@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.
Files changed (119) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/Send.svg +3 -0
  3. package/dist/assets/loading.svg +5 -16
  4. package/dist/index.d.ts +1155 -950
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/styles/CometChatCallButtons.css +1 -1
  8. package/dist/styles/CometChatCallLogs.css +3 -3
  9. package/dist/styles/{components/AIConversationStarter.css → CometChatConversationStarter.css} +2 -2
  10. package/dist/styles/{components/AIConversationSummary.css → CometChatConversationSummary.css} +12 -12
  11. package/dist/styles/CometChatConversations.css +10 -10
  12. package/dist/styles/CometChatGroupMembers.css +5 -5
  13. package/dist/styles/CometChatIncomingCall.css +1 -1
  14. package/dist/styles/CometChatList.css +15 -22
  15. package/dist/styles/CometChatListItem.css +2 -2
  16. package/dist/styles/CometChatMessageComposer.css +44 -41
  17. package/dist/styles/CometChatMessageHeader.css +22 -5
  18. package/dist/styles/CometChatMessageInformation.css +3 -2
  19. package/dist/styles/CometChatMessageList.css +6 -5
  20. package/dist/styles/CometChatOutgoingCall.css +5 -0
  21. package/dist/styles/{AISmartReplies.css → CometChatSmartReplies.css} +72 -79
  22. package/dist/styles/PollsBubble.css +7 -1
  23. package/dist/styles/components/CometChatCallButtons.css +1 -1
  24. package/dist/styles/components/CometChatCallLogs.css +3 -3
  25. package/dist/styles/{AIConversationStarter.css → components/CometChatConversationStarter.css} +2 -2
  26. package/dist/styles/{AIConversationSummary.css → components/CometChatConversationSummary.css} +12 -12
  27. package/dist/styles/components/CometChatConversations.css +10 -10
  28. package/dist/styles/components/CometChatGroupMembers.css +5 -5
  29. package/dist/styles/components/CometChatIncomingCall.css +1 -1
  30. package/dist/styles/components/CometChatList.css +15 -22
  31. package/dist/styles/components/CometChatListItem.css +2 -2
  32. package/dist/styles/components/CometChatMessageComposer.css +44 -41
  33. package/dist/styles/components/CometChatMessageHeader.css +22 -5
  34. package/dist/styles/components/CometChatMessageInformation.css +3 -2
  35. package/dist/styles/components/CometChatMessageList.css +6 -5
  36. package/dist/styles/components/CometChatOutgoingCall.css +5 -0
  37. package/dist/styles/components/{AISmartReplies.css → CometChatSmartReplies.css} +72 -79
  38. package/dist/styles/components/PollsBubble.css +7 -1
  39. package/dist/styles/components/index.css +3 -3
  40. package/dist/styles/index.css +3 -3
  41. package/dist/types/CometChatCustomHooks.d.ts +1 -1
  42. package/dist/types/CometChatUIKit/CometChatUIKit.d.ts +0 -6
  43. package/dist/types/CometChatUIKit/UIKitSettings.d.ts +0 -22
  44. package/dist/types/Enums/Enums.d.ts +9 -0
  45. package/dist/types/components/BaseComponents/CometChatConversationStarter/CometChatConversationStarter.d.ts +6 -0
  46. package/dist/types/components/BaseComponents/CometChatConversationSummary/CometChatConversationSummary.d.ts +6 -0
  47. package/dist/types/components/BaseComponents/CometChatList/CometChatList.d.ts +12 -12
  48. package/dist/types/components/BaseComponents/CometChatListItem/CometChatListItem.d.ts +3 -1
  49. package/dist/types/components/BaseComponents/CometChatSmartReplies/CometChatSmartReplies.d.ts +7 -0
  50. package/dist/types/components/Calling/CallButtonConfiguration.d.ts +1 -1
  51. package/dist/types/components/Calling/CallingExtensionDecorator.d.ts +2 -2
  52. package/dist/types/components/Calling/CometChatCallButtons/CometChatCallButtons.d.ts +30 -12
  53. package/dist/types/components/Calling/CometChatCallButtons/useCallButtons.d.ts +1 -1
  54. package/dist/types/components/Calling/CometChatCallLogs/CometChatCallLogs.d.ts +50 -38
  55. package/dist/types/components/Calling/CometChatCallLogs/useCometChatCallLogs.d.ts +1 -1
  56. package/dist/types/components/Calling/CometChatIncomingCall/CometChatIncomingCall.d.ts +48 -26
  57. package/dist/types/components/Calling/CometChatIncomingCall/useCometChatIncomingCall.d.ts +1 -1
  58. package/dist/types/components/Calling/CometChatOutgoingCall/CometChatOutgoingCall.d.ts +31 -15
  59. package/dist/types/components/Calling/CometChatOutgoingCall/useCometChatOutgoingCall.d.ts +1 -1
  60. package/dist/types/components/Calling/OutgoingCallConfiguration.d.ts +7 -3
  61. package/dist/types/components/CometChatConversations/CometChatConversations.d.ts +88 -87
  62. package/dist/types/components/CometChatConversations/controller.d.ts +10 -8
  63. package/dist/types/components/CometChatConversations/useCometChatConversations.d.ts +2 -5
  64. package/dist/types/components/CometChatGroupMembers/CometChatGroupMembers.d.ts +94 -76
  65. package/dist/types/components/CometChatGroupMembers/useCometChatGroupMembers.d.ts +2 -2
  66. package/dist/types/components/CometChatGroups/CometChatGroups.d.ts +74 -62
  67. package/dist/types/components/CometChatGroups/useCometChatGroups.d.ts +1 -0
  68. package/dist/types/components/CometChatMessageComposer/CometChatMessageComposer.d.ts +107 -49
  69. package/dist/types/components/CometChatMessageComposer/useCometChatMessageComposer.d.ts +1 -1
  70. package/dist/types/components/CometChatMessageHeader/CometChatMessageHeader.d.ts +77 -16
  71. package/dist/types/components/CometChatMessageHeader/useCometChatMessageHeader.d.ts +1 -1
  72. package/dist/types/components/CometChatMessageInformation/CometChatMessageInformation.d.ts +5 -0
  73. package/dist/types/components/CometChatMessageList/CometChatMessageList.d.ts +133 -55
  74. package/dist/types/components/CometChatMessageList/CometChatMessageListController.d.ts +3 -1
  75. package/dist/types/components/CometChatMessageList/useCometChatMessageList.d.ts +1 -1
  76. package/dist/types/components/CometChatThreadedMessagePreview/CometChatThreadedMessagePreview.d.ts +34 -2
  77. package/dist/types/components/CometChatUsers/CometChatUsers.d.ts +88 -89
  78. package/dist/types/components/CometChatUsers/useCometChatUsers.d.ts +2 -1
  79. package/dist/types/components/Extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.d.ts +4 -3
  80. package/dist/types/components/Extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.d.ts +4 -3
  81. package/dist/types/components/Extensions/MessageTranslation/MessageTranslationExtensionDecorator.d.ts +3 -1
  82. package/dist/types/components/Extensions/Polls/PollsBubble.d.ts +5 -0
  83. package/dist/types/components/Extensions/Polls/PollsExtensionDecorator.d.ts +4 -3
  84. package/dist/types/components/Extensions/Stickers/StickersExtensionDecorator.d.ts +2 -3
  85. package/dist/types/components/Reactions/CometChatReactionInfo/CometChatReactionInfo.d.ts +3 -2
  86. package/dist/types/components/Reactions/CometChatReactionList/CometChatReactionList.d.ts +3 -2
  87. package/dist/types/components/Reactions/CometChatReactions/CometChatReactions.d.ts +3 -2
  88. package/dist/types/index.d.ts +8 -7
  89. package/dist/types/resources/CometChatLocalize/cometchat-localize.d.ts +129 -115
  90. package/dist/types/utils/DataSource.d.ts +17 -18
  91. package/dist/types/utils/DataSourceDecorator.d.ts +17 -18
  92. package/dist/types/utils/GroupMemberUtils.d.ts +1 -1
  93. package/dist/types/utils/MessageUtils.d.ts +1 -1
  94. package/dist/types/utils/MessagesDataSource.d.ts +29 -16
  95. package/dist/types/utils/util.d.ts +5 -0
  96. package/package.json +1 -1
  97. package/dist/assets/ai-empty.svg +0 -22
  98. package/dist/assets/ai-error.svg +0 -3
  99. package/dist/assets/heart-reaction.png +0 -0
  100. package/dist/assets/send.svg +0 -12
  101. package/dist/styles/AICard.css +0 -30
  102. package/dist/styles/components/AICard.css +0 -30
  103. package/dist/types/components/AI/AIBaseConfiguration.d.ts +0 -51
  104. package/dist/types/components/AI/AIConversationStarter/AIConversationStarterConfiguration.d.ts +0 -20
  105. package/dist/types/components/AI/AIConversationStarter/AIConversationStarterDecorator.d.ts +0 -18
  106. package/dist/types/components/AI/AIConversationStarter/AIConversationStarterExtension.d.ts +0 -8
  107. package/dist/types/components/AI/AIConversationStarter/AIConversationStarterView.d.ts +0 -8
  108. package/dist/types/components/AI/AIConversationSummary/AIConversationSummaryConfiguration.d.ts +0 -31
  109. package/dist/types/components/AI/AIConversationSummary/AIConversationSummaryDecorator.d.ts +0 -22
  110. package/dist/types/components/AI/AIConversationSummary/AIConversationSummaryExtension.d.ts +0 -8
  111. package/dist/types/components/AI/AIConversationSummary/AIConversationSummaryView.d.ts +0 -9
  112. package/dist/types/components/AI/AIExtensionDataSource.d.ts +0 -6
  113. package/dist/types/components/AI/AISmartReplies/AISmartRepliesConfiguration.d.ts +0 -28
  114. package/dist/types/components/AI/AISmartReplies/AISmartRepliesDecorator.d.ts +0 -21
  115. package/dist/types/components/AI/AISmartReplies/AISmartRepliesExtension.d.ts +0 -8
  116. package/dist/types/components/AI/AISmartReplies/AISmartRepliesView.d.ts +0 -11
  117. package/dist/types/components/BaseComponents/CometChatLiveReaction/CometChatLiveReaction.d.ts +0 -5
  118. package/dist/types/components/BaseComponents/CometChatLiveReaction/useLiveReactionHook.d.ts +0 -19
  119. /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
