@cometchat/chat-uikit-react 6.0.6 → 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.
- package/dist/assets/audio_filter_icon.svg +3 -0
- package/dist/assets/chats_filter_icon.svg +1 -0
- package/dist/assets/file_filter_icon.svg +4 -0
- package/dist/assets/group_filter_icon.svg +3 -0
- package/dist/assets/link_filter_icon.svg +3 -0
- package/dist/assets/link_icon_2x.svg +3 -0
- package/dist/assets/messages_filter_icon.svg +1 -0
- package/dist/assets/photo_filter_icon.svg +3 -0
- package/dist/assets/search_message_icon.svg +14 -0
- package/dist/assets/unread_filter_icon.svg +7 -0
- package/dist/assets/video_filter_icon.svg +3 -0
- package/dist/index.d.ts +493 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/CometChatActionSheet.css +1 -4
- package/dist/styles/CometChatChangeScope.css +1 -4
- package/dist/styles/CometChatConversations.css +16 -1
- package/dist/styles/CometChatEmojiKeyboard.css +1 -6
- package/dist/styles/CometChatGroupMembers.css +7 -2
- package/dist/styles/CometChatList.css +12 -3
- package/dist/styles/CometChatMessageComposer.css +34 -1
- package/dist/styles/CometChatMessageHeader.css +55 -12
- package/dist/styles/CometChatMessageInformation.css +7 -7
- package/dist/styles/CometChatMessageList.css +42 -13
- package/dist/styles/CometChatReactionList.css +0 -6
- package/dist/styles/CometChatSearch.css +948 -0
- package/dist/styles/CometChatThreadHeader.css +18 -3
- package/dist/styles/StickersKeyboard.css +0 -20
- package/dist/styles/components/CometChatActionSheet.css +1 -4
- package/dist/styles/components/CometChatChangeScope.css +1 -4
- package/dist/styles/components/CometChatConversations.css +16 -1
- package/dist/styles/components/CometChatEmojiKeyboard.css +1 -6
- package/dist/styles/components/CometChatGroupMembers.css +7 -2
- package/dist/styles/components/CometChatList.css +12 -3
- package/dist/styles/components/CometChatMessageComposer.css +34 -1
- package/dist/styles/components/CometChatMessageHeader.css +55 -12
- package/dist/styles/components/CometChatMessageInformation.css +7 -7
- package/dist/styles/components/CometChatMessageList.css +42 -13
- package/dist/styles/components/CometChatReactionList.css +0 -6
- package/dist/styles/components/CometChatSearch.css +948 -0
- package/dist/styles/components/CometChatThreadHeader.css +18 -3
- package/dist/styles/components/StickersKeyboard.css +0 -20
- package/dist/styles/components/index.css +5 -0
- package/dist/styles/index.css +5 -0
- package/dist/types/Enums/Enums.d.ts +37 -0
- package/dist/types/components/BaseComponents/CometChatContextMenu/CometChatContextMenu.d.ts +1 -0
- package/dist/types/components/BaseComponents/CometChatList/CometChatList.d.ts +29 -4
- package/dist/types/components/Calling/CometChatCallLogs/CometChatCallLogs.d.ts +5 -0
- package/dist/types/components/CometChatConversations/CometChatConversations.d.ts +18 -0
- package/dist/types/components/CometChatGroupMembers/CometChatGroupMembers.d.ts +5 -0
- package/dist/types/components/CometChatGroups/CometChatGroups.d.ts +5 -0
- package/dist/types/components/CometChatMessageComposer/CometChatMessageComposer.d.ts +5 -0
- package/dist/types/components/CometChatMessageHeader/CometChatMessageHeader.d.ts +15 -0
- package/dist/types/components/CometChatMessageInformation/CometChatMessageInformation.d.ts +5 -0
- package/dist/types/components/CometChatMessageList/CometChatMessageList.d.ts +11 -0
- package/dist/types/components/CometChatMessageList/useCometChatMessageList.d.ts +1 -1
- package/dist/types/components/CometChatSearch/CometChatSearch.d.ts +240 -0
- package/dist/types/components/CometChatSearch/SearchConversationsManager.d.ts +50 -0
- package/dist/types/components/CometChatSearch/useCometChatSearchConversationsList.d.ts +207 -0
- package/dist/types/components/CometChatSearch/useCometChatSearchMessagesList.d.ts +127 -0
- package/dist/types/components/CometChatThreadHeader/CometChatThreadHeader.d.ts +13 -0
- package/dist/types/components/CometChatUserMemberWrapper/CometChatUserMemberWrapper.d.ts +48 -0
- package/dist/types/components/CometChatUsers/CometChatUsers.d.ts +6 -0
- package/dist/types/formatters/CometChatFormatters/CometChatTextHighlightFormatter/CometChatTextHighlightFormatter.d.ts +26 -0
- package/dist/types/formatters/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/modals/CometChatSearchFilterOption.d.ts +34 -0
- package/dist/types/utils/SearchUtils.d.ts +30 -0
- package/dist/types/utils/util.d.ts +7 -0
- package/package.json +4 -3
|
@@ -21,18 +21,33 @@
|
|
|
21
21
|
background: var(--cometchat-background-color-01, #FFF);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.cometchat-thread-header__top-bar-title {
|
|
24
|
+
.cometchat-thread-header__top-bar-title-container {
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
justify-content: center;
|
|
28
28
|
align-items: flex-start;
|
|
29
29
|
flex: 1 0 0;
|
|
30
30
|
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cometchat-thread-header__top-bar-title {
|
|
31
34
|
color: var(--cometchat-text-color-primary, #141414);
|
|
32
35
|
text-overflow: ellipsis;
|
|
33
36
|
font: var(--cometchat-font-heading3-bold, 700 20px Roboto);
|
|
34
37
|
}
|
|
35
38
|
|
|
39
|
+
.cometchat-thread-header__top-bar-subtitle-text{
|
|
40
|
+
color: var(--cometchat-text-color-secondary, #727272);
|
|
41
|
+
font: var(--cometchat-font-caption1-regular, 400 12px Roboto);
|
|
42
|
+
text-overflow: ellipsis;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.cometchat-thread-header__top-bar-subtitle-text-clickable {
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
}
|
|
50
|
+
|
|
36
51
|
.cometchat-thread-header__top-bar-close {
|
|
37
52
|
display: flex;
|
|
38
53
|
width: 24px;
|
|
@@ -102,8 +117,8 @@
|
|
|
102
117
|
flex: 1 0 0;
|
|
103
118
|
}
|
|
104
119
|
|
|
105
|
-
.cometchat-thread-header__message::-webkit-scrollbar,
|
|
106
|
-
.cometchat-thread-header__message::-webkit-scrollbar-thumb {
|
|
120
|
+
.cometchat-thread-header-hide-scrollbar .cometchat-thread-header__message::-webkit-scrollbar,
|
|
121
|
+
.cometchat-thread-header-hide-scrollbar .cometchat-thread-header__message::-webkit-scrollbar-thumb {
|
|
107
122
|
display: none;
|
|
108
123
|
}
|
|
109
124
|
|
|
@@ -77,26 +77,6 @@
|
|
|
77
77
|
cursor: pointer;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.cometchat-sticker-keyboard__tabs::-webkit-scrollbar {
|
|
81
|
-
background: transparent;
|
|
82
|
-
height: 0px;
|
|
83
|
-
width: 0px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.cometchat-sticker-keyboard__tabs::-webkit-scrollbar-thumb {
|
|
87
|
-
background: rgb(232, 229, 229);
|
|
88
|
-
border-radius: 8px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.cometchat-sticker-keyboard__list::-webkit-scrollbar {
|
|
92
|
-
background: transparent;
|
|
93
|
-
width: 0px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.cometchat-sticker-keyboard__list::-webkit-scrollbar-thumb {
|
|
97
|
-
background: rgb(232, 229, 229);
|
|
98
|
-
border-radius: 8px;
|
|
99
|
-
}
|
|
100
80
|
|
|
101
81
|
|
|
102
82
|
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
@import url('./CometChatOngoingCall.css');
|
|
55
55
|
@import url('./CometChatThreadHeader.css');
|
|
56
56
|
@import url('./CometChatToast.css');
|
|
57
|
+
@import url('./CometChatSearch.css');
|
|
57
58
|
|
|
58
59
|
.cometchat * {
|
|
59
60
|
box-sizing: border-box;
|
|
@@ -109,4 +110,8 @@ font:var(--cometchat-font-body-regular);
|
|
|
109
110
|
}
|
|
110
111
|
.cometchat-text-bubble .cometchat-url{
|
|
111
112
|
text-decoration: underline;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.cometchat-text-bubble .cometchat-text-highlight {
|
|
116
|
+
font: var(--cometchat-font-body-bold);
|
|
112
117
|
}
|
package/dist/styles/index.css
CHANGED
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
@import url('./CometChatOngoingCall.css');
|
|
55
55
|
@import url('./CometChatThreadHeader.css');
|
|
56
56
|
@import url('./CometChatToast.css');
|
|
57
|
+
@import url('./CometChatSearch.css');
|
|
57
58
|
|
|
58
59
|
.cometchat * {
|
|
59
60
|
box-sizing: border-box;
|
|
@@ -109,4 +110,8 @@ font:var(--cometchat-font-body-regular);
|
|
|
109
110
|
}
|
|
110
111
|
.cometchat-text-bubble .cometchat-url{
|
|
111
112
|
text-decoration: underline;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.cometchat-text-bubble .cometchat-text-highlight {
|
|
116
|
+
font: var(--cometchat-font-body-bold);
|
|
112
117
|
}
|
|
@@ -256,3 +256,40 @@ export declare enum MentionsVisibility {
|
|
|
256
256
|
groupConversationOnly = 1,
|
|
257
257
|
both = 2
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Specifies the scope of the search functionality.
|
|
261
|
+
*
|
|
262
|
+
* @remarks
|
|
263
|
+
* - `Conversations`: Limits the search to conversations only.
|
|
264
|
+
* - `Messages`: Limits the search to messages only.
|
|
265
|
+
*
|
|
266
|
+
*/
|
|
267
|
+
export declare enum CometChatSearchScope {
|
|
268
|
+
Conversations = "conversations",
|
|
269
|
+
Messages = "messages"
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Specifies the filters available for the search functionality.
|
|
273
|
+
*
|
|
274
|
+
* @remarks
|
|
275
|
+
* - `Messages`: Filters to search within messages.
|
|
276
|
+
* - `Conversations`: Filters to search within conversations.
|
|
277
|
+
* - `Unread`: Filters to search for unread messages.
|
|
278
|
+
* - `Groups`: Filters to search within groups.
|
|
279
|
+
* - `Photos`: Filters to search for photo messages.
|
|
280
|
+
* - `Videos`: Filters to search for video messages.
|
|
281
|
+
* - `Links`: Filters to search for links shared in messages.
|
|
282
|
+
* - `Documents`: Filters to search for document files.
|
|
283
|
+
* - `Audio`: Filters to search for audio messages.
|
|
284
|
+
*/
|
|
285
|
+
export declare enum CometChatSearchFilter {
|
|
286
|
+
Messages = "messages",
|
|
287
|
+
Conversations = "conversations",
|
|
288
|
+
Unread = "unread",
|
|
289
|
+
Groups = "groups",
|
|
290
|
+
Photos = "photos",
|
|
291
|
+
Videos = "videos",
|
|
292
|
+
Links = "links",
|
|
293
|
+
Documents = "files",
|
|
294
|
+
Audio = "audio"
|
|
295
|
+
}
|
|
@@ -9,6 +9,7 @@ interface ContextMenuProps {
|
|
|
9
9
|
closeOnOutsideClick?: boolean;
|
|
10
10
|
disableBackgroundInteraction?: boolean;
|
|
11
11
|
useParentContainer?: boolean;
|
|
12
|
+
useParentHeight?: boolean;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* CometChatContextMenu is a composite component used to display menu data in required format.
|
|
@@ -12,6 +12,8 @@ interface ListProps<T> {
|
|
|
12
12
|
* Hide the search bar
|
|
13
13
|
*
|
|
14
14
|
* @defaulValue `false`
|
|
15
|
+
* @remarks
|
|
16
|
+
* This property is ignored when a custom `searchView` is provided
|
|
15
17
|
*/
|
|
16
18
|
hideSearch?: boolean;
|
|
17
19
|
/**
|
|
@@ -110,11 +112,34 @@ interface ListProps<T> {
|
|
|
110
112
|
*/
|
|
111
113
|
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
112
114
|
/**
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
* Title of the component
|
|
116
|
+
*
|
|
117
|
+
* @defaultValue `""`
|
|
118
|
+
*/
|
|
117
119
|
title?: string;
|
|
120
|
+
/**
|
|
121
|
+
* A custom search bar component to display in the header.
|
|
122
|
+
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* When provided, this component overrides the default search bar and the `hideSearch` property.
|
|
125
|
+
* The custom search view will be displayed even if `hideSearch` is set to true.
|
|
126
|
+
*/
|
|
127
|
+
searchView?: JSX.Element;
|
|
128
|
+
/**
|
|
129
|
+
* Callback triggered when the search bar is clicked.
|
|
130
|
+
*/
|
|
131
|
+
onSearchBarClicked?: () => void;
|
|
132
|
+
/**
|
|
133
|
+
* Show shimmer effect on top of the list
|
|
134
|
+
*
|
|
135
|
+
* @defaultValue `false`
|
|
136
|
+
*/
|
|
137
|
+
showShimmerOnTop?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Controls the visibility of the scrollbar in the list.
|
|
140
|
+
* @defaultValue `false`
|
|
141
|
+
*/
|
|
142
|
+
showScrollbar?: boolean;
|
|
118
143
|
}
|
|
119
144
|
/**
|
|
120
145
|
* Renders a list component that can display a title, search bar,
|
|
@@ -78,6 +78,11 @@ interface CallLogsProps {
|
|
|
78
78
|
* @returns A JSX element to be rendered as the trailing view.
|
|
79
79
|
*/
|
|
80
80
|
trailingView?: (call: any) => JSX.Element;
|
|
81
|
+
/**
|
|
82
|
+
* Controls the visibility of the scrollbar in the list.
|
|
83
|
+
* @defaultValue `false`
|
|
84
|
+
*/
|
|
85
|
+
showScrollbar?: boolean;
|
|
81
86
|
}
|
|
82
87
|
declare const CometChatCallLogs: (props: CallLogsProps) => import("react/jsx-runtime").JSX.Element;
|
|
83
88
|
export { CometChatCallLogs };
|
|
@@ -151,6 +151,24 @@ interface ConversationsProps {
|
|
|
151
151
|
* @returns A JSX element to be rendered as the trailing view.
|
|
152
152
|
*/
|
|
153
153
|
trailingView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
154
|
+
/**
|
|
155
|
+
* A custom search bar component to display in the Conversations header.
|
|
156
|
+
*/
|
|
157
|
+
searchView?: JSX.Element;
|
|
158
|
+
/**
|
|
159
|
+
* Callback triggered when the search bar is clicked.
|
|
160
|
+
*/
|
|
161
|
+
onSearchBarClicked?: () => void;
|
|
162
|
+
/**
|
|
163
|
+
* Determines whether to display the search bar in the Conversations header.
|
|
164
|
+
*
|
|
165
|
+
* @defaultValue `false`
|
|
166
|
+
*/
|
|
167
|
+
showSearchBar?: boolean;
|
|
168
|
+
/** Controls the visibility of the scrollbar in the list.
|
|
169
|
+
* @defaultValue `false`
|
|
170
|
+
*/
|
|
171
|
+
showScrollbar?: boolean;
|
|
154
172
|
}
|
|
155
173
|
export type Action = {
|
|
156
174
|
type: "appendConversations";
|
|
@@ -156,6 +156,11 @@ interface GroupMembersProps {
|
|
|
156
156
|
* @returns A JSX element to be rendered as the trailing view.
|
|
157
157
|
*/
|
|
158
158
|
trailingView?: (groupMember: CometChat.GroupMember) => JSX.Element;
|
|
159
|
+
/**
|
|
160
|
+
* Controls the visibility of the scrollbar in the list.
|
|
161
|
+
* @defaultValue `false`
|
|
162
|
+
*/
|
|
163
|
+
showScrollbar?: boolean;
|
|
159
164
|
}
|
|
160
165
|
export type Action = {
|
|
161
166
|
type: "appendGroupMembers";
|
|
@@ -121,6 +121,11 @@ interface GroupsProps {
|
|
|
121
121
|
* @returns A JSX element to be rendered as the trailing view.
|
|
122
122
|
*/
|
|
123
123
|
trailingView?: (group: CometChat.Group) => JSX.Element;
|
|
124
|
+
/**
|
|
125
|
+
* Controls the visibility of the scrollbar in the list.
|
|
126
|
+
* @defaultValue `false`
|
|
127
|
+
*/
|
|
128
|
+
showScrollbar?: boolean;
|
|
124
129
|
}
|
|
125
130
|
export type Action = {
|
|
126
131
|
type: "appendGroups";
|
|
@@ -149,6 +149,11 @@ interface MessageComposerProps {
|
|
|
149
149
|
* A custom header section displayed at the top of the message composer, often used for media previews or additional information.
|
|
150
150
|
*/
|
|
151
151
|
headerView?: JSX.Element;
|
|
152
|
+
/**
|
|
153
|
+
* Controls the visibility of the scrollbar in the list.
|
|
154
|
+
* @defaultValue `false`
|
|
155
|
+
*/
|
|
156
|
+
showScrollbar?: boolean;
|
|
152
157
|
}
|
|
153
158
|
/**
|
|
154
159
|
* Represents the state of the message composer.
|
|
@@ -9,6 +9,16 @@ interface MessageHeaderProps {
|
|
|
9
9
|
* @default false
|
|
10
10
|
*/
|
|
11
11
|
showConversationSummaryButton?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Shows the search option.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
showSearchOption?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Callback function triggered when search option is clicked.
|
|
19
|
+
* @returns void
|
|
20
|
+
*/
|
|
21
|
+
onSearchOptionClicked?: () => void;
|
|
12
22
|
/**
|
|
13
23
|
* Hides the back button in the header in mobile view.
|
|
14
24
|
* @deprecated Use 'showBackButton' prop instead. This prop is deprecated and will be removed in future versions.
|
|
@@ -95,6 +105,11 @@ interface MessageHeaderProps {
|
|
|
95
105
|
* Format for displaying the "last active" timestamp in the message header.
|
|
96
106
|
*/
|
|
97
107
|
lastActiveAtDateTimeFormat?: CalendarObject;
|
|
108
|
+
/**
|
|
109
|
+
* Callback function triggered when the message header item is clicked.
|
|
110
|
+
* @returns void
|
|
111
|
+
*/
|
|
112
|
+
onItemClick?: () => void;
|
|
98
113
|
}
|
|
99
114
|
/** Functional component for rendering the CometChatMessageHeader */
|
|
100
115
|
export declare const CometChatMessageHeader: (props: MessageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -30,6 +30,11 @@ interface MessageInformationProps {
|
|
|
30
30
|
* Array of text formatters for custom styling or formatting of message text bubbles.
|
|
31
31
|
*/
|
|
32
32
|
textFormatters?: CometChatTextFormatter[];
|
|
33
|
+
/**
|
|
34
|
+
* Controls the visibility of the scrollbar in the list.
|
|
35
|
+
* @defaultValue `false`
|
|
36
|
+
*/
|
|
37
|
+
showScrollbar?: boolean;
|
|
33
38
|
}
|
|
34
39
|
declare const CometChatMessageInformation: (props: MessageInformationProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
40
|
export { CometChatMessageInformation };
|
|
@@ -214,6 +214,17 @@ interface MessageListProps {
|
|
|
214
214
|
* Format for timestamps displayed in message details (e.g., delivery or read time).
|
|
215
215
|
*/
|
|
216
216
|
messageInfoDateTimeFormat?: CalendarObject;
|
|
217
|
+
/**
|
|
218
|
+
* ID of the message to automatically scroll to when the message list loads.
|
|
219
|
+
* @type {string}
|
|
220
|
+
* @optional
|
|
221
|
+
*/
|
|
222
|
+
goToMessageId?: string;
|
|
223
|
+
/**
|
|
224
|
+
* Controls the visibility of the scrollbar in the list.
|
|
225
|
+
* @defaultValue `false`
|
|
226
|
+
*/
|
|
227
|
+
showScrollbar?: boolean;
|
|
217
228
|
}
|
|
218
229
|
declare const CometChatMessageList: (props: MessageListProps) => import("react/jsx-runtime").JSX.Element;
|
|
219
230
|
export { CometChatMessageList };
|
|
@@ -2,5 +2,5 @@ import { MutableRefObject } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* This Hooks function is a custom React hook designed to manage functionalities of CometChatMessageList component. It fetches the logged-in user, handles event subscriptions and tracks message IDs for new message retrieval. It plays a key role in maintaining real-time functionality and user interactions in the chat interface.
|
|
4
4
|
**/
|
|
5
|
-
declare function useCometChatMessageList(loggedInUserRef: MutableRefObject<CometChat.User | null>, messageListManagerRef: MutableRefObject<any>, fetchPreviousMessages: () => void, updateMessage: (key: string, mesage: CometChat.BaseMessage, group?: CometChat.Group) => void, messagesRequestBuilder: CometChat.MessagesRequestBuilder | undefined, user: CometChat.User | undefined, group: CometChat.Group | undefined, messageIdRef: MutableRefObject<any>, totalMessagesCountRef: MutableRefObject<any>, messageList: CometChat.BaseMessage[], errorHandler: (error: unknown, source?: string) => void, setMessageList: (messages: CometChat.BaseMessage[]) => void, setScrollListToBottom: (scrollToBottom: boolean) => void, smartReplyViewRef: MutableRefObject<any>, isOnBottomRef: MutableRefObject<boolean>, isFirstReloadRef: MutableRefObject<boolean>, subscribeToUIEvents: Function, showSmartRepliesRef: MutableRefObject<any>, setDateHeader?: Function, parentMessageId?: number, hideGroupActionMessages?: boolean, showSmartReplies?: boolean): void;
|
|
5
|
+
declare function useCometChatMessageList(loggedInUserRef: MutableRefObject<CometChat.User | null>, messageListManagerRef: MutableRefObject<any>, fetchPreviousMessages: () => void, updateMessage: (key: string, mesage: CometChat.BaseMessage, group?: CometChat.Group) => void, messagesRequestBuilder: CometChat.MessagesRequestBuilder | undefined, user: CometChat.User | undefined, group: CometChat.Group | undefined, messageIdRef: MutableRefObject<any>, totalMessagesCountRef: MutableRefObject<any>, messageList: CometChat.BaseMessage[], errorHandler: (error: unknown, source?: string) => void, setMessageList: (messages: CometChat.BaseMessage[]) => void, setScrollListToBottom: (scrollToBottom: boolean) => void, smartReplyViewRef: MutableRefObject<any>, isOnBottomRef: MutableRefObject<boolean>, isFirstReloadRef: MutableRefObject<boolean>, subscribeToUIEvents: Function, showSmartRepliesRef: MutableRefObject<any>, setDateHeader?: Function, parentMessageId?: number, hideGroupActionMessages?: boolean, showSmartReplies?: boolean, goToMessageId?: string): void;
|
|
6
6
|
export { useCometChatMessageList };
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
2
|
+
import { CometChatSearchScope, CometChatSearchFilter } from "../../Enums/Enums";
|
|
3
|
+
import { CalendarObject } from "../../utils/CalendarObject";
|
|
4
|
+
import { CometChatTextFormatter } from "../../formatters/CometChatFormatters/CometChatTextFormatter";
|
|
5
|
+
import { CometChatOption } from "../../modals";
|
|
6
|
+
/**
|
|
7
|
+
* Interface for search filter that matches our component needs
|
|
8
|
+
*/
|
|
9
|
+
export interface CometChatSearchFilterItem {
|
|
10
|
+
id: CometChatSearchFilter;
|
|
11
|
+
title: string;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Props for the CometChatSearch component
|
|
16
|
+
*/
|
|
17
|
+
interface SearchProps {
|
|
18
|
+
/**
|
|
19
|
+
* Callback triggered when the back button is clicked
|
|
20
|
+
* Use this to handle navigation when user clicks the back button
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue () => {}
|
|
23
|
+
*/
|
|
24
|
+
onBack?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to hide the back button
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue false - back button is shown
|
|
29
|
+
*/
|
|
30
|
+
hideBackButton?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Callback triggered when a conversation is clicked in search results
|
|
33
|
+
* Receives the conversation object and the search keyword that was used
|
|
34
|
+
*
|
|
35
|
+
* @param conversation - The conversation that was clicked
|
|
36
|
+
* @param searchKeyword - The keyword that was used in the search
|
|
37
|
+
*/
|
|
38
|
+
onConversationClicked?: (conversation: CometChat.Conversation, searchKeyword?: string) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Callback triggered when a message is clicked in search results
|
|
41
|
+
* Receives the message object and the search keyword that was used
|
|
42
|
+
*
|
|
43
|
+
* @param message - The message that was clicked
|
|
44
|
+
* @param searchKeyword - The keyword that was used in the search
|
|
45
|
+
*/
|
|
46
|
+
onMessageClicked?: (message: CometChat.BaseMessage, searchKeyword?: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Array of search filters to display in the filter bar
|
|
49
|
+
* These allow users to narrow down their search results
|
|
50
|
+
*
|
|
51
|
+
* @defaultValue All available filters (Audio, Documents, Groups, Photos, Videos, Links, Unread)
|
|
52
|
+
*/
|
|
53
|
+
searchFilters?: Array<CometChatSearchFilter>;
|
|
54
|
+
/**
|
|
55
|
+
* Filter that should be active by default when the component loads
|
|
56
|
+
* This allows pre-filtering the search results
|
|
57
|
+
*/
|
|
58
|
+
initialSearchFilter?: CometChatSearchFilter;
|
|
59
|
+
/**
|
|
60
|
+
* Scopes to search in (Conversations, Messages, or both)
|
|
61
|
+
* Controls whether to search in conversations, messages, or both
|
|
62
|
+
*
|
|
63
|
+
* @defaultValue [CometChatSearchScope.All] - searches in both conversations and messages
|
|
64
|
+
*/
|
|
65
|
+
searchIn?: Array<CometChatSearchScope>;
|
|
66
|
+
/**
|
|
67
|
+
* Custom view for conversation items in the search results
|
|
68
|
+
* Use this to completely customize how conversation items are rendered
|
|
69
|
+
*
|
|
70
|
+
* @param conversation - The conversation object to render
|
|
71
|
+
* @returns JSX element representing the conversation item
|
|
72
|
+
*/
|
|
73
|
+
conversationItemView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
74
|
+
/**
|
|
75
|
+
* Custom leading view for conversation items (typically avatar/icon)
|
|
76
|
+
* Use this to customize just the leading section of conversation items
|
|
77
|
+
*
|
|
78
|
+
* @param conversation - The conversation object to render the leading view for
|
|
79
|
+
* @returns JSX element for the leading part of the conversation item
|
|
80
|
+
*/
|
|
81
|
+
conversationLeadingView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
82
|
+
/**
|
|
83
|
+
* Custom title view for conversation items
|
|
84
|
+
* Use this to customize how the title of conversation items is displayed
|
|
85
|
+
*
|
|
86
|
+
* @param conversation - The conversation object to render the title for
|
|
87
|
+
* @returns JSX element for the title of the conversation item
|
|
88
|
+
*/
|
|
89
|
+
conversationTitleView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
90
|
+
/**
|
|
91
|
+
* Custom subtitle view for conversation items
|
|
92
|
+
* Use this to customize how the subtitle (typically last message) is displayed
|
|
93
|
+
*
|
|
94
|
+
* @param conversation - The conversation object to render the subtitle for
|
|
95
|
+
* @returns JSX element for the subtitle of the conversation item
|
|
96
|
+
*/
|
|
97
|
+
conversationSubtitleView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
98
|
+
/**
|
|
99
|
+
* Custom trailing view for conversation items (typically timestamp)
|
|
100
|
+
* Use this to customize what appears at the end of conversation items
|
|
101
|
+
*
|
|
102
|
+
* @param conversation - The conversation object to render the trailing view for
|
|
103
|
+
* @returns JSX element for the trailing part of the conversation item
|
|
104
|
+
*/
|
|
105
|
+
conversationTrailingView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
106
|
+
/**
|
|
107
|
+
* Request builder for conversations search
|
|
108
|
+
* Use this to customize the conversation search request parameters
|
|
109
|
+
*
|
|
110
|
+
* @defaultValue New instance with default parameters and search keyword
|
|
111
|
+
*/
|
|
112
|
+
conversationsRequestBuilder?: CometChat.ConversationsRequestBuilder;
|
|
113
|
+
/**
|
|
114
|
+
* Custom view for message items in the search results
|
|
115
|
+
* Use this to completely customize how message items are rendered
|
|
116
|
+
*
|
|
117
|
+
* @param message - The message object to render
|
|
118
|
+
* @returns JSX element representing the message item
|
|
119
|
+
*/
|
|
120
|
+
messageItemView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
121
|
+
/**
|
|
122
|
+
* Custom leading view for message items (typically sender avatar/icon)
|
|
123
|
+
* Use this to customize just the leading section of message items
|
|
124
|
+
*
|
|
125
|
+
* @param message - The message object to render the leading view for
|
|
126
|
+
* @returns JSX element for the leading part of the message item
|
|
127
|
+
*/
|
|
128
|
+
messageLeadingView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
129
|
+
/**
|
|
130
|
+
* Custom title view for message items (typically sender name)
|
|
131
|
+
* Use this to customize how the title of message items is displayed
|
|
132
|
+
*
|
|
133
|
+
* @param message - The message object to render the title for
|
|
134
|
+
* @returns JSX element for the title of the message item
|
|
135
|
+
*/
|
|
136
|
+
messageTitleView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
137
|
+
/**
|
|
138
|
+
* Custom subtitle view for message items (typically message content)
|
|
139
|
+
* Use this to customize how the subtitle/content is displayed
|
|
140
|
+
*
|
|
141
|
+
* @param message - The message object to render the subtitle for
|
|
142
|
+
* @returns JSX element for the subtitle of the message item
|
|
143
|
+
*/
|
|
144
|
+
messageSubtitleView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
145
|
+
/**
|
|
146
|
+
* Custom trailing view for message items (typically timestamp)
|
|
147
|
+
* Use this to customize what appears at the end of message items
|
|
148
|
+
*
|
|
149
|
+
* @param message - The message object to render the trailing view for
|
|
150
|
+
* @returns JSX element for the trailing part of the message item
|
|
151
|
+
*/
|
|
152
|
+
messageTrailingView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
153
|
+
/**
|
|
154
|
+
* Request builder for messages search
|
|
155
|
+
* Use this to customize the message search request parameters
|
|
156
|
+
*
|
|
157
|
+
* @defaultValue New instance with default parameters and search keyword
|
|
158
|
+
*/
|
|
159
|
+
messagesRequestBuilder?: CometChat.MessagesRequestBuilder;
|
|
160
|
+
/**
|
|
161
|
+
* Custom view for empty state when no search results are found
|
|
162
|
+
* This will be displayed when search returns no results
|
|
163
|
+
*/
|
|
164
|
+
emptyView?: JSX.Element;
|
|
165
|
+
/**
|
|
166
|
+
* Custom view for error state when search fails
|
|
167
|
+
* This will be displayed when an error occurs during search
|
|
168
|
+
*/
|
|
169
|
+
errorView?: JSX.Element;
|
|
170
|
+
/**
|
|
171
|
+
* Custom view for loading state during search
|
|
172
|
+
* This will be displayed while search is in progress
|
|
173
|
+
*/
|
|
174
|
+
loadingView?: JSX.Element;
|
|
175
|
+
/**
|
|
176
|
+
* Custom view for initial state before user enters a search query
|
|
177
|
+
* This will be displayed when the search component first loads
|
|
178
|
+
*
|
|
179
|
+
* @defaultValue Basic prompt encouraging user to search
|
|
180
|
+
*/
|
|
181
|
+
initialView?: JSX.Element;
|
|
182
|
+
/**
|
|
183
|
+
* Format for message sent date/time in the UI
|
|
184
|
+
* Customize how timestamps are displayed in message items
|
|
185
|
+
*/
|
|
186
|
+
messageSentAtDateTimeFormat?: CalendarObject;
|
|
187
|
+
/**
|
|
188
|
+
* Custom text formatters for message content
|
|
189
|
+
* Use these to customize how message text is formatted (e.g., emoji, links, mentions)
|
|
190
|
+
*/
|
|
191
|
+
textFormatters?: CometChatTextFormatter[];
|
|
192
|
+
/**
|
|
193
|
+
* Whether to hide the group type icon in group conversations
|
|
194
|
+
*
|
|
195
|
+
* @defaultValue false - group type icons are shown
|
|
196
|
+
*/
|
|
197
|
+
hideGroupType?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Whether to hide user online/offline status indicators
|
|
200
|
+
*
|
|
201
|
+
* @defaultValue false - user status is shown
|
|
202
|
+
*/
|
|
203
|
+
hideUserStatus?: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Whether to hide message receipt indicators (sent/delivered/read)
|
|
206
|
+
*
|
|
207
|
+
* @defaultValue false - receipts are shown
|
|
208
|
+
*/
|
|
209
|
+
hideReceipts?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* User ID to search within specific user's messages
|
|
212
|
+
* When provided, search will be limited to messages with this user
|
|
213
|
+
*/
|
|
214
|
+
uid?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Group ID to search within specific group's messages
|
|
217
|
+
* When provided, search will be limited to messages in this group
|
|
218
|
+
*/
|
|
219
|
+
guid?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Custom options for conversation items in search results
|
|
222
|
+
* Function that returns array of options (e.g., for context menu)
|
|
223
|
+
*
|
|
224
|
+
* @param conversation - The conversation to generate options for
|
|
225
|
+
* @returns Array of option objects or null for no options
|
|
226
|
+
*/
|
|
227
|
+
conversationOptions?: ((conversation: CometChat.Conversation) => CometChatOption[]) | null;
|
|
228
|
+
/**
|
|
229
|
+
* Custom error handler for search operations
|
|
230
|
+
* Override the default error handling behavior
|
|
231
|
+
*
|
|
232
|
+
* @param error - The error that occurred during a search operation
|
|
233
|
+
*/
|
|
234
|
+
onError?: (error: CometChat.CometChatException) => void;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* CometChatSearch component for searching conversations and messages in CometChat
|
|
238
|
+
*/
|
|
239
|
+
export declare function CometChatSearch(props: SearchProps): import("react/jsx-runtime").JSX.Element;
|
|
240
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controller class to manage search conversation related operations
|
|
3
|
+
*/
|
|
4
|
+
export declare class SearchConversationsManager {
|
|
5
|
+
private static errorHandler;
|
|
6
|
+
/**
|
|
7
|
+
* Set error handler for the manager
|
|
8
|
+
*/
|
|
9
|
+
static setErrorHandler(handler: (error: unknown, source?: string) => void): void;
|
|
10
|
+
/**
|
|
11
|
+
* Attaches an SDK user listener
|
|
12
|
+
*
|
|
13
|
+
* @returns Function to call to remove the attached SDK user listener
|
|
14
|
+
*/
|
|
15
|
+
static attachUserListener(callback: (user: CometChat.User) => void): () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Attaches an SDK group listener
|
|
18
|
+
*
|
|
19
|
+
* @returns Function to call to remove the attached SDK group listener
|
|
20
|
+
*/
|
|
21
|
+
static attachGroupListener(callback: (message: CometChat.BaseMessage, remove?: boolean) => Promise<void>, loggedInUser: CometChat.User | null): (() => void) | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Attaches an SDK message received listener
|
|
24
|
+
*
|
|
25
|
+
* @returns - Function to remove the added SDK message received listener
|
|
26
|
+
*/
|
|
27
|
+
static attachMessageReceivedListener(callback: (message: CometChat.BaseMessage) => Promise<void>): (() => void) | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Attaches an SDK message receipt listener
|
|
30
|
+
*
|
|
31
|
+
* @returns - Function to remove the added SDK message receipt listener
|
|
32
|
+
*/
|
|
33
|
+
static attachMessageReceiptListener(callback: (receipt: CometChat.MessageReceipt, updateReadAt: boolean) => void): (() => void) | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Attaches an SDK message modified listener
|
|
36
|
+
*
|
|
37
|
+
* @returns - Function to remove the added SDK message modified listener
|
|
38
|
+
*/
|
|
39
|
+
static attachMessageModifiedListener(callback: (message: CometChat.BaseMessage) => void): (() => void) | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Attaches an SDK call listener
|
|
42
|
+
*
|
|
43
|
+
* @returns - Function to remove the added SDK call listener
|
|
44
|
+
*/
|
|
45
|
+
static attachCallListener(callback: (message: CometChat.BaseMessage) => void): (() => void) | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Determines if the last message should trigger an update based on its category and type.
|
|
48
|
+
*/
|
|
49
|
+
static shouldLastMessageAndUnreadCountBeUpdated: (message: CometChat.BaseMessage) => any;
|
|
50
|
+
}
|