stream-chat-react 12.0.0 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/components/Channel/Channel.d.ts +3 -103
  2. package/dist/components/ChannelList/ChannelList.js +3 -1
  3. package/dist/components/ChannelList/hooks/useChannelDeletedListener.js +2 -3
  4. package/dist/components/ChannelList/hooks/useChannelHiddenListener.js +1 -2
  5. package/dist/components/ChannelList/hooks/useChannelTruncatedListener.js +1 -2
  6. package/dist/components/ChannelList/hooks/useChannelUpdatedListener.js +1 -2
  7. package/dist/components/ChannelList/hooks/useChannelVisibleListener.js +1 -2
  8. package/dist/components/ChannelList/hooks/useConnectionRecoveredListener.js +1 -2
  9. package/dist/components/ChannelList/hooks/useMessageNewListener.js +7 -2
  10. package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.js +1 -2
  11. package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.js +1 -2
  12. package/dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.js +1 -2
  13. package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.js +1 -2
  14. package/dist/components/MessageList/MessageList.js +2 -2
  15. package/dist/components/MessageList/MessageListMainPanel.d.ts +1 -1
  16. package/dist/components/MessageList/MessageListMainPanel.js +1 -1
  17. package/dist/components/MessageList/VirtualizedMessageList.d.ts +2 -2
  18. package/dist/components/MessageList/VirtualizedMessageList.js +4 -3
  19. package/dist/components/MessageList/VirtualizedMessageListComponents.js +2 -2
  20. package/dist/components/MessageList/hooks/MessageList/useUnreadMessagesNotification.js +2 -2
  21. package/dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.d.ts +0 -1
  22. package/dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.js +21 -17
  23. package/dist/context/ComponentContext.d.ts +50 -1
  24. package/dist/index.browser.cjs +66 -52
  25. package/dist/index.browser.cjs.map +3 -3
  26. package/dist/index.node.cjs +90 -76
  27. package/dist/index.node.cjs.map +3 -3
  28. package/package.json +1 -1
