stream-chat-react-native-core 4.12.1-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 +2 -1
- package/lib/commonjs/components/Attachment/Card.js.map +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 +5 -5
- 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 +36 -32
- 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 +2 -2
- 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 +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 +2 -1
- package/lib/module/components/Attachment/Card.js.map +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 +5 -5
- 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 +36 -32
- 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 +2 -2
- 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 +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/Card.tsx +1 -0
- package/src/components/Attachment/Gallery.tsx +4 -2
- package/src/components/Attachment/Giphy.tsx +8 -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/Message/Message.tsx +1 -1
- 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
|
@@ -4,7 +4,6 @@ import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
|
4
4
|
import type { Attachment } from 'stream-chat';
|
|
5
5
|
|
|
6
6
|
import { GalleryImage } from './GalleryImage';
|
|
7
|
-
import { useLoadingImage } from './hooks/useLoadingImage';
|
|
8
7
|
import { buildGallery } from './utils/buildGallery/buildGallery';
|
|
9
8
|
|
|
10
9
|
import type { Thumbnail } from './utils/buildGallery/types';
|
|
@@ -30,6 +29,7 @@ import {
|
|
|
30
29
|
useOverlayContext,
|
|
31
30
|
} from '../../contexts/overlayContext/OverlayContext';
|
|
32
31
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
32
|
+
import { useLoadingImage } from '../../hooks/useLoadingImage';
|
|
33
33
|
import { isVideoPackageAvailable } from '../../native';
|
|
34
34
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
35
35
|
import { getUrlWithoutParams } from '../../utils/utils';
|
|
@@ -525,7 +525,9 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
525
525
|
videos: nextVideos,
|
|
526
526
|
} = nextProps;
|
|
527
527
|
|
|
528
|
-
const messageEqual =
|
|
528
|
+
const messageEqual =
|
|
529
|
+
prevMessage?.id === nextMessage?.id &&
|
|
530
|
+
`${prevMessage?.updated_at}` === `${nextMessage?.updated_at}`;
|
|
529
531
|
if (!messageEqual) return false;
|
|
530
532
|
|
|
531
533
|
const groupStylesEqual =
|
|
@@ -3,8 +3,6 @@ import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import type { Attachment } from 'stream-chat';
|
|
5
5
|
|
|
6
|
-
import { useLoadingImage } from './hooks/useLoadingImage';
|
|
7
|
-
|
|
8
6
|
import {
|
|
9
7
|
ImageGalleryContextValue,
|
|
10
8
|
useImageGalleryContext,
|
|
@@ -22,6 +20,7 @@ import {
|
|
|
22
20
|
useOverlayContext,
|
|
23
21
|
} from '../../contexts/overlayContext/OverlayContext';
|
|
24
22
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
23
|
+
import { useLoadingImage } from '../../hooks/useLoadingImage';
|
|
25
24
|
import { GiphyIcon } from '../../icons';
|
|
26
25
|
import { Lightning } from '../../icons/Lightning';
|
|
27
26
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
@@ -392,11 +391,13 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
392
391
|
attachment: { actions: prevActions, image_url: prevImageUrl, thumb_url: prevThumbUrl },
|
|
393
392
|
giphyVersion: prevGiphyVersion,
|
|
394
393
|
isMyMessage: prevIsMyMessage,
|
|
394
|
+
message: prevMessage,
|
|
395
395
|
} = prevProps;
|
|
396
396
|
const {
|
|
397
397
|
attachment: { actions: nextActions, image_url: nextImageUrl, thumb_url: nextThumbUrl },
|
|
398
398
|
giphyVersion: nextGiphyVersion,
|
|
399
399
|
isMyMessage: nextIsMyMessage,
|
|
400
|
+
message: nextMessage,
|
|
400
401
|
} = nextProps;
|
|
401
402
|
|
|
402
403
|
const imageUrlEqual = prevImageUrl === nextImageUrl;
|
|
@@ -419,6 +420,11 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
419
420
|
const isMyMessageEqual = prevIsMyMessage === nextIsMyMessage;
|
|
420
421
|
if (!isMyMessageEqual) return false;
|
|
421
422
|
|
|
423
|
+
const messageEqual =
|
|
424
|
+
prevMessage?.id === nextMessage?.id &&
|
|
425
|
+
`${prevMessage?.updated_at}` === `${nextMessage?.updated_at}`;
|
|
426
|
+
|
|
427
|
+
if (!messageEqual) return false;
|
|
422
428
|
return true;
|
|
423
429
|
};
|
|
424
430
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Image, ImageStyle, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
3
|
import Svg, { Circle, CircleProps } from 'react-native-svg';
|
|
4
4
|
|
|
5
5
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
6
|
+
import { useLoadingImage } from '../../hooks/useLoadingImage';
|
|
6
7
|
import { getResizedImageUrl } from '../../utils/getResizedImageUrl';
|
|
7
8
|
|
|
8
9
|
const randomImageBaseUrl = 'https://getstream.io/random_png/';
|
|
@@ -68,7 +69,7 @@ export const Avatar: React.FC<AvatarProps> = (props) => {
|
|
|
68
69
|
},
|
|
69
70
|
} = useTheme();
|
|
70
71
|
|
|
71
|
-
const
|
|
72
|
+
const { isLoadingImageError, setLoadingImageError } = useLoadingImage();
|
|
72
73
|
|
|
73
74
|
return (
|
|
74
75
|
<View>
|
|
@@ -84,37 +85,50 @@ export const Avatar: React.FC<AvatarProps> = (props) => {
|
|
|
84
85
|
containerStyle,
|
|
85
86
|
]}
|
|
86
87
|
>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
88
|
+
{isLoadingImageError ? (
|
|
89
|
+
<View
|
|
90
|
+
style={{
|
|
91
|
+
backgroundColor: '#ececec',
|
|
92
|
+
borderRadius: size / 2,
|
|
93
|
+
height: size,
|
|
94
|
+
width: size,
|
|
95
|
+
}}
|
|
96
|
+
/>
|
|
97
|
+
) : (
|
|
98
|
+
<Image
|
|
99
|
+
accessibilityLabel={testID || 'Avatar Image'}
|
|
100
|
+
onError={() => setLoadingImageError(true)}
|
|
101
|
+
source={{
|
|
102
|
+
uri:
|
|
103
|
+
!imageProp ||
|
|
104
|
+
imageProp.includes(randomImageBaseUrl) ||
|
|
105
|
+
imageProp.includes(randomSvgBaseUrl)
|
|
106
|
+
? imageProp?.includes(streamCDN)
|
|
107
|
+
? imageProp
|
|
108
|
+
: `${randomImageBaseUrl}${
|
|
109
|
+
name ? `?name=${getInitials(name)}&size=${size}` : ''
|
|
110
|
+
}`
|
|
111
|
+
: getResizedImageUrl({
|
|
112
|
+
height: size,
|
|
113
|
+
url: imageProp,
|
|
114
|
+
width: size,
|
|
115
|
+
}),
|
|
116
|
+
}}
|
|
117
|
+
style={[
|
|
118
|
+
image,
|
|
119
|
+
size
|
|
120
|
+
? {
|
|
121
|
+
backgroundColor: '#ececec',
|
|
122
|
+
borderRadius: size / 2,
|
|
100
123
|
height: size,
|
|
101
|
-
url: imageProp,
|
|
102
124
|
width: size,
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
height: size,
|
|
111
|
-
width: size,
|
|
112
|
-
}
|
|
113
|
-
: {},
|
|
114
|
-
imageStyle,
|
|
115
|
-
]}
|
|
116
|
-
testID={testID || 'avatar-image'}
|
|
117
|
-
/>
|
|
125
|
+
}
|
|
126
|
+
: {},
|
|
127
|
+
imageStyle,
|
|
128
|
+
]}
|
|
129
|
+
testID={testID || 'avatar-image'}
|
|
130
|
+
/>
|
|
131
|
+
)}
|
|
118
132
|
</View>
|
|
119
133
|
{online && (
|
|
120
134
|
<View
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Image, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
5
|
+
import { useLoadingImage } from '../../hooks/useLoadingImage';
|
|
5
6
|
import { getResizedImageUrl } from '../../utils/getResizedImageUrl';
|
|
6
7
|
|
|
7
8
|
const randomImageBaseUrl = 'https://getstream.io/random_png/';
|
|
@@ -44,8 +45,7 @@ export const GroupAvatar: React.FC<GroupAvatarProps> = (props) => {
|
|
|
44
45
|
},
|
|
45
46
|
} = useTheme();
|
|
46
47
|
|
|
47
|
-
const
|
|
48
|
-
|
|
48
|
+
const { isLoadingImageError, setLoadingImageError } = useLoadingImage();
|
|
49
49
|
/**
|
|
50
50
|
* [
|
|
51
51
|
* [
|
|
@@ -115,24 +115,33 @@ export const GroupAvatar: React.FC<GroupAvatarProps> = (props) => {
|
|
|
115
115
|
]}
|
|
116
116
|
testID={testID || 'group-avatar'}
|
|
117
117
|
>
|
|
118
|
-
{
|
|
118
|
+
{isLoadingImageError ? (
|
|
119
119
|
<View
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
120
|
+
style={{
|
|
121
|
+
backgroundColor: '#ececec',
|
|
122
|
+
borderRadius: size / 2,
|
|
123
|
+
height: size,
|
|
124
|
+
width: size,
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
) : (
|
|
128
|
+
avatarImages.map((column, colIndex) => (
|
|
129
|
+
<View
|
|
130
|
+
key={`avatar-column-${colIndex}`}
|
|
131
|
+
style={[
|
|
132
|
+
styles.flex,
|
|
133
|
+
{
|
|
134
|
+
flexDirection: imagesOrNames.length === 2 ? 'column' : 'row',
|
|
135
|
+
},
|
|
136
|
+
]}
|
|
137
|
+
>
|
|
138
|
+
{column.map(({ height, name, url, width }, rowIndex) => (
|
|
139
|
+
<Image
|
|
140
|
+
accessibilityLabel={testID || 'Avatar Image'}
|
|
141
|
+
key={`avatar-${url}-${rowIndex}`}
|
|
142
|
+
onError={() => setLoadingImageError(true)}
|
|
143
|
+
source={{
|
|
144
|
+
uri: url.includes(randomSvgBaseUrl)
|
|
136
145
|
? url.includes(streamCDN)
|
|
137
146
|
? url
|
|
138
147
|
: `${randomImageBaseUrl}${
|
|
@@ -143,21 +152,23 @@ export const GroupAvatar: React.FC<GroupAvatarProps> = (props) => {
|
|
|
143
152
|
url,
|
|
144
153
|
width,
|
|
145
154
|
}),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
}}
|
|
156
|
+
style={[
|
|
157
|
+
image,
|
|
158
|
+
size
|
|
159
|
+
? {
|
|
160
|
+
backgroundColor: '#ececec',
|
|
161
|
+
height,
|
|
162
|
+
width,
|
|
163
|
+
}
|
|
164
|
+
: {},
|
|
165
|
+
]}
|
|
166
|
+
testID={`group-avatar-image-${colIndex}-${rowIndex}`}
|
|
167
|
+
/>
|
|
168
|
+
))}
|
|
169
|
+
</View>
|
|
170
|
+
))
|
|
171
|
+
)}
|
|
161
172
|
</View>
|
|
162
173
|
);
|
|
163
174
|
};
|
|
@@ -178,12 +178,6 @@ const debounceOptions = {
|
|
|
178
178
|
trailing: true,
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
/**
|
|
182
|
-
* Number of unread messages to show in first frame, when channel loads at first
|
|
183
|
-
* unread message. Only applicable if unread count > scrollToFirstUnreadThreshold.
|
|
184
|
-
*/
|
|
185
|
-
const unreadMessagesOnInitialLoadLimit = 2;
|
|
186
|
-
|
|
187
181
|
export type ChannelPropsWithContext<
|
|
188
182
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
189
183
|
> = Pick<ChannelContextValue<StreamChatGenerics>, 'channel'> &
|
|
@@ -341,11 +335,6 @@ export type ChannelPropsWithContext<
|
|
|
341
335
|
channelId: string,
|
|
342
336
|
updatedMessage: Parameters<StreamChat<StreamChatGenerics>['updateMessage']>[0],
|
|
343
337
|
) => ReturnType<StreamChat<StreamChatGenerics>['updateMessage']>;
|
|
344
|
-
/**
|
|
345
|
-
* E.g. Once unread count exceeds 255, display unread count as 255+ instead of actual count.
|
|
346
|
-
* Also 255 is the limit per Stream chat channel for unread count.
|
|
347
|
-
*/
|
|
348
|
-
globalUnreadCountLimit?: number;
|
|
349
338
|
/**
|
|
350
339
|
* When true, messageList will be scrolled at first unread message, when opened.
|
|
351
340
|
*/
|
|
@@ -377,6 +366,9 @@ export type ChannelPropsWithContext<
|
|
|
377
366
|
*/
|
|
378
367
|
LoadingErrorIndicator?: React.ComponentType<LoadingErrorProps>;
|
|
379
368
|
maxMessageLength?: number;
|
|
369
|
+
/**
|
|
370
|
+
* Load the channel at a specified message instead of the most recent message.
|
|
371
|
+
*/
|
|
380
372
|
messageId?: string;
|
|
381
373
|
newMessageStateUpdateThrottleInterval?: number;
|
|
382
374
|
overrideOwnCapabilities?: Partial<OwnCapabilitiesContextValue>;
|
|
@@ -441,7 +433,6 @@ const ChannelWithContext = <
|
|
|
441
433
|
Giphy = GiphyDefault,
|
|
442
434
|
giphyEnabled,
|
|
443
435
|
giphyVersion = 'fixed_height',
|
|
444
|
-
globalUnreadCountLimit = 255,
|
|
445
436
|
handleBlock,
|
|
446
437
|
handleCopy,
|
|
447
438
|
handleDelete,
|
|
@@ -575,12 +566,18 @@ const ChannelWithContext = <
|
|
|
575
566
|
|
|
576
567
|
const [syncingChannel, setSyncingChannel] = useState(false);
|
|
577
568
|
|
|
578
|
-
|
|
569
|
+
/**
|
|
570
|
+
* Flag to track if we know for sure that there are no more recent messages to load.
|
|
571
|
+
* This is necessary to avoid unnecessary api calls to load recent messages on pagination.
|
|
572
|
+
*/
|
|
573
|
+
const [hasNoMoreRecentMessagesToLoad, setHasNoMoreRecentMessagesToLoad] = useState(true);
|
|
574
|
+
|
|
575
|
+
const { setTargetedMessage, targetedMessage } = useTargetedMessage();
|
|
579
576
|
|
|
580
577
|
const channelId = channel?.id || '';
|
|
581
578
|
useEffect(() => {
|
|
582
579
|
const initChannel = () => {
|
|
583
|
-
if (!channel || !shouldSyncChannel) return;
|
|
580
|
+
if (!channel || !shouldSyncChannel || channel.staticState) return;
|
|
584
581
|
/**
|
|
585
582
|
* Loading channel at first unread message requires channel to be initialized in the first place,
|
|
586
583
|
* since we use read state on channel to decide what offset to load channel at.
|
|
@@ -593,7 +590,7 @@ const ChannelWithContext = <
|
|
|
593
590
|
}
|
|
594
591
|
|
|
595
592
|
if (messageId) {
|
|
596
|
-
|
|
593
|
+
loadChannelAroundMessage({ messageId });
|
|
597
594
|
return;
|
|
598
595
|
}
|
|
599
596
|
|
|
@@ -798,114 +795,82 @@ const ChannelWithContext = <
|
|
|
798
795
|
};
|
|
799
796
|
}, [channelId, connectionChangedHandler, connectionRecoveredHandler, handleEvent]);
|
|
800
797
|
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
798
|
+
const channelQueryCallRef = useRef(
|
|
799
|
+
async (
|
|
800
|
+
queryCall: () => Promise<void>,
|
|
801
|
+
onAfterQueryCall: (() => void) | undefined = undefined,
|
|
802
|
+
) => {
|
|
803
|
+
setError(false);
|
|
804
|
+
try {
|
|
805
|
+
await queryCall();
|
|
806
|
+
setLastRead(new Date());
|
|
807
|
+
setHasMore(true);
|
|
808
|
+
copyChannelState();
|
|
809
|
+
onAfterQueryCall?.();
|
|
810
|
+
} catch (err) {
|
|
811
|
+
if (err instanceof Error) {
|
|
812
|
+
setError(err);
|
|
813
|
+
} else {
|
|
814
|
+
setError(true);
|
|
815
|
+
}
|
|
816
|
+
setLoading(false);
|
|
817
|
+
setLastRead(new Date());
|
|
816
818
|
}
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
}
|
|
820
|
-
};
|
|
819
|
+
},
|
|
820
|
+
);
|
|
821
821
|
|
|
822
822
|
/**
|
|
823
|
-
* Loads channel at first unread
|
|
823
|
+
* Loads channel at first unread message.
|
|
824
824
|
*/
|
|
825
825
|
const loadChannelAtFirstUnreadMessage = () => {
|
|
826
826
|
if (!channel) return;
|
|
827
827
|
const unreadCount = channel.countUnread();
|
|
828
828
|
if (unreadCount <= scrollToFirstUnreadThreshold) return;
|
|
829
|
+
// temporarily clear existing messages so that messageList component gets a list change and does not scroll to any unread message first before loading completes
|
|
830
|
+
setMessages([]);
|
|
831
|
+
// query for messages around the last read date
|
|
832
|
+
return channelQueryCallRef.current(async () => {
|
|
833
|
+
setLoading(true);
|
|
834
|
+
const lastReadDate = channel.lastRead() || new Date(0);
|
|
835
|
+
await channel.query({
|
|
836
|
+
messages: {
|
|
837
|
+
created_at_around: lastReadDate,
|
|
838
|
+
limit: 25,
|
|
839
|
+
},
|
|
840
|
+
});
|
|
841
|
+
setLoading(false);
|
|
842
|
+
});
|
|
843
|
+
};
|
|
829
844
|
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
* message. So 2nd message in list is the first unread message. We can safely assume that 2nd message in list
|
|
844
|
-
* will be visible to user when list loads.
|
|
845
|
-
*/
|
|
846
|
-
const offset = unreadCount - unreadMessagesOnInitialLoadLimit;
|
|
847
|
-
await query(offset, 30);
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* If the number of messages are not enough to fill the screen (we are making an assumption here that on overage 4 messages
|
|
851
|
-
* are enough to fill the screen), then we need to fetch some more messages on recent side.
|
|
852
|
-
*/
|
|
853
|
-
if (
|
|
854
|
-
channel.state.messages.length &&
|
|
855
|
-
channel.state.messages.length <= scrollToFirstUnreadThreshold &&
|
|
856
|
-
!channel.state.isUpToDate
|
|
857
|
-
) {
|
|
858
|
-
const mostRecentMessage = channel.state.messages[channel.state.messages.length - 1];
|
|
859
|
-
await queryAfterMessage(mostRecentMessage.id, 10 - channel.state.messages.length);
|
|
860
|
-
}
|
|
861
|
-
} else {
|
|
862
|
-
/**
|
|
863
|
-
* If the unread count is 255, then we don't have exact unread count anymore, to determine the offset for querying messages.
|
|
864
|
-
* In this case we are going to query messages using date params instead of offset-limit e.g., created_at_before_or_equal
|
|
865
|
-
* So we query 30 messages before the last time user read the channel - channel.lastRead()
|
|
866
|
-
*/
|
|
867
|
-
await channel.query({
|
|
868
|
-
messages: {
|
|
869
|
-
created_at_before_or_equal: channel.lastRead() || new Date(0),
|
|
870
|
-
limit: 30,
|
|
871
|
-
},
|
|
872
|
-
});
|
|
873
|
-
|
|
874
|
-
/**
|
|
875
|
-
* If the number of messages are not enough to fill the screen (we are making an assumption here that on overage 4 messages
|
|
876
|
-
* are enough to fill the screen), then we need to fetch some more messages on recent side.
|
|
877
|
-
*/
|
|
878
|
-
if (
|
|
879
|
-
channel.state.messages.length <= unreadMessagesOnInitialLoadLimit &&
|
|
880
|
-
!channel.state.isUpToDate
|
|
881
|
-
) {
|
|
882
|
-
if (channel.state.messages.length > 0) {
|
|
883
|
-
const mostRecentMessage = channel.state.messages[channel.state.messages.length - 1];
|
|
884
|
-
await queryAfterMessage(mostRecentMessage.id, 5);
|
|
845
|
+
/**
|
|
846
|
+
* Loads channel around a specific message
|
|
847
|
+
*
|
|
848
|
+
* @param messageId If undefined, channel will be loaded at most recent message.
|
|
849
|
+
*/
|
|
850
|
+
const loadChannelAroundMessage: ChannelContextValue<StreamChatGenerics>['loadChannelAroundMessage'] =
|
|
851
|
+
({ messageId }) =>
|
|
852
|
+
channelQueryCallRef.current(
|
|
853
|
+
async () => {
|
|
854
|
+
setHasNoMoreRecentMessagesToLoad(false); // we are jumping to a message, hence we do not know for sure anymore if there are no more recent messages
|
|
855
|
+
setLoading(true);
|
|
856
|
+
if (messageId) {
|
|
857
|
+
await channel.state.loadMessageIntoState(messageId);
|
|
885
858
|
} else {
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
* So simply fetch some messages after the lastRead datetime.
|
|
889
|
-
* We are keeping the limit as 10 here, as opposed to 30 in cases above. The reason being, we want the list
|
|
890
|
-
* to be scrolled upto first unread message. So in this case we will need the scroll to start at top of the list.
|
|
891
|
-
* React native provides a prop `initialScrollIndex` on FlatList, but it doesn't really work well
|
|
892
|
-
* especially for dynamic sized content. So when the list loads, we are just going to manually scroll
|
|
893
|
-
* to top of the list - flRef.current.scrollToEnd(). This autoscroll behavior is not great in general, but its less
|
|
894
|
-
* bad for scrolling up 10 messages than scrolling up 30 messages.
|
|
895
|
-
*/
|
|
896
|
-
await channel.query({
|
|
897
|
-
messages: {
|
|
898
|
-
created_at_after: channel.lastRead() || new Date(0),
|
|
899
|
-
limit: 10,
|
|
900
|
-
},
|
|
901
|
-
});
|
|
859
|
+
await channel.state.loadMessageIntoState('latest');
|
|
860
|
+
channel.state.setIsUpToDate(true);
|
|
902
861
|
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
862
|
+
setLoading(false);
|
|
863
|
+
},
|
|
864
|
+
() => {
|
|
865
|
+
if (messageId) {
|
|
866
|
+
setTargetedMessage(messageId);
|
|
867
|
+
}
|
|
868
|
+
},
|
|
869
|
+
);
|
|
907
870
|
|
|
908
871
|
/**
|
|
872
|
+
* @deprecated use loadChannelAroundMessage instead
|
|
873
|
+
*
|
|
909
874
|
* Loads channel at specific message
|
|
910
875
|
*
|
|
911
876
|
* @param messageId If undefined, channel will be loaded at most recent message.
|
|
@@ -917,7 +882,7 @@ const ChannelWithContext = <
|
|
|
917
882
|
before = 30,
|
|
918
883
|
messageId,
|
|
919
884
|
}) =>
|
|
920
|
-
|
|
885
|
+
channelQueryCallRef.current(async () => {
|
|
921
886
|
await queryAtMessage({ after, before, messageId });
|
|
922
887
|
|
|
923
888
|
if (messageId) {
|
|
@@ -926,12 +891,14 @@ const ChannelWithContext = <
|
|
|
926
891
|
});
|
|
927
892
|
|
|
928
893
|
const loadChannel = () =>
|
|
929
|
-
|
|
894
|
+
channelQueryCallRef.current(async () => {
|
|
930
895
|
if (!channel?.initialized || !channel.state.isUpToDate) {
|
|
931
896
|
await channel?.watch();
|
|
897
|
+
setHasNoMoreRecentMessagesToLoad(true);
|
|
932
898
|
channel?.state.setIsUpToDate(true);
|
|
899
|
+
} else {
|
|
900
|
+
await channel.state.loadMessageIntoState('latest');
|
|
933
901
|
}
|
|
934
|
-
|
|
935
902
|
return;
|
|
936
903
|
});
|
|
937
904
|
|
|
@@ -1048,6 +1015,7 @@ const ChannelWithContext = <
|
|
|
1048
1015
|
finalMessages = state.messages;
|
|
1049
1016
|
}
|
|
1050
1017
|
|
|
1018
|
+
setHasNoMoreRecentMessagesToLoad(true);
|
|
1051
1019
|
channel.state.setIsUpToDate(true);
|
|
1052
1020
|
|
|
1053
1021
|
channel.state.clearMessages();
|
|
@@ -1080,29 +1048,16 @@ const ChannelWithContext = <
|
|
|
1080
1048
|
};
|
|
1081
1049
|
|
|
1082
1050
|
const reloadChannel = () =>
|
|
1083
|
-
|
|
1084
|
-
|
|
1051
|
+
channelQueryCallRef.current(async () => {
|
|
1052
|
+
setLoading(true);
|
|
1053
|
+
await channel.state.loadMessageIntoState('latest');
|
|
1054
|
+
setLoading(false);
|
|
1055
|
+
setHasNoMoreRecentMessagesToLoad(true);
|
|
1085
1056
|
channel?.state.setIsUpToDate(true);
|
|
1086
1057
|
});
|
|
1087
1058
|
|
|
1088
1059
|
/**
|
|
1089
|
-
*
|
|
1090
|
-
*/
|
|
1091
|
-
const query = async (offset = 0, limit = 30) => {
|
|
1092
|
-
if (!channel) return;
|
|
1093
|
-
channel.state.clearMessages();
|
|
1094
|
-
|
|
1095
|
-
await channel.query({
|
|
1096
|
-
messages: {
|
|
1097
|
-
limit,
|
|
1098
|
-
offset,
|
|
1099
|
-
},
|
|
1100
|
-
watch: true,
|
|
1101
|
-
});
|
|
1102
|
-
channel.state.setIsUpToDate(offset === 0);
|
|
1103
|
-
};
|
|
1104
|
-
|
|
1105
|
-
/**
|
|
1060
|
+
* @deprecated
|
|
1106
1061
|
* Makes a query to load messages at particular message id.
|
|
1107
1062
|
*
|
|
1108
1063
|
* @param messageId Targeted message id
|
|
@@ -1135,6 +1090,7 @@ const ChannelWithContext = <
|
|
|
1135
1090
|
};
|
|
1136
1091
|
|
|
1137
1092
|
/**
|
|
1093
|
+
* @deprecated
|
|
1138
1094
|
* Makes a query to load messages before particular message id.
|
|
1139
1095
|
*
|
|
1140
1096
|
* @param messageId Targeted message id
|
|
@@ -1155,6 +1111,7 @@ const ChannelWithContext = <
|
|
|
1155
1111
|
};
|
|
1156
1112
|
|
|
1157
1113
|
/**
|
|
1114
|
+
* @deprecated
|
|
1158
1115
|
* Makes a query to load messages later than particular message id.
|
|
1159
1116
|
*
|
|
1160
1117
|
* @param messageId Targeted message id
|
|
@@ -1415,7 +1372,6 @@ const ChannelWithContext = <
|
|
|
1415
1372
|
loadMoreFinished(updatedHasMore, channel.state.messages);
|
|
1416
1373
|
}
|
|
1417
1374
|
} catch (err) {
|
|
1418
|
-
console.warn('Message pagination request failed with error', err);
|
|
1419
1375
|
if (err instanceof Error) {
|
|
1420
1376
|
setError(err);
|
|
1421
1377
|
} else {
|
|
@@ -1428,7 +1384,7 @@ const ChannelWithContext = <
|
|
|
1428
1384
|
|
|
1429
1385
|
const loadMoreRecent: PaginatedMessageListContextValue<StreamChatGenerics>['loadMoreRecent'] =
|
|
1430
1386
|
async (limit = 5) => {
|
|
1431
|
-
if (
|
|
1387
|
+
if (hasNoMoreRecentMessagesToLoad) {
|
|
1432
1388
|
return;
|
|
1433
1389
|
}
|
|
1434
1390
|
|
|
@@ -1443,7 +1399,14 @@ const ChannelWithContext = <
|
|
|
1443
1399
|
|
|
1444
1400
|
try {
|
|
1445
1401
|
if (channel) {
|
|
1446
|
-
await
|
|
1402
|
+
const state = await channel.query({
|
|
1403
|
+
messages: {
|
|
1404
|
+
id_gte: recentMessage.id,
|
|
1405
|
+
limit,
|
|
1406
|
+
},
|
|
1407
|
+
watch: true,
|
|
1408
|
+
});
|
|
1409
|
+
setHasNoMoreRecentMessagesToLoad(state.messages.length < limit);
|
|
1447
1410
|
loadMoreRecentFinished(channel.state.messages);
|
|
1448
1411
|
}
|
|
1449
1412
|
} catch (err) {
|
|
@@ -1599,6 +1562,7 @@ const ChannelWithContext = <
|
|
|
1599
1562
|
isModerator,
|
|
1600
1563
|
isOwner,
|
|
1601
1564
|
lastRead,
|
|
1565
|
+
loadChannelAroundMessage,
|
|
1602
1566
|
loadChannelAtMessage,
|
|
1603
1567
|
loading,
|
|
1604
1568
|
LoadingIndicator,
|
|
@@ -1665,6 +1629,7 @@ const ChannelWithContext = <
|
|
|
1665
1629
|
const messageListContext = useCreatePaginatedMessageListContext({
|
|
1666
1630
|
channelId,
|
|
1667
1631
|
hasMore,
|
|
1632
|
+
hasNoMoreRecentMessagesToLoad,
|
|
1668
1633
|
loadingMore: loadingMoreProp !== undefined ? loadingMoreProp : loadingMore,
|
|
1669
1634
|
loadingMoreRecent:
|
|
1670
1635
|
loadingMoreRecentProp !== undefined ? loadingMoreRecentProp : loadingMoreRecent,
|
|
@@ -1712,7 +1677,7 @@ const ChannelWithContext = <
|
|
|
1712
1677
|
handleThreadReply,
|
|
1713
1678
|
ImageLoadingFailedIndicator,
|
|
1714
1679
|
ImageLoadingIndicator,
|
|
1715
|
-
initialScrollToFirstUnreadMessage,
|
|
1680
|
+
initialScrollToFirstUnreadMessage: !messageId && initialScrollToFirstUnreadMessage, // when messageId is set, we scroll to the messageId instead of first unread
|
|
1716
1681
|
InlineDateSeparator,
|
|
1717
1682
|
InlineUnreadIndicator,
|
|
1718
1683
|
isAttachmentEqual,
|