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
|
@@ -3,13 +3,16 @@ import { KeyboardAvoidingViewProps, StyleSheet, Text, View } from 'react-native'
|
|
|
3
3
|
|
|
4
4
|
import debounce from 'lodash/debounce';
|
|
5
5
|
import throttle from 'lodash/throttle';
|
|
6
|
+
|
|
7
|
+
import { lookup } from 'mime-types';
|
|
6
8
|
import {
|
|
9
|
+
Channel as ChannelClass,
|
|
7
10
|
ChannelState,
|
|
8
11
|
Channel as ChannelType,
|
|
9
|
-
ConnectionChangeEvent,
|
|
10
12
|
EventHandler,
|
|
11
13
|
logChatPromiseExecution,
|
|
12
14
|
MessageResponse,
|
|
15
|
+
Reaction,
|
|
13
16
|
SendMessageAPIResponse,
|
|
14
17
|
StreamChat,
|
|
15
18
|
Event as StreamEvent,
|
|
@@ -72,8 +75,13 @@ import {
|
|
|
72
75
|
WutReaction,
|
|
73
76
|
} from '../../icons';
|
|
74
77
|
import { FlatList as FlatListDefault } from '../../native';
|
|
78
|
+
import * as dbApi from '../../store/apis';
|
|
75
79
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
76
|
-
import {
|
|
80
|
+
import { addReactionToLocalState } from '../../utils/addReactionToLocalState';
|
|
81
|
+
import { DBSyncManager } from '../../utils/DBSyncManager';
|
|
82
|
+
import { dropPendingTasks, queueTask } from '../../utils/pendingTaskUtils';
|
|
83
|
+
import { removeReactionFromLocalState } from '../../utils/removeReactionFromLocalState';
|
|
84
|
+
import { generateRandomId, isLocalUrl, MessageStatusTypes, ReactionData } from '../../utils/utils';
|
|
77
85
|
import { Attachment as AttachmentDefault } from '../Attachment/Attachment';
|
|
78
86
|
import { AttachmentActions as AttachmentActionsDefault } from '../Attachment/AttachmentActions';
|
|
79
87
|
import { AudioAttachment as AudioAttachmentDefault } from '../Attachment/AudioAttachment';
|
|
@@ -174,7 +182,7 @@ const throttleOptions = {
|
|
|
174
182
|
trailing: true,
|
|
175
183
|
};
|
|
176
184
|
const debounceOptions = {
|
|
177
|
-
leading:
|
|
185
|
+
leading: false,
|
|
178
186
|
trailing: true,
|
|
179
187
|
};
|
|
180
188
|
|
|
@@ -196,7 +204,7 @@ export type ChannelPropsWithContext<
|
|
|
196
204
|
| 'StickyHeader'
|
|
197
205
|
>
|
|
198
206
|
> &
|
|
199
|
-
Pick<ChatContextValue<StreamChatGenerics>, 'client'> &
|
|
207
|
+
Pick<ChatContextValue<StreamChatGenerics>, 'client' | 'enableOfflineSupport'> &
|
|
200
208
|
Partial<
|
|
201
209
|
Omit<
|
|
202
210
|
InputMessageInputContextValue<StreamChatGenerics>,
|
|
@@ -422,6 +430,7 @@ const ChannelWithContext = <
|
|
|
422
430
|
doUpdateMessageRequest,
|
|
423
431
|
EmptyStateIndicator = EmptyStateIndicatorDefault,
|
|
424
432
|
enableMessageGroupingByUser = true,
|
|
433
|
+
enableOfflineSupport,
|
|
425
434
|
enforceUniqueReaction = false,
|
|
426
435
|
FileAttachment = FileAttachmentDefault,
|
|
427
436
|
FileAttachmentGroup = FileAttachmentGroupDefault,
|
|
@@ -673,14 +682,14 @@ const ChannelWithContext = <
|
|
|
673
682
|
).current;
|
|
674
683
|
|
|
675
684
|
const copyMessagesState = useRef(
|
|
676
|
-
|
|
685
|
+
debounce(
|
|
677
686
|
() => {
|
|
678
687
|
if (channel) {
|
|
679
688
|
setMessages([...channel.state.messages]);
|
|
680
689
|
}
|
|
681
690
|
},
|
|
682
691
|
newMessageStateUpdateThrottleInterval,
|
|
683
|
-
|
|
692
|
+
debounceOptions,
|
|
684
693
|
),
|
|
685
694
|
).current;
|
|
686
695
|
|
|
@@ -709,7 +718,7 @@ const ChannelWithContext = <
|
|
|
709
718
|
).current;
|
|
710
719
|
|
|
711
720
|
const copyChannelState = useRef(
|
|
712
|
-
|
|
721
|
+
debounce(
|
|
713
722
|
() => {
|
|
714
723
|
setLoading(false);
|
|
715
724
|
if (channel) {
|
|
@@ -722,21 +731,12 @@ const ChannelWithContext = <
|
|
|
722
731
|
}
|
|
723
732
|
},
|
|
724
733
|
stateUpdateThrottleInterval,
|
|
725
|
-
|
|
734
|
+
debounceOptions,
|
|
726
735
|
),
|
|
727
736
|
).current;
|
|
728
737
|
|
|
729
|
-
const
|
|
730
|
-
if (
|
|
731
|
-
copyChannelState();
|
|
732
|
-
if (thread) {
|
|
733
|
-
setThreadMessages([...channel.state.threads[thread.id]]);
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
|
|
738
|
-
const connectionChangedHandler = (event: ConnectionChangeEvent) => {
|
|
739
|
-
if (event.online && shouldSyncChannel) {
|
|
738
|
+
const connectionChangedHandler = () => {
|
|
739
|
+
if (shouldSyncChannel) {
|
|
740
740
|
resyncChannel();
|
|
741
741
|
}
|
|
742
742
|
};
|
|
@@ -777,8 +777,7 @@ const ChannelWithContext = <
|
|
|
777
777
|
* The more complex sync logic around internet connectivity (NetInfo) is part of Chat.tsx
|
|
778
778
|
* listen to client.connection.recovered and all channel events
|
|
779
779
|
*/
|
|
780
|
-
clientSubscriptions.push(
|
|
781
|
-
clientSubscriptions.push(client.on('connection.changed', connectionChangedHandler));
|
|
780
|
+
clientSubscriptions.push(DBSyncManager.onSyncStatusChange(connectionChangedHandler));
|
|
782
781
|
clientSubscriptions.push(
|
|
783
782
|
client.on('channel.deleted', (event) => {
|
|
784
783
|
if (event.cid === channel.cid) {
|
|
@@ -795,7 +794,7 @@ const ChannelWithContext = <
|
|
|
795
794
|
clientSubscriptions.forEach((s) => s.unsubscribe());
|
|
796
795
|
channelSubscriptions.forEach((s) => s.unsubscribe());
|
|
797
796
|
};
|
|
798
|
-
}, [channelId, connectionChangedHandler,
|
|
797
|
+
}, [channelId, connectionChangedHandler, handleEvent]);
|
|
799
798
|
|
|
800
799
|
const channelQueryCallRef = useRef(
|
|
801
800
|
async (
|
|
@@ -906,7 +905,6 @@ const ChannelWithContext = <
|
|
|
906
905
|
|
|
907
906
|
const reloadThread = async () => {
|
|
908
907
|
if (!channel || !thread?.id) return;
|
|
909
|
-
|
|
910
908
|
setThreadLoadingMore(true);
|
|
911
909
|
try {
|
|
912
910
|
const parentID = thread.id;
|
|
@@ -1231,56 +1229,124 @@ const ChannelWithContext = <
|
|
|
1231
1229
|
return preview;
|
|
1232
1230
|
};
|
|
1233
1231
|
|
|
1232
|
+
const uploadPendingAttachments = async (message: MessageResponse<StreamChatGenerics>) => {
|
|
1233
|
+
const updatedMessage = { ...message };
|
|
1234
|
+
if (updatedMessage.attachments?.length) {
|
|
1235
|
+
for (let i = 0; i < updatedMessage.attachments?.length; i++) {
|
|
1236
|
+
// TODO: abstract the following logic to a separate function for DRY within MessageInputContext
|
|
1237
|
+
const attachment = updatedMessage.attachments[i];
|
|
1238
|
+
const file = attachment.originalFile;
|
|
1239
|
+
// check if image_url is not a remote url
|
|
1240
|
+
if (
|
|
1241
|
+
attachment.type === 'image' &&
|
|
1242
|
+
file?.uri &&
|
|
1243
|
+
attachment.image_url &&
|
|
1244
|
+
isLocalUrl(attachment.image_url)
|
|
1245
|
+
) {
|
|
1246
|
+
const filename = file.uri.replace(/^(file:\/\/|content:\/\/|assets-library:\/\/)/, '');
|
|
1247
|
+
const contentType = lookup(filename) || 'multipart/form-data';
|
|
1248
|
+
|
|
1249
|
+
const uploadResponse = doImageUploadRequest
|
|
1250
|
+
? await doImageUploadRequest(file, channel)
|
|
1251
|
+
: await channel.sendImage(file?.uri, filename, contentType);
|
|
1252
|
+
|
|
1253
|
+
attachment.image_url = uploadResponse.file;
|
|
1254
|
+
delete attachment.originalFile;
|
|
1255
|
+
|
|
1256
|
+
dbApi.updateMessage({
|
|
1257
|
+
message: { ...updatedMessage, cid: channel.cid },
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
if (
|
|
1262
|
+
(attachment.type === 'file' ||
|
|
1263
|
+
attachment.type === 'audio' ||
|
|
1264
|
+
attachment.type === 'video') &&
|
|
1265
|
+
attachment.asset_url &&
|
|
1266
|
+
isLocalUrl(attachment.asset_url) &&
|
|
1267
|
+
file?.uri
|
|
1268
|
+
) {
|
|
1269
|
+
const response = doDocUploadRequest
|
|
1270
|
+
? await doDocUploadRequest(file, channel)
|
|
1271
|
+
: await channel.sendFile(file.uri, file.name, file.type);
|
|
1272
|
+
attachment.asset_url = response.file;
|
|
1273
|
+
delete attachment.originalFile;
|
|
1274
|
+
dbApi.updateMessage({
|
|
1275
|
+
message: { ...updatedMessage, cid: channel.cid },
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
return updatedMessage;
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1234
1284
|
const sendMessageRequest = async (
|
|
1235
1285
|
message: MessageResponse<StreamChatGenerics>,
|
|
1236
1286
|
retrying?: boolean,
|
|
1237
1287
|
) => {
|
|
1238
|
-
const {
|
|
1239
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1240
|
-
__html,
|
|
1241
|
-
attachments,
|
|
1242
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1243
|
-
created_at,
|
|
1244
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1245
|
-
html,
|
|
1246
|
-
id,
|
|
1247
|
-
mentioned_users,
|
|
1248
|
-
parent_id,
|
|
1249
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1250
|
-
quoted_message,
|
|
1251
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1252
|
-
reactions,
|
|
1253
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1254
|
-
status,
|
|
1255
|
-
text,
|
|
1256
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1257
|
-
type,
|
|
1258
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1259
|
-
updated_at,
|
|
1260
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1261
|
-
user,
|
|
1262
|
-
...extraFields
|
|
1263
|
-
} = message;
|
|
1264
|
-
|
|
1265
|
-
const messageData = {
|
|
1266
|
-
attachments,
|
|
1267
|
-
id: retrying ? undefined : id,
|
|
1268
|
-
mentioned_users: mentioned_users?.map((mentionedUser) => mentionedUser.id) || [],
|
|
1269
|
-
parent_id,
|
|
1270
|
-
text,
|
|
1271
|
-
...extraFields,
|
|
1272
|
-
} as StreamMessage<StreamChatGenerics>;
|
|
1273
|
-
|
|
1274
1288
|
try {
|
|
1275
|
-
|
|
1289
|
+
const updatedMessage = await uploadPendingAttachments(message);
|
|
1290
|
+
const {
|
|
1291
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1292
|
+
__html,
|
|
1293
|
+
attachments,
|
|
1294
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1295
|
+
created_at,
|
|
1296
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1297
|
+
deleted_at,
|
|
1298
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1299
|
+
html,
|
|
1300
|
+
id,
|
|
1301
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1302
|
+
latest_reactions,
|
|
1303
|
+
mentioned_users,
|
|
1304
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1305
|
+
own_reactions,
|
|
1306
|
+
parent_id,
|
|
1307
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1308
|
+
quoted_message,
|
|
1309
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1310
|
+
reaction_counts,
|
|
1311
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1312
|
+
reactions,
|
|
1313
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1314
|
+
status,
|
|
1315
|
+
text,
|
|
1316
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1317
|
+
type,
|
|
1318
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1319
|
+
updated_at,
|
|
1320
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1321
|
+
user,
|
|
1322
|
+
...extraFields
|
|
1323
|
+
} = updatedMessage;
|
|
1324
|
+
if (!channel.id) return;
|
|
1325
|
+
|
|
1326
|
+
const messageData = {
|
|
1327
|
+
attachments,
|
|
1328
|
+
id,
|
|
1329
|
+
mentioned_users: mentioned_users?.map((mentionedUser) => mentionedUser.id) || [],
|
|
1330
|
+
parent_id,
|
|
1331
|
+
text,
|
|
1332
|
+
...extraFields,
|
|
1333
|
+
} as StreamMessage<StreamChatGenerics>;
|
|
1276
1334
|
|
|
1335
|
+
let messageResponse = {} as SendMessageAPIResponse<StreamChatGenerics>;
|
|
1277
1336
|
if (doSendMessageRequest) {
|
|
1278
1337
|
messageResponse = await doSendMessageRequest(channel?.cid || '', messageData);
|
|
1279
1338
|
} else if (channel) {
|
|
1280
1339
|
messageResponse = await channel.sendMessage(messageData);
|
|
1281
1340
|
}
|
|
1341
|
+
|
|
1282
1342
|
if (messageResponse.message) {
|
|
1283
1343
|
messageResponse.message.status = MessageStatusTypes.RECEIVED;
|
|
1344
|
+
|
|
1345
|
+
if (enableOfflineSupport) {
|
|
1346
|
+
dbApi.updateMessage({
|
|
1347
|
+
message: { ...messageResponse.message, cid: channel.cid },
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1284
1350
|
if (retrying) {
|
|
1285
1351
|
replaceMessage(message, messageResponse.message);
|
|
1286
1352
|
} else {
|
|
@@ -1290,7 +1356,13 @@ const ChannelWithContext = <
|
|
|
1290
1356
|
} catch (err) {
|
|
1291
1357
|
console.log(err);
|
|
1292
1358
|
message.status = MessageStatusTypes.FAILED;
|
|
1293
|
-
updateMessage(message);
|
|
1359
|
+
updateMessage({ ...message, cid: channel.cid });
|
|
1360
|
+
|
|
1361
|
+
if (enableOfflineSupport) {
|
|
1362
|
+
dbApi.updateMessage({
|
|
1363
|
+
message: { ...message, cid: channel.cid },
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1294
1366
|
}
|
|
1295
1367
|
};
|
|
1296
1368
|
|
|
@@ -1315,6 +1387,16 @@ const ChannelWithContext = <
|
|
|
1315
1387
|
messageInput: '',
|
|
1316
1388
|
});
|
|
1317
1389
|
|
|
1390
|
+
if (enableOfflineSupport) {
|
|
1391
|
+
// While sending a message, we add the message to local db with failed status, so that
|
|
1392
|
+
// if app gets closed before message gets sent and next time user opens the app
|
|
1393
|
+
// then user can see that message in failed state and can retry.
|
|
1394
|
+
// If succesfull, it will be updated with received status.
|
|
1395
|
+
dbApi.upsertMessages({
|
|
1396
|
+
messages: [{ ...messagePreview, cid: channel.cid, status: MessageStatusTypes.FAILED }],
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1318
1400
|
await sendMessageRequest(messagePreview);
|
|
1319
1401
|
};
|
|
1320
1402
|
|
|
@@ -1327,6 +1409,7 @@ const ChannelWithContext = <
|
|
|
1327
1409
|
};
|
|
1328
1410
|
|
|
1329
1411
|
updateMessage(statusPendingMessage);
|
|
1412
|
+
|
|
1330
1413
|
await sendMessageRequest(statusPendingMessage, true);
|
|
1331
1414
|
};
|
|
1332
1415
|
|
|
@@ -1469,6 +1552,127 @@ const ChannelWithContext = <
|
|
|
1469
1552
|
setThreadMessages(channel.state.threads[thread.id] || []);
|
|
1470
1553
|
}
|
|
1471
1554
|
}
|
|
1555
|
+
|
|
1556
|
+
if (enableOfflineSupport) {
|
|
1557
|
+
dbApi.deleteMessage({
|
|
1558
|
+
id: message.id,
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
|
|
1563
|
+
const sendReaction = async (type: string, messageId: string) => {
|
|
1564
|
+
if (!channel?.id || !client.user) {
|
|
1565
|
+
throw new Error('Channel has not been initialized');
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
const payload: Parameters<ChannelClass<StreamChatGenerics>['sendReaction']> = [
|
|
1569
|
+
messageId,
|
|
1570
|
+
{
|
|
1571
|
+
type,
|
|
1572
|
+
} as Reaction<StreamChatGenerics>,
|
|
1573
|
+
{ enforce_unique: enforceUniqueReaction },
|
|
1574
|
+
];
|
|
1575
|
+
|
|
1576
|
+
if (!enableOfflineSupport) {
|
|
1577
|
+
await channel.sendReaction(...payload);
|
|
1578
|
+
return;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
addReactionToLocalState<StreamChatGenerics>({
|
|
1582
|
+
channel,
|
|
1583
|
+
enforceUniqueReaction,
|
|
1584
|
+
messageId,
|
|
1585
|
+
reactionType: type,
|
|
1586
|
+
user: client.user,
|
|
1587
|
+
});
|
|
1588
|
+
|
|
1589
|
+
setMessages(channel.state.messages);
|
|
1590
|
+
|
|
1591
|
+
await queueTask<StreamChatGenerics>({
|
|
1592
|
+
client,
|
|
1593
|
+
task: {
|
|
1594
|
+
channelId: channel.id,
|
|
1595
|
+
channelType: channel.type,
|
|
1596
|
+
messageId,
|
|
1597
|
+
payload,
|
|
1598
|
+
type: 'send-reaction',
|
|
1599
|
+
},
|
|
1600
|
+
});
|
|
1601
|
+
};
|
|
1602
|
+
const deleteMessage: MessagesContextValue<StreamChatGenerics>['deleteMessage'] = async (
|
|
1603
|
+
message,
|
|
1604
|
+
) => {
|
|
1605
|
+
if (!channel.id) {
|
|
1606
|
+
throw new Error('Channel has not been initialized yet');
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
if (!enableOfflineSupport) {
|
|
1610
|
+
await client.deleteMessage(message.id);
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
if (message.status === MessageStatusTypes.FAILED) {
|
|
1615
|
+
dropPendingTasks({ messageId: message.id });
|
|
1616
|
+
removeMessage(message);
|
|
1617
|
+
} else {
|
|
1618
|
+
updateMessage({
|
|
1619
|
+
...message,
|
|
1620
|
+
cid: channel.cid,
|
|
1621
|
+
deleted_at: new Date().toISOString(),
|
|
1622
|
+
type: 'deleted',
|
|
1623
|
+
});
|
|
1624
|
+
|
|
1625
|
+
const data = await queueTask<StreamChatGenerics>({
|
|
1626
|
+
client,
|
|
1627
|
+
task: {
|
|
1628
|
+
channelId: channel.id,
|
|
1629
|
+
channelType: channel.type,
|
|
1630
|
+
messageId: message.id,
|
|
1631
|
+
payload: [message.id],
|
|
1632
|
+
type: 'delete-message',
|
|
1633
|
+
},
|
|
1634
|
+
});
|
|
1635
|
+
|
|
1636
|
+
if (data?.message) {
|
|
1637
|
+
updateMessage({ ...data.message });
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
|
|
1642
|
+
const deleteReaction: MessagesContextValue<StreamChatGenerics>['deleteReaction'] = async (
|
|
1643
|
+
type: string,
|
|
1644
|
+
messageId: string,
|
|
1645
|
+
) => {
|
|
1646
|
+
if (!channel?.id || !client.user) {
|
|
1647
|
+
throw new Error('Channel has not been initialized');
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
const payload: Parameters<ChannelClass['deleteReaction']> = [messageId, type];
|
|
1651
|
+
|
|
1652
|
+
if (!enableOfflineSupport) {
|
|
1653
|
+
await channel.deleteReaction(...payload);
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
removeReactionFromLocalState({
|
|
1658
|
+
channel,
|
|
1659
|
+
messageId,
|
|
1660
|
+
reactionType: type,
|
|
1661
|
+
user: client.user,
|
|
1662
|
+
});
|
|
1663
|
+
|
|
1664
|
+
setMessages(channel.state.messages);
|
|
1665
|
+
|
|
1666
|
+
await queueTask({
|
|
1667
|
+
client,
|
|
1668
|
+
task: {
|
|
1669
|
+
channelId: channel.id,
|
|
1670
|
+
channelType: channel.type,
|
|
1671
|
+
messageId,
|
|
1672
|
+
payload,
|
|
1673
|
+
type: 'delete-reaction',
|
|
1674
|
+
},
|
|
1675
|
+
});
|
|
1472
1676
|
};
|
|
1473
1677
|
|
|
1474
1678
|
/**
|
|
@@ -1654,6 +1858,8 @@ const ChannelWithContext = <
|
|
|
1654
1858
|
channelId,
|
|
1655
1859
|
DateHeader,
|
|
1656
1860
|
deletedMessagesVisibilityType,
|
|
1861
|
+
deleteMessage,
|
|
1862
|
+
deleteReaction,
|
|
1657
1863
|
disableTypingIndicator,
|
|
1658
1864
|
dismissKeyboardOnMessageTouch,
|
|
1659
1865
|
enableMessageGroupingByUser,
|
|
@@ -1713,6 +1919,7 @@ const ChannelWithContext = <
|
|
|
1713
1919
|
retrySendMessage,
|
|
1714
1920
|
ScrollToBottomButton,
|
|
1715
1921
|
selectReaction,
|
|
1922
|
+
sendReaction,
|
|
1716
1923
|
setEditingState,
|
|
1717
1924
|
setQuotedMessageState,
|
|
1718
1925
|
supportedReactions,
|
|
@@ -1808,7 +2015,7 @@ export const Channel = <
|
|
|
1808
2015
|
>(
|
|
1809
2016
|
props: PropsWithChildren<ChannelProps<StreamChatGenerics>>,
|
|
1810
2017
|
) => {
|
|
1811
|
-
const { client } = useChatContext<StreamChatGenerics>();
|
|
2018
|
+
const { client, enableOfflineSupport } = useChatContext<StreamChatGenerics>();
|
|
1812
2019
|
const { t } = useTranslationContext();
|
|
1813
2020
|
|
|
1814
2021
|
const shouldSyncChannel = props.thread?.id ? !!props.threadList : true;
|
|
@@ -1837,6 +2044,7 @@ export const Channel = <
|
|
|
1837
2044
|
<ChannelWithContext<StreamChatGenerics>
|
|
1838
2045
|
{...{
|
|
1839
2046
|
client,
|
|
2047
|
+
enableOfflineSupport,
|
|
1840
2048
|
t,
|
|
1841
2049
|
}}
|
|
1842
2050
|
{...props}
|
|
@@ -17,6 +17,8 @@ export const useCreateMessagesContext = <
|
|
|
17
17
|
channelId,
|
|
18
18
|
DateHeader,
|
|
19
19
|
deletedMessagesVisibilityType,
|
|
20
|
+
deleteMessage,
|
|
21
|
+
deleteReaction,
|
|
20
22
|
disableTypingIndicator,
|
|
21
23
|
dismissKeyboardOnMessageTouch,
|
|
22
24
|
enableMessageGroupingByUser,
|
|
@@ -76,6 +78,7 @@ export const useCreateMessagesContext = <
|
|
|
76
78
|
retrySendMessage,
|
|
77
79
|
ScrollToBottomButton,
|
|
78
80
|
selectReaction,
|
|
81
|
+
sendReaction,
|
|
79
82
|
setEditingState,
|
|
80
83
|
setQuotedMessageState,
|
|
81
84
|
supportedReactions,
|
|
@@ -108,6 +111,8 @@ export const useCreateMessagesContext = <
|
|
|
108
111
|
CardHeader,
|
|
109
112
|
DateHeader,
|
|
110
113
|
deletedMessagesVisibilityType,
|
|
114
|
+
deleteMessage,
|
|
115
|
+
deleteReaction,
|
|
111
116
|
disableTypingIndicator,
|
|
112
117
|
dismissKeyboardOnMessageTouch,
|
|
113
118
|
enableMessageGroupingByUser,
|
|
@@ -167,6 +172,7 @@ export const useCreateMessagesContext = <
|
|
|
167
172
|
retrySendMessage,
|
|
168
173
|
ScrollToBottomButton,
|
|
169
174
|
selectReaction,
|
|
175
|
+
sendReaction,
|
|
170
176
|
setEditingState,
|
|
171
177
|
setQuotedMessageState,
|
|
172
178
|
supportedReactions,
|
|
@@ -242,7 +242,7 @@ export const ChannelList = <
|
|
|
242
242
|
} = props;
|
|
243
243
|
|
|
244
244
|
const [forceUpdate, setForceUpdate] = useState(0);
|
|
245
|
-
const { enableOfflineSupport
|
|
245
|
+
const { enableOfflineSupport } = useChatContext<StreamChatGenerics>();
|
|
246
246
|
const {
|
|
247
247
|
channels,
|
|
248
248
|
error,
|
|
@@ -259,6 +259,7 @@ export const ChannelList = <
|
|
|
259
259
|
enableOfflineSupport,
|
|
260
260
|
filters,
|
|
261
261
|
options,
|
|
262
|
+
setForceUpdate,
|
|
262
263
|
sort,
|
|
263
264
|
});
|
|
264
265
|
|
|
@@ -328,15 +329,6 @@ export const ChannelList = <
|
|
|
328
329
|
});
|
|
329
330
|
}, [channelIdsStr, staticChannelsActive]);
|
|
330
331
|
|
|
331
|
-
useEffect(() => {
|
|
332
|
-
const unsubscribe = subscribeConnectionRecoveredCallback(() => {
|
|
333
|
-
refreshList();
|
|
334
|
-
setForceUpdate((count) => count + 1);
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
return () => unsubscribe();
|
|
338
|
-
});
|
|
339
|
-
|
|
340
332
|
const channelsContext = useCreateChannelsContext({
|
|
341
333
|
additionalFlatListProps,
|
|
342
334
|
channels,
|