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
|
@@ -5,6 +5,7 @@ import type { UserResponse } from 'stream-chat';
|
|
|
5
5
|
|
|
6
6
|
import { useCountdown } from './hooks/useCountdown';
|
|
7
7
|
|
|
8
|
+
import { ChatContextValue, useChatContext } from '../../contexts';
|
|
8
9
|
import { useAttachmentPickerContext } from '../../contexts/attachmentPickerContext/AttachmentPickerContext';
|
|
9
10
|
import {
|
|
10
11
|
ChannelContextValue,
|
|
@@ -78,7 +79,8 @@ const styles = StyleSheet.create({
|
|
|
78
79
|
|
|
79
80
|
type MessageInputPropsWithContext<
|
|
80
81
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
81
|
-
> = Pick<
|
|
82
|
+
> = Pick<ChatContextValue<StreamChatGenerics>, 'isOnline'> &
|
|
83
|
+
Pick<ChannelContextValue<StreamChatGenerics>, 'disabled' | 'members' | 'watchers'> &
|
|
82
84
|
Pick<
|
|
83
85
|
MessageInputContextValue<StreamChatGenerics>,
|
|
84
86
|
| 'additionalTextInputProps'
|
|
@@ -159,6 +161,7 @@ const MessageInputWithContext = <
|
|
|
159
161
|
InputEditingStateHeader,
|
|
160
162
|
InputGiphySearch,
|
|
161
163
|
InputReplyStateHeader,
|
|
164
|
+
isOnline,
|
|
162
165
|
isValidMessage,
|
|
163
166
|
maxNumberOfFiles,
|
|
164
167
|
members,
|
|
@@ -526,7 +529,7 @@ const MessageInputWithContext = <
|
|
|
526
529
|
) : null}
|
|
527
530
|
{fileUploads.length ? <FileUploadPreview /> : null}
|
|
528
531
|
{giphyActive ? (
|
|
529
|
-
<InputGiphySearch />
|
|
532
|
+
<InputGiphySearch disabled={!isOnline} />
|
|
530
533
|
) : (
|
|
531
534
|
<View style={[styles.autoCompleteInputContainer, autoCompleteInputContainer]}>
|
|
532
535
|
<AutoCompleteInput<StreamChatGenerics>
|
|
@@ -540,7 +543,11 @@ const MessageInputWithContext = <
|
|
|
540
543
|
{cooldownRemainingSeconds ? (
|
|
541
544
|
<CooldownTimer seconds={cooldownRemainingSeconds} />
|
|
542
545
|
) : (
|
|
543
|
-
<SendButton
|
|
546
|
+
<SendButton
|
|
547
|
+
disabled={
|
|
548
|
+
disabled || sending.current || !isValidMessage() || (giphyActive && !isOnline)
|
|
549
|
+
}
|
|
550
|
+
/>
|
|
544
551
|
)}
|
|
545
552
|
</View>
|
|
546
553
|
</>
|
|
@@ -598,6 +605,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
598
605
|
fileUploads: prevFileUploads,
|
|
599
606
|
giphyActive: prevGiphyActive,
|
|
600
607
|
imageUploads: prevImageUploads,
|
|
608
|
+
isOnline: prevIsOnline,
|
|
601
609
|
isValidMessage: prevIsValidMessage,
|
|
602
610
|
mentionedUsers: prevMentionedUsers,
|
|
603
611
|
quotedMessage: prevQuotedMessage,
|
|
@@ -616,6 +624,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
616
624
|
fileUploads: nextFileUploads,
|
|
617
625
|
giphyActive: nextGiphyActive,
|
|
618
626
|
imageUploads: nextImageUploads,
|
|
627
|
+
isOnline: nextIsOnline,
|
|
619
628
|
isValidMessage: nextIsValidMessage,
|
|
620
629
|
mentionedUsers: nextMentionedUsers,
|
|
621
630
|
quotedMessage: nextQuotedMessage,
|
|
@@ -661,6 +670,9 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
661
670
|
const showMoreOptionsEqual = prevShowMoreOptions === nextShowMoreOptions;
|
|
662
671
|
if (!showMoreOptionsEqual) return false;
|
|
663
672
|
|
|
673
|
+
const isOnlineEqual = prevIsOnline === nextIsOnline;
|
|
674
|
+
if (!isOnlineEqual) return false;
|
|
675
|
+
|
|
664
676
|
const isValidMessageEqual = prevIsValidMessage() === nextIsValidMessage();
|
|
665
677
|
if (!isValidMessageEqual) return false;
|
|
666
678
|
|
|
@@ -719,6 +731,7 @@ export const MessageInput = <
|
|
|
719
731
|
>(
|
|
720
732
|
props: MessageInputProps<StreamChatGenerics>,
|
|
721
733
|
) => {
|
|
734
|
+
const { isOnline } = useChatContext();
|
|
722
735
|
const ownCapabilities = useOwnCapabilitiesContext();
|
|
723
736
|
|
|
724
737
|
const { disabled = false, members, watchers } = useChannelContext<StreamChatGenerics>();
|
|
@@ -809,6 +822,7 @@ export const MessageInput = <
|
|
|
809
822
|
InputEditingStateHeader,
|
|
810
823
|
InputGiphySearch,
|
|
811
824
|
InputReplyStateHeader,
|
|
825
|
+
isOnline,
|
|
812
826
|
isValidMessage,
|
|
813
827
|
maxNumberOfFiles,
|
|
814
828
|
members,
|
|
@@ -38,7 +38,7 @@ const SendButtonWithContext = <
|
|
|
38
38
|
style={[sendButton]}
|
|
39
39
|
testID='send-button'
|
|
40
40
|
>
|
|
41
|
-
{giphyActive && <Search pathFill={accent_blue} />}
|
|
41
|
+
{giphyActive && <Search pathFill={disabled ? grey_gainsboro : accent_blue} />}
|
|
42
42
|
{!giphyActive && disabled && <SendRight pathFill={grey_gainsboro} />}
|
|
43
43
|
{!giphyActive && !disabled && <SendUp pathFill={accent_blue} />}
|
|
44
44
|
</TouchableOpacity>
|
package/src/components/index.ts
CHANGED
|
@@ -72,7 +72,6 @@ export * from './Chat/Chat';
|
|
|
72
72
|
export * from './Chat/hooks/useCreateChatContext';
|
|
73
73
|
export * from './Chat/hooks/useIsOnline';
|
|
74
74
|
export * from './Chat/hooks/useMutedUsers';
|
|
75
|
-
export * from './Chat/hooks/useConnectionRecovered';
|
|
76
75
|
export * from './Chat/hooks/useSyncDatabase';
|
|
77
76
|
|
|
78
77
|
export * from './ImageGallery/ImageGallery';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useContext } from 'react';
|
|
2
2
|
import type { ImageProps } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import type { AppSettingsAPIResponse, Channel,
|
|
4
|
+
import type { AppSettingsAPIResponse, Channel, Mute, StreamChat } from 'stream-chat';
|
|
5
5
|
|
|
6
6
|
import type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';
|
|
7
7
|
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
@@ -44,7 +44,6 @@ export type ChatContextValue<
|
|
|
44
44
|
* @overrideType Function
|
|
45
45
|
*/
|
|
46
46
|
setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;
|
|
47
|
-
subscribeConnectionRecoveredCallback: (callback: EventHandler<StreamChatGenerics>) => () => void;
|
|
48
47
|
/**
|
|
49
48
|
* Instance of channel object from stream-chat package.
|
|
50
49
|
*
|
|
@@ -416,7 +416,7 @@ export const MessageInputProvider = <
|
|
|
416
416
|
}>) => {
|
|
417
417
|
const { closePicker, openPicker, selectedPicker, setSelectedPicker } =
|
|
418
418
|
useAttachmentPickerContext();
|
|
419
|
-
const { appSettings, client } = useChatContext<StreamChatGenerics>();
|
|
419
|
+
const { appSettings, client, enableOfflineSupport } = useChatContext<StreamChatGenerics>();
|
|
420
420
|
|
|
421
421
|
const getFileUploadConfig = () => {
|
|
422
422
|
const fileConfig = appSettings?.app?.file_upload_config;
|
|
@@ -491,9 +491,10 @@ export const MessageInputProvider = <
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
for (const image of imageUploads) {
|
|
494
|
-
if (!image || image.state === FileState.UPLOAD_FAILED) {
|
|
494
|
+
if ((!image || image.state === FileState.UPLOAD_FAILED) && !enableOfflineSupport) {
|
|
495
495
|
continue;
|
|
496
496
|
}
|
|
497
|
+
|
|
497
498
|
if (image.state === FileState.UPLOADING) {
|
|
498
499
|
// TODO: show error to user that they should wait until image is uploaded
|
|
499
500
|
return false;
|
|
@@ -503,7 +504,7 @@ export const MessageInputProvider = <
|
|
|
503
504
|
}
|
|
504
505
|
|
|
505
506
|
for (const file of fileUploads) {
|
|
506
|
-
if (!file || file.state === FileState.UPLOAD_FAILED) {
|
|
507
|
+
if ((!file || file.state === FileState.UPLOAD_FAILED) && !enableOfflineSupport) {
|
|
507
508
|
continue;
|
|
508
509
|
}
|
|
509
510
|
if (file.state === FileState.UPLOADING) {
|
|
@@ -647,7 +648,7 @@ export const MessageInputProvider = <
|
|
|
647
648
|
|
|
648
649
|
const attachments = [] as Attachment<StreamChatGenerics>[];
|
|
649
650
|
for (const image of imageUploads) {
|
|
650
|
-
if (!image || image.state === FileState.UPLOAD_FAILED) {
|
|
651
|
+
if ((!image || image.state === FileState.UPLOAD_FAILED) && !enableOfflineSupport) {
|
|
651
652
|
continue;
|
|
652
653
|
}
|
|
653
654
|
|
|
@@ -668,22 +669,29 @@ export const MessageInputProvider = <
|
|
|
668
669
|
// To get the mime type of the image from the file name and send it as an response for an image
|
|
669
670
|
const mime_type: string | boolean = lookup(image.file.filename as string);
|
|
670
671
|
|
|
671
|
-
if (
|
|
672
|
+
if (
|
|
673
|
+
image.state === FileState.UPLOADED ||
|
|
674
|
+
image.state === FileState.FINISHED ||
|
|
675
|
+
(enableOfflineSupport && image.state === FileState.UPLOAD_FAILED)
|
|
676
|
+
) {
|
|
677
|
+
// @ts-ignore
|
|
672
678
|
attachments.push({
|
|
673
679
|
fallback: image.file.name,
|
|
674
680
|
image_url: image.url,
|
|
675
681
|
mime_type: mime_type ? mime_type : undefined,
|
|
676
682
|
original_height: image.height,
|
|
677
683
|
original_width: image.width,
|
|
684
|
+
originalFile: image.file,
|
|
678
685
|
type: 'image',
|
|
679
686
|
});
|
|
680
687
|
}
|
|
681
688
|
}
|
|
682
689
|
|
|
683
690
|
for (const file of fileUploads) {
|
|
684
|
-
if (!file || file.state === FileState.UPLOAD_FAILED) {
|
|
691
|
+
if ((!file || file.state === FileState.UPLOAD_FAILED) && !enableOfflineSupport) {
|
|
685
692
|
continue;
|
|
686
693
|
}
|
|
694
|
+
|
|
687
695
|
if (file.state === FileState.UPLOADING) {
|
|
688
696
|
// TODO: show error to user that they should wait until image is uploaded
|
|
689
697
|
sending.current = false;
|
|
@@ -691,38 +699,46 @@ export const MessageInputProvider = <
|
|
|
691
699
|
}
|
|
692
700
|
const mime_type: string | boolean = lookup(file.file.name as string);
|
|
693
701
|
|
|
694
|
-
if (
|
|
702
|
+
if (
|
|
703
|
+
file.state === FileState.UPLOADED ||
|
|
704
|
+
file.state === FileState.FINISHED ||
|
|
705
|
+
(enableOfflineSupport && file.state === FileState.UPLOAD_FAILED)
|
|
706
|
+
) {
|
|
695
707
|
if (file.file.type?.startsWith('image/')) {
|
|
696
708
|
attachments.push({
|
|
697
709
|
fallback: file.file.name,
|
|
698
710
|
image_url: file.url,
|
|
699
711
|
mime_type: mime_type ? mime_type : undefined,
|
|
712
|
+
originalFile: file.file,
|
|
700
713
|
type: 'image',
|
|
701
714
|
});
|
|
702
715
|
} else if (file.file.type?.startsWith('audio/')) {
|
|
703
716
|
attachments.push({
|
|
704
|
-
asset_url: file.url,
|
|
717
|
+
asset_url: file.url || file.file.uri,
|
|
705
718
|
duration: file.file.duration,
|
|
706
719
|
file_size: file.file.size,
|
|
707
720
|
mime_type: file.file.type,
|
|
721
|
+
originalFile: file.file,
|
|
708
722
|
title: file.file.name,
|
|
709
723
|
type: 'audio',
|
|
710
724
|
});
|
|
711
725
|
} else if (file.file.type?.startsWith('video/')) {
|
|
712
726
|
attachments.push({
|
|
713
|
-
asset_url: file.url,
|
|
727
|
+
asset_url: file.url || file.file.uri,
|
|
714
728
|
duration: file.file.duration,
|
|
715
729
|
file_size: file.file.size,
|
|
716
730
|
mime_type: file.file.type,
|
|
731
|
+
originalFile: file.file,
|
|
717
732
|
thumb_url: file.thumb_url,
|
|
718
733
|
title: file.file.name,
|
|
719
734
|
type: 'video',
|
|
720
735
|
});
|
|
721
736
|
} else {
|
|
722
737
|
attachments.push({
|
|
723
|
-
asset_url: file.url,
|
|
738
|
+
asset_url: file.url || file.file.uri,
|
|
724
739
|
file_size: file.file.size,
|
|
725
740
|
mime_type: file.file.type,
|
|
741
|
+
originalFile: file.file,
|
|
726
742
|
title: file.file.name,
|
|
727
743
|
type: 'file',
|
|
728
744
|
});
|
|
@@ -1073,8 +1089,11 @@ export const MessageInputProvider = <
|
|
|
1073
1089
|
|
|
1074
1090
|
const newImage: ImageUpload = {
|
|
1075
1091
|
file: image,
|
|
1092
|
+
height: image.height,
|
|
1076
1093
|
id,
|
|
1077
1094
|
state: imageState,
|
|
1095
|
+
url: image.uri,
|
|
1096
|
+
width: image.width,
|
|
1078
1097
|
};
|
|
1079
1098
|
|
|
1080
1099
|
await Promise.all([
|
|
@@ -7,6 +7,9 @@ Object {
|
|
|
7
7
|
"fallback": undefined,
|
|
8
8
|
"image_url": undefined,
|
|
9
9
|
"mime_type": undefined,
|
|
10
|
+
"originalFile": Object {
|
|
11
|
+
"uri": "http://www.jackblack.com/tenac_iousd.bmp",
|
|
12
|
+
},
|
|
10
13
|
"original_height": undefined,
|
|
11
14
|
"original_width": undefined,
|
|
12
15
|
"type": "image",
|
|
@@ -43,6 +46,11 @@ Object {
|
|
|
43
46
|
"asset_url": undefined,
|
|
44
47
|
"file_size": undefined,
|
|
45
48
|
"mime_type": "file",
|
|
49
|
+
"originalFile": Object {
|
|
50
|
+
"name": "dummy.pdf",
|
|
51
|
+
"state": "uploaded",
|
|
52
|
+
"type": "file",
|
|
53
|
+
},
|
|
46
54
|
"title": "dummy.pdf",
|
|
47
55
|
"type": "file",
|
|
48
56
|
},
|
|
@@ -51,6 +59,11 @@ Object {
|
|
|
51
59
|
"duration": undefined,
|
|
52
60
|
"file_size": undefined,
|
|
53
61
|
"mime_type": "video/mp4",
|
|
62
|
+
"originalFile": Object {
|
|
63
|
+
"name": "dummy.pdf",
|
|
64
|
+
"state": "finished",
|
|
65
|
+
"type": "video/mp4",
|
|
66
|
+
},
|
|
54
67
|
"thumb_url": undefined,
|
|
55
68
|
"title": "dummy.pdf",
|
|
56
69
|
"type": "video",
|
|
@@ -60,6 +73,11 @@ Object {
|
|
|
60
73
|
"duration": undefined,
|
|
61
74
|
"file_size": undefined,
|
|
62
75
|
"mime_type": "audio/mp3",
|
|
76
|
+
"originalFile": Object {
|
|
77
|
+
"name": "dummy.pdf",
|
|
78
|
+
"state": "uploaded",
|
|
79
|
+
"type": "audio/mp3",
|
|
80
|
+
},
|
|
63
81
|
"title": "dummy.pdf",
|
|
64
82
|
"type": "audio",
|
|
65
83
|
},
|
|
@@ -67,6 +85,11 @@ Object {
|
|
|
67
85
|
"fallback": "dummy.pdf",
|
|
68
86
|
"image_url": undefined,
|
|
69
87
|
"mime_type": "application/pdf",
|
|
88
|
+
"originalFile": Object {
|
|
89
|
+
"name": "dummy.pdf",
|
|
90
|
+
"state": "finished",
|
|
91
|
+
"type": "image/jpeg",
|
|
92
|
+
},
|
|
70
93
|
"type": "image",
|
|
71
94
|
},
|
|
72
95
|
],
|
|
@@ -88,6 +111,9 @@ Object {
|
|
|
88
111
|
"fallback": undefined,
|
|
89
112
|
"image_url": undefined,
|
|
90
113
|
"mime_type": undefined,
|
|
114
|
+
"originalFile": Object {
|
|
115
|
+
"uri": "http://www.jackblack.com/tenac_iousd.bmp",
|
|
116
|
+
},
|
|
91
117
|
"original_height": undefined,
|
|
92
118
|
"original_width": undefined,
|
|
93
119
|
"type": "image",
|
|
@@ -96,6 +122,9 @@ Object {
|
|
|
96
122
|
"fallback": undefined,
|
|
97
123
|
"image_url": undefined,
|
|
98
124
|
"mime_type": undefined,
|
|
125
|
+
"originalFile": Object {
|
|
126
|
+
"uri": "http://www.jackblack.com/tenac_iousd.bmp",
|
|
127
|
+
},
|
|
99
128
|
"original_height": undefined,
|
|
100
129
|
"original_width": undefined,
|
|
101
130
|
"type": "image",
|
|
@@ -87,6 +87,8 @@ export type MessagesContextValue<
|
|
|
87
87
|
* Defaults to: [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageList/DateHeader.tsx)
|
|
88
88
|
**/
|
|
89
89
|
DateHeader: React.ComponentType<DateHeaderProps>;
|
|
90
|
+
deleteMessage: (message: MessageResponse<StreamChatGenerics>) => Promise<void>;
|
|
91
|
+
deleteReaction: (type: string, messageId: string) => Promise<void>;
|
|
90
92
|
|
|
91
93
|
/** Should keyboard be dismissed when messaged is touched */
|
|
92
94
|
dismissKeyboardOnMessageTouch: boolean;
|
|
@@ -176,11 +178,11 @@ export type MessagesContextValue<
|
|
|
176
178
|
* Custom message pinned component
|
|
177
179
|
*/
|
|
178
180
|
MessagePinnedHeader: React.ComponentType<MessagePinnedHeaderProps<StreamChatGenerics>>;
|
|
181
|
+
|
|
179
182
|
/**
|
|
180
183
|
* UI component for MessageReplies
|
|
181
184
|
* Defaults to: [MessageReplies](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageSimple/MessageReplies.tsx)
|
|
182
185
|
*/
|
|
183
|
-
|
|
184
186
|
MessageReplies: React.ComponentType<MessageRepliesProps<StreamChatGenerics>>;
|
|
185
187
|
/**
|
|
186
188
|
* UI Component for MessageRepliesAvatars
|
|
@@ -226,6 +228,7 @@ export type MessagesContextValue<
|
|
|
226
228
|
* Defaults to: [ScrollToBottomButton](https://getstream.io/chat/docs/sdk/reactnative/ui-components/scroll-to-bottom-button/)
|
|
227
229
|
*/
|
|
228
230
|
ScrollToBottomButton: React.ComponentType<ScrollToBottomButtonProps>;
|
|
231
|
+
sendReaction: (type: string, messageId: string) => Promise<void>;
|
|
229
232
|
setEditingState: (message: MessageType<StreamChatGenerics>) => void;
|
|
230
233
|
setQuotedMessageState: (message: MessageType<StreamChatGenerics>) => void;
|
|
231
234
|
supportedReactions: ReactionData[];
|
|
@@ -19,7 +19,7 @@ export const useTranslatedMessage = <
|
|
|
19
19
|
|
|
20
20
|
const translationKey: TranslationKey = `${userLanguage}_text`;
|
|
21
21
|
|
|
22
|
-
if (message.i18n && translationKey in message.i18n) {
|
|
22
|
+
if (message.i18n && translationKey in message.i18n && message.type !== 'deleted') {
|
|
23
23
|
return {
|
|
24
24
|
...message,
|
|
25
25
|
text: message.i18n[translationKey],
|
|
@@ -12,7 +12,7 @@ export const sqliteMock = {
|
|
|
12
12
|
status: 0,
|
|
13
13
|
};
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
execute: (dbName: string, queryInput: string, params: unknown[]) => {
|
|
16
16
|
const query = queryInput.trim().toLowerCase();
|
|
17
17
|
const stmt = db.prepare(query);
|
|
18
18
|
let result: unknown[] = [];
|
|
@@ -72,7 +72,7 @@ export const sqliteMock = {
|
|
|
72
72
|
status: 0,
|
|
73
73
|
};
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
executeBatch: (dbName: string, queriesArr: PreparedQueries[]) => {
|
|
76
76
|
queriesArr.forEach((queryAndParams) => {
|
|
77
77
|
const query = queryAndParams[0];
|
|
78
78
|
const params = queryAndParams[1];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { mockedApiResponse } from './utils';
|
|
2
|
+
|
|
3
|
+
import { generateMessage } from '../generator/message';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the api response for sendMessage api.
|
|
6
|
+
*
|
|
7
|
+
* api - /channels/{type}/{id}/message
|
|
8
|
+
*
|
|
9
|
+
* @param {*} message
|
|
10
|
+
*/
|
|
11
|
+
export const deleteMessageApi = (message = generateMessage()) => {
|
|
12
|
+
const result = {
|
|
13
|
+
duration: 0.01,
|
|
14
|
+
message,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return mockedApiResponse(result, 'delete');
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { mockedApiResponse } from './utils';
|
|
2
|
+
|
|
3
|
+
import { generateReaction } from '../generator/reaction';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the api response for sendMessage api.
|
|
6
|
+
*
|
|
7
|
+
* api - /messages/{id}/reaction
|
|
8
|
+
*
|
|
9
|
+
* @param {*} message
|
|
10
|
+
*/
|
|
11
|
+
export const deleteReactionApi = (message, reaction = generateReaction()) => {
|
|
12
|
+
const result = {
|
|
13
|
+
duration: 0.01,
|
|
14
|
+
message,
|
|
15
|
+
reaction,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return mockedApiResponse(result, 'delete');
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { mockedApiResponse } from './utils';
|
|
2
|
+
|
|
3
|
+
import { generateReaction } from '../generator/reaction';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the api response for sendMessage api.
|
|
6
|
+
*
|
|
7
|
+
* api - /messages/{id}/reaction
|
|
8
|
+
*
|
|
9
|
+
* @param {*} message
|
|
10
|
+
*/
|
|
11
|
+
export const sendReactionApi = (message, reaction = generateReaction()) => {
|
|
12
|
+
const result = {
|
|
13
|
+
duration: 0.01,
|
|
14
|
+
message,
|
|
15
|
+
reaction,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return mockedApiResponse(result, 'post');
|
|
19
|
+
};
|
|
@@ -3,14 +3,14 @@ import type { QuickSQLite } from 'react-native-quick-sqlite';
|
|
|
3
3
|
let sqlite: typeof QuickSQLite;
|
|
4
4
|
|
|
5
5
|
try {
|
|
6
|
-
sqlite = require('react-native-quick-sqlite')
|
|
6
|
+
sqlite = require('react-native-quick-sqlite').QuickSQLite;
|
|
7
7
|
} catch (e) {
|
|
8
8
|
// Failed for one of the reason
|
|
9
9
|
// 1. Running on expo, where we don't support offline storage yet.
|
|
10
10
|
// 2. Offline support is disabled, in which case this library is not installed.
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
import { DB_LOCATION, DB_NAME
|
|
13
|
+
import { DB_LOCATION, DB_NAME } from './constants';
|
|
14
14
|
import { tables } from './schema';
|
|
15
15
|
import { createCreateTableQuery } from './sqlite-utils/createCreateTableQuery';
|
|
16
16
|
import type { PreparedQueries, Table } from './types';
|
|
@@ -20,7 +20,7 @@ import type { PreparedQueries, Table } from './types';
|
|
|
20
20
|
* This way usage react-native-quick-sqlite package is scoped to a single class/file.
|
|
21
21
|
*/
|
|
22
22
|
export class QuickSqliteClient {
|
|
23
|
-
static dbVersion =
|
|
23
|
+
static dbVersion = 3;
|
|
24
24
|
|
|
25
25
|
static dbName = DB_NAME;
|
|
26
26
|
static dbLocation = DB_LOCATION;
|
|
@@ -30,46 +30,47 @@ export class QuickSqliteClient {
|
|
|
30
30
|
static setDbVersion = (version: number) => (this.dbVersion = version);
|
|
31
31
|
|
|
32
32
|
static openDB = () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
console.error(`Error opening database ${this.dbName}: ${
|
|
33
|
+
try {
|
|
34
|
+
sqlite.open(this.dbName, this.dbLocation);
|
|
35
|
+
sqlite.execute(this.dbName, `PRAGMA foreign_keys = ON`, []);
|
|
36
|
+
} catch (e) {
|
|
37
|
+
console.error(`Error opening database ${this.dbName}: ${e}`);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
static closeDB = () => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
console.error(`Error closing database ${this.dbName}: ${
|
|
42
|
+
try {
|
|
43
|
+
sqlite.close(this.dbName);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
console.error(`Error closing database ${this.dbName}: ${e}`);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
static executeSqlBatch = (queries: PreparedQueries[]) => {
|
|
50
|
+
if (!queries || !queries.length) return;
|
|
50
51
|
this.openDB();
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
try {
|
|
54
|
+
sqlite.executeBatch(DB_NAME, queries);
|
|
55
|
+
this.closeDB();
|
|
56
|
+
} catch (e) {
|
|
57
|
+
this.closeDB();
|
|
58
|
+
throw new Error(`Query/queries failed: ${e}`);
|
|
56
59
|
}
|
|
57
|
-
|
|
58
|
-
this.closeDB();
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
static executeSql = (query: string, params?: string[]) => {
|
|
62
63
|
this.openDB();
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
try {
|
|
66
|
+
const { rows } = sqlite.execute(DB_NAME, query, params);
|
|
67
|
+
this.closeDB();
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
return rows ? rows._array : [];
|
|
70
|
+
} catch (e) {
|
|
71
|
+
this.closeDB();
|
|
72
|
+
throw new Error(`Query/queries failed: ${e}: `);
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
return rows ? rows._array : [];
|
|
73
74
|
};
|
|
74
75
|
|
|
75
76
|
static dropTables = () => {
|
|
@@ -82,9 +83,10 @@ export class QuickSqliteClient {
|
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
static deleteDatabase = () => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
try {
|
|
87
|
+
sqlite.delete(this.dbName, this.dbLocation);
|
|
88
|
+
} catch (e) {
|
|
89
|
+
throw new Error(`Error deleting DB: ${e}`);
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
return true;
|
|
@@ -118,7 +120,7 @@ export class QuickSqliteClient {
|
|
|
118
120
|
static updateUserPragmaVersion = (version: number) => {
|
|
119
121
|
this.openDB();
|
|
120
122
|
|
|
121
|
-
sqlite.
|
|
123
|
+
sqlite.execute(DB_NAME, `PRAGMA user_version = ${version}`, []);
|
|
122
124
|
|
|
123
125
|
this.closeDB();
|
|
124
126
|
};
|
|
@@ -126,15 +128,15 @@ export class QuickSqliteClient {
|
|
|
126
128
|
static getUserPragmaVersion = () => {
|
|
127
129
|
this.openDB();
|
|
128
130
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
try {
|
|
132
|
+
const { rows } = sqlite.execute(DB_NAME, `PRAGMA user_version`, []);
|
|
133
|
+
const result = rows ? rows._array : [];
|
|
134
|
+
this.closeDB();
|
|
135
|
+
return result[0].user_version as number;
|
|
136
|
+
} catch (e) {
|
|
137
|
+
this.closeDB();
|
|
138
|
+
throw new Error(`Querying for user_version failed: ${e}`);
|
|
134
139
|
}
|
|
135
|
-
|
|
136
|
-
const result = rows ? rows._array : [];
|
|
137
|
-
return result[0].user_version as number;
|
|
138
140
|
};
|
|
139
141
|
|
|
140
142
|
static resetDB = () => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { mapTaskToStorable } from '../mappers/mapTaskToStorable';
|
|
2
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
3
|
+
import { createDeleteQuery } from '../sqlite-utils/createDeleteQuery';
|
|
4
|
+
import { createUpsertQuery } from '../sqlite-utils/createUpsertQuery';
|
|
5
|
+
import type { PendingTask } from '../types';
|
|
6
|
+
|
|
7
|
+
export const addPendingTask = (task: PendingTask) => {
|
|
8
|
+
const storable = mapTaskToStorable(task);
|
|
9
|
+
const query = createUpsertQuery('pendingTasks', storable);
|
|
10
|
+
|
|
11
|
+
QuickSqliteClient.executeSql.apply(null, query);
|
|
12
|
+
|
|
13
|
+
return () => {
|
|
14
|
+
const { channelId, channelType, payload, type } = storable;
|
|
15
|
+
const query = createDeleteQuery('pendingTasks', {
|
|
16
|
+
channelId,
|
|
17
|
+
channelType,
|
|
18
|
+
payload,
|
|
19
|
+
type,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
QuickSqliteClient.executeSql.apply(null, query);
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
2
|
+
import { createDeleteQuery } from '../sqlite-utils/createDeleteQuery';
|
|
3
|
+
|
|
4
|
+
export const deleteMessage = ({ flush = true, id }: { id: string; flush?: boolean }) => {
|
|
5
|
+
const query = createDeleteQuery('messages', {
|
|
6
|
+
id,
|
|
7
|
+
});
|
|
8
|
+
if (flush) {
|
|
9
|
+
QuickSqliteClient.executeSql.apply(null, query);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return [query];
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { QuickSqliteClient } from '../QuickSqliteClient';
|
|
2
|
+
import { createDeleteQuery } from '../sqlite-utils/createDeleteQuery';
|
|
3
|
+
|
|
4
|
+
export const deletePendingTask = ({ id }: { id: number }) => {
|
|
5
|
+
const query = createDeleteQuery('pendingTasks', {
|
|
6
|
+
id,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
QuickSqliteClient.executeSql.apply(null, query);
|
|
10
|
+
|
|
11
|
+
return [query];
|
|
12
|
+
};
|