@cometchat/chat-uikit-react 6.0.7 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/assets/audio_filter_icon.svg +3 -0
  2. package/dist/assets/chats_filter_icon.svg +1 -0
  3. package/dist/assets/file_filter_icon.svg +4 -0
  4. package/dist/assets/group_filter_icon.svg +3 -0
  5. package/dist/assets/link_filter_icon.svg +3 -0
  6. package/dist/assets/link_icon_2x.svg +3 -0
  7. package/dist/assets/messages_filter_icon.svg +1 -0
  8. package/dist/assets/photo_filter_icon.svg +3 -0
  9. package/dist/assets/search_message_icon.svg +14 -0
  10. package/dist/assets/unread_filter_icon.svg +7 -0
  11. package/dist/assets/video_filter_icon.svg +3 -0
  12. package/dist/index.d.ts +420 -31
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/styles/CometChatConversations.css +16 -1
  16. package/dist/styles/CometChatList.css +10 -1
  17. package/dist/styles/CometChatMessageHeader.css +39 -0
  18. package/dist/styles/CometChatMessageList.css +28 -13
  19. package/dist/styles/CometChatSearch.css +948 -0
  20. package/dist/styles/CometChatThreadHeader.css +16 -1
  21. package/dist/styles/components/CometChatConversations.css +16 -1
  22. package/dist/styles/components/CometChatList.css +10 -1
  23. package/dist/styles/components/CometChatMessageHeader.css +39 -0
  24. package/dist/styles/components/CometChatMessageList.css +28 -13
  25. package/dist/styles/components/CometChatSearch.css +948 -0
  26. package/dist/styles/components/CometChatThreadHeader.css +16 -1
  27. package/dist/styles/components/index.css +5 -0
  28. package/dist/styles/index.css +5 -0
  29. package/dist/types/Enums/Enums.d.ts +37 -0
  30. package/dist/types/components/BaseComponents/CometChatContextMenu/CometChatContextMenu.d.ts +1 -0
  31. package/dist/types/components/BaseComponents/CometChatList/CometChatList.d.ts +24 -4
  32. package/dist/types/components/CometChatConversations/CometChatConversations.d.ts +14 -1
  33. package/dist/types/components/CometChatMessageHeader/CometChatMessageHeader.d.ts +15 -0
  34. package/dist/types/components/CometChatMessageList/CometChatMessageList.d.ts +6 -0
  35. package/dist/types/components/CometChatMessageList/useCometChatMessageList.d.ts +1 -1
  36. package/dist/types/components/CometChatSearch/CometChatSearch.d.ts +240 -0
  37. package/dist/types/components/CometChatSearch/SearchConversationsManager.d.ts +50 -0
  38. package/dist/types/components/CometChatSearch/useCometChatSearchConversationsList.d.ts +207 -0
  39. package/dist/types/components/CometChatSearch/useCometChatSearchMessagesList.d.ts +127 -0
  40. package/dist/types/components/CometChatThreadHeader/CometChatThreadHeader.d.ts +8 -0
  41. package/dist/types/formatters/CometChatFormatters/CometChatTextHighlightFormatter/CometChatTextHighlightFormatter.d.ts +26 -0
  42. package/dist/types/formatters/index.d.ts +1 -0
  43. package/dist/types/index.d.ts +2 -0
  44. package/dist/types/modals/CometChatSearchFilterOption.d.ts +34 -0
  45. package/dist/types/utils/SearchUtils.d.ts +30 -0
  46. package/dist/types/utils/util.d.ts +7 -0
  47. package/package.json +4 -3
package/dist/index.d.ts CHANGED
@@ -288,6 +288,43 @@ declare enum MentionsVisibility {
288
288
  groupConversationOnly = 1,
289
289
  both = 2
290
290
  }
291
+ /**
292
+ * Specifies the scope of the search functionality.
293
+ *
294
+ * @remarks
295
+ * - `Conversations`: Limits the search to conversations only.
296
+ * - `Messages`: Limits the search to messages only.
297
+ *
298
+ */
299
+ declare enum CometChatSearchScope {
300
+ Conversations = "conversations",
301
+ Messages = "messages"
302
+ }
303
+ /**
304
+ * Specifies the filters available for the search functionality.
305
+ *
306
+ * @remarks
307
+ * - `Messages`: Filters to search within messages.
308
+ * - `Conversations`: Filters to search within conversations.
309
+ * - `Unread`: Filters to search for unread messages.
310
+ * - `Groups`: Filters to search within groups.
311
+ * - `Photos`: Filters to search for photo messages.
312
+ * - `Videos`: Filters to search for video messages.
313
+ * - `Links`: Filters to search for links shared in messages.
314
+ * - `Documents`: Filters to search for document files.
315
+ * - `Audio`: Filters to search for audio messages.
316
+ */
317
+ declare enum CometChatSearchFilter {
318
+ Messages = "messages",
319
+ Conversations = "conversations",
320
+ Unread = "unread",
321
+ Groups = "groups",
322
+ Photos = "photos",
323
+ Videos = "videos",
324
+ Links = "links",
325
+ Documents = "files",
326
+ Audio = "audio"
327
+ }
291
328
 
