stream-chat-react-native-core 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -13
- package/lib/commonjs/components/Attachment/Attachment.js +17 -16
- package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/AttachmentActions.js +5 -5
- package/lib/commonjs/components/Attachment/AttachmentActions.js.map +1 -1
- package/lib/commonjs/components/Attachment/Card.js +19 -16
- package/lib/commonjs/components/Attachment/Card.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +9 -9
- package/lib/commonjs/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +5 -5
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +124 -122
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +113 -149
- package/lib/commonjs/components/Attachment/Giphy.js.map +1 -1
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/buildGallery/types.js +4 -0
- package/lib/commonjs/{styleguideComponents/Reanimated.js.map → components/Attachment/utils/buildGallery/types.js.map} +0 -0
- package/lib/commonjs/components/Attachment/utils/getAspectRatio.js +14 -0
- package/lib/commonjs/components/Attachment/utils/getAspectRatio.js.map +1 -0
- package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
- package/lib/commonjs/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +10 -9
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +12 -9
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +25 -49
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/{CommandsItem.js → AutoCompleteSuggestionCommandIcon.js} +21 -94
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +145 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +248 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +223 -0
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -0
- package/lib/commonjs/components/Avatar/Avatar.js +14 -8
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +11 -9
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +304 -203
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +7 -5
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js +7 -5
- package/lib/commonjs/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +13 -31
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +35 -0
- package/lib/commonjs/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -0
- package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateTypingContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +7 -7
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +6 -5
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +7 -8
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +5 -4
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +8 -5
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +18 -18
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelList/Skeleton.js +15 -14
- package/lib/commonjs/components/ChannelList/Skeleton.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js +3 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js +3 -3
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +96 -63
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelList/utils.js +1 -1
- package/lib/commonjs/components/ChannelList/utils.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +3 -3
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +5 -5
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +6 -6
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +50 -21
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +5 -5
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +2 -2
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +3 -3
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js +16 -7
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js +2 -1
- package/lib/commonjs/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +9 -5
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useIsOnline.js +40 -31
- package/lib/commonjs/components/Chat/hooks/useIsOnline.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +91 -59
- package/lib/commonjs/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +3 -3
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +13 -13
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +32 -17
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +8 -8
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +6 -6
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDot.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDots.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +10 -10
- package/lib/commonjs/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js +21 -13
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js.map +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/commonjs/components/Message/Message.js +153 -855
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +7 -7
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +42 -40
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +9 -7
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +35 -23
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +122 -0
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -0
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +27 -11
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +6 -6
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +32 -15
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +29 -25
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +8 -4
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +87 -114
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js +89 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.js.map +1 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js +46 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +208 -27
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js +240 -0
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js.map +1 -0
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js +1 -5
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js +307 -0
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -0
- package/lib/commonjs/components/Message/hooks/useMessageActions.js +563 -0
- package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -0
- package/lib/commonjs/components/Message/utils/messageActions.js +17 -15
- package/lib/commonjs/components/Message/utils/messageActions.js.map +1 -1
- package/lib/commonjs/components/Message/utils/removeReservedFields.js.map +1 -1
- package/lib/commonjs/components/MessageInput/AttachButton.js +7 -5
- package/lib/commonjs/components/MessageInput/AttachButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/CommandsButton.js +4 -4
- package/lib/commonjs/components/MessageInput/CommandsButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/CooldownTimer.js +78 -0
- package/lib/commonjs/components/MessageInput/CooldownTimer.js.map +1 -0
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +33 -28
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +10 -10
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +18 -23
- package/lib/commonjs/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +94 -66
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +4 -4
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +9 -7
- package/lib/commonjs/components/MessageInput/SendButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +71 -0
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -0
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +12 -11
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js +1 -1
- package/lib/commonjs/components/MessageInput/hooks/useCooldown.js +63 -0
- package/lib/commonjs/components/MessageInput/hooks/useCooldown.js.map +1 -0
- package/lib/commonjs/components/MessageInput/hooks/useCountdown.js +57 -0
- package/lib/commonjs/components/MessageInput/hooks/useCountdown.js.map +1 -0
- package/lib/commonjs/components/MessageList/DateHeader.js +3 -3
- package/lib/commonjs/components/MessageList/DateHeader.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js +5 -4
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +5 -5
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +5 -5
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +5 -5
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +101 -62
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageSystem.js +7 -7
- package/lib/commonjs/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/commonjs/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +8 -6
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicator.js +6 -6
- package/lib/commonjs/components/MessageList/TypingIndicator.js.map +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +3 -3
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js +24 -11
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useTypingString.js +2 -2
- package/lib/commonjs/components/MessageList/hooks/useTypingString.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/filterTypingUsers.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getDateSeparators.js +2 -1
- package/lib/commonjs/components/MessageList/utils/getDateSeparators.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js +11 -10
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js +3 -1
- package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getReadStates.js.map +1 -1
- package/lib/{module/components/MessageOverlay/MessageActions.js → commonjs/components/MessageOverlay/MessageActionList.js} +33 -85
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js.map +1 -0
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +131 -0
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js.map +1 -0
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +100 -85
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +38 -0
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js.map +1 -0
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +18 -19
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +32 -35
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
- package/lib/commonjs/components/MessageOverlay/hooks/useMessageActionAnimation.js +37 -0
- package/lib/commonjs/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -0
- package/lib/commonjs/components/Reply/Reply.js +26 -20
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/Spinner/Spinner.js +1 -1
- package/lib/commonjs/components/Thread/Thread.js +15 -6
- package/lib/commonjs/components/Thread/Thread.js.map +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +14 -13
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/commonjs/components/docs/ListProps.md +1 -1
- package/lib/commonjs/components/docs/data.js +45 -45
- package/lib/commonjs/components/docs/data.js.map +1 -1
- package/lib/commonjs/components/index.js +133 -55
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +3 -3
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +3 -3
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +3 -3
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +3 -3
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +5 -5
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js +3 -3
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +3 -3
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +3 -3
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +3 -3
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js.map +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js +3 -3
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +106 -71
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +9 -5
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +6 -20
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +3 -3
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +2 -2
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +50 -50
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +61 -0
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js.map +1 -0
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +3 -3
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +21 -34
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/ThemeContext.js +3 -3
- package/lib/commonjs/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +48 -20
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.js +3 -3
- package/lib/commonjs/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +4 -4
- package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/commonjs/contexts/typingContext/TypingContext.js +3 -3
- package/lib/commonjs/contexts/typingContext/TypingContext.js.map +1 -1
- package/lib/commonjs/contexts/utils/getDisplayName.js.map +1 -1
- package/lib/commonjs/emoji-data/compiled.js +0 -315
- package/lib/commonjs/emoji-data/compiled.js.map +1 -1
- package/lib/commonjs/emoji-data/emojiNames.js +0 -105
- package/lib/commonjs/emoji-data/emojiNames.js.map +1 -1
- package/lib/commonjs/emoji-data/emojis.js +0 -175
- package/lib/commonjs/emoji-data/emojis.js.map +1 -1
- package/lib/commonjs/emoji-data/index.js +2 -2
- package/lib/commonjs/emoji-data/index.js.map +1 -1
- package/lib/commonjs/hooks/useAppStateListener.js +8 -5
- package/lib/commonjs/hooks/useAppStateListener.js.map +1 -1
- package/lib/commonjs/hooks/useIsMountedRef.js +19 -0
- package/lib/commonjs/hooks/useIsMountedRef.js.map +1 -0
- package/lib/commonjs/hooks/useStreami18n.js +5 -2
- package/lib/commonjs/hooks/useStreami18n.js.map +1 -1
- package/lib/commonjs/i18n/en.json +9 -3
- package/lib/commonjs/i18n/fr.json +9 -3
- package/lib/commonjs/i18n/hi.json +9 -3
- package/lib/commonjs/i18n/it.json +9 -3
- package/lib/commonjs/i18n/ja.json +67 -0
- package/lib/commonjs/i18n/ko.json +67 -0
- package/lib/commonjs/i18n/nl.json +9 -3
- package/lib/commonjs/i18n/ru.json +9 -3
- package/lib/commonjs/i18n/tr.json +10 -4
- package/lib/commonjs/icons/ArrowRight.js +1 -1
- package/lib/commonjs/icons/AtMentions.js +1 -1
- package/lib/commonjs/icons/Attach.js +1 -1
- package/lib/commonjs/icons/Audio.js +1 -1
- package/lib/commonjs/icons/CSV.js +1 -1
- package/lib/commonjs/icons/Camera.js +1 -1
- package/lib/commonjs/icons/Check.js +1 -1
- package/lib/commonjs/icons/CheckAll.js +1 -1
- package/lib/commonjs/icons/CheckSend.js +1 -1
- package/lib/commonjs/icons/CircleClose.js +1 -1
- package/lib/commonjs/icons/CirclePlus.js +1 -1
- package/lib/commonjs/icons/CircleRight.js +1 -1
- package/lib/commonjs/icons/Close.js +1 -1
- package/lib/commonjs/icons/Copy.js +1 -1
- package/lib/commonjs/icons/CurveLineLeftUp.js +1 -1
- package/lib/commonjs/icons/DOC.js +1 -1
- package/lib/commonjs/icons/DOCX.js +1 -1
- package/lib/commonjs/icons/Delete.js +1 -1
- package/lib/commonjs/icons/Down.js +1 -1
- package/lib/commonjs/icons/DownloadArrow.js +1 -1
- package/lib/commonjs/icons/DownloadCloud.js +1 -1
- package/lib/commonjs/icons/Edit.js +1 -1
- package/lib/commonjs/icons/Error.js +1 -1
- package/lib/commonjs/icons/Eye.js +1 -1
- package/lib/commonjs/icons/Flag.js +1 -1
- package/lib/commonjs/icons/Folder.js +1 -1
- package/lib/commonjs/icons/GenericFile.js +1 -1
- package/lib/commonjs/icons/GiphyIcon.js +1 -1
- package/lib/commonjs/icons/Grid.js +1 -1
- package/lib/commonjs/icons/Group.js +1 -1
- package/lib/commonjs/icons/HTML.js +1 -1
- package/lib/commonjs/icons/Imgur.js +1 -1
- package/lib/commonjs/icons/LOLReaction.js +1 -1
- package/lib/commonjs/icons/Lightning.js +1 -1
- package/lib/commonjs/icons/Link.js +1 -1
- package/lib/commonjs/icons/Loading.js +1 -1
- package/lib/commonjs/icons/Logo.js +1 -1
- package/lib/commonjs/icons/LoveReaction.js +1 -1
- package/lib/commonjs/icons/MD.js +1 -1
- package/lib/commonjs/icons/MailOpen.js +1 -1
- package/lib/commonjs/icons/MenuPointHorizontal.js +1 -1
- package/lib/commonjs/icons/MenuPointVertical.js +1 -1
- package/lib/commonjs/icons/MessageFlag.js +1 -1
- package/lib/commonjs/icons/MessageIcon.js +1 -1
- package/lib/commonjs/icons/Mute.js +1 -1
- package/lib/commonjs/icons/Notification.js +1 -1
- package/lib/commonjs/icons/ODT.js +1 -1
- package/lib/commonjs/icons/PDF.js +1 -1
- package/lib/commonjs/icons/PPT.js +1 -1
- package/lib/commonjs/icons/PPTX.js +1 -1
- package/lib/commonjs/icons/Picture.js +1 -1
- package/lib/commonjs/icons/Pin.js +42 -0
- package/lib/commonjs/icons/Pin.js.map +1 -0
- package/lib/commonjs/icons/PinHeader.js +38 -0
- package/lib/commonjs/icons/PinHeader.js.map +1 -0
- package/lib/commonjs/icons/RAR.js +1 -1
- package/lib/commonjs/icons/RTF.js +1 -1
- package/lib/commonjs/icons/Refresh.js +1 -1
- package/lib/commonjs/icons/SEVEN_Z.js +1 -1
- package/lib/commonjs/icons/Search.js +1 -1
- package/lib/commonjs/icons/SendRight.js +1 -1
- package/lib/commonjs/icons/SendUp.js +1 -1
- package/lib/commonjs/icons/Share.js +1 -1
- package/lib/commonjs/icons/ShareRightArrow.js +1 -1
- package/lib/commonjs/icons/Smile.js +1 -1
- package/lib/commonjs/icons/Sound.js +1 -1
- package/lib/commonjs/icons/TAR.js +1 -1
- package/lib/commonjs/icons/TXT.js +1 -1
- package/lib/commonjs/icons/ThreadReply.js +1 -1
- package/lib/commonjs/icons/ThumbsDownReaction.js +1 -1
- package/lib/commonjs/icons/ThumbsUpReaction.js +1 -1
- package/lib/commonjs/icons/Time.js +1 -1
- package/lib/commonjs/icons/Unknown.js +1 -1
- package/lib/commonjs/icons/Unpin.js +38 -0
- package/lib/commonjs/icons/Unpin.js.map +1 -0
- package/lib/commonjs/icons/User.js +1 -1
- package/lib/commonjs/icons/UserAdd.js +1 -1
- package/lib/commonjs/icons/UserAdmin.js +62 -0
- package/lib/commonjs/icons/UserAdmin.js.map +1 -0
- package/lib/commonjs/icons/UserDelete.js +1 -1
- package/lib/commonjs/icons/UserMinus.js +1 -1
- package/lib/commonjs/icons/WutReaction.js +1 -1
- package/lib/commonjs/icons/XLS.js +1 -1
- package/lib/commonjs/icons/XLSX.js +1 -1
- package/lib/commonjs/icons/ZIP.js +1 -1
- package/lib/commonjs/icons/index.js +39 -26
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/icons/utils/base.js +2 -2
- package/lib/commonjs/index.js +6 -6
- package/lib/commonjs/init.js +13 -0
- package/lib/commonjs/init.js.map +1 -0
- package/lib/commonjs/mock-builders/api/error.js +1 -1
- package/lib/commonjs/mock-builders/api/queryChannels.js +1 -1
- package/lib/commonjs/mock-builders/api/queryChannels.js.map +1 -1
- package/lib/commonjs/mock-builders/api/sendMessage.js +4 -1
- package/lib/commonjs/mock-builders/api/sendMessage.js.map +1 -1
- package/lib/commonjs/mock-builders/generator/attachment.js +1 -3
- package/lib/commonjs/mock-builders/generator/attachment.js.map +1 -1
- package/lib/commonjs/mock-builders/generator/channel.js +101 -50
- package/lib/commonjs/mock-builders/generator/channel.js.map +1 -1
- package/lib/commonjs/mock-builders/generator/user.js +32 -33
- package/lib/commonjs/mock-builders/generator/user.js.map +1 -1
- package/lib/commonjs/mock-builders/mock.js +3 -3
- package/lib/commonjs/mock-builders/mock.js.map +1 -1
- package/lib/commonjs/mock-builders/native/react-native-mock.js +1 -1
- package/lib/commonjs/mock-builders/native/react-native-mock.js.map +1 -1
- package/lib/commonjs/native.js +1 -7
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/utils/Streami18n.js +10 -0
- package/lib/commonjs/utils/Streami18n.js.map +1 -1
- package/lib/commonjs/utils/date.js +13 -0
- package/lib/commonjs/utils/date.js.map +1 -0
- package/lib/commonjs/utils/getResizedImageUrl.js +37 -0
- package/lib/commonjs/utils/getResizedImageUrl.js.map +1 -0
- package/lib/commonjs/utils/getUrlOfImageAttachment.js +9 -0
- package/lib/commonjs/utils/getUrlOfImageAttachment.js.map +1 -0
- package/lib/commonjs/utils/utils.js +39 -19
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +17 -16
- package/lib/module/components/Attachment/Attachment.js.map +1 -1
- package/lib/module/components/Attachment/AttachmentActions.js +5 -5
- package/lib/module/components/Attachment/AttachmentActions.js.map +1 -1
- package/lib/module/components/Attachment/Card.js +19 -16
- package/lib/module/components/Attachment/Card.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +9 -9
- package/lib/module/components/Attachment/FileAttachment.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +5 -5
- package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/module/components/Attachment/FileIcon.js +1 -1
- package/lib/module/components/Attachment/FileIcon.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +124 -122
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/Giphy.js +113 -149
- package/lib/module/components/Attachment/Giphy.js.map +1 -1
- package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js +46 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGallery.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js +88 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js +75 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js +43 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js +30 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnail.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js +49 -0
- package/lib/module/components/Attachment/utils/buildGallery/buildThumbnailGrid.js.map +1 -0
- package/lib/module/components/Attachment/utils/buildGallery/types.js +4 -0
- package/lib/module/{styleguideComponents/Reanimated.js.map → components/Attachment/utils/buildGallery/types.js.map} +0 -0
- package/lib/module/components/Attachment/utils/getAspectRatio.js +14 -0
- package/lib/module/components/Attachment/utils/getAspectRatio.js.map +1 -0
- package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js +36 -0
- package/lib/module/components/Attachment/utils/getGalleryImageBorderRadius.js.map +1 -0
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +10 -9
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +12 -9
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +25 -49
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/{CommandsItem.js → AutoCompleteSuggestionCommandIcon.js} +21 -94
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js.map +1 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +145 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js.map +1 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +248 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js.map +1 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +223 -0
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js.map +1 -0
- package/lib/module/components/Avatar/Avatar.js +14 -8
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +11 -9
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +304 -203
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js +7 -5
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js +7 -5
- package/lib/module/components/Channel/hooks/useCreateInputMessageInputContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +13 -31
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js +35 -0
- package/lib/module/components/Channel/hooks/useCreateOwnCapabilitiesContext.js.map +1 -0
- package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateThreadContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateTypingContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +7 -7
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +6 -5
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +7 -8
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +5 -4
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +8 -5
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +18 -18
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/ChannelList/Skeleton.js +15 -14
- package/lib/module/components/ChannelList/Skeleton.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js +3 -1
- package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js +3 -3
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +2 -2
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +96 -63
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelList/utils.js +1 -1
- package/lib/module/components/ChannelList/utils.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +3 -3
- package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +5 -5
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +6 -6
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +50 -21
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +51 -0
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -0
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +5 -5
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +2 -2
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +3 -3
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js +16 -7
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayName.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.js.map +1 -1
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js +2 -1
- package/lib/module/components/ChannelPreview/hooks/useLatestMessagePreview.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +9 -5
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/Chat/hooks/useIsOnline.js +40 -31
- package/lib/module/components/Chat/hooks/useIsOnline.js.map +1 -1
- package/lib/module/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +91 -59
- package/lib/module/components/ImageGallery/ImageGallery.js.map +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +3 -3
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +13 -13
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +32 -17
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +8 -8
- package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js +6 -6
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js.map +1 -1
- package/lib/module/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingDot.js +1 -1
- package/lib/module/components/Indicators/LoadingDots.js +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js.map +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +10 -10
- package/lib/module/components/Indicators/LoadingIndicator.js.map +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js +21 -13
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js.map +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/module/components/Message/Message.js +153 -855
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +7 -7
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +42 -40
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js +9 -7
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +35 -23
- package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +122 -0
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js.map +1 -0
- package/lib/module/components/Message/MessageSimple/MessageReplies.js +27 -11
- package/lib/module/components/Message/MessageSimple/MessageReplies.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +6 -6
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +32 -15
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +29 -25
- package/lib/module/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +8 -4
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/ReactionList.js +87 -114
- package/lib/module/components/Message/MessageSimple/ReactionList.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.js +89 -0
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.js.map +1 -0
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js +46 -0
- package/lib/module/components/Message/MessageSimple/utils/parseLinks.test.js.map +1 -0
- package/lib/module/components/Message/MessageSimple/utils/renderText.js +208 -27
- package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.test.js +240 -0
- package/lib/module/components/Message/MessageSimple/utils/renderText.test.js.map +1 -0
- package/lib/module/components/Message/hooks/useCreateMessageContext.js +1 -5
- package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js +307 -0
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -0
- package/lib/module/components/Message/hooks/useMessageActions.js +563 -0
- package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -0
- package/lib/module/components/Message/utils/messageActions.js +17 -15
- package/lib/module/components/Message/utils/messageActions.js.map +1 -1
- package/lib/module/components/Message/utils/removeReservedFields.js.map +1 -1
- package/lib/module/components/MessageInput/AttachButton.js +7 -5
- package/lib/module/components/MessageInput/AttachButton.js.map +1 -1
- package/lib/module/components/MessageInput/CommandsButton.js +4 -4
- package/lib/module/components/MessageInput/CommandsButton.js.map +1 -1
- package/lib/module/components/MessageInput/CooldownTimer.js +78 -0
- package/lib/module/components/MessageInput/CooldownTimer.js.map +1 -0
- package/lib/module/components/MessageInput/FileUploadPreview.js +33 -28
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +10 -10
- package/lib/module/components/MessageInput/ImageUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +18 -23
- package/lib/module/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +94 -66
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/MoreOptionsButton.js +4 -4
- package/lib/module/components/MessageInput/MoreOptionsButton.js.map +1 -1
- package/lib/module/components/MessageInput/SendButton.js +9 -7
- package/lib/module/components/MessageInput/SendButton.js.map +1 -1
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +71 -0
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js.map +1 -0
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +12 -11
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js.map +1 -1
- package/lib/module/components/MessageInput/UploadProgressIndicator.js +1 -1
- package/lib/module/components/MessageInput/hooks/useCooldown.js +63 -0
- package/lib/module/components/MessageInput/hooks/useCooldown.js.map +1 -0
- package/lib/module/components/MessageInput/hooks/useCountdown.js +57 -0
- package/lib/module/components/MessageInput/hooks/useCountdown.js.map +1 -0
- package/lib/module/components/MessageList/DateHeader.js +3 -3
- package/lib/module/components/MessageList/DateHeader.js.map +1 -1
- package/lib/module/components/MessageList/InlineDateSeparator.js +5 -4
- package/lib/module/components/MessageList/InlineDateSeparator.js.map +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +5 -5
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js.map +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +5 -5
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js.map +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +5 -5
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js.map +1 -1
- package/lib/module/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/module/components/MessageList/MessageList.js +101 -62
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/MessageSystem.js +7 -7
- package/lib/module/components/MessageList/MessageSystem.js.map +1 -1
- package/lib/module/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/module/components/MessageList/ScrollToBottomButton.js +8 -6
- package/lib/module/components/MessageList/ScrollToBottomButton.js.map +1 -1
- package/lib/module/components/MessageList/TypingIndicator.js +6 -6
- package/lib/module/components/MessageList/TypingIndicator.js.map +1 -1
- package/lib/module/components/MessageList/TypingIndicatorContainer.js +3 -3
- package/lib/module/components/MessageList/TypingIndicatorContainer.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js +24 -11
- package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useTypingString.js +2 -2
- package/lib/module/components/MessageList/hooks/useTypingString.js.map +1 -1
- package/lib/module/components/MessageList/utils/filterTypingUsers.js.map +1 -1
- package/lib/module/components/MessageList/utils/getDateSeparators.js +2 -1
- package/lib/module/components/MessageList/utils/getDateSeparators.js.map +1 -1
- package/lib/module/components/MessageList/utils/getGroupStyles.js +11 -10
- package/lib/module/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/module/components/MessageList/utils/getLastReceivedMessage.js +3 -1
- package/lib/module/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/module/components/MessageList/utils/getReadStates.js.map +1 -1
- package/lib/{commonjs/components/MessageOverlay/MessageActions.js → module/components/MessageOverlay/MessageActionList.js} +33 -85
- package/lib/module/components/MessageOverlay/MessageActionList.js.map +1 -0
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +131 -0
- package/lib/module/components/MessageOverlay/MessageActionListItem.js.map +1 -0
- package/lib/module/components/MessageOverlay/MessageOverlay.js +100 -85
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js +38 -0
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js.map +1 -0
- package/lib/module/components/MessageOverlay/OverlayReactionList.js +18 -19
- package/lib/module/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +32 -35
- package/lib/module/components/MessageOverlay/OverlayReactions.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +41 -0
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js.map +1 -0
- package/lib/module/components/MessageOverlay/hooks/useMessageActionAnimation.js +37 -0
- package/lib/module/components/MessageOverlay/hooks/useMessageActionAnimation.js.map +1 -0
- package/lib/module/components/Reply/Reply.js +26 -20
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/Spinner/Spinner.js +1 -1
- package/lib/module/components/Thread/Thread.js +15 -6
- package/lib/module/components/Thread/Thread.js.map +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +14 -13
- package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/module/components/docs/ListProps.md +1 -1
- package/lib/module/components/docs/data.js +45 -45
- package/lib/module/components/docs/data.js.map +1 -1
- package/lib/module/components/index.js +133 -55
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +3 -3
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js.map +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +3 -3
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +3 -3
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +3 -3
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +5 -5
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js.map +1 -1
- package/lib/module/contexts/channelsStateContext/useChannelState.js +3 -3
- package/lib/module/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +3 -3
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +3 -3
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/module/contexts/keyboardContext/KeyboardContext.js +3 -3
- package/lib/module/contexts/keyboardContext/KeyboardContext.js.map +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +3 -3
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +106 -71
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +9 -5
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js +10 -3
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +6 -20
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js.map +1 -1
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js +36 -0
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.js.map +1 -0
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +105 -0
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js.map +1 -0
- package/lib/module/contexts/messagesContext/MessagesContext.js +3 -3
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +2 -2
- package/lib/module/contexts/overlayContext/OverlayContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +50 -50
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +61 -0
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js.map +1 -0
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +3 -3
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +21 -34
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/module/contexts/themeContext/ThemeContext.js +3 -3
- package/lib/module/contexts/themeContext/ThemeContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +48 -20
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/contexts/threadContext/ThreadContext.js +3 -3
- package/lib/module/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +4 -4
- package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/module/contexts/typingContext/TypingContext.js +3 -3
- package/lib/module/contexts/typingContext/TypingContext.js.map +1 -1
- package/lib/module/contexts/utils/getDisplayName.js.map +1 -1
- package/lib/module/emoji-data/compiled.js +0 -315
- package/lib/module/emoji-data/compiled.js.map +1 -1
- package/lib/module/emoji-data/emojiNames.js +0 -105
- package/lib/module/emoji-data/emojiNames.js.map +1 -1
- package/lib/module/emoji-data/emojis.js +0 -175
- package/lib/module/emoji-data/emojis.js.map +1 -1
- package/lib/module/emoji-data/index.js +2 -2
- package/lib/module/emoji-data/index.js.map +1 -1
- package/lib/module/hooks/useAppStateListener.js +8 -5
- package/lib/module/hooks/useAppStateListener.js.map +1 -1
- package/lib/module/hooks/useIsMountedRef.js +19 -0
- package/lib/module/hooks/useIsMountedRef.js.map +1 -0
- package/lib/module/hooks/useStreami18n.js +5 -2
- package/lib/module/hooks/useStreami18n.js.map +1 -1
- package/lib/module/i18n/en.json +9 -3
- package/lib/module/i18n/fr.json +9 -3
- package/lib/module/i18n/hi.json +9 -3
- package/lib/module/i18n/it.json +9 -3
- package/lib/module/i18n/ja.json +67 -0
- package/lib/module/i18n/ko.json +67 -0
- package/lib/module/i18n/nl.json +9 -3
- package/lib/module/i18n/ru.json +9 -3
- package/lib/module/i18n/tr.json +10 -4
- package/lib/module/icons/ArrowRight.js +1 -1
- package/lib/module/icons/AtMentions.js +1 -1
- package/lib/module/icons/Attach.js +1 -1
- package/lib/module/icons/Audio.js +1 -1
- package/lib/module/icons/CSV.js +1 -1
- package/lib/module/icons/Camera.js +1 -1
- package/lib/module/icons/Check.js +1 -1
- package/lib/module/icons/CheckAll.js +1 -1
- package/lib/module/icons/CheckSend.js +1 -1
- package/lib/module/icons/CircleClose.js +1 -1
- package/lib/module/icons/CirclePlus.js +1 -1
- package/lib/module/icons/CircleRight.js +1 -1
- package/lib/module/icons/Close.js +1 -1
- package/lib/module/icons/Copy.js +1 -1
- package/lib/module/icons/CurveLineLeftUp.js +1 -1
- package/lib/module/icons/DOC.js +1 -1
- package/lib/module/icons/DOCX.js +1 -1
- package/lib/module/icons/Delete.js +1 -1
- package/lib/module/icons/Down.js +1 -1
- package/lib/module/icons/DownloadArrow.js +1 -1
- package/lib/module/icons/DownloadCloud.js +1 -1
- package/lib/module/icons/Edit.js +1 -1
- package/lib/module/icons/Error.js +1 -1
- package/lib/module/icons/Eye.js +1 -1
- package/lib/module/icons/Flag.js +1 -1
- package/lib/module/icons/Folder.js +1 -1
- package/lib/module/icons/GenericFile.js +1 -1
- package/lib/module/icons/GiphyIcon.js +1 -1
- package/lib/module/icons/Grid.js +1 -1
- package/lib/module/icons/Group.js +1 -1
- package/lib/module/icons/HTML.js +1 -1
- package/lib/module/icons/Imgur.js +1 -1
- package/lib/module/icons/LOLReaction.js +1 -1
- package/lib/module/icons/Lightning.js +1 -1
- package/lib/module/icons/Link.js +1 -1
- package/lib/module/icons/Loading.js +1 -1
- package/lib/module/icons/Logo.js +1 -1
- package/lib/module/icons/LoveReaction.js +1 -1
- package/lib/module/icons/MD.js +1 -1
- package/lib/module/icons/MailOpen.js +1 -1
- package/lib/module/icons/MenuPointHorizontal.js +1 -1
- package/lib/module/icons/MenuPointVertical.js +1 -1
- package/lib/module/icons/MessageFlag.js +1 -1
- package/lib/module/icons/MessageIcon.js +1 -1
- package/lib/module/icons/Mute.js +1 -1
- package/lib/module/icons/Notification.js +1 -1
- package/lib/module/icons/ODT.js +1 -1
- package/lib/module/icons/PDF.js +1 -1
- package/lib/module/icons/PPT.js +1 -1
- package/lib/module/icons/PPTX.js +1 -1
- package/lib/module/icons/Picture.js +1 -1
- package/lib/module/icons/Pin.js +42 -0
- package/lib/module/icons/Pin.js.map +1 -0
- package/lib/module/icons/PinHeader.js +38 -0
- package/lib/module/icons/PinHeader.js.map +1 -0
- package/lib/module/icons/RAR.js +1 -1
- package/lib/module/icons/RTF.js +1 -1
- package/lib/module/icons/Refresh.js +1 -1
- package/lib/module/icons/SEVEN_Z.js +1 -1
- package/lib/module/icons/Search.js +1 -1
- package/lib/module/icons/SendRight.js +1 -1
- package/lib/module/icons/SendUp.js +1 -1
- package/lib/module/icons/Share.js +1 -1
- package/lib/module/icons/ShareRightArrow.js +1 -1
- package/lib/module/icons/Smile.js +1 -1
- package/lib/module/icons/Sound.js +1 -1
- package/lib/module/icons/TAR.js +1 -1
- package/lib/module/icons/TXT.js +1 -1
- package/lib/module/icons/ThreadReply.js +1 -1
- package/lib/module/icons/ThumbsDownReaction.js +1 -1
- package/lib/module/icons/ThumbsUpReaction.js +1 -1
- package/lib/module/icons/Time.js +1 -1
- package/lib/module/icons/Unknown.js +1 -1
- package/lib/module/icons/Unpin.js +38 -0
- package/lib/module/icons/Unpin.js.map +1 -0
- package/lib/module/icons/User.js +1 -1
- package/lib/module/icons/UserAdd.js +1 -1
- package/lib/module/icons/UserAdmin.js +62 -0
- package/lib/module/icons/UserAdmin.js.map +1 -0
- package/lib/module/icons/UserDelete.js +1 -1
- package/lib/module/icons/UserMinus.js +1 -1
- package/lib/module/icons/WutReaction.js +1 -1
- package/lib/module/icons/XLS.js +1 -1
- package/lib/module/icons/XLSX.js +1 -1
- package/lib/module/icons/ZIP.js +1 -1
- package/lib/module/icons/index.js +39 -26
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/icons/utils/base.js +2 -2
- package/lib/module/index.js +6 -6
- package/lib/module/init.js +13 -0
- package/lib/module/init.js.map +1 -0
- package/lib/module/mock-builders/api/error.js +1 -1
- package/lib/module/mock-builders/api/queryChannels.js +1 -1
- package/lib/module/mock-builders/api/queryChannels.js.map +1 -1
- package/lib/module/mock-builders/api/sendMessage.js +4 -1
- package/lib/module/mock-builders/api/sendMessage.js.map +1 -1
- package/lib/module/mock-builders/generator/attachment.js +1 -3
- package/lib/module/mock-builders/generator/attachment.js.map +1 -1
- package/lib/module/mock-builders/generator/channel.js +101 -50
- package/lib/module/mock-builders/generator/channel.js.map +1 -1
- package/lib/module/mock-builders/generator/user.js +32 -33
- package/lib/module/mock-builders/generator/user.js.map +1 -1
- package/lib/module/mock-builders/mock.js +3 -3
- package/lib/module/mock-builders/mock.js.map +1 -1
- package/lib/module/mock-builders/native/react-native-mock.js +1 -1
- package/lib/module/mock-builders/native/react-native-mock.js.map +1 -1
- package/lib/module/native.js +1 -7
- package/lib/module/native.js.map +1 -1
- package/lib/module/utils/Streami18n.js +10 -0
- package/lib/module/utils/Streami18n.js.map +1 -1
- package/lib/module/utils/date.js +13 -0
- package/lib/module/utils/date.js.map +1 -0
- package/lib/module/utils/getResizedImageUrl.js +37 -0
- package/lib/module/utils/getResizedImageUrl.js.map +1 -0
- package/lib/module/utils/getUrlOfImageAttachment.js +9 -0
- package/lib/module/utils/getUrlOfImageAttachment.js.map +1 -0
- package/lib/module/utils/utils.js +39 -19
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Attachment.d.ts +6 -6
- package/lib/typescript/components/Attachment/AttachmentActions.d.ts +5 -5
- package/lib/typescript/components/Attachment/Card.d.ts +7 -5
- package/lib/typescript/components/Attachment/FileAttachment.d.ts +6 -6
- package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts +4 -4
- package/lib/typescript/components/Attachment/Gallery.d.ts +19 -6
- package/lib/typescript/components/Attachment/Giphy.d.ts +7 -7
- package/lib/typescript/components/Attachment/utils/buildGallery/buildGallery.d.ts +23 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.d.ts +7 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.d.ts +7 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.d.ts +7 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildThumbnail.d.ts +10 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/buildThumbnailGrid.d.ts +137 -0
- package/lib/typescript/components/Attachment/utils/buildGallery/types.d.ts +23 -0
- package/lib/typescript/components/Attachment/utils/getAspectRatio.d.ts +9 -0
- package/lib/typescript/components/Attachment/utils/getGalleryImageBorderRadius.d.ts +22 -0
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteInput.d.ts +10 -4
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.d.ts +5 -0
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionHeader.d.ts +8 -0
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionItem.d.ts +10 -0
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteSuggestionList.d.ts +21 -0
- package/lib/typescript/components/Avatar/Avatar.d.ts +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +13 -16
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +2 -2
- package/lib/typescript/components/Channel/hooks/useCreateInputMessageInputContext.d.ts +3 -70
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +3 -126
- package/lib/typescript/components/Channel/hooks/useCreateOwnCapabilitiesContext.d.ts +7 -0
- package/lib/typescript/components/Channel/hooks/useCreatePaginatedMessageListContext.d.ts +3 -3
- package/lib/typescript/components/Channel/hooks/useCreateThreadContext.d.ts +2 -2
- package/lib/typescript/components/Channel/hooks/useCreateTypingContext.d.ts +2 -2
- package/lib/typescript/components/ChannelList/ChannelList.d.ts +15 -15
- package/lib/typescript/components/ChannelList/ChannelListMessenger.d.ts +4 -4
- package/lib/typescript/components/ChannelList/hooks/listeners/useAddedToChannelNotification.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelDeleted.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelHidden.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelTruncated.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelUpdated.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useChannelVisible.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useConnectionRecovered.d.ts +2 -2
- package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessage.d.ts +4 -4
- package/lib/typescript/components/ChannelList/hooks/listeners/useNewMessageNotification.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.d.ts +5 -5
- package/lib/typescript/components/ChannelList/hooks/listeners/useUserPresence.d.ts +4 -4
- package/lib/typescript/components/ChannelList/hooks/useCreateChannelsContext.d.ts +2 -2
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +11 -9
- package/lib/typescript/components/ChannelList/utils.d.ts +7 -7
- package/lib/typescript/components/ChannelPreview/ChannelAvatar.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +7 -7
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessage.d.ts +4 -5
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMessenger.d.ts +6 -6
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMutedStatus.d.ts +9 -0
- package/lib/typescript/components/ChannelPreview/ChannelPreviewStatus.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/ChannelPreviewTitle.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/ChannelPreviewUnreadCount.d.ts +3 -3
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.d.ts +15 -3
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayName.d.ts +4 -4
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.d.ts +2 -2
- package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts +5 -5
- package/lib/typescript/components/Chat/Chat.d.ts +3 -3
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +2 -2
- package/lib/typescript/components/Chat/hooks/useIsOnline.d.ts +2 -2
- package/lib/typescript/components/Chat/hooks/useMutedUsers.d.ts +2 -2
- package/lib/typescript/components/ImageGallery/ImageGallery.d.ts +13 -10
- package/lib/typescript/components/ImageGallery/components/AnimatedGalleryImage.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +10 -10
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts +10 -10
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +10 -10
- package/lib/typescript/components/ImageGallery/components/__tests__/ImageGalleryHeader.test.d.ts +1 -0
- package/lib/typescript/components/Indicators/LoadingErrorIndicator.d.ts +1 -1
- package/lib/typescript/components/KeyboardCompatibleView/KeyboardCompatibleView.d.ts +2 -1
- package/lib/typescript/components/Message/Message.d.ts +14 -13
- package/lib/typescript/components/Message/MessageSimple/MessageAvatar.d.ts +5 -5
- package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts +4 -4
- package/lib/typescript/components/Message/MessageSimple/MessageDeleted.d.ts +6 -6
- package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts +8 -8
- package/lib/typescript/components/Message/MessageSimple/MessagePinnedHeader.d.ts +8 -0
- package/lib/typescript/components/Message/MessageSimple/MessageReplies.d.ts +4 -4
- package/lib/typescript/components/Message/MessageSimple/MessageRepliesAvatars.d.ts +3 -3
- package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts +4 -4
- package/lib/typescript/components/Message/MessageSimple/MessageStatus.d.ts +4 -4
- package/lib/typescript/components/Message/MessageSimple/MessageTextContainer.d.ts +7 -6
- package/lib/typescript/components/Message/MessageSimple/ReactionList.d.ts +5 -4
- package/lib/typescript/components/Message/MessageSimple/utils/parseLinks.d.ts +7 -0
- package/lib/typescript/components/Message/MessageSimple/utils/parseLinks.test.d.ts +1 -0
- package/lib/typescript/components/Message/MessageSimple/utils/renderText.d.ts +21 -6
- package/lib/typescript/components/Message/MessageSimple/utils/renderText.test.d.ts +1 -0
- package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts +2 -2
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +15 -0
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +26 -0
- package/lib/typescript/components/Message/utils/messageActions.d.ts +22 -21
- package/lib/typescript/components/Message/utils/removeReservedFields.d.ts +2 -2
- package/lib/typescript/components/MessageInput/AttachButton.d.ts +5 -5
- package/lib/typescript/components/MessageInput/CommandsButton.d.ts +5 -5
- package/lib/typescript/components/MessageInput/CooldownTimer.d.ts +10 -0
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +4 -4
- package/lib/typescript/components/MessageInput/ImageUploadPreview.d.ts +4 -4
- package/lib/typescript/components/MessageInput/InputButtons.d.ts +5 -5
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +4 -4
- package/lib/typescript/components/MessageInput/MoreOptionsButton.d.ts +5 -5
- package/lib/typescript/components/MessageInput/SendButton.d.ts +4 -4
- package/lib/typescript/components/MessageInput/SendMessageDisallowedIndicator.d.ts +1 -0
- package/lib/typescript/components/MessageInput/ShowThreadMessageInChannelButton.d.ts +2 -2
- package/lib/typescript/components/MessageInput/hooks/useCooldown.d.ts +9 -0
- package/lib/typescript/components/MessageInput/hooks/useCountdown.d.ts +8 -0
- package/lib/typescript/components/MessageList/InlineLoadingMoreIndicator.d.ts +2 -2
- package/lib/typescript/components/MessageList/InlineLoadingMoreRecentIndicator.d.ts +2 -2
- package/lib/typescript/components/MessageList/InlineLoadingMoreThreadIndicator.d.ts +2 -2
- package/lib/typescript/components/MessageList/MessageList.d.ts +8 -7
- package/lib/typescript/components/MessageList/MessageSystem.d.ts +5 -5
- package/lib/typescript/components/MessageList/TypingIndicator.d.ts +2 -2
- package/lib/typescript/components/MessageList/TypingIndicatorContainer.d.ts +4 -4
- package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts +6 -5
- package/lib/typescript/components/MessageList/hooks/useTypingString.d.ts +2 -2
- package/lib/typescript/components/MessageList/utils/filterTypingUsers.d.ts +3 -3
- package/lib/typescript/components/MessageList/utils/getDateSeparators.d.ts +4 -4
- package/lib/typescript/components/MessageList/utils/getGroupStyles.d.ts +5 -5
- package/lib/typescript/components/MessageList/utils/getLastReceivedMessage.d.ts +2 -2
- package/lib/typescript/components/MessageList/utils/getReadStates.d.ts +8 -5
- package/lib/typescript/components/MessageOverlay/MessageActionList.d.ts +12 -0
- package/lib/typescript/components/MessageOverlay/MessageActionListItem.d.ts +21 -0
- package/lib/typescript/components/MessageOverlay/MessageOverlay.d.ts +6 -6
- package/lib/typescript/components/MessageOverlay/OverlayBackdrop.d.ts +6 -0
- package/lib/typescript/components/MessageOverlay/OverlayReactionList.d.ts +6 -7
- package/lib/typescript/components/MessageOverlay/OverlayReactions.d.ts +3 -1
- package/lib/typescript/components/MessageOverlay/OverlayReactionsAvatar.d.ts +7 -0
- package/lib/typescript/components/MessageOverlay/hooks/useMessageActionAnimation.d.ts +12 -0
- package/lib/typescript/components/Reply/Reply.d.ts +5 -5
- package/lib/typescript/components/Thread/Thread.d.ts +8 -8
- package/lib/typescript/components/Thread/components/ThreadFooterComponent.d.ts +2 -2
- package/lib/typescript/components/index.d.ts +13 -7
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +2 -2
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +39 -40
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +30 -22
- package/lib/typescript/contexts/channelsStateContext/ChannelsStateContext.d.ts +19 -19
- package/lib/typescript/contexts/channelsStateContext/useChannelState.d.ts +17 -17
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +11 -11
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts +8 -8
- package/lib/typescript/contexts/keyboardContext/KeyboardContext.d.ts +2 -2
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +12 -16
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +53 -42
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +3 -3
- package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +3 -3
- package/lib/typescript/contexts/messageOverlayContext/MessageOverlayContext.d.ts +31 -32
- package/lib/typescript/contexts/messageOverlayContext/hooks/useResettableState.d.ts +12 -0
- package/lib/typescript/contexts/messageOverlayContext/hooks/useResettableState.test.d.ts +1 -0
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +77 -166
- package/lib/typescript/contexts/overlayContext/OverlayContext.d.ts +15 -8
- package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts +2 -2
- package/lib/typescript/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.d.ts +25 -0
- package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +8 -8
- package/lib/typescript/contexts/suggestionsContext/SuggestionsContext.d.ts +29 -28
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +46 -17
- package/lib/typescript/contexts/threadContext/ThreadContext.d.ts +10 -10
- package/lib/typescript/contexts/translationContext/TranslationContext.d.ts +2 -2
- package/lib/typescript/contexts/typingContext/TypingContext.d.ts +8 -8
- package/lib/typescript/contexts/utils/getDisplayName.d.ts +2 -2
- package/lib/typescript/hooks/useIsMountedRef.d.ts +20 -0
- package/lib/typescript/i18n/en.json +9 -3
- package/lib/typescript/i18n/fr.json +9 -3
- package/lib/typescript/i18n/hi.json +9 -3
- package/lib/typescript/i18n/it.json +9 -3
- package/lib/typescript/i18n/ja.json +67 -0
- package/lib/typescript/i18n/ko.json +67 -0
- package/lib/typescript/i18n/nl.json +9 -3
- package/lib/typescript/i18n/ru.json +9 -3
- package/lib/typescript/i18n/tr.json +10 -4
- package/lib/typescript/icons/{Left.d.ts → Pin.d.ts} +1 -1
- package/lib/typescript/icons/PinHeader.d.ts +3 -0
- package/lib/typescript/icons/{Right.d.ts → Unpin.d.ts} +1 -1
- package/lib/typescript/icons/UserAdmin.d.ts +3 -0
- package/lib/typescript/icons/index.d.ts +3 -2
- package/lib/typescript/init.d.ts +2 -0
- package/lib/typescript/native.d.ts +1 -9
- package/lib/typescript/types/types.d.ts +16 -13
- package/lib/typescript/utils/Streami18n.d.ts +17 -9
- package/lib/typescript/utils/date.d.ts +2 -0
- package/lib/typescript/utils/getResizedImageUrl.d.ts +20 -0
- package/lib/typescript/utils/getUrlOfImageAttachment.d.ts +7 -0
- package/lib/typescript/utils/utils.d.ts +36 -30
- package/package.json +15 -20
- package/src/components/Attachment/Attachment.tsx +20 -61
- package/src/components/Attachment/AttachmentActions.tsx +17 -57
- package/src/components/Attachment/Card.tsx +22 -52
- package/src/components/Attachment/FileAttachment.tsx +16 -51
- package/src/components/Attachment/FileAttachmentGroup.tsx +16 -57
- package/src/components/Attachment/FileIcon.tsx +2 -2
- package/src/components/Attachment/Gallery.tsx +209 -241
- package/src/components/Attachment/Giphy.tsx +84 -128
- package/src/components/Attachment/__tests__/Attachment.test.js +27 -19
- package/src/components/Attachment/__tests__/Gallery.test.js +233 -0
- package/src/components/Attachment/__tests__/buildGallery.test.js +131 -0
- package/src/components/Attachment/utils/buildGallery/buildGallery.ts +77 -0
- package/src/components/Attachment/utils/buildGallery/buildGalleryOfSingleImage.ts +91 -0
- package/src/components/Attachment/utils/buildGallery/buildGalleryOfThreeImages.ts +99 -0
- package/src/components/Attachment/utils/buildGallery/buildGalleryOfTwoImages.ts +66 -0
- package/src/components/Attachment/utils/buildGallery/buildThumbnail.ts +48 -0
- package/src/components/Attachment/utils/buildGallery/buildThumbnailGrid.ts +188 -0
- package/src/components/Attachment/utils/buildGallery/types.ts +27 -0
- package/src/components/Attachment/utils/getAspectRatio.ts +21 -0
- package/src/components/Attachment/utils/getGalleryImageBorderRadius.ts +71 -0
- package/src/components/AttachmentPicker/AttachmentPicker.tsx +4 -2
- package/src/components/AttachmentPicker/components/AttachmentSelectionBar.tsx +15 -3
- package/src/components/AutoCompleteInput/AutoCompleteInput.tsx +66 -96
- package/src/components/AutoCompleteInput/{CommandsItem.tsx → AutoCompleteSuggestionCommandIcon.tsx} +7 -59
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx +102 -0
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionItem.tsx +149 -0
- package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx +209 -0
- package/src/components/AutoCompleteInput/__tests__/AutoCompleteInput.test.js +10 -16
- package/src/components/Avatar/Avatar.tsx +8 -11
- package/src/components/Avatar/GroupAvatar.tsx +7 -21
- package/src/components/Avatar/__tests__/Avatar.test.js +2 -33
- package/src/components/Channel/Channel.tsx +495 -477
- package/src/components/Channel/__tests__/Channel.test.js +63 -100
- package/src/components/Channel/__tests__/ownCapabilities.test.js +376 -0
- package/src/components/Channel/hooks/useCreateChannelContext.ts +11 -25
- package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts +54 -69
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +17 -49
- package/src/components/Channel/hooks/useCreateOwnCapabilitiesContext.ts +39 -0
- package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +16 -32
- package/src/components/Channel/hooks/useCreateThreadContext.ts +4 -19
- package/src/components/Channel/hooks/useCreateTypingContext.ts +4 -19
- package/src/components/ChannelList/ChannelList.tsx +36 -58
- package/src/components/ChannelList/ChannelListFooterLoadingIndicator.tsx +2 -3
- package/src/components/ChannelList/ChannelListHeaderErrorIndicator.tsx +3 -7
- package/src/components/ChannelList/ChannelListHeaderNetworkDownIndicator.tsx +5 -2
- package/src/components/ChannelList/ChannelListLoadingIndicator.tsx +5 -1
- package/src/components/ChannelList/ChannelListMessenger.tsx +22 -74
- package/src/components/ChannelList/Skeleton.tsx +2 -1
- package/src/components/ChannelList/__tests__/ChannelList.test.js +75 -16
- package/src/components/ChannelList/__tests__/ChannelListMessenger.test.js +46 -14
- package/src/components/ChannelList/hooks/listeners/useAddedToChannelNotification.ts +17 -39
- package/src/components/ChannelList/hooks/listeners/useChannelDeleted.ts +15 -37
- package/src/components/ChannelList/hooks/listeners/useChannelHidden.ts +15 -37
- package/src/components/ChannelList/hooks/listeners/useChannelTruncated.ts +17 -39
- package/src/components/ChannelList/hooks/listeners/useChannelUpdated.ts +15 -37
- package/src/components/ChannelList/hooks/listeners/useChannelVisible.ts +17 -39
- package/src/components/ChannelList/hooks/listeners/useConnectionRecovered.ts +8 -20
- package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +13 -36
- package/src/components/ChannelList/hooks/listeners/useNewMessageNotification.ts +17 -39
- package/src/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.ts +15 -37
- package/src/components/ChannelList/hooks/listeners/useUserPresence.ts +11 -33
- package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +5 -21
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +95 -70
- package/src/components/ChannelList/utils.ts +9 -42
- package/src/components/ChannelPreview/ChannelAvatar.tsx +6 -29
- package/src/components/ChannelPreview/ChannelPreview.tsx +21 -54
- package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +14 -24
- package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +39 -56
- package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx +50 -0
- package/src/components/ChannelPreview/ChannelPreviewStatus.tsx +10 -30
- package/src/components/ChannelPreview/ChannelPreviewTitle.tsx +7 -28
- package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx +7 -27
- package/src/components/ChannelPreview/__tests__/ChannelPreview.test.js +16 -22
- package/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +23 -14
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayAvatar.ts +15 -30
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayName.ts +8 -30
- package/src/components/ChannelPreview/hooks/useChannelPreviewDisplayPresence.ts +9 -30
- package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +31 -81
- package/src/components/Chat/Chat.tsx +19 -44
- package/src/components/Chat/__tests__/Chat.test.js +12 -47
- package/src/components/Chat/hooks/useCreateChatContext.ts +4 -19
- package/src/components/Chat/hooks/useIsOnline.ts +45 -56
- package/src/components/Chat/hooks/useMutedUsers.ts +5 -20
- package/src/components/ImageGallery/ImageGallery.tsx +110 -86
- package/src/components/ImageGallery/components/AnimatedGalleryImage.tsx +1 -2
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +20 -15
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +45 -25
- package/src/components/ImageGallery/components/ImageGrid.tsx +47 -33
- package/src/components/ImageGallery/components/ImageGridHandle.tsx +1 -0
- package/src/components/ImageGallery/components/__tests__/ImageGalleryHeader.test.tsx +31 -0
- package/src/components/Indicators/LoadingErrorIndicator.tsx +1 -1
- package/src/components/Indicators/LoadingIndicator.tsx +1 -2
- package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx +9 -2
- package/src/components/Message/Message.tsx +196 -688
- package/src/components/Message/MessageSimple/MessageAvatar.tsx +14 -56
- package/src/components/Message/MessageSimple/MessageContent.tsx +42 -87
- package/src/components/Message/MessageSimple/MessageDeleted.tsx +24 -63
- package/src/components/Message/MessageSimple/MessageFooter.tsx +60 -84
- package/src/components/Message/MessageSimple/MessagePinnedHeader.tsx +109 -0
- package/src/components/Message/MessageSimple/MessageReplies.tsx +19 -60
- package/src/components/Message/MessageSimple/MessageRepliesAvatars.tsx +7 -29
- package/src/components/Message/MessageSimple/MessageSimple.tsx +64 -78
- package/src/components/Message/MessageSimple/MessageStatus.tsx +35 -88
- package/src/components/Message/MessageSimple/MessageTextContainer.tsx +24 -66
- package/src/components/Message/MessageSimple/ReactionList.tsx +110 -163
- package/src/components/Message/MessageSimple/__tests__/Message.test.js +24 -258
- package/src/components/Message/MessageSimple/__tests__/MessageAvatar.test.js +9 -8
- package/src/components/Message/MessageSimple/__tests__/MessageContent.test.js +63 -46
- package/src/components/Message/MessageSimple/__tests__/MessagePinnedHeader.test.js +53 -0
- package/src/components/Message/MessageSimple/__tests__/MessageReplies.test.js +13 -9
- package/src/components/Message/MessageSimple/__tests__/MessageStatus.test.js +11 -47
- package/src/components/Message/MessageSimple/__tests__/MessageTextContainer.test.js +2 -2
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageAvatar.test.js.snap +35 -22
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessagePinnedHeader.test.js.snap +80 -0
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageReplies.test.js.snap +72 -46
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageStatus.test.js.snap +77 -48
- package/src/components/Message/MessageSimple/__tests__/__snapshots__/MessageTextContainer.test.js.snap +6 -18
- package/src/components/Message/MessageSimple/utils/parseLinks.test.ts +100 -0
- package/src/components/Message/MessageSimple/utils/parseLinks.ts +95 -0
- package/src/components/Message/MessageSimple/utils/renderText.test.tsx +70 -0
- package/src/components/Message/MessageSimple/utils/renderText.tsx +138 -63
- package/src/components/Message/hooks/useCreateMessageContext.ts +5 -26
- package/src/components/Message/hooks/useMessageActionHandlers.ts +157 -0
- package/src/components/Message/hooks/useMessageActions.tsx +371 -0
- package/src/components/Message/utils/messageActions.ts +53 -54
- package/src/components/Message/utils/removeReservedFields.ts +3 -18
- package/src/components/MessageInput/AttachButton.tsx +15 -57
- package/src/components/MessageInput/CommandsButton.tsx +16 -58
- package/src/components/MessageInput/CooldownTimer.tsx +67 -0
- package/src/components/MessageInput/FileUploadPreview.tsx +86 -118
- package/src/components/MessageInput/ImageUploadPreview.tsx +15 -58
- package/src/components/MessageInput/InputButtons.tsx +17 -64
- package/src/components/MessageInput/MessageInput.tsx +83 -97
- package/src/components/MessageInput/MoreOptionsButton.tsx +14 -56
- package/src/components/MessageInput/SendButton.tsx +14 -55
- package/src/components/MessageInput/SendMessageDisallowedIndicator.tsx +47 -0
- package/src/components/MessageInput/ShowThreadMessageInChannelButton.tsx +6 -21
- package/src/components/MessageInput/__tests__/AttachButton.test.js +2 -2
- package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +193 -97
- package/src/components/MessageInput/__tests__/ImageUploadPreview.test.js +35 -35
- package/src/components/MessageInput/__tests__/MessageInput.test.js +29 -17
- package/src/components/MessageInput/__tests__/SendButton.test.js +2 -2
- package/src/components/MessageInput/__tests__/UploadProgressIndicator.test.js +2 -2
- package/src/components/MessageInput/__tests__/__snapshots__/AttachButton.test.js.snap +134 -52
- package/src/components/MessageInput/__tests__/__snapshots__/FileUploadPreview.test.js.snap +3955 -1647
- package/src/components/MessageInput/__tests__/__snapshots__/ImageUploadPreview.test.js.snap +1964 -1464
- package/src/components/MessageInput/__tests__/__snapshots__/MessageInput.test.js.snap +633 -326
- package/src/components/MessageInput/__tests__/__snapshots__/SendButton.test.js.snap +224 -124
- package/src/components/MessageInput/__tests__/__snapshots__/UploadProgressIndicator.test.js.snap +85 -17
- package/src/components/MessageInput/hooks/useCooldown.ts +48 -0
- package/src/components/MessageInput/hooks/useCountdown.ts +48 -0
- package/src/components/MessageList/DateHeader.tsx +2 -2
- package/src/components/MessageList/InlineDateSeparator.tsx +5 -2
- package/src/components/MessageList/InlineLoadingMoreIndicator.tsx +3 -18
- package/src/components/MessageList/InlineLoadingMoreRecentIndicator.tsx +3 -18
- package/src/components/MessageList/InlineLoadingMoreThreadIndicator.tsx +3 -18
- package/src/components/MessageList/MessageList.tsx +181 -159
- package/src/components/MessageList/MessageSystem.tsx +7 -28
- package/src/components/MessageList/ScrollToBottomButton.tsx +6 -1
- package/src/components/MessageList/TypingIndicator.tsx +4 -20
- package/src/components/MessageList/TypingIndicatorContainer.tsx +14 -47
- package/src/components/MessageList/__tests__/MessageList.test.js +231 -152
- package/src/components/MessageList/__tests__/MessageSystem.test.js +3 -3
- package/src/components/MessageList/__tests__/ScrollToBottomButton.test.js +13 -8
- package/src/components/MessageList/__tests__/TypingIndicator.test.js +14 -97
- package/src/components/MessageList/__tests__/__snapshots__/MessageSystem.test.js.snap +9 -4
- package/src/components/MessageList/__tests__/__snapshots__/ScrollToBottomButton.test.js.snap +78 -32
- package/src/components/MessageList/__tests__/__snapshots__/TypingIndicator.test.js.snap +60 -57
- package/src/components/MessageList/hooks/useMessageList.ts +39 -62
- package/src/components/MessageList/hooks/useTypingString.ts +6 -22
- package/src/components/MessageList/utils/filterTypingUsers.ts +7 -28
- package/src/components/MessageList/utils/getDateSeparators.ts +10 -30
- package/src/components/MessageList/utils/getGroupStyles.ts +23 -44
- package/src/components/MessageList/utils/getLastReceivedMessage.ts +9 -19
- package/src/components/MessageList/utils/getReadStates.ts +5 -20
- package/src/components/MessageOverlay/MessageActionList.tsx +170 -0
- package/src/components/MessageOverlay/MessageActionListItem.tsx +124 -0
- package/src/components/MessageOverlay/MessageOverlay.tsx +264 -268
- package/src/components/MessageOverlay/OverlayBackdrop.tsx +18 -0
- package/src/components/MessageOverlay/OverlayReactionList.tsx +24 -82
- package/src/components/MessageOverlay/OverlayReactions.tsx +12 -8
- package/src/components/MessageOverlay/OverlayReactionsAvatar.tsx +27 -0
- package/src/components/MessageOverlay/hooks/useMessageActionAnimation.tsx +44 -0
- package/src/components/Reply/Reply.tsx +44 -81
- package/src/components/Thread/Thread.tsx +31 -57
- package/src/components/Thread/__tests__/Thread.test.js +58 -77
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +874 -1011
- package/src/components/Thread/components/ThreadFooterComponent.tsx +13 -49
- package/src/components/docs/ListProps.md +1 -1
- package/src/components/docs/data.js +38 -37
- package/src/components/index.ts +13 -7
- package/src/contexts/activeChannelsRefContext/ActiveChannelsRefContext.tsx +1 -2
- package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +10 -9
- package/src/contexts/channelContext/ChannelContext.tsx +43 -79
- package/src/contexts/channelsContext/ChannelsContext.tsx +37 -63
- package/src/contexts/channelsStateContext/ChannelsStateContext.tsx +39 -117
- package/src/contexts/channelsStateContext/useChannelState.ts +29 -61
- package/src/contexts/chatContext/ChatContext.tsx +15 -51
- package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +13 -56
- package/src/contexts/keyboardContext/KeyboardContext.tsx +13 -8
- package/src/contexts/messageContext/MessageContext.tsx +16 -57
- package/src/contexts/messageInputContext/MessageInputContext.tsx +146 -157
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +13 -26
- package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +15 -34
- package/src/contexts/messageOverlayContext/MessageOverlayContext.tsx +41 -97
- package/src/contexts/messageOverlayContext/hooks/useResettableState.test.tsx +46 -0
- package/src/contexts/messageOverlayContext/hooks/useResettableState.ts +22 -0
- package/src/contexts/messagesContext/MessagesContext.tsx +96 -234
- package/src/contexts/overlayContext/OverlayContext.tsx +35 -35
- package/src/contexts/overlayContext/OverlayProvider.tsx +52 -62
- package/src/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.tsx +38 -0
- package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +14 -55
- package/src/contexts/suggestionsContext/SuggestionsContext.tsx +59 -80
- package/src/contexts/suggestionsContext/__tests__/Suggestions.test.js +4 -2
- package/src/contexts/themeContext/ThemeContext.tsx +1 -0
- package/src/contexts/themeContext/utils/theme.ts +92 -36
- package/src/contexts/threadContext/ThreadContext.tsx +14 -48
- package/src/contexts/translationContext/TranslationContext.tsx +15 -10
- package/src/contexts/typingContext/TypingContext.tsx +12 -46
- package/src/contexts/utils/getDisplayName.ts +3 -1
- package/src/emoji-data/compiled.ts +1830 -9609
- package/src/emoji-data/emojiNames.ts +0 -140
- package/src/emoji-data/emojis.ts +0 -210
- package/src/emoji-data/index.js +1 -1
- package/src/hooks/useAppStateListener.ts +26 -12
- package/src/hooks/useIsMountedRef.ts +36 -0
- package/src/hooks/useStreami18n.ts +5 -3
- package/src/i18n/en.json +9 -3
- package/src/i18n/fr.json +9 -3
- package/src/i18n/hi.json +9 -3
- package/src/i18n/it.json +9 -3
- package/src/i18n/ja.json +67 -0
- package/src/i18n/ko.json +67 -0
- package/src/i18n/nl.json +9 -3
- package/src/i18n/ru.json +9 -3
- package/src/i18n/tr.json +10 -4
- package/src/icons/Pin.tsx +17 -0
- package/src/icons/PinHeader.tsx +12 -0
- package/src/icons/Unpin.tsx +12 -0
- package/src/icons/UserAdmin.tsx +23 -0
- package/src/icons/index.ts +3 -2
- package/src/init.ts +5 -0
- package/src/mock-builders/api/queryChannels.js +1 -1
- package/src/mock-builders/api/sendMessage.js +3 -1
- package/src/mock-builders/generator/attachment.js +0 -2
- package/src/mock-builders/generator/channel.js +101 -46
- package/src/mock-builders/generator/user.js +33 -26
- package/src/mock-builders/mock.js +2 -2
- package/src/mock-builders/native/react-native-mock.js +1 -1
- package/src/native.ts +2 -13
- package/src/types/types.ts +16 -18
- package/src/utils/Streami18n.ts +12 -6
- package/src/utils/__tests__/Streami18n.test.js +9 -45
- package/src/utils/__tests__/getResizedImageUrl.test.js +57 -0
- package/src/utils/__tests__/utils.test.js +19 -0
- package/src/utils/date.ts +4 -0
- package/src/utils/getResizedImageUrl.ts +59 -0
- package/src/utils/getUrlOfImageAttachment.ts +10 -0
- package/src/utils/utils.ts +97 -142
- package/src/version.json +1 -1
- package/lib/commonjs/components/AutoCompleteInput/CommandsHeader.js +0 -78
- package/lib/commonjs/components/AutoCompleteInput/CommandsHeader.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/CommandsItem.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/EmojisHeader.js +0 -81
- package/lib/commonjs/components/AutoCompleteInput/EmojisHeader.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/EmojisItem.js +0 -75
- package/lib/commonjs/components/AutoCompleteInput/EmojisItem.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/MentionsItem.js +0 -125
- package/lib/commonjs/components/AutoCompleteInput/MentionsItem.js.map +0 -1
- package/lib/commonjs/components/AutoCompleteInput/SuggestionsList.js +0 -199
- package/lib/commonjs/components/AutoCompleteInput/SuggestionsList.js.map +0 -1
- package/lib/commonjs/components/Channel/utils/debounce.js +0 -20
- package/lib/commonjs/components/Channel/utils/debounce.js.map +0 -1
- package/lib/commonjs/components/Channel/utils/throttle.js +0 -20
- package/lib/commonjs/components/Channel/utils/throttle.js.map +0 -1
- package/lib/commonjs/components/MessageOverlay/MessageActions.js.map +0 -1
- package/lib/commonjs/icons/Left.js +0 -38
- package/lib/commonjs/icons/Left.js.map +0 -1
- package/lib/commonjs/icons/Right.js +0 -38
- package/lib/commonjs/icons/Right.js.map +0 -1
- package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js +0 -100
- package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js.map +0 -1
- package/lib/commonjs/styleguideComponents/BottomSheet.js +0 -25
- package/lib/commonjs/styleguideComponents/BottomSheet.js.map +0 -1
- package/lib/commonjs/styleguideComponents/JsDoc.js +0 -87
- package/lib/commonjs/styleguideComponents/JsDoc.js.map +0 -1
- package/lib/commonjs/styleguideComponents/Markdown.js +0 -12
- package/lib/commonjs/styleguideComponents/Markdown.js.map +0 -1
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js +0 -92
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js.map +0 -1
- package/lib/commonjs/styleguideComponents/PropsRenderer.js +0 -267
- package/lib/commonjs/styleguideComponents/PropsRenderer.js.map +0 -1
- package/lib/commonjs/styleguideComponents/Reanimated.js +0 -2
- package/lib/commonjs/styleguideComponents/Wrapper.js +0 -29
- package/lib/commonjs/styleguideComponents/Wrapper.js.map +0 -1
- package/lib/commonjs/styleguideComponents/register-react-native-web.js +0 -44
- package/lib/commonjs/styleguideComponents/register-react-native-web.js.map +0 -1
- package/lib/commonjs/styleguideComponents/resolveAssetSource.js +0 -11
- package/lib/commonjs/styleguideComponents/resolveAssetSource.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/CommandsHeader.js +0 -78
- package/lib/module/components/AutoCompleteInput/CommandsHeader.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/CommandsItem.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/EmojisHeader.js +0 -81
- package/lib/module/components/AutoCompleteInput/EmojisHeader.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/EmojisItem.js +0 -75
- package/lib/module/components/AutoCompleteInput/EmojisItem.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/MentionsItem.js +0 -125
- package/lib/module/components/AutoCompleteInput/MentionsItem.js.map +0 -1
- package/lib/module/components/AutoCompleteInput/SuggestionsList.js +0 -199
- package/lib/module/components/AutoCompleteInput/SuggestionsList.js.map +0 -1
- package/lib/module/components/Channel/utils/debounce.js +0 -20
- package/lib/module/components/Channel/utils/debounce.js.map +0 -1
- package/lib/module/components/Channel/utils/throttle.js +0 -20
- package/lib/module/components/Channel/utils/throttle.js.map +0 -1
- package/lib/module/components/MessageOverlay/MessageActions.js.map +0 -1
- package/lib/module/icons/Left.js +0 -38
- package/lib/module/icons/Left.js.map +0 -1
- package/lib/module/icons/Right.js +0 -38
- package/lib/module/icons/Right.js.map +0 -1
- package/lib/module/styleguideComponents/ArgumentsRenderer.js +0 -100
- package/lib/module/styleguideComponents/ArgumentsRenderer.js.map +0 -1
- package/lib/module/styleguideComponents/BottomSheet.js +0 -25
- package/lib/module/styleguideComponents/BottomSheet.js.map +0 -1
- package/lib/module/styleguideComponents/JsDoc.js +0 -87
- package/lib/module/styleguideComponents/JsDoc.js.map +0 -1
- package/lib/module/styleguideComponents/Markdown.js +0 -12
- package/lib/module/styleguideComponents/Markdown.js.map +0 -1
- package/lib/module/styleguideComponents/PathlineRenderer.js +0 -92
- package/lib/module/styleguideComponents/PathlineRenderer.js.map +0 -1
- package/lib/module/styleguideComponents/PropsRenderer.js +0 -267
- package/lib/module/styleguideComponents/PropsRenderer.js.map +0 -1
- package/lib/module/styleguideComponents/Reanimated.js +0 -2
- package/lib/module/styleguideComponents/Wrapper.js +0 -29
- package/lib/module/styleguideComponents/Wrapper.js.map +0 -1
- package/lib/module/styleguideComponents/register-react-native-web.js +0 -44
- package/lib/module/styleguideComponents/register-react-native-web.js.map +0 -1
- package/lib/module/styleguideComponents/resolveAssetSource.js +0 -11
- package/lib/module/styleguideComponents/resolveAssetSource.js.map +0 -1
- package/lib/typescript/components/AutoCompleteInput/CommandsHeader.d.ts +0 -2
- package/lib/typescript/components/AutoCompleteInput/CommandsItem.d.ts +0 -15
- package/lib/typescript/components/AutoCompleteInput/EmojisHeader.d.ts +0 -5
- package/lib/typescript/components/AutoCompleteInput/EmojisItem.d.ts +0 -12
- package/lib/typescript/components/AutoCompleteInput/MentionsItem.d.ts +0 -16
- package/lib/typescript/components/AutoCompleteInput/SuggestionsList.d.ts +0 -13
- package/lib/typescript/components/Channel/utils/debounce.d.ts +0 -2
- package/lib/typescript/components/Channel/utils/throttle.d.ts +0 -2
- package/lib/typescript/components/MessageOverlay/MessageActions.d.ts +0 -11
- package/src/components/AutoCompleteInput/CommandsHeader.tsx +0 -43
- package/src/components/AutoCompleteInput/EmojisHeader.tsx +0 -45
- package/src/components/AutoCompleteInput/EmojisItem.tsx +0 -52
- package/src/components/AutoCompleteInput/MentionsItem.tsx +0 -74
- package/src/components/AutoCompleteInput/SuggestionsList.tsx +0 -138
- package/src/components/AutoCompleteInput/__tests__/CommandsItem.test.js +0 -29
- package/src/components/AutoCompleteInput/__tests__/MentionsItem.test.js +0 -62
- package/src/components/Channel/utils/debounce.ts +0 -12
- package/src/components/Channel/utils/throttle.ts +0 -12
- package/src/components/MessageList/__tests__/__snapshots__/MessageList.test.js.snap +0 -983
- package/src/components/MessageOverlay/MessageActions.tsx +0 -243
- package/src/icons/Left.tsx +0 -12
- package/src/icons/Right.tsx +0 -12
- package/src/styleguideComponents/ArgumentsRenderer.tsx +0 -59
- package/src/styleguideComponents/BottomSheet.tsx +0 -3
- package/src/styleguideComponents/JsDoc.tsx +0 -43
- package/src/styleguideComponents/Markdown.tsx +0 -1
- package/src/styleguideComponents/PathlineRenderer.tsx +0 -44
- package/src/styleguideComponents/PropsRenderer.tsx +0 -138
- package/src/styleguideComponents/Reanimated.tsx +0 -0
- package/src/styleguideComponents/Wrapper.tsx +0 -6
- package/src/styleguideComponents/register-react-native-web.js +0 -13
- package/src/styleguideComponents/resolveAssetSource.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChannelsContext.tsx"],"names":["ChannelsContext","React","createContext","ChannelsProvider","children","value","useChannelsContext","withChannelsContext","Component","WithChannelsContextComponent","props","channelsContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;;;;;;;;AAuNO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAAxB;;;;AAEA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAS9BC,QAT8B,QAS9BA,QAT8B;AAAA,MAU9BC,KAV8B,QAU9BA,KAV8B;AAAA,SAc9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAd8B;AAAA,CAAzB;;;;AAmBA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB;AAAA,SAQ3B,uBAAWN,eAAX,CAR2B;AAAA,CAA3B;;;;AAeA,IAAMO,mBAAmB,GAAG,SAAtBA,mBAAsB,CAUjCC,SAViC,EAW6C;AAC9E,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGL,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CArBM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport { getDisplayName } from '../utils/getDisplayName';\n\nimport type { FlatListProps } from 'react-native';\nimport type { FlatList } from 'react-native-gesture-handler';\nimport type { Channel } from 'stream-chat';\n\nimport type { HeaderErrorProps } from '../../components/ChannelList/ChannelListHeaderErrorIndicator';\nimport type { ChannelAvatarProps } from '../../components/ChannelPreview/ChannelAvatar';\nimport type { ChannelPreviewMessageProps } from '../../components/ChannelPreview/ChannelPreviewMessage';\nimport type { ChannelPreviewMessengerProps } from '../../components/ChannelPreview/ChannelPreviewMessenger';\nimport type { ChannelPreviewStatusProps } from '../../components/ChannelPreview/ChannelPreviewStatus';\nimport type { ChannelPreviewTitleProps } from '../../components/ChannelPreview/ChannelPreviewTitle';\nimport type { ChannelPreviewUnreadCountProps } from '../../components/ChannelPreview/ChannelPreviewUnreadCount';\nimport type { EmptyStateProps } from '../../components/Indicators/EmptyStateIndicator';\nimport type { LoadingErrorProps } from '../../components/Indicators/LoadingErrorIndicator';\nimport type { LoadingProps } from '../../components/Indicators/LoadingIndicator';\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../types/types';\n\nexport type ChannelsContextValue<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = {\n /**\n * Besides the existing default behavior of the ChannelListMessenger component, you can attach\n * additional props to the underlying React Native FlatList.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **EXAMPLE:**\n *\n * ```\n * <ChannelListMessenger\n * channels={channels}\n * additionalFlatListProps={{ bounces: true }}\n * />\n * ```\n *\n * **Note:** Don't use `additionalFlatListProps` to access the FlatList ref, use `setFlatListRef`\n */\n additionalFlatListProps: Partial<FlatListProps<Channel<At, Ch, Co, Ev, Me, Re, Us>>>;\n /**\n * Channels can be either an array of channels or a promise which resolves to an array of channels\n */\n channels: Channel<At, Ch, Co, Ev, Me, Re, Us>[];\n /**\n * Custom indicator to use when channel list is empty\n *\n * Default: [EmptyStateIndicator](https://getstream.github.io/stream-chat-react-native/v3/#emptystateindicator)\n * */\n EmptyStateIndicator: React.ComponentType<EmptyStateProps>;\n /**\n * Error in channels query, if any\n */\n error: boolean;\n /**\n * Custom loading indicator to display at bottom of the list, while loading further pages\n *\n * Default: [ChannelListFooterLoadingIndicator](https://getstream.github.io/stream-chat-react-native/v3/#ChannelListFooterLoadingIndicator)\n */\n FooterLoadingIndicator: React.ComponentType;\n /**\n * Incremental number change to force update the FlatList\n */\n forceUpdate: number;\n /**\n * Whether or not the FlatList has another page to render\n */\n hasNextPage: boolean;\n /**\n * Custom indicator to display error at top of list, if loading/pagination error occurs\n *\n * Default: [ChannelListHeaderErrorIndicator](https://getstream.github.io/stream-chat-react-native/v3/#ChannelListHeaderErrorIndicator)\n */\n HeaderErrorIndicator: React.ComponentType<HeaderErrorProps>;\n /**\n * Custom indicator to display network-down error at top of list, if there is connectivity issue\n *\n * Default: [ChannelListHeaderNetworkDownIndicator](https://getstream.github.io/stream-chat-react-native/v3/#ChannelListHeaderNetworkDownIndicator)\n */\n HeaderNetworkDownIndicator: React.ComponentType;\n /**\n * Initial channels query loading state, triggers the LoadingIndicator\n */\n loadingChannels: boolean;\n /**\n * Custom indicator to use when there is error in fetching channels\n *\n * Default: [LoadingErrorIndicator](https://getstream.github.io/stream-chat-react-native/v3/#loadingerrorindicator)\n * */\n LoadingErrorIndicator: React.ComponentType<LoadingErrorProps>;\n /**\n * Custom loading indicator to use on Channel List\n *\n * */\n LoadingIndicator: React.ComponentType<Pick<LoadingProps, 'listType'>>;\n /**\n * Whether or not additional channels are being loaded, triggers the FooterLoadingIndicator\n */\n loadingNextPage: boolean;\n /**\n * The React Native FlatList threshold to fetch more data\n * @see See loadMoreThreshold [doc](https://facebook.github.io/react-native/docs/flatlist#onendreachedthreshold)\n * */\n loadMoreThreshold: number;\n /**\n * Loads the next page of `channels`, which is present as a required prop\n */\n loadNextPage: ((queryType?: string, retryCount?: number) => Promise<void>) | undefined;\n /**\n * Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations\n */\n maxUnreadCount: number;\n /**\n * Number of skeletons that should show when loading. Default: 6\n */\n numberOfSkeletons: number;\n /**\n * Custom UI component to display individual channel list items\n *\n * Default: [ChannelPreviewMessenger](https://getstream.github.io/stream-chat-react-native/v3/#channelpreviewmessenger)\n */\n Preview: React.ComponentType<ChannelPreviewMessengerProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Triggered when the channel list is refreshing, displays a loading spinner at the top of the list\n */\n refreshing: boolean;\n /**\n * Function to refresh the channel list that is similar to `reloadList`, but it doesn't wipe out existing channels\n * from UI before loading the new ones\n */\n refreshList: () => void | Promise<void>;\n /**\n * Removes all the existing channels from UI and loads fresh channels\n * */\n reloadList: () => Promise<void>;\n // /**\n // * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n // *\n // * @param channel A channel object\n // */\n // setActiveChannel?: (channel: Channel<At, Ch, Co, Ev, Me, Re, Us>) => void;\n /**\n * Function to gain access to the inner FlatList ref\n *\n * **Example:**\n *\n * ```\n * <ChannelListMessenger\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef: (ref: FlatList<Channel<At, Ch, Co, Ev, Me, Re, Us>> | null) => void;\n /**\n * Custom UI component to display loading channel skeletons\n *\n * Default: [Skeleton](https://getstream.github.io/stream-chat-react-native/v3/#skeleton)\n */\n Skeleton: React.ComponentType;\n ListHeaderComponent?: React.ComponentType;\n /**\n * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n *\n * @param channel A channel object\n */\n onSelect?: (channel: Channel<At, Ch, Co, Ev, Me, Re, Us>) => void;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelAvatar.tsx)\n */\n PreviewAvatar?: React.ComponentType<ChannelAvatarProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom UI component to render preview of latest message on channel.\n *\n * **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewMessage.tsx)\n */\n PreviewMessage?: React.ComponentType<ChannelPreviewMessageProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewStatus.tsx)\n */\n PreviewStatus?: React.ComponentType<ChannelPreviewStatusProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewTitle.tsx)\n */\n PreviewTitle?: React.ComponentType<ChannelPreviewTitleProps<At, Ch, Co, Ev, Me, Re, Us>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)\n */\n PreviewUnreadCount?: React.ComponentType<\n ChannelPreviewUnreadCountProps<At, Ch, Co, Ev, Me, Re, Us>\n >;\n};\n\nexport const ChannelsContext = React.createContext({} as ChannelsContextValue);\n\nexport const ChannelsProvider = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChannelsContextValue<At, Ch, Co, Ev, Me, Re, Us>;\n}>) => (\n <ChannelsContext.Provider value={value as unknown as ChannelsContextValue}>\n {children}\n </ChannelsContext.Provider>\n);\n\nexport const useChannelsContext = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>() => useContext(ChannelsContext) as unknown as ChannelsContextValue<At, Ch, Co, Ev, Me, Re, Us>;\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChannelContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChannelsContext = <\n P extends UnknownType,\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsContextValue<At, Ch, Co, Ev, Me, Re, Us>>> => {\n const WithChannelsContextComponent = (\n props: Omit<P, keyof ChannelsContextValue<At, Ch, Co, Ev, Me, Re, Us>>,\n ) => {\n const channelsContext = useChannelsContext<At, Ch, Co, Ev, Me, Re, Us>();\n\n return <Component {...(props as P)} {...channelsContext} />;\n };\n WithChannelsContextComponent.displayName = `WithChannelsContext${getDisplayName(Component)}`;\n return WithChannelsContextComponent;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["ChannelsContext.tsx"],"names":["ChannelsContext","React","createContext","ChannelsProvider","children","value","useChannelsContext","withChannelsContext","Component","WithChannelsContextComponent","props","channelsContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAqBA;;;;;;;;;AA4LO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAAxB;;;;AAEA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAG9BC,QAH8B,QAG9BA,QAH8B;AAAA,MAI9BC,KAJ8B,QAI9BA,KAJ8B;AAAA,SAQ9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR8B;AAAA,CAAzB;;;;AAaA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB;AAAA,SAE3B,uBAAWN,eAAX,CAF2B;AAAA,CAA3B;;;;AASA,IAAMO,mBAAmB,GAAG,SAAtBA,mBAAsB,CAIjCC,SAJiC,EAKqC;AACtE,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGL,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { FlatListProps } from 'react-native';\nimport type { FlatList } from 'react-native-gesture-handler';\n\nimport type { ChannelPreviewMutedStatusProps } from 'src/components/ChannelPreview/ChannelPreviewMutedStatus';\n\nimport type { Channel } from 'stream-chat';\n\nimport type { HeaderErrorProps } from '../../components/ChannelList/ChannelListHeaderErrorIndicator';\nimport type { QueryChannels } from '../../components/ChannelList/hooks/usePaginatedChannels';\nimport type { ChannelAvatarProps } from '../../components/ChannelPreview/ChannelAvatar';\nimport type { ChannelPreviewMessageProps } from '../../components/ChannelPreview/ChannelPreviewMessage';\nimport type { ChannelPreviewMessengerProps } from '../../components/ChannelPreview/ChannelPreviewMessenger';\nimport type { ChannelPreviewStatusProps } from '../../components/ChannelPreview/ChannelPreviewStatus';\nimport type { ChannelPreviewTitleProps } from '../../components/ChannelPreview/ChannelPreviewTitle';\nimport type { ChannelPreviewUnreadCountProps } from '../../components/ChannelPreview/ChannelPreviewUnreadCount';\nimport type { EmptyStateProps } from '../../components/Indicators/EmptyStateIndicator';\nimport type { LoadingErrorProps } from '../../components/Indicators/LoadingErrorIndicator';\nimport type { LoadingProps } from '../../components/Indicators/LoadingIndicator';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type ChannelsContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Besides the existing default behavior of the ChannelListMessenger component, you can attach\n * additional props to the underlying React Native FlatList.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **EXAMPLE:**\n *\n * ```\n * <ChannelListMessenger\n * channels={channels}\n * additionalFlatListProps={{ bounces: true }}\n * />\n * ```\n *\n * **Note:** Don't use `additionalFlatListProps` to access the FlatList ref, use `setFlatListRef`\n */\n additionalFlatListProps: Partial<FlatListProps<Channel<StreamChatGenerics>>>;\n /**\n * Channels can be either an array of channels or a promise which resolves to an array of channels\n */\n channels: Channel<StreamChatGenerics>[];\n /**\n * Custom indicator to use when channel list is empty\n *\n * Default: [EmptyStateIndicator](https://getstream.github.io/stream-chat-react-native/v3/#emptystateindicator)\n * */\n EmptyStateIndicator: React.ComponentType<EmptyStateProps>;\n /**\n * Custom loading indicator to display at bottom of the list, while loading further pages\n *\n * Default: [ChannelListFooterLoadingIndicator](https://getstream.github.io/stream-chat-react-native/v3/#ChannelListFooterLoadingIndicator)\n */\n FooterLoadingIndicator: React.ComponentType;\n /**\n * Incremental number change to force update the FlatList\n */\n forceUpdate: number;\n /**\n * Whether or not the FlatList has another page to render\n */\n hasNextPage: boolean;\n /**\n * Custom indicator to display error at top of list, if loading/pagination error occurs\n *\n * Default: [ChannelListHeaderErrorIndicator](https://getstream.github.io/stream-chat-react-native/v3/#ChannelListHeaderErrorIndicator)\n */\n HeaderErrorIndicator: React.ComponentType<HeaderErrorProps>;\n /**\n * Custom indicator to display network-down error at top of list, if there is connectivity issue\n *\n * Default: [ChannelListHeaderNetworkDownIndicator](https://getstream.github.io/stream-chat-react-native/v3/#ChannelListHeaderNetworkDownIndicator)\n */\n HeaderNetworkDownIndicator: React.ComponentType;\n /**\n * Initial channels query loading state, triggers the LoadingIndicator\n */\n loadingChannels: boolean;\n /**\n * Custom indicator to use when there is error in fetching channels\n *\n * Default: [LoadingErrorIndicator](https://getstream.github.io/stream-chat-react-native/v3/#loadingerrorindicator)\n * */\n LoadingErrorIndicator: React.ComponentType<LoadingErrorProps>;\n /**\n * Custom loading indicator to use on Channel List\n *\n * */\n LoadingIndicator: React.ComponentType<Pick<LoadingProps, 'listType'>>;\n /**\n * Whether or not additional channels are being loaded, triggers the FooterLoadingIndicator\n */\n loadingNextPage: boolean;\n /**\n * The React Native FlatList threshold to fetch more data\n * @see See loadMoreThreshold [doc](https://facebook.github.io/react-native/docs/flatlist#onendreachedthreshold)\n * */\n loadMoreThreshold: number;\n /**\n * Loads the next page of `channels`, which is present as a required prop\n */\n loadNextPage: QueryChannels | undefined;\n /**\n * Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations\n */\n maxUnreadCount: number;\n /**\n * Number of skeletons that should show when loading. Default: 6\n */\n numberOfSkeletons: number;\n /**\n * Custom UI component to display individual channel list items\n *\n * Default: [ChannelPreviewMessenger](https://getstream.github.io/stream-chat-react-native/v3/#channelpreviewmessenger)\n */\n Preview: React.ComponentType<ChannelPreviewMessengerProps<StreamChatGenerics>>;\n /**\n * Triggered when the channel list is refreshing, displays a loading spinner at the top of the list\n */\n refreshing: boolean;\n /**\n * Function to refresh the channel list that is similar to `reloadList`, but it doesn't wipe out existing channels\n * from UI before loading the new ones\n */\n refreshList: () => void | Promise<void>;\n /**\n * Removes all the existing channels from UI and loads fresh channels\n * */\n reloadList: () => Promise<void>;\n // /**\n // * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n // *\n // * @param channel A channel object\n // */\n // setActiveChannel?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Function to gain access to the inner FlatList ref\n *\n * **Example:**\n *\n * ```\n * <ChannelListMessenger\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef: (ref: FlatList<Channel<StreamChatGenerics>> | null) => void;\n /**\n * Custom UI component to display loading channel skeletons\n *\n * Default: [Skeleton](https://getstream.github.io/stream-chat-react-native/v3/#skeleton)\n */\n Skeleton: React.ComponentType;\n /**\n * Error in channels query, if any\n */\n error?: Error;\n ListHeaderComponent?: React.ComponentType;\n /**\n * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n *\n * @param channel A channel object\n */\n onSelect?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelAvatar.tsx)\n */\n PreviewAvatar?: React.ComponentType<ChannelAvatarProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview of latest message on channel.\n *\n * **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewMessage.tsx)\n */\n PreviewMessage?: React.ComponentType<ChannelPreviewMessageProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render muted status.\n *\n * **Default** [ChannelMutedStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx)\n */\n PreviewMutedStatus?: React.ComponentType<ChannelPreviewMutedStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewStatus.tsx)\n */\n PreviewStatus?: React.ComponentType<ChannelPreviewStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewTitle.tsx)\n */\n PreviewTitle?: React.ComponentType<ChannelPreviewTitleProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)\n */\n PreviewUnreadCount?: React.ComponentType<ChannelPreviewUnreadCountProps<StreamChatGenerics>>;\n};\n\nexport const ChannelsContext = React.createContext({} as ChannelsContextValue);\n\nexport const ChannelsProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChannelsContextValue<StreamChatGenerics>;\n}>) => (\n <ChannelsContext.Provider value={value as unknown as ChannelsContextValue}>\n {children}\n </ChannelsContext.Provider>\n);\n\nexport const useChannelsContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => useContext(ChannelsContext) as unknown as ChannelsContextValue<StreamChatGenerics>;\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChannelContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChannelsContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>> => {\n const WithChannelsContextComponent = (\n props: Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>,\n ) => {\n const channelsContext = useChannelsContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...channelsContext} />;\n };\n WithChannelsContextComponent.displayName = `WithChannelsContext${getDisplayName(Component)}`;\n return WithChannelsContextComponent;\n};\n"]}
|
|
@@ -20,7 +20,7 @@ var _ActiveChannelsRefContext = require("../activeChannelsRefContext/ActiveChann
|
|
|
20
20
|
var _getDisplayName = require("../utils/getDisplayName");
|
|
21
21
|
|
|
22
22
|
var _this = this,
|
|
23
|
-
_jsxFileName = "/
|
|
23
|
+
_jsxFileName = "/Users/vishalnarkhede/projects/stream-chat-react-native/package/src/contexts/channelsStateContext/ChannelsStateContext.tsx";
|
|
24
24
|
|
|
25
25
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
26
|
|
|
@@ -47,7 +47,7 @@ function reducer(state, action) {
|
|
|
47
47
|
|
|
48
48
|
var _currentCount = (_state$action$payload3 = (_state$action$payload4 = state[action.payload.cid]) == null ? void 0 : _state$action$payload4.subscriberCount) != null ? _state$action$payload3 : 0;
|
|
49
49
|
|
|
50
|
-
if (_currentCount
|
|
50
|
+
if (_currentCount <= 1) {
|
|
51
51
|
var stateShallowCopy = (0, _extends6["default"])({}, state);
|
|
52
52
|
delete stateShallowCopy[action.payload.cid];
|
|
53
53
|
return stateShallowCopy;
|
|
@@ -112,7 +112,7 @@ var ChannelsStateProvider = function ChannelsStateProvider(_ref) {
|
|
|
112
112
|
__self: _this,
|
|
113
113
|
__source: {
|
|
114
114
|
fileName: _jsxFileName,
|
|
115
|
-
lineNumber:
|
|
115
|
+
lineNumber: 182,
|
|
116
116
|
columnNumber: 5
|
|
117
117
|
}
|
|
118
118
|
}, _react["default"].createElement(_ActiveChannelsRefContext.ActiveChannelsProvider, {
|
|
@@ -120,7 +120,7 @@ var ChannelsStateProvider = function ChannelsStateProvider(_ref) {
|
|
|
120
120
|
__self: _this,
|
|
121
121
|
__source: {
|
|
122
122
|
fileName: _jsxFileName,
|
|
123
|
-
lineNumber:
|
|
123
|
+
lineNumber: 183,
|
|
124
124
|
columnNumber: 7
|
|
125
125
|
}
|
|
126
126
|
}, children));
|
|
@@ -141,7 +141,7 @@ var withChannelsStateContext = function withChannelsStateContext(Component) {
|
|
|
141
141
|
__self: _this,
|
|
142
142
|
__source: {
|
|
143
143
|
fileName: _jsxFileName,
|
|
144
|
-
lineNumber:
|
|
144
|
+
lineNumber: 203,
|
|
145
145
|
columnNumber: 12
|
|
146
146
|
}
|
|
147
147
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChannelsStateContext.tsx"],"names":["reducer","state","action","type","payload","cid","key","value","currentCount","subscriberCount","stateShallowCopy","Error","ChannelsStateContext","React","createContext","removeChannelState","setState","ChannelsStateProvider","children","dispatch","increaseSubscriberCount","decreaseSubscriberCount","activeChannelsRef","Object","keys","current","useChannelsStateContext","withChannelsStateContext","Component","WithChannelsStateContextComponent","props","channelsStateContext","displayName"],"mappings":"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","sourcesContent":["import React, {\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n} from 'react';\n\nimport { ActiveChannelsProvider } from '../activeChannelsRefContext/ActiveChannelsRefContext';\n\nimport type { ChannelContextValue } from '../channelContext/ChannelContext';\nimport type { PaginatedMessageListContextValue } from '../paginatedMessageListContext/PaginatedMessageListContext';\nimport type { ThreadContextValue } from '../threadContext/ThreadContext';\nimport type { TypingContextValue } from '../typingContext/TypingContext';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nimport type {\n DefaultAttachmentType,\n DefaultChannelType,\n DefaultCommandType,\n DefaultEventType,\n DefaultMessageType,\n DefaultReactionType,\n DefaultUserType,\n UnknownType,\n} from '../../types/types';\n\nexport type ChannelState<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = {\n members: ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['members'];\n messages: PaginatedMessageListContextValue<At, Ch, Co, Ev, Me, Re, Us>['messages'];\n read: ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['read'];\n subscriberCount: number;\n threadMessages: ThreadContextValue<At, Ch, Co, Ev, Me, Re, Us>['threadMessages'];\n typing: TypingContextValue<At, Ch, Co, Ev, Me, Re, Us>['typing'];\n watcherCount: ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['watcherCount'];\n watchers: ChannelContextValue<At, Ch, Co, Ev, Me, Re, Us>['watchers'];\n};\n\ntype ChannelsState<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = { [cid: string]: ChannelState<At, Ch, Co, Ev, Me, Re, Us> };\n\nexport type Keys = keyof ChannelState;\n\nexport type Payload<\n Key extends Keys = Keys,\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = {\n cid: string;\n key: Key;\n value: ChannelState<At, Ch, Co, Ev, Me, Re, Us>[Key];\n};\n\ntype SetStateAction<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = { payload: Payload<Keys, At, Ch, Co, Ev, Me, Re, Us>; type: 'SET_STATE' };\n\ntype IncreaseSubscriberCountAction = {\n payload: { cid: string };\n type: 'INCREASE_SUBSCRIBER_COUNT';\n};\ntype DecreaseSubscriberCountAction = {\n payload: { cid: string };\n type: 'DECREASE_SUBSCRIBER_COUNT';\n};\n\ntype Action<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> =\n | SetStateAction<At, Ch, Co, Ev, Me, Re, Us>\n | IncreaseSubscriberCountAction\n | DecreaseSubscriberCountAction;\n\nexport type ChannelsStateContextValue<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = {\n decreaseSubscriberCount: (value: { cid: string }) => void;\n increaseSubscriberCount: (value: { cid: string }) => void;\n setState: (value: Payload<Keys, At, Ch, Co, Ev, Me, Re, Us>) => void;\n state: ChannelsState<At, Ch, Co, Ev, Me, Re, Us>;\n};\n\ntype Reducer<\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n> = (\n state: ChannelsState<At, Ch, Co, Ev, Me, Re, Us>,\n action: Action<At, Ch, Co, Ev, Me, Re, Us>,\n) => ChannelsState<At, Ch, Co, Ev, Me, Re, Us>;\n\nfunction reducer(state: ChannelsState, action: Action) {\n switch (action.type) {\n case 'SET_STATE':\n return {\n ...state,\n [action.payload.cid]: {\n ...(state[action.payload.cid] || {}),\n [action.payload.key]: action.payload.value,\n },\n };\n\n case 'INCREASE_SUBSCRIBER_COUNT': {\n const currentCount = state[action.payload.cid]?.subscriberCount ?? 0;\n return {\n ...state,\n [action.payload.cid]: {\n ...(state[action.payload.cid] || {}),\n subscriberCount: currentCount + 1,\n },\n };\n }\n\n case 'DECREASE_SUBSCRIBER_COUNT': {\n const currentCount = state[action.payload.cid]?.subscriberCount ?? 0;\n\n // If there last subscribed Channel component unsubscribes, we clear the channel state.\n if (currentCount === 0) {\n const stateShallowCopy = {\n ...state,\n };\n\n delete stateShallowCopy[action.payload.cid];\n\n return stateShallowCopy;\n }\n\n return {\n ...state,\n [action.payload.cid]: {\n ...(state[action.payload.cid] || {}),\n subscriberCount: currentCount - 1,\n },\n };\n }\n default:\n throw new Error();\n }\n}\n\nconst ChannelsStateContext = React.createContext({\n removeChannelState: () => {\n // do nothing.\n },\n setState: () => {\n // do nothing.\n },\n state: {},\n} as unknown as ChannelsStateContextValue);\n\nexport const ChannelsStateProvider = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>({\n children,\n}: {\n children: ReactNode;\n}) => {\n const [state, dispatch] = useReducer(reducer as Reducer<At, Ch, Co, Ev, Me, Re, Us>, {});\n\n const setState = useCallback((payload: Payload<Keys, At, Ch, Co, Ev, Me, Re, Us>) => {\n dispatch({ payload, type: 'SET_STATE' });\n }, []);\n\n const increaseSubscriberCount = useCallback((payload: { cid: string }) => {\n dispatch({ payload, type: 'INCREASE_SUBSCRIBER_COUNT' });\n }, []);\n\n const decreaseSubscriberCount = useCallback((payload: { cid: string }) => {\n dispatch({ payload, type: 'DECREASE_SUBSCRIBER_COUNT' });\n }, []);\n\n const value = useMemo(\n () => ({\n decreaseSubscriberCount,\n increaseSubscriberCount,\n setState,\n state,\n }),\n [state],\n );\n\n const activeChannelsRef = useRef(Object.keys(state));\n\n useEffect(() => {\n activeChannelsRef.current = Object.keys(state);\n }, [state]);\n\n return (\n <ChannelsStateContext.Provider value={value as unknown as ChannelsStateContextValue}>\n <ActiveChannelsProvider value={activeChannelsRef}>{children}</ActiveChannelsProvider>\n </ChannelsStateContext.Provider>\n );\n};\n\nexport const useChannelsStateContext = <\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>() =>\n useContext(ChannelsStateContext) as unknown as ChannelsStateContextValue<\n At,\n Ch,\n Co,\n Ev,\n Me,\n Re,\n Us\n >;\n\nexport const withChannelsStateContext = <\n P extends UnknownType,\n At extends UnknownType = DefaultAttachmentType,\n Ch extends UnknownType = DefaultChannelType,\n Co extends string = DefaultCommandType,\n Ev extends UnknownType = DefaultEventType,\n Me extends UnknownType = DefaultMessageType,\n Re extends UnknownType = DefaultReactionType,\n Us extends UnknownType = DefaultUserType,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsStateContextValue<At, Ch, Co, Ev, Me, Re, Us>>> => {\n const WithChannelsStateContextComponent = (\n props: Omit<P, keyof ChannelsStateContextValue<At, Ch, Co, Ev, Me, Re, Us>>,\n ) => {\n const channelsStateContext = useChannelsStateContext<At, Ch, Co, Ev, Me, Re, Us>();\n\n return <Component {...(props as P)} {...channelsStateContext} />;\n };\n WithChannelsStateContextComponent.displayName = `WithChannelsStateContext${getDisplayName(\n Component,\n )}`;\n return WithChannelsStateContextComponent;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["ChannelsStateContext.tsx"],"names":["reducer","state","action","type","payload","cid","key","value","currentCount","subscriberCount","stateShallowCopy","Error","ChannelsStateContext","React","createContext","removeChannelState","setState","ChannelsStateProvider","children","dispatch","increaseSubscriberCount","decreaseSubscriberCount","activeChannelsRef","Object","keys","current","useChannelsStateContext","withChannelsStateContext","Component","WithChannelsStateContextComponent","props","channelsStateContext","displayName"],"mappings":"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","sourcesContent":["import React, {\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n} from 'react';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { ActiveChannelsProvider } from '../activeChannelsRefContext/ActiveChannelsRefContext';\n\nimport type { ChannelContextValue } from '../channelContext/ChannelContext';\nimport type { PaginatedMessageListContextValue } from '../paginatedMessageListContext/PaginatedMessageListContext';\nimport type { ThreadContextValue } from '../threadContext/ThreadContext';\nimport type { TypingContextValue } from '../typingContext/TypingContext';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type ChannelState<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n members: ChannelContextValue<StreamChatGenerics>['members'];\n messages: PaginatedMessageListContextValue<StreamChatGenerics>['messages'];\n read: ChannelContextValue<StreamChatGenerics>['read'];\n subscriberCount: number;\n threadMessages: ThreadContextValue<StreamChatGenerics>['threadMessages'];\n typing: TypingContextValue<StreamChatGenerics>['typing'];\n watcherCount: ChannelContextValue<StreamChatGenerics>['watcherCount'];\n watchers: ChannelContextValue<StreamChatGenerics>['watchers'];\n};\n\ntype ChannelsState<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n [cid: string]: ChannelState<StreamChatGenerics>;\n};\n\nexport type Keys = keyof ChannelState;\n\nexport type Payload<\n Key extends Keys = Keys,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n cid: string;\n key: Key;\n value: ChannelState<StreamChatGenerics>[Key];\n};\n\ntype SetStateAction<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n payload: Payload<Keys, StreamChatGenerics>;\n type: 'SET_STATE';\n};\n\ntype IncreaseSubscriberCountAction = {\n payload: { cid: string };\n type: 'INCREASE_SUBSCRIBER_COUNT';\n};\ntype DecreaseSubscriberCountAction = {\n payload: { cid: string };\n type: 'DECREASE_SUBSCRIBER_COUNT';\n};\n\ntype Action<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> =\n | SetStateAction<StreamChatGenerics>\n | IncreaseSubscriberCountAction\n | DecreaseSubscriberCountAction;\n\nexport type ChannelsStateContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n decreaseSubscriberCount: (value: { cid: string }) => void;\n increaseSubscriberCount: (value: { cid: string }) => void;\n setState: (value: Payload<Keys, StreamChatGenerics>) => void;\n state: ChannelsState<StreamChatGenerics>;\n};\n\ntype Reducer<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = (\n state: ChannelsState<StreamChatGenerics>,\n action: Action<StreamChatGenerics>,\n) => ChannelsState<StreamChatGenerics>;\n\nfunction reducer(state: ChannelsState, action: Action) {\n switch (action.type) {\n case 'SET_STATE':\n return {\n ...state,\n [action.payload.cid]: {\n ...(state[action.payload.cid] || {}),\n [action.payload.key]: action.payload.value,\n },\n };\n\n case 'INCREASE_SUBSCRIBER_COUNT': {\n const currentCount = state[action.payload.cid]?.subscriberCount ?? 0;\n return {\n ...state,\n [action.payload.cid]: {\n ...(state[action.payload.cid] || {}),\n subscriberCount: currentCount + 1,\n },\n };\n }\n\n case 'DECREASE_SUBSCRIBER_COUNT': {\n const currentCount = state[action.payload.cid]?.subscriberCount ?? 0;\n\n // If there last subscribed Channel component unsubscribes, we clear the channel state.\n if (currentCount <= 1) {\n const stateShallowCopy = {\n ...state,\n };\n\n delete stateShallowCopy[action.payload.cid];\n\n return stateShallowCopy;\n }\n\n return {\n ...state,\n [action.payload.cid]: {\n ...(state[action.payload.cid] || {}),\n subscriberCount: currentCount - 1,\n },\n };\n }\n default:\n throw new Error();\n }\n}\n\nconst ChannelsStateContext = React.createContext({\n removeChannelState: () => {\n // do nothing.\n },\n setState: () => {\n // do nothing.\n },\n state: {},\n} as unknown as ChannelsStateContextValue);\n\nexport const ChannelsStateProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n}: {\n children: ReactNode;\n}) => {\n const [state, dispatch] = useReducer(reducer as unknown as Reducer<StreamChatGenerics>, {});\n\n const setState = useCallback((payload: Payload<Keys, StreamChatGenerics>) => {\n dispatch({ payload, type: 'SET_STATE' });\n }, []);\n\n const increaseSubscriberCount = useCallback((payload: { cid: string }) => {\n dispatch({ payload, type: 'INCREASE_SUBSCRIBER_COUNT' });\n }, []);\n\n const decreaseSubscriberCount = useCallback((payload: { cid: string }) => {\n dispatch({ payload, type: 'DECREASE_SUBSCRIBER_COUNT' });\n }, []);\n\n const value = useMemo(\n () => ({\n decreaseSubscriberCount,\n increaseSubscriberCount,\n setState,\n state,\n }),\n [state],\n );\n\n const activeChannelsRef = useRef(Object.keys(state));\n\n useEffect(() => {\n activeChannelsRef.current = Object.keys(state);\n }, [state]);\n\n return (\n <ChannelsStateContext.Provider value={value as unknown as ChannelsStateContextValue}>\n <ActiveChannelsProvider value={activeChannelsRef}>{children}</ActiveChannelsProvider>\n </ChannelsStateContext.Provider>\n );\n};\n\nexport const useChannelsStateContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => useContext(ChannelsStateContext) as unknown as ChannelsStateContextValue<StreamChatGenerics>;\n\nexport const withChannelsStateContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsStateContextValue<StreamChatGenerics>>> => {\n const WithChannelsStateContextComponent = (\n props: Omit<P, keyof ChannelsStateContextValue<StreamChatGenerics>>,\n ) => {\n const channelsStateContext = useChannelsStateContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...channelsStateContext} />;\n };\n WithChannelsStateContextComponent.displayName = `WithChannelsStateContext${getDisplayName(\n Component,\n )}`;\n return WithChannelsStateContextComponent;\n};\n"]}
|
|
@@ -33,7 +33,7 @@ function useStateManager(_ref, initialValue) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function useChannelState(channel, threadId) {
|
|
36
|
-
var _channel$state, _channel$
|
|
36
|
+
var _channel$state, _channel$state2, _channel$state2$threa;
|
|
37
37
|
|
|
38
38
|
var cid = (channel == null ? void 0 : channel.id) || 'id';
|
|
39
39
|
|
|
@@ -69,7 +69,7 @@ function useChannelState(channel, threadId) {
|
|
|
69
69
|
key: 'messages',
|
|
70
70
|
setState: setState,
|
|
71
71
|
state: state
|
|
72
|
-
}, []),
|
|
72
|
+
}, (channel == null ? void 0 : (_channel$state = channel.state) == null ? void 0 : _channel$state.messages) || []),
|
|
73
73
|
_useStateManager4 = (0, _slicedToArray2["default"])(_useStateManager3, 2),
|
|
74
74
|
messages = _useStateManager4[0],
|
|
75
75
|
setMessages = _useStateManager4[1];
|
|
@@ -119,7 +119,7 @@ function useChannelState(channel, threadId) {
|
|
|
119
119
|
key: 'threadMessages',
|
|
120
120
|
setState: setState,
|
|
121
121
|
state: state
|
|
122
|
-
}, threadId && (channel == null ? void 0 : (_channel$
|
|
122
|
+
}, threadId && (channel == null ? void 0 : (_channel$state2 = channel.state) == null ? void 0 : (_channel$state2$threa = _channel$state2.threads) == null ? void 0 : _channel$state2$threa[threadId]) || []),
|
|
123
123
|
_useStateManager14 = (0, _slicedToArray2["default"])(_useStateManager13, 2),
|
|
124
124
|
threadMessages = _useStateManager14[0],
|
|
125
125
|
setThreadMessages = _useStateManager14[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useChannelState.ts"],"names":["useStateManager","initialValue","cid","key","setState","state","memoizedInitialValue","value","setValue","useChannelState","channel","threadId","id","decreaseSubscriberCount","increaseSubscriberCount","members","setMembers","messages","setMessages","read","setRead","typing","setTyping","watcherCount","setWatcherCount","watchers","setWatchers","threads","threadMessages","setThreadMessages"],"mappings":";;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["useChannelState.ts"],"names":["useStateManager","initialValue","cid","key","setState","state","memoizedInitialValue","value","setValue","useChannelState","channel","threadId","id","decreaseSubscriberCount","increaseSubscriberCount","members","setMembers","messages","setMessages","read","setRead","typing","setTyping","watcherCount","setWatcherCount","watchers","setWatchers","threads","threadMessages","setThreadMessages"],"mappings":"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","sourcesContent":["import { useCallback, useEffect, useMemo } from 'react';\n\nimport type { Channel as ChannelType } from 'stream-chat';\n\nimport { useChannelsStateContext } from './ChannelsStateContext';\n\nimport type { ChannelsStateContextValue, ChannelState, Keys } from './ChannelsStateContext';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\ntype StateManagerParams<\n Key extends Keys,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Omit<\n ChannelsStateContextValue<StreamChatGenerics>,\n 'increaseSubscriberCount' | 'decreaseSubscriberCount'\n> & {\n cid: string;\n key: Key;\n};\n\n/* \n This hook takes care of creating a useState-like interface which can be used later to call\n updates to the ChannelsStateContext reducer. It receives the cid and key which it wants to update\n and perform the state updates. Also supports a initialState.\n*/\nfunction useStateManager<\n Key extends Keys,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n {\n cid,\n key,\n setState,\n state,\n }: Omit<\n StateManagerParams<Key, StreamChatGenerics>,\n 'increaseSubscriberCount' | 'decreaseSubscriberCount'\n >,\n initialValue?: ChannelState<StreamChatGenerics>[Key],\n) {\n const memoizedInitialValue = useMemo(() => initialValue, []);\n const value =\n state[cid]?.[key] || (memoizedInitialValue as ChannelState<StreamChatGenerics>[Key]);\n\n const setValue = useCallback(\n (value: ChannelState<StreamChatGenerics>[Key]) => setState({ cid, key, value }),\n [cid, key],\n );\n\n return [value, setValue] as const;\n}\n\nexport type UseChannelStateValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n members: ChannelState<StreamChatGenerics>['members'];\n messages: ChannelState<StreamChatGenerics>['messages'];\n read: ChannelState<StreamChatGenerics>['read'];\n setMembers: (value: ChannelState<StreamChatGenerics>['members']) => void;\n setMessages: (value: ChannelState<StreamChatGenerics>['messages']) => void;\n setRead: (value: ChannelState<StreamChatGenerics>['read']) => void;\n setThreadMessages: (value: ChannelState<StreamChatGenerics>['threadMessages']) => void;\n setTyping: (value: ChannelState<StreamChatGenerics>['typing']) => void;\n setWatcherCount: (value: ChannelState<StreamChatGenerics>['watcherCount']) => void;\n setWatchers: (value: ChannelState<StreamChatGenerics>['watchers']) => void;\n threadMessages: ChannelState<StreamChatGenerics>['threadMessages'];\n typing: ChannelState<StreamChatGenerics>['typing'];\n watcherCount: ChannelState<StreamChatGenerics>['watcherCount'];\n watchers: ChannelState<StreamChatGenerics>['watchers'];\n};\n\nexport function useChannelState<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n channel: ChannelType<StreamChatGenerics> | undefined,\n threadId?: string,\n): UseChannelStateValue<StreamChatGenerics> {\n const cid = channel?.id || 'id'; // in case channel is not initialized, use generic id string for indexing\n const { decreaseSubscriberCount, increaseSubscriberCount, setState, state } =\n useChannelsStateContext<StreamChatGenerics>();\n\n // Keeps track of how many Channel components are subscribed to this Channel state (Channel vs Thread concurrency)\n useEffect(() => {\n increaseSubscriberCount({ cid });\n return () => {\n decreaseSubscriberCount({ cid });\n };\n }, []);\n\n const [members, setMembers] = useStateManager(\n {\n cid,\n key: 'members',\n setState,\n state,\n },\n {},\n );\n\n const [messages, setMessages] = useStateManager(\n {\n cid,\n key: 'messages',\n setState,\n state,\n },\n channel?.state?.messages || [],\n );\n\n const [read, setRead] = useStateManager(\n {\n cid,\n key: 'read',\n setState,\n state,\n },\n {},\n );\n\n const [typing, setTyping] = useStateManager(\n {\n cid,\n key: 'typing',\n setState,\n state,\n },\n {},\n );\n\n const [watcherCount, setWatcherCount] = useStateManager({\n cid,\n key: 'watcherCount',\n setState,\n state,\n });\n\n const [watchers, setWatchers] = useStateManager(\n {\n cid,\n key: 'watchers',\n setState,\n state,\n },\n {},\n );\n\n const [threadMessages, setThreadMessages] = useStateManager(\n {\n cid,\n key: 'threadMessages',\n setState,\n state,\n },\n (threadId && channel?.state?.threads?.[threadId]) || [],\n );\n\n return {\n members,\n messages,\n read,\n setMembers,\n setMessages,\n setRead,\n setThreadMessages,\n setTyping,\n setWatcherCount,\n setWatchers,\n threadMessages,\n typing,\n watcherCount,\n watchers,\n };\n}\n"]}
|
|
@@ -14,7 +14,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
14
14
|
var _getDisplayName = require("../utils/getDisplayName");
|
|
15
15
|
|
|
16
16
|
var _this = this,
|
|
17
|
-
_jsxFileName = "/
|
|
17
|
+
_jsxFileName = "/Users/vishalnarkhede/projects/stream-chat-react-native/package/src/contexts/chatContext/ChatContext.tsx";
|
|
18
18
|
|
|
19
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
20
|
|
|
@@ -32,7 +32,7 @@ var ChatProvider = function ChatProvider(_ref) {
|
|
|
32
32
|
__self: _this,
|
|
33
33
|
__source: {
|
|
34
34
|
fileName: _jsxFileName,
|
|
35
|
-
lineNumber:
|
|
35
|
+
lineNumber: 67,
|
|
36
36
|
columnNumber: 3
|
|
37
37
|
}
|
|
38
38
|
}, children);
|
|
@@ -53,7 +53,7 @@ var withChatContext = function withChatContext(Component) {
|
|
|
53
53
|
__self: _this,
|
|
54
54
|
__source: {
|
|
55
55
|
fileName: _jsxFileName,
|
|
56
|
-
lineNumber:
|
|
56
|
+
lineNumber: 90,
|
|
57
57
|
columnNumber: 12
|
|
58
58
|
}
|
|
59
59
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatContext.tsx"],"names":["ChatContext","React","createContext","ChatProvider","children","value","useChatContext","withChatContext","Component","WithChatContextComponent","props","chatContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["ChatContext.tsx"],"names":["ChatContext","React","createContext","ChatProvider","children","value","useChatContext","withChatContext","Component","WithChatContextComponent","props","chatContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAKA;;;;;;;;;AAmDO,IAAMA,WAAW,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAApB;;;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe;AAAA,MAG1BC,QAH0B,QAG1BA,QAH0B;AAAA,MAI1BC,KAJ0B,QAI1BA,KAJ0B;AAAA,SAQ1B,gCAAC,WAAD,CAAa,QAAb;AAAsB,IAAA,KAAK,EAAEA,KAA7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR0B;AAAA,CAArB;;;;AAaA,IAAME,cAAc,GAAG,SAAjBA,cAAiB;AAAA,SAEvB,uBAAWN,WAAX,CAFuB;AAAA,CAAvB;;;;AASA,IAAMO,eAAe,GAAG,SAAlBA,eAAkB,CAI7BC,SAJ6B,EAKqC;AAClE,MAAMC,wBAAwB,GAAG,SAA3BA,wBAA2B,CAACC,KAAD,EAAgE;AAC/F,QAAMC,WAAW,GAAGL,cAAc,EAAlC;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,WAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAJD;;AAKAF,EAAAA,wBAAwB,CAACG,WAAzB,uBAAyD,oCAAeJ,SAAf,CAAzD;AACA,SAAOC,wBAAP;AACD,CAbM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { Channel, Mute, StreamChat } from 'stream-chat';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type ChatContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * The StreamChat client object\n *\n * ```\n * import { StreamChat } from 'stream-chat';\n * import { Chat } from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key);\n * await client.connectUser('user_id', 'userToken');\n *\n * <Chat client={client}>\n * </Chat>\n * ```\n *\n * @overrideType StreamChat\n * */\n client: StreamChat<StreamChatGenerics>;\n connectionRecovering: boolean;\n isOnline: boolean;\n mutedUsers: Mute<StreamChatGenerics>[];\n /**\n * @param newChannel Channel to set as active.\n *\n * @overrideType Function\n */\n setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<StreamChatGenerics>;\n};\n\nexport const ChatContext = React.createContext({} as ChatContextValue);\n\nexport const ChatProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChatContextValue<StreamChatGenerics>;\n}>) => (\n <ChatContext.Provider value={value as unknown as ChatContextValue}>\n {children}\n </ChatContext.Provider>\n);\n\nexport const useChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => useContext(ChatContext) as unknown as ChatContextValue<StreamChatGenerics>;\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChatContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChatContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChatContextValue<StreamChatGenerics>>> => {\n const WithChatContextComponent = (props: Omit<P, keyof ChatContextValue<StreamChatGenerics>>) => {\n const chatContext = useChatContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...chatContext} />;\n };\n WithChatContextComponent.displayName = `WithChatContext${getDisplayName(Component)}`;\n return WithChatContextComponent;\n};\n"]}
|
|
@@ -16,7 +16,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
16
16
|
var _getDisplayName = require("../utils/getDisplayName");
|
|
17
17
|
|
|
18
18
|
var _this = this,
|
|
19
|
-
_jsxFileName = "/
|
|
19
|
+
_jsxFileName = "/Users/vishalnarkhede/projects/stream-chat-react-native/package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx";
|
|
20
20
|
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
|
|
@@ -50,7 +50,7 @@ var ImageGalleryProvider = function ImageGalleryProvider(_ref) {
|
|
|
50
50
|
__self: _this,
|
|
51
51
|
__source: {
|
|
52
52
|
fileName: _jsxFileName,
|
|
53
|
-
lineNumber:
|
|
53
|
+
lineNumber: 36,
|
|
54
54
|
columnNumber: 5
|
|
55
55
|
}
|
|
56
56
|
}, children);
|
|
@@ -71,7 +71,7 @@ var withImageGalleryContext = function withImageGalleryContext(Component) {
|
|
|
71
71
|
__self: _this,
|
|
72
72
|
__source: {
|
|
73
73
|
fileName: _jsxFileName,
|
|
74
|
-
lineNumber:
|
|
74
|
+
lineNumber: 59,
|
|
75
75
|
columnNumber: 12
|
|
76
76
|
}
|
|
77
77
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ImageGalleryContext.tsx"],"names":["ImageGalleryContext","React","createContext","ImageGalleryProvider","children","images","setImages","image","setImage","imageGalleryContext","useImageGalleryContext","withImageGalleryContext","Component","WithImageGalleryContextComponent","props","displayName"],"mappings":";;;;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["ImageGalleryContext.tsx"],"names":["ImageGalleryContext","React","createContext","ImageGalleryProvider","children","images","setImages","image","setImage","imageGalleryContext","useImageGalleryContext","withImageGalleryContext","Component","WithImageGalleryContextComponent","props","displayName"],"mappings":";;;;;;;;;;;;;AAAA;;AAIA;;;;;;;;;AAWO,IAAMA,mBAAmB,GAAGC,kBAAMC,aAAN,CACjC,EADiC,CAA5B;;;;AAIA,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,OAIE;AAAA,MADpCC,QACoC,QADpCA,QACoC;;AACpC,kBAA4B,qBAA4C,EAA5C,CAA5B;AAAA;AAAA,MAAOC,MAAP;AAAA,MAAeC,SAAf;;AACA,mBAA0B,sBAA1B;AAAA;AAAA,MAAOC,KAAP;AAAA,MAAcC,QAAd;;AAEA,MAAMC,mBAAmB,GAAG;AAC1BF,IAAAA,KAAK,EAALA,KAD0B;AAE1BF,IAAAA,MAAM,EAANA,MAF0B;AAG1BG,IAAAA,QAAQ,EAARA,QAH0B;AAI1BF,IAAAA,SAAS,EAATA;AAJ0B,GAA5B;AAOA,SACE,gCAAC,mBAAD,CAAqB,QAArB;AACE,IAAA,KAAK,EAAEG,mBADT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAGGL,QAHH,CADF;AAOD,CAtBM;;;;AAwBA,IAAMM,sBAAsB,GAAG,SAAzBA,sBAAyB;AAAA,SAE/B,uBAAWV,mBAAX,CAF+B;AAAA,CAA/B;;;;AAIA,IAAMW,uBAAuB,GAAG,SAA1BA,uBAA0B,CAIrCC,SAJqC,EAKqC;AAC1E,MAAMC,gCAAgC,GAAG,SAAnCA,gCAAmC,CACvCC,KADuC,EAEpC;AACH,QAAML,mBAAmB,GAAGC,sBAAsB,EAAlD;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCL,mBAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAI,EAAAA,gCAAgC,CAACE,WAAjC,+BAAyE,oCACvEH,SADuE,CAAzE;AAGA,SAAOC,gCAAP;AACD,CAjBM","sourcesContent":["import React, { PropsWithChildren, useContext, useState } from 'react';\n\nimport type { MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type ImageGalleryContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n images: MessageType<StreamChatGenerics>[];\n setImage: React.Dispatch<React.SetStateAction<{ messageId?: string; url?: string } | undefined>>;\n setImages: React.Dispatch<React.SetStateAction<MessageType<StreamChatGenerics>[]>>;\n image?: { messageId?: string; url?: string };\n};\n\nexport const ImageGalleryContext = React.createContext<ImageGalleryContextValue>(\n {} as ImageGalleryContextValue,\n);\n\nexport const ImageGalleryProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n}: PropsWithChildren<UnknownType>) => {\n const [images, setImages] = useState<MessageType<StreamChatGenerics>[]>([]);\n const [image, setImage] = useState<{ messageId?: string; url?: string }>();\n\n const imageGalleryContext = {\n image,\n images,\n setImage,\n setImages,\n };\n\n return (\n <ImageGalleryContext.Provider\n value={imageGalleryContext as unknown as ImageGalleryContextValue}\n >\n {children}\n </ImageGalleryContext.Provider>\n );\n};\n\nexport const useImageGalleryContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => useContext(ImageGalleryContext) as unknown as ImageGalleryContextValue<StreamChatGenerics>;\n\nexport const withImageGalleryContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ImageGalleryContextValue<StreamChatGenerics>>> => {\n const WithImageGalleryContextComponent = (\n props: Omit<P, keyof ImageGalleryContextValue<StreamChatGenerics>>,\n ) => {\n const imageGalleryContext = useImageGalleryContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...imageGalleryContext} />;\n };\n WithImageGalleryContextComponent.displayName = `WithImageGalleryContext${getDisplayName(\n Component,\n )}`;\n return WithImageGalleryContextComponent;\n};\n"]}
|
|
@@ -16,7 +16,7 @@ var _reactNative = require("react-native");
|
|
|
16
16
|
var _getDisplayName = require("../utils/getDisplayName");
|
|
17
17
|
|
|
18
18
|
var _this = this,
|
|
19
|
-
_jsxFileName = "/
|
|
19
|
+
_jsxFileName = "/Users/vishalnarkhede/projects/stream-chat-react-native/package/src/contexts/keyboardContext/KeyboardContext.tsx";
|
|
20
20
|
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
|
|
@@ -36,7 +36,7 @@ var KeyboardProvider = function KeyboardProvider(_ref) {
|
|
|
36
36
|
__self: _this,
|
|
37
37
|
__source: {
|
|
38
38
|
fileName: _jsxFileName,
|
|
39
|
-
lineNumber:
|
|
39
|
+
lineNumber: 18,
|
|
40
40
|
columnNumber: 3
|
|
41
41
|
}
|
|
42
42
|
}, children);
|
|
@@ -57,7 +57,7 @@ var withKeyboardContext = function withKeyboardContext(Component) {
|
|
|
57
57
|
__self: _this,
|
|
58
58
|
__source: {
|
|
59
59
|
fileName: _jsxFileName,
|
|
60
|
-
lineNumber:
|
|
60
|
+
lineNumber: 33,
|
|
61
61
|
columnNumber: 12
|
|
62
62
|
}
|
|
63
63
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["KeyboardContext.tsx"],"names":["KeyboardContext","React","createContext","dismissKeyboard","Keyboard","dismiss","KeyboardProvider","children","value","useKeyboardContext","withKeyboardContext","Component","WithKeyboardContextComponent","props","keyboardContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["KeyboardContext.tsx"],"names":["KeyboardContext","React","createContext","dismissKeyboard","Keyboard","dismiss","KeyboardProvider","children","value","useKeyboardContext","withKeyboardContext","Component","WithKeyboardContextComponent","props","keyboardContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAGA;;;;;;;;;AAMO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAA0C;AACvEC,EAAAA,eAAe,EAAEC,sBAASC;AAD6C,CAA1C,CAAxB;;;;AAIA,IAAMC,gBAEX,GAAG,SAFQA,gBAER;AAAA,MAAGC,QAAH,QAAGA,QAAH;AAAA,MAAaC,KAAb,QAAaA,KAAb;AAAA,SACH,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAyCD,QAAzC,CADG;AAAA,CAFE;;;;AAMA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB;AAAA,SAAM,uBAAWT,eAAX,CAAN;AAAA,CAA3B;;;;AAEA,IAAMU,mBAAmB,GAAG,SAAtBA,mBAAsB,CAGjCC,SAHiC,EAIkC;AACnE,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGL,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAkDC,eAAlD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAC/DJ,SAD+D,CAAjE;AAGA,SAAOC,4BAAP;AACD,CAhBM","sourcesContent":["import React, { useContext } from 'react';\nimport { Keyboard } from 'react-native';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type KeyboardContextValue = {\n dismissKeyboard: () => void;\n};\n\nexport const KeyboardContext = React.createContext<KeyboardContextValue>({\n dismissKeyboard: Keyboard.dismiss,\n});\n\nexport const KeyboardProvider: React.FC<{\n value: KeyboardContextValue;\n}> = ({ children, value }) => (\n <KeyboardContext.Provider value={value}>{children}</KeyboardContext.Provider>\n);\n\nexport const useKeyboardContext = () => useContext(KeyboardContext);\n\nexport const withKeyboardContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<StreamChatGenerics>,\n): React.FC<Omit<StreamChatGenerics, keyof KeyboardContextValue>> => {\n const WithKeyboardContextComponent = (\n props: Omit<StreamChatGenerics, keyof KeyboardContextValue>,\n ) => {\n const keyboardContext = useKeyboardContext();\n\n return <Component {...(props as StreamChatGenerics)} {...keyboardContext} />;\n };\n WithKeyboardContextComponent.displayName = `WithKeyboardContext${getDisplayName(\n Component as React.ComponentType,\n )}`;\n return WithKeyboardContextComponent;\n};\n"]}
|
|
@@ -14,7 +14,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
14
14
|
var _getDisplayName = require("../utils/getDisplayName");
|
|
15
15
|
|
|
16
16
|
var _this = this,
|
|
17
|
-
_jsxFileName = "/
|
|
17
|
+
_jsxFileName = "/Users/vishalnarkhede/projects/stream-chat-react-native/package/src/contexts/messageContext/MessageContext.tsx";
|
|
18
18
|
|
|
19
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
20
|
|
|
@@ -32,7 +32,7 @@ var MessageProvider = function MessageProvider(_ref) {
|
|
|
32
32
|
__self: _this,
|
|
33
33
|
__source: {
|
|
34
34
|
fileName: _jsxFileName,
|
|
35
|
-
lineNumber:
|
|
35
|
+
lineNumber: 110,
|
|
36
36
|
columnNumber: 3
|
|
37
37
|
}
|
|
38
38
|
}, children);
|
|
@@ -53,7 +53,7 @@ var withMessageContext = function withMessageContext(Component) {
|
|
|
53
53
|
__self: _this,
|
|
54
54
|
__source: {
|
|
55
55
|
fileName: _jsxFileName,
|
|
56
|
-
lineNumber:
|
|
56
|
+
lineNumber: 135,
|
|
57
57
|
columnNumber: 12
|
|
58
58
|
}
|
|
59
59
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MessageContext.tsx"],"names":["MessageContext","React","createContext","MessageProvider","children","value","useMessageContext","withMessageContext","Component","WithMessageContextComponent","props","messageContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["MessageContext.tsx"],"names":["MessageContext","React","createContext","MessageProvider","children","value","useMessageContext","withMessageContext","Component","WithMessageContextComponent","props","messageContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAUA;;;;;;;;;AAyFO,IAAMA,cAAc,GAAGC,kBAAMC,aAAN,CAAoB,EAApB,CAAvB;;;;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB;AAAA,MAG7BC,QAH6B,QAG7BA,QAH6B;AAAA,MAI7BC,KAJ6B,QAI7BA,KAJ6B;AAAA,SAQ7B,gCAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAEA,KAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR6B;AAAA,CAAxB;;;;AAaA,IAAME,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,SAE1B,uBAAWN,cAAX,CAF0B;AAAA,CAA1B;;;;AASA,IAAMO,kBAAkB,GAAG,SAArBA,kBAAqB,CAIhCC,SAJgC,EAKqC;AACrE,MAAMC,2BAA2B,GAAG,SAA9BA,2BAA8B,CAClCC,KADkC,EAE/B;AACH,QAAMC,cAAc,GAAGL,iBAAiB,EAAxC;AAEA,WAAO,gCAAC,SAAD,gCAAgBI,KAAhB,EAAiCC,cAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,2BAA2B,CAACG,WAA5B,0BAA+D,oCAAeJ,SAAf,CAA/D;AACA,SAAOC,2BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { Attachment } from 'stream-chat';\n\nimport type { ActionHandler } from '../../components/Attachment/Attachment';\nimport type { TouchableHandlerPayload } from '../../components/Message/Message';\nimport type { GroupType, MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { ChannelContextValue } from '../../contexts/channelContext/ChannelContext';\nimport type { MessageContentType } from '../../contexts/messagesContext/MessagesContext';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type Alignment = 'right' | 'left';\n\nexport type Reactions = {\n own: boolean;\n type: string;\n}[];\n\nexport type MessageContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /** Whether or not actions can be performed on message */\n actionsEnabled: boolean;\n /** Position of the message, either 'right' or 'left' */\n alignment: Alignment;\n /** The files attached to a message */\n files: Attachment<StreamChatGenerics>[];\n /**\n * Position of message in group - top, bottom, middle, single.\n *\n * Message group is a group of consecutive messages from same user. groupStyles can be used to style message as per their position in message group\n * e.g., user avatar (to which message belongs to) is only showed for last (bottom) message in group.\n */\n groupStyles: GroupType[];\n /** Handler for actions. Actions in combination with attachments can be used to build [commands](https://getstream.io/chat/docs/#channel_commands). */\n handleAction: ActionHandler;\n handleDeleteMessage: () => Promise<void>;\n handleEditMessage: () => void;\n handleQuotedReplyMessage: () => void;\n handleResendMessage: () => Promise<void>;\n handleToggleBanUser: () => Promise<void>;\n handleToggleMuteUser: () => Promise<void>;\n handleToggleReaction: (reactionType: string) => Promise<void>;\n /** Whether or not message has reactions */\n hasReactions: boolean;\n /** The images attached to a message */\n images: Attachment<StreamChatGenerics>[];\n /** Whether or not this is the active user's message */\n isMyMessage: boolean;\n /** Whether or not this is the last message in a group of messages */\n lastGroupMessage: boolean;\n /** Current [message object](https://getstream.io/chat/docs/#message_format) */\n message: MessageType<StreamChatGenerics>;\n /** Order to render the message content */\n messageContentOrder: MessageContentType[];\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/Message.tsx)\n *\n * By default, we show the overlay with all the message actions on long press.\n *\n * @param event Event object for onLongPress event\n */\n onLongPress: (payload: TouchableHandlerPayload) => void;\n /** Whether the message is only text and the text is only emojis */\n onlyEmojis: boolean;\n /** Handler to open a thread on a message */\n onOpenThread: () => void;\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Message/Message.tsx)\n *\n * By default, we will dismiss the keyboard on press.\n *\n * @param event Event object for onPress event\n */\n onPress: (payload: TouchableHandlerPayload) => void;\n onPressIn: ((payload: TouchableHandlerPayload) => void) | null;\n /** The images attached to a message */\n otherAttachments: Attachment<StreamChatGenerics>[];\n reactions: Reactions;\n showMessageOverlay: (messageReactions?: boolean) => void;\n showMessageStatus: boolean;\n /** Whether or not the Message is part of a Thread */\n threadList: boolean;\n goToMessage?: (messageId: string) => void;\n /** Latest message id on current channel */\n lastReceivedId?: string;\n /** Prevent message being pressed for image viewer view */\n preventPress?: boolean;\n /** Whether or not the avatar show show next to Message */\n showAvatar?: boolean;\n} & Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'disabled' | 'members'>;\n\nexport const MessageContext = React.createContext({} as MessageContextValue);\n\nexport const MessageProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessageContextValue<StreamChatGenerics>;\n}>) => (\n <MessageContext.Provider value={value as unknown as MessageContextValue}>\n {children}\n </MessageContext.Provider>\n);\n\nexport const useMessageContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => useContext(MessageContext) as unknown as MessageContextValue<StreamChatGenerics>;\n\n/**\n * Typescript currently does not support partial inference so if MessageContext\n * typing is desired while using the HOC withMessageContextContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessageContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessageContextValue<StreamChatGenerics>>> => {\n const WithMessageContextComponent = (\n props: Omit<P, keyof MessageContextValue<StreamChatGenerics>>,\n ) => {\n const messageContext = useMessageContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...messageContext} />;\n };\n WithMessageContextComponent.displayName = `WithMessageContext${getDisplayName(Component)}`;\n return WithMessageContextComponent;\n};\n"]}
|