stream-chat-react 12.11.1 → 12.13.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 (102) hide show
  1. package/dist/components/Channel/Channel.d.ts +1 -1
  2. package/dist/components/Channel/Channel.js +41 -26
  3. package/dist/components/Channel/channelState.d.ts +1 -1
  4. package/dist/components/Channel/channelState.js +2 -1
  5. package/dist/components/ChannelList/ChannelList.d.ts +2 -2
  6. package/dist/components/ChannelList/ChannelList.js +15 -9
  7. package/dist/components/ChannelPreview/ChannelPreview.d.ts +6 -6
  8. package/dist/components/ChannelPreview/ChannelPreview.js +3 -4
  9. package/dist/components/ChannelPreview/ChannelPreviewMessenger.d.ts +1 -1
  10. package/dist/components/ChannelPreview/utils.d.ts +2 -2
  11. package/dist/components/ChannelSearch/SearchBar.js +7 -8
  12. package/dist/components/ChannelSearch/SearchResults.js +8 -7
  13. package/dist/components/Chat/Chat.d.ts +5 -2
  14. package/dist/components/Chat/Chat.js +12 -2
  15. package/dist/components/Chat/hooks/useChat.js +1 -1
  16. package/dist/components/Chat/hooks/useCreateChatContext.js +3 -1
  17. package/dist/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +1 -1
  18. package/dist/components/InfiniteScrollPaginator/InfiniteScroll.js +1 -1
  19. package/dist/components/InfiniteScrollPaginator/InfiniteScrollPaginator.d.ts +1 -0
  20. package/dist/components/InfiniteScrollPaginator/InfiniteScrollPaginator.js +8 -2
  21. package/dist/components/MediaRecorder/classes/MediaRecorderController.d.ts +6 -1
  22. package/dist/components/MediaRecorder/classes/MediaRecorderController.js +6 -8
  23. package/dist/components/Message/QuotedMessage.d.ts +3 -1
  24. package/dist/components/Message/QuotedMessage.js +14 -11
  25. package/dist/components/Message/renderText/renderText.d.ts +3 -3
  26. package/dist/components/Message/renderText/renderText.js +3 -3
  27. package/dist/components/Message/types.d.ts +2 -2
  28. package/dist/components/MessageInput/MessageInputFlat.js +2 -1
  29. package/dist/components/MessageInput/QuotedMessagePreview.d.ts +3 -1
  30. package/dist/components/MessageInput/QuotedMessagePreview.js +4 -3
  31. package/dist/components/MessageList/utils.js +3 -0
  32. package/dist/context/ChatContext.d.ts +3 -1
  33. package/dist/context/ComponentContext.d.ts +23 -0
  34. package/dist/context/MessageContext.d.ts +2 -2
  35. package/dist/css/v2/index.css +1 -1
  36. package/dist/css/v2/index.layout.css +1 -1
  37. package/dist/experimental/Search/Search.d.ts +12 -0
  38. package/dist/experimental/Search/Search.js +25 -0
  39. package/dist/experimental/Search/SearchBar/SearchBar.d.ts +2 -0
  40. package/dist/experimental/Search/SearchBar/SearchBar.js +56 -0
  41. package/dist/experimental/Search/SearchBar/index.d.ts +1 -0
  42. package/dist/experimental/Search/SearchBar/index.js +1 -0
  43. package/dist/experimental/Search/SearchContext.d.ts +23 -0
  44. package/dist/experimental/Search/SearchContext.js +10 -0
  45. package/dist/experimental/Search/SearchResults/SearchResultItem.d.ts +19 -0
  46. package/dist/experimental/Search/SearchResults/SearchResultItem.js +62 -0
  47. package/dist/experimental/Search/SearchResults/SearchResults.d.ts +3 -0
  48. package/dist/experimental/Search/SearchResults/SearchResults.js +21 -0
  49. package/dist/experimental/Search/SearchResults/SearchResultsHeader.d.ts +3 -0
  50. package/dist/experimental/Search/SearchResults/SearchResultsHeader.js +31 -0
  51. package/dist/experimental/Search/SearchResults/SearchResultsPresearch.d.ts +6 -0
  52. package/dist/experimental/Search/SearchResults/SearchResultsPresearch.js +6 -0
  53. package/dist/experimental/Search/SearchResults/SearchSourceResultList.d.ts +9 -0
  54. package/dist/experimental/Search/SearchResults/SearchSourceResultList.js +22 -0
  55. package/dist/experimental/Search/SearchResults/SearchSourceResultListFooter.d.ts +3 -0
  56. package/dist/experimental/Search/SearchResults/SearchSourceResultListFooter.js +16 -0
  57. package/dist/experimental/Search/SearchResults/SearchSourceResults.d.ts +7 -0
  58. package/dist/experimental/Search/SearchResults/SearchSourceResults.js +21 -0
  59. package/dist/experimental/Search/SearchResults/SearchSourceResultsEmpty.d.ts +2 -0
  60. package/dist/experimental/Search/SearchResults/SearchSourceResultsEmpty.js +6 -0
  61. package/dist/experimental/Search/SearchResults/SearchSourceResultsHeader.d.ts +1 -0
  62. package/dist/experimental/Search/SearchResults/SearchSourceResultsHeader.js +1 -0
  63. package/dist/experimental/Search/SearchResults/SearchSourceResultsLoadingIndicator.d.ts +2 -0
  64. package/dist/experimental/Search/SearchResults/SearchSourceResultsLoadingIndicator.js +8 -0
  65. package/dist/experimental/Search/SearchResults/index.d.ts +9 -0
  66. package/dist/experimental/Search/SearchResults/index.js +9 -0
  67. package/dist/experimental/Search/SearchSourceResultsContext.d.ts +13 -0
  68. package/dist/experimental/Search/SearchSourceResultsContext.js +10 -0
  69. package/dist/experimental/Search/hooks/index.d.ts +2 -0
  70. package/dist/experimental/Search/hooks/index.js +2 -0
  71. package/dist/experimental/Search/hooks/useSearchFocusedMessage.d.ts +2 -0
  72. package/dist/experimental/Search/hooks/useSearchFocusedMessage.js +8 -0
  73. package/dist/experimental/Search/hooks/useSearchQueriesInProgress.d.ts +6 -0
  74. package/dist/experimental/Search/hooks/useSearchQueriesInProgress.js +22 -0
  75. package/dist/experimental/Search/index.d.ts +5 -0
  76. package/dist/experimental/Search/index.js +5 -0
  77. package/dist/experimental/index.browser.cjs +11286 -301
  78. package/dist/experimental/index.browser.cjs.map +4 -4
  79. package/dist/experimental/index.d.ts +1 -0
  80. package/dist/experimental/index.js +1 -0
  81. package/dist/experimental/index.node.cjs +13176 -301
  82. package/dist/experimental/index.node.cjs.map +4 -4
  83. package/dist/i18n/Streami18n.d.ts +7 -0
  84. package/dist/i18n/de.json +7 -0
  85. package/dist/i18n/en.json +7 -0
  86. package/dist/i18n/es.json +7 -0
  87. package/dist/i18n/fr.json +8 -1
  88. package/dist/i18n/hi.json +7 -0
  89. package/dist/i18n/it.json +7 -0
  90. package/dist/i18n/ja.json +7 -0
  91. package/dist/i18n/ko.json +7 -0
  92. package/dist/i18n/nl.json +7 -0
  93. package/dist/i18n/pt.json +8 -1
  94. package/dist/i18n/ru.json +7 -0
  95. package/dist/i18n/tr.json +7 -0
  96. package/dist/index.browser.cjs +22862 -21873
  97. package/dist/index.browser.cjs.map +4 -4
  98. package/dist/index.node.cjs +17830 -16963
  99. package/dist/index.node.cjs.map +4 -4
  100. package/dist/scss/v2/Message/Message-layout.scss +1 -1
  101. package/dist/scss/v2/Message/Message-theme.scss +5 -5
  102. package/package.json +9 -10
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { Attachment as DefaultAttachment } from '../Attachment';
4
4
  import { Avatar as DefaultAvatar } from '../Avatar';