292
329
  interface MentionsProps {
293
330
  /**
@@ -1173,6 +1210,32 @@ declare class CometChatUrlsFormatter extends CometChatTextFormatter {
1173
1210
  registerEventListeners(element: HTMLElement, classList: DOMTokenList): HTMLElement;
1174
1211
  }
1175
1212
 
1213
+ /**
1214
+ * Class that handles the text highlighting for specific patterns.
1215
+ * CometChatTextHighlightFormatter is a child class of CometChatTextFormatter.
1216
+ * It extends the functionality of text formatting to specifically highlight text patterns.
1217
+ * It can be used to highlight specific words or patterns.
1218
+ */
1219
+ declare class CometChatTextHighlightFormatter extends CometChatTextFormatter {
1220
+ constructor(pattern?: string | RegExp);
1221
+ /**
1222
+ * Sets the text pattern to highlight
1223
+ * @param pattern The text pattern (string or RegExp) to highlight
1224
+ */
1225
+ setText(pattern: string | RegExp): void;
1226
+ /**
1227
+ * Generates a unique ID for the highlight span
1228
+ */
1229
+ getUniqueId(): string;
1230
+ /**
1231
+ * Format the text by applying highlighting to matches of the regex pattern
1232
+ * @param inputText The text to format
1233
+ * @param params Optional parameters
1234
+ * @returns The formatted text with highlights
1235
+ */
1236
+ getFormattedText(inputText: string | null): string | void;
1237
+ }
1238
+
1176
1239
  /**
1177
1240
  * CometChatMessageTemplate is a pre-defined structure for creating message views
1178
1241
  * that can be used as a starting point or blueprint for creating message views,
@@ -1390,7 +1453,7 @@ declare class MessagesDataSource implements DataSource {
1390
1453
  }): Array<string>;
1391
1454
  getStickerButton(id: ComposerId, user?: CometChat.User, group?: CometChat.Group): JSX.Element | undefined;
1392
1455
  getId(): string;
1393
- getTextMessageContentView(message: CometChat.TextMessage, _alignment: MessageBubbleAlignment, additionalConfigurations?: additionalParams): JSX.Element | Element;
1456
+ getTextMessageContentView(message: CometChat.TextMessage, _alignment: MessageBubbleAlignment, additionalConfigurations?: additionalParams): Element | JSX.Element;
1394
1457
  getAudioMessageContentView(message: CometChat.MediaMessage, _alignment: MessageBubbleAlignment): Element | JSX.Element;
1395
1458
  getFileMessageContentView(message: CometChat.MediaMessage, _alignment: MessageBubbleAlignment): Element | JSX.Element;
1396
1459
  getImageMessageContentView(message: CometChat.MediaMessage, _alignment: MessageBubbleAlignment): Element | JSX.Element;
@@ -2136,13 +2199,13 @@ declare abstract class DataSourceDecorator implements DataSource {
2136
2199
  getVideoMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
2137
2200
  getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
2138
2201
  getFileMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
2139
- getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject): JSX.Element | Element | null;
2140
- getBottomView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment): JSX.Element | Element | null;
2141
- getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): JSX.Element | Element;
2142
- getImageMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2143
- getVideoMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2144
- getAudioMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2145
- getFileMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2202
+ getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject): Element | JSX.Element | null;
2203
+ getBottomView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment): Element | JSX.Element | null;
2204
+ getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): Element | JSX.Element;
2205
+ getImageMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2206
+ getVideoMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2207
+ getAudioMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2208
+ getFileMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2146
2209
  getTextMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
2147
2210
  getImageMessageTemplate(): CometChatMessageTemplate;
2148
2211
  getVideoMessageTemplate(): CometChatMessageTemplate;
@@ -2158,28 +2221,28 @@ declare abstract class DataSourceDecorator implements DataSource {
2158
2221
  getAllMessageCategories(additionalConfigurations?: Object | undefined): string[];
2159
2222
  getStickerButton(id: ComposerId, user?: CometChat.User, group?: CometChat.Group): JSX.Element | undefined;
2160
2223
  getId(): string;
2161
- getDeleteMessageBubble(messageObject: CometChat.BaseMessage, text?: string, alignment?: MessageBubbleAlignment): JSX.Element | Element;
2162
- getGroupActionBubble(message: CometChat.BaseMessage): JSX.Element | Element;
2163
- getTextMessageBubble(messageText: string, message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): JSX.Element | Element;
2164
- getVideoMessageBubble(videoUrl: string, message: CometChat.MediaMessage, thumbnailUrl?: string, onClick?: Function, alignment?: MessageBubbleAlignment): JSX.Element | Element;
2165
- getImageMessageBubble(imageUrl: string, placeholderImage: string, message: CometChat.MediaMessage, onClick?: Function, alignment?: MessageBubbleAlignment): JSX.Element | Element;
2166
- getAudioMessageBubble(audioUrl: string, message: CometChat.MediaMessage, title?: string, alignment?: MessageBubbleAlignment): JSX.Element | Element;
2167
- getFileMessageBubble(fileUrl: string, message: CometChat.MediaMessage, title?: string, alignment?: MessageBubbleAlignment): JSX.Element | Element;
2224
+ getDeleteMessageBubble(messageObject: CometChat.BaseMessage, text?: string, alignment?: MessageBubbleAlignment): Element | JSX.Element;
2225
+ getGroupActionBubble(message: CometChat.BaseMessage): Element | JSX.Element;
2226
+ getTextMessageBubble(messageText: string, message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): Element | JSX.Element;
2227
+ getVideoMessageBubble(videoUrl: string, message: CometChat.MediaMessage, thumbnailUrl?: string, onClick?: Function, alignment?: MessageBubbleAlignment): Element | JSX.Element;
2228
+ getImageMessageBubble(imageUrl: string, placeholderImage: string, message: CometChat.MediaMessage, onClick?: Function, alignment?: MessageBubbleAlignment): Element | JSX.Element;
2229
+ getAudioMessageBubble(audioUrl: string, message: CometChat.MediaMessage, title?: string, alignment?: MessageBubbleAlignment): Element | JSX.Element;
2230
+ getFileMessageBubble(fileUrl: string, message: CometChat.MediaMessage, title?: string, alignment?: MessageBubbleAlignment): Element | JSX.Element;
2168
2231
  getLastConversationMessage(conversation: CometChat.Conversation, loggedInUser: CometChat.User, additionalConfigurations?: additionalParams): string;
2169
2232
  getAuxiliaryHeaderMenu(user?: CometChat.User, group?: CometChat.Group, additionalConfigurations?: any): Element[] | JSX.Element[];
2170
2233
  getAllTextFormatters(formatterParams: additionalParams): CometChatTextFormatter[];
2171
2234
  getMentionsTextFormatter(params?: Object): CometChatMentionsFormatter;
2172
2235
  getUrlTextFormatter(params?: Object): CometChatUrlsFormatter;
2173
2236
  getMentionsFormattedText(message: CometChat.TextMessage, subtitle: string, additionalConfigurations: Object): string;
2174
- getFormMessageContentView(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2175
- getSchedulerMessageContentView(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2176
- getCardMessageContentView(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2237
+ getFormMessageContentView(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2238
+ getSchedulerMessageContentView(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2239
+ getCardMessageContentView(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2177
2240
  getFormMessageTemplate(): CometChatMessageTemplate;
2178
2241
  getSchedulerMessageTemplate(): CometChatMessageTemplate;
2179
2242
  getCardMessageTemplate(): CometChatMessageTemplate;
2180
- getFormMessageBubble(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2181
- getSchedulerMessageBubble(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2182
- getCardMessageBubble(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
2243
+ getFormMessageBubble(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2244
+ getSchedulerMessageBubble(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2245
+ getCardMessageBubble(message: CometChat.InteractiveMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
2183
2246
  }
2184
2247
 
2185
2248
  interface ListProps<T> {
@@ -2193,6 +2256,8 @@ interface ListProps<T> {
2193
2256
  * Hide the search bar
2194
2257
  *
2195
2258
  * @defaulValue `false`
2259
+ * @remarks
2260
+ * This property is ignored when a custom `searchView` is provided
2196
2261
  */
2197
2262
  hideSearch?: boolean;
2198
2263
  /**
@@ -2291,11 +2356,29 @@ interface ListProps<T> {
2291
2356
  */
2292
2357
  onError?: ((error: CometChat.CometChatException) => void) | null;
2293
2358
  /**
2294
- * Title of the component
2295
- *
2296
- * @defaultValue `""`
2297
- */
2359
+ * Title of the component
2360
+ *
2361
+ * @defaultValue `""`
2362
+ */
2298
2363
  title?: string;
2364
+ /**
2365
+ * A custom search bar component to display in the header.
2366
+ *
2367
+ * @remarks
2368
+ * When provided, this component overrides the default search bar and the `hideSearch` property.
2369
+ * The custom search view will be displayed even if `hideSearch` is set to true.
2370
+ */
2371
+ searchView?: JSX.Element;
2372
+ /**
2373
+ * Callback triggered when the search bar is clicked.
2374
+ */
2375
+ onSearchBarClicked?: () => void;
2376
+ /**
2377
+ * Show shimmer effect on top of the list
2378
+ *
2379
+ * @defaultValue `false`
2380
+ */
2381
+ showShimmerOnTop?: boolean;
2299
2382
  /**
2300
2383
  * Controls the visibility of the scrollbar in the list.
2301
2384
  * @defaultValue `false`
@@ -2707,7 +2790,7 @@ declare class LinkPreviewExtensionDecorator extends DataSourceDecorator {
2707
2790
  * @param {any} [additionalConfigurations] - Additional configurations for formatting.
2708
2791
  * @returns {JSX.Element} The JSX element representing the message content view.
2709
2792
  */
2710
- getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: any): react_jsx_runtime.JSX.Element | Element;
2793
+ getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: any): Element | React__default.JSX.Element;
2711
2794
  /**
2712
2795
  * Retrieves the style for the link preview wrapper.
2713
2796
  * @returns {object} The style object for the link preview wrapper.
@@ -2801,7 +2884,7 @@ declare class MessageTranslationExtensionDecorator extends DataSourceDecorator {
2801
2884
  * @param {any} [additionalConfigurations] - Optional additional configurations for the content view.
2802
2885
  * @returns {JSX.Element} The content view for the text message.
2803
2886
  */
