stream-chat-react-native-core 4.12.2-beta.1 → 5.0.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 +3 -3
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/GalleryImage.js +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +30 -30
- package/lib/commonjs/components/Attachment/Giphy.js.map +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/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 +31 -18
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +28 -21
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +227 -257
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +2 -0
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js +2 -0
- package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +41 -10
- 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 +20 -8
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelList/Skeleton.js +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js +4 -4
- package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +51 -21
- 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 +3 -3
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +8 -6
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +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 +45 -9
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/handleEventToSyncDB.js +144 -0
- package/lib/commonjs/components/Chat/hooks/handleEventToSyncDB.js.map +1 -0
- package/lib/commonjs/components/Chat/hooks/useConnectionRecovered.js +171 -0
- package/lib/commonjs/components/Chat/hooks/useConnectionRecovered.js.map +1 -0
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +7 -3
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useMutedUsers.js +3 -3
- package/lib/commonjs/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js +29 -0
- package/lib/commonjs/components/Chat/hooks/useSyncDatabase.js.map +1 -0
- 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 +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 +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/useMessageActions.js +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 +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +1 -1
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +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 +136 -108
- package/lib/commonjs/components/MessageList/MessageList.js.map +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 +26 -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 +3 -3
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js +5 -5
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +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/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 +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 +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +13 -26
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +3 -3
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +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/{components/Attachment/hooks → hooks}/useLoadingImage.js +10 -0
- package/lib/commonjs/hooks/useLoadingImage.js.map +1 -0
- 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/index.js +9 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock-builders/DB/consts.js +15 -0
- package/lib/commonjs/mock-builders/DB/consts.js.map +1 -0
- package/lib/commonjs/mock-builders/DB/mock.js +125 -0
- package/lib/commonjs/mock-builders/DB/mock.js.map +1 -0
- package/lib/commonjs/mock-builders/event/memberAdded.js +17 -0
- package/lib/commonjs/mock-builders/event/memberAdded.js.map +1 -0
- package/lib/commonjs/mock-builders/event/memberRemoved.js +17 -0
- package/lib/commonjs/mock-builders/event/memberRemoved.js.map +1 -0
- package/lib/commonjs/mock-builders/event/memberUpdated.js +17 -0
- package/lib/commonjs/mock-builders/event/memberUpdated.js.map +1 -0
- package/lib/commonjs/mock-builders/event/reactionDeleted.js +18 -0
- package/lib/commonjs/mock-builders/event/reactionDeleted.js.map +1 -0
- package/lib/commonjs/mock-builders/event/reactionNew.js +18 -0
- package/lib/commonjs/mock-builders/event/reactionNew.js.map +1 -0
- package/lib/commonjs/mock-builders/event/reactionUpdated.js +18 -0
- package/lib/commonjs/mock-builders/event/reactionUpdated.js.map +1 -0
- package/lib/commonjs/mock-builders/generator/reaction.js +1 -1
- package/lib/commonjs/mock-builders/generator/reaction.js.map +1 -1
- package/lib/commonjs/store/QuickSqliteClient.js +156 -0
- package/lib/commonjs/store/QuickSqliteClient.js.map +1 -0
- package/lib/commonjs/store/apis/deleteChannel.js +26 -0
- package/lib/commonjs/store/apis/deleteChannel.js.map +1 -0
- package/lib/commonjs/store/apis/deleteMember.js +28 -0
- package/lib/commonjs/store/apis/deleteMember.js.map +1 -0
- package/lib/commonjs/store/apis/deleteMessagesForChannel.js +26 -0
- package/lib/commonjs/store/apis/deleteMessagesForChannel.js.map +1 -0
- package/lib/commonjs/store/apis/deleteReactions.js +28 -0
- package/lib/commonjs/store/apis/deleteReactions.js.map +1 -0
- package/lib/commonjs/store/apis/getAllChannelIds.js +16 -0
- package/lib/commonjs/store/apis/getAllChannelIds.js.map +1 -0
- package/lib/commonjs/store/apis/getChannelMessages.js +45 -0
- package/lib/commonjs/store/apis/getChannelMessages.js.map +1 -0
- package/lib/commonjs/store/apis/getChannels.js +60 -0
- package/lib/commonjs/store/apis/getChannels.js.map +1 -0
- package/lib/commonjs/store/apis/getLastSyncedAt.js +23 -0
- package/lib/commonjs/store/apis/getLastSyncedAt.js.map +1 -0
- package/lib/commonjs/store/apis/getMembers.js +25 -0
- package/lib/commonjs/store/apis/getMembers.js.map +1 -0
- package/lib/commonjs/store/apis/getReads.js +25 -0
- package/lib/commonjs/store/apis/getReads.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectChannelIdsForFilterSort.js +31 -0
- package/lib/commonjs/store/apis/queries/selectChannelIdsForFilterSort.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectChannels.js +30 -0
- package/lib/commonjs/store/apis/queries/selectChannels.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectMembersForChannels.js +27 -0
- package/lib/commonjs/store/apis/queries/selectMembersForChannels.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectMessagesForChannels.js +27 -0
- package/lib/commonjs/store/apis/queries/selectMessagesForChannels.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectReactionsForMessages.js +27 -0
- package/lib/commonjs/store/apis/queries/selectReactionsForMessages.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectReadsForChannels.js +27 -0
- package/lib/commonjs/store/apis/queries/selectReadsForChannels.js.map +1 -0
- package/lib/commonjs/store/apis/updateMessage.js +69 -0
- package/lib/commonjs/store/apis/updateMessage.js.map +1 -0
- package/lib/commonjs/store/apis/updateReaction.js +53 -0
- package/lib/commonjs/store/apis/updateReaction.js.map +1 -0
- package/lib/commonjs/store/apis/upsertChannelData.js +26 -0
- package/lib/commonjs/store/apis/upsertChannelData.js.map +1 -0
- package/lib/commonjs/store/apis/upsertChannels.js +83 -0
- package/lib/commonjs/store/apis/upsertChannels.js.map +1 -0
- package/lib/commonjs/store/apis/upsertCidsForQuery.js +34 -0
- package/lib/commonjs/store/apis/upsertCidsForQuery.js.map +1 -0
- package/lib/commonjs/store/apis/upsertLastSyncedAt.js +22 -0
- package/lib/commonjs/store/apis/upsertLastSyncedAt.js.map +1 -0
- package/lib/commonjs/store/apis/upsertMembers.js +39 -0
- package/lib/commonjs/store/apis/upsertMembers.js.map +1 -0
- package/lib/commonjs/store/apis/upsertMessages.js +52 -0
- package/lib/commonjs/store/apis/upsertMessages.js.map +1 -0
- package/lib/commonjs/store/apis/upsertReads.js +39 -0
- package/lib/commonjs/store/apis/upsertReads.js.map +1 -0
- package/lib/commonjs/store/apis/utils/convertFilterSortToQuery.js +13 -0
- package/lib/commonjs/store/apis/utils/convertFilterSortToQuery.js.map +1 -0
- package/lib/commonjs/store/constants.js +11 -0
- package/lib/commonjs/store/constants.js.map +1 -0
- package/lib/commonjs/store/mappers/mapChannelDataToStorable.js +67 -0
- package/lib/commonjs/store/mappers/mapChannelDataToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapDateTimeToStorable.js +12 -0
- package/lib/commonjs/store/mappers/mapDateTimeToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapMemberToStorable.js +39 -0
- package/lib/commonjs/store/mappers/mapMemberToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapMessageToStorable.js +42 -0
- package/lib/commonjs/store/mappers/mapMessageToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapReactionToStorable.js +34 -0
- package/lib/commonjs/store/mappers/mapReactionToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapReadToStorable.js +23 -0
- package/lib/commonjs/store/mappers/mapReadToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToChannel.js +65 -0
- package/lib/commonjs/store/mappers/mapStorableToChannel.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToMember.js +38 -0
- package/lib/commonjs/store/mappers/mapStorableToMember.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToMessage.js +50 -0
- package/lib/commonjs/store/mappers/mapStorableToMessage.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToReaction.js +31 -0
- package/lib/commonjs/store/mappers/mapStorableToReaction.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToRead.js +20 -0
- package/lib/commonjs/store/mappers/mapStorableToRead.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToUser.js +31 -0
- package/lib/commonjs/store/mappers/mapStorableToUser.js.map +1 -0
- package/lib/commonjs/store/mappers/mapUserToStorable.js +34 -0
- package/lib/commonjs/store/mappers/mapUserToStorable.js.map +1 -0
- package/lib/commonjs/store/schema.js +161 -0
- package/lib/commonjs/store/schema.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/appendWhereCluase.js +38 -0
- package/lib/commonjs/store/sqlite-utils/appendWhereCluase.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js +35 -0
- package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createDeleteQuery.js +14 -0
- package/lib/commonjs/store/sqlite-utils/createDeleteQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createSelectQuery.js +26 -0
- package/lib/commonjs/store/sqlite-utils/createSelectQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js +29 -0
- package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js +30 -0
- package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/printRow.js +23 -0
- package/lib/commonjs/store/sqlite-utils/printRow.js.map +1 -0
- package/lib/commonjs/store/types.js +4 -0
- package/lib/commonjs/store/types.js.map +1 -0
- 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 +3 -3
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/GalleryImage.js +1 -1
- package/lib/module/components/Attachment/Giphy.js +30 -30
- package/lib/module/components/Attachment/Giphy.js.map +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/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 +31 -18
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +28 -21
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +227 -257
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js +2 -0
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js +2 -0
- package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +41 -10
- 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 +20 -8
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/ChannelList/Skeleton.js +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js +4 -4
- package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +51 -21
- 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 +3 -3
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +8 -6
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +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 +45 -9
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/handleEventToSyncDB.js +144 -0
- package/lib/module/components/Chat/hooks/handleEventToSyncDB.js.map +1 -0
- package/lib/module/components/Chat/hooks/useConnectionRecovered.js +171 -0
- package/lib/module/components/Chat/hooks/useConnectionRecovered.js.map +1 -0
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +7 -3
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/Chat/hooks/useMutedUsers.js +3 -3
- package/lib/module/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/module/components/Chat/hooks/useSyncDatabase.js +29 -0
- package/lib/module/components/Chat/hooks/useSyncDatabase.js.map +1 -0
- 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 +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 +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/useMessageActions.js +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 +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +1 -1
- package/lib/module/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/module/components/MessageInput/SendButton.js +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 +136 -108
- package/lib/module/components/MessageList/MessageList.js.map +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 +26 -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 +3 -3
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/module/contexts/channelsStateContext/useChannelState.js +5 -5
- package/lib/module/contexts/channelsStateContext/useChannelState.js.map +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/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 +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 +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +13 -26
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +3 -3
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +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/{components/Attachment/hooks → hooks}/useLoadingImage.js +10 -0
- package/lib/module/hooks/useLoadingImage.js.map +1 -0
- 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/index.js +9 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock-builders/DB/consts.js +15 -0
- package/lib/module/mock-builders/DB/consts.js.map +1 -0
- package/lib/module/mock-builders/DB/mock.js +125 -0
- package/lib/module/mock-builders/DB/mock.js.map +1 -0
- package/lib/module/mock-builders/event/memberAdded.js +17 -0
- package/lib/module/mock-builders/event/memberAdded.js.map +1 -0
- package/lib/module/mock-builders/event/memberRemoved.js +17 -0
- package/lib/module/mock-builders/event/memberRemoved.js.map +1 -0
- package/lib/module/mock-builders/event/memberUpdated.js +17 -0
- package/lib/module/mock-builders/event/memberUpdated.js.map +1 -0
- package/lib/module/mock-builders/event/reactionDeleted.js +18 -0
- package/lib/module/mock-builders/event/reactionDeleted.js.map +1 -0
- package/lib/module/mock-builders/event/reactionNew.js +18 -0
- package/lib/module/mock-builders/event/reactionNew.js.map +1 -0
- package/lib/module/mock-builders/event/reactionUpdated.js +18 -0
- package/lib/module/mock-builders/event/reactionUpdated.js.map +1 -0
- package/lib/module/mock-builders/generator/reaction.js +1 -1
- package/lib/module/mock-builders/generator/reaction.js.map +1 -1
- package/lib/module/store/QuickSqliteClient.js +156 -0
- package/lib/module/store/QuickSqliteClient.js.map +1 -0
- package/lib/module/store/apis/deleteChannel.js +26 -0
- package/lib/module/store/apis/deleteChannel.js.map +1 -0
- package/lib/module/store/apis/deleteMember.js +28 -0
- package/lib/module/store/apis/deleteMember.js.map +1 -0
- package/lib/module/store/apis/deleteMessagesForChannel.js +26 -0
- package/lib/module/store/apis/deleteMessagesForChannel.js.map +1 -0
- package/lib/module/store/apis/deleteReactions.js +28 -0
- package/lib/module/store/apis/deleteReactions.js.map +1 -0
- package/lib/module/store/apis/getAllChannelIds.js +16 -0
- package/lib/module/store/apis/getAllChannelIds.js.map +1 -0
- package/lib/module/store/apis/getChannelMessages.js +45 -0
- package/lib/module/store/apis/getChannelMessages.js.map +1 -0
- package/lib/module/store/apis/getChannels.js +60 -0
- package/lib/module/store/apis/getChannels.js.map +1 -0
- package/lib/module/store/apis/getLastSyncedAt.js +23 -0
- package/lib/module/store/apis/getLastSyncedAt.js.map +1 -0
- package/lib/module/store/apis/getMembers.js +25 -0
- package/lib/module/store/apis/getMembers.js.map +1 -0
- package/lib/module/store/apis/getReads.js +25 -0
- package/lib/module/store/apis/getReads.js.map +1 -0
- package/lib/module/store/apis/queries/selectChannelIdsForFilterSort.js +31 -0
- package/lib/module/store/apis/queries/selectChannelIdsForFilterSort.js.map +1 -0
- package/lib/module/store/apis/queries/selectChannels.js +30 -0
- package/lib/module/store/apis/queries/selectChannels.js.map +1 -0
- package/lib/module/store/apis/queries/selectMembersForChannels.js +27 -0
- package/lib/module/store/apis/queries/selectMembersForChannels.js.map +1 -0
- package/lib/module/store/apis/queries/selectMessagesForChannels.js +27 -0
- package/lib/module/store/apis/queries/selectMessagesForChannels.js.map +1 -0
- package/lib/module/store/apis/queries/selectReactionsForMessages.js +27 -0
- package/lib/module/store/apis/queries/selectReactionsForMessages.js.map +1 -0
- package/lib/module/store/apis/queries/selectReadsForChannels.js +27 -0
- package/lib/module/store/apis/queries/selectReadsForChannels.js.map +1 -0
- package/lib/module/store/apis/updateMessage.js +69 -0
- package/lib/module/store/apis/updateMessage.js.map +1 -0
- package/lib/module/store/apis/updateReaction.js +53 -0
- package/lib/module/store/apis/updateReaction.js.map +1 -0
- package/lib/module/store/apis/upsertChannelData.js +26 -0
- package/lib/module/store/apis/upsertChannelData.js.map +1 -0
- package/lib/module/store/apis/upsertChannels.js +83 -0
- package/lib/module/store/apis/upsertChannels.js.map +1 -0
- package/lib/module/store/apis/upsertCidsForQuery.js +34 -0
- package/lib/module/store/apis/upsertCidsForQuery.js.map +1 -0
- package/lib/module/store/apis/upsertLastSyncedAt.js +22 -0
- package/lib/module/store/apis/upsertLastSyncedAt.js.map +1 -0
- package/lib/module/store/apis/upsertMembers.js +39 -0
- package/lib/module/store/apis/upsertMembers.js.map +1 -0
- package/lib/module/store/apis/upsertMessages.js +52 -0
- package/lib/module/store/apis/upsertMessages.js.map +1 -0
- package/lib/module/store/apis/upsertReads.js +39 -0
- package/lib/module/store/apis/upsertReads.js.map +1 -0
- package/lib/module/store/apis/utils/convertFilterSortToQuery.js +13 -0
- package/lib/module/store/apis/utils/convertFilterSortToQuery.js.map +1 -0
- package/lib/module/store/constants.js +11 -0
- package/lib/module/store/constants.js.map +1 -0
- package/lib/module/store/mappers/mapChannelDataToStorable.js +67 -0
- package/lib/module/store/mappers/mapChannelDataToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapDateTimeToStorable.js +12 -0
- package/lib/module/store/mappers/mapDateTimeToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapMemberToStorable.js +39 -0
- package/lib/module/store/mappers/mapMemberToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapMessageToStorable.js +42 -0
- package/lib/module/store/mappers/mapMessageToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapReactionToStorable.js +34 -0
- package/lib/module/store/mappers/mapReactionToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapReadToStorable.js +23 -0
- package/lib/module/store/mappers/mapReadToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToChannel.js +65 -0
- package/lib/module/store/mappers/mapStorableToChannel.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToMember.js +38 -0
- package/lib/module/store/mappers/mapStorableToMember.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToMessage.js +50 -0
- package/lib/module/store/mappers/mapStorableToMessage.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToReaction.js +31 -0
- package/lib/module/store/mappers/mapStorableToReaction.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToRead.js +20 -0
- package/lib/module/store/mappers/mapStorableToRead.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToUser.js +31 -0
- package/lib/module/store/mappers/mapStorableToUser.js.map +1 -0
- package/lib/module/store/mappers/mapUserToStorable.js +34 -0
- package/lib/module/store/mappers/mapUserToStorable.js.map +1 -0
- package/lib/module/store/schema.js +161 -0
- package/lib/module/store/schema.js.map +1 -0
- package/lib/module/store/sqlite-utils/appendWhereCluase.js +38 -0
- package/lib/module/store/sqlite-utils/appendWhereCluase.js.map +1 -0
- package/lib/module/store/sqlite-utils/createCreateTableQuery.js +35 -0
- package/lib/module/store/sqlite-utils/createCreateTableQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/createDeleteQuery.js +14 -0
- package/lib/module/store/sqlite-utils/createDeleteQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/createSelectQuery.js +26 -0
- package/lib/module/store/sqlite-utils/createSelectQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/createUpdateQuery.js +29 -0
- package/lib/module/store/sqlite-utils/createUpdateQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/createUpsertQuery.js +30 -0
- package/lib/module/store/sqlite-utils/createUpsertQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/printRow.js +23 -0
- package/lib/module/store/sqlite-utils/printRow.js.map +1 -0
- package/lib/module/store/types.js +4 -0
- package/lib/module/store/types.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/__tests__/utils/BetterSqlite.d.ts +8 -0
- package/lib/typescript/components/Channel/Channel.d.ts +3 -5
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreatePaginatedMessageListContext.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +4 -2
- package/lib/typescript/components/Chat/Chat.d.ts +4 -0
- package/lib/typescript/components/Chat/hooks/handleEventToSyncDB.d.ts +2 -0
- package/lib/typescript/components/Chat/hooks/useConnectionRecovered.d.ts +10 -0
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/Chat/hooks/useSyncDatabase.d.ts +8 -0
- package/lib/typescript/components/MessageList/MessageList.d.ts +1 -1
- package/lib/typescript/components/index.d.ts +2 -1
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +17 -0
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +3 -1
- package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +4 -0
- package/lib/typescript/{components/Attachment/hooks → hooks}/useLoadingImage.d.ts +0 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/store/QuickSqliteClient.d.ts +18 -0
- package/lib/typescript/store/apis/deleteChannel.d.ts +4 -0
- package/lib/typescript/store/apis/deleteMember.d.ts +6 -0
- package/lib/typescript/store/apis/deleteMessagesForChannel.d.ts +4 -0
- package/lib/typescript/store/apis/deleteReactions.d.ts +4 -0
- package/lib/typescript/store/apis/getAllChannelIds.d.ts +1 -0
- package/lib/typescript/store/apis/getChannelMessages.d.ts +6 -0
- package/lib/typescript/store/apis/getChannels.d.ts +7 -0
- package/lib/typescript/store/apis/getLastSyncedAt.d.ts +3 -0
- package/lib/typescript/store/apis/getMembers.d.ts +5 -0
- package/lib/typescript/store/apis/getReads.d.ts +5 -0
- package/lib/typescript/store/apis/queries/selectChannelIdsForFilterSort.d.ts +6 -0
- package/lib/typescript/store/apis/queries/selectChannels.d.ts +4 -0
- package/lib/typescript/store/apis/queries/selectMembersForChannels.d.ts +2 -0
- package/lib/typescript/store/apis/queries/selectMessagesForChannels.d.ts +2 -0
- package/lib/typescript/store/apis/queries/selectReactionsForMessages.d.ts +2 -0
- package/lib/typescript/store/apis/queries/selectReadsForChannels.d.ts +2 -0
- package/lib/typescript/store/apis/updateMessage.d.ts +6 -0
- package/lib/typescript/store/apis/updateReaction.d.ts +7 -0
- package/lib/typescript/store/apis/upsertChannelData.d.ts +5 -0
- package/lib/typescript/store/apis/upsertChannels.d.ts +9 -0
- package/lib/typescript/store/apis/upsertCidsForQuery.d.ts +7 -0
- package/lib/typescript/store/apis/upsertLastSyncedAt.d.ts +4 -0
- package/lib/typescript/store/apis/upsertMembers.d.ts +7 -0
- package/lib/typescript/store/apis/upsertMessages.d.ts +6 -0
- package/lib/typescript/store/apis/upsertReads.d.ts +7 -0
- package/lib/typescript/store/apis/utils/convertFilterSortToQuery.d.ts +6 -0
- package/lib/typescript/store/constants.d.ts +3 -0
- package/lib/typescript/store/mappers/mapChannelDataToStorable.d.ts +4 -0
- package/lib/typescript/store/mappers/mapDateTimeToStorable.d.ts +1 -0
- package/lib/typescript/store/mappers/mapMemberToStorable.d.ts +7 -0
- package/lib/typescript/store/mappers/mapMessageToStorable.d.ts +3 -0
- package/lib/typescript/store/mappers/mapReactionToStorable.d.ts +3 -0
- package/lib/typescript/store/mappers/mapReadToStorable.d.ts +7 -0
- package/lib/typescript/store/mappers/mapStorableToChannel.d.ts +4 -0
- package/lib/typescript/store/mappers/mapStorableToMember.d.ts +4 -0
- package/lib/typescript/store/mappers/mapStorableToMessage.d.ts +8 -0
- package/lib/typescript/store/mappers/mapStorableToReaction.d.ts +4 -0
- package/lib/typescript/store/mappers/mapStorableToRead.d.ts +4 -0
- package/lib/typescript/store/mappers/mapStorableToUser.d.ts +4 -0
- package/lib/typescript/store/mappers/mapUserToStorable.d.ts +3 -0
- package/lib/typescript/store/schema.d.ts +110 -0
- package/lib/typescript/store/sqlite-utils/__tests__/createSelectQuery.test.d.ts +1 -0
- package/lib/typescript/store/sqlite-utils/appendWhereCluase.d.ts +3 -0
- package/lib/typescript/store/sqlite-utils/createCreateTableQuery.d.ts +2 -0
- package/lib/typescript/store/sqlite-utils/createDeleteQuery.d.ts +12 -0
- package/lib/typescript/store/sqlite-utils/createSelectQuery.d.ts +13 -0
- package/lib/typescript/store/sqlite-utils/createUpdateQuery.d.ts +13 -0
- package/lib/typescript/store/sqlite-utils/createUpsertQuery.d.ts +11 -0
- package/lib/typescript/store/sqlite-utils/printRow.d.ts +2 -0
- package/lib/typescript/store/types.d.ts +9 -0
- package/package.json +4 -2
- package/src/__tests__/offline-feature.test.js +657 -0
- package/src/__tests__/utils/BetterSqlite.js +44 -0
- package/src/components/Attachment/Gallery.tsx +1 -1
- package/src/components/Attachment/Giphy.tsx +1 -2
- package/src/components/Avatar/Avatar.tsx +45 -31
- package/src/components/Avatar/GroupAvatar.tsx +46 -35
- package/src/components/Channel/Channel.tsx +101 -136
- package/src/components/Channel/hooks/useCreateChannelContext.ts +2 -0
- package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +2 -0
- package/src/components/ChannelList/ChannelList.tsx +28 -8
- package/src/components/ChannelList/ChannelListMessenger.tsx +4 -0
- package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +2 -0
- package/src/components/ChannelList/hooks/listeners/useAddedToChannelNotification.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelDeleted.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelHidden.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelTruncated.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelUpdated.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelVisible.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +3 -2
- package/src/components/ChannelList/hooks/listeners/useNewMessageNotification.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useUserPresence.ts +5 -4
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +36 -9
- package/src/components/ChannelPreview/ChannelPreview.tsx +2 -2
- package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +10 -9
- package/src/components/Chat/Chat.tsx +41 -4
- package/src/components/Chat/hooks/handleEventToSyncDB.ts +142 -0
- package/src/components/Chat/hooks/useConnectionRecovered.ts +92 -0
- package/src/components/Chat/hooks/useCreateChatContext.ts +9 -3
- package/src/components/Chat/hooks/useMutedUsers.ts +5 -3
- package/src/components/Chat/hooks/useSyncDatabase.ts +30 -0
- package/src/components/MessageList/MessageList.tsx +157 -101
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +2 -0
- package/src/components/index.ts +2 -1
- package/src/contexts/channelContext/ChannelContext.tsx +15 -0
- package/src/contexts/channelsStateContext/useChannelState.ts +2 -2
- package/src/contexts/chatContext/ChatContext.tsx +3 -1
- package/src/contexts/overlayContext/OverlayProvider.tsx +1 -5
- package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +4 -0
- package/src/{components/Attachment/hooks → hooks}/useLoadingImage.tsx +9 -1
- package/src/index.ts +1 -0
- package/src/mock-builders/DB/consts.ts +2 -0
- package/src/mock-builders/DB/mock.ts +112 -0
- package/src/mock-builders/event/memberAdded.js +8 -0
- package/src/mock-builders/event/memberRemoved.js +8 -0
- package/src/mock-builders/event/memberUpdated.js +8 -0
- package/src/mock-builders/event/reactionDeleted.js +9 -0
- package/src/mock-builders/event/reactionNew.js +9 -0
- package/src/mock-builders/event/reactionUpdated.js +9 -0
- package/src/mock-builders/generator/reaction.js +1 -1
- package/src/store/QuickSqliteClient.ts +140 -0
- package/src/store/apis/deleteChannel.ts +14 -0
- package/src/store/apis/deleteMember.ts +25 -0
- package/src/store/apis/deleteMessagesForChannel.ts +19 -0
- package/src/store/apis/deleteReactions.ts +24 -0
- package/src/store/apis/getAllChannelIds.ts +7 -0
- package/src/store/apis/getChannelMessages.ts +50 -0
- package/src/store/apis/getChannels.ts +43 -0
- package/src/store/apis/getLastSyncedAt.ts +17 -0
- package/src/store/apis/getMembers.ts +26 -0
- package/src/store/apis/getReads.ts +26 -0
- package/src/store/apis/queries/selectChannelIdsForFilterSort.ts +28 -0
- package/src/store/apis/queries/selectChannels.ts +19 -0
- package/src/store/apis/queries/selectMembersForChannels.ts +32 -0
- package/src/store/apis/queries/selectMessagesForChannels.ts +40 -0
- package/src/store/apis/queries/selectReactionsForMessages.ts +33 -0
- package/src/store/apis/queries/selectReadsForChannels.ts +30 -0
- package/src/store/apis/updateMessage.ts +65 -0
- package/src/store/apis/updateReaction.ts +54 -0
- package/src/store/apis/upsertChannelData.ts +20 -0
- package/src/store/apis/upsertChannels.ts +79 -0
- package/src/store/apis/upsertCidsForQuery.ts +30 -0
- package/src/store/apis/upsertLastSyncedAt.ts +17 -0
- package/src/store/apis/upsertMembers.ts +41 -0
- package/src/store/apis/upsertMessages.ts +43 -0
- package/src/store/apis/upsertReads.ts +41 -0
- package/src/store/apis/utils/convertFilterSortToQuery.ts +14 -0
- package/src/store/constants.ts +3 -0
- package/src/store/mappers/mapChannelDataToStorable.ts +67 -0
- package/src/store/mappers/mapDateTimeToStorable.ts +5 -0
- package/src/store/mappers/mapMemberToStorable.ts +45 -0
- package/src/store/mappers/mapMessageToStorable.ts +35 -0
- package/src/store/mappers/mapReactionToStorable.ts +19 -0
- package/src/store/mappers/mapReadToStorable.ts +25 -0
- package/src/store/mappers/mapStorableToChannel.ts +69 -0
- package/src/store/mappers/mapStorableToMember.ts +42 -0
- package/src/store/mappers/mapStorableToMessage.ts +40 -0
- package/src/store/mappers/mapStorableToReaction.ts +25 -0
- package/src/store/mappers/mapStorableToRead.ts +21 -0
- package/src/store/mappers/mapStorableToUser.ts +23 -0
- package/src/store/mappers/mapUserToStorable.ts +18 -0
- package/src/store/schema.ts +284 -0
- package/src/store/sqlite-utils/__tests__/createSelectQuery.test.ts +21 -0
- package/src/store/sqlite-utils/appendWhereCluase.ts +33 -0
- package/src/store/sqlite-utils/createCreateTableQuery.ts +39 -0
- package/src/store/sqlite-utils/createDeleteQuery.ts +23 -0
- package/src/store/sqlite-utils/createSelectQuery.ts +25 -0
- package/src/store/sqlite-utils/createUpdateQuery.ts +27 -0
- package/src/store/sqlite-utils/createUpsertQuery.ts +48 -0
- package/src/store/sqlite-utils/printRow.ts +19 -0
- package/src/store/types.ts +12 -0
- package/src/version.json +1 -1
- package/lib/commonjs/components/Attachment/hooks/useLoadingImage.js.map +0 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js +0 -45
- package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +0 -1
- package/lib/module/components/Attachment/hooks/useLoadingImage.js.map +0 -1
- package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js +0 -45
- package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +0 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/useConnectionRecovered.d.ts +0 -8
- package/src/components/ChannelList/hooks/listeners/useConnectionRecovered.ts +0 -41
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReadResponse } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { selectReadsForChannels } from './queries/selectReadsForChannels';
|
|
4
|
+
|
|
5
|
+
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
6
|
+
import { mapStorableToRead } from '../mappers/mapStorableToRead';
|
|
7
|
+
|
|
8
|
+
export const getReads = <
|
|
9
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
10
|
+
>({
|
|
11
|
+
channelIds,
|
|
12
|
+
}: {
|
|
13
|
+
channelIds: string[];
|
|
14
|
+
}) => {
|
|
15
|
+
const reads = selectReadsForChannels(channelIds);
|
|
16
|
+
const cidVsReads: Record<string, ReadResponse<StreamChatGenerics>[]> = {};
|
|
17
|
+
|
|
18
|
+
reads.forEach((read) => {
|
|
19
|
+
if (!cidVsReads[read.cid]) {
|
|
20
|
+
cidVsReads[read.cid] = [];
|
|
21
|
+
}
|
|
22
|
+
cidVsReads[read.cid].push(mapStorableToRead<StreamChatGenerics>(read));
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return cidVsReads;
|
|
26
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ChannelFilters, ChannelSort } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
4
|
+
import { QuickSqliteClient } from '../../QuickSqliteClient';
|
|
5
|
+
import { createSelectQuery } from '../../sqlite-utils/createSelectQuery';
|
|
6
|
+
|
|
7
|
+
import { convertFilterSortToQuery } from '../utils/convertFilterSortToQuery';
|
|
8
|
+
|
|
9
|
+
export const selectChannelIdsForFilterSort = <
|
|
10
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
11
|
+
>({
|
|
12
|
+
filters,
|
|
13
|
+
sort,
|
|
14
|
+
}: {
|
|
15
|
+
filters?: ChannelFilters<StreamChatGenerics>;
|
|
16
|
+
sort?: ChannelSort<StreamChatGenerics>;
|
|
17
|
+
}): string[] => {
|
|
18
|
+
const query = convertFilterSortToQuery({ filters, sort });
|
|
19
|
+
const results = QuickSqliteClient.executeSql.apply(
|
|
20
|
+
null,
|
|
21
|
+
createSelectQuery('channelQueries', ['*'], {
|
|
22
|
+
id: query,
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const channelIdsStr = results?.[0]?.cids;
|
|
27
|
+
return channelIdsStr ? JSON.parse(channelIdsStr) : [];
|
|
28
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QuickSqliteClient } from '../../QuickSqliteClient';
|
|
2
|
+
import { createSelectQuery } from '../../sqlite-utils/createSelectQuery';
|
|
3
|
+
import type { TableRowJoinedUser } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const selectChannels = ({
|
|
6
|
+
channelIds,
|
|
7
|
+
}: { channelIds?: string[] } = {}): TableRowJoinedUser<'channels'>[] => {
|
|
8
|
+
const query = createSelectQuery('channels', ['*'], {
|
|
9
|
+
cid: channelIds,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const result = QuickSqliteClient.executeSql.apply(null, query);
|
|
13
|
+
|
|
14
|
+
if (channelIds) {
|
|
15
|
+
return result.sort((a, b) => channelIds.indexOf(a.cid) - channelIds.indexOf(b.cid));
|
|
16
|
+
} else {
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TableRowJoinedUser } from 'src/store/types';
|
|
2
|
+
|
|
3
|
+
import { QuickSqliteClient } from '../../QuickSqliteClient';
|
|
4
|
+
import { tables } from '../../schema';
|
|
5
|
+
|
|
6
|
+
export const selectMembersForChannels = (cids: string[]): TableRowJoinedUser<'members'>[] => {
|
|
7
|
+
const questionMarks = Array(cids.length).fill('?').join(',');
|
|
8
|
+
const membersColumnNames = Object.keys(tables.members.columns)
|
|
9
|
+
.map((name) => `'${name}', a.${name}`)
|
|
10
|
+
.join(', ');
|
|
11
|
+
const userColumnNames = Object.keys(tables.users.columns)
|
|
12
|
+
.map((name) => `'${name}', b.${name}`)
|
|
13
|
+
.join(', ');
|
|
14
|
+
|
|
15
|
+
const result = QuickSqliteClient.executeSql(
|
|
16
|
+
`SELECT
|
|
17
|
+
json_object(
|
|
18
|
+
'user', json_object(
|
|
19
|
+
${userColumnNames}
|
|
20
|
+
),
|
|
21
|
+
${membersColumnNames}
|
|
22
|
+
) as value
|
|
23
|
+
FROM members a
|
|
24
|
+
LEFT JOIN
|
|
25
|
+
users b
|
|
26
|
+
ON b.id = a.userId
|
|
27
|
+
WHERE cid in (${questionMarks}) ORDER BY datetime(a.createdAt) DESC`,
|
|
28
|
+
cids,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return result.map((r) => JSON.parse(r.value));
|
|
32
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { QuickSqliteClient } from '../../QuickSqliteClient';
|
|
2
|
+
import { tables } from '../../schema';
|
|
3
|
+
import type { TableRowJoinedUser } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const selectMessagesForChannels = (cids: string[]): TableRowJoinedUser<'messages'>[] => {
|
|
6
|
+
const questionMarks = Array(cids.length).fill('?').join(',');
|
|
7
|
+
const messagesColumnNames = Object.keys(tables.messages.columns)
|
|
8
|
+
.map((name) => `'${name}', a.${name}`)
|
|
9
|
+
.join(', ');
|
|
10
|
+
const userColumnNames = Object.keys(tables.users.columns)
|
|
11
|
+
.map((name) => `'${name}', b.${name}`)
|
|
12
|
+
.join(', ');
|
|
13
|
+
|
|
14
|
+
const result = QuickSqliteClient.executeSql(
|
|
15
|
+
`SELECT
|
|
16
|
+
json_object(
|
|
17
|
+
'user', json_object(
|
|
18
|
+
${userColumnNames}
|
|
19
|
+
),
|
|
20
|
+
${messagesColumnNames}
|
|
21
|
+
) as value
|
|
22
|
+
FROM (
|
|
23
|
+
SELECT
|
|
24
|
+
*,
|
|
25
|
+
ROW_NUMBER() OVER (
|
|
26
|
+
PARTITION BY cid
|
|
27
|
+
ORDER BY datetime(createdAt) DESC
|
|
28
|
+
) RowNum
|
|
29
|
+
FROM messages
|
|
30
|
+
WHERE cid in (${questionMarks})
|
|
31
|
+
) a
|
|
32
|
+
LEFT JOIN
|
|
33
|
+
users b
|
|
34
|
+
ON b.id = a.userId
|
|
35
|
+
WHERE RowNum < 200`,
|
|
36
|
+
cids,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return result.map((r) => JSON.parse(r.value));
|
|
40
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { QuickSqliteClient } from '../../QuickSqliteClient';
|
|
2
|
+
import { tables } from '../../schema';
|
|
3
|
+
import type { TableRowJoinedUser } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const selectReactionsForMessages = (
|
|
6
|
+
messageIds: string[],
|
|
7
|
+
): TableRowJoinedUser<'reactions'>[] => {
|
|
8
|
+
const questionMarks = Array(messageIds.length).fill('?').join(',');
|
|
9
|
+
const reactionsColumnNames = Object.keys(tables.reactions.columns)
|
|
10
|
+
.map((name) => `'${name}', a.${name}`)
|
|
11
|
+
.join(', ');
|
|
12
|
+
const userColumnNames = Object.keys(tables.users.columns)
|
|
13
|
+
.map((name) => `'${name}', b.${name}`)
|
|
14
|
+
.join(', ');
|
|
15
|
+
|
|
16
|
+
const result = QuickSqliteClient.executeSql(
|
|
17
|
+
`SELECT
|
|
18
|
+
json_object(
|
|
19
|
+
'user', json_object(
|
|
20
|
+
${userColumnNames}
|
|
21
|
+
),
|
|
22
|
+
${reactionsColumnNames}
|
|
23
|
+
) as value
|
|
24
|
+
FROM reactions a
|
|
25
|
+
LEFT JOIN
|
|
26
|
+
users b
|
|
27
|
+
ON b.id = a.userId
|
|
28
|
+
WHERE a.messageId in (${questionMarks})`,
|
|
29
|
+
messageIds,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return result.map((r) => JSON.parse(r.value));
|
|
33
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { QuickSqliteClient } from '../../QuickSqliteClient';
|
|
2
|
+
import { tables } from '../../schema';
|
|
3
|
+
import type { TableRowJoinedUser } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const selectReadsForChannels = (cids: string[]): TableRowJoinedUser<'reads'>[] => {
|
|
6
|
+
const questionMarks = Array(cids.length).fill('?').join(',');
|
|
7
|
+
const readsColumnNames = Object.keys(tables.reads.columns)
|
|
8
|
+
.map((name) => `'${name}', a.${name}`)
|
|
9
|
+
.join(', ');
|
|
10
|
+
const userColumnNames = Object.keys(tables.users.columns)
|
|
11
|
+
.map((name) => `'${name}', b.${name}`)
|
|
12
|
+
.join(', ');
|
|
13
|
+
const result = QuickSqliteClient.executeSql(
|
|
14
|
+
`SELECT
|
|
15
|
+
json_object(
|
|
16
|
+
'user', json_object(
|
|
17
|
+
${userColumnNames}
|
|
18
|
+
),
|
|
19
|
+
${readsColumnNames}
|
|
20
|
+
) as value
|
|
21
|
+
FROM reads a
|
|
22
|
+
LEFT JOIN
|
|
23
|
+
users b
|
|
24
|
+
ON b.id = a.userId
|
|
25
|
+
WHERE a.cid in (${questionMarks})`,
|
|
26
|
+
cids,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
return result.map((r) => JSON.parse(r.value));
|
|
30
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { MessageResponse } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { mapMessageToStorable } from '../mappers/mapMessageToStorable';
|
|
4
|
+
import { mapReactionToStorable } from '../mappers/mapReactionToStorable';
|
|
5
|
+
import { mapUserToStorable } from '../mappers/mapUserToStorable';
|
|
6
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
7
|
+
import { createDeleteQuery } from '../sqlite-utils/createDeleteQuery';
|
|
8
|
+
import { createSelectQuery } from '../sqlite-utils/createSelectQuery';
|
|
9
|
+
import { createUpdateQuery } from '../sqlite-utils/createUpdateQuery';
|
|
10
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
11
|
+
import type { PreparedQueries } from '../types';
|
|
12
|
+
|
|
13
|
+
export const updateMessage = ({
|
|
14
|
+
flush = true,
|
|
15
|
+
message,
|
|
16
|
+
}: {
|
|
17
|
+
message: MessageResponse;
|
|
18
|
+
flush?: boolean;
|
|
19
|
+
}) => {
|
|
20
|
+
const queries: PreparedQueries[] = [];
|
|
21
|
+
|
|
22
|
+
const messages = QuickSqliteClient.executeSql.apply(
|
|
23
|
+
null,
|
|
24
|
+
createSelectQuery('messages', ['*'], {
|
|
25
|
+
id: message.id,
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
if (messages.length === 0) {
|
|
30
|
+
return queries;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
queries.push(
|
|
34
|
+
createUpdateQuery('messages', mapMessageToStorable(message), {
|
|
35
|
+
id: message.id,
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
if (message.user) {
|
|
40
|
+
queries.push(createUpsertQuery('users', mapUserToStorable(message.user)));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
queries.push(
|
|
44
|
+
createDeleteQuery('reactions', {
|
|
45
|
+
messageId: message.id,
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const latestReactions = message.latest_reactions || [];
|
|
50
|
+
const ownReactions = message.own_reactions || [];
|
|
51
|
+
|
|
52
|
+
[...latestReactions, ...ownReactions].forEach((r) => {
|
|
53
|
+
if (r.user) {
|
|
54
|
+
queries.push(createUpsertQuery('users', mapUserToStorable(r.user)));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
queries.push(createUpsertQuery('reactions', mapReactionToStorable(r)));
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (flush) {
|
|
61
|
+
QuickSqliteClient.executeSqlBatch(queries);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return queries;
|
|
65
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { MessageResponse, ReactionResponse } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { mapMessageToStorable } from '../mappers/mapMessageToStorable';
|
|
4
|
+
import { mapReactionToStorable } from '../mappers/mapReactionToStorable';
|
|
5
|
+
import { mapUserToStorable } from '../mappers/mapUserToStorable';
|
|
6
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
7
|
+
import { createUpdateQuery } from '../sqlite-utils/createUpdateQuery';
|
|
8
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
9
|
+
import type { PreparedQueries } from '../types';
|
|
10
|
+
|
|
11
|
+
export const updateReaction = ({
|
|
12
|
+
flush = true,
|
|
13
|
+
message,
|
|
14
|
+
reaction,
|
|
15
|
+
}: {
|
|
16
|
+
message: MessageResponse;
|
|
17
|
+
reaction: ReactionResponse;
|
|
18
|
+
flush?: boolean;
|
|
19
|
+
}) => {
|
|
20
|
+
const queries: PreparedQueries[] = [];
|
|
21
|
+
|
|
22
|
+
if (reaction.user) {
|
|
23
|
+
queries.push(createUpsertQuery('users', mapUserToStorable(reaction.user)));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
queries.push(
|
|
27
|
+
createUpdateQuery('reactions', mapReactionToStorable(reaction), {
|
|
28
|
+
messageId: reaction.message_id,
|
|
29
|
+
userId: reaction.user_id,
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
if (message.reaction_counts) {
|
|
34
|
+
const { reactionCounts } = mapMessageToStorable(message);
|
|
35
|
+
|
|
36
|
+
queries.push(
|
|
37
|
+
createUpdateQuery(
|
|
38
|
+
'messages',
|
|
39
|
+
{
|
|
40
|
+
reactionCounts,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: message.id,
|
|
44
|
+
},
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (flush) {
|
|
50
|
+
QuickSqliteClient.executeSqlBatch(queries);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return queries;
|
|
54
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ChannelResponse } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { mapChannelDataToStorable } from '../mappers/mapChannelDataToStorable';
|
|
4
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
5
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
6
|
+
|
|
7
|
+
export const upsertChannelData = ({
|
|
8
|
+
channel,
|
|
9
|
+
flush = true,
|
|
10
|
+
}: {
|
|
11
|
+
channel: ChannelResponse;
|
|
12
|
+
flush?: boolean;
|
|
13
|
+
}) => {
|
|
14
|
+
const query = createUpsertQuery('channels', mapChannelDataToStorable(channel));
|
|
15
|
+
if (flush) {
|
|
16
|
+
QuickSqliteClient.executeSqlBatch([query]);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return [query];
|
|
20
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ChannelAPIResponse, ChannelFilters, ChannelSort } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { upsertCidsForQuery } from './upsertCidsForQuery';
|
|
4
|
+
import { upsertMembers } from './upsertMembers';
|
|
5
|
+
|
|
6
|
+
import { upsertMessages } from './upsertMessages';
|
|
7
|
+
import { upsertReads } from './upsertReads';
|
|
8
|
+
|
|
9
|
+
import { mapChannelDataToStorable } from '../mappers/mapChannelDataToStorable';
|
|
10
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
11
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
12
|
+
import type { PreparedQueries } from '../types';
|
|
13
|
+
|
|
14
|
+
export const upsertChannels = ({
|
|
15
|
+
channels,
|
|
16
|
+
filters,
|
|
17
|
+
flush = true,
|
|
18
|
+
isLatestMessagesSet,
|
|
19
|
+
sort,
|
|
20
|
+
}: {
|
|
21
|
+
channels: ChannelAPIResponse[];
|
|
22
|
+
filters?: ChannelFilters;
|
|
23
|
+
flush?: boolean;
|
|
24
|
+
isLatestMessagesSet?: boolean;
|
|
25
|
+
sort?: ChannelSort;
|
|
26
|
+
}) => {
|
|
27
|
+
// Update the database only if the query is provided.
|
|
28
|
+
let queries: PreparedQueries[] = [];
|
|
29
|
+
|
|
30
|
+
if (filters || sort) {
|
|
31
|
+
const channelIds = channels.map((channel) => channel.channel.cid);
|
|
32
|
+
queries = queries.concat(
|
|
33
|
+
upsertCidsForQuery({
|
|
34
|
+
cids: channelIds,
|
|
35
|
+
filters,
|
|
36
|
+
flush: false,
|
|
37
|
+
sort,
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
for (const channel of channels) {
|
|
43
|
+
queries.push(createUpsertQuery('channels', mapChannelDataToStorable(channel.channel)));
|
|
44
|
+
|
|
45
|
+
const { members, messages, read } = channel;
|
|
46
|
+
queries = queries.concat(
|
|
47
|
+
upsertMembers({
|
|
48
|
+
cid: channel.channel.cid,
|
|
49
|
+
flush: false,
|
|
50
|
+
members,
|
|
51
|
+
}),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
if (read) {
|
|
55
|
+
queries = queries.concat(
|
|
56
|
+
upsertReads({
|
|
57
|
+
cid: channel.channel.cid,
|
|
58
|
+
flush: false,
|
|
59
|
+
reads: read,
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (isLatestMessagesSet) {
|
|
65
|
+
queries = queries.concat(
|
|
66
|
+
upsertMessages({
|
|
67
|
+
flush: false,
|
|
68
|
+
messages,
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (flush) {
|
|
75
|
+
QuickSqliteClient.executeSqlBatch(queries);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return queries;
|
|
79
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ChannelFilters, ChannelSort } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { convertFilterSortToQuery } from './utils/convertFilterSortToQuery';
|
|
4
|
+
|
|
5
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
6
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
7
|
+
|
|
8
|
+
export const upsertCidsForQuery = ({
|
|
9
|
+
cids,
|
|
10
|
+
filters,
|
|
11
|
+
flush = true,
|
|
12
|
+
sort,
|
|
13
|
+
}: {
|
|
14
|
+
cids: string[];
|
|
15
|
+
filters?: ChannelFilters;
|
|
16
|
+
flush?: boolean;
|
|
17
|
+
sort?: ChannelSort;
|
|
18
|
+
}) => {
|
|
19
|
+
// Update the database only if the query is provided.
|
|
20
|
+
const query = createUpsertQuery('channelQueries', {
|
|
21
|
+
cids: JSON.stringify(cids),
|
|
22
|
+
id: convertFilterSortToQuery({ filters, sort }),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
if (flush) {
|
|
26
|
+
QuickSqliteClient.executeSql.apply(null, query);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return [query];
|
|
30
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
2
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
3
|
+
|
|
4
|
+
export const upsertLastSyncedAt = ({
|
|
5
|
+
currentUserId,
|
|
6
|
+
lastSyncedAt,
|
|
7
|
+
}: {
|
|
8
|
+
currentUserId: string;
|
|
9
|
+
lastSyncedAt: string;
|
|
10
|
+
}) => {
|
|
11
|
+
const query = createUpsertQuery('userSyncStatus', {
|
|
12
|
+
lastSyncedAt,
|
|
13
|
+
userId: currentUserId,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
QuickSqliteClient.executeSql.apply(null, query);
|
|
17
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ChannelMemberResponse } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { mapMemberToStorable } from '../mappers/mapMemberToStorable';
|
|
4
|
+
import { mapUserToStorable } from '../mappers/mapUserToStorable';
|
|
5
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
6
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
7
|
+
import type { PreparedQueries } from '../types';
|
|
8
|
+
|
|
9
|
+
export const upsertMembers = ({
|
|
10
|
+
cid,
|
|
11
|
+
flush = true,
|
|
12
|
+
members,
|
|
13
|
+
}: {
|
|
14
|
+
cid: string;
|
|
15
|
+
members: ChannelMemberResponse[];
|
|
16
|
+
flush?: boolean;
|
|
17
|
+
}) => {
|
|
18
|
+
const queries: PreparedQueries[] = [];
|
|
19
|
+
|
|
20
|
+
members?.forEach((member) => {
|
|
21
|
+
if (member.user) {
|
|
22
|
+
queries.push(createUpsertQuery('users', mapUserToStorable(member.user)));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
queries.push(
|
|
26
|
+
createUpsertQuery(
|
|
27
|
+
'members',
|
|
28
|
+
mapMemberToStorable({
|
|
29
|
+
cid,
|
|
30
|
+
member,
|
|
31
|
+
}),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
if (flush) {
|
|
37
|
+
QuickSqliteClient.executeSqlBatch(queries);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return queries;
|
|
41
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { MessageResponse } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { mapMessageToStorable } from '../mappers/mapMessageToStorable';
|
|
4
|
+
import { mapReactionToStorable } from '../mappers/mapReactionToStorable';
|
|
5
|
+
import { mapUserToStorable } from '../mappers/mapUserToStorable';
|
|
6
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
7
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
8
|
+
import type { PreparedQueries } from '../types';
|
|
9
|
+
|
|
10
|
+
export const upsertMessages = ({
|
|
11
|
+
flush = true,
|
|
12
|
+
messages,
|
|
13
|
+
}: {
|
|
14
|
+
messages: MessageResponse[];
|
|
15
|
+
flush?: boolean;
|
|
16
|
+
}) => {
|
|
17
|
+
const usersToUpsert: PreparedQueries[] = [];
|
|
18
|
+
const messagesToUpsert: PreparedQueries[] = [];
|
|
19
|
+
const reactionsToUpsert: PreparedQueries[] = [];
|
|
20
|
+
|
|
21
|
+
messages?.forEach((message: MessageResponse) => {
|
|
22
|
+
messagesToUpsert.push(createUpsertQuery('messages', mapMessageToStorable(message)));
|
|
23
|
+
if (message.user) {
|
|
24
|
+
usersToUpsert.push(createUpsertQuery('users', mapUserToStorable(message.user)));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[...(message.latest_reactions || []), ...(message.own_reactions || [])].forEach((r) => {
|
|
28
|
+
if (r.user) {
|
|
29
|
+
usersToUpsert.push(createUpsertQuery('users', mapUserToStorable(r.user)));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
reactionsToUpsert.push(createUpsertQuery('reactions', mapReactionToStorable(r)));
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const finalQueries = [...messagesToUpsert, ...reactionsToUpsert, ...usersToUpsert];
|
|
37
|
+
|
|
38
|
+
if (flush) {
|
|
39
|
+
QuickSqliteClient.executeSqlBatch(finalQueries);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return finalQueries;
|
|
43
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReadResponse } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import { mapReadToStorable } from '../mappers/mapReadToStorable';
|
|
4
|
+
import { mapUserToStorable } from '../mappers/mapUserToStorable';
|
|
5
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
6
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
7
|
+
import type { PreparedQueries } from '../types';
|
|
8
|
+
|
|
9
|
+
export const upsertReads = ({
|
|
10
|
+
cid,
|
|
11
|
+
flush = true,
|
|
12
|
+
reads,
|
|
13
|
+
}: {
|
|
14
|
+
cid: string;
|
|
15
|
+
reads: ReadResponse[];
|
|
16
|
+
flush?: boolean;
|
|
17
|
+
}) => {
|
|
18
|
+
const queries: PreparedQueries[] = [];
|
|
19
|
+
|
|
20
|
+
reads?.forEach((read) => {
|
|
21
|
+
if (read.user) {
|
|
22
|
+
queries.push(createUpsertQuery('users', mapUserToStorable(read.user)));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
queries.push(
|
|
26
|
+
createUpsertQuery(
|
|
27
|
+
'reads',
|
|
28
|
+
mapReadToStorable({
|
|
29
|
+
cid,
|
|
30
|
+
read,
|
|
31
|
+
}),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
if (flush) {
|
|
37
|
+
QuickSqliteClient.executeSqlBatch(queries);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return queries;
|
|
41
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChannelFilters, ChannelSort } from 'stream-chat';
|
|
2
|
+
|
|
3
|
+
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
4
|
+
|
|
5
|
+
export const convertFilterSortToQuery = <
|
|
6
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
7
|
+
>({
|
|
8
|
+
filters,
|
|
9
|
+
sort,
|
|
10
|
+
}: {
|
|
11
|
+
filters?: ChannelFilters<StreamChatGenerics>;
|
|
12
|
+
sort?: ChannelSort<StreamChatGenerics>;
|
|
13
|
+
}) =>
|
|
14
|
+
JSON.stringify(`${filters ? JSON.stringify(filters) : ''}-${sort ? JSON.stringify(sort) : ''}`);
|