@cometchat/chat-uikit-react 5.0.0-beta2 → 5.0.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/README.md +2 -2
- package/dist/assets/Send.svg +3 -0
- package/dist/assets/loading.svg +5 -16
- package/dist/index.d.ts +1155 -950
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/CometChatCallButtons.css +1 -1
- package/dist/styles/CometChatCallLogs.css +3 -3
- package/dist/styles/{components/AIConversationStarter.css → CometChatConversationStarter.css} +2 -2
- package/dist/styles/{components/AIConversationSummary.css → CometChatConversationSummary.css} +12 -12
- package/dist/styles/CometChatConversations.css +10 -10
- package/dist/styles/CometChatGroupMembers.css +5 -5
- package/dist/styles/CometChatIncomingCall.css +1 -1
- package/dist/styles/CometChatList.css +15 -22
- package/dist/styles/CometChatListItem.css +2 -2
- package/dist/styles/CometChatMessageComposer.css +44 -41
- package/dist/styles/CometChatMessageHeader.css +22 -5
- package/dist/styles/CometChatMessageInformation.css +3 -2
- package/dist/styles/CometChatMessageList.css +6 -5
- package/dist/styles/CometChatOutgoingCall.css +5 -0
- package/dist/styles/{AISmartReplies.css → CometChatSmartReplies.css} +72 -79
- package/dist/styles/PollsBubble.css +7 -1
- package/dist/styles/components/CometChatCallButtons.css +1 -1
- package/dist/styles/components/CometChatCallLogs.css +3 -3
- package/dist/styles/{AIConversationStarter.css → components/CometChatConversationStarter.css} +2 -2
- package/dist/styles/{AIConversationSummary.css → components/CometChatConversationSummary.css} +12 -12
- package/dist/styles/components/CometChatConversations.css +10 -10
- package/dist/styles/components/CometChatGroupMembers.css +5 -5
- package/dist/styles/components/CometChatIncomingCall.css +1 -1
- package/dist/styles/components/CometChatList.css +15 -22
- package/dist/styles/components/CometChatListItem.css +2 -2
- package/dist/styles/components/CometChatMessageComposer.css +44 -41
- package/dist/styles/components/CometChatMessageHeader.css +22 -5
- package/dist/styles/components/CometChatMessageInformation.css +3 -2
- package/dist/styles/components/CometChatMessageList.css +6 -5
- package/dist/styles/components/CometChatOutgoingCall.css +5 -0
- package/dist/styles/components/{AISmartReplies.css → CometChatSmartReplies.css} +72 -79
- package/dist/styles/components/PollsBubble.css +7 -1
- package/dist/styles/components/index.css +3 -3
- package/dist/styles/index.css +3 -3
- package/dist/types/CometChatCustomHooks.d.ts +1 -1
- package/dist/types/CometChatUIKit/CometChatUIKit.d.ts +0 -6
- package/dist/types/CometChatUIKit/UIKitSettings.d.ts +0 -22
- package/dist/types/Enums/Enums.d.ts +9 -0
- package/dist/types/components/BaseComponents/CometChatConversationStarter/CometChatConversationStarter.d.ts +6 -0
- package/dist/types/components/BaseComponents/CometChatConversationSummary/CometChatConversationSummary.d.ts +6 -0
- package/dist/types/components/BaseComponents/CometChatList/CometChatList.d.ts +12 -12
- package/dist/types/components/BaseComponents/CometChatListItem/CometChatListItem.d.ts +3 -1
- package/dist/types/components/BaseComponents/CometChatSmartReplies/CometChatSmartReplies.d.ts +7 -0
- package/dist/types/components/Calling/CallButtonConfiguration.d.ts +1 -1
- package/dist/types/components/Calling/CallingExtensionDecorator.d.ts +2 -2
- package/dist/types/components/Calling/CometChatCallButtons/CometChatCallButtons.d.ts +30 -12
- package/dist/types/components/Calling/CometChatCallButtons/useCallButtons.d.ts +1 -1
- package/dist/types/components/Calling/CometChatCallLogs/CometChatCallLogs.d.ts +50 -38
- package/dist/types/components/Calling/CometChatCallLogs/useCometChatCallLogs.d.ts +1 -1
- package/dist/types/components/Calling/CometChatIncomingCall/CometChatIncomingCall.d.ts +48 -26
- package/dist/types/components/Calling/CometChatIncomingCall/useCometChatIncomingCall.d.ts +1 -1
- package/dist/types/components/Calling/CometChatOutgoingCall/CometChatOutgoingCall.d.ts +31 -15
- package/dist/types/components/Calling/CometChatOutgoingCall/useCometChatOutgoingCall.d.ts +1 -1
- package/dist/types/components/Calling/OutgoingCallConfiguration.d.ts +7 -3
- package/dist/types/components/CometChatConversations/CometChatConversations.d.ts +88 -87
- package/dist/types/components/CometChatConversations/controller.d.ts +10 -8
- package/dist/types/components/CometChatConversations/useCometChatConversations.d.ts +2 -5
- package/dist/types/components/CometChatGroupMembers/CometChatGroupMembers.d.ts +94 -76
- package/dist/types/components/CometChatGroupMembers/useCometChatGroupMembers.d.ts +2 -2
- package/dist/types/components/CometChatGroups/CometChatGroups.d.ts +74 -62
- package/dist/types/components/CometChatGroups/useCometChatGroups.d.ts +1 -0
- package/dist/types/components/CometChatMessageComposer/CometChatMessageComposer.d.ts +107 -49
- package/dist/types/components/CometChatMessageComposer/useCometChatMessageComposer.d.ts +1 -1
- package/dist/types/components/CometChatMessageHeader/CometChatMessageHeader.d.ts +77 -16
- package/dist/types/components/CometChatMessageHeader/useCometChatMessageHeader.d.ts +1 -1
- package/dist/types/components/CometChatMessageInformation/CometChatMessageInformation.d.ts +5 -0
- package/dist/types/components/CometChatMessageList/CometChatMessageList.d.ts +133 -55
- package/dist/types/components/CometChatMessageList/CometChatMessageListController.d.ts +3 -1
- package/dist/types/components/CometChatMessageList/useCometChatMessageList.d.ts +1 -1
- package/dist/types/components/CometChatThreadedMessagePreview/CometChatThreadedMessagePreview.d.ts +34 -2
- package/dist/types/components/CometChatUsers/CometChatUsers.d.ts +88 -89
- package/dist/types/components/CometChatUsers/useCometChatUsers.d.ts +2 -1
- package/dist/types/components/Extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.d.ts +4 -3
- package/dist/types/components/Extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.d.ts +4 -3
- package/dist/types/components/Extensions/MessageTranslation/MessageTranslationExtensionDecorator.d.ts +3 -1
- package/dist/types/components/Extensions/Polls/PollsBubble.d.ts +5 -0
- package/dist/types/components/Extensions/Polls/PollsExtensionDecorator.d.ts +4 -3
- package/dist/types/components/Extensions/Stickers/StickersExtensionDecorator.d.ts +2 -3
- package/dist/types/components/Reactions/CometChatReactionInfo/CometChatReactionInfo.d.ts +3 -2
- package/dist/types/components/Reactions/CometChatReactionList/CometChatReactionList.d.ts +3 -2
- package/dist/types/components/Reactions/CometChatReactions/CometChatReactions.d.ts +3 -2
- package/dist/types/index.d.ts +8 -7
- package/dist/types/resources/CometChatLocalize/cometchat-localize.d.ts +129 -115
- package/dist/types/utils/DataSource.d.ts +17 -18
- package/dist/types/utils/DataSourceDecorator.d.ts +17 -18
- package/dist/types/utils/GroupMemberUtils.d.ts +1 -1
- package/dist/types/utils/MessageUtils.d.ts +1 -1
- package/dist/types/utils/MessagesDataSource.d.ts +29 -16
- package/dist/types/utils/util.d.ts +5 -0
- package/package.json +1 -1
- package/dist/assets/ai-empty.svg +0 -22
- package/dist/assets/ai-error.svg +0 -3
- package/dist/assets/heart-reaction.png +0 -0
- package/dist/assets/send.svg +0 -12
- package/dist/styles/AICard.css +0 -30
- package/dist/styles/components/AICard.css +0 -30
- package/dist/types/components/AI/AIBaseConfiguration.d.ts +0 -51
- package/dist/types/components/AI/AIConversationStarter/AIConversationStarterConfiguration.d.ts +0 -20
- package/dist/types/components/AI/AIConversationStarter/AIConversationStarterDecorator.d.ts +0 -18
- package/dist/types/components/AI/AIConversationStarter/AIConversationStarterExtension.d.ts +0 -8
- package/dist/types/components/AI/AIConversationStarter/AIConversationStarterView.d.ts +0 -8
- package/dist/types/components/AI/AIConversationSummary/AIConversationSummaryConfiguration.d.ts +0 -31
- package/dist/types/components/AI/AIConversationSummary/AIConversationSummaryDecorator.d.ts +0 -22
- package/dist/types/components/AI/AIConversationSummary/AIConversationSummaryExtension.d.ts +0 -8
- package/dist/types/components/AI/AIConversationSummary/AIConversationSummaryView.d.ts +0 -9
- package/dist/types/components/AI/AIExtensionDataSource.d.ts +0 -6
- package/dist/types/components/AI/AISmartReplies/AISmartRepliesConfiguration.d.ts +0 -28
- package/dist/types/components/AI/AISmartReplies/AISmartRepliesDecorator.d.ts +0 -21
- package/dist/types/components/AI/AISmartReplies/AISmartRepliesExtension.d.ts +0 -8
- package/dist/types/components/AI/AISmartReplies/AISmartRepliesView.d.ts +0 -11
- package/dist/types/components/BaseComponents/CometChatLiveReaction/CometChatLiveReaction.d.ts +0 -5
- package/dist/types/components/BaseComponents/CometChatLiveReaction/useLiveReactionHook.d.ts +0 -19
- /package/dist/assets/{ai.svg → conversation_summary.svg} +0 -0
|
@@ -4,151 +4,152 @@ import { DatePatterns, SelectionMode, States } from "../../Enums/Enums";
|
|
|
4
4
|
import { CometChatOption } from "../../modals";
|
|
5
5
|
interface ConversationsProps {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
menu?: JSX.Element;
|
|
10
|
-
/**
|
|
11
|
-
* Title of the component
|
|
7
|
+
* Disables the display of message read receipts.
|
|
12
8
|
*
|
|
13
|
-
* @
|
|
14
|
-
|
|
15
|
-
title?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Request builder to fetch conversations
|
|
18
|
-
* @defaultValue Default request builder having the limit set to 30
|
|
19
|
-
*/
|
|
20
|
-
conversationsRequestBuilder?: CometChat.ConversationsRequestBuilder;
|
|
21
|
-
/**
|
|
22
|
-
* Function to call whenever the component encounters an error
|
|
9
|
+
* @remarks If set to `true`, the receipt status of the sent message won't be displayed.
|
|
10
|
+
* @defaultValue `false`
|
|
23
11
|
*/
|
|
24
|
-
|
|
12
|
+
hideReceipts?: boolean;
|
|
25
13
|
/**
|
|
26
|
-
*
|
|
14
|
+
* Hides the default and the custom error view passed in the `errorView` prop.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue `false`
|
|
27
17
|
*/
|
|
28
|
-
|
|
18
|
+
hideError?: boolean;
|
|
29
19
|
/**
|
|
30
|
-
*
|
|
20
|
+
* Hides the delete conversation option in the default context menu.
|
|
31
21
|
*
|
|
32
|
-
* @
|
|
33
|
-
* This prop is used if `listItemView` prop is not provided
|
|
22
|
+
* @defaultValue `false`
|
|
34
23
|
*/
|
|
35
|
-
|
|
24
|
+
hideDeleteConversation?: boolean;
|
|
36
25
|
/**
|
|
37
|
-
*
|
|
26
|
+
* Hides the user's online/offline status indicator.
|
|
38
27
|
*
|
|
39
|
-
* @
|
|
40
|
-
* This prop is used if `listItemView` prop is not provided
|
|
28
|
+
* @defaultValue `false`
|
|
41
29
|
*/
|
|
42
|
-
|
|
30
|
+
hideUserStatus?: boolean;
|
|
43
31
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* @remarks
|
|
47
|
-
* If set to true, the status indicator of the default list item view is not displayed for conversation objects related to users
|
|
32
|
+
* Hides the group type icon.
|
|
48
33
|
*
|
|
49
34
|
* @defaultValue `false`
|
|
50
35
|
*/
|
|
51
|
-
|
|
36
|
+
hideGroupType?: boolean;
|
|
52
37
|
/**
|
|
53
|
-
*
|
|
38
|
+
* A request builder to fetch conversations.
|
|
54
39
|
*
|
|
55
|
-
* @
|
|
56
|
-
|
|
40
|
+
* @defaultValue Default request builder with the limit set to 30.
|
|
41
|
+
*/
|
|
42
|
+
conversationsRequestBuilder?: CometChat.ConversationsRequestBuilder;
|
|
43
|
+
/**
|
|
44
|
+
* Specifies the conversation to highlight in the list.
|
|
57
45
|
*/
|
|
58
46
|
activeConversation?: CometChat.Conversation;
|
|
59
47
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* @remarks
|
|
63
|
-
* This prop is used if `listItemView` prop is not provided.
|
|
48
|
+
* Allows the user to pass custom formatters for text.
|
|
64
49
|
*
|
|
65
|
-
*
|
|
50
|
+
* These formatters should be an array of `CometChatTextFormatter` instances, enabling customized text rendering and processing.
|
|
66
51
|
*/
|
|
67
|
-
|
|
52
|
+
textFormatters?: CometChatTextFormatter[];
|
|
68
53
|
/**
|
|
69
|
-
*
|
|
54
|
+
* Determines the selection mode for the component.
|
|
70
55
|
*
|
|
71
|
-
* @
|
|
72
|
-
* If set to true, the receipt status of the sent message won't be displayed, and received messages won't be marked as delivered
|
|
73
|
-
*
|
|
74
|
-
* @defaultValue `false`
|
|
56
|
+
* @defaultValue `SelectionMode.none`
|
|
75
57
|
*/
|
|
76
|
-
|
|
58
|
+
selectionMode?: SelectionMode;
|
|
77
59
|
/**
|
|
78
|
-
*
|
|
60
|
+
* A function that returns a list of actions available when hovering over a conversation item.
|
|
61
|
+
* @param conversation - An instance of `CometChat.Conversation` representing the conversation.
|
|
62
|
+
* @returns An array of `CometChatOption` objects.
|
|
79
63
|
*/
|
|
80
64
|
options?: ((conversation: CometChat.Conversation) => CometChatOption[]) | null;
|
|
81
65
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* @remarks
|
|
85
|
-
* The date component is inside the tail view of the default list item view when `selectionMode` prop is set to `SelectionMode.none`
|
|
66
|
+
* Specifies the format for displaying dates within the component.
|
|
86
67
|
*/
|
|
87
68
|
datePattern?: DatePatterns;
|
|
88
69
|
/**
|
|
89
|
-
*
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Custom view for the empty state of the component
|
|
70
|
+
* Disables sound for incoming messages.
|
|
71
|
+
*
|
|
72
|
+
* @defaultValue `false`
|
|
94
73
|
*/
|
|
95
|
-
|
|
74
|
+
disableSoundForMessages?: boolean;
|
|
96
75
|
/**
|
|
97
|
-
* Custom
|
|
76
|
+
* Custom audio sound for incoming messages.
|
|
98
77
|
*/
|
|
99
|
-
|
|
78
|
+
customSoundForMessages?: string;
|
|
100
79
|
/**
|
|
101
|
-
*
|
|
80
|
+
* Callback function triggered when the component encounters an error.
|
|
102
81
|
*
|
|
103
|
-
* @
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* @defaultValue `false`
|
|
82
|
+
* @param error - An instance of `CometChat.CometChatException` representing the error.
|
|
83
|
+
* @returns void
|
|
107
84
|
*/
|
|
108
|
-
|
|
85
|
+
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
109
86
|
/**
|
|
110
|
-
*
|
|
87
|
+
* Callback function invoked when a conversation item is clicked.
|
|
88
|
+
*
|
|
89
|
+
* @param conversation - An instance of `CometChat.Conversation` representing the clicked conversation.
|
|
90
|
+
* @returns void
|
|
111
91
|
*/
|
|
112
92
|
onItemClick?: (conversation: CometChat.Conversation) => void;
|
|
113
93
|
/**
|
|
114
|
-
*
|
|
94
|
+
* Callback function invoked when a conversation item is selected.
|
|
115
95
|
*
|
|
116
|
-
* @
|
|
117
|
-
*
|
|
96
|
+
* @param conversation - An instance of `CometChat.Conversation` representing the selected conversation.
|
|
97
|
+
* @param selected - A boolean indicating whether the item is selected.
|
|
98
|
+
* @returns void
|
|
99
|
+
* @remarks This prop works only if `selectionMode` is not set to `SelectionMode.none`.
|
|
118
100
|
*/
|
|
119
101
|
onSelect?: (conversation: CometChat.Conversation, selected: boolean) => void;
|
|
120
102
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* @defaultValue `false`
|
|
103
|
+
* A custom component to render in the top-right corner of the Conversations UI.
|
|
124
104
|
*/
|
|
125
|
-
|
|
105
|
+
headerView?: JSX.Element;
|
|
126
106
|
/**
|
|
127
|
-
*
|
|
128
|
-
|
|
107
|
+
* A custom component to display during the loading state.
|
|
108
|
+
*/
|
|
109
|
+
loadingView?: JSX.Element;
|
|
110
|
+
/**
|
|
111
|
+
* A custom component to display when there are no conversations available.
|
|
129
112
|
*/
|
|
130
|
-
|
|
113
|
+
emptyView?: JSX.Element;
|
|
131
114
|
/**
|
|
132
|
-
*
|
|
115
|
+
* A custom component to display when an error occurs.
|
|
116
|
+
*/
|
|
117
|
+
errorView?: JSX.Element;
|
|
118
|
+
/**
|
|
119
|
+
* A custom view to render each conversation in the list.
|
|
133
120
|
*
|
|
121
|
+
* @param conversation - An instance of `CometChat.Conversation` representing the conversation.
|
|
122
|
+
* @returns A JSX element to be rendered as the conversation item.
|
|
134
123
|
*/
|
|
135
|
-
|
|
124
|
+
itemView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
136
125
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
126
|
+
* A function that renders a JSX element to display the leading view.
|
|
127
|
+
*
|
|
128
|
+
* @param conversation - An instance of `CometChat.Conversation` representing the conversation.
|
|
129
|
+
* @returns A JSX element to be rendered as the leading view.
|
|
130
|
+
*/
|
|
131
|
+
leadingView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
140
132
|
/**
|
|
141
|
-
*
|
|
133
|
+
* A function that renders a JSX element to display the title view.
|
|
134
|
+
*
|
|
135
|
+
* @param conversation - An instance of `CometChat.Conversation` representing the conversation.
|
|
136
|
+
* @returns A JSX element to be rendered as the title view.
|
|
142
137
|
*/
|
|
143
|
-
|
|
138
|
+
titleView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
144
139
|
/**
|
|
145
|
-
*
|
|
140
|
+
* A custom view to render the subtitle for each conversation.
|
|
141
|
+
*
|
|
142
|
+
* @param conversation - An instance of `CometChat.Conversation` representing the conversation.
|
|
143
|
+
* @returns A JSX element to be rendered as the subtitle view.
|
|
146
144
|
*/
|
|
147
|
-
|
|
145
|
+
subtitleView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
148
146
|
/**
|
|
149
|
-
*
|
|
147
|
+
* A custom view to render at the end of each conversation item.
|
|
148
|
+
*
|
|
149
|
+
* @param conversation - An instance of `CometChat.Conversation` representing the conversation.
|
|
150
|
+
* @returns A JSX element to be rendered as the trailing view.
|
|
150
151
|
*/
|
|
151
|
-
|
|
152
|
+
trailingView?: (conversation: CometChat.Conversation) => JSX.Element;
|
|
152
153
|
}
|
|
153
154
|
export type Action = {
|
|
154
155
|
type: "appendConversations";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { CometChat } from '@cometchat/chat-sdk-javascript';
|
|
2
2
|
type Args = {
|
|
3
3
|
conversationsRequestBuilder: CometChat.ConversationsRequestBuilder | null;
|
|
4
|
+
errorHandler: (error: unknown, source?: string) => void;
|
|
4
5
|
};
|
|
5
6
|
export declare class ConversationsManager {
|
|
6
7
|
private static limit;
|
|
7
8
|
private conversationsRequest;
|
|
8
9
|
private static conversationType;
|
|
10
|
+
private static errorHandler;
|
|
9
11
|
/**
|
|
10
12
|
* Set `conversationsRequest` of the instance
|
|
11
13
|
*/
|
|
@@ -19,49 +21,49 @@ export declare class ConversationsManager {
|
|
|
19
21
|
*
|
|
20
22
|
* @returns Function to call to remove the attached SDK user listener
|
|
21
23
|
*/
|
|
22
|
-
static attachUserListener(callback: (user: CometChat.User) => void): () => void;
|
|
24
|
+
static attachUserListener(callback: (user: CometChat.User) => void): (() => void) | undefined;
|
|
23
25
|
/**
|
|
24
26
|
* Attaches an SDK group listener
|
|
25
27
|
*
|
|
26
28
|
* @returns Function to call to remove the attached SDK group listener
|
|
27
29
|
*/
|
|
28
|
-
static attachGroupListener(callback: (message: CometChat.BaseMessage, remove?: boolean) => Promise<void>, loggedInUser: CometChat.User | null): () => void;
|
|
30
|
+
static attachGroupListener(callback: (message: CometChat.BaseMessage, remove?: boolean) => Promise<void>, loggedInUser: CometChat.User | null): (() => void) | undefined;
|
|
29
31
|
/**
|
|
30
32
|
* Attaches an SDK message received listener
|
|
31
33
|
*
|
|
32
34
|
* @returns - Function to remove the added SDK message received listener
|
|
33
35
|
*/
|
|
34
|
-
static attachMessageReceivedListener(callback: (message: CometChat.BaseMessage) => Promise<void>): () => void;
|
|
36
|
+
static attachMessageReceivedListener(callback: (message: CometChat.BaseMessage) => Promise<void>): (() => void) | undefined;
|
|
35
37
|
/**
|
|
36
38
|
* Attaches an SDK message receipt listener
|
|
37
39
|
*
|
|
38
40
|
* @returns - Function to remove the added SDK message receipt listener
|
|
39
41
|
*/
|
|
40
|
-
static attachMessageReceiptListener(callback: (receipt: CometChat.MessageReceipt, updateReadAt: boolean) => void): () => void;
|
|
42
|
+
static attachMessageReceiptListener(callback: (receipt: CometChat.MessageReceipt, updateReadAt: boolean) => void): (() => void) | undefined;
|
|
41
43
|
/**
|
|
42
44
|
* Attaches an SDK message typing listener
|
|
43
45
|
*
|
|
44
46
|
* @returns - Function to remove the added SDK message typing listener
|
|
45
47
|
*/
|
|
46
|
-
static attachMessageTypingListener(callback: (typingIndicator: CometChat.TypingIndicator, typingStarted: boolean) => void): () => void;
|
|
48
|
+
static attachMessageTypingListener(callback: (typingIndicator: CometChat.TypingIndicator, typingStarted: boolean) => void): (() => void) | undefined;
|
|
47
49
|
/**
|
|
48
50
|
* Attaches an SDK message modified listener
|
|
49
51
|
*
|
|
50
52
|
* @returns - Function to remove the added SDK message modified listener
|
|
51
53
|
*/
|
|
52
|
-
static attachMessageModifiedListener(callback: (message: CometChat.BaseMessage) => void): () => void;
|
|
54
|
+
static attachMessageModifiedListener(callback: (message: CometChat.BaseMessage) => void): (() => void) | undefined;
|
|
53
55
|
/**
|
|
54
56
|
* Attaches an SDK call listener
|
|
55
57
|
*
|
|
56
58
|
* @returns - Function to remove the added SDK call listener
|
|
57
59
|
*/
|
|
58
|
-
static attachCallListener(callback: (message: CometChat.BaseMessage) => void): () => void;
|
|
60
|
+
static attachCallListener(callback: (message: CometChat.BaseMessage) => void): (() => void) | undefined;
|
|
59
61
|
/**
|
|
60
62
|
* Attaches an SDK websocket listener
|
|
61
63
|
*
|
|
62
64
|
* @returns - Function to remove the added SDK websocket listener
|
|
63
65
|
*/
|
|
64
|
-
static attachConnestionListener(callback: () => void): () => void;
|
|
66
|
+
static attachConnestionListener(callback: () => void): (() => void) | undefined;
|
|
65
67
|
/**
|
|
66
68
|
* Determines if the last message should trigger an update based on its category and type.
|
|
67
69
|
*
|
|
@@ -8,18 +8,15 @@ type Args = {
|
|
|
8
8
|
fetchNextAndAppendConversations: (fetchId: string) => Promise<void>;
|
|
9
9
|
fetchNextIdRef: React.MutableRefObject<string>;
|
|
10
10
|
dispatch: React.Dispatch<Action>;
|
|
11
|
-
|
|
12
|
-
errorHandler: (error: unknown) => void;
|
|
11
|
+
errorHandler: (error: unknown, source?: string) => void;
|
|
13
12
|
refreshSingleConversation: (message: CometChat.BaseMessage, remove?: boolean) => Promise<void>;
|
|
14
13
|
onMessageReceived: (message: CometChat.BaseMessage) => Promise<void>;
|
|
15
14
|
setReceipts: (messageReceipt: CometChat.MessageReceipt, updateReadAt: boolean) => void;
|
|
16
15
|
setTypingIndicator: (typingIndicator: CometChat.TypingIndicator, typingStarted: boolean) => void;
|
|
17
|
-
disableTyping: boolean;
|
|
18
16
|
loggedInUser: CometChat.User | null;
|
|
19
|
-
isFirstReload: boolean;
|
|
20
|
-
disableUsersPresence?: boolean;
|
|
21
17
|
activeConversation: Conversation | null;
|
|
22
18
|
setActiveConversationState: React.Dispatch<React.SetStateAction<Conversation | null>>;
|
|
19
|
+
hideUserStatus?: boolean;
|
|
23
20
|
};
|
|
24
21
|
export declare function useCometChatConversations(args: Args): void;
|
|
25
22
|
export {};
|
|
@@ -4,140 +4,158 @@ import { SelectionMode, States } from "../../Enums/Enums";
|
|
|
4
4
|
import { CometChatOption } from "../../modals";
|
|
5
5
|
interface GroupMembersProps {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Hides the default search bar.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue `false`
|
|
8
10
|
*/
|
|
9
|
-
|
|
11
|
+
hideSearch?: boolean;
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Hides the default and custom error view passed in `errorView` prop.
|
|
12
14
|
*
|
|
13
|
-
* @defaultValue `
|
|
15
|
+
* @defaultValue `false`
|
|
14
16
|
*/
|
|
15
|
-
|
|
17
|
+
hideError?: boolean;
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* Disables the loading state while fetching users.
|
|
18
20
|
*
|
|
19
|
-
* @defaultValue `
|
|
21
|
+
* @defaultValue `false`
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
disableLoadingState?: boolean;
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
25
|
+
* Hides the option to kick a member from the group.
|
|
24
26
|
*
|
|
25
27
|
* @defaultValue `false`
|
|
26
28
|
*/
|
|
27
|
-
|
|
29
|
+
hideKickMemberOption?: boolean;
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* Hides the option to ban a member from the group.
|
|
30
32
|
*
|
|
31
|
-
* @
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
* @defaultValue `false`
|
|
34
|
+
*/
|
|
35
|
+
hideBanMemberOption?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Hides the option to change the scope of a group member.
|
|
34
38
|
*
|
|
35
|
-
* @defaultValue
|
|
39
|
+
* @defaultValue `false`
|
|
36
40
|
*/
|
|
37
|
-
|
|
41
|
+
hideScopeChangeOption?: boolean;
|
|
38
42
|
/**
|
|
39
|
-
*
|
|
43
|
+
* Hides the user's online/offline status indicator.
|
|
40
44
|
*
|
|
41
|
-
* @
|
|
42
|
-
* If the search input is not empty,
|
|
43
|
-
* the search keyword of this request builder is set to the text in the search input
|
|
45
|
+
* @defaultValue `false`
|
|
44
46
|
*/
|
|
45
|
-
|
|
47
|
+
hideUserStatus?: boolean;
|
|
46
48
|
/**
|
|
47
|
-
*
|
|
49
|
+
* The group for which members are being fetched.
|
|
48
50
|
*/
|
|
49
51
|
group: CometChat.Group;
|
|
50
52
|
/**
|
|
51
|
-
*
|
|
53
|
+
* Request builder to fetch group members.
|
|
54
|
+
*
|
|
55
|
+
* @defaultValue Default request builder having the limit set to `30`.
|
|
52
56
|
*/
|
|
53
|
-
|
|
57
|
+
groupMemberRequestBuilder?: CometChat.GroupMembersRequestBuilder;
|
|
54
58
|
/**
|
|
55
|
-
*
|
|
59
|
+
* Request builder with search parameters to fetch group members.
|
|
60
|
+
*
|
|
61
|
+
* @remarks If the search input is not empty, the search keyword of this request builder is set to the text in the search input.
|
|
56
62
|
*/
|
|
57
|
-
|
|
63
|
+
searchRequestBuilder?: CometChat.GroupMembersRequestBuilder;
|
|
58
64
|
/**
|
|
59
|
-
*
|
|
65
|
+
* The keyword used to filter the group members list.
|
|
66
|
+
*
|
|
67
|
+
* @defaultValue `""`
|
|
60
68
|
*/
|
|
61
|
-
|
|
69
|
+
searchKeyword?: string;
|
|
62
70
|
/**
|
|
63
|
-
*
|
|
71
|
+
* A function that returns a list of actions available when hovering over a group member item.
|
|
72
|
+
*
|
|
73
|
+
* @param group - The group instance.
|
|
74
|
+
* @param groupMember - An instance of `CometChat.GroupMember` representing the group member.
|
|
75
|
+
* @returns An array of `CometChatOption`.
|
|
64
76
|
*/
|
|
65
|
-
|
|
77
|
+
options?: (group: CometChat.Group, groupMember: CometChat.GroupMember) => CometChatOption[];
|
|
66
78
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* @remarks
|
|
70
|
-
* If set to true, hides the default and the custom error view
|
|
79
|
+
* Selection mode to use for the default list item view.
|
|
71
80
|
*
|
|
72
|
-
* @defaultValue `
|
|
81
|
+
* @defaultValue `SelectionMode.none`
|
|
73
82
|
*/
|
|
74
|
-
|
|
83
|
+
selectionMode?: SelectionMode;
|
|
75
84
|
/**
|
|
76
|
-
*
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
* Callback function invoked when an error occurs in the component.
|
|
86
|
+
*/
|
|
87
|
+
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
88
|
+
/**
|
|
89
|
+
* Callback function invoked when a group member item is clicked.
|
|
80
90
|
*
|
|
81
|
-
* @
|
|
91
|
+
* @param groupMember - An instance of `CometChat.GroupMember` representing the group member.
|
|
92
|
+
* returns void
|
|
82
93
|
*/
|
|
83
|
-
|
|
94
|
+
onItemClick?: (groupMember: CometChat.GroupMember) => void;
|
|
84
95
|
/**
|
|
85
|
-
*
|
|
96
|
+
* Callback function invoked when a group member is selected or deselected.
|
|
86
97
|
*
|
|
87
|
-
* @
|
|
88
|
-
*
|
|
98
|
+
* @param groupMember - An instance of `CometChat.GroupMember` representing the group member.
|
|
99
|
+
* @param selected - Boolean value to identify if the member is selected or removed.
|
|
100
|
+
* @returns void
|
|
89
101
|
*/
|
|
90
|
-
|
|
102
|
+
onSelect?: (groupMember: CometChat.GroupMember, selected: boolean) => void;
|
|
91
103
|
/**
|
|
92
|
-
*
|
|
104
|
+
* Callback function invoked when the group members list is empty.
|
|
105
|
+
* @returns void
|
|
93
106
|
*/
|
|
94
|
-
|
|
107
|
+
onEmpty?: () => void;
|
|
95
108
|
/**
|
|
96
|
-
*
|
|
109
|
+
* A custom component to render in the top-right corner of the group members list.
|
|
97
110
|
*/
|
|
98
|
-
|
|
111
|
+
headerView?: JSX.Element;
|
|
99
112
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* @remarks
|
|
103
|
-
* This prop will be used if `listItemView` is not provided
|
|
113
|
+
* A custom view to display during the loading state.
|
|
104
114
|
*/
|
|
105
|
-
|
|
115
|
+
loadingView?: JSX.Element;
|
|
106
116
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* @remarks
|
|
110
|
-
* This prop is used if `listItemView` prop is not provided
|
|
111
|
-
*
|
|
112
|
-
* @defaultValue `SelectionMode.none`
|
|
117
|
+
* Custom view for the error state of the component.
|
|
113
118
|
*/
|
|
114
|
-
|
|
119
|
+
errorView?: JSX.Element;
|
|
115
120
|
/**
|
|
116
|
-
*
|
|
121
|
+
* A custom view to display when no group members are available in the list.
|
|
117
122
|
*/
|
|
118
|
-
|
|
123
|
+
emptyView?: JSX.Element;
|
|
119
124
|
/**
|
|
120
|
-
*
|
|
125
|
+
* A custom view to render for each group member in the fetched list.
|
|
121
126
|
*
|
|
122
|
-
* @
|
|
123
|
-
*
|
|
127
|
+
* @param groupMember - An instance of `CometChat.GroupMember` representing the group member.
|
|
128
|
+
* @returns A JSX element to be rendered as the group member item.
|
|
124
129
|
*/
|
|
125
|
-
|
|
130
|
+
itemView?: (groupMember: CometChat.GroupMember) => JSX.Element;
|
|
126
131
|
/**
|
|
127
|
-
*
|
|
132
|
+
* A function that renders a JSX element to display the leading view.
|
|
128
133
|
*
|
|
129
|
-
* @
|
|
134
|
+
* @param groupMember - An instance of `CometChat.GroupMember` representing the group member.
|
|
135
|
+
* @returns A JSX element to be rendered as the leading view.
|
|
130
136
|
*/
|
|
131
|
-
|
|
137
|
+
leadingView?: (groupMember: CometChat.GroupMember) => JSX.Element;
|
|
132
138
|
/**
|
|
133
|
-
*
|
|
139
|
+
* A function that renders a JSX element to display the title view.
|
|
140
|
+
*
|
|
141
|
+
* @param groupMember - An instance of `CometChat.GroupMember` representing the group member.
|
|
142
|
+
* @returns A JSX element to be rendered as the title view.
|
|
134
143
|
*/
|
|
135
|
-
|
|
144
|
+
titleView?: (groupMember: CometChat.GroupMember) => JSX.Element;
|
|
136
145
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
146
|
+
* A function that renders a JSX element to display the subtitle view.
|
|
147
|
+
*
|
|
148
|
+
* @param groupMember - An instance of `CometChat.GroupMember` representing the group member.
|
|
149
|
+
* @returns A JSX element to be rendered as the subtitle view.
|
|
139
150
|
*/
|
|
140
|
-
|
|
151
|
+
subtitleView?: (groupMember: CometChat.GroupMember) => JSX.Element;
|
|
152
|
+
/**
|
|
153
|
+
* A function that renders a JSX element to display the trailing view.
|
|
154
|
+
*
|
|
155
|
+
* @param groupMember - An instance of `CometChat.GroupMember` representing the group member.
|
|
156
|
+
* @returns A JSX element to be rendered as the trailing view.
|
|
157
|
+
*/
|
|
158
|
+
trailingView?: (groupMember: CometChat.GroupMember) => JSX.Element;
|
|
141
159
|
}
|
|
142
160
|
export type Action = {
|
|
143
161
|
type: "appendGroupMembers";
|
|
@@ -11,12 +11,12 @@ type Args = {
|
|
|
11
11
|
fetchNextIdRef: React.MutableRefObject<string>;
|
|
12
12
|
dispatch: React.Dispatch<Action>;
|
|
13
13
|
loggedInUserRef: React.MutableRefObject<CometChat.User | null>;
|
|
14
|
-
errorHandler: (error: unknown) => void;
|
|
14
|
+
errorHandler: (error: unknown, source?: string | undefined) => void;
|
|
15
15
|
updateGroupMemberScope: (newScope: string) => Promise<void>;
|
|
16
16
|
searchKeyword: string;
|
|
17
17
|
disableLoadingState: boolean;
|
|
18
18
|
groupMembersSearchText: React.MutableRefObject<string>;
|
|
19
|
-
|
|
19
|
+
hideUserStatus?: boolean;
|
|
20
20
|
};
|
|
21
21
|
export declare function Hooks(args: Args): void;
|
|
22
22
|
export {};
|