@@ -8,25 +8,28 @@ import { useComponentContext } from '../../context/ComponentContext';
8
8
  import { useMessageContext } from '../../context/MessageContext';
9
9
  import { useTranslationContext } from '../../context/TranslationContext';
10
10
  import { useChannelActionContext } from '../../context/ChannelActionContext';
11
- export const QuotedMessage = () => {
11
+ import { renderText as defaultRenderText } from './renderText';
12
+ export const QuotedMessage = ({ renderText: propsRenderText, }) => {
12
13
  const { Attachment = DefaultAttachment, Avatar: ContextAvatar } = useComponentContext('QuotedMessage');
13
14
  const { client } = useChatContext();
14
- const { isMyMessage, message } = useMessageContext('QuotedMessage');
15
+ const { isMyMessage, message, renderText: contextRenderText, } = useMessageContext('QuotedMessage');
15
16
  const { t, userLanguage } = useTranslationContext('QuotedMessage');
16
17
  const { jumpToMessage } = useChannelActionContext('QuotedMessage');
18
+ const renderText = propsRenderText ?? contextRenderText ?? defaultRenderText;
17
19
  const Avatar = ContextAvatar || DefaultAvatar;
18
20
  const { quoted_message } = message;
19
- if (!quoted_message)
20
- return null;
21
- const poll = quoted_message.poll_id && client.polls.fromState(quoted_message.poll_id);
22
- const quotedMessageDeleted = quoted_message.deleted_at || quoted_message.type === 'deleted';
21
+ const poll = quoted_message?.poll_id && client.polls.fromState(quoted_message.poll_id);
22
+ const quotedMessageDeleted = quoted_message?.deleted_at || quoted_message?.type === 'deleted';
23
23
  const quotedMessageText = quotedMessageDeleted
24
24
  ? t('This message was deleted...')
25
- : quoted_message.i18n?.[`${userLanguage}_text`] ||
26
- quoted_message.text;
27
- const quotedMessageAttachment = quoted_message.attachments?.length && !quotedMessageDeleted
25
+ : quoted_message?.i18n?.[`${userLanguage}_text`] ||
26
+ quoted_message?.text;
27
+ const quotedMessageAttachment = quoted_message?.attachments?.length && !quotedMessageDeleted
28
28
  ? quoted_message.attachments[0]
29
29
  : null;
30
+ const renderedText = useMemo(() => renderText(quotedMessageText, quoted_message?.mentioned_users), [quotedMessageText, quoted_message?.mentioned_users, renderText]);
31
+ if (!quoted_message)
32
+ return null;
30
33
  if (!quoted_message.poll && !quotedMessageText && !quotedMessageAttachment)
31
34
  return null;
32
35
  return (React.createElement(React.Fragment, null,
@@ -38,6 +41,6 @@ export const QuotedMessage = () => {
38
41
  quoted_message.user && (React.createElement(Avatar, { className: 'str-chat__avatar--quoted-message-sender', image: quoted_message.user.image, name: quoted_message.user.name || quoted_message.user.id, user: quoted_message.user })),
39
42
  React.createElement("div", { className: 'str-chat__quoted-message-bubble', "data-testid": 'quoted-message-contents' }, poll ? (React.createElement(Poll, { isQuoted: true, poll: poll })) : (React.createElement(React.Fragment, null,
40
43
  quotedMessageAttachment && (React.createElement(Attachment, { attachments: [quotedMessageAttachment], isQuoted: true })),
41
- React.createElement("div", { className: 'str-chat__quoted-message-bubble__text', "data-testid": 'quoted-message-text' }, quotedMessageText))))),
44
+ React.createElement("div", { className: 'str-chat__quoted-message-bubble__text', "data-testid": 'quoted-message-text' }, renderedText))))),
42
45
  message.attachments?.length ? (React.createElement(Attachment, { attachments: message.attachments })) : null));
