@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
@@ -3,112 +3,124 @@ import { SelectionMode, States } from "../../Enums/Enums";
3
3
  import { CometChatOption } from "../../modals";
4
4
  interface GroupsProps {
5
5
  /**
6
- * Custom view to render on the top-right of the component
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
- * Request builder to fetch groups
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 Default request builder having the limit set to 30
14
+ * @defaultValue `false`
35
15
  */
36
- groupsRequestBuilder?: CometChat.GroupsRequestBuilder;
16
+ hideError?: boolean;
37
17
  /**
38
- * Request builder with search parameters to fetch groups
18
+ * Hides the group type icon.
39
19
  *
40
- * @remarks
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
- searchRequestBuilder?: CometChat.GroupsRequestBuilder;
22
+ hideGroupType?: boolean;
45
23
  /**
46
- * Function to call whenever the component encounters an error
24
+ * The group to highlight in the list.
47
25
  */
48
- onError?: ((error: CometChat.CometChatException) => void) | null;
26
+ activeGroup?: CometChat.Group;
49
27
  /**
50
- * Custom list item view to be rendered for each group in the fetched list
28
+ * A request builder for fetching groups.
29
+ *
30
+ * @defaultValue Default request builder having the limit set to `30`.
51
31
  */
52
- listItemView?: (group: CometChat.Group) => JSX.Element;
32
+ groupsRequestBuilder?: CometChat.GroupsRequestBuilder;
53
33
  /**
54
- * Custom subtitle view to be rendered for each group in the fetched list
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
- subtitleView?: (group: CometChat.Group) => JSX.Element;
38
+ searchRequestBuilder?: CometChat.GroupsRequestBuilder;
60
39
  /**
61
- * List of actions available on mouse over on the default list item component
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 tail view
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
- * Function to call when a group from the fetched list is selected
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
- * This prop is used if `selectionMode` prop is not `SelectionMode.none`
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
- * Function to call on click of the default list item view of a group
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
- * Group to highlight
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
- activeGroup?: CometChat.Group;
76
+ headerView?: JSX.Element;
91
77
  /**
92
- * Custom view for the loading state of the component
78
+ * A custom view to display during the loading state.
93
79
  */
94
- loadingStateView?: JSX.Element;
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
- emptyStateView?: JSX.Element;
84
+ emptyView?: JSX.Element;
99
85
  /**
100
- * Custom view for the error state of the component
86
+ * A custom view to display when an error occurs.
101
87
  */
102
- errorStateView?: JSX.Element;
88
+ errorView?: JSX.Element;
103
89
  /**
104
- * Hide error view
90
+ * A custom view to render for each group in the fetched list.
105
91
  *
106
- * @remarks
107
- * If set to true, hides the default and the custom error view
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
- * @defaultValue `false`
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
- hideError?: boolean;
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
- * User to send messages to
9
+ * The initial text pre-filled in the message input when the component mounts.
10
+ * @defaultValue ""
10
11
  */
11
- user?: CometChat.User;
12
+ initialComposerText?: string;
12
13
  /**
13
- * Group to send messages to
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
- group?: CometChat.Group;
17
+ disableTypingEvents?: boolean;
19
18
  /**
20
- * Text to fill the message input with
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
- text?: string;
22
+ disableMentions?: boolean;
28
23
  /**
29
- * Function to call when the message input's text value changes
24
+ * Hides the image attachment option in the message composer.
25
+ * @defaultValue `false`
30
26
  */
31
- onTextChange?: (text: string) => void;
27
+ hideImageAttachmentOption?: boolean;
32
28
  /**
33
- * Text shown in the message input when it is empty
29
+ * Hides the video attachment option in the message composer.
30
+ * @defaultValue `false`
34
31
  */
35
- placeHolderText?: string;
32
+ hideVideoAttachmentOption?: boolean;
36
33
  /**
37
- * Custom send button view
34
+ * Hides the audio attachment option in the message composer.
35
+ * @defaultValue `false`
38
36
  */
39
- sendButtonView?: JSX.Element;
37
+ hideAudioAttachmentOption?: boolean;
40
38
  /**
41
- * Function to call whenever a new text message is sent
39
+ * Hides the file attachment option in the message composer.
40
+ * @defaultValue `false`
42
41
  */
43
- onSendButtonClick?: (message: CometChat.BaseMessage, previewMessageMode?: PreviewMessageMode) => void;
42
+ hideFileAttachmentOption?: boolean;
43
+ /**
44
+ * Hides the polls option in the message composer.
45
+ * @defaultValue `false`
46
+ */
47
+ hidePollsOption?: boolean;
44
48
  /**
45
- * Custom secondary button view
49
+ * Hides the collaborative document option in the message composer.
50
+ * @defaultValue `false`
46
51
  */
47
- secondaryButtonView?: JSX.Element;
52
+ hideCollaborativeDocumentOption?: boolean;
48
53
  /**
49
- * Custom auxiliary button view
54
+ * Hides the collaborative whiteboard option in the message composer.
55
+ * @defaultValue `false`
50
56
  */
51
- auxiliaryButtonView?: JSX.Element;
57
+ hideCollaborativeWhiteboardOption?: boolean;
52
58
  /**
53
- * Options for the default secondary view
59
+ * Hides the attachment button in the message composer.
60
+ * @defaultValue `false`
54
61
  */
55
- attachmentOptions?: CometChatMessageComposerAction[];
62
+ hideAttachmentButton?: boolean;
56
63
  /**
57
- * Id of the parent message
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
- * Preview section at the top of the message input
97
+ * Options for default attachments, including various attachment types available in the composer.
62
98
  */
63
- headerView?: JSX.Element;
99
+ attachmentOptions?: CometChatMessageComposerAction[];
64
100
  /**
65
- * Function to call whenever the component encounters an error
101
+ * Array of text formatters to apply to the message text for customization and styling.
66
102
  */
67
- onError?: ((error: CometChat.CometChatException) => void) | null;
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
- * Disable sending typing events
110
+ * Disables sound for incoming messages.
70
111
  *
71
112
  * @defaultValue `false`
72
113
  */
73
- disableTypingEvents?: boolean;
114
+ disableSoundForMessage?: boolean;
74
115
  /**
75
- * Hide voice recording button
116
+ * Custom audio sound for incoming messages.
76
117
  */
77
- hideVoiceRecording?: boolean;
118
+ customSoundForMessage?: string;
78
119
  /**
79
- * Hide emoji keyboard button
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
- hideEmojiKeyboard?: boolean;
125
+ onTextChange?: (text: string) => void;
82
126
  /**
83
- * fotmatters for composer text
84
- */
85
- textFormatters?: Array<CometChatTextFormatter>;
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
- * boolean to hide mentions UI
88
- */
89
- disableMentions?: boolean;
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
- * text to show when mentions limit exceeds
92
- */
93
- mentionsWarningText?: string;
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
- /** Custom subtitle view, allowing you to render a JSX element as the subtitle */
7
- subtitleView?: JSX.Element;
8
- /** Disables showing the user's online/offline presence if set to true */
9
- disableUsersPresence?: boolean;
10
- /** Disables showing the typing indicator if set to true */
11
- disableTyping?: boolean;
12
- /** Custom JSX element for the menu, which can be used for additional options or actions */
13
- menu?: JSX.Element;
14
- /** The user object from CometChat, used to show user-specific information (e.g., status) */
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
- /** The group object from CometChat, used to show group-specific information (e.g., member count) */
35
+ /**
36
+ * A `CometChat.Group` object representing the group whose details (e.g., member count) are displayed.
37
+ */
17
38
  group?: CometChat.Group;
18
- /** Custom JSX element for rendering a list item view, often used to display user/group details */
19
- listItemView?: JSX.Element;
20
- /** Callback function to handle any errors related to CometChat operations */
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
- /** Callback function triggered when the back action is performed (e.g., navigating to the previous view) */
56
+ /**
57
+ * Callback function triggered when the back action is performed.
58
+ *
59
+ * @returns void
60
+ */
23
61
  onBack?: () => void;
24
- /** Controls the visibility of the back button. */
25
- hideBackButton?: boolean;
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 };