@@ -3,112 +3,10 @@ import { ChannelQueryOptions, EventAPIResponse, Message, MessageResponse, Channe
3
3
  import { OnMentionAction } from './hooks/useMentionsHandlers';
4
4
  import { LoadingErrorIndicatorProps } from '../Loading';
5
5
  import { ComponentContextValue, StreamMessage } from '../../context';
6
- import type { UnreadMessagesNotificationProps } from '../MessageList';
7
- import type { MessageProps } from '../Message';
8
6
  import type { MessageInputProps } from '../MessageInput';
9
7
  import type { ChannelUnreadUiState, CustomTrigger, DefaultStreamChatGenerics, GiphyVersions, ImageAttachmentSizeHandler, SendMessageOptions, UpdateMessageOptions, VideoAttachmentSizeHandler } from '../../types/types';
10
8
  import type { URLEnrichmentConfig } from '../MessageInput/hooks/useLinkPreviews';
11
- import { ReactionOptions } from '../Reactions';
12
- type ChannelPropsForwardedToComponentContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
13
- /** Custom UI component to display a message attachment, defaults to and accepts same props as: [Attachment](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Attachment.tsx) */
14
- Attachment?: ComponentContextValue<StreamChatGenerics>['Attachment'];
15
- /** Custom UI component to display an attachment previews in MessageInput, defaults to and accepts same props as: [Attachment](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/AttachmentPreviewList.tsx) */
16
- AttachmentPreviewList?: ComponentContextValue<StreamChatGenerics>['AttachmentPreviewList'];
17
- /** Custom UI component to display AudioRecorder in MessageInput, defaults to and accepts same props as: [AudioRecorder](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/AudioRecorder.tsx) */
18
- AudioRecorder?: ComponentContextValue<StreamChatGenerics>['AudioRecorder'];
19
- /** Optional UI component to override the default suggestion Item component, defaults to and accepts same props as: [Item](https://github.com/GetStream/stream-chat-react/blob/master/src/components/AutoCompleteTextarea/Item.js) */
20
- AutocompleteSuggestionItem?: ComponentContextValue<StreamChatGenerics>['AutocompleteSuggestionItem'];
21
- /** Optional UI component to override the default List component that displays suggestions, defaults to and accepts same props as: [List](https://github.com/GetStream/stream-chat-react/blob/master/src/components/AutoCompleteTextarea/List.js) */
22
- AutocompleteSuggestionList?: ComponentContextValue<StreamChatGenerics>['AutocompleteSuggestionList'];
23
- /** UI component to display a user's avatar, defaults to and accepts same props as: [Avatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/Avatar.tsx) */
24
- Avatar?: ComponentContextValue<StreamChatGenerics>['Avatar'];
25
- /** Custom UI component to display <img/> elements resp. a fallback in case of load error, defaults to and accepts same props as: [BaseImage](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/BaseImage.tsx) */
26
- BaseImage?: ComponentContextValue<StreamChatGenerics>['BaseImage'];
27
- /** Custom UI component to display the slow mode cooldown timer, defaults to and accepts same props as: [CooldownTimer](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/CooldownTimer.tsx) */
28
- CooldownTimer?: ComponentContextValue<StreamChatGenerics>['CooldownTimer'];
29
- /** Custom UI component to render set of buttons to be displayed in the MessageActionsBox, defaults to and accepts same props as: [CustomMessageActionsList](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageActions/CustomMessageActionsList.tsx) */
30
- CustomMessageActionsList?: ComponentContextValue<StreamChatGenerics>['CustomMessageActionsList'];
31
- /** Custom UI component for date separators, defaults to and accepts same props as: [DateSeparator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/DateSeparator.tsx) */
32
- DateSeparator?: ComponentContextValue<StreamChatGenerics>['DateSeparator'];
33
- /** Custom UI component to override default edit message input, defaults to and accepts same props as: [EditMessageForm](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/EditMessageForm.tsx) */
34
- EditMessageInput?: ComponentContextValue<StreamChatGenerics>['EditMessageInput'];
35
- /** Custom UI component for rendering button with emoji picker in MessageInput */
36
- EmojiPicker?: ComponentContextValue<StreamChatGenerics>['EmojiPicker'];
37
- /** Mechanism to be used with autocomplete and text replace features of the `MessageInput` component, see [emoji-mart `SearchIndex`](https://github.com/missive/emoji-mart#%EF%B8%8F%EF%B8%8F-headless-search) */
38
- emojiSearchIndex?: ComponentContextValue<StreamChatGenerics>['emojiSearchIndex'];
39
- /** Custom UI component to be displayed when the `MessageList` is empty, defaults to and accepts same props as: [EmptyStateIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/EmptyStateIndicator/EmptyStateIndicator.tsx) */
40
- EmptyStateIndicator?: ComponentContextValue<StreamChatGenerics>['EmptyStateIndicator'];
41
- /** Custom UI component for file upload icon, defaults to and accepts same props as: [FileUploadIcon](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/icons.tsx) */
42
- FileUploadIcon?: ComponentContextValue<StreamChatGenerics>['FileUploadIcon'];
43
- /** Custom UI component to render a Giphy preview in the `VirtualizedMessageList` */
44
- GiphyPreviewMessage?: ComponentContextValue<StreamChatGenerics>['GiphyPreviewMessage'];
45
- /** Custom UI component to render at the top of the `MessageList` */
46
- HeaderComponent?: ComponentContextValue<StreamChatGenerics>['HeaderComponent'];
47
- /** Custom UI component handling how the message input is rendered, defaults to and accepts the same props as [MessageInputFlat](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/MessageInputFlat.tsx) */
48
- Input?: ComponentContextValue<StreamChatGenerics>['Input'];
49
- /** Custom component to render link previews in message input **/
50
- LinkPreviewList?: ComponentContextValue<StreamChatGenerics>['LinkPreviewList'];
51
- /** Custom UI component to be shown if the channel query fails, defaults to and accepts same props as: [LoadingErrorIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingErrorIndicator.tsx) */
52
- LoadingErrorIndicator?: React.ComponentType<LoadingErrorIndicatorProps>;
53
- /** Custom UI component to render while the `MessageList` is loading new messages, defaults to and accepts same props as: [LoadingIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingIndicator.tsx) */
54
- LoadingIndicator?: ComponentContextValue<StreamChatGenerics>['LoadingIndicator'];
55
- /** Custom UI component to display a message in the standard `MessageList`, defaults to and accepts the same props as: [MessageSimple](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageSimple.tsx) */
56
- Message?: ComponentContextValue<StreamChatGenerics>['Message'];
57
- /** Custom UI component to display the contents of a bounced message modal. Usually it allows to retry, edit, or delete the message. Defaults to and accepts the same props as: [MessageBouncePrompt](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageBounce/MessageBouncePrompt.tsx) */
58
- MessageBouncePrompt?: ComponentContextValue<StreamChatGenerics>['MessageBouncePrompt'];
59
- /** Custom UI component for a deleted message, defaults to and accepts same props as: [MessageDeleted](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageDeleted.tsx) */
60
- MessageDeleted?: ComponentContextValue<StreamChatGenerics>['MessageDeleted'];
61
- /** Custom UI component that displays message and connection status notifications in the `MessageList`, defaults to and accepts same props as [DefaultMessageListNotifications](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageList/MessageListNotifications.tsx) */
62
- MessageListNotifications?: ComponentContextValue<StreamChatGenerics>['MessageListNotifications'];
63
- /** Custom UI component to display a notification when scrolled up the list and new messages arrive, defaults to and accepts same props as [MessageNotification](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageList/MessageNotification.tsx) */
64
- MessageNotification?: ComponentContextValue<StreamChatGenerics>['MessageNotification'];
65
- /** Custom UI component for message options popup, defaults to and accepts same props as: [MessageOptions](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageOptions.tsx) */
66
- MessageOptions?: ComponentContextValue<StreamChatGenerics>['MessageOptions'];
67
- /** Custom UI component to display message replies, defaults to and accepts same props as: [MessageRepliesCountButton](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageRepliesCountButton.tsx) */
68
- MessageRepliesCountButton?: ComponentContextValue<StreamChatGenerics>['MessageRepliesCountButton'];
69
- /** Custom UI component to display message delivery status, defaults to and accepts same props as: [MessageStatus](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageStatus.tsx) */
70
- MessageStatus?: ComponentContextValue<StreamChatGenerics>['MessageStatus'];
71
- /** Custom UI component to display system messages, defaults to and accepts same props as: [EventComponent](https://github.com/GetStream/stream-chat-react/blob/master/src/components/EventComponent/EventComponent.tsx) */
72
- MessageSystem?: ComponentContextValue<StreamChatGenerics>['MessageSystem'];
73
- /** Custom UI component to display a timestamp on a message, defaults to and accepts same props as: [MessageTimestamp](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageTimestamp.tsx) */
74
- MessageTimestamp?: ComponentContextValue<StreamChatGenerics>['MessageTimestamp'];
75
- /** Custom UI component for viewing message's image attachments, defaults to and accepts the same props as [ModalGallery](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/ModalGallery.tsx) */
76
- ModalGallery?: ComponentContextValue<StreamChatGenerics>['ModalGallery'];
77
- /** Custom UI component to override default pinned message indicator, defaults to and accepts same props as: [PinIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/icons.tsx) */
78
- PinIndicator?: ComponentContextValue<StreamChatGenerics>['PinIndicator'];
79
- /** Custom UI component to override quoted message UI on a sent message, defaults to and accepts same props as: [QuotedMessage](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/QuotedMessage.tsx) */
80
- QuotedMessage?: ComponentContextValue<StreamChatGenerics>['QuotedMessage'];
81
- /** Custom UI component to override the message input's quoted message preview, defaults to and accepts same props as: [QuotedMessagePreview](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/QuotedMessagePreview.tsx) */
82
- QuotedMessagePreview?: ComponentContextValue<StreamChatGenerics>['QuotedMessagePreview'];
83
- /** Custom reaction options to be applied to ReactionSelector, ReactionList and SimpleReactionList components */
84
- reactionOptions?: ReactionOptions;
85
- /** Custom UI component to display the reaction selector, defaults to and accepts same props as: [ReactionSelector](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Reactions/ReactionSelector.tsx) */
86
- ReactionSelector?: ComponentContextValue<StreamChatGenerics>['ReactionSelector'];
87
- /** Custom UI component to display the list of reactions on a message, defaults to and accepts same props as: [ReactionsList](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Reactions/ReactionsList.tsx) */
88
- ReactionsList?: ComponentContextValue<StreamChatGenerics>['ReactionsList'];
89
- /** Custom UI component for send button, defaults to and accepts same props as: [SendButton](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/icons.tsx) */
90
- SendButton?: ComponentContextValue<StreamChatGenerics>['SendButton'];
91
- /** Custom UI component button for initiating audio recording, defaults to and accepts same props as: [StartRecordingAudioButton](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MediaRecorder/AudioRecorder/AudioRecordingButtons.tsx) */
92
- StartRecordingAudioButton?: ComponentContextValue<StreamChatGenerics>['StartRecordingAudioButton'];
93
- /** Custom UI component that displays thread's parent or other message at the top of the `MessageList`, defaults to and accepts same props as [MessageSimple](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageSimple.tsx) */
94
- ThreadHead?: React.ComponentType<MessageProps<StreamChatGenerics>>;
95
- /** Custom UI component to display the header of a `Thread`, defaults to and accepts same props as: [DefaultThreadHeader](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Thread/Thread.tsx) */
96
- ThreadHeader?: ComponentContextValue<StreamChatGenerics>['ThreadHeader'];
97
- /** Custom UI component to display the start of a threaded `MessageList`, defaults to and accepts same props as: [DefaultThreadStart](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Thread/Thread.tsx) */
98
- ThreadStart?: ComponentContextValue<StreamChatGenerics>['ThreadStart'];
99
- /** Custom UI component to display a date used in timestamps. It's used internally by the default `MessageTimestamp`, and to display a timestamp for edited messages. */
100
- Timestamp?: ComponentContextValue<StreamChatGenerics>['Timestamp'];
101
- /** Optional context provider that lets you override the default autocomplete triggers, defaults to: [DefaultTriggerProvider](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/DefaultTriggerProvider.tsx) */
102
- TriggerProvider?: ComponentContextValue<StreamChatGenerics>['TriggerProvider'];
103
- /** Custom UI component for the typing indicator, defaults to and accepts same props as: [TypingIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/TypingIndicator/TypingIndicator.tsx) */
104
- TypingIndicator?: ComponentContextValue<StreamChatGenerics>['TypingIndicator'];
105
- /** Custom UI component that indicates a user is viewing unread messages. It disappears once the user scrolls to UnreadMessagesSeparator. Defaults to and accepts same props as: [UnreadMessagesNotification](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageList/UnreadMessagesNotification.tsx) */
106
- UnreadMessagesNotification?: React.ComponentType<UnreadMessagesNotificationProps>;
107
- /** Custom UI component that separates read messages from unread, defaults to and accepts same props as: [UnreadMessagesSeparator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageList/UnreadMessagesSeparator.tsx) */
108
- UnreadMessagesSeparator?: ComponentContextValue<StreamChatGenerics>['UnreadMessagesSeparator'];
109
- /** Custom UI component to display a message in the `VirtualizedMessageList`, does not have a default implementation */
110
- VirtualMessage?: ComponentContextValue<StreamChatGenerics>['VirtualMessage'];
111
- };
9
+ type ChannelPropsForwardedToComponentContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<ComponentContextValue<StreamChatGenerics>, 'Attachment' | 'AttachmentPreviewList' | 'AudioRecorder' | 'AutocompleteSuggestionItem' | 'AutocompleteSuggestionList' | 'Avatar' | 'BaseImage' | 'CooldownTimer' | 'CustomMessageActionsList' | 'DateSeparator' | 'EditMessageInput' | 'EmojiPicker' | 'emojiSearchIndex' | 'EmptyStateIndicator' | 'FileUploadIcon' | 'GiphyPreviewMessage' | 'HeaderComponent' | 'Input' | 'LinkPreviewList' | 'LoadingIndicator' | 'Message' | 'MessageBouncePrompt' | 'MessageDeleted' | 'MessageListNotifications' | 'MessageListMainPanel' | 'MessageNotification' | 'MessageOptions' | 'MessageRepliesCountButton' | 'MessageStatus' | 'MessageSystem' | 'MessageTimestamp' | 'ModalGallery' | 'PinIndicator' | 'QuotedMessage' | 'QuotedMessagePreview' | 'reactionOptions' | 'ReactionSelector' | 'ReactionsList' | 'SendButton' | 'StartRecordingAudioButton' | 'ThreadHead' | 'ThreadHeader' | 'ThreadStart' | 'Timestamp' | 'TriggerProvider' | 'TypingIndicator' | 'UnreadMessagesNotification' | 'UnreadMessagesSeparator' | 'VirtualMessage'>;
112
10
  export type ChannelProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, V extends CustomTrigger = CustomTrigger> = ChannelPropsForwardedToComponentContext<StreamChatGenerics> & {
113
11
  /** List of accepted file types */
114
12
  acceptedFiles?: string[];
@@ -153,6 +51,8 @@ export type ChannelProps<StreamChatGenerics extends DefaultStreamChatGenerics =
153
51
  * Preventing to initialize the channel on mount allows us to postpone the channel creation to a later point in time.
154
52
  */
155
53
  initializeOnMount?: boolean;
54
+ /** Custom UI component to be shown if the channel query fails, defaults to and accepts same props as: [LoadingErrorIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingErrorIndicator.tsx) */
55
+ LoadingErrorIndicator?: React.ComponentType<LoadingErrorIndicatorProps>;
156
56
  /** Configuration parameter to mark the active channel as read when mounted (opened). By default, the channel is marked read on mount. */
157
57
  markReadOnMount?: boolean;
158
58
  /** Maximum number of attachments allowed per message */
@@ -66,7 +66,9 @@ const UnMemoizedChannelList = (props) => {
66
66
  * For some events, inner properties on the channel will update but the shallow comparison will not
67
67
  * force a re-render. Incrementing this dummy variable ensures the channel previews update.
68
68
  */
69
- const forceUpdate = () => setChannelUpdateCount((count) => count + 1);
69
+ const forceUpdate = useCallback(() => setChannelUpdateCount((count) => count + 1), [
70
+ setChannelUpdateCount,
71
+ ]);
70
72
  const onSearch = useCallback((event) => {
71
73
  if (!event.target.value) {
72
74
  setSearchActive(false);
@@ -12,7 +12,7 @@ export const useChannelDeletedListener = (setChannels, customHandler) => {
12
12
  const channelIndex = channels.findIndex((channel) => channel.cid === event.cid);
13
13
  if (channelIndex < 0)
14
14
  return [...channels];
15
- // Remove the deleted channel from the list.s
15
+ // Remove the deleted channel from the list
16
16
  channels.splice(channelIndex, 1);
17
17
  return [...channels];
18
18
  });
@@ -22,6 +22,5 @@ export const useChannelDeletedListener = (setChannels, customHandler) => {
22
22
  return () => {
23
23
  client.off('channel.deleted', handleEvent);
24
24
  };
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- }, [customHandler]);
25
+ }, [client, customHandler, setChannels]);
27
26
  };
