stream-chat-react-native-core 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -13
- package/lib/commonjs/components/Attachment/Attachment.js +17 -16
- package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/AttachmentActions.js +5 -5
- package/lib/commonjs/components/Attachment/AttachmentActions.js.map +1 -1
- package/lib/commonjs/components/Attachment/Card.js +19 -16
- package/lib/commonjs/components/Attachment/Card.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +9 -9
- package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +5 -5
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +124 -122
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +113 -149
- 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/{styleguideComponents/Reanimated.js.map → components/Attachment/utils/buildGallery/types.js.map} +0 -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 +10 -9
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +12 -9
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +25 -49
- 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 +14 -8
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +11 -9
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +304 -203
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +7 -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 +13 -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/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateTypingContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +7 -7
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +6 -5
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +7 -8
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +5 -4
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +8 -5
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +18 -18
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelList/Skeleton.js +15 -14
- package/lib/commonjs/components/ChannelList/Skeleton.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/useConnectionRecovered.js +3 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.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 +96 -63
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelList/utils.js +1 -1
- package/lib/commonjs/components/ChannelList/utils.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +3 -3
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +5 -5
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +6 -6
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +50 -21
- 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 +5 -5
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +2 -2
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +3 -3
- 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 +9 -5
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useIsOnline.js +40 -31
- package/lib/commonjs/components/Chat/hooks/useIsOnline.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +91 -59
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +3 -3
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +13 -13
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +32 -17
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +8 -8
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +6 -6
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDot.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDots.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +10 -10
- package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js +21 -13
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js.map +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/commonjs/components/Message/Message.js +153 -855
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +7 -7
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +42 -40
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +9 -7
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +35 -23
- 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 +27 -11
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +6 -6
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +32 -15
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +29 -25
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +8 -4
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +87 -114
- 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 +208 -27
- 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 +7 -5
- package/lib/commonjs/components/MessageInput/AttachButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/CommandsButton.js +4 -4
- 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 +33 -28
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +10 -10
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +18 -23
- package/lib/commonjs/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +94 -66
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +4 -4
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +9 -7
- package/lib/commonjs/components/MessageInput/SendButton.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 +12 -11
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js +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 +3 -3
- package/lib/commonjs/components/MessageList/DateHeader.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js +5 -4
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +5 -5
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +5 -5
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +5 -5
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +101 -62
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageSystem.js +7 -7
- package/lib/commonjs/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/commonjs/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +8 -6
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicator.js +6 -6
- package/lib/commonjs/components/MessageList/TypingIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +3 -3
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js +24 -11
- 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/filterTypingUsers.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 +11 -10
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js +3 -1
- package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getReadStates.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 +100 -85
- 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 +18 -19
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +32 -35
- 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 +26 -20
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/Spinner/Spinner.js +1 -1
- package/lib/commonjs/components/Thread/Thread.js +15 -6
- package/lib/commonjs/components/Thread/Thread.js.map +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +14 -13
- 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 +45 -45
- package/lib/commonjs/components/docs/data.js.map +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 +3 -3
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +3 -3
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +3 -3
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +3 -3
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +5 -5
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js +3 -3
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +3 -3
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +3 -3
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +3 -3
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js.map +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js +3 -3
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +106 -71
- 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 +6 -20
- 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 +3 -3
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +2 -2
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +50 -50
- 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 +3 -3
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +21 -34
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/ThemeContext.js +3 -3
- package/lib/commonjs/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +48 -20
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.js +3 -3
- package/lib/commonjs/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +4 -4
- package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/commonjs/contexts/typingContext/TypingContext.js +3 -3
- 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/useAppStateListener.js +8 -5
- package/lib/commonjs/hooks/useAppStateListener.js.map +1 -1
- package/lib/commonjs/hooks/useIsMountedRef.js +19 -0
- package/lib/commonjs/hooks/useIsMountedRef.js.map +1 -0
- package/lib/commonjs/hooks/useStreami18n.js +5 -2
- 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 +67 -0
- package/lib/commonjs/i18n/ko.json +67 -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/ArrowRight.js +1 -1
- package/lib/commonjs/icons/AtMentions.js +1 -1
- package/lib/commonjs/icons/Attach.js +1 -1
- package/lib/commonjs/icons/Audio.js +1 -1
- package/lib/commonjs/icons/CSV.js +1 -1
- package/lib/commonjs/icons/Camera.js +1 -1
- package/lib/commonjs/icons/Check.js +1 -1
- package/lib/commonjs/icons/CheckAll.js +1 -1
- package/lib/commonjs/icons/CheckSend.js +1 -1
- package/lib/commonjs/icons/CircleClose.js +1 -1
- package/lib/commonjs/icons/CirclePlus.js +1 -1
- package/lib/commonjs/icons/CircleRight.js +1 -1
- package/lib/commonjs/icons/Close.js +1 -1
- package/lib/commonjs/icons/Copy.js +1 -1
- package/lib/commonjs/icons/CurveLineLeftUp.js +1 -1
- package/lib/commonjs/icons/DOC.js +1 -1
- package/lib/commonjs/icons/DOCX.js +1 -1
- package/lib/commonjs/icons/Delete.js +1 -1
- package/lib/commonjs/icons/Down.js +1 -1
- package/lib/commonjs/icons/DownloadArrow.js +1 -1
- package/lib/commonjs/icons/DownloadCloud.js +1 -1
- package/lib/commonjs/icons/Edit.js +1 -1
- package/lib/commonjs/icons/Error.js +1 -1
- package/lib/commonjs/icons/Eye.js +1 -1
- package/lib/commonjs/icons/Flag.js +1 -1
- package/lib/commonjs/icons/Folder.js +1 -1
- package/lib/commonjs/icons/GenericFile.js +1 -1
- package/lib/commonjs/icons/GiphyIcon.js +1 -1
- package/lib/commonjs/icons/Grid.js +1 -1
- package/lib/commonjs/icons/Group.js +1 -1
- package/lib/commonjs/icons/HTML.js +1 -1
- package/lib/commonjs/icons/Imgur.js +1 -1
- package/lib/commonjs/icons/LOLReaction.js +1 -1
- package/lib/commonjs/icons/Lightning.js +1 -1
- package/lib/commonjs/icons/Link.js +1 -1
- package/lib/commonjs/icons/Loading.js +1 -1
- package/lib/commonjs/icons/Logo.js +1 -1
- package/lib/commonjs/icons/LoveReaction.js +1 -1
- package/lib/commonjs/icons/MD.js +1 -1
- package/lib/commonjs/icons/MailOpen.js +1 -1
- package/lib/commonjs/icons/MenuPointHorizontal.js +1 -1
- package/lib/commonjs/icons/MenuPointVertical.js +1 -1
- package/lib/commonjs/icons/MessageFlag.js +1 -1
- package/lib/commonjs/icons/MessageIcon.js +1 -1
- package/lib/commonjs/icons/Mute.js +1 -1
- package/lib/commonjs/icons/Notification.js +1 -1
- package/lib/commonjs/icons/ODT.js +1 -1
- package/lib/commonjs/icons/PDF.js +1 -1
- package/lib/commonjs/icons/PPT.js +1 -1
- package/lib/commonjs/icons/PPTX.js +1 -1
- package/lib/commonjs/icons/Picture.js +1 -1
- 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/RAR.js +1 -1
- package/lib/commonjs/icons/RTF.js +1 -1
- package/lib/commonjs/icons/Refresh.js +1 -1
- package/lib/commonjs/icons/SEVEN_Z.js +1 -1
- package/lib/commonjs/icons/Search.js +1 -1
- package/lib/commonjs/icons/SendRight.js +1 -1
- package/lib/commonjs/icons/SendUp.js +1 -1
- package/lib/commonjs/icons/Share.js +1 -1
- package/lib/commonjs/icons/ShareRightArrow.js +1 -1
- package/lib/commonjs/icons/Smile.js +1 -1
- package/lib/commonjs/icons/Sound.js +1 -1
- package/lib/commonjs/icons/TAR.js +1 -1
- package/lib/commonjs/icons/TXT.js +1 -1
- package/lib/commonjs/icons/ThreadReply.js +1 -1
- package/lib/commonjs/icons/ThumbsDownReaction.js +1 -1
- package/lib/commonjs/icons/ThumbsUpReaction.js +1 -1
- package/lib/commonjs/icons/Time.js +1 -1
- package/lib/commonjs/icons/Unknown.js +1 -1
- package/lib/commonjs/icons/Unpin.js +38 -0
- package/lib/commonjs/icons/Unpin.js.map +1 -0
- package/lib/commonjs/icons/User.js +1 -1
- package/lib/commonjs/icons/UserAdd.js +1 -1
- package/lib/commonjs/icons/UserAdmin.js +62 -0
- package/lib/commonjs/icons/UserAdmin.js.map +1 -0
- package/lib/commonjs/icons/UserDelete.js +1 -1
- package/lib/commonjs/icons/UserMinus.js +1 -1
- package/lib/commonjs/icons/WutReaction.js +1 -1
- package/lib/commonjs/icons/XLS.js +1 -1
- package/lib/commonjs/icons/XLSX.js +1 -1
- package/lib/commonjs/icons/ZIP.js +1 -1
- package/lib/commonjs/icons/index.js +39 -26
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/icons/utils/base.js +2 -2
- package/lib/commonjs/index.js +6 -6
- package/lib/commonjs/init.js +13 -0
- package/lib/commonjs/init.js.map +1 -0
- package/lib/commonjs/mock-builders/api/error.js +1 -1
- package/lib/commonjs/mock-builders/api/queryChannels.js +1 -1
- package/lib/commonjs/mock-builders/api/queryChannels.js.map +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/mock-builders/native/react-native-mock.js +1 -1
- package/lib/commonjs/mock-builders/native/react-native-mock.js.map +1 -1
- package/lib/commonjs/native.js +1 -7
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/utils/Streami18n.js +10 -0
- 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 +37 -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 +39 -19
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +17 -16
- package/lib/module/components/Attachment/Attachment.js.map +1 -1
- package/lib/module/components/Attachment/AttachmentActions.js +5 -5
- package/lib/module/components/Attachment/AttachmentActions.js.map +1 -1
- package/lib/module/components/Attachment/Card.js +19 -16
- package/lib/module/components/Attachment/Card.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +9 -9
- package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +5 -5
- package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/module/components/Attachment/FileIcon.js +1 -1
- package/lib/module/components/Attachment/FileIcon.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +124 -122
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +113 -149
- 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/{styleguideComponents/Reanimated.js.map → components/Attachment/utils/buildGallery/types.js.map} +0 -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 +10 -9
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +12 -9
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +25 -49
- 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 +14 -8
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +11 -9
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +304 -203
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js +7 -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 +13 -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/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateTypingContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +7 -7
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +6 -5
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +7 -8
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +5 -4
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +8 -5
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +18 -18
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/ChannelList/Skeleton.js +15 -14
- package/lib/module/components/ChannelList/Skeleton.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/useConnectionRecovered.js +3 -1
- package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.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 +96 -63
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelList/utils.js +1 -1
- package/lib/module/components/ChannelList/utils.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +3 -3
- package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +5 -5
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +6 -6
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +50 -21
- 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 +5 -5
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +2 -2
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +3 -3
- 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 +9 -5
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/Chat/hooks/useIsOnline.js +40 -31
- package/lib/module/components/Chat/hooks/useIsOnline.js.map +1 -1
- package/lib/module/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +91 -59
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +3 -3
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +13 -13
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +32 -17
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +8 -8
- package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js +6 -6
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/module/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingDot.js +1 -1
- package/lib/module/components/Indicators/LoadingDots.js +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +10 -10
- package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js +21 -13
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js.map +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/module/components/Message/Message.js +153 -855
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +7 -7
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +42 -40
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js +9 -7
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +35 -23
- 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 +27 -11
- package/lib/module/components/Message/MessageSimple/MessageReplies.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +6 -6
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +32 -15
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +29 -25
- package/lib/module/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +8 -4
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/ReactionList.js +87 -114
- 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 +208 -27
- 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 +7 -5
- package/lib/module/components/MessageInput/AttachButton.js.map +1 -1
- package/lib/module/components/MessageInput/CommandsButton.js +4 -4
- 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 +33 -28
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +10 -10
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +18 -23
- package/lib/module/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +94 -66
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/MoreOptionsButton.js +4 -4
- package/lib/module/components/MessageInput/MoreOptionsButton.js.map +1 -1
- package/lib/module/components/MessageInput/SendButton.js +9 -7
- package/lib/module/components/MessageInput/SendButton.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 +12 -11
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/module/components/MessageInput/UploadProgressIndicator.js +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 +3 -3
- package/lib/module/components/MessageList/DateHeader.js.map +1 -1
- package/lib/module/components/MessageList/InlineDateSeparator.js +5 -4
- package/lib/module/components/MessageList/InlineDateSeparator.js.map +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +5 -5
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +5 -5
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +5 -5
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
- package/lib/module/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/module/components/MessageList/MessageList.js +101 -62
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/MessageSystem.js +7 -7
- package/lib/module/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/module/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/module/components/MessageList/ScrollToBottomButton.js +8 -6
- package/lib/module/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/module/components/MessageList/TypingIndicator.js +6 -6
- package/lib/module/components/MessageList/TypingIndicator.js.map +1 -1
- package/lib/module/components/MessageList/TypingIndicatorContainer.js +3 -3
- package/lib/module/components/MessageList/TypingIndicatorContainer.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js +24 -11
- 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/filterTypingUsers.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 +11 -10
- package/lib/module/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/module/components/MessageList/utils/getLastReceivedMessage.js +3 -1
- package/lib/module/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/module/components/MessageList/utils/getReadStates.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 +100 -85
- 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 +18 -19
- package/lib/module/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +32 -35
- 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 +26 -20
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/Spinner/Spinner.js +1 -1
- package/lib/module/components/Thread/Thread.js +15 -6
- package/lib/module/components/Thread/Thread.js.map +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +14 -13
- 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 +45 -45
- package/lib/module/components/docs/data.js.map +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 +3 -3
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +3 -3
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +3 -3
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +3 -3
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +5 -5
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
- package/lib/module/contexts/channelsStateContext/useChannelState.js +3 -3
- package/lib/module/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +3 -3
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +3 -3
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/module/contexts/keyboardContext/KeyboardContext.js +3 -3
- package/lib/module/contexts/keyboardContext/KeyboardContext.js.map +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +3 -3
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +106 -71
- 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 +6 -20
- 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 +3 -3
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +2 -2
- package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +50 -50
- 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 +3 -3
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +21 -34
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/module/contexts/themeContext/ThemeContext.js +3 -3
- package/lib/module/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +48 -20
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/contexts/threadContext/ThreadContext.js +3 -3
- package/lib/module/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +4 -4
- package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/module/contexts/typingContext/TypingContext.js +3 -3
- 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/useAppStateListener.js +8 -5
- package/lib/module/hooks/useAppStateListener.js.map +1 -1
- package/lib/module/hooks/useIsMountedRef.js +19 -0
- package/lib/module/hooks/useIsMountedRef.js.map +1 -0
- package/lib/module/hooks/useStreami18n.js +5 -2
- 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 +67 -0
- package/lib/module/i18n/ko.json +67 -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/ArrowRight.js +1 -1
- package/lib/module/icons/AtMentions.js +1 -1
- package/lib/module/icons/Attach.js +1 -1
- package/lib/module/icons/Audio.js +1 -1
- package/lib/module/icons/CSV.js +1 -1
- package/lib/module/icons/Camera.js +1 -1
- package/lib/module/icons/Check.js +1 -1
- package/lib/module/icons/CheckAll.js +1 -1
- package/lib/module/icons/CheckSend.js +1 -1
- package/lib/module/icons/CircleClose.js +1 -1
- package/lib/module/icons/CirclePlus.js +1 -1
- package/lib/module/icons/CircleRight.js +1 -1
- package/lib/module/icons/Close.js +1 -1
- package/lib/module/icons/Copy.js +1 -1
- package/lib/module/icons/CurveLineLeftUp.js +1 -1
- package/lib/module/icons/DOC.js +1 -1
- package/lib/module/icons/DOCX.js +1 -1
- package/lib/module/icons/Delete.js +1 -1
- package/lib/module/icons/Down.js +1 -1
- package/lib/module/icons/DownloadArrow.js +1 -1
- package/lib/module/icons/DownloadCloud.js +1 -1
- package/lib/module/icons/Edit.js +1 -1
- package/lib/module/icons/Error.js +1 -1
- package/lib/module/icons/Eye.js +1 -1
- package/lib/module/icons/Flag.js +1 -1
- package/lib/module/icons/Folder.js +1 -1
- package/lib/module/icons/GenericFile.js +1 -1
- package/lib/module/icons/GiphyIcon.js +1 -1
- package/lib/module/icons/Grid.js +1 -1
- package/lib/module/icons/Group.js +1 -1
- package/lib/module/icons/HTML.js +1 -1
- package/lib/module/icons/Imgur.js +1 -1
- package/lib/module/icons/LOLReaction.js +1 -1
- package/lib/module/icons/Lightning.js +1 -1
- package/lib/module/icons/Link.js +1 -1
- package/lib/module/icons/Loading.js +1 -1
- package/lib/module/icons/Logo.js +1 -1
- package/lib/module/icons/LoveReaction.js +1 -1
- package/lib/module/icons/MD.js +1 -1
- package/lib/module/icons/MailOpen.js +1 -1
- package/lib/module/icons/MenuPointHorizontal.js +1 -1
- package/lib/module/icons/MenuPointVertical.js +1 -1
- package/lib/module/icons/MessageFlag.js +1 -1
- package/lib/module/icons/MessageIcon.js +1 -1
- package/lib/module/icons/Mute.js +1 -1
- package/lib/module/icons/Notification.js +1 -1
- package/lib/module/icons/ODT.js +1 -1
- package/lib/module/icons/PDF.js +1 -1
- package/lib/module/icons/PPT.js +1 -1
- package/lib/module/icons/PPTX.js +1 -1
- package/lib/module/icons/Picture.js +1 -1
- 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/RAR.js +1 -1
- package/lib/module/icons/RTF.js +1 -1
- package/lib/module/icons/Refresh.js +1 -1
- package/lib/module/icons/SEVEN_Z.js +1 -1
- package/lib/module/icons/Search.js +1 -1
- package/lib/module/icons/SendRight.js +1 -1
- package/lib/module/icons/SendUp.js +1 -1
- package/lib/module/icons/Share.js +1 -1
- package/lib/module/icons/ShareRightArrow.js +1 -1
- package/lib/module/icons/Smile.js +1 -1
- package/lib/module/icons/Sound.js +1 -1
- package/lib/module/icons/TAR.js +1 -1
- package/lib/module/icons/TXT.js +1 -1
- package/lib/module/icons/ThreadReply.js +1 -1
- package/lib/module/icons/ThumbsDownReaction.js +1 -1
- package/lib/module/icons/ThumbsUpReaction.js +1 -1
- package/lib/module/icons/Time.js +1 -1
- package/lib/module/icons/Unknown.js +1 -1
- package/lib/module/icons/Unpin.js +38 -0
- package/lib/module/icons/Unpin.js.map +1 -0
- package/lib/module/icons/User.js +1 -1
- package/lib/module/icons/UserAdd.js +1 -1
- package/lib/module/icons/UserAdmin.js +62 -0
- package/lib/module/icons/UserAdmin.js.map +1 -0
- package/lib/module/icons/UserDelete.js +1 -1
- package/lib/module/icons/UserMinus.js +1 -1
- package/lib/module/icons/WutReaction.js +1 -1
- package/lib/module/icons/XLS.js +1 -1
- package/lib/module/icons/XLSX.js +1 -1
- package/lib/module/icons/ZIP.js +1 -1
- package/lib/module/icons/index.js +39 -26
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/icons/utils/base.js +2 -2
- package/lib/module/index.js +6 -6
- package/lib/module/init.js +13 -0
- package/lib/module/init.js.map +1 -0
- package/lib/module/mock-builders/api/error.js +1 -1
- package/lib/module/mock-builders/api/queryChannels.js +1 -1
- package/lib/module/mock-builders/api/queryChannels.js.map +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/mock-builders/native/react-native-mock.js +1 -1
- package/lib/module/mock-builders/native/react-native-mock.js.map +1 -1
- package/lib/module/native.js +1 -7
- package/lib/module/native.js.map +1 -1
- package/lib/module/utils/Streami18n.js +10 -0
- 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 +37 -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 +39 -19
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Attachment.d.ts +6 -6
- package/lib/typescript/components/Attachment/AttachmentActions.d.ts +5 -5
- package/lib/typescript/components/Attachment/Card.d.ts +7 -5
- package/lib/typescript/components/Attachment/FileAttachment.d.ts +6 -6
- package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +4 -4
- package/lib/typescript/components/Attachment/Gallery.d.ts +19 -6
- package/lib/typescript/components/Attachment/Giphy.d.ts +7 -7
- 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 +10 -4
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.d.ts +5 -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/Avatar/Avatar.d.ts +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +13 -16
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +2 -2
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +3 -70
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +3 -126
- package/lib/typescript/components/Channel/hooks/useCreateOwnCapabilitiesContext.d.ts +7 -0
- package/lib/typescript/components/Channel/hooks/useCreatePaginatedMessageListContext.d.ts +3 -3
- package/lib/typescript/components/Channel/hooks/useCreateThreadContext.d.ts +2 -2
- package/lib/typescript/components/Channel/hooks/useCreateTypingContext.d.ts +2 -2
- package/lib/typescript/components/ChannelList/ChannelList.d.ts +15 -15
- package/lib/typescript/components/ChannelList/ChannelListMessenger.d.ts +4 -4
- package/lib/typescript/components/ChannelList/hooks/listeners/useAddedToChannelNotification.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelDeleted.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelHidden.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelTruncated.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelUpdated.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelVisible.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useConnectionRecovered.d.ts +2 -2
- package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessage.d.ts +4 -4
- package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessageNotification.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useUserPresence.d.ts +4 -4
- package/lib/typescript/components/ChannelList/hooks/useCreateChannelsContext.d.ts +2 -2
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +11 -9
- package/lib/typescript/components/ChannelList/utils.d.ts +7 -7
- package/lib/typescript/components/ChannelPreview/ChannelAvatar.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +7 -7
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts +4 -5
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessenger.d.ts +6 -6
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMutedStatus.d.ts +9 -0
- package/lib/typescript/components/ChannelPreview/ChannelPreviewStatus.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/ChannelPreviewTitle.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/ChannelPreviewUnreadCount.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.d.ts +15 -3
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayName.d.ts +4 -4
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.d.ts +2 -2
- package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts +5 -5
- package/lib/typescript/components/Chat/Chat.d.ts +3 -3
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +2 -2
- package/lib/typescript/components/Chat/hooks/useIsOnline.d.ts +2 -2
- package/lib/typescript/components/Chat/hooks/useMutedUsers.d.ts +2 -2
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +13 -10
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +10 -10
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts +10 -10
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +10 -10
- package/lib/typescript/components/ImageGallery/components/__tests__/ImageGalleryHeader.test.d.ts +1 -0
- package/lib/typescript/components/Indicators/LoadingErrorIndicator.d.ts +1 -1
- package/lib/typescript/components/KeyboardCompatibleView/KeyboardCompatibleView.d.ts +2 -1
- package/lib/typescript/components/Message/Message.d.ts +14 -13
- package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +5 -5
- package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts +4 -4
- package/lib/typescript/components/Message/MessageSimple/MessageDeleted.d.ts +6 -6
- package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts +8 -8
- package/lib/typescript/components/Message/MessageSimple/MessagePinnedHeader.d.ts +8 -0
- package/lib/typescript/components/Message/MessageSimple/MessageReplies.d.ts +4 -4
- package/lib/typescript/components/Message/MessageSimple/MessageRepliesAvatars.d.ts +3 -3
- package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +4 -4
- package/lib/typescript/components/Message/MessageSimple/MessageStatus.d.ts +4 -4
- package/lib/typescript/components/Message/MessageSimple/MessageTextContainer.d.ts +7 -6
- package/lib/typescript/components/Message/MessageSimple/ReactionList.d.ts +5 -4
- 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 +21 -6
- package/lib/typescript/components/Message/MessageSimple/utils/renderText.test.d.ts +1 -0
- package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts +2 -2
- 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 +2 -2
- package/lib/typescript/components/MessageInput/AttachButton.d.ts +5 -5
- package/lib/typescript/components/MessageInput/CommandsButton.d.ts +5 -5
- package/lib/typescript/components/MessageInput/CooldownTimer.d.ts +10 -0
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +4 -4
- package/lib/typescript/components/MessageInput/ImageUploadPreview.d.ts +4 -4
- package/lib/typescript/components/MessageInput/InputButtons.d.ts +5 -5
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +4 -4
- package/lib/typescript/components/MessageInput/MoreOptionsButton.d.ts +5 -5
- package/lib/typescript/components/MessageInput/SendButton.d.ts +4 -4
- package/lib/typescript/components/MessageInput/SendMessageDisallowedIndicator.d.ts +1 -0
- package/lib/typescript/components/MessageInput/ShowThreadMessageInChannelButton.d.ts +2 -2
- 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/InlineLoadingMoreIndicator.d.ts +2 -2
- package/lib/typescript/components/MessageList/InlineLoadingMoreRecentIndicator.d.ts +2 -2
- package/lib/typescript/components/MessageList/InlineLoadingMoreThreadIndicator.d.ts +2 -2
- package/lib/typescript/components/MessageList/MessageList.d.ts +8 -7
- package/lib/typescript/components/MessageList/MessageSystem.d.ts +5 -5
- package/lib/typescript/components/MessageList/TypingIndicator.d.ts +2 -2
- package/lib/typescript/components/MessageList/TypingIndicatorContainer.d.ts +4 -4
- package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts +6 -5
- package/lib/typescript/components/MessageList/hooks/useTypingString.d.ts +2 -2
- package/lib/typescript/components/MessageList/utils/filterTypingUsers.d.ts +3 -3
- package/lib/typescript/components/MessageList/utils/getDateSeparators.d.ts +4 -4
- package/lib/typescript/components/MessageList/utils/getGroupStyles.d.ts +5 -5
- package/lib/typescript/components/MessageList/utils/getLastReceivedMessage.d.ts +2 -2
- package/lib/typescript/components/MessageList/utils/getReadStates.d.ts +8 -5
- package/lib/typescript/components/MessageOverlay/MessageActionList.d.ts +12 -0
- package/lib/typescript/components/MessageOverlay/MessageActionListItem.d.ts +21 -0
- package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts +6 -6
- package/lib/typescript/components/MessageOverlay/OverlayBackdrop.d.ts +6 -0
- package/lib/typescript/components/MessageOverlay/OverlayReactionList.d.ts +6 -7
- 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 +5 -5
- package/lib/typescript/components/Thread/Thread.d.ts +8 -8
- package/lib/typescript/components/Thread/components/ThreadFooterComponent.d.ts +2 -2
- package/lib/typescript/components/index.d.ts +13 -7
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +2 -2
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +39 -40
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +30 -22
- package/lib/typescript/contexts/channelsStateContext/ChannelsStateContext.d.ts +19 -19
- package/lib/typescript/contexts/channelsStateContext/useChannelState.d.ts +17 -17
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +11 -11
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts +8 -8
- package/lib/typescript/contexts/keyboardContext/KeyboardContext.d.ts +2 -2
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +12 -16
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +53 -42
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +3 -3
- package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +3 -3
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +31 -32
- 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 +77 -166
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +15 -8
- package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts +2 -2
- package/lib/typescript/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.d.ts +25 -0
- package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +8 -8
- package/lib/typescript/contexts/suggestionsContext/SuggestionsContext.d.ts +29 -28
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +46 -17
- package/lib/typescript/contexts/threadContext/ThreadContext.d.ts +10 -10
- package/lib/typescript/contexts/translationContext/TranslationContext.d.ts +2 -2
- package/lib/typescript/contexts/typingContext/TypingContext.d.ts +8 -8
- package/lib/typescript/contexts/utils/getDisplayName.d.ts +2 -2
- package/lib/typescript/hooks/useIsMountedRef.d.ts +20 -0
- 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 +67 -0
- package/lib/typescript/i18n/ko.json +67 -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/UserAdmin.d.ts +3 -0
- package/lib/typescript/icons/index.d.ts +3 -2
- package/lib/typescript/init.d.ts +2 -0
- package/lib/typescript/native.d.ts +1 -9
- package/lib/typescript/types/types.d.ts +16 -13
- package/lib/typescript/utils/Streami18n.d.ts +17 -9
- package/lib/typescript/utils/date.d.ts +2 -0
- package/lib/typescript/utils/getResizedImageUrl.d.ts +20 -0
- package/lib/typescript/utils/getUrlOfImageAttachment.d.ts +7 -0
- package/lib/typescript/utils/utils.d.ts +36 -30
- package/package.json +15 -20
- package/src/components/Attachment/Attachment.tsx +20 -61
- package/src/components/Attachment/AttachmentActions.tsx +17 -57
- package/src/components/Attachment/Card.tsx +22 -52
- package/src/components/Attachment/FileAttachment.tsx +16 -51
- package/src/components/Attachment/FileAttachmentGroup.tsx +16 -57
- package/src/components/Attachment/FileIcon.tsx +2 -2
- package/src/components/Attachment/Gallery.tsx +209 -241
- package/src/components/Attachment/Giphy.tsx +84 -128
- package/src/components/Attachment/__tests__/Attachment.test.js +27 -19
- 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 +77 -0
- package/src/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.ts +91 -0
- package/src/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.ts +99 -0
- package/src/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.ts +66 -0
- package/src/components/Attachment/utils/buildGallery/buildThumbnail.ts +48 -0
- package/src/components/Attachment/utils/buildGallery/buildThumbnailGrid.ts +188 -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/AttachmentPicker/components/AttachmentSelectionBar.tsx +15 -3
- package/src/components/AutoCompleteInput/AutoCompleteInput.tsx +66 -96
- package/src/components/AutoCompleteInput/{CommandsItem.tsx → AutoCompleteSuggestionCommandIcon.tsx} +7 -59
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx +102 -0
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionItem.tsx +149 -0
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +209 -0
- package/src/components/AutoCompleteInput/__tests__/AutoCompleteInput.test.js +10 -16
- package/src/components/Avatar/Avatar.tsx +8 -11
- package/src/components/Avatar/GroupAvatar.tsx +7 -21
- package/src/components/Avatar/__tests__/Avatar.test.js +2 -33
- package/src/components/Channel/Channel.tsx +495 -477
- package/src/components/Channel/__tests__/Channel.test.js +63 -100
- package/src/components/Channel/__tests__/ownCapabilities.test.js +376 -0
- package/src/components/Channel/hooks/useCreateChannelContext.ts +11 -25
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +54 -69
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +17 -49
- package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +39 -0
- package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +16 -32
- package/src/components/Channel/hooks/useCreateThreadContext.ts +4 -19
- package/src/components/Channel/hooks/useCreateTypingContext.ts +4 -19
- package/src/components/ChannelList/ChannelList.tsx +36 -58
- 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/ChannelListLoadingIndicator.tsx +5 -1
- package/src/components/ChannelList/ChannelListMessenger.tsx +22 -74
- package/src/components/ChannelList/Skeleton.tsx +2 -1
- package/src/components/ChannelList/__tests__/ChannelList.test.js +75 -16
- package/src/components/ChannelList/__tests__/ChannelListMessenger.test.js +46 -14
- package/src/components/ChannelList/hooks/listeners/useAddedToChannelNotification.ts +17 -39
- package/src/components/ChannelList/hooks/listeners/useChannelDeleted.ts +15 -37
- package/src/components/ChannelList/hooks/listeners/useChannelHidden.ts +15 -37
- package/src/components/ChannelList/hooks/listeners/useChannelTruncated.ts +17 -39
- package/src/components/ChannelList/hooks/listeners/useChannelUpdated.ts +15 -37
- package/src/components/ChannelList/hooks/listeners/useChannelVisible.ts +17 -39
- package/src/components/ChannelList/hooks/listeners/useConnectionRecovered.ts +8 -20
- package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +13 -36
- package/src/components/ChannelList/hooks/listeners/useNewMessageNotification.ts +17 -39
- package/src/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.ts +15 -37
- package/src/components/ChannelList/hooks/listeners/useUserPresence.ts +11 -33
- package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +5 -21
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +95 -70
- package/src/components/ChannelList/utils.ts +9 -42
- package/src/components/ChannelPreview/ChannelAvatar.tsx +6 -29
- package/src/components/ChannelPreview/ChannelPreview.tsx +21 -54
- package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +14 -24
- package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +39 -56
- package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx +50 -0
- package/src/components/ChannelPreview/ChannelPreviewStatus.tsx +10 -30
- package/src/components/ChannelPreview/ChannelPreviewTitle.tsx +7 -28
- package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx +7 -27
- package/src/components/ChannelPreview/__tests__/ChannelPreview.test.js +16 -22
- package/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +23 -14
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.ts +15 -30
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +8 -30
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts +9 -30
- package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +31 -81
- package/src/components/Chat/Chat.tsx +19 -44
- package/src/components/Chat/__tests__/Chat.test.js +12 -47
- package/src/components/Chat/hooks/useCreateChatContext.ts +4 -19
- package/src/components/Chat/hooks/useIsOnline.ts +45 -56
- package/src/components/Chat/hooks/useMutedUsers.ts +5 -20
- package/src/components/ImageGallery/ImageGallery.tsx +110 -86
- package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +1 -2
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +20 -15
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +45 -25
- package/src/components/ImageGallery/components/ImageGrid.tsx +47 -33
- package/src/components/ImageGallery/components/ImageGridHandle.tsx +1 -0
- package/src/components/ImageGallery/components/__tests__/ImageGalleryHeader.test.tsx +31 -0
- package/src/components/Indicators/LoadingErrorIndicator.tsx +1 -1
- package/src/components/Indicators/LoadingIndicator.tsx +1 -2
- package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx +9 -2
- package/src/components/Message/Message.tsx +196 -688
- package/src/components/Message/MessageSimple/MessageAvatar.tsx +14 -56
- package/src/components/Message/MessageSimple/MessageContent.tsx +42 -87
- package/src/components/Message/MessageSimple/MessageDeleted.tsx +24 -63
- package/src/components/Message/MessageSimple/MessageFooter.tsx +60 -84
- package/src/components/Message/MessageSimple/MessagePinnedHeader.tsx +109 -0
- package/src/components/Message/MessageSimple/MessageReplies.tsx +19 -60
- package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +7 -29
- package/src/components/Message/MessageSimple/MessageSimple.tsx +64 -78
- package/src/components/Message/MessageSimple/MessageStatus.tsx +35 -88
- package/src/components/Message/MessageSimple/MessageTextContainer.tsx +24 -66
- package/src/components/Message/MessageSimple/ReactionList.tsx +110 -163
- package/src/components/Message/MessageSimple/__tests__/Message.test.js +24 -258
- package/src/components/Message/MessageSimple/__tests__/MessageAvatar.test.js +9 -8
- package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +63 -46
- package/src/components/Message/MessageSimple/__tests__/MessagePinnedHeader.test.js +53 -0
- package/src/components/Message/MessageSimple/__tests__/MessageReplies.test.js +13 -9
- package/src/components/Message/MessageSimple/__tests__/MessageStatus.test.js +11 -47
- package/src/components/Message/MessageSimple/__tests__/MessageTextContainer.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +35 -22
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessagePinnedHeader.test.js.snap +80 -0
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageReplies.test.js.snap +72 -46
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageStatus.test.js.snap +77 -48
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageTextContainer.test.js.snap +6 -18
- 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 +138 -63
- package/src/components/Message/hooks/useCreateMessageContext.ts +5 -26
- package/src/components/Message/hooks/useMessageActionHandlers.ts +157 -0
- package/src/components/Message/hooks/useMessageActions.tsx +371 -0
- package/src/components/Message/utils/messageActions.ts +53 -54
- package/src/components/Message/utils/removeReservedFields.ts +3 -18
- package/src/components/MessageInput/AttachButton.tsx +15 -57
- package/src/components/MessageInput/CommandsButton.tsx +16 -58
- package/src/components/MessageInput/CooldownTimer.tsx +67 -0
- package/src/components/MessageInput/FileUploadPreview.tsx +86 -118
- package/src/components/MessageInput/ImageUploadPreview.tsx +15 -58
- package/src/components/MessageInput/InputButtons.tsx +17 -64
- package/src/components/MessageInput/MessageInput.tsx +83 -97
- package/src/components/MessageInput/MoreOptionsButton.tsx +14 -56
- package/src/components/MessageInput/SendButton.tsx +14 -55
- package/src/components/MessageInput/SendMessageDisallowedIndicator.tsx +47 -0
- package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx +6 -21
- package/src/components/MessageInput/__tests__/AttachButton.test.js +2 -2
- package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +193 -97
- package/src/components/MessageInput/__tests__/ImageUploadPreview.test.js +35 -35
- package/src/components/MessageInput/__tests__/MessageInput.test.js +29 -17
- 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__/AttachButton.test.js.snap +134 -52
- package/src/components/MessageInput/__tests__/__snapshots__/FileUploadPreview.test.js.snap +3955 -1647
- package/src/components/MessageInput/__tests__/__snapshots__/ImageUploadPreview.test.js.snap +1964 -1464
- package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +633 -326
- package/src/components/MessageInput/__tests__/__snapshots__/SendButton.test.js.snap +224 -124
- package/src/components/MessageInput/__tests__/__snapshots__/UploadProgressIndicator.test.js.snap +85 -17
- package/src/components/MessageInput/hooks/useCooldown.ts +48 -0
- package/src/components/MessageInput/hooks/useCountdown.ts +48 -0
- package/src/components/MessageList/DateHeader.tsx +2 -2
- package/src/components/MessageList/InlineDateSeparator.tsx +5 -2
- package/src/components/MessageList/InlineLoadingMoreIndicator.tsx +3 -18
- package/src/components/MessageList/InlineLoadingMoreRecentIndicator.tsx +3 -18
- package/src/components/MessageList/InlineLoadingMoreThreadIndicator.tsx +3 -18
- package/src/components/MessageList/MessageList.tsx +181 -159
- package/src/components/MessageList/MessageSystem.tsx +7 -28
- package/src/components/MessageList/ScrollToBottomButton.tsx +6 -1
- package/src/components/MessageList/TypingIndicator.tsx +4 -20
- package/src/components/MessageList/TypingIndicatorContainer.tsx +14 -47
- package/src/components/MessageList/__tests__/MessageList.test.js +231 -152
- package/src/components/MessageList/__tests__/MessageSystem.test.js +3 -3
- package/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +13 -8
- package/src/components/MessageList/__tests__/TypingIndicator.test.js +14 -97
- package/src/components/MessageList/__tests__/__snapshots__/MessageSystem.test.js.snap +9 -4
- package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.js.snap +78 -32
- package/src/components/MessageList/__tests__/__snapshots__/TypingIndicator.test.js.snap +60 -57
- package/src/components/MessageList/hooks/useMessageList.ts +39 -62
- package/src/components/MessageList/hooks/useTypingString.ts +6 -22
- package/src/components/MessageList/utils/filterTypingUsers.ts +7 -28
- package/src/components/MessageList/utils/getDateSeparators.ts +10 -30
- package/src/components/MessageList/utils/getGroupStyles.ts +23 -44
- package/src/components/MessageList/utils/getLastReceivedMessage.ts +9 -19
- package/src/components/MessageList/utils/getReadStates.ts +5 -20
- package/src/components/MessageOverlay/MessageActionList.tsx +170 -0
- package/src/components/MessageOverlay/MessageActionListItem.tsx +124 -0
- package/src/components/MessageOverlay/MessageOverlay.tsx +264 -268
- package/src/components/MessageOverlay/OverlayBackdrop.tsx +18 -0
- package/src/components/MessageOverlay/OverlayReactionList.tsx +24 -82
- package/src/components/MessageOverlay/OverlayReactions.tsx +12 -8
- package/src/components/MessageOverlay/OverlayReactionsAvatar.tsx +27 -0
- package/src/components/MessageOverlay/hooks/useMessageActionAnimation.tsx +44 -0
- package/src/components/Reply/Reply.tsx +44 -81
- package/src/components/Thread/Thread.tsx +31 -57
- package/src/components/Thread/__tests__/Thread.test.js +58 -77
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +874 -1011
- package/src/components/Thread/components/ThreadFooterComponent.tsx +13 -49
- package/src/components/docs/ListProps.md +1 -1
- package/src/components/docs/data.js +38 -37
- package/src/components/index.ts +13 -7
- package/src/contexts/activeChannelsRefContext/ActiveChannelsRefContext.tsx +1 -2
- package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +10 -9
- package/src/contexts/channelContext/ChannelContext.tsx +43 -79
- package/src/contexts/channelsContext/ChannelsContext.tsx +37 -63
- package/src/contexts/channelsStateContext/ChannelsStateContext.tsx +39 -117
- package/src/contexts/channelsStateContext/useChannelState.ts +29 -61
- package/src/contexts/chatContext/ChatContext.tsx +15 -51
- package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +13 -56
- package/src/contexts/keyboardContext/KeyboardContext.tsx +13 -8
- package/src/contexts/messageContext/MessageContext.tsx +16 -57
- package/src/contexts/messageInputContext/MessageInputContext.tsx +146 -157
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +13 -26
- package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +15 -34
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +41 -97
- 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 +96 -234
- package/src/contexts/overlayContext/OverlayContext.tsx +35 -35
- package/src/contexts/overlayContext/OverlayProvider.tsx +52 -62
- package/src/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.tsx +38 -0
- package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +14 -55
- package/src/contexts/suggestionsContext/SuggestionsContext.tsx +59 -80
- package/src/contexts/suggestionsContext/__tests__/Suggestions.test.js +4 -2
- package/src/contexts/themeContext/ThemeContext.tsx +1 -0
- package/src/contexts/themeContext/utils/theme.ts +92 -36
- package/src/contexts/threadContext/ThreadContext.tsx +14 -48
- package/src/contexts/translationContext/TranslationContext.tsx +15 -10
- package/src/contexts/typingContext/TypingContext.tsx +12 -46
- 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/useAppStateListener.ts +26 -12
- package/src/hooks/useIsMountedRef.ts +36 -0
- package/src/hooks/useStreami18n.ts +5 -3
- 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 +67 -0
- package/src/i18n/ko.json +67 -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/UserAdmin.tsx +23 -0
- package/src/icons/index.ts +3 -2
- package/src/init.ts +5 -0
- package/src/mock-builders/api/queryChannels.js +1 -1
- 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/mock-builders/native/react-native-mock.js +1 -1
- package/src/native.ts +2 -13
- package/src/types/types.ts +16 -18
- package/src/utils/Streami18n.ts +12 -6
- package/src/utils/__tests__/Streami18n.test.js +9 -45
- package/src/utils/__tests__/getResizedImageUrl.test.js +57 -0
- package/src/utils/__tests__/utils.test.js +19 -0
- package/src/utils/date.ts +4 -0
- package/src/utils/getResizedImageUrl.ts +59 -0
- package/src/utils/getUrlOfImageAttachment.ts +10 -0
- package/src/utils/utils.ts +97 -142
- 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/Channel/utils/debounce.js +0 -20
- package/lib/commonjs/components/Channel/utils/debounce.js.map +0 -1
- package/lib/commonjs/components/Channel/utils/throttle.js +0 -20
- package/lib/commonjs/components/Channel/utils/throttle.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/commonjs/styleguideComponents/ArgumentsRenderer.js +0 -100
- package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js.map +0 -1
- package/lib/commonjs/styleguideComponents/BottomSheet.js +0 -25
- package/lib/commonjs/styleguideComponents/BottomSheet.js.map +0 -1
- package/lib/commonjs/styleguideComponents/JsDoc.js +0 -87
- package/lib/commonjs/styleguideComponents/JsDoc.js.map +0 -1
- package/lib/commonjs/styleguideComponents/Markdown.js +0 -12
- package/lib/commonjs/styleguideComponents/Markdown.js.map +0 -1
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js +0 -92
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js.map +0 -1
- package/lib/commonjs/styleguideComponents/PropsRenderer.js +0 -267
- package/lib/commonjs/styleguideComponents/PropsRenderer.js.map +0 -1
- package/lib/commonjs/styleguideComponents/Reanimated.js +0 -2
- package/lib/commonjs/styleguideComponents/Wrapper.js +0 -29
- package/lib/commonjs/styleguideComponents/Wrapper.js.map +0 -1
- package/lib/commonjs/styleguideComponents/register-react-native-web.js +0 -44
- package/lib/commonjs/styleguideComponents/register-react-native-web.js.map +0 -1
- package/lib/commonjs/styleguideComponents/resolveAssetSource.js +0 -11
- package/lib/commonjs/styleguideComponents/resolveAssetSource.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/Channel/utils/debounce.js +0 -20
- package/lib/module/components/Channel/utils/debounce.js.map +0 -1
- package/lib/module/components/Channel/utils/throttle.js +0 -20
- package/lib/module/components/Channel/utils/throttle.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/module/styleguideComponents/ArgumentsRenderer.js +0 -100
- package/lib/module/styleguideComponents/ArgumentsRenderer.js.map +0 -1
- package/lib/module/styleguideComponents/BottomSheet.js +0 -25
- package/lib/module/styleguideComponents/BottomSheet.js.map +0 -1
- package/lib/module/styleguideComponents/JsDoc.js +0 -87
- package/lib/module/styleguideComponents/JsDoc.js.map +0 -1
- package/lib/module/styleguideComponents/Markdown.js +0 -12
- package/lib/module/styleguideComponents/Markdown.js.map +0 -1
- package/lib/module/styleguideComponents/PathlineRenderer.js +0 -92
- package/lib/module/styleguideComponents/PathlineRenderer.js.map +0 -1
- package/lib/module/styleguideComponents/PropsRenderer.js +0 -267
- package/lib/module/styleguideComponents/PropsRenderer.js.map +0 -1
- package/lib/module/styleguideComponents/Reanimated.js +0 -2
- package/lib/module/styleguideComponents/Wrapper.js +0 -29
- package/lib/module/styleguideComponents/Wrapper.js.map +0 -1
- package/lib/module/styleguideComponents/register-react-native-web.js +0 -44
- package/lib/module/styleguideComponents/register-react-native-web.js.map +0 -1
- package/lib/module/styleguideComponents/resolveAssetSource.js +0 -11
- package/lib/module/styleguideComponents/resolveAssetSource.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/Channel/utils/debounce.d.ts +0 -2
- package/lib/typescript/components/Channel/utils/throttle.d.ts +0 -2
- 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 -29
- package/src/components/AutoCompleteInput/__tests__/MentionsItem.test.js +0 -62
- package/src/components/Channel/utils/debounce.ts +0 -12
- package/src/components/Channel/utils/throttle.ts +0 -12
- package/src/components/MessageList/__tests__/__snapshots__/MessageList.test.js.snap +0 -983
- package/src/components/MessageOverlay/MessageActions.tsx +0 -243
- package/src/icons/Left.tsx +0 -12
- package/src/icons/Right.tsx +0 -12
- package/src/styleguideComponents/ArgumentsRenderer.tsx +0 -59
- package/src/styleguideComponents/BottomSheet.tsx +0 -3
- package/src/styleguideComponents/JsDoc.tsx +0 -43
- package/src/styleguideComponents/Markdown.tsx +0 -1
- package/src/styleguideComponents/PathlineRenderer.tsx +0 -44
- package/src/styleguideComponents/PropsRenderer.tsx +0 -138
- package/src/styleguideComponents/Reanimated.tsx +0 -0
- package/src/styleguideComponents/Wrapper.tsx +0 -6
- package/src/styleguideComponents/register-react-native-web.js +0 -13
- package/src/styleguideComponents/resolveAssetSource.js +0 -2
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import React, { PropsWithChildren, useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import React, { PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { KeyboardAvoidingViewProps, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import debounce from 'lodash/debounce';
|
|
5
|
+
import throttle from 'lodash/throttle';
|
|
3
6
|
import {
|
|
4
7
|
ChannelState,
|
|
5
8
|
Channel as ChannelType,
|
|
@@ -13,17 +16,64 @@ import {
|
|
|
13
16
|
Message as StreamMessage,
|
|
14
17
|
} from 'stream-chat';
|
|
15
18
|
|
|
16
|
-
import { useAppStateListener } from '../../hooks/useAppStateListener';
|
|
17
19
|
import { useCreateChannelContext } from './hooks/useCreateChannelContext';
|
|
20
|
+
|
|
18
21
|
import { useCreateInputMessageInputContext } from './hooks/useCreateInputMessageInputContext';
|
|
22
|
+
|
|
19
23
|
import { useCreateMessagesContext } from './hooks/useCreateMessagesContext';
|
|
24
|
+
|
|
25
|
+
import { useCreateOwnCapabilitiesContext } from './hooks/useCreateOwnCapabilitiesContext';
|
|
20
26
|
import { useCreatePaginatedMessageListContext } from './hooks/useCreatePaginatedMessageListContext';
|
|
27
|
+
|
|
21
28
|
import { useCreateThreadContext } from './hooks/useCreateThreadContext';
|
|
29
|
+
|
|
22
30
|
import { useCreateTypingContext } from './hooks/useCreateTypingContext';
|
|
31
|
+
|
|
23
32
|
import { useTargetedMessage } from './hooks/useTargetedMessage';
|
|
24
|
-
import { heavyDebounce } from './utils/debounce';
|
|
25
|
-
import { lightThrottle } from './utils/throttle';
|
|
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 { DefaultStreamChatGenerics } from '../../types/types';
|
|
76
|
+
import { generateRandomId, MessageStatusTypes, ReactionData } from '../../utils/utils';
|
|
27
77
|
import { Attachment as AttachmentDefault } from '../Attachment/Attachment';
|
|
28
78
|
import { AttachmentActions as AttachmentActionsDefault } from '../Attachment/AttachmentActions';
|
|
29
79
|
import { Card as CardDefault } from '../Attachment/Card';
|
|
@@ -32,19 +82,22 @@ import { FileAttachmentGroup as FileAttachmentGroupDefault } from '../Attachment
|
|
|
32
82
|
import { FileIcon as FileIconDefault } from '../Attachment/FileIcon';
|
|
33
83
|
import { Gallery as GalleryDefault } from '../Attachment/Gallery';
|
|
34
84
|
import { Giphy as GiphyDefault } from '../Attachment/Giphy';
|
|
85
|
+
import { AutoCompleteSuggestionHeader as AutoCompleteSuggestionHeaderDefault } from '../AutoCompleteInput/AutoCompleteSuggestionHeader';
|
|
86
|
+
import { AutoCompleteSuggestionItem as AutoCompleteSuggestionItemDefault } from '../AutoCompleteInput/AutoCompleteSuggestionItem';
|
|
87
|
+
import { AutoCompleteSuggestionList as AutoCompleteSuggestionListDefault } from '../AutoCompleteInput/AutoCompleteSuggestionList';
|
|
35
88
|
import { EmptyStateIndicator as EmptyStateIndicatorDefault } from '../Indicators/EmptyStateIndicator';
|
|
36
89
|
import {
|
|
37
90
|
LoadingErrorIndicator as LoadingErrorIndicatorDefault,
|
|
38
91
|
LoadingErrorProps,
|
|
39
92
|
} from '../Indicators/LoadingErrorIndicator';
|
|
40
93
|
import { LoadingIndicator as LoadingIndicatorDefault } from '../Indicators/LoadingIndicator';
|
|
41
|
-
import { NetworkDownIndicator as NetworkDownIndicatorDefault } from '../MessageList/NetworkDownIndicator';
|
|
42
94
|
import { KeyboardCompatibleView as KeyboardCompatibleViewDefault } from '../KeyboardCompatibleView/KeyboardCompatibleView';
|
|
43
95
|
import { Message as MessageDefault } from '../Message/Message';
|
|
44
96
|
import { MessageAvatar as MessageAvatarDefault } from '../Message/MessageSimple/MessageAvatar';
|
|
45
97
|
import { MessageContent as MessageContentDefault } from '../Message/MessageSimple/MessageContent';
|
|
46
98
|
import { MessageDeleted as MessageDeletedDefault } from '../Message/MessageSimple/MessageDeleted';
|
|
47
99
|
import { MessageFooter as MessageFooterDefault } from '../Message/MessageSimple/MessageFooter';
|
|
100
|
+
import { MessagePinnedHeader as MessagePinnedHeaderDefault } from '../Message/MessageSimple/MessagePinnedHeader';
|
|
48
101
|
import { MessageReplies as MessageRepliesDefault } from '../Message/MessageSimple/MessageReplies';
|
|
49
102
|
import { MessageRepliesAvatars as MessageRepliesAvatarsDefault } from '../Message/MessageSimple/MessageRepliesAvatars';
|
|
50
103
|
import { MessageSimple as MessageSimpleDefault } from '../Message/MessageSimple/MessageSimple';
|
|
@@ -52,80 +105,28 @@ import { MessageStatus as MessageStatusDefault } from '../Message/MessageSimple/
|
|
|
52
105
|
import { ReactionList as ReactionListDefault } from '../Message/MessageSimple/ReactionList';
|
|
53
106
|
import { AttachButton as AttachButtonDefault } from '../MessageInput/AttachButton';
|
|
54
107
|
import { CommandsButton as CommandsButtonDefault } from '../MessageInput/CommandsButton';
|
|
108
|
+
import { CooldownTimer as CooldownTimerDefault } from '../MessageInput/CooldownTimer';
|
|
55
109
|
import { FileUploadPreview as FileUploadPreviewDefault } from '../MessageInput/FileUploadPreview';
|
|
56
110
|
import { ImageUploadPreview as ImageUploadPreviewDefault } from '../MessageInput/ImageUploadPreview';
|
|
57
111
|
import { InputButtons as InputButtonsDefault } from '../MessageInput/InputButtons';
|
|
58
112
|
import { MoreOptionsButton as MoreOptionsButtonDefault } from '../MessageInput/MoreOptionsButton';
|
|
59
113
|
import { SendButton as SendButtonDefault } from '../MessageInput/SendButton';
|
|
114
|
+
import { SendMessageDisallowedIndicator as SendMessageDisallowedIndicatorDefault } from '../MessageInput/SendMessageDisallowedIndicator';
|
|
60
115
|
import { ShowThreadMessageInChannelButton as ShowThreadMessageInChannelButtonDefault } from '../MessageInput/ShowThreadMessageInChannelButton';
|
|
61
116
|
import { UploadProgressIndicator as UploadProgressIndicatorDefault } from '../MessageInput/UploadProgressIndicator';
|
|
62
117
|
import { DateHeader as DateHeaderDefault } from '../MessageList/DateHeader';
|
|
118
|
+
import type { MessageType } from '../MessageList/hooks/useMessageList';
|
|
63
119
|
import { InlineDateSeparator as InlineDateSeparatorDefault } from '../MessageList/InlineDateSeparator';
|
|
64
120
|
import { InlineUnreadIndicator as InlineUnreadIndicatorDefault } from '../MessageList/InlineUnreadIndicator';
|
|
65
121
|
import { MessageList as MessageListDefault } from '../MessageList/MessageList';
|
|
66
122
|
import { MessageSystem as MessageSystemDefault } from '../MessageList/MessageSystem';
|
|
123
|
+
import { NetworkDownIndicator as NetworkDownIndicatorDefault } from '../MessageList/NetworkDownIndicator';
|
|
67
124
|
import { ScrollToBottomButton as ScrollToBottomButtonDefault } from '../MessageList/ScrollToBottomButton';
|
|
68
125
|
import { TypingIndicator as TypingIndicatorDefault } from '../MessageList/TypingIndicator';
|
|
69
126
|
import { TypingIndicatorContainer as TypingIndicatorContainerDefault } from '../MessageList/TypingIndicatorContainer';
|
|
70
127
|
import { OverlayReactionList as OverlayReactionListDefault } from '../MessageOverlay/OverlayReactionList';
|
|
71
128
|
import { Reply as ReplyDefault } from '../Reply/Reply';
|
|
72
129
|
|
|
73
|
-
import {
|
|
74
|
-
ChannelConfig,
|
|
75
|
-
ChannelContextValue,
|
|
76
|
-
ChannelProvider,
|
|
77
|
-
} from '../../contexts/channelContext/ChannelContext';
|
|
78
|
-
import { useChannelState } from '../../contexts/channelsStateContext/useChannelState';
|
|
79
|
-
import { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';
|
|
80
|
-
import {
|
|
81
|
-
InputConfig,
|
|
82
|
-
InputMessageInputContextValue,
|
|
83
|
-
MessageInputProvider,
|
|
84
|
-
} from '../../contexts/messageInputContext/MessageInputContext';
|
|
85
|
-
import {
|
|
86
|
-
MessagesConfig,
|
|
87
|
-
MessagesContextValue,
|
|
88
|
-
MessagesProvider,
|
|
89
|
-
} from '../../contexts/messagesContext/MessagesContext';
|
|
90
|
-
import {
|
|
91
|
-
PaginatedMessageListContextValue,
|
|
92
|
-
PaginatedMessageListProvider,
|
|
93
|
-
} from '../../contexts/paginatedMessageListContext/PaginatedMessageListContext';
|
|
94
|
-
import {
|
|
95
|
-
SuggestionsContextValue,
|
|
96
|
-
SuggestionsProvider,
|
|
97
|
-
} from '../../contexts/suggestionsContext/SuggestionsContext';
|
|
98
|
-
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
99
|
-
import { ThreadContextValue, ThreadProvider } from '../../contexts/threadContext/ThreadContext';
|
|
100
|
-
import {
|
|
101
|
-
TranslationContextValue,
|
|
102
|
-
useTranslationContext,
|
|
103
|
-
} from '../../contexts/translationContext/TranslationContext';
|
|
104
|
-
import { TypingProvider } from '../../contexts/typingContext/TypingContext';
|
|
105
|
-
import {
|
|
106
|
-
LOLReaction,
|
|
107
|
-
LoveReaction,
|
|
108
|
-
ThumbsDownReaction,
|
|
109
|
-
ThumbsUpReaction,
|
|
110
|
-
WutReaction,
|
|
111
|
-
} from '../../icons';
|
|
112
|
-
import { FlatList as FlatListDefault } from '../../native';
|
|
113
|
-
import { generateRandomId, ReactionData } from '../../utils/utils';
|
|
114
|
-
|
|
115
|
-
import type { MessageType } from '../MessageList/hooks/useMessageList';
|
|
116
|
-
import type { UseChannelStateValue } from '../../contexts/channelsStateContext/useChannelState';
|
|
117
|
-
|
|
118
|
-
import type {
|
|
119
|
-
DefaultAttachmentType,
|
|
120
|
-
DefaultChannelType,
|
|
121
|
-
DefaultCommandType,
|
|
122
|
-
DefaultEventType,
|
|
123
|
-
DefaultMessageType,
|
|
124
|
-
DefaultReactionType,
|
|
125
|
-
DefaultUserType,
|
|
126
|
-
UnknownType,
|
|
127
|
-
} from '../../types/types';
|
|
128
|
-
|
|
129
130
|
const styles = StyleSheet.create({
|
|
130
131
|
selectChannel: { fontWeight: 'bold', padding: 16 },
|
|
131
132
|
});
|
|
@@ -159,6 +160,17 @@ export const reactionData: ReactionData[] = [
|
|
|
159
160
|
*/
|
|
160
161
|
const scrollToFirstUnreadThreshold = 4;
|
|
161
162
|
|
|
163
|
+
const defaultThrottleInterval = 500;
|
|
164
|
+
const defaultDebounceInterval = 500;
|
|
165
|
+
const throttleOptions = {
|
|
166
|
+
leading: true,
|
|
167
|
+
trailing: true,
|
|
168
|
+
};
|
|
169
|
+
const debounceOptions = {
|
|
170
|
+
leading: true,
|
|
171
|
+
trailing: true,
|
|
172
|
+
};
|
|
173
|
+
|
|
162
174
|
/**
|
|
163
175
|
* Number of unread messages to show in first frame, when channel loads at first
|
|
164
176
|
* unread message. Only applicable if unread count > scrollToFirstUnreadThreshold.
|
|
@@ -166,65 +178,61 @@ const scrollToFirstUnreadThreshold = 4;
|
|
|
166
178
|
const unreadMessagesOnInitialLoadLimit = 2;
|
|
167
179
|
|
|
168
180
|
export type ChannelPropsWithContext<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
| 'StickyHeader'
|
|
188
|
-
>
|
|
189
|
-
> &
|
|
190
|
-
Pick<ChatContextValue<At, Ch, Co, Ev, Me, Re, Us>, 'client'> &
|
|
181
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
182
|
+
> = Pick<ChannelContextValue<StreamChatGenerics>, 'channel'> &
|
|
183
|
+
Partial<
|
|
184
|
+
Pick<
|
|
185
|
+
ChannelContextValue<StreamChatGenerics>,
|
|
186
|
+
| 'EmptyStateIndicator'
|
|
187
|
+
| 'enableMessageGroupingByUser'
|
|
188
|
+
| 'enforceUniqueReaction'
|
|
189
|
+
| 'giphyEnabled'
|
|
190
|
+
| 'hideStickyDateHeader'
|
|
191
|
+
| 'hideDateSeparators'
|
|
192
|
+
| 'LoadingIndicator'
|
|
193
|
+
| 'maxTimeBetweenGroupedMessages'
|
|
194
|
+
| 'NetworkDownIndicator'
|
|
195
|
+
| 'StickyHeader'
|
|
196
|
+
>
|
|
197
|
+
> &
|
|
198
|
+
Pick<ChatContextValue<StreamChatGenerics>, 'client'> &
|
|
191
199
|
Partial<
|
|
192
200
|
Omit<
|
|
193
|
-
InputMessageInputContextValue<
|
|
201
|
+
InputMessageInputContextValue<StreamChatGenerics>,
|
|
194
202
|
'quotedMessage' | 'editing' | 'clearEditingState' | 'clearQuotedMessageState' | 'sendMessage'
|
|
195
203
|
>
|
|
196
204
|
> &
|
|
197
|
-
Partial<
|
|
205
|
+
Partial<
|
|
206
|
+
Pick<
|
|
207
|
+
SuggestionsContextValue<StreamChatGenerics>,
|
|
208
|
+
'AutoCompleteSuggestionHeader' | 'AutoCompleteSuggestionItem' | 'AutoCompleteSuggestionList'
|
|
209
|
+
>
|
|
210
|
+
> &
|
|
198
211
|
Pick<TranslationContextValue, 't'> &
|
|
199
212
|
Partial<
|
|
200
213
|
Pick<
|
|
201
|
-
PaginatedMessageListContextValue<
|
|
214
|
+
PaginatedMessageListContextValue<StreamChatGenerics>,
|
|
202
215
|
'messages' | 'loadingMore' | 'loadingMoreRecent'
|
|
203
216
|
>
|
|
204
217
|
> &
|
|
205
|
-
UseChannelStateValue<
|
|
218
|
+
UseChannelStateValue<StreamChatGenerics> &
|
|
206
219
|
Partial<
|
|
207
220
|
Pick<
|
|
208
|
-
MessagesContextValue<
|
|
221
|
+
MessagesContextValue<StreamChatGenerics>,
|
|
209
222
|
| 'additionalTouchableProps'
|
|
210
|
-
| 'animatedLongPress'
|
|
211
223
|
| 'Attachment'
|
|
212
224
|
| 'AttachmentActions'
|
|
213
|
-
| 'blockUser'
|
|
214
225
|
| 'Card'
|
|
215
226
|
| 'CardCover'
|
|
216
227
|
| 'CardFooter'
|
|
217
228
|
| 'CardHeader'
|
|
218
|
-
| 'copyMessage'
|
|
219
229
|
| 'DateHeader'
|
|
220
|
-
| '
|
|
230
|
+
| 'deletedMessagesVisibilityType'
|
|
221
231
|
| 'disableTypingIndicator'
|
|
222
232
|
| 'dismissKeyboardOnMessageTouch'
|
|
223
|
-
| 'editMessage'
|
|
224
233
|
| 'FileAttachment'
|
|
225
234
|
| 'FileAttachmentIcon'
|
|
226
235
|
| 'FileAttachmentGroup'
|
|
227
|
-
| 'flagMessage'
|
|
228
236
|
| 'FlatList'
|
|
229
237
|
| 'forceAlignMessages'
|
|
230
238
|
| 'formatDate'
|
|
@@ -236,12 +244,14 @@ export type ChannelPropsWithContext<
|
|
|
236
244
|
| 'handleEdit'
|
|
237
245
|
| 'handleFlag'
|
|
238
246
|
| 'handleMute'
|
|
247
|
+
| 'handlePinMessage'
|
|
239
248
|
| 'handleReaction'
|
|
240
249
|
| 'handleQuotedReply'
|
|
241
250
|
| 'handleRetry'
|
|
242
251
|
| 'handleThreadReply'
|
|
243
252
|
| 'InlineDateSeparator'
|
|
244
253
|
| 'InlineUnreadIndicator'
|
|
254
|
+
| 'legacyImageViewerSwipeBehaviour'
|
|
245
255
|
| 'markdownRules'
|
|
246
256
|
| 'Message'
|
|
247
257
|
| 'messageActions'
|
|
@@ -252,34 +262,30 @@ export type ChannelPropsWithContext<
|
|
|
252
262
|
| 'MessageFooter'
|
|
253
263
|
| 'MessageHeader'
|
|
254
264
|
| 'MessageList'
|
|
265
|
+
| 'MessagePinnedHeader'
|
|
255
266
|
| 'MessageReplies'
|
|
256
267
|
| 'MessageRepliesAvatars'
|
|
257
268
|
| 'MessageSimple'
|
|
258
269
|
| 'MessageStatus'
|
|
259
270
|
| 'MessageSystem'
|
|
260
271
|
| 'MessageText'
|
|
261
|
-
| 'muteUser'
|
|
262
272
|
| 'myMessageTheme'
|
|
263
|
-
| 'onDoubleTapMessage'
|
|
264
273
|
| 'onLongPressMessage'
|
|
265
274
|
| 'onPressInMessage'
|
|
266
275
|
| 'onPressMessage'
|
|
267
276
|
| 'OverlayReactionList'
|
|
268
|
-
| 'quotedReply'
|
|
269
277
|
| 'ReactionList'
|
|
270
278
|
| 'Reply'
|
|
271
|
-
| 'retry'
|
|
272
279
|
| 'ScrollToBottomButton'
|
|
273
280
|
| 'selectReaction'
|
|
274
281
|
| 'supportedReactions'
|
|
275
|
-
| 'threadReply'
|
|
276
282
|
| 'TypingIndicator'
|
|
277
283
|
| 'TypingIndicatorContainer'
|
|
278
284
|
| 'UrlPreview'
|
|
279
285
|
>
|
|
280
286
|
> &
|
|
281
287
|
Partial<
|
|
282
|
-
Pick<ThreadContextValue<
|
|
288
|
+
Pick<ThreadContextValue<StreamChatGenerics>, 'allowThreadMessagesInChannel' | 'thread'>
|
|
283
289
|
> & {
|
|
284
290
|
shouldSyncChannel: boolean;
|
|
285
291
|
/**
|
|
@@ -303,7 +309,7 @@ export type ChannelPropsWithContext<
|
|
|
303
309
|
* Overrides the Stream default mark channel read request (Advanced usage only)
|
|
304
310
|
* @param channel Channel object
|
|
305
311
|
*/
|
|
306
|
-
doMarkReadRequest?: (channel: ChannelType<
|
|
312
|
+
doMarkReadRequest?: (channel: ChannelType<StreamChatGenerics>) => void;
|
|
307
313
|
/**
|
|
308
314
|
* Overrides the Stream default send message request (Advanced usage only)
|
|
309
315
|
* @param channelId
|
|
@@ -311,8 +317,8 @@ export type ChannelPropsWithContext<
|
|
|
311
317
|
*/
|
|
312
318
|
doSendMessageRequest?: (
|
|
313
319
|
channelId: string,
|
|
314
|
-
messageData: StreamMessage<
|
|
315
|
-
) => Promise<SendMessageAPIResponse<
|
|
320
|
+
messageData: StreamMessage<StreamChatGenerics>,
|
|
321
|
+
) => Promise<SendMessageAPIResponse<StreamChatGenerics>>;
|
|
316
322
|
/**
|
|
317
323
|
* Overrides the Stream default update message request (Advanced usage only)
|
|
318
324
|
* @param channelId
|
|
@@ -320,8 +326,8 @@ export type ChannelPropsWithContext<
|
|
|
320
326
|
*/
|
|
321
327
|
doUpdateMessageRequest?: (
|
|
322
328
|
channelId: string,
|
|
323
|
-
updatedMessage: Parameters<StreamChat<
|
|
324
|
-
) => ReturnType<StreamChat<
|
|
329
|
+
updatedMessage: Parameters<StreamChat<StreamChatGenerics>['updateMessage']>[0],
|
|
330
|
+
) => ReturnType<StreamChat<StreamChatGenerics>['updateMessage']>;
|
|
325
331
|
/**
|
|
326
332
|
* E.g. Once unread count exceeds 255, display unread count as 255+ instead of actual count.
|
|
327
333
|
* Also 255 is the limit per Stream chat channel for unread count.
|
|
@@ -359,42 +365,33 @@ export type ChannelPropsWithContext<
|
|
|
359
365
|
LoadingErrorIndicator?: React.ComponentType<LoadingErrorProps>;
|
|
360
366
|
maxMessageLength?: number;
|
|
361
367
|
messageId?: string;
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
readEventsEnabled?: boolean;
|
|
368
|
+
newMessageStateUpdateThrottleInterval?: number;
|
|
369
|
+
overrideOwnCapabilities?: OwnCapabilitiesContextValue;
|
|
370
|
+
stateUpdateThrottleInterval?: number;
|
|
366
371
|
/**
|
|
367
372
|
* Tells if channel is rendering a thread list
|
|
368
373
|
*/
|
|
369
374
|
threadList?: boolean;
|
|
370
|
-
threadRepliesEnabled?: boolean;
|
|
371
|
-
typingEventsEnabled?: boolean;
|
|
372
|
-
uploadsEnabled?: boolean;
|
|
373
375
|
};
|
|
374
376
|
|
|
375
377
|
const ChannelWithContext = <
|
|
376
|
-
|
|
377
|
-
Ch extends UnknownType = DefaultChannelType,
|
|
378
|
-
Co extends string = DefaultCommandType,
|
|
379
|
-
Ev extends UnknownType = DefaultEventType,
|
|
380
|
-
Me extends UnknownType = DefaultMessageType,
|
|
381
|
-
Re extends UnknownType = DefaultReactionType,
|
|
382
|
-
Us extends UnknownType = DefaultUserType,
|
|
378
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
383
379
|
>(
|
|
384
|
-
props: PropsWithChildren<ChannelPropsWithContext<
|
|
380
|
+
props: PropsWithChildren<ChannelPropsWithContext<StreamChatGenerics>>,
|
|
385
381
|
) => {
|
|
386
382
|
const {
|
|
387
383
|
additionalKeyboardAvoidingViewProps,
|
|
388
384
|
additionalTextInputProps,
|
|
389
385
|
additionalTouchableProps,
|
|
390
386
|
allowThreadMessagesInChannel = true,
|
|
391
|
-
animatedLongPress,
|
|
392
387
|
AttachButton = AttachButtonDefault,
|
|
393
388
|
Attachment = AttachmentDefault,
|
|
394
389
|
AttachmentActions = AttachmentActionsDefault,
|
|
390
|
+
AutoCompleteSuggestionHeader = AutoCompleteSuggestionHeaderDefault,
|
|
391
|
+
AutoCompleteSuggestionItem = AutoCompleteSuggestionItemDefault,
|
|
392
|
+
AutoCompleteSuggestionList = AutoCompleteSuggestionListDefault,
|
|
395
393
|
autoCompleteSuggestionsLimit,
|
|
396
394
|
autoCompleteTriggerSettings,
|
|
397
|
-
blockUser,
|
|
398
395
|
Card = CardDefault,
|
|
399
396
|
CardCover,
|
|
400
397
|
CardFooter,
|
|
@@ -402,12 +399,11 @@ const ChannelWithContext = <
|
|
|
402
399
|
channel,
|
|
403
400
|
children,
|
|
404
401
|
client,
|
|
405
|
-
closeSuggestions,
|
|
406
402
|
CommandsButton = CommandsButtonDefault,
|
|
407
403
|
compressImageQuality,
|
|
408
|
-
|
|
404
|
+
CooldownTimer = CooldownTimerDefault,
|
|
409
405
|
DateHeader = DateHeaderDefault,
|
|
410
|
-
|
|
406
|
+
deletedMessagesVisibilityType = 'always',
|
|
411
407
|
disableIfFrozenChannel = true,
|
|
412
408
|
disableKeyboardCompatibleView = false,
|
|
413
409
|
disableTypingIndicator,
|
|
@@ -417,14 +413,13 @@ const ChannelWithContext = <
|
|
|
417
413
|
doMarkReadRequest,
|
|
418
414
|
doSendMessageRequest,
|
|
419
415
|
doUpdateMessageRequest,
|
|
420
|
-
editMessage: editMessageProp,
|
|
421
416
|
EmptyStateIndicator = EmptyStateIndicatorDefault,
|
|
417
|
+
enableMessageGroupingByUser = true,
|
|
422
418
|
enforceUniqueReaction = false,
|
|
423
419
|
FileAttachment = FileAttachmentDefault,
|
|
424
420
|
FileAttachmentGroup = FileAttachmentGroupDefault,
|
|
425
421
|
FileAttachmentIcon = FileIconDefault,
|
|
426
422
|
FileUploadPreview = FileUploadPreviewDefault,
|
|
427
|
-
flagMessage,
|
|
428
423
|
FlatList = FlatListDefault,
|
|
429
424
|
forceAlignMessages,
|
|
430
425
|
formatDate,
|
|
@@ -438,6 +433,7 @@ const ChannelWithContext = <
|
|
|
438
433
|
handleEdit,
|
|
439
434
|
handleFlag,
|
|
440
435
|
handleMute,
|
|
436
|
+
handlePinMessage,
|
|
441
437
|
handleQuotedReply,
|
|
442
438
|
handleReaction,
|
|
443
439
|
handleRetry,
|
|
@@ -446,6 +442,7 @@ const ChannelWithContext = <
|
|
|
446
442
|
hasFilePicker = true,
|
|
447
443
|
hasImagePicker = true,
|
|
448
444
|
hideDateSeparators = false,
|
|
445
|
+
hideStickyDateHeader = false,
|
|
449
446
|
ImageUploadPreview = ImageUploadPreviewDefault,
|
|
450
447
|
initialScrollToFirstUnreadMessage = false,
|
|
451
448
|
initialValue,
|
|
@@ -456,6 +453,7 @@ const ChannelWithContext = <
|
|
|
456
453
|
keyboardBehavior,
|
|
457
454
|
KeyboardCompatibleView = KeyboardCompatibleViewDefault,
|
|
458
455
|
keyboardVerticalOffset,
|
|
456
|
+
legacyImageViewerSwipeBehaviour = false,
|
|
459
457
|
LoadingErrorIndicator = LoadingErrorIndicatorDefault,
|
|
460
458
|
LoadingIndicator = LoadingIndicatorDefault,
|
|
461
459
|
loadingMore: loadingMoreProp,
|
|
@@ -477,6 +475,7 @@ const ChannelWithContext = <
|
|
|
477
475
|
MessageHeader,
|
|
478
476
|
messageId,
|
|
479
477
|
MessageList = MessageListDefault,
|
|
478
|
+
MessagePinnedHeader = MessagePinnedHeaderDefault,
|
|
480
479
|
MessageReplies = MessageRepliesDefault,
|
|
481
480
|
MessageRepliesAvatars = MessageRepliesAvatarsDefault,
|
|
482
481
|
messages,
|
|
@@ -485,29 +484,23 @@ const ChannelWithContext = <
|
|
|
485
484
|
MessageSystem = MessageSystemDefault,
|
|
486
485
|
MessageText,
|
|
487
486
|
MoreOptionsButton = MoreOptionsButtonDefault,
|
|
488
|
-
mutesEnabled: mutesEnabledProp,
|
|
489
|
-
muteUser,
|
|
490
487
|
myMessageTheme,
|
|
488
|
+
newMessageStateUpdateThrottleInterval = defaultThrottleInterval,
|
|
491
489
|
NetworkDownIndicator = NetworkDownIndicatorDefault,
|
|
492
490
|
numberOfLines = 5,
|
|
493
491
|
onChangeText,
|
|
494
|
-
onDoubleTapMessage,
|
|
495
492
|
onLongPressMessage,
|
|
493
|
+
overrideOwnCapabilities,
|
|
496
494
|
onPressInMessage,
|
|
497
495
|
onPressMessage,
|
|
498
|
-
openSuggestions,
|
|
499
496
|
OverlayReactionList = OverlayReactionListDefault,
|
|
500
|
-
quotedRepliesEnabled: quotedRepliesEnabledProp,
|
|
501
|
-
quotedReply,
|
|
502
497
|
ReactionList = ReactionListDefault,
|
|
503
|
-
reactionsEnabled: reactionsEnabledProp,
|
|
504
498
|
read,
|
|
505
|
-
readEventsEnabled: readEventsEnabledProp,
|
|
506
499
|
Reply = ReplyDefault,
|
|
507
|
-
retry,
|
|
508
500
|
ScrollToBottomButton = ScrollToBottomButtonDefault,
|
|
509
501
|
selectReaction,
|
|
510
502
|
SendButton = SendButtonDefault,
|
|
503
|
+
SendMessageDisallowedIndicator = SendMessageDisallowedIndicatorDefault,
|
|
511
504
|
sendImageAsync = false,
|
|
512
505
|
setInputRef,
|
|
513
506
|
setMembers,
|
|
@@ -519,21 +512,17 @@ const ChannelWithContext = <
|
|
|
519
512
|
setWatchers,
|
|
520
513
|
shouldSyncChannel,
|
|
521
514
|
ShowThreadMessageInChannelButton = ShowThreadMessageInChannelButtonDefault,
|
|
515
|
+
stateUpdateThrottleInterval = defaultThrottleInterval,
|
|
522
516
|
StickyHeader,
|
|
523
517
|
supportedReactions = reactionData,
|
|
524
518
|
t,
|
|
525
519
|
thread: threadProps,
|
|
526
520
|
threadList,
|
|
527
521
|
threadMessages,
|
|
528
|
-
threadRepliesEnabled: threadRepliesEnabledProp,
|
|
529
|
-
threadReply,
|
|
530
522
|
typing,
|
|
531
|
-
typingEventsEnabled: typingEventsEnabledProp,
|
|
532
523
|
TypingIndicator = TypingIndicatorDefault,
|
|
533
524
|
TypingIndicatorContainer = TypingIndicatorContainerDefault,
|
|
534
|
-
updateSuggestions,
|
|
535
525
|
UploadProgressIndicator = UploadProgressIndicatorDefault,
|
|
536
|
-
uploadsEnabled: uploadsEnabledProp,
|
|
537
526
|
UrlPreview = CardDefault,
|
|
538
527
|
watcherCount,
|
|
539
528
|
watchers,
|
|
@@ -545,19 +534,18 @@ const ChannelWithContext = <
|
|
|
545
534
|
colors: { black },
|
|
546
535
|
},
|
|
547
536
|
} = useTheme();
|
|
548
|
-
|
|
549
|
-
const [editing, setEditing] = useState<boolean | MessageType<
|
|
550
|
-
const [error, setError] = useState(false);
|
|
537
|
+
const [deleted, setDeleted] = useState(false);
|
|
538
|
+
const [editing, setEditing] = useState<boolean | MessageType<StreamChatGenerics>>(false);
|
|
539
|
+
const [error, setError] = useState<Error | boolean>(false);
|
|
551
540
|
const [hasMore, setHasMore] = useState(true);
|
|
552
|
-
const [lastRead, setLastRead] =
|
|
553
|
-
|
|
554
|
-
const [loading, setLoading] = useState(true);
|
|
541
|
+
const [lastRead, setLastRead] = useState<ChannelContextValue<StreamChatGenerics>['lastRead']>();
|
|
542
|
+
const [loading, setLoading] = useState(!channel?.state.messages.length);
|
|
555
543
|
const [loadingMore, setLoadingMore] = useState(false);
|
|
556
544
|
|
|
557
545
|
const [loadingMoreRecent, setLoadingMoreRecent] = useState(false);
|
|
558
546
|
const [quotedMessage, setQuotedMessage] =
|
|
559
|
-
useState<boolean | MessageType<
|
|
560
|
-
const [thread, setThread] = useState<ThreadContextValue<
|
|
547
|
+
useState<boolean | MessageType<StreamChatGenerics>>(false);
|
|
548
|
+
const [thread, setThread] = useState<ThreadContextValue<StreamChatGenerics>['thread']>(
|
|
561
549
|
threadProps || null,
|
|
562
550
|
);
|
|
563
551
|
const [threadHasMore, setThreadHasMore] = useState(true);
|
|
@@ -571,7 +559,6 @@ const ChannelWithContext = <
|
|
|
571
559
|
useEffect(() => {
|
|
572
560
|
const initChannel = () => {
|
|
573
561
|
if (!channel || !shouldSyncChannel) return;
|
|
574
|
-
|
|
575
562
|
/**
|
|
576
563
|
* Loading channel at first unread message requires channel to be initialized in the first place,
|
|
577
564
|
* since we use read state on channel to decide what offset to load channel at.
|
|
@@ -623,15 +610,10 @@ const ChannelWithContext = <
|
|
|
623
610
|
|
|
624
611
|
const handleAppBackground = useCallback(() => {
|
|
625
612
|
if (channel) {
|
|
626
|
-
channel.sendEvent({
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
Ev,
|
|
631
|
-
Me,
|
|
632
|
-
Re,
|
|
633
|
-
Us
|
|
634
|
-
>);
|
|
613
|
+
channel.sendEvent({
|
|
614
|
+
parent_id: thread?.id,
|
|
615
|
+
type: 'typing.stop',
|
|
616
|
+
} as StreamEvent<StreamChatGenerics>);
|
|
635
617
|
}
|
|
636
618
|
}, [thread?.id, channelId]);
|
|
637
619
|
|
|
@@ -651,43 +633,77 @@ const ChannelWithContext = <
|
|
|
651
633
|
/**
|
|
652
634
|
* CHANNEL METHODS
|
|
653
635
|
*/
|
|
654
|
-
const markRead: ChannelContextValue<
|
|
655
|
-
(
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
if (doMarkReadRequest) {
|
|
661
|
-
doMarkReadRequest(channel);
|
|
662
|
-
} else {
|
|
663
|
-
logChatPromiseExecution(channel.markRead(), 'mark read');
|
|
664
|
-
}
|
|
665
|
-
},
|
|
666
|
-
);
|
|
667
|
-
|
|
668
|
-
const copyTypingState = lightThrottle(() => {
|
|
669
|
-
if (channel) {
|
|
670
|
-
setTyping({ ...channel.state.typing });
|
|
671
|
-
}
|
|
672
|
-
});
|
|
673
|
-
|
|
674
|
-
const copyReadState = lightThrottle(() => {
|
|
675
|
-
if (channel) {
|
|
676
|
-
setRead({ ...channel.state.read });
|
|
677
|
-
}
|
|
678
|
-
});
|
|
636
|
+
const markRead: ChannelContextValue<StreamChatGenerics>['markRead'] = useRef(
|
|
637
|
+
throttle(
|
|
638
|
+
() => {
|
|
639
|
+
if (!channel || channel?.disconnected || !clientChannelConfig?.read_events) {
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
679
642
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
643
|
+
if (doMarkReadRequest) {
|
|
644
|
+
doMarkReadRequest(channel);
|
|
645
|
+
} else {
|
|
646
|
+
logChatPromiseExecution(channel.markRead(), 'mark read');
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
defaultThrottleInterval,
|
|
650
|
+
throttleOptions,
|
|
651
|
+
),
|
|
652
|
+
).current;
|
|
653
|
+
|
|
654
|
+
const copyMessagesState = useRef(
|
|
655
|
+
throttle(
|
|
656
|
+
() => {
|
|
657
|
+
if (channel) {
|
|
658
|
+
setMessages([...channel.state.messages]);
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
newMessageStateUpdateThrottleInterval,
|
|
662
|
+
throttleOptions,
|
|
663
|
+
),
|
|
664
|
+
).current;
|
|
665
|
+
|
|
666
|
+
const copyTypingState = useRef(
|
|
667
|
+
throttle(
|
|
668
|
+
() => {
|
|
669
|
+
if (channel) {
|
|
670
|
+
setTyping({ ...channel.state.typing });
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
stateUpdateThrottleInterval,
|
|
674
|
+
throttleOptions,
|
|
675
|
+
),
|
|
676
|
+
).current;
|
|
677
|
+
|
|
678
|
+
const copyReadState = useRef(
|
|
679
|
+
throttle(
|
|
680
|
+
() => {
|
|
681
|
+
if (channel) {
|
|
682
|
+
setRead({ ...channel.state.read });
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
stateUpdateThrottleInterval,
|
|
686
|
+
throttleOptions,
|
|
687
|
+
),
|
|
688
|
+
).current;
|
|
689
|
+
|
|
690
|
+
const copyChannelState = useRef(
|
|
691
|
+
throttle(
|
|
692
|
+
() => {
|
|
693
|
+
setLoading(false);
|
|
694
|
+
if (channel) {
|
|
695
|
+
setMembers({ ...channel.state.members });
|
|
696
|
+
setMessages([...channel.state.messages]);
|
|
697
|
+
setRead({ ...channel.state.read });
|
|
698
|
+
setTyping({ ...channel.state.typing });
|
|
699
|
+
setWatcherCount(channel.state.watcher_count);
|
|
700
|
+
setWatchers({ ...channel.state.watchers });
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
stateUpdateThrottleInterval,
|
|
704
|
+
throttleOptions,
|
|
705
|
+
),
|
|
706
|
+
).current;
|
|
691
707
|
|
|
692
708
|
const connectionRecoveredHandler = () => {
|
|
693
709
|
if (channel && shouldSyncChannel) {
|
|
@@ -704,7 +720,7 @@ const ChannelWithContext = <
|
|
|
704
720
|
}
|
|
705
721
|
};
|
|
706
722
|
|
|
707
|
-
const handleEvent: EventHandler<
|
|
723
|
+
const handleEvent: EventHandler<StreamChatGenerics> = (event) => {
|
|
708
724
|
if (shouldSyncChannel) {
|
|
709
725
|
if (thread) {
|
|
710
726
|
const updatedThreadMessages =
|
|
@@ -721,6 +737,8 @@ const ChannelWithContext = <
|
|
|
721
737
|
copyTypingState();
|
|
722
738
|
} else if (event.type === 'message.read') {
|
|
723
739
|
copyReadState();
|
|
740
|
+
} else if (event.type === 'message.new') {
|
|
741
|
+
copyMessagesState();
|
|
724
742
|
} else if (channel) {
|
|
725
743
|
copyChannelState();
|
|
726
744
|
}
|
|
@@ -728,24 +746,40 @@ const ChannelWithContext = <
|
|
|
728
746
|
};
|
|
729
747
|
|
|
730
748
|
useEffect(() => {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
749
|
+
const channelSubscriptions: Array<ReturnType<ChannelType['on']>> = [];
|
|
750
|
+
const clientSubscriptions: Array<ReturnType<StreamChat['on']>> = [];
|
|
751
|
+
|
|
752
|
+
const subscribe = () => {
|
|
753
|
+
if (!channel) return;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* The more complex sync logic around internet connectivity (NetInfo) is part of Chat.tsx
|
|
757
|
+
* listen to client.connection.recovered and all channel events
|
|
758
|
+
*/
|
|
759
|
+
clientSubscriptions.push(client.on('connection.recovered', connectionRecoveredHandler));
|
|
760
|
+
clientSubscriptions.push(client.on('connection.changed', connectionChangedHandler));
|
|
761
|
+
clientSubscriptions.push(
|
|
762
|
+
client.on('channel.deleted', (event) => {
|
|
763
|
+
if (event.cid === channel.cid) {
|
|
764
|
+
setDeleted(true);
|
|
765
|
+
}
|
|
766
|
+
}),
|
|
767
|
+
);
|
|
768
|
+
channelSubscriptions.push(channel.on(handleEvent));
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
subscribe();
|
|
738
772
|
|
|
739
773
|
return () => {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
channel?.off(handleEvent);
|
|
774
|
+
clientSubscriptions.forEach((s) => s.unsubscribe());
|
|
775
|
+
channelSubscriptions.forEach((s) => s.unsubscribe());
|
|
743
776
|
};
|
|
744
777
|
}, [channelId, connectionChangedHandler, connectionRecoveredHandler, handleEvent]);
|
|
745
778
|
|
|
746
779
|
const channelQueryCall = async (queryCall: () => void = () => null) => {
|
|
747
780
|
setError(false);
|
|
748
|
-
|
|
781
|
+
// Skips setting loading state when there are messages in the channel
|
|
782
|
+
setLoading(!channel?.state.messages.length);
|
|
749
783
|
|
|
750
784
|
try {
|
|
751
785
|
await queryCall();
|
|
@@ -753,7 +787,11 @@ const ChannelWithContext = <
|
|
|
753
787
|
setHasMore(true);
|
|
754
788
|
copyChannelState();
|
|
755
789
|
} catch (err) {
|
|
756
|
-
|
|
790
|
+
if (err instanceof Error) {
|
|
791
|
+
setError(err);
|
|
792
|
+
} else {
|
|
793
|
+
setError(true);
|
|
794
|
+
}
|
|
757
795
|
setLoading(false);
|
|
758
796
|
setLastRead(new Date());
|
|
759
797
|
}
|
|
@@ -852,15 +890,11 @@ const ChannelWithContext = <
|
|
|
852
890
|
* @param before Number of message to query before messageId
|
|
853
891
|
* @param after Number of message to query after messageId
|
|
854
892
|
*/
|
|
855
|
-
const loadChannelAtMessage: ChannelContextValue<
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
Me,
|
|
861
|
-
Re,
|
|
862
|
-
Us
|
|
863
|
-
>['loadChannelAtMessage'] = ({ after = 2, before = 30, messageId }) =>
|
|
893
|
+
const loadChannelAtMessage: ChannelContextValue<StreamChatGenerics>['loadChannelAtMessage'] = ({
|
|
894
|
+
after = 2,
|
|
895
|
+
before = 30,
|
|
896
|
+
messageId,
|
|
897
|
+
}) =>
|
|
864
898
|
channelQueryCall(async () => {
|
|
865
899
|
await queryAtMessage({ after, before, messageId });
|
|
866
900
|
|
|
@@ -903,7 +937,11 @@ const ChannelWithContext = <
|
|
|
903
937
|
}
|
|
904
938
|
} catch (err) {
|
|
905
939
|
console.warn('Thread loading request failed with error', err);
|
|
906
|
-
|
|
940
|
+
if (err instanceof Error) {
|
|
941
|
+
setError(err);
|
|
942
|
+
} else {
|
|
943
|
+
setError(true);
|
|
944
|
+
}
|
|
907
945
|
setThreadLoadingMore(false);
|
|
908
946
|
throw err;
|
|
909
947
|
}
|
|
@@ -952,14 +990,16 @@ const ChannelWithContext = <
|
|
|
952
990
|
created_at: message.created_at.toString(),
|
|
953
991
|
pinned_at: message.pinned_at?.toString(),
|
|
954
992
|
updated_at: message.updated_at?.toString(),
|
|
955
|
-
} as unknown as MessageResponse<
|
|
993
|
+
} as unknown as MessageResponse<StreamChatGenerics>);
|
|
956
994
|
|
|
957
995
|
const failedMessages = messages
|
|
958
|
-
.filter((message) => message.status ===
|
|
996
|
+
.filter((message) => message.status === MessageStatusTypes.FAILED)
|
|
959
997
|
.map(parseMessage);
|
|
960
998
|
|
|
961
999
|
const failedThreadMessages = thread
|
|
962
|
-
? threadMessages
|
|
1000
|
+
? threadMessages
|
|
1001
|
+
.filter((message) => message.status === MessageStatusTypes.FAILED)
|
|
1002
|
+
.map(parseMessage)
|
|
963
1003
|
: [];
|
|
964
1004
|
|
|
965
1005
|
const oldListTopMessageCreatedAt = oldListTopMessage.created_at;
|
|
@@ -1006,7 +1046,11 @@ const ChannelWithContext = <
|
|
|
1006
1046
|
setThreadMessages([...channel.state.threads[thread.id]]);
|
|
1007
1047
|
}
|
|
1008
1048
|
} catch (err) {
|
|
1009
|
-
|
|
1049
|
+
if (err instanceof Error) {
|
|
1050
|
+
setError(err);
|
|
1051
|
+
} else {
|
|
1052
|
+
setError(true);
|
|
1053
|
+
}
|
|
1010
1054
|
setLoading(false);
|
|
1011
1055
|
}
|
|
1012
1056
|
|
|
@@ -1047,7 +1091,7 @@ const ChannelWithContext = <
|
|
|
1047
1091
|
after = 10,
|
|
1048
1092
|
before = 10,
|
|
1049
1093
|
messageId,
|
|
1050
|
-
}: Parameters<ChannelContextValue<
|
|
1094
|
+
}: Parameters<ChannelContextValue<StreamChatGenerics>['loadChannelAtMessage']>[0]) => {
|
|
1051
1095
|
if (!channel) return;
|
|
1052
1096
|
channel.state.setIsUpToDate(false);
|
|
1053
1097
|
channel.state.clearMessages();
|
|
@@ -1111,37 +1155,29 @@ const ChannelWithContext = <
|
|
|
1111
1155
|
}
|
|
1112
1156
|
};
|
|
1113
1157
|
|
|
1158
|
+
// In case the channel is disconnected which may happen when channel is deleted,
|
|
1159
|
+
// underlying js client throws an error. Following function ensures that Channel component
|
|
1160
|
+
// won't result in error in such a case.
|
|
1161
|
+
const getChannelConfigSafely = () => {
|
|
1162
|
+
try {
|
|
1163
|
+
return channel?.getConfig();
|
|
1164
|
+
} catch (_) {
|
|
1165
|
+
return null;
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
|
|
1114
1169
|
/**
|
|
1115
1170
|
* Channel configs for use in disabling local functionality.
|
|
1116
1171
|
* Nullish coalescing is used to give first priority to props to override
|
|
1117
1172
|
* the server settings. Then priority to server settings to override defaults.
|
|
1118
1173
|
*/
|
|
1119
|
-
const clientChannelConfig =
|
|
1120
|
-
typeof channel?.getConfig === 'function' ? channel.getConfig() : undefined;
|
|
1121
|
-
|
|
1122
|
-
const messagesConfig: MessagesConfig = {
|
|
1123
|
-
/**
|
|
1124
|
-
* Replace with backend flag once its ready
|
|
1125
|
-
*/
|
|
1126
|
-
mutesEnabled: mutesEnabledProp ?? clientChannelConfig?.mutes ?? true,
|
|
1127
|
-
quotedRepliesEnabled: quotedRepliesEnabledProp ?? true,
|
|
1128
|
-
reactionsEnabled: reactionsEnabledProp ?? clientChannelConfig?.reactions ?? true,
|
|
1129
|
-
threadRepliesEnabled: threadRepliesEnabledProp ?? clientChannelConfig?.replies ?? true,
|
|
1130
|
-
};
|
|
1131
|
-
const channelConfig: ChannelConfig = {
|
|
1132
|
-
readEventsEnabled: readEventsEnabledProp ?? clientChannelConfig?.read_events ?? true,
|
|
1133
|
-
typingEventsEnabled: typingEventsEnabledProp ?? clientChannelConfig?.typing_events ?? true,
|
|
1134
|
-
};
|
|
1135
|
-
const inputConfig: InputConfig = {
|
|
1136
|
-
maxMessageLength: maxMessageLengthProp ?? clientChannelConfig?.max_message_length ?? undefined,
|
|
1137
|
-
uploadsEnabled: uploadsEnabledProp ?? clientChannelConfig?.uploads ?? true,
|
|
1138
|
-
};
|
|
1174
|
+
const clientChannelConfig = getChannelConfigSafely();
|
|
1139
1175
|
|
|
1140
1176
|
/**
|
|
1141
1177
|
* MESSAGE METHODS
|
|
1142
1178
|
*/
|
|
1143
1179
|
|
|
1144
|
-
const updateMessage: MessagesContextValue<
|
|
1180
|
+
const updateMessage: MessagesContextValue<StreamChatGenerics>['updateMessage'] = (
|
|
1145
1181
|
updatedMessage,
|
|
1146
1182
|
extraState = {},
|
|
1147
1183
|
) => {
|
|
@@ -1157,8 +1193,8 @@ const ChannelWithContext = <
|
|
|
1157
1193
|
};
|
|
1158
1194
|
|
|
1159
1195
|
const replaceMessage = (
|
|
1160
|
-
oldMessage: MessageResponse<
|
|
1161
|
-
newMessage: MessageResponse<
|
|
1196
|
+
oldMessage: MessageResponse<StreamChatGenerics>,
|
|
1197
|
+
newMessage: MessageResponse<StreamChatGenerics>,
|
|
1162
1198
|
) => {
|
|
1163
1199
|
if (channel) {
|
|
1164
1200
|
channel.state.removeMessage(oldMessage);
|
|
@@ -1177,7 +1213,7 @@ const ChannelWithContext = <
|
|
|
1177
1213
|
parent_id,
|
|
1178
1214
|
text,
|
|
1179
1215
|
...extraFields
|
|
1180
|
-
}: Partial<StreamMessage<
|
|
1216
|
+
}: Partial<StreamMessage<StreamChatGenerics>>) => {
|
|
1181
1217
|
const preview = {
|
|
1182
1218
|
__html: text,
|
|
1183
1219
|
attachments,
|
|
@@ -1190,7 +1226,7 @@ const ChannelWithContext = <
|
|
|
1190
1226
|
})) || [],
|
|
1191
1227
|
parent_id,
|
|
1192
1228
|
reactions: [],
|
|
1193
|
-
status:
|
|
1229
|
+
status: MessageStatusTypes.SENDING,
|
|
1194
1230
|
text,
|
|
1195
1231
|
type: 'regular',
|
|
1196
1232
|
user: {
|
|
@@ -1198,7 +1234,7 @@ const ChannelWithContext = <
|
|
|
1198
1234
|
...client.user,
|
|
1199
1235
|
},
|
|
1200
1236
|
...extraFields,
|
|
1201
|
-
} as unknown as MessageResponse<
|
|
1237
|
+
} as unknown as MessageResponse<StreamChatGenerics>;
|
|
1202
1238
|
|
|
1203
1239
|
/**
|
|
1204
1240
|
* This is added to the message for local rendering prior to the message
|
|
@@ -1208,20 +1244,14 @@ const ChannelWithContext = <
|
|
|
1208
1244
|
if (preview.quoted_message_id) {
|
|
1209
1245
|
const quotedMessage = messages.find((message) => message.id === preview.quoted_message_id);
|
|
1210
1246
|
|
|
1211
|
-
preview.quoted_message =
|
|
1212
|
-
|
|
1213
|
-
Ch,
|
|
1214
|
-
Co,
|
|
1215
|
-
Me,
|
|
1216
|
-
Re,
|
|
1217
|
-
Us
|
|
1218
|
-
>['quoted_message'];
|
|
1247
|
+
preview.quoted_message =
|
|
1248
|
+
quotedMessage as MessageResponse<StreamChatGenerics>['quoted_message'];
|
|
1219
1249
|
}
|
|
1220
1250
|
return preview;
|
|
1221
1251
|
};
|
|
1222
1252
|
|
|
1223
1253
|
const sendMessageRequest = async (
|
|
1224
|
-
message: MessageResponse<
|
|
1254
|
+
message: MessageResponse<StreamChatGenerics>,
|
|
1225
1255
|
retrying?: boolean,
|
|
1226
1256
|
) => {
|
|
1227
1257
|
const {
|
|
@@ -1258,19 +1288,18 @@ const ChannelWithContext = <
|
|
|
1258
1288
|
parent_id,
|
|
1259
1289
|
text,
|
|
1260
1290
|
...extraFields,
|
|
1261
|
-
} as StreamMessage<
|
|
1291
|
+
} as StreamMessage<StreamChatGenerics>;
|
|
1262
1292
|
|
|
1263
1293
|
try {
|
|
1264
|
-
let messageResponse = {} as SendMessageAPIResponse<
|
|
1294
|
+
let messageResponse = {} as SendMessageAPIResponse<StreamChatGenerics>;
|
|
1265
1295
|
|
|
1266
1296
|
if (doSendMessageRequest) {
|
|
1267
1297
|
messageResponse = await doSendMessageRequest(channel?.cid || '', messageData);
|
|
1268
1298
|
} else if (channel) {
|
|
1269
1299
|
messageResponse = await channel.sendMessage(messageData);
|
|
1270
1300
|
}
|
|
1271
|
-
|
|
1272
1301
|
if (messageResponse.message) {
|
|
1273
|
-
messageResponse.message.status =
|
|
1302
|
+
messageResponse.message.status = MessageStatusTypes.RECEIVED;
|
|
1274
1303
|
if (retrying) {
|
|
1275
1304
|
replaceMessage(message, messageResponse.message);
|
|
1276
1305
|
} else {
|
|
@@ -1279,59 +1308,62 @@ const ChannelWithContext = <
|
|
|
1279
1308
|
}
|
|
1280
1309
|
} catch (err) {
|
|
1281
1310
|
console.log(err);
|
|
1282
|
-
message.status =
|
|
1311
|
+
message.status = MessageStatusTypes.FAILED;
|
|
1283
1312
|
updateMessage(message);
|
|
1284
1313
|
}
|
|
1285
1314
|
};
|
|
1286
1315
|
|
|
1287
|
-
const sendMessage: InputMessageInputContextValue<
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
const messagePreview = createMessagePreview({
|
|
1294
|
-
...message,
|
|
1295
|
-
attachments: message.attachments || [],
|
|
1296
|
-
});
|
|
1316
|
+
const sendMessage: InputMessageInputContextValue<StreamChatGenerics>['sendMessage'] = async (
|
|
1317
|
+
message,
|
|
1318
|
+
) => {
|
|
1319
|
+
if (channel?.state?.filterErrorMessages) {
|
|
1320
|
+
channel.state.filterErrorMessages();
|
|
1321
|
+
}
|
|
1297
1322
|
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1323
|
+
const messagePreview = createMessagePreview({
|
|
1324
|
+
...message,
|
|
1325
|
+
attachments: message.attachments || [],
|
|
1326
|
+
});
|
|
1301
1327
|
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
});
|
|
1328
|
+
if (!channel?.state.isUpToDate) {
|
|
1329
|
+
await reloadChannel();
|
|
1330
|
+
}
|
|
1306
1331
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1332
|
+
updateMessage(messagePreview, {
|
|
1333
|
+
commands: [],
|
|
1334
|
+
messageInput: '',
|
|
1335
|
+
});
|
|
1309
1336
|
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
const statusPendingMessage = {
|
|
1313
|
-
...message,
|
|
1314
|
-
status: 'sending',
|
|
1315
|
-
};
|
|
1337
|
+
await sendMessageRequest(messagePreview);
|
|
1338
|
+
};
|
|
1316
1339
|
|
|
1317
|
-
|
|
1318
|
-
|
|
1340
|
+
const retrySendMessage: MessagesContextValue<StreamChatGenerics>['retrySendMessage'] = async (
|
|
1341
|
+
message,
|
|
1342
|
+
) => {
|
|
1343
|
+
const statusPendingMessage = {
|
|
1344
|
+
...message,
|
|
1345
|
+
status: MessageStatusTypes.SENDING,
|
|
1319
1346
|
};
|
|
1320
1347
|
|
|
1348
|
+
updateMessage(statusPendingMessage);
|
|
1349
|
+
await sendMessageRequest(statusPendingMessage, true);
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1321
1352
|
// hard limit to prevent you from scrolling faster than 1 page per 2 seconds
|
|
1322
|
-
const loadMoreFinished =
|
|
1323
|
-
(
|
|
1324
|
-
updatedHasMore: boolean,
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1353
|
+
const loadMoreFinished = useRef(
|
|
1354
|
+
debounce(
|
|
1355
|
+
(updatedHasMore: boolean, newMessages: ChannelState<StreamChatGenerics>['messages']) => {
|
|
1356
|
+
setLoadingMore(false);
|
|
1357
|
+
setError(false);
|
|
1358
|
+
setHasMore(updatedHasMore);
|
|
1359
|
+
setMessages(newMessages);
|
|
1360
|
+
},
|
|
1361
|
+
defaultDebounceInterval,
|
|
1362
|
+
debounceOptions,
|
|
1363
|
+
),
|
|
1364
|
+
).current;
|
|
1333
1365
|
|
|
1334
|
-
const loadMore: PaginatedMessageListContextValue<
|
|
1366
|
+
const loadMore: PaginatedMessageListContextValue<StreamChatGenerics>['loadMore'] = async (
|
|
1335
1367
|
limit = 20,
|
|
1336
1368
|
) => {
|
|
1337
1369
|
if (loadingMore || hasMore === false) {
|
|
@@ -1345,7 +1377,7 @@ const ChannelWithContext = <
|
|
|
1345
1377
|
|
|
1346
1378
|
const oldestMessage = messages && messages[0];
|
|
1347
1379
|
|
|
1348
|
-
if (oldestMessage && oldestMessage.status !==
|
|
1380
|
+
if (oldestMessage && oldestMessage.status !== MessageStatusTypes.RECEIVED) {
|
|
1349
1381
|
return setLoadingMore(false);
|
|
1350
1382
|
}
|
|
1351
1383
|
|
|
@@ -1362,104 +1394,87 @@ const ChannelWithContext = <
|
|
|
1362
1394
|
}
|
|
1363
1395
|
} catch (err) {
|
|
1364
1396
|
console.warn('Message pagination request failed with error', err);
|
|
1365
|
-
|
|
1397
|
+
if (err instanceof Error) {
|
|
1398
|
+
setError(err);
|
|
1399
|
+
} else {
|
|
1400
|
+
setError(true);
|
|
1401
|
+
}
|
|
1366
1402
|
setLoadingMore(false);
|
|
1367
1403
|
throw err;
|
|
1368
1404
|
}
|
|
1369
1405
|
};
|
|
1370
1406
|
|
|
1371
|
-
const loadMoreRecent: PaginatedMessageListContextValue<
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
Me,
|
|
1377
|
-
Re,
|
|
1378
|
-
Us
|
|
1379
|
-
>['loadMoreRecent'] = async (limit = 5) => {
|
|
1380
|
-
if (channel?.state.isUpToDate) {
|
|
1381
|
-
return;
|
|
1382
|
-
}
|
|
1407
|
+
const loadMoreRecent: PaginatedMessageListContextValue<StreamChatGenerics>['loadMoreRecent'] =
|
|
1408
|
+
async (limit = 5) => {
|
|
1409
|
+
if (channel?.state.isUpToDate) {
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1383
1412
|
|
|
1384
|
-
|
|
1413
|
+
setLoadingMoreRecent(true);
|
|
1385
1414
|
|
|
1386
|
-
|
|
1415
|
+
const recentMessage = messages[messages.length - 1];
|
|
1387
1416
|
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1417
|
+
if (recentMessage?.status !== MessageStatusTypes.RECEIVED) {
|
|
1418
|
+
setLoadingMoreRecent(false);
|
|
1419
|
+
return;
|
|
1420
|
+
}
|
|
1392
1421
|
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1422
|
+
try {
|
|
1423
|
+
if (channel) {
|
|
1424
|
+
await queryAfterMessage(recentMessage.id, limit);
|
|
1425
|
+
loadMoreRecentFinished(channel.state.messages);
|
|
1426
|
+
}
|
|
1427
|
+
} catch (err) {
|
|
1428
|
+
console.warn('Message pagination request failed with error', err);
|
|
1429
|
+
if (err instanceof Error) {
|
|
1430
|
+
setError(err);
|
|
1431
|
+
} else {
|
|
1432
|
+
setError(true);
|
|
1433
|
+
}
|
|
1434
|
+
setLoadingMoreRecent(false);
|
|
1435
|
+
throw err;
|
|
1397
1436
|
}
|
|
1398
|
-
}
|
|
1399
|
-
console.warn('Message pagination request failed with error', err);
|
|
1400
|
-
setError(err);
|
|
1401
|
-
setLoadingMoreRecent(false);
|
|
1402
|
-
throw err;
|
|
1403
|
-
}
|
|
1404
|
-
};
|
|
1437
|
+
};
|
|
1405
1438
|
|
|
1406
1439
|
// hard limit to prevent you from scrolling faster than 1 page per 2 seconds
|
|
1407
|
-
const loadMoreRecentFinished =
|
|
1408
|
-
(
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1440
|
+
const loadMoreRecentFinished = useRef(
|
|
1441
|
+
debounce(
|
|
1442
|
+
(newMessages: ChannelState<StreamChatGenerics>['messages']) => {
|
|
1443
|
+
setLoadingMoreRecent(false);
|
|
1444
|
+
setMessages(newMessages);
|
|
1445
|
+
setError(false);
|
|
1446
|
+
},
|
|
1447
|
+
defaultDebounceInterval,
|
|
1448
|
+
debounceOptions,
|
|
1449
|
+
),
|
|
1450
|
+
).current;
|
|
1414
1451
|
|
|
1415
|
-
const editMessage: InputMessageInputContextValue<
|
|
1452
|
+
const editMessage: InputMessageInputContextValue<StreamChatGenerics>['editMessage'] = (
|
|
1416
1453
|
updatedMessage,
|
|
1417
1454
|
) =>
|
|
1418
1455
|
doUpdateMessageRequest
|
|
1419
1456
|
? doUpdateMessageRequest(channel?.cid || '', updatedMessage)
|
|
1420
1457
|
: client.updateMessage(updatedMessage);
|
|
1421
1458
|
|
|
1422
|
-
const setEditingState: MessagesContextValue<
|
|
1459
|
+
const setEditingState: MessagesContextValue<StreamChatGenerics>['setEditingState'] = (
|
|
1423
1460
|
message,
|
|
1424
1461
|
) => {
|
|
1425
1462
|
setEditing(message);
|
|
1426
1463
|
};
|
|
1427
1464
|
|
|
1428
|
-
const setQuotedMessageState: MessagesContextValue<
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
Co,
|
|
1432
|
-
Ev,
|
|
1433
|
-
Me,
|
|
1434
|
-
Re,
|
|
1435
|
-
Us
|
|
1436
|
-
>['setQuotedMessageState'] = (message) => {
|
|
1465
|
+
const setQuotedMessageState: MessagesContextValue<StreamChatGenerics>['setQuotedMessageState'] = (
|
|
1466
|
+
message,
|
|
1467
|
+
) => {
|
|
1437
1468
|
setQuotedMessage(message);
|
|
1438
1469
|
};
|
|
1439
1470
|
|
|
1440
|
-
const clearEditingState: InputMessageInputContextValue<
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
Us
|
|
1448
|
-
>['clearEditingState'] = () => setEditing(false);
|
|
1449
|
-
|
|
1450
|
-
const clearQuotedMessageState: InputMessageInputContextValue<
|
|
1451
|
-
At,
|
|
1452
|
-
Ch,
|
|
1453
|
-
Co,
|
|
1454
|
-
Ev,
|
|
1455
|
-
Me,
|
|
1456
|
-
Re,
|
|
1457
|
-
Us
|
|
1458
|
-
>['clearQuotedMessageState'] = () => setQuotedMessage(false);
|
|
1459
|
-
|
|
1460
|
-
const removeMessage: MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>['removeMessage'] = (
|
|
1461
|
-
message,
|
|
1462
|
-
) => {
|
|
1471
|
+
const clearEditingState: InputMessageInputContextValue<StreamChatGenerics>['clearEditingState'] =
|
|
1472
|
+
() => setEditing(false);
|
|
1473
|
+
|
|
1474
|
+
const clearQuotedMessageState: InputMessageInputContextValue<StreamChatGenerics>['clearQuotedMessageState'] =
|
|
1475
|
+
() => setQuotedMessage(false);
|
|
1476
|
+
|
|
1477
|
+
const removeMessage: MessagesContextValue<StreamChatGenerics>['removeMessage'] = (message) => {
|
|
1463
1478
|
if (channel) {
|
|
1464
1479
|
channel.state.removeMessage(message);
|
|
1465
1480
|
setMessages(channel.state.messages);
|
|
@@ -1472,80 +1487,93 @@ const ChannelWithContext = <
|
|
|
1472
1487
|
/**
|
|
1473
1488
|
* THREAD METHODS
|
|
1474
1489
|
*/
|
|
1475
|
-
const openThread: ThreadContextValue<
|
|
1490
|
+
const openThread: ThreadContextValue<StreamChatGenerics>['openThread'] = (message) => {
|
|
1476
1491
|
const newThreadMessages = message?.id ? channel?.state?.threads[message.id] || [] : [];
|
|
1477
1492
|
setThread(message);
|
|
1478
1493
|
setThreadMessages(newThreadMessages);
|
|
1479
1494
|
};
|
|
1480
1495
|
|
|
1481
|
-
const closeThread: ThreadContextValue<
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
}, [setThread, setThreadMessages]);
|
|
1496
|
+
const closeThread: ThreadContextValue<StreamChatGenerics>['closeThread'] = useCallback(() => {
|
|
1497
|
+
setThread(null);
|
|
1498
|
+
setThreadMessages([]);
|
|
1499
|
+
}, [setThread, setThreadMessages]);
|
|
1486
1500
|
|
|
1487
1501
|
// hard limit to prevent you from scrolling faster than 1 page per 2 seconds
|
|
1488
|
-
const loadMoreThreadFinished =
|
|
1489
|
-
(
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1502
|
+
const loadMoreThreadFinished = useRef(
|
|
1503
|
+
debounce(
|
|
1504
|
+
(
|
|
1505
|
+
newThreadHasMore: boolean,
|
|
1506
|
+
updatedThreadMessages: ChannelState<StreamChatGenerics>['threads'][string],
|
|
1507
|
+
) => {
|
|
1508
|
+
setThreadHasMore(newThreadHasMore);
|
|
1509
|
+
setThreadLoadingMore(false);
|
|
1510
|
+
setThreadMessages(updatedThreadMessages);
|
|
1511
|
+
},
|
|
1512
|
+
defaultDebounceInterval,
|
|
1513
|
+
debounceOptions,
|
|
1514
|
+
),
|
|
1515
|
+
).current;
|
|
1498
1516
|
|
|
1499
|
-
const loadMoreThread: ThreadContextValue<
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
setThreadLoadingMore(true);
|
|
1517
|
+
const loadMoreThread: ThreadContextValue<StreamChatGenerics>['loadMoreThread'] = async () => {
|
|
1518
|
+
if (threadLoadingMore || !thread?.id) {
|
|
1519
|
+
return;
|
|
1520
|
+
}
|
|
1521
|
+
setThreadLoadingMore(true);
|
|
1505
1522
|
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1523
|
+
try {
|
|
1524
|
+
if (channel) {
|
|
1525
|
+
const parentID = thread.id;
|
|
1526
|
+
|
|
1527
|
+
/**
|
|
1528
|
+
* In the channel is re-initializing, then threads may get wiped out during the process
|
|
1529
|
+
* (check `addMessagesSorted` method on channel.state). In those cases, we still want to
|
|
1530
|
+
* preserve the messages on active thread, so lets simply copy messages from UI state to
|
|
1531
|
+
* `channel.state`.
|
|
1532
|
+
*/
|
|
1533
|
+
channel.state.threads[parentID] = threadMessages;
|
|
1534
|
+
const oldestMessageID = threadMessages?.[0]?.id;
|
|
1535
|
+
|
|
1536
|
+
const limit = 50;
|
|
1537
|
+
const queryResponse = await channel.getReplies(parentID, {
|
|
1538
|
+
id_lt: oldestMessageID,
|
|
1539
|
+
limit,
|
|
1540
|
+
});
|
|
1541
|
+
|
|
1542
|
+
const updatedHasMore = queryResponse.messages.length === limit;
|
|
1543
|
+
const updatedThreadMessages = channel.state.threads[parentID] || [];
|
|
1544
|
+
loadMoreThreadFinished(updatedHasMore, updatedThreadMessages);
|
|
1545
|
+
}
|
|
1546
|
+
} catch (err) {
|
|
1547
|
+
console.warn('Message pagination request failed with error', err);
|
|
1548
|
+
if (err instanceof Error) {
|
|
1531
1549
|
setError(err);
|
|
1532
|
-
|
|
1533
|
-
|
|
1550
|
+
} else {
|
|
1551
|
+
setError(true);
|
|
1534
1552
|
}
|
|
1535
|
-
|
|
1553
|
+
setThreadLoadingMore(false);
|
|
1554
|
+
throw err;
|
|
1555
|
+
}
|
|
1556
|
+
};
|
|
1557
|
+
|
|
1558
|
+
const ownCapabilitiesContext = useCreateOwnCapabilitiesContext({
|
|
1559
|
+
channel,
|
|
1560
|
+
overrideCapabilities: overrideOwnCapabilities,
|
|
1561
|
+
});
|
|
1536
1562
|
|
|
1537
1563
|
const channelContext = useCreateChannelContext({
|
|
1538
|
-
...channelConfig,
|
|
1539
1564
|
channel,
|
|
1540
1565
|
disabled: !!channel?.data?.frozen && disableIfFrozenChannel,
|
|
1541
1566
|
EmptyStateIndicator,
|
|
1567
|
+
enableMessageGroupingByUser,
|
|
1542
1568
|
enforceUniqueReaction,
|
|
1543
1569
|
error,
|
|
1544
1570
|
giphyEnabled:
|
|
1545
1571
|
giphyEnabled ??
|
|
1546
|
-
!!(
|
|
1572
|
+
!!(clientChannelConfig?.commands || [])?.some((command) => command.name === 'giphy'),
|
|
1547
1573
|
hideDateSeparators,
|
|
1574
|
+
hideStickyDateHeader,
|
|
1548
1575
|
isAdmin,
|
|
1576
|
+
isChannelActive: shouldSyncChannel,
|
|
1549
1577
|
isModerator,
|
|
1550
1578
|
isOwner,
|
|
1551
1579
|
lastRead,
|
|
@@ -1568,8 +1596,7 @@ const ChannelWithContext = <
|
|
|
1568
1596
|
watchers,
|
|
1569
1597
|
});
|
|
1570
1598
|
|
|
1571
|
-
const
|
|
1572
|
-
...inputConfig,
|
|
1599
|
+
const inputMessageInputContext = useCreateInputMessageInputContext({
|
|
1573
1600
|
additionalTextInputProps,
|
|
1574
1601
|
AttachButton,
|
|
1575
1602
|
autoCompleteSuggestionsLimit,
|
|
@@ -1579,6 +1606,7 @@ const ChannelWithContext = <
|
|
|
1579
1606
|
clearQuotedMessageState,
|
|
1580
1607
|
CommandsButton,
|
|
1581
1608
|
compressImageQuality,
|
|
1609
|
+
CooldownTimer,
|
|
1582
1610
|
doDocUploadRequest,
|
|
1583
1611
|
doImageUploadRequest,
|
|
1584
1612
|
editing,
|
|
@@ -1591,6 +1619,7 @@ const ChannelWithContext = <
|
|
|
1591
1619
|
initialValue,
|
|
1592
1620
|
Input,
|
|
1593
1621
|
InputButtons,
|
|
1622
|
+
maxMessageLength: maxMessageLengthProp ?? clientChannelConfig?.max_message_length ?? undefined,
|
|
1594
1623
|
maxNumberOfFiles,
|
|
1595
1624
|
mentionAllAppUsersEnabled,
|
|
1596
1625
|
mentionAllAppUsersQuery,
|
|
@@ -1601,6 +1630,7 @@ const ChannelWithContext = <
|
|
|
1601
1630
|
SendButton,
|
|
1602
1631
|
sendImageAsync,
|
|
1603
1632
|
sendMessage,
|
|
1633
|
+
SendMessageDisallowedIndicator,
|
|
1604
1634
|
setInputRef,
|
|
1605
1635
|
setQuotedMessageState,
|
|
1606
1636
|
ShowThreadMessageInChannelButton,
|
|
@@ -1621,27 +1651,22 @@ const ChannelWithContext = <
|
|
|
1621
1651
|
});
|
|
1622
1652
|
|
|
1623
1653
|
const messagesContext = useCreateMessagesContext({
|
|
1624
|
-
...messagesConfig,
|
|
1625
1654
|
additionalTouchableProps,
|
|
1626
|
-
animatedLongPress,
|
|
1627
1655
|
Attachment,
|
|
1628
1656
|
AttachmentActions,
|
|
1629
|
-
blockUser,
|
|
1630
1657
|
Card,
|
|
1631
1658
|
CardCover,
|
|
1632
1659
|
CardFooter,
|
|
1633
1660
|
CardHeader,
|
|
1634
1661
|
channelId,
|
|
1635
|
-
copyMessage,
|
|
1636
1662
|
DateHeader,
|
|
1637
|
-
|
|
1663
|
+
deletedMessagesVisibilityType,
|
|
1638
1664
|
disableTypingIndicator,
|
|
1639
1665
|
dismissKeyboardOnMessageTouch,
|
|
1640
|
-
|
|
1666
|
+
enableMessageGroupingByUser,
|
|
1641
1667
|
FileAttachment,
|
|
1642
1668
|
FileAttachmentGroup,
|
|
1643
1669
|
FileAttachmentIcon,
|
|
1644
|
-
flagMessage,
|
|
1645
1670
|
FlatList,
|
|
1646
1671
|
forceAlignMessages,
|
|
1647
1672
|
formatDate,
|
|
@@ -1653,6 +1678,7 @@ const ChannelWithContext = <
|
|
|
1653
1678
|
handleEdit,
|
|
1654
1679
|
handleFlag,
|
|
1655
1680
|
handleMute,
|
|
1681
|
+
handlePinMessage,
|
|
1656
1682
|
handleQuotedReply,
|
|
1657
1683
|
handleReaction,
|
|
1658
1684
|
handleRetry,
|
|
@@ -1660,6 +1686,7 @@ const ChannelWithContext = <
|
|
|
1660
1686
|
initialScrollToFirstUnreadMessage,
|
|
1661
1687
|
InlineDateSeparator,
|
|
1662
1688
|
InlineUnreadIndicator,
|
|
1689
|
+
legacyImageViewerSwipeBehaviour,
|
|
1663
1690
|
markdownRules,
|
|
1664
1691
|
Message,
|
|
1665
1692
|
messageActions,
|
|
@@ -1670,41 +1697,38 @@ const ChannelWithContext = <
|
|
|
1670
1697
|
MessageFooter,
|
|
1671
1698
|
MessageHeader,
|
|
1672
1699
|
MessageList,
|
|
1700
|
+
MessagePinnedHeader,
|
|
1673
1701
|
MessageReplies,
|
|
1674
1702
|
MessageRepliesAvatars,
|
|
1675
1703
|
MessageSimple,
|
|
1676
1704
|
MessageStatus,
|
|
1677
1705
|
MessageSystem,
|
|
1678
1706
|
MessageText,
|
|
1679
|
-
muteUser,
|
|
1680
1707
|
myMessageTheme,
|
|
1681
|
-
onDoubleTapMessage,
|
|
1682
1708
|
onLongPressMessage,
|
|
1683
1709
|
onPressInMessage,
|
|
1684
1710
|
onPressMessage,
|
|
1685
1711
|
OverlayReactionList,
|
|
1686
|
-
quotedReply,
|
|
1687
1712
|
ReactionList,
|
|
1688
1713
|
removeMessage,
|
|
1689
1714
|
Reply,
|
|
1690
|
-
retry,
|
|
1691
1715
|
retrySendMessage,
|
|
1692
1716
|
ScrollToBottomButton,
|
|
1693
1717
|
selectReaction,
|
|
1694
1718
|
setEditingState,
|
|
1695
1719
|
setQuotedMessageState,
|
|
1696
1720
|
supportedReactions,
|
|
1697
|
-
|
|
1721
|
+
targetedMessage,
|
|
1698
1722
|
TypingIndicator,
|
|
1699
1723
|
TypingIndicatorContainer,
|
|
1700
1724
|
updateMessage,
|
|
1701
1725
|
UrlPreview,
|
|
1702
1726
|
});
|
|
1703
1727
|
|
|
1704
|
-
const suggestionsContext
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1728
|
+
const suggestionsContext = {
|
|
1729
|
+
AutoCompleteSuggestionHeader,
|
|
1730
|
+
AutoCompleteSuggestionItem,
|
|
1731
|
+
AutoCompleteSuggestionList,
|
|
1708
1732
|
};
|
|
1709
1733
|
|
|
1710
1734
|
const threadContext = useCreateThreadContext({
|
|
@@ -1724,6 +1748,9 @@ const ChannelWithContext = <
|
|
|
1724
1748
|
typing,
|
|
1725
1749
|
});
|
|
1726
1750
|
|
|
1751
|
+
// TODO: replace the null view with appropriate message. Currently this is waiting a design decision.
|
|
1752
|
+
if (deleted) return null;
|
|
1753
|
+
|
|
1727
1754
|
if (!channel || (error && messages.length === 0)) {
|
|
1728
1755
|
return <LoadingErrorIndicator error={error} listType='message' retry={reloadChannel} />;
|
|
1729
1756
|
}
|
|
@@ -1743,34 +1770,31 @@ const ChannelWithContext = <
|
|
|
1743
1770
|
keyboardVerticalOffset={keyboardVerticalOffset}
|
|
1744
1771
|
{...additionalKeyboardAvoidingViewProps}
|
|
1745
1772
|
>
|
|
1746
|
-
<ChannelProvider<
|
|
1747
|
-
<
|
|
1748
|
-
<
|
|
1749
|
-
<
|
|
1750
|
-
<
|
|
1751
|
-
<
|
|
1752
|
-
<
|
|
1753
|
-
<
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1773
|
+
<ChannelProvider<StreamChatGenerics> value={channelContext}>
|
|
1774
|
+
<OwnCapabilitiesProvider value={ownCapabilitiesContext}>
|
|
1775
|
+
<TypingProvider<StreamChatGenerics> value={typingContext}>
|
|
1776
|
+
<PaginatedMessageListProvider<StreamChatGenerics> value={messageListContext}>
|
|
1777
|
+
<MessagesProvider<StreamChatGenerics> value={messagesContext}>
|
|
1778
|
+
<ThreadProvider<StreamChatGenerics> value={threadContext}>
|
|
1779
|
+
<SuggestionsProvider<StreamChatGenerics> value={suggestionsContext}>
|
|
1780
|
+
<MessageInputProvider<StreamChatGenerics> value={inputMessageInputContext}>
|
|
1781
|
+
<View style={{ height: '100%' }}>{children}</View>
|
|
1782
|
+
</MessageInputProvider>
|
|
1783
|
+
</SuggestionsProvider>
|
|
1784
|
+
</ThreadProvider>
|
|
1785
|
+
</MessagesProvider>
|
|
1786
|
+
</PaginatedMessageListProvider>
|
|
1787
|
+
</TypingProvider>
|
|
1788
|
+
</OwnCapabilitiesProvider>
|
|
1760
1789
|
</ChannelProvider>
|
|
1761
1790
|
</KeyboardCompatibleView>
|
|
1762
1791
|
);
|
|
1763
1792
|
};
|
|
1764
1793
|
|
|
1765
1794
|
export type ChannelProps<
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
Ev extends UnknownType = DefaultEventType,
|
|
1770
|
-
Me extends UnknownType = DefaultMessageType,
|
|
1771
|
-
Re extends UnknownType = DefaultReactionType,
|
|
1772
|
-
Us extends UnknownType = DefaultUserType,
|
|
1773
|
-
> = Partial<ChannelPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>>;
|
|
1795
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
1796
|
+
> = Partial<Omit<ChannelPropsWithContext<StreamChatGenerics>, 'channel'>> &
|
|
1797
|
+
Pick<ChannelPropsWithContext<StreamChatGenerics>, 'channel'>;
|
|
1774
1798
|
|
|
1775
1799
|
/**
|
|
1776
1800
|
*
|
|
@@ -1781,17 +1805,11 @@ export type ChannelProps<
|
|
|
1781
1805
|
* @example ./Channel.md
|
|
1782
1806
|
*/
|
|
1783
1807
|
export const Channel = <
|
|
1784
|
-
|
|
1785
|
-
Ch extends UnknownType = DefaultChannelType,
|
|
1786
|
-
Co extends string = DefaultCommandType,
|
|
1787
|
-
Ev extends UnknownType = DefaultEventType,
|
|
1788
|
-
Me extends UnknownType = DefaultMessageType,
|
|
1789
|
-
Re extends UnknownType = DefaultReactionType,
|
|
1790
|
-
Us extends UnknownType = DefaultUserType,
|
|
1808
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
1791
1809
|
>(
|
|
1792
|
-
props: PropsWithChildren<ChannelProps<
|
|
1810
|
+
props: PropsWithChildren<ChannelProps<StreamChatGenerics>>,
|
|
1793
1811
|
) => {
|
|
1794
|
-
const { client } = useChatContext<
|
|
1812
|
+
const { client } = useChatContext<StreamChatGenerics>();
|
|
1795
1813
|
const { t } = useTranslationContext();
|
|
1796
1814
|
|
|
1797
1815
|
const shouldSyncChannel = props.thread?.id ? !!props.threadList : true;
|
|
@@ -1811,13 +1829,13 @@ export const Channel = <
|
|
|
1811
1829
|
typing,
|
|
1812
1830
|
watcherCount,
|
|
1813
1831
|
watchers,
|
|
1814
|
-
} = useChannelState<
|
|
1832
|
+
} = useChannelState<StreamChatGenerics>(
|
|
1815
1833
|
props.channel,
|
|
1816
1834
|
props.threadList ? props.thread?.id : undefined,
|
|
1817
1835
|
);
|
|
1818
1836
|
|
|
1819
1837
|
return (
|
|
1820
|
-
<ChannelWithContext<
|
|
1838
|
+
<ChannelWithContext<StreamChatGenerics>
|
|
1821
1839
|
{...{
|
|
1822
1840
|
client,
|
|
1823
1841
|
t,
|