stream-chat-react-native-core 4.0.0-beta.2 → 4.0.0-beta.3
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 +2 -2
- package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/AttachmentActions.js.map +1 -1
- package/lib/commonjs/components/Attachment/Card.js +15 -15
- package/lib/commonjs/components/Attachment/Card.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +8 -8
- package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +97 -106
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +27 -27
- package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/types.js +4 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/types.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/getAspectRatio.js +14 -0
- package/lib/commonjs/components/Attachment/utils/getAspectRatio.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
- package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +9 -8
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +2 -2
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +16 -16
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +11 -11
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +13 -7
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +10 -4
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +64 -64
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +6 -6
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +4 -4
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +6 -7
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +2 -2
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +17 -17
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js +3 -3
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +83 -70
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelList/utils.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +2 -2
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +2 -2
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +48 -20
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useIsOnline.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +89 -56
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +2 -2
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +12 -12
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +10 -10
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +7 -7
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +5 -5
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +9 -9
- package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +13 -9
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +6 -6
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +19 -19
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +5 -5
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +11 -11
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +2 -2
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +5 -5
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +9 -7
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js +89 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js.map +1 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js +46 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +14 -25
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +16 -3
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActions.js +18 -14
- package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/commonjs/components/Message/utils/messageActions.js.map +1 -1
- package/lib/commonjs/components/Message/utils/removeReservedFields.js.map +1 -1
- package/lib/commonjs/components/MessageInput/AttachButton.js +3 -3
- package/lib/commonjs/components/MessageInput/AttachButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/CommandsButton.js +3 -3
- package/lib/commonjs/components/MessageInput/CommandsButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/CooldownTimer.js +2 -2
- package/lib/commonjs/components/MessageInput/CooldownTimer.js.map +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +2 -2
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +7 -7
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +3 -3
- package/lib/commonjs/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +40 -40
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +3 -3
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +2 -2
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +3 -3
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/hooks/useCooldown.js.map +1 -1
- package/lib/commonjs/components/MessageInput/hooks/useCountdown.js.map +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/MessageList.js +2 -2
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicator.js +5 -5
- package/lib/commonjs/components/MessageList/TypingIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js +7 -7
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useTypingString.js +2 -2
- package/lib/commonjs/components/MessageList/hooks/useTypingString.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js +3 -1
- package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js +2 -2
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +7 -7
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +38 -32
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +11 -11
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +31 -34
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
- package/lib/commonjs/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +25 -19
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/Thread/Thread.js +6 -6
- package/lib/commonjs/components/Thread/Thread.js.map +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +12 -12
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/commonjs/components/docs/data.js +1 -1
- package/lib/commonjs/components/index.js +26 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +2 -2
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +2 -2
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +2 -2
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +2 -2
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +3 -3
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +2 -2
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +2 -2
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js.map +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js +2 -2
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +18 -14
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +5 -19
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +33 -31
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +2 -2
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +3 -3
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/ThemeContext.js +2 -2
- package/lib/commonjs/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +13 -5
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.js +2 -2
- package/lib/commonjs/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/commonjs/contexts/typingContext/TypingContext.js +2 -2
- package/lib/commonjs/contexts/typingContext/TypingContext.js.map +1 -1
- package/lib/commonjs/contexts/utils/getDisplayName.js.map +1 -1
- package/lib/commonjs/emoji-data/index.js +2 -2
- package/lib/commonjs/emoji-data/index.js.map +1 -1
- package/lib/commonjs/hooks/useStreami18n.js.map +1 -1
- package/lib/commonjs/icons/utils/base.js +1 -1
- package/lib/commonjs/index.js +6 -6
- package/lib/commonjs/mock-builders/api/error.js +1 -1
- package/lib/commonjs/mock-builders/api/sendMessage.js.map +1 -1
- package/lib/commonjs/mock-builders/generator/attachment.js +1 -3
- package/lib/commonjs/mock-builders/generator/attachment.js.map +1 -1
- package/lib/commonjs/mock-builders/generator/channel.js +101 -51
- package/lib/commonjs/mock-builders/generator/channel.js.map +1 -1
- package/lib/commonjs/mock-builders/generator/user.js +32 -33
- package/lib/commonjs/mock-builders/generator/user.js.map +1 -1
- package/lib/commonjs/mock-builders/mock.js +1 -1
- package/lib/commonjs/native.js +1 -1
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js +7 -7
- package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js.map +1 -1
- package/lib/commonjs/styleguideComponents/JsDoc.js +4 -4
- package/lib/commonjs/styleguideComponents/JsDoc.js.map +1 -1
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js +7 -7
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js.map +1 -1
- package/lib/commonjs/styleguideComponents/PropsRenderer.js +25 -25
- package/lib/commonjs/styleguideComponents/PropsRenderer.js.map +1 -1
- package/lib/commonjs/styleguideComponents/Wrapper.js +1 -1
- package/lib/commonjs/styleguideComponents/Wrapper.js.map +1 -1
- package/lib/commonjs/utils/Streami18n.js.map +1 -1
- package/lib/commonjs/utils/getResizedImageUrl.js +26 -0
- package/lib/commonjs/utils/getResizedImageUrl.js.map +1 -0
- package/lib/commonjs/utils/getUrlOfImageAttachment.js +9 -0
- package/lib/commonjs/utils/getUrlOfImageAttachment.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 +2 -2
- package/lib/module/components/Attachment/Attachment.js.map +1 -1
- package/lib/module/components/Attachment/AttachmentActions.js.map +1 -1
- package/lib/module/components/Attachment/Card.js +15 -15
- package/lib/module/components/Attachment/Card.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +8 -8
- package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/module/components/Attachment/FileIcon.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +97 -106
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +27 -27
- package/lib/module/components/Attachment/Giphy.js.map +1 -1
- package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/types.js +4 -0
- package/lib/module/components/Attachment/utils/buildGallery/types.js.map +1 -0
- package/lib/module/components/Attachment/utils/getAspectRatio.js +14 -0
- package/lib/module/components/Attachment/utils/getAspectRatio.js.map +1 -0
- package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
- package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +9 -8
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +2 -2
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +16 -16
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +11 -11
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/module/components/Avatar/Avatar.js +13 -7
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +10 -4
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +64 -64
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +6 -6
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +4 -4
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +6 -7
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +2 -2
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +17 -17
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js +3 -3
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +2 -2
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +83 -70
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelList/utils.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +2 -2
- package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +2 -2
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +48 -20
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useIsOnline.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +89 -56
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +2 -2
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +12 -12
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +10 -10
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +7 -7
- package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js +5 -5
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +9 -9
- package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/module/components/Message/Message.js +13 -9
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +6 -6
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +19 -19
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js +5 -5
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +11 -11
- package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +2 -2
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +5 -5
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +9 -7
- package/lib/module/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.js +89 -0
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.js.map +1 -0
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js +46 -0
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -0
- package/lib/module/components/Message/MessageSimple/utils/renderText.js +14 -25
- package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js +16 -3
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActions.js +18 -14
- package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/module/components/Message/utils/messageActions.js.map +1 -1
- package/lib/module/components/Message/utils/removeReservedFields.js.map +1 -1
- package/lib/module/components/MessageInput/AttachButton.js +3 -3
- package/lib/module/components/MessageInput/AttachButton.js.map +1 -1
- package/lib/module/components/MessageInput/CommandsButton.js +3 -3
- package/lib/module/components/MessageInput/CommandsButton.js.map +1 -1
- package/lib/module/components/MessageInput/CooldownTimer.js +2 -2
- package/lib/module/components/MessageInput/CooldownTimer.js.map +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +2 -2
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +7 -7
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +3 -3
- package/lib/module/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +40 -40
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/MoreOptionsButton.js +3 -3
- package/lib/module/components/MessageInput/MoreOptionsButton.js.map +1 -1
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +2 -2
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -1
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +3 -3
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/module/components/MessageInput/hooks/useCooldown.js.map +1 -1
- package/lib/module/components/MessageInput/hooks/useCountdown.js.map +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/MessageList.js +2 -2
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/module/components/MessageList/TypingIndicator.js +5 -5
- package/lib/module/components/MessageList/TypingIndicator.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js +7 -7
- package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useTypingString.js +2 -2
- package/lib/module/components/MessageList/hooks/useTypingString.js.map +1 -1
- package/lib/module/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/module/components/MessageList/utils/getLastReceivedMessage.js +3 -1
- package/lib/module/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageActionList.js +2 -2
- package/lib/module/components/MessageOverlay/MessageActionList.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +7 -7
- package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +38 -32
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionList.js +11 -11
- package/lib/module/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +31 -34
- package/lib/module/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
- package/lib/module/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +25 -19
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/Thread/Thread.js +6 -6
- package/lib/module/components/Thread/Thread.js.map +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +12 -12
- package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/module/components/docs/data.js +1 -1
- package/lib/module/components/index.js +26 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +2 -2
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +2 -2
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +2 -2
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +2 -2
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +3 -3
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
- package/lib/module/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +2 -2
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +2 -2
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/module/contexts/keyboardContext/KeyboardContext.js +2 -2
- package/lib/module/contexts/keyboardContext/KeyboardContext.js.map +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +2 -2
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +18 -14
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +5 -19
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +33 -31
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +2 -2
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +3 -3
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/module/contexts/themeContext/ThemeContext.js +2 -2
- package/lib/module/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +13 -5
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/contexts/threadContext/ThreadContext.js +2 -2
- package/lib/module/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/module/contexts/typingContext/TypingContext.js +2 -2
- package/lib/module/contexts/typingContext/TypingContext.js.map +1 -1
- package/lib/module/contexts/utils/getDisplayName.js.map +1 -1
- package/lib/module/emoji-data/index.js +2 -2
- package/lib/module/emoji-data/index.js.map +1 -1
- package/lib/module/hooks/useStreami18n.js.map +1 -1
- package/lib/module/icons/utils/base.js +1 -1
- package/lib/module/index.js +6 -6
- package/lib/module/mock-builders/api/error.js +1 -1
- package/lib/module/mock-builders/api/sendMessage.js.map +1 -1
- package/lib/module/mock-builders/generator/attachment.js +1 -3
- package/lib/module/mock-builders/generator/attachment.js.map +1 -1
- package/lib/module/mock-builders/generator/channel.js +101 -51
- package/lib/module/mock-builders/generator/channel.js.map +1 -1
- package/lib/module/mock-builders/generator/user.js +32 -33
- package/lib/module/mock-builders/generator/user.js.map +1 -1
- package/lib/module/mock-builders/mock.js +1 -1
- package/lib/module/native.js +1 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/styleguideComponents/ArgumentsRenderer.js +7 -7
- package/lib/module/styleguideComponents/ArgumentsRenderer.js.map +1 -1
- package/lib/module/styleguideComponents/JsDoc.js +4 -4
- package/lib/module/styleguideComponents/JsDoc.js.map +1 -1
- package/lib/module/styleguideComponents/PathlineRenderer.js +7 -7
- package/lib/module/styleguideComponents/PathlineRenderer.js.map +1 -1
- package/lib/module/styleguideComponents/PropsRenderer.js +25 -25
- package/lib/module/styleguideComponents/PropsRenderer.js.map +1 -1
- package/lib/module/styleguideComponents/Wrapper.js +1 -1
- package/lib/module/styleguideComponents/Wrapper.js.map +1 -1
- package/lib/module/utils/Streami18n.js.map +1 -1
- package/lib/module/utils/getResizedImageUrl.js +26 -0
- package/lib/module/utils/getResizedImageUrl.js.map +1 -0
- package/lib/module/utils/getUrlOfImageAttachment.js +9 -0
- package/lib/module/utils/getUrlOfImageAttachment.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/Attachment/Attachment.d.ts +1 -1
- package/lib/typescript/components/Attachment/AttachmentActions.d.ts +1 -1
- package/lib/typescript/components/Attachment/Card.d.ts +1 -1
- package/lib/typescript/components/Attachment/FileAttachment.d.ts +1 -1
- package/lib/typescript/components/Attachment/Gallery.d.ts +1 -4
- package/lib/typescript/components/Attachment/Giphy.d.ts +1 -1
- package/lib/typescript/components/Attachment/utils/buildGallery/buildGallery.d.ts +23 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.d.ts +7 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.d.ts +7 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.d.ts +7 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildThumbnail.d.ts +10 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildThumbnailGrid.d.ts +137 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/types.d.ts +23 -0
- package/lib/typescript/components/Attachment/utils/getAspectRatio.d.ts +9 -0
- package/lib/typescript/components/Attachment/utils/getGalleryImageBorderRadius.d.ts +22 -0
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionHeader.d.ts +1 -1
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionItem.d.ts +1 -1
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts +2 -3
- package/lib/typescript/components/Channel/Channel.d.ts +4 -4
- package/lib/typescript/components/Channel/hooks/useCreateOwnCapabilitiesContext.d.ts +1 -1
- package/lib/typescript/components/ChannelList/ChannelList.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +4 -2
- package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +2 -2
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessenger.d.ts +2 -2
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMutedStatus.d.ts +9 -0
- package/lib/typescript/components/Chat/Chat.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +3 -1
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageDeleted.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/utils/parseLinks.d.ts +7 -0
- package/lib/typescript/components/Message/MessageSimple/utils/parseLinks.test.d.ts +1 -0
- package/lib/typescript/components/Message/MessageSimple/utils/renderText.d.ts +2 -2
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +3 -3
- package/lib/typescript/components/Message/utils/messageActions.d.ts +2 -2
- package/lib/typescript/components/Message/utils/removeReservedFields.d.ts +1 -1
- package/lib/typescript/components/MessageInput/AttachButton.d.ts +1 -1
- package/lib/typescript/components/MessageInput/CommandsButton.d.ts +1 -1
- package/lib/typescript/components/MessageInput/MoreOptionsButton.d.ts +1 -1
- package/lib/typescript/components/MessageList/MessageSystem.d.ts +1 -1
- package/lib/typescript/components/MessageList/utils/getGroupStyles.d.ts +1 -1
- package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts +1 -1
- package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts +3 -1
- package/lib/typescript/components/MessageOverlay/OverlayReactionsAvatar.d.ts +7 -0
- package/lib/typescript/components/Reply/Reply.d.ts +1 -1
- package/lib/typescript/components/Thread/Thread.d.ts +2 -2
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +13 -5
- package/lib/typescript/contexts/channelsStateContext/ChannelsStateContext.d.ts +1 -1
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +6 -4
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +2 -2
- package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +1 -1
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +6 -4
- package/lib/typescript/contexts/messageOverlayContext/hooks/useResettableState.d.ts +12 -0
- package/lib/typescript/contexts/messageOverlayContext/hooks/useResettableState.test.d.ts +1 -0
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +10 -10
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +5 -5
- package/lib/typescript/contexts/suggestionsContext/SuggestionsContext.d.ts +2 -2
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +11 -3
- package/lib/typescript/hooks/useStreami18n.d.ts +1 -1
- package/lib/typescript/utils/Streami18n.d.ts +2 -2
- package/lib/typescript/utils/getResizedImageUrl.d.ts +19 -0
- package/lib/typescript/utils/getUrlOfImageAttachment.d.ts +7 -0
- package/lib/typescript/utils/utils.d.ts +6 -1
- package/package.json +9 -13
- package/src/components/Attachment/Attachment.tsx +3 -3
- package/src/components/Attachment/AttachmentActions.tsx +2 -2
- package/src/components/Attachment/Card.tsx +3 -4
- package/src/components/Attachment/FileAttachment.tsx +3 -4
- package/src/components/Attachment/FileIcon.tsx +2 -2
- package/src/components/Attachment/Gallery.tsx +160 -184
- package/src/components/Attachment/Giphy.tsx +3 -4
- package/src/components/Attachment/__tests__/Attachment.test.js +11 -10
- package/src/components/Attachment/__tests__/Gallery.test.js +233 -0
- package/src/components/Attachment/__tests__/buildGallery.test.js +131 -0
- package/src/components/Attachment/utils/buildGallery/buildGallery.ts +75 -0
- package/src/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.ts +95 -0
- package/src/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.ts +99 -0
- package/src/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.ts +64 -0
- package/src/components/Attachment/utils/buildGallery/buildThumbnail.ts +46 -0
- package/src/components/Attachment/utils/buildGallery/buildThumbnailGrid.ts +186 -0
- package/src/components/Attachment/utils/buildGallery/types.ts +27 -0
- package/src/components/Attachment/utils/getAspectRatio.ts +21 -0
- package/src/components/Attachment/utils/getGalleryImageBorderRadius.ts +71 -0
- package/src/components/AttachmentPicker/AttachmentPicker.tsx +4 -2
- package/src/components/AutoCompleteInput/AutoCompleteInput.tsx +4 -3
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.tsx +1 -1
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx +2 -2
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionItem.tsx +7 -5
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +5 -6
- package/src/components/AutoCompleteInput/__tests__/AutoCompleteInput.test.js +6 -8
- package/src/components/Avatar/Avatar.tsx +7 -10
- package/src/components/Avatar/GroupAvatar.tsx +7 -2
- package/src/components/Avatar/__tests__/Avatar.test.js +2 -2
- package/src/components/Channel/Channel.tsx +75 -68
- package/src/components/Channel/__tests__/Channel.test.js +10 -10
- package/src/components/Channel/__tests__/ownCapabilities.test.js +8 -8
- package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +2 -1
- package/src/components/ChannelList/ChannelList.tsx +8 -9
- package/src/components/ChannelList/ChannelListFooterLoadingIndicator.tsx +1 -2
- package/src/components/ChannelList/ChannelListHeaderErrorIndicator.tsx +3 -7
- package/src/components/ChannelList/ChannelListHeaderNetworkDownIndicator.tsx +2 -2
- package/src/components/ChannelList/ChannelListMessenger.tsx +3 -4
- package/src/components/ChannelList/__tests__/ChannelList.test.js +73 -13
- package/src/components/ChannelList/__tests__/ChannelListMessenger.test.js +11 -12
- package/src/components/ChannelList/hooks/listeners/useAddedToChannelNotification.ts +3 -3
- package/src/components/ChannelList/hooks/listeners/useChannelDeleted.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelHidden.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelTruncated.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelUpdated.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelVisible.ts +3 -3
- package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +2 -3
- package/src/components/ChannelList/hooks/listeners/useNewMessageNotification.ts +4 -4
- package/src/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useUserPresence.ts +2 -2
- package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +1 -2
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +78 -48
- package/src/components/ChannelPreview/ChannelAvatar.tsx +3 -5
- package/src/components/ChannelPreview/ChannelPreview.tsx +3 -3
- package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +2 -2
- package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +23 -10
- package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx +71 -0
- package/src/components/ChannelPreview/ChannelPreviewStatus.tsx +4 -3
- package/src/components/ChannelPreview/ChannelPreviewTitle.tsx +2 -2
- package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx +2 -1
- package/src/components/ChannelPreview/__tests__/ChannelPreview.test.js +8 -9
- package/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +8 -9
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.ts +2 -2
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +3 -4
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts +2 -2
- package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +2 -2
- package/src/components/Chat/Chat.tsx +6 -6
- package/src/components/Chat/__tests__/Chat.test.js +5 -5
- package/src/components/Chat/hooks/useIsOnline.ts +4 -3
- package/src/components/ImageGallery/ImageGallery.tsx +82 -49
- package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +1 -2
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +2 -5
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +1 -2
- package/src/components/ImageGallery/components/ImageGrid.tsx +4 -5
- package/src/components/ImageGallery/components/ImageGridHandle.tsx +1 -0
- package/src/components/Indicators/LoadingIndicator.tsx +1 -2
- package/src/components/Message/Message.tsx +20 -20
- package/src/components/Message/MessageSimple/MessageAvatar.tsx +1 -2
- package/src/components/Message/MessageSimple/MessageContent.tsx +2 -3
- package/src/components/Message/MessageSimple/MessageDeleted.tsx +3 -4
- package/src/components/Message/MessageSimple/MessageFooter.tsx +6 -7
- package/src/components/Message/MessageSimple/MessagePinnedHeader.tsx +2 -2
- package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +2 -3
- package/src/components/Message/MessageSimple/MessageStatus.tsx +9 -5
- package/src/components/Message/MessageSimple/__tests__/Message.test.js +9 -9
- package/src/components/Message/MessageSimple/__tests__/MessageAvatar.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +9 -26
- package/src/components/Message/MessageSimple/__tests__/MessagePinnedHeader.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/MessageReplies.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/MessageStatus.test.js +4 -5
- package/src/components/Message/MessageSimple/__tests__/MessageTextContainer.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +1 -1
- package/src/components/Message/MessageSimple/utils/parseLinks.test.ts +100 -0
- package/src/components/Message/MessageSimple/utils/parseLinks.ts +95 -0
- package/src/components/Message/MessageSimple/utils/renderText.tsx +11 -23
- package/src/components/Message/hooks/useCreateMessageContext.ts +1 -2
- package/src/components/Message/hooks/useMessageActionHandlers.ts +13 -4
- package/src/components/Message/hooks/useMessageActions.tsx +14 -9
- package/src/components/Message/utils/messageActions.ts +2 -2
- package/src/components/Message/utils/removeReservedFields.ts +1 -1
- package/src/components/MessageInput/AttachButton.tsx +1 -2
- package/src/components/MessageInput/CommandsButton.tsx +1 -2
- package/src/components/MessageInput/CooldownTimer.tsx +1 -0
- package/src/components/MessageInput/FileUploadPreview.tsx +3 -3
- package/src/components/MessageInput/ImageUploadPreview.tsx +1 -2
- package/src/components/MessageInput/InputButtons.tsx +1 -1
- package/src/components/MessageInput/MessageInput.tsx +5 -6
- package/src/components/MessageInput/MoreOptionsButton.tsx +1 -2
- package/src/components/MessageInput/SendMessageDisallowedIndicator.tsx +1 -1
- package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx +1 -1
- package/src/components/MessageInput/__tests__/AttachButton.test.js +2 -2
- package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +15 -17
- package/src/components/MessageInput/__tests__/ImageUploadPreview.test.js +3 -3
- package/src/components/MessageInput/__tests__/MessageInput.test.js +8 -8
- package/src/components/MessageInput/__tests__/SendButton.test.js +2 -2
- package/src/components/MessageInput/__tests__/UploadProgressIndicator.test.js +2 -2
- package/src/components/MessageInput/__tests__/__snapshots__/FileUploadPreview.test.js.snap +1604 -4172
- package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +1 -643
- package/src/components/MessageInput/hooks/useCooldown.ts +2 -0
- package/src/components/MessageInput/hooks/useCountdown.ts +1 -0
- package/src/components/MessageList/MessageList.tsx +3 -3
- package/src/components/MessageList/MessageSystem.tsx +2 -2
- package/src/components/MessageList/TypingIndicator.tsx +1 -2
- package/src/components/MessageList/__tests__/MessageList.test.js +17 -17
- package/src/components/MessageList/__tests__/MessageSystem.test.js +3 -3
- package/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +3 -3
- package/src/components/MessageList/__tests__/TypingIndicator.test.js +5 -6
- package/src/components/MessageList/__tests__/__snapshots__/TypingIndicator.test.js.snap +1 -1
- package/src/components/MessageList/hooks/useMessageList.ts +5 -7
- package/src/components/MessageList/hooks/useTypingString.ts +1 -2
- package/src/components/MessageList/utils/getGroupStyles.ts +1 -2
- package/src/components/MessageList/utils/getLastReceivedMessage.ts +6 -1
- package/src/components/MessageOverlay/MessageActionList.tsx +3 -3
- package/src/components/MessageOverlay/MessageActionListItem.tsx +3 -1
- package/src/components/MessageOverlay/MessageOverlay.tsx +20 -16
- package/src/components/MessageOverlay/OverlayBackdrop.tsx +1 -0
- package/src/components/MessageOverlay/OverlayReactionList.tsx +2 -4
- package/src/components/MessageOverlay/OverlayReactions.tsx +27 -8
- package/src/components/MessageOverlay/OverlayReactionsAvatar.tsx +27 -0
- package/src/components/MessageOverlay/hooks/useMessageActionAnimation.tsx +1 -0
- package/src/components/Reply/Reply.tsx +25 -15
- package/src/components/Thread/Thread.tsx +5 -6
- package/src/components/Thread/__tests__/Thread.test.js +12 -14
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +13 -13
- package/src/components/Thread/components/ThreadFooterComponent.tsx +1 -2
- package/src/components/index.ts +2 -0
- package/src/contexts/activeChannelsRefContext/ActiveChannelsRefContext.tsx +1 -2
- package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +1 -2
- package/src/contexts/channelContext/ChannelContext.tsx +1 -2
- package/src/contexts/channelsContext/ChannelsContext.tsx +18 -7
- package/src/contexts/channelsStateContext/ChannelsStateContext.tsx +7 -8
- package/src/contexts/channelsStateContext/useChannelState.ts +1 -0
- package/src/contexts/chatContext/ChatContext.tsx +1 -2
- package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +1 -2
- package/src/contexts/keyboardContext/KeyboardContext.tsx +1 -2
- package/src/contexts/messageContext/MessageContext.tsx +1 -2
- package/src/contexts/messageInputContext/MessageInputContext.tsx +27 -24
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +2 -4
- package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +15 -10
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +10 -19
- package/src/contexts/messageOverlayContext/hooks/useResettableState.test.tsx +46 -0
- package/src/contexts/messageOverlayContext/hooks/useResettableState.ts +22 -0
- package/src/contexts/messagesContext/MessagesContext.tsx +13 -13
- package/src/contexts/overlayContext/OverlayContext.tsx +10 -8
- package/src/contexts/overlayContext/OverlayProvider.tsx +30 -25
- package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +1 -2
- package/src/contexts/suggestionsContext/SuggestionsContext.tsx +4 -3
- package/src/contexts/suggestionsContext/__tests__/Suggestions.test.js +1 -0
- package/src/contexts/themeContext/ThemeContext.tsx +1 -0
- package/src/contexts/themeContext/utils/theme.ts +23 -8
- package/src/contexts/threadContext/ThreadContext.tsx +1 -2
- package/src/contexts/translationContext/TranslationContext.tsx +2 -2
- package/src/contexts/typingContext/TypingContext.tsx +1 -2
- package/src/contexts/utils/getDisplayName.ts +1 -0
- package/src/emoji-data/index.js +1 -1
- package/src/hooks/useStreami18n.ts +1 -1
- package/src/mock-builders/api/sendMessage.js +1 -0
- package/src/mock-builders/generator/attachment.js +0 -2
- package/src/mock-builders/generator/channel.js +101 -64
- package/src/mock-builders/generator/user.js +33 -26
- package/src/native.ts +1 -0
- package/src/styleguideComponents/ArgumentsRenderer.tsx +2 -1
- package/src/styleguideComponents/JsDoc.tsx +3 -1
- package/src/styleguideComponents/PathlineRenderer.tsx +2 -1
- package/src/styleguideComponents/PropsRenderer.tsx +7 -4
- package/src/styleguideComponents/Wrapper.tsx +1 -0
- package/src/utils/Streami18n.ts +3 -3
- package/src/utils/__tests__/Streami18n.test.js +1 -2
- package/src/utils/getResizedImageUrl.ts +43 -0
- package/src/utils/getUrlOfImageAttachment.ts +10 -0
- package/src/utils/utils.ts +9 -4
- package/src/version.json +1 -1
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { cleanup, render, waitFor } from '@testing-library/react-native';
|
|
3
2
|
|
|
4
|
-
import {
|
|
5
|
-
import { ChannelList } from '../ChannelList';
|
|
6
|
-
|
|
7
|
-
import { Chat } from '../../Chat/Chat';
|
|
3
|
+
import { cleanup, render, waitFor } from '@testing-library/react-native';
|
|
8
4
|
|
|
9
|
-
import { getOrCreateChannelApi } from '../../../mock-builders/api/getOrCreateChannel';
|
|
10
|
-
import { useMockedApis } from '../../../mock-builders/api/useMockedApis';
|
|
11
|
-
import { generateChannel } from '../../../mock-builders/generator/channel';
|
|
12
|
-
import { getTestClientWithUser } from '../../../mock-builders/mock';
|
|
13
|
-
import { queryChannelsApi } from '../../../mock-builders/api/queryChannels';
|
|
14
5
|
import {
|
|
15
6
|
ChannelsProvider,
|
|
16
7
|
useChannelsContext,
|
|
17
8
|
} from '../../../contexts/channelsContext/ChannelsContext';
|
|
18
9
|
import { ChatContext, ChatProvider } from '../../../contexts/chatContext/ChatContext';
|
|
10
|
+
import { getOrCreateChannelApi } from '../../../mock-builders/api/getOrCreateChannel';
|
|
11
|
+
import { queryChannelsApi } from '../../../mock-builders/api/queryChannels';
|
|
12
|
+
import { useMockedApis } from '../../../mock-builders/api/useMockedApis';
|
|
13
|
+
import { generateChannelResponse } from '../../../mock-builders/generator/channel';
|
|
14
|
+
import { getTestClientWithUser } from '../../../mock-builders/mock';
|
|
15
|
+
import { Chat } from '../../Chat/Chat';
|
|
16
|
+
import { ChannelList } from '../ChannelList';
|
|
17
|
+
import { ChannelListMessenger } from '../ChannelListMessenger';
|
|
19
18
|
|
|
20
19
|
let mockChannels;
|
|
21
20
|
let chatClient;
|
|
@@ -54,8 +53,8 @@ const Component = ({ error = false, loadingChannels = false }) => (
|
|
|
54
53
|
describe('ChannelListMessenger', () => {
|
|
55
54
|
beforeAll(async () => {
|
|
56
55
|
chatClient = await getTestClientWithUser({ id: 'vishal' });
|
|
57
|
-
const c1 =
|
|
58
|
-
const c2 =
|
|
56
|
+
const c1 = generateChannelResponse();
|
|
57
|
+
const c2 = generateChannelResponse();
|
|
59
58
|
useMockedApis(chatClient, [getOrCreateChannelApi(c1), getOrCreateChannelApi(c2)]);
|
|
60
59
|
const channel1 = chatClient.channel(c1.channel.type, c1.channel.id);
|
|
61
60
|
await channel1.watch();
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
+
|
|
2
3
|
import uniqBy from 'lodash/uniqBy';
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
+
import type { Channel, Event } from 'stream-chat';
|
|
5
6
|
|
|
6
7
|
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
7
8
|
|
|
8
|
-
import type { Channel, Event } from 'stream-chat';
|
|
9
|
-
|
|
10
9
|
import type {
|
|
11
10
|
DefaultAttachmentType,
|
|
12
11
|
DefaultChannelType,
|
|
@@ -17,6 +16,7 @@ import type {
|
|
|
17
16
|
DefaultUserType,
|
|
18
17
|
UnknownType,
|
|
19
18
|
} from '../../../../types/types';
|
|
19
|
+
import { getChannel } from '../../utils';
|
|
20
20
|
|
|
21
21
|
type Parameters<
|
|
22
22
|
At extends UnknownType = DefaultAttachmentType,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
4
|
-
|
|
5
3
|
import type { Channel, Event } from 'stream-chat';
|
|
6
4
|
|
|
5
|
+
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
6
|
+
|
|
7
7
|
import type {
|
|
8
8
|
DefaultAttachmentType,
|
|
9
9
|
DefaultChannelType,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
4
|
-
|
|
5
3
|
import type { Channel, Event } from 'stream-chat';
|
|
6
4
|
|
|
5
|
+
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
6
|
+
|
|
7
7
|
import type {
|
|
8
8
|
DefaultAttachmentType,
|
|
9
9
|
DefaultChannelType,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
4
|
-
|
|
5
3
|
import type { Channel, Event } from 'stream-chat';
|
|
6
4
|
|
|
5
|
+
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
6
|
+
|
|
7
7
|
import type {
|
|
8
8
|
DefaultAttachmentType,
|
|
9
9
|
DefaultChannelType,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
4
|
-
|
|
5
3
|
import type { Channel, Event } from 'stream-chat';
|
|
6
4
|
|
|
5
|
+
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
6
|
+
|
|
7
7
|
import type {
|
|
8
8
|
DefaultAttachmentType,
|
|
9
9
|
DefaultChannelType,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
+
|
|
2
3
|
import uniqBy from 'lodash/uniqBy';
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
+
import type { Channel, Event } from 'stream-chat';
|
|
5
6
|
|
|
6
7
|
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
7
8
|
|
|
8
|
-
import type { Channel, Event } from 'stream-chat';
|
|
9
|
-
|
|
10
9
|
import type {
|
|
11
10
|
DefaultAttachmentType,
|
|
12
11
|
DefaultChannelType,
|
|
@@ -17,6 +16,7 @@ import type {
|
|
|
17
16
|
DefaultUserType,
|
|
18
17
|
UnknownType,
|
|
19
18
|
} from '../../../../types/types';
|
|
19
|
+
import { getChannel } from '../../utils';
|
|
20
20
|
|
|
21
21
|
type Parameters<
|
|
22
22
|
At extends UnknownType = DefaultAttachmentType,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type { Channel, Event } from 'stream-chat';
|
|
4
4
|
|
|
5
5
|
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
6
6
|
|
|
7
|
-
import type { Channel, Event } from 'stream-chat';
|
|
8
|
-
|
|
9
7
|
import type {
|
|
10
8
|
DefaultAttachmentType,
|
|
11
9
|
DefaultChannelType,
|
|
@@ -16,6 +14,7 @@ import type {
|
|
|
16
14
|
DefaultUserType,
|
|
17
15
|
UnknownType,
|
|
18
16
|
} from '../../../../types/types';
|
|
17
|
+
import { moveChannelUp } from '../../utils';
|
|
19
18
|
|
|
20
19
|
type Parameters<
|
|
21
20
|
At extends UnknownType = DefaultAttachmentType,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import uniqBy from 'lodash/uniqBy';
|
|
2
1
|
import { useEffect } from 'react';
|
|
3
2
|
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
3
|
+
import uniqBy from 'lodash/uniqBy';
|
|
7
4
|
|
|
8
5
|
import type { Channel, Event } from 'stream-chat';
|
|
9
6
|
|
|
7
|
+
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
8
|
+
|
|
10
9
|
import type {
|
|
11
10
|
DefaultAttachmentType,
|
|
12
11
|
DefaultChannelType,
|
|
@@ -17,6 +16,7 @@ import type {
|
|
|
17
16
|
DefaultUserType,
|
|
18
17
|
UnknownType,
|
|
19
18
|
} from '../../../../types/types';
|
|
19
|
+
import { getChannel } from '../../utils';
|
|
20
20
|
|
|
21
21
|
type Parameters<
|
|
22
22
|
At extends UnknownType = DefaultAttachmentType,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
4
|
-
|
|
5
3
|
import type { Channel, Event } from 'stream-chat';
|
|
6
4
|
|
|
5
|
+
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
6
|
+
|
|
7
7
|
import type {
|
|
8
8
|
DefaultAttachmentType,
|
|
9
9
|
DefaultChannelType,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
4
|
-
|
|
5
3
|
import type { Channel, Event } from 'stream-chat';
|
|
6
4
|
|
|
5
|
+
import { useChatContext } from '../../../../contexts/chatContext/ChatContext';
|
|
6
|
+
|
|
7
7
|
import type {
|
|
8
8
|
DefaultAttachmentType,
|
|
9
9
|
DefaultChannelType,
|
|
@@ -55,12 +55,11 @@ export const useCreateChannelsContext = <
|
|
|
55
55
|
const channelValueString = channels
|
|
56
56
|
.map(
|
|
57
57
|
(channel) =>
|
|
58
|
-
`${channel.data?.name}${Object.values(channel.state.members)
|
|
58
|
+
`${channel.data?.name ?? ''}${channel.id ?? ''}${Object.values(channel.state.members)
|
|
59
59
|
.map((member) => member.user?.online)
|
|
60
60
|
.join()}`,
|
|
61
61
|
)
|
|
62
62
|
.join();
|
|
63
|
-
|
|
64
63
|
const channelsContext: ChannelsContextValue<At, Ch, Co, Ev, Me, Re, Us> = useMemo(
|
|
65
64
|
() => ({
|
|
66
65
|
additionalFlatListProps,
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type { Channel, ChannelFilters, ChannelOptions, ChannelSort } from 'stream-chat';
|
|
4
4
|
|
|
5
5
|
import { useActiveChannelsRefContext } from '../../../contexts/activeChannelsRefContext/ActiveChannelsRefContext';
|
|
6
6
|
import { useChatContext } from '../../../contexts/chatContext/ChatContext';
|
|
7
7
|
import { useIsMountedRef } from '../../../hooks/useIsMountedRef';
|
|
8
8
|
|
|
9
|
-
import type { Channel, ChannelFilters, ChannelOptions, ChannelSort } from 'stream-chat';
|
|
10
|
-
|
|
11
9
|
import type {
|
|
12
10
|
DefaultAttachmentType,
|
|
13
11
|
DefaultChannelType,
|
|
@@ -18,10 +16,12 @@ import type {
|
|
|
18
16
|
DefaultUserType,
|
|
19
17
|
UnknownType,
|
|
20
18
|
} from '../../../types/types';
|
|
19
|
+
import { ONE_SECOND_IN_MS } from '../../../utils/date';
|
|
20
|
+
import { MAX_QUERY_CHANNELS_LIMIT } from '../utils';
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const waitSeconds = (seconds: number) =>
|
|
23
23
|
new Promise((resolve) => {
|
|
24
|
-
setTimeout(resolve,
|
|
24
|
+
setTimeout(resolve, seconds * ONE_SECOND_IN_MS);
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
type Parameters<
|
|
@@ -38,6 +38,12 @@ const DEFAULT_OPTIONS = {
|
|
|
38
38
|
message_limit: 10,
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
const MAX_NUMBER_OF_RETRIES = 3;
|
|
42
|
+
const RETRY_INTERVAL_IN_MS = 5000;
|
|
43
|
+
|
|
44
|
+
type QueryType = 'reload' | 'refresh' | 'loadChannels';
|
|
45
|
+
export type QueryChannels = (queryType?: QueryType, retryCount?: number) => Promise<void>;
|
|
46
|
+
|
|
41
47
|
export const usePaginatedChannels = <
|
|
42
48
|
At extends UnknownType = DefaultAttachmentType,
|
|
43
49
|
Ch extends UnknownType = DefaultChannelType,
|
|
@@ -55,32 +61,49 @@ export const usePaginatedChannels = <
|
|
|
55
61
|
const [channels, setChannels] = useState<Channel<At, Ch, Co, Ev, Me, Re, Us>[]>([]);
|
|
56
62
|
const activeChannels = useActiveChannelsRefContext();
|
|
57
63
|
|
|
58
|
-
const [error, setError] = useState<
|
|
64
|
+
const [error, setError] = useState<Error>();
|
|
59
65
|
const [hasNextPage, setHasNextPage] = useState(true);
|
|
60
66
|
const lastRefresh = useRef(Date.now());
|
|
61
|
-
const
|
|
62
|
-
const [
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
const isQueryingRef = useRef(false);
|
|
68
|
+
const [activeQueryType, setActiveQueryType] = useState<QueryType | null>();
|
|
69
|
+
const isMountedRef = useIsMountedRef();
|
|
70
|
+
const filtersRef = useRef<typeof filters | null>(null);
|
|
71
|
+
const sortRef = useRef<typeof filters | null>(null);
|
|
72
|
+
const activeRequestId = useRef<number>(0);
|
|
73
|
+
|
|
74
|
+
const queryChannels: QueryChannels = async (
|
|
75
|
+
queryType: QueryType = 'loadChannels',
|
|
76
|
+
retryCount = 0,
|
|
77
|
+
): Promise<void> => {
|
|
78
|
+
if (!client || !isMountedRef.current) return;
|
|
79
|
+
|
|
80
|
+
const hasUpdatedData = () =>
|
|
81
|
+
[
|
|
82
|
+
JSON.stringify(filtersRef.current) !== JSON.stringify(filters),
|
|
83
|
+
JSON.stringify(sortRef.current) !== JSON.stringify(sort),
|
|
84
|
+
activeRequestId.current !== currentRequestId,
|
|
85
|
+
].some(Boolean); // will return true if any element is truthy
|
|
86
|
+
|
|
87
|
+
const queryIsStale = () => !isMountedRef || activeRequestId.current !== currentRequestId;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* We don't need to make another call to query channels if we don't
|
|
91
|
+
* have new data for the query to include
|
|
92
|
+
* */
|
|
93
|
+
if (!hasUpdatedData) {
|
|
94
|
+
if (activeQueryType === null) return;
|
|
79
95
|
}
|
|
80
96
|
|
|
97
|
+
filtersRef.current = filters;
|
|
98
|
+
isQueryingRef.current = true;
|
|
99
|
+
setError(undefined);
|
|
100
|
+
activeRequestId.current++;
|
|
101
|
+
const currentRequestId = activeRequestId.current;
|
|
102
|
+
setActiveQueryType(queryType);
|
|
103
|
+
|
|
81
104
|
const newOptions = {
|
|
82
105
|
limit: options?.limit ?? MAX_QUERY_CHANNELS_LIMIT,
|
|
83
|
-
offset: queryType === '
|
|
106
|
+
offset: queryType === 'loadChannels' ? channels.length : 0,
|
|
84
107
|
...options,
|
|
85
108
|
};
|
|
86
109
|
|
|
@@ -89,54 +112,61 @@ export const usePaginatedChannels = <
|
|
|
89
112
|
skipInitialization: activeChannels.current,
|
|
90
113
|
});
|
|
91
114
|
|
|
92
|
-
if (!
|
|
115
|
+
if (queryIsStale() || !isMountedRef.current) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
93
118
|
|
|
94
119
|
channelQueryResponse.forEach((channel) => channel.state.setIsUpToDate(true));
|
|
95
120
|
|
|
96
121
|
const newChannels =
|
|
97
|
-
queryType === '
|
|
98
|
-
? channelQueryResponse
|
|
99
|
-
:
|
|
122
|
+
queryType === 'loadChannels'
|
|
123
|
+
? [...channels, ...channelQueryResponse]
|
|
124
|
+
: channelQueryResponse;
|
|
100
125
|
|
|
101
126
|
setChannels(newChannels);
|
|
102
127
|
setHasNextPage(channelQueryResponse.length >= newOptions.limit);
|
|
103
|
-
setError(
|
|
104
|
-
|
|
105
|
-
} catch (err) {
|
|
106
|
-
|
|
107
|
-
await
|
|
108
|
-
|
|
109
|
-
if (
|
|
128
|
+
setError(undefined);
|
|
129
|
+
isQueryingRef.current = false;
|
|
130
|
+
} catch (err: unknown) {
|
|
131
|
+
isQueryingRef.current = false;
|
|
132
|
+
await waitSeconds(2);
|
|
133
|
+
|
|
134
|
+
if (queryIsStale()) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
110
137
|
|
|
111
138
|
// querying.current check is needed in order to make sure the next query call doesnt flick an error
|
|
112
139
|
// state and then succeed (reconnect case)
|
|
113
|
-
if (retryCount ===
|
|
114
|
-
|
|
115
|
-
setLoadingNextPage(false);
|
|
116
|
-
setRefreshing(false);
|
|
140
|
+
if (retryCount === MAX_NUMBER_OF_RETRIES && !isQueryingRef.current) {
|
|
141
|
+
setActiveQueryType(null);
|
|
117
142
|
console.warn(err);
|
|
118
|
-
|
|
143
|
+
setError(
|
|
144
|
+
new Error(
|
|
145
|
+
`Maximum number of retries reached in queryChannels. Last error message is: ${err}`,
|
|
146
|
+
),
|
|
147
|
+
);
|
|
148
|
+
return;
|
|
119
149
|
}
|
|
120
150
|
|
|
121
151
|
return queryChannels(queryType, retryCount + 1);
|
|
122
152
|
}
|
|
123
153
|
|
|
124
|
-
|
|
125
|
-
setLoadingNextPage(false);
|
|
126
|
-
setRefreshing(false);
|
|
154
|
+
setActiveQueryType(null);
|
|
127
155
|
};
|
|
128
156
|
|
|
129
157
|
const loadNextPage = hasNextPage ? queryChannels : undefined;
|
|
158
|
+
|
|
130
159
|
const refreshList = () => {
|
|
131
160
|
const now = Date.now();
|
|
132
161
|
// Only allow pull-to-refresh 5 seconds after last successful refresh.
|
|
133
|
-
if (now - lastRefresh.current <
|
|
162
|
+
if (now - lastRefresh.current < RETRY_INTERVAL_IN_MS && error === undefined) {
|
|
134
163
|
return;
|
|
135
164
|
}
|
|
136
165
|
|
|
137
166
|
lastRefresh.current = Date.now();
|
|
138
167
|
return queryChannels('refresh');
|
|
139
168
|
};
|
|
169
|
+
|
|
140
170
|
const reloadList = () => queryChannels('reload');
|
|
141
171
|
|
|
142
172
|
/**
|
|
@@ -165,10 +195,10 @@ export const usePaginatedChannels = <
|
|
|
165
195
|
channels,
|
|
166
196
|
error,
|
|
167
197
|
hasNextPage,
|
|
168
|
-
loadingChannels,
|
|
169
|
-
loadingNextPage,
|
|
198
|
+
loadingChannels: activeQueryType === 'reload',
|
|
199
|
+
loadingNextPage: activeQueryType === 'loadChannels',
|
|
170
200
|
loadNextPage,
|
|
171
|
-
refreshing,
|
|
201
|
+
refreshing: activeQueryType === 'refresh',
|
|
172
202
|
refreshList,
|
|
173
203
|
reloadList,
|
|
174
204
|
setChannels,
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
import type { ChannelPreviewProps } from './ChannelPreview';
|
|
3
4
|
import { useChannelPreviewDisplayAvatar } from './hooks/useChannelPreviewDisplayAvatar';
|
|
4
5
|
import { useChannelPreviewDisplayPresence } from './hooks/useChannelPreviewDisplayPresence';
|
|
5
6
|
|
|
6
|
-
import { Avatar } from '../Avatar/Avatar';
|
|
7
|
-
import { GroupAvatar } from '../Avatar/GroupAvatar';
|
|
8
|
-
|
|
9
|
-
import type { ChannelPreviewProps } from './ChannelPreview';
|
|
10
|
-
|
|
11
7
|
import type {
|
|
12
8
|
DefaultAttachmentType,
|
|
13
9
|
DefaultChannelType,
|
|
@@ -18,6 +14,8 @@ import type {
|
|
|
18
14
|
DefaultUserType,
|
|
19
15
|
UnknownType,
|
|
20
16
|
} from '../../types/types';
|
|
17
|
+
import { Avatar } from '../Avatar/Avatar';
|
|
18
|
+
import { GroupAvatar } from '../Avatar/GroupAvatar';
|
|
21
19
|
|
|
22
20
|
export type ChannelAvatarProps<
|
|
23
21
|
At extends UnknownType = DefaultAttachmentType,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
+
import type { Channel, ChannelState, Event, MessageResponse } from 'stream-chat';
|
|
4
|
+
|
|
3
5
|
import { useLatestMessagePreview } from './hooks/useLatestMessagePreview';
|
|
4
6
|
|
|
5
|
-
import { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';
|
|
6
7
|
import {
|
|
7
8
|
ChannelsContextValue,
|
|
8
9
|
useChannelsContext,
|
|
9
10
|
} from '../../contexts/channelsContext/ChannelsContext';
|
|
10
|
-
|
|
11
|
-
import type { Channel, ChannelState, Event, MessageResponse } from 'stream-chat';
|
|
11
|
+
import { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';
|
|
12
12
|
|
|
13
13
|
import type {
|
|
14
14
|
DefaultAttachmentType,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, Text } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
5
|
-
|
|
6
4
|
import type { LatestMessagePreview } from './hooks/useLatestMessagePreview';
|
|
7
5
|
|
|
6
|
+
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
7
|
+
|
|
8
8
|
import type {
|
|
9
9
|
DefaultAttachmentType,
|
|
10
10
|
DefaultChannelType,
|
|
@@ -3,18 +3,21 @@ import { StyleSheet, View } from 'react-native';
|
|
|
3
3
|
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
4
4
|
|
|
5
5
|
import { ChannelAvatar } from './ChannelAvatar';
|
|
6
|
+
import type { ChannelPreviewProps } from './ChannelPreview';
|
|
7
|
+
import { ChannelPreviewMessage } from './ChannelPreviewMessage';
|
|
8
|
+
import { ChannelPreviewMutedStatus } from './ChannelPreviewMutedStatus';
|
|
9
|
+
import { ChannelPreviewStatus } from './ChannelPreviewStatus';
|
|
10
|
+
import { ChannelPreviewTitle } from './ChannelPreviewTitle';
|
|
11
|
+
import { ChannelPreviewUnreadCount } from './ChannelPreviewUnreadCount';
|
|
6
12
|
import { useChannelPreviewDisplayName } from './hooks/useChannelPreviewDisplayName';
|
|
7
13
|
|
|
14
|
+
import type { LatestMessagePreview } from './hooks/useLatestMessagePreview';
|
|
15
|
+
|
|
8
16
|
import {
|
|
9
17
|
ChannelsContextValue,
|
|
10
18
|
useChannelsContext,
|
|
11
19
|
} from '../../contexts/channelsContext/ChannelsContext';
|
|
12
20
|
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
13
|
-
import { vw } from '../../utils/utils';
|
|
14
|
-
|
|
15
|
-
import type { ChannelPreviewProps } from './ChannelPreview';
|
|
16
|
-
import type { LatestMessagePreview } from './hooks/useLatestMessagePreview';
|
|
17
|
-
|
|
18
21
|
import type {
|
|
19
22
|
DefaultAttachmentType,
|
|
20
23
|
DefaultChannelType,
|
|
@@ -25,10 +28,7 @@ import type {
|
|
|
25
28
|
DefaultUserType,
|
|
26
29
|
UnknownType,
|
|
27
30
|
} from '../../types/types';
|
|
28
|
-
import {
|
|
29
|
-
import { ChannelPreviewMessage } from './ChannelPreviewMessage';
|
|
30
|
-
import { ChannelPreviewStatus } from './ChannelPreviewStatus';
|
|
31
|
-
import { ChannelPreviewUnreadCount } from './ChannelPreviewUnreadCount';
|
|
31
|
+
import { vw } from '../../utils/utils';
|
|
32
32
|
|
|
33
33
|
const styles = StyleSheet.create({
|
|
34
34
|
container: {
|
|
@@ -46,6 +46,10 @@ const styles = StyleSheet.create({
|
|
|
46
46
|
justifyContent: 'space-between',
|
|
47
47
|
paddingLeft: 8,
|
|
48
48
|
},
|
|
49
|
+
statusContainer: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
},
|
|
49
53
|
title: { fontSize: 14, fontWeight: '700' },
|
|
50
54
|
});
|
|
51
55
|
|
|
@@ -66,6 +70,7 @@ export type ChannelPreviewMessengerPropsWithContext<
|
|
|
66
70
|
| 'onSelect'
|
|
67
71
|
| 'PreviewAvatar'
|
|
68
72
|
| 'PreviewMessage'
|
|
73
|
+
| 'PreviewMutedStatus'
|
|
69
74
|
| 'PreviewStatus'
|
|
70
75
|
| 'PreviewTitle'
|
|
71
76
|
| 'PreviewUnreadCount'
|
|
@@ -126,6 +131,7 @@ const ChannelPreviewMessengerWithContext = <
|
|
|
126
131
|
PreviewStatus = ChannelPreviewStatus,
|
|
127
132
|
PreviewTitle = ChannelPreviewTitle,
|
|
128
133
|
PreviewUnreadCount = ChannelPreviewUnreadCount,
|
|
134
|
+
PreviewMutedStatus = ChannelPreviewMutedStatus,
|
|
129
135
|
unread,
|
|
130
136
|
} = props;
|
|
131
137
|
|
|
@@ -141,6 +147,8 @@ const ChannelPreviewMessengerWithContext = <
|
|
|
141
147
|
Math.floor(maxWidth / ((title.fontSize || styles.title.fontSize) / 2)),
|
|
142
148
|
);
|
|
143
149
|
|
|
150
|
+
const isChannelMuted = channel.muteStatus().muted;
|
|
151
|
+
|
|
144
152
|
return (
|
|
145
153
|
<TouchableOpacity
|
|
146
154
|
onPress={() => {
|
|
@@ -162,7 +170,10 @@ const ChannelPreviewMessengerWithContext = <
|
|
|
162
170
|
>
|
|
163
171
|
<View style={[styles.row, row]}>
|
|
164
172
|
<PreviewTitle channel={channel} displayName={displayName} />
|
|
165
|
-
<
|
|
173
|
+
<View style={[styles.statusContainer, row]}>
|
|
174
|
+
<PreviewMutedStatus channel={channel} muted={isChannelMuted} />
|
|
175
|
+
<PreviewUnreadCount channel={channel} maxUnreadCount={maxUnreadCount} unread={unread} />
|
|
176
|
+
</View>
|
|
166
177
|
</View>
|
|
167
178
|
<View style={[styles.row, row]}>
|
|
168
179
|
<PreviewMessage latestMessagePreview={latestMessagePreview} />
|
|
@@ -220,6 +231,7 @@ export const ChannelPreviewMessenger = <
|
|
|
220
231
|
onSelect,
|
|
221
232
|
PreviewAvatar,
|
|
222
233
|
PreviewMessage,
|
|
234
|
+
PreviewMutedStatus,
|
|
223
235
|
PreviewStatus,
|
|
224
236
|
PreviewTitle,
|
|
225
237
|
PreviewUnreadCount,
|
|
@@ -231,6 +243,7 @@ export const ChannelPreviewMessenger = <
|
|
|
231
243
|
onSelect,
|
|
232
244
|
PreviewAvatar,
|
|
233
245
|
PreviewMessage,
|
|
246
|
+
PreviewMutedStatus,
|
|
234
247
|
PreviewStatus,
|
|
235
248
|
PreviewTitle,
|
|
236
249
|
PreviewUnreadCount,
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import type { ChannelPreviewProps } from './ChannelPreview';
|
|
6
|
+
|
|
7
|
+
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
8
|
+
import { Mute } from '../../icons';
|
|
9
|
+
import type {
|
|
10
|
+
DefaultAttachmentType,
|
|
11
|
+
DefaultChannelType,
|
|
12
|
+
DefaultCommandType,
|
|
13
|
+
DefaultEventType,
|
|
14
|
+
DefaultMessageType,
|
|
15
|
+
DefaultReactionType,
|
|
16
|
+
DefaultUserType,
|
|
17
|
+
UnknownType,
|
|
18
|
+
} from '../../types/types';
|
|
19
|
+
|
|
20
|
+
const styles = StyleSheet.create({
|
|
21
|
+
iconStyle: {
|
|
22
|
+
marginRight: 8,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export type ChannelPreviewMutedStatusProps<
|
|
27
|
+
At extends UnknownType = DefaultAttachmentType,
|
|
28
|
+
Ch extends UnknownType = DefaultChannelType,
|
|
29
|
+
Co extends string = DefaultCommandType,
|
|
30
|
+
Ev extends UnknownType = DefaultEventType,
|
|
31
|
+
Me extends UnknownType = DefaultMessageType,
|
|
32
|
+
Re extends UnknownType = DefaultReactionType,
|
|
33
|
+
Us extends UnknownType = DefaultUserType,
|
|
34
|
+
> = Pick<ChannelPreviewProps<At, Ch, Co, Ev, Me, Re, Us>, 'channel'> & {
|
|
35
|
+
muted: boolean;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* This UI component displays an avatar for a particular channel.
|
|
40
|
+
*/
|
|
41
|
+
export const ChannelPreviewMutedStatus = <
|
|
42
|
+
At extends UnknownType = DefaultAttachmentType,
|
|
43
|
+
Ch extends UnknownType = DefaultChannelType,
|
|
44
|
+
Co extends string = DefaultCommandType,
|
|
45
|
+
Ev extends UnknownType = DefaultEventType,
|
|
46
|
+
Me extends UnknownType = DefaultMessageType,
|
|
47
|
+
Re extends UnknownType = DefaultReactionType,
|
|
48
|
+
Us extends UnknownType = DefaultUserType,
|
|
49
|
+
>(
|
|
50
|
+
props: ChannelPreviewMutedStatusProps<At, Ch, Co, Ev, Me, Re, Us>,
|
|
51
|
+
) => {
|
|
52
|
+
const { muted } = props;
|
|
53
|
+
|
|
54
|
+
const {
|
|
55
|
+
theme: {
|
|
56
|
+
channelPreview: {
|
|
57
|
+
mutedStatus: { height, iconStyle, width },
|
|
58
|
+
},
|
|
59
|
+
colors: { grey_dark },
|
|
60
|
+
},
|
|
61
|
+
} = useTheme();
|
|
62
|
+
|
|
63
|
+
return muted ? (
|
|
64
|
+
<Mute
|
|
65
|
+
height={height}
|
|
66
|
+
pathFill={grey_dark}
|
|
67
|
+
style={[styles.iconStyle, iconStyle]}
|
|
68
|
+
width={width}
|
|
69
|
+
/>
|
|
70
|
+
) : null;
|
|
71
|
+
};
|