- * Custom view to render on the top-right of the component
8
- */
9
- menu?: JSX.Element;
10
- /**
11
- * Title of the component
7
+ * Disables the display of message read receipts.
12
8
  *
13
- * @defaultValue `localize("CHATS")`
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
- onError?: (error: CometChat.CometChatException) => void;
12
+ hideReceipts?: boolean;
25
13
  /**
26
- * Custom list item view to be rendered for each conversation in the fetched list
14
+ * Hides the default and the custom error view passed in the `errorView` prop.
15
+ *
16
+ * @defaultValue `false`
27
17
  */
28
- listItemView?: (conversation: CometChat.Conversation) => JSX.Element;
18
+ hideError?: boolean;
29
19
  /**
30
- * Custom subtitle view to be rendered for each conversation in the fetched list
20
+ * Hides the delete conversation option in the default context menu.
31
21
  *
32
- * @remarks
33
- * This prop is used if `listItemView` prop is not provided
22
+ * @defaultValue `false`
34
23
  */
35
- subtitleView?: (conversation: CometChat.Conversation) => JSX.Element;
24
+ hideDeleteConversation?: boolean;
36
25
  /**
37
- * Custom tail view to be rendered for each conversation in the fetched list
26
+ * Hides the user's online/offline status indicator.
38
27
  *
39
- * @remarks
40
- * This prop is used if `listItemView` prop is not provided
28
+ * @defaultValue `false`
41
29
  */