43
46
  };
@@ -1,8 +1,8 @@
1
1
  import React, { ComponentType } from 'react';
2
- import { Options } from 'react-markdown';
3
- import type { PluggableList } from 'react-markdown/lib/react-markdown';
4
- import type { UserResponse } from 'stream-chat';
5
2
  import { MentionProps } from './componentRenderers';
3
+ import type { Options } from 'react-markdown/lib';
4
+ import type { UserResponse } from 'stream-chat';
5
+ import type { PluggableList } from 'unified';
6
6
  import type { DefaultStreamChatGenerics } from '../../../types/types';
7
7
  export type RenderTextPluginConfigurator = (defaultPlugins: PluggableList) => PluggableList;
8
8
  export declare const defaultAllowedTagNames: Array<keyof JSX.IntrinsicElements | 'emoji' | 'mention'>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import ReactMarkdown, { uriTransformer } from 'react-markdown';
2
+ import ReactMarkdown, { defaultUrlTransform } from 'react-markdown';
3
3
  import { find } from 'linkifyjs';
4
4
  import uniqBy from 'lodash.uniqby';
5
5
  import remarkGfm from 'remark-gfm';
@@ -50,7 +50,7 @@ function encodeDecode(url) {
50
50
  return url;
51
51
  }
52
52
  }
