@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
|
@@ -3,112 +3,124 @@ import { SelectionMode, States } from "../../Enums/Enums";
|
|
|
3
3
|
import { CometChatOption } from "../../modals";
|
|
4
4
|
interface GroupsProps {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
menu?: JSX.Element;
|
|
9
|
-
/**
|
|
10
|
-
* Title of the component
|
|
11
|
-
*
|
|
12
|
-
* @defaultValue `localize("GROUPS")`
|
|
13
|
-
*/
|
|
14
|
-
title?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Text to be displayed when the search input has no value
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue `localize("SEARCH")`
|
|
19
|
-
*/
|
|
20
|
-
searchPlaceholderText?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Hide the search bar
|
|
6
|
+
* Hides the default search bar.
|
|
23
7
|
*
|
|
24
8
|
* @defaultValue `false`
|
|
25
9
|
*/
|
|
26
10
|
hideSearch?: boolean;
|
|
27
11
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* If the search input is not empty and the `searchRequestBuilder` prop is not provided,
|
|
32
|
-
* the search keyword of this request builder is set to the text in the search input
|
|
12
|
+
* Hides the default and custom error view passed in `errorView` prop.
|
|
33
13
|
*
|
|
34
|
-
* @defaultValue
|
|
14
|
+
* @defaultValue `false`
|
|
35
15
|
*/
|
|
36
|
-
|
|
16
|
+
hideError?: boolean;
|
|
37
17
|
/**
|
|
38
|
-
*
|
|
18
|
+
* Hides the group type icon.
|
|
39
19
|
*
|
|
40
|
-
* @
|
|
41
|
-
* If the search input is not empty,
|
|
42
|
-
* the search keyword of this request builder is set to the text in the search input
|
|
20
|
+
* @defaultValue `false`
|
|
43
21
|
*/
|
|
44
|
-
|
|
22
|
+
hideGroupType?: boolean;
|
|
45
23
|
/**
|
|
46
|
-
*
|
|
24
|
+
* The group to highlight in the list.
|
|
47
25
|
*/
|
|
48
|
-
|
|
26
|
+
activeGroup?: CometChat.Group;
|
|
49
27
|
/**
|
|
50
|
-
*
|
|
28
|
+
* A request builder for fetching groups.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue Default request builder having the limit set to `30`.
|
|
51
31
|
*/
|
|
52
|
-
|
|
32
|
+
groupsRequestBuilder?: CometChat.GroupsRequestBuilder;
|
|
53
33
|
/**
|
|
54
|
-
*
|
|
34
|
+
* A request builder configured with search parameters to fetch groups.
|
|
55
35
|
*
|
|
56
|
-
* @remarks
|
|
57
|
-
* This prop is used if `listItemView` prop is not provided
|
|
36
|
+
* @remarks If the search input is not empty, the search keyword of this request builder is set to the text in the search input.
|
|
58
37
|
*/
|
|
59
|
-
|
|
38
|
+
searchRequestBuilder?: CometChat.GroupsRequestBuilder;
|
|
60
39
|
/**
|
|
61
|
-
*
|
|
40
|
+
* A function that returns a list of actions available when hovering over a group item.
|
|
41
|
+
* @param group - An instance of `CometChat.Group` representing the group.
|
|
42
|
+
* @returns An array of `CometChatOption` objects.
|
|
62
43
|
*/
|
|
63
44
|
options?: (group: CometChat.Group) => CometChatOption[];
|
|
64
45
|
/**
|
|
65
|
-
* Selection mode to use for the default
|
|
66
|
-
*
|
|
67
|
-
* @remarks
|
|
68
|
-
* This prop is used if `listItemView` prop is not provided.
|
|
46
|
+
* Selection mode to use for the default trailing view.
|
|
69
47
|
*
|
|
70
48
|
* @defaultValue `SelectionMode.none`
|
|
71
49
|
*/
|
|
72
50
|
selectionMode?: SelectionMode;
|
|
73
51
|
/**
|
|
74
|
-
*
|
|
52
|
+
* Callback function invoked when an error occurs in the component.
|
|
53
|
+
* @param error - An instance of `CometChat.CometChatException` representing the error that occurred.
|
|
54
|
+
* @returns void
|
|
55
|
+
*/
|
|
56
|
+
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
57
|
+
/**
|
|
58
|
+
* Callback function invoked when a group is selected.
|
|
75
59
|
*
|
|
76
|
-
* @remarks
|
|
77
|
-
*
|
|
60
|
+
* @remarks This prop works only if `selectionMode` is not set to `SelectionMode.none`.
|
|
61
|
+
* @param group - An instance of `CometChat.Group` representing the selected group.
|
|
62
|
+
* @param selected - A boolean indicating whether the group is selected.
|
|
63
|
+
* @returns void
|
|
78
64
|
*/
|
|
79
65
|
onSelect?: (group: CometChat.Group, selected: boolean) => void;
|
|
80
66
|
/**
|
|
81
|
-
*
|
|
67
|
+
* Callback function invoked when a group item is clicked.
|
|
68
|
+
*
|
|
69
|
+
* @param group - An instance of `CometChat.Group` representing the clicked group.
|
|
70
|
+
* @returns void
|
|
82
71
|
*/
|
|
83
72
|
onItemClick?: (group: CometChat.Group) => void;
|
|
84
73
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* @remarks
|
|
88
|
-
* This prop is used if `listItemView` prop is not provided
|
|
74
|
+
* A custom component to render in the top-right corner of the groups list.
|
|
89
75
|
*/
|
|
90
|
-
|
|
76
|
+
headerView?: JSX.Element;
|
|
91
77
|
/**
|
|
92
|
-
*
|
|
78
|
+
* A custom view to display during the loading state.
|
|
93
79
|
*/
|
|
94
|
-
|
|
80
|
+
loadingView?: JSX.Element;
|
|
95
81
|
/**
|
|
96
|
-
* Custom view for the empty state of the component
|
|
82
|
+
* Custom view for the empty state of the component.
|
|
97
83
|
*/
|
|
98
|
-
|
|
84
|
+
emptyView?: JSX.Element;
|
|
99
85
|
/**
|
|
100
|
-
*
|
|
86
|
+
* A custom view to display when an error occurs.
|
|
101
87
|
*/
|
|
102
|
-
|
|
88
|
+
errorView?: JSX.Element;
|
|
103
89
|
/**
|
|
104
|
-
*
|
|
90
|
+
* A custom view to render for each group in the fetched list.
|
|
105
91
|
*
|
|
106
|
-
* @
|
|
107
|
-
*
|
|
92
|
+
* @param group - An instance of `CometChat.Group` representing the group.
|
|
93
|
+
* @returns A JSX element to be rendered as the group item.
|
|
94
|
+
*/
|
|
95
|
+
itemView?: (group: CometChat.Group) => JSX.Element;
|
|
96
|
+
/**
|
|
97
|
+
* A function that renders a JSX element to display the leading view.
|
|
108
98
|
*
|
|
109
|
-
* @
|
|
99
|
+
* @param group - An instance of `CometChat.Group` representing the group.
|
|
100
|
+
* @returns A JSX element to be rendered as the leading view.
|
|
110
101
|
*/
|
|
111
|
-
|
|
102
|
+
leadingView?: (group: CometChat.Group) => JSX.Element;
|
|
103
|
+
/**
|
|
104
|
+
* A function that renders a JSX element to display the title view.
|
|
105
|
+
*
|
|
106
|
+
* @param group - An instance of `CometChat.Group` representing the group.
|
|
107
|
+
* @returns A JSX element to be rendered as the title view.
|
|
108
|
+
*/
|
|
109
|
+
titleView?: (group: CometChat.Group) => JSX.Element;
|
|
110
|
+
/**
|
|
111
|
+
* Custom subtitle view to be rendered for each group in the fetched list.
|
|
112
|
+
*
|
|
113
|
+
* @param group - An instance of `CometChat.Group` representing the group.
|
|
114
|
+
* @returns A JSX element to be rendered as the subtitle view.
|
|
115
|
+
*/
|
|
116
|
+
subtitleView?: (group: CometChat.Group) => JSX.Element;
|
|
117
|
+
/**
|
|
118
|
+
* A function that renders a JSX element to display the trailing view.
|
|
119
|
+
*
|
|
120
|
+
* @param group - An instance of `CometChat.Group` representing the group.
|
|
121
|
+
* @returns A JSX element to be rendered as the trailing view.
|
|
122
|
+
*/
|
|
123
|
+
trailingView?: (group: CometChat.Group) => JSX.Element;
|
|
112
124
|
}
|
|
113
125
|
export type Action = {
|
|
114
126
|
type: "appendGroups";
|
|
@@ -10,6 +10,7 @@ type Args = {
|
|
|
10
10
|
dispatch: React.Dispatch<Action>;
|
|
11
11
|
fetchNextAndAppendGroups: (fetchId: string) => Promise<void>;
|
|
12
12
|
groupsSearchText: React.MutableRefObject<string>;
|
|
13
|
+
errorHandler: (error: unknown, source?: string | undefined) => void;
|
|
13
14
|
};
|
|
14
15
|
export declare function useCometChatGroups(args: Args): void;
|
|
15
16
|
export {};
|
|
@@ -1,96 +1,154 @@
|
|
|
1
1
|
import { JSX } from "react";
|
|
2
2
|
import { CometChatTextFormatter } from "../../formatters/CometChatFormatters/CometChatTextFormatter";
|
|
3
3
|
import { CometChatMessageComposerAction } from "../../modals";
|
|
4
|
-
import { PreviewMessageMode } from "../../Enums/Enums";
|
|
4
|
+
import { EnterKeyBehavior, PreviewMessageMode } from "../../Enums/Enums";
|
|
5
5
|
export type ContentToDisplay = "attachments" | "emojiKeyboard" | "voiceRecording" | "ai" | "none";
|
|
6
6
|
export type ActionOnClickType = (() => void) | null;
|
|
7
7
|
interface MessageComposerProps {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* The initial text pre-filled in the message input when the component mounts.
|
|
10
|
+
* @defaultValue ""
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
initialComposerText?: string;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* This prop is used if `user` prop is not provided
|
|
14
|
+
* Disables the typing indicator for the current message composer.
|
|
15
|
+
* @defaultValue `false`
|
|
17
16
|
*/
|
|
18
|
-
|
|
17
|
+
disableTypingEvents?: boolean;
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @remarks
|
|
23
|
-
* This prop is used only when this component mounts
|
|
24
|
-
*
|
|
25
|
-
* @defaultValue `""`
|
|
19
|
+
* Disables the mentions functionality in the message composer.
|
|
20
|
+
* @defaultValue `false`
|
|
26
21
|
*/
|
|
27
|
-
|
|
22
|
+
disableMentions?: boolean;
|
|
28
23
|
/**
|
|
29
|
-
*
|
|
24
|
+
* Hides the image attachment option in the message composer.
|
|
25
|
+
* @defaultValue `false`
|
|
30
26
|
*/
|
|
31
|
-
|
|
27
|
+
hideImageAttachmentOption?: boolean;
|
|
32
28
|
/**
|
|
33
|
-
*
|
|
29
|
+
* Hides the video attachment option in the message composer.
|
|
30
|
+
* @defaultValue `false`
|
|
34
31
|
*/
|
|
35
|
-
|
|
32
|
+
hideVideoAttachmentOption?: boolean;
|
|
36
33
|
/**
|
|
37
|
-
*
|
|
34
|
+
* Hides the audio attachment option in the message composer.
|
|
35
|
+
* @defaultValue `false`
|
|
38
36
|
*/
|
|
39
|
-
|
|
37
|
+
hideAudioAttachmentOption?: boolean;
|
|
40
38
|
/**
|
|
41
|
-
*
|
|
39
|
+
* Hides the file attachment option in the message composer.
|
|
40
|
+
* @defaultValue `false`
|
|
42
41
|
*/
|
|
43
|
-
|
|
42
|
+
hideFileAttachmentOption?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Hides the polls option in the message composer.
|
|
45
|
+
* @defaultValue `false`
|
|
46
|
+
*/
|
|
47
|
+
hidePollsOption?: boolean;
|
|
44
48
|
/**
|
|
45
|
-
*
|
|
49
|
+
* Hides the collaborative document option in the message composer.
|
|
50
|
+
* @defaultValue `false`
|
|
46
51
|
*/
|
|
47
|
-
|
|
52
|
+
hideCollaborativeDocumentOption?: boolean;
|
|
48
53
|
/**
|
|
49
|
-
*
|
|
54
|
+
* Hides the collaborative whiteboard option in the message composer.
|
|
55
|
+
* @defaultValue `false`
|
|
50
56
|
*/
|
|
51
|
-
|
|
57
|
+
hideCollaborativeWhiteboardOption?: boolean;
|
|
52
58
|
/**
|
|
53
|
-
*
|
|
59
|
+
* Hides the attachment button in the message composer.
|
|
60
|
+
* @defaultValue `false`
|
|
54
61
|
*/
|
|
55
|
-
|
|
62
|
+
hideAttachmentButton?: boolean;
|
|
56
63
|
/**
|
|
57
|
-
*
|
|
64
|
+
* Hides the voice recording button in the message composer.
|
|
65
|
+
* @defaultValue `false`
|
|
66
|
+
*/
|
|
67
|
+
hideVoiceRecordingButton?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Hides the emoji keyboard button in the message composer.
|
|
70
|
+
* @defaultValue `false`
|
|
71
|
+
*/
|
|
72
|
+
hideEmojiKeyboardButton?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Hides the stickers button in the message composer.
|
|
75
|
+
* @defaultValue `false`
|
|
76
|
+
*/
|
|
77
|
+
hideStickersButton?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Hides the send button in the message composer.
|
|
80
|
+
* @defaultValue `false`
|
|
81
|
+
*/
|
|
82
|
+
hideSendButton?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The user to send messages to. This prop specifies the recipient of the message.
|
|
85
|
+
*/
|
|
86
|
+
user?: CometChat.User;
|
|
87
|
+
/**
|
|
88
|
+
* The group to send messages to.
|
|
89
|
+
* @remarks This prop is used if the `user` prop is not provided.
|
|
90
|
+
*/
|
|
91
|
+
group?: CometChat.Group;
|
|
92
|
+
/**
|
|
93
|
+
* The ID of the parent message. This is used for threading or replying to a specific message.
|
|
58
94
|
*/
|
|
59
95
|
parentMessageId?: number;
|
|
60
96
|
/**
|
|
61
|
-
*
|
|
97
|
+
* Options for default attachments, including various attachment types available in the composer.
|
|
62
98
|
*/
|
|
63
|
-
|
|
99
|
+
attachmentOptions?: CometChatMessageComposerAction[];
|
|
64
100
|
/**
|
|
65
|
-
*
|
|
101
|
+
* Array of text formatters to apply to the message text for customization and styling.
|
|
66
102
|
*/
|
|
67
|
-
|
|
103
|
+
textFormatters?: Array<CometChatTextFormatter>;
|
|
104
|
+
/**
|
|
105
|
+
* Determines the behavior of the Enter key in the composer (e.g., send message or add a new line).
|
|
106
|
+
* @default EnterKeyBehavior.SendMessage
|
|
107
|
+
*/
|
|
108
|
+
enterKeyBehavior?: EnterKeyBehavior;
|
|
68
109
|
/**
|
|
69
|
-
*
|
|
110
|
+
* Disables sound for incoming messages.
|
|
70
111
|
*
|
|
71
112
|
* @defaultValue `false`
|
|
72
113
|
*/
|
|
73
|
-
|
|
114
|
+
disableSoundForMessage?: boolean;
|
|
74
115
|
/**
|
|
75
|
-
*
|
|
116
|
+
* Custom audio sound for incoming messages.
|
|
76
117
|
*/
|
|
77
|
-
|
|
118
|
+
customSoundForMessage?: string;
|
|
78
119
|
/**
|
|
79
|
-
*
|
|
120
|
+
* Callback function triggered when the message input text changes.
|
|
121
|
+
*
|
|
122
|
+
* @param text - The current text value of the message input.
|
|
123
|
+
* @returns void
|
|
80
124
|
*/
|
|
81
|
-
|
|
125
|
+
onTextChange?: (text: string) => void;
|
|
82
126
|
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
127
|
+
* Callback function triggered when the message composer encounters an error.
|
|
128
|
+
*
|
|
129
|
+
* @param error - An instance of `CometChat.CometChatException` representing the error.
|
|
130
|
+
* @returns void
|
|
131
|
+
*/
|
|
132
|
+
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
86
133
|
/**
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
134
|
+
* Callback function triggered when the send button is clicked.
|
|
135
|
+
*
|
|
136
|
+
* @param message - The message that was sent.
|
|
137
|
+
* @param previewMessageMode - Optionally, specify if the message is in preview mode.
|
|
138
|
+
*/
|
|
139
|
+
onSendButtonClick?: (message: CometChat.BaseMessage, previewMessageMode?: PreviewMessageMode) => void;
|
|
90
140
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
141
|
+
* A custom view for the send button to customize its appearance or behavior.
|
|
142
|
+
*/
|
|
143
|
+
sendButtonView?: JSX.Element;
|
|
144
|
+
/**
|
|
145
|
+
* A custom view for an auxiliary button, which can be used alongside the send button.
|
|
146
|
+
*/
|
|
147
|
+
auxiliaryButtonView?: JSX.Element;
|
|
148
|
+
/**
|
|
149
|
+
* A custom header section displayed at the top of the message composer, often used for media previews or additional information.
|
|
150
|
+
*/
|
|
151
|
+
headerView?: JSX.Element;
|
|
94
152
|
}
|
|
95
153
|
/**
|
|
96
154
|
* Represents the state of the message composer.
|
|
@@ -7,7 +7,7 @@ import { UserMemberListType } from "../../Enums/Enums";
|
|
|
7
7
|
type Args = {
|
|
8
8
|
dispatch: React.Dispatch<Action>;
|
|
9
9
|
mySetAddToMsgInputText: (text: string) => void;
|
|
10
|
-
errorHandler: (error: unknown) => void;
|
|
10
|
+
errorHandler: (error: unknown, source?: string) => void;
|
|
11
11
|
pasteHtmlAtCaret: (text: string) => void;
|
|
12
12
|
textFormatters: Array<CometChatTextFormatter>;
|
|
13
13
|
disableMentions: boolean;
|
|
@@ -3,26 +3,87 @@ import { JSX } from "react";
|
|
|
3
3
|
* Interface for the props accepted by the CometChatMessageHeader component.
|
|
4
4
|
*/
|
|
5
5
|
interface MessageHeaderProps {
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Shows the conversation summary button.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
showConversationSummaryButton?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Hides the back button in the header in mobile view.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
hideBackButton?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Hides the video call button.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
hideVideoCallButton?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Hides the voice call button.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
hideVoiceCallButton?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Hides the user's online/offline status indicator.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
hideUserStatus?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A `CometChat.User` object representing the user whose information (e.g., status) is displayed.
|
|
33
|
+
*/
|
|
15
34
|
user?: CometChat.User;
|
|
16
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* A `CometChat.Group` object representing the group whose details (e.g., member count) are displayed.
|
|
37
|
+
*/
|
|
17
38
|
group?: CometChat.Group;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Number of messages for which the summary should be shown.
|
|
41
|
+
* @default 1000
|
|
42
|
+
*/
|
|
43
|
+
summaryGenerationMessageCount?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Enables the auto generation of conversation summary.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
enableAutoSummaryGeneration?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Callback function to handle errors related to CometChat operations.
|
|
51
|
+
*
|
|
52
|
+
* @param error - An instance of `CometChat.CometChatException` representing the error.
|
|
53
|
+
* @returns void
|
|
54
|
+
*/
|
|
21
55
|
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
22
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Callback function triggered when the back action is performed.
|
|
58
|
+
*
|
|
59
|
+
* @returns void
|
|
60
|
+
*/
|
|
23
61
|
onBack?: () => void;
|
|
24
|
-
/**
|
|
25
|
-
|
|
62
|
+
/**
|
|
63
|
+
* A custom JSX element for rendering a menu. It can be used to add options or actions.
|
|
64
|
+
*/
|
|
65
|
+
auxiliaryButtonView?: JSX.Element;
|
|
66
|
+
/**
|
|
67
|
+
* A custom JSX element for rendering a list item view, typically used to show user or group details.
|
|
68
|
+
*/
|
|
69
|
+
itemView?: JSX.Element;
|
|
70
|
+
/**
|
|
71
|
+
* A function that renders a JSX element to display the leading view.
|
|
72
|
+
*/
|
|
73
|
+
leadingView?: JSX.Element;
|
|
74
|
+
/**
|
|
75
|
+
* A function that renders a JSX element to display the title view.
|
|
76
|
+
*/
|
|
77
|
+
titleView?: JSX.Element;
|
|
78
|
+
/**
|
|
79
|
+
* Custom subtitle view, allowing you to render a JSX element as the subtitle.
|
|
80
|
+
* It can be used to provide additional information under the title.
|
|
81
|
+
*/
|
|
82
|
+
subtitleView?: JSX.Element;
|
|
83
|
+
/**
|
|
84
|
+
* A function that renders a JSX element to display the trailing view.
|
|
85
|
+
*/
|
|
86
|
+
trailingView?: JSX.Element;
|
|
26
87
|
}
|
|
27
88
|
/** Functional component for rendering the CometChatMessageHeader */
|
|
28
89
|
export declare const CometChatMessageHeader: (props: MessageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare function useCometChatMessageHeader(loggedInUser: CometChat.User | null, setLoggedInUser: Function, attachListeners: Function, userRef: React.MutableRefObject<CometChat.User | undefined>, groupRef: React.MutableRefObject<CometChat.Group | undefined>, updateSubtitle: Function, subscribeToEvents: Function, user?: CometChat.User, group?: CometChat.Group): void;
|
|
2
|
+
declare function useCometChatMessageHeader(loggedInUser: CometChat.User | null, setLoggedInUser: Function, attachListeners: Function, userRef: React.MutableRefObject<CometChat.User | undefined>, groupRef: React.MutableRefObject<CometChat.Group | undefined>, updateSubtitle: Function, subscribeToEvents: Function, onErrorCallback: (error: unknown, source?: string | undefined) => void, user?: CometChat.User, group?: CometChat.Group, enableAutoSummaryGeneration?: boolean, loadConversationSummary?: Function): void;
|
|
3
3
|
export { useCometChatMessageHeader };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
interface MessageInformationProps {
|
|
2
2
|
message: CometChat.BaseMessage;
|
|
3
3
|
onClose?: () => void;
|
|
4
|
+
/**
|
|
5
|
+
* Callback triggered when an error occurs during the message receipt fetching process.
|
|
6
|
+
* @param error - CometChatException object representing the error.
|
|
7
|
+
*/
|
|
8
|
+
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
4
9
|
}
|
|
5
10
|
declare const CometChatMessageInformation: (props: MessageInformationProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
11
|
export { CometChatMessageInformation };
|