42
- tailView?: (conversation: CometChat.Conversation) => JSX.Element;
30
+ hideUserStatus?: boolean;
43
31
  /**
44
- * Hide user presence
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
- disableUsersPresence?: boolean;
36
+ hideGroupType?: boolean;
52
37
  /**
53
- * Conversation to highlight
38
+ * A request builder to fetch conversations.
54
39
  *
55
- * @remarks
56
- * This prop is used if `listItemView` prop is not provided
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
- * Selection mode to use for the default tail view
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
- * @defaultValue `SelectionMode.none`
50
+ * These formatters should be an array of `CometChatTextFormatter` instances, enabling customized text rendering and processing.
66
51
  */
67
- selectionMode?: SelectionMode;
52
+ textFormatters?: CometChatTextFormatter[];
68
53
  /**
69
- * Disable receipt status
54
+ * Determines the selection mode for the component.
70
55
  *
71
- * @remarks
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
- hideReceipt?: boolean;
58
+ selectionMode?: SelectionMode;
77
59
  /**
78
- * List of actions available on mouse over on the default list item component
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
- * Date format for the date component
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
- * Custom view for the loading state of the component
90
- */
91
- loadingStateView?: JSX.Element;
92
- /**
93
- * Custom view for the empty state of the component
70
+ * Disables sound for incoming messages.
71
+ *
72
+ * @defaultValue `false`
94
73
  */
95
- emptyStateView?: JSX.Element;
74
+ disableSoundForMessages?: boolean;
96
75
  /**
97
- * Custom view for the error state of the component
76
+ * Custom audio sound for incoming messages.
98
77
  */