53
- const urlTransform = (uri) => uri.startsWith('app://') ? uri : uriTransformer(uri);
53
+ const urlTransform = (uri) => uri.startsWith('app://') ? uri : defaultUrlTransform(uri);
54
54
  const getPluginsForward = (plugins) => plugins;
55
55
  export const markDownRenderers = {
56
56
  a: Anchor,
@@ -118,5 +118,5 @@ export const renderText = (text, mentionedUsers, { allowedTagNames = defaultAllo
118
118
  React.createElement(ReactMarkdown, { allowedElements: allowedTagNames, components: {
119
119
  ...markDownRenderers,
120
120
  ...customMarkDownRenderers,
121
- }, rehypePlugins: getRehypePlugins(rehypePlugins), remarkPlugins: getRemarkPlugins(remarkPlugins), skipHtml: true, transformLinkUri: urlTransform, unwrapDisallowed: true }, newText)));
121
+ }, rehypePlugins: getRehypePlugins(rehypePlugins), remarkPlugins: getRemarkPlugins(remarkPlugins), skipHtml: true, unwrapDisallowed: true, urlTransform: urlTransform }, newText)));
122
122
  };
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import type { TFunction } from 'i18next';
2
+ import type { ReactNode } from 'react';
3
3
  import type { ReactionSort, UserResponse } from 'stream-chat';
4
4
  import type { PinPermissions, UserEventHandler } from './hooks';
5
5
  import type { MessageActionsArray } from './utils';
@@ -85,7 +85,7 @@ export type MessageProps<StreamChatGenerics extends DefaultStreamChatGenerics =
85
85
  /** A list of users that have read this Message if the message is the last one and was posted by my user */
86
86
  readBy?: UserResponse<StreamChatGenerics>[];
87
87
  /** Custom function to render message text content, defaults to the renderText function: [utils](https://github.com/GetStream/stream-chat-react/blob/master/src/utils.ts) */
88
- renderText?: (text?: string, mentioned_users?: UserResponse<StreamChatGenerics>[], options?: RenderTextOptions) => JSX.Element | null;
88
+ renderText?: (text?: string, mentioned_users?: UserResponse<StreamChatGenerics>[], options?: RenderTextOptions) => ReactNode;
89
89
  /** Custom retry send message handler to override default in [ChannelActionContext](https://getstream.io/chat/docs/sdk/react/contexts/channel_action_context/) */
90
90
  retrySendMessage?: ChannelActionContextValue<StreamChatGenerics>['retrySendMessage'];
