stream-chat-react 12.15.0 → 13.0.0-rc.2
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/dist/components/AIStateIndicator/AIStateIndicator.d.ts +4 -5
- package/dist/components/AIStateIndicator/hooks/useAIState.d.ts +2 -3
- package/dist/components/Attachment/Attachment.d.ts +8 -9
- package/dist/components/Attachment/Attachment.js +6 -5
- package/dist/components/Attachment/AttachmentActions.d.ts +2 -3
- package/dist/components/Attachment/AttachmentContainer.d.ts +15 -15
- package/dist/components/Attachment/AttachmentContainer.js +2 -2
- package/dist/components/Attachment/Audio.d.ts +3 -4
- package/dist/components/Attachment/Card.d.ts +1 -1
- package/dist/components/Attachment/FileAttachment.d.ts +3 -4
- package/dist/components/Attachment/FileAttachment.js +1 -1
- package/dist/components/Attachment/UnsupportedAttachment.d.ts +3 -4
- package/dist/components/Attachment/UnsupportedAttachment.js +1 -1
- package/dist/components/Attachment/VoiceRecording.d.ts +4 -5
- package/dist/components/Attachment/components/FileSizeIndicator.d.ts +1 -1
- package/dist/components/Attachment/components/FileSizeIndicator.js +4 -2
- package/dist/components/Attachment/utils.d.ts +8 -22
- package/dist/components/Attachment/utils.js +3 -18
- package/dist/components/Avatar/Avatar.d.ts +3 -4
- package/dist/components/Avatar/ChannelAvatar.d.ts +3 -4
- package/dist/components/Avatar/ChannelAvatar.js +1 -1
- package/dist/components/Avatar/GroupAvatar.d.ts +2 -2
- package/dist/components/Channel/Channel.d.ts +18 -43
- package/dist/components/Channel/Channel.js +25 -88
- package/dist/components/Channel/channelState.d.ts +17 -18
- package/dist/components/Channel/hooks/useChannelContainerClasses.d.ts +2 -3
- package/dist/components/Channel/hooks/useCreateChannelStateContext.d.ts +2 -3
- package/dist/components/Channel/hooks/useCreateChannelStateContext.js +1 -15
- package/dist/components/Channel/hooks/useCreateTypingContext.d.ts +1 -2
- package/dist/components/Channel/hooks/useEditMessageHandler.d.ts +3 -4
- package/dist/components/Channel/hooks/useMentionsHandlers.d.ts +3 -4
- package/dist/components/Channel/utils.d.ts +8 -6
- package/dist/components/Channel/utils.js +1 -0
- package/dist/components/ChannelHeader/ChannelHeader.d.ts +2 -3
- package/dist/components/ChannelList/ChannelList.d.ts +31 -30
- package/dist/components/ChannelList/ChannelList.js +8 -10
- package/dist/components/ChannelList/ChannelListMessenger.d.ts +6 -6
- package/dist/components/ChannelList/hooks/useChannelDeletedListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useChannelHiddenListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useChannelListShape.d.ts +44 -44
- package/dist/components/ChannelList/hooks/useChannelListShape.js +0 -2
- package/dist/components/ChannelList/hooks/useChannelMembershipState.d.ts +3 -3
- package/dist/components/ChannelList/hooks/useChannelTruncatedListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useChannelUpdatedListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useChannelVisibleListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useConnectionRecoveredListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useMessageNewListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts +1 -2
- package/dist/components/ChannelList/hooks/usePaginatedChannels.d.ts +7 -8
- package/dist/components/ChannelList/hooks/usePaginatedChannels.js +3 -3
- package/dist/components/ChannelList/hooks/useSelectedChannelState.d.ts +7 -7
- package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts +1 -2
- package/dist/components/ChannelList/utils.d.ts +20 -21
- package/dist/components/ChannelList/utils.js +2 -2
- package/dist/components/ChannelPreview/ChannelPreview.d.ts +15 -16
- package/dist/components/ChannelPreview/ChannelPreview.js +1 -1
- package/dist/components/ChannelPreview/ChannelPreviewActionButtons.d.ts +4 -4
- package/dist/components/ChannelPreview/ChannelPreviewMessenger.d.ts +1 -2
- package/dist/components/ChannelPreview/hooks/useChannelPreviewInfo.d.ts +3 -4
- package/dist/components/ChannelPreview/hooks/useIsChannelMuted.d.ts +1 -2
- package/dist/components/ChannelPreview/hooks/useMessageDeliveryStatus.d.ts +5 -7
- package/dist/components/ChannelPreview/icons.d.ts +1 -1
- package/dist/components/ChannelPreview/utils.d.ts +7 -7
- package/dist/components/ChannelSearch/ChannelSearch.d.ts +5 -6
- package/dist/components/ChannelSearch/ChannelSearch.js +2 -2
- package/dist/components/ChannelSearch/SearchBar.d.ts +1 -1
- package/dist/components/ChannelSearch/SearchBar.js +1 -1
- package/dist/components/ChannelSearch/SearchResults.d.ts +13 -14
- package/dist/components/ChannelSearch/SearchResults.js +1 -1
- package/dist/components/ChannelSearch/hooks/useChannelSearch.d.ts +17 -18
- package/dist/components/ChannelSearch/hooks/useChannelSearch.js +2 -6
- package/dist/components/ChannelSearch/utils.d.ts +2 -3
- package/dist/components/Chat/Chat.d.ts +9 -9
- package/dist/components/Chat/hooks/useChannelsQueryState.d.ts +1 -1
- package/dist/components/Chat/hooks/useChat.d.ts +10 -10
- package/dist/components/Chat/hooks/useChat.js +3 -3
- package/dist/components/Chat/hooks/useCreateChatClient.d.ts +4 -4
- package/dist/components/Chat/hooks/useCreateChatContext.d.ts +1 -2
- package/dist/components/Dialog/DialogAnchor.d.ts +4 -3
- package/dist/components/Dialog/DialogAnchor.js +2 -2
- package/dist/components/Dialog/DialogMenu.d.ts +2 -1
- package/dist/components/Dialog/DialogPortal.d.ts +2 -1
- package/dist/components/Dialog/FormDialog.d.ts +2 -1
- package/dist/components/Dialog/FormDialog.js +1 -1
- package/dist/components/Dialog/PromptDialog.d.ts +2 -1
- package/dist/components/DragAndDrop/DragAndDropContainer.d.ts +2 -1
- package/dist/components/EventComponent/EventComponent.d.ts +7 -6
- package/dist/components/Form/FieldError.d.ts +2 -1
- package/dist/components/Form/SwitchField.d.ts +2 -1
- package/dist/components/Form/SwitchField.js +1 -1
- package/dist/components/Gallery/Gallery.d.ts +5 -5
- package/dist/components/Gallery/Image.d.ts +6 -5
- package/dist/components/Gallery/ModalGallery.d.ts +3 -4
- package/dist/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +2 -1
- package/dist/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts +2 -1
- package/dist/components/LoadMore/LoadMoreButton.d.ts +2 -1
- package/dist/components/LoadMore/LoadMorePaginator.d.ts +3 -2
- package/dist/components/LoadMore/LoadMorePaginator.js +1 -1
- package/dist/components/MediaRecorder/AudioRecorder/AudioRecorder.js +3 -2
- package/dist/components/MediaRecorder/AudioRecorder/AudioRecordingInProgress.js +1 -1
- package/dist/components/MediaRecorder/RecordingPermissionDeniedNotification.d.ts +1 -1
- package/dist/components/MediaRecorder/classes/MediaRecorderController.d.ts +11 -23
- package/dist/components/MediaRecorder/hooks/useMediaRecorder.d.ts +8 -8
- package/dist/components/MediaRecorder/hooks/useMediaRecorder.js +6 -4
- package/dist/components/MediaRecorder/observable/BehaviorSubject.d.ts +2 -2
- package/dist/components/MediaRecorder/observable/Observable.d.ts +1 -1
- package/dist/components/MediaRecorder/observable/Subject.d.ts +3 -2
- package/dist/components/Message/FixedHeightMessage.d.ts +4 -5
- package/dist/components/Message/Message.d.ts +1 -2
- package/dist/components/Message/MessageDeleted.d.ts +4 -5
- package/dist/components/Message/MessageEditedTimestamp.d.ts +2 -3
- package/dist/components/Message/MessageErrorText.d.ts +4 -5
- package/dist/components/Message/MessageErrorText.js +2 -2
- package/dist/components/Message/MessageOptions.d.ts +3 -3
- package/dist/components/Message/MessageRepliesCountButton.d.ts +2 -1
- package/dist/components/Message/MessageSimple.d.ts +1 -2
- package/dist/components/Message/MessageSimple.js +8 -10
- package/dist/components/Message/MessageStatus.d.ts +3 -4
- package/dist/components/Message/MessageText.d.ts +6 -6
- package/dist/components/Message/MessageTimestamp.d.ts +4 -5
- package/dist/components/Message/QuotedMessage.d.ts +2 -3
- package/dist/components/Message/QuotedMessage.js +1 -1
- package/dist/components/Message/StreamedMessageText.d.ts +3 -4
- package/dist/components/Message/hooks/useActionHandler.d.ts +2 -3
- package/dist/components/Message/hooks/useActionHandler.js +1 -1
- package/dist/components/Message/hooks/useDeleteHandler.d.ts +4 -5
- package/dist/components/Message/hooks/useFlagHandler.d.ts +5 -6
- package/dist/components/Message/hooks/useMarkUnreadHandler.d.ts +5 -6
- package/dist/components/Message/hooks/useMentionsHandler.d.ts +6 -8
- package/dist/components/Message/hooks/useMessageTextStreaming.d.ts +2 -3
- package/dist/components/Message/hooks/useMuteHandler.d.ts +5 -7
- package/dist/components/Message/hooks/useMuteHandler.js +1 -1
- package/dist/components/Message/hooks/useOpenThreadHandler.d.ts +2 -3
- package/dist/components/Message/hooks/usePinHandler.d.ts +4 -5
- package/dist/components/Message/hooks/usePinHandler.js +1 -1
- package/dist/components/Message/hooks/useReactionHandler.d.ts +3 -4
- package/dist/components/Message/hooks/useReactionHandler.js +2 -4
- package/dist/components/Message/hooks/useReactionsFetcher.d.ts +5 -7
- package/dist/components/Message/hooks/useRetryHandler.d.ts +2 -3
- package/dist/components/Message/hooks/useRetryHandler.js +1 -1
- package/dist/components/Message/hooks/useUserHandler.d.ts +5 -6
- package/dist/components/Message/hooks/useUserRole.d.ts +2 -3
- package/dist/components/Message/hooks/useUserRole.js +1 -1
- package/dist/components/Message/icons.d.ts +2 -2
- package/dist/components/Message/icons.js +1 -1
- package/dist/components/Message/renderText/componentRenderers/Anchor.d.ts +2 -1
- package/dist/components/Message/renderText/componentRenderers/Emoji.d.ts +1 -1
- package/dist/components/Message/renderText/componentRenderers/Mention.d.ts +5 -5
- package/dist/components/Message/renderText/componentRenderers/Mention.js +1 -1
- package/dist/components/Message/renderText/rehypePlugins/mentionsMarkdownPlugin.d.ts +1 -2
- package/dist/components/Message/renderText/renderText.d.ts +6 -6
- package/dist/components/Message/renderText/types.d.ts +1 -1
- package/dist/components/Message/types.d.ts +27 -28
- package/dist/components/Message/utils.d.ts +21 -22
- package/dist/components/Message/utils.js +5 -4
- package/dist/components/MessageActions/CustomMessageActionsList.d.ts +6 -7
- package/dist/components/MessageActions/MessageActions.d.ts +6 -5
- package/dist/components/MessageActions/MessageActions.js +1 -1
- package/dist/components/MessageActions/MessageActionsBox.d.ts +5 -5
- package/dist/components/MessageActions/MessageActionsBox.js +4 -3
- package/dist/components/MessageActions/hooks/useMessageActionsBoxPopper.d.ts +1 -1
- package/dist/components/MessageBounce/MessageBounceModal.d.ts +4 -3
- package/dist/components/MessageBounce/MessageBouncePrompt.d.ts +1 -2
- package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.d.ts +11 -11
- package/dist/components/MessageInput/AttachmentPreviewList/AttachmentPreviewList.js +17 -14
- package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.d.ts +4 -12
- package/dist/components/MessageInput/AttachmentPreviewList/FileAttachmentPreview.js +8 -5
- package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.d.ts +4 -5
- package/dist/components/MessageInput/AttachmentPreviewList/ImageAttachmentPreview.js +2 -2
- package/dist/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.d.ts +7 -5
- package/dist/components/MessageInput/AttachmentPreviewList/UnsupportedAttachmentPreview.js +5 -2
- package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.d.ts +4 -5
- package/dist/components/MessageInput/AttachmentPreviewList/VoiceRecordingPreview.js +5 -2
- package/dist/components/MessageInput/AttachmentPreviewList/index.d.ts +1 -1
- package/dist/components/MessageInput/AttachmentPreviewList/types.d.ts +3 -4
- package/dist/components/MessageInput/AttachmentSelector.d.ts +1 -2
- package/dist/components/MessageInput/AttachmentSelector.js +5 -3
- package/dist/components/MessageInput/EditMessageForm.d.ts +3 -2
- package/dist/components/MessageInput/EditMessageForm.js +30 -6
- package/dist/components/MessageInput/LinkPreviewList.d.ts +6 -4
- package/dist/components/MessageInput/LinkPreviewList.js +24 -10
- package/dist/components/MessageInput/MessageInput.d.ts +23 -45
- package/dist/components/MessageInput/MessageInput.js +24 -17
- package/dist/components/MessageInput/MessageInputFlat.d.ts +1 -2
- package/dist/components/MessageInput/MessageInputFlat.js +14 -39
- package/dist/components/MessageInput/QuotedMessagePreview.d.ts +4 -7
- package/dist/components/MessageInput/QuotedMessagePreview.js +22 -16
- package/dist/components/MessageInput/SendButton.d.ts +4 -5
- package/dist/components/MessageInput/SendButton.js +6 -2
- package/dist/components/MessageInput/WithDragAndDropUpload.d.ts +4 -3
- package/dist/components/MessageInput/WithDragAndDropUpload.js +20 -9
- package/dist/components/MessageInput/hooks/index.d.ts +5 -1
- package/dist/components/MessageInput/hooks/index.js +5 -1
- package/dist/components/MessageInput/hooks/useAttachmentManagerState.d.ts +10 -0
- package/dist/components/MessageInput/hooks/useAttachmentManagerState.js +19 -0
- package/dist/components/MessageInput/hooks/useCanCreatePoll.d.ts +1 -0
- package/dist/components/MessageInput/hooks/useCanCreatePoll.js +10 -0
- package/dist/components/MessageInput/hooks/useCooldownTimer.d.ts +2 -3
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.d.ts +1 -2
- package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +1 -55
- package/dist/components/MessageInput/hooks/useMessageComposer.d.ts +2 -0
- package/dist/components/MessageInput/hooks/useMessageComposer.js +80 -0
- package/dist/components/MessageInput/hooks/useMessageComposerHasSendableData.d.ts +1 -0
- package/dist/components/MessageInput/hooks/useMessageComposerHasSendableData.js +8 -0
- package/dist/components/MessageInput/hooks/useMessageInputControls.d.ts +12 -0
- package/dist/components/MessageInput/hooks/useMessageInputControls.js +23 -0
- package/dist/components/MessageInput/hooks/useMessageInputText.d.ts +1 -5
- package/dist/components/MessageInput/hooks/useMessageInputText.js +19 -53
- package/dist/components/MessageInput/hooks/usePasteHandler.d.ts +1 -3
- package/dist/components/MessageInput/hooks/usePasteHandler.js +6 -8
- package/dist/components/MessageInput/hooks/useSubmitHandler.d.ts +2 -6
- package/dist/components/MessageInput/hooks/useSubmitHandler.js +30 -98
- package/dist/components/MessageInput/hooks/utils.d.ts +0 -27
- package/dist/components/MessageInput/hooks/utils.js +0 -124
- package/dist/components/MessageInput/index.d.ts +0 -2
- package/dist/components/MessageInput/index.js +0 -2
- package/dist/components/MessageList/ConnectionStatus.d.ts +1 -2
- package/dist/components/MessageList/ConnectionStatus.js +1 -1
- package/dist/components/MessageList/CustomNotification.d.ts +2 -1
- package/dist/components/MessageList/GiphyPreviewMessage.d.ts +4 -5
- package/dist/components/MessageList/MessageList.d.ts +11 -12
- package/dist/components/MessageList/MessageList.js +4 -4
- package/dist/components/MessageList/MessageNotification.d.ts +2 -1
- package/dist/components/MessageList/VirtualizedMessageList.d.ts +22 -21
- package/dist/components/MessageList/VirtualizedMessageList.js +6 -6
- package/dist/components/MessageList/VirtualizedMessageListComponents.d.ts +10 -10
- package/dist/components/MessageList/VirtualizedMessageListComponents.js +7 -7
- package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.d.ts +8 -10
- package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.js +1 -1
- package/dist/components/MessageList/hooks/MessageList/useMessageListElements.d.ts +11 -12
- package/dist/components/MessageList/hooks/MessageList/useMessageListScrollManager.d.ts +4 -5
- package/dist/components/MessageList/hooks/MessageList/useScrollLocationLogic.d.ts +5 -6
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.d.ts +4 -5
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.js +3 -2
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.d.ts +4 -5
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useMessageSetKey.js +1 -1
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useNewMessageNotification.d.ts +2 -3
- package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.d.ts +2 -3
- package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.js +6 -2
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.d.ts +4 -5
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.d.ts +2 -3
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.d.ts +3 -4
- package/dist/components/MessageList/hooks/VirtualizedMessageList/useUnreadMessagesNotificationVirtualized.js +5 -6
- package/dist/components/MessageList/hooks/useLastReadData.d.ts +5 -6
- package/dist/components/MessageList/hooks/useLastReadData.js +5 -1
- package/dist/components/MessageList/hooks/useMarkRead.d.ts +1 -2
- package/dist/components/MessageList/renderMessages.d.ts +14 -14
- package/dist/components/MessageList/renderMessages.js +8 -7
- package/dist/components/MessageList/utils.d.ts +34 -28
- package/dist/components/MessageList/utils.js +26 -21
- package/dist/components/Modal/Modal.d.ts +2 -1
- package/dist/components/Poll/Poll.d.ts +2 -3
- package/dist/components/Poll/Poll.js +1 -1
- package/dist/components/Poll/PollActions/AddCommentForm.d.ts +1 -2
- package/dist/components/Poll/PollActions/AddCommentForm.js +4 -2
- package/dist/components/Poll/PollActions/EndPollDialog.d.ts +1 -2
- package/dist/components/Poll/PollActions/EndPollDialog.js +1 -1
- package/dist/components/Poll/PollActions/PollAction.d.ts +2 -1
- package/dist/components/Poll/PollActions/PollActions.d.ts +7 -8
- package/dist/components/Poll/PollActions/PollActions.js +5 -5
- package/dist/components/Poll/PollActions/PollAnswerList.d.ts +1 -2
- package/dist/components/Poll/PollActions/PollOptionsFullList.d.ts +1 -2
- package/dist/components/Poll/PollActions/PollOptionsFullList.js +4 -2
- package/dist/components/Poll/PollActions/PollResults/PollOptionVotesList.d.ts +3 -4
- package/dist/components/Poll/PollActions/PollResults/PollOptionVotesList.js +1 -1
- package/dist/components/Poll/PollActions/PollResults/PollOptionWithLatestVotes.d.ts +3 -4
- package/dist/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.d.ts +4 -5
- package/dist/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.js +1 -1
- package/dist/components/Poll/PollActions/PollResults/PollResults.d.ts +1 -2
- package/dist/components/Poll/PollActions/PollResults/PollResults.js +1 -1
- package/dist/components/Poll/PollActions/SuggestPollOptionForm.d.ts +1 -2
- package/dist/components/Poll/PollActions/SuggestPollOptionForm.js +3 -1
- package/dist/components/Poll/PollContent.d.ts +1 -2
- package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.d.ts +2 -0
- package/dist/components/Poll/PollCreationDialog/MultipleAnswersField.js +35 -0
- package/dist/components/Poll/PollCreationDialog/NameField.d.ts +2 -0
- package/dist/components/Poll/PollCreationDialog/NameField.js +26 -0
- package/dist/components/Poll/PollCreationDialog/OptionFieldSet.d.ts +1 -8
- package/dist/components/Poll/PollCreationDialog/OptionFieldSet.js +33 -65
- package/dist/components/Poll/PollCreationDialog/PollCreationDialog.js +31 -85
- package/dist/components/Poll/PollCreationDialog/PollCreationDialogControls.d.ts +1 -4
- package/dist/components/Poll/PollCreationDialog/PollCreationDialogControls.js +15 -41
- package/dist/components/Poll/PollCreationDialog/types.d.ts +0 -14
- package/dist/components/Poll/PollHeader.d.ts +1 -2
- package/dist/components/Poll/PollOptionList.d.ts +1 -2
- package/dist/components/Poll/PollOptionList.js +4 -2
- package/dist/components/Poll/PollOptionSelector.d.ts +3 -4
- package/dist/components/Poll/PollVote.d.ts +6 -7
- package/dist/components/Poll/PollVote.js +3 -3
- package/dist/components/Poll/QuotedPoll.d.ts +1 -2
- package/dist/components/Poll/constants.d.ts +0 -1
- package/dist/components/Poll/constants.js +0 -1
- package/dist/components/Poll/hooks/useManagePollVotesRealtime.d.ts +2 -3
- package/dist/components/Poll/hooks/usePollAnswerPagination.d.ts +2 -3
- package/dist/components/Poll/hooks/usePollAnswerPagination.js +2 -2
- package/dist/components/Poll/hooks/usePollOptionVotesPagination.d.ts +2 -3
- package/dist/components/Poll/hooks/usePollOptionVotesPagination.js +1 -1
- package/dist/components/Portal/Portal.d.ts +1 -1
- package/dist/components/ReactFileUtilities/FileIcon/FileIcon.d.ts +1 -1
- package/dist/components/ReactFileUtilities/FileIcon/FileIconSet.d.ts +2 -1
- package/dist/components/ReactFileUtilities/FileIcon/iconMap.d.ts +1 -1
- package/dist/components/ReactFileUtilities/UploadButton.d.ts +3 -2
- package/dist/components/ReactFileUtilities/UploadButton.js +16 -6
- package/dist/components/ReactFileUtilities/index.d.ts +0 -1
- package/dist/components/ReactFileUtilities/index.js +0 -1
- package/dist/components/ReactFileUtilities/utils.d.ts +2 -2
- package/dist/components/Reactions/ReactionSelector.d.ts +4 -5
- package/dist/components/Reactions/ReactionSelectorWithButton.d.ts +1 -2
- package/dist/components/Reactions/ReactionsList.d.ts +6 -7
- package/dist/components/Reactions/ReactionsList.js +2 -2
- package/dist/components/Reactions/ReactionsListModal.d.ts +9 -10
- package/dist/components/Reactions/SimpleReactionsList.d.ts +5 -6
- package/dist/components/Reactions/StreamEmoji.d.ts +1 -1
- package/dist/components/Reactions/hooks/useFetchReactions.d.ts +9 -10
- package/dist/components/Reactions/hooks/useProcessReactions.d.ts +1 -2
- package/dist/components/Reactions/types.d.ts +3 -4
- package/dist/components/Reactions/utils/utils.d.ts +1 -1
- package/dist/components/SafeAnchor/SafeAnchor.d.ts +2 -1
- package/dist/components/TextareaComposer/SuggestionList/CommandItem.d.ts +7 -0
- package/dist/components/{CommandItem → TextareaComposer/SuggestionList}/CommandItem.js +1 -2
- package/dist/components/{EmoticonItem → TextareaComposer/SuggestionList}/EmoticonItem.d.ts +7 -7
- package/dist/components/TextareaComposer/SuggestionList/EmoticonItem.js +12 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionList.d.ts +14 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionList.js +50 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.d.ts +18 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.js +24 -0
- package/dist/components/{UserItem → TextareaComposer/SuggestionList}/UserItem.d.ts +7 -4
- package/dist/components/TextareaComposer/SuggestionList/UserItem.js +24 -0
- package/dist/components/TextareaComposer/SuggestionList/index.d.ts +5 -0
- package/dist/components/TextareaComposer/SuggestionList/index.js +5 -0
- package/dist/components/TextareaComposer/TextareaComposer.d.ts +13 -0
- package/dist/components/TextareaComposer/TextareaComposer.js +155 -0
- package/dist/components/TextareaComposer/index.d.ts +2 -0
- package/dist/components/TextareaComposer/index.js +2 -0
- package/dist/components/Thread/Thread.d.ts +13 -10
- package/dist/components/Thread/Thread.js +23 -12
- package/dist/components/Thread/ThreadHead.d.ts +2 -3
- package/dist/components/Thread/ThreadHeader.d.ts +5 -6
- package/dist/components/Thread/ThreadHeader.js +1 -1
- package/dist/components/Threads/ThreadContext.d.ts +2 -2
- package/dist/components/Threads/ThreadContext.js +1 -4
- package/dist/components/Threads/ThreadList/ThreadList.d.ts +1 -1
- package/dist/components/Threads/ThreadList/ThreadListItem.d.ts +1 -1
- package/dist/components/Threads/hooks/useThreadManagerState.d.ts +1 -1
- package/dist/components/Threads/hooks/useThreadState.d.ts +1 -1
- package/dist/components/Threads/icons.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +3 -2
- package/dist/components/Tooltip/hooks/useEnterLeaveHandlers.d.ts +1 -1
- package/dist/components/TypingIndicator/TypingIndicator.d.ts +1 -2
- package/dist/components/Window/Window.d.ts +6 -6
- package/dist/components/index.d.ts +1 -5
- package/dist/components/index.js +1 -5
- package/dist/context/AttachmentSelectorContext.d.ts +2 -1
- package/dist/context/ChannelActionContext.d.ts +26 -35
- package/dist/context/ChannelListContext.d.ts +9 -9
- package/dist/context/ChannelListContext.js +1 -1
- package/dist/context/ChannelStateContext.d.ts +24 -34
- package/dist/context/ChatContext.d.ts +18 -17
- package/dist/context/ComponentContext.d.ts +39 -37
- package/dist/context/DialogManagerContext.d.ts +2 -1
- package/dist/context/MessageBounceContext.d.ts +8 -7
- package/dist/context/MessageBounceContext.js +1 -1
- package/dist/context/MessageContext.d.ts +23 -23
- package/dist/context/MessageInputContext.d.ts +8 -26
- package/dist/context/MessageListContext.d.ts +2 -1
- package/dist/context/PollContext.d.ts +8 -8
- package/dist/context/TranslationContext.d.ts +2 -1
- package/dist/context/TypingContext.d.ts +11 -10
- package/dist/context/VirtualizedMessageListContext.d.ts +2 -1
- package/dist/context/WithComponents.d.ts +3 -2
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/experimental/MessageActions/MessageActions.d.ts +1 -1
- package/dist/experimental/MessageActions/MessageActions.js +1 -1
- package/dist/experimental/MessageActions/defaults.js +4 -3
- package/dist/experimental/Search/Search.d.ts +1 -2
- package/dist/experimental/Search/SearchContext.d.ts +8 -8
- package/dist/experimental/Search/SearchResults/SearchResultItem.d.ts +11 -11
- package/dist/experimental/Search/SearchResults/SearchResultItem.js +3 -3
- package/dist/experimental/Search/SearchResults/SearchResults.d.ts +1 -2
- package/dist/experimental/Search/SearchResults/SearchResultsHeader.d.ts +1 -2
- package/dist/experimental/Search/SearchResults/SearchResultsHeader.js +1 -1
- package/dist/experimental/Search/SearchResults/SearchSourceResultList.d.ts +2 -3
- package/dist/experimental/Search/SearchResults/SearchSourceResultListFooter.d.ts +1 -2
- package/dist/experimental/Search/SearchResults/SearchSourceResults.d.ts +1 -2
- package/dist/experimental/Search/SearchResults/SearchSourceResults.js +1 -1
- package/dist/experimental/Search/SearchSourceResultsContext.d.ts +2 -1
- package/dist/experimental/Search/hooks/useSearchFocusedMessage.d.ts +1 -2
- package/dist/experimental/Search/hooks/useSearchFocusedMessage.js +3 -1
- package/dist/experimental/Search/hooks/useSearchQueriesInProgress.d.ts +3 -4
- package/dist/experimental/index.browser.cjs +1139 -1075
- package/dist/experimental/index.browser.cjs.map +4 -4
- package/dist/experimental/index.node.cjs +1139 -1075
- package/dist/experimental/index.node.cjs.map +4 -4
- package/dist/i18n/Streami18n.d.ts +1 -1
- package/dist/i18n/types.d.ts +2 -2
- package/dist/i18n/utils.d.ts +1 -1
- package/dist/i18n/utils.js +3 -1
- package/dist/index.browser.cjs +28513 -30641
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +30740 -32877
- package/dist/index.node.cjs.map +4 -4
- package/dist/plugins/Emojis/index.browser.cjs +133 -2
- package/dist/plugins/Emojis/index.browser.cjs.map +4 -4
- package/dist/plugins/Emojis/index.d.ts +1 -0
- package/dist/plugins/Emojis/index.js +1 -0
- package/dist/plugins/Emojis/index.node.cjs +135 -3
- package/dist/plugins/Emojis/index.node.cjs.map +4 -4
- package/dist/plugins/Emojis/middleware/index.d.ts +1 -0
- package/dist/plugins/Emojis/middleware/index.js +1 -0
- package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.d.ts +66 -0
- package/dist/plugins/Emojis/middleware/textComposerEmojiMiddleware.js +143 -0
- package/dist/plugins/encoders/mp3.browser.cjs.map +2 -2
- package/dist/plugins/encoders/mp3.node.cjs.map +2 -2
- package/dist/scss/v2/Autocomplete/Autocomplete-layout.scss +14 -0
- package/dist/scss/v2/Autocomplete/Autocomplete-theme.scss +11 -0
- package/dist/scss/v2/LinkPreview/LinkPreview-layout.scss +18 -0
- package/dist/scss/v2/LinkPreview/LinkPreview-theme.scss +15 -0
- package/dist/types/defaultDataInterfaces.d.ts +25 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types.d.ts +2 -62
- package/dist/utils/getChannel.d.ts +5 -6
- package/dist/utils/mergeDeep.d.ts +2 -3
- package/package.json +5 -5
- package/dist/components/AutoCompleteTextarea/Item.d.ts +0 -2
- package/dist/components/AutoCompleteTextarea/Item.js +0 -10
- package/dist/components/AutoCompleteTextarea/List.d.ts +0 -17
- package/dist/components/AutoCompleteTextarea/List.js +0 -89
- package/dist/components/AutoCompleteTextarea/Textarea.d.ts +0 -114
- package/dist/components/AutoCompleteTextarea/Textarea.js +0 -593
- package/dist/components/AutoCompleteTextarea/index.d.ts +0 -4
- package/dist/components/AutoCompleteTextarea/index.js +0 -4
- package/dist/components/AutoCompleteTextarea/types.d.ts +0 -15
- package/dist/components/AutoCompleteTextarea/utils.d.ts +0 -6
- package/dist/components/AutoCompleteTextarea/utils.js +0 -40
- package/dist/components/ChatAutoComplete/ChatAutoComplete.d.ts +0 -78
- package/dist/components/ChatAutoComplete/ChatAutoComplete.js +0 -33
- package/dist/components/ChatAutoComplete/index.d.ts +0 -1
- package/dist/components/ChatAutoComplete/index.js +0 -1
- package/dist/components/CommandItem/CommandItem.d.ts +0 -12
- package/dist/components/CommandItem/index.d.ts +0 -1
- package/dist/components/CommandItem/index.js +0 -1
- package/dist/components/EmoticonItem/EmoticonItem.js +0 -16
- package/dist/components/EmoticonItem/index.d.ts +0 -1
- package/dist/components/EmoticonItem/index.js +0 -1
- package/dist/components/MessageInput/DefaultTriggerProvider.d.ts +0 -35
- package/dist/components/MessageInput/DefaultTriggerProvider.js +0 -24
- package/dist/components/MessageInput/DropzoneProvider.d.ts +0 -4
- package/dist/components/MessageInput/DropzoneProvider.js +0 -23
- package/dist/components/MessageInput/hooks/useAttachments.d.ts +0 -14
- package/dist/components/MessageInput/hooks/useAttachments.js +0 -209
- package/dist/components/MessageInput/hooks/useCommandTrigger.d.ts +0 -3
- package/dist/components/MessageInput/hooks/useCommandTrigger.js +0 -62
- package/dist/components/MessageInput/hooks/useEmojiTrigger.d.ts +0 -3
- package/dist/components/MessageInput/hooks/useEmojiTrigger.js +0 -29
- package/dist/components/MessageInput/hooks/useLinkPreviews.d.ts +0 -30
- package/dist/components/MessageInput/hooks/useLinkPreviews.js +0 -109
- package/dist/components/MessageInput/hooks/useMessageInputState.d.ts +0 -71
- package/dist/components/MessageInput/hooks/useMessageInputState.js +0 -200
- package/dist/components/MessageInput/hooks/useUserTrigger.d.ts +0 -12
- package/dist/components/MessageInput/hooks/useUserTrigger.js +0 -130
- package/dist/components/MessageInput/types.d.ts +0 -87
- package/dist/components/MessageInput/types.js +0 -19
- package/dist/components/ReactFileUtilities/ImageDropzone.d.ts +0 -16
- package/dist/components/ReactFileUtilities/ImageDropzone.js +0 -42
- package/dist/components/UserItem/UserItem.js +0 -26
- package/dist/components/UserItem/index.d.ts +0 -1
- package/dist/components/UserItem/index.js +0 -1
- /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.d.ts +0 -0
- /package/dist/components/{MessageInput → MediaRecorder/AudioRecorder}/hooks/useTimeElapsed.js +0 -0
- /package/dist/{components/AutoCompleteTextarea/types.js → types/defaultDataInterfaces.js} +0 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import { CustomQueryChannelsFn } from './hooks/usePaginatedChannels';
|
|
4
|
-
import { ChannelPreviewUIComponentProps } from '../ChannelPreview/ChannelPreview';
|
|
5
|
-
import { ChannelSearchProps } from '../ChannelSearch/ChannelSearch';
|
|
6
|
-
import { EmptyStateIndicatorProps } from '../EmptyStateIndicator';
|
|
7
|
-
import { LoadMorePaginatorProps } from '../LoadMore/LoadMorePaginator';
|
|
8
|
-
import { ChatContextValue } from '../../context';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
9
3
|
import type { Channel, ChannelFilters, ChannelOptions, ChannelSort, Event } from 'stream-chat';
|
|
4
|
+
import type { CustomQueryChannelsFn } from './hooks/usePaginatedChannels';
|
|
5
|
+
import type { ChannelListMessengerProps } from './ChannelListMessenger';
|
|
6
|
+
import type { ChannelPreviewUIComponentProps } from '../ChannelPreview/ChannelPreview';
|
|
7
|
+
import type { ChannelSearchProps } from '../ChannelSearch/ChannelSearch';
|
|
8
|
+
import type { EmptyStateIndicatorProps } from '../EmptyStateIndicator';
|
|
9
|
+
import type { LoadMorePaginatorProps } from '../LoadMore/LoadMorePaginator';
|
|
10
|
+
import type { ChatContextValue } from '../../context';
|
|
10
11
|
import type { ChannelAvatarProps } from '../Avatar';
|
|
11
12
|
import type { TranslationContextValue } from '../../context/TranslationContext';
|
|
12
|
-
import type {
|
|
13
|
-
export type ChannelListProps
|
|
13
|
+
import type { PaginatorProps } from '../../types/types';
|
|
14
|
+
export type ChannelListProps = {
|
|
14
15
|
/** Additional props for underlying ChannelSearch component and channel search controller, [available props](https://getstream.io/chat/docs/sdk/react/utility-components/channel_search/#props) */
|
|
15
|
-
additionalChannelSearchProps?: Omit<ChannelSearchProps
|
|
16
|
+
additionalChannelSearchProps?: Omit<ChannelSearchProps, 'setChannels'>;
|
|
16
17
|
/**
|
|
17
18
|
* When the client receives `message.new`, `notification.message_new`, and `notification.added_to_channel` events, we automatically
|
|
18
19
|
* push that channel to the top of the list. If the channel doesn't currently exist in the list, we grab the channel from
|
|
@@ -23,21 +24,21 @@ export type ChannelListProps<StreamChatGenerics extends DefaultStreamChatGeneric
|
|
|
23
24
|
/** UI component to display an avatar, defaults to [Avatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/Avatar.tsx) component and accepts the same props as: [ChannelAvatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/ChannelAvatar.tsx) */
|
|
24
25
|
Avatar?: React.ComponentType<ChannelAvatarProps>;
|
|
25
26
|
/** Optional function to filter channels prior to loading in the DOM. Do not use any complex or async logic that would delay the loading of the ChannelList. We recommend using a pure function with array methods like filter/sort/reduce. */
|
|
26
|
-
channelRenderFilterFn?: (channels: Array<Channel
|
|
27
|
+
channelRenderFilterFn?: (channels: Array<Channel>) => Array<Channel>;
|
|
27
28
|
/** Custom UI component to display search results, defaults to and accepts same props as: [ChannelSearch](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelSearch/ChannelSearch.tsx) */
|
|
28
|
-
ChannelSearch?: React.ComponentType<ChannelSearchProps
|
|
29
|
+
ChannelSearch?: React.ComponentType<ChannelSearchProps>;
|
|
29
30
|
/** Set a channel (with this ID) to active and manually move it to the top of the list */
|
|
30
31
|
customActiveChannel?: string;
|
|
31
32
|
/** Custom function that handles the channel pagination. Has to build query filters, sort and options and query and append channels to the current channels state and update the hasNext pagination flag after each query. */
|
|
32
|
-
customQueryChannels?: CustomQueryChannelsFn
|
|
33
|
+
customQueryChannels?: CustomQueryChannelsFn;
|
|
33
34
|
/** Custom UI component for rendering an empty list, defaults to and accepts same props as: [EmptyStateIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/EmptyStateIndicator/EmptyStateIndicator.tsx) */
|
|
34
35
|
EmptyStateIndicator?: React.ComponentType<EmptyStateIndicatorProps>;
|
|
35
36
|
/** An object containing channel query filters */
|
|
36
|
-
filters?: ChannelFilters
|
|
37
|
+
filters?: ChannelFilters;
|
|
37
38
|
/** Custom function that generates the message preview in ChannelPreview component */
|
|
38
|
-
getLatestMessagePreview?: (channel: Channel
|
|
39
|
+
getLatestMessagePreview?: (channel: Channel, t: TranslationContextValue['t'], userLanguage: TranslationContextValue['userLanguage'], isMessageAIGenerated?: ChatContextValue['isMessageAIGenerated']) => ReactNode;
|
|
39
40
|
/** Custom UI component to display the container for the queried channels, defaults to and accepts same props as: [ChannelListMessenger](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelListMessenger.tsx) */
|
|
40
|
-
List?: React.ComponentType<ChannelListMessengerProps
|
|
41
|
+
List?: React.ComponentType<ChannelListMessengerProps>;
|
|
41
42
|
/** Custom UI component to display the loading error indicator, defaults to component that renders null */
|
|
42
43
|
LoadingErrorIndicator?: React.ComponentType;
|
|
43
44
|
/** Custom UI component to display the loading state, defaults to and accepts same props as: [LoadingChannels](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingChannels.tsx) */
|
|
@@ -45,29 +46,29 @@ export type ChannelListProps<StreamChatGenerics extends DefaultStreamChatGeneric
|
|
|
45
46
|
/** When true, channels won't dynamically sort by most recent message */
|
|
46
47
|
lockChannelOrder?: boolean;
|
|
47
48
|
/** Function to override the default behavior when a user is added to a channel, corresponds to [notification.added\_to\_channel](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
|
|
48
|
-
onAddedToChannel?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
49
|
+
onAddedToChannel?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void;
|
|
49
50
|
/** Function to override the default behavior when a channel is deleted, corresponds to [channel.deleted](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
|
|
50
|
-
onChannelDeleted?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
51
|
+
onChannelDeleted?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void;
|
|
51
52
|
/** Function to override the default behavior when a channel is hidden, corresponds to [channel.hidden](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
|
|
52
|
-
onChannelHidden?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
53
|
+
onChannelHidden?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void;
|
|
53
54
|
/** Function to override the default behavior when a channel is truncated, corresponds to [channel.truncated](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
|
|
54
|
-
onChannelTruncated?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
55
|
+
onChannelTruncated?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void;
|
|
55
56
|
/** Function to override the default behavior when a channel is updated, corresponds to [channel.updated](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
|
|
56
|
-
onChannelUpdated?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
57
|
+
onChannelUpdated?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void;
|
|
57
58
|
/** Function to override the default channel visible behavior, corresponds to [channel.visible](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
|
|
58
|
-
onChannelVisible?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
59
|
+
onChannelVisible?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void;
|
|
59
60
|
/** Function to override the default behavior when a message is received on a channel not being watched, corresponds to [notification.message\_new](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
|
|
60
|
-
onMessageNew?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
61
|
+
onMessageNew?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void;
|
|
61
62
|
/** Function to override the default behavior when a message is received on a channel being watched, handles [message.new](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
|
|
62
|
-
onMessageNewHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
63
|
+
onMessageNewHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void;
|
|
63
64
|
/** Function to override the default behavior when a user gets removed from a channel, corresponds to [notification.removed\_from\_channel](https://getstream.io/chat/docs/javascript/event_object/?language=javascript) event */
|
|
64
|
-
onRemovedFromChannel?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
65
|
+
onRemovedFromChannel?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void;
|
|
65
66
|
/** An object containing channel query options */
|
|
66
67
|
options?: ChannelOptions;
|
|
67
68
|
/** Custom UI component to handle channel pagination logic, defaults to and accepts same props as: [LoadMorePaginator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/LoadMore/LoadMorePaginator.tsx) */
|
|
68
69
|
Paginator?: React.ComponentType<PaginatorProps | LoadMorePaginatorProps>;
|
|
69
70
|
/** Custom UI component to display the channel preview in the list, defaults to and accepts same props as: [ChannelPreviewMessenger](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelPreview/ChannelPreviewMessenger.tsx) */
|
|
70
|
-
Preview?: React.ComponentType<ChannelPreviewUIComponentProps
|
|
71
|
+
Preview?: React.ComponentType<ChannelPreviewUIComponentProps>;
|
|
71
72
|
/**
|
|
72
73
|
* Custom interval during which the recovery channel list queries will be prevented.
|
|
73
74
|
* This is to avoid firing unnecessary queries during internet connection fluctuation.
|
|
@@ -76,7 +77,7 @@ export type ChannelListProps<StreamChatGenerics extends DefaultStreamChatGeneric
|
|
|
76
77
|
*/
|
|
77
78
|
recoveryThrottleIntervalMs?: number;
|
|
78
79
|
/** Function to override the default behavior when rendering channels, so this function is called instead of rendering the Preview directly */
|
|
79
|
-
renderChannels?: (channels: Channel
|
|
80
|
+
renderChannels?: (channels: Channel[], channelPreview: (item: Channel) => React.ReactNode) => React.ReactNode;
|
|
80
81
|
/** If true, sends the list's currently loaded channels to the `List` component as the `loadedChannels` prop */
|
|
81
82
|
sendChannelsToList?: boolean;
|
|
82
83
|
/** Last channel will be set as active channel if true, defaults to true */
|
|
@@ -84,7 +85,7 @@ export type ChannelListProps<StreamChatGenerics extends DefaultStreamChatGeneric
|
|
|
84
85
|
/** Whether or not to load the list with a search component, defaults to false */
|
|
85
86
|
showChannelSearch?: boolean;
|
|
86
87
|
/** An object containing channel query sort parameters */
|
|
87
|
-
sort?: ChannelSort
|
|
88
|
+
sort?: ChannelSort;
|
|
88
89
|
/** An object containing query parameters for fetching channel watchers */
|
|
89
90
|
watchers?: {
|
|
90
91
|
limit?: number;
|
|
@@ -94,4 +95,4 @@ export type ChannelListProps<StreamChatGenerics extends DefaultStreamChatGeneric
|
|
|
94
95
|
/**
|
|
95
96
|
* Renders a preview list of Channels, allowing you to select the Channel you want to open
|
|
96
97
|
*/
|
|
97
|
-
export declare const ChannelList:
|
|
98
|
+
export declare const ChannelList: (props: ChannelListProps) => React.JSX.Element;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { ChannelListMessenger } from './ChannelListMessenger';
|
|
4
3
|
import { useConnectionRecoveredListener } from './hooks/useConnectionRecoveredListener';
|
|
5
4
|
import { useMobileNavigation } from './hooks/useMobileNavigation';
|
|
6
|
-
import { usePaginatedChannels
|
|
5
|
+
import { usePaginatedChannels } from './hooks/usePaginatedChannels';
|
|
7
6
|
import { useChannelListShape, usePrepareShapeHandlers, } from './hooks/useChannelListShape';
|
|
8
|
-
import {
|
|
7
|
+
import { useStateStore } from '../../store';
|
|
8
|
+
import { ChannelListMessenger } from './ChannelListMessenger';
|
|
9
9
|
import { Avatar as DefaultAvatar } from '../Avatar';
|
|
10
|
-
import { ChannelPreview
|
|
11
|
-
import { ChannelSearch as DefaultChannelSearch
|
|
12
|
-
import { EmptyStateIndicator as DefaultEmptyStateIndicator
|
|
10
|
+
import { ChannelPreview } from '../ChannelPreview/ChannelPreview';
|
|
11
|
+
import { ChannelSearch as DefaultChannelSearch } from '../ChannelSearch/ChannelSearch';
|
|
12
|
+
import { EmptyStateIndicator as DefaultEmptyStateIndicator } from '../EmptyStateIndicator';
|
|
13
13
|
import { LoadingChannels } from '../Loading/LoadingChannels';
|
|
14
14
|
import { LoadMorePaginator } from '../LoadMore/LoadMorePaginator';
|
|
15
|
+
import { ChannelListContextProvider, useChatContext, useComponentContext, } from '../../context';
|
|
15
16
|
import { NullComponent } from '../UtilityComponents';
|
|
16
|
-
import {
|
|
17
|
-
import { useChatContext } from '../../context/ChatContext';
|
|
18
|
-
import { useStateStore } from '../../store';
|
|
17
|
+
import { MAX_QUERY_CHANNELS_LIMIT, moveChannelUpwards } from './utils';
|
|
19
18
|
const DEFAULT_FILTERS = {};
|
|
20
19
|
const DEFAULT_OPTIONS = {};
|
|
21
20
|
const DEFAULT_SORT = {};
|
|
@@ -44,7 +43,6 @@ const UnMemoizedChannelList = (props) => {
|
|
|
44
43
|
// FIXME: this is wrong...
|
|
45
44
|
let customActiveChannelObject = channels.find((chan) => chan.id === customActiveChannel);
|
|
46
45
|
if (!customActiveChannelObject) {
|
|
47
|
-
//@ts-expect-error valid query
|
|
48
46
|
[customActiveChannelObject] = await client.queryChannels({
|
|
49
47
|
id: customActiveChannel,
|
|
50
48
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
2
3
|
import type { APIErrorResponse, Channel, ErrorFromResponse } from 'stream-chat';
|
|
3
|
-
|
|
4
|
-
export type ChannelListMessengerProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
4
|
+
export type ChannelListMessengerProps = {
|
|
5
5
|
/** Whether the channel query request returned an errored response */
|
|
6
6
|
error: ErrorFromResponse<APIErrorResponse> | null;
|
|
7
7
|
/** The channels currently loaded in the list, only defined if `sendChannelsToList` on `ChannelList` is true */
|
|
8
|
-
loadedChannels?: Channel
|
|
8
|
+
loadedChannels?: Channel[];
|
|
9
9
|
/** Whether the channels are currently loading */
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
/** Custom UI component to display the loading error indicator, defaults to component that renders null */
|
|
@@ -13,9 +13,9 @@ export type ChannelListMessengerProps<StreamChatGenerics extends DefaultStreamCh
|
|
|
13
13
|
/** Custom UI component to display a loading indicator, defaults to and accepts same props as: [LoadingChannels](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingChannels.tsx) */
|
|
14
14
|
LoadingIndicator?: React.ComponentType;
|
|
15
15
|
/** Local state hook that resets the currently loaded channels */
|
|
16
|
-
setChannels?: React.Dispatch<React.SetStateAction<Channel
|
|
16
|
+
setChannels?: React.Dispatch<React.SetStateAction<Channel[]>>;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* A preview list of channels, allowing you to select the channel you want to open
|
|
20
20
|
*/
|
|
21
|
-
export declare const ChannelListMessenger:
|
|
21
|
+
export declare const ChannelListMessenger: (props: PropsWithChildren<ChannelListMessengerProps>) => React.JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel, Event } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useChannelDeletedListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, event: Event<StreamChatGenerics>) => void) => void;
|
|
2
|
+
export declare const useChannelDeletedListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void) => void;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel, Event } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useChannelHiddenListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, event: Event<StreamChatGenerics>) => void) => void;
|
|
2
|
+
export declare const useChannelHiddenListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void) => void;
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ChannelListProps } from '../ChannelList';
|
|
4
|
-
type SetChannels
|
|
5
|
-
type BaseParameters
|
|
6
|
-
event: Event
|
|
7
|
-
setChannels: SetChannels
|
|
1
|
+
import type { Channel, Event } from 'stream-chat';
|
|
2
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
import type { ChannelListProps } from '../ChannelList';
|
|
4
|
+
type SetChannels = Dispatch<SetStateAction<Channel[]>>;
|
|
5
|
+
type BaseParameters = {
|
|
6
|
+
event: Event;
|
|
7
|
+
setChannels: SetChannels;
|
|
8
8
|
};
|
|
9
|
-
type RepeatedParameters
|
|
10
|
-
customHandler?: (setChannels: BaseParameters
|
|
9
|
+
type RepeatedParameters = {
|
|
10
|
+
customHandler?: (setChannels: BaseParameters['setChannels'], event: BaseParameters['event']) => void;
|
|
11
11
|
};
|
|
12
|
-
type HandleMessageNewParameters
|
|
12
|
+
type HandleMessageNewParameters = BaseParameters & RepeatedParameters & {
|
|
13
13
|
allowNewMessagesFromUnfilteredChannels: boolean;
|
|
14
14
|
lockChannelOrder: boolean;
|
|
15
|
-
} & Required<Pick<ChannelListProps
|
|
16
|
-
type HandleNotificationMessageNewParameters
|
|
15
|
+
} & Required<Pick<ChannelListProps, 'filters' | 'sort'>>;
|
|
16
|
+
type HandleNotificationMessageNewParameters = BaseParameters & RepeatedParameters & {
|
|
17
17
|
allowNewMessagesFromUnfilteredChannels: boolean;
|
|
18
18
|
lockChannelOrder: boolean;
|
|
19
|
-
} & Required<Pick<ChannelListProps
|
|
20
|
-
type HandleNotificationRemovedFromChannelParameters
|
|
21
|
-
type HandleNotificationAddedToChannelParameters
|
|
19
|
+
} & Required<Pick<ChannelListProps, 'filters' | 'sort'>>;
|
|
20
|
+
type HandleNotificationRemovedFromChannelParameters = BaseParameters & RepeatedParameters;
|
|
21
|
+
type HandleNotificationAddedToChannelParameters = BaseParameters & RepeatedParameters & {
|
|
22
22
|
allowNewMessagesFromUnfilteredChannels: boolean;
|
|
23
23
|
lockChannelOrder: boolean;
|
|
24
|
-
} & Required<Pick<ChannelListProps
|
|
25
|
-
type
|
|
24
|
+
} & Required<Pick<ChannelListProps, 'sort'>>;
|
|
25
|
+
type HandleChannelVisibleParameters = BaseParameters & RepeatedParameters & Required<Pick<ChannelListProps, 'sort' | 'filters'>>;
|
|
26
|
+
type HandleMemberUpdatedParameters = BaseParameters & {
|
|
26
27
|
lockChannelOrder: boolean;
|
|
27
|
-
} & Required<Pick<ChannelListProps
|
|
28
|
-
type HandleChannelDeletedParameters
|
|
29
|
-
type HandleChannelHiddenParameters
|
|
30
|
-
type
|
|
31
|
-
type
|
|
32
|
-
type
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
handleUserPresenceChanged: ({ event, setChannels }: HandleUserPresenceChangedParameters<SCG>) => void;
|
|
28
|
+
} & Required<Pick<ChannelListProps, 'sort' | 'filters'>>;
|
|
29
|
+
type HandleChannelDeletedParameters = BaseParameters & RepeatedParameters;
|
|
30
|
+
type HandleChannelHiddenParameters = BaseParameters & RepeatedParameters;
|
|
31
|
+
type HandleChannelTruncatedParameters = BaseParameters & RepeatedParameters;
|
|
32
|
+
type HandleChannelUpdatedParameters = BaseParameters & RepeatedParameters;
|
|
33
|
+
type HandleUserPresenceChangedParameters = BaseParameters;
|
|
34
|
+
export declare const useChannelListShapeDefaults: () => {
|
|
35
|
+
handleChannelDeleted: (p: HandleChannelDeletedParameters) => void;
|
|
36
|
+
handleChannelHidden: (p: HandleChannelHiddenParameters) => void;
|
|
37
|
+
handleChannelTruncated: ({ customHandler, event, setChannels }: HandleChannelTruncatedParameters) => void;
|
|
38
|
+
handleChannelUpdated: ({ customHandler, event, setChannels }: HandleChannelUpdatedParameters) => void;
|
|
39
|
+
handleChannelVisible: ({ customHandler, event, filters, setChannels, sort, }: HandleChannelVisibleParameters) => Promise<void>;
|
|
40
|
+
handleMemberUpdated: ({ event, filters, lockChannelOrder, setChannels, sort, }: HandleMemberUpdatedParameters) => void;
|
|
41
|
+
handleMessageNew: ({ allowNewMessagesFromUnfilteredChannels, customHandler, event, filters, lockChannelOrder, setChannels, sort, }: HandleMessageNewParameters) => void;
|
|
42
|
+
handleNotificationAddedToChannel: ({ allowNewMessagesFromUnfilteredChannels, customHandler, event, setChannels, sort, }: HandleNotificationAddedToChannelParameters) => Promise<void>;
|
|
43
|
+
handleNotificationMessageNew: ({ allowNewMessagesFromUnfilteredChannels, customHandler, event, filters, setChannels, sort, }: HandleNotificationMessageNewParameters) => Promise<void>;
|
|
44
|
+
handleNotificationRemovedFromChannel: ({ customHandler, event, setChannels, }: HandleNotificationRemovedFromChannelParameters) => void;
|
|
45
|
+
handleUserPresenceChanged: ({ event, setChannels }: HandleUserPresenceChangedParameters) => void;
|
|
46
46
|
};
|
|
47
|
-
type UseDefaultHandleChannelListShapeParameters
|
|
48
|
-
setChannels: SetChannels
|
|
47
|
+
type UseDefaultHandleChannelListShapeParameters = Required<Pick<ChannelListProps, 'allowNewMessagesFromUnfilteredChannels' | 'lockChannelOrder' | 'filters' | 'sort'>> & Pick<ChannelListProps, 'onAddedToChannel' | 'onChannelDeleted' | 'onChannelHidden' | 'onChannelTruncated' | 'onChannelUpdated' | 'onChannelVisible' | 'onMessageNew' | 'onMessageNewHandler' | 'onRemovedFromChannel'> & {
|
|
48
|
+
setChannels: SetChannels;
|
|
49
49
|
customHandleChannelListShape?: (data: {
|
|
50
50
|
defaults: ReturnType<typeof useChannelListShapeDefaults>;
|
|
51
|
-
event: Event
|
|
52
|
-
setChannels: SetChannels
|
|
51
|
+
event: Event;
|
|
52
|
+
setChannels: SetChannels;
|
|
53
53
|
}) => void;
|
|
54
54
|
};
|
|
55
|
-
export declare const usePrepareShapeHandlers:
|
|
56
|
-
customHandler: ((e: Event
|
|
57
|
-
defaultHandler: (e: Event
|
|
55
|
+
export declare const usePrepareShapeHandlers: ({ allowNewMessagesFromUnfilteredChannels, customHandleChannelListShape, filters, lockChannelOrder, onAddedToChannel, onChannelDeleted, onChannelHidden, onChannelTruncated, onChannelUpdated, onChannelVisible, onMessageNew, onMessageNewHandler, onRemovedFromChannel, setChannels, sort, }: UseDefaultHandleChannelListShapeParameters) => {
|
|
56
|
+
customHandler: ((e: Event) => void) | null;
|
|
57
|
+
defaultHandler: (e: Event) => void;
|
|
58
58
|
};
|
|
59
|
-
export declare const useChannelListShape:
|
|
59
|
+
export declare const useChannelListShape: (handler: (e: Event) => void) => void;
|
|
60
60
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// const defaults = useChannelListShapeDefaults();
|
|
2
1
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
2
|
import { extractSortValue, findLastPinnedChannelIndex, isChannelArchived, isChannelPinned, moveChannelUpwards, shouldConsiderArchivedChannels, shouldConsiderPinnedChannels, } from '../utils';
|
|
4
3
|
import { useChatContext } from '../../../context';
|
|
@@ -258,7 +257,6 @@ export const usePrepareShapeHandlers = ({ allowNewMessagesFromUnfilteredChannels
|
|
|
258
257
|
const defaultHandleChannelListShapeRef = useRef(undefined);
|
|
259
258
|
const customHandleChannelListShapeRef = useRef(undefined);
|
|
260
259
|
customHandleChannelListShapeRef.current = (event) => {
|
|
261
|
-
// @ts-expect-error can't use ReturnType<typeof useChannelListShapeDefaults<SCG>> until we upgrade prettier to at least v2.7.0
|
|
262
260
|
customHandleChannelListShape?.({ defaults, event, setChannels });
|
|
263
261
|
};
|
|
264
262
|
defaultHandleChannelListShapeRef.current = (event) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Channel, ChannelMemberResponse
|
|
2
|
-
export declare function useChannelMembershipState
|
|
3
|
-
export declare function useChannelMembershipState
|
|
1
|
+
import type { Channel, ChannelMemberResponse } from 'stream-chat';
|
|
2
|
+
export declare function useChannelMembershipState(channel: Channel): ChannelMemberResponse;
|
|
3
|
+
export declare function useChannelMembershipState(channel?: Channel | undefined): ChannelMemberResponse | undefined;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel, Event } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useChannelTruncatedListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, event: Event<StreamChatGenerics>) => void, forceUpdate?: () => void) => void;
|
|
2
|
+
export declare const useChannelTruncatedListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void, forceUpdate?: () => void) => void;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel, Event } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useChannelUpdatedListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, event: Event<StreamChatGenerics>) => void, forceUpdate?: () => void) => void;
|
|
2
|
+
export declare const useChannelUpdatedListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void, forceUpdate?: () => void) => void;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel, Event } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useChannelVisibleListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, event: Event<StreamChatGenerics>) => void) => void;
|
|
2
|
+
export declare const useChannelVisibleListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void) => void;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const useConnectionRecoveredListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(forceUpdate?: () => void) => void;
|
|
1
|
+
export declare const useConnectionRecoveredListener: (forceUpdate?: () => void) => void;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel, Event } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useMessageNewListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, event: Event<StreamChatGenerics>) => void, lockChannelOrder?: boolean, allowNewMessagesFromUnfilteredChannels?: boolean) => void;
|
|
2
|
+
export declare const useMessageNewListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void, lockChannelOrder?: boolean, allowNewMessagesFromUnfilteredChannels?: boolean) => void;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel, Event } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useNotificationAddedToChannelListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, event: Event<StreamChatGenerics>) => void, allowNewMessagesFromUnfilteredChannels?: boolean) => void;
|
|
2
|
+
export declare const useNotificationAddedToChannelListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void, allowNewMessagesFromUnfilteredChannels?: boolean) => void;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel, Event } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useNotificationMessageNewListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, event: Event<StreamChatGenerics>) => void, allowNewMessagesFromUnfilteredChannels?: boolean) => void;
|
|
2
|
+
export declare const useNotificationMessageNewListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void, allowNewMessagesFromUnfilteredChannels?: boolean) => void;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel, Event } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useNotificationRemovedFromChannelListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>, event: Event<StreamChatGenerics>) => void) => void;
|
|
2
|
+
export declare const useNotificationRemovedFromChannelListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, customHandler?: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>, event: Event) => void) => void;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Channel, ChannelFilters, ChannelOptions, ChannelSort, StreamChat } from 'stream-chat';
|
|
3
|
-
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
4
3
|
import type { ChannelsQueryState } from '../../Chat/hooks/useChannelsQueryState';
|
|
5
4
|
type AllowedQueryType = Extract<ChannelsQueryState['queryInProgress'], 'reload' | 'load-more'>;
|
|
6
|
-
export type CustomQueryChannelParams
|
|
7
|
-
currentChannels: Array<Channel
|
|
5
|
+
export type CustomQueryChannelParams = {
|
|
6
|
+
currentChannels: Array<Channel>;
|
|
8
7
|
queryType: AllowedQueryType;
|
|
9
|
-
setChannels: React.Dispatch<React.SetStateAction<Array<Channel
|
|
8
|
+
setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>;
|
|
10
9
|
setHasNextPage: React.Dispatch<React.SetStateAction<boolean>>;
|
|
11
10
|
};
|
|
12
|
-
export type CustomQueryChannelsFn
|
|
13
|
-
export declare const usePaginatedChannels:
|
|
14
|
-
channels: Channel
|
|
11
|
+
export type CustomQueryChannelsFn = (params: CustomQueryChannelParams) => Promise<void>;
|
|
12
|
+
export declare const usePaginatedChannels: (client: StreamChat, filters: ChannelFilters, sort: ChannelSort, options: ChannelOptions, activeChannelHandler: (channels: Array<Channel>, setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>) => void, recoveryThrottleIntervalMs?: number, customQueryChannels?: CustomQueryChannelsFn) => {
|
|
13
|
+
channels: Channel[];
|
|
15
14
|
hasNextPage: boolean;
|
|
16
15
|
loadNextPage: () => void;
|
|
17
|
-
setChannels: import("react").Dispatch<import("react").SetStateAction<Channel
|
|
16
|
+
setChannels: import("react").Dispatch<import("react").SetStateAction<Channel[]>>;
|
|
18
17
|
};
|
|
19
18
|
export {};
|
|
@@ -52,9 +52,9 @@ export const usePaginatedChannels = (client, filters, sort, options, activeChann
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
catch (
|
|
56
|
-
console.warn(
|
|
57
|
-
setError(
|
|
55
|
+
catch (error) {
|
|
56
|
+
console.warn(error);
|
|
57
|
+
setError(error);
|
|
58
58
|
}
|
|
59
59
|
setQueryInProgress(null);
|
|
60
60
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Channel, EventTypes
|
|
2
|
-
export declare function useSelectedChannelState<
|
|
3
|
-
channel: Channel
|
|
4
|
-
selector: (channel: Channel
|
|
1
|
+
import type { Channel, EventTypes } from 'stream-chat';
|
|
2
|
+
export declare function useSelectedChannelState<O>(_: {
|
|
3
|
+
channel: Channel;
|
|
4
|
+
selector: (channel: Channel) => O;
|
|
5
5
|
stateChangeEventKeys?: EventTypes[];
|
|
6
6
|
}): O;
|
|
7
|
-
export declare function useSelectedChannelState<
|
|
8
|
-
selector: (channel: Channel
|
|
9
|
-
channel?: Channel
|
|
7
|
+
export declare function useSelectedChannelState<O>(_: {
|
|
8
|
+
selector: (channel: Channel) => O;
|
|
9
|
+
channel?: Channel | undefined;
|
|
10
10
|
stateChangeEventKeys?: EventTypes[];
|
|
11
11
|
}): O | undefined;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Channel } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useUserPresenceChangedListener: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(setChannels: React.Dispatch<React.SetStateAction<Array<Channel<StreamChatGenerics>>>>) => void;
|
|
2
|
+
export declare const useUserPresenceChangedListener: (setChannels: React.Dispatch<React.SetStateAction<Array<Channel>>>) => void;
|
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
import type { Channel, ChannelSort, ChannelSortBase
|
|
2
|
-
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
1
|
+
import type { Channel, ChannelSort, ChannelSortBase } from 'stream-chat';
|
|
3
2
|
import type { ChannelListProps } from './ChannelList';
|
|
4
3
|
export declare const MAX_QUERY_CHANNELS_LIMIT = 30;
|
|
5
|
-
type MoveChannelUpParams
|
|
6
|
-
channels: Array<Channel
|
|
4
|
+
type MoveChannelUpParams = {
|
|
5
|
+
channels: Array<Channel>;
|
|
7
6
|
cid: string;
|
|
8
|
-
activeChannel?: Channel
|
|
7
|
+
activeChannel?: Channel;
|
|
9
8
|
};
|
|
10
9
|
/**
|
|
11
10
|
* @deprecated
|
|
12
11
|
*/
|
|
13
|
-
export declare const moveChannelUp:
|
|
12
|
+
export declare const moveChannelUp: ({ activeChannel, channels, cid }: MoveChannelUpParams) => Channel[];
|
|
14
13
|
/**
|
|
15
14
|
* Expects channel array sorted by `{ pinned_at: -1 }`.
|
|
16
15
|
*
|
|
17
16
|
* TODO: add support for the `{ pinned_at: 1 }`
|
|
18
17
|
*/
|
|
19
|
-
export declare function findLastPinnedChannelIndex
|
|
20
|
-
channels: Channel
|
|
18
|
+
export declare function findLastPinnedChannelIndex({ channels }: {
|
|
19
|
+
channels: Channel[];
|
|
21
20
|
}): number | null;
|
|
22
|
-
type MoveChannelUpwardsParams
|
|
23
|
-
channels: Array<Channel
|
|
24
|
-
channelToMove: Channel
|
|
25
|
-
sort: ChannelSort
|
|
21
|
+
type MoveChannelUpwardsParams = {
|
|
22
|
+
channels: Array<Channel>;
|
|
23
|
+
channelToMove: Channel;
|
|
24
|
+
sort: ChannelSort;
|
|
26
25
|
/**
|
|
27
26
|
* If the index of the channel within `channels` list which is being moved upwards
|
|
28
27
|
* (`channelToMove`) is known, you can supply it to skip extra calculation.
|
|
29
28
|
*/
|
|
30
29
|
channelToMoveIndexWithinChannels?: number;
|
|
31
30
|
};
|
|
32
|
-
export declare const moveChannelUpwards:
|
|
31
|
+
export declare const moveChannelUpwards: ({ channels, channelToMove, channelToMoveIndexWithinChannels, sort, }: MoveChannelUpwardsParams) => Channel[];
|
|
33
32
|
/**
|
|
34
33
|
* Returns `true` only if object with `pinned_at` property is first within the `sort` array
|
|
35
34
|
* or if `pinned_at` key of the `sort` object gets picked first when using `for...in` looping mechanism
|
|
36
35
|
* and value of the `pinned_at` is either `1` or `-1`.
|
|
37
36
|
*/
|
|
38
|
-
export declare const shouldConsiderPinnedChannels:
|
|
39
|
-
export declare const extractSortValue:
|
|
37
|
+
export declare const shouldConsiderPinnedChannels: (sort: ChannelListProps['sort']) => boolean;
|
|
38
|
+
export declare const extractSortValue: ({ atIndex, sort, targetKey, }: {
|
|
40
39
|
atIndex: number;
|
|
41
|
-
targetKey: keyof ChannelSortBase
|
|
42
|
-
sort?: ChannelListProps
|
|
43
|
-
}) =>
|
|
40
|
+
targetKey: keyof ChannelSortBase;
|
|
41
|
+
sort?: ChannelListProps['sort'];
|
|
42
|
+
}) => import("stream-chat").AscDesc | null;
|
|
44
43
|
/**
|
|
45
44
|
* Returns `true` only if `archived` property is of type `boolean` within `filters` object.
|
|
46
45
|
*/
|
|
47
|
-
export declare const shouldConsiderArchivedChannels:
|
|
46
|
+
export declare const shouldConsiderArchivedChannels: (filters: ChannelListProps['filters']) => boolean;
|
|
48
47
|
/**
|
|
49
48
|
* Returns `true` only if `pinned_at` property is of type `string` within `membership` object.
|
|
50
49
|
*/
|
|
51
|
-
export declare const isChannelPinned:
|
|
50
|
+
export declare const isChannelPinned: (channel: Channel) => boolean;
|
|
52
51
|
/**
|
|
53
52
|
* Returns `true` only if `archived_at` property is of type `string` within `membership` object.
|
|
54
53
|
*/
|
|
55
|
-
export declare const isChannelArchived:
|
|
54
|
+
export declare const isChannelArchived: (channel: Channel) => boolean;
|
|
56
55
|
export {};
|
|
@@ -3,7 +3,7 @@ export const MAX_QUERY_CHANNELS_LIMIT = 30;
|
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated
|
|
5
5
|
*/
|
|
6
|
-
export const moveChannelUp = ({ activeChannel, channels, cid
|
|
6
|
+
export const moveChannelUp = ({ activeChannel, channels, cid }) => {
|
|
7
7
|
// get index of channel to move up
|
|
8
8
|
const channelIndex = channels.findIndex((channel) => channel.cid === cid);
|
|
9
9
|
if (!activeChannel && channelIndex <= 0)
|
|
@@ -17,7 +17,7 @@ export const moveChannelUp = ({ activeChannel, channels, cid, }) => {
|
|
|
17
17
|
*
|
|
18
18
|
* TODO: add support for the `{ pinned_at: 1 }`
|
|
19
19
|
*/
|
|
20
|
-
export function findLastPinnedChannelIndex({ channels
|
|
20
|
+
export function findLastPinnedChannelIndex({ channels }) {
|
|
21
21
|
let lastPinnedChannelIndex = null;
|
|
22
22
|
for (const channel of channels) {
|
|
23
23
|
if (!isChannelPinned(channel))
|