99
- errorStateView?: JSX.Element;
78
+ customSoundForMessages?: string;
100
79
  /**
101
- * Hide error view
80
+ * Callback function triggered when the component encounters an error.
102
81
  *
103
- * @remarks
104
- * If set to true, hides the default and the custom error view
105
- *
106
- * @defaultValue `false`
82
+ * @param error - An instance of `CometChat.CometChatException` representing the error.
83
+ * @returns void
107
84
  */
108
- hideError?: boolean;
85
+ onError?: ((error: CometChat.CometChatException) => void) | null;
109
86
  /**
110
- * Function to call on click of the default list item view of a conversation
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
- * Function to call when a conversation from the fetched list is selected
94
+ * Callback function invoked when a conversation item is selected.
115
95
  *
116
- * @remarks
117
- * This prop is used if `selectionMode` prop is not `SelectionMode.none`
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
- * Disable typing indicator display
122
- *
123
- * @defaultValue `false`
103
+ * A custom component to render in the top-right corner of the Conversations UI.
124
104
  */
125
- disableTyping?: boolean;
105
+ headerView?: JSX.Element;
126
106
  /**
127
- * Title of the confirmation dialog.
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
- confirmDialogTitle?: string;
113
+ emptyView?: JSX.Element;
131
114
  /**
132
- * Message displayed in the confirmation dialog.
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
- confirmDialogMessage?: string;
124
+ itemView?: (conversation: CometChat.Conversation) => JSX.Element;
136
125
  /**
137
- * Text for the cancel button in the confirmation dialog.
138
- */
139
- cancelButtonText?: string;
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
- * Text for the confirm button in the confirmation dialog.
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
- confirmButtonText?: string;
138
+ titleView?: (conversation: CometChat.Conversation) => JSX.Element;
144
139
  /**
145
- * Disable mentions in conversation. Default value is set to false
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
- disableMentions?: boolean;
145
+ subtitleView?: (conversation: CometChat.Conversation) => JSX.Element;
148
146
  /**
149
- * Allows user to pass custom formatters
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
- textFormatters?: CometChatTextFormatter[];
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
- conversationToBeDeleted: CometChat.Conversation | null;
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
- * Custom view to render on the top-right of the component
7
+ * Hides the default search bar.
8
+ *
9
+ * @defaultValue `false`
8
10
  */
9
- menu?: JSX.Element;
11
+ hideSearch?: boolean;
10
12
  /**
11
- * Title of the component
13
+ * Hides the default and custom error view passed in `errorView` prop.
12
14
  *
13
- * @defaultValue `localize("MEMBERS")`
15
+ * @defaultValue `false`
14
16
  */
15
- title?: string;
17
+ hideError?: boolean;
16
18
  /**
17
- * Text to be displayed when the search input has no value
19
+ * Disables the loading state while fetching users.
18
20
  *
19
- * @defaultValue `localize("SEARCH")`
21
+ * @defaultValue `false`
20
22
  */
21
- searchPlaceholderText?: string;
23
+ disableLoadingState?: boolean;
22
24
  /**
23
- * Hide the search bar
25
+ * Hides the option to kick a member from the group.
24
26
  *
25
27
  * @defaultValue `false`
26
28
  */
27
- hideSearch?: boolean;
29
+ hideKickMemberOption?: boolean;
28
30
  /**
29
- * Request builder to fetch group members
31
+ * Hides the option to ban a member from the group.
30
32
  *
31
- * @remarks
32
- * If the search input is not empty and the `searchRequestBuilder` prop is not provided,
33
- * the search keyword of this request builder is set to the text in the search input
33
+ * @defaultValue `false`
34
+ */
35
+ hideBanMemberOption?: boolean;
36
+ /**
37
+ * Hides the option to change the scope of a group member.
34
38
  *
35
- * @defaultValue Default request builder having the limit set to 30
39
+ * @defaultValue `false`
36
40
  */
37
- groupMemberRequestBuilder?: CometChat.GroupMembersRequestBuilder;
41
+ hideScopeChangeOption?: boolean;
38
42
  /**
39
- * Request builder with search parameters to fetch group members
43
+ * Hides the user's online/offline status indicator.
40
44
  *
41
- * @remarks
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
- searchRequestBuilder?: CometChat.GroupMembersRequestBuilder;
47
+ hideUserStatus?: boolean;
46
48
  /**
47
- * Group the fetched groupMembers belong to
49
+ * The group for which members are being fetched.
48
50
  */
49
51
  group: CometChat.Group;