91
91
  /** Comparator function to sort the list of reacted users
@@ -68,7 +68,8 @@ export const MessageInputFlat = () => {
68
68
  const displayQuotedMessage = !message && quotedMessage && quotedMessage.parent_id === parent?.id;
69
69
  const recordingEnabled = !!(recordingController.recorder && navigator.mediaDevices); // account for requirement on iOS as per this bug report: https://bugs.webkit.org/show_bug.cgi?id=252303
70
70
  const isRecording = !!recordingController.recordingState;
71
- /* This bit here is needed to make sure that we can get rid of the default behaviour
71
+ /**
72
+ * This bit here is needed to make sure that we can get rid of the default behaviour
72
73
  * if need be. Essentially this allows us to pass StopAIGenerationButton={null} and
73
74
  * completely circumvent the default logic if it's not what we want. We need it as a
74
75
  * prop because there is no other trivial way to override the SendMessage button otherwise.
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { StreamMessage } from '../../context/ChannelStateContext';
3
+ import type { MessageContextValue } from '../../context';
3
4
  import type { DefaultStreamChatGenerics } from '../../types/types';
4
5
  export declare const QuotedMessagePreviewHeader: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>() => React.JSX.Element;
5
6
  export type QuotedMessagePreviewProps<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
6
7
  quotedMessage: StreamMessage<StreamChatGenerics>;
8
+ renderText?: MessageContextValue<StreamChatGenerics>['renderText'];
7
9
  };
8
- export declare const QuotedMessagePreview: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ quotedMessage, }: QuotedMessagePreviewProps<StreamChatGenerics>) => React.JSX.Element | null;
10
+ export declare const QuotedMessagePreview: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ quotedMessage, renderText, }: QuotedMessagePreviewProps<StreamChatGenerics>) => React.JSX.Element | null;
@@ -7,6 +7,7 @@ import { useChatContext } from '../../context/ChatContext';
7
7
  import { useChannelActionContext } from '../../context/ChannelActionContext';
8
8
  import { useComponentContext } from '../../context/ComponentContext';
9
9
  import { useTranslationContext } from '../../context/TranslationContext';
10
+ import { renderText as defaultRenderText } from '../Message';
10
11
  export const QuotedMessagePreviewHeader = () => {
11
12
  const { setQuotedMessage } = useChannelActionContext('QuotedMessagePreview');
12
13
  const { t } = useTranslationContext('QuotedMessagePreview');
@@ -15,12 +16,13 @@ export const QuotedMessagePreviewHeader = () => {
15
16
  React.createElement("button", { "aria-label": t('aria/Cancel Reply'), className: 'str-chat__quoted-message-remove', onClick: () => setQuotedMessage(undefined) },
16
17
  React.createElement(CloseIcon, null))));
17
18
  };
18
- export const QuotedMessagePreview = ({ quotedMessage, }) => {
19
+ export const QuotedMessagePreview = ({ quotedMessage, renderText = defaultRenderText, }) => {
19
20
  const { client } = useChatContext();
20
21
  const { Attachment = DefaultAttachment, Avatar = DefaultAvatar } = useComponentContext('QuotedMessagePreview');
21
22
  const { userLanguage } = useTranslationContext('QuotedMessagePreview');
22
23
  const quotedMessageText = quotedMessage.i18n?.[`${userLanguage}_text`] ||
23
24
  quotedMessage.text;
25
+ const renderedText = useMemo(() => renderText(quotedMessageText, quotedMessage.mentioned_users), [quotedMessage.mentioned_users, quotedMessageText, renderText]);
24
26
  const quotedMessageAttachment = useMemo(() => {
25
27
  const [attachment] = quotedMessage.attachments ?? [];
26
28
  return attachment ? [attachment] : [];
@@ -32,6 +34,5 @@ export const QuotedMessagePreview = ({ quotedMessage, }) => {
32
34
  quotedMessage.user && (React.createElement(Avatar, { className: 'str-chat__avatar--quoted-message-sender', image: quotedMessage.user.image, name: quotedMessage.user.name || quotedMessage.user.id, user: quotedMessage.user })),
33
35
  React.createElement("div", { className: 'str-chat__quoted-message-bubble' }, poll ? (React.createElement(Poll, { isQuoted: true, poll: poll })) : (React.createElement(React.Fragment, null,
34
36
  !!quotedMessageAttachment.length && (React.createElement(Attachment, { attachments: quotedMessageAttachment, isQuoted: true })),
35
- React.createElement("div", { className: 'str-chat__quoted-message-text', "data-testid": 'quoted-message-text' },
36
- React.createElement("p", null, quotedMessageText)))))));
37
+ React.createElement("div", { className: 'str-chat__quoted-message-text', "data-testid": 'quoted-message-text' }, renderedText))))));
37
38
  };
@@ -257,6 +257,9 @@ export function isDateSeparatorMessage(message) {
257
257
  isDate(message.date));
258
258
  }
259
259
  export const getIsFirstUnreadMessage = ({ firstUnreadMessageId, isFirstMessage, lastReadDate, lastReadMessageId, message, previousMessage, unreadMessageCount = 0, }) => {
260
+ // prevent showing unread indicator in threads
261
+ if (message.parent_id)
262
+ return false;
260
263
  const createdAtTimestamp = message.created_at && new Date(message.created_at).getTime();
261
264
  const lastReadTimestamp = lastReadDate?.getTime();
262
265
  const messageIsUnread = !!createdAtTimestamp && !!lastReadTimestamp && createdAtTimestamp > lastReadTimestamp;
@@ -1,5 +1,5 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- import type { AppSettingsAPIResponse, Channel, Mute } from 'stream-chat';
2
+ import type { AppSettingsAPIResponse, Channel, Mute, SearchController } from 'stream-chat';
3
3
  import type { ChatProps } from '../components/Chat/Chat';
4
4
  import type { DefaultStreamChatGenerics, UnknownType } from '../types/types';
5
5
  import type { ChannelsQueryState } from '../components/Chat/hooks/useChannelsQueryState';
@@ -16,6 +16,8 @@ export type ChatContextValue<StreamChatGenerics extends DefaultStreamChatGeneric
16
16
  latestMessageDatesByChannels: Record<ChannelCID, Date>;
17
17
  mutes: Array<Mute<StreamChatGenerics>>;
18
18
  openMobileNav: () => void;
19
+ /** Instance of SearchController class that allows to control all the search operations. */
20
+ searchController: SearchController<StreamChatGenerics>;
19
21
  /**
20
22
  * Sets active channel to be rendered within Channel component.
21
23
  * @param newChannel
@@ -1,5 +1,6 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  import { AttachmentPreviewListProps, AttachmentProps, AvatarProps, BaseImageProps, ChannelPreviewActionButtonsProps, CooldownTimerProps, CustomMessageActionsListProps, DateSeparatorProps, EmojiSearchIndex, EmptyStateIndicatorProps, EventComponentProps, FixedHeightMessageProps, GiphyPreviewMessageProps, LinkPreviewListProps, LoadingIndicatorProps, MessageBouncePromptProps, MessageDeletedProps, MessageInputProps, MessageListNotificationsProps, MessageNotificationProps, MessageOptionsProps, MessageProps, MessageRepliesCountButtonProps, MessageStatusProps, MessageTimestampProps, MessageUIComponentProps, ModalGalleryProps, PinIndicatorProps, PollCreationDialogProps, PollOptionSelectorProps, QuotedMessagePreviewProps, ReactionOptions, ReactionSelectorProps, ReactionsListModalProps, ReactionsListProps, RecordingPermissionDeniedNotificationProps, SendButtonProps, StartRecordingAudioButtonProps, StreamedMessageTextProps, SuggestionItemProps, SuggestionListProps, ThreadHeaderProps, ThreadListItemProps, ThreadListItemUIProps, TimestampProps, TypingIndicatorProps, UnreadMessagesNotificationProps, UnreadMessagesSeparatorProps } from '../components';
3
+ import { SearchProps, SearchResultsPresearchProps, SearchSourceResultListProps } from '../experimental';
3
4
  import type { CustomTrigger, DefaultStreamChatGenerics, PropsWithChildrenOnly, UnknownType } from '../types/types';
4
5
  import type { StopAIGenerationButtonProps } from '../components/MessageInput/StopAIGenerationButton';
5
6
  export type ComponentContextValue<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics, V extends CustomTrigger = CustomTrigger> = {
@@ -108,6 +109,28 @@ export type ComponentContextValue<StreamChatGenerics extends DefaultStreamChatGe
108
109
  /** Custom UI component to display the reactions modal, defaults to and accepts same props as: [ReactionsListModal](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Reactions/ReactionsListModal.tsx) */
