stream-chat-react-native-core 4.0.0-beta.2 → 4.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Attachment/Attachment.js +12 -12
- package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/AttachmentActions.js +4 -4
- package/lib/commonjs/components/Attachment/AttachmentActions.js.map +1 -1
- package/lib/commonjs/components/Attachment/Card.js +15 -15
- package/lib/commonjs/components/Attachment/Card.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +8 -8
- package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +4 -4
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +97 -106
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +112 -148
- package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/types.js +4 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/types.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/getAspectRatio.js +14 -0
- package/lib/commonjs/components/Attachment/utils/getAspectRatio.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
- package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +9 -8
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +2 -2
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +16 -16
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +7 -7
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +4 -4
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +11 -11
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +13 -7
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +10 -4
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +64 -64
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
- 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 +6 -6
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +4 -4
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +6 -7
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +2 -2
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +17 -17
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/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 +83 -70
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelList/utils.js +1 -1
- package/lib/commonjs/components/ChannelList/utils.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +2 -2
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +4 -4
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +4 -4
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +48 -20
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +4 -4
- 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.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +89 -56
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +2 -2
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +12 -12
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +28 -11
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +7 -7
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +5 -5
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +9 -9
- package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +19 -15
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +6 -6
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +19 -19
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +5 -5
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +20 -16
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +6 -6
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +10 -10
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +5 -5
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +6 -6
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +15 -13
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +3 -3
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +51 -51
- 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 +151 -81
- 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.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +16 -3
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActions.js +18 -14
- package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/commonjs/components/Message/utils/messageActions.js.map +1 -1
- package/lib/commonjs/components/Message/utils/removeReservedFields.js.map +1 -1
- package/lib/commonjs/components/MessageInput/AttachButton.js +3 -3
- package/lib/commonjs/components/MessageInput/AttachButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/CommandsButton.js +3 -3
- package/lib/commonjs/components/MessageInput/CommandsButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/CooldownTimer.js +2 -2
- package/lib/commonjs/components/MessageInput/CooldownTimer.js.map +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +13 -13
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +7 -7
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +9 -9
- package/lib/commonjs/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +40 -40
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +3 -3
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +5 -5
- package/lib/commonjs/components/MessageInput/SendButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +2 -2
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +10 -10
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/hooks/useCooldown.js.map +1 -1
- package/lib/commonjs/components/MessageInput/hooks/useCountdown.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +4 -4
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +4 -4
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +4 -4
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +28 -28
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageSystem.js +6 -6
- package/lib/commonjs/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicator.js +5 -5
- package/lib/commonjs/components/MessageList/TypingIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +2 -2
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js +7 -7
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useTypingString.js +2 -2
- package/lib/commonjs/components/MessageList/hooks/useTypingString.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/filterTypingUsers.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getDateSeparators.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js +3 -1
- package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getReadStates.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js +5 -5
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +8 -8
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +41 -34
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +16 -16
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +31 -34
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
- package/lib/commonjs/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +25 -19
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/Thread/Thread.js +6 -6
- package/lib/commonjs/components/Thread/Thread.js.map +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +12 -12
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/commonjs/components/docs/data.js +45 -45
- package/lib/commonjs/components/docs/data.js.map +1 -1
- package/lib/commonjs/components/index.js +26 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +2 -2
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +2 -2
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +2 -2
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +2 -2
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +3 -3
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +2 -2
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +2 -2
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js.map +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js +2 -2
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +18 -14
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +5 -19
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +33 -31
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +2 -2
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +2 -2
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/ThemeContext.js +2 -2
- package/lib/commonjs/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +20 -11
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.js +2 -2
- package/lib/commonjs/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +3 -3
- package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/commonjs/contexts/typingContext/TypingContext.js +2 -2
- package/lib/commonjs/contexts/typingContext/TypingContext.js.map +1 -1
- package/lib/commonjs/contexts/utils/getDisplayName.js.map +1 -1
- package/lib/commonjs/emoji-data/index.js +2 -2
- package/lib/commonjs/emoji-data/index.js.map +1 -1
- package/lib/commonjs/hooks/useStreami18n.js.map +1 -1
- package/lib/commonjs/icons/UserAdmin.js +62 -0
- package/lib/commonjs/icons/UserAdmin.js.map +1 -0
- package/lib/commonjs/icons/index.js +0 -26
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/icons/utils/base.js +1 -1
- package/lib/commonjs/index.js +6 -6
- package/lib/commonjs/mock-builders/api/error.js +1 -1
- package/lib/commonjs/mock-builders/api/sendMessage.js.map +1 -1
- package/lib/commonjs/mock-builders/generator/attachment.js +1 -3
- package/lib/commonjs/mock-builders/generator/attachment.js.map +1 -1
- package/lib/commonjs/mock-builders/generator/channel.js +101 -51
- package/lib/commonjs/mock-builders/generator/channel.js.map +1 -1
- package/lib/commonjs/mock-builders/generator/user.js +32 -33
- package/lib/commonjs/mock-builders/generator/user.js.map +1 -1
- package/lib/commonjs/mock-builders/mock.js +1 -1
- package/lib/commonjs/native.js +1 -1
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js +7 -7
- package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js.map +1 -1
- package/lib/commonjs/styleguideComponents/JsDoc.js +4 -4
- package/lib/commonjs/styleguideComponents/JsDoc.js.map +1 -1
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js +7 -7
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js.map +1 -1
- package/lib/commonjs/styleguideComponents/PropsRenderer.js +25 -25
- package/lib/commonjs/styleguideComponents/PropsRenderer.js.map +1 -1
- package/lib/commonjs/styleguideComponents/Wrapper.js +1 -1
- package/lib/commonjs/styleguideComponents/Wrapper.js.map +1 -1
- package/lib/commonjs/utils/Streami18n.js.map +1 -1
- package/lib/commonjs/utils/getResizedImageUrl.js +26 -0
- package/lib/commonjs/utils/getResizedImageUrl.js.map +1 -0
- package/lib/commonjs/utils/getUrlOfImageAttachment.js +9 -0
- package/lib/commonjs/utils/getUrlOfImageAttachment.js.map +1 -0
- package/lib/commonjs/utils/utils.js +9 -3
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +12 -12
- package/lib/module/components/Attachment/Attachment.js.map +1 -1
- package/lib/module/components/Attachment/AttachmentActions.js +4 -4
- package/lib/module/components/Attachment/AttachmentActions.js.map +1 -1
- package/lib/module/components/Attachment/Card.js +15 -15
- package/lib/module/components/Attachment/Card.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +8 -8
- package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +4 -4
- package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/module/components/Attachment/FileIcon.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +97 -106
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +112 -148
- package/lib/module/components/Attachment/Giphy.js.map +1 -1
- package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/types.js +4 -0
- package/lib/module/components/Attachment/utils/buildGallery/types.js.map +1 -0
- package/lib/module/components/Attachment/utils/getAspectRatio.js +14 -0
- package/lib/module/components/Attachment/utils/getAspectRatio.js.map +1 -0
- package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
- package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +9 -8
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +2 -2
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +16 -16
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +7 -7
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +4 -4
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +11 -11
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -1
- package/lib/module/components/Avatar/Avatar.js +13 -7
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +10 -4
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +64 -64
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -1
- 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 +6 -6
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +4 -4
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +6 -7
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +2 -2
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +17 -17
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/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 +83 -70
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelList/utils.js +1 -1
- package/lib/module/components/ChannelList/utils.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +2 -2
- package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +4 -4
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +4 -4
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +48 -20
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +4 -4
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +2 -2
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +4 -4
- 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.map +1 -1
- package/lib/module/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +89 -56
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +2 -2
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +12 -12
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +28 -11
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +7 -7
- package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js +5 -5
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +9 -9
- package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/module/components/Message/Message.js +19 -15
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +6 -6
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +19 -19
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js +5 -5
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +20 -16
- package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +6 -6
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageReplies.js +10 -10
- package/lib/module/components/Message/MessageSimple/MessageReplies.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +5 -5
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +6 -6
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +15 -13
- package/lib/module/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +3 -3
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/ReactionList.js +51 -51
- 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 +151 -81
- 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.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js +16 -3
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActions.js +18 -14
- package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/module/components/Message/utils/messageActions.js.map +1 -1
- package/lib/module/components/Message/utils/removeReservedFields.js.map +1 -1
- package/lib/module/components/MessageInput/AttachButton.js +3 -3
- package/lib/module/components/MessageInput/AttachButton.js.map +1 -1
- package/lib/module/components/MessageInput/CommandsButton.js +3 -3
- package/lib/module/components/MessageInput/CommandsButton.js.map +1 -1
- package/lib/module/components/MessageInput/CooldownTimer.js +2 -2
- package/lib/module/components/MessageInput/CooldownTimer.js.map +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +13 -13
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +7 -7
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +9 -9
- package/lib/module/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +40 -40
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/MoreOptionsButton.js +3 -3
- package/lib/module/components/MessageInput/MoreOptionsButton.js.map +1 -1
- package/lib/module/components/MessageInput/SendButton.js +5 -5
- package/lib/module/components/MessageInput/SendButton.js.map +1 -1
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +2 -2
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -1
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +10 -10
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/module/components/MessageInput/hooks/useCooldown.js.map +1 -1
- package/lib/module/components/MessageInput/hooks/useCountdown.js.map +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +4 -4
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +4 -4
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +4 -4
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +28 -28
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/MessageSystem.js +6 -6
- package/lib/module/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/module/components/MessageList/TypingIndicator.js +5 -5
- package/lib/module/components/MessageList/TypingIndicator.js.map +1 -1
- package/lib/module/components/MessageList/TypingIndicatorContainer.js +2 -2
- package/lib/module/components/MessageList/TypingIndicatorContainer.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js +7 -7
- package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useTypingString.js +2 -2
- package/lib/module/components/MessageList/hooks/useTypingString.js.map +1 -1
- package/lib/module/components/MessageList/utils/filterTypingUsers.js.map +1 -1
- package/lib/module/components/MessageList/utils/getDateSeparators.js.map +1 -1
- package/lib/module/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/module/components/MessageList/utils/getLastReceivedMessage.js +3 -1
- package/lib/module/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/module/components/MessageList/utils/getReadStates.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageActionList.js +5 -5
- package/lib/module/components/MessageOverlay/MessageActionList.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +8 -8
- package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +41 -34
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionList.js +16 -16
- package/lib/module/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +31 -34
- package/lib/module/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
- package/lib/module/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +25 -19
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/Thread/Thread.js +6 -6
- package/lib/module/components/Thread/Thread.js.map +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +12 -12
- package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/module/components/docs/data.js +45 -45
- package/lib/module/components/docs/data.js.map +1 -1
- package/lib/module/components/index.js +26 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +2 -2
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +2 -2
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +2 -2
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +2 -2
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +3 -3
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
- package/lib/module/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +2 -2
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +2 -2
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/module/contexts/keyboardContext/KeyboardContext.js +2 -2
- package/lib/module/contexts/keyboardContext/KeyboardContext.js.map +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +2 -2
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +18 -14
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +5 -19
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
- package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +33 -31
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +2 -2
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +2 -2
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/module/contexts/themeContext/ThemeContext.js +2 -2
- package/lib/module/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +20 -11
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/contexts/threadContext/ThreadContext.js +2 -2
- package/lib/module/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +3 -3
- package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/module/contexts/typingContext/TypingContext.js +2 -2
- package/lib/module/contexts/typingContext/TypingContext.js.map +1 -1
- package/lib/module/contexts/utils/getDisplayName.js.map +1 -1
- package/lib/module/emoji-data/index.js +2 -2
- package/lib/module/emoji-data/index.js.map +1 -1
- package/lib/module/hooks/useStreami18n.js.map +1 -1
- package/lib/module/icons/UserAdmin.js +62 -0
- package/lib/module/icons/UserAdmin.js.map +1 -0
- package/lib/module/icons/index.js +0 -26
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/icons/utils/base.js +1 -1
- package/lib/module/index.js +6 -6
- package/lib/module/mock-builders/api/error.js +1 -1
- package/lib/module/mock-builders/api/sendMessage.js.map +1 -1
- package/lib/module/mock-builders/generator/attachment.js +1 -3
- package/lib/module/mock-builders/generator/attachment.js.map +1 -1
- package/lib/module/mock-builders/generator/channel.js +101 -51
- package/lib/module/mock-builders/generator/channel.js.map +1 -1
- package/lib/module/mock-builders/generator/user.js +32 -33
- package/lib/module/mock-builders/generator/user.js.map +1 -1
- package/lib/module/mock-builders/mock.js +1 -1
- package/lib/module/native.js +1 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/styleguideComponents/ArgumentsRenderer.js +7 -7
- package/lib/module/styleguideComponents/ArgumentsRenderer.js.map +1 -1
- package/lib/module/styleguideComponents/JsDoc.js +4 -4
- package/lib/module/styleguideComponents/JsDoc.js.map +1 -1
- package/lib/module/styleguideComponents/PathlineRenderer.js +7 -7
- package/lib/module/styleguideComponents/PathlineRenderer.js.map +1 -1
- package/lib/module/styleguideComponents/PropsRenderer.js +25 -25
- package/lib/module/styleguideComponents/PropsRenderer.js.map +1 -1
- package/lib/module/styleguideComponents/Wrapper.js +1 -1
- package/lib/module/styleguideComponents/Wrapper.js.map +1 -1
- package/lib/module/utils/Streami18n.js.map +1 -1
- package/lib/module/utils/getResizedImageUrl.js +26 -0
- package/lib/module/utils/getResizedImageUrl.js.map +1 -0
- package/lib/module/utils/getUrlOfImageAttachment.js +9 -0
- package/lib/module/utils/getUrlOfImageAttachment.js.map +1 -0
- package/lib/module/utils/utils.js +9 -3
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Attachment.d.ts +6 -6
- package/lib/typescript/components/Attachment/AttachmentActions.d.ts +5 -5
- package/lib/typescript/components/Attachment/Card.d.ts +5 -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 +6 -9
- 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 +4 -4
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.d.ts +3 -2
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionHeader.d.ts +4 -4
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionItem.d.ts +5 -5
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts +10 -11
- package/lib/typescript/components/Avatar/Avatar.d.ts +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +10 -10
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +2 -2
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +3 -3
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +3 -3
- package/lib/typescript/components/Channel/hooks/useCreateOwnCapabilitiesContext.d.ts +4 -4
- 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 +3 -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 +12 -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/Message/Message.d.ts +12 -12
- 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 +4 -4
- 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 +6 -6
- package/lib/typescript/components/Message/MessageSimple/ReactionList.d.ts +4 -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 +20 -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 +2 -2
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +5 -5
- package/lib/typescript/components/Message/utils/messageActions.d.ts +7 -7
- 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/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/ShowThreadMessageInChannelButton.d.ts +2 -2
- package/lib/typescript/components/MessageInput/hooks/useCooldown.d.ts +2 -2
- 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 +7 -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 +5 -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 +4 -4
- package/lib/typescript/components/MessageOverlay/MessageActionListItem.d.ts +4 -3
- package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts +4 -4
- package/lib/typescript/components/MessageOverlay/OverlayReactionList.d.ts +6 -6
- 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 +1 -1
- 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 +2 -0
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +2 -2
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +12 -12
- 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 -12
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +39 -37
- 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 +27 -25
- 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 +67 -67
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +8 -8
- package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts +2 -2
- package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +8 -8
- package/lib/typescript/contexts/suggestionsContext/SuggestionsContext.d.ts +21 -21
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +17 -8
- 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/hooks/useStreami18n.d.ts +1 -1
- package/lib/typescript/icons/{Left.d.ts → UserAdmin.d.ts} +1 -1
- package/lib/typescript/icons/index.d.ts +0 -2
- package/lib/typescript/types/types.d.ts +16 -13
- package/lib/typescript/utils/Streami18n.d.ts +6 -6
- package/lib/typescript/utils/getResizedImageUrl.d.ts +19 -0
- package/lib/typescript/utils/getUrlOfImageAttachment.d.ts +7 -0
- package/lib/typescript/utils/utils.d.ts +27 -22
- package/package.json +9 -13
- package/src/components/Attachment/Attachment.tsx +18 -59
- package/src/components/Attachment/AttachmentActions.tsx +17 -57
- package/src/components/Attachment/Card.tsx +17 -51
- 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 +177 -242
- package/src/components/Attachment/Giphy.tsx +84 -128
- package/src/components/Attachment/__tests__/Attachment.test.js +11 -10
- package/src/components/Attachment/__tests__/Gallery.test.js +233 -0
- package/src/components/Attachment/__tests__/buildGallery.test.js +131 -0
- package/src/components/Attachment/utils/buildGallery/buildGallery.ts +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/AutoCompleteInput/AutoCompleteInput.tsx +23 -62
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.tsx +6 -4
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx +13 -20
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionItem.tsx +20 -25
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +25 -29
- package/src/components/AutoCompleteInput/__tests__/AutoCompleteInput.test.js +6 -8
- package/src/components/Avatar/Avatar.tsx +8 -11
- package/src/components/Avatar/GroupAvatar.tsx +7 -2
- package/src/components/Avatar/__tests__/Avatar.test.js +2 -2
- package/src/components/Channel/Channel.tsx +237 -313
- package/src/components/Channel/__tests__/Channel.test.js +10 -10
- package/src/components/Channel/__tests__/ownCapabilities.test.js +8 -8
- package/src/components/Channel/hooks/useCreateChannelContext.ts +4 -19
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +52 -68
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +4 -19
- package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +5 -19
- 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 +1 -2
- package/src/components/ChannelList/ChannelListHeaderErrorIndicator.tsx +3 -7
- package/src/components/ChannelList/ChannelListHeaderNetworkDownIndicator.tsx +2 -2
- package/src/components/ChannelList/ChannelListMessenger.tsx +22 -74
- package/src/components/ChannelList/__tests__/ChannelList.test.js +73 -13
- package/src/components/ChannelList/__tests__/ChannelListMessenger.test.js +11 -12
- package/src/components/ChannelList/hooks/listeners/useAddedToChannelNotification.ts +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 +3 -18
- 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 +89 -77
- 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 +13 -23
- package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +35 -55
- 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 +8 -9
- package/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +8 -9
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.ts +9 -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 +29 -80
- package/src/components/Chat/Chat.tsx +17 -45
- package/src/components/Chat/__tests__/Chat.test.js +5 -5
- package/src/components/Chat/hooks/useCreateChatContext.ts +4 -19
- package/src/components/Chat/hooks/useIsOnline.ts +8 -22
- package/src/components/Chat/hooks/useMutedUsers.ts +5 -20
- package/src/components/ImageGallery/ImageGallery.tsx +109 -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 +42 -21
- 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/LoadingIndicator.tsx +1 -2
- package/src/components/Message/Message.tsx +59 -112
- package/src/components/Message/MessageSimple/MessageAvatar.tsx +14 -56
- package/src/components/Message/MessageSimple/MessageContent.tsx +20 -64
- package/src/components/Message/MessageSimple/MessageDeleted.tsx +19 -61
- package/src/components/Message/MessageSimple/MessageFooter.tsx +28 -71
- package/src/components/Message/MessageSimple/MessagePinnedHeader.tsx +15 -56
- package/src/components/Message/MessageSimple/MessageReplies.tsx +15 -56
- package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +7 -29
- package/src/components/Message/MessageSimple/MessageSimple.tsx +16 -57
- package/src/components/Message/MessageSimple/MessageStatus.tsx +21 -58
- package/src/components/Message/MessageSimple/MessageTextContainer.tsx +19 -66
- package/src/components/Message/MessageSimple/ReactionList.tsx +47 -88
- package/src/components/Message/MessageSimple/__tests__/Message.test.js +9 -9
- package/src/components/Message/MessageSimple/__tests__/MessageAvatar.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +9 -26
- package/src/components/Message/MessageSimple/__tests__/MessagePinnedHeader.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/MessageReplies.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/MessageStatus.test.js +4 -5
- package/src/components/Message/MessageSimple/__tests__/MessageTextContainer.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +1 -1
- package/src/components/Message/MessageSimple/utils/parseLinks.test.ts +100 -0
- package/src/components/Message/MessageSimple/utils/parseLinks.ts +95 -0
- package/src/components/Message/MessageSimple/utils/renderText.test.tsx +70 -0
- package/src/components/Message/MessageSimple/utils/renderText.tsx +97 -94
- package/src/components/Message/hooks/useCreateMessageContext.ts +5 -21
- package/src/components/Message/hooks/useMessageActionHandlers.ts +21 -27
- package/src/components/Message/hooks/useMessageActions.tsx +21 -31
- package/src/components/Message/utils/messageActions.ts +9 -36
- package/src/components/Message/utils/removeReservedFields.ts +3 -18
- package/src/components/MessageInput/AttachButton.tsx +14 -56
- package/src/components/MessageInput/CommandsButton.tsx +16 -58
- package/src/components/MessageInput/CooldownTimer.tsx +1 -0
- package/src/components/MessageInput/FileUploadPreview.tsx +16 -58
- package/src/components/MessageInput/ImageUploadPreview.tsx +13 -56
- package/src/components/MessageInput/InputButtons.tsx +14 -55
- package/src/components/MessageInput/MessageInput.tsx +30 -72
- package/src/components/MessageInput/MoreOptionsButton.tsx +14 -56
- package/src/components/MessageInput/SendButton.tsx +13 -54
- package/src/components/MessageInput/SendMessageDisallowedIndicator.tsx +1 -1
- package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx +5 -20
- package/src/components/MessageInput/__tests__/AttachButton.test.js +2 -2
- package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +15 -17
- package/src/components/MessageInput/__tests__/ImageUploadPreview.test.js +3 -3
- package/src/components/MessageInput/__tests__/MessageInput.test.js +8 -8
- package/src/components/MessageInput/__tests__/SendButton.test.js +2 -2
- package/src/components/MessageInput/__tests__/UploadProgressIndicator.test.js +2 -2
- package/src/components/MessageInput/__tests__/__snapshots__/FileUploadPreview.test.js.snap +1604 -4172
- package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +1 -643
- package/src/components/MessageInput/hooks/useCooldown.ts +7 -19
- package/src/components/MessageInput/hooks/useCountdown.ts +1 -0
- 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 +37 -79
- package/src/components/MessageList/MessageSystem.tsx +7 -28
- package/src/components/MessageList/TypingIndicator.tsx +4 -20
- package/src/components/MessageList/TypingIndicatorContainer.tsx +14 -47
- package/src/components/MessageList/__tests__/MessageList.test.js +17 -17
- package/src/components/MessageList/__tests__/MessageSystem.test.js +3 -3
- package/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +3 -3
- package/src/components/MessageList/__tests__/TypingIndicator.test.js +5 -6
- package/src/components/MessageList/__tests__/__snapshots__/TypingIndicator.test.js.snap +1 -1
- package/src/components/MessageList/hooks/useMessageList.ts +24 -59
- 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 +6 -27
- package/src/components/MessageList/utils/getGroupStyles.ts +7 -29
- package/src/components/MessageList/utils/getLastReceivedMessage.ts +9 -19
- package/src/components/MessageList/utils/getReadStates.ts +5 -20
- package/src/components/MessageOverlay/MessageActionList.tsx +17 -58
- package/src/components/MessageOverlay/MessageActionListItem.tsx +23 -10
- package/src/components/MessageOverlay/MessageOverlay.tsx +56 -95
- package/src/components/MessageOverlay/OverlayBackdrop.tsx +1 -0
- package/src/components/MessageOverlay/OverlayReactionList.tsx +23 -78
- package/src/components/MessageOverlay/OverlayReactions.tsx +12 -8
- package/src/components/MessageOverlay/OverlayReactionsAvatar.tsx +27 -0
- package/src/components/MessageOverlay/hooks/useMessageActionAnimation.tsx +1 -0
- package/src/components/Reply/Reply.tsx +44 -81
- package/src/components/Thread/Thread.tsx +24 -58
- package/src/components/Thread/__tests__/Thread.test.js +12 -14
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +13 -13
- package/src/components/Thread/components/ThreadFooterComponent.tsx +12 -48
- package/src/components/docs/data.js +38 -37
- package/src/components/index.ts +2 -0
- package/src/contexts/activeChannelsRefContext/ActiveChannelsRefContext.tsx +1 -2
- package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +10 -9
- package/src/contexts/channelContext/ChannelContext.tsx +16 -50
- package/src/contexts/channelsContext/ChannelsContext.tsx +37 -63
- package/src/contexts/channelsStateContext/ChannelsStateContext.tsx +38 -116
- package/src/contexts/channelsStateContext/useChannelState.ts +28 -60
- 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 -50
- package/src/contexts/messageInputContext/MessageInputContext.tsx +88 -134
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +6 -23
- package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +15 -34
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +34 -90
- 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 +73 -112
- package/src/contexts/overlayContext/OverlayContext.tsx +28 -34
- package/src/contexts/overlayContext/OverlayProvider.tsx +36 -46
- package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +14 -55
- package/src/contexts/suggestionsContext/SuggestionsContext.tsx +42 -42
- package/src/contexts/suggestionsContext/__tests__/Suggestions.test.js +1 -0
- package/src/contexts/themeContext/ThemeContext.tsx +1 -0
- package/src/contexts/themeContext/utils/theme.ts +36 -19
- package/src/contexts/threadContext/ThreadContext.tsx +14 -48
- package/src/contexts/translationContext/TranslationContext.tsx +14 -9
- package/src/contexts/typingContext/TypingContext.tsx +12 -46
- package/src/contexts/utils/getDisplayName.ts +1 -0
- package/src/emoji-data/index.js +1 -1
- package/src/hooks/useStreami18n.ts +1 -1
- package/src/icons/UserAdmin.tsx +23 -0
- package/src/icons/index.ts +0 -2
- package/src/mock-builders/api/sendMessage.js +1 -0
- package/src/mock-builders/generator/attachment.js +0 -2
- package/src/mock-builders/generator/channel.js +101 -64
- package/src/mock-builders/generator/user.js +33 -26
- package/src/native.ts +1 -0
- package/src/styleguideComponents/ArgumentsRenderer.tsx +2 -1
- package/src/styleguideComponents/JsDoc.tsx +3 -1
- package/src/styleguideComponents/PathlineRenderer.tsx +2 -1
- package/src/styleguideComponents/PropsRenderer.tsx +7 -4
- package/src/styleguideComponents/Wrapper.tsx +1 -0
- package/src/types/types.ts +16 -18
- package/src/utils/Streami18n.ts +6 -6
- package/src/utils/__tests__/Streami18n.test.js +1 -2
- package/src/utils/getResizedImageUrl.ts +43 -0
- package/src/utils/getUrlOfImageAttachment.ts +10 -0
- package/src/utils/utils.ts +72 -132
- package/src/version.json +1 -1
- package/lib/commonjs/icons/Left.js +0 -38
- package/lib/commonjs/icons/Left.js.map +0 -1
- package/lib/commonjs/icons/Right.js +0 -38
- package/lib/commonjs/icons/Right.js.map +0 -1
- package/lib/module/icons/Left.js +0 -38
- package/lib/module/icons/Left.js.map +0 -1
- package/lib/module/icons/Right.js +0 -38
- package/lib/module/icons/Right.js.map +0 -1
- package/lib/typescript/icons/Right.d.ts +0 -3
- package/src/icons/Left.tsx +0 -12
- package/src/icons/Right.tsx +0 -12
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { render, waitFor } from '@testing-library/react-native';
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
import { ASTNode, SingleASTNode } from 'simple-markdown';
|
|
8
|
+
|
|
9
|
+
import { ListOutput, ListOutputProps } from './renderText';
|
|
10
|
+
|
|
11
|
+
describe('list', () => {
|
|
12
|
+
const createNode = ({
|
|
13
|
+
amount,
|
|
14
|
+
ordered = false,
|
|
15
|
+
start = 1,
|
|
16
|
+
}: {
|
|
17
|
+
amount: number;
|
|
18
|
+
ordered?: boolean;
|
|
19
|
+
start?: number;
|
|
20
|
+
}): SingleASTNode => ({
|
|
21
|
+
items: Array.from(Array(amount).keys()),
|
|
22
|
+
ordered,
|
|
23
|
+
start,
|
|
24
|
+
type: 'text',
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const mockOutput = (node: ASTNode) => <Text>{node}</Text>;
|
|
28
|
+
const MockText = ({ node, output, state }: ListOutputProps) => (
|
|
29
|
+
<>
|
|
30
|
+
<ListOutput node={node} output={output} state={state} styles={{}} />
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
it('renders numbered items', async () => {
|
|
35
|
+
const node = createNode({ amount: 3, ordered: true, start: 1 });
|
|
36
|
+
const { getByText } = render(<MockText node={node} output={mockOutput} state={{}} />);
|
|
37
|
+
|
|
38
|
+
await waitFor(() => expect(getByText('1. ')).toBeTruthy());
|
|
39
|
+
await waitFor(() => expect(getByText('2. ')).toBeTruthy());
|
|
40
|
+
await waitFor(() => expect(getByText('3. ')).toBeTruthy());
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('renders numbered items from a start index', async () => {
|
|
44
|
+
const node = createNode({ amount: 3, ordered: true, start: 3 });
|
|
45
|
+
const { getByText } = render(<MockText node={node} output={mockOutput} state={{}} />);
|
|
46
|
+
|
|
47
|
+
await waitFor(() => expect(getByText('3. ')).toBeTruthy());
|
|
48
|
+
await waitFor(() => expect(getByText('4. ')).toBeTruthy());
|
|
49
|
+
await waitFor(() => expect(getByText('5. ')).toBeTruthy());
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('does not throw an error if an item is empty', async () => {
|
|
53
|
+
const node = {
|
|
54
|
+
...createNode({ amount: 3, ordered: true }),
|
|
55
|
+
items: ['Not empty', null, 'Not empty'],
|
|
56
|
+
};
|
|
57
|
+
const { getByText } = render(<MockText node={node} output={mockOutput} state={{}} />);
|
|
58
|
+
|
|
59
|
+
await waitFor(() => expect(getByText('1. ')).toBeTruthy());
|
|
60
|
+
await waitFor(() => expect(getByText('2. ')).toBeTruthy());
|
|
61
|
+
await waitFor(() => expect(getByText('3. ')).toBeTruthy());
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('renders an unordered list', async () => {
|
|
65
|
+
const node = createNode({ amount: 3 });
|
|
66
|
+
const { getAllByText } = render(<MockText node={node} output={mockOutput} state={{}} />);
|
|
67
|
+
|
|
68
|
+
await waitFor(() => expect(getAllByText('\u2022 ')).toHaveLength(3));
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { GestureResponderEvent, Linking, Text, View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
import truncate from 'lodash/truncate';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { GestureResponderEvent, Linking, Text, TextProps, View, ViewProps } from 'react-native';
|
|
3
|
+
|
|
5
4
|
// @ts-expect-error
|
|
6
5
|
import Markdown from 'react-native-markdown-package';
|
|
6
|
+
|
|
7
|
+
import truncate from 'lodash/truncate';
|
|
7
8
|
import {
|
|
8
9
|
DefaultRules,
|
|
9
10
|
defaultRules,
|
|
@@ -11,23 +12,17 @@ import {
|
|
|
11
12
|
ParseFunction,
|
|
12
13
|
parseInline,
|
|
13
14
|
ReactNodeOutput,
|
|
15
|
+
ReactOutput,
|
|
14
16
|
SingleASTNode,
|
|
17
|
+
State,
|
|
15
18
|
} from 'simple-markdown';
|
|
16
19
|
|
|
17
|
-
import
|
|
20
|
+
import { parseLinksFromText } from './parseLinks';
|
|
18
21
|
|
|
19
|
-
import type {
|
|
20
|
-
DefaultAttachmentType,
|
|
21
|
-
DefaultChannelType,
|
|
22
|
-
DefaultCommandType,
|
|
23
|
-
DefaultEventType,
|
|
24
|
-
DefaultMessageType,
|
|
25
|
-
DefaultReactionType,
|
|
26
|
-
DefaultUserType,
|
|
27
|
-
UnknownType,
|
|
28
|
-
} from '../../../../types/types';
|
|
29
22
|
import type { MessageContextValue } from '../../../../contexts/messageContext/MessageContext';
|
|
30
23
|
import type { Colors, MarkdownStyle } from '../../../../contexts/themeContext/utils/theme';
|
|
24
|
+
import type { DefaultStreamChatGenerics } from '../../../../types/types';
|
|
25
|
+
import type { MessageType } from '../../../MessageList/hooks/useMessageList';
|
|
31
26
|
|
|
32
27
|
const defaultMarkdownStyles: MarkdownStyle = {
|
|
33
28
|
inlineCode: {
|
|
@@ -51,7 +46,6 @@ const defaultMarkdownStyles: MarkdownStyle = {
|
|
|
51
46
|
mentions: {
|
|
52
47
|
fontWeight: '700',
|
|
53
48
|
},
|
|
54
|
-
// unfortunately marginVertical doesn't override the defaults for these within the 3rd party lib
|
|
55
49
|
paragraph: {
|
|
56
50
|
marginBottom: 8,
|
|
57
51
|
marginTop: 8,
|
|
@@ -70,34 +64,15 @@ const parse: ParseFunction = (capture, parse, state) => ({
|
|
|
70
64
|
content: parseInline(parse, capture[0], state),
|
|
71
65
|
});
|
|
72
66
|
|
|
73
|
-
const parseUrlsFromText = (text: string) => {
|
|
74
|
-
try {
|
|
75
|
-
return anchorme(text, {
|
|
76
|
-
list: true,
|
|
77
|
-
});
|
|
78
|
-
} catch (e) {
|
|
79
|
-
console.warn(`failure at parseUrlsFromText: ${e}`);
|
|
80
|
-
// In case of failures its not worth crashing the app,
|
|
81
|
-
// and instead simply to have un-parsed urls in message text.
|
|
82
|
-
return [];
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
67
|
export type MarkdownRules = Partial<DefaultRules>;
|
|
87
68
|
|
|
88
69
|
export type RenderTextParams<
|
|
89
|
-
|
|
90
|
-
Ch extends UnknownType = DefaultChannelType,
|
|
91
|
-
Co extends string = DefaultCommandType,
|
|
92
|
-
Ev extends UnknownType = DefaultEventType,
|
|
93
|
-
Me extends UnknownType = DefaultMessageType,
|
|
94
|
-
Re extends UnknownType = DefaultReactionType,
|
|
95
|
-
Us extends UnknownType = DefaultUserType,
|
|
70
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
96
71
|
> = Partial<
|
|
97
|
-
Pick<MessageContextValue<
|
|
72
|
+
Pick<MessageContextValue<StreamChatGenerics>, 'onLongPress' | 'onPress' | 'preventPress'>
|
|
98
73
|
> & {
|
|
99
74
|
colors: typeof Colors;
|
|
100
|
-
message: MessageType<
|
|
75
|
+
message: MessageType<StreamChatGenerics>;
|
|
101
76
|
markdownRules?: MarkdownRules;
|
|
102
77
|
markdownStyles?: MarkdownStyle;
|
|
103
78
|
messageOverlay?: boolean;
|
|
@@ -107,15 +82,9 @@ export type RenderTextParams<
|
|
|
107
82
|
};
|
|
108
83
|
|
|
109
84
|
export const renderText = <
|
|
110
|
-
|
|
111
|
-
Ch extends UnknownType = DefaultChannelType,
|
|
112
|
-
Co extends string = DefaultCommandType,
|
|
113
|
-
Ev extends UnknownType = DefaultEventType,
|
|
114
|
-
Me extends UnknownType = DefaultMessageType,
|
|
115
|
-
Re extends UnknownType = DefaultReactionType,
|
|
116
|
-
Us extends UnknownType = DefaultUserType,
|
|
85
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
117
86
|
>(
|
|
118
|
-
params: RenderTextParams<
|
|
87
|
+
params: RenderTextParams<StreamChatGenerics>,
|
|
119
88
|
) => {
|
|
120
89
|
const {
|
|
121
90
|
colors,
|
|
@@ -138,14 +107,14 @@ export const renderText = <
|
|
|
138
107
|
if (!text) return null;
|
|
139
108
|
|
|
140
109
|
let newText = text.trim();
|
|
141
|
-
const urls =
|
|
110
|
+
const urls = parseLinksFromText(newText);
|
|
142
111
|
|
|
143
112
|
for (const urlInfo of urls) {
|
|
144
|
-
const displayLink = truncate(urlInfo.encoded
|
|
113
|
+
const displayLink = truncate(urlInfo.encoded, {
|
|
145
114
|
length: 200,
|
|
146
115
|
omission: '...',
|
|
147
116
|
});
|
|
148
|
-
const markdown = `[${displayLink}](${urlInfo.
|
|
117
|
+
const markdown = `[${displayLink}](${urlInfo.scheme}${urlInfo.encoded})`;
|
|
149
118
|
newText = newText.replace(urlInfo.raw, markdown);
|
|
150
119
|
}
|
|
151
120
|
|
|
@@ -183,7 +152,7 @@ export const renderText = <
|
|
|
183
152
|
? onLinkParams(url)
|
|
184
153
|
: Linking.canOpenURL(url).then((canOpenUrl) => canOpenUrl && Linking.openURL(url));
|
|
185
154
|
|
|
186
|
-
const
|
|
155
|
+
const link: ReactNodeOutput = (node, output, { ...state }) => {
|
|
187
156
|
const onPress = (event: GestureResponderEvent) => {
|
|
188
157
|
if (!preventPress && onPressParam) {
|
|
189
158
|
onPressParam({
|
|
@@ -261,56 +230,24 @@ export const renderText = <
|
|
|
261
230
|
);
|
|
262
231
|
};
|
|
263
232
|
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
* This custom rule overrides this behavior both for top level lists and sublists,
|
|
274
|
-
* in order to start the numbering from the number of the first list item provided.
|
|
275
|
-
* */
|
|
276
|
-
const customListAtLevel =
|
|
277
|
-
(level: keyof typeof listLevels): ReactNodeOutput =>
|
|
278
|
-
(node, output, { ...state }) => {
|
|
279
|
-
const items = node.items.map((item: Array<SingleASTNode>, index: number) => {
|
|
280
|
-
const withinList = item.length > 1 && item[1].type === 'list';
|
|
281
|
-
const content = output(item, { ...state, withinList });
|
|
282
|
-
|
|
283
|
-
const isTopLevelText =
|
|
284
|
-
['text', 'paragraph', 'strong'].includes(item[0].type) && withinList === false;
|
|
285
|
-
|
|
286
|
-
return (
|
|
287
|
-
<View key={index} style={styles.listRow}>
|
|
288
|
-
<Text style={styles.listItemNumber}>
|
|
289
|
-
{node.ordered ? `${node.start + index}. ` : `\u2022`}
|
|
290
|
-
</Text>
|
|
291
|
-
<Text style={[styles.listItemText, isTopLevelText && { marginBottom: 0 }]}>
|
|
292
|
-
{content}
|
|
293
|
-
</Text>
|
|
294
|
-
</View>
|
|
295
|
-
);
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
const isSublist = level === 'sub';
|
|
299
|
-
return (
|
|
300
|
-
<View key={state.key} style={[isSublist ? styles.list : styles.sublist]}>
|
|
301
|
-
{items}
|
|
302
|
-
</View>
|
|
303
|
-
);
|
|
304
|
-
};
|
|
233
|
+
const list: ReactNodeOutput = (node, output, state) => (
|
|
234
|
+
<ListOutput
|
|
235
|
+
key={`list-${state.key}`}
|
|
236
|
+
node={node}
|
|
237
|
+
output={output}
|
|
238
|
+
state={state}
|
|
239
|
+
styles={styles}
|
|
240
|
+
/>
|
|
241
|
+
);
|
|
305
242
|
|
|
306
243
|
const customRules = {
|
|
307
|
-
link: {
|
|
308
|
-
list: { react:
|
|
244
|
+
link: { link },
|
|
245
|
+
list: { react: list },
|
|
309
246
|
// Truncate long text content in the message overlay
|
|
310
247
|
paragraph: messageTextNumberOfLines ? { react: paragraphText } : {},
|
|
311
248
|
// we have no react rendering support for reflinks
|
|
312
249
|
reflink: { match: () => null },
|
|
313
|
-
sublist: { react:
|
|
250
|
+
sublist: { react: list },
|
|
314
251
|
...(mentionedUsers
|
|
315
252
|
? {
|
|
316
253
|
mentions: {
|
|
@@ -339,3 +276,69 @@ export const renderText = <
|
|
|
339
276
|
</Markdown>
|
|
340
277
|
);
|
|
341
278
|
};
|
|
279
|
+
|
|
280
|
+
export interface ListOutputProps {
|
|
281
|
+
node: SingleASTNode;
|
|
282
|
+
output: ReactOutput;
|
|
283
|
+
state: State;
|
|
284
|
+
styles?: Partial<MarkdownStyle>;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* For lists and sublists, the default behavior of the markdown library we use is
|
|
289
|
+
* to always renumber any list, so all ordered lists start from 1.
|
|
290
|
+
*
|
|
291
|
+
* This custom rule overrides this behavior both for top level lists and sublists,
|
|
292
|
+
* in order to start the numbering from the number of the first list item provided.
|
|
293
|
+
*/
|
|
294
|
+
export const ListOutput = ({ node, output, state, styles }: ListOutputProps) => {
|
|
295
|
+
let isSublist = state.withinList;
|
|
296
|
+
const parentTypes = ['text', 'paragraph', 'strong'];
|
|
297
|
+
|
|
298
|
+
return (
|
|
299
|
+
<View key={state.key} style={isSublist ? styles?.sublist : styles?.list}>
|
|
300
|
+
{node.items.map((item: SingleASTNode, index: number) => {
|
|
301
|
+
const indexAfterStart = node.start + index;
|
|
302
|
+
|
|
303
|
+
if (item === null) {
|
|
304
|
+
return (
|
|
305
|
+
<ListRow key={index} style={styles?.listRow} testID='list-item'>
|
|
306
|
+
<Bullet index={node.ordered && indexAfterStart} />
|
|
307
|
+
</ListRow>
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
isSublist = item.length > 1 && item[1].type === 'list';
|
|
312
|
+
const isSublistWithinText = parentTypes.includes((item[0] ?? {}).type) && isSublist;
|
|
313
|
+
const style = isSublistWithinText ? { marginBottom: 0 } : {};
|
|
314
|
+
|
|
315
|
+
return (
|
|
316
|
+
<ListRow key={index} style={styles?.listRow} testID='list-item'>
|
|
317
|
+
<Bullet index={node.ordered && indexAfterStart} />
|
|
318
|
+
<ListItem key={1} style={[styles?.listItemText, style]}>
|
|
319
|
+
{output(item, state)}
|
|
320
|
+
</ListItem>
|
|
321
|
+
</ListRow>
|
|
322
|
+
);
|
|
323
|
+
})}
|
|
324
|
+
</View>
|
|
325
|
+
);
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
interface BulletProps extends TextProps {
|
|
329
|
+
index?: number;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const Bullet = ({ index, style }: BulletProps) => (
|
|
333
|
+
<Text key={0} style={[style, defaultMarkdownStyles.listItemNumber]}>
|
|
334
|
+
{index ? `${index}. ` : '\u2022 '}
|
|
335
|
+
</Text>
|
|
336
|
+
);
|
|
337
|
+
|
|
338
|
+
const ListRow = (props: PropsWithChildren<ViewProps>) => (
|
|
339
|
+
<Text style={[props.style, defaultMarkdownStyles.listRow]}>{props.children}</Text>
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
const ListItem = ({ children, style }: PropsWithChildren<TextProps>) => (
|
|
343
|
+
<Text style={style}>{children}</Text>
|
|
344
|
+
);
|
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
import { isMessageWithStylesReadByAndDateSeparator } from '../../MessageList/hooks/useMessageList';
|
|
4
|
-
|
|
5
3
|
import type { MessageContextValue } from '../../../contexts/messageContext/MessageContext';
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
DefaultChannelType,
|
|
9
|
-
DefaultCommandType,
|
|
10
|
-
DefaultEventType,
|
|
11
|
-
DefaultMessageType,
|
|
12
|
-
DefaultReactionType,
|
|
13
|
-
DefaultUserType,
|
|
14
|
-
UnknownType,
|
|
15
|
-
} from '../../../types/types';
|
|
4
|
+
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
5
|
+
import { isMessageWithStylesReadByAndDateSeparator } from '../../MessageList/hooks/useMessageList';
|
|
16
6
|
|
|
17
7
|
export const useCreateMessageContext = <
|
|
18
|
-
|
|
19
|
-
Ch extends UnknownType = DefaultChannelType,
|
|
20
|
-
Co extends string = DefaultCommandType,
|
|
21
|
-
Ev extends UnknownType = DefaultEventType,
|
|
22
|
-
Me extends UnknownType = DefaultMessageType,
|
|
23
|
-
Re extends UnknownType = DefaultReactionType,
|
|
24
|
-
Us extends UnknownType = DefaultUserType,
|
|
8
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
25
9
|
>({
|
|
26
10
|
actionsEnabled,
|
|
27
11
|
alignment,
|
|
@@ -58,7 +42,7 @@ export const useCreateMessageContext = <
|
|
|
58
42
|
showMessageOverlay,
|
|
59
43
|
showMessageStatus,
|
|
60
44
|
threadList,
|
|
61
|
-
}: MessageContextValue<
|
|
45
|
+
}: MessageContextValue<StreamChatGenerics>) => {
|
|
62
46
|
const groupStylesLength = groupStyles.length;
|
|
63
47
|
const reactionsValue = reactions.map(({ own, type }) => `${own}${type}`).join();
|
|
64
48
|
const latestReactions = message.latest_reactions ? message.latest_reactions : undefined;
|
|
@@ -72,7 +56,7 @@ export const useCreateMessageContext = <
|
|
|
72
56
|
|
|
73
57
|
const quotedMessageDeletedValue = message.quoted_message?.deleted_at;
|
|
74
58
|
|
|
75
|
-
const messageContext: MessageContextValue<
|
|
59
|
+
const messageContext: MessageContextValue<StreamChatGenerics> = useMemo(
|
|
76
60
|
() => ({
|
|
77
61
|
actionsEnabled,
|
|
78
62
|
alignment,
|
|
@@ -2,52 +2,42 @@ import type { MessageResponse, Reaction } from 'stream-chat';
|
|
|
2
2
|
|
|
3
3
|
import type { ChannelContextValue } from '../../../contexts/channelContext/ChannelContext';
|
|
4
4
|
import type { ChatContextValue } from '../../../contexts/chatContext/ChatContext';
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
MessageContextValue,
|
|
7
|
+
Reactions,
|
|
8
|
+
} from '../../../contexts/messageContext/MessageContext';
|
|
6
9
|
import type { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';
|
|
7
|
-
import type { Reactions } from '../../../contexts/messageContext/MessageContext';
|
|
8
10
|
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
DefaultChannelType,
|
|
12
|
-
DefaultCommandType,
|
|
13
|
-
DefaultEventType,
|
|
14
|
-
DefaultMessageType,
|
|
15
|
-
DefaultReactionType,
|
|
16
|
-
DefaultUserType,
|
|
17
|
-
UnknownType,
|
|
18
|
-
} from '../../../types/types';
|
|
11
|
+
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
12
|
+
import { MessageStatusTypes } from '../../../utils/utils';
|
|
19
13
|
|
|
20
14
|
export const useMessageActionHandlers = <
|
|
21
|
-
|
|
22
|
-
Ch extends UnknownType = DefaultChannelType,
|
|
23
|
-
Co extends string = DefaultCommandType,
|
|
24
|
-
Ev extends UnknownType = DefaultEventType,
|
|
25
|
-
Me extends UnknownType = DefaultMessageType,
|
|
26
|
-
Re extends UnknownType = DefaultReactionType,
|
|
27
|
-
Us extends UnknownType = DefaultUserType,
|
|
15
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
28
16
|
>({
|
|
29
17
|
channel,
|
|
30
18
|
client,
|
|
31
19
|
enforceUniqueReaction,
|
|
32
20
|
message,
|
|
21
|
+
removeMessage,
|
|
33
22
|
retrySendMessage,
|
|
34
23
|
setEditingState,
|
|
35
24
|
setQuotedMessageState,
|
|
36
25
|
supportedReactions,
|
|
37
26
|
updateMessage,
|
|
38
27
|
}: Pick<
|
|
39
|
-
MessagesContextValue<
|
|
28
|
+
MessagesContextValue<StreamChatGenerics>,
|
|
29
|
+
| 'removeMessage'
|
|
40
30
|
| 'retrySendMessage'
|
|
41
31
|
| 'setEditingState'
|
|
42
32
|
| 'setQuotedMessageState'
|
|
43
33
|
| 'supportedReactions'
|
|
44
34
|
| 'updateMessage'
|
|
45
35
|
> &
|
|
46
|
-
Pick<ChannelContextValue<
|
|
47
|
-
Pick<ChatContextValue<
|
|
48
|
-
Pick<MessageContextValue<
|
|
36
|
+
Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'enforceUniqueReaction'> &
|
|
37
|
+
Pick<ChatContextValue<StreamChatGenerics>, 'client'> &
|
|
38
|
+
Pick<MessageContextValue<StreamChatGenerics>, 'message'>) => {
|
|
49
39
|
const handleResendMessage = () =>
|
|
50
|
-
retrySendMessage(message as MessageResponse<
|
|
40
|
+
retrySendMessage(message as MessageResponse<StreamChatGenerics>);
|
|
51
41
|
|
|
52
42
|
const handleQuotedReplyMessage = () => {
|
|
53
43
|
setQuotedMessageState(message);
|
|
@@ -58,8 +48,12 @@ export const useMessageActionHandlers = <
|
|
|
58
48
|
);
|
|
59
49
|
|
|
60
50
|
const handleDeleteMessage = async () => {
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
if (message.status === MessageStatusTypes.FAILED) {
|
|
52
|
+
removeMessage(message);
|
|
53
|
+
} else {
|
|
54
|
+
const data = await client.deleteMessage(message.id);
|
|
55
|
+
updateMessage(data.message);
|
|
56
|
+
}
|
|
63
57
|
};
|
|
64
58
|
|
|
65
59
|
const handleToggleMuteUser = async () => {
|
|
@@ -140,7 +134,7 @@ export const useMessageActionHandlers = <
|
|
|
140
134
|
messageId,
|
|
141
135
|
{
|
|
142
136
|
type: reactionType,
|
|
143
|
-
} as Reaction<
|
|
137
|
+
} as Reaction<StreamChatGenerics>,
|
|
144
138
|
{ enforce_unique: enforceUniqueReaction },
|
|
145
139
|
);
|
|
146
140
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Alert, Clipboard } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { useMessageActionHandlers } from './useMessageActionHandlers';
|
|
5
|
+
|
|
4
6
|
import type { ChannelContextValue } from '../../../contexts/channelContext/ChannelContext';
|
|
5
7
|
import type { ChatContextValue } from '../../../contexts/chatContext/ChatContext';
|
|
6
|
-
import type { MessageActionType } from '../../MessageOverlay/MessageActionListItem';
|
|
7
8
|
import type { MessageContextValue } from '../../../contexts/messageContext/MessageContext';
|
|
8
9
|
import type { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';
|
|
9
|
-
import {
|
|
10
|
+
import type { OverlayContextValue } from '../../../contexts/overlayContext/OverlayContext';
|
|
10
11
|
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
11
|
-
import type {
|
|
12
|
+
import type { ThreadContextValue } from '../../../contexts/threadContext/ThreadContext';
|
|
13
|
+
import type { TranslationContextValue } from '../../../contexts/translationContext/TranslationContext';
|
|
12
14
|
import {
|
|
13
15
|
Copy,
|
|
14
16
|
CurveLineLeftUp,
|
|
@@ -22,30 +24,15 @@ import {
|
|
|
22
24
|
Unpin,
|
|
23
25
|
UserDelete,
|
|
24
26
|
} from '../../../icons';
|
|
25
|
-
import type {
|
|
26
|
-
import
|
|
27
|
-
import type { TranslationContextValue } from '../../../contexts/translationContext/TranslationContext';
|
|
27
|
+
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
28
|
+
import { MessageStatusTypes } from '../../../utils/utils';
|
|
28
29
|
|
|
29
|
-
import type {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
DefaultCommandType,
|
|
33
|
-
DefaultEventType,
|
|
34
|
-
DefaultMessageType,
|
|
35
|
-
DefaultReactionType,
|
|
36
|
-
DefaultUserType,
|
|
37
|
-
UnknownType,
|
|
38
|
-
} from '../../../types/types';
|
|
39
|
-
import { useMessageActionHandlers } from './useMessageActionHandlers';
|
|
30
|
+
import type { MessageType } from '../../MessageList/hooks/useMessageList';
|
|
31
|
+
import type { MessageActionType } from '../../MessageOverlay/MessageActionListItem';
|
|
32
|
+
import { removeReservedFields } from '../utils/removeReservedFields';
|
|
40
33
|
|
|
41
34
|
export const useMessageActions = <
|
|
42
|
-
|
|
43
|
-
Ch extends UnknownType = DefaultChannelType,
|
|
44
|
-
Co extends string = DefaultCommandType,
|
|
45
|
-
Ev extends UnknownType = DefaultEventType,
|
|
46
|
-
Me extends UnknownType = DefaultMessageType,
|
|
47
|
-
Re extends UnknownType = DefaultReactionType,
|
|
48
|
-
Us extends UnknownType = DefaultUserType,
|
|
35
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
49
36
|
>({
|
|
50
37
|
channel,
|
|
51
38
|
client,
|
|
@@ -64,6 +51,7 @@ export const useMessageActions = <
|
|
|
64
51
|
message,
|
|
65
52
|
onThreadSelect,
|
|
66
53
|
openThread,
|
|
54
|
+
removeMessage,
|
|
67
55
|
retrySendMessage,
|
|
68
56
|
selectReaction,
|
|
69
57
|
setEditingState,
|
|
@@ -73,7 +61,7 @@ export const useMessageActions = <
|
|
|
73
61
|
t,
|
|
74
62
|
updateMessage,
|
|
75
63
|
}: Pick<
|
|
76
|
-
MessagesContextValue<
|
|
64
|
+
MessagesContextValue<StreamChatGenerics>,
|
|
77
65
|
| 'handleBlock'
|
|
78
66
|
| 'handleCopy'
|
|
79
67
|
| 'handleDelete'
|
|
@@ -85,6 +73,7 @@ export const useMessageActions = <
|
|
|
85
73
|
| 'handleRetry'
|
|
86
74
|
| 'handleReaction'
|
|
87
75
|
| 'handleThreadReply'
|
|
76
|
+
| 'removeMessage'
|
|
88
77
|
| 'retrySendMessage'
|
|
89
78
|
| 'setEditingState'
|
|
90
79
|
| 'setQuotedMessageState'
|
|
@@ -92,13 +81,13 @@ export const useMessageActions = <
|
|
|
92
81
|
| 'supportedReactions'
|
|
93
82
|
| 'updateMessage'
|
|
94
83
|
> &
|
|
95
|
-
Pick<ChannelContextValue<
|
|
96
|
-
Pick<ChatContextValue<
|
|
84
|
+
Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'enforceUniqueReaction'> &
|
|
85
|
+
Pick<ChatContextValue<StreamChatGenerics>, 'client'> &
|
|
97
86
|
Pick<OverlayContextValue, 'setOverlay'> &
|
|
98
|
-
Pick<ThreadContextValue<
|
|
99
|
-
Pick<MessageContextValue<
|
|
87
|
+
Pick<ThreadContextValue<StreamChatGenerics>, 'openThread'> &
|
|
88
|
+
Pick<MessageContextValue<StreamChatGenerics>, 'message'> &
|
|
100
89
|
Pick<TranslationContextValue, 't'> & {
|
|
101
|
-
onThreadSelect?: (message: MessageType<
|
|
90
|
+
onThreadSelect?: (message: MessageType<StreamChatGenerics>) => void;
|
|
102
91
|
}) => {
|
|
103
92
|
const {
|
|
104
93
|
theme: {
|
|
@@ -119,6 +108,7 @@ export const useMessageActions = <
|
|
|
119
108
|
client,
|
|
120
109
|
enforceUniqueReaction,
|
|
121
110
|
message,
|
|
111
|
+
removeMessage,
|
|
122
112
|
retrySendMessage,
|
|
123
113
|
setEditingState,
|
|
124
114
|
setQuotedMessageState,
|
|
@@ -126,7 +116,7 @@ export const useMessageActions = <
|
|
|
126
116
|
updateMessage,
|
|
127
117
|
});
|
|
128
118
|
|
|
129
|
-
const error = message.type === 'error' || message.status ===
|
|
119
|
+
const error = message.type === 'error' || message.status === MessageStatusTypes.FAILED;
|
|
130
120
|
|
|
131
121
|
const onOpenThread = () => {
|
|
132
122
|
if (onThreadSelect) {
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import type { MessageActionType } from '../../MessageOverlay/MessageActionListItem';
|
|
2
|
-
import type { OwnCapabilitiesContextValue } from '../../../contexts/ownCapabilitiesContext/OwnCapabilitiesContext';
|
|
3
1
|
import type { MessageContextValue } from '../../../contexts/messageContext/MessageContext';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
DefaultCommandType,
|
|
8
|
-
DefaultEventType,
|
|
9
|
-
DefaultMessageType,
|
|
10
|
-
DefaultReactionType,
|
|
11
|
-
DefaultUserType,
|
|
12
|
-
UnknownType,
|
|
13
|
-
} from '../../../types/types';
|
|
2
|
+
import type { OwnCapabilitiesContextValue } from '../../../contexts/ownCapabilitiesContext/OwnCapabilitiesContext';
|
|
3
|
+
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
4
|
+
import type { MessageActionType } from '../../MessageOverlay/MessageActionListItem';
|
|
14
5
|
|
|
15
6
|
export type MessageActionsParams<
|
|
16
|
-
|
|
17
|
-
Ch extends UnknownType = DefaultChannelType,
|
|
18
|
-
Co extends string = DefaultCommandType,
|
|
19
|
-
Ev extends UnknownType = DefaultEventType,
|
|
20
|
-
Me extends UnknownType = DefaultMessageType,
|
|
21
|
-
Re extends UnknownType = DefaultReactionType,
|
|
22
|
-
Us extends UnknownType = DefaultUserType,
|
|
7
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
23
8
|
> = {
|
|
24
9
|
blockUser: MessageActionType;
|
|
25
10
|
copyMessage: MessageActionType;
|
|
@@ -37,26 +22,14 @@ export type MessageActionsParams<
|
|
|
37
22
|
retry: MessageActionType;
|
|
38
23
|
threadReply: MessageActionType;
|
|
39
24
|
unpinMessage: MessageActionType;
|
|
40
|
-
} & Pick<MessageContextValue<
|
|
25
|
+
} & Pick<MessageContextValue<StreamChatGenerics>, 'message' | 'isMyMessage'>;
|
|
41
26
|
|
|
42
27
|
export type MessageActionsProp<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Co extends string = DefaultCommandType,
|
|
46
|
-
Ev extends UnknownType = DefaultEventType,
|
|
47
|
-
Me extends UnknownType = DefaultMessageType,
|
|
48
|
-
Re extends UnknownType = DefaultReactionType,
|
|
49
|
-
Us extends UnknownType = DefaultUserType,
|
|
50
|
-
> = (param: MessageActionsParams<At, Ch, Co, Ev, Me, Re, Us>) => MessageActionType[];
|
|
28
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
29
|
+
> = (param: MessageActionsParams<StreamChatGenerics>) => MessageActionType[];
|
|
51
30
|
|
|
52
31
|
export const messageActions = <
|
|
53
|
-
|
|
54
|
-
Ch extends UnknownType = DefaultChannelType,
|
|
55
|
-
Co extends string = DefaultCommandType,
|
|
56
|
-
Ev extends UnknownType = DefaultEventType,
|
|
57
|
-
Me extends UnknownType = DefaultMessageType,
|
|
58
|
-
Re extends UnknownType = DefaultReactionType,
|
|
59
|
-
Us extends UnknownType = DefaultUserType,
|
|
32
|
+
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
60
33
|
>({
|
|
61
34
|
blockUser,
|
|
62
35
|
copyMessage,
|
|
@@ -74,7 +47,7 @@ export const messageActions = <
|
|
|
74
47
|
retry,
|
|
75
48
|
threadReply,
|
|
76
49
|
unpinMessage,
|
|
77
|
-
}: MessageActionsParams<
|
|
50
|
+
}: MessageActionsParams<StreamChatGenerics>) => {
|
|
78
51
|
if (messageReactions) {
|
|
79
52
|
return undefined;
|
|
80
53
|
}
|