@cometchat/chat-uikit-react 6.0.7 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +395 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/CometChatConversations.css +16 -1
- package/dist/styles/CometChatList.css +10 -1
- package/dist/styles/CometChatMessageHeader.css +39 -0
- package/dist/styles/CometChatMessageList.css +28 -13
- package/dist/styles/CometChatSearch.css +948 -0
- package/dist/styles/CometChatThreadHeader.css +16 -1
- package/dist/styles/components/CometChatConversations.css +16 -1
- package/dist/styles/components/CometChatList.css +10 -1
- package/dist/styles/components/CometChatMessageHeader.css +39 -0
- package/dist/styles/components/CometChatMessageList.css +28 -13
- package/dist/styles/components/CometChatSearch.css +948 -0
- package/dist/styles/components/CometChatThreadHeader.css +16 -1
- 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 +24 -4
- package/dist/types/components/CometChatConversations/CometChatConversations.d.ts +14 -1
- package/dist/types/components/CometChatMessageHeader/CometChatMessageHeader.d.ts +15 -0
- package/dist/types/components/CometChatMessageList/CometChatMessageList.d.ts +6 -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 +8 -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 +2 -2
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
2
|
+
import { CometChatTextFormatter } from "../../formatters/CometChatFormatters/CometChatTextFormatter";
|
|
3
|
+
import { CometChatSearchFilter, States } from "../../Enums/Enums";
|
|
4
|
+
import { CometChatOption } from "../../modals";
|
|
5
|
+
import { CalendarObject } from "../../utils/CalendarObject";
|
|
6
|
+
/**
|
|
7
|
+
* Interface for the hook props
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Interface for the props used by the useCometChatSearchConversationsList hook.
|
|
11
|
+
*/
|
|
12
|
+
interface UseCometChatSearchConversationsListProps {
|
|
13
|
+
/**
|
|
14
|
+
* Search keyword used to filter the conversations.
|
|
15
|
+
*/
|
|
16
|
+
searchKeyword?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional request builder to customize the conversation query.
|
|
19
|
+
*/
|
|
20
|
+
conversationsRequestBuilder?: CometChat.ConversationsRequestBuilder | null;
|
|
21
|
+
/**
|
|
22
|
+
* Callback function triggered when a conversation item is clicked.
|
|
23
|
+
* @param conversation - The selected conversation.
|
|
24
|
+
* @param searchKeyword - The keyword used during the search (optional).
|
|
25
|
+
*/
|
|
26
|
+
onItemClick?: (conversation: CometChat.Conversation, searchKeyword?: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Custom renderer for each conversation item.
|
|
29
|
+
* @param conversation - The current conversation.
|
|
30
|
+
*/
|
|
31
|
+
itemView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Custom JSX element to display at the start (leading view) of a conversation item.
|
|
34
|
+
* @param conversation - The current conversation.
|
|
35
|
+
*/
|
|
36
|
+
leadingView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
37
|
+
/**
|
|
38
|
+
* Custom JSX element to display the title of a conversation item.
|
|
39
|
+
* @param conversation - The current conversation.
|
|
40
|
+
*/
|
|
41
|
+
titleView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* Custom JSX element to display the subtitle of a conversation item.
|
|
44
|
+
* @param conversation - The current conversation.
|
|
45
|
+
*/
|
|
46
|
+
subtitleView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
47
|
+
/**
|
|
48
|
+
* Custom JSX element to display at the end (trailing view) of a conversation item.
|
|
49
|
+
* @param conversation - The current conversation.
|
|
50
|
+
*/
|
|
51
|
+
trailingView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* Optional array of text formatters to customize conversation text display.
|
|
54
|
+
*/
|
|
55
|
+
textFormatters?: CometChatTextFormatter[];
|
|
56
|
+
/**
|
|
57
|
+
* Format object for displaying timestamps of the last message.
|
|
58
|
+
*/
|
|
59
|
+
lastMessageDateTimeFormat?: CalendarObject;
|
|
60
|
+
/**
|
|
61
|
+
* If true, message read receipts will be hidden.
|
|
62
|
+
*/
|
|
63
|
+
hideReceipts?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* If true, user online/offline status indicators will be hidden.
|
|
66
|
+
*/
|
|
67
|
+
hideUserStatus?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* If true, the group type icon will be hidden.
|
|
70
|
+
*/
|
|
71
|
+
hideGroupType?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Function to return available options for a conversation item (e.g., context menu actions).
|
|
74
|
+
* @param conversation - The current conversation.
|
|
75
|
+
*/
|
|
76
|
+
options?: ((conversation: CometChat.Conversation) => CometChatOption[]) | null;
|
|
77
|
+
/**
|
|
78
|
+
* Callback triggered when an error occurs during component behavior.
|
|
79
|
+
* @param error - The CometChatException error object.
|
|
80
|
+
*/
|
|
81
|
+
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
82
|
+
/**
|
|
83
|
+
* The currently active conversation to be visually highlighted.
|
|
84
|
+
*/
|
|
85
|
+
activeConversation?: CometChat.Conversation | null;
|
|
86
|
+
/**
|
|
87
|
+
* Custom component displayed when there are no conversations.
|
|
88
|
+
*/
|
|
89
|
+
emptyView?: JSX.Element;
|
|
90
|
+
/**
|
|
91
|
+
* Custom component displayed while the conversations list is loading.
|
|
92
|
+
*/
|
|
93
|
+
loadingView?: JSX.Element;
|
|
94
|
+
/**
|
|
95
|
+
* Custom component displayed when an error occurs while fetching conversations.
|
|
96
|
+
*/
|
|
97
|
+
errorView?: JSX.Element;
|
|
98
|
+
/**
|
|
99
|
+
* Text displayed on the "See More" button.
|
|
100
|
+
*/
|
|
101
|
+
seeMoreButtonText?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Whether to always show the "See More" button even when no more results are available.
|
|
104
|
+
*/
|
|
105
|
+
alwaysShowSeeMore?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Active filters applied to the search results.
|
|
108
|
+
*/
|
|
109
|
+
activeFilters?: CometChatSearchFilter[];
|
|
110
|
+
/**
|
|
111
|
+
* Enables scroll-based pagination instead of a "See More" button.
|
|
112
|
+
*/
|
|
113
|
+
useScrollPagination?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* If true, hides error UI even when an error occurs.
|
|
116
|
+
*/
|
|
117
|
+
hideError?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The logged-in user object.
|
|
120
|
+
*/
|
|
121
|
+
loggedInUser?: CometChat.User | null;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* State interface for the hook
|
|
125
|
+
*/
|
|
126
|
+
interface State {
|
|
127
|
+
conversationList: CometChat.Conversation[];
|
|
128
|
+
fetchState: States;
|
|
129
|
+
typingIndicatorMap: Map<string, CometChat.TypingIndicator>;
|
|
130
|
+
hasMoreResults: boolean;
|
|
131
|
+
conversationToBeDeleted: CometChat.Conversation | null;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Action types for the reducer
|
|
135
|
+
*/
|
|
136
|
+
export type Action = {
|
|
137
|
+
type: "appendConversations";
|
|
138
|
+
conversations: CometChat.Conversation[];
|
|
139
|
+
removeOldConversation?: boolean;
|
|
140
|
+
} | {
|
|
141
|
+
type: "setConversationList";
|
|
142
|
+
conversationList: CometChat.Conversation[];
|
|
143
|
+
} | {
|
|
144
|
+
type: "setFetchState";
|
|
145
|
+
fetchState: States;
|
|
146
|
+
} | {
|
|
147
|
+
type: "setConversationToBeDeleted";
|
|
148
|
+
conversation: CometChat.Conversation | null;
|
|
149
|
+
} | {
|
|
150
|
+
type: "removeConversation";
|
|
151
|
+
conversation: CometChat.Conversation;
|
|
152
|
+
} | {
|
|
153
|
+
type: "updateConversationWithUser";
|
|
154
|
+
user: CometChat.User;
|
|
155
|
+
} | {
|
|
156
|
+
type: "fromUpdateConversationListFn";
|
|
157
|
+
conversation: CometChat.Conversation;
|
|
158
|
+
} | {
|
|
159
|
+
type: "addTypingIndicator";
|
|
160
|
+
typingIndicator: CometChat.TypingIndicator;
|
|
161
|
+
} | {
|
|
162
|
+
type: "removeTypingIndicator";
|
|
163
|
+
typingIndicator: CometChat.TypingIndicator;
|
|
164
|
+
} | {
|
|
165
|
+
type: "updateConversationLastMessage";
|
|
166
|
+
message: CometChat.BaseMessage;
|
|
167
|
+
} | {
|
|
168
|
+
type: "updateConversationLastMessageAndPlaceAtTheTop";
|
|
169
|
+
message: CometChat.BaseMessage;
|
|
170
|
+
} | {
|
|
171
|
+
type: "updateConversationLastMessageAndGroupAndPlaceAtTheTop";
|
|
172
|
+
group: CometChat.Group;
|
|
173
|
+
message: CometChat.Action;
|
|
174
|
+
} | {
|
|
175
|
+
type: "removeConversationOfTheGroup";
|
|
176
|
+
group: CometChat.Group;
|
|
177
|
+
} | {
|
|
178
|
+
type: "removeConversationOfTheUser";
|
|
179
|
+
user: CometChat.User;
|
|
180
|
+
} | {
|
|
181
|
+
type: "updateConversationLastMessageResetUnreadCountAndPlaceAtTheTop";
|
|
182
|
+
message: CometChat.BaseMessage;
|
|
183
|
+
conversation: CometChat.Conversation;
|
|
184
|
+
} | {
|
|
185
|
+
type: "resetUnreadCountAndSetReadAtIfLastMessage";
|
|
186
|
+
message: CometChat.BaseMessage;
|
|
187
|
+
} | {
|
|
188
|
+
type: "setLastMessageReadOrDeliveredAt";
|
|
189
|
+
updateReadAt: boolean;
|
|
190
|
+
messageReceipt: CometChat.MessageReceipt;
|
|
191
|
+
} | {
|
|
192
|
+
type: "setHasMoreResults";
|
|
193
|
+
hasMoreResults: boolean;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Hook for managing and rendering a list of conversations in the search component
|
|
197
|
+
*/
|
|
198
|
+
export declare function useCometChatSearchConversationsList(props: UseCometChatSearchConversationsListProps): {
|
|
199
|
+
renderConversationsList: () => import("react/jsx-runtime").JSX.Element | null;
|
|
200
|
+
getListItem: () => (conversation: CometChat.Conversation) => JSX.Element;
|
|
201
|
+
conversationState: State;
|
|
202
|
+
searchConversations: () => Promise<void>;
|
|
203
|
+
loadMoreResults: () => Promise<void>;
|
|
204
|
+
handleScrollToBottom: () => Promise<void>;
|
|
205
|
+
shouldRender: () => boolean;
|
|
206
|
+
};
|
|
207
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
2
|
+
import { CometChatTextFormatter } from "../../formatters/CometChatFormatters/CometChatTextFormatter";
|
|
3
|
+
import { CometChatSearchFilter, States } from "../../Enums/Enums";
|
|
4
|
+
import { CometChatOption } from "../../modals";
|
|
5
|
+
import { CalendarObject } from "../../utils/CalendarObject";
|
|
6
|
+
/**
|
|
7
|
+
* Interface for the props used by the useCometChatSearchMessagesList hook.
|
|
8
|
+
*/
|
|
9
|
+
interface UseCometChatSearchMessagesListProps {
|
|
10
|
+
/**
|
|
11
|
+
* Search keyword used to filter messages.
|
|
12
|
+
*/
|
|
13
|
+
searchKeyword?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional request builder to customize the message search query.
|
|
16
|
+
*/
|
|
17
|
+
messagesRequestBuilder?: CometChat.MessagesRequestBuilder;
|
|
18
|
+
/**
|
|
19
|
+
* Callback function triggered when a message item is clicked.
|
|
20
|
+
* @param message - The selected message.
|
|
21
|
+
* @param searchKeyword - The keyword used during the search (optional).
|
|
22
|
+
*/
|
|
23
|
+
onItemClick?: (message: CometChat.BaseMessage, searchKeyword?: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Custom renderer for each message item.
|
|
26
|
+
* @param message - The current message.
|
|
27
|
+
*/
|
|
28
|
+
itemView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* Custom JSX element to display at the start (leading view) of a message item.
|
|
31
|
+
* @param message - The current message.
|
|
32
|
+
*/
|
|
33
|
+
leadingView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Custom JSX element to display the title of a message item.
|
|
36
|
+
* @param message - The current message.
|
|
37
|
+
*/
|
|
38
|
+
titleView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
39
|
+
/**
|
|
40
|
+
* Custom JSX element to display the subtitle of a message item.
|
|
41
|
+
* @param message - The current message.
|
|
42
|
+
*/
|
|
43
|
+
subtitleView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Custom JSX element to display at the end (trailing view) of a message item.
|
|
46
|
+
* @param message - The current message.
|
|
47
|
+
*/
|
|
48
|
+
trailingView?: (message: CometChat.BaseMessage) => JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* Optional array of text formatters to customize message text display.
|
|
51
|
+
*/
|
|
52
|
+
textFormatters?: CometChatTextFormatter[];
|
|
53
|
+
/**
|
|
54
|
+
* Format object for displaying the timestamp of messages.
|
|
55
|
+
*/
|
|
56
|
+
messageDateTimeFormat?: CalendarObject;
|
|
57
|
+
/**
|
|
58
|
+
* Function to return available options for a message item (e.g., actions or menu items).
|
|
59
|
+
* @param message - The current message.
|
|
60
|
+
*/
|
|
61
|
+
options?: ((message: CometChat.BaseMessage) => CometChatOption[]) | null;
|
|
62
|
+
/**
|
|
63
|
+
* Callback triggered when an error occurs during component behavior.
|
|
64
|
+
* @param error - The CometChatException error object.
|
|
65
|
+
*/
|
|
66
|
+
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
67
|
+
/**
|
|
68
|
+
* Custom component displayed when there are no messages to show.
|
|
69
|
+
*/
|
|
70
|
+
emptyView?: JSX.Element;
|
|
71
|
+
/**
|
|
72
|
+
* Custom component displayed while the message list is loading.
|
|
73
|
+
*/
|
|
74
|
+
loadingView?: JSX.Element;
|
|
75
|
+
/**
|
|
76
|
+
* Custom component displayed when an error occurs while fetching messages.
|
|
77
|
+
*/
|
|
78
|
+
errorView?: JSX.Element;
|
|
79
|
+
/**
|
|
80
|
+
* Text displayed on the "See More" button.
|
|
81
|
+
*/
|
|
82
|
+
seeMoreButtonText?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to always show the "See More" button even if there are no more results.
|
|
85
|
+
*/
|
|
86
|
+
alwaysShowSeeMore?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Active filters applied to the message search.
|
|
89
|
+
*/
|
|
90
|
+
activeFilters?: CometChatSearchFilter[];
|
|
91
|
+
/**
|
|
92
|
+
* User ID to search messages specific to a user.
|
|
93
|
+
*/
|
|
94
|
+
uid?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Group ID to search messages specific to a group.
|
|
97
|
+
*/
|
|
98
|
+
guid?: string;
|
|
99
|
+
/**
|
|
100
|
+
* If true, hides error views from rendering.
|
|
101
|
+
*/
|
|
102
|
+
hideError?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Logged-in user object reference.
|
|
105
|
+
*/
|
|
106
|
+
loggedInUser?: CometChat.User | null;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* State interface for the hook
|
|
110
|
+
*/
|
|
111
|
+
interface State {
|
|
112
|
+
messageList: CometChat.BaseMessage[];
|
|
113
|
+
fetchState: States;
|
|
114
|
+
hasMoreResults: boolean;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Hook for managing and rendering a list of messages in the search component
|
|
118
|
+
*/
|
|
119
|
+
export declare function useCometChatSearchMessagesList(props: UseCometChatSearchMessagesListProps): {
|
|
120
|
+
renderMessagesList: () => import("react/jsx-runtime").JSX.Element | null;
|
|
121
|
+
messageState: State;
|
|
122
|
+
searchMessages: () => Promise<void>;
|
|
123
|
+
loadMoreResults: () => Promise<void>;
|
|
124
|
+
handleScrollToBottom: () => Promise<void>;
|
|
125
|
+
shouldRender: () => boolean;
|
|
126
|
+
};
|
|
127
|
+
export {};
|
|
@@ -57,6 +57,14 @@ interface CometChatThreadHeaderProps {
|
|
|
57
57
|
* Array of text formatters for custom styling or formatting of message text bubbles.
|
|
58
58
|
*/
|
|
59
59
|
textFormatters?: CometChatTextFormatter[];
|
|
60
|
+
/**
|
|
61
|
+
* Callback function triggered when the subtitle is clicked.
|
|
62
|
+
*/
|
|
63
|
+
onSubtitleClicked?: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* Custom subtitle view to display below the thread title.
|
|
66
|
+
*/
|
|
67
|
+
subtitleView?: JSX.Element;
|
|
60
68
|
/**
|
|
61
69
|
* Controls the visibility of the scrollbar in the list.
|
|
62
70
|
* @defaultValue `false`
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CometChatTextFormatter } from "../CometChatTextFormatter";
|
|
2
|
+
/**
|
|
3
|
+
* Class that handles the text highlighting for specific patterns.
|
|
4
|
+
* CometChatTextHighlightFormatter is a child class of CometChatTextFormatter.
|
|
5
|
+
* It extends the functionality of text formatting to specifically highlight text patterns.
|
|
6
|
+
* It can be used to highlight specific words or patterns.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CometChatTextHighlightFormatter extends CometChatTextFormatter {
|
|
9
|
+
constructor(pattern?: string | RegExp);
|
|
10
|
+
/**
|
|
11
|
+
* Sets the text pattern to highlight
|
|
12
|
+
* @param pattern The text pattern (string or RegExp) to highlight
|
|
13
|
+
*/
|
|
14
|
+
setText(pattern: string | RegExp): void;
|
|
15
|
+
/**
|
|
16
|
+
* Generates a unique ID for the highlight span
|
|
17
|
+
*/
|
|
18
|
+
getUniqueId(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Format the text by applying highlighting to matches of the regex pattern
|
|
21
|
+
* @param inputText The text to format
|
|
22
|
+
* @param params Optional parameters
|
|
23
|
+
* @returns The formatted text with highlights
|
|
24
|
+
*/
|
|
25
|
+
getFormattedText(inputText: string | null): string | void;
|
|
26
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { CometChatTextFormatter } from './CometChatFormatters/CometChatTextFormatter';
|
|
2
2
|
export { CometChatUrlsFormatter } from './CometChatFormatters/CometChatUrlsFormatter/CometChatUrlsFormatter';
|
|
3
3
|
export { CometChatMentionsFormatter } from './CometChatFormatters/CometChatMentionsFormatter/CometChatMentionsFormatter';
|
|
4
|
+
export { CometChatTextHighlightFormatter } from './CometChatFormatters/CometChatTextHighlightFormatter/CometChatTextHighlightFormatter';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -111,3 +111,5 @@ export { CometChatUIKitLoginListener } from './CometChatUIKit/CometChatUIKitLogi
|
|
|
111
111
|
export { CometChatUIKitUtility } from './CometChatUIKit/CometChatUIKitUtility';
|
|
112
112
|
export * from './CometChatCustomHooks';
|
|
113
113
|
export * from './formatters/index';
|
|
114
|
+
export * from './utils/SearchUtils';
|
|
115
|
+
export { CometChatSearch } from './components/CometChatSearch/CometChatSearch';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class is used to define the properties of a search filter option,
|
|
3
|
+
* including its unique identifier, display name, and an optional icon URL.
|
|
4
|
+
*/
|
|
5
|
+
export declare class CometChatSearchFilterOption {
|
|
6
|
+
/**
|
|
7
|
+
* A unique identifier for the filter option.
|
|
8
|
+
* Example: 'photos', 'groups', etc.
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* An optional display name for the filter option.
|
|
13
|
+
* Example: 'Photos', 'Groups', etc.
|
|
14
|
+
*/
|
|
15
|
+
name?: string;
|
|
16
|
+
/**
|
|
17
|
+
* An optional URL or path to the icon representing the filter option.
|
|
18
|
+
* Example: 'path/to/icon.png'.
|
|
19
|
+
*/
|
|
20
|
+
iconURL?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Creates an instance of CometChatSearchFilterOption.
|
|
23
|
+
*
|
|
24
|
+
* @param options - An object containing the properties of the filter option.
|
|
25
|
+
* @param options.id - A unique identifier for the filter option.
|
|
26
|
+
* @param options.name - An optional display name for the filter option.
|
|
27
|
+
* @param options.iconURL - An optional URL or path to the icon for the filter option.
|
|
28
|
+
*/
|
|
29
|
+
constructor(options: {
|
|
30
|
+
id: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
iconURL?: string;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CometChatSearchFilter } from "../Enums/Enums";
|
|
2
|
+
import { CalendarObject } from "./CalendarObject";
|
|
3
|
+
/**
|
|
4
|
+
* Checks if two dates (timestamps) are from different months or years
|
|
5
|
+
*
|
|
6
|
+
* @param firstDate - First timestamp to compare in milliseconds
|
|
7
|
+
* @param secondDate - Second timestamp to compare in milliseconds
|
|
8
|
+
* @param errorHandler - Optional error handler function for exception handling
|
|
9
|
+
* @returns boolean indicating if the dates belong to different months or years
|
|
10
|
+
*/
|
|
11
|
+
export declare function isMonthDifferent(firstDate?: number, secondDate?: number, errorHandler?: (error: unknown, source?: string) => void): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Get common date format based on provided custom format
|
|
14
|
+
* @returns CalendarObject with format specifications
|
|
15
|
+
*/
|
|
16
|
+
export declare function getCommonDateFormat(customFormat?: CalendarObject): CalendarObject;
|
|
17
|
+
/**
|
|
18
|
+
* Checks if message search criteria are valid
|
|
19
|
+
* Returns true if search keyword exists or if valid filters are active
|
|
20
|
+
*/
|
|
21
|
+
export declare function hasValidMessageSearchCriteria(searchKeyword: string, filters: CometChatSearchFilter[]): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Checks if conversation search criteria are valid
|
|
24
|
+
* Returns true if search keyword exists or if valid filters are active
|
|
25
|
+
*/
|
|
26
|
+
export declare function hasValidConversationSearchCriteria(searchKeyword: string, filters: CometChatSearchFilter[]): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if a message has link preview metadata
|
|
29
|
+
*/
|
|
30
|
+
export declare function hasLink(metadata: any): boolean;
|
|
@@ -52,4 +52,11 @@ export declare function sanitizeCalendarObject(calendarObject?: CalendarObject):
|
|
|
52
52
|
};
|
|
53
53
|
export declare function fireClickEvent(): void;
|
|
54
54
|
export declare const decodeHTML: (input: string) => string;
|
|
55
|
+
/**
|
|
56
|
+
* Custom React hook for creating debounced callbacks with automatic cleanup.
|
|
57
|
+
*/
|
|
58
|
+
export declare const useDebouncedCallback: (callback: () => void, delay: number) => {
|
|
59
|
+
debouncedCallback: () => void;
|
|
60
|
+
cleanup: () => void;
|
|
61
|
+
};
|
|
55
62
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cometchat/chat-uikit-react",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "Ready-to-use Chat UI Components for React(Javascript/Web)",
|
|
5
5
|
"author": "CometChat",
|
|
6
6
|
"exports": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"./css-variables.css": "./dist/styles/css-variables.css"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@cometchat/chat-sdk-javascript": "^4.0.
|
|
11
|
+
"@cometchat/chat-sdk-javascript": "^4.0.13",
|
|
12
12
|
"@rollup/plugin-json": "^6.1.0",
|
|
13
13
|
"rxjs": "^7.8.1"
|
|
14
14
|
},
|