109
110
  ReactionsListModal?: React.ComponentType<ReactionsListModalProps<StreamChatGenerics>>;
110
111
  RecordingPermissionDeniedNotification?: React.ComponentType<RecordingPermissionDeniedNotificationProps>;
112
+ /** Custom component to display the search UI, defaults to and accepts same props as: [Search](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/Search.tsx) */
113
+ Search?: React.ComponentType<SearchProps>;
114
+ /** Custom component to display the UI where the searched string is entered, defaults to and accepts same props as: [SearchBar](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/SearchBar/SearchBar.tsx) */
115
+ SearchBar?: React.ComponentType;
116
+ /** Custom component for the search UI dedicated to display the results area, defaults to and accepts same props as: [SearchResults](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/SearchResults/SearchResults.tsx) */
117
+ SearchResults?: React.ComponentType;
118
+ /** Custom UI component to display header of search results pane, defaults to and accepts same props as: [SearchResultsHeader](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/SearchResults/SearchResultsHeader.tsx) */
119
+ SearchResultsHeader?: React.ComponentType;
120
+ /** Custom component to display search results pane before emitting the first search query for a given source, defaults to and accepts same props as: [SearchResultsPresearch](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/SearchResults/SearchSourceResultsPresearch.tsx) */
121
+ SearchResultsPresearch?: React.ComponentType<SearchResultsPresearchProps>;
122
+ /** Custom component to display the search source items results, defaults to and accepts same props as: [SearchSourceResultList](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/SearchResults/SearchSourceResultList.tsx) */
123
+ SearchSourceResultList?: React.ComponentType<SearchSourceResultListProps>;
124
+ /** Custom component to indicate the end of the last page for a searched source, defaults to and accepts same props as: [SearchSourceResultListFooter](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/SearchResults/SearchSourceResultListFooter.tsx) */
125
+ SearchSourceResultListFooter?: React.ComponentType;
126
+ /** Custom UI component to display search results items for a given search source pane, defaults to and accepts same props as: [SearchSourceResults](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/SearchResults/SourceSearchResults.tsx) */
127
+ SearchSourceResults?: React.ComponentType;
128
+ /** Custom component to display the search source results UI with 0 items found, defaults to and accepts same props as: [SearchSourceResultsEmpty](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/SearchResults/SearchSourceResultsEmpty.tsx) */
129
+ SearchSourceResultsEmpty?: React.ComponentType;
130
+ /** Custom component to display the header content for a given search source results, no default component is provided. */
131
+ SearchSourceResultsHeader?: React.ComponentType;
132
+ /** Custom component to display the search source results UI during the search query execution, defaults to and accepts same props as: [SearchSourceResultsLoadingIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Search/SearchResults/SearchSourceResultsLoadingIndicator.tsx) */
133
+ SearchSourceResultsLoadingIndicator?: React.ComponentType;
111
134
  /** 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) */
