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
|
@@ -27,6 +27,8 @@ var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
|
27
27
|
|
|
28
28
|
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
29
29
|
|
|
30
|
+
var _mimeTypes = require("mime-types");
|
|
31
|
+
|
|
30
32
|
var _streamChat = require("stream-chat");
|
|
31
33
|
|
|
32
34
|
var _useCreateChannelContext = require("./hooks/useCreateChannelContext");
|
|
@@ -75,6 +77,16 @@ var _icons = require("../../icons");
|
|
|
75
77
|
|
|
76
78
|
var _native = require("../../native");
|
|
77
79
|
|
|
80
|
+
var dbApi = _interopRequireWildcard(require("../../store/apis"));
|
|
81
|
+
|
|
82
|
+
var _addReactionToLocalState = require("../../utils/addReactionToLocalState");
|
|
83
|
+
|
|
84
|
+
var _DBSyncManager = require("../../utils/DBSyncManager");
|
|
85
|
+
|
|
86
|
+
var _pendingTaskUtils = require("../../utils/pendingTaskUtils");
|
|
87
|
+
|
|
88
|
+
var _removeReactionFromLocalState = require("../../utils/removeReactionFromLocalState");
|
|
89
|
+
|
|
78
90
|
var _utils = require("../../utils/utils");
|
|
79
91
|
|
|
80
92
|
var _Attachment = require("../Attachment/Attachment");
|
|
@@ -188,10 +200,10 @@ var _OverlayReactionList = require("../MessageOverlay/OverlayReactionList");
|
|
|
188
200
|
var _Reply = require("../Reply/Reply");
|
|
189
201
|
|
|
190
202
|
var _excluded = ["attachments", "mentioned_users", "parent_id", "text"],
|
|
191
|
-
_excluded2 = ["__html", "attachments", "created_at", "html", "id", "mentioned_users", "parent_id", "quoted_message", "reactions", "status", "text", "type", "updated_at", "user"];
|
|
203
|
+
_excluded2 = ["__html", "attachments", "created_at", "deleted_at", "html", "id", "latest_reactions", "mentioned_users", "own_reactions", "parent_id", "quoted_message", "reaction_counts", "reactions", "status", "text", "type", "updated_at", "user"];
|
|
192
204
|
|
|
193
205
|
var _this = this,
|
|
194
|
-
_jsxFileName = "/
|
|
206
|
+
_jsxFileName = "/Users/vishalnarkhede/projects/stream-chat-react-native/package/src/components/Channel/Channel.tsx";
|
|
195
207
|
|
|
196
208
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
197
209
|
|
|
@@ -229,12 +241,12 @@ var throttleOptions = {
|
|
|
229
241
|
trailing: true
|
|
230
242
|
};
|
|
231
243
|
var debounceOptions = {
|
|
232
|
-
leading:
|
|
244
|
+
leading: false,
|
|
233
245
|
trailing: true
|
|
234
246
|
};
|
|
235
247
|
|
|
236
248
|
var ChannelWithContext = function ChannelWithContext(props) {
|
|
237
|
-
var _client$user, _channel$data,
|
|
249
|
+
var _client$user, _channel$data, _ref26, _ref27;
|
|
238
250
|
|
|
239
251
|
var additionalKeyboardAvoidingViewProps = props.additionalKeyboardAvoidingViewProps,
|
|
240
252
|
additionalTextInputProps = props.additionalTextInputProps,
|
|
@@ -290,6 +302,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
290
302
|
EmptyStateIndicator = _props$EmptyStateIndi === void 0 ? _EmptyStateIndicator.EmptyStateIndicator : _props$EmptyStateIndi,
|
|
291
303
|
_props$enableMessageG = props.enableMessageGroupingByUser,
|
|
292
304
|
enableMessageGroupingByUser = _props$enableMessageG === void 0 ? true : _props$enableMessageG,
|
|
305
|
+
enableOfflineSupport = props.enableOfflineSupport,
|
|
293
306
|
_props$enforceUniqueR = props.enforceUniqueReaction,
|
|
294
307
|
enforceUniqueReaction = _props$enforceUniqueR === void 0 ? false : _props$enforceUniqueR,
|
|
295
308
|
_props$FileAttachment = props.FileAttachment,
|
|
@@ -621,11 +634,11 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
621
634
|
(0, _streamChat.logChatPromiseExecution)(channel.markRead(), 'mark read');
|
|
622
635
|
}
|
|
623
636
|
}, defaultThrottleInterval, throttleOptions)).current;
|
|
624
|
-
var copyMessagesState = (0, _react.useRef)((0,
|
|
637
|
+
var copyMessagesState = (0, _react.useRef)((0, _debounce["default"])(function () {
|
|
625
638
|
if (channel) {
|
|
626
639
|
setMessages((0, _toConsumableArray2["default"])(channel.state.messages));
|
|
627
640
|
}
|
|
628
|
-
}, newMessageStateUpdateThrottleInterval,
|
|
641
|
+
}, newMessageStateUpdateThrottleInterval, debounceOptions)).current;
|
|
629
642
|
var copyTypingState = (0, _react.useRef)((0, _throttle["default"])(function () {
|
|
630
643
|
if (channel) {
|
|
631
644
|
setTyping((0, _extends2["default"])({}, channel.state.typing));
|
|
@@ -636,7 +649,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
636
649
|
setRead((0, _extends2["default"])({}, channel.state.read));
|
|
637
650
|
}
|
|
638
651
|
}, stateUpdateThrottleInterval, throttleOptions)).current;
|
|
639
|
-
var copyChannelState = (0, _react.useRef)((0,
|
|
652
|
+
var copyChannelState = (0, _react.useRef)((0, _debounce["default"])(function () {
|
|
640
653
|
setLoading(false);
|
|
641
654
|
|
|
642
655
|
if (channel) {
|
|
@@ -647,20 +660,10 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
647
660
|
setWatcherCount(channel.state.watcher_count);
|
|
648
661
|
setWatchers((0, _extends2["default"])({}, channel.state.watchers));
|
|
649
662
|
}
|
|
650
|
-
}, stateUpdateThrottleInterval,
|
|
651
|
-
|
|
652
|
-
var connectionRecoveredHandler = function connectionRecoveredHandler() {
|
|
653
|
-
if (channel && shouldSyncChannel) {
|
|
654
|
-
copyChannelState();
|
|
655
|
-
|
|
656
|
-
if (thread) {
|
|
657
|
-
setThreadMessages((0, _toConsumableArray2["default"])(channel.state.threads[thread.id]));
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
};
|
|
663
|
+
}, stateUpdateThrottleInterval, debounceOptions)).current;
|
|
661
664
|
|
|
662
|
-
var connectionChangedHandler = function connectionChangedHandler(
|
|
663
|
-
if (
|
|
665
|
+
var connectionChangedHandler = function connectionChangedHandler() {
|
|
666
|
+
if (shouldSyncChannel) {
|
|
664
667
|
resyncChannel();
|
|
665
668
|
}
|
|
666
669
|
};
|
|
@@ -697,8 +700,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
697
700
|
|
|
698
701
|
var subscribe = function subscribe() {
|
|
699
702
|
if (!channel) return;
|
|
700
|
-
clientSubscriptions.push(
|
|
701
|
-
clientSubscriptions.push(client.on('connection.changed', connectionChangedHandler));
|
|
703
|
+
clientSubscriptions.push(_DBSyncManager.DBSyncManager.onSyncStatusChange(connectionChangedHandler));
|
|
702
704
|
clientSubscriptions.push(client.on('channel.deleted', function (event) {
|
|
703
705
|
if (event.cid === channel.cid) {
|
|
704
706
|
setDeleted(true);
|
|
@@ -716,7 +718,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
716
718
|
return s.unsubscribe();
|
|
717
719
|
});
|
|
718
720
|
};
|
|
719
|
-
}, [channelId, connectionChangedHandler,
|
|
721
|
+
}, [channelId, connectionChangedHandler, handleEvent]);
|
|
720
722
|
var channelQueryCallRef = (0, _react.useRef)(function () {
|
|
721
723
|
var _ref = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(queryCall) {
|
|
722
724
|
var onAfterQueryCall,
|
|
@@ -1369,56 +1371,201 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1369
1371
|
return preview;
|
|
1370
1372
|
};
|
|
1371
1373
|
|
|
1372
|
-
var
|
|
1373
|
-
var _ref16 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee12(message
|
|
1374
|
-
var
|
|
1374
|
+
var uploadPendingAttachments = function () {
|
|
1375
|
+
var _ref16 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee12(message) {
|
|
1376
|
+
var _updatedMessage$attac;
|
|
1377
|
+
|
|
1378
|
+
var updatedMessage, i, _updatedMessage$attac2, attachment, file, filename, contentType, uploadResponse, response;
|
|
1375
1379
|
|
|
1376
1380
|
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
1377
1381
|
while (1) {
|
|
1378
1382
|
switch (_context12.prev = _context12.next) {
|
|
1379
1383
|
case 0:
|
|
1380
|
-
|
|
1381
|
-
|
|
1384
|
+
updatedMessage = (0, _extends2["default"])({}, message);
|
|
1385
|
+
|
|
1386
|
+
if (!((_updatedMessage$attac = updatedMessage.attachments) != null && _updatedMessage$attac.length)) {
|
|
1387
|
+
_context12.next = 39;
|
|
1388
|
+
break;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
i = 0;
|
|
1392
|
+
|
|
1393
|
+
case 3:
|
|
1394
|
+
if (!(i < ((_updatedMessage$attac2 = updatedMessage.attachments) == null ? void 0 : _updatedMessage$attac2.length))) {
|
|
1395
|
+
_context12.next = 39;
|
|
1396
|
+
break;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
attachment = updatedMessage.attachments[i];
|
|
1400
|
+
file = attachment.originalFile;
|
|
1401
|
+
|
|
1402
|
+
if (!(attachment.type === 'image' && file != null && file.uri && attachment.image_url && (0, _utils.isLocalUrl)(attachment.image_url))) {
|
|
1403
|
+
_context12.next = 22;
|
|
1404
|
+
break;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
filename = file.uri.replace(/^(file:\/\/|content:\/\/|assets-library:\/\/)/, '');
|
|
1408
|
+
contentType = (0, _mimeTypes.lookup)(filename) || 'multipart/form-data';
|
|
1409
|
+
|
|
1410
|
+
if (!doImageUploadRequest) {
|
|
1411
|
+
_context12.next = 15;
|
|
1412
|
+
break;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
_context12.next = 12;
|
|
1416
|
+
return doImageUploadRequest(file, channel);
|
|
1417
|
+
|
|
1418
|
+
case 12:
|
|
1419
|
+
_context12.t0 = _context12.sent;
|
|
1420
|
+
_context12.next = 18;
|
|
1421
|
+
break;
|
|
1422
|
+
|
|
1423
|
+
case 15:
|
|
1424
|
+
_context12.next = 17;
|
|
1425
|
+
return channel.sendImage(file == null ? void 0 : file.uri, filename, contentType);
|
|
1426
|
+
|
|
1427
|
+
case 17:
|
|
1428
|
+
_context12.t0 = _context12.sent;
|
|
1429
|
+
|
|
1430
|
+
case 18:
|
|
1431
|
+
uploadResponse = _context12.t0;
|
|
1432
|
+
attachment.image_url = uploadResponse.file;
|
|
1433
|
+
delete attachment.originalFile;
|
|
1434
|
+
dbApi.updateMessage({
|
|
1435
|
+
message: (0, _extends2["default"])({}, updatedMessage, {
|
|
1436
|
+
cid: channel.cid
|
|
1437
|
+
})
|
|
1438
|
+
});
|
|
1439
|
+
|
|
1440
|
+
case 22:
|
|
1441
|
+
if (!((attachment.type === 'file' || attachment.type === 'audio' || attachment.type === 'video') && attachment.asset_url && (0, _utils.isLocalUrl)(attachment.asset_url) && file != null && file.uri)) {
|
|
1442
|
+
_context12.next = 36;
|
|
1443
|
+
break;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
if (!doDocUploadRequest) {
|
|
1447
|
+
_context12.next = 29;
|
|
1448
|
+
break;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
_context12.next = 26;
|
|
1452
|
+
return doDocUploadRequest(file, channel);
|
|
1453
|
+
|
|
1454
|
+
case 26:
|
|
1455
|
+
_context12.t1 = _context12.sent;
|
|
1456
|
+
_context12.next = 32;
|
|
1457
|
+
break;
|
|
1458
|
+
|
|
1459
|
+
case 29:
|
|
1460
|
+
_context12.next = 31;
|
|
1461
|
+
return channel.sendFile(file.uri, file.name, file.type);
|
|
1462
|
+
|
|
1463
|
+
case 31:
|
|
1464
|
+
_context12.t1 = _context12.sent;
|
|
1465
|
+
|
|
1466
|
+
case 32:
|
|
1467
|
+
response = _context12.t1;
|
|
1468
|
+
attachment.asset_url = response.file;
|
|
1469
|
+
delete attachment.originalFile;
|
|
1470
|
+
dbApi.updateMessage({
|
|
1471
|
+
message: (0, _extends2["default"])({}, updatedMessage, {
|
|
1472
|
+
cid: channel.cid
|
|
1473
|
+
})
|
|
1474
|
+
});
|
|
1475
|
+
|
|
1476
|
+
case 36:
|
|
1477
|
+
i++;
|
|
1478
|
+
_context12.next = 3;
|
|
1479
|
+
break;
|
|
1480
|
+
|
|
1481
|
+
case 39:
|
|
1482
|
+
return _context12.abrupt("return", updatedMessage);
|
|
1483
|
+
|
|
1484
|
+
case 40:
|
|
1485
|
+
case "end":
|
|
1486
|
+
return _context12.stop();
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}, _callee12);
|
|
1490
|
+
}));
|
|
1491
|
+
|
|
1492
|
+
return function uploadPendingAttachments(_x5) {
|
|
1493
|
+
return _ref16.apply(this, arguments);
|
|
1494
|
+
};
|
|
1495
|
+
}();
|
|
1496
|
+
|
|
1497
|
+
var sendMessageRequest = function () {
|
|
1498
|
+
var _ref17 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee13(message, retrying) {
|
|
1499
|
+
var _updatedMessage, __html, attachments, created_at, deleted_at, html, id, latest_reactions, mentioned_users, own_reactions, parent_id, quoted_message, reaction_counts, reactions, status, text, type, updated_at, user, extraFields, _messageData, messageResponse;
|
|
1500
|
+
|
|
1501
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
1502
|
+
while (1) {
|
|
1503
|
+
switch (_context13.prev = _context13.next) {
|
|
1504
|
+
case 0:
|
|
1505
|
+
_context13.prev = 0;
|
|
1506
|
+
_context13.next = 3;
|
|
1507
|
+
return uploadPendingAttachments(message);
|
|
1508
|
+
|
|
1509
|
+
case 3:
|
|
1510
|
+
_updatedMessage = _context13.sent;
|
|
1511
|
+
__html = _updatedMessage.__html, attachments = _updatedMessage.attachments, created_at = _updatedMessage.created_at, deleted_at = _updatedMessage.deleted_at, html = _updatedMessage.html, id = _updatedMessage.id, latest_reactions = _updatedMessage.latest_reactions, mentioned_users = _updatedMessage.mentioned_users, own_reactions = _updatedMessage.own_reactions, parent_id = _updatedMessage.parent_id, quoted_message = _updatedMessage.quoted_message, reaction_counts = _updatedMessage.reaction_counts, reactions = _updatedMessage.reactions, status = _updatedMessage.status, text = _updatedMessage.text, type = _updatedMessage.type, updated_at = _updatedMessage.updated_at, user = _updatedMessage.user, extraFields = (0, _objectWithoutProperties2["default"])(_updatedMessage, _excluded2);
|
|
1512
|
+
|
|
1513
|
+
if (channel.id) {
|
|
1514
|
+
_context13.next = 7;
|
|
1515
|
+
break;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
return _context13.abrupt("return");
|
|
1519
|
+
|
|
1520
|
+
case 7:
|
|
1521
|
+
_messageData = (0, _extends2["default"])({
|
|
1382
1522
|
attachments: attachments,
|
|
1383
|
-
id:
|
|
1523
|
+
id: id,
|
|
1384
1524
|
mentioned_users: (mentioned_users == null ? void 0 : mentioned_users.map(function (mentionedUser) {
|
|
1385
1525
|
return mentionedUser.id;
|
|
1386
1526
|
})) || [],
|
|
1387
1527
|
parent_id: parent_id,
|
|
1388
1528
|
text: text
|
|
1389
1529
|
}, extraFields);
|
|
1390
|
-
_context12.prev = 2;
|
|
1391
1530
|
messageResponse = {};
|
|
1392
1531
|
|
|
1393
1532
|
if (!doSendMessageRequest) {
|
|
1394
|
-
|
|
1533
|
+
_context13.next = 15;
|
|
1395
1534
|
break;
|
|
1396
1535
|
}
|
|
1397
1536
|
|
|
1398
|
-
|
|
1399
|
-
return doSendMessageRequest((channel == null ? void 0 : channel.cid) || '',
|
|
1537
|
+
_context13.next = 12;
|
|
1538
|
+
return doSendMessageRequest((channel == null ? void 0 : channel.cid) || '', _messageData);
|
|
1400
1539
|
|
|
1401
|
-
case
|
|
1402
|
-
messageResponse =
|
|
1403
|
-
|
|
1540
|
+
case 12:
|
|
1541
|
+
messageResponse = _context13.sent;
|
|
1542
|
+
_context13.next = 19;
|
|
1404
1543
|
break;
|
|
1405
1544
|
|
|
1406
|
-
case
|
|
1545
|
+
case 15:
|
|
1407
1546
|
if (!channel) {
|
|
1408
|
-
|
|
1547
|
+
_context13.next = 19;
|
|
1409
1548
|
break;
|
|
1410
1549
|
}
|
|
1411
1550
|
|
|
1412
|
-
|
|
1413
|
-
return channel.sendMessage(
|
|
1551
|
+
_context13.next = 18;
|
|
1552
|
+
return channel.sendMessage(_messageData);
|
|
1414
1553
|
|
|
1415
|
-
case
|
|
1416
|
-
messageResponse =
|
|
1554
|
+
case 18:
|
|
1555
|
+
messageResponse = _context13.sent;
|
|
1417
1556
|
|
|
1418
|
-
case
|
|
1557
|
+
case 19:
|
|
1419
1558
|
if (messageResponse.message) {
|
|
1420
1559
|
messageResponse.message.status = _utils.MessageStatusTypes.RECEIVED;
|
|
1421
1560
|
|
|
1561
|
+
if (enableOfflineSupport) {
|
|
1562
|
+
dbApi.updateMessage({
|
|
1563
|
+
message: (0, _extends2["default"])({}, messageResponse.message, {
|
|
1564
|
+
cid: channel.cid
|
|
1565
|
+
})
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1422
1569
|
if (retrying) {
|
|
1423
1570
|
replaceMessage(message, messageResponse.message);
|
|
1424
1571
|
} else {
|
|
@@ -1426,37 +1573,47 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1426
1573
|
}
|
|
1427
1574
|
}
|
|
1428
1575
|
|
|
1429
|
-
|
|
1576
|
+
_context13.next = 28;
|
|
1430
1577
|
break;
|
|
1431
1578
|
|
|
1432
|
-
case
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
console.log(
|
|
1579
|
+
case 22:
|
|
1580
|
+
_context13.prev = 22;
|
|
1581
|
+
_context13.t0 = _context13["catch"](0);
|
|
1582
|
+
console.log(_context13.t0);
|
|
1436
1583
|
message.status = _utils.MessageStatusTypes.FAILED;
|
|
1437
|
-
updateMessage(message
|
|
1584
|
+
updateMessage((0, _extends2["default"])({}, message, {
|
|
1585
|
+
cid: channel.cid
|
|
1586
|
+
}));
|
|
1438
1587
|
|
|
1439
|
-
|
|
1588
|
+
if (enableOfflineSupport) {
|
|
1589
|
+
dbApi.updateMessage({
|
|
1590
|
+
message: (0, _extends2["default"])({}, message, {
|
|
1591
|
+
cid: channel.cid
|
|
1592
|
+
})
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
case 28:
|
|
1440
1597
|
case "end":
|
|
1441
|
-
return
|
|
1598
|
+
return _context13.stop();
|
|
1442
1599
|
}
|
|
1443
1600
|
}
|
|
1444
|
-
},
|
|
1601
|
+
}, _callee13, null, [[0, 22]]);
|
|
1445
1602
|
}));
|
|
1446
1603
|
|
|
1447
|
-
return function sendMessageRequest(
|
|
1448
|
-
return
|
|
1604
|
+
return function sendMessageRequest(_x6, _x7) {
|
|
1605
|
+
return _ref17.apply(this, arguments);
|
|
1449
1606
|
};
|
|
1450
1607
|
}();
|
|
1451
1608
|
|
|
1452
1609
|
var sendMessage = function () {
|
|
1453
|
-
var
|
|
1610
|
+
var _ref18 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee14(message) {
|
|
1454
1611
|
var _channel$state;
|
|
1455
1612
|
|
|
1456
1613
|
var messagePreview;
|
|
1457
|
-
return _regenerator["default"].wrap(function
|
|
1614
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
|
1458
1615
|
while (1) {
|
|
1459
|
-
switch (
|
|
1616
|
+
switch (_context14.prev = _context14.next) {
|
|
1460
1617
|
case 0:
|
|
1461
1618
|
if (channel != null && (_channel$state = channel.state) != null && _channel$state.filterErrorMessages) {
|
|
1462
1619
|
channel.state.filterErrorMessages();
|
|
@@ -1467,11 +1624,11 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1467
1624
|
}));
|
|
1468
1625
|
|
|
1469
1626
|
if (channel != null && channel.state.isUpToDate) {
|
|
1470
|
-
|
|
1627
|
+
_context14.next = 5;
|
|
1471
1628
|
break;
|
|
1472
1629
|
}
|
|
1473
1630
|
|
|
1474
|
-
|
|
1631
|
+
_context14.next = 5;
|
|
1475
1632
|
return reloadChannel();
|
|
1476
1633
|
|
|
1477
1634
|
case 5:
|
|
@@ -1479,46 +1636,56 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1479
1636
|
commands: [],
|
|
1480
1637
|
messageInput: ''
|
|
1481
1638
|
});
|
|
1482
|
-
|
|
1639
|
+
|
|
1640
|
+
if (enableOfflineSupport) {
|
|
1641
|
+
dbApi.upsertMessages({
|
|
1642
|
+
messages: [(0, _extends2["default"])({}, messagePreview, {
|
|
1643
|
+
cid: channel.cid,
|
|
1644
|
+
status: _utils.MessageStatusTypes.FAILED
|
|
1645
|
+
})]
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
_context14.next = 9;
|
|
1483
1650
|
return sendMessageRequest(messagePreview);
|
|
1484
1651
|
|
|
1485
|
-
case
|
|
1652
|
+
case 9:
|
|
1486
1653
|
case "end":
|
|
1487
|
-
return
|
|
1654
|
+
return _context14.stop();
|
|
1488
1655
|
}
|
|
1489
1656
|
}
|
|
1490
|
-
},
|
|
1657
|
+
}, _callee14);
|
|
1491
1658
|
}));
|
|
1492
1659
|
|
|
1493
|
-
return function sendMessage(
|
|
1494
|
-
return
|
|
1660
|
+
return function sendMessage(_x8) {
|
|
1661
|
+
return _ref18.apply(this, arguments);
|
|
1495
1662
|
};
|
|
1496
1663
|
}();
|
|
1497
1664
|
|
|
1498
1665
|
var retrySendMessage = function () {
|
|
1499
|
-
var
|
|
1666
|
+
var _ref19 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee15(message) {
|
|
1500
1667
|
var statusPendingMessage;
|
|
1501
|
-
return _regenerator["default"].wrap(function
|
|
1668
|
+
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
|
1502
1669
|
while (1) {
|
|
1503
|
-
switch (
|
|
1670
|
+
switch (_context15.prev = _context15.next) {
|
|
1504
1671
|
case 0:
|
|
1505
1672
|
statusPendingMessage = (0, _extends2["default"])({}, message, {
|
|
1506
1673
|
status: _utils.MessageStatusTypes.SENDING
|
|
1507
1674
|
});
|
|
1508
1675
|
updateMessage(statusPendingMessage);
|
|
1509
|
-
|
|
1676
|
+
_context15.next = 4;
|
|
1510
1677
|
return sendMessageRequest(statusPendingMessage, true);
|
|
1511
1678
|
|
|
1512
1679
|
case 4:
|
|
1513
1680
|
case "end":
|
|
1514
|
-
return
|
|
1681
|
+
return _context15.stop();
|
|
1515
1682
|
}
|
|
1516
1683
|
}
|
|
1517
|
-
},
|
|
1684
|
+
}, _callee15);
|
|
1518
1685
|
}));
|
|
1519
1686
|
|
|
1520
|
-
return function retrySendMessage(
|
|
1521
|
-
return
|
|
1687
|
+
return function retrySendMessage(_x9) {
|
|
1688
|
+
return _ref19.apply(this, arguments);
|
|
1522
1689
|
};
|
|
1523
1690
|
}();
|
|
1524
1691
|
|
|
@@ -1530,56 +1697,56 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1530
1697
|
}, defaultDebounceInterval, debounceOptions)).current;
|
|
1531
1698
|
|
|
1532
1699
|
var loadMore = function () {
|
|
1533
|
-
var
|
|
1700
|
+
var _ref20 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee16() {
|
|
1534
1701
|
var limit,
|
|
1535
1702
|
oldestMessage,
|
|
1536
1703
|
oldestID,
|
|
1537
1704
|
queryResponse,
|
|
1538
1705
|
updatedHasMore,
|
|
1539
|
-
|
|
1540
|
-
return _regenerator["default"].wrap(function
|
|
1706
|
+
_args16 = arguments;
|
|
1707
|
+
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
|
1541
1708
|
while (1) {
|
|
1542
|
-
switch (
|
|
1709
|
+
switch (_context16.prev = _context16.next) {
|
|
1543
1710
|
case 0:
|
|
1544
|
-
limit =
|
|
1711
|
+
limit = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : 20;
|
|
1545
1712
|
|
|
1546
1713
|
if (!(loadingMore || hasMore === false)) {
|
|
1547
|
-
|
|
1714
|
+
_context16.next = 3;
|
|
1548
1715
|
break;
|
|
1549
1716
|
}
|
|
1550
1717
|
|
|
1551
|
-
return
|
|
1718
|
+
return _context16.abrupt("return");
|
|
1552
1719
|
|
|
1553
1720
|
case 3:
|
|
1554
1721
|
setLoadingMore(true);
|
|
1555
1722
|
|
|
1556
1723
|
if (messages.length) {
|
|
1557
|
-
|
|
1724
|
+
_context16.next = 6;
|
|
1558
1725
|
break;
|
|
1559
1726
|
}
|
|
1560
1727
|
|
|
1561
|
-
return
|
|
1728
|
+
return _context16.abrupt("return", setLoadingMore(false));
|
|
1562
1729
|
|
|
1563
1730
|
case 6:
|
|
1564
1731
|
oldestMessage = messages && messages[0];
|
|
1565
1732
|
|
|
1566
1733
|
if (!(oldestMessage && oldestMessage.status !== _utils.MessageStatusTypes.RECEIVED)) {
|
|
1567
|
-
|
|
1734
|
+
_context16.next = 9;
|
|
1568
1735
|
break;
|
|
1569
1736
|
}
|
|
1570
1737
|
|
|
1571
|
-
return
|
|
1738
|
+
return _context16.abrupt("return", setLoadingMore(false));
|
|
1572
1739
|
|
|
1573
1740
|
case 9:
|
|
1574
1741
|
oldestID = oldestMessage && oldestMessage.id;
|
|
1575
|
-
|
|
1742
|
+
_context16.prev = 10;
|
|
1576
1743
|
|
|
1577
1744
|
if (!channel) {
|
|
1578
|
-
|
|
1745
|
+
_context16.next = 17;
|
|
1579
1746
|
break;
|
|
1580
1747
|
}
|
|
1581
1748
|
|
|
1582
|
-
|
|
1749
|
+
_context16.next = 14;
|
|
1583
1750
|
return channel.query({
|
|
1584
1751
|
messages: {
|
|
1585
1752
|
id_lt: oldestID,
|
|
@@ -1588,80 +1755,80 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1588
1755
|
});
|
|
1589
1756
|
|
|
1590
1757
|
case 14:
|
|
1591
|
-
queryResponse =
|
|
1758
|
+
queryResponse = _context16.sent;
|
|
1592
1759
|
updatedHasMore = queryResponse.messages.length === limit;
|
|
1593
1760
|
loadMoreFinished(updatedHasMore, channel.state.messages);
|
|
1594
1761
|
|
|
1595
1762
|
case 17:
|
|
1596
|
-
|
|
1763
|
+
_context16.next = 24;
|
|
1597
1764
|
break;
|
|
1598
1765
|
|
|
1599
1766
|
case 19:
|
|
1600
|
-
|
|
1601
|
-
|
|
1767
|
+
_context16.prev = 19;
|
|
1768
|
+
_context16.t0 = _context16["catch"](10);
|
|
1602
1769
|
|
|
1603
|
-
if (
|
|
1604
|
-
setError(
|
|
1770
|
+
if (_context16.t0 instanceof Error) {
|
|
1771
|
+
setError(_context16.t0);
|
|
1605
1772
|
} else {
|
|
1606
1773
|
setError(true);
|
|
1607
1774
|
}
|
|
1608
1775
|
|
|
1609
1776
|
setLoadingMore(false);
|
|
1610
|
-
throw
|
|
1777
|
+
throw _context16.t0;
|
|
1611
1778
|
|
|
1612
1779
|
case 24:
|
|
1613
1780
|
case "end":
|
|
1614
|
-
return
|
|
1781
|
+
return _context16.stop();
|
|
1615
1782
|
}
|
|
1616
1783
|
}
|
|
1617
|
-
},
|
|
1784
|
+
}, _callee16, null, [[10, 19]]);
|
|
1618
1785
|
}));
|
|
1619
1786
|
|
|
1620
1787
|
return function loadMore() {
|
|
1621
|
-
return
|
|
1788
|
+
return _ref20.apply(this, arguments);
|
|
1622
1789
|
};
|
|
1623
1790
|
}();
|
|
1624
1791
|
|
|
1625
1792
|
var loadMoreRecent = function () {
|
|
1626
|
-
var
|
|
1793
|
+
var _ref21 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee17() {
|
|
1627
1794
|
var limit,
|
|
1628
1795
|
recentMessage,
|
|
1629
1796
|
state,
|
|
1630
|
-
|
|
1631
|
-
return _regenerator["default"].wrap(function
|
|
1797
|
+
_args17 = arguments;
|
|
1798
|
+
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
|
1632
1799
|
while (1) {
|
|
1633
|
-
switch (
|
|
1800
|
+
switch (_context17.prev = _context17.next) {
|
|
1634
1801
|
case 0:
|
|
1635
|
-
limit =
|
|
1802
|
+
limit = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : 5;
|
|
1636
1803
|
|
|
1637
1804
|
if (!hasNoMoreRecentMessagesToLoad) {
|
|
1638
|
-
|
|
1805
|
+
_context17.next = 3;
|
|
1639
1806
|
break;
|
|
1640
1807
|
}
|
|
1641
1808
|
|
|
1642
|
-
return
|
|
1809
|
+
return _context17.abrupt("return");
|
|
1643
1810
|
|
|
1644
1811
|
case 3:
|
|
1645
1812
|
setLoadingMoreRecent(true);
|
|
1646
1813
|
recentMessage = messages[messages.length - 1];
|
|
1647
1814
|
|
|
1648
1815
|
if (!((recentMessage == null ? void 0 : recentMessage.status) !== _utils.MessageStatusTypes.RECEIVED)) {
|
|
1649
|
-
|
|
1816
|
+
_context17.next = 8;
|
|
1650
1817
|
break;
|
|
1651
1818
|
}
|
|
1652
1819
|
|
|
1653
1820
|
setLoadingMoreRecent(false);
|
|
1654
|
-
return
|
|
1821
|
+
return _context17.abrupt("return");
|
|
1655
1822
|
|
|
1656
1823
|
case 8:
|
|
1657
|
-
|
|
1824
|
+
_context17.prev = 8;
|
|
1658
1825
|
|
|
1659
1826
|
if (!channel) {
|
|
1660
|
-
|
|
1827
|
+
_context17.next = 15;
|
|
1661
1828
|
break;
|
|
1662
1829
|
}
|
|
1663
1830
|
|
|
1664
|
-
|
|
1831
|
+
_context17.next = 12;
|
|
1665
1832
|
return channel.query({
|
|
1666
1833
|
messages: {
|
|
1667
1834
|
id_gte: recentMessage.id,
|
|
@@ -1671,38 +1838,38 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1671
1838
|
});
|
|
1672
1839
|
|
|
1673
1840
|
case 12:
|
|
1674
|
-
state =
|
|
1841
|
+
state = _context17.sent;
|
|
1675
1842
|
setHasNoMoreRecentMessagesToLoad(state.messages.length < limit);
|
|
1676
1843
|
loadMoreRecentFinished(channel.state.messages);
|
|
1677
1844
|
|
|
1678
1845
|
case 15:
|
|
1679
|
-
|
|
1846
|
+
_context17.next = 23;
|
|
1680
1847
|
break;
|
|
1681
1848
|
|
|
1682
1849
|
case 17:
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
console.warn('Message pagination request failed with error',
|
|
1850
|
+
_context17.prev = 17;
|
|
1851
|
+
_context17.t0 = _context17["catch"](8);
|
|
1852
|
+
console.warn('Message pagination request failed with error', _context17.t0);
|
|
1686
1853
|
|
|
1687
|
-
if (
|
|
1688
|
-
setError(
|
|
1854
|
+
if (_context17.t0 instanceof Error) {
|
|
1855
|
+
setError(_context17.t0);
|
|
1689
1856
|
} else {
|
|
1690
1857
|
setError(true);
|
|
1691
1858
|
}
|
|
1692
1859
|
|
|
1693
1860
|
setLoadingMoreRecent(false);
|
|
1694
|
-
throw
|
|
1861
|
+
throw _context17.t0;
|
|
1695
1862
|
|
|
1696
1863
|
case 23:
|
|
1697
1864
|
case "end":
|
|
1698
|
-
return
|
|
1865
|
+
return _context17.stop();
|
|
1699
1866
|
}
|
|
1700
1867
|
}
|
|
1701
|
-
},
|
|
1868
|
+
}, _callee17, null, [[8, 17]]);
|
|
1702
1869
|
}));
|
|
1703
1870
|
|
|
1704
1871
|
return function loadMoreRecent() {
|
|
1705
|
-
return
|
|
1872
|
+
return _ref21.apply(this, arguments);
|
|
1706
1873
|
};
|
|
1707
1874
|
}();
|
|
1708
1875
|
|
|
@@ -1741,8 +1908,218 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1741
1908
|
setThreadMessages(channel.state.threads[thread.id] || []);
|
|
1742
1909
|
}
|
|
1743
1910
|
}
|
|
1911
|
+
|
|
1912
|
+
if (enableOfflineSupport) {
|
|
1913
|
+
dbApi.deleteMessage({
|
|
1914
|
+
id: message.id
|
|
1915
|
+
});
|
|
1916
|
+
}
|
|
1744
1917
|
};
|
|
1745
1918
|
|
|
1919
|
+
var sendReaction = function () {
|
|
1920
|
+
var _ref22 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee18(type, messageId) {
|
|
1921
|
+
var payload;
|
|
1922
|
+
return _regenerator["default"].wrap(function _callee18$(_context18) {
|
|
1923
|
+
while (1) {
|
|
1924
|
+
switch (_context18.prev = _context18.next) {
|
|
1925
|
+
case 0:
|
|
1926
|
+
if (!(!(channel != null && channel.id) || !client.user)) {
|
|
1927
|
+
_context18.next = 2;
|
|
1928
|
+
break;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
throw new Error('Channel has not been initialized');
|
|
1932
|
+
|
|
1933
|
+
case 2:
|
|
1934
|
+
payload = [messageId, {
|
|
1935
|
+
type: type
|
|
1936
|
+
}, {
|
|
1937
|
+
enforce_unique: enforceUniqueReaction
|
|
1938
|
+
}];
|
|
1939
|
+
|
|
1940
|
+
if (enableOfflineSupport) {
|
|
1941
|
+
_context18.next = 7;
|
|
1942
|
+
break;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
_context18.next = 6;
|
|
1946
|
+
return channel.sendReaction.apply(channel, payload);
|
|
1947
|
+
|
|
1948
|
+
case 6:
|
|
1949
|
+
return _context18.abrupt("return");
|
|
1950
|
+
|
|
1951
|
+
case 7:
|
|
1952
|
+
(0, _addReactionToLocalState.addReactionToLocalState)({
|
|
1953
|
+
channel: channel,
|
|
1954
|
+
enforceUniqueReaction: enforceUniqueReaction,
|
|
1955
|
+
messageId: messageId,
|
|
1956
|
+
reactionType: type,
|
|
1957
|
+
user: client.user
|
|
1958
|
+
});
|
|
1959
|
+
setMessages(channel.state.messages);
|
|
1960
|
+
_context18.next = 11;
|
|
1961
|
+
return (0, _pendingTaskUtils.queueTask)({
|
|
1962
|
+
client: client,
|
|
1963
|
+
task: {
|
|
1964
|
+
channelId: channel.id,
|
|
1965
|
+
channelType: channel.type,
|
|
1966
|
+
messageId: messageId,
|
|
1967
|
+
payload: payload,
|
|
1968
|
+
type: 'send-reaction'
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1971
|
+
|
|
1972
|
+
case 11:
|
|
1973
|
+
case "end":
|
|
1974
|
+
return _context18.stop();
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
}, _callee18);
|
|
1978
|
+
}));
|
|
1979
|
+
|
|
1980
|
+
return function sendReaction(_x10, _x11) {
|
|
1981
|
+
return _ref22.apply(this, arguments);
|
|
1982
|
+
};
|
|
1983
|
+
}();
|
|
1984
|
+
|
|
1985
|
+
var deleteMessage = function () {
|
|
1986
|
+
var _ref23 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee19(message) {
|
|
1987
|
+
var data;
|
|
1988
|
+
return _regenerator["default"].wrap(function _callee19$(_context19) {
|
|
1989
|
+
while (1) {
|
|
1990
|
+
switch (_context19.prev = _context19.next) {
|
|
1991
|
+
case 0:
|
|
1992
|
+
if (channel.id) {
|
|
1993
|
+
_context19.next = 2;
|
|
1994
|
+
break;
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
throw new Error('Channel has not been initialized yet');
|
|
1998
|
+
|
|
1999
|
+
case 2:
|
|
2000
|
+
if (enableOfflineSupport) {
|
|
2001
|
+
_context19.next = 6;
|
|
2002
|
+
break;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
_context19.next = 5;
|
|
2006
|
+
return client.deleteMessage(message.id);
|
|
2007
|
+
|
|
2008
|
+
case 5:
|
|
2009
|
+
return _context19.abrupt("return");
|
|
2010
|
+
|
|
2011
|
+
case 6:
|
|
2012
|
+
if (!(message.status === _utils.MessageStatusTypes.FAILED)) {
|
|
2013
|
+
_context19.next = 11;
|
|
2014
|
+
break;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
(0, _pendingTaskUtils.dropPendingTasks)({
|
|
2018
|
+
messageId: message.id
|
|
2019
|
+
});
|
|
2020
|
+
removeMessage(message);
|
|
2021
|
+
_context19.next = 16;
|
|
2022
|
+
break;
|
|
2023
|
+
|
|
2024
|
+
case 11:
|
|
2025
|
+
updateMessage((0, _extends2["default"])({}, message, {
|
|
2026
|
+
cid: channel.cid,
|
|
2027
|
+
deleted_at: new Date().toISOString(),
|
|
2028
|
+
type: 'deleted'
|
|
2029
|
+
}));
|
|
2030
|
+
_context19.next = 14;
|
|
2031
|
+
return (0, _pendingTaskUtils.queueTask)({
|
|
2032
|
+
client: client,
|
|
2033
|
+
task: {
|
|
2034
|
+
channelId: channel.id,
|
|
2035
|
+
channelType: channel.type,
|
|
2036
|
+
messageId: message.id,
|
|
2037
|
+
payload: [message.id],
|
|
2038
|
+
type: 'delete-message'
|
|
2039
|
+
}
|
|
2040
|
+
});
|
|
2041
|
+
|
|
2042
|
+
case 14:
|
|
2043
|
+
data = _context19.sent;
|
|
2044
|
+
|
|
2045
|
+
if (data != null && data.message) {
|
|
2046
|
+
updateMessage((0, _extends2["default"])({}, data.message));
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
case 16:
|
|
2050
|
+
case "end":
|
|
2051
|
+
return _context19.stop();
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
}, _callee19);
|
|
2055
|
+
}));
|
|
2056
|
+
|
|
2057
|
+
return function deleteMessage(_x12) {
|
|
2058
|
+
return _ref23.apply(this, arguments);
|
|
2059
|
+
};
|
|
2060
|
+
}();
|
|
2061
|
+
|
|
2062
|
+
var deleteReaction = function () {
|
|
2063
|
+
var _ref24 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee20(type, messageId) {
|
|
2064
|
+
var payload;
|
|
2065
|
+
return _regenerator["default"].wrap(function _callee20$(_context20) {
|
|
2066
|
+
while (1) {
|
|
2067
|
+
switch (_context20.prev = _context20.next) {
|
|
2068
|
+
case 0:
|
|
2069
|
+
if (!(!(channel != null && channel.id) || !client.user)) {
|
|
2070
|
+
_context20.next = 2;
|
|
2071
|
+
break;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
throw new Error('Channel has not been initialized');
|
|
2075
|
+
|
|
2076
|
+
case 2:
|
|
2077
|
+
payload = [messageId, type];
|
|
2078
|
+
|
|
2079
|
+
if (enableOfflineSupport) {
|
|
2080
|
+
_context20.next = 7;
|
|
2081
|
+
break;
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
_context20.next = 6;
|
|
2085
|
+
return channel.deleteReaction.apply(channel, payload);
|
|
2086
|
+
|
|
2087
|
+
case 6:
|
|
2088
|
+
return _context20.abrupt("return");
|
|
2089
|
+
|
|
2090
|
+
case 7:
|
|
2091
|
+
(0, _removeReactionFromLocalState.removeReactionFromLocalState)({
|
|
2092
|
+
channel: channel,
|
|
2093
|
+
messageId: messageId,
|
|
2094
|
+
reactionType: type,
|
|
2095
|
+
user: client.user
|
|
2096
|
+
});
|
|
2097
|
+
setMessages(channel.state.messages);
|
|
2098
|
+
_context20.next = 11;
|
|
2099
|
+
return (0, _pendingTaskUtils.queueTask)({
|
|
2100
|
+
client: client,
|
|
2101
|
+
task: {
|
|
2102
|
+
channelId: channel.id,
|
|
2103
|
+
channelType: channel.type,
|
|
2104
|
+
messageId: messageId,
|
|
2105
|
+
payload: payload,
|
|
2106
|
+
type: 'delete-reaction'
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2109
|
+
|
|
2110
|
+
case 11:
|
|
2111
|
+
case "end":
|
|
2112
|
+
return _context20.stop();
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
}, _callee20);
|
|
2116
|
+
}));
|
|
2117
|
+
|
|
2118
|
+
return function deleteReaction(_x13, _x14) {
|
|
2119
|
+
return _ref24.apply(this, arguments);
|
|
2120
|
+
};
|
|
2121
|
+
}();
|
|
2122
|
+
|
|
1746
2123
|
var openThread = function openThread(message) {
|
|
1747
2124
|
var _channel$state2;
|
|
1748
2125
|
|
|
@@ -1762,26 +2139,26 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1762
2139
|
}, defaultDebounceInterval, debounceOptions)).current;
|
|
1763
2140
|
|
|
1764
2141
|
var loadMoreThread = function () {
|
|
1765
|
-
var
|
|
2142
|
+
var _ref25 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee21() {
|
|
1766
2143
|
var _threadMessages$, parentID, oldestMessageID, limit, queryResponse, updatedHasMore, updatedThreadMessages;
|
|
1767
2144
|
|
|
1768
|
-
return _regenerator["default"].wrap(function
|
|
2145
|
+
return _regenerator["default"].wrap(function _callee21$(_context21) {
|
|
1769
2146
|
while (1) {
|
|
1770
|
-
switch (
|
|
2147
|
+
switch (_context21.prev = _context21.next) {
|
|
1771
2148
|
case 0:
|
|
1772
2149
|
if (!(threadLoadingMore || !(thread != null && thread.id))) {
|
|
1773
|
-
|
|
2150
|
+
_context21.next = 2;
|
|
1774
2151
|
break;
|
|
1775
2152
|
}
|
|
1776
2153
|
|
|
1777
|
-
return
|
|
2154
|
+
return _context21.abrupt("return");
|
|
1778
2155
|
|
|
1779
2156
|
case 2:
|
|
1780
2157
|
setThreadLoadingMore(true);
|
|
1781
|
-
|
|
2158
|
+
_context21.prev = 3;
|
|
1782
2159
|
|
|
1783
2160
|
if (!channel) {
|
|
1784
|
-
|
|
2161
|
+
_context21.next = 15;
|
|
1785
2162
|
break;
|
|
1786
2163
|
}
|
|
1787
2164
|
|
|
@@ -1789,46 +2166,46 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1789
2166
|
channel.state.threads[parentID] = threadMessages;
|
|
1790
2167
|
oldestMessageID = threadMessages == null ? void 0 : (_threadMessages$ = threadMessages[0]) == null ? void 0 : _threadMessages$.id;
|
|
1791
2168
|
limit = 50;
|
|
1792
|
-
|
|
2169
|
+
_context21.next = 11;
|
|
1793
2170
|
return channel.getReplies(parentID, {
|
|
1794
2171
|
id_lt: oldestMessageID,
|
|
1795
2172
|
limit: limit
|
|
1796
2173
|
});
|
|
1797
2174
|
|
|
1798
2175
|
case 11:
|
|
1799
|
-
queryResponse =
|
|
2176
|
+
queryResponse = _context21.sent;
|
|
1800
2177
|
updatedHasMore = queryResponse.messages.length === limit;
|
|
1801
2178
|
updatedThreadMessages = channel.state.threads[parentID] || [];
|
|
1802
2179
|
loadMoreThreadFinished(updatedHasMore, updatedThreadMessages);
|
|
1803
2180
|
|
|
1804
2181
|
case 15:
|
|
1805
|
-
|
|
2182
|
+
_context21.next = 23;
|
|
1806
2183
|
break;
|
|
1807
2184
|
|
|
1808
2185
|
case 17:
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
console.warn('Message pagination request failed with error',
|
|
2186
|
+
_context21.prev = 17;
|
|
2187
|
+
_context21.t0 = _context21["catch"](3);
|
|
2188
|
+
console.warn('Message pagination request failed with error', _context21.t0);
|
|
1812
2189
|
|
|
1813
|
-
if (
|
|
1814
|
-
setError(
|
|
2190
|
+
if (_context21.t0 instanceof Error) {
|
|
2191
|
+
setError(_context21.t0);
|
|
1815
2192
|
} else {
|
|
1816
2193
|
setError(true);
|
|
1817
2194
|
}
|
|
1818
2195
|
|
|
1819
2196
|
setThreadLoadingMore(false);
|
|
1820
|
-
throw
|
|
2197
|
+
throw _context21.t0;
|
|
1821
2198
|
|
|
1822
2199
|
case 23:
|
|
1823
2200
|
case "end":
|
|
1824
|
-
return
|
|
2201
|
+
return _context21.stop();
|
|
1825
2202
|
}
|
|
1826
2203
|
}
|
|
1827
|
-
},
|
|
2204
|
+
}, _callee21, null, [[3, 17]]);
|
|
1828
2205
|
}));
|
|
1829
2206
|
|
|
1830
2207
|
return function loadMoreThread() {
|
|
1831
|
-
return
|
|
2208
|
+
return _ref25.apply(this, arguments);
|
|
1832
2209
|
};
|
|
1833
2210
|
}();
|
|
1834
2211
|
|
|
@@ -1843,7 +2220,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1843
2220
|
enableMessageGroupingByUser: enableMessageGroupingByUser,
|
|
1844
2221
|
enforceUniqueReaction: enforceUniqueReaction,
|
|
1845
2222
|
error: error,
|
|
1846
|
-
giphyEnabled: giphyEnabled != null ? giphyEnabled : !!((
|
|
2223
|
+
giphyEnabled: giphyEnabled != null ? giphyEnabled : !!((_ref26 = (clientChannelConfig == null ? void 0 : clientChannelConfig.commands) || []) != null && _ref26.some(function (command) {
|
|
1847
2224
|
return command.name === 'giphy';
|
|
1848
2225
|
})),
|
|
1849
2226
|
hideDateSeparators: hideDateSeparators,
|
|
@@ -1898,7 +2275,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1898
2275
|
InputEditingStateHeader: InputEditingStateHeader,
|
|
1899
2276
|
InputGiphySearch: InputGiphySearch,
|
|
1900
2277
|
InputReplyStateHeader: InputReplyStateHeader,
|
|
1901
|
-
maxMessageLength: (
|
|
2278
|
+
maxMessageLength: (_ref27 = maxMessageLengthProp != null ? maxMessageLengthProp : clientChannelConfig == null ? void 0 : clientChannelConfig.max_message_length) != null ? _ref27 : undefined,
|
|
1902
2279
|
maxNumberOfFiles: maxNumberOfFiles,
|
|
1903
2280
|
mentionAllAppUsersEnabled: mentionAllAppUsersEnabled,
|
|
1904
2281
|
mentionAllAppUsersQuery: mentionAllAppUsersQuery,
|
|
@@ -1939,6 +2316,8 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1939
2316
|
channelId: channelId,
|
|
1940
2317
|
DateHeader: DateHeader,
|
|
1941
2318
|
deletedMessagesVisibilityType: deletedMessagesVisibilityType,
|
|
2319
|
+
deleteMessage: deleteMessage,
|
|
2320
|
+
deleteReaction: deleteReaction,
|
|
1942
2321
|
disableTypingIndicator: disableTypingIndicator,
|
|
1943
2322
|
dismissKeyboardOnMessageTouch: dismissKeyboardOnMessageTouch,
|
|
1944
2323
|
enableMessageGroupingByUser: enableMessageGroupingByUser,
|
|
@@ -1998,6 +2377,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
1998
2377
|
retrySendMessage: retrySendMessage,
|
|
1999
2378
|
ScrollToBottomButton: ScrollToBottomButton,
|
|
2000
2379
|
selectReaction: selectReaction,
|
|
2380
|
+
sendReaction: sendReaction,
|
|
2001
2381
|
setEditingState: setEditingState,
|
|
2002
2382
|
setQuotedMessageState: setQuotedMessageState,
|
|
2003
2383
|
supportedReactions: supportedReactions,
|
|
@@ -2038,7 +2418,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2038
2418
|
__self: _this,
|
|
2039
2419
|
__source: {
|
|
2040
2420
|
fileName: _jsxFileName,
|
|
2041
|
-
lineNumber:
|
|
2421
|
+
lineNumber: 1961,
|
|
2042
2422
|
columnNumber: 12
|
|
2043
2423
|
}
|
|
2044
2424
|
});
|
|
@@ -2053,7 +2433,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2053
2433
|
__self: _this,
|
|
2054
2434
|
__source: {
|
|
2055
2435
|
fileName: _jsxFileName,
|
|
2056
|
-
lineNumber:
|
|
2436
|
+
lineNumber: 1966,
|
|
2057
2437
|
columnNumber: 7
|
|
2058
2438
|
}
|
|
2059
2439
|
}, t('Please select a channel first'));
|
|
@@ -2067,7 +2447,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2067
2447
|
__self: _this,
|
|
2068
2448
|
__source: {
|
|
2069
2449
|
fileName: _jsxFileName,
|
|
2070
|
-
lineNumber:
|
|
2450
|
+
lineNumber: 1973,
|
|
2071
2451
|
columnNumber: 5
|
|
2072
2452
|
}
|
|
2073
2453
|
}), _react["default"].createElement(_ChannelContext.ChannelProvider, {
|
|
@@ -2075,7 +2455,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2075
2455
|
__self: _this,
|
|
2076
2456
|
__source: {
|
|
2077
2457
|
fileName: _jsxFileName,
|
|
2078
|
-
lineNumber:
|
|
2458
|
+
lineNumber: 1979,
|
|
2079
2459
|
columnNumber: 7
|
|
2080
2460
|
}
|
|
2081
2461
|
}, _react["default"].createElement(_OwnCapabilitiesContext.OwnCapabilitiesProvider, {
|
|
@@ -2083,7 +2463,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2083
2463
|
__self: _this,
|
|
2084
2464
|
__source: {
|
|
2085
2465
|
fileName: _jsxFileName,
|
|
2086
|
-
lineNumber:
|
|
2466
|
+
lineNumber: 1980,
|
|
2087
2467
|
columnNumber: 9
|
|
2088
2468
|
}
|
|
2089
2469
|
}, _react["default"].createElement(_TypingContext.TypingProvider, {
|
|
@@ -2091,7 +2471,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2091
2471
|
__self: _this,
|
|
2092
2472
|
__source: {
|
|
2093
2473
|
fileName: _jsxFileName,
|
|
2094
|
-
lineNumber:
|
|
2474
|
+
lineNumber: 1981,
|
|
2095
2475
|
columnNumber: 11
|
|
2096
2476
|
}
|
|
2097
2477
|
}, _react["default"].createElement(_PaginatedMessageListContext.PaginatedMessageListProvider, {
|
|
@@ -2099,7 +2479,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2099
2479
|
__self: _this,
|
|
2100
2480
|
__source: {
|
|
2101
2481
|
fileName: _jsxFileName,
|
|
2102
|
-
lineNumber:
|
|
2482
|
+
lineNumber: 1982,
|
|
2103
2483
|
columnNumber: 13
|
|
2104
2484
|
}
|
|
2105
2485
|
}, _react["default"].createElement(_MessagesContext.MessagesProvider, {
|
|
@@ -2107,7 +2487,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2107
2487
|
__self: _this,
|
|
2108
2488
|
__source: {
|
|
2109
2489
|
fileName: _jsxFileName,
|
|
2110
|
-
lineNumber:
|
|
2490
|
+
lineNumber: 1983,
|
|
2111
2491
|
columnNumber: 15
|
|
2112
2492
|
}
|
|
2113
2493
|
}, _react["default"].createElement(_ThreadContext.ThreadProvider, {
|
|
@@ -2115,7 +2495,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2115
2495
|
__self: _this,
|
|
2116
2496
|
__source: {
|
|
2117
2497
|
fileName: _jsxFileName,
|
|
2118
|
-
lineNumber:
|
|
2498
|
+
lineNumber: 1984,
|
|
2119
2499
|
columnNumber: 17
|
|
2120
2500
|
}
|
|
2121
2501
|
}, _react["default"].createElement(_SuggestionsContext.SuggestionsProvider, {
|
|
@@ -2123,7 +2503,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2123
2503
|
__self: _this,
|
|
2124
2504
|
__source: {
|
|
2125
2505
|
fileName: _jsxFileName,
|
|
2126
|
-
lineNumber:
|
|
2506
|
+
lineNumber: 1985,
|
|
2127
2507
|
columnNumber: 19
|
|
2128
2508
|
}
|
|
2129
2509
|
}, _react["default"].createElement(_MessageInputContext.MessageInputProvider, {
|
|
@@ -2131,7 +2511,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2131
2511
|
__self: _this,
|
|
2132
2512
|
__source: {
|
|
2133
2513
|
fileName: _jsxFileName,
|
|
2134
|
-
lineNumber:
|
|
2514
|
+
lineNumber: 1986,
|
|
2135
2515
|
columnNumber: 21
|
|
2136
2516
|
}
|
|
2137
2517
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -2141,7 +2521,7 @@ var ChannelWithContext = function ChannelWithContext(props) {
|
|
|
2141
2521
|
__self: _this,
|
|
2142
2522
|
__source: {
|
|
2143
2523
|
fileName: _jsxFileName,
|
|
2144
|
-
lineNumber:
|
|
2524
|
+
lineNumber: 1987,
|
|
2145
2525
|
columnNumber: 23
|
|
2146
2526
|
}
|
|
2147
2527
|
}, children))))))))));
|
|
@@ -2151,7 +2531,8 @@ var Channel = function Channel(props) {
|
|
|
2151
2531
|
var _props$thread, _props$thread2;
|
|
2152
2532
|
|
|
2153
2533
|
var _useChatContext = (0, _ChatContext.useChatContext)(),
|
|
2154
|
-
client = _useChatContext.client
|
|
2534
|
+
client = _useChatContext.client,
|
|
2535
|
+
enableOfflineSupport = _useChatContext.enableOfflineSupport;
|
|
2155
2536
|
|
|
2156
2537
|
var _useTranslationContex = (0, _TranslationContext.useTranslationContext)(),
|
|
2157
2538
|
t = _useTranslationContex.t;
|
|
@@ -2176,6 +2557,7 @@ var Channel = function Channel(props) {
|
|
|
2176
2557
|
|
|
2177
2558
|
return _react["default"].createElement(ChannelWithContext, (0, _extends2["default"])({
|
|
2178
2559
|
client: client,
|
|
2560
|
+
enableOfflineSupport: enableOfflineSupport,
|
|
2179
2561
|
t: t
|
|
2180
2562
|
}, props, {
|
|
2181
2563
|
shouldSyncChannel: shouldSyncChannel,
|
|
@@ -2196,7 +2578,7 @@ var Channel = function Channel(props) {
|
|
|
2196
2578
|
__self: _this,
|
|
2197
2579
|
__source: {
|
|
2198
2580
|
fileName: _jsxFileName,
|
|
2199
|
-
lineNumber:
|
|
2581
|
+
lineNumber: 2044,
|
|
2200
2582
|
columnNumber: 5
|
|
2201
2583
|
}
|
|
2202
2584
|
}));
|