50
52
  /**
51
- * Function to call whenever the component encounters an error
53
+ * Request builder to fetch group members.
54
+ *
55
+ * @defaultValue Default request builder having the limit set to `30`.
52
56
  */
53
- onError?: ((error: CometChat.CometChatException) => void) | null;
57
+ groupMemberRequestBuilder?: CometChat.GroupMembersRequestBuilder;
54
58
  /**
55
- * Custom view for the loading state of the component
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
- loadingStateView?: JSX.Element;
63
+ searchRequestBuilder?: CometChat.GroupMembersRequestBuilder;
58
64
  /**
59
- * Custom view for the empty state of the component
65
+ * The keyword used to filter the group members list.
66
+ *
67
+ * @defaultValue `""`
60
68
  */
61
- emptyStateView?: JSX.Element;
69
+ searchKeyword?: string;
62
70
  /**
63
- * Custom view for the error state of the component
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
- errorStateView?: JSX.Element;
77
+ options?: (group: CometChat.Group, groupMember: CometChat.GroupMember) => CometChatOption[];
66
78
  /**
67
- * Hide error view
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 `false`
81
+ * @defaultValue `SelectionMode.none`
73
82
  */
74
- hideError?: boolean;
83
+ selectionMode?: SelectionMode;
75
84
  /**
76
- * Hide user presence
77
- *
78
- * @remarks
79
- * If set to true, the status indicator of the default list item view is not displayed
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
- * @defaultValue `false`
91
+ * @param groupMember - An instance of `CometChat.GroupMember` representing the group member.
92
+ * returns void
82
93
  */
83
- disableUsersPresence?: boolean;
94
+ onItemClick?: (groupMember: CometChat.GroupMember) => void;
84
95
  /**
85
- * Custom subtitle view to be rendered for each group member in the fetched list
96
+ * Callback function invoked when a group member is selected or deselected.
86
97
  *
87
- * @remarks
88
- * This prop is used if `listItemView` prop is not provided
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
- subtitleView?: (groupMember: CometChat.GroupMember) => JSX.Element;
102
+ onSelect?: (groupMember: CometChat.GroupMember, selected: boolean) => void;
91
103
  /**
92
- * Custom list item view to be rendered for each group member in the fetched list
104
+ * Callback function invoked when the group members list is empty.
105
+ * @returns void
93
106
  */
94
- listItemView?: (groupMember: CometChat.GroupMember) => JSX.Element;
107
+ onEmpty?: () => void;
95
108
  /**
96
- * List of actions available on mouse over on the default list item component
109
+ * A custom component to render in the top-right corner of the group members list.
97
110
  */
98
- options?: (group: CometChat.Group, groupMember: CometChat.GroupMember) => CometChatOption[];
111
+ headerView?: JSX.Element;
99
112
  /**
100
- * View to be placed in the tail view
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
- tailView?: (groupMember: CometChat.GroupMember) => JSX.Element;
115
+ loadingView?: JSX.Element;
106
116
  /**
107
- * Selection mode to use for the default list item view
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
- selectionMode?: SelectionMode;
119
+ errorView?: JSX.Element;
115
120
  /**
116
- * Function to call on click of the default list item view of a group member
121
+ * A custom view to display when no group members are available in the list.
117
122
  */
118
- onItemClick?: (groupMember: CometChat.GroupMember) => void;
123
+ emptyView?: JSX.Element;
119
124
  /**
120
- * Function to call when a group member from the fetched list is selected
125
+ * A custom view to render for each group member in the fetched list.
121
126
  *
122
- * @remarks
123
- * This prop is used if `selectionMode` prop is not `SelectionMode.none`
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
- onSelect?: (groupMember: CometChat.GroupMember, selected: boolean) => void;
130
+ itemView?: (groupMember: CometChat.GroupMember) => JSX.Element;
126
131
  /**
127
- * Search keyword to filter the list of users.
132
+ * A function that renders a JSX element to display the leading view.
128
133
  *
129
- * @defaultValue `""`
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
- searchKeyword?: string;
137
+ leadingView?: (groupMember: CometChat.GroupMember) => JSX.Element;
132
138
  /**
133
- * Callback function to be executed when the user list is empty.
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
- onEmpty?: () => void;
144
+ titleView?: (groupMember: CometChat.GroupMember) => JSX.Element;
136
145
  /**
137
- * Flag to indicate whether to disable loading state while fetching users.
138
- * @defaultValue `false`
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
- disableLoadingState?: boolean;
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
- disableUsersPresence?: boolean;
19
+ hideUserStatus?: boolean;
20
20
  };
21
21
  export declare function Hooks(args: Args): void;
22
22
  export {};