2804
- getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: any): react_jsx_runtime.JSX.Element | Element;
2887
+ getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: any): Element | React.JSX.Element;
2805
2888
  /**
2806
2889
  * Checks if an option with the specified ID already exists in the options list.
2807
2890
  *
@@ -3144,7 +3227,7 @@ declare class ThumbnailGenerationExtensionDecorator extends DataSourceDecorator
3144
3227
  * @param {ImageBubbleStyle} [style] - Optional style for the image bubble.
3145
3228
  * @returns {React.ReactNode} The rendered image message bubble.
3146
3229
  */
3147
- getImageMessageBubble(imageUrl: string, placeholderImage: string, message: CometChat.MediaMessage, onClick?: Function): React.JSX.Element | Element;
3230
+ getImageMessageBubble(imageUrl: string, placeholderImage: string, message: CometChat.MediaMessage, onClick?: Function): Element | React.JSX.Element;
3148
3231
  /**
3149
3232
  * Provides the video message bubble with support for thumbnail generation.
3150
3233
  * It checks for a thumbnail URL in the message metadata and uses it if available.
@@ -3155,7 +3238,7 @@ declare class ThumbnailGenerationExtensionDecorator extends DataSourceDecorator
3155
3238
  * @param {Function} [onClick] - Optional click event handler.
3156
3239
  * @returns {React.ReactNode} The rendered video message bubble.
3157
3240
  */