@@ -22,6 +22,5 @@ export const useChannelHiddenListener = (setChannels, customHandler) => {
22
22
  return () => {
23
23
  client.off('channel.hidden', handleEvent);
24
24
  };
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- }, [customHandler]);
25
+ }, [client, customHandler, setChannels]);
27
26
  };
@@ -16,6 +16,5 @@ export const useChannelTruncatedListener = (setChannels, customHandler, forceUpd
16
16
  return () => {
17
17
  client.off('channel.truncated', handleEvent);
18
18
  };
19
- // eslint-disable-next-line react-hooks/exhaustive-deps
20
- }, [customHandler]);
19
+ }, [client, customHandler, forceUpdate, setChannels]);
21
20
  };
@@ -28,6 +28,5 @@ export const useChannelUpdatedListener = (setChannels, customHandler, forceUpdat
28
28
  return () => {
29
29
  client.off('channel.updated', handleEvent);
30
30
  };
31
- // eslint-disable-next-line react-hooks/exhaustive-deps
32
- }, [customHandler]);
31
+ }, [client, customHandler, forceUpdate, setChannels]);
33
32
  };
@@ -22,6 +22,5 @@ export const useChannelVisibleListener = (setChannels, customHandler) => {
22
22
  return () => {
23
23
  client.off('channel.visible', handleEvent);
24
24
  };
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- }, [customHandler]);
25
+ }, [client, customHandler, setChannels]);
27
26
  };
