stream-chat-react-native-core 5.5.1-beta.1 → 5.6.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Attachment/Attachment.js +1 -1
- package/lib/commonjs/components/Attachment/AttachmentActions.js +1 -1
- package/lib/commonjs/components/Attachment/AudioAttachment.js +1 -1
- package/lib/commonjs/components/Attachment/Card.js +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +1 -1
- package/lib/commonjs/components/Attachment/GalleryImage.js +20 -4
- package/lib/commonjs/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js +1 -1
- package/lib/commonjs/components/Attachment/VideoThumbnail.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +1 -1
- package/lib/commonjs/components/Channel/Channel.js +537 -155
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +6 -0
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +5 -16
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +1 -1
- package/lib/commonjs/components/ChannelList/Skeleton.js +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +112 -42
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
- package/lib/commonjs/components/Chat/Chat.js +17 -21
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +2 -4
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/ImageBackground.js +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +1 -1
- package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDot.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDots.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/commonjs/components/Message/Message.js +22 -11
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +15 -13
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +9 -30
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActions.js +20 -18
- package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/commonjs/components/MessageInput/AttachButton.js +1 -1
- package/lib/commonjs/components/MessageInput/CommandsButton.js +1 -1
- package/lib/commonjs/components/MessageInput/CooldownTimer.js +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +32 -22
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +52 -20
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +40 -28
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +2 -2
- package/lib/commonjs/components/MessageInput/SendButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
- package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputEditingStateHeader.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputGiphySearch.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputReplyStateHeader.js +1 -1
- package/lib/commonjs/components/MessageList/DateHeader.js +1 -1
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +1 -1
- package/lib/commonjs/components/MessageList/MessageSystem.js +1 -1
- package/lib/commonjs/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
- package/lib/commonjs/components/ProgressControl/ProgressControl.js +1 -1
- package/lib/commonjs/components/RTLComponents/WritingDirectionAwareText.js +1 -1
- package/lib/commonjs/components/Reply/Reply.js +1 -1
- package/lib/commonjs/components/Spinner/Spinner.js +1 -1
- package/lib/commonjs/components/Thread/Thread.js +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +1 -1
- package/lib/commonjs/components/index.js +0 -13
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +3 -3
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/debugContext/DebugContext.js +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +23 -14
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +3 -3
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +1 -1
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +1 -1
- package/lib/commonjs/contexts/themeContext/ThemeContext.js +1 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.js +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/commonjs/contexts/typingContext/TypingContext.js +1 -1
- package/lib/commonjs/hooks/useTranslatedMessage.js +1 -1
- package/lib/commonjs/hooks/useTranslatedMessage.js.map +1 -1
- package/lib/commonjs/icons/ArrowRight.js +1 -1
- package/lib/commonjs/icons/AtMentions.js +1 -1
- package/lib/commonjs/icons/Attach.js +1 -1
- package/lib/commonjs/icons/Audio.js +1 -1
- package/lib/commonjs/icons/CSV.js +1 -1
- package/lib/commonjs/icons/Camera.js +1 -1
- package/lib/commonjs/icons/Check.js +1 -1
- package/lib/commonjs/icons/CheckAll.js +1 -1
- package/lib/commonjs/icons/CheckSend.js +1 -1
- package/lib/commonjs/icons/CircleClose.js +1 -1
- package/lib/commonjs/icons/CirclePlus.js +1 -1
- package/lib/commonjs/icons/CircleRight.js +1 -1
- package/lib/commonjs/icons/Close.js +1 -1
- package/lib/commonjs/icons/Copy.js +1 -1
- package/lib/commonjs/icons/CurveLineLeftUp.js +1 -1
- package/lib/commonjs/icons/DOC.js +1 -1
- package/lib/commonjs/icons/DOCX.js +1 -1
- package/lib/commonjs/icons/Delete.js +1 -1
- package/lib/commonjs/icons/Down.js +1 -1
- package/lib/commonjs/icons/DownloadArrow.js +1 -1
- package/lib/commonjs/icons/DownloadCloud.js +1 -1
- package/lib/commonjs/icons/Edit.js +1 -1
- package/lib/commonjs/icons/Error.js +1 -1
- package/lib/commonjs/icons/Eye.js +1 -1
- package/lib/commonjs/icons/Flag.js +1 -1
- package/lib/commonjs/icons/Folder.js +1 -1
- package/lib/commonjs/icons/GenericFile.js +1 -1
- package/lib/commonjs/icons/GiphyIcon.js +1 -1
- package/lib/commonjs/icons/Grid.js +1 -1
- package/lib/commonjs/icons/Group.js +1 -1
- package/lib/commonjs/icons/HTML.js +1 -1
- package/lib/commonjs/icons/Imgur.js +1 -1
- package/lib/commonjs/icons/LOLReaction.js +1 -1
- package/lib/commonjs/icons/Lightning.js +1 -1
- package/lib/commonjs/icons/Link.js +1 -1
- package/lib/commonjs/icons/Loading.js +1 -1
- package/lib/commonjs/icons/Logo.js +1 -1
- package/lib/commonjs/icons/LoveReaction.js +1 -1
- package/lib/commonjs/icons/MD.js +1 -1
- package/lib/commonjs/icons/MailOpen.js +1 -1
- package/lib/commonjs/icons/MenuPointHorizontal.js +1 -1
- package/lib/commonjs/icons/MenuPointVertical.js +1 -1
- package/lib/commonjs/icons/MessageFlag.js +1 -1
- package/lib/commonjs/icons/MessageIcon.js +1 -1
- package/lib/commonjs/icons/Mute.js +1 -1
- package/lib/commonjs/icons/Notification.js +1 -1
- package/lib/commonjs/icons/ODT.js +1 -1
- package/lib/commonjs/icons/PDF.js +1 -1
- package/lib/commonjs/icons/PPT.js +1 -1
- package/lib/commonjs/icons/PPTX.js +1 -1
- package/lib/commonjs/icons/Pause.js +1 -1
- package/lib/commonjs/icons/Picture.js +1 -1
- package/lib/commonjs/icons/Pin.js +1 -1
- package/lib/commonjs/icons/PinHeader.js +1 -1
- package/lib/commonjs/icons/Play.js +1 -1
- package/lib/commonjs/icons/RAR.js +1 -1
- package/lib/commonjs/icons/RTF.js +1 -1
- package/lib/commonjs/icons/Recorder.js +1 -1
- package/lib/commonjs/icons/Refresh.js +1 -1
- package/lib/commonjs/icons/SEVEN_Z.js +1 -1
- package/lib/commonjs/icons/Search.js +1 -1
- package/lib/commonjs/icons/SendRight.js +1 -1
- package/lib/commonjs/icons/SendUp.js +1 -1
- package/lib/commonjs/icons/Share.js +1 -1
- package/lib/commonjs/icons/ShareRightArrow.js +1 -1
- package/lib/commonjs/icons/Smile.js +1 -1
- package/lib/commonjs/icons/Sound.js +1 -1
- package/lib/commonjs/icons/TAR.js +1 -1
- package/lib/commonjs/icons/TXT.js +1 -1
- package/lib/commonjs/icons/ThreadReply.js +1 -1
- package/lib/commonjs/icons/ThumbsDownReaction.js +1 -1
- package/lib/commonjs/icons/ThumbsUpReaction.js +1 -1
- package/lib/commonjs/icons/Time.js +1 -1
- package/lib/commonjs/icons/Unknown.js +1 -1
- package/lib/commonjs/icons/Unpin.js +1 -1
- package/lib/commonjs/icons/User.js +1 -1
- package/lib/commonjs/icons/UserAdd.js +1 -1
- package/lib/commonjs/icons/UserAdmin.js +1 -1
- package/lib/commonjs/icons/UserDelete.js +1 -1
- package/lib/commonjs/icons/UserMinus.js +1 -1
- package/lib/commonjs/icons/Video.js +1 -1
- package/lib/commonjs/icons/Warning.js +1 -1
- package/lib/commonjs/icons/WutReaction.js +1 -1
- package/lib/commonjs/icons/XLS.js +1 -1
- package/lib/commonjs/icons/XLSX.js +1 -1
- package/lib/commonjs/icons/ZIP.js +1 -1
- package/lib/commonjs/icons/utils/base.js +1 -1
- package/lib/commonjs/mock-builders/DB/mock.js +2 -2
- package/lib/commonjs/mock-builders/DB/mock.js.map +1 -1
- package/lib/commonjs/mock-builders/api/deleteMessage.js +20 -0
- package/lib/commonjs/mock-builders/api/deleteMessage.js.map +1 -0
- package/lib/commonjs/mock-builders/api/deleteReaction.js +21 -0
- package/lib/commonjs/mock-builders/api/deleteReaction.js.map +1 -0
- package/lib/commonjs/mock-builders/api/sendReaction.js +21 -0
- package/lib/commonjs/mock-builders/api/sendReaction.js.map +1 -0
- package/lib/commonjs/mock-builders/event/connectionChanged.js +2 -0
- package/lib/commonjs/mock-builders/event/connectionChanged.js.map +1 -1
- package/lib/commonjs/store/QuickSqliteClient.js +40 -51
- package/lib/commonjs/store/QuickSqliteClient.js.map +1 -1
- package/lib/commonjs/store/apis/addPendingTask.js +37 -0
- package/lib/commonjs/store/apis/addPendingTask.js.map +1 -0
- package/lib/commonjs/store/apis/deleteMessage.js +26 -0
- package/lib/commonjs/store/apis/deleteMessage.js.map +1 -0
- package/lib/commonjs/store/apis/deletePendingTask.js +22 -0
- package/lib/commonjs/store/apis/deletePendingTask.js.map +1 -0
- package/lib/commonjs/store/apis/deleteReaction.js +30 -0
- package/lib/commonjs/store/apis/deleteReaction.js.map +1 -0
- package/lib/commonjs/store/apis/getChannelMessages.js +3 -3
- package/lib/commonjs/store/apis/getChannelMessages.js.map +1 -1
- package/lib/commonjs/store/apis/getChannels.js +1 -1
- package/lib/commonjs/store/apis/getChannels.js.map +1 -1
- package/lib/commonjs/store/apis/getPendingTasks.js +26 -0
- package/lib/commonjs/store/apis/getPendingTasks.js.map +1 -0
- package/lib/commonjs/store/apis/index.js +13 -0
- package/lib/commonjs/store/apis/index.js.map +1 -1
- package/lib/commonjs/store/apis/insertReaction.js +28 -0
- package/lib/commonjs/store/apis/insertReaction.js.map +1 -0
- package/lib/commonjs/store/apis/updateMessage.js.map +1 -1
- package/lib/commonjs/store/apis/updateReaction.js.map +1 -1
- package/lib/commonjs/store/mappers/mapDateTimeToStorable.js.map +1 -1
- package/lib/commonjs/store/mappers/mapMessageToStorable.js +3 -1
- package/lib/commonjs/store/mappers/mapMessageToStorable.js.map +1 -1
- package/lib/commonjs/store/mappers/mapStorableToTask.js +23 -0
- package/lib/commonjs/store/mappers/mapStorableToTask.js.map +1 -0
- package/lib/commonjs/store/mappers/mapTaskToStorable.js +18 -0
- package/lib/commonjs/store/mappers/mapTaskToStorable.js.map +1 -0
- package/lib/commonjs/store/schema.js +11 -0
- package/lib/commonjs/store/schema.js.map +1 -1
- package/lib/commonjs/store/sqlite-utils/appendOrderByClause.js +24 -0
- package/lib/commonjs/store/sqlite-utils/appendOrderByClause.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js +1 -1
- package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js.map +1 -1
- package/lib/commonjs/store/sqlite-utils/createSelectQuery.js +8 -1
- package/lib/commonjs/store/sqlite-utils/createSelectQuery.js.map +1 -1
- package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js +2 -2
- package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js.map +1 -1
- package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js +1 -1
- package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js.map +1 -1
- package/lib/commonjs/utils/DBSyncManager.js +436 -0
- package/lib/commonjs/utils/DBSyncManager.js.map +1 -0
- package/lib/commonjs/utils/addReactionToLocalState.js +92 -0
- package/lib/commonjs/utils/addReactionToLocalState.js.map +1 -0
- package/lib/commonjs/utils/pendingTaskUtils.js +302 -0
- package/lib/commonjs/utils/pendingTaskUtils.js.map +1 -0
- package/lib/commonjs/utils/removeReactionFromLocalState.js +39 -0
- package/lib/commonjs/utils/removeReactionFromLocalState.js.map +1 -0
- package/lib/commonjs/utils/utils.js +9 -3
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +1 -1
- package/lib/module/components/Attachment/AttachmentActions.js +1 -1
- package/lib/module/components/Attachment/AudioAttachment.js +1 -1
- package/lib/module/components/Attachment/Card.js +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +1 -1
- package/lib/module/components/Attachment/FileIcon.js +1 -1
- package/lib/module/components/Attachment/Gallery.js +1 -1
- package/lib/module/components/Attachment/GalleryImage.js +20 -4
- package/lib/module/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +1 -1
- package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js +1 -1
- package/lib/module/components/Attachment/ImageLoadingIndicator.js +1 -1
- package/lib/module/components/Attachment/VideoThumbnail.js +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
- package/lib/module/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
- package/lib/module/components/Avatar/Avatar.js +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +1 -1
- package/lib/module/components/Channel/Channel.js +537 -155
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +6 -0
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +5 -16
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +1 -1
- package/lib/module/components/ChannelList/Skeleton.js +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +112 -42
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
- package/lib/module/components/Chat/Chat.js +17 -21
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +2 -4
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/ImageBackground.js +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js +1 -1
- package/lib/module/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingDot.js +1 -1
- package/lib/module/components/Indicators/LoadingDots.js +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/module/components/Message/Message.js +22 -11
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +15 -13
- package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageReplies.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +1 -1
- package/lib/module/components/Message/MessageSimple/ReactionList.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.test.js +1 -1
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js +9 -30
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActions.js +20 -18
- package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/module/components/MessageInput/AttachButton.js +1 -1
- package/lib/module/components/MessageInput/CommandsButton.js +1 -1
- package/lib/module/components/MessageInput/CooldownTimer.js +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +32 -22
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +52 -20
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +40 -28
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/module/components/MessageInput/SendButton.js +2 -2
- package/lib/module/components/MessageInput/SendButton.js.map +1 -1
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
- package/lib/module/components/MessageInput/UploadProgressIndicator.js +1 -1
- package/lib/module/components/MessageInput/components/InputEditingStateHeader.js +1 -1
- package/lib/module/components/MessageInput/components/InputGiphySearch.js +1 -1
- package/lib/module/components/MessageInput/components/InputReplyStateHeader.js +1 -1
- package/lib/module/components/MessageList/DateHeader.js +1 -1
- package/lib/module/components/MessageList/InlineDateSeparator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/module/components/MessageList/MessageList.js +1 -1
- package/lib/module/components/MessageList/MessageSystem.js +1 -1
- package/lib/module/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/module/components/MessageList/ScrollToBottomButton.js +1 -1
- package/lib/module/components/MessageList/TypingIndicator.js +1 -1
- package/lib/module/components/MessageList/TypingIndicatorContainer.js +1 -1
- package/lib/module/components/MessageOverlay/MessageActionList.js +1 -1
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionList.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
- package/lib/module/components/ProgressControl/ProgressControl.js +1 -1
- package/lib/module/components/RTLComponents/WritingDirectionAwareText.js +1 -1
- package/lib/module/components/Reply/Reply.js +1 -1
- package/lib/module/components/Spinner/Spinner.js +1 -1
- package/lib/module/components/Thread/Thread.js +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +1 -1
- package/lib/module/components/index.js +0 -13
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +3 -3
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/debugContext/DebugContext.js +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
- package/lib/module/contexts/keyboardContext/KeyboardContext.js +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +23 -14
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js +3 -3
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +1 -1
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +1 -1
- package/lib/module/contexts/themeContext/ThemeContext.js +1 -1
- package/lib/module/contexts/threadContext/ThreadContext.js +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/module/contexts/typingContext/TypingContext.js +1 -1
- package/lib/module/hooks/useTranslatedMessage.js +1 -1
- package/lib/module/hooks/useTranslatedMessage.js.map +1 -1
- package/lib/module/icons/ArrowRight.js +1 -1
- package/lib/module/icons/AtMentions.js +1 -1
- package/lib/module/icons/Attach.js +1 -1
- package/lib/module/icons/Audio.js +1 -1
- package/lib/module/icons/CSV.js +1 -1
- package/lib/module/icons/Camera.js +1 -1
- package/lib/module/icons/Check.js +1 -1
- package/lib/module/icons/CheckAll.js +1 -1
- package/lib/module/icons/CheckSend.js +1 -1
- package/lib/module/icons/CircleClose.js +1 -1
- package/lib/module/icons/CirclePlus.js +1 -1
- package/lib/module/icons/CircleRight.js +1 -1
- package/lib/module/icons/Close.js +1 -1
- package/lib/module/icons/Copy.js +1 -1
- package/lib/module/icons/CurveLineLeftUp.js +1 -1
- package/lib/module/icons/DOC.js +1 -1
- package/lib/module/icons/DOCX.js +1 -1
- package/lib/module/icons/Delete.js +1 -1
- package/lib/module/icons/Down.js +1 -1
- package/lib/module/icons/DownloadArrow.js +1 -1
- package/lib/module/icons/DownloadCloud.js +1 -1
- package/lib/module/icons/Edit.js +1 -1
- package/lib/module/icons/Error.js +1 -1
- package/lib/module/icons/Eye.js +1 -1
- package/lib/module/icons/Flag.js +1 -1
- package/lib/module/icons/Folder.js +1 -1
- package/lib/module/icons/GenericFile.js +1 -1
- package/lib/module/icons/GiphyIcon.js +1 -1
- package/lib/module/icons/Grid.js +1 -1
- package/lib/module/icons/Group.js +1 -1
- package/lib/module/icons/HTML.js +1 -1
- package/lib/module/icons/Imgur.js +1 -1
- package/lib/module/icons/LOLReaction.js +1 -1
- package/lib/module/icons/Lightning.js +1 -1
- package/lib/module/icons/Link.js +1 -1
- package/lib/module/icons/Loading.js +1 -1
- package/lib/module/icons/Logo.js +1 -1
- package/lib/module/icons/LoveReaction.js +1 -1
- package/lib/module/icons/MD.js +1 -1
- package/lib/module/icons/MailOpen.js +1 -1
- package/lib/module/icons/MenuPointHorizontal.js +1 -1
- package/lib/module/icons/MenuPointVertical.js +1 -1
- package/lib/module/icons/MessageFlag.js +1 -1
- package/lib/module/icons/MessageIcon.js +1 -1
- package/lib/module/icons/Mute.js +1 -1
- package/lib/module/icons/Notification.js +1 -1
- package/lib/module/icons/ODT.js +1 -1
- package/lib/module/icons/PDF.js +1 -1
- package/lib/module/icons/PPT.js +1 -1
- package/lib/module/icons/PPTX.js +1 -1
- package/lib/module/icons/Pause.js +1 -1
- package/lib/module/icons/Picture.js +1 -1
- package/lib/module/icons/Pin.js +1 -1
- package/lib/module/icons/PinHeader.js +1 -1
- package/lib/module/icons/Play.js +1 -1
- package/lib/module/icons/RAR.js +1 -1
- package/lib/module/icons/RTF.js +1 -1
- package/lib/module/icons/Recorder.js +1 -1
- package/lib/module/icons/Refresh.js +1 -1
- package/lib/module/icons/SEVEN_Z.js +1 -1
- package/lib/module/icons/Search.js +1 -1
- package/lib/module/icons/SendRight.js +1 -1
- package/lib/module/icons/SendUp.js +1 -1
- package/lib/module/icons/Share.js +1 -1
- package/lib/module/icons/ShareRightArrow.js +1 -1
- package/lib/module/icons/Smile.js +1 -1
- package/lib/module/icons/Sound.js +1 -1
- package/lib/module/icons/TAR.js +1 -1
- package/lib/module/icons/TXT.js +1 -1
- package/lib/module/icons/ThreadReply.js +1 -1
- package/lib/module/icons/ThumbsDownReaction.js +1 -1
- package/lib/module/icons/ThumbsUpReaction.js +1 -1
- package/lib/module/icons/Time.js +1 -1
- package/lib/module/icons/Unknown.js +1 -1
- package/lib/module/icons/Unpin.js +1 -1
- package/lib/module/icons/User.js +1 -1
- package/lib/module/icons/UserAdd.js +1 -1
- package/lib/module/icons/UserAdmin.js +1 -1
- package/lib/module/icons/UserDelete.js +1 -1
- package/lib/module/icons/UserMinus.js +1 -1
- package/lib/module/icons/Video.js +1 -1
- package/lib/module/icons/Warning.js +1 -1
- package/lib/module/icons/WutReaction.js +1 -1
- package/lib/module/icons/XLS.js +1 -1
- package/lib/module/icons/XLSX.js +1 -1
- package/lib/module/icons/ZIP.js +1 -1
- package/lib/module/icons/utils/base.js +1 -1
- package/lib/module/mock-builders/DB/mock.js +2 -2
- package/lib/module/mock-builders/DB/mock.js.map +1 -1
- package/lib/module/mock-builders/api/deleteMessage.js +20 -0
- package/lib/module/mock-builders/api/deleteMessage.js.map +1 -0
- package/lib/module/mock-builders/api/deleteReaction.js +21 -0
- package/lib/module/mock-builders/api/deleteReaction.js.map +1 -0
- package/lib/module/mock-builders/api/sendReaction.js +21 -0
- package/lib/module/mock-builders/api/sendReaction.js.map +1 -0
- package/lib/module/mock-builders/event/connectionChanged.js +2 -0
- package/lib/module/mock-builders/event/connectionChanged.js.map +1 -1
- package/lib/module/store/QuickSqliteClient.js +40 -51
- package/lib/module/store/QuickSqliteClient.js.map +1 -1
- package/lib/module/store/apis/addPendingTask.js +37 -0
- package/lib/module/store/apis/addPendingTask.js.map +1 -0
- package/lib/module/store/apis/deleteMessage.js +26 -0
- package/lib/module/store/apis/deleteMessage.js.map +1 -0
- package/lib/module/store/apis/deletePendingTask.js +22 -0
- package/lib/module/store/apis/deletePendingTask.js.map +1 -0
- package/lib/module/store/apis/deleteReaction.js +30 -0
- package/lib/module/store/apis/deleteReaction.js.map +1 -0
- package/lib/module/store/apis/getChannelMessages.js +3 -3
- package/lib/module/store/apis/getChannelMessages.js.map +1 -1
- package/lib/module/store/apis/getChannels.js +1 -1
- package/lib/module/store/apis/getChannels.js.map +1 -1
- package/lib/module/store/apis/getPendingTasks.js +26 -0
- package/lib/module/store/apis/getPendingTasks.js.map +1 -0
- package/lib/module/store/apis/index.js +13 -0
- package/lib/module/store/apis/index.js.map +1 -1
- package/lib/module/store/apis/insertReaction.js +28 -0
- package/lib/module/store/apis/insertReaction.js.map +1 -0
- package/lib/module/store/apis/updateMessage.js.map +1 -1
- package/lib/module/store/apis/updateReaction.js.map +1 -1
- package/lib/module/store/mappers/mapDateTimeToStorable.js.map +1 -1
- package/lib/module/store/mappers/mapMessageToStorable.js +3 -1
- package/lib/module/store/mappers/mapMessageToStorable.js.map +1 -1
- package/lib/module/store/mappers/mapStorableToTask.js +23 -0
- package/lib/module/store/mappers/mapStorableToTask.js.map +1 -0
- package/lib/module/store/mappers/mapTaskToStorable.js +18 -0
- package/lib/module/store/mappers/mapTaskToStorable.js.map +1 -0
- package/lib/module/store/schema.js +11 -0
- package/lib/module/store/schema.js.map +1 -1
- package/lib/module/store/sqlite-utils/appendOrderByClause.js +24 -0
- package/lib/module/store/sqlite-utils/appendOrderByClause.js.map +1 -0
- package/lib/module/store/sqlite-utils/createCreateTableQuery.js +1 -1
- package/lib/module/store/sqlite-utils/createCreateTableQuery.js.map +1 -1
- package/lib/module/store/sqlite-utils/createSelectQuery.js +8 -1
- package/lib/module/store/sqlite-utils/createSelectQuery.js.map +1 -1
- package/lib/module/store/sqlite-utils/createUpdateQuery.js +2 -2
- package/lib/module/store/sqlite-utils/createUpdateQuery.js.map +1 -1
- package/lib/module/store/sqlite-utils/createUpsertQuery.js +1 -1
- package/lib/module/store/sqlite-utils/createUpsertQuery.js.map +1 -1
- package/lib/module/utils/DBSyncManager.js +436 -0
- package/lib/module/utils/DBSyncManager.js.map +1 -0
- package/lib/module/utils/addReactionToLocalState.js +92 -0
- package/lib/module/utils/addReactionToLocalState.js.map +1 -0
- package/lib/module/utils/pendingTaskUtils.js +302 -0
- package/lib/module/utils/pendingTaskUtils.js.map +1 -0
- package/lib/module/utils/removeReactionFromLocalState.js +39 -0
- package/lib/module/utils/removeReactionFromLocalState.js.map +1 -0
- package/lib/module/utils/utils.js +9 -3
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +2 -1
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +2 -1
- package/lib/typescript/components/MessageInput/ImageUploadPreview.d.ts +2 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +2 -1
- package/lib/typescript/components/index.d.ts +0 -1
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +1 -2
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +3 -0
- package/lib/typescript/store/apis/addPendingTask.d.ts +2 -0
- package/lib/typescript/store/apis/deleteMessage.d.ts +4 -0
- package/lib/typescript/store/apis/deletePendingTask.d.ts +3 -0
- package/lib/typescript/store/apis/deleteReaction.d.ts +6 -0
- package/lib/typescript/store/apis/getChannelMessages.d.ts +1 -1
- package/lib/typescript/store/apis/getPendingTasks.d.ts +3 -0
- package/lib/typescript/store/apis/index.d.ts +1 -0
- package/lib/typescript/store/apis/insertReaction.d.ts +6 -0
- package/lib/typescript/store/apis/updateMessage.d.ts +2 -2
- package/lib/typescript/store/apis/updateReaction.d.ts +2 -2
- package/lib/typescript/store/mappers/mapDateTimeToStorable.d.ts +1 -1
- package/lib/typescript/store/mappers/mapMessageToStorable.d.ts +2 -2
- package/lib/typescript/store/mappers/mapStorableToTask.d.ts +2 -0
- package/lib/typescript/store/mappers/mapTaskToStorable.d.ts +34 -0
- package/lib/typescript/store/schema.d.ts +12 -1
- package/lib/typescript/store/sqlite-utils/appendOrderByClause.d.ts +3 -0
- package/lib/typescript/store/sqlite-utils/createSelectQuery.d.ts +1 -1
- package/lib/typescript/store/types.d.ts +25 -0
- package/lib/typescript/types/types.d.ts +3 -1
- package/lib/typescript/utils/DBSyncManager.d.ts +47 -0
- package/lib/typescript/utils/addReactionToLocalState.d.ts +9 -0
- package/lib/typescript/utils/pendingTaskUtils.d.ts +13 -0
- package/lib/typescript/utils/removeReactionFromLocalState.d.ts +8 -0
- package/lib/typescript/utils/utils.d.ts +3 -3
- package/package.json +2 -2
- package/src/__tests__/offline-feature.test.js +19 -2
- package/src/__tests__/optimistic-update.test.js +368 -0
- package/src/components/Attachment/GalleryImage.tsx +14 -2
- package/src/components/Channel/Channel.tsx +270 -62
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +6 -0
- package/src/components/ChannelList/ChannelList.tsx +2 -10
- package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +0 -1
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +75 -27
- package/src/components/Chat/Chat.tsx +5 -9
- package/src/components/Chat/__tests__/Chat.test.js +1 -1
- package/src/components/Chat/hooks/useCreateChatContext.ts +0 -2
- package/src/components/Message/Message.tsx +18 -2
- package/src/components/Message/MessageSimple/MessageFooter.tsx +2 -1
- package/src/components/Message/hooks/useMessageActionHandlers.ts +10 -21
- package/src/components/Message/hooks/useMessageActions.tsx +9 -4
- package/src/components/MessageInput/FileUploadPreview.tsx +8 -2
- package/src/components/MessageInput/ImageUploadPreview.tsx +37 -8
- package/src/components/MessageInput/MessageInput.tsx +17 -3
- package/src/components/MessageInput/SendButton.tsx +1 -1
- package/src/components/index.ts +0 -1
- package/src/contexts/chatContext/ChatContext.tsx +1 -2
- package/src/contexts/messageInputContext/MessageInputContext.tsx +29 -10
- package/src/contexts/messageInputContext/__tests__/__snapshots__/sendMessage.test.tsx.snap +29 -0
- package/src/contexts/messagesContext/MessagesContext.tsx +4 -1
- package/src/hooks/useTranslatedMessage.ts +1 -1
- package/src/mock-builders/DB/mock.ts +2 -2
- package/src/mock-builders/api/deleteMessage.js +18 -0
- package/src/mock-builders/api/deleteReaction.js +19 -0
- package/src/mock-builders/api/sendReaction.tsx +19 -0
- package/src/mock-builders/event/connectionChanged.js +2 -1
- package/src/store/QuickSqliteClient.ts +39 -37
- package/src/store/apis/addPendingTask.ts +24 -0
- package/src/store/apis/deleteMessage.ts +13 -0
- package/src/store/apis/deletePendingTask.ts +12 -0
- package/src/store/apis/deleteReaction.ts +26 -0
- package/src/store/apis/getChannelMessages.ts +1 -1
- package/src/store/apis/getChannels.ts +2 -2
- package/src/store/apis/getPendingTasks.ts +13 -0
- package/src/store/apis/index.ts +1 -0
- package/src/store/apis/insertReaction.ts +29 -0
- package/src/store/apis/updateMessage.ts +2 -2
- package/src/store/apis/updateReaction.ts +2 -2
- package/src/store/mappers/mapDateTimeToStorable.ts +1 -1
- package/src/store/mappers/mapMessageToStorable.ts +8 -2
- package/src/store/mappers/mapStorableToTask.ts +13 -0
- package/src/store/mappers/mapTaskToStorable.ts +7 -0
- package/src/store/schema.ts +25 -1
- package/src/store/sqlite-utils/appendOrderByClause.ts +24 -0
- package/src/store/sqlite-utils/createCreateTableQuery.ts +2 -2
- package/src/store/sqlite-utils/createSelectQuery.ts +4 -1
- package/src/store/sqlite-utils/createUpdateQuery.ts +3 -2
- package/src/store/sqlite-utils/createUpsertQuery.ts +1 -1
- package/src/store/types.ts +33 -0
- package/src/types/types.ts +4 -1
- package/src/utils/DBSyncManager.ts +222 -0
- package/src/utils/addReactionToLocalState.ts +87 -0
- package/src/utils/pendingTaskUtils.ts +131 -0
- package/src/utils/removeReactionFromLocalState.ts +39 -0
- package/src/utils/utils.ts +12 -4
- package/src/version.json +1 -1
- package/lib/commonjs/components/Chat/hooks/useConnectionRecovered.js +0 -171
- package/lib/commonjs/components/Chat/hooks/useConnectionRecovered.js.map +0 -1
- package/lib/module/components/Chat/hooks/useConnectionRecovered.js +0 -171
- package/lib/module/components/Chat/hooks/useConnectionRecovered.js.map +0 -1
- package/lib/typescript/components/Chat/hooks/useConnectionRecovered.d.ts +0 -10
- package/src/components/Chat/hooks/useConnectionRecovered.ts +0 -92
|
@@ -2,13 +2,13 @@ import { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import type { Channel, ChannelFilters, ChannelOptions, ChannelSort } from 'stream-chat';
|
|
4
4
|
|
|
5
|
-
import { useActiveChannelsRefContext } from '../../../contexts/activeChannelsRefContext/ActiveChannelsRefContext';
|
|
6
5
|
import { useChatContext } from '../../../contexts/chatContext/ChatContext';
|
|
7
6
|
import { useIsMountedRef } from '../../../hooks/useIsMountedRef';
|
|
8
7
|
|
|
9
8
|
import { getChannelsForFilterSort } from '../../../store/apis/getChannelsForFilterSort';
|
|
10
9
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
11
10
|
import { ONE_SECOND_IN_MS } from '../../../utils/date';
|
|
11
|
+
import { DBSyncManager } from '../../../utils/DBSyncManager';
|
|
12
12
|
import { MAX_QUERY_CHANNELS_LIMIT } from '../utils';
|
|
13
13
|
|
|
14
14
|
const waitSeconds = (seconds: number) =>
|
|
@@ -21,6 +21,7 @@ type Parameters<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultSt
|
|
|
21
21
|
enableOfflineSupport: boolean;
|
|
22
22
|
filters: ChannelFilters<StreamChatGenerics>;
|
|
23
23
|
options: ChannelOptions;
|
|
24
|
+
setForceUpdate: React.Dispatch<React.SetStateAction<number>>;
|
|
24
25
|
sort: ChannelSort<StreamChatGenerics>;
|
|
25
26
|
};
|
|
26
27
|
|
|
@@ -41,12 +42,12 @@ export const usePaginatedChannels = <
|
|
|
41
42
|
enableOfflineSupport,
|
|
42
43
|
filters = {},
|
|
43
44
|
options = DEFAULT_OPTIONS,
|
|
45
|
+
setForceUpdate,
|
|
44
46
|
sort = {},
|
|
45
47
|
}: Parameters<StreamChatGenerics>) => {
|
|
46
48
|
const { client } = useChatContext<StreamChatGenerics>();
|
|
47
49
|
const [channels, setChannels] = useState<Channel<StreamChatGenerics>[] | null>(null);
|
|
48
50
|
const [staticChannelsActive, setStaticChannelsActive] = useState<boolean>(false);
|
|
49
|
-
const activeChannels = useActiveChannelsRefContext();
|
|
50
51
|
|
|
51
52
|
const [error, setError] = useState<Error>();
|
|
52
53
|
const [hasNextPage, setHasNextPage] = useState(true);
|
|
@@ -98,17 +99,33 @@ export const usePaginatedChannels = <
|
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
try {
|
|
102
|
+
const activeChannelIds = [];
|
|
103
|
+
for (const cid in client.activeChannels) {
|
|
104
|
+
if (client.activeChannels[cid].id) {
|
|
105
|
+
activeChannelIds.push(client.activeChannels[cid].id);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// TODO: Think about the implications of this.
|
|
101
110
|
const channelQueryResponse = await client.queryChannels(filters, sort, newOptions, {
|
|
102
|
-
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
skipInitialization: activeChannelIds,
|
|
103
113
|
});
|
|
104
|
-
|
|
105
114
|
if (isQueryStale() || !isMountedRef.current) {
|
|
106
115
|
return;
|
|
107
116
|
}
|
|
117
|
+
|
|
108
118
|
const newChannels =
|
|
109
119
|
queryType === 'loadChannels' && !staticChannelsActive && channels
|
|
110
120
|
? [...channels, ...channelQueryResponse]
|
|
111
|
-
: channelQueryResponse
|
|
121
|
+
: channelQueryResponse.map((c) => {
|
|
122
|
+
const existingChannel = client.activeChannels[c.cid];
|
|
123
|
+
if (existingChannel) {
|
|
124
|
+
return existingChannel;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return c;
|
|
128
|
+
});
|
|
112
129
|
|
|
113
130
|
setChannels(newChannels);
|
|
114
131
|
setStaticChannelsActive(false);
|
|
@@ -177,33 +194,62 @@ export const usePaginatedChannels = <
|
|
|
177
194
|
const sortStr = useMemo(() => JSON.stringify(sort), [sort]);
|
|
178
195
|
|
|
179
196
|
useEffect(() => {
|
|
180
|
-
const
|
|
197
|
+
const loadOfflineChannels = () => {
|
|
181
198
|
if (!client?.user?.id) return;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
} catch (e) {
|
|
199
|
-
console.warn('Failed to get channels from database: ', e);
|
|
199
|
+
|
|
200
|
+
try {
|
|
201
|
+
const channelsFromDB = getChannelsForFilterSort({
|
|
202
|
+
currentUserId: client.user.id,
|
|
203
|
+
filters,
|
|
204
|
+
sort,
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
if (channelsFromDB) {
|
|
208
|
+
setChannels(
|
|
209
|
+
client.hydrateActiveChannels(channelsFromDB, {
|
|
210
|
+
offlineMode: true,
|
|
211
|
+
}),
|
|
212
|
+
);
|
|
213
|
+
setStaticChannelsActive(true);
|
|
200
214
|
}
|
|
215
|
+
} catch (e) {
|
|
216
|
+
console.warn('Failed to get channels from database: ', e);
|
|
201
217
|
}
|
|
202
218
|
|
|
203
|
-
|
|
219
|
+
setActiveQueryType(null);
|
|
204
220
|
};
|
|
205
221
|
|
|
206
|
-
|
|
222
|
+
let listener: ReturnType<typeof DBSyncManager.onSyncStatusChange>;
|
|
223
|
+
if (enableOfflineSupport) {
|
|
224
|
+
// Any time DB is synced, we need to update the UI with local DB channels first,
|
|
225
|
+
// and then call queryChannels to ensure any new channels are added to UI.
|
|
226
|
+
listener = DBSyncManager.onSyncStatusChange((syncStatus) => {
|
|
227
|
+
if (syncStatus) {
|
|
228
|
+
loadOfflineChannels();
|
|
229
|
+
reloadList();
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
// On start, load the channels from local db.
|
|
233
|
+
loadOfflineChannels();
|
|
234
|
+
|
|
235
|
+
// If db is already synced (sync api and pending api calls), then
|
|
236
|
+
// right away call queryChannels.
|
|
237
|
+
const dbSyncStatus = DBSyncManager.getSyncStatus();
|
|
238
|
+
if (dbSyncStatus) {
|
|
239
|
+
reloadList();
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
listener = client.on('connection.changed', async (event) => {
|
|
243
|
+
if (event.online) {
|
|
244
|
+
await refreshList();
|
|
245
|
+
setForceUpdate((u) => u + 1);
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
reloadList();
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return () => listener?.unsubscribe?.();
|
|
207
253
|
}, [filterStr, sortStr]);
|
|
208
254
|
|
|
209
255
|
return {
|
|
@@ -211,7 +257,9 @@ export const usePaginatedChannels = <
|
|
|
211
257
|
error,
|
|
212
258
|
hasNextPage,
|
|
213
259
|
loadingChannels:
|
|
214
|
-
activeQueryType === 'queryLocalDB'
|
|
260
|
+
activeQueryType === 'queryLocalDB'
|
|
261
|
+
? true
|
|
262
|
+
: (activeQueryType === 'reload' || activeQueryType === null) && channels === null,
|
|
215
263
|
loadingNextPage: activeQueryType === 'loadChannels',
|
|
216
264
|
loadNextPage,
|
|
217
265
|
refreshing: activeQueryType === 'refresh',
|
|
@@ -3,10 +3,9 @@ import { Image, Platform } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import Dayjs from 'dayjs';
|
|
5
5
|
|
|
6
|
-
import type { Channel } from 'stream-chat';
|
|
6
|
+
import type { Channel, StreamChat } from 'stream-chat';
|
|
7
7
|
|
|
8
8
|
import { useAppSettings } from './hooks/useAppSettings';
|
|
9
|
-
import { useConnectionRecovered } from './hooks/useConnectionRecovered';
|
|
10
9
|
import { useCreateChatContext } from './hooks/useCreateChatContext';
|
|
11
10
|
import { useIsOnline } from './hooks/useIsOnline';
|
|
12
11
|
import { useMutedUsers } from './hooks/useMutedUsers';
|
|
@@ -30,6 +29,7 @@ import init from '../../init';
|
|
|
30
29
|
import { SDK } from '../../native';
|
|
31
30
|
import { QuickSqliteClient } from '../../store/QuickSqliteClient';
|
|
32
31
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
32
|
+
import { DBSyncManager } from '../../utils/DBSyncManager';
|
|
33
33
|
import type { Streami18n } from '../../utils/Streami18n';
|
|
34
34
|
import { version } from '../../version.json';
|
|
35
35
|
|
|
@@ -197,10 +197,6 @@ const ChatWithContext = <
|
|
|
197
197
|
const setActiveChannel = (newChannel?: Channel<StreamChatGenerics>) => setChannel(newChannel);
|
|
198
198
|
|
|
199
199
|
const appSettings = useAppSettings(client, isOnline);
|
|
200
|
-
const { subscribeConnectionRecoveredCallback } = useConnectionRecovered<StreamChatGenerics>({
|
|
201
|
-
client,
|
|
202
|
-
enableOfflineSupport,
|
|
203
|
-
});
|
|
204
200
|
|
|
205
201
|
const chatContext = useCreateChatContext({
|
|
206
202
|
appSettings,
|
|
@@ -212,14 +208,14 @@ const ChatWithContext = <
|
|
|
212
208
|
isOnline,
|
|
213
209
|
mutedUsers,
|
|
214
210
|
setActiveChannel,
|
|
215
|
-
subscribeConnectionRecoveredCallback,
|
|
216
211
|
});
|
|
217
212
|
|
|
218
213
|
useEffect(() => {
|
|
219
|
-
if (enableOfflineSupport) {
|
|
214
|
+
if (client.user?.id && enableOfflineSupport) {
|
|
220
215
|
QuickSqliteClient.initializeDatabase();
|
|
216
|
+
DBSyncManager.init(client as unknown as StreamChat);
|
|
221
217
|
}
|
|
222
|
-
}, []);
|
|
218
|
+
}, [client?.user?.id]);
|
|
223
219
|
|
|
224
220
|
useSyncDatabase({
|
|
225
221
|
client,
|
|
@@ -55,7 +55,7 @@ describe('Chat', () => {
|
|
|
55
55
|
await waitFor(() => expect(netInfoFetch).toHaveBeenCalledTimes(1));
|
|
56
56
|
|
|
57
57
|
const { connectionRecovering } = context;
|
|
58
|
-
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
58
|
+
act(() => dispatchConnectionChangedEvent(chatClient, false));
|
|
59
59
|
await waitFor(() => {
|
|
60
60
|
expect(context.connectionRecovering).toStrictEqual(!connectionRecovering);
|
|
61
61
|
expect(context.isOnline).toBeFalsy();
|
|
@@ -15,7 +15,6 @@ export const useCreateChatContext = <
|
|
|
15
15
|
isOnline,
|
|
16
16
|
mutedUsers,
|
|
17
17
|
setActiveChannel,
|
|
18
|
-
subscribeConnectionRecoveredCallback,
|
|
19
18
|
}: ChatContextValue<StreamChatGenerics>) => {
|
|
20
19
|
const channelId = channel?.id;
|
|
21
20
|
const clientValues = client
|
|
@@ -36,7 +35,6 @@ export const useCreateChatContext = <
|
|
|
36
35
|
isOnline,
|
|
37
36
|
mutedUsers,
|
|
38
37
|
setActiveChannel,
|
|
39
|
-
subscribeConnectionRecoveredCallback,
|
|
40
38
|
}),
|
|
41
39
|
[channelId, clientValues, connectionRecovering, isOnline, mutedUsersLength],
|
|
42
40
|
);
|
|
@@ -123,6 +123,8 @@ export type MessagePropsWithContext<
|
|
|
123
123
|
Pick<MessageContextValue<StreamChatGenerics>, 'groupStyles' | 'message'> &
|
|
124
124
|
Pick<
|
|
125
125
|
MessagesContextValue<StreamChatGenerics>,
|
|
126
|
+
| 'sendReaction'
|
|
127
|
+
| 'deleteMessage'
|
|
126
128
|
| 'dismissKeyboardOnMessageTouch'
|
|
127
129
|
| 'forceAlignMessages'
|
|
128
130
|
| 'handleBlock'
|
|
@@ -145,6 +147,7 @@ export type MessagePropsWithContext<
|
|
|
145
147
|
| 'onPressMessage'
|
|
146
148
|
| 'OverlayReactionList'
|
|
147
149
|
| 'removeMessage'
|
|
150
|
+
| 'deleteReaction'
|
|
148
151
|
| 'retrySendMessage'
|
|
149
152
|
| 'selectReaction'
|
|
150
153
|
| 'setEditingState'
|
|
@@ -217,7 +220,9 @@ const MessageWithContext = <
|
|
|
217
220
|
const isMessageTypeDeleted = props.message.type === 'deleted';
|
|
218
221
|
|
|
219
222
|
const {
|
|
223
|
+
sendReaction,
|
|
220
224
|
channel,
|
|
225
|
+
deleteMessage: deleteMessageFromContext,
|
|
221
226
|
disabled,
|
|
222
227
|
dismissKeyboard,
|
|
223
228
|
dismissKeyboardOnMessageTouch,
|
|
@@ -256,6 +261,7 @@ const MessageWithContext = <
|
|
|
256
261
|
OverlayReactionList,
|
|
257
262
|
preventPress,
|
|
258
263
|
removeMessage,
|
|
264
|
+
deleteReaction,
|
|
259
265
|
retrySendMessage,
|
|
260
266
|
selectReaction,
|
|
261
267
|
setData,
|
|
@@ -460,14 +466,15 @@ const MessageWithContext = <
|
|
|
460
466
|
} = useMessageActionHandlers({
|
|
461
467
|
channel,
|
|
462
468
|
client,
|
|
469
|
+
deleteMessage: deleteMessageFromContext,
|
|
470
|
+
deleteReaction,
|
|
463
471
|
enforceUniqueReaction,
|
|
464
472
|
message,
|
|
465
|
-
removeMessage,
|
|
466
473
|
retrySendMessage,
|
|
474
|
+
sendReaction,
|
|
467
475
|
setEditingState,
|
|
468
476
|
setQuotedMessageState,
|
|
469
477
|
supportedReactions,
|
|
470
|
-
updateMessage,
|
|
471
478
|
});
|
|
472
479
|
|
|
473
480
|
const {
|
|
@@ -486,6 +493,8 @@ const MessageWithContext = <
|
|
|
486
493
|
} = useMessageActions({
|
|
487
494
|
channel,
|
|
488
495
|
client,
|
|
496
|
+
deleteMessage: deleteMessageFromContext,
|
|
497
|
+
deleteReaction,
|
|
489
498
|
enforceUniqueReaction,
|
|
490
499
|
handleBlock,
|
|
491
500
|
handleCopy,
|
|
@@ -504,6 +513,7 @@ const MessageWithContext = <
|
|
|
504
513
|
removeMessage,
|
|
505
514
|
retrySendMessage,
|
|
506
515
|
selectReaction,
|
|
516
|
+
sendReaction,
|
|
507
517
|
setEditingState,
|
|
508
518
|
setOverlay,
|
|
509
519
|
setQuotedMessageState,
|
|
@@ -722,6 +732,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
722
732
|
const {
|
|
723
733
|
chatContext: { mutedUsers: prevMutedUsers },
|
|
724
734
|
goToMessage: prevGoToMessage,
|
|
735
|
+
groupStyles: prevGroupStyles,
|
|
725
736
|
isAttachmentEqual,
|
|
726
737
|
isTargetedMessage: prevIsTargetedMessage,
|
|
727
738
|
lastReceivedId: prevLastReceivedId,
|
|
@@ -733,6 +744,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
733
744
|
const {
|
|
734
745
|
chatContext: { mutedUsers: nextMutedUsers },
|
|
735
746
|
goToMessage: nextGoToMessage,
|
|
747
|
+
groupStyles: nextGroupStyles,
|
|
736
748
|
isTargetedMessage: nextIsTargetedMessage,
|
|
737
749
|
lastReceivedId: nextLastReceivedId,
|
|
738
750
|
members: nextMembers,
|
|
@@ -761,6 +773,10 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
761
773
|
|
|
762
774
|
if (goToMessageChangedAndMatters) return false;
|
|
763
775
|
|
|
776
|
+
const groupStylesEqual =
|
|
777
|
+
prevGroupStyles.length === nextGroupStyles.length && prevGroupStyles[0] === nextGroupStyles[0];
|
|
778
|
+
if (!groupStylesEqual) return false;
|
|
779
|
+
|
|
764
780
|
const isPrevMessageTypeDeleted = prevMessage.type === 'deleted';
|
|
765
781
|
const isNextMessageTypeDeleted = nextMessage.type === 'deleted';
|
|
766
782
|
|
|
@@ -21,6 +21,7 @@ import { useTranslationContext } from '../../../contexts/translationContext/Tran
|
|
|
21
21
|
import { Eye } from '../../../icons';
|
|
22
22
|
|
|
23
23
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
24
|
+
import { MessageStatusTypes } from '../../../utils/utils';
|
|
24
25
|
import type { MessageType } from '../../MessageList/hooks/useMessageList';
|
|
25
26
|
|
|
26
27
|
type MessageFooterComponentProps = {
|
|
@@ -109,7 +110,7 @@ const MessageFooterWithContext = <
|
|
|
109
110
|
);
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
if (lastGroupMessage === false) {
|
|
113
|
+
if (lastGroupMessage === false && message.status === MessageStatusTypes.RECEIVED) {
|
|
113
114
|
return null;
|
|
114
115
|
}
|
|
115
116
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MessageResponse
|
|
1
|
+
import type { MessageResponse } from 'stream-chat';
|
|
2
2
|
|
|
3
3
|
import type { ChannelContextValue } from '../../../contexts/channelContext/ChannelContext';
|
|
4
4
|
import type { ChatContextValue } from '../../../contexts/chatContext/ChatContext';
|
|
@@ -9,29 +9,29 @@ import type {
|
|
|
9
9
|
import type { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';
|
|
10
10
|
|
|
11
11
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
12
|
-
import { MessageStatusTypes } from '../../../utils/utils';
|
|
13
12
|
|
|
14
13
|
export const useMessageActionHandlers = <
|
|
15
14
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
16
15
|
>({
|
|
17
16
|
channel,
|
|
18
17
|
client,
|
|
19
|
-
|
|
18
|
+
deleteMessage,
|
|
19
|
+
deleteReaction,
|
|
20
20
|
message,
|
|
21
|
-
removeMessage,
|
|
22
21
|
retrySendMessage,
|
|
22
|
+
sendReaction,
|
|
23
23
|
setEditingState,
|
|
24
24
|
setQuotedMessageState,
|
|
25
25
|
supportedReactions,
|
|
26
|
-
updateMessage,
|
|
27
26
|
}: Pick<
|
|
28
27
|
MessagesContextValue<StreamChatGenerics>,
|
|
29
|
-
| '
|
|
28
|
+
| 'sendReaction'
|
|
29
|
+
| 'deleteMessage'
|
|
30
|
+
| 'deleteReaction'
|
|
30
31
|
| 'retrySendMessage'
|
|
31
32
|
| 'setEditingState'
|
|
32
33
|
| 'setQuotedMessageState'
|
|
33
34
|
| 'supportedReactions'
|
|
34
|
-
| 'updateMessage'
|
|
35
35
|
> &
|
|
36
36
|
Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'enforceUniqueReaction'> &
|
|
37
37
|
Pick<ChatContextValue<StreamChatGenerics>, 'client'> &
|
|
@@ -48,12 +48,7 @@ export const useMessageActionHandlers = <
|
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
const handleDeleteMessage = async () => {
|
|
51
|
-
|
|
52
|
-
removeMessage(message);
|
|
53
|
-
} else {
|
|
54
|
-
const data = await client.deleteMessage(message.id);
|
|
55
|
-
updateMessage(data.message);
|
|
56
|
-
}
|
|
51
|
+
await deleteMessage(message as MessageResponse<StreamChatGenerics>);
|
|
57
52
|
};
|
|
58
53
|
|
|
59
54
|
const handleToggleMuteUser = async () => {
|
|
@@ -128,15 +123,9 @@ export const useMessageActionHandlers = <
|
|
|
128
123
|
try {
|
|
129
124
|
if (channel && messageId) {
|
|
130
125
|
if (ownReaction) {
|
|
131
|
-
await
|
|
126
|
+
await deleteReaction(reactionType, messageId);
|
|
132
127
|
} else {
|
|
133
|
-
await
|
|
134
|
-
messageId,
|
|
135
|
-
{
|
|
136
|
-
type: reactionType,
|
|
137
|
-
} as Reaction<StreamChatGenerics>,
|
|
138
|
-
{ enforce_unique: enforceUniqueReaction },
|
|
139
|
-
);
|
|
128
|
+
await sendReaction(reactionType, messageId);
|
|
140
129
|
}
|
|
141
130
|
}
|
|
142
131
|
} catch (err) {
|
|
@@ -37,6 +37,8 @@ export const useMessageActions = <
|
|
|
37
37
|
>({
|
|
38
38
|
channel,
|
|
39
39
|
client,
|
|
40
|
+
deleteMessage: deleteMessageFromContext,
|
|
41
|
+
deleteReaction,
|
|
40
42
|
enforceUniqueReaction,
|
|
41
43
|
handleBlock,
|
|
42
44
|
handleCopy,
|
|
@@ -52,17 +54,18 @@ export const useMessageActions = <
|
|
|
52
54
|
message,
|
|
53
55
|
onThreadSelect,
|
|
54
56
|
openThread,
|
|
55
|
-
removeMessage,
|
|
56
57
|
retrySendMessage,
|
|
57
58
|
selectReaction,
|
|
59
|
+
sendReaction,
|
|
58
60
|
setEditingState,
|
|
59
61
|
setOverlay,
|
|
60
62
|
setQuotedMessageState,
|
|
61
63
|
supportedReactions,
|
|
62
64
|
t,
|
|
63
|
-
updateMessage,
|
|
64
65
|
}: Pick<
|
|
65
66
|
MessagesContextValue<StreamChatGenerics>,
|
|
67
|
+
| 'deleteMessage'
|
|
68
|
+
| 'sendReaction'
|
|
66
69
|
| 'handleBlock'
|
|
67
70
|
| 'handleCopy'
|
|
68
71
|
| 'handleDelete'
|
|
@@ -75,6 +78,7 @@ export const useMessageActions = <
|
|
|
75
78
|
| 'handleReaction'
|
|
76
79
|
| 'handleThreadReply'
|
|
77
80
|
| 'removeMessage'
|
|
81
|
+
| 'deleteReaction'
|
|
78
82
|
| 'retrySendMessage'
|
|
79
83
|
| 'setEditingState'
|
|
80
84
|
| 'setQuotedMessageState'
|
|
@@ -107,14 +111,15 @@ export const useMessageActions = <
|
|
|
107
111
|
} = useMessageActionHandlers({
|
|
108
112
|
channel,
|
|
109
113
|
client,
|
|
114
|
+
deleteMessage: deleteMessageFromContext,
|
|
115
|
+
deleteReaction,
|
|
110
116
|
enforceUniqueReaction,
|
|
111
117
|
message,
|
|
112
|
-
removeMessage,
|
|
113
118
|
retrySendMessage,
|
|
119
|
+
sendReaction,
|
|
114
120
|
setEditingState,
|
|
115
121
|
setQuotedMessageState,
|
|
116
122
|
supportedReactions,
|
|
117
|
-
updateMessage,
|
|
118
123
|
});
|
|
119
124
|
|
|
120
125
|
const error = message.type === 'error' || message.status === MessageStatusTypes.FAILED;
|
|
@@ -3,6 +3,7 @@ import { FlatList, I18nManager, StyleSheet, Text, TouchableOpacity, View } from
|
|
|
3
3
|
|
|
4
4
|
import { UploadProgressIndicator } from './UploadProgressIndicator';
|
|
5
5
|
|
|
6
|
+
import { ChatContextValue, useChatContext } from '../../contexts';
|
|
6
7
|
import {
|
|
7
8
|
FileUpload,
|
|
8
9
|
MessageInputContextValue,
|
|
@@ -126,7 +127,8 @@ type FileUploadPreviewPropsWithContext<
|
|
|
126
127
|
MessageInputContextValue<StreamChatGenerics>,
|
|
127
128
|
'fileUploads' | 'removeFile' | 'uploadFile' | 'setFileUploads'
|
|
128
129
|
> &
|
|
129
|
-
Pick<MessagesContextValue<StreamChatGenerics>, 'AudioAttachment' | 'FileAttachmentIcon'
|
|
130
|
+
Pick<MessagesContextValue<StreamChatGenerics>, 'AudioAttachment' | 'FileAttachmentIcon'> &
|
|
131
|
+
Pick<ChatContextValue<StreamChatGenerics>, 'isOnline' | 'enableOfflineSupport'>;
|
|
130
132
|
|
|
131
133
|
const FileUploadPreviewWithContext = <
|
|
132
134
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
@@ -135,8 +137,10 @@ const FileUploadPreviewWithContext = <
|
|
|
135
137
|
) => {
|
|
136
138
|
const {
|
|
137
139
|
AudioAttachment,
|
|
140
|
+
enableOfflineSupport,
|
|
138
141
|
FileAttachmentIcon,
|
|
139
142
|
fileUploads,
|
|
143
|
+
isOnline,
|
|
140
144
|
removeFile,
|
|
141
145
|
setFileUploads,
|
|
142
146
|
uploadFile,
|
|
@@ -211,7 +215,7 @@ const FileUploadPreviewWithContext = <
|
|
|
211
215
|
} = useTheme();
|
|
212
216
|
|
|
213
217
|
const renderItem = ({ index, item }: { index: number; item: FileUpload }) => {
|
|
214
|
-
const indicatorType = getIndicatorTypeForFileState(item.state);
|
|
218
|
+
const indicatorType = getIndicatorTypeForFileState(item.state, isOnline, enableOfflineSupport);
|
|
215
219
|
|
|
216
220
|
const lastIndexOfDot = item.file.name.lastIndexOf('.');
|
|
217
221
|
|
|
@@ -389,6 +393,7 @@ export const FileUploadPreview = <
|
|
|
389
393
|
>(
|
|
390
394
|
props: FileUploadPreviewProps<StreamChatGenerics>,
|
|
391
395
|
) => {
|
|
396
|
+
const { enableOfflineSupport, isOnline } = useChatContext<StreamChatGenerics>();
|
|
392
397
|
const { fileUploads, removeFile, setFileUploads, uploadFile } =
|
|
393
398
|
useMessageInputContext<StreamChatGenerics>();
|
|
394
399
|
const { AudioAttachment, FileAttachmentIcon } = useMessagesContext<StreamChatGenerics>();
|
|
@@ -403,6 +408,7 @@ export const FileUploadPreview = <
|
|
|
403
408
|
setFileUploads,
|
|
404
409
|
uploadFile,
|
|
405
410
|
}}
|
|
411
|
+
{...{ enableOfflineSupport, isOnline }}
|
|
406
412
|
{...props}
|
|
407
413
|
/>
|
|
408
414
|
);
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
|
|
12
12
|
import { UploadProgressIndicator } from './UploadProgressIndicator';
|
|
13
13
|
|
|
14
|
+
import { ChatContextValue, useChatContext } from '../../contexts';
|
|
14
15
|
import {
|
|
15
16
|
ImageUpload,
|
|
16
17
|
MessageInputContextValue,
|
|
@@ -78,7 +79,8 @@ type ImageUploadPreviewPropsWithContext<
|
|
|
78
79
|
> = Pick<
|
|
79
80
|
MessageInputContextValue<StreamChatGenerics>,
|
|
80
81
|
'imageUploads' | 'removeImage' | 'uploadImage'
|
|
81
|
-
|
|
82
|
+
> &
|
|
83
|
+
Pick<ChatContextValue<StreamChatGenerics>, 'isOnline' | 'enableOfflineSupport'>;
|
|
82
84
|
|
|
83
85
|
export type ImageUploadPreviewProps<
|
|
84
86
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
@@ -91,7 +93,7 @@ const ImageUploadPreviewWithContext = <
|
|
|
91
93
|
>(
|
|
92
94
|
props: ImageUploadPreviewPropsWithContext<StreamChatGenerics>,
|
|
93
95
|
) => {
|
|
94
|
-
const { imageUploads, removeImage, uploadImage } = props;
|
|
96
|
+
const { enableOfflineSupport, imageUploads, isOnline, removeImage, uploadImage } = props;
|
|
95
97
|
|
|
96
98
|
const {
|
|
97
99
|
theme: {
|
|
@@ -129,7 +131,7 @@ const ImageUploadPreviewWithContext = <
|
|
|
129
131
|
};
|
|
130
132
|
|
|
131
133
|
const renderItem = ({ index, item }: ImageUploadPreviewItem) => {
|
|
132
|
-
const indicatorType = getIndicatorTypeForFileState(item.state);
|
|
134
|
+
const indicatorType = getIndicatorTypeForFileState(item.state, isOnline, enableOfflineSupport);
|
|
133
135
|
const itemMarginForIndex = index === imageUploads.length - 1 ? { marginRight: 8 } : {};
|
|
134
136
|
|
|
135
137
|
return (
|
|
@@ -200,15 +202,40 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
200
202
|
prevProps: ImageUploadPreviewPropsWithContext<StreamChatGenerics>,
|
|
201
203
|
nextProps: ImageUploadPreviewPropsWithContext<StreamChatGenerics>,
|
|
202
204
|
) => {
|
|
203
|
-
const {
|
|
204
|
-
|
|
205
|
+
const {
|
|
206
|
+
enableOfflineSupport: prevEnableOfflineSupport,
|
|
207
|
+
imageUploads: prevImageUploads,
|
|
208
|
+
isOnline: prevIsOnline,
|
|
209
|
+
} = prevProps;
|
|
210
|
+
const {
|
|
211
|
+
enableOfflineSupport: nextEnableOfflineSupport,
|
|
212
|
+
imageUploads: nextImageUploads,
|
|
213
|
+
isOnline: nextIsOnline,
|
|
214
|
+
} = nextProps;
|
|
205
215
|
|
|
206
|
-
|
|
216
|
+
const isOnlineEqual = prevIsOnline === nextIsOnline;
|
|
217
|
+
|
|
218
|
+
if (!isOnlineEqual) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const enableOfflineSupportEqual = prevEnableOfflineSupport === nextEnableOfflineSupport;
|
|
223
|
+
|
|
224
|
+
if (!enableOfflineSupportEqual) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const imageUploadsEqual =
|
|
207
229
|
prevImageUploads.length === nextImageUploads.length &&
|
|
208
230
|
prevImageUploads.every(
|
|
209
231
|
(prevImageUpload, index) => prevImageUpload.state === nextImageUploads[index].state,
|
|
210
|
-
)
|
|
211
|
-
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
if (!imageUploadsEqual) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return true;
|
|
212
239
|
};
|
|
213
240
|
|
|
214
241
|
const MemoizedImageUploadPreviewWithContext = React.memo(
|
|
@@ -224,11 +251,13 @@ export const ImageUploadPreview = <
|
|
|
224
251
|
>(
|
|
225
252
|
props: ImageUploadPreviewProps<StreamChatGenerics>,
|
|
226
253
|
) => {
|
|
254
|
+
const { enableOfflineSupport, isOnline } = useChatContext<StreamChatGenerics>();
|
|
227
255
|
const { imageUploads, removeImage, uploadImage } = useMessageInputContext<StreamChatGenerics>();
|
|
228
256
|
|
|
229
257
|
return (
|
|
230
258
|
<MemoizedImageUploadPreviewWithContext
|
|
231
259
|
{...{ imageUploads, removeImage, uploadImage }}
|
|
260
|
+
{...{ enableOfflineSupport, isOnline }}
|
|
232
261
|
{...props}
|
|
233
262
|
/>
|
|
234
263
|
);
|