3158
- getVideoMessageBubble(videoUrl: string, message: CometChat.MediaMessage, thumbnailUrl?: string, onClick?: Function): React.JSX.Element | Element;
3241
+ getVideoMessageBubble(videoUrl: string, message: CometChat.MediaMessage, thumbnailUrl?: string, onClick?: Function): Element | React.JSX.Element;
3159
3242
  }
3160
3243
 
3161
3244
  declare class CallingExtensionDecorator extends DataSourceDecorator {
@@ -3561,9 +3644,22 @@ interface ConversationsProps {
3561
3644
  */
3562
3645
  trailingView?: (conversation: CometChat.Conversation) => JSX.Element;
3563
3646
  /**
3564
- * Controls the visibility of the scrollbar in the list.
3647
+ * A custom search bar component to display in the Conversations header.
3648
+ */
3649
+ searchView?: JSX.Element;
3650
+ /**
3651
+ * Callback triggered when the search bar is clicked.
3652
+ */
3653
+ onSearchBarClicked?: () => void;
3654
+ /**
3655
+ * Determines whether to display the search bar in the Conversations header.
3656
+ *
3565
3657
  * @defaultValue `false`
3566
3658
  */
3659
+ showSearchBar?: boolean;
3660
+ /** Controls the visibility of the scrollbar in the list.
3661
+ * @defaultValue `false`
3662
+ */
3567
3663
  showScrollbar?: boolean;
3568
3664
  }
3569
3665
  /**
@@ -4054,6 +4150,16 @@ interface MessageHeaderProps {
4054
4150
  * @default false
4055
4151
  */
4056
4152
  showConversationSummaryButton?: boolean;
4153
+ /**
4154
+ * Shows the search option.
4155
+ * @default false
4156
+ */
4157
+ showSearchOption?: boolean;
4158
+ /**
4159
+ * Callback function triggered when search option is clicked.
4160
+ * @returns void
4161
+ */
4162
+ onSearchOptionClicked?: () => void;
4057
4163
  /**
4058
4164
  * Hides the back button in the header in mobile view.
4059
4165
  * @deprecated Use 'showBackButton' prop instead. This prop is deprecated and will be removed in future versions.
@@ -4140,6 +4246,11 @@ interface MessageHeaderProps {
4140
4246
  * Format for displaying the "last active" timestamp in the message header.
4141
4247
  */
4142
4248
  lastActiveAtDateTimeFormat?: CalendarObject;
4249
+ /**
4250
+ * Callback function triggered when the message header item is clicked.
4251
+ * @returns void
4252
+ */
4253
+ onItemClick?: () => void;
4143
4254
  }
4144
4255
  /** Functional component for rendering the CometChatMessageHeader */
4145
4256
  declare const CometChatMessageHeader: (props: MessageHeaderProps) => react_jsx_runtime.JSX.Element;