@@ -12,6 +12,5 @@ export const useConnectionRecoveredListener = (forceUpdate) => {
12
12
  return () => {
13
13
  client.off('connection.recovered', handleEvent);
14
14
  };
15
- // eslint-disable-next-line react-hooks/exhaustive-deps
16
- }, []);
15
+ }, [client, forceUpdate]);
17
16
  };
@@ -26,6 +26,11 @@ export const useMessageNewListener = (setChannels, customHandler, lockChannelOrd
26
26
  return () => {
27
27
  client.off('message.new', handleEvent);
28
28
  };
29
- // eslint-disable-next-line react-hooks/exhaustive-deps
30
- }, [lockChannelOrder]);
29
+ }, [
30
+ allowNewMessagesFromUnfilteredChannels,
31
+ client,
32
+ customHandler,
33
+ lockChannelOrder,
34
+ setChannels,
35
+ ]);
31
36
  };
@@ -29,6 +29,5 @@ export const useNotificationAddedToChannelListener = (setChannels, customHandler
29
29
  return () => {
30
30
  client.off('notification.added_to_channel', handleEvent);
31
31
  };
32
- // eslint-disable-next-line react-hooks/exhaustive-deps
33
- }, [customHandler]);
32
+ }, [allowNewMessagesFromUnfilteredChannels, client, customHandler, setChannels]);
34
33
  };
@@ -22,6 +22,5 @@ export const useNotificationMessageNewListener = (setChannels, customHandler, al
22
22
  return () => {
23
23
  client.off('notification.message_new', handleEvent);
24
24
  };
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- }, [customHandler]);
25
+ }, [allowNewMessagesFromUnfilteredChannels, client, customHandler, setChannels]);
27
26
  };
@@ -15,6 +15,5 @@ export const useNotificationRemovedFromChannelListener = (setChannels, customHan
15
15
  return () => {
16
16
  client.off('notification.removed_from_channel', handleEvent);
17
17
  };
18
- // eslint-disable-next-line react-hooks/exhaustive-deps
19
- }, [customHandler]);
18
+ }, [client, customHandler, setChannels]);
20
19
  };
@@ -20,6 +20,5 @@ export const useUserPresenceChangedListener = (setChannels) => {
20
20
  return () => {
21
21
  client.off('user.presence.changed', handleEvent);
22
22
  };
23
- // eslint-disable-next-line react-hooks/exhaustive-deps
24
- }, []);
23
+ }, [client, setChannels]);
25
24
  };
@@ -16,7 +16,7 @@ import { InfiniteScroll } from '../InfiniteScrollPaginator/InfiniteScroll';
16
16
  import { LoadingIndicator as DefaultLoadingIndicator } from '../Loading';
17
17
  import { defaultPinPermissions, MESSAGE_ACTIONS } from '../Message/utils';
18
18
  import { TypingIndicator as DefaultTypingIndicator } from '../TypingIndicator';
19
- import { MessageListMainPanel } from './MessageListMainPanel';
19
+ import { MessageListMainPanel as DefaultMessageListMainPanel } from './MessageListMainPanel';
20
20
  import { defaultRenderMessages } from './renderMessages';
21
21
  import { DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD, DEFAULT_NEXT_CHANNEL_PAGE_SIZE, } from '../../constants/limits';
