stream-chat-react-native-core 9.0.0-beta.31 → 9.0.0-beta.32
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 +15 -52
- package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +4 -6
- package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +4 -10
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/commonjs/components/Attachment/FilePreview.js +3 -6
- package/lib/commonjs/components/Attachment/FilePreview.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +9 -28
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/GalleryImage.js +3 -3
- package/lib/commonjs/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy/GiphyImage.js +7 -13
- package/lib/commonjs/components/Attachment/Giphy/GiphyImage.js.map +1 -1
- package/lib/commonjs/components/Attachment/UnsupportedAttachment.js +4 -6
- package/lib/commonjs/components/Attachment/UnsupportedAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/UrlPreview/URLPreview.js +3 -3
- package/lib/commonjs/components/Attachment/UrlPreview/URLPreview.js.map +1 -1
- package/lib/commonjs/components/Attachment/UrlPreview/URLPreviewCompact.js +3 -3
- package/lib/commonjs/components/Attachment/UrlPreview/URLPreviewCompact.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +4 -2
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +7 -4
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +9 -13
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +9 -418
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +0 -8
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -77
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +2 -132
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +1 -57
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +4 -2
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListView.js +11 -20
- package/lib/commonjs/components/ChannelList/ChannelListView.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +1 -39
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelDetailsBottomSheet.js +3 -2
- package/lib/commonjs/components/ChannelPreview/ChannelDetailsBottomSheet.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +4 -6
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +6 -18
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js +8 -28
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelSwipableWrapper.js +3 -3
- package/lib/commonjs/components/ChannelPreview/ChannelSwipableWrapper.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +4 -6
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +0 -2
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +7 -9
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +4 -2
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +9 -13
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageBubble.js +4 -2
- package/lib/commonjs/components/Message/MessageItemView/MessageBubble.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageContent.js +18 -39
- package/lib/commonjs/components/Message/MessageItemView/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageDeleted.js +5 -7
- package/lib/commonjs/components/Message/MessageItemView/MessageDeleted.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageFooter.js +4 -8
- package/lib/commonjs/components/Message/MessageItemView/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageHeader.js +8 -16
- package/lib/commonjs/components/Message/MessageItemView/MessageHeader.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js +13 -35
- package/lib/commonjs/components/Message/MessageItemView/MessageItemView.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js +3 -5
- package/lib/commonjs/components/Message/MessageItemView/MessageReplies.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageTextContainer.js +3 -3
- package/lib/commonjs/components/Message/MessageItemView/MessageTextContainer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/MessageWrapper.js +6 -4
- package/lib/commonjs/components/Message/MessageItemView/MessageWrapper.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListBottom.js +6 -8
- package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListBottom.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListTop.js +7 -11
- package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListTop.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageComposer.js +15 -55
- package/lib/commonjs/components/MessageInput/MessageComposer.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInputHeaderView.js +5 -5
- package/lib/commonjs/components/MessageInput/MessageInputHeaderView.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +9 -17
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.js +5 -5
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js +5 -5
- package/lib/commonjs/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js +5 -5
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/InputButtons/index.js +4 -4
- package/lib/commonjs/components/MessageInput/components/InputButtons/index.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/LinkPreviewList.js +3 -2
- package/lib/commonjs/components/MessageInput/components/LinkPreviewList.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/OutputButtons/index.js +7 -13
- package/lib/commonjs/components/MessageInput/components/OutputButtons/index.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageFlashList.js +14 -40
- package/lib/commonjs/components/MessageList/MessageFlashList.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +12 -38
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/StickyHeader.js +3 -1
- package/lib/commonjs/components/MessageList/StickyHeader.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageActionList.js +4 -2
- package/lib/commonjs/components/MessageMenu/MessageActionList.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageMenu.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageUserReactions.js +4 -8
- package/lib/commonjs/components/MessageMenu/MessageUserReactions.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js +4 -2
- package/lib/commonjs/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
- package/lib/commonjs/components/Poll/CreatePollContent.js +3 -1
- package/lib/commonjs/components/Poll/CreatePollContent.js.map +1 -1
- package/lib/commonjs/components/Poll/Poll.js +12 -9
- package/lib/commonjs/components/Poll/Poll.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollAnswersList.js +5 -3
- package/lib/commonjs/components/Poll/components/PollAnswersList.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollOption.js +5 -3
- package/lib/commonjs/components/Poll/components/PollOption.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js +5 -5
- package/lib/commonjs/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollResults.js +5 -3
- package/lib/commonjs/components/Poll/components/PollResults/PollResults.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +4 -2
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/Thread/Thread.js +4 -8
- package/lib/commonjs/components/Thread/Thread.js.map +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +4 -6
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadList.js +12 -15
- package/lib/commonjs/components/ThreadList/ThreadList.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListItem.js +8 -11
- package/lib/commonjs/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/commonjs/components/ui/Avatar/Avatar.js +3 -3
- package/lib/commonjs/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/componentsContext/ComponentsContext.js +37 -0
- package/lib/commonjs/contexts/componentsContext/ComponentsContext.js.map +1 -0
- package/lib/commonjs/contexts/componentsContext/PLAN.md +148 -0
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js +286 -0
- package/lib/commonjs/contexts/componentsContext/defaultComponents.js.map +1 -0
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +1 -9
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContextBase.js.map +1 -1
- package/lib/commonjs/contexts/index.js +11 -0
- package/lib/commonjs/contexts/index.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -76
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js +7 -5
- package/lib/commonjs/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +1 -4
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/contexts/threadsContext/ThreadsContext.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +15 -52
- package/lib/module/components/Attachment/Attachment.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +4 -6
- package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +4 -10
- package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/module/components/Attachment/FilePreview.js +3 -6
- package/lib/module/components/Attachment/FilePreview.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +9 -28
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/GalleryImage.js +3 -3
- package/lib/module/components/Attachment/GalleryImage.js.map +1 -1
- package/lib/module/components/Attachment/Giphy/GiphyImage.js +7 -13
- package/lib/module/components/Attachment/Giphy/GiphyImage.js.map +1 -1
- package/lib/module/components/Attachment/UnsupportedAttachment.js +4 -6
- package/lib/module/components/Attachment/UnsupportedAttachment.js.map +1 -1
- package/lib/module/components/Attachment/UrlPreview/URLPreview.js +3 -3
- package/lib/module/components/Attachment/UrlPreview/URLPreview.js.map +1 -1
- package/lib/module/components/Attachment/UrlPreview/URLPreviewCompact.js +3 -3
- package/lib/module/components/Attachment/UrlPreview/URLPreviewCompact.js.map +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +4 -2
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +7 -4
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +9 -13
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +9 -418
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js +0 -8
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +3 -77
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +2 -132
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +1 -57
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +4 -2
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListView.js +11 -20
- package/lib/module/components/ChannelList/ChannelListView.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +1 -39
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelDetailsBottomSheet.js +3 -2
- package/lib/module/components/ChannelPreview/ChannelDetailsBottomSheet.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +4 -6
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +6 -18
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewView.js +8 -28
- package/lib/module/components/ChannelPreview/ChannelPreviewView.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelSwipableWrapper.js +3 -3
- package/lib/module/components/ChannelPreview/ChannelSwipableWrapper.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +4 -6
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +0 -2
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +7 -9
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +4 -2
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/Message/Message.js +9 -13
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageBubble.js +4 -2
- package/lib/module/components/Message/MessageItemView/MessageBubble.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageContent.js +18 -39
- package/lib/module/components/Message/MessageItemView/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageDeleted.js +5 -7
- package/lib/module/components/Message/MessageItemView/MessageDeleted.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageFooter.js +4 -8
- package/lib/module/components/Message/MessageItemView/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageHeader.js +8 -16
- package/lib/module/components/Message/MessageItemView/MessageHeader.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageItemView.js +13 -35
- package/lib/module/components/Message/MessageItemView/MessageItemView.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageReplies.js +3 -5
- package/lib/module/components/Message/MessageItemView/MessageReplies.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageTextContainer.js +3 -3
- package/lib/module/components/Message/MessageItemView/MessageTextContainer.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/MessageWrapper.js +6 -4
- package/lib/module/components/Message/MessageItemView/MessageWrapper.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListBottom.js +6 -8
- package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListBottom.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListTop.js +7 -11
- package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListTop.js.map +1 -1
- package/lib/module/components/MessageInput/MessageComposer.js +15 -55
- package/lib/module/components/MessageInput/MessageComposer.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInputHeaderView.js +5 -5
- package/lib/module/components/MessageInput/MessageInputHeaderView.js.map +1 -1
- package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js +9 -17
- package/lib/module/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.js.map +1 -1
- package/lib/module/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.js +5 -5
- package/lib/module/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js +5 -5
- package/lib/module/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js +5 -5
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.js.map +1 -1
- package/lib/module/components/MessageInput/components/InputButtons/index.js +4 -4
- package/lib/module/components/MessageInput/components/InputButtons/index.js.map +1 -1
- package/lib/module/components/MessageInput/components/LinkPreviewList.js +3 -2
- package/lib/module/components/MessageInput/components/LinkPreviewList.js.map +1 -1
- package/lib/module/components/MessageInput/components/OutputButtons/index.js +7 -13
- package/lib/module/components/MessageInput/components/OutputButtons/index.js.map +1 -1
- package/lib/module/components/MessageList/MessageFlashList.js +14 -40
- package/lib/module/components/MessageList/MessageFlashList.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +12 -38
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/StickyHeader.js +3 -1
- package/lib/module/components/MessageList/StickyHeader.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageActionList.js +4 -2
- package/lib/module/components/MessageMenu/MessageActionList.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageMenu.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageUserReactions.js +4 -8
- package/lib/module/components/MessageMenu/MessageUserReactions.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageUserReactionsItem.js +4 -2
- package/lib/module/components/MessageMenu/MessageUserReactionsItem.js.map +1 -1
- package/lib/module/components/Poll/CreatePollContent.js +3 -1
- package/lib/module/components/Poll/CreatePollContent.js.map +1 -1
- package/lib/module/components/Poll/Poll.js +12 -9
- package/lib/module/components/Poll/Poll.js.map +1 -1
- package/lib/module/components/Poll/components/PollAnswersList.js +5 -3
- package/lib/module/components/Poll/components/PollAnswersList.js.map +1 -1
- package/lib/module/components/Poll/components/PollOption.js +5 -3
- package/lib/module/components/Poll/components/PollOption.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js +5 -5
- package/lib/module/components/Poll/components/PollResults/PollOptionFullResults.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollResults.js +5 -3
- package/lib/module/components/Poll/components/PollResults/PollResults.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +4 -2
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/Thread/Thread.js +4 -8
- package/lib/module/components/Thread/Thread.js.map +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +4 -6
- package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadList.js +12 -15
- package/lib/module/components/ThreadList/ThreadList.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadListItem.js +8 -11
- package/lib/module/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/module/components/ui/Avatar/Avatar.js +3 -3
- package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/componentsContext/ComponentsContext.js +37 -0
- package/lib/module/contexts/componentsContext/ComponentsContext.js.map +1 -0
- package/lib/module/contexts/componentsContext/PLAN.md +148 -0
- package/lib/module/contexts/componentsContext/defaultComponents.js +286 -0
- package/lib/module/contexts/componentsContext/defaultComponents.js.map +1 -0
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +1 -9
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContextBase.js.map +1 -1
- package/lib/module/contexts/index.js +11 -0
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +2 -76
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js +7 -5
- package/lib/module/contexts/overlayContext/MessageOverlayHostLayer.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +1 -4
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/contexts/threadsContext/ThreadsContext.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Attachment.d.ts +1 -1
- package/lib/typescript/components/Attachment/Attachment.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/FileAttachment.d.ts +1 -1
- package/lib/typescript/components/Attachment/FileAttachment.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +1 -2
- package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/FilePreview.d.ts +2 -3
- package/lib/typescript/components/Attachment/FilePreview.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/Gallery.d.ts +1 -1
- package/lib/typescript/components/Attachment/Gallery.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/GalleryImage.d.ts +3 -2
- package/lib/typescript/components/Attachment/GalleryImage.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/Giphy/GiphyImage.d.ts +4 -2
- package/lib/typescript/components/Attachment/Giphy/GiphyImage.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/UnsupportedAttachment.d.ts +2 -3
- package/lib/typescript/components/Attachment/UnsupportedAttachment.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/UrlPreview/URLPreview.d.ts +4 -3
- package/lib/typescript/components/Attachment/UrlPreview/URLPreview.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/UrlPreview/URLPreviewCompact.d.ts +4 -3
- package/lib/typescript/components/Attachment/UrlPreview/URLPreviewCompact.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts.map +1 -1
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts +2 -3
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts.map +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +3 -28
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useMessageListPagination.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/ChannelList.d.ts +2 -10
- package/lib/typescript/components/ChannelList/ChannelList.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/ChannelListLoadingIndicator.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/ChannelListView.d.ts +1 -1
- package/lib/typescript/components/ChannelList/ChannelListView.d.ts.map +1 -1
- package/lib/typescript/components/ChannelList/hooks/useCreateChannelsContext.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/useCreateChannelsContext.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelDetailsBottomSheet.d.ts +1 -2
- package/lib/typescript/components/ChannelPreview/ChannelDetailsBottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts +1 -2
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewView.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewView.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelSwipableWrapper.d.ts +1 -3
- package/lib/typescript/components/ChannelPreview/ChannelSwipableWrapper.d.ts.map +1 -1
- package/lib/typescript/components/Chat/Chat.d.ts +1 -7
- package/lib/typescript/components/Chat/Chat.d.ts.map +1 -1
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +6 -1
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/types.d.ts +0 -2
- package/lib/typescript/components/ImageGallery/components/types.d.ts.map +1 -1
- package/lib/typescript/components/Message/Message.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageBubble.d.ts +1 -2
- package/lib/typescript/components/Message/MessageItemView/MessageBubble.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageContent.d.ts +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageContent.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageDeleted.d.ts +1 -2
- package/lib/typescript/components/Message/MessageItemView/MessageDeleted.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageFooter.d.ts +0 -2
- package/lib/typescript/components/Message/MessageItemView/MessageFooter.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageHeader.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageItemView.d.ts +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageItemView.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageReplies.d.ts +1 -2
- package/lib/typescript/components/Message/MessageItemView/MessageReplies.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageTextContainer.d.ts +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageTextContainer.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/MessageWrapper.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListBottom.d.ts +1 -1
- package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListBottom.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListTop.d.ts +1 -1
- package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListTop.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/MessageComposer.d.ts +1 -2
- package/lib/typescript/components/MessageInput/MessageComposer.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.d.ts +3 -4
- package/lib/typescript/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.d.ts +1 -1
- package/lib/typescript/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/InputButtons/index.d.ts +1 -1
- package/lib/typescript/components/MessageInput/components/InputButtons/index.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/LinkPreviewList.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/components/OutputButtons/index.d.ts +1 -1
- package/lib/typescript/components/MessageInput/components/OutputButtons/index.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageFlashList.d.ts +1 -1
- package/lib/typescript/components/MessageList/MessageFlashList.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/StickyHeader.d.ts +2 -3
- package/lib/typescript/components/MessageList/StickyHeader.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageActionList.d.ts +1 -2
- package/lib/typescript/components/MessageMenu/MessageActionList.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageMenu.d.ts +1 -2
- package/lib/typescript/components/MessageMenu/MessageMenu.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageUserReactions.d.ts +1 -1
- package/lib/typescript/components/MessageMenu/MessageUserReactions.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/MessageUserReactionsItem.d.ts +2 -3
- package/lib/typescript/components/MessageMenu/MessageUserReactionsItem.d.ts.map +1 -1
- package/lib/typescript/components/Poll/CreatePollContent.d.ts +2 -2
- package/lib/typescript/components/Poll/CreatePollContent.d.ts.map +1 -1
- package/lib/typescript/components/Poll/Poll.d.ts +5 -8
- package/lib/typescript/components/Poll/Poll.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollAnswersList.d.ts +1 -2
- package/lib/typescript/components/Poll/components/PollAnswersList.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollOption.d.ts +1 -2
- package/lib/typescript/components/Poll/components/PollOption.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollResults/PollOptionFullResults.d.ts +1 -4
- package/lib/typescript/components/Poll/components/PollResults/PollOptionFullResults.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollResults/PollResults.d.ts +1 -2
- package/lib/typescript/components/Poll/components/PollResults/PollResults.d.ts.map +1 -1
- package/lib/typescript/components/Reply/Reply.d.ts +4 -3
- package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
- package/lib/typescript/components/Thread/Thread.d.ts +2 -8
- package/lib/typescript/components/Thread/Thread.d.ts.map +1 -1
- package/lib/typescript/components/Thread/components/ThreadFooterComponent.d.ts +1 -2
- package/lib/typescript/components/Thread/components/ThreadFooterComponent.d.ts.map +1 -1
- package/lib/typescript/components/ThreadList/ThreadList.d.ts +2 -3
- package/lib/typescript/components/ThreadList/ThreadList.d.ts.map +1 -1
- package/lib/typescript/components/ThreadList/ThreadListItem.d.ts.map +1 -1
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +0 -17
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts.map +1 -1
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +0 -23
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts.map +1 -1
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +0 -112
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts.map +1 -1
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +0 -5
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts.map +1 -1
- package/lib/typescript/contexts/componentsContext/ComponentsContext.d.ts +321 -0
- package/lib/typescript/contexts/componentsContext/ComponentsContext.d.ts.map +1 -0
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts +296 -0
- package/lib/typescript/contexts/componentsContext/defaultComponents.d.ts.map +1 -0
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts.map +1 -1
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContextBase.d.ts +0 -5
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContextBase.d.ts.map +1 -1
- package/lib/typescript/contexts/index.d.ts +1 -0
- package/lib/typescript/contexts/index.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +1 -169
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +3 -332
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/MessageOverlayHostLayer.d.ts +2 -5
- package/lib/typescript/contexts/overlayContext/MessageOverlayHostLayer.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +0 -4
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts.map +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts.map +1 -1
- package/lib/typescript/contexts/threadsContext/ThreadsContext.d.ts +0 -9
- package/lib/typescript/contexts/threadsContext/ThreadsContext.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/offline-support/offline-feature.js +64 -67
- package/src/components/Attachment/Attachment.tsx +7 -69
- package/src/components/Attachment/FileAttachment.tsx +4 -7
- package/src/components/Attachment/FileAttachmentGroup.tsx +9 -19
- package/src/components/Attachment/FilePreview.tsx +4 -9
- package/src/components/Attachment/Gallery.tsx +6 -83
- package/src/components/Attachment/GalleryImage.tsx +5 -4
- package/src/components/Attachment/Giphy/GiphyImage.tsx +15 -37
- package/src/components/Attachment/UnsupportedAttachment.tsx +5 -10
- package/src/components/Attachment/UrlPreview/URLPreview.tsx +6 -4
- package/src/components/Attachment/UrlPreview/URLPreviewCompact.tsx +6 -4
- package/src/components/AttachmentPicker/AttachmentPicker.tsx +2 -2
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +5 -4
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +4 -20
- package/src/components/Channel/Channel.tsx +31 -438
- package/src/components/Channel/__tests__/isAttachmentEqualHandler.test.js +12 -9
- package/src/components/Channel/hooks/useCreateChannelContext.ts +0 -8
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +1 -81
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +0 -130
- package/src/components/ChannelList/ChannelList.tsx +3 -76
- package/src/components/ChannelList/ChannelListLoadingIndicator.tsx +3 -1
- package/src/components/ChannelList/ChannelListView.tsx +12 -33
- package/src/components/ChannelList/__tests__/ChannelList.test.js +173 -116
- package/src/components/ChannelList/__tests__/ChannelListView.test.js +64 -41
- package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +0 -39
- package/src/components/ChannelPreview/ChannelDetailsBottomSheet.tsx +2 -2
- package/src/components/ChannelPreview/ChannelPreview.tsx +6 -14
- package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +7 -33
- package/src/components/ChannelPreview/ChannelPreviewView.tsx +11 -40
- package/src/components/ChannelPreview/ChannelSwipableWrapper.tsx +2 -4
- package/src/components/ChannelPreview/__tests__/ChannelDetailsBottomSheet.test.tsx +16 -12
- package/src/components/ChannelPreview/__tests__/ChannelPreview.test.tsx +25 -24
- package/src/components/ChannelPreview/__tests__/ChannelSwipableWrapper.test.tsx +11 -6
- package/src/components/Chat/Chat.tsx +5 -12
- package/src/components/Chat/hooks/useCreateChatContext.ts +0 -2
- package/src/components/ImageGallery/ImageGallery.tsx +14 -16
- package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +0 -8
- package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +25 -21
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +3 -1
- package/src/components/ImageGallery/components/types.ts +0 -3
- package/src/components/Message/Message.tsx +11 -32
- package/src/components/Message/MessageItemView/MessageBubble.tsx +11 -7
- package/src/components/Message/MessageItemView/MessageContent.tsx +14 -47
- package/src/components/Message/MessageItemView/MessageDeleted.tsx +3 -9
- package/src/components/Message/MessageItemView/MessageFooter.tsx +2 -14
- package/src/components/Message/MessageItemView/MessageHeader.tsx +11 -29
- package/src/components/Message/MessageItemView/MessageItemView.tsx +10 -42
- package/src/components/Message/MessageItemView/MessageReplies.tsx +2 -8
- package/src/components/Message/MessageItemView/MessageTextContainer.tsx +4 -8
- package/src/components/Message/MessageItemView/MessageWrapper.tsx +4 -9
- package/src/components/Message/MessageItemView/ReactionList/ReactionListBottom.tsx +4 -12
- package/src/components/Message/MessageItemView/ReactionList/ReactionListTop.tsx +4 -20
- package/src/components/Message/MessageItemView/__tests__/MessageContent.test.js +47 -30
- package/src/components/Message/MessageItemView/__tests__/MessageItemView.test.js +16 -7
- package/src/components/Message/MessageItemView/__tests__/MessageTextContainer.test.tsx +8 -4
- package/src/components/MessageInput/MessageComposer.tsx +16 -76
- package/src/components/MessageInput/MessageInputHeaderView.tsx +3 -3
- package/src/components/MessageInput/components/AttachmentPreview/AttachmentUploadPreviewList.tsx +7 -35
- package/src/components/MessageInput/components/AttachmentPreview/FileAttachmentUploadPreview.tsx +2 -2
- package/src/components/MessageInput/components/AttachmentPreview/ImageAttachmentUploadPreview.tsx +2 -2
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingInProgress.tsx +6 -4
- package/src/components/MessageInput/components/InputButtons/index.tsx +4 -5
- package/src/components/MessageInput/components/LinkPreviewList.tsx +3 -2
- package/src/components/MessageInput/components/OutputButtons/index.tsx +4 -23
- package/src/components/MessageList/MessageFlashList.tsx +13 -57
- package/src/components/MessageList/MessageList.tsx +15 -57
- package/src/components/MessageList/StickyHeader.tsx +4 -3
- package/src/components/MessageMenu/MessageActionList.tsx +4 -3
- package/src/components/MessageMenu/MessageMenu.tsx +35 -47
- package/src/components/MessageMenu/MessageUserReactions.tsx +7 -27
- package/src/components/MessageMenu/MessageUserReactionsItem.tsx +3 -6
- package/src/components/MessageMenu/__tests__/MessageUserReactions.test.tsx +12 -11
- package/src/components/Poll/CreatePollContent.tsx +3 -4
- package/src/components/Poll/Poll.tsx +22 -24
- package/src/components/Poll/components/PollAnswersList.tsx +9 -11
- package/src/components/Poll/components/PollOption.tsx +9 -11
- package/src/components/Poll/components/PollResults/PollOptionFullResults.tsx +10 -11
- package/src/components/Poll/components/PollResults/PollResults.tsx +9 -15
- package/src/components/Reply/Reply.tsx +18 -5
- package/src/components/Thread/Thread.tsx +3 -18
- package/src/components/Thread/components/ThreadFooterComponent.tsx +10 -11
- package/src/components/ThreadList/ThreadList.tsx +14 -22
- package/src/components/ThreadList/ThreadListItem.tsx +6 -11
- package/src/components/ui/Avatar/Avatar.tsx +2 -2
- package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +0 -15
- package/src/contexts/channelContext/ChannelContext.tsx +0 -24
- package/src/contexts/channelsContext/ChannelsContext.tsx +0 -113
- package/src/contexts/chatContext/ChatContext.tsx +0 -5
- package/src/contexts/componentsContext/ComponentsContext.tsx +62 -0
- package/src/contexts/componentsContext/PLAN.md +148 -0
- package/src/contexts/componentsContext/__tests__/defaultComponents.test.ts +44 -0
- package/src/contexts/componentsContext/defaultComponents.ts +332 -0
- package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +0 -8
- package/src/contexts/imageGalleryContext/ImageGalleryContextBase.tsx +0 -10
- package/src/contexts/index.ts +1 -0
- package/src/contexts/messageInputContext/MessageInputContext.tsx +0 -185
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +1 -75
- package/src/contexts/messagesContext/MessagesContext.tsx +3 -358
- package/src/contexts/overlayContext/MessageOverlayHostLayer.tsx +5 -7
- package/src/contexts/overlayContext/OverlayContext.tsx +0 -4
- package/src/contexts/overlayContext/OverlayProvider.tsx +1 -2
- package/src/contexts/overlayContext/__tests__/MessageOverlayHostLayer.test.tsx +21 -6
- package/src/contexts/threadsContext/ThreadsContext.tsx +0 -9
- package/src/version.json +1 -1
|
@@ -9,7 +9,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
9
9
|
|
|
10
10
|
import { ChannelList } from '../../components/ChannelList/ChannelList';
|
|
11
11
|
import { Chat } from '../../components/Chat/Chat';
|
|
12
|
-
import {
|
|
12
|
+
import { WithComponents } from '../../contexts/componentsContext/ComponentsContext';
|
|
13
13
|
import { getOrCreateChannelApi } from '../../mock-builders/api/getOrCreateChannel';
|
|
14
14
|
import { queryChannelsApi } from '../../mock-builders/api/queryChannels';
|
|
15
15
|
import { useMockedApis } from '../../mock-builders/api/useMockedApis';
|
|
@@ -48,33 +48,17 @@ import { BetterSqlite } from '../../test-utils/BetterSqlite';
|
|
|
48
48
|
* to those components might end up breaking tests for ChannelList, which will be quite painful
|
|
49
49
|
* to debug.
|
|
50
50
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Custom Preview component used via WithComponents.
|
|
53
|
+
* Receives { channel, muted, unread, lastMessage } from ChannelPreview.
|
|
54
|
+
*/
|
|
55
|
+
const ChannelPreviewComponent = ({ channel }) => (
|
|
56
|
+
<View accessibilityLabel='list-item' testID={channel.cid}>
|
|
57
|
+
<Text>{channel.data?.name}</Text>
|
|
58
|
+
<Text>{channel.state?.messages?.[0]?.text}</Text>
|
|
55
59
|
</View>
|
|
56
60
|
);
|
|
57
61
|
|
|
58
|
-
const ChannelListComponent = (props) => {
|
|
59
|
-
const { channels, onSelect } = useChannelsContext();
|
|
60
|
-
if (!channels) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<View testID='channel-list'>
|
|
66
|
-
{channels?.map((channel) => (
|
|
67
|
-
<ChannelPreviewComponent
|
|
68
|
-
{...props}
|
|
69
|
-
channel={channel}
|
|
70
|
-
key={channel.id}
|
|
71
|
-
setActiveChannel={onSelect}
|
|
72
|
-
/>
|
|
73
|
-
))}
|
|
74
|
-
</View>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
62
|
test('Workaround to allow exporting tests', () => expect(true).toBe(true));
|
|
79
63
|
|
|
80
64
|
export const Generic = () => {
|
|
@@ -223,12 +207,9 @@ export const Generic = () => {
|
|
|
223
207
|
const renderComponent = () =>
|
|
224
208
|
render(
|
|
225
209
|
<Chat client={chatClient} enableOfflineSupport>
|
|
226
|
-
<
|
|
227
|
-
filters={filters}
|
|
228
|
-
|
|
229
|
-
Preview={ChannelPreviewComponent}
|
|
230
|
-
sort={sort}
|
|
231
|
-
/>
|
|
210
|
+
<WithComponents overrides={{ Preview: ChannelPreviewComponent }}>
|
|
211
|
+
<ChannelList filters={filters} sort={sort} swipeActionsEnabled={false} />
|
|
212
|
+
</WithComponents>
|
|
232
213
|
</Chat>,
|
|
233
214
|
);
|
|
234
215
|
|
|
@@ -325,7 +306,7 @@ export const Generic = () => {
|
|
|
325
306
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
326
307
|
|
|
327
308
|
await waitFor(async () => {
|
|
328
|
-
expect(screen.getByTestId('channel-list')).toBeTruthy();
|
|
309
|
+
expect(screen.getByTestId('channel-list-view')).toBeTruthy();
|
|
329
310
|
await expectCIDsOnUIToBeInDB(screen.queryAllByLabelText);
|
|
330
311
|
});
|
|
331
312
|
});
|
|
@@ -340,7 +321,7 @@ export const Generic = () => {
|
|
|
340
321
|
|
|
341
322
|
await waitFor(
|
|
342
323
|
async () => {
|
|
343
|
-
expect(screen.getByTestId('channel-list')).toBeTruthy();
|
|
324
|
+
expect(screen.getByTestId('channel-list-view')).toBeTruthy();
|
|
344
325
|
await expectAllChannelsWithStateToBeInDB(screen.queryAllByLabelText);
|
|
345
326
|
},
|
|
346
327
|
{ timeout: 5000 },
|
|
@@ -359,7 +340,7 @@ export const Generic = () => {
|
|
|
359
340
|
await act(
|
|
360
341
|
async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true),
|
|
361
342
|
);
|
|
362
|
-
expect(screen.getByTestId('channel-list')).toBeTruthy();
|
|
343
|
+
expect(screen.getByTestId('channel-list-view')).toBeTruthy();
|
|
363
344
|
expect(screen.getByTestId(emptyChannel.cid)).toBeTruthy();
|
|
364
345
|
expect(chatClient.hydrateActiveChannels).toHaveBeenCalled();
|
|
365
346
|
expect(chatClient.hydrateActiveChannels.mock.calls[0][0]).toStrictEqual([emptyChannel]);
|
|
@@ -372,7 +353,7 @@ export const Generic = () => {
|
|
|
372
353
|
renderComponent();
|
|
373
354
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
374
355
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
375
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
356
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
376
357
|
const targetChannel = channels[0].channel;
|
|
377
358
|
const newMessage = generateMessage({
|
|
378
359
|
cid: targetChannel.cid,
|
|
@@ -401,7 +382,7 @@ export const Generic = () => {
|
|
|
401
382
|
renderComponent();
|
|
402
383
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
403
384
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
404
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
385
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
405
386
|
const targetChannel = channels[0].channel;
|
|
406
387
|
|
|
407
388
|
// check if the reads state is correct first
|
|
@@ -463,7 +444,7 @@ export const Generic = () => {
|
|
|
463
444
|
renderComponent();
|
|
464
445
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
465
446
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
466
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
447
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
467
448
|
const targetChannel = channels[0].channel;
|
|
468
449
|
|
|
469
450
|
// check if the reads state is correct first
|
|
@@ -526,7 +507,7 @@ export const Generic = () => {
|
|
|
526
507
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
527
508
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
528
509
|
await waitFor(() => {
|
|
529
|
-
expect(screen.getByTestId('channel-list')).toBeTruthy();
|
|
510
|
+
expect(screen.getByTestId('channel-list-view')).toBeTruthy();
|
|
530
511
|
});
|
|
531
512
|
|
|
532
513
|
const newChannel = createChannel();
|
|
@@ -534,13 +515,26 @@ export const Generic = () => {
|
|
|
534
515
|
useMockedApis(chatClient, [getOrCreateChannelApi(newChannel)]);
|
|
535
516
|
|
|
536
517
|
await act(() => dispatchNotificationMessageNewEvent(chatClient, newChannel.channel));
|
|
518
|
+
|
|
519
|
+
// Verify the new channel appears on the UI
|
|
537
520
|
await waitFor(() => {
|
|
538
521
|
const channelIdsOnUI = screen
|
|
539
522
|
.queryAllByLabelText('list-item')
|
|
540
523
|
.map((node) => node._fiber.pendingProps.testID);
|
|
541
524
|
expect(channelIdsOnUI.includes(newChannel.channel.cid)).toBeTruthy();
|
|
542
525
|
});
|
|
543
|
-
|
|
526
|
+
|
|
527
|
+
// Verify the new channel and its state are persisted in the DB
|
|
528
|
+
await waitFor(async () => {
|
|
529
|
+
const channelsRows = await BetterSqlite.selectFromTable('channels');
|
|
530
|
+
const messagesRows = await BetterSqlite.selectFromTable('messages');
|
|
531
|
+
|
|
532
|
+
expect(channelsRows.length).toBe(channels.length);
|
|
533
|
+
expect(messagesRows.length).toBe(allMessages.length);
|
|
534
|
+
|
|
535
|
+
const matchingChannelRow = channelsRows.filter((c) => c.id === newChannel.channel.id);
|
|
536
|
+
expect(matchingChannelRow.length).toBe(1);
|
|
537
|
+
});
|
|
544
538
|
});
|
|
545
539
|
|
|
546
540
|
it('should update a message in database', async () => {
|
|
@@ -549,7 +543,7 @@ export const Generic = () => {
|
|
|
549
543
|
renderComponent();
|
|
550
544
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
551
545
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
552
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
546
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
553
547
|
|
|
554
548
|
const updatedMessage = { ...channels[0].messages[0] };
|
|
555
549
|
updatedMessage.text = uuidv4();
|
|
@@ -571,7 +565,7 @@ export const Generic = () => {
|
|
|
571
565
|
renderComponent();
|
|
572
566
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
573
567
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
574
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
568
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
575
569
|
const removedChannel = channels[getRandomInt(0, channels.length - 1)].channel;
|
|
576
570
|
act(() => dispatchNotificationRemovedFromChannel(chatClient, removedChannel));
|
|
577
571
|
await waitFor(async () => {
|
|
@@ -598,7 +592,7 @@ export const Generic = () => {
|
|
|
598
592
|
renderComponent();
|
|
599
593
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
600
594
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
601
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
595
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
602
596
|
const removedChannel = channels[getRandomInt(0, channels.length - 1)].channel;
|
|
603
597
|
act(() => dispatchChannelDeletedEvent(chatClient, removedChannel));
|
|
604
598
|
await waitFor(async () => {
|
|
@@ -625,7 +619,7 @@ export const Generic = () => {
|
|
|
625
619
|
renderComponent();
|
|
626
620
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
627
621
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
628
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
622
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
629
623
|
const hiddenChannel = channels[getRandomInt(0, channels.length - 1)].channel;
|
|
630
624
|
act(() => dispatchChannelHiddenEvent(chatClient, hiddenChannel));
|
|
631
625
|
await waitFor(async () => {
|
|
@@ -655,7 +649,7 @@ export const Generic = () => {
|
|
|
655
649
|
renderComponent();
|
|
656
650
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
657
651
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
658
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
652
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
659
653
|
const hiddenChannel = channels[getRandomInt(0, channels.length - 1)].channel;
|
|
660
654
|
// first, we mark it as hidden
|
|
661
655
|
act(() => dispatchChannelHiddenEvent(chatClient, hiddenChannel));
|
|
@@ -708,20 +702,23 @@ export const Generic = () => {
|
|
|
708
702
|
renderComponent();
|
|
709
703
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
710
704
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
711
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
705
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
712
706
|
|
|
713
707
|
const newChannel = createChannel();
|
|
714
708
|
useMockedApis(chatClient, [getOrCreateChannelApi(newChannel)]);
|
|
715
709
|
|
|
716
|
-
act(() => dispatchNotificationAddedToChannel(chatClient, newChannel.channel));
|
|
710
|
+
await act(() => dispatchNotificationAddedToChannel(chatClient, newChannel.channel));
|
|
717
711
|
|
|
718
|
-
|
|
712
|
+
// Verify the new channel appears on the UI
|
|
713
|
+
await waitFor(() => {
|
|
719
714
|
const channelIdsOnUI = screen
|
|
720
715
|
.queryAllByLabelText('list-item')
|
|
721
716
|
.map((node) => node._fiber.pendingProps.testID);
|
|
722
717
|
expect(channelIdsOnUI.includes(newChannel.channel.cid)).toBeTruthy();
|
|
718
|
+
});
|
|
723
719
|
|
|
724
|
-
|
|
720
|
+
// Verify the new channel is persisted in the DB
|
|
721
|
+
await waitFor(async () => {
|
|
725
722
|
const channelsRows = await BetterSqlite.selectFromTable('channels');
|
|
726
723
|
const matchingChannelsRows = channelsRows.filter((c) => c.id === newChannel.channel.id);
|
|
727
724
|
|
|
@@ -739,7 +736,7 @@ export const Generic = () => {
|
|
|
739
736
|
renderComponent();
|
|
740
737
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
741
738
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
742
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
739
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
743
740
|
|
|
744
741
|
const channelToTruncate = channels[getRandomInt(0, channels.length - 1)].channel;
|
|
745
742
|
act(() => dispatchChannelTruncatedEvent(chatClient, channelToTruncate));
|
|
@@ -771,7 +768,7 @@ export const Generic = () => {
|
|
|
771
768
|
renderComponent();
|
|
772
769
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
773
770
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
774
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
771
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
775
772
|
|
|
776
773
|
const channelResponse = channels[getRandomInt(0, channels.length - 1)];
|
|
777
774
|
const channelToTruncate = channelResponse.channel;
|
|
@@ -815,7 +812,7 @@ export const Generic = () => {
|
|
|
815
812
|
renderComponent();
|
|
816
813
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
817
814
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
818
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
815
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
819
816
|
|
|
820
817
|
const channelResponse = channels[getRandomInt(0, channels.length - 1)];
|
|
821
818
|
const channelToTruncate = channelResponse.channel;
|
|
@@ -847,7 +844,7 @@ export const Generic = () => {
|
|
|
847
844
|
renderComponent();
|
|
848
845
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
849
846
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
850
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
847
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
851
848
|
|
|
852
849
|
const channelResponse = channels[getRandomInt(0, channels.length - 1)];
|
|
853
850
|
const channelToTruncate = channelResponse.channel;
|
|
@@ -881,7 +878,7 @@ export const Generic = () => {
|
|
|
881
878
|
renderComponent();
|
|
882
879
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
883
880
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
884
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
881
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
885
882
|
|
|
886
883
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
887
884
|
const targetMessage =
|
|
@@ -926,7 +923,7 @@ export const Generic = () => {
|
|
|
926
923
|
renderComponent();
|
|
927
924
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
928
925
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
929
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
926
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
930
927
|
|
|
931
928
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
932
929
|
const targetMessage =
|
|
@@ -1010,7 +1007,7 @@ export const Generic = () => {
|
|
|
1010
1007
|
renderComponent();
|
|
1011
1008
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1012
1009
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1013
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1010
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1014
1011
|
|
|
1015
1012
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1016
1013
|
const targetMessage =
|
|
@@ -1076,7 +1073,7 @@ export const Generic = () => {
|
|
|
1076
1073
|
renderComponent();
|
|
1077
1074
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1078
1075
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1079
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1076
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1080
1077
|
|
|
1081
1078
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1082
1079
|
const targetMessage =
|
|
@@ -1130,7 +1127,7 @@ export const Generic = () => {
|
|
|
1130
1127
|
renderComponent();
|
|
1131
1128
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1132
1129
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1133
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1130
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1134
1131
|
|
|
1135
1132
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1136
1133
|
const targetMessage =
|
|
@@ -1167,7 +1164,7 @@ export const Generic = () => {
|
|
|
1167
1164
|
renderComponent();
|
|
1168
1165
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1169
1166
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1170
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1167
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1171
1168
|
|
|
1172
1169
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1173
1170
|
const targetMessage =
|
|
@@ -1264,7 +1261,7 @@ export const Generic = () => {
|
|
|
1264
1261
|
renderComponent();
|
|
1265
1262
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1266
1263
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1267
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1264
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1268
1265
|
|
|
1269
1266
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1270
1267
|
const targetMessage =
|
|
@@ -1323,7 +1320,7 @@ export const Generic = () => {
|
|
|
1323
1320
|
renderComponent();
|
|
1324
1321
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1325
1322
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1326
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1323
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1327
1324
|
|
|
1328
1325
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1329
1326
|
const targetMessage =
|
|
@@ -1380,7 +1377,7 @@ export const Generic = () => {
|
|
|
1380
1377
|
renderComponent();
|
|
1381
1378
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1382
1379
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1383
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1380
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1384
1381
|
|
|
1385
1382
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1386
1383
|
const targetMessage =
|
|
@@ -1438,7 +1435,7 @@ export const Generic = () => {
|
|
|
1438
1435
|
|
|
1439
1436
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1440
1437
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1441
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1438
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1442
1439
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1443
1440
|
|
|
1444
1441
|
const oldMemberCount = targetChannel.channel.member_count;
|
|
@@ -1466,7 +1463,7 @@ export const Generic = () => {
|
|
|
1466
1463
|
renderComponent();
|
|
1467
1464
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1468
1465
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1469
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1466
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1470
1467
|
|
|
1471
1468
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1472
1469
|
const targetMember = targetChannel.members[getRandomInt(0, targetChannel.members.length - 1)];
|
|
@@ -1494,7 +1491,7 @@ export const Generic = () => {
|
|
|
1494
1491
|
renderComponent();
|
|
1495
1492
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1496
1493
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1497
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1494
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1498
1495
|
|
|
1499
1496
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1500
1497
|
const targetMember = targetChannel.members[getRandomInt(0, targetChannel.members.length - 1)];
|
|
@@ -1521,7 +1518,7 @@ export const Generic = () => {
|
|
|
1521
1518
|
renderComponent();
|
|
1522
1519
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1523
1520
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1524
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1521
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1525
1522
|
|
|
1526
1523
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1527
1524
|
targetChannel.channel.name = uuidv4();
|
|
@@ -1547,7 +1544,7 @@ export const Generic = () => {
|
|
|
1547
1544
|
renderComponent();
|
|
1548
1545
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1549
1546
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1550
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1547
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1551
1548
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1552
1549
|
const targetMember = targetChannel.members[getRandomInt(0, targetChannel.members.length - 1)];
|
|
1553
1550
|
|
|
@@ -1582,7 +1579,7 @@ export const Generic = () => {
|
|
|
1582
1579
|
renderComponent();
|
|
1583
1580
|
act(() => dispatchConnectionChangedEvent(chatClient));
|
|
1584
1581
|
await act(async () => await chatClient.offlineDb.syncManager.invokeSyncStatusListeners(true));
|
|
1585
|
-
await waitFor(() => expect(screen.getByTestId('channel-list')).toBeTruthy());
|
|
1582
|
+
await waitFor(() => expect(screen.getByTestId('channel-list-view')).toBeTruthy());
|
|
1586
1583
|
const targetChannel = channels[getRandomInt(0, channels.length - 1)];
|
|
1587
1584
|
const targetMember = targetChannel.members[getRandomInt(0, targetChannel.members.length - 1)];
|
|
1588
1585
|
|
|
@@ -11,17 +11,8 @@ import {
|
|
|
11
11
|
type Attachment as AttachmentType,
|
|
12
12
|
} from 'stream-chat';
|
|
13
13
|
|
|
14
|
-
import { AudioAttachment as AudioAttachmentDefault } from './Audio';
|
|
15
|
-
|
|
16
|
-
import { UnsupportedAttachment as UnsupportedAttachmentDefault } from './UnsupportedAttachment';
|
|
17
|
-
import { URLPreview as URLPreviewDefault } from './UrlPreview';
|
|
18
|
-
import { URLPreviewCompact as URLPreviewCompactDefault } from './UrlPreview/URLPreviewCompact';
|
|
19
|
-
|
|
20
|
-
import { FileAttachment as FileAttachmentDefault } from '../../components/Attachment/FileAttachment';
|
|
21
|
-
import { Gallery as GalleryDefault } from '../../components/Attachment/Gallery';
|
|
22
|
-
import { Giphy as GiphyDefault } from '../../components/Attachment/Giphy';
|
|
23
|
-
|
|
24
14
|
import { useTheme } from '../../contexts';
|
|
15
|
+
import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
|
|
25
16
|
import {
|
|
26
17
|
MessageContextValue,
|
|
27
18
|
useMessageContext,
|
|
@@ -39,16 +30,7 @@ export type ActionHandler = (name: string, value: string) => void;
|
|
|
39
30
|
|
|
40
31
|
export type AttachmentPropsWithContext = Pick<
|
|
41
32
|
MessagesContextValue,
|
|
42
|
-
| '
|
|
43
|
-
| 'FileAttachment'
|
|
44
|
-
| 'Gallery'
|
|
45
|
-
| 'Giphy'
|
|
46
|
-
| 'isAttachmentEqual'
|
|
47
|
-
| 'UrlPreview'
|
|
48
|
-
| 'URLPreviewCompact'
|
|
49
|
-
| 'myMessageTheme'
|
|
50
|
-
| 'urlPreviewType'
|
|
51
|
-
| 'UnsupportedAttachment'
|
|
33
|
+
'isAttachmentEqual' | 'myMessageTheme' | 'urlPreviewType'
|
|
52
34
|
> &
|
|
53
35
|
Pick<MessageContextValue, 'message'> & {
|
|
54
36
|
/**
|
|
@@ -62,19 +44,16 @@ export type AttachmentPropsWithContext = Pick<
|
|
|
62
44
|
};
|
|
63
45
|
|
|
64
46
|
const AttachmentWithContext = (props: AttachmentPropsWithContext) => {
|
|
47
|
+
const { attachment, index, message, urlPreviewType } = props;
|
|
65
48
|
const {
|
|
66
|
-
attachment,
|
|
67
49
|
AudioAttachment,
|
|
68
50
|
FileAttachment,
|
|
69
51
|
Gallery,
|
|
70
52
|
Giphy,
|
|
71
53
|
UrlPreview,
|
|
72
54
|
URLPreviewCompact,
|
|
73
|
-
index,
|
|
74
|
-
message,
|
|
75
|
-
urlPreviewType,
|
|
76
55
|
UnsupportedAttachment,
|
|
77
|
-
} =
|
|
56
|
+
} = useComponentsContext();
|
|
78
57
|
const audioAttachmentStyles = useAudioAttachmentStyles();
|
|
79
58
|
|
|
80
59
|
if (attachment.type === FileTypes.Giphy || attachment.type === FileTypes.Imgur) {
|
|
@@ -164,31 +143,9 @@ export type AttachmentProps = Partial<AttachmentPropsWithContext>;
|
|
|
164
143
|
* Attachment - The message attachment
|
|
165
144
|
*/
|
|
166
145
|
export const Attachment = (props: AttachmentProps) => {
|
|
167
|
-
const {
|
|
168
|
-
attachment,
|
|
169
|
-
AudioAttachment: PropAudioAttachment,
|
|
170
|
-
FileAttachment: PropFileAttachment,
|
|
171
|
-
Gallery: PropGallery,
|
|
172
|
-
Giphy: PropGiphy,
|
|
173
|
-
myMessageTheme: PropMyMessageTheme,
|
|
174
|
-
UrlPreview: PropUrlPreview,
|
|
175
|
-
URLPreviewCompact: PropURLPreviewCompact,
|
|
176
|
-
urlPreviewType: PropUrlPreviewType,
|
|
177
|
-
UnsupportedAttachment: PropUnsupportedAttachment,
|
|
178
|
-
} = props;
|
|
146
|
+
const { attachment } = props;
|
|
179
147
|
|
|
180
|
-
const {
|
|
181
|
-
AudioAttachment: ContextAudioAttachment,
|
|
182
|
-
FileAttachment: ContextFileAttachment,
|
|
183
|
-
Gallery: ContextGallery,
|
|
184
|
-
Giphy: ContextGiphy,
|
|
185
|
-
isAttachmentEqual,
|
|
186
|
-
myMessageTheme: ContextMyMessageTheme,
|
|
187
|
-
UrlPreview: ContextUrlPreview,
|
|
188
|
-
URLPreviewCompact: ContextURLPreviewCompact,
|
|
189
|
-
urlPreviewType: ContextUrlPreviewType,
|
|
190
|
-
UnsupportedAttachment: ContextUnsupportedAttachment,
|
|
191
|
-
} = useMessagesContext();
|
|
148
|
+
const { isAttachmentEqual, myMessageTheme, urlPreviewType } = useMessagesContext();
|
|
192
149
|
|
|
193
150
|
const { message } = useMessageContext();
|
|
194
151
|
|
|
@@ -196,33 +153,14 @@ export const Attachment = (props: AttachmentProps) => {
|
|
|
196
153
|
return null;
|
|
197
154
|
}
|
|
198
155
|
|
|
199
|
-
const AudioAttachment = PropAudioAttachment || ContextAudioAttachment || AudioAttachmentDefault;
|
|
200
|
-
const FileAttachment = PropFileAttachment || ContextFileAttachment || FileAttachmentDefault;
|
|
201
|
-
const Gallery = PropGallery || ContextGallery || GalleryDefault;
|
|
202
|
-
const Giphy = PropGiphy || ContextGiphy || GiphyDefault;
|
|
203
|
-
const UrlPreview = PropUrlPreview || ContextUrlPreview || URLPreviewDefault;
|
|
204
|
-
const myMessageTheme = PropMyMessageTheme || ContextMyMessageTheme;
|
|
205
|
-
const URLPreviewCompact =
|
|
206
|
-
PropURLPreviewCompact || ContextURLPreviewCompact || URLPreviewCompactDefault;
|
|
207
|
-
const urlPreviewType = PropUrlPreviewType || ContextUrlPreviewType;
|
|
208
|
-
const UnsupportedAttachment =
|
|
209
|
-
PropUnsupportedAttachment || ContextUnsupportedAttachment || UnsupportedAttachmentDefault;
|
|
210
|
-
|
|
211
156
|
return (
|
|
212
157
|
<MemoizedAttachment
|
|
213
158
|
{...{
|
|
214
159
|
attachment,
|
|
215
|
-
message,
|
|
216
|
-
AudioAttachment,
|
|
217
|
-
FileAttachment,
|
|
218
|
-
Gallery,
|
|
219
|
-
Giphy,
|
|
220
160
|
isAttachmentEqual,
|
|
161
|
+
message,
|
|
221
162
|
myMessageTheme,
|
|
222
|
-
UrlPreview,
|
|
223
|
-
URLPreviewCompact,
|
|
224
163
|
urlPreviewType,
|
|
225
|
-
UnsupportedAttachment,
|
|
226
164
|
}}
|
|
227
165
|
/>
|
|
228
166
|
);
|
|
@@ -7,6 +7,7 @@ import { openUrlSafely } from './utils/openUrlSafely';
|
|
|
7
7
|
|
|
8
8
|
import { FileIconProps } from '../../components/Attachment/FileIcon';
|
|
9
9
|
|
|
10
|
+
import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
|
|
10
11
|
import {
|
|
11
12
|
MessageContextValue,
|
|
12
13
|
useMessageContext,
|
|
@@ -21,7 +22,7 @@ export type FileAttachmentPropsWithContext = Pick<
|
|
|
21
22
|
MessageContextValue,
|
|
22
23
|
'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress'
|
|
23
24
|
> &
|
|
24
|
-
Pick<MessagesContextValue, 'additionalPressableProps'
|
|
25
|
+
Pick<MessagesContextValue, 'additionalPressableProps'> & {
|
|
25
26
|
/** The attachment to render */
|
|
26
27
|
attachment: Attachment;
|
|
27
28
|
attachmentIconSize?: FileIconProps['size'];
|
|
@@ -41,13 +42,13 @@ const FileAttachmentWithContext = (props: FileAttachmentPropsWithContext) => {
|
|
|
41
42
|
additionalPressableProps,
|
|
42
43
|
attachment,
|
|
43
44
|
attachmentIconSize,
|
|
44
|
-
FilePreview,
|
|
45
45
|
onLongPress,
|
|
46
46
|
onPress,
|
|
47
47
|
onPressIn,
|
|
48
48
|
preventPress,
|
|
49
49
|
styles: stylesProp = styles,
|
|
50
50
|
} = props;
|
|
51
|
+
const { FilePreview } = useComponentsContext();
|
|
51
52
|
|
|
52
53
|
const defaultOnPress = () => openUrlSafely(attachment.asset_url);
|
|
53
54
|
|
|
@@ -99,17 +100,13 @@ export type FileAttachmentProps = Partial<Omit<FileAttachmentPropsWithContext, '
|
|
|
99
100
|
Pick<FileAttachmentPropsWithContext, 'attachment'>;
|
|
100
101
|
|
|
101
102
|
export const FileAttachment = (props: FileAttachmentProps) => {
|
|
102
|
-
const { FilePreview: PropFilePreview } = props;
|
|
103
103
|
const { onLongPress, onPress, onPressIn, preventPress } = useMessageContext();
|
|
104
|
-
const { additionalPressableProps
|
|
105
|
-
|
|
106
|
-
const FilePreview = PropFilePreview || ContextFilePreview;
|
|
104
|
+
const { additionalPressableProps } = useMessagesContext();
|
|
107
105
|
|
|
108
106
|
return (
|
|
109
107
|
<FileAttachmentWithContext
|
|
110
108
|
{...{
|
|
111
109
|
additionalPressableProps,
|
|
112
|
-
FilePreview,
|
|
113
110
|
onLongPress,
|
|
114
111
|
onPress,
|
|
115
112
|
onPressIn,
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
|
|
6
5
|
import {
|
|
7
6
|
MessageContextValue,
|
|
8
7
|
useMessageContext,
|
|
9
8
|
} from '../../contexts/messageContext/MessageContext';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
MessagesContextValue,
|
|
13
|
-
useMessagesContext,
|
|
14
|
-
} from '../../contexts/messagesContext/MessagesContext';
|
|
15
9
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
16
10
|
import { primitives } from '../../theme';
|
|
17
11
|
|
|
18
|
-
export type FileAttachmentGroupPropsWithContext = Pick<MessageContextValue, 'files' | 'message'> &
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
12
|
+
export type FileAttachmentGroupPropsWithContext = Pick<MessageContextValue, 'files' | 'message'> & {
|
|
13
|
+
styles?: Partial<{
|
|
14
|
+
attachmentContainer: StyleProp<ViewStyle>;
|
|
15
|
+
container: StyleProp<ViewStyle>;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
25
18
|
|
|
26
19
|
const FileAttachmentGroupWithContext = (props: FileAttachmentGroupPropsWithContext) => {
|
|
27
|
-
const {
|
|
20
|
+
const { files, message, styles: stylesProp = {} } = props;
|
|
21
|
+
const { Attachment } = useComponentsContext();
|
|
28
22
|
|
|
29
23
|
const {
|
|
30
24
|
theme: {
|
|
@@ -75,8 +69,6 @@ export const FileAttachmentGroup = (props: FileAttachmentGroupProps) => {
|
|
|
75
69
|
|
|
76
70
|
const { files: contextFiles, message } = useMessageContext();
|
|
77
71
|
|
|
78
|
-
const { Attachment = AttachmentDefault, AudioAttachment } = useMessagesContext();
|
|
79
|
-
|
|
80
72
|
const files = propFiles || contextFiles;
|
|
81
73
|
|
|
82
74
|
if (!files.length) {
|
|
@@ -86,8 +78,6 @@ export const FileAttachmentGroup = (props: FileAttachmentGroupProps) => {
|
|
|
86
78
|
return (
|
|
87
79
|
<MemoizedFileAttachmentGroup
|
|
88
80
|
{...{
|
|
89
|
-
Attachment,
|
|
90
|
-
AudioAttachment,
|
|
91
81
|
files,
|
|
92
82
|
message,
|
|
93
83
|
}}
|
|
@@ -3,16 +3,13 @@ import { StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle } from 'react-n
|
|
|
3
3
|
|
|
4
4
|
import type { Attachment } from 'stream-chat';
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
MessagesContextValue,
|
|
9
|
-
useMessagesContext,
|
|
10
|
-
} from '../../contexts/messagesContext/MessagesContext';
|
|
6
|
+
import type { FileIconProps } from '../../components/Attachment/FileIcon';
|
|
7
|
+
import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
|
|
11
8
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
12
9
|
import { primitives } from '../../theme';
|
|
13
10
|
import { getDurationLabelFromDuration, getFileSizeDisplayText } from '../../utils/utils';
|
|
14
11
|
|
|
15
|
-
export type FilePreviewProps =
|
|
12
|
+
export type FilePreviewProps = {
|
|
16
13
|
/** The attachment to render */
|
|
17
14
|
attachment: Attachment;
|
|
18
15
|
attachmentIconSize?: FileIconProps['size'];
|
|
@@ -30,14 +27,12 @@ export type FilePreviewProps = Partial<Pick<MessagesContextValue, 'FileAttachmen
|
|
|
30
27
|
export const FilePreview = (props: FilePreviewProps) => {
|
|
31
28
|
const {
|
|
32
29
|
attachment,
|
|
33
|
-
FileAttachmentIcon: PropFileAttachmentIcon,
|
|
34
30
|
attachmentIconSize,
|
|
35
31
|
styles: stylesProp = {},
|
|
36
32
|
titleNumberOfLines = 2,
|
|
37
33
|
indicator,
|
|
38
34
|
} = props;
|
|
39
|
-
const { FileAttachmentIcon
|
|
40
|
-
const FileAttachmentIcon = PropFileAttachmentIcon || ContextFileAttachmentIcon || FileIconDefault;
|
|
35
|
+
const { FileAttachmentIcon } = useComponentsContext();
|
|
41
36
|
|
|
42
37
|
const styles = useStyles();
|
|
43
38
|
|