@@ -4355,6 +4466,12 @@ interface MessageListProps {
4355
4466
  * Format for timestamps displayed in message details (e.g., delivery or read time).
4356
4467
  */
4357
4468
  messageInfoDateTimeFormat?: CalendarObject;
4469
+ /**
4470
+ * ID of the message to automatically scroll to when the message list loads.
4471
+ * @type {string}
4472
+ * @optional
4473
+ */
4474
+ goToMessageId?: string;
4358
4475
  /**
4359
4476
  * Controls the visibility of the scrollbar in the list.
4360
4477
  * @defaultValue `false`
@@ -5101,6 +5218,7 @@ interface ContextMenuProps {
5101
5218
  closeOnOutsideClick?: boolean;
5102
5219
  disableBackgroundInteraction?: boolean;
5103
5220
  useParentContainer?: boolean;
5221
+ useParentHeight?: boolean;
5104
5222
  }
5105
5223
  /**
5106
5224
  * CometChatContextMenu is a composite component used to display menu data in required format.
@@ -5899,6 +6017,13 @@ declare function sanitizeCalendarObject(calendarObject?: CalendarObject): {
5899
6017
  };
5900
6018
  declare function fireClickEvent(): void;
5901
6019
  declare const decodeHTML: (input: string) => string;
6020
+ /**
6021
+ * Custom React hook for creating debounced callbacks with automatic cleanup.
6022
+ */
6023
+ declare const useDebouncedCallback: (callback: () => void, delay: number) => {
6024
+ debouncedCallback: () => void;
6025
+ cleanup: () => void;
6026
+ };
5902
6027
 
5903
6028
  /**
5904
6029
  * Utility class for managing local storage with change detection capabilities.
@@ -5992,6 +6117,14 @@ interface CometChatThreadHeaderProps {
5992
6117
  * Array of text formatters for custom styling or formatting of message text bubbles.
5993
6118
  */
5994
6119
  textFormatters?: CometChatTextFormatter[];
6120
+ /**
6121
+ * Callback function triggered when the subtitle is clicked.
6122
+ */
6123
+ onSubtitleClicked?: () => void;
6124
+ /**
6125
+ * Custom subtitle view to display below the thread title.
6126
+ */
6127
+ subtitleView?: JSX.Element;
5995
6128
  /**
5996
6129
  * Controls the visibility of the scrollbar in the list.
5997
6130
  * @defaultValue `false`
@@ -6140,5 +6273,261 @@ declare function useRefSync<T>(value: T): React__default.MutableRefObject<T>;
6140
6273
  declare function useStateRef<T>(initialValue: T): [T, (node: T) => void];
6141
6274
  declare function useCometChatErrorHandler(onError?: ((error: CometChat.CometChatException) => void) | null): (error: unknown, source?: string) => void;
6142
6275
 
6143
- export { AuxiliaryButtonAlignment, ButtonAction, CalendarObject, CallButtonConfiguration, CallWorkflow, CallingConfiguration, CallingDetailsUtils, CallingExtension, CallingExtensionDecorator, ChatConfigurator, ChatSdkEventInitializer, CollaborativeDocumentConfiguration, CollaborativeDocumentExtension, CollaborativeDocumentExtensionDecorator, CollaborativeWhiteBoardExtensionDecorator, CollaborativeWhiteboardConfiguration, CollaborativeWhiteboardExtension, CometChatActionBubble, CometChatActionSheet, CometChatActions, CometChatActionsIcon, CometChatActionsView, CometChatAudioBubble, CometChatAvatar, CometChatButton, CometChatCallBubble, CometChatCallButtons, CometChatCallEvents, CometChatCallLogs, CometChatChangeScope, CometChatCheckbox, CometChatConfirmDialog, CometChatContextMenu, CometChatConversationEvents, CometChatConversations, CometChatDate, CometChatDeleteBubble, CometChatDocumentBubble, CometChatDropDown, CometChatEditPreview, CometChatEmojiKeyboard, CometChatFileBubble, CometChatFullScreenViewer, CometChatGroupEvents, CometChatGroupMembers, CometChatGroups, CometChatImageBubble, CometChatIncomingCall, CometChatList, CometChatListItem, CometChatLocalize, CometChatMediaRecorder, CometChatMentionsFormatter, CometChatMessageBubble, CometChatMessageComposer, CometChatMessageComposerAction, CometChatMessageEvents, CometChatMessageHeader, CometChatMessageInformation, CometChatMessageList, CometChatMessageOption, CometChatMessageTemplate, CometChatOngoingCall, CometChatOption, CometChatOutgoingCall, CometChatPopover, CometChatRadioButton, CometChatReactionInfo, CometChatReactionList, CometChatReactions, CometChatSearchBar, CometChatTextBubble, CometChatTextFormatter, CometChatThreadHeader, CometChatToast, CometChatUIEvents, CometChatUIKit, CometChatUIKitCalls, CometChatUIKitConstants, CometChatUIKitLoginListener, CometChatUIKitUtility, CometChatUrlsFormatter, CometChatUserEvents, CometChatUserMemberWrapper, CometChatUsers, CometChatUtilityConstants, CometChatVideoBubble, ConversationUtils, DataSource, DataSourceDecorator, DateTimePickerMode, DocumentIconAlignment, ElementType, EnterKeyBehavior, ExtensionsDataSource, GroupMemberUtils, HTTPSRequestMethods, IconButtonAlignment, LabelAlignment, LinkPreviewExtension, LinkPreviewExtensionDecorator, MentionsTargetElement, MentionsVisibility, MessageBubbleAlignment, MessageListAlignment, MessageReceiptUtils, MessageStatus, MessageTranslationExtension, MessageTranslationExtensionDecorator, MessageUtils, MessagesDataSource, MouseEventSource, OutgoingCallConfiguration, PanelAlignment, Placement$1 as Placement, PollsConfiguration, PollsExtension, PollsExtensionDecorator, PreviewMessageMode, Receipts, RecordingType, SelectionMode, States, StickersExtension, StickersExtensionDecorator, StorageUtils, TabAlignment, TabsVisibility, ThumbnailGenerationExtension, ThumbnailGenerationExtensionDecorator, TimestampAlignment, TitleAlignment, UIKitSettings, UIKitSettingsBuilder, UserMemberListType, closeCurrentMediaPlayer, convertMinutesToHoursMinutesSeconds, convertSecondsToHoursMinutesSeconds, currentAudioPlayer, currentMediaPlayer, decodeHTML, downloadRecordingFromURL, fireClickEvent, formatDateFromTimestamp, getLocalizedString, getThemeMode, getThemeVariable, isMessageSentByMe, isMissedCall, isMobileDevice, isSafari, isSentByMe, isURL, processFileForAudio, sanitizeCalendarObject, sanitizeHtml, useCometChatErrorHandler, useRefSync, useStateRef, verifyCallUser };
6276
+ /**
6277
+ * Checks if two dates (timestamps) are from different months or years
6278
+ *
6279
+ * @param firstDate - First timestamp to compare in milliseconds
6280
+ * @param secondDate - Second timestamp to compare in milliseconds
6281
+ * @param errorHandler - Optional error handler function for exception handling
6282
+ * @returns boolean indicating if the dates belong to different months or years
6283
+ */
6284
+ declare function isMonthDifferent(firstDate?: number, secondDate?: number, errorHandler?: (error: unknown, source?: string) => void): boolean;
6285
+ /**
6286
+ * Get common date format based on provided custom format
6287
+ * @returns CalendarObject with format specifications
6288
+ */
6289
+ declare function getCommonDateFormat(customFormat?: CalendarObject): CalendarObject;
6290
+ /**
6291
+ * Checks if message search criteria are valid
6292
+ * Returns true if search keyword exists or if valid filters are active
6293
+ */
6294
+ declare function hasValidMessageSearchCriteria(searchKeyword: string, filters: CometChatSearchFilter[]): boolean;
6295
+ /**
6296
+ * Checks if conversation search criteria are valid
6297
+ * Returns true if search keyword exists or if valid filters are active
6298
+ */
6299
+ declare function hasValidConversationSearchCriteria(searchKeyword: string, filters: CometChatSearchFilter[]): boolean;
6300
+ /**
6301
+ * Checks if a message has link preview metadata
6302
+ */
6303
+ declare function hasLink(metadata: any): boolean;
6304
+
6305
+ /**
6306
+ * Props for the CometChatSearch component
6307
+ */
6308
+ interface SearchProps {
6309
+ /**
6310
+ * Callback triggered when the back button is clicked
6311
+ * Use this to handle navigation when user clicks the back button
6312
+ *
6313
+ * @defaultValue () => {}
6314
+ */
6315
+ onBack?: () => void;
6316
+ /**
6317
+ * Whether to hide the back button
6318
+ *
6319
+ * @defaultValue false - back button is shown
6320
+ */
6321
+ hideBackButton?: boolean;
6322
+ /**
6323
+ * Callback triggered when a conversation is clicked in search results
6324
+ * Receives the conversation object and the search keyword that was used
6325
+ *
6326
+ * @param conversation - The conversation that was clicked
6327
+ * @param searchKeyword - The keyword that was used in the search
6328
+ */
6329
+ onConversationClicked?: (conversation: CometChat.Conversation, searchKeyword?: string) => void;
6330
+ /**
6331
+ * Callback triggered when a message is clicked in search results
6332
+ * Receives the message object and the search keyword that was used
6333
+ *
6334
+ * @param message - The message that was clicked
6335
+ * @param searchKeyword - The keyword that was used in the search
6336
+ */
6337
+ onMessageClicked?: (message: CometChat.BaseMessage, searchKeyword?: string) => void;
6338
+ /**
6339
+ * Array of search filters to display in the filter bar
6340
+ * These allow users to narrow down their search results
6341
+ *
6342
+ * @defaultValue All available filters (Audio, Documents, Groups, Photos, Videos, Links, Unread)
6343
+ */
6344
+ searchFilters?: Array<CometChatSearchFilter>;
6345
+ /**
6346
+ * Filter that should be active by default when the component loads
6347
+ * This allows pre-filtering the search results
6348
+ */
6349
+ initialSearchFilter?: CometChatSearchFilter;
6350
+ /**
6351
+ * Scopes to search in (Conversations, Messages, or both)
6352
+ * Controls whether to search in conversations, messages, or both
6353
+ *
6354
+ * @defaultValue [CometChatSearchScope.All] - searches in both conversations and messages
6355
+ */
6356
+ searchIn?: Array<CometChatSearchScope>;
6357
+ /**
6358
+ * Custom view for conversation items in the search results
6359
+ * Use this to completely customize how conversation items are rendered
6360
+ *
6361
+ * @param conversation - The conversation object to render
6362
+ * @returns JSX element representing the conversation item
6363
+ */
6364
+ conversationItemView?: (conversation: CometChat.Conversation) => JSX.Element;
6365
+ /**
6366
+ * Custom leading view for conversation items (typically avatar/icon)
6367
+ * Use this to customize just the leading section of conversation items
6368
+ *
6369
+ * @param conversation - The conversation object to render the leading view for
6370
+ * @returns JSX element for the leading part of the conversation item
6371
+ */
6372
+ conversationLeadingView?: (conversation: CometChat.Conversation) => JSX.Element;
6373
+ /**
6374
+ * Custom title view for conversation items
6375
+ * Use this to customize how the title of conversation items is displayed
6376
+ *
6377
+ * @param conversation - The conversation object to render the title for
6378
+ * @returns JSX element for the title of the conversation item
6379
+ */
6380
+ conversationTitleView?: (conversation: CometChat.Conversation) => JSX.Element;
6381
+ /**
6382
+ * Custom subtitle view for conversation items
6383
+ * Use this to customize how the subtitle (typically last message) is displayed
6384
+ *
6385
+ * @param conversation - The conversation object to render the subtitle for
6386
+ * @returns JSX element for the subtitle of the conversation item
6387
+ */
6388
+ conversationSubtitleView?: (conversation: CometChat.Conversation) => JSX.Element;
6389
+ /**
6390
+ * Custom trailing view for conversation items (typically timestamp)
6391
+ * Use this to customize what appears at the end of conversation items
6392
+ *
6393
+ * @param conversation - The conversation object to render the trailing view for
6394
+ * @returns JSX element for the trailing part of the conversation item
6395
+ */
6396
+ conversationTrailingView?: (conversation: CometChat.Conversation) => JSX.Element;
6397
+ /**
6398
+ * Request builder for conversations search
6399
+ * Use this to customize the conversation search request parameters
6400
+ *
6401
+ * @defaultValue New instance with default parameters and search keyword
6402
+ */
6403
+ conversationsRequestBuilder?: CometChat.ConversationsRequestBuilder;
6404
+ /**
6405
+ * Custom view for message items in the search results
6406
+ * Use this to completely customize how message items are rendered
6407
+ *
6408
+ * @param message - The message object to render
6409
+ * @returns JSX element representing the message item
6410
+ */
6411
+ messageItemView?: (message: CometChat.BaseMessage) => JSX.Element;
6412
+ /**
6413
+ * Custom leading view for message items (typically sender avatar/icon)
6414
+ * Use this to customize just the leading section of message items
6415
+ *
6416
+ * @param message - The message object to render the leading view for
6417
+ * @returns JSX element for the leading part of the message item
6418
+ */
6419
+ messageLeadingView?: (message: CometChat.BaseMessage) => JSX.Element;
6420
+ /**
6421
+ * Custom title view for message items (typically sender name)
6422
+ * Use this to customize how the title of message items is displayed
6423
+ *
6424
+ * @param message - The message object to render the title for
6425
+ * @returns JSX element for the title of the message item
6426
+ */
6427
+ messageTitleView?: (message: CometChat.BaseMessage) => JSX.Element;
6428
+ /**
6429
+ * Custom subtitle view for message items (typically message content)
6430
+ * Use this to customize how the subtitle/content is displayed
6431
+ *
6432
+ * @param message - The message object to render the subtitle for
6433
+ * @returns JSX element for the subtitle of the message item
6434
+ */
6435
+ messageSubtitleView?: (message: CometChat.BaseMessage) => JSX.Element;
6436
+ /**
6437
+ * Custom trailing view for message items (typically timestamp)
6438
+ * Use this to customize what appears at the end of message items
6439
+ *
6440
+ * @param message - The message object to render the trailing view for
6441
+ * @returns JSX element for the trailing part of the message item
6442
+ */
6443
+ messageTrailingView?: (message: CometChat.BaseMessage) => JSX.Element;
6444
+ /**
6445
+ * Request builder for messages search
6446
+ * Use this to customize the message search request parameters
6447
+ *
6448
+ * @defaultValue New instance with default parameters and search keyword
6449
+ */
6450
+ messagesRequestBuilder?: CometChat.MessagesRequestBuilder;
6451
+ /**
6452
+ * Custom view for empty state when no search results are found
6453
+ * This will be displayed when search returns no results
6454
+ */
6455
+ emptyView?: JSX.Element;
6456
+ /**
6457
+ * Custom view for error state when search fails
6458
+ * This will be displayed when an error occurs during search
6459
+ */
6460
+ errorView?: JSX.Element;
6461
+ /**
6462
+ * Custom view for loading state during search
6463
+ * This will be displayed while search is in progress
6464
+ */
6465
+ loadingView?: JSX.Element;
6466
+ /**
6467
+ * Custom view for initial state before user enters a search query
6468
+ * This will be displayed when the search component first loads
6469
+ *
6470
+ * @defaultValue Basic prompt encouraging user to search
6471
+ */
6472
+ initialView?: JSX.Element;
6473
+ /**
6474
+ * Format for message sent date/time in the UI
6475
+ * Customize how timestamps are displayed in message items
6476
+ */
6477
+ messageSentAtDateTimeFormat?: CalendarObject;
6478
+ /**
6479
+ * Custom text formatters for message content
6480
+ * Use these to customize how message text is formatted (e.g., emoji, links, mentions)
6481
+ */
6482
+ textFormatters?: CometChatTextFormatter[];
6483
+ /**
6484
+ * Whether to hide the group type icon in group conversations
6485
+ *
6486
+ * @defaultValue false - group type icons are shown
6487
+ */
6488
+ hideGroupType?: boolean;
6489
+ /**
6490
+ * Whether to hide user online/offline status indicators
6491
+ *
6492
+ * @defaultValue false - user status is shown
6493
+ */
6494
+ hideUserStatus?: boolean;
6495
+ /**
6496
+ * Whether to hide message receipt indicators (sent/delivered/read)
6497
+ *
6498
+ * @defaultValue false - receipts are shown
6499
+ */
6500
+ hideReceipts?: boolean;
6501
+ /**
6502
+ * User ID to search within specific user's messages
6503
+ * When provided, search will be limited to messages with this user
6504
+ */
6505
+ uid?: string;
6506
+ /**
6507
+ * Group ID to search within specific group's messages
6508
+ * When provided, search will be limited to messages in this group
6509
+ */
6510
+ guid?: string;
6511
+ /**
6512
+ * Custom options for conversation items in search results
6513
+ * Function that returns array of options (e.g., for context menu)
6514
+ *
6515
+ * @param conversation - The conversation to generate options for
6516
+ * @returns Array of option objects or null for no options
6517
+ */
6518
+ conversationOptions?: ((conversation: CometChat.Conversation) => CometChatOption[]) | null;
6519
+ /**
6520
+ * Custom error handler for search operations
6521
+ * Override the default error handling behavior
6522
+ *
6523
+ * @param error - The error that occurred during a search operation
6524
+ */
6525
+ onError?: (error: CometChat.CometChatException) => void;
6526
+ }
6527
+ /**
6528
+ * CometChatSearch component for searching conversations and messages in CometChat
6529
+ */
6530
+ declare function CometChatSearch(props: SearchProps): react_jsx_runtime.JSX.Element;
6531
+
6532
+ export { AuxiliaryButtonAlignment, ButtonAction, CalendarObject, CallButtonConfiguration, CallWorkflow, CallingConfiguration, CallingDetailsUtils, CallingExtension, CallingExtensionDecorator, ChatConfigurator, ChatSdkEventInitializer, CollaborativeDocumentConfiguration, CollaborativeDocumentExtension, CollaborativeDocumentExtensionDecorator, CollaborativeWhiteBoardExtensionDecorator, CollaborativeWhiteboardConfiguration, CollaborativeWhiteboardExtension, CometChatActionBubble, CometChatActionSheet, CometChatActions, CometChatActionsIcon, CometChatActionsView, CometChatAudioBubble, CometChatAvatar, CometChatButton, CometChatCallBubble, CometChatCallButtons, CometChatCallEvents, CometChatCallLogs, CometChatChangeScope, CometChatCheckbox, CometChatConfirmDialog, CometChatContextMenu, CometChatConversationEvents, CometChatConversations, CometChatDate, CometChatDeleteBubble, CometChatDocumentBubble, CometChatDropDown, CometChatEditPreview, CometChatEmojiKeyboard, CometChatFileBubble, CometChatFullScreenViewer, CometChatGroupEvents, CometChatGroupMembers, CometChatGroups, CometChatImageBubble, CometChatIncomingCall, CometChatList, CometChatListItem, CometChatLocalize, CometChatMediaRecorder, CometChatMentionsFormatter, CometChatMessageBubble, CometChatMessageComposer, CometChatMessageComposerAction, CometChatMessageEvents, CometChatMessageHeader, CometChatMessageInformation, CometChatMessageList, CometChatMessageOption, CometChatMessageTemplate, CometChatOngoingCall, CometChatOption, CometChatOutgoingCall, CometChatPopover, CometChatRadioButton, CometChatReactionInfo, CometChatReactionList, CometChatReactions, CometChatSearch, CometChatSearchBar, CometChatSearchFilter, CometChatSearchScope, CometChatTextBubble, CometChatTextFormatter, CometChatTextHighlightFormatter, CometChatThreadHeader, CometChatToast, CometChatUIEvents, CometChatUIKit, CometChatUIKitCalls, CometChatUIKitConstants, CometChatUIKitLoginListener, CometChatUIKitUtility, CometChatUrlsFormatter, CometChatUserEvents, CometChatUserMemberWrapper, CometChatUsers, CometChatUtilityConstants, CometChatVideoBubble, ConversationUtils, DataSource, DataSourceDecorator, DateTimePickerMode, DocumentIconAlignment, ElementType, EnterKeyBehavior, ExtensionsDataSource, GroupMemberUtils, HTTPSRequestMethods, IconButtonAlignment, LabelAlignment, LinkPreviewExtension, LinkPreviewExtensionDecorator, MentionsTargetElement, MentionsVisibility, MessageBubbleAlignment, MessageListAlignment, MessageReceiptUtils, MessageStatus, MessageTranslationExtension, MessageTranslationExtensionDecorator, MessageUtils, MessagesDataSource, MouseEventSource, OutgoingCallConfiguration, PanelAlignment, Placement$1 as Placement, PollsConfiguration, PollsExtension, PollsExtensionDecorator, PreviewMessageMode, Receipts, RecordingType, SelectionMode, States, StickersExtension, StickersExtensionDecorator, StorageUtils, TabAlignment, TabsVisibility, ThumbnailGenerationExtension, ThumbnailGenerationExtensionDecorator, TimestampAlignment, TitleAlignment, UIKitSettings, UIKitSettingsBuilder, UserMemberListType, closeCurrentMediaPlayer, convertMinutesToHoursMinutesSeconds, convertSecondsToHoursMinutesSeconds, currentAudioPlayer, currentMediaPlayer, decodeHTML, downloadRecordingFromURL, fireClickEvent, formatDateFromTimestamp, getCommonDateFormat, getLocalizedString, getThemeMode, getThemeVariable, hasLink, hasValidConversationSearchCriteria, hasValidMessageSearchCriteria, isMessageSentByMe, isMissedCall, isMobileDevice, isMonthDifferent, isSafari, isSentByMe, isURL, processFileForAudio, sanitizeCalendarObject, sanitizeHtml, useCometChatErrorHandler, useDebouncedCallback, useRefSync, useStateRef, verifyCallUser };
6144
6533
  export type { IActiveChatChanged, IDialog, IGroupLeft, IGroupMemberAdded, IGroupMemberJoined, IGroupMemberKickedBanned, IGroupMemberScopeChanged, IGroupMemberUnBanned, IMentionsCountWarning, IMessages, IModal, IMouseEvent, IOpenChat, IOwnershipChanged, IPanel, IShowOngoingCall, LocalizationSettings, PollOptions };