22
22
  const MessageListWithContext = (props) => {
@@ -25,7 +25,7 @@ const MessageListWithContext = (props) => {
25
25
  const [listElement, setListElement] = React.useState(null);
26
26
  const [ulElement, setUlElement] = React.useState(null);
27
27
  const { customClasses } = useChatContext('MessageList');
28
- const { EmptyStateIndicator = DefaultEmptyStateIndicator, LoadingIndicator = DefaultLoadingIndicator, MessageListNotifications = DefaultMessageListNotifications, MessageNotification = DefaultMessageNotification, TypingIndicator = DefaultTypingIndicator, UnreadMessagesNotification = DefaultUnreadMessagesNotification, } = useComponentContext('MessageList');
28
+ const { EmptyStateIndicator = DefaultEmptyStateIndicator, LoadingIndicator = DefaultLoadingIndicator, MessageListNotifications = DefaultMessageListNotifications, MessageNotification = DefaultMessageNotification, TypingIndicator = DefaultTypingIndicator, UnreadMessagesNotification = DefaultUnreadMessagesNotification, MessageListMainPanel = DefaultMessageListMainPanel, } = useComponentContext('MessageList');
29
29
  const { hasNewMessages, isMessageListScrolledToBottom, onScroll, scrollToBottom, wrapperRect, } = useScrollLocationLogic({
30
30
  hasMoreNewer,
31
31
  listElement,
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { PropsWithChildrenOnly } from '../../types/types';
3
- export declare const MESSAGE_LIST_MAIN_PANEL_CLASS: "str-chat__main-panel-inner";
3
+ export declare const MESSAGE_LIST_MAIN_PANEL_CLASS: "str-chat__main-panel-inner str-chat__message-list-main-panel";
4
4
  export declare const MessageListMainPanel: ({ children }: PropsWithChildrenOnly) => React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- export const MESSAGE_LIST_MAIN_PANEL_CLASS = 'str-chat__main-panel-inner';
2
+ export const MESSAGE_LIST_MAIN_PANEL_CLASS = 'str-chat__main-panel-inner str-chat__message-list-main-panel';
3
3
  export const MessageListMainPanel = ({ children }) => (React.createElement("div", { className: MESSAGE_LIST_MAIN_PANEL_CLASS }, children));
@@ -8,7 +8,8 @@ import { ChatContextValue } from '../../context/ChatContext';
8
8
  import { ComponentContextValue } from '../../context/ComponentContext';
9
9
  import type { UserResponse } from 'stream-chat';
10
10
  import type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';
11
- type VirtualizedMessageListPropsForContext = 'additionalMessageInputProps' | 'closeReactionSelectorOnClick' | 'customMessageActions' | 'customMessageRenderer' | 'formatDate' | 'head' | 'loadingMore' | 'Message' | 'messageActions' | 'shouldGroupByUser' | 'reactionDetailsSort' | 'sortReactions' | 'sortReactionDetails' | 'threadList';
11
+ type PropsDrilledToMessage = 'additionalMessageInputProps' | 'customMessageActions' | 'formatDate' | 'messageActions' | 'openThread' | 'reactionDetailsSort' | 'sortReactions' | 'sortReactionDetails';
12
+ type VirtualizedMessageListPropsForContext = PropsDrilledToMessage | 'closeReactionSelectorOnClick' | 'customMessageRenderer' | 'head' | 'loadingMore' | 'Message' | 'shouldGroupByUser' | 'threadList';
12
13
  /**
13
14
  * Context object provided to some Virtuoso props that are functions (components rendered by Virtuoso and other functions)
14
15
  */
@@ -36,7 +37,6 @@ export type VirtuosoContext<StreamChatGenerics extends DefaultStreamChatGenerics
36
37
  /** The number of unread messages in the current channel. */
37
38
  unreadMessageCount?: number;
38
39
  };
39
- type PropsDrilledToMessage = 'additionalMessageInputProps' | 'customMessageActions' | 'formatDate' | 'messageActions' | 'reactionDetailsSort' | 'sortReactions' | 'sortReactionDetails';
40
40
  export type VirtualizedMessageListProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Partial<Pick<MessageProps<StreamChatGenerics>, PropsDrilledToMessage>> & {
41
41
  /** Additional props to be passed the underlying [`react-virtuoso` virtualized list dependency](https://virtuoso.dev/virtuoso-api-reference/) */
42
42
  additionalVirtuosoProps?: VirtuosoProps<UnknownType, VirtuosoContext<StreamChatGenerics>>;
@@ -6,7 +6,7 @@ import { useGiphyPreview, useMessageSetKey, useNewMessageNotification, usePrepen
6
6
  import { useMarkRead } from './hooks/useMarkRead';
7
7
  import { MessageNotification as DefaultMessageNotification } from './MessageNotification';
8
8
  import { MessageListNotifications as DefaultMessageListNotifications } from './MessageListNotifications';
9
- import { MessageListMainPanel } from './MessageListMainPanel';
9
+ import { MessageListMainPanel as DefaultMessageListMainPanel } from './MessageListMainPanel';
10
10
  import { getGroupStyles, getLastReceived, processMessages, } from './utils';
11
11
  import { MessageSimple } from '../Message';
12
12
  import { UnreadMessagesNotification as DefaultUnreadMessagesNotification } from './UnreadMessagesNotification';
@@ -50,14 +50,14 @@ function calculateInitialTopMostItemIndex(messages, highlightedMessageId) {
50
50
  return messages.length - 1;
51
51
  }
52
52
  const VirtualizedMessageListWithContext = (props) => {
53
- const { additionalMessageInputProps, additionalVirtuosoProps = {}, channel, channelUnreadUiState, closeReactionSelectorOnClick, customMessageActions, customMessageRenderer, defaultItemHeight, disableDateSeparator = true, formatDate, groupStyles, hasMoreNewer, head, hideDeletedMessages = false, hideNewMessageSeparator = false, highlightedMessageId, jumpToLatestMessage, loadingMore, loadMore, loadMoreNewer, maxTimeBetweenGroupedMessages, Message: MessageUIComponentFromProps, messageActions, messageLimit = DEFAULT_NEXT_CHANNEL_PAGE_SIZE, messages, notifications,
53
+ const { additionalMessageInputProps, additionalVirtuosoProps = {}, channel, channelUnreadUiState, closeReactionSelectorOnClick, customMessageActions, customMessageRenderer, defaultItemHeight, disableDateSeparator = true, formatDate, groupStyles, hasMoreNewer, head, hideDeletedMessages = false, hideNewMessageSeparator = false, highlightedMessageId, jumpToLatestMessage, loadingMore, loadMore, loadMoreNewer, maxTimeBetweenGroupedMessages, Message: MessageUIComponentFromProps, messageActions, messageLimit = DEFAULT_NEXT_CHANNEL_PAGE_SIZE, messages, notifications, openThread,
54
54
  // TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
55
55
  overscan = 0, read, returnAllReadData = false, reviewProcessedMessage, scrollSeekPlaceHolder, scrollToLatestMessageOnFocus = false, separateGiphyPreview = false, shouldGroupByUser = false, showUnreadNotificationAlways, reactionDetailsSort, sortReactionDetails, sortReactions, stickToBottomScrollBehavior = 'smooth', suppressAutoscroll, threadList, } = props;
56
56
  const { components: virtuosoComponentsFromProps, ...overridingVirtuosoProps } = additionalVirtuosoProps;
57
57
  // Stops errors generated from react-virtuoso to bubble up
58
58
  // to Sentry or other tracking tools.
59
59
  useCaptureResizeObserverExceededError();
60
- const { DateSeparator = DefaultDateSeparator, GiphyPreviewMessage = DefaultGiphyPreviewMessage, MessageListNotifications = DefaultMessageListNotifications, MessageNotification = DefaultMessageNotification, MessageSystem = DefaultMessageSystem, UnreadMessagesNotification = DefaultUnreadMessagesNotification, UnreadMessagesSeparator = DefaultUnreadMessagesSeparator, VirtualMessage: MessageUIComponentFromContext = MessageSimple, TypingIndicator, } = useComponentContext('VirtualizedMessageList');
60
+ const { DateSeparator = DefaultDateSeparator, GiphyPreviewMessage = DefaultGiphyPreviewMessage, MessageListNotifications = DefaultMessageListNotifications, MessageNotification = DefaultMessageNotification, MessageSystem = DefaultMessageSystem, MessageListMainPanel = DefaultMessageListMainPanel, UnreadMessagesNotification = DefaultUnreadMessagesNotification, UnreadMessagesSeparator = DefaultUnreadMessagesSeparator, VirtualMessage: MessageUIComponentFromContext = MessageSimple, TypingIndicator, } = useComponentContext('VirtualizedMessageList');
61
61
  const MessageUIComponent = MessageUIComponentFromProps || MessageUIComponentFromContext;
62
62
  const { client, customClasses } = useChatContext('VirtualizedMessageList');
63
63
  const virtuoso = useRef(null);
@@ -218,6 +218,7 @@ const VirtualizedMessageListWithContext = (props) => {
218
218
  messageGroupStyles,
219
219
  MessageSystem,
220
220
  numItemsPrepended,
221
+ openThread,
221
222
  ownMessagesReadByOthers,
222
223
  processedMessages,
223
224
  reactionDetailsSort,
@@ -47,7 +47,7 @@ export const EmptyPlaceholder = ({ context, }) => {
47
47
  return (React.createElement(React.Fragment, null, EmptyStateIndicator && (React.createElement(EmptyStateIndicator, { listType: context?.threadList ? 'thread' : 'message' }))));
48
48
  };
49
49
  export const messageRenderer = (virtuosoIndex, _data, virtuosoContext) => {
50
- const { additionalMessageInputProps, closeReactionSelectorOnClick, customMessageActions, customMessageRenderer, DateSeparator, firstUnreadMessageId, formatDate, lastReadDate, lastReadMessageId, lastReceivedMessageId, Message: MessageUIComponent, messageActions, messageGroupStyles, MessageSystem, numItemsPrepended, ownMessagesReadByOthers, processedMessages: messageList, reactionDetailsSort, shouldGroupByUser, sortReactionDetails, sortReactions, threadList, unreadMessageCount = 0, UnreadMessagesSeparator, virtuosoRef, } = virtuosoContext;
50
+ const { additionalMessageInputProps, closeReactionSelectorOnClick, customMessageActions, customMessageRenderer, DateSeparator, firstUnreadMessageId, formatDate, lastReadDate, lastReadMessageId, lastReceivedMessageId, Message: MessageUIComponent, messageActions, messageGroupStyles, MessageSystem, numItemsPrepended, openThread, ownMessagesReadByOthers, processedMessages: messageList, reactionDetailsSort, shouldGroupByUser, sortReactionDetails, sortReactions, threadList, unreadMessageCount = 0, UnreadMessagesSeparator, virtuosoRef, } = virtuosoContext;
51
51
  const streamMessageIndex = calculateItemIndex(virtuosoIndex, numItemsPrepended);
52
52
  if (customMessageRenderer) {
53
53
  return customMessageRenderer(messageList, streamMessageIndex);
@@ -89,7 +89,7 @@ export const messageRenderer = (virtuosoIndex, _data, virtuosoContext) => {
89
89
  return (React.createElement(React.Fragment, null,
90
90
  showUnreadSeparatorAbove && (React.createElement("div", { className: 'str-chat__unread-messages-separator-wrapper' },
91
91
  React.createElement(UnreadMessagesSeparator, { unreadCount: unreadMessageCount }))),
92
- React.createElement(Message, { additionalMessageInputProps: additionalMessageInputProps, autoscrollToBottom: virtuosoRef.current?.autoscrollToBottom, closeReactionSelectorOnClick: closeReactionSelectorOnClick, customMessageActions: customMessageActions, endOfGroup: endOfGroup, firstOfGroup: firstOfGroup, formatDate: formatDate, groupedByUser: groupedByUser, groupStyles: [messageGroupStyles[message.id] ?? ''], lastReceivedId: lastReceivedMessageId, message: message, Message: MessageUIComponent, messageActions: messageActions, reactionDetailsSort: reactionDetailsSort, readBy: ownMessagesReadByOthers[message.id] || [], sortReactionDetails: sortReactionDetails, sortReactions: sortReactions, threadList: threadList }),
92
+ React.createElement(Message, { additionalMessageInputProps: additionalMessageInputProps, autoscrollToBottom: virtuosoRef.current?.autoscrollToBottom, closeReactionSelectorOnClick: closeReactionSelectorOnClick, customMessageActions: customMessageActions, endOfGroup: endOfGroup, firstOfGroup: firstOfGroup, formatDate: formatDate, groupedByUser: groupedByUser, groupStyles: [messageGroupStyles[message.id] ?? ''], lastReceivedId: lastReceivedMessageId, message: message, Message: MessageUIComponent, messageActions: messageActions, openThread: openThread, reactionDetailsSort: reactionDetailsSort, readBy: ownMessagesReadByOthers[message.id] || [], sortReactionDetails: sortReactionDetails, sortReactions: sortReactions, threadList: threadList }),
93
93
  showUnreadSeparatorBelow && (React.createElement("div", { className: 'str-chat__unread-messages-separator-wrapper' },
94
94
  React.createElement(UnreadMessagesSeparator, { unreadCount: unreadMessageCount })))));
95
95
  };
@@ -21,10 +21,10 @@ export const useUnreadMessagesNotification = ({ isMessageListScrolledToBottom, s
21
21
  setShow(false);
22
22
  return;
23
23
  }
24
- const msgListPanel = document.querySelector(`.${MESSAGE_LIST_MAIN_PANEL_CLASS}`);
24
+ const [msgListPanel] = document.getElementsByClassName(MESSAGE_LIST_MAIN_PANEL_CLASS);
25
25
  if (!msgListPanel)
26
26
  return;
27
- const observedTarget = document.querySelector(`.${UNREAD_MESSAGE_SEPARATOR_CLASS}`);
27
+ const [observedTarget] = document.getElementsByClassName(UNREAD_MESSAGE_SEPARATOR_CLASS);
28
28
  if (!observedTarget) {
29
29
  setShow(true);
30
30
  return;
@@ -1,7 +1,6 @@
1
1
  import { StreamMessage } from '../../../../context';
2
2
  import { DefaultStreamChatGenerics } from '../../../../types/types';
3
3
  type UseScrollToBottomOnNewMessageParams<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
4
- /** */
5
4
  scrollToBottom: () => void;
6
5
  messages?: StreamMessage<StreamChatGenerics>[];
7
6
  /** When `true`, the list will scroll to the latest message when the window regains focus */
@@ -1,28 +1,32 @@
1
- import React, { useCallback, useEffect } from 'react';
1
+ import { useEffect, useRef, useState } from 'react';
2
2
  export const useScrollToBottomOnNewMessage = ({ messages, scrollToBottom, scrollToLatestMessageOnFocus, }) => {
3
- const [newMessagesReceivedInBackground, setNewMessagesReceivedInBackground] = React.useState(false);
4
- const resetNewMessagesReceivedInBackground = useCallback(() => {
5
- setNewMessagesReceivedInBackground(false);
6
- }, []);
7
- useEffect(() => {
8
- setNewMessagesReceivedInBackground(true);
9
- }, [messages]);
10
- const scrollToBottomIfConfigured = useCallback((event) => {
3
+ const [newMessagesReceivedInBackground, setNewMessagesReceivedInBackground] = useState(false);
4
+ const scrollToBottomIfConfigured = useRef();
5
+ scrollToBottomIfConfigured.current = (event) => {
11
6
  if (!scrollToLatestMessageOnFocus ||
12
7
  !newMessagesReceivedInBackground ||
13
- event.target !== window)
8
+ event.target !== window) {
14
9
  return;
10
+ }
15
11
  setTimeout(scrollToBottom, 100);
16
- }, [scrollToLatestMessageOnFocus, scrollToBottom, newMessagesReceivedInBackground]);
12
+ };
17
13
  useEffect(() => {
14
+ setNewMessagesReceivedInBackground(true);
15
+ }, [messages]);
16
+ useEffect(() => {
17
+ const handleFocus = (event) => {
18
+ scrollToBottomIfConfigured.current?.(event);
19
+ };
20
+ const handleBlur = () => {
21
+ setNewMessagesReceivedInBackground(false);
22
+ };
18
23
  if (typeof window !== 'undefined') {
19
- window.addEventListener('focus', scrollToBottomIfConfigured);
20
- window.addEventListener('blur', resetNewMessagesReceivedInBackground);
24
+ window.addEventListener('focus', handleFocus);
25
+ window.addEventListener('blur', handleBlur);
21
26
  }
22
27
  return () => {
23
- window.removeEventListener('focus', scrollToBottomIfConfigured);
24
- window.removeEventListener('blur', resetNewMessagesReceivedInBackground);
28
+ window.removeEventListener('focus', handleFocus);
29
+ window.removeEventListener('blur', handleBlur);
25
30
  };
26
- // eslint-disable-next-line react-hooks/exhaustive-deps
27
- }, [scrollToBottomIfConfigured]);
31
+ }, []);
28
32
  };
@@ -3,49 +3,91 @@ import { BaseImageProps, CooldownTimerProps, CustomMessageActionsListProps, Star
3
3
  import type { AttachmentPreviewListProps, AttachmentProps, AvatarProps, DateSeparatorProps, EmojiSearchIndex, EmptyStateIndicatorProps, EventComponentProps, FixedHeightMessageProps, GiphyPreviewMessageProps, LinkPreviewListProps, LoadingIndicatorProps, MessageDeletedProps, MessageInputProps, MessageListNotificationsProps, MessageNotificationProps, MessageOptionsProps, MessageProps, MessageRepliesCountButtonProps, MessageStatusProps, MessageTimestampProps, MessageUIComponentProps, ModalGalleryProps, PinIndicatorProps, QuotedMessagePreviewProps, ReactionOptions, ReactionSelectorProps, ReactionsListProps, RecordingPermissionDeniedNotificationProps, SendButtonProps, SuggestionItemProps, SuggestionListProps, ThreadHeaderProps, ThreadListItemProps, ThreadListItemUIProps, TypingIndicatorProps, UnreadMessagesNotificationProps, UnreadMessagesSeparatorProps } from '../components';
4
4
  import type { MessageBouncePromptProps } from '../components/MessageBounce';
5
5
  import type { TimestampProps } from '../components/Message/Timestamp';
6
- import type { CustomTrigger, DefaultStreamChatGenerics, UnknownType } from '../types/types';
6
+ import type { CustomTrigger, DefaultStreamChatGenerics, PropsWithChildrenOnly, UnknownType } from '../types/types';
7
7
  export type ComponentContextValue<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, V extends CustomTrigger = CustomTrigger> = {
8
+ /** Custom UI component to display a message attachment, defaults to and accepts same props as: [Attachment](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Attachment.tsx) */
8
9
  Attachment?: React.ComponentType<AttachmentProps<StreamChatGenerics>>;
10
+ /** Custom UI component to display an attachment previews in MessageInput, defaults to and accepts same props as: [Attachment](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/AttachmentPreviewList.tsx) */
9
11
  AttachmentPreviewList?: React.ComponentType<AttachmentPreviewListProps>;
12
+ /** Custom UI component to display AudioRecorder in MessageInput, defaults to and accepts same props as: [AudioRecorder](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/AudioRecorder.tsx) */
10
13
  AudioRecorder?: React.ComponentType;
14
+ /** Optional UI component to override the default suggestion Item component, defaults to and accepts same props as: [Item](https://github.com/GetStream/stream-chat-react/blob/master/src/components/AutoCompleteTextarea/Item.js) */
11
15
  AutocompleteSuggestionItem?: React.ComponentType<SuggestionItemProps<StreamChatGenerics>>;
16
+ /** Optional UI component to override the default List component that displays suggestions, defaults to and accepts same props as: [List](https://github.com/GetStream/stream-chat-react/blob/master/src/components/AutoCompleteTextarea/List.js) */
12
17
  AutocompleteSuggestionList?: React.ComponentType<SuggestionListProps<StreamChatGenerics>>;
18
+ /** UI component to display a user's avatar, defaults to and accepts same props as: [Avatar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Avatar/Avatar.tsx) */
13
19
  Avatar?: React.ComponentType<AvatarProps<StreamChatGenerics>>;
20
+ /** Custom UI component to display <img/> elements resp. a fallback in case of load error, defaults to and accepts same props as: [BaseImage](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/BaseImage.tsx) */
14
21
  BaseImage?: React.ComponentType<BaseImageProps>;
22
+ /** Custom UI component to display the slow mode cooldown timer, defaults to and accepts same props as: [CooldownTimer](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/CooldownTimer.tsx) */
15
23
  CooldownTimer?: React.ComponentType<CooldownTimerProps>;
24
+ /** Custom UI component to render set of buttons to be displayed in the MessageActionsBox, defaults to and accepts same props as: [CustomMessageActionsList](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageActions/CustomMessageActionsList.tsx) */
16
25
  CustomMessageActionsList?: React.ComponentType<CustomMessageActionsListProps<StreamChatGenerics>>;
26
+ /** Custom UI component for date separators, defaults to and accepts same props as: [DateSeparator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/DateSeparator.tsx) */
17
27
  DateSeparator?: React.ComponentType<DateSeparatorProps>;
28
+ /** Custom UI component to override default edit message input, defaults to and accepts same props as: [EditMessageForm](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/EditMessageForm.tsx) */
18
29
  EditMessageInput?: React.ComponentType<MessageInputProps<StreamChatGenerics>>;
30
+ /** Custom UI component for rendering button with emoji picker in MessageInput */
19
31
  EmojiPicker?: React.ComponentType;
32
+ /** Mechanism to be used with autocomplete and text replace features of the `MessageInput` component, see [emoji-mart `SearchIndex`](https://github.com/missive/emoji-mart#%EF%B8%8F%EF%B8%8F-headless-search) */
20
33
  emojiSearchIndex?: EmojiSearchIndex;
34
+ /** Custom UI component to be displayed when the `MessageList` is empty, defaults to and accepts same props as: [EmptyStateIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/EmptyStateIndicator/EmptyStateIndicator.tsx) */
21
35
  EmptyStateIndicator?: React.ComponentType<EmptyStateIndicatorProps>;
36
+ /** Custom UI component for file upload icon, defaults to and accepts same props as: [FileUploadIcon](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/icons.tsx) */
22
37
  FileUploadIcon?: React.ComponentType;
38
+ /** Custom UI component to render a Giphy preview in the `VirtualizedMessageList` */
23
39
  GiphyPreviewMessage?: React.ComponentType<GiphyPreviewMessageProps<StreamChatGenerics>>;
40
+ /** Custom UI component to render at the top of the `MessageList` */
24
41
  HeaderComponent?: React.ComponentType;
42
+ /** Custom UI component handling how the message input is rendered, defaults to and accepts the same props as [MessageInputFlat](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/MessageInputFlat.tsx) */
25
43
  Input?: React.ComponentType<MessageInputProps<StreamChatGenerics, V>>;
44
+ /** Custom component to render link previews in message input **/
26
45
  LinkPreviewList?: React.ComponentType<LinkPreviewListProps>;
46
+ /** Custom UI component to render while the `MessageList` is loading new messages, defaults to and accepts same props as: [LoadingIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingIndicator.tsx) */
27
47
  LoadingIndicator?: React.ComponentType<LoadingIndicatorProps>;
48
+ /** Custom UI component to display a message in the standard `MessageList`, defaults to and accepts the same props as: [MessageSimple](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageSimple.tsx) */
28
49
  Message?: React.ComponentType<MessageUIComponentProps<StreamChatGenerics>>;
50
+ /** Custom UI component to display the contents of a bounced message modal. Usually it allows to retry, edit, or delete the message. Defaults to and accepts the same props as: [MessageBouncePrompt](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageBounce/MessageBouncePrompt.tsx) */
29
51
  MessageBouncePrompt?: React.ComponentType<MessageBouncePromptProps>;
52
+ /** Custom UI component for a deleted message, defaults to and accepts same props as: [MessageDeleted](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageDeleted.tsx) */
30
53
  MessageDeleted?: React.ComponentType<MessageDeletedProps<StreamChatGenerics>>;
54
+ MessageListMainPanel?: React.ComponentType<PropsWithChildrenOnly>;
55
+ /** Custom UI component that displays message and connection status notifications in the `MessageList`, defaults to and accepts same props as [DefaultMessageListNotifications](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageList/MessageListNotifications.tsx) */
31
56
  MessageListNotifications?: React.ComponentType<MessageListNotificationsProps>;
57
+ /** Custom UI component to display a notification when scrolled up the list and new messages arrive, defaults to and accepts same props as [MessageNotification](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageList/MessageNotification.tsx) */
32
58
  MessageNotification?: React.ComponentType<MessageNotificationProps>;
59
+ /** Custom UI component for message options popup, defaults to and accepts same props as: [MessageOptions](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageOptions.tsx) */
33
60
  MessageOptions?: React.ComponentType<MessageOptionsProps<StreamChatGenerics>>;
61
+ /** Custom UI component to display message replies, defaults to and accepts same props as: [MessageRepliesCountButton](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageRepliesCountButton.tsx) */
34
62
  MessageRepliesCountButton?: React.ComponentType<MessageRepliesCountButtonProps>;
63
+ /** Custom UI component to display message delivery status, defaults to and accepts same props as: [MessageStatus](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageStatus.tsx) */
35
64
  MessageStatus?: React.ComponentType<MessageStatusProps>;
65
+ /** Custom UI component to display system messages, defaults to and accepts same props as: [EventComponent](https://github.com/GetStream/stream-chat-react/blob/master/src/components/EventComponent/EventComponent.tsx) */
36
66
  MessageSystem?: React.ComponentType<EventComponentProps<StreamChatGenerics>>;
67
+ /** Custom UI component to display a timestamp on a message, defaults to and accepts same props as: [MessageTimestamp](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageTimestamp.tsx) */
37
68
  MessageTimestamp?: React.ComponentType<MessageTimestampProps<StreamChatGenerics>>;
69
+ /** Custom UI component for viewing message's image attachments, defaults to and accepts the same props as [ModalGallery](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/ModalGallery.tsx) */
38
70
  ModalGallery?: React.ComponentType<ModalGalleryProps>;
71
+ /** Custom UI component to override default pinned message indicator, defaults to and accepts same props as: [PinIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/icons.tsx) */
39
72
  PinIndicator?: React.ComponentType<PinIndicatorProps<StreamChatGenerics>>;
73
+ /** Custom UI component to override quoted message UI on a sent message, defaults to and accepts same props as: [QuotedMessage](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/QuotedMessage.tsx) */
40
74
  QuotedMessage?: React.ComponentType;
75
+ /** Custom UI component to override the message input's quoted message preview, defaults to and accepts same props as: [QuotedMessagePreview](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/QuotedMessagePreview.tsx) */
41
76
  QuotedMessagePreview?: React.ComponentType<QuotedMessagePreviewProps<StreamChatGenerics>>;
77
+ /** Custom reaction options to be applied to ReactionSelector, ReactionList and SimpleReactionList components */
42
78
  reactionOptions?: ReactionOptions;
79
+ /** Custom UI component to display the reaction selector, defaults to and accepts same props as: [ReactionSelector](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Reactions/ReactionSelector.tsx) */
43
80
  ReactionSelector?: React.ForwardRefExoticComponent<ReactionSelectorProps<StreamChatGenerics>>;
81
+ /** Custom UI component to display the list of reactions on a message, defaults to and accepts same props as: [ReactionsList](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Reactions/ReactionsList.tsx) */
44
82
  ReactionsList?: React.ComponentType<ReactionsListProps<StreamChatGenerics>>;
45
83
  RecordingPermissionDeniedNotification?: React.ComponentType<RecordingPermissionDeniedNotificationProps>;
84
+ /** Custom UI component for send button, defaults to and accepts same props as: [SendButton](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/icons.tsx) */
46
85
  SendButton?: React.ComponentType<SendButtonProps<StreamChatGenerics>>;
86
+ /** Custom UI component button for initiating audio recording, defaults to and accepts same props as: [StartRecordingAudioButton](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MediaRecorder/AudioRecorder/AudioRecordingButtons.tsx) */
47
87
  StartRecordingAudioButton?: React.ComponentType<StartRecordingAudioButtonProps>;
88
+ /** Custom UI component that displays thread's parent or other message at the top of the `MessageList`, defaults to and accepts same props as [MessageSimple](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/MessageSimple.tsx) */
48
89
  ThreadHead?: React.ComponentType<MessageProps<StreamChatGenerics>>;
90
+ /** Custom UI component to display the header of a `Thread`, defaults to and accepts same props as: [DefaultThreadHeader](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Thread/Thread.tsx) */
49
91
  ThreadHeader?: React.ComponentType<ThreadHeaderProps<StreamChatGenerics>>;
50
92
  ThreadInput?: React.ComponentType<MessageInputProps<StreamChatGenerics, V>>;
51
93
  ThreadListEmptyPlaceholder?: React.ComponentType;
@@ -53,12 +95,19 @@ export type ComponentContextValue<StreamChatGenerics extends DefaultStreamChatGe
53
95
  ThreadListItemUI?: React.ComponentType<ThreadListItemUIProps>;
54
96
  ThreadListLoadingIndicator?: React.ComponentType;
55
97
  ThreadListUnseenThreadsBanner?: React.ComponentType;
98
+ /** Custom UI component to display the start of a threaded `MessageList`, defaults to and accepts same props as: [DefaultThreadStart](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Thread/Thread.tsx) */
56
99
  ThreadStart?: React.ComponentType;
100
+ /** Custom UI component to display a date used in timestamps. It's used internally by the default `MessageTimestamp`, and to display a timestamp for edited messages. */
57
101
  Timestamp?: React.ComponentType<TimestampProps>;
102
+ /** Optional context provider that lets you override the default autocomplete triggers, defaults to: [DefaultTriggerProvider](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/DefaultTriggerProvider.tsx) */
58
103
  TriggerProvider?: React.ComponentType;
104
+ /** Custom UI component for the typing indicator, defaults to and accepts same props as: [TypingIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/TypingIndicator/TypingIndicator.tsx) */
59
105
  TypingIndicator?: React.ComponentType<TypingIndicatorProps>;
106
+ /** Custom UI component that indicates a user is viewing unread messages. It disappears once the user scrolls to UnreadMessagesSeparator. Defaults to and accepts same props as: [UnreadMessagesNotification](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageList/UnreadMessagesNotification.tsx) */
60
107
  UnreadMessagesNotification?: React.ComponentType<UnreadMessagesNotificationProps>;
108
+ /** Custom UI component that separates read messages from unread, defaults to and accepts same props as: [UnreadMessagesSeparator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageList/UnreadMessagesSeparator.tsx) */
61
109
  UnreadMessagesSeparator?: React.ComponentType<UnreadMessagesSeparatorProps>;
110
+ /** Custom UI component to display a message in the `VirtualizedMessageList`, does not have a default implementation */
62
111
  VirtualMessage?: React.ComponentType<FixedHeightMessageProps<StreamChatGenerics>>;
63
112
  };
64
113
  export declare const ComponentContext: React.Context<ComponentContextValue<DefaultStreamChatGenerics, CustomTrigger>>;