112
135
  SendButton?: React.ComponentType<SendButtonProps<StreamChatGenerics>>;
113
136
  /** 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) */
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import React, { PropsWithChildren, ReactNode } from 'react';
2
2
  import type { Mute, ReactionResponse, ReactionSort, UserResponse } from 'stream-chat';
3
3
  import type { ChannelActionContextValue } from './ChannelActionContext';
4
4
  import type { StreamMessage } from './ChannelStateContext';
@@ -103,7 +103,7 @@ export type MessageContextValue<StreamChatGenerics extends DefaultStreamChatGene
103
103
  /** A list of users that have read this Message */
104
104
  readBy?: UserResponse<StreamChatGenerics>[];
105
105
  /** Custom function to render message text content, defaults to the renderText function: [utils](https://github.com/GetStream/stream-chat-react/blob/master/src/utils.tsx) */
106
- renderText?: (text?: string, mentioned_users?: UserResponse<StreamChatGenerics>[], options?: RenderTextOptions) => JSX.Element | null;
106
+ renderText?: (text?: string, mentioned_users?: UserResponse<StreamChatGenerics>[], options?: RenderTextOptions) => ReactNode;
107
107
  /** Comparator function to sort the list of reacted users
108
108
  * @deprecated use `reactionDetailsSort` instead
109
109
  */