@cometchat/chat-uikit-react 6.1.2 → 6.2.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/dist/assets/Profile.png +0 -0
- package/dist/assets/chat-history.svg +3 -0
- package/dist/assets/copy-text.svg +3 -0
- package/dist/assets/new-chat.svg +3 -0
- package/dist/assets/right-arrow.svg +3 -0
- package/dist/assets/send-message.svg +3 -0
- package/dist/assets/stop-message.svg +3 -0
- package/dist/assets/warning-small.svg +0 -0
- package/dist/index.d.ts +258 -34
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/CometChatAIAssistantChat.css +456 -0
- package/dist/styles/CometChatAIAssistantChatHistory.css +175 -0
- package/dist/styles/CometChatAIAssistantMessageBubble.css +86 -0
- package/dist/styles/CometChatConversations.css +3 -0
- package/dist/styles/CometChatErrorView.css +22 -0
- package/dist/styles/CometChatMessageComposer.css +9 -9
- package/dist/styles/CometChatMessageHeader.css +2 -4
- package/dist/styles/CometChatMessageList.css +4 -4
- package/dist/styles/CometChatStreamMessageBubble.css +154 -0
- package/dist/styles/CometChatToolCallArgumentBubble.css +100 -0
- package/dist/styles/CometChatToolCallResultBubble.css +91 -0
- package/dist/styles/components/CometChatAIAssistantChat.css +456 -0
- package/dist/styles/components/CometChatAIAssistantChatHistory.css +175 -0
- package/dist/styles/components/CometChatAIAssistantMessageBubble.css +86 -0
- package/dist/styles/components/CometChatConversations.css +3 -0
- package/dist/styles/components/CometChatErrorView.css +22 -0
- package/dist/styles/components/CometChatMessageComposer.css +9 -9
- package/dist/styles/components/CometChatMessageHeader.css +2 -4
- package/dist/styles/components/CometChatMessageList.css +4 -4
- package/dist/styles/components/CometChatStreamMessageBubble.css +154 -0
- package/dist/styles/components/CometChatToolCallArgumentBubble.css +100 -0
- package/dist/styles/components/CometChatToolCallResultBubble.css +91 -0
- package/dist/styles/components/index.css +8 -2
- package/dist/styles/css-variables.css +5 -0
- package/dist/styles/index.css +8 -2
- package/dist/types/components/BaseComponents/CometChatAIAssistantMessageBubble/CometChatAIAssistantMessageBubble.d.ts +6 -0
- package/dist/types/components/BaseComponents/CometChatErrorView/CometChatErrorView.d.ts +9 -0
- package/dist/types/components/BaseComponents/CometChatList/CometChatList.d.ts +7 -0
- package/dist/types/components/BaseComponents/CometChatSendButtonView/CometChatSendButtonView.d.ts +4 -0
- package/dist/types/components/BaseComponents/CometChatStreamMessageBubble/CometChatStreamMessageBubble.d.ts +6 -0
- package/dist/types/components/BaseComponents/CometChatToolCallArgumentBubble/CometChatToolCallArgumentBubble.d.ts +6 -0
- package/dist/types/components/BaseComponents/CometChatToolCallResultBubble/CometChatToolCallResultBubble.d.ts +6 -0
- package/dist/types/components/CometChatAIAssistantChat/CometChatAIAssistantChat.d.ts +30 -0
- package/dist/types/components/CometChatAIAssistantChatHistory/CometChatAIAssistantChatHistory.d.ts +24 -0
- package/dist/types/components/CometChatMessageComposer/CometChatMessageComposer.d.ts +5 -0
- package/dist/types/components/CometChatMessageComposer/useCometChatMessageComposer.d.ts +1 -0
- package/dist/types/components/CometChatMessageList/CometChatMessageList.d.ts +5 -0
- package/dist/types/components/CometChatMessageList/CometChatMessageListController.d.ts +3 -2
- package/dist/types/components/CometChatMessageList/useCometChatMessageList.d.ts +1 -1
- package/dist/types/constants/CometChatUIKitConstants.d.ts +15 -0
- package/dist/types/events/CometChatMessageEvents.d.ts +3 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/modals/CometChatAIAssistantTools.d.ts +47 -0
- package/dist/types/modals/CometChatMessageTemplate.d.ts +1 -1
- package/dist/types/services/stream-message.service.d.ts +44 -0
- package/dist/types/utils/DataSource.d.ts +9 -1
- package/dist/types/utils/DataSourceDecorator.d.ts +9 -1
- package/dist/types/utils/MessagesDataSource.d.ts +15 -6
- package/dist/types/utils/util.d.ts +2 -0
- package/package.json +6 -3
package/dist/types/components/CometChatAIAssistantChatHistory/CometChatAIAssistantChatHistory.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface CometChatAIAssistantChatHistoryProps {
|
|
2
|
+
/**
|
|
3
|
+
* A `CometChat.User` object representing the participant of the chat whose message history is displayed.
|
|
4
|
+
*/
|
|
5
|
+
user?: CometChat.User;
|
|
6
|
+
/**
|
|
7
|
+
* A `CometChat.Group` object representing the group whose message history is displayed.
|
|
8
|
+
*/
|
|
9
|
+
group?: CometChat.Group;
|
|
10
|
+
/**
|
|
11
|
+
* Callback function triggered when an error occurs during message fetching.
|
|
12
|
+
*/
|
|
13
|
+
onError?: ((error: CometChat.CometChatException) => void) | null;
|
|
14
|
+
/**
|
|
15
|
+
* Callback function triggered when clicked on closeIcon button
|
|
16
|
+
*/
|
|
17
|
+
onClose?: (() => void) | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Callback function triggered when clicked on a message
|
|
20
|
+
*/
|
|
21
|
+
onMessageClicked?: ((message: CometChat.BaseMessage) => void) | undefined;
|
|
22
|
+
}
|
|
23
|
+
declare const CometChatAIAssistantChatHistory: (props: CometChatAIAssistantChatHistoryProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export { CometChatAIAssistantChatHistory };
|
|
@@ -154,6 +154,11 @@ interface MessageComposerProps {
|
|
|
154
154
|
* @defaultValue `false`
|
|
155
155
|
*/
|
|
156
156
|
showScrollbar?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* The placeholder text to display in the message input field when it is empty.
|
|
159
|
+
* @defaultValue ""
|
|
160
|
+
*/
|
|
161
|
+
placeholderText?: string;
|
|
157
162
|
}
|
|
158
163
|
/**
|
|
159
164
|
* Represents the state of the message composer.
|
|
@@ -40,6 +40,7 @@ type Args = {
|
|
|
40
40
|
textMessageToEdit: CometChat.TextMessage | null;
|
|
41
41
|
getCurrentWindow: () => Window;
|
|
42
42
|
getCurrentDocument: () => Document;
|
|
43
|
+
onTextChange: ((text: string) => void) | undefined;
|
|
43
44
|
};
|
|
44
45
|
export declare function useCometChatMessageComposer(args: Args): void;
|
|
45
46
|
export {};
|
|
@@ -225,6 +225,11 @@ interface MessageListProps {
|
|
|
225
225
|
* @defaultValue `false`
|
|
226
226
|
*/
|
|
227
227
|
showScrollbar?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Toggles AI Agent functionality.
|
|
230
|
+
* @defaultValue `false`
|
|
231
|
+
*/
|
|
232
|
+
isAgentChat?: boolean;
|
|
228
233
|
}
|
|
229
234
|
declare const CometChatMessageList: (props: MessageListProps) => import("react/jsx-runtime").JSX.Element;
|
|
230
235
|
export { CometChatMessageList };
|
|
@@ -7,6 +7,7 @@ export declare class MessageListManager {
|
|
|
7
7
|
static groupListenerId: string;
|
|
8
8
|
static callListenerId: string;
|
|
9
9
|
static connectionListenerId: string;
|
|
10
|
+
static streamListenerId: string;
|
|
10
11
|
private static errorHandler;
|
|
11
12
|
/**
|
|
12
13
|
* Creates an instance of MessageListManager which constructs a request builder for fetching messages from a particular user/group in the chat.
|
|
@@ -18,7 +19,7 @@ export declare class MessageListManager {
|
|
|
18
19
|
* @param {boolean} [hideGroupActionMessages]
|
|
19
20
|
* @memberof MessageListManager
|
|
20
21
|
*/
|
|
21
|
-
constructor(errorHandler: (error: unknown, source?: string) => void, messagesRequestBuilder?: CometChat.MessagesRequestBuilder, user?: CometChat.User, group?: CometChat.Group, messageId?: number, parentMessageId?: number, hideGroupActionMessages?: boolean);
|
|
22
|
+
constructor(errorHandler: (error: unknown, source?: string) => void, messagesRequestBuilder?: CometChat.MessagesRequestBuilder, user?: CometChat.User, group?: CometChat.Group, messageId?: number, parentMessageId?: number, hideGroupActionMessages?: boolean, isAgentChat?: boolean);
|
|
22
23
|
/**
|
|
23
24
|
* Function to invoke the fetchNext method of the messagesRequestBuilder to retrieve the subsequent messages following the latest fetched message.
|
|
24
25
|
*
|
|
@@ -36,7 +37,7 @@ export declare class MessageListManager {
|
|
|
36
37
|
*
|
|
37
38
|
* @param {Function} callback
|
|
38
39
|
*/
|
|
39
|
-
static attachListeners: (callback: (key: string, mesage: CometChat.BaseMessage, group?: CometChat.Group) => void) => void;
|
|
40
|
+
static attachListeners: (addStreamListener: boolean, callback: (key: string, mesage: CometChat.BaseMessage, group?: CometChat.Group) => void, addMessage: (message: CometChat.BaseMessage) => void, user?: CometChat.User) => void;
|
|
40
41
|
/**
|
|
41
42
|
* Function to remove the attached listeners for a particular user/group.
|
|
42
43
|
* */
|
|
@@ -2,5 +2,5 @@ import { MutableRefObject } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* This Hooks function is a custom React hook designed to manage functionalities of CometChatMessageList component. It fetches the logged-in user, handles event subscriptions and tracks message IDs for new message retrieval. It plays a key role in maintaining real-time functionality and user interactions in the chat interface.
|
|
4
4
|
**/
|
|
5
|
-
declare function useCometChatMessageList(loggedInUserRef: MutableRefObject<CometChat.User | null>, messageListManagerRef: MutableRefObject<any>, fetchPreviousMessages: () => void, updateMessage: (key: string, mesage: CometChat.BaseMessage, group?: CometChat.Group) => void, messagesRequestBuilder: CometChat.MessagesRequestBuilder | undefined, user: CometChat.User | undefined, group: CometChat.Group | undefined, messageIdRef: MutableRefObject<any>, totalMessagesCountRef: MutableRefObject<any>, messageList: CometChat.BaseMessage[], errorHandler: (error: unknown, source?: string) => void, setMessageList: (messages: CometChat.BaseMessage[]) => void, setScrollListToBottom: (scrollToBottom: boolean) => void, smartReplyViewRef: MutableRefObject<any>, isOnBottomRef: MutableRefObject<boolean>, isFirstReloadRef: MutableRefObject<boolean>, subscribeToUIEvents: Function, showSmartRepliesRef: MutableRefObject<any>, setDateHeader?: Function, parentMessageId?: number, hideGroupActionMessages?: boolean, showSmartReplies?: boolean, goToMessageId?: string): void;
|
|
5
|
+
declare function useCometChatMessageList(loggedInUserRef: MutableRefObject<CometChat.User | null>, messageListManagerRef: MutableRefObject<any>, fetchPreviousMessages: () => void, updateMessage: (key: string, mesage: CometChat.BaseMessage, group?: CometChat.Group) => void, messagesRequestBuilder: CometChat.MessagesRequestBuilder | undefined, user: CometChat.User | undefined, group: CometChat.Group | undefined, messageIdRef: MutableRefObject<any>, totalMessagesCountRef: MutableRefObject<any>, messageList: CometChat.BaseMessage[], errorHandler: (error: unknown, source?: string) => void, setMessageList: (messages: CometChat.BaseMessage[]) => void, setScrollListToBottom: (scrollToBottom: boolean) => void, smartReplyViewRef: MutableRefObject<any>, isOnBottomRef: MutableRefObject<boolean>, isFirstReloadRef: MutableRefObject<boolean>, subscribeToUIEvents: Function, showSmartRepliesRef: MutableRefObject<any>, addMessage: (message: CometChat.BaseMessage) => void, setDateHeader?: Function, parentMessageId?: number, hideGroupActionMessages?: boolean, showSmartReplies?: boolean, goToMessageId?: string, isAgentChat?: boolean): void;
|
|
6
6
|
export { useCometChatMessageList };
|
|
@@ -5,6 +5,7 @@ export declare class CometChatUIKitConstants {
|
|
|
5
5
|
action: string;
|
|
6
6
|
call: string;
|
|
7
7
|
interactive: string;
|
|
8
|
+
agentic: import("@cometchat/chat-sdk-javascript").MessageCategory.AGENTIC;
|
|
8
9
|
}>;
|
|
9
10
|
static MessageTypes: Readonly<{
|
|
10
11
|
text: string;
|
|
@@ -19,6 +20,9 @@ export declare class CometChatUIKitConstants {
|
|
|
19
20
|
card: "card";
|
|
20
21
|
customInteractive: "customInteractive";
|
|
21
22
|
scheduler: "scheduler";
|
|
23
|
+
assistant: string;
|
|
24
|
+
toolArguments: string;
|
|
25
|
+
toolResults: string;
|
|
22
26
|
}>;
|
|
23
27
|
static groupMemberAction: Readonly<{
|
|
24
28
|
ROLE: "role";
|
|
@@ -147,4 +151,15 @@ export declare class CometChatUIKitConstants {
|
|
|
147
151
|
changeScope: "changeScope";
|
|
148
152
|
groupMembers: "groupMembers";
|
|
149
153
|
}>;
|
|
154
|
+
static streamMessageTypes: Readonly<{
|
|
155
|
+
run_started: string;
|
|
156
|
+
text_message_start: string;
|
|
157
|
+
text_message_content: string;
|
|
158
|
+
text_message_end: string;
|
|
159
|
+
run_finished: string;
|
|
160
|
+
tool_call_start: string;
|
|
161
|
+
tool_call_end: string;
|
|
162
|
+
tool_call_args: string;
|
|
163
|
+
tool_call_result: string;
|
|
164
|
+
}>;
|
|
150
165
|
}
|
|
@@ -35,6 +35,9 @@ export declare class CometChatMessageEvents {
|
|
|
35
35
|
static onFormMessageReceived: Subject<CometChat.InteractiveMessage>;
|
|
36
36
|
static onCardMessageReceived: Subject<CometChat.InteractiveMessage>;
|
|
37
37
|
static onSchedulerMessageReceived: Subject<CometChat.InteractiveMessage>;
|
|
38
|
+
static onAIAssistantMessageReceived: Subject<CometChat.AIAssistantMessage>;
|
|
39
|
+
static onAIToolResultReceived: Subject<CometChat.AIToolResultMessage>;
|
|
40
|
+
static onAIToolArgumentsReceived: Subject<CometChat.AIToolArgumentMessage>;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Interface for message-related events
|
package/dist/types/index.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export { CometChatRadioButton } from './components/BaseComponents/CometChatRadio
|
|
|
85
85
|
export { CometChatPopover } from './components/BaseComponents/CometChatPopover/CometChatPopover';
|
|
86
86
|
export { CometChatMediaRecorder } from './components/BaseComponents/CometChatMediaRecorder/CometChatMediaRecorder';
|
|
87
87
|
export { CometChatListItem } from './components/BaseComponents/CometChatListItem/CometChatListItem';
|
|
88
|
+
export { CometChatErrorView } from './components/BaseComponents/CometChatErrorView/CometChatErrorView';
|
|
88
89
|
export { CometChatImageBubble } from './components/BaseComponents/CometChatImageBubble/CometChatImageBubble';
|
|
89
90
|
export { CometChatFullScreenViewer } from './components/BaseComponents/CometChatFullScreenViewer/CometChatFullScreenViewer';
|
|
90
91
|
export { CometChatFileBubble } from './components/BaseComponents/CometChatFileBubble/CometChatFileBubble';
|
|
@@ -114,3 +115,9 @@ export * from './formatters/index';
|
|
|
114
115
|
export * from './utils/SearchUtils';
|
|
115
116
|
export { CometChatSearch } from './components/CometChatSearch/CometChatSearch';
|
|
116
117
|
export { CometChatFrameProvider, useCometChatFrameContext } from './context/CometChatFrameContext';
|
|
118
|
+
export { CometChatAIAssistantChat } from './components/CometChatAIAssistantChat/CometChatAIAssistantChat';
|
|
119
|
+
export * from './services/stream-message.service';
|
|
120
|
+
export { CometChatAIAssistantTools } from './modals/CometChatAIAssistantTools';
|
|
121
|
+
export { CometChatStreamMessageBubble } from './components/BaseComponents/CometChatStreamMessageBubble/CometChatStreamMessageBubble';
|
|
122
|
+
export { CometChatAIAssistantMessageBubble } from './components/BaseComponents/CometChatAIAssistantMessageBubble/CometChatAIAssistantMessageBubble';
|
|
123
|
+
export { CometChatAIAssistantChatHistory } from './components/CometChatAIAssistantChatHistory/CometChatAIAssistantChatHistory';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definition for toolkit action functions
|
|
3
|
+
* Each function can return any value or a Promise for async operations
|
|
4
|
+
*/
|
|
5
|
+
type CometChatAIAssistantToolsFunction = (args: any) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Interface for the toolkit actions map
|
|
8
|
+
* Key: string (function name)
|
|
9
|
+
* Value: CometChatAIAssistantToolsFunction
|
|
10
|
+
*/
|
|
11
|
+
interface ICometChatAIAssistantToolsMap {
|
|
12
|
+
[functionName: string]: CometChatAIAssistantToolsFunction;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* CometChatAIAssistantTools class for managing action functions
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const toolkit = new CometChatAIAssistantTools({
|
|
20
|
+
* // Weather related functions
|
|
21
|
+
* getCurrentWeather: (params: {location: string}) => {
|
|
22
|
+
* // Implementation for getting current weather
|
|
23
|
+
* fetch(`/api/weather?location=${params.location}`);
|
|
24
|
+
* },
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
declare class CometChatAIAssistantTools {
|
|
30
|
+
private actionsMap;
|
|
31
|
+
[functionName: string]: any;
|
|
32
|
+
constructor(actions: ICometChatAIAssistantToolsMap);
|
|
33
|
+
/**
|
|
34
|
+
* Get the implementation of a specific action
|
|
35
|
+
*
|
|
36
|
+
* @param functionName - Name of the function
|
|
37
|
+
* @returns The function implementation or undefined if not found
|
|
38
|
+
*/
|
|
39
|
+
getAction(functionName: string): CometChatAIAssistantToolsFunction | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Get a copy of all actions
|
|
42
|
+
*
|
|
43
|
+
* @returns A copy of the actions map
|
|
44
|
+
*/
|
|
45
|
+
getActions(): ICometChatAIAssistantToolsMap;
|
|
46
|
+
}
|
|
47
|
+
export { CometChatAIAssistantTools, type ICometChatAIAssistantToolsMap, type CometChatAIAssistantToolsFunction };
|
|
@@ -50,7 +50,7 @@ declare class CometChatMessageTemplate {
|
|
|
50
50
|
* By default, it displays the receipt and the timestamp.
|
|
51
51
|
* @type {(message:CometChat.BaseMessage,alignment:MessageBubbleAlignment)=> Element | JSX.Element | null}
|
|
52
52
|
*/
|
|
53
|
-
statusInfoView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject) => Element | JSX.Element | null) | null;
|
|
53
|
+
statusInfoView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject, showError?: boolean) => Element | JSX.Element | null) | null;
|
|
54
54
|
/**
|
|
55
55
|
* List of available actions that any user can perform on a message, like reacting,
|
|
56
56
|
* editing or deleting a message.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CometChatAIAssistantTools } from '../modals/CometChatAIAssistantTools';
|
|
2
|
+
/**
|
|
3
|
+
* Interface representing streaming message data that contains both the original message event
|
|
4
|
+
* and the accumulated streamed text content that has been processed so far.
|
|
5
|
+
*/
|
|
6
|
+
export interface IStreamData {
|
|
7
|
+
message: CometChat.AIAssistantBaseEvent;
|
|
8
|
+
streamedMessages?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Observable stream for streaming state changes
|
|
12
|
+
*/
|
|
13
|
+
export declare const streamingState$: import("rxjs").Observable<boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* Observable stream for message updates
|
|
16
|
+
*/
|
|
17
|
+
export declare const messageStream: import("rxjs").Observable<IStreamData>;
|
|
18
|
+
/**
|
|
19
|
+
* Starts a new streaming message session
|
|
20
|
+
* Resets accumulated content and initializes the message processor
|
|
21
|
+
*/
|
|
22
|
+
export declare const startStreamingMessage: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Handles incoming websocket messages by adding them to the processing queue
|
|
25
|
+
* @param msg - The message update to process
|
|
26
|
+
*/
|
|
27
|
+
export declare const handleWebsocketMessage: (msg: CometChat.AIAssistantBaseEvent) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the typing speed delay for text message content chunks
|
|
30
|
+
* @param delay - The delay in milliseconds between text content chunks (default: 80ms)
|
|
31
|
+
*/
|
|
32
|
+
export declare const setStreamSpeed: (delay: number) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the current typing speed delay for text message content chunks
|
|
35
|
+
* @returns The current delay in milliseconds
|
|
36
|
+
*/
|
|
37
|
+
export declare const getStreamSpeed: () => number;
|
|
38
|
+
export declare const getAIAssistantTools: () => CometChatAIAssistantTools;
|
|
39
|
+
export declare const setAIAssistantTools: (actions: CometChatAIAssistantTools) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Stops the streaming message session and cleans up resources
|
|
42
|
+
* Unsubscribes from the message processor and resets accumulated content
|
|
43
|
+
*/
|
|
44
|
+
export declare const stopStreamingMessage: () => void;
|
|
@@ -18,12 +18,16 @@ export declare abstract class DataSource {
|
|
|
18
18
|
abstract getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
19
19
|
abstract getFileMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
20
20
|
abstract getBottomView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment): Element | JSX.Element | null;
|
|
21
|
-
abstract getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject): Element | JSX.Element | null;
|
|
21
|
+
abstract getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject, showError?: boolean): Element | JSX.Element | null;
|
|
22
22
|
abstract getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, otherParams: Object | undefined): Element | JSX.Element;
|
|
23
23
|
abstract getImageMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
|
|
24
24
|
abstract getVideoMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
|
|
25
25
|
abstract getAudioMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
|
|
26
26
|
abstract getFileMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
|
|
27
|
+
abstract getAgentAssistantMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
28
|
+
abstract getToolArgumentsMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
29
|
+
abstract getToolResultsMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
30
|
+
abstract getStreamMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
27
31
|
abstract getTextMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
28
32
|
abstract getImageMessageTemplate(): CometChatMessageTemplate;
|
|
29
33
|
abstract getVideoMessageTemplate(): CometChatMessageTemplate;
|
|
@@ -41,6 +45,10 @@ export declare abstract class DataSource {
|
|
|
41
45
|
abstract getId(): string;
|
|
42
46
|
abstract getDeleteMessageBubble(messageObject: CometChat.BaseMessage, text?: string, alignment?: MessageBubbleAlignment): Element | JSX.Element;
|
|
43
47
|
abstract getGroupActionBubble(message: CometChat.BaseMessage): Element | JSX.Element;
|
|
48
|
+
abstract getStreamMessageBubble(message: CometChat.CustomMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): Element | JSX.Element;
|
|
49
|
+
abstract getAgentAssistantMessageBubble(message: CometChat.AIAssistantMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): Element | JSX.Element;
|
|
50
|
+
abstract getToolArgumentsMessageBubble(message: CometChat.AIToolArgumentMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): Element | JSX.Element;
|
|
51
|
+
abstract getToolResultsMessageBubble(message: CometChat.AIToolResultMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): Element | JSX.Element;
|
|
44
52
|
abstract getTextMessageBubble(messageText: string, message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): Element | JSX.Element;
|
|
45
53
|
abstract getVideoMessageBubble(videoUrl: string, message: CometChat.MediaMessage, thumbnailUrl?: string, onClick?: Function, alignment?: MessageBubbleAlignment): Element | JSX.Element;
|
|
46
54
|
abstract getImageMessageBubble(imageUrl: string, placeholderImage: string, message: CometChat.MediaMessage, onClick?: Function, alignment?: MessageBubbleAlignment): Element | JSX.Element;
|
|
@@ -19,7 +19,7 @@ export declare abstract class DataSourceDecorator implements DataSource {
|
|
|
19
19
|
getVideoMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
20
20
|
getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
21
21
|
getFileMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
22
|
-
getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject): JSX.Element | Element | null;
|
|
22
|
+
getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject, showError?: boolean): JSX.Element | Element | null;
|
|
23
23
|
getBottomView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment): JSX.Element | Element | null;
|
|
24
24
|
getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): JSX.Element | Element;
|
|
25
25
|
getImageMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
|
|
@@ -27,6 +27,10 @@ export declare abstract class DataSourceDecorator implements DataSource {
|
|
|
27
27
|
getAudioMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
|
|
28
28
|
getFileMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
|
|
29
29
|
getTextMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
30
|
+
getAgentAssistantMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
31
|
+
getToolArgumentsMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
32
|
+
getToolResultsMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
33
|
+
getStreamMessageTemplate(additionalConfigurations?: Object | undefined): CometChatMessageTemplate;
|
|
30
34
|
getImageMessageTemplate(): CometChatMessageTemplate;
|
|
31
35
|
getVideoMessageTemplate(): CometChatMessageTemplate;
|
|
32
36
|
getAudioMessageTemplate(): CometChatMessageTemplate;
|
|
@@ -44,6 +48,10 @@ export declare abstract class DataSourceDecorator implements DataSource {
|
|
|
44
48
|
getDeleteMessageBubble(messageObject: CometChat.BaseMessage, text?: string, alignment?: MessageBubbleAlignment): JSX.Element | Element;
|
|
45
49
|
getGroupActionBubble(message: CometChat.BaseMessage): JSX.Element | Element;
|
|
46
50
|
getTextMessageBubble(messageText: string, message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): JSX.Element | Element;
|
|
51
|
+
getAgentAssistantMessageBubble(message: CometChat.AIAssistantMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): JSX.Element | Element;
|
|
52
|
+
getToolArgumentsMessageBubble(message: CometChat.AIToolArgumentMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): JSX.Element | Element;
|
|
53
|
+
getToolResultsMessageBubble(message: CometChat.AIToolResultMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): JSX.Element | Element;
|
|
54
|
+
getStreamMessageBubble(message: CometChat.CustomMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): JSX.Element | Element;
|
|
47
55
|
getVideoMessageBubble(videoUrl: string, message: CometChat.MediaMessage, thumbnailUrl?: string, onClick?: Function, alignment?: MessageBubbleAlignment): JSX.Element | Element;
|
|
48
56
|
getImageMessageBubble(imageUrl: string, placeholderImage: string, message: CometChat.MediaMessage, onClick?: Function, alignment?: MessageBubbleAlignment): JSX.Element | Element;
|
|
49
57
|
getAudioMessageBubble(audioUrl: string, message: CometChat.MediaMessage, title?: string, alignment?: MessageBubbleAlignment): JSX.Element | Element;
|
|
@@ -41,17 +41,17 @@ export declare class MessagesDataSource implements DataSource {
|
|
|
41
41
|
getVideoMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
42
42
|
getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
43
43
|
getFileMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
44
|
-
getReceiptClass(status?: number): "error" | "
|
|
44
|
+
getReceiptClass(status?: number): "error" | "read" | "wait" | "delivered" | "sent" | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* Function to get receipt for message bubble
|
|
47
47
|
* @param {CometChat.BaseMessage} item - The message bubble for which the receipt needs to be fetched
|
|
48
48
|
* @returns {JSX.Element | null} Returns JSX.Element for receipt of a message bubble or null
|
|
49
49
|
*/
|
|
50
|
-
getBubbleStatusInfoReceipt: (item: CometChat.BaseMessage, hideReceipts?: boolean) => JSX.Element | null;
|
|
50
|
+
getBubbleStatusInfoReceipt: (item: CometChat.BaseMessage, hideReceipts?: boolean, showError?: boolean) => JSX.Element | null;
|
|
51
51
|
/**
|
|
52
|
-
* Function for displaying the timestamp next to messages.
|
|
53
|
-
* @returns CalendarObject
|
|
54
|
-
*/
|
|
52
|
+
* Function for displaying the timestamp next to messages.
|
|
53
|
+
* @returns CalendarObject
|
|
54
|
+
*/
|
|
55
55
|
getMessageSentAtDateFormat(messageSentAtDateTimeFormat?: CalendarObject): {
|
|
56
56
|
today: string;
|
|
57
57
|
yesterday: string;
|
|
@@ -70,9 +70,18 @@ export declare class MessagesDataSource implements DataSource {
|
|
|
70
70
|
* @returns {JSX.Element | null} Returns JSX.Element for status and date of a message bubble or null
|
|
71
71
|
*/
|
|
72
72
|
getBubbleStatusInfoDate: (item: CometChat.BaseMessage, messageSentAtDateTimeFormat?: CalendarObject) => JSX.Element | null;
|
|
73
|
-
getStatusInfoView: (_messageObject: CometChat.BaseMessage, _alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject) => import("react/jsx-runtime").JSX.Element | null;
|
|
73
|
+
getStatusInfoView: (_messageObject: CometChat.BaseMessage, _alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject, showError?: boolean) => import("react/jsx-runtime").JSX.Element | null;
|
|
74
74
|
getBottomView(_messageObject: CometChat.BaseMessage, _alignment: MessageBubbleAlignment): null;
|
|
75
75
|
getTextMessageTemplate(additionalConfigurations?: additionalParams): CometChatMessageTemplate;
|
|
76
|
+
getAgentAssistantMessageBubble(message: CometChat.AIAssistantMessage): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
getToolArgumentsMessageBubble(message: CometChat.AIToolArgumentMessage): import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
getToolResultsMessageBubble(message: CometChat.AIToolResultMessage): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
handleCopy: (message: CometChat.AIAssistantMessage) => void;
|
|
80
|
+
getAgentAssistantMessageTemplate(): CometChatMessageTemplate;
|
|
81
|
+
getToolResultsMessageTemplate(): CometChatMessageTemplate;
|
|
82
|
+
getToolArgumentsMessageTemplate(): CometChatMessageTemplate;
|
|
83
|
+
getStreamMessageBubble(message: CometChat.CustomMessage): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
getStreamMessageTemplate(): CometChatMessageTemplate;
|
|
76
85
|
getAudioMessageTemplate(): CometChatMessageTemplate;
|
|
77
86
|
getVideoMessageTemplate(): CometChatMessageTemplate;
|
|
78
87
|
getImageMessageTemplate(): CometChatMessageTemplate;
|
|
@@ -59,4 +59,6 @@ export declare const useDebouncedCallback: (callback: () => void, delay: number)
|
|
|
59
59
|
debouncedCallback: () => void;
|
|
60
60
|
cleanup: () => void;
|
|
61
61
|
};
|
|
62
|
+
export declare function createMessageCopy(msg: CometChat.AIAssistantBaseEvent, user: CometChat.User, category?: string, type?: string): CometChat.BaseMessage;
|
|
63
|
+
export declare function isDarkMode(): boolean;
|
|
62
64
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cometchat/chat-uikit-react",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Ready-to-use Chat UI Components for React(Javascript/Web)",
|
|
5
5
|
"author": "CometChat",
|
|
6
6
|
"exports": {
|
|
@@ -8,9 +8,12 @@
|
|
|
8
8
|
"./css-variables.css": "./dist/styles/css-variables.css"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@cometchat/chat-sdk-javascript": "^4.0
|
|
11
|
+
"@cometchat/chat-sdk-javascript": "^4.1.0",
|
|
12
12
|
"@rollup/plugin-json": "^6.1.0",
|
|
13
|
-
"rxjs": "^7.8.1"
|
|
13
|
+
"rxjs": "^7.8.1",
|
|
14
|
+
"react-markdown": "^10.1.0",
|
|
15
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
16
|
+
"react-syntax-highlighter": "^15.6.1"
|
|
14
17
|
},
|
|
15
18
|
"scripts": {
|
|
16
19
|
"test": "echo \"Error: no test specified\" && exit 1",
|