stream-chat-react 12.13.1 → 13.0.0-rc.1
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 +27 -30
- 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 -37
- package/dist/components/Channel/Channel.js +31 -92
- 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 +4 -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/MessageBlocked.d.ts +2 -0
- package/dist/components/Message/MessageBlocked.js +16 -0
- 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 +14 -12
- 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 -21
- package/dist/components/Message/utils.js +8 -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 +25 -15
- package/dist/components/MessageInput/MessageInputFlat.d.ts +1 -2
- package/dist/components/MessageInput/MessageInputFlat.js +31 -76
- 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 +38 -0
- package/dist/components/MessageInput/WithDragAndDropUpload.js +96 -0
- 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 +1 -2
- package/dist/components/MessageInput/index.js +1 -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/{CommandItem → TextareaComposer/SuggestionList}/CommandItem.d.ts +2 -1
- 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 +16 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionList.js +49 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.d.ts +18 -0
- package/dist/components/TextareaComposer/SuggestionList/SuggestionListItem.js +25 -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 +41 -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/MessageInputContext.js +3 -2
- 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 +2 -1
- package/dist/i18n/de.json +1 -0
- package/dist/i18n/en.json +1 -0
- package/dist/i18n/es.json +1 -0
- package/dist/i18n/fr.json +1 -0
- package/dist/i18n/hi.json +1 -0
- package/dist/i18n/it.json +1 -0
- package/dist/i18n/ja.json +1 -0
- package/dist/i18n/ko.json +1 -0
- package/dist/i18n/nl.json +1 -0
- package/dist/i18n/pt.json +1 -0
- package/dist/i18n/ru.json +1 -0
- package/dist/i18n/tr.json +1 -0
- 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 +28774 -30813
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +30798 -32844
- package/dist/index.node.cjs.map +4 -4
- package/dist/plugins/Emojis/index.browser.cjs +133 -5
- 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 -6
- 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/DropzoneContainer/DropzoneContainer-layout.scss +14 -0
- package/dist/scss/v2/DropzoneContainer/DropzoneContainer-theme.scss +17 -0
- package/dist/scss/v2/LinkPreview/LinkPreview-layout.scss +18 -0
- package/dist/scss/v2/LinkPreview/LinkPreview-theme.scss +15 -0
- package/dist/scss/v2/Message/Message-layout.scss +8 -0
- package/dist/scss/v2/Message/Message-theme.scss +29 -0
- package/dist/scss/v2/MessageInput/MessageInput-layout.scss +0 -13
- package/dist/scss/v2/MessageInput/MessageInput-theme.scss +8 -19
- package/dist/scss/v2/index.layout.scss +2 -1
- package/dist/scss/v2/index.scss +1 -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 +8 -11
- 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/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/scss/v2/DragAndDropContainer/{DragAmdDropContainer-layout.scss → DragAndDropContainer-layout.scss} +0 -0
- /package/dist/{components/AutoCompleteTextarea/types.js → types/defaultDataInterfaces.js} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { Channel, LocalMessage } from 'stream-chat';
|
|
4
|
+
import type { MessageDeliveryStatus } from './hooks/useMessageDeliveryStatus';
|
|
5
|
+
import type { ChatContextValue } from '../../context/ChatContext';
|
|
5
6
|
import type { ChannelAvatarProps } from '../Avatar/ChannelAvatar';
|
|
6
7
|
import type { GroupChannelDisplayInfo } from './utils';
|
|
7
|
-
import type { StreamMessage } from '../../context/ChannelStateContext';
|
|
8
8
|
import type { TranslationContextValue } from '../../context/TranslationContext';
|
|
9
|
-
|
|
10
|
-
export type ChannelPreviewUIComponentProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = ChannelPreviewProps<StreamChatGenerics> & {
|
|
9
|
+
export type ChannelPreviewUIComponentProps = ChannelPreviewProps & {
|
|
11
10
|
/** Image of Channel to display */
|
|
12
11
|
displayImage?: string;
|
|
13
12
|
/** Title of Channel to display */
|
|
@@ -15,7 +14,7 @@ export type ChannelPreviewUIComponentProps<StreamChatGenerics extends DefaultStr
|
|
|
15
14
|
/** Title of Channel to display */
|
|
16
15
|
groupChannelDisplayInfo?: GroupChannelDisplayInfo;
|
|
17
16
|
/** The last message received in a channel */
|
|
18
|
-
lastMessage?:
|
|
17
|
+
lastMessage?: LocalMessage;
|
|
19
18
|
/** @deprecated Use latestMessagePreview prop instead. */
|
|
20
19
|
latestMessage?: ReactNode;
|
|
21
20
|
/** Latest message preview to display, will be a string or JSX element supporting markdown. */
|
|
@@ -25,32 +24,32 @@ export type ChannelPreviewUIComponentProps<StreamChatGenerics extends DefaultStr
|
|
|
25
24
|
/** Number of unread Messages */
|
|
26
25
|
unread?: number;
|
|
27
26
|
};
|
|
28
|
-
export type ChannelPreviewProps
|
|
27
|
+
export type ChannelPreviewProps = {
|
|
29
28
|
/** Comes from either the `channelRenderFilterFn` or `usePaginatedChannels` call from [ChannelList](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelList.tsx) */
|
|
30
|
-
channel: Channel
|
|
29
|
+
channel: Channel;
|
|
31
30
|
/** If the component's channel is the active (selected) Channel */
|
|
32
31
|
active?: boolean;
|
|
33
32
|
/** Current selected channel object */
|
|
34
|
-
activeChannel?: Channel
|
|
33
|
+
activeChannel?: Channel;
|
|
35
34
|
/** 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) */
|
|
36
|
-
Avatar?: React.ComponentType<ChannelAvatarProps
|
|
35
|
+
Avatar?: React.ComponentType<ChannelAvatarProps>;
|
|
37
36
|
/** Forces the update of preview component on channel update */
|
|
38
37
|
channelUpdateCount?: number;
|
|
39
38
|
/** Custom class for the channel preview root */
|
|
40
39
|
className?: string;
|
|
41
40
|
/** Custom function that generates the message preview in ChannelPreview component */
|
|
42
|
-
getLatestMessagePreview?: (channel: Channel
|
|
41
|
+
getLatestMessagePreview?: (channel: Channel, t: TranslationContextValue['t'], userLanguage: TranslationContextValue['userLanguage'], isMessageAIGenerated: ChatContextValue['isMessageAIGenerated']) => ReactNode;
|
|
43
42
|
key?: string;
|
|
44
43
|
/** Custom ChannelPreview click handler function */
|
|
45
44
|
onSelect?: (event: React.MouseEvent) => void;
|
|
46
45
|
/** 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) */
|
|
47
|
-
Preview?: React.ComponentType<ChannelPreviewUIComponentProps
|
|
46
|
+
Preview?: React.ComponentType<ChannelPreviewUIComponentProps>;
|
|
48
47
|
/** Setter for selected Channel */
|
|
49
|
-
setActiveChannel?: ChatContextValue
|
|
48
|
+
setActiveChannel?: ChatContextValue['setActiveChannel'];
|
|
50
49
|
/** Object containing watcher parameters */
|
|
51
50
|
watchers?: {
|
|
52
51
|
limit?: number;
|
|
53
52
|
offset?: number;
|
|
54
53
|
};
|
|
55
54
|
};
|
|
56
|
-
export declare const ChannelPreview:
|
|
55
|
+
export declare const ChannelPreview: (props: ChannelPreviewProps) => React.JSX.Element | null;
|
|
@@ -6,7 +6,7 @@ import { useChannelPreviewInfo } from './hooks/useChannelPreviewInfo';
|
|
|
6
6
|
import { getLatestMessagePreview as defaultGetLatestMessagePreview } from './utils';
|
|
7
7
|
import { useChatContext } from '../../context/ChatContext';
|
|
8
8
|
import { useTranslationContext } from '../../context/TranslationContext';
|
|
9
|
-
import { useMessageDeliveryStatus
|
|
9
|
+
import { useMessageDeliveryStatus } from './hooks/useMessageDeliveryStatus';
|
|
10
10
|
export const ChannelPreview = (props) => {
|
|
11
11
|
const { active, channel, channelUpdateCount, getLatestMessagePreview = defaultGetLatestMessagePreview, Preview = ChannelPreviewMessenger, } = props;
|
|
12
12
|
const { channel: activeChannel, client, isMessageAIGenerated, setActiveChannel, } = useChatContext('ChannelPreview');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Channel
|
|
3
|
-
export type ChannelPreviewActionButtonsProps
|
|
4
|
-
channel: Channel
|
|
2
|
+
import type { Channel } from 'stream-chat';
|
|
3
|
+
export type ChannelPreviewActionButtonsProps = {
|
|
4
|
+
channel: Channel;
|
|
5
5
|
};
|
|
6
|
-
export declare function ChannelPreviewActionButtons
|
|
6
|
+
export declare function ChannelPreviewActionButtons({ channel, }: ChannelPreviewActionButtonsProps): React.JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ChannelPreviewUIComponentProps } from './ChannelPreview';
|
|
3
|
-
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
4
3
|
/**
|
|
5
4
|
* Used as preview component for channel item in [ChannelList](#channellist) component.
|
|
6
5
|
* Its best suited for messenger type chat.
|
|
7
6
|
*/
|
|
8
|
-
export declare const ChannelPreviewMessenger:
|
|
7
|
+
export declare const ChannelPreviewMessenger: (props: ChannelPreviewUIComponentProps) => React.JSX.Element;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Channel } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
channel: Channel<StreamChatGenerics>;
|
|
2
|
+
export type ChannelPreviewInfoParams = {
|
|
3
|
+
channel: Channel;
|
|
5
4
|
/** Manually set the image to render, defaults to the Channel image */
|
|
6
5
|
overrideImage?: string;
|
|
7
6
|
/** Set title manually */
|
|
8
7
|
overrideTitle?: string;
|
|
9
8
|
};
|
|
10
|
-
export declare const useChannelPreviewInfo:
|
|
9
|
+
export declare const useChannelPreviewInfo: (props: ChannelPreviewInfoParams) => {
|
|
11
10
|
displayImage: string | undefined;
|
|
12
11
|
displayTitle: string | undefined;
|
|
13
12
|
groupChannelDisplayInfo: import("../utils").GroupChannelDisplayInfo | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Channel } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export declare const useIsChannelMuted: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(channel: Channel<StreamChatGenerics>) => {
|
|
2
|
+
export declare const useIsChannelMuted: (channel: Channel) => {
|
|
4
3
|
createdAt: Date | null;
|
|
5
4
|
expiresAt: Date | null;
|
|
6
5
|
muted: boolean;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import type { Channel } from 'stream-chat';
|
|
2
|
-
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
3
|
-
import type { StreamMessage } from '../../../context';
|
|
1
|
+
import type { Channel, LocalMessage } from 'stream-chat';
|
|
4
2
|
export declare enum MessageDeliveryStatus {
|
|
5
3
|
DELIVERED = "delivered",
|
|
6
4
|
READ = "read"
|
|
7
5
|
}
|
|
8
|
-
type UseMessageStatusParamsChannelPreviewProps
|
|
9
|
-
channel: Channel
|
|
6
|
+
type UseMessageStatusParamsChannelPreviewProps = {
|
|
7
|
+
channel: Channel;
|
|
10
8
|
/** The last message received in a channel */
|
|
11
|
-
lastMessage?:
|
|
9
|
+
lastMessage?: LocalMessage;
|
|
12
10
|
};
|
|
13
|
-
export declare const useMessageDeliveryStatus:
|
|
11
|
+
export declare const useMessageDeliveryStatus: ({ channel, lastMessage, }: UseMessageStatusParamsChannelPreviewProps) => {
|
|
14
12
|
messageDeliveryStatus: MessageDeliveryStatus | undefined;
|
|
15
13
|
};
|
|
16
14
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
export declare const Icon: {
|
|
4
4
|
ArchiveBox: (props: ComponentPropsWithoutRef<'svg'>) => React.JSX.Element;
|
|
5
5
|
Pin: (props: ComponentPropsWithoutRef<'svg'>) => React.JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
2
3
|
import type { Channel, UserResponse } from 'stream-chat';
|
|
3
4
|
import type { TranslationContextValue } from '../../context/TranslationContext';
|
|
4
|
-
import type {
|
|
5
|
-
import { ChatContextValue } from '../../context';
|
|
5
|
+
import type { ChatContextValue } from '../../context';
|
|
6
6
|
export declare const renderPreviewText: (text: string) => React.JSX.Element;
|
|
7
|
-
export declare const getLatestMessagePreview:
|
|
7
|
+
export declare const getLatestMessagePreview: (channel: Channel, t: TranslationContextValue['t'], userLanguage?: TranslationContextValue['userLanguage'], isMessageAIGenerated?: ChatContextValue['isMessageAIGenerated']) => ReactNode;
|
|
8
8
|
export type GroupChannelDisplayInfo = {
|
|
9
9
|
image?: string;
|
|
10
10
|
name?: string;
|
|
11
11
|
}[];
|
|
12
|
-
export declare const getGroupChannelDisplayInfo:
|
|
13
|
-
export declare const getDisplayTitle:
|
|
14
|
-
export declare const getDisplayImage:
|
|
12
|
+
export declare const getGroupChannelDisplayInfo: (channel: Channel) => GroupChannelDisplayInfo | undefined;
|
|
13
|
+
export declare const getDisplayTitle: (channel: Channel, currentUser?: UserResponse) => string | undefined;
|
|
14
|
+
export declare const getDisplayImage: (channel: Channel, currentUser?: UserResponse) => string | undefined;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ChannelSearchControllerParams } from './hooks/useChannelSearch';
|
|
2
|
+
import type { ChannelSearchControllerParams } from './hooks/useChannelSearch';
|
|
3
3
|
import type { AdditionalSearchBarProps, SearchBarProps } from './SearchBar';
|
|
4
|
-
import { AdditionalSearchInputProps, SearchInputProps } from './SearchInput';
|
|
5
|
-
import { AdditionalSearchResultsProps } from './SearchResults';
|
|
6
|
-
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
4
|
+
import type { AdditionalSearchInputProps, SearchInputProps } from './SearchInput';
|
|
5
|
+
import type { AdditionalSearchResultsProps } from './SearchResults';
|
|
7
6
|
export type AdditionalChannelSearchProps = {
|
|
8
7
|
/** Custom UI component to display the search bar with text input */
|
|
9
8
|
SearchBar?: React.ComponentType<SearchBarProps>;
|
|
10
9
|
/** Custom UI component to display the search text input */
|
|
11
10
|
SearchInput?: React.ComponentType<SearchInputProps>;
|
|
12
11
|
};
|
|
13
|
-
export type ChannelSearchProps
|
|
12
|
+
export type ChannelSearchProps = AdditionalSearchBarProps & AdditionalSearchInputProps & AdditionalSearchResultsProps & AdditionalChannelSearchProps & ChannelSearchControllerParams;
|
|
14
13
|
/**
|
|
15
14
|
* The ChannelSearch component makes a query users call and displays the results in a list.
|
|
16
15
|
* Clicking on a list item will navigate you into a channel with the selected user. It can be used
|
|
17
16
|
* on its own or added to the ChannelList component by setting the `showChannelSearch` prop to true.
|
|
18
17
|
*/
|
|
19
|
-
export declare const ChannelSearch:
|
|
18
|
+
export declare const ChannelSearch: (props: ChannelSearchProps) => React.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { useChannelSearch
|
|
3
|
+
import { useChannelSearch } from './hooks/useChannelSearch';
|
|
4
4
|
import { SearchBar as DefaultSearchBar } from './SearchBar';
|
|
5
|
-
import { SearchInput as DefaultSearchInput
|
|
5
|
+
import { SearchInput as DefaultSearchInput } from './SearchInput';
|
|
6
6
|
import { SearchResults } from './SearchResults';
|
|
7
7
|
const UnMemoizedChannelSearch = (props) => {
|
|
8
8
|
const { AppMenu, ClearInputIcon, ExitSearchIcon, MenuIcon, placeholder, popupResults = false, SearchBar = DefaultSearchBar, SearchEmpty, SearchInput = DefaultSearchInput, SearchInputIcon, SearchLoading, SearchResultItem, SearchResultsHeader, SearchResultsList, ...channelSearchParams } = props;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { MenuIcon as DefaultMenuIcon, SearchIcon as DefaultSearchInputIcon, ReturnIcon, XIcon, } from './icons';
|
|
4
4
|
import { SearchInput as DefaultSearchInput } from './SearchInput';
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ChannelOrUserResponse } from './utils';
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
export type SearchResultsListProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Required<Pick<SearchResultsProps<StreamChatGenerics>, 'results' | 'SearchResultItem' | 'selectResult'>> & {
|
|
2
|
+
import type { ChannelOrUserResponse } from './utils';
|
|
3
|
+
export type SearchResultsHeaderProps = Pick<SearchResultsProps, 'results'>;
|
|
4
|
+
export type SearchResultsListProps = Required<Pick<SearchResultsProps, 'results' | 'SearchResultItem' | 'selectResult'>> & {
|
|
6
5
|
focusedUser?: number;
|
|
7
6
|
};
|
|
8
|
-
export type SearchResultItemProps
|
|
7
|
+
export type SearchResultItemProps = Pick<SearchResultsProps, 'selectResult'> & {
|
|
9
8
|
index: number;
|
|
10
|
-
result: ChannelOrUserResponse
|
|
9
|
+
result: ChannelOrUserResponse;
|
|
11
10
|
focusedUser?: number;
|
|
12
11
|
};
|
|
13
|
-
export type SearchResultsController
|
|
14
|
-
results: Array<ChannelOrUserResponse
|
|
12
|
+
export type SearchResultsController = {
|
|
13
|
+
results: Array<ChannelOrUserResponse>;
|
|
15
14
|
searching: boolean;
|
|
16
|
-
selectResult: (result: ChannelOrUserResponse
|
|
15
|
+
selectResult: (result: ChannelOrUserResponse) => Promise<void> | void;
|
|
17
16
|
};
|
|
18
|
-
export type AdditionalSearchResultsProps
|
|
17
|
+
export type AdditionalSearchResultsProps = {
|
|
19
18
|
/** Display search results as an absolutely positioned popup, defaults to false and shows inline */
|
|
20
19
|
popupResults?: boolean;
|
|
21
20
|
/** Custom UI component to display empty search results */
|
|
@@ -23,11 +22,11 @@ export type AdditionalSearchResultsProps<StreamChatGenerics extends DefaultStrea
|
|
|
23
22
|
/** Custom UI component to display the search loading state */
|
|
24
23
|
SearchLoading?: React.ComponentType;
|
|
25
24
|
/** Custom UI component to display a search result list item, defaults to and accepts the same props as: [DefaultSearchResultItem](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelSearch/SearchResults.tsx) */
|
|
26
|
-
SearchResultItem?: React.ComponentType<SearchResultItemProps
|
|
25
|
+
SearchResultItem?: React.ComponentType<SearchResultItemProps>;
|
|
27
26
|
/** Custom UI component to display the search results header */
|
|
28
27
|
SearchResultsHeader?: React.ComponentType;
|
|
29
28
|
/** Custom UI component to display all the search results, defaults to and accepts the same props as: [DefaultSearchResultsList](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelSearch/SearchResults.tsx) */
|
|
30
|
-
SearchResultsList?: React.ComponentType<SearchResultsListProps
|
|
29
|
+
SearchResultsList?: React.ComponentType<SearchResultsListProps>;
|
|
31
30
|
};
|
|
32
|
-
export type SearchResultsProps
|
|
33
|
-
export declare const SearchResults:
|
|
31
|
+
export type SearchResultsProps = AdditionalSearchResultsProps & SearchResultsController;
|
|
32
|
+
export declare const SearchResults: (props: SearchResultsProps) => React.JSX.Element;
|
|
@@ -11,7 +11,7 @@ const DefaultSearchEmpty = () => {
|
|
|
11
11
|
React.createElement(SearchIcon, null),
|
|
12
12
|
t('No results found')));
|
|
13
13
|
};
|
|
14
|
-
const DefaultSearchResultsHeader = ({ results
|
|
14
|
+
const DefaultSearchResultsHeader = ({ results }) => {
|
|
15
15
|
const { t } = useTranslationContext('SearchResultsHeader');
|
|
16
16
|
return (React.createElement("div", { className: 'str-chat__channel-search-results-header', "data-testid": 'channel-search-results-header' }, t('searchResultsCount', {
|
|
17
17
|
count: results.length,
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ChannelOrUserResponse } from '../utils';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ChannelOrUserResponse } from '../utils';
|
|
3
3
|
import type { Channel, ChannelFilters, ChannelOptions, ChannelSort, UserFilters, UserOptions, UserSort } from 'stream-chat';
|
|
4
4
|
import type { SearchBarController } from '../SearchBar';
|
|
5
5
|
import type { SearchInputController } from '../SearchInput';
|
|
6
6
|
import type { SearchResultsController } from '../SearchResults';
|
|
7
|
-
|
|
8
|
-
export type ChannelSearchFunctionParams<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
7
|
+
export type ChannelSearchFunctionParams = {
|
|
9
8
|
setQuery: React.Dispatch<React.SetStateAction<string>>;
|
|
10
|
-
setResults: React.Dispatch<React.SetStateAction<ChannelOrUserResponse
|
|
9
|
+
setResults: React.Dispatch<React.SetStateAction<ChannelOrUserResponse[]>>;
|
|
11
10
|
setSearching: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
11
|
};
|
|
13
|
-
export type SearchController
|
|
14
|
-
export type SearchQueryParams
|
|
12
|
+
export type SearchController = SearchInputController & SearchBarController & SearchResultsController;
|
|
13
|
+
export type SearchQueryParams = {
|
|
15
14
|
channelFilters?: {
|
|
16
|
-
filters?: ChannelFilters
|
|
15
|
+
filters?: ChannelFilters;
|
|
17
16
|
options?: ChannelOptions;
|
|
18
|
-
sort?: ChannelSort
|
|
17
|
+
sort?: ChannelSort;
|
|
19
18
|
};
|
|
20
19
|
userFilters?: {
|
|
21
|
-
filters?: UserFilters
|
|
20
|
+
filters?: UserFilters | ((query: string) => UserFilters);
|
|
22
21
|
options?: UserOptions;
|
|
23
|
-
sort?: UserSort
|
|
22
|
+
sort?: UserSort;
|
|
24
23
|
};
|
|
25
24
|
};
|
|
26
|
-
export type ChannelSearchParams
|
|
25
|
+
export type ChannelSearchParams = {
|
|
27
26
|
/** The type of channel to create on user result select, defaults to `messaging` */
|
|
28
27
|
channelType?: string;
|
|
29
28
|
/** Clear search state / results on every click outside the search input, defaults to true */
|
|
@@ -35,7 +34,7 @@ export type ChannelSearchParams<StreamChatGenerics extends DefaultStreamChatGene
|
|
|
35
34
|
/** Callback invoked when the search UI is deactivated */
|
|
36
35
|
onSearchExit?: () => void;
|
|
37
36
|
/** Custom handler function to run on search result item selection */
|
|
38
|
-
onSelectResult?: (params: ChannelSearchFunctionParams
|
|
37
|
+
onSelectResult?: (params: ChannelSearchFunctionParams, result: ChannelOrUserResponse) => Promise<void> | void;
|
|
39
38
|
/** The number of milliseconds to debounce the search query. The default interval is 200ms. */
|
|
40
39
|
searchDebounceIntervalMs?: number;
|
|
41
40
|
/** Boolean to search for channels in the server query, default is false and just searches for users */
|
|
@@ -43,12 +42,12 @@ export type ChannelSearchParams<StreamChatGenerics extends DefaultStreamChatGene
|
|
|
43
42
|
/** Boolean to search for users in the server query, default is true and just searches for users */
|
|
44
43
|
searchForUsers?: boolean;
|
|
45
44
|
/** Custom search function to override the default implementation */
|
|
46
|
-
searchFunction?: (params: ChannelSearchFunctionParams
|
|
45
|
+
searchFunction?: (params: ChannelSearchFunctionParams, event: React.BaseSyntheticEvent) => Promise<void> | void;
|
|
47
46
|
/** Object containing filters/sort/options overrides for user / channel search */
|
|
48
|
-
searchQueryParams?: SearchQueryParams
|
|
47
|
+
searchQueryParams?: SearchQueryParams;
|
|
49
48
|
};
|
|
50
|
-
export type ChannelSearchControllerParams
|
|
49
|
+
export type ChannelSearchControllerParams = ChannelSearchParams & {
|
|
51
50
|
/** Set the array of channels displayed in the ChannelList */
|
|
52
|
-
setChannels?: React.Dispatch<React.SetStateAction<Array<Channel
|
|
51
|
+
setChannels?: React.Dispatch<React.SetStateAction<Array<Channel>>>;
|
|
53
52
|
};
|
|
54
|
-
export declare const useChannelSearch:
|
|
53
|
+
export declare const useChannelSearch: ({ channelType, clearSearchOnClickOutside, disabled, onSearch: onSearchCallback, onSearchExit, onSelectResult, searchDebounceIntervalMs, searchForChannels, searchForUsers, searchFunction, searchQueryParams, setChannels, }: ChannelSearchControllerParams) => SearchController;
|
|
@@ -103,18 +103,14 @@ export const useChannelSearch = ({ channelType = 'messaging', clearSearchOnClick
|
|
|
103
103
|
const promises = [];
|
|
104
104
|
try {
|
|
105
105
|
if (searchForChannels) {
|
|
106
|
-
promises.push(client.queryChannels(
|
|
107
|
-
// @ts-expect-error valid query
|
|
108
|
-
{
|
|
106
|
+
promises.push(client.queryChannels({
|
|
109
107
|
members: { $in: [client.userID] },
|
|
110
108
|
name: { $autocomplete: text },
|
|
111
109
|
...searchQueryParams?.channelFilters?.filters,
|
|
112
110
|
}, searchQueryParams?.channelFilters?.sort || {}, { limit: 5, ...searchQueryParams?.channelFilters?.options }));
|
|
113
111
|
}
|
|
114
112
|
if (searchForUsers) {
|
|
115
|
-
promises.push(client.queryUsers(
|
|
116
|
-
// @ts-expect-error valid query
|
|
117
|
-
{
|
|
113
|
+
promises.push(client.queryUsers({
|
|
118
114
|
$or: [{ id: { $autocomplete: text } }, { name: { $autocomplete: text } }],
|
|
119
115
|
...searchQueryParams?.userFilters?.filters,
|
|
120
116
|
}, { id: 1, ...searchQueryParams?.userFilters?.sort }, { limit: 8, ...searchQueryParams?.userFilters?.options }));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { Channel, UserResponse } from 'stream-chat';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare const isChannel: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(output: ChannelOrUserResponse<StreamChatGenerics>) => output is Channel<StreamChatGenerics>;
|
|
2
|
+
export type ChannelOrUserResponse = Channel | UserResponse;
|
|
3
|
+
export declare const isChannel: (output: ChannelOrUserResponse) => output is Channel;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import type { StreamChat } from 'stream-chat';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import { SearchController } from 'stream-chat';
|
|
4
|
-
import {
|
|
3
|
+
import type { PropsWithChildren } from 'react';
|
|
4
|
+
import type { StreamChat } from 'stream-chat';
|
|
5
|
+
import type { CustomClasses } from '../../context/ChatContext';
|
|
5
6
|
import type { MessageContextValue } from '../../context';
|
|
6
7
|
import type { SupportedTranslations } from '../../i18n/types';
|
|
7
8
|
import type { Streami18n } from '../../i18n/Streami18n';
|
|
8
|
-
|
|
9
|
-
export type ChatProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
9
|
+
export type ChatProps = {
|
|
10
10
|
/** The StreamChat client object */
|
|
11
|
-
client: StreamChat
|
|
11
|
+
client: StreamChat;
|
|
12
12
|
/** Object containing custom CSS classnames to override the library's default container CSS */
|
|
13
13
|
customClasses?: CustomClasses;
|
|
14
14
|
/** Sets the default fallback language for UI component translation, defaults to 'en' for English */
|
|
@@ -18,7 +18,7 @@ export type ChatProps<StreamChatGenerics extends DefaultStreamChatGenerics = Def
|
|
|
18
18
|
/** Initial status of mobile navigation */
|
|
19
19
|
initialNavOpen?: boolean;
|
|
20
20
|
/** Instance of SearchController class that allows to control all the search operations. */
|
|
21
|
-
searchController?: SearchController
|
|
21
|
+
searchController?: SearchController;
|
|
22
22
|
/** Used for injecting className/s to the Channel and ChannelList components */
|
|
23
23
|
theme?: string;
|
|
24
24
|
/**
|
|
@@ -29,9 +29,9 @@ export type ChatProps<StreamChatGenerics extends DefaultStreamChatGenerics = Def
|
|
|
29
29
|
* Note: requires importing `stream-chat-react/css/v2/emoji-replacement.css` style sheet
|
|
30
30
|
*/
|
|
31
31
|
useImageFlagEmojisOnWindows?: boolean;
|
|
32
|
-
} & Partial<Pick<MessageContextValue
|
|
32
|
+
} & Partial<Pick<MessageContextValue, 'isMessageAIGenerated'>>;
|
|
33
33
|
/**
|
|
34
34
|
* Wrapper component for a StreamChat application. Chat needs to be placed around any other chat components
|
|
35
35
|
* as it provides the ChatContext.
|
|
36
36
|
*/
|
|
37
|
-
export declare const Chat:
|
|
37
|
+
export declare const Chat: (props: PropsWithChildren<ChatProps>) => React.JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import type { APIErrorResponse, ErrorFromResponse } from 'stream-chat';
|
|
3
3
|
type ChannelQueryState = 'uninitialized' | 'reload' | 'load-more' | null;
|
|
4
4
|
export interface ChannelsQueryState {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { TranslationContextValue } from '../../../context/TranslationContext';
|
|
2
|
-
import {
|
|
1
|
+
import type { TranslationContextValue } from '../../../context/TranslationContext';
|
|
2
|
+
import type { SupportedTranslations } from '../../../i18n';
|
|
3
|
+
import { Streami18n } from '../../../i18n';
|
|
3
4
|
import type { AppSettingsAPIResponse, Channel, Mute, StreamChat } from 'stream-chat';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
client: StreamChat<StreamChatGenerics>;
|
|
5
|
+
export type UseChatParams = {
|
|
6
|
+
client: StreamChat;
|
|
7
7
|
defaultLanguage?: SupportedTranslations;
|
|
8
8
|
i18nInstance?: Streami18n;
|
|
9
9
|
initialNavOpen?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const useChat:
|
|
12
|
-
channel: Channel
|
|
11
|
+
export declare const useChat: ({ client, defaultLanguage, i18nInstance, initialNavOpen, }: UseChatParams) => {
|
|
12
|
+
channel: Channel | undefined;
|
|
13
13
|
closeMobileNav: () => void;
|
|
14
|
-
getAppSettings: () => Promise<AppSettingsAPIResponse
|
|
14
|
+
getAppSettings: () => Promise<AppSettingsAPIResponse>;
|
|
15
15
|
latestMessageDatesByChannels: {};
|
|
16
|
-
mutes: Mute
|
|
16
|
+
mutes: Mute[];
|
|
17
17
|
navOpen: boolean | undefined;
|
|
18
18
|
openMobileNav: () => NodeJS.Timeout;
|
|
19
|
-
setActiveChannel: (activeChannel?: Channel
|
|
19
|
+
setActiveChannel: (activeChannel?: Channel, watchers?: {
|
|
20
20
|
limit?: number;
|
|
21
21
|
offset?: number;
|
|
22
22
|
}, event?: React.BaseSyntheticEvent) => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { defaultDateTimeParser, isLanguageSupported, Streami18n
|
|
2
|
+
import { defaultDateTimeParser, isLanguageSupported, Streami18n } from '../../../i18n';
|
|
3
3
|
export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialNavOpen, }) => {
|
|
4
4
|
const [translators, setTranslators] = useState({
|
|
5
5
|
t: (key) => key,
|
|
@@ -10,7 +10,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
|
|
|
10
10
|
const [mutes, setMutes] = useState([]);
|
|
11
11
|
const [navOpen, setNavOpen] = useState(initialNavOpen);
|
|
12
12
|
const [latestMessageDatesByChannels, setLatestMessageDatesByChannels] = useState({});
|
|
13
|
-
const clientMutes = client.user?.mutes
|
|
13
|
+
const clientMutes = client.user?.mutes ?? [];
|
|
14
14
|
const closeMobileNav = () => setNavOpen(false);
|
|
15
15
|
const openMobileNav = () => setTimeout(() => setNavOpen(true), 100);
|
|
16
16
|
const appSettings = useRef(null);
|
|
@@ -24,11 +24,12 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
if (!client)
|
|
26
26
|
return;
|
|
27
|
+
const version = "13.0.0-rc.1";
|
|
27
28
|
const userAgent = client.getUserAgent();
|
|
28
29
|
if (!userAgent.includes('stream-chat-react')) {
|
|
29
30
|
// result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
|
|
30
31
|
// the upper-case text between double underscores is replaced with the actual semantic version of the library
|
|
31
|
-
client.setUserAgent(`stream-chat-react
|
|
32
|
+
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|
|
32
33
|
}
|
|
33
34
|
client.threads.registerSubscriptions();
|
|
34
35
|
client.polls.registerSubscriptions();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { StreamChat } from 'stream-chat';
|
|
2
|
-
import type {
|
|
2
|
+
import type { OwnUserResponse, StreamChatOptions, TokenOrProvider, UserResponse } from 'stream-chat';
|
|
3
3
|
/**
|
|
4
4
|
* React hook to create, connect and return `StreamChat` client.
|
|
5
5
|
*/
|
|
6
|
-
export declare const useCreateChatClient:
|
|
6
|
+
export declare const useCreateChatClient: ({ apiKey, options, tokenOrProvider, userData, }: {
|
|
7
7
|
apiKey: string;
|
|
8
8
|
tokenOrProvider: TokenOrProvider;
|
|
9
|
-
userData: OwnUserResponse
|
|
9
|
+
userData: OwnUserResponse | UserResponse;
|
|
10
10
|
options?: StreamChatOptions;
|
|
11
|
-
}) => StreamChat
|
|
11
|
+
}) => StreamChat | null;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { ChatContextValue } from '../../../context/ChatContext';
|
|
2
|
-
|
|
3
|
-
export declare const useCreateChatContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(value: ChatContextValue<StreamChatGenerics>) => ChatContextValue<StreamChatGenerics>;
|
|
2
|
+
export declare const useCreateChatContext: (value: ChatContextValue) => ChatContextValue;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Placement } from '@popperjs/core';
|
|
2
|
-
import
|
|
1
|
+
import type { Placement } from '@popperjs/core';
|
|
2
|
+
import type { ComponentProps, PropsWithChildren } from 'react';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
export interface DialogAnchorOptions {
|
|
4
5
|
open: boolean;
|
|
5
6
|
placement: Placement;
|
|
@@ -21,4 +22,4 @@ export type DialogAnchorProps = PropsWithChildren<Partial<DialogAnchorOptions>>
|
|
|
21
22
|
focus?: boolean;
|
|
22
23
|
trapFocus?: boolean;
|
|
23
24
|
} & ComponentProps<'div'>;
|
|
24
|
-
export declare const DialogAnchor: ({ children, className, focus, id, placement, referenceElement, trapFocus, ...restDivProps }: DialogAnchorProps) => React.JSX.Element | null;
|
|
25
|
+
export declare const DialogAnchor: ({ children, className, focus, id, placement, referenceElement, tabIndex, trapFocus, ...restDivProps }: DialogAnchorProps) => React.JSX.Element | null;
|
|
@@ -37,7 +37,7 @@ export function useDialogAnchor({ open, placement, referenceElement, }) {
|
|
|
37
37
|
styles,
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
export const DialogAnchor = ({ children, className, focus = true, id, placement = 'auto', referenceElement = null, trapFocus, ...restDivProps }) => {
|
|
40
|
+
export const DialogAnchor = ({ children, className, focus = true, id, placement = 'auto', referenceElement = null, tabIndex, trapFocus, ...restDivProps }) => {
|
|
41
41
|
const dialog = useDialog({ id });
|
|
42
42
|
const open = useDialogIsOpen(id);
|
|
43
43
|
const { attributes, setPopperElement, styles } = useDialogAnchor({
|
|
@@ -64,5 +64,5 @@ export const DialogAnchor = ({ children, className, focus = true, id, placement
|
|
|
64
64
|
}
|
|
65
65
|
return (React.createElement(DialogPortalEntry, { dialogId: id },
|
|
66
66
|
React.createElement(FocusScope, { autoFocus: focus, contain: trapFocus, restoreFocus: true },
|
|
67
|
-
React.createElement("div", { ...restDivProps, ...attributes.popper, className: clsx('str-chat__dialog-contents', className), "data-testid": 'str-chat__dialog-contents', ref: setPopperElement, style: styles.popper, tabIndex: 0 }, children))));
|
|
67
|
+
React.createElement("div", { ...restDivProps, ...attributes.popper, className: clsx('str-chat__dialog-contents', className), "data-testid": 'str-chat__dialog-contents', ref: setPopperElement, style: styles.popper, tabIndex: typeof tabIndex !== 'undefined' ? tabIndex : 0 }, children))));
|
|
68
68
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
export type DialogMenuButtonProps = ComponentProps<'button'>;
|
|
3
4
|
export declare const DialogMenuButton: ({ children, className, ...props }: DialogMenuButtonProps) => React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
type FormElements = 'input' | 'textarea';
|
|
3
4
|
type FieldId = string;
|
|
4
5
|
type Validator = (value: string | readonly string[] | number | boolean | undefined) => Error | undefined;
|