stream-chat-react-native-core 5.5.1-beta.1 → 5.6.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Attachment/Attachment.js +1 -1
- package/lib/commonjs/components/Attachment/AttachmentActions.js +1 -1
- package/lib/commonjs/components/Attachment/AudioAttachment.js +1 -1
- package/lib/commonjs/components/Attachment/Card.js +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +1 -1
- package/lib/commonjs/components/Attachment/GalleryImage.js +20 -4
- package/lib/commonjs/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js +1 -1
- package/lib/commonjs/components/Attachment/VideoThumbnail.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +1 -1
- package/lib/commonjs/components/Channel/Channel.js +537 -155
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +6 -0
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +5 -16
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +1 -1
- package/lib/commonjs/components/ChannelList/Skeleton.js +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +112 -42
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
- package/lib/commonjs/components/Chat/Chat.js +17 -21
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +2 -4
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/ImageBackground.js +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +1 -1
- package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDot.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDots.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/commonjs/components/Message/Message.js +22 -11
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +15 -13
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +9 -30
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActions.js +20 -18
- package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/commonjs/components/MessageInput/AttachButton.js +1 -1
- package/lib/commonjs/components/MessageInput/CommandsButton.js +1 -1
- package/lib/commonjs/components/MessageInput/CooldownTimer.js +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +32 -22
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +52 -20
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +40 -28
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +2 -2
- package/lib/commonjs/components/MessageInput/SendButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
- package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputEditingStateHeader.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputGiphySearch.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputReplyStateHeader.js +1 -1
- package/lib/commonjs/components/MessageList/DateHeader.js +1 -1
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +1 -1
- package/lib/commonjs/components/MessageList/MessageSystem.js +1 -1
- package/lib/commonjs/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
- package/lib/commonjs/components/ProgressControl/ProgressControl.js +1 -1
- package/lib/commonjs/components/RTLComponents/WritingDirectionAwareText.js +1 -1
- package/lib/commonjs/components/Reply/Reply.js +1 -1
- package/lib/commonjs/components/Spinner/Spinner.js +1 -1
- package/lib/commonjs/components/Thread/Thread.js +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +1 -1
- package/lib/commonjs/components/index.js +0 -13
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +3 -3
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/debugContext/DebugContext.js +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +23 -14
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +3 -3
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +1 -1
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +1 -1
- package/lib/commonjs/contexts/themeContext/ThemeContext.js +1 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.js +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/commonjs/contexts/typingContext/TypingContext.js +1 -1
- package/lib/commonjs/hooks/useTranslatedMessage.js +1 -1
- package/lib/commonjs/hooks/useTranslatedMessage.js.map +1 -1
- package/lib/commonjs/icons/ArrowRight.js +1 -1
- package/lib/commonjs/icons/AtMentions.js +1 -1
- package/lib/commonjs/icons/Attach.js +1 -1
- package/lib/commonjs/icons/Audio.js +1 -1
- package/lib/commonjs/icons/CSV.js +1 -1
- package/lib/commonjs/icons/Camera.js +1 -1
- package/lib/commonjs/icons/Check.js +1 -1
- package/lib/commonjs/icons/CheckAll.js +1 -1
- package/lib/commonjs/icons/CheckSend.js +1 -1
- package/lib/commonjs/icons/CircleClose.js +1 -1
- package/lib/commonjs/icons/CirclePlus.js +1 -1
- package/lib/commonjs/icons/CircleRight.js +1 -1
- package/lib/commonjs/icons/Close.js +1 -1
- package/lib/commonjs/icons/Copy.js +1 -1
- package/lib/commonjs/icons/CurveLineLeftUp.js +1 -1
- package/lib/commonjs/icons/DOC.js +1 -1
- package/lib/commonjs/icons/DOCX.js +1 -1
- package/lib/commonjs/icons/Delete.js +1 -1
- package/lib/commonjs/icons/Down.js +1 -1
- package/lib/commonjs/icons/DownloadArrow.js +1 -1
- package/lib/commonjs/icons/DownloadCloud.js +1 -1
- package/lib/commonjs/icons/Edit.js +1 -1
- package/lib/commonjs/icons/Error.js +1 -1
- package/lib/commonjs/icons/Eye.js +1 -1
- package/lib/commonjs/icons/Flag.js +1 -1
- package/lib/commonjs/icons/Folder.js +1 -1
- package/lib/commonjs/icons/GenericFile.js +1 -1
- package/lib/commonjs/icons/GiphyIcon.js +1 -1
- package/lib/commonjs/icons/Grid.js +1 -1
- package/lib/commonjs/icons/Group.js +1 -1
- package/lib/commonjs/icons/HTML.js +1 -1
- package/lib/commonjs/icons/Imgur.js +1 -1
- package/lib/commonjs/icons/LOLReaction.js +1 -1
- package/lib/commonjs/icons/Lightning.js +1 -1
- package/lib/commonjs/icons/Link.js +1 -1
- package/lib/commonjs/icons/Loading.js +1 -1
- package/lib/commonjs/icons/Logo.js +1 -1
- package/lib/commonjs/icons/LoveReaction.js +1 -1
- package/lib/commonjs/icons/MD.js +1 -1
- package/lib/commonjs/icons/MailOpen.js +1 -1
- package/lib/commonjs/icons/MenuPointHorizontal.js +1 -1
- package/lib/commonjs/icons/MenuPointVertical.js +1 -1
- package/lib/commonjs/icons/MessageFlag.js +1 -1
- package/lib/commonjs/icons/MessageIcon.js +1 -1
- package/lib/commonjs/icons/Mute.js +1 -1
- package/lib/commonjs/icons/Notification.js +1 -1
- package/lib/commonjs/icons/ODT.js +1 -1
- package/lib/commonjs/icons/PDF.js +1 -1
- package/lib/commonjs/icons/PPT.js +1 -1
- package/lib/commonjs/icons/PPTX.js +1 -1
- package/lib/commonjs/icons/Pause.js +1 -1
- package/lib/commonjs/icons/Picture.js +1 -1
- package/lib/commonjs/icons/Pin.js +1 -1
- package/lib/commonjs/icons/PinHeader.js +1 -1
- package/lib/commonjs/icons/Play.js +1 -1
- package/lib/commonjs/icons/RAR.js +1 -1
- package/lib/commonjs/icons/RTF.js +1 -1
- package/lib/commonjs/icons/Recorder.js +1 -1
- package/lib/commonjs/icons/Refresh.js +1 -1
- package/lib/commonjs/icons/SEVEN_Z.js +1 -1
- package/lib/commonjs/icons/Search.js +1 -1
- package/lib/commonjs/icons/SendRight.js +1 -1
- package/lib/commonjs/icons/SendUp.js +1 -1
- package/lib/commonjs/icons/Share.js +1 -1
- package/lib/commonjs/icons/ShareRightArrow.js +1 -1
- package/lib/commonjs/icons/Smile.js +1 -1
- package/lib/commonjs/icons/Sound.js +1 -1
- package/lib/commonjs/icons/TAR.js +1 -1
- package/lib/commonjs/icons/TXT.js +1 -1
- package/lib/commonjs/icons/ThreadReply.js +1 -1
- package/lib/commonjs/icons/ThumbsDownReaction.js +1 -1
- package/lib/commonjs/icons/ThumbsUpReaction.js +1 -1
- package/lib/commonjs/icons/Time.js +1 -1
- package/lib/commonjs/icons/Unknown.js +1 -1
- package/lib/commonjs/icons/Unpin.js +1 -1
- package/lib/commonjs/icons/User.js +1 -1
- package/lib/commonjs/icons/UserAdd.js +1 -1
- package/lib/commonjs/icons/UserAdmin.js +1 -1
- package/lib/commonjs/icons/UserDelete.js +1 -1
- package/lib/commonjs/icons/UserMinus.js +1 -1
- package/lib/commonjs/icons/Video.js +1 -1
- package/lib/commonjs/icons/Warning.js +1 -1
- package/lib/commonjs/icons/WutReaction.js +1 -1
- package/lib/commonjs/icons/XLS.js +1 -1
- package/lib/commonjs/icons/XLSX.js +1 -1
- package/lib/commonjs/icons/ZIP.js +1 -1
- package/lib/commonjs/icons/utils/base.js +1 -1
- package/lib/commonjs/mock-builders/DB/mock.js +2 -2
- package/lib/commonjs/mock-builders/DB/mock.js.map +1 -1
- package/lib/commonjs/mock-builders/api/deleteMessage.js +20 -0
- package/lib/commonjs/mock-builders/api/deleteMessage.js.map +1 -0
- package/lib/commonjs/mock-builders/api/deleteReaction.js +21 -0
- package/lib/commonjs/mock-builders/api/deleteReaction.js.map +1 -0
- package/lib/commonjs/mock-builders/api/sendReaction.js +21 -0
- package/lib/commonjs/mock-builders/api/sendReaction.js.map +1 -0
- package/lib/commonjs/mock-builders/event/connectionChanged.js +2 -0
- package/lib/commonjs/mock-builders/event/connectionChanged.js.map +1 -1
- package/lib/commonjs/store/QuickSqliteClient.js +40 -51
- package/lib/commonjs/store/QuickSqliteClient.js.map +1 -1
- package/lib/commonjs/store/apis/addPendingTask.js +37 -0
- package/lib/commonjs/store/apis/addPendingTask.js.map +1 -0
- package/lib/commonjs/store/apis/deleteMessage.js +26 -0
- package/lib/commonjs/store/apis/deleteMessage.js.map +1 -0
- package/lib/commonjs/store/apis/deletePendingTask.js +22 -0
- package/lib/commonjs/store/apis/deletePendingTask.js.map +1 -0
- package/lib/commonjs/store/apis/deleteReaction.js +30 -0
- package/lib/commonjs/store/apis/deleteReaction.js.map +1 -0
- package/lib/commonjs/store/apis/getChannelMessages.js +3 -3
- package/lib/commonjs/store/apis/getChannelMessages.js.map +1 -1
- package/lib/commonjs/store/apis/getChannels.js +1 -1
- package/lib/commonjs/store/apis/getChannels.js.map +1 -1
- package/lib/commonjs/store/apis/getPendingTasks.js +26 -0
- package/lib/commonjs/store/apis/getPendingTasks.js.map +1 -0
- package/lib/commonjs/store/apis/index.js +13 -0
- package/lib/commonjs/store/apis/index.js.map +1 -1
- package/lib/commonjs/store/apis/insertReaction.js +28 -0
- package/lib/commonjs/store/apis/insertReaction.js.map +1 -0
- package/lib/commonjs/store/apis/updateMessage.js.map +1 -1
- package/lib/commonjs/store/apis/updateReaction.js.map +1 -1
- package/lib/commonjs/store/mappers/mapDateTimeToStorable.js.map +1 -1
- package/lib/commonjs/store/mappers/mapMessageToStorable.js +3 -1
- package/lib/commonjs/store/mappers/mapMessageToStorable.js.map +1 -1
- package/lib/commonjs/store/mappers/mapStorableToTask.js +23 -0
- package/lib/commonjs/store/mappers/mapStorableToTask.js.map +1 -0
- package/lib/commonjs/store/mappers/mapTaskToStorable.js +18 -0
- package/lib/commonjs/store/mappers/mapTaskToStorable.js.map +1 -0
- package/lib/commonjs/store/schema.js +11 -0
- package/lib/commonjs/store/schema.js.map +1 -1
- package/lib/commonjs/store/sqlite-utils/appendOrderByClause.js +24 -0
- package/lib/commonjs/store/sqlite-utils/appendOrderByClause.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js +1 -1
- package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js.map +1 -1
- package/lib/commonjs/store/sqlite-utils/createSelectQuery.js +8 -1
- package/lib/commonjs/store/sqlite-utils/createSelectQuery.js.map +1 -1
- package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js +2 -2
- package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js.map +1 -1
- package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js +1 -1
- package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js.map +1 -1
- package/lib/commonjs/utils/DBSyncManager.js +436 -0
- package/lib/commonjs/utils/DBSyncManager.js.map +1 -0
- package/lib/commonjs/utils/addReactionToLocalState.js +92 -0
- package/lib/commonjs/utils/addReactionToLocalState.js.map +1 -0
- package/lib/commonjs/utils/pendingTaskUtils.js +302 -0
- package/lib/commonjs/utils/pendingTaskUtils.js.map +1 -0
- package/lib/commonjs/utils/removeReactionFromLocalState.js +39 -0
- package/lib/commonjs/utils/removeReactionFromLocalState.js.map +1 -0
- package/lib/commonjs/utils/utils.js +9 -3
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +1 -1
- package/lib/module/components/Attachment/AttachmentActions.js +1 -1
- package/lib/module/components/Attachment/AudioAttachment.js +1 -1
- package/lib/module/components/Attachment/Card.js +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +1 -1
- package/lib/module/components/Attachment/FileIcon.js +1 -1
- package/lib/module/components/Attachment/Gallery.js +1 -1
- package/lib/module/components/Attachment/GalleryImage.js +20 -4
- package/lib/module/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +1 -1
- package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js +1 -1
- package/lib/module/components/Attachment/ImageLoadingIndicator.js +1 -1
- package/lib/module/components/Attachment/VideoThumbnail.js +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
- package/lib/module/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
- package/lib/module/components/Avatar/Avatar.js +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +1 -1
- package/lib/module/components/Channel/Channel.js +537 -155
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +6 -0
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +5 -16
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +1 -1
- package/lib/module/components/ChannelList/Skeleton.js +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +112 -42
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
- package/lib/module/components/Chat/Chat.js +17 -21
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +2 -4
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/ImageBackground.js +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js +1 -1
- package/lib/module/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingDot.js +1 -1
- package/lib/module/components/Indicators/LoadingDots.js +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/module/components/Message/Message.js +22 -11
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +15 -13
- package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageReplies.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +1 -1
- package/lib/module/components/Message/MessageSimple/ReactionList.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.test.js +1 -1
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js +9 -30
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActions.js +20 -18
- package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/module/components/MessageInput/AttachButton.js +1 -1
- package/lib/module/components/MessageInput/CommandsButton.js +1 -1
- package/lib/module/components/MessageInput/CooldownTimer.js +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +32 -22
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +52 -20
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +40 -28
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/module/components/MessageInput/SendButton.js +2 -2
- package/lib/module/components/MessageInput/SendButton.js.map +1 -1
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
- package/lib/module/components/MessageInput/UploadProgressIndicator.js +1 -1
- package/lib/module/components/MessageInput/components/InputEditingStateHeader.js +1 -1
- package/lib/module/components/MessageInput/components/InputGiphySearch.js +1 -1
- package/lib/module/components/MessageInput/components/InputReplyStateHeader.js +1 -1
- package/lib/module/components/MessageList/DateHeader.js +1 -1
- package/lib/module/components/MessageList/InlineDateSeparator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/module/components/MessageList/MessageList.js +1 -1
- package/lib/module/components/MessageList/MessageSystem.js +1 -1
- package/lib/module/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/module/components/MessageList/ScrollToBottomButton.js +1 -1
- package/lib/module/components/MessageList/TypingIndicator.js +1 -1
- package/lib/module/components/MessageList/TypingIndicatorContainer.js +1 -1
- package/lib/module/components/MessageOverlay/MessageActionList.js +1 -1
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionList.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
- package/lib/module/components/ProgressControl/ProgressControl.js +1 -1
- package/lib/module/components/RTLComponents/WritingDirectionAwareText.js +1 -1
- package/lib/module/components/Reply/Reply.js +1 -1
- package/lib/module/components/Spinner/Spinner.js +1 -1
- package/lib/module/components/Thread/Thread.js +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +1 -1
- package/lib/module/components/index.js +0 -13
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +3 -3
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/debugContext/DebugContext.js +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
- package/lib/module/contexts/keyboardContext/KeyboardContext.js +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +23 -14
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js +3 -3
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +1 -1
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +1 -1
- package/lib/module/contexts/themeContext/ThemeContext.js +1 -1
- package/lib/module/contexts/threadContext/ThreadContext.js +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/module/contexts/typingContext/TypingContext.js +1 -1
- package/lib/module/hooks/useTranslatedMessage.js +1 -1
- package/lib/module/hooks/useTranslatedMessage.js.map +1 -1
- package/lib/module/icons/ArrowRight.js +1 -1
- package/lib/module/icons/AtMentions.js +1 -1
- package/lib/module/icons/Attach.js +1 -1
- package/lib/module/icons/Audio.js +1 -1
- package/lib/module/icons/CSV.js +1 -1
- package/lib/module/icons/Camera.js +1 -1
- package/lib/module/icons/Check.js +1 -1
- package/lib/module/icons/CheckAll.js +1 -1
- package/lib/module/icons/CheckSend.js +1 -1
- package/lib/module/icons/CircleClose.js +1 -1
- package/lib/module/icons/CirclePlus.js +1 -1
- package/lib/module/icons/CircleRight.js +1 -1
- package/lib/module/icons/Close.js +1 -1
- package/lib/module/icons/Copy.js +1 -1
- package/lib/module/icons/CurveLineLeftUp.js +1 -1
- package/lib/module/icons/DOC.js +1 -1
- package/lib/module/icons/DOCX.js +1 -1
- package/lib/module/icons/Delete.js +1 -1
- package/lib/module/icons/Down.js +1 -1
- package/lib/module/icons/DownloadArrow.js +1 -1
- package/lib/module/icons/DownloadCloud.js +1 -1
- package/lib/module/icons/Edit.js +1 -1
- package/lib/module/icons/Error.js +1 -1
- package/lib/module/icons/Eye.js +1 -1
- package/lib/module/icons/Flag.js +1 -1
- package/lib/module/icons/Folder.js +1 -1
- package/lib/module/icons/GenericFile.js +1 -1
- package/lib/module/icons/GiphyIcon.js +1 -1
- package/lib/module/icons/Grid.js +1 -1
- package/lib/module/icons/Group.js +1 -1
- package/lib/module/icons/HTML.js +1 -1
- package/lib/module/icons/Imgur.js +1 -1
- package/lib/module/icons/LOLReaction.js +1 -1
- package/lib/module/icons/Lightning.js +1 -1
- package/lib/module/icons/Link.js +1 -1
- package/lib/module/icons/Loading.js +1 -1
- package/lib/module/icons/Logo.js +1 -1
- package/lib/module/icons/LoveReaction.js +1 -1
- package/lib/module/icons/MD.js +1 -1
- package/lib/module/icons/MailOpen.js +1 -1
- package/lib/module/icons/MenuPointHorizontal.js +1 -1
- package/lib/module/icons/MenuPointVertical.js +1 -1
- package/lib/module/icons/MessageFlag.js +1 -1
- package/lib/module/icons/MessageIcon.js +1 -1
- package/lib/module/icons/Mute.js +1 -1
- package/lib/module/icons/Notification.js +1 -1
- package/lib/module/icons/ODT.js +1 -1
- package/lib/module/icons/PDF.js +1 -1
- package/lib/module/icons/PPT.js +1 -1
- package/lib/module/icons/PPTX.js +1 -1
- package/lib/module/icons/Pause.js +1 -1
- package/lib/module/icons/Picture.js +1 -1
- package/lib/module/icons/Pin.js +1 -1
- package/lib/module/icons/PinHeader.js +1 -1
- package/lib/module/icons/Play.js +1 -1
- package/lib/module/icons/RAR.js +1 -1
- package/lib/module/icons/RTF.js +1 -1
- package/lib/module/icons/Recorder.js +1 -1
- package/lib/module/icons/Refresh.js +1 -1
- package/lib/module/icons/SEVEN_Z.js +1 -1
- package/lib/module/icons/Search.js +1 -1
- package/lib/module/icons/SendRight.js +1 -1
- package/lib/module/icons/SendUp.js +1 -1
- package/lib/module/icons/Share.js +1 -1
- package/lib/module/icons/ShareRightArrow.js +1 -1
- package/lib/module/icons/Smile.js +1 -1
- package/lib/module/icons/Sound.js +1 -1
- package/lib/module/icons/TAR.js +1 -1
- package/lib/module/icons/TXT.js +1 -1
- package/lib/module/icons/ThreadReply.js +1 -1
- package/lib/module/icons/ThumbsDownReaction.js +1 -1
- package/lib/module/icons/ThumbsUpReaction.js +1 -1
- package/lib/module/icons/Time.js +1 -1
- package/lib/module/icons/Unknown.js +1 -1
- package/lib/module/icons/Unpin.js +1 -1
- package/lib/module/icons/User.js +1 -1
- package/lib/module/icons/UserAdd.js +1 -1
- package/lib/module/icons/UserAdmin.js +1 -1
- package/lib/module/icons/UserDelete.js +1 -1
- package/lib/module/icons/UserMinus.js +1 -1
- package/lib/module/icons/Video.js +1 -1
- package/lib/module/icons/Warning.js +1 -1
- package/lib/module/icons/WutReaction.js +1 -1
- package/lib/module/icons/XLS.js +1 -1
- package/lib/module/icons/XLSX.js +1 -1
- package/lib/module/icons/ZIP.js +1 -1
- package/lib/module/icons/utils/base.js +1 -1
- package/lib/module/mock-builders/DB/mock.js +2 -2
- package/lib/module/mock-builders/DB/mock.js.map +1 -1
- package/lib/module/mock-builders/api/deleteMessage.js +20 -0
- package/lib/module/mock-builders/api/deleteMessage.js.map +1 -0
- package/lib/module/mock-builders/api/deleteReaction.js +21 -0
- package/lib/module/mock-builders/api/deleteReaction.js.map +1 -0
- package/lib/module/mock-builders/api/sendReaction.js +21 -0
- package/lib/module/mock-builders/api/sendReaction.js.map +1 -0
- package/lib/module/mock-builders/event/connectionChanged.js +2 -0
- package/lib/module/mock-builders/event/connectionChanged.js.map +1 -1
- package/lib/module/store/QuickSqliteClient.js +40 -51
- package/lib/module/store/QuickSqliteClient.js.map +1 -1
- package/lib/module/store/apis/addPendingTask.js +37 -0
- package/lib/module/store/apis/addPendingTask.js.map +1 -0
- package/lib/module/store/apis/deleteMessage.js +26 -0
- package/lib/module/store/apis/deleteMessage.js.map +1 -0
- package/lib/module/store/apis/deletePendingTask.js +22 -0
- package/lib/module/store/apis/deletePendingTask.js.map +1 -0
- package/lib/module/store/apis/deleteReaction.js +30 -0
- package/lib/module/store/apis/deleteReaction.js.map +1 -0
- package/lib/module/store/apis/getChannelMessages.js +3 -3
- package/lib/module/store/apis/getChannelMessages.js.map +1 -1
- package/lib/module/store/apis/getChannels.js +1 -1
- package/lib/module/store/apis/getChannels.js.map +1 -1
- package/lib/module/store/apis/getPendingTasks.js +26 -0
- package/lib/module/store/apis/getPendingTasks.js.map +1 -0
- package/lib/module/store/apis/index.js +13 -0
- package/lib/module/store/apis/index.js.map +1 -1
- package/lib/module/store/apis/insertReaction.js +28 -0
- package/lib/module/store/apis/insertReaction.js.map +1 -0
- package/lib/module/store/apis/updateMessage.js.map +1 -1
- package/lib/module/store/apis/updateReaction.js.map +1 -1
- package/lib/module/store/mappers/mapDateTimeToStorable.js.map +1 -1
- package/lib/module/store/mappers/mapMessageToStorable.js +3 -1
- package/lib/module/store/mappers/mapMessageToStorable.js.map +1 -1
- package/lib/module/store/mappers/mapStorableToTask.js +23 -0
- package/lib/module/store/mappers/mapStorableToTask.js.map +1 -0
- package/lib/module/store/mappers/mapTaskToStorable.js +18 -0
- package/lib/module/store/mappers/mapTaskToStorable.js.map +1 -0
- package/lib/module/store/schema.js +11 -0
- package/lib/module/store/schema.js.map +1 -1
- package/lib/module/store/sqlite-utils/appendOrderByClause.js +24 -0
- package/lib/module/store/sqlite-utils/appendOrderByClause.js.map +1 -0
- package/lib/module/store/sqlite-utils/createCreateTableQuery.js +1 -1
- package/lib/module/store/sqlite-utils/createCreateTableQuery.js.map +1 -1
- package/lib/module/store/sqlite-utils/createSelectQuery.js +8 -1
- package/lib/module/store/sqlite-utils/createSelectQuery.js.map +1 -1
- package/lib/module/store/sqlite-utils/createUpdateQuery.js +2 -2
- package/lib/module/store/sqlite-utils/createUpdateQuery.js.map +1 -1
- package/lib/module/store/sqlite-utils/createUpsertQuery.js +1 -1
- package/lib/module/store/sqlite-utils/createUpsertQuery.js.map +1 -1
- package/lib/module/utils/DBSyncManager.js +436 -0
- package/lib/module/utils/DBSyncManager.js.map +1 -0
- package/lib/module/utils/addReactionToLocalState.js +92 -0
- package/lib/module/utils/addReactionToLocalState.js.map +1 -0
- package/lib/module/utils/pendingTaskUtils.js +302 -0
- package/lib/module/utils/pendingTaskUtils.js.map +1 -0
- package/lib/module/utils/removeReactionFromLocalState.js +39 -0
- package/lib/module/utils/removeReactionFromLocalState.js.map +1 -0
- package/lib/module/utils/utils.js +9 -3
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +2 -1
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +2 -1
- package/lib/typescript/components/MessageInput/ImageUploadPreview.d.ts +2 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +2 -1
- package/lib/typescript/components/index.d.ts +0 -1
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +1 -2
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +3 -0
- package/lib/typescript/store/apis/addPendingTask.d.ts +2 -0
- package/lib/typescript/store/apis/deleteMessage.d.ts +4 -0
- package/lib/typescript/store/apis/deletePendingTask.d.ts +3 -0
- package/lib/typescript/store/apis/deleteReaction.d.ts +6 -0
- package/lib/typescript/store/apis/getChannelMessages.d.ts +1 -1
- package/lib/typescript/store/apis/getPendingTasks.d.ts +3 -0
- package/lib/typescript/store/apis/index.d.ts +1 -0
- package/lib/typescript/store/apis/insertReaction.d.ts +6 -0
- package/lib/typescript/store/apis/updateMessage.d.ts +2 -2
- package/lib/typescript/store/apis/updateReaction.d.ts +2 -2
- package/lib/typescript/store/mappers/mapDateTimeToStorable.d.ts +1 -1
- package/lib/typescript/store/mappers/mapMessageToStorable.d.ts +2 -2
- package/lib/typescript/store/mappers/mapStorableToTask.d.ts +2 -0
- package/lib/typescript/store/mappers/mapTaskToStorable.d.ts +34 -0
- package/lib/typescript/store/schema.d.ts +12 -1
- package/lib/typescript/store/sqlite-utils/appendOrderByClause.d.ts +3 -0
- package/lib/typescript/store/sqlite-utils/createSelectQuery.d.ts +1 -1
- package/lib/typescript/store/types.d.ts +25 -0
- package/lib/typescript/types/types.d.ts +3 -1
- package/lib/typescript/utils/DBSyncManager.d.ts +47 -0
- package/lib/typescript/utils/addReactionToLocalState.d.ts +9 -0
- package/lib/typescript/utils/pendingTaskUtils.d.ts +13 -0
- package/lib/typescript/utils/removeReactionFromLocalState.d.ts +8 -0
- package/lib/typescript/utils/utils.d.ts +3 -3
- package/package.json +2 -2
- package/src/__tests__/offline-feature.test.js +19 -2
- package/src/__tests__/optimistic-update.test.js +368 -0
- package/src/components/Attachment/GalleryImage.tsx +14 -2
- package/src/components/Channel/Channel.tsx +270 -62
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +6 -0
- package/src/components/ChannelList/ChannelList.tsx +2 -10
- package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +0 -1
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +75 -27
- package/src/components/Chat/Chat.tsx +5 -9
- package/src/components/Chat/__tests__/Chat.test.js +1 -1
- package/src/components/Chat/hooks/useCreateChatContext.ts +0 -2
- package/src/components/Message/Message.tsx +18 -2
- package/src/components/Message/MessageSimple/MessageFooter.tsx +2 -1
- package/src/components/Message/hooks/useMessageActionHandlers.ts +10 -21
- package/src/components/Message/hooks/useMessageActions.tsx +9 -4
- package/src/components/MessageInput/FileUploadPreview.tsx +8 -2
- package/src/components/MessageInput/ImageUploadPreview.tsx +37 -8
- package/src/components/MessageInput/MessageInput.tsx +17 -3
- package/src/components/MessageInput/SendButton.tsx +1 -1
- package/src/components/index.ts +0 -1
- package/src/contexts/chatContext/ChatContext.tsx +1 -2
- package/src/contexts/messageInputContext/MessageInputContext.tsx +29 -10
- package/src/contexts/messageInputContext/__tests__/__snapshots__/sendMessage.test.tsx.snap +29 -0
- package/src/contexts/messagesContext/MessagesContext.tsx +4 -1
- package/src/hooks/useTranslatedMessage.ts +1 -1
- package/src/mock-builders/DB/mock.ts +2 -2
- package/src/mock-builders/api/deleteMessage.js +18 -0
- package/src/mock-builders/api/deleteReaction.js +19 -0
- package/src/mock-builders/api/sendReaction.tsx +19 -0
- package/src/mock-builders/event/connectionChanged.js +2 -1
- package/src/store/QuickSqliteClient.ts +39 -37
- package/src/store/apis/addPendingTask.ts +24 -0
- package/src/store/apis/deleteMessage.ts +13 -0
- package/src/store/apis/deletePendingTask.ts +12 -0
- package/src/store/apis/deleteReaction.ts +26 -0
- package/src/store/apis/getChannelMessages.ts +1 -1
- package/src/store/apis/getChannels.ts +2 -2
- package/src/store/apis/getPendingTasks.ts +13 -0
- package/src/store/apis/index.ts +1 -0
- package/src/store/apis/insertReaction.ts +29 -0
- package/src/store/apis/updateMessage.ts +2 -2
- package/src/store/apis/updateReaction.ts +2 -2
- package/src/store/mappers/mapDateTimeToStorable.ts +1 -1
- package/src/store/mappers/mapMessageToStorable.ts +8 -2
- package/src/store/mappers/mapStorableToTask.ts +13 -0
- package/src/store/mappers/mapTaskToStorable.ts +7 -0
- package/src/store/schema.ts +25 -1
- package/src/store/sqlite-utils/appendOrderByClause.ts +24 -0
- package/src/store/sqlite-utils/createCreateTableQuery.ts +2 -2
- package/src/store/sqlite-utils/createSelectQuery.ts +4 -1
- package/src/store/sqlite-utils/createUpdateQuery.ts +3 -2
- package/src/store/sqlite-utils/createUpsertQuery.ts +1 -1
- package/src/store/types.ts +33 -0
- package/src/types/types.ts +4 -1
- package/src/utils/DBSyncManager.ts +222 -0
- package/src/utils/addReactionToLocalState.ts +87 -0
- package/src/utils/pendingTaskUtils.ts +131 -0
- package/src/utils/removeReactionFromLocalState.ts +39 -0
- package/src/utils/utils.ts +12 -4
- package/src/version.json +1 -1
- package/lib/commonjs/components/Chat/hooks/useConnectionRecovered.js +0 -171
- package/lib/commonjs/components/Chat/hooks/useConnectionRecovered.js.map +0 -1
- package/lib/module/components/Chat/hooks/useConnectionRecovered.js +0 -171
- package/lib/module/components/Chat/hooks/useConnectionRecovered.js.map +0 -1
- package/lib/typescript/components/Chat/hooks/useConnectionRecovered.d.ts +0 -10
- package/src/components/Chat/hooks/useConnectionRecovered.ts +0 -92
|
@@ -14,6 +14,7 @@ import { queryChannelsApi } from '../mock-builders/api/queryChannels';
|
|
|
14
14
|
import { useMockedApis } from '../mock-builders/api/useMockedApis';
|
|
15
15
|
import dispatchChannelTruncatedEvent from '../mock-builders/event/channelTruncated';
|
|
16
16
|
import dispatchChannelUpdatedEvent from '../mock-builders/event/channelUpdated';
|
|
17
|
+
import dispatchConnectionChangedEvent from '../mock-builders/event/connectionChanged';
|
|
17
18
|
import dispatchMemberAddedEvent from '../mock-builders/event/memberAdded';
|
|
18
19
|
import dispatchMemberRemovedEvent from '../mock-builders/event/memberRemoved';
|
|
19
20
|
import dispatchMemberUpdatedEvent from '../mock-builders/event/memberUpdated';
|
|
@@ -206,7 +207,6 @@ describe('Offline support is enabled', () => {
|
|
|
206
207
|
|
|
207
208
|
const channelQueriesRows = BetterSqlite.selectFromTable('channelQueries');
|
|
208
209
|
const cidsInDB = JSON.parse(channelQueriesRows[0].cids);
|
|
209
|
-
|
|
210
210
|
const filterSortQueryInDB = channelQueriesRows[0].id;
|
|
211
211
|
const actualFilterSortQueryInDB = convertFilterSortToQuery({ filters, sort });
|
|
212
212
|
|
|
@@ -285,8 +285,10 @@ describe('Offline support is enabled', () => {
|
|
|
285
285
|
|
|
286
286
|
it('should store filter-sort query and cids on ChannelList in channelQueries table', async () => {
|
|
287
287
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
288
|
-
|
|
289
288
|
const { getByTestId, queryAllByA11yRole } = renderComponent();
|
|
289
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
290
|
+
// await waiter();
|
|
291
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
290
292
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
291
293
|
|
|
292
294
|
expectCIDsOnUIToBeInDB(queryAllByA11yRole);
|
|
@@ -296,6 +298,7 @@ describe('Offline support is enabled', () => {
|
|
|
296
298
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
297
299
|
|
|
298
300
|
const { getByTestId, queryAllByA11yRole } = renderComponent();
|
|
301
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
299
302
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
300
303
|
|
|
301
304
|
expectAllChannelsWithStateToBeInDB(queryAllByA11yRole);
|
|
@@ -305,6 +308,7 @@ describe('Offline support is enabled', () => {
|
|
|
305
308
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
306
309
|
|
|
307
310
|
const { getByTestId } = renderComponent();
|
|
311
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
308
312
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
309
313
|
const newMessage = generateMessage({
|
|
310
314
|
cid: channels[0].channel.cid,
|
|
@@ -322,6 +326,7 @@ describe('Offline support is enabled', () => {
|
|
|
322
326
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
323
327
|
|
|
324
328
|
const { getByTestId, queryAllByA11yRole } = renderComponent();
|
|
329
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
325
330
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
326
331
|
|
|
327
332
|
const newChannel = createChannel();
|
|
@@ -343,6 +348,7 @@ describe('Offline support is enabled', () => {
|
|
|
343
348
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
344
349
|
|
|
345
350
|
const { getByTestId } = renderComponent();
|
|
351
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
346
352
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
347
353
|
|
|
348
354
|
const updatedMessage = { ...channels[0].messages[0] };
|
|
@@ -361,6 +367,7 @@ describe('Offline support is enabled', () => {
|
|
|
361
367
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
362
368
|
|
|
363
369
|
const { getByTestId, queryAllByA11yRole } = renderComponent();
|
|
370
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
364
371
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
365
372
|
const removedChannel = channels[getRandomInt(0, channels.length - 1)].channel;
|
|
366
373
|
act(() => dispatchNotificationRemovedFromChannel(chatClient, removedChannel));
|
|
@@ -387,6 +394,7 @@ describe('Offline support is enabled', () => {
|
|
|
387
394
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
388
395
|
|
|
389
396
|
const { getByTestId, queryAllByA11yRole } = renderComponent();
|
|
397
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
390
398
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
391
399
|
|
|
392
400
|
const newChannel = createChannel();
|
|
@@ -416,6 +424,7 @@ describe('Offline support is enabled', () => {
|
|
|
416
424
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
417
425
|
|
|
418
426
|
const { getByTestId, queryAllByA11yRole } = renderComponent();
|
|
427
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
419
428
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
420
429
|
|
|
421
430
|
const channelToTruncate = channels[getRandomInt(0, channels.length - 1)].channel;
|
|
@@ -440,6 +449,7 @@ describe('Offline support is enabled', () => {
|
|
|
440
449
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
441
450
|
|
|
442
451
|
const { getByTestId } = renderComponent();
|
|
452
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
443
453
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
444
454
|
|
|
445
455
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
@@ -481,6 +491,7 @@ describe('Offline support is enabled', () => {
|
|
|
481
491
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
482
492
|
|
|
483
493
|
const { getByTestId } = renderComponent();
|
|
494
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
484
495
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
485
496
|
|
|
486
497
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
@@ -528,6 +539,7 @@ describe('Offline support is enabled', () => {
|
|
|
528
539
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
529
540
|
|
|
530
541
|
const { getByTestId } = renderComponent();
|
|
542
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
531
543
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
532
544
|
|
|
533
545
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
@@ -561,6 +573,7 @@ describe('Offline support is enabled', () => {
|
|
|
561
573
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
562
574
|
|
|
563
575
|
const { getByTestId } = renderComponent();
|
|
576
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
564
577
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
565
578
|
|
|
566
579
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
@@ -579,6 +592,7 @@ describe('Offline support is enabled', () => {
|
|
|
579
592
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
580
593
|
|
|
581
594
|
const { getByTestId } = renderComponent();
|
|
595
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
582
596
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
583
597
|
|
|
584
598
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
@@ -597,6 +611,7 @@ describe('Offline support is enabled', () => {
|
|
|
597
611
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
598
612
|
|
|
599
613
|
const { getByTestId } = renderComponent();
|
|
614
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
600
615
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
601
616
|
|
|
602
617
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
@@ -620,6 +635,7 @@ describe('Offline support is enabled', () => {
|
|
|
620
635
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
621
636
|
|
|
622
637
|
const { getByTestId } = renderComponent();
|
|
638
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
623
639
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
624
640
|
|
|
625
641
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
@@ -640,6 +656,7 @@ describe('Offline support is enabled', () => {
|
|
|
640
656
|
useMockedApis(chatClient, [queryChannelsApi(channels)]);
|
|
641
657
|
|
|
642
658
|
const { getByTestId } = renderComponent();
|
|
659
|
+
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
643
660
|
await waitFor(() => expect(getByTestId('channel-list')).toBeTruthy());
|
|
644
661
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
645
662
|
const targetMember = targetChannel.members[getRandomInt(0, targetChannel.members.length - 1)];
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/* eslint-disable no-underscore-dangle */
|
|
2
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { act, cleanup, render, waitFor } from '@testing-library/react-native';
|
|
6
|
+
|
|
7
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
8
|
+
|
|
9
|
+
import { Channel } from '../components/Channel/Channel';
|
|
10
|
+
import { Chat } from '../components/Chat/Chat';
|
|
11
|
+
import { MessagesContext } from '../contexts';
|
|
12
|
+
import { deleteMessageApi } from '../mock-builders/api/deleteMessage';
|
|
13
|
+
import { deleteReactionApi } from '../mock-builders/api/deleteReaction';
|
|
14
|
+
import { erroredDeleteApi, erroredPostApi } from '../mock-builders/api/error';
|
|
15
|
+
import { getOrCreateChannelApi } from '../mock-builders/api/getOrCreateChannel';
|
|
16
|
+
import { sendReactionApi } from '../mock-builders/api/sendReaction';
|
|
17
|
+
import { useMockedApis } from '../mock-builders/api/useMockedApis';
|
|
18
|
+
import dispatchConnectionChangedEvent from '../mock-builders/event/connectionChanged';
|
|
19
|
+
import { generateChannelResponse } from '../mock-builders/generator/channel';
|
|
20
|
+
import { generateMember } from '../mock-builders/generator/member';
|
|
21
|
+
import { generateMessage } from '../mock-builders/generator/message';
|
|
22
|
+
import { generateReaction } from '../mock-builders/generator/reaction';
|
|
23
|
+
import { generateUser } from '../mock-builders/generator/user';
|
|
24
|
+
import { getTestClientWithUser } from '../mock-builders/mock';
|
|
25
|
+
import { upsertChannels } from '../store/apis';
|
|
26
|
+
import { QuickSqliteClient } from '../store/QuickSqliteClient';
|
|
27
|
+
import { BetterSqlite } from '../test-utils/BetterSqlite';
|
|
28
|
+
|
|
29
|
+
describe('Optimistic Updates', () => {
|
|
30
|
+
let chatClient;
|
|
31
|
+
|
|
32
|
+
const getRandomInt = (lower, upper) => Math.floor(lower + Math.random() * (upper - lower + 1));
|
|
33
|
+
const createChannel = () => {
|
|
34
|
+
const allUsers = Array(20).fill(1).map(generateUser);
|
|
35
|
+
const allMessages = [];
|
|
36
|
+
const allMembers = [];
|
|
37
|
+
const allReactions = [];
|
|
38
|
+
const allReads = [];
|
|
39
|
+
const id = uuidv4();
|
|
40
|
+
const cid = `messaging:${id}`;
|
|
41
|
+
const begin = getRandomInt(0, allUsers.length - 2); // begin shouldn't be the end of users.length
|
|
42
|
+
const end = getRandomInt(begin + 1, allUsers.length - 1);
|
|
43
|
+
const usersForMembers = allUsers.slice(begin, end);
|
|
44
|
+
const members = usersForMembers.map((user) =>
|
|
45
|
+
generateMember({
|
|
46
|
+
cid,
|
|
47
|
+
user,
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
50
|
+
const messages = Array(10)
|
|
51
|
+
.fill(1)
|
|
52
|
+
.map(() => {
|
|
53
|
+
const id = uuidv4();
|
|
54
|
+
const user = usersForMembers[getRandomInt(0, usersForMembers.length - 1)];
|
|
55
|
+
|
|
56
|
+
const begin = getRandomInt(0, usersForMembers.length - 2); // begin shouldn't be the end of users.length
|
|
57
|
+
const end = getRandomInt(begin + 1, usersForMembers.length - 1);
|
|
58
|
+
|
|
59
|
+
const usersForReactions = usersForMembers.slice(begin, end);
|
|
60
|
+
const reactions = usersForReactions.map((user) =>
|
|
61
|
+
generateReaction({
|
|
62
|
+
message_id: id,
|
|
63
|
+
user,
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
allReactions.push(...reactions);
|
|
67
|
+
return generateMessage({
|
|
68
|
+
cid,
|
|
69
|
+
id,
|
|
70
|
+
latest_reactions: reactions,
|
|
71
|
+
user,
|
|
72
|
+
userId: user.id,
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const reads = members.map((member) => ({
|
|
77
|
+
last_read: new Date(new Date().setDate(new Date().getDate() - getRandomInt(0, 20))),
|
|
78
|
+
unread_messages: getRandomInt(0, messages.length),
|
|
79
|
+
user: member.user,
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
allMessages.push(...messages);
|
|
83
|
+
allMembers.push(...members);
|
|
84
|
+
allReads.push(...reads);
|
|
85
|
+
|
|
86
|
+
return generateChannelResponse({
|
|
87
|
+
cid,
|
|
88
|
+
id,
|
|
89
|
+
members,
|
|
90
|
+
messages,
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
beforeEach(async () => {
|
|
95
|
+
jest.clearAllMocks();
|
|
96
|
+
|
|
97
|
+
chatClient = await getTestClientWithUser({ id: 'dan' });
|
|
98
|
+
const channelResponse = createChannel();
|
|
99
|
+
useMockedApis(chatClient, [getOrCreateChannelApi(channelResponse)]);
|
|
100
|
+
channel = chatClient.channel('messaging', channelResponse.id);
|
|
101
|
+
await channel.watch();
|
|
102
|
+
|
|
103
|
+
channel.cid = channelResponse.channel.cid;
|
|
104
|
+
channel.id = channelResponse.channel.id;
|
|
105
|
+
|
|
106
|
+
// Populate the DB with channel
|
|
107
|
+
QuickSqliteClient.initializeDatabase();
|
|
108
|
+
upsertChannels({
|
|
109
|
+
channels: [channelResponse],
|
|
110
|
+
isLatestMessagesSet: true,
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
afterEach(() => {
|
|
115
|
+
BetterSqlite.dropAllTables();
|
|
116
|
+
cleanup();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
let channel;
|
|
120
|
+
// This component is used for performing effects in a component that consumes ChannelContext,
|
|
121
|
+
// i.e. making use of the callbacks & values provided by the Channel component.
|
|
122
|
+
// the effect is called every time channelContext changes
|
|
123
|
+
const CallbackEffectWithContext = ({ callback, children, context }) => {
|
|
124
|
+
const ctx = useContext(context);
|
|
125
|
+
const [ready, setReady] = useState(false);
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
const call = async () => {
|
|
128
|
+
await callback(ctx);
|
|
129
|
+
setReady(true);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
call();
|
|
133
|
+
}, []);
|
|
134
|
+
|
|
135
|
+
if (!ready) return null;
|
|
136
|
+
|
|
137
|
+
return children;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
describe('delete message', () => {
|
|
141
|
+
it('pending task should exist if deleteMessage request fails', async () => {
|
|
142
|
+
const message = generateMessage();
|
|
143
|
+
|
|
144
|
+
const { getByTestId } = render(
|
|
145
|
+
<Chat client={chatClient} enableOfflineSupport>
|
|
146
|
+
<Channel channel={channel} initialValue={message.text}>
|
|
147
|
+
<CallbackEffectWithContext
|
|
148
|
+
callback={async ({ deleteMessage }) => {
|
|
149
|
+
useMockedApis(chatClient, [erroredPostApi()]);
|
|
150
|
+
try {
|
|
151
|
+
await deleteMessage(message);
|
|
152
|
+
} catch (e) {
|
|
153
|
+
// do nothing
|
|
154
|
+
}
|
|
155
|
+
}}
|
|
156
|
+
context={MessagesContext}
|
|
157
|
+
>
|
|
158
|
+
<View testID='children' />
|
|
159
|
+
</CallbackEffectWithContext>
|
|
160
|
+
</Channel>
|
|
161
|
+
</Chat>,
|
|
162
|
+
);
|
|
163
|
+
await waitFor(() => expect(getByTestId('children')).toBeTruthy());
|
|
164
|
+
await waitFor(() => {
|
|
165
|
+
const pendingTasksRows = BetterSqlite.selectFromTable('pendingTasks');
|
|
166
|
+
const pendingTaskType = pendingTasksRows?.[0]?.type;
|
|
167
|
+
const pendingTaskPayload = JSON.parse(pendingTasksRows?.[0]?.payload || '{}');
|
|
168
|
+
expect(pendingTaskType).toBe('delete-message');
|
|
169
|
+
expect(pendingTaskPayload[0]).toBe(message.id);
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it('pending task should be cleared if deleteMessage request is succesful', async () => {
|
|
174
|
+
const message = generateMessage();
|
|
175
|
+
const { getByTestId } = render(
|
|
176
|
+
<Chat client={chatClient} enableOfflineSupport>
|
|
177
|
+
<Channel channel={channel} initialValue={message.text}>
|
|
178
|
+
<CallbackEffectWithContext
|
|
179
|
+
callback={({ deleteMessage }) => {
|
|
180
|
+
useMockedApis(chatClient, [deleteMessageApi(message)]);
|
|
181
|
+
deleteMessage(message);
|
|
182
|
+
}}
|
|
183
|
+
context={MessagesContext}
|
|
184
|
+
>
|
|
185
|
+
<View testID='children' />
|
|
186
|
+
</CallbackEffectWithContext>
|
|
187
|
+
</Channel>
|
|
188
|
+
</Chat>,
|
|
189
|
+
);
|
|
190
|
+
await waitFor(() => expect(getByTestId('children')).toBeTruthy());
|
|
191
|
+
await waitFor(() => {
|
|
192
|
+
const pendingTasksRows = BetterSqlite.selectFromTable('pendingTasks');
|
|
193
|
+
expect(pendingTasksRows.length).toBe(0);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
describe('send reaction', () => {
|
|
199
|
+
it('pending task should exist if sendReaction request fails', async () => {
|
|
200
|
+
const reaction = generateReaction();
|
|
201
|
+
const targetMessage = channel.state.messages[0];
|
|
202
|
+
|
|
203
|
+
const { getByTestId } = render(
|
|
204
|
+
<Chat client={chatClient} enableOfflineSupport>
|
|
205
|
+
<Channel channel={channel}>
|
|
206
|
+
<CallbackEffectWithContext
|
|
207
|
+
callback={async ({ sendReaction }) => {
|
|
208
|
+
useMockedApis(chatClient, [erroredPostApi()]);
|
|
209
|
+
try {
|
|
210
|
+
await sendReaction(reaction.type, targetMessage.id);
|
|
211
|
+
} catch (e) {
|
|
212
|
+
// do nothing
|
|
213
|
+
}
|
|
214
|
+
}}
|
|
215
|
+
context={MessagesContext}
|
|
216
|
+
>
|
|
217
|
+
<View testID='children' />
|
|
218
|
+
</CallbackEffectWithContext>
|
|
219
|
+
</Channel>
|
|
220
|
+
</Chat>,
|
|
221
|
+
);
|
|
222
|
+
await waitFor(() => expect(getByTestId('children')).toBeTruthy());
|
|
223
|
+
await waitFor(() => {
|
|
224
|
+
const pendingTasksRows = BetterSqlite.selectFromTable('pendingTasks');
|
|
225
|
+
const pendingTaskType = pendingTasksRows?.[0]?.type;
|
|
226
|
+
const pendingTaskPayload = JSON.parse(pendingTasksRows?.[0]?.payload || '{}');
|
|
227
|
+
expect(pendingTaskType).toBe('send-reaction');
|
|
228
|
+
expect(pendingTaskPayload[0]).toBe(targetMessage.id);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
it('pending task should be cleared if sendReaction request is succesful', async () => {
|
|
233
|
+
const reaction = generateReaction();
|
|
234
|
+
const targetMessage = channel.state.messages[0];
|
|
235
|
+
|
|
236
|
+
const { getByTestId } = render(
|
|
237
|
+
<Chat client={chatClient} enableOfflineSupport>
|
|
238
|
+
<Channel channel={channel}>
|
|
239
|
+
<CallbackEffectWithContext
|
|
240
|
+
callback={({ sendReaction }) => {
|
|
241
|
+
useMockedApis(chatClient, [sendReactionApi(targetMessage, reaction)]);
|
|
242
|
+
sendReaction(reaction.type, targetMessage.id);
|
|
243
|
+
}}
|
|
244
|
+
context={MessagesContext}
|
|
245
|
+
>
|
|
246
|
+
<View testID='children' />
|
|
247
|
+
</CallbackEffectWithContext>
|
|
248
|
+
</Channel>
|
|
249
|
+
</Chat>,
|
|
250
|
+
);
|
|
251
|
+
await waitFor(() => expect(getByTestId('children')).toBeTruthy());
|
|
252
|
+
await waitFor(() => {
|
|
253
|
+
const pendingTasksRows = BetterSqlite.selectFromTable('pendingTasks');
|
|
254
|
+
expect(pendingTasksRows.length).toBe(0);
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
describe('delete reaction', () => {
|
|
260
|
+
it('pending task should exist if deleteReaction request fails', async () => {
|
|
261
|
+
const reaction = generateReaction();
|
|
262
|
+
const targetMessage = channel.state.messages[0];
|
|
263
|
+
|
|
264
|
+
const { getByTestId } = render(
|
|
265
|
+
<Chat client={chatClient} enableOfflineSupport>
|
|
266
|
+
<Channel channel={channel}>
|
|
267
|
+
<CallbackEffectWithContext
|
|
268
|
+
callback={async ({ deleteReaction }) => {
|
|
269
|
+
useMockedApis(chatClient, [erroredPostApi()]);
|
|
270
|
+
try {
|
|
271
|
+
await deleteReaction(reaction.type, targetMessage.id);
|
|
272
|
+
} catch (e) {
|
|
273
|
+
// do nothing
|
|
274
|
+
}
|
|
275
|
+
}}
|
|
276
|
+
context={MessagesContext}
|
|
277
|
+
>
|
|
278
|
+
<View testID='children' />
|
|
279
|
+
</CallbackEffectWithContext>
|
|
280
|
+
</Channel>
|
|
281
|
+
</Chat>,
|
|
282
|
+
);
|
|
283
|
+
await waitFor(() => expect(getByTestId('children')).toBeTruthy());
|
|
284
|
+
await waitFor(() => {
|
|
285
|
+
const pendingTasksRows = BetterSqlite.selectFromTable('pendingTasks');
|
|
286
|
+
const pendingTaskType = pendingTasksRows?.[0]?.type;
|
|
287
|
+
const pendingTaskPayload = JSON.parse(pendingTasksRows?.[0]?.payload || '{}');
|
|
288
|
+
expect(pendingTaskType).toBe('delete-reaction');
|
|
289
|
+
expect(pendingTaskPayload[0]).toBe(targetMessage.id);
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it('pending task should be cleared if deleteReaction request is succesful', async () => {
|
|
294
|
+
const reaction = generateReaction();
|
|
295
|
+
const targetMessage = channel.state.messages[0];
|
|
296
|
+
|
|
297
|
+
const { getByTestId } = render(
|
|
298
|
+
<Chat client={chatClient} enableOfflineSupport>
|
|
299
|
+
<Channel channel={channel}>
|
|
300
|
+
<CallbackEffectWithContext
|
|
301
|
+
callback={async ({ deleteReaction }) => {
|
|
302
|
+
useMockedApis(chatClient, [deleteReactionApi(targetMessage, reaction)]);
|
|
303
|
+
await deleteReaction(reaction.type, targetMessage.id);
|
|
304
|
+
}}
|
|
305
|
+
context={MessagesContext}
|
|
306
|
+
>
|
|
307
|
+
<View testID='children' />
|
|
308
|
+
</CallbackEffectWithContext>
|
|
309
|
+
</Channel>
|
|
310
|
+
</Chat>,
|
|
311
|
+
);
|
|
312
|
+
await waitFor(() => expect(getByTestId('children')).toBeTruthy());
|
|
313
|
+
|
|
314
|
+
await waitFor(() => {
|
|
315
|
+
const pendingTasksRows = BetterSqlite.selectFromTable('pendingTasks');
|
|
316
|
+
expect(pendingTasksRows.length).toBe(0);
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
it('pending task should be executed after connection is recovered', async () => {
|
|
322
|
+
const message = channel.state.messages[0];
|
|
323
|
+
const reaction = generateReaction();
|
|
324
|
+
|
|
325
|
+
const { getByTestId } = render(
|
|
326
|
+
<Chat client={chatClient} enableOfflineSupport>
|
|
327
|
+
<Channel channel={channel} initialValue={message.text}>
|
|
328
|
+
<CallbackEffectWithContext
|
|
329
|
+
callback={async ({ deleteMessage, sendReaction }) => {
|
|
330
|
+
useMockedApis(chatClient, [erroredDeleteApi()]);
|
|
331
|
+
try {
|
|
332
|
+
await deleteMessage(reaction);
|
|
333
|
+
} catch (e) {
|
|
334
|
+
// do nothing
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
useMockedApis(chatClient, [erroredPostApi()]);
|
|
338
|
+
try {
|
|
339
|
+
await sendReaction(reaction.type, message.id);
|
|
340
|
+
} catch (e) {
|
|
341
|
+
// do nothing
|
|
342
|
+
}
|
|
343
|
+
}}
|
|
344
|
+
context={MessagesContext}
|
|
345
|
+
>
|
|
346
|
+
<View testID='children' />
|
|
347
|
+
</CallbackEffectWithContext>
|
|
348
|
+
</Channel>
|
|
349
|
+
</Chat>,
|
|
350
|
+
);
|
|
351
|
+
await waitFor(() => expect(getByTestId('children')).toBeTruthy());
|
|
352
|
+
|
|
353
|
+
await waitFor(() => {
|
|
354
|
+
const pendingTasksRows = BetterSqlite.selectFromTable('pendingTasks');
|
|
355
|
+
expect(pendingTasksRows.length).toBe(2);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
chatClient.deleteMessage = jest.fn();
|
|
359
|
+
channel.sendReaction = jest.fn();
|
|
360
|
+
|
|
361
|
+
act(() => dispatchConnectionChangedEvent(chatClient, true));
|
|
362
|
+
|
|
363
|
+
await waitFor(() => {
|
|
364
|
+
expect(chatClient.deleteMessage).toHaveBeenCalled();
|
|
365
|
+
expect(channel.sendReaction).toHaveBeenCalled();
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
});
|
|
@@ -4,7 +4,7 @@ import { Image, ImageProps } from 'react-native';
|
|
|
4
4
|
import { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';
|
|
5
5
|
|
|
6
6
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
7
|
-
import { getUrlWithoutParams, makeImageCompatibleUrl } from '../../utils/utils';
|
|
7
|
+
import { getUrlWithoutParams, isLocalUrl, makeImageCompatibleUrl } from '../../utils/utils';
|
|
8
8
|
|
|
9
9
|
export type GalleryImageWithContextProps<
|
|
10
10
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
@@ -13,8 +13,20 @@ export type GalleryImageWithContextProps<
|
|
|
13
13
|
export const GalleryImageWithContext: React.FC<GalleryImageWithContextProps> = (props) => {
|
|
14
14
|
const { ImageComponent = Image, uri, ...rest } = props;
|
|
15
15
|
|
|
16
|
+
if (!isLocalUrl(uri)) {
|
|
17
|
+
return (
|
|
18
|
+
<ImageComponent
|
|
19
|
+
{...rest}
|
|
20
|
+
accessibilityLabel='Gallery Image'
|
|
21
|
+
source={{
|
|
22
|
+
uri: makeImageCompatibleUrl(uri),
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
return (
|
|
17
|
-
<
|
|
29
|
+
<Image
|
|
18
30
|
{...rest}
|
|
19
31
|
accessibilityLabel='Gallery Image'
|
|
20
32
|
source={{
|