stream-chat-react-native-core 3.10.2 → 4.0.0-beta.4
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 +18 -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 -113
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +112 -148
- 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 +21 -45
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/{CommandsItem.js → AutoCompleteSuggestionCommandIcon.js} +21 -94
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +145 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +248 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +223 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -0
- 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 -10
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +332 -247
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +5 -5
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +7 -5
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +9 -31
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +35 -0
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -0
- 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 +5 -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 +4 -3
- 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 +89 -64
- 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 +49 -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 +16 -7
- 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 +2 -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 +12 -5
- package/lib/commonjs/components/Chat/hooks/useIsOnline.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +90 -58
- 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 +14 -16
- 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/LoadingErrorIndicator.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 +151 -860
- 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 +39 -38
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +8 -6
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +33 -21
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +122 -0
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -0
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +5 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.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/MessageSimple.js +27 -13
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +25 -24
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +7 -3
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +52 -80
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.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 +170 -73
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js +240 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js.map +1 -0
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js +1 -5
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +307 -0
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -0
- package/lib/commonjs/components/Message/hooks/useMessageActions.js +563 -0
- package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -0
- package/lib/commonjs/components/Message/utils/messageActions.js +17 -15
- 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 +78 -0
- package/lib/commonjs/components/MessageInput/CooldownTimer.js.map +1 -0
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +4 -4
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +9 -9
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +17 -22
- package/lib/commonjs/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +93 -65
- 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 +71 -0
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -0
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +4 -3
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/hooks/useCooldown.js +63 -0
- package/lib/commonjs/components/MessageInput/hooks/useCooldown.js.map +1 -0
- package/lib/commonjs/components/MessageInput/hooks/useCountdown.js +57 -0
- package/lib/commonjs/components/MessageInput/hooks/useCountdown.js.map +1 -0
- package/lib/commonjs/components/MessageList/DateHeader.js +2 -2
- package/lib/commonjs/components/MessageList/DateHeader.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js +2 -2
- package/lib/commonjs/components/MessageList/InlineDateSeparator.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 +77 -44
- 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 +23 -10
- 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/getDateSeparators.js +2 -1
- package/lib/commonjs/components/MessageList/utils/getDateSeparators.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js +10 -5
- 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/{module/components/MessageOverlay/MessageActions.js → commonjs/components/MessageOverlay/MessageActionList.js} +33 -85
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js.map +1 -0
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +131 -0
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -0
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +97 -78
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +38 -0
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js.map +1 -0
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +12 -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 +37 -0
- package/lib/commonjs/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -0
- 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 +11 -2
- package/lib/commonjs/components/Thread/Thread.js.map +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +20 -12
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/commonjs/components/docs/ListProps.md +1 -1
- package/lib/commonjs/components/docs/data.js +1 -1
- package/lib/commonjs/components/index.js +133 -55
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +68 -0
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -0
- 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 +155 -0
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -0
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js +144 -0
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +1 -0
- 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 +122 -84
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +9 -5
- 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 +2 -2
- 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 +55 -46
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +61 -0
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js.map +1 -0
- 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 +20 -33
- 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 +45 -20
- 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/compiled.js +0 -315
- package/lib/commonjs/emoji-data/compiled.js.map +1 -1
- package/lib/commonjs/emoji-data/emojiNames.js +0 -105
- package/lib/commonjs/emoji-data/emojiNames.js.map +1 -1
- package/lib/commonjs/emoji-data/emojis.js +0 -175
- package/lib/commonjs/emoji-data/emojis.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/i18n/en.json +9 -3
- package/lib/commonjs/i18n/fr.json +9 -3
- package/lib/commonjs/i18n/hi.json +9 -3
- package/lib/commonjs/i18n/it.json +9 -3
- package/lib/commonjs/i18n/ja.json +9 -0
- package/lib/commonjs/i18n/ko.json +9 -0
- package/lib/commonjs/i18n/nl.json +9 -3
- package/lib/commonjs/i18n/ru.json +9 -3
- package/lib/commonjs/i18n/tr.json +10 -4
- package/lib/commonjs/icons/Pin.js +42 -0
- package/lib/commonjs/icons/Pin.js.map +1 -0
- package/lib/commonjs/icons/PinHeader.js +38 -0
- package/lib/commonjs/icons/PinHeader.js.map +1 -0
- package/lib/commonjs/icons/Unpin.js +38 -0
- package/lib/commonjs/icons/Unpin.js.map +1 -0
- package/lib/commonjs/icons/index.js +39 -26
- package/lib/commonjs/icons/index.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 +4 -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 -50
- 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 +3 -3
- package/lib/commonjs/mock-builders/mock.js.map +1 -1
- package/lib/commonjs/native.js +1 -7
- 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/date.js +13 -0
- package/lib/commonjs/utils/date.js.map +1 -0
- 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 +17 -9
- 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 +18 -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 -113
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +112 -148
- 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 +21 -45
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/{CommandsItem.js → AutoCompleteSuggestionCommandIcon.js} +21 -94
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +145 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +248 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +223 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -0
- 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 -10
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +332 -247
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js +5 -5
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +7 -5
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +9 -31
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +35 -0
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -0
- 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 +5 -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 +4 -3
- 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 +89 -64
- 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 +49 -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 +16 -7
- 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 +2 -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 +12 -5
- package/lib/module/components/Chat/hooks/useIsOnline.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +90 -58
- 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 +14 -16
- 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/LoadingErrorIndicator.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 +151 -860
- 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 +39 -38
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js +8 -6
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +33 -21
- package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +122 -0
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -0
- package/lib/module/components/Message/MessageSimple/MessageReplies.js +5 -1
- package/lib/module/components/Message/MessageSimple/MessageReplies.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/MessageSimple.js +27 -13
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +25 -24
- package/lib/module/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +7 -3
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/ReactionList.js +52 -80
- package/lib/module/components/Message/MessageSimple/ReactionList.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 +170 -73
- package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.test.js +240 -0
- package/lib/module/components/Message/MessageSimple/utils/renderText.test.js.map +1 -0
- package/lib/module/components/Message/hooks/useCreateMessageContext.js +1 -5
- package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js +307 -0
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -0
- package/lib/module/components/Message/hooks/useMessageActions.js +563 -0
- package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -0
- package/lib/module/components/Message/utils/messageActions.js +17 -15
- 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 +78 -0
- package/lib/module/components/MessageInput/CooldownTimer.js.map +1 -0
- package/lib/module/components/MessageInput/FileUploadPreview.js +4 -4
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +9 -9
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +17 -22
- package/lib/module/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +93 -65
- 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 +71 -0
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -0
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +4 -3
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/module/components/MessageInput/hooks/useCooldown.js +63 -0
- package/lib/module/components/MessageInput/hooks/useCooldown.js.map +1 -0
- package/lib/module/components/MessageInput/hooks/useCountdown.js +57 -0
- package/lib/module/components/MessageInput/hooks/useCountdown.js.map +1 -0
- package/lib/module/components/MessageList/DateHeader.js +2 -2
- package/lib/module/components/MessageList/DateHeader.js.map +1 -1
- package/lib/module/components/MessageList/InlineDateSeparator.js +2 -2
- package/lib/module/components/MessageList/InlineDateSeparator.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 +77 -44
- 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 +23 -10
- 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/getDateSeparators.js +2 -1
- package/lib/module/components/MessageList/utils/getDateSeparators.js.map +1 -1
- package/lib/module/components/MessageList/utils/getGroupStyles.js +10 -5
- 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/{commonjs/components/MessageOverlay/MessageActions.js → module/components/MessageOverlay/MessageActionList.js} +33 -85
- package/lib/module/components/MessageOverlay/MessageActionList.js.map +1 -0
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +131 -0
- package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -0
- package/lib/module/components/MessageOverlay/MessageOverlay.js +97 -78
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js +38 -0
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js.map +1 -0
- package/lib/module/components/MessageOverlay/OverlayReactionList.js +12 -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 +37 -0
- package/lib/module/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -0
- 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 +11 -2
- package/lib/module/components/Thread/Thread.js.map +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +20 -12
- package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/module/components/docs/ListProps.md +1 -1
- package/lib/module/components/docs/data.js +1 -1
- package/lib/module/components/index.js +133 -55
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +68 -0
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -0
- 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 +155 -0
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -0
- package/lib/module/contexts/channelsStateContext/useChannelState.js +144 -0
- package/lib/module/contexts/channelsStateContext/useChannelState.js.map +1 -0
- 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 +122 -84
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +9 -5
- 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 +2 -2
- 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 +55 -46
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +61 -0
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js.map +1 -0
- 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 +20 -33
- 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 +45 -20
- 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/compiled.js +0 -315
- package/lib/module/emoji-data/compiled.js.map +1 -1
- package/lib/module/emoji-data/emojiNames.js +0 -105
- package/lib/module/emoji-data/emojiNames.js.map +1 -1
- package/lib/module/emoji-data/emojis.js +0 -175
- package/lib/module/emoji-data/emojis.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/i18n/en.json +9 -3
- package/lib/module/i18n/fr.json +9 -3
- package/lib/module/i18n/hi.json +9 -3
- package/lib/module/i18n/it.json +9 -3
- package/lib/module/i18n/ja.json +9 -0
- package/lib/module/i18n/ko.json +9 -0
- package/lib/module/i18n/nl.json +9 -3
- package/lib/module/i18n/ru.json +9 -3
- package/lib/module/i18n/tr.json +10 -4
- package/lib/module/icons/Pin.js +42 -0
- package/lib/module/icons/Pin.js.map +1 -0
- package/lib/module/icons/PinHeader.js +38 -0
- package/lib/module/icons/PinHeader.js.map +1 -0
- package/lib/module/icons/Unpin.js +38 -0
- package/lib/module/icons/Unpin.js.map +1 -0
- package/lib/module/icons/index.js +39 -26
- package/lib/module/icons/index.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 +4 -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 -50
- 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 +3 -3
- package/lib/module/mock-builders/mock.js.map +1 -1
- package/lib/module/native.js +1 -7
- 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/date.js +13 -0
- package/lib/module/utils/date.js.map +1 -0
- 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 +17 -9
- 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 +3 -1
- package/lib/typescript/components/Attachment/FileAttachment.d.ts +1 -1
- package/lib/typescript/components/Attachment/Gallery.d.ts +4 -6
- 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/AutoCompleteInput.d.ts +7 -1
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.d.ts +4 -0
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionHeader.d.ts +8 -0
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionItem.d.ts +10 -0
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts +21 -0
- package/lib/typescript/components/Channel/Channel.d.ts +13 -12
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +1 -68
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -126
- package/lib/typescript/components/Channel/hooks/useCreateOwnCapabilitiesContext.d.ts +7 -0
- 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/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.d.ts +12 -0
- package/lib/typescript/components/Chat/Chat.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +4 -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/Indicators/LoadingErrorIndicator.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts +4 -3
- package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageContent.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/MessagePinnedHeader.d.ts +8 -0
- package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageStatus.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageTextContainer.d.ts +1 -0
- package/lib/typescript/components/Message/MessageSimple/ReactionList.d.ts +2 -1
- 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 +18 -3
- package/lib/typescript/components/Message/MessageSimple/utils/renderText.test.d.ts +1 -0
- package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +15 -0
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +26 -0
- package/lib/typescript/components/Message/utils/messageActions.d.ts +22 -21
- 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/CooldownTimer.d.ts +10 -0
- package/lib/typescript/components/MessageInput/InputButtons.d.ts +1 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +1 -1
- package/lib/typescript/components/MessageInput/MoreOptionsButton.d.ts +1 -1
- package/lib/typescript/components/MessageInput/SendMessageDisallowedIndicator.d.ts +1 -0
- package/lib/typescript/components/MessageInput/hooks/useCooldown.d.ts +9 -0
- package/lib/typescript/components/MessageInput/hooks/useCountdown.d.ts +8 -0
- package/lib/typescript/components/MessageList/MessageList.d.ts +2 -1
- package/lib/typescript/components/MessageList/MessageSystem.d.ts +1 -1
- package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts +1 -0
- package/lib/typescript/components/MessageList/utils/getGroupStyles.d.ts +1 -1
- package/lib/typescript/components/MessageOverlay/MessageActionList.d.ts +12 -0
- package/lib/typescript/components/MessageOverlay/MessageActionListItem.d.ts +20 -0
- package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts +4 -4
- package/lib/typescript/components/MessageOverlay/OverlayBackdrop.d.ts +6 -0
- package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts +3 -1
- package/lib/typescript/components/MessageOverlay/OverlayReactionsAvatar.d.ts +7 -0
- package/lib/typescript/components/MessageOverlay/hooks/useMessageActionAnimation.d.ts +12 -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 +13 -7
- package/lib/typescript/contexts/activeChannelsRefContext/ActiveChannelsRefContext.d.ts +9 -0
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +28 -30
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +13 -5
- package/lib/typescript/contexts/channelsStateContext/ChannelsStateContext.d.ts +41 -0
- package/lib/typescript/contexts/channelsStateContext/useChannelState.d.ts +20 -0
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +2 -6
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +21 -10
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +3 -3
- package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +1 -1
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +12 -13
- 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 +23 -114
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +14 -7
- package/lib/typescript/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.d.ts +25 -0
- package/lib/typescript/contexts/suggestionsContext/SuggestionsContext.d.ts +14 -13
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +41 -16
- package/lib/typescript/contexts/utils/getDisplayName.d.ts +2 -2
- package/lib/typescript/hooks/useStreami18n.d.ts +1 -1
- package/lib/typescript/i18n/en.json +9 -3
- package/lib/typescript/i18n/fr.json +9 -3
- package/lib/typescript/i18n/hi.json +9 -3
- package/lib/typescript/i18n/it.json +9 -3
- package/lib/typescript/i18n/ja.json +9 -0
- package/lib/typescript/i18n/ko.json +9 -0
- package/lib/typescript/i18n/nl.json +9 -3
- package/lib/typescript/i18n/ru.json +9 -3
- package/lib/typescript/i18n/tr.json +10 -4
- package/lib/typescript/icons/{Left.d.ts → Pin.d.ts} +1 -1
- package/lib/typescript/icons/PinHeader.d.ts +3 -0
- package/lib/typescript/icons/{Right.d.ts → Unpin.d.ts} +1 -1
- package/lib/typescript/icons/index.d.ts +3 -2
- package/lib/typescript/native.d.ts +1 -9
- package/lib/typescript/utils/Streami18n.d.ts +11 -8
- package/lib/typescript/utils/date.d.ts +2 -0
- 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 +14 -11
- package/package.json +12 -14
- package/src/components/Attachment/Attachment.tsx +3 -3
- package/src/components/Attachment/AttachmentActions.tsx +2 -2
- package/src/components/Attachment/Card.tsx +8 -5
- package/src/components/Attachment/FileAttachment.tsx +3 -4
- package/src/components/Attachment/FileIcon.tsx +2 -2
- package/src/components/Attachment/Gallery.tsx +164 -193
- package/src/components/Attachment/Giphy.tsx +67 -70
- package/src/components/Attachment/__tests__/Attachment.test.js +22 -14
- 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 +43 -28
- package/src/components/AutoCompleteInput/{CommandsItem.tsx → AutoCompleteSuggestionCommandIcon.tsx} +3 -57
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx +109 -0
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionItem.tsx +156 -0
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +212 -0
- package/src/components/AutoCompleteInput/__tests__/AutoCompleteInput.test.js +6 -12
- package/src/components/Avatar/Avatar.tsx +7 -10
- package/src/components/Avatar/GroupAvatar.tsx +7 -21
- package/src/components/Avatar/__tests__/Avatar.test.js +2 -30
- package/src/components/Channel/Channel.tsx +288 -232
- package/src/components/Channel/__tests__/Channel.test.js +34 -29
- package/src/components/Channel/__tests__/ownCapabilities.test.js +376 -0
- package/src/components/Channel/hooks/useCreateChannelContext.ts +6 -6
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +4 -3
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +9 -30
- package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +54 -0
- package/src/components/ChannelList/ChannelList.tsx +8 -9
- package/src/components/ChannelList/ChannelListFooterLoadingIndicator.tsx +2 -3
- package/src/components/ChannelList/ChannelListHeaderErrorIndicator.tsx +3 -7
- package/src/components/ChannelList/ChannelListHeaderNetworkDownIndicator.tsx +5 -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 +86 -44
- 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 +27 -11
- 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 +8 -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 +4 -3
- package/src/components/Chat/Chat.tsx +6 -6
- package/src/components/Chat/__tests__/Chat.test.js +10 -6
- package/src/components/Chat/hooks/useIsOnline.ts +12 -8
- package/src/components/ImageGallery/ImageGallery.tsx +83 -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 +5 -7
- package/src/components/ImageGallery/components/ImageGrid.tsx +4 -5
- package/src/components/ImageGallery/components/ImageGridHandle.tsx +1 -0
- package/src/components/Indicators/LoadingErrorIndicator.tsx +1 -1
- package/src/components/Indicators/LoadingIndicator.tsx +1 -2
- package/src/components/Message/Message.tsx +155 -594
- package/src/components/Message/MessageSimple/MessageAvatar.tsx +1 -2
- package/src/components/Message/MessageSimple/MessageContent.tsx +23 -25
- package/src/components/Message/MessageSimple/MessageDeleted.tsx +8 -6
- package/src/components/Message/MessageSimple/MessageFooter.tsx +45 -27
- package/src/components/Message/MessageSimple/MessagePinnedHeader.tsx +150 -0
- package/src/components/Message/MessageSimple/MessageReplies.tsx +5 -0
- package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +2 -3
- package/src/components/Message/MessageSimple/MessageSimple.tsx +47 -26
- package/src/components/Message/MessageSimple/MessageStatus.tsx +19 -34
- package/src/components/Message/MessageSimple/MessageTextContainer.tsx +5 -0
- package/src/components/Message/MessageSimple/ReactionList.tsx +64 -77
- package/src/components/Message/MessageSimple/__tests__/Message.test.js +9 -10
- package/src/components/Message/MessageSimple/__tests__/MessageAvatar.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +40 -47
- package/src/components/Message/MessageSimple/__tests__/MessagePinnedHeader.test.js +53 -0
- 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/__tests__/__snapshots__/MessagePinnedHeader.test.js.snap +80 -0
- 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.test.tsx +70 -0
- package/src/components/Message/MessageSimple/utils/renderText.tsx +98 -58
- package/src/components/Message/hooks/useCreateMessageContext.ts +1 -7
- package/src/components/Message/hooks/useMessageActionHandlers.ts +172 -0
- package/src/components/Message/hooks/useMessageActions.tsx +386 -0
- package/src/components/Message/utils/messageActions.ts +64 -38
- 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 +67 -0
- package/src/components/MessageInput/FileUploadPreview.tsx +5 -5
- package/src/components/MessageInput/ImageUploadPreview.tsx +3 -4
- package/src/components/MessageInput/InputButtons.tsx +4 -10
- package/src/components/MessageInput/MessageInput.tsx +62 -35
- package/src/components/MessageInput/MoreOptionsButton.tsx +1 -2
- package/src/components/MessageInput/SendMessageDisallowedIndicator.tsx +47 -0
- package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx +2 -2
- package/src/components/MessageInput/__tests__/AttachButton.test.js +2 -2
- package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +43 -45
- package/src/components/MessageInput/__tests__/ImageUploadPreview.test.js +15 -15
- package/src/components/MessageInput/__tests__/MessageInput.test.js +15 -23
- 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 +3593 -2889
- package/src/components/MessageInput/__tests__/__snapshots__/ImageUploadPreview.test.js.snap +1912 -1572
- package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +539 -296
- package/src/components/MessageInput/__tests__/__snapshots__/UploadProgressIndicator.test.js.snap +4 -4
- package/src/components/MessageInput/hooks/useCooldown.ts +62 -0
- package/src/components/MessageInput/hooks/useCountdown.ts +48 -0
- package/src/components/MessageList/DateHeader.tsx +2 -2
- package/src/components/MessageList/InlineDateSeparator.tsx +2 -2
- package/src/components/MessageList/MessageList.tsx +63 -39
- package/src/components/MessageList/MessageSystem.tsx +2 -2
- package/src/components/MessageList/TypingIndicator.tsx +1 -2
- package/src/components/MessageList/__tests__/MessageList.test.js +241 -116
- 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 +19 -9
- package/src/components/MessageList/hooks/useTypingString.ts +1 -2
- package/src/components/MessageList/utils/getDateSeparators.ts +4 -3
- package/src/components/MessageList/utils/getGroupStyles.ts +14 -9
- package/src/components/MessageList/utils/getLastReceivedMessage.ts +6 -1
- package/src/components/MessageOverlay/{MessageActions.tsx → MessageActionList.tsx} +59 -91
- package/src/components/MessageOverlay/MessageActionListItem.tsx +113 -0
- package/src/components/MessageOverlay/MessageOverlay.tsx +258 -217
- package/src/components/MessageOverlay/OverlayBackdrop.tsx +18 -0
- package/src/components/MessageOverlay/OverlayReactionList.tsx +3 -5
- package/src/components/MessageOverlay/OverlayReactions.tsx +27 -8
- package/src/components/MessageOverlay/OverlayReactionsAvatar.tsx +27 -0
- package/src/components/MessageOverlay/hooks/useMessageActionAnimation.tsx +44 -0
- package/src/components/Reply/Reply.tsx +25 -15
- package/src/components/Thread/Thread.tsx +13 -6
- package/src/components/Thread/__tests__/Thread.test.js +38 -113
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +1085 -1018
- package/src/components/Thread/components/ThreadFooterComponent.tsx +14 -3
- package/src/components/docs/ListProps.md +1 -1
- package/src/components/index.ts +13 -7
- package/src/contexts/activeChannelsRefContext/ActiveChannelsRefContext.tsx +32 -0
- package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +1 -2
- package/src/contexts/channelContext/ChannelContext.tsx +28 -32
- package/src/contexts/channelsContext/ChannelsContext.tsx +18 -7
- package/src/contexts/channelsStateContext/ChannelsStateContext.tsx +286 -0
- package/src/contexts/channelsStateContext/useChannelState.ts +207 -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 +2 -10
- package/src/contexts/messageInputContext/MessageInputContext.tsx +77 -36
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +9 -7
- package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +15 -10
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +19 -28
- 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 +39 -140
- package/src/contexts/overlayContext/OverlayContext.tsx +19 -11
- package/src/contexts/overlayContext/OverlayProvider.tsx +48 -42
- package/src/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.tsx +38 -0
- package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +1 -2
- package/src/contexts/suggestionsContext/SuggestionsContext.tsx +26 -46
- package/src/contexts/suggestionsContext/__tests__/Suggestions.test.js +1 -1
- package/src/contexts/themeContext/ThemeContext.tsx +1 -0
- package/src/contexts/themeContext/utils/theme.ts +84 -35
- package/src/contexts/threadContext/ThreadContext.tsx +1 -2
- package/src/contexts/translationContext/TranslationContext.tsx +3 -3
- package/src/contexts/typingContext/TypingContext.tsx +1 -2
- package/src/contexts/utils/getDisplayName.ts +3 -1
- package/src/emoji-data/compiled.ts +1830 -9609
- package/src/emoji-data/emojiNames.ts +0 -140
- package/src/emoji-data/emojis.ts +0 -210
- package/src/emoji-data/index.js +1 -1
- package/src/hooks/useStreami18n.ts +1 -1
- package/src/i18n/en.json +9 -3
- package/src/i18n/fr.json +9 -3
- package/src/i18n/hi.json +9 -3
- package/src/i18n/it.json +9 -3
- package/src/i18n/ja.json +9 -0
- package/src/i18n/ko.json +9 -0
- package/src/i18n/nl.json +9 -3
- package/src/i18n/ru.json +9 -3
- package/src/i18n/tr.json +10 -4
- package/src/icons/Pin.tsx +17 -0
- package/src/icons/PinHeader.tsx +12 -0
- package/src/icons/Unpin.tsx +12 -0
- package/src/icons/index.ts +3 -2
- package/src/mock-builders/api/sendMessage.js +3 -1
- package/src/mock-builders/generator/attachment.js +0 -2
- package/src/mock-builders/generator/channel.js +101 -46
- package/src/mock-builders/generator/user.js +33 -26
- package/src/mock-builders/mock.js +2 -2
- package/src/native.ts +2 -13
- 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/date.ts +4 -0
- package/src/utils/getResizedImageUrl.ts +43 -0
- package/src/utils/getUrlOfImageAttachment.ts +10 -0
- package/src/utils/utils.ts +23 -16
- package/src/version.json +1 -1
- package/lib/commonjs/components/AutoCompleteInput/CommandsHeader.js +0 -78
- package/lib/commonjs/components/AutoCompleteInput/CommandsHeader.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/CommandsItem.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/EmojisHeader.js +0 -81
- package/lib/commonjs/components/AutoCompleteInput/EmojisHeader.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/EmojisItem.js +0 -75
- package/lib/commonjs/components/AutoCompleteInput/EmojisItem.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/MentionsItem.js +0 -125
- package/lib/commonjs/components/AutoCompleteInput/MentionsItem.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/SuggestionsList.js +0 -199
- package/lib/commonjs/components/AutoCompleteInput/SuggestionsList.js.map +0 -1
- package/lib/commonjs/components/MessageOverlay/MessageActions.js.map +0 -1
- package/lib/commonjs/icons/Left.js +0 -38
- package/lib/commonjs/icons/Left.js.map +0 -1
- package/lib/commonjs/icons/Right.js +0 -38
- package/lib/commonjs/icons/Right.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/CommandsHeader.js +0 -78
- package/lib/module/components/AutoCompleteInput/CommandsHeader.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/CommandsItem.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/EmojisHeader.js +0 -81
- package/lib/module/components/AutoCompleteInput/EmojisHeader.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/EmojisItem.js +0 -75
- package/lib/module/components/AutoCompleteInput/EmojisItem.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/MentionsItem.js +0 -125
- package/lib/module/components/AutoCompleteInput/MentionsItem.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/SuggestionsList.js +0 -199
- package/lib/module/components/AutoCompleteInput/SuggestionsList.js.map +0 -1
- package/lib/module/components/MessageOverlay/MessageActions.js.map +0 -1
- package/lib/module/icons/Left.js +0 -38
- package/lib/module/icons/Left.js.map +0 -1
- package/lib/module/icons/Right.js +0 -38
- package/lib/module/icons/Right.js.map +0 -1
- package/lib/typescript/components/AutoCompleteInput/CommandsHeader.d.ts +0 -2
- package/lib/typescript/components/AutoCompleteInput/CommandsItem.d.ts +0 -15
- package/lib/typescript/components/AutoCompleteInput/EmojisHeader.d.ts +0 -5
- package/lib/typescript/components/AutoCompleteInput/EmojisItem.d.ts +0 -12
- package/lib/typescript/components/AutoCompleteInput/MentionsItem.d.ts +0 -16
- package/lib/typescript/components/AutoCompleteInput/SuggestionsList.d.ts +0 -13
- package/lib/typescript/components/MessageOverlay/MessageActions.d.ts +0 -11
- package/src/components/AutoCompleteInput/CommandsHeader.tsx +0 -43
- package/src/components/AutoCompleteInput/EmojisHeader.tsx +0 -45
- package/src/components/AutoCompleteInput/EmojisItem.tsx +0 -52
- package/src/components/AutoCompleteInput/MentionsItem.tsx +0 -74
- package/src/components/AutoCompleteInput/SuggestionsList.tsx +0 -138
- package/src/components/AutoCompleteInput/__tests__/CommandsItem.test.js +0 -26
- package/src/components/AutoCompleteInput/__tests__/MentionsItem.test.js +0 -62
- package/src/components/MessageList/__tests__/__snapshots__/MessageList.test.js.snap +0 -936
- package/src/icons/Left.tsx +0 -12
- package/src/icons/Right.tsx +0 -12
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { KeyboardAvoidingViewProps, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
|
|
3
4
|
import debounce from 'lodash/debounce';
|
|
4
5
|
import throttle from 'lodash/throttle';
|
|
5
6
|
import {
|
|
@@ -15,15 +16,73 @@ import {
|
|
|
15
16
|
Message as StreamMessage,
|
|
16
17
|
} from 'stream-chat';
|
|
17
18
|
|
|
18
|
-
import { useAppStateListener } from '../../hooks/useAppStateListener';
|
|
19
19
|
import { useCreateChannelContext } from './hooks/useCreateChannelContext';
|
|
20
|
+
|
|
20
21
|
import { useCreateInputMessageInputContext } from './hooks/useCreateInputMessageInputContext';
|
|
22
|
+
|
|
21
23
|
import { useCreateMessagesContext } from './hooks/useCreateMessagesContext';
|
|
24
|
+
|
|
25
|
+
import { useCreateOwnCapabilitiesContext } from './hooks/useCreateOwnCapabilitiesContext';
|
|
22
26
|
import { useCreatePaginatedMessageListContext } from './hooks/useCreatePaginatedMessageListContext';
|
|
27
|
+
|
|
23
28
|
import { useCreateThreadContext } from './hooks/useCreateThreadContext';
|
|
29
|
+
|
|
24
30
|
import { useCreateTypingContext } from './hooks/useCreateTypingContext';
|
|
31
|
+
|
|
25
32
|
import { useTargetedMessage } from './hooks/useTargetedMessage';
|
|
26
33
|
|
|
34
|
+
import { ChannelContextValue, ChannelProvider } from '../../contexts/channelContext/ChannelContext';
|
|
35
|
+
import { useChannelState } from '../../contexts/channelsStateContext/useChannelState';
|
|
36
|
+
import type { UseChannelStateValue } from '../../contexts/channelsStateContext/useChannelState';
|
|
37
|
+
import { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';
|
|
38
|
+
import {
|
|
39
|
+
InputMessageInputContextValue,
|
|
40
|
+
MessageInputProvider,
|
|
41
|
+
} from '../../contexts/messageInputContext/MessageInputContext';
|
|
42
|
+
import {
|
|
43
|
+
MessagesContextValue,
|
|
44
|
+
MessagesProvider,
|
|
45
|
+
} from '../../contexts/messagesContext/MessagesContext';
|
|
46
|
+
import {
|
|
47
|
+
OwnCapabilitiesContextValue,
|
|
48
|
+
OwnCapabilitiesProvider,
|
|
49
|
+
} from '../../contexts/ownCapabilitiesContext/OwnCapabilitiesContext';
|
|
50
|
+
import {
|
|
51
|
+
PaginatedMessageListContextValue,
|
|
52
|
+
PaginatedMessageListProvider,
|
|
53
|
+
} from '../../contexts/paginatedMessageListContext/PaginatedMessageListContext';
|
|
54
|
+
import {
|
|
55
|
+
SuggestionsContextValue,
|
|
56
|
+
SuggestionsProvider,
|
|
57
|
+
} from '../../contexts/suggestionsContext/SuggestionsContext';
|
|
58
|
+
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
59
|
+
import { ThreadContextValue, ThreadProvider } from '../../contexts/threadContext/ThreadContext';
|
|
60
|
+
import {
|
|
61
|
+
TranslationContextValue,
|
|
62
|
+
useTranslationContext,
|
|
63
|
+
} from '../../contexts/translationContext/TranslationContext';
|
|
64
|
+
import { TypingProvider } from '../../contexts/typingContext/TypingContext';
|
|
65
|
+
import { useAppStateListener } from '../../hooks/useAppStateListener';
|
|
66
|
+
|
|
67
|
+
import {
|
|
68
|
+
LOLReaction,
|
|
69
|
+
LoveReaction,
|
|
70
|
+
ThumbsDownReaction,
|
|
71
|
+
ThumbsUpReaction,
|
|
72
|
+
WutReaction,
|
|
73
|
+
} from '../../icons';
|
|
74
|
+
import { FlatList as FlatListDefault } from '../../native';
|
|
75
|
+
import type {
|
|
76
|
+
DefaultAttachmentType,
|
|
77
|
+
DefaultChannelType,
|
|
78
|
+
DefaultCommandType,
|
|
79
|
+
DefaultEventType,
|
|
80
|
+
DefaultMessageType,
|
|
81
|
+
DefaultReactionType,
|
|
82
|
+
DefaultUserType,
|
|
83
|
+
UnknownType,
|
|
84
|
+
} from '../../types/types';
|
|
85
|
+
import { generateRandomId, MessageStatusTypes, ReactionData } from '../../utils/utils';
|
|
27
86
|
import { Attachment as AttachmentDefault } from '../Attachment/Attachment';
|
|
28
87
|
import { AttachmentActions as AttachmentActionsDefault } from '../Attachment/AttachmentActions';
|
|
29
88
|
import { Card as CardDefault } from '../Attachment/Card';
|
|
@@ -32,19 +91,22 @@ import { FileAttachmentGroup as FileAttachmentGroupDefault } from '../Attachment
|
|
|
32
91
|
import { FileIcon as FileIconDefault } from '../Attachment/FileIcon';
|
|
33
92
|
import { Gallery as GalleryDefault } from '../Attachment/Gallery';
|
|
34
93
|
import { Giphy as GiphyDefault } from '../Attachment/Giphy';
|
|
94
|
+
import { AutoCompleteSuggestionHeader as AutoCompleteSuggestionHeaderDefault } from '../AutoCompleteInput/AutoCompleteSuggestionHeader';
|
|
95
|
+
import { AutoCompleteSuggestionItem as AutoCompleteSuggestionItemDefault } from '../AutoCompleteInput/AutoCompleteSuggestionItem';
|
|
96
|
+
import { AutoCompleteSuggestionList as AutoCompleteSuggestionListDefault } from '../AutoCompleteInput/AutoCompleteSuggestionList';
|
|
35
97
|
import { EmptyStateIndicator as EmptyStateIndicatorDefault } from '../Indicators/EmptyStateIndicator';
|
|
36
98
|
import {
|
|
37
99
|
LoadingErrorIndicator as LoadingErrorIndicatorDefault,
|
|
38
100
|
LoadingErrorProps,
|
|
39
101
|
} from '../Indicators/LoadingErrorIndicator';
|
|
40
102
|
import { LoadingIndicator as LoadingIndicatorDefault } from '../Indicators/LoadingIndicator';
|
|
41
|
-
import { NetworkDownIndicator as NetworkDownIndicatorDefault } from '../MessageList/NetworkDownIndicator';
|
|
42
103
|
import { KeyboardCompatibleView as KeyboardCompatibleViewDefault } from '../KeyboardCompatibleView/KeyboardCompatibleView';
|
|
43
104
|
import { Message as MessageDefault } from '../Message/Message';
|
|
44
105
|
import { MessageAvatar as MessageAvatarDefault } from '../Message/MessageSimple/MessageAvatar';
|
|
45
106
|
import { MessageContent as MessageContentDefault } from '../Message/MessageSimple/MessageContent';
|
|
46
107
|
import { MessageDeleted as MessageDeletedDefault } from '../Message/MessageSimple/MessageDeleted';
|
|
47
108
|
import { MessageFooter as MessageFooterDefault } from '../Message/MessageSimple/MessageFooter';
|
|
109
|
+
import { MessagePinnedHeader as MessagePinnedHeaderDefault } from '../Message/MessageSimple/MessagePinnedHeader';
|
|
48
110
|
import { MessageReplies as MessageRepliesDefault } from '../Message/MessageSimple/MessageReplies';
|
|
49
111
|
import { MessageRepliesAvatars as MessageRepliesAvatarsDefault } from '../Message/MessageSimple/MessageRepliesAvatars';
|
|
50
112
|
import { MessageSimple as MessageSimpleDefault } from '../Message/MessageSimple/MessageSimple';
|
|
@@ -52,78 +114,28 @@ import { MessageStatus as MessageStatusDefault } from '../Message/MessageSimple/
|
|
|
52
114
|
import { ReactionList as ReactionListDefault } from '../Message/MessageSimple/ReactionList';
|
|
53
115
|
import { AttachButton as AttachButtonDefault } from '../MessageInput/AttachButton';
|
|
54
116
|
import { CommandsButton as CommandsButtonDefault } from '../MessageInput/CommandsButton';
|
|
117
|
+
import { CooldownTimer as CooldownTimerDefault } from '../MessageInput/CooldownTimer';
|
|
55
118
|
import { FileUploadPreview as FileUploadPreviewDefault } from '../MessageInput/FileUploadPreview';
|
|
56
119
|
import { ImageUploadPreview as ImageUploadPreviewDefault } from '../MessageInput/ImageUploadPreview';
|
|
57
120
|
import { InputButtons as InputButtonsDefault } from '../MessageInput/InputButtons';
|
|
58
121
|
import { MoreOptionsButton as MoreOptionsButtonDefault } from '../MessageInput/MoreOptionsButton';
|
|
59
122
|
import { SendButton as SendButtonDefault } from '../MessageInput/SendButton';
|
|
123
|
+
import { SendMessageDisallowedIndicator as SendMessageDisallowedIndicatorDefault } from '../MessageInput/SendMessageDisallowedIndicator';
|
|
60
124
|
import { ShowThreadMessageInChannelButton as ShowThreadMessageInChannelButtonDefault } from '../MessageInput/ShowThreadMessageInChannelButton';
|
|
61
125
|
import { UploadProgressIndicator as UploadProgressIndicatorDefault } from '../MessageInput/UploadProgressIndicator';
|
|
62
126
|
import { DateHeader as DateHeaderDefault } from '../MessageList/DateHeader';
|
|
127
|
+
import type { MessageType } from '../MessageList/hooks/useMessageList';
|
|
63
128
|
import { InlineDateSeparator as InlineDateSeparatorDefault } from '../MessageList/InlineDateSeparator';
|
|
64
129
|
import { InlineUnreadIndicator as InlineUnreadIndicatorDefault } from '../MessageList/InlineUnreadIndicator';
|
|
65
130
|
import { MessageList as MessageListDefault } from '../MessageList/MessageList';
|
|
66
131
|
import { MessageSystem as MessageSystemDefault } from '../MessageList/MessageSystem';
|
|
132
|
+
import { NetworkDownIndicator as NetworkDownIndicatorDefault } from '../MessageList/NetworkDownIndicator';
|
|
67
133
|
import { ScrollToBottomButton as ScrollToBottomButtonDefault } from '../MessageList/ScrollToBottomButton';
|
|
68
134
|
import { TypingIndicator as TypingIndicatorDefault } from '../MessageList/TypingIndicator';
|
|
69
135
|
import { TypingIndicatorContainer as TypingIndicatorContainerDefault } from '../MessageList/TypingIndicatorContainer';
|
|
70
136
|
import { OverlayReactionList as OverlayReactionListDefault } from '../MessageOverlay/OverlayReactionList';
|
|
71
137
|
import { Reply as ReplyDefault } from '../Reply/Reply';
|
|
72
138
|
|
|
73
|
-
import {
|
|
74
|
-
ChannelConfig,
|
|
75
|
-
ChannelContextValue,
|
|
76
|
-
ChannelProvider,
|
|
77
|
-
} from '../../contexts/channelContext/ChannelContext';
|
|
78
|
-
import { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';
|
|
79
|
-
import {
|
|
80
|
-
InputConfig,
|
|
81
|
-
InputMessageInputContextValue,
|
|
82
|
-
MessageInputProvider,
|
|
83
|
-
} from '../../contexts/messageInputContext/MessageInputContext';
|
|
84
|
-
import {
|
|
85
|
-
MessagesConfig,
|
|
86
|
-
MessagesContextValue,
|
|
87
|
-
MessagesProvider,
|
|
88
|
-
} from '../../contexts/messagesContext/MessagesContext';
|
|
89
|
-
import {
|
|
90
|
-
PaginatedMessageListContextValue,
|
|
91
|
-
PaginatedMessageListProvider,
|
|
92
|
-
} from '../../contexts/paginatedMessageListContext/PaginatedMessageListContext';
|
|
93
|
-
import {
|
|
94
|
-
SuggestionsContextValue,
|
|
95
|
-
SuggestionsProvider,
|
|
96
|
-
} from '../../contexts/suggestionsContext/SuggestionsContext';
|
|
97
|
-
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
98
|
-
import { ThreadContextValue, ThreadProvider } from '../../contexts/threadContext/ThreadContext';
|
|
99
|
-
import {
|
|
100
|
-
TranslationContextValue,
|
|
101
|
-
useTranslationContext,
|
|
102
|
-
} from '../../contexts/translationContext/TranslationContext';
|
|
103
|
-
import { TypingContextValue, TypingProvider } from '../../contexts/typingContext/TypingContext';
|
|
104
|
-
import {
|
|
105
|
-
LOLReaction,
|
|
106
|
-
LoveReaction,
|
|
107
|
-
ThumbsDownReaction,
|
|
108
|
-
ThumbsUpReaction,
|
|
109
|
-
WutReaction,
|
|
110
|
-
} from '../../icons';
|
|
111
|
-
import { FlatList as FlatListDefault } from '../../native';
|
|
112
|
-
import { generateRandomId, ReactionData } from '../../utils/utils';
|
|
113
|
-
|
|
114
|
-
import type { MessageType } from '../MessageList/hooks/useMessageList';
|
|
115
|
-
|
|
116
|
-
import type {
|
|
117
|
-
DefaultAttachmentType,
|
|
118
|
-
DefaultChannelType,
|
|
119
|
-
DefaultCommandType,
|
|
120
|
-
DefaultEventType,
|
|
121
|
-
DefaultMessageType,
|
|
122
|
-
DefaultReactionType,
|
|
123
|
-
DefaultUserType,
|
|
124
|
-
UnknownType,
|
|
125
|
-
} from '../../types/types';
|
|
126
|
-
|
|
127
139
|
const styles = StyleSheet.create({
|
|
128
140
|
selectChannel: { fontWeight: 'bold', padding: 16 },
|
|
129
141
|
});
|
|
@@ -182,22 +194,22 @@ export type ChannelPropsWithContext<
|
|
|
182
194
|
Me extends UnknownType = DefaultMessageType,
|
|
183
195
|
Re extends UnknownType = DefaultReactionType,
|
|
184
196
|
Us extends UnknownType = DefaultUserType,
|
|
185
|
-
> =
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
> &
|
|
197
|
+
> = Pick<ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'channel'> &
|
|
198
|
+
Partial<
|
|
199
|
+
Pick<
|
|
200
|
+
ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>,
|
|
201
|
+
| 'EmptyStateIndicator'
|
|
202
|
+
| 'enableMessageGroupingByUser'
|
|
203
|
+
| 'enforceUniqueReaction'
|
|
204
|
+
| 'giphyEnabled'
|
|
205
|
+
| 'hideStickyDateHeader'
|
|
206
|
+
| 'hideDateSeparators'
|
|
207
|
+
| 'LoadingIndicator'
|
|
208
|
+
| 'maxTimeBetweenGroupedMessages'
|
|
209
|
+
| 'NetworkDownIndicator'
|
|
210
|
+
| 'StickyHeader'
|
|
211
|
+
>
|
|
212
|
+
> &
|
|
201
213
|
Pick<ChatContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'client'> &
|
|
202
214
|
Partial<
|
|
203
215
|
Omit<
|
|
@@ -205,7 +217,12 @@ export type ChannelPropsWithContext<
|
|
|
205
217
|
'quotedMessage' | 'editing' | 'clearEditingState' | 'clearQuotedMessageState' | 'sendMessage'
|
|
206
218
|
>
|
|
207
219
|
> &
|
|
208
|
-
Partial<
|
|
220
|
+
Partial<
|
|
221
|
+
Pick<
|
|
222
|
+
SuggestionsContextValue<Co, Us>,
|
|
223
|
+
'AutoCompleteSuggestionHeader' | 'AutoCompleteSuggestionItem' | 'AutoCompleteSuggestionList'
|
|
224
|
+
>
|
|
225
|
+
> &
|
|
209
226
|
Pick<TranslationContextValue, 't'> &
|
|
210
227
|
Partial<
|
|
211
228
|
Pick<
|
|
@@ -213,28 +230,24 @@ export type ChannelPropsWithContext<
|
|
|
213
230
|
'messages' | 'loadingMore' | 'loadingMoreRecent'
|
|
214
231
|
>
|
|
215
232
|
> &
|
|
233
|
+
UseChannelStateValue<At, Ch, Co, Ev, Me, Re, Us> &
|
|
216
234
|
Partial<
|
|
217
235
|
Pick<
|
|
218
236
|
MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>,
|
|
219
237
|
| 'additionalTouchableProps'
|
|
220
|
-
| 'animatedLongPress'
|
|
221
238
|
| 'Attachment'
|
|
222
239
|
| 'AttachmentActions'
|
|
223
|
-
| 'blockUser'
|
|
224
240
|
| 'Card'
|
|
225
241
|
| 'CardCover'
|
|
226
242
|
| 'CardFooter'
|
|
227
243
|
| 'CardHeader'
|
|
228
|
-
| 'copyMessage'
|
|
229
244
|
| 'DateHeader'
|
|
230
|
-
| '
|
|
245
|
+
| 'deletedMessagesVisibilityType'
|
|
231
246
|
| 'disableTypingIndicator'
|
|
232
247
|
| 'dismissKeyboardOnMessageTouch'
|
|
233
|
-
| 'editMessage'
|
|
234
248
|
| 'FileAttachment'
|
|
235
249
|
| 'FileAttachmentIcon'
|
|
236
250
|
| 'FileAttachmentGroup'
|
|
237
|
-
| 'flagMessage'
|
|
238
251
|
| 'FlatList'
|
|
239
252
|
| 'forceAlignMessages'
|
|
240
253
|
| 'formatDate'
|
|
@@ -246,6 +259,7 @@ export type ChannelPropsWithContext<
|
|
|
246
259
|
| 'handleEdit'
|
|
247
260
|
| 'handleFlag'
|
|
248
261
|
| 'handleMute'
|
|
262
|
+
| 'handlePinMessage'
|
|
249
263
|
| 'handleReaction'
|
|
250
264
|
| 'handleQuotedReply'
|
|
251
265
|
| 'handleRetry'
|
|
@@ -263,27 +277,23 @@ export type ChannelPropsWithContext<
|
|
|
263
277
|
| 'MessageFooter'
|
|
264
278
|
| 'MessageHeader'
|
|
265
279
|
| 'MessageList'
|
|
280
|
+
| 'MessagePinnedHeader'
|
|
266
281
|
| 'MessageReplies'
|
|
267
282
|
| 'MessageRepliesAvatars'
|
|
268
283
|
| 'MessageSimple'
|
|
269
284
|
| 'MessageStatus'
|
|
270
285
|
| 'MessageSystem'
|
|
271
286
|
| 'MessageText'
|
|
272
|
-
| 'muteUser'
|
|
273
287
|
| 'myMessageTheme'
|
|
274
|
-
| 'onDoubleTapMessage'
|
|
275
288
|
| 'onLongPressMessage'
|
|
276
289
|
| 'onPressInMessage'
|
|
277
290
|
| 'onPressMessage'
|
|
278
291
|
| 'OverlayReactionList'
|
|
279
|
-
| 'quotedReply'
|
|
280
292
|
| 'ReactionList'
|
|
281
293
|
| 'Reply'
|
|
282
|
-
| 'retry'
|
|
283
294
|
| 'ScrollToBottomButton'
|
|
284
295
|
| 'selectReaction'
|
|
285
296
|
| 'supportedReactions'
|
|
286
|
-
| 'threadReply'
|
|
287
297
|
| 'TypingIndicator'
|
|
288
298
|
| 'TypingIndicatorContainer'
|
|
289
299
|
| 'UrlPreview'
|
|
@@ -292,6 +302,7 @@ export type ChannelPropsWithContext<
|
|
|
292
302
|
Partial<
|
|
293
303
|
Pick<ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'allowThreadMessagesInChannel' | 'thread'>
|
|
294
304
|
> & {
|
|
305
|
+
shouldSyncChannel: boolean;
|
|
295
306
|
/**
|
|
296
307
|
* Additional props passed to keyboard avoiding view
|
|
297
308
|
*/
|
|
@@ -369,15 +380,13 @@ export type ChannelPropsWithContext<
|
|
|
369
380
|
LoadingErrorIndicator?: React.ComponentType<LoadingErrorProps>;
|
|
370
381
|
maxMessageLength?: number;
|
|
371
382
|
messageId?: string;
|
|
372
|
-
mutesEnabled?: boolean;
|
|
373
383
|
newMessageStateUpdateThrottleInterval?: number;
|
|
374
|
-
|
|
375
|
-
reactionsEnabled?: boolean;
|
|
376
|
-
readEventsEnabled?: boolean;
|
|
384
|
+
overrideOwnCapabilities?: OwnCapabilitiesContextValue;
|
|
377
385
|
stateUpdateThrottleInterval?: number;
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
386
|
+
/**
|
|
387
|
+
* Tells if channel is rendering a thread list
|
|
388
|
+
*/
|
|
389
|
+
threadList?: boolean;
|
|
381
390
|
};
|
|
382
391
|
|
|
383
392
|
const ChannelWithContext = <
|
|
@@ -394,15 +403,16 @@ const ChannelWithContext = <
|
|
|
394
403
|
const {
|
|
395
404
|
additionalKeyboardAvoidingViewProps,
|
|
396
405
|
additionalTextInputProps,
|
|
397
|
-
animatedLongPress,
|
|
398
406
|
additionalTouchableProps,
|
|
399
407
|
allowThreadMessagesInChannel = true,
|
|
400
408
|
AttachButton = AttachButtonDefault,
|
|
401
409
|
Attachment = AttachmentDefault,
|
|
402
410
|
AttachmentActions = AttachmentActionsDefault,
|
|
411
|
+
AutoCompleteSuggestionHeader = AutoCompleteSuggestionHeaderDefault,
|
|
412
|
+
AutoCompleteSuggestionItem = AutoCompleteSuggestionItemDefault,
|
|
413
|
+
AutoCompleteSuggestionList = AutoCompleteSuggestionListDefault,
|
|
403
414
|
autoCompleteSuggestionsLimit,
|
|
404
415
|
autoCompleteTriggerSettings,
|
|
405
|
-
blockUser,
|
|
406
416
|
Card = CardDefault,
|
|
407
417
|
CardCover,
|
|
408
418
|
CardFooter,
|
|
@@ -410,12 +420,11 @@ const ChannelWithContext = <
|
|
|
410
420
|
channel,
|
|
411
421
|
children,
|
|
412
422
|
client,
|
|
413
|
-
closeSuggestions,
|
|
414
423
|
CommandsButton = CommandsButtonDefault,
|
|
415
424
|
compressImageQuality,
|
|
416
|
-
|
|
425
|
+
CooldownTimer = CooldownTimerDefault,
|
|
417
426
|
DateHeader = DateHeaderDefault,
|
|
418
|
-
|
|
427
|
+
deletedMessagesVisibilityType = 'always',
|
|
419
428
|
disableIfFrozenChannel = true,
|
|
420
429
|
disableKeyboardCompatibleView = false,
|
|
421
430
|
disableTypingIndicator,
|
|
@@ -425,15 +434,13 @@ const ChannelWithContext = <
|
|
|
425
434
|
doMarkReadRequest,
|
|
426
435
|
doSendMessageRequest,
|
|
427
436
|
doUpdateMessageRequest,
|
|
428
|
-
editMessage: editMessageProp,
|
|
429
437
|
EmptyStateIndicator = EmptyStateIndicatorDefault,
|
|
430
438
|
enableMessageGroupingByUser = true,
|
|
431
439
|
enforceUniqueReaction = false,
|
|
432
440
|
FileAttachment = FileAttachmentDefault,
|
|
433
|
-
FileAttachmentIcon = FileIconDefault,
|
|
434
441
|
FileAttachmentGroup = FileAttachmentGroupDefault,
|
|
442
|
+
FileAttachmentIcon = FileIconDefault,
|
|
435
443
|
FileUploadPreview = FileUploadPreviewDefault,
|
|
436
|
-
flagMessage,
|
|
437
444
|
FlatList = FlatListDefault,
|
|
438
445
|
forceAlignMessages,
|
|
439
446
|
formatDate,
|
|
@@ -447,6 +454,7 @@ const ChannelWithContext = <
|
|
|
447
454
|
handleEdit,
|
|
448
455
|
handleFlag,
|
|
449
456
|
handleMute,
|
|
457
|
+
handlePinMessage,
|
|
450
458
|
handleQuotedReply,
|
|
451
459
|
handleReaction,
|
|
452
460
|
handleRetry,
|
|
@@ -466,19 +474,18 @@ const ChannelWithContext = <
|
|
|
466
474
|
keyboardBehavior,
|
|
467
475
|
KeyboardCompatibleView = KeyboardCompatibleViewDefault,
|
|
468
476
|
keyboardVerticalOffset,
|
|
469
|
-
|
|
470
|
-
legacyImageViewerSwipeBehaviour = true,
|
|
477
|
+
legacyImageViewerSwipeBehaviour = false,
|
|
471
478
|
LoadingErrorIndicator = LoadingErrorIndicatorDefault,
|
|
472
479
|
LoadingIndicator = LoadingIndicatorDefault,
|
|
473
480
|
loadingMore: loadingMoreProp,
|
|
474
481
|
loadingMoreRecent: loadingMoreRecentProp,
|
|
475
482
|
markdownRules,
|
|
476
|
-
messageId,
|
|
477
483
|
maxMessageLength: maxMessageLengthProp,
|
|
478
484
|
maxNumberOfFiles = 10,
|
|
479
485
|
maxTimeBetweenGroupedMessages,
|
|
480
486
|
mentionAllAppUsersEnabled = false,
|
|
481
487
|
mentionAllAppUsersQuery,
|
|
488
|
+
members,
|
|
482
489
|
Message = MessageDefault,
|
|
483
490
|
messageActions,
|
|
484
491
|
MessageAvatar = MessageAvatarDefault,
|
|
@@ -487,55 +494,59 @@ const ChannelWithContext = <
|
|
|
487
494
|
MessageDeleted = MessageDeletedDefault,
|
|
488
495
|
MessageFooter = MessageFooterDefault,
|
|
489
496
|
MessageHeader,
|
|
497
|
+
messageId,
|
|
490
498
|
MessageList = MessageListDefault,
|
|
499
|
+
MessagePinnedHeader = MessagePinnedHeaderDefault,
|
|
491
500
|
MessageReplies = MessageRepliesDefault,
|
|
492
501
|
MessageRepliesAvatars = MessageRepliesAvatarsDefault,
|
|
493
|
-
messages
|
|
502
|
+
messages,
|
|
494
503
|
MessageSimple = MessageSimpleDefault,
|
|
495
504
|
MessageStatus = MessageStatusDefault,
|
|
496
505
|
MessageSystem = MessageSystemDefault,
|
|
497
506
|
MessageText,
|
|
498
507
|
MoreOptionsButton = MoreOptionsButtonDefault,
|
|
499
|
-
mutesEnabled: mutesEnabledProp,
|
|
500
|
-
muteUser,
|
|
501
508
|
myMessageTheme,
|
|
502
509
|
newMessageStateUpdateThrottleInterval = defaultThrottleInterval,
|
|
503
510
|
NetworkDownIndicator = NetworkDownIndicatorDefault,
|
|
504
511
|
numberOfLines = 5,
|
|
505
512
|
onChangeText,
|
|
506
|
-
onDoubleTapMessage,
|
|
507
513
|
onLongPressMessage,
|
|
508
|
-
|
|
514
|
+
overrideOwnCapabilities,
|
|
509
515
|
onPressInMessage,
|
|
510
|
-
|
|
516
|
+
onPressMessage,
|
|
511
517
|
OverlayReactionList = OverlayReactionListDefault,
|
|
512
|
-
quotedRepliesEnabled: quotedRepliesEnabledProp,
|
|
513
|
-
quotedReply,
|
|
514
518
|
ReactionList = ReactionListDefault,
|
|
515
|
-
|
|
516
|
-
readEventsEnabled: readEventsEnabledProp,
|
|
519
|
+
read,
|
|
517
520
|
Reply = ReplyDefault,
|
|
518
|
-
retry,
|
|
519
521
|
ScrollToBottomButton = ScrollToBottomButtonDefault,
|
|
520
522
|
selectReaction,
|
|
521
523
|
SendButton = SendButtonDefault,
|
|
524
|
+
SendMessageDisallowedIndicator = SendMessageDisallowedIndicatorDefault,
|
|
522
525
|
sendImageAsync = false,
|
|
523
526
|
setInputRef,
|
|
527
|
+
setMembers,
|
|
528
|
+
setMessages,
|
|
529
|
+
setRead,
|
|
530
|
+
setThreadMessages,
|
|
531
|
+
setTyping,
|
|
532
|
+
setWatcherCount,
|
|
533
|
+
setWatchers,
|
|
534
|
+
shouldSyncChannel,
|
|
524
535
|
ShowThreadMessageInChannelButton = ShowThreadMessageInChannelButtonDefault,
|
|
525
536
|
stateUpdateThrottleInterval = defaultThrottleInterval,
|
|
526
537
|
StickyHeader,
|
|
527
538
|
supportedReactions = reactionData,
|
|
528
539
|
t,
|
|
529
540
|
thread: threadProps,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
541
|
+
threadList,
|
|
542
|
+
threadMessages,
|
|
543
|
+
typing,
|
|
533
544
|
TypingIndicator = TypingIndicatorDefault,
|
|
534
545
|
TypingIndicatorContainer = TypingIndicatorContainerDefault,
|
|
535
|
-
updateSuggestions,
|
|
536
546
|
UploadProgressIndicator = UploadProgressIndicatorDefault,
|
|
537
|
-
uploadsEnabled: uploadsEnabledProp,
|
|
538
547
|
UrlPreview = CardDefault,
|
|
548
|
+
watcherCount,
|
|
549
|
+
watchers,
|
|
539
550
|
} = props;
|
|
540
551
|
|
|
541
552
|
const {
|
|
@@ -546,48 +557,30 @@ const ChannelWithContext = <
|
|
|
546
557
|
} = useTheme();
|
|
547
558
|
const [deleted, setDeleted] = useState(false);
|
|
548
559
|
const [editing, setEditing] = useState<boolean | MessageType<At, Ch, Co, Ev, Me, Re, Us>>(false);
|
|
549
|
-
const [error, setError] = useState(false);
|
|
560
|
+
const [error, setError] = useState<Error | boolean>(false);
|
|
550
561
|
const [hasMore, setHasMore] = useState(true);
|
|
551
562
|
const [lastRead, setLastRead] =
|
|
552
563
|
useState<ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['lastRead']>();
|
|
553
|
-
const [loading, setLoading] = useState(
|
|
564
|
+
const [loading, setLoading] = useState(!channel?.state.messages.length);
|
|
554
565
|
const [loadingMore, setLoadingMore] = useState(false);
|
|
555
566
|
|
|
556
567
|
const [loadingMoreRecent, setLoadingMoreRecent] = useState(false);
|
|
557
|
-
const [messages, setMessages] = useState<
|
|
558
|
-
PaginatedMessageListContextValue<At, Ch, Co, Ev, Me, Re, Us>['messages']
|
|
559
|
-
>([]);
|
|
560
|
-
|
|
561
|
-
const [members, setMembers] = useState<
|
|
562
|
-
ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['members']
|
|
563
|
-
>({});
|
|
564
568
|
const [quotedMessage, setQuotedMessage] =
|
|
565
569
|
useState<boolean | MessageType<At, Ch, Co, Ev, Me, Re, Us>>(false);
|
|
566
|
-
const [read, setRead] = useState<ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['read']>({});
|
|
567
570
|
const [thread, setThread] = useState<ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>['thread']>(
|
|
568
571
|
threadProps || null,
|
|
569
572
|
);
|
|
570
573
|
const [threadHasMore, setThreadHasMore] = useState(true);
|
|
571
574
|
const [threadLoadingMore, setThreadLoadingMore] = useState(false);
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
>((threadProps?.id && channel?.state?.threads?.[threadProps.id]) || []);
|
|
575
|
-
const [typing, setTyping] = useState<TypingContextValue<At, Ch, Co, Ev, Me, Re, Us>['typing']>(
|
|
576
|
-
{},
|
|
577
|
-
);
|
|
578
|
-
const [watcherCount, setWatcherCount] =
|
|
579
|
-
useState<ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['watcherCount']>();
|
|
580
|
-
const [watchers, setWatchers] = useState<
|
|
581
|
-
ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['watchers']
|
|
582
|
-
>({});
|
|
575
|
+
|
|
576
|
+
const [syncingChannel, setSyncingChannel] = useState(false);
|
|
583
577
|
|
|
584
578
|
const { setTargetedMessage, targetedMessage } = useTargetedMessage(messageId);
|
|
585
579
|
|
|
586
580
|
const channelId = channel?.id || '';
|
|
587
581
|
useEffect(() => {
|
|
588
582
|
const initChannel = () => {
|
|
589
|
-
if (!channel) return;
|
|
590
|
-
|
|
583
|
+
if (!channel || !shouldSyncChannel) return;
|
|
591
584
|
/**
|
|
592
585
|
* Loading channel at first unread message requires channel to be initialized in the first place,
|
|
593
586
|
* since we use read state on channel to decide what offset to load channel at.
|
|
@@ -627,7 +620,7 @@ const ChannelWithContext = <
|
|
|
627
620
|
|
|
628
621
|
const threadPropsExists = !!threadProps;
|
|
629
622
|
useEffect(() => {
|
|
630
|
-
if (threadProps) {
|
|
623
|
+
if (threadProps && shouldSyncChannel) {
|
|
631
624
|
setThread(threadProps);
|
|
632
625
|
if (channel && threadProps?.id) {
|
|
633
626
|
setThreadMessages(channel.state.threads?.[threadProps.id] || []);
|
|
@@ -740,7 +733,7 @@ const ChannelWithContext = <
|
|
|
740
733
|
).current;
|
|
741
734
|
|
|
742
735
|
const connectionRecoveredHandler = () => {
|
|
743
|
-
if (channel) {
|
|
736
|
+
if (channel && shouldSyncChannel) {
|
|
744
737
|
copyChannelState();
|
|
745
738
|
if (thread) {
|
|
746
739
|
setThreadMessages([...channel.state.threads[thread.id]]);
|
|
@@ -749,31 +742,33 @@ const ChannelWithContext = <
|
|
|
749
742
|
};
|
|
750
743
|
|
|
751
744
|
const connectionChangedHandler = (event: ConnectionChangeEvent) => {
|
|
752
|
-
if (event.online) {
|
|
745
|
+
if (event.online && shouldSyncChannel) {
|
|
753
746
|
resyncChannel();
|
|
754
747
|
}
|
|
755
748
|
};
|
|
756
749
|
|
|
757
750
|
const handleEvent: EventHandler<At, Ch, Co, Ev, Me, Re, Us> = (event) => {
|
|
758
|
-
if (
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
751
|
+
if (shouldSyncChannel) {
|
|
752
|
+
if (thread) {
|
|
753
|
+
const updatedThreadMessages =
|
|
754
|
+
(thread.id && channel && channel.state.threads[thread.id]) || threadMessages;
|
|
755
|
+
setThreadMessages(updatedThreadMessages);
|
|
756
|
+
}
|
|
763
757
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
758
|
+
if (channel && thread && event.message?.id === thread.id) {
|
|
759
|
+
const updatedThread = channel.state.formatMessage(event.message);
|
|
760
|
+
setThread(updatedThread);
|
|
761
|
+
}
|
|
768
762
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
763
|
+
if (event.type === 'typing.start' || event.type === 'typing.stop') {
|
|
764
|
+
copyTypingState();
|
|
765
|
+
} else if (event.type === 'message.read') {
|
|
766
|
+
copyReadState();
|
|
767
|
+
} else if (event.type === 'message.new') {
|
|
768
|
+
copyMessagesState();
|
|
769
|
+
} else if (channel) {
|
|
770
|
+
copyChannelState();
|
|
771
|
+
}
|
|
777
772
|
}
|
|
778
773
|
};
|
|
779
774
|
|
|
@@ -806,11 +801,12 @@ const ChannelWithContext = <
|
|
|
806
801
|
clientSubscriptions.forEach((s) => s.unsubscribe());
|
|
807
802
|
channelSubscriptions.forEach((s) => s.unsubscribe());
|
|
808
803
|
};
|
|
809
|
-
}, [channelId, connectionRecoveredHandler, handleEvent]);
|
|
804
|
+
}, [channelId, connectionChangedHandler, connectionRecoveredHandler, handleEvent]);
|
|
810
805
|
|
|
811
806
|
const channelQueryCall = async (queryCall: () => void = () => null) => {
|
|
812
807
|
setError(false);
|
|
813
|
-
|
|
808
|
+
// Skips setting loading state when there are messages in the channel
|
|
809
|
+
setLoading(!channel?.state.messages.length);
|
|
814
810
|
|
|
815
811
|
try {
|
|
816
812
|
await queryCall();
|
|
@@ -818,7 +814,11 @@ const ChannelWithContext = <
|
|
|
818
814
|
setHasMore(true);
|
|
819
815
|
copyChannelState();
|
|
820
816
|
} catch (err) {
|
|
821
|
-
|
|
817
|
+
if (err instanceof Error) {
|
|
818
|
+
setError(err);
|
|
819
|
+
} else {
|
|
820
|
+
setError(true);
|
|
821
|
+
}
|
|
822
822
|
setLoading(false);
|
|
823
823
|
setLastRead(new Date());
|
|
824
824
|
}
|
|
@@ -954,22 +954,33 @@ const ChannelWithContext = <
|
|
|
954
954
|
const limit = 50;
|
|
955
955
|
channel.state.threads[parentID] = [];
|
|
956
956
|
const queryResponse = await channel.getReplies(parentID, {
|
|
957
|
-
limit
|
|
957
|
+
limit,
|
|
958
958
|
});
|
|
959
959
|
|
|
960
960
|
const updatedHasMore = queryResponse.messages.length === limit;
|
|
961
961
|
const updatedThreadMessages = channel.state.threads[parentID] || [];
|
|
962
962
|
loadMoreThreadFinished(updatedHasMore, updatedThreadMessages);
|
|
963
|
+
const { messages } = await channel.getMessagesById([parentID]);
|
|
964
|
+
const [threadMessage] = messages;
|
|
965
|
+
if (threadMessage) {
|
|
966
|
+
const formattedMessage = channel.state.formatMessage(threadMessage);
|
|
967
|
+
setThread(formattedMessage);
|
|
968
|
+
}
|
|
963
969
|
} catch (err) {
|
|
964
970
|
console.warn('Thread loading request failed with error', err);
|
|
965
|
-
|
|
971
|
+
if (err instanceof Error) {
|
|
972
|
+
setError(err);
|
|
973
|
+
} else {
|
|
974
|
+
setError(true);
|
|
975
|
+
}
|
|
966
976
|
setThreadLoadingMore(false);
|
|
967
977
|
throw err;
|
|
968
978
|
}
|
|
969
979
|
};
|
|
970
980
|
|
|
971
981
|
const resyncChannel = async () => {
|
|
972
|
-
if (!channel) return;
|
|
982
|
+
if (!channel || syncingChannel) return;
|
|
983
|
+
setSyncingChannel(true);
|
|
973
984
|
|
|
974
985
|
setError(false);
|
|
975
986
|
try {
|
|
@@ -1013,11 +1024,13 @@ const ChannelWithContext = <
|
|
|
1013
1024
|
} as unknown as MessageResponse<At, Ch, Co, Me, Re, Us>);
|
|
1014
1025
|
|
|
1015
1026
|
const failedMessages = messages
|
|
1016
|
-
.filter((message) => message.status ===
|
|
1027
|
+
.filter((message) => message.status === MessageStatusTypes.FAILED)
|
|
1017
1028
|
.map(parseMessage);
|
|
1018
1029
|
|
|
1019
1030
|
const failedThreadMessages = thread
|
|
1020
|
-
? threadMessages
|
|
1031
|
+
? threadMessages
|
|
1032
|
+
.filter((message) => message.status === MessageStatusTypes.FAILED)
|
|
1033
|
+
.map(parseMessage)
|
|
1021
1034
|
: [];
|
|
1022
1035
|
|
|
1023
1036
|
const oldListTopMessageCreatedAt = oldListTopMessage.created_at;
|
|
@@ -1064,9 +1077,15 @@ const ChannelWithContext = <
|
|
|
1064
1077
|
setThreadMessages([...channel.state.threads[thread.id]]);
|
|
1065
1078
|
}
|
|
1066
1079
|
} catch (err) {
|
|
1067
|
-
|
|
1080
|
+
if (err instanceof Error) {
|
|
1081
|
+
setError(err);
|
|
1082
|
+
} else {
|
|
1083
|
+
setError(true);
|
|
1084
|
+
}
|
|
1068
1085
|
setLoading(false);
|
|
1069
1086
|
}
|
|
1087
|
+
|
|
1088
|
+
setSyncingChannel(false);
|
|
1070
1089
|
};
|
|
1071
1090
|
|
|
1072
1091
|
const reloadChannel = () =>
|
|
@@ -1185,24 +1204,6 @@ const ChannelWithContext = <
|
|
|
1185
1204
|
*/
|
|
1186
1205
|
const clientChannelConfig = getChannelConfigSafely();
|
|
1187
1206
|
|
|
1188
|
-
const messagesConfig: MessagesConfig = {
|
|
1189
|
-
/**
|
|
1190
|
-
* Replace with backend flag once its ready
|
|
1191
|
-
*/
|
|
1192
|
-
mutesEnabled: mutesEnabledProp ?? clientChannelConfig?.mutes ?? true,
|
|
1193
|
-
quotedRepliesEnabled: quotedRepliesEnabledProp ?? true,
|
|
1194
|
-
reactionsEnabled: reactionsEnabledProp ?? clientChannelConfig?.reactions ?? true,
|
|
1195
|
-
threadRepliesEnabled: threadRepliesEnabledProp ?? clientChannelConfig?.replies ?? true,
|
|
1196
|
-
};
|
|
1197
|
-
const channelConfig: ChannelConfig = {
|
|
1198
|
-
readEventsEnabled: readEventsEnabledProp ?? clientChannelConfig?.read_events ?? true,
|
|
1199
|
-
typingEventsEnabled: typingEventsEnabledProp ?? clientChannelConfig?.typing_events ?? true,
|
|
1200
|
-
};
|
|
1201
|
-
const inputConfig: InputConfig = {
|
|
1202
|
-
maxMessageLength: maxMessageLengthProp ?? clientChannelConfig?.max_message_length ?? undefined,
|
|
1203
|
-
uploadsEnabled: uploadsEnabledProp ?? clientChannelConfig?.uploads ?? true,
|
|
1204
|
-
};
|
|
1205
|
-
|
|
1206
1207
|
/**
|
|
1207
1208
|
* MESSAGE METHODS
|
|
1208
1209
|
*/
|
|
@@ -1256,7 +1257,7 @@ const ChannelWithContext = <
|
|
|
1256
1257
|
})) || [],
|
|
1257
1258
|
parent_id,
|
|
1258
1259
|
reactions: [],
|
|
1259
|
-
status:
|
|
1260
|
+
status: MessageStatusTypes.SENDING,
|
|
1260
1261
|
text,
|
|
1261
1262
|
type: 'regular',
|
|
1262
1263
|
user: {
|
|
@@ -1334,9 +1335,8 @@ const ChannelWithContext = <
|
|
|
1334
1335
|
} else if (channel) {
|
|
1335
1336
|
messageResponse = await channel.sendMessage(messageData);
|
|
1336
1337
|
}
|
|
1337
|
-
|
|
1338
1338
|
if (messageResponse.message) {
|
|
1339
|
-
messageResponse.message.status =
|
|
1339
|
+
messageResponse.message.status = MessageStatusTypes.RECEIVED;
|
|
1340
1340
|
if (retrying) {
|
|
1341
1341
|
replaceMessage(message, messageResponse.message);
|
|
1342
1342
|
} else {
|
|
@@ -1345,7 +1345,7 @@ const ChannelWithContext = <
|
|
|
1345
1345
|
}
|
|
1346
1346
|
} catch (err) {
|
|
1347
1347
|
console.log(err);
|
|
1348
|
-
message.status =
|
|
1348
|
+
message.status = MessageStatusTypes.FAILED;
|
|
1349
1349
|
updateMessage(message);
|
|
1350
1350
|
}
|
|
1351
1351
|
};
|
|
@@ -1377,7 +1377,7 @@ const ChannelWithContext = <
|
|
|
1377
1377
|
async (message) => {
|
|
1378
1378
|
const statusPendingMessage = {
|
|
1379
1379
|
...message,
|
|
1380
|
-
status:
|
|
1380
|
+
status: MessageStatusTypes.SENDING,
|
|
1381
1381
|
};
|
|
1382
1382
|
|
|
1383
1383
|
updateMessage(statusPendingMessage);
|
|
@@ -1415,7 +1415,7 @@ const ChannelWithContext = <
|
|
|
1415
1415
|
|
|
1416
1416
|
const oldestMessage = messages && messages[0];
|
|
1417
1417
|
|
|
1418
|
-
if (oldestMessage && oldestMessage.status !==
|
|
1418
|
+
if (oldestMessage && oldestMessage.status !== MessageStatusTypes.RECEIVED) {
|
|
1419
1419
|
return setLoadingMore(false);
|
|
1420
1420
|
}
|
|
1421
1421
|
|
|
@@ -1432,7 +1432,11 @@ const ChannelWithContext = <
|
|
|
1432
1432
|
}
|
|
1433
1433
|
} catch (err) {
|
|
1434
1434
|
console.warn('Message pagination request failed with error', err);
|
|
1435
|
-
|
|
1435
|
+
if (err instanceof Error) {
|
|
1436
|
+
setError(err);
|
|
1437
|
+
} else {
|
|
1438
|
+
setError(true);
|
|
1439
|
+
}
|
|
1436
1440
|
setLoadingMore(false);
|
|
1437
1441
|
throw err;
|
|
1438
1442
|
}
|
|
@@ -1455,7 +1459,7 @@ const ChannelWithContext = <
|
|
|
1455
1459
|
|
|
1456
1460
|
const recentMessage = messages[messages.length - 1];
|
|
1457
1461
|
|
|
1458
|
-
if (recentMessage?.status !==
|
|
1462
|
+
if (recentMessage?.status !== MessageStatusTypes.RECEIVED) {
|
|
1459
1463
|
setLoadingMoreRecent(false);
|
|
1460
1464
|
return;
|
|
1461
1465
|
}
|
|
@@ -1467,7 +1471,11 @@ const ChannelWithContext = <
|
|
|
1467
1471
|
}
|
|
1468
1472
|
} catch (err) {
|
|
1469
1473
|
console.warn('Message pagination request failed with error', err);
|
|
1470
|
-
|
|
1474
|
+
if (err instanceof Error) {
|
|
1475
|
+
setError(err);
|
|
1476
|
+
} else {
|
|
1477
|
+
setError(true);
|
|
1478
|
+
}
|
|
1471
1479
|
setLoadingMoreRecent(false);
|
|
1472
1480
|
throw err;
|
|
1473
1481
|
}
|
|
@@ -1606,14 +1614,22 @@ const ChannelWithContext = <
|
|
|
1606
1614
|
}
|
|
1607
1615
|
} catch (err) {
|
|
1608
1616
|
console.warn('Message pagination request failed with error', err);
|
|
1609
|
-
|
|
1617
|
+
if (err instanceof Error) {
|
|
1618
|
+
setError(err);
|
|
1619
|
+
} else {
|
|
1620
|
+
setError(true);
|
|
1621
|
+
}
|
|
1610
1622
|
setThreadLoadingMore(false);
|
|
1611
1623
|
throw err;
|
|
1612
1624
|
}
|
|
1613
1625
|
};
|
|
1614
1626
|
|
|
1627
|
+
const ownCapabilitiesContext = useCreateOwnCapabilitiesContext({
|
|
1628
|
+
channel,
|
|
1629
|
+
overrideCapabilities: overrideOwnCapabilities,
|
|
1630
|
+
});
|
|
1631
|
+
|
|
1615
1632
|
const channelContext = useCreateChannelContext({
|
|
1616
|
-
...channelConfig,
|
|
1617
1633
|
channel,
|
|
1618
1634
|
disabled: !!channel?.data?.frozen && disableIfFrozenChannel,
|
|
1619
1635
|
EmptyStateIndicator,
|
|
@@ -1626,6 +1642,7 @@ const ChannelWithContext = <
|
|
|
1626
1642
|
hideDateSeparators,
|
|
1627
1643
|
hideStickyDateHeader,
|
|
1628
1644
|
isAdmin,
|
|
1645
|
+
isChannelActive: shouldSyncChannel,
|
|
1629
1646
|
isModerator,
|
|
1630
1647
|
isOwner,
|
|
1631
1648
|
lastRead,
|
|
@@ -1643,12 +1660,12 @@ const ChannelWithContext = <
|
|
|
1643
1660
|
setTargetedMessage,
|
|
1644
1661
|
StickyHeader,
|
|
1645
1662
|
targetedMessage,
|
|
1663
|
+
threadList,
|
|
1646
1664
|
watcherCount,
|
|
1647
1665
|
watchers,
|
|
1648
1666
|
});
|
|
1649
1667
|
|
|
1650
|
-
const
|
|
1651
|
-
...inputConfig,
|
|
1668
|
+
const inputMessageInputContext = useCreateInputMessageInputContext({
|
|
1652
1669
|
additionalTextInputProps,
|
|
1653
1670
|
AttachButton,
|
|
1654
1671
|
autoCompleteSuggestionsLimit,
|
|
@@ -1658,6 +1675,7 @@ const ChannelWithContext = <
|
|
|
1658
1675
|
clearQuotedMessageState,
|
|
1659
1676
|
CommandsButton,
|
|
1660
1677
|
compressImageQuality,
|
|
1678
|
+
CooldownTimer,
|
|
1661
1679
|
doDocUploadRequest,
|
|
1662
1680
|
doImageUploadRequest,
|
|
1663
1681
|
editing,
|
|
@@ -1670,6 +1688,7 @@ const ChannelWithContext = <
|
|
|
1670
1688
|
initialValue,
|
|
1671
1689
|
Input,
|
|
1672
1690
|
InputButtons,
|
|
1691
|
+
maxMessageLength: maxMessageLengthProp ?? clientChannelConfig?.max_message_length ?? undefined,
|
|
1673
1692
|
maxNumberOfFiles,
|
|
1674
1693
|
mentionAllAppUsersEnabled,
|
|
1675
1694
|
mentionAllAppUsersQuery,
|
|
@@ -1680,6 +1699,7 @@ const ChannelWithContext = <
|
|
|
1680
1699
|
SendButton,
|
|
1681
1700
|
sendImageAsync,
|
|
1682
1701
|
sendMessage,
|
|
1702
|
+
SendMessageDisallowedIndicator,
|
|
1683
1703
|
setInputRef,
|
|
1684
1704
|
setQuotedMessageState,
|
|
1685
1705
|
ShowThreadMessageInChannelButton,
|
|
@@ -1694,34 +1714,28 @@ const ChannelWithContext = <
|
|
|
1694
1714
|
loadingMoreRecentProp !== undefined ? loadingMoreRecentProp : loadingMoreRecent,
|
|
1695
1715
|
loadMore,
|
|
1696
1716
|
loadMoreRecent,
|
|
1697
|
-
messages
|
|
1717
|
+
messages,
|
|
1698
1718
|
setLoadingMore,
|
|
1699
1719
|
setLoadingMoreRecent,
|
|
1700
1720
|
});
|
|
1701
1721
|
|
|
1702
1722
|
const messagesContext = useCreateMessagesContext({
|
|
1703
|
-
...messagesConfig,
|
|
1704
1723
|
additionalTouchableProps,
|
|
1705
|
-
animatedLongPress,
|
|
1706
1724
|
Attachment,
|
|
1707
1725
|
AttachmentActions,
|
|
1708
|
-
blockUser,
|
|
1709
1726
|
Card,
|
|
1710
1727
|
CardCover,
|
|
1711
1728
|
CardFooter,
|
|
1712
1729
|
CardHeader,
|
|
1713
1730
|
channelId,
|
|
1714
|
-
copyMessage,
|
|
1715
1731
|
DateHeader,
|
|
1716
|
-
|
|
1732
|
+
deletedMessagesVisibilityType,
|
|
1717
1733
|
disableTypingIndicator,
|
|
1718
1734
|
dismissKeyboardOnMessageTouch,
|
|
1719
|
-
editMessage: editMessageProp,
|
|
1720
1735
|
enableMessageGroupingByUser,
|
|
1721
1736
|
FileAttachment,
|
|
1722
1737
|
FileAttachmentGroup,
|
|
1723
1738
|
FileAttachmentIcon,
|
|
1724
|
-
flagMessage,
|
|
1725
1739
|
FlatList,
|
|
1726
1740
|
forceAlignMessages,
|
|
1727
1741
|
formatDate,
|
|
@@ -1733,6 +1747,7 @@ const ChannelWithContext = <
|
|
|
1733
1747
|
handleEdit,
|
|
1734
1748
|
handleFlag,
|
|
1735
1749
|
handleMute,
|
|
1750
|
+
handlePinMessage,
|
|
1736
1751
|
handleQuotedReply,
|
|
1737
1752
|
handleReaction,
|
|
1738
1753
|
handleRetry,
|
|
@@ -1751,41 +1766,38 @@ const ChannelWithContext = <
|
|
|
1751
1766
|
MessageFooter,
|
|
1752
1767
|
MessageHeader,
|
|
1753
1768
|
MessageList,
|
|
1769
|
+
MessagePinnedHeader,
|
|
1754
1770
|
MessageReplies,
|
|
1755
1771
|
MessageRepliesAvatars,
|
|
1756
1772
|
MessageSimple,
|
|
1757
1773
|
MessageStatus,
|
|
1758
1774
|
MessageSystem,
|
|
1759
1775
|
MessageText,
|
|
1760
|
-
muteUser,
|
|
1761
1776
|
myMessageTheme,
|
|
1762
|
-
onDoubleTapMessage,
|
|
1763
1777
|
onLongPressMessage,
|
|
1764
1778
|
onPressInMessage,
|
|
1765
1779
|
onPressMessage,
|
|
1766
1780
|
OverlayReactionList,
|
|
1767
|
-
quotedReply,
|
|
1768
1781
|
ReactionList,
|
|
1769
1782
|
removeMessage,
|
|
1770
1783
|
Reply,
|
|
1771
|
-
retry,
|
|
1772
1784
|
retrySendMessage,
|
|
1773
1785
|
ScrollToBottomButton,
|
|
1774
1786
|
selectReaction,
|
|
1775
1787
|
setEditingState,
|
|
1776
1788
|
setQuotedMessageState,
|
|
1777
1789
|
supportedReactions,
|
|
1778
|
-
|
|
1790
|
+
targetedMessage,
|
|
1779
1791
|
TypingIndicator,
|
|
1780
1792
|
TypingIndicatorContainer,
|
|
1781
1793
|
updateMessage,
|
|
1782
1794
|
UrlPreview,
|
|
1783
1795
|
});
|
|
1784
1796
|
|
|
1785
|
-
const suggestionsContext
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1797
|
+
const suggestionsContext = {
|
|
1798
|
+
AutoCompleteSuggestionHeader,
|
|
1799
|
+
AutoCompleteSuggestionItem,
|
|
1800
|
+
AutoCompleteSuggestionList,
|
|
1789
1801
|
};
|
|
1790
1802
|
|
|
1791
1803
|
const threadContext = useCreateThreadContext({
|
|
@@ -1828,19 +1840,23 @@ const ChannelWithContext = <
|
|
|
1828
1840
|
{...additionalKeyboardAvoidingViewProps}
|
|
1829
1841
|
>
|
|
1830
1842
|
<ChannelProvider<At, Ch, Co, Ev, Me, Re, Us> value={channelContext}>
|
|
1831
|
-
<
|
|
1832
|
-
<
|
|
1833
|
-
<
|
|
1834
|
-
<
|
|
1835
|
-
<
|
|
1836
|
-
<
|
|
1837
|
-
<
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1843
|
+
<OwnCapabilitiesProvider value={ownCapabilitiesContext}>
|
|
1844
|
+
<TypingProvider<At, Ch, Co, Ev, Me, Re, Us> value={typingContext}>
|
|
1845
|
+
<PaginatedMessageListProvider<At, Ch, Co, Ev, Me, Re, Us> value={messageListContext}>
|
|
1846
|
+
<MessagesProvider<At, Ch, Co, Ev, Me, Re, Us> value={messagesContext}>
|
|
1847
|
+
<ThreadProvider<At, Ch, Co, Ev, Me, Re, Us> value={threadContext}>
|
|
1848
|
+
<SuggestionsProvider<Co, Us> value={suggestionsContext}>
|
|
1849
|
+
<MessageInputProvider<At, Ch, Co, Ev, Me, Re, Us>
|
|
1850
|
+
value={inputMessageInputContext}
|
|
1851
|
+
>
|
|
1852
|
+
<View style={{ height: '100%' }}>{children}</View>
|
|
1853
|
+
</MessageInputProvider>
|
|
1854
|
+
</SuggestionsProvider>
|
|
1855
|
+
</ThreadProvider>
|
|
1856
|
+
</MessagesProvider>
|
|
1857
|
+
</PaginatedMessageListProvider>
|
|
1858
|
+
</TypingProvider>
|
|
1859
|
+
</OwnCapabilitiesProvider>
|
|
1844
1860
|
</ChannelProvider>
|
|
1845
1861
|
</KeyboardCompatibleView>
|
|
1846
1862
|
);
|
|
@@ -1854,7 +1870,8 @@ export type ChannelProps<
|
|
|
1854
1870
|
Me extends UnknownType = DefaultMessageType,
|
|
1855
1871
|
Re extends UnknownType = DefaultReactionType,
|
|
1856
1872
|
Us extends UnknownType = DefaultUserType,
|
|
1857
|
-
> = Partial<ChannelPropsWithContext<At, Ch, Co, Ev, Me, Re, Us
|
|
1873
|
+
> = Partial<Omit<ChannelPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>, 'channel'>> &
|
|
1874
|
+
Pick<ChannelPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>, 'channel'>;
|
|
1858
1875
|
|
|
1859
1876
|
/**
|
|
1860
1877
|
*
|
|
@@ -1878,6 +1895,28 @@ export const Channel = <
|
|
|
1878
1895
|
const { client } = useChatContext<At, Ch, Co, Ev, Me, Re, Us>();
|
|
1879
1896
|
const { t } = useTranslationContext();
|
|
1880
1897
|
|
|
1898
|
+
const shouldSyncChannel = props.thread?.id ? !!props.threadList : true;
|
|
1899
|
+
|
|
1900
|
+
const {
|
|
1901
|
+
members,
|
|
1902
|
+
messages,
|
|
1903
|
+
read,
|
|
1904
|
+
setMembers,
|
|
1905
|
+
setMessages,
|
|
1906
|
+
setRead,
|
|
1907
|
+
setThreadMessages,
|
|
1908
|
+
setTyping,
|
|
1909
|
+
setWatcherCount,
|
|
1910
|
+
setWatchers,
|
|
1911
|
+
threadMessages,
|
|
1912
|
+
typing,
|
|
1913
|
+
watcherCount,
|
|
1914
|
+
watchers,
|
|
1915
|
+
} = useChannelState<At, Ch, Co, Ev, Me, Re, Us>(
|
|
1916
|
+
props.channel,
|
|
1917
|
+
props.threadList ? props.thread?.id : undefined,
|
|
1918
|
+
);
|
|
1919
|
+
|
|
1881
1920
|
return (
|
|
1882
1921
|
<ChannelWithContext<At, Ch, Co, Ev, Me, Re, Us>
|
|
1883
1922
|
{...{
|
|
@@ -1885,6 +1924,23 @@ export const Channel = <
|
|
|
1885
1924
|
t,
|
|
1886
1925
|
}}
|
|
1887
1926
|
{...props}
|
|
1927
|
+
shouldSyncChannel={shouldSyncChannel}
|
|
1928
|
+
{...{
|
|
1929
|
+
members,
|
|
1930
|
+
messages: props.messages || messages,
|
|
1931
|
+
read,
|
|
1932
|
+
setMembers,
|
|
1933
|
+
setMessages,
|
|
1934
|
+
setRead,
|
|
1935
|
+
setThreadMessages,
|
|
1936
|
+
setTyping,
|
|
1937
|
+
setWatcherCount,
|
|
1938
|
+
setWatchers,
|
|
1939
|
+
threadMessages,
|
|
1940
|
+
typing,
|
|
1941
|
+
watcherCount,
|
|
1942
|
+
watchers,
|
|
1943
|
+
}}
|
|
1888
1944
|
/>
|
|
1889
1945
|
);
|
|
1890
1946
|
};
|