@cometchat/chat-uikit-react 6.3.9 → 6.3.11

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.
@@ -187,6 +187,11 @@
187
187
  .cometchat-mention-list>.cometchat {
188
188
  border-radius: inherit;
189
189
  }
190
+
191
+ .cometchat-mention-list .cometchat-users .cometchat-list{
192
+ max-height: 336px;
193
+ }
194
+
190
195
  .cometchat-mention-list .cometchat-list .cometchat-list__header-title{
191
196
  display: none;
192
197
  }
@@ -187,6 +187,11 @@
187
187
  .cometchat-mention-list>.cometchat {
188
188
  border-radius: inherit;
189
189
  }
190
+
191
+ .cometchat-mention-list .cometchat-users .cometchat-list{
192
+ max-height: 336px;
193
+ }
194
+
190
195
  .cometchat-mention-list .cometchat-list .cometchat-list__header-title{
191
196
  display: none;
192
197
  }
@@ -147,6 +147,18 @@ interface ListProps<T> {
147
147
  *
148
148
  */
149
149
  scrollToEnd?: boolean;
150
+ /**
151
+ * @internal
152
+ *
153
+ * Skips the scroll height check when triggering onScrolledToBottom callback in CometChatList.
154
+ * When true, the callback fires even if the list content fits within the list body container.
155
+ * Uses the screen/viewport as the intersection root instead of the list body,
156
+ * so the callback triggers when the bottom of the list becomes visible on screen.
157
+ * Useful when the list is embedded in a parent scrollable container.
158
+ *
159
+ * @defaultValue `false`
160
+ */
161
+ observeScrollFromViewport?: boolean;
150
162
  }
151
163
  /**
152
164
  * Renders a list component that can display a title, search bar,
@@ -12,6 +12,7 @@ type Args = {
12
12
  didTopObserverCallbackRunRef: React.MutableRefObject<boolean>;
13
13
  errorHandler: (error: unknown) => void;
14
14
  scrolledUpCallback?: (boolean?: boolean) => void;
15
+ observeScrollFromViewport?: boolean;
15
16
  };
16
17
  export declare function useCometChatList(args: Args): void;
17
18
  export {};
@@ -19,6 +19,7 @@ interface MessageBubbleProps {
19
19
  topMenuSize?: number;
20
20
  type?: string;
21
21
  category?: string;
22
+ toggleOptionsVisibility?: boolean;
22
23
  }
23
24
  /**
24
25
  * React component for displaying different types of messages in the message list.
@@ -29,6 +29,8 @@ interface AIAssistantChatProps {
29
29
  emptyChatImageView?: React.JSX.Element;
30
30
  aiAssistantTools?: CometChatAIAssistantTools;
31
31
  templates?: CometChatMessageTemplate[];
32
+ parentMessageId?: number;
33
+ loadLastAgentConversation?: boolean;
32
34
  }
33
35
  export declare const CometChatAIAssistantChat: React.MemoExoticComponent<(props: AIAssistantChatProps) => import("react/jsx-runtime").JSX.Element>;
34
36
  export {};
@@ -28,6 +28,16 @@ interface CometChatAIAssistantChatHistoryProps {
28
28
  * @default false
29
29
  */
30
30
  hideNewChat?: boolean;
31
+ /**
32
+ * Callback function triggered when the chat history is empty.
33
+ * Useful for handling UI state when no conversations exist.
34
+ */
35
+ onEmpty?: (() => void) | undefined;
36
+ /**
37
+ * Loads the most recent existing agent conversation if one is available, by clicking it.
38
+ * @default false
39
+ */
40
+ loadLastAgentConversation?: boolean;
31
41
  }
32
42
  declare const CometChatAIAssistantChatHistory: (props: CometChatAIAssistantChatHistoryProps) => import("react/jsx-runtime").JSX.Element;
33
43
  export { CometChatAIAssistantChatHistory };
@@ -161,6 +161,18 @@ interface GroupMembersProps {
161
161
  * @defaultValue `false`
162
162
  */
163
163
  showScrollbar?: boolean;
164
+ /**
165
+ * @internal
166
+ *
167
+ * Skips the scroll height check when triggering onScrolledToBottom callback in CometChatList.
168
+ * When true, the callback fires even if the list content fits within the list body container.
169
+ * Uses the screen/viewport as the intersection root instead of the list body,
170
+ * so the callback triggers when the bottom of the list becomes visible on screen.
171
+ * Useful when the list is embedded in a parent scrollable container.
172
+ *
173
+ * @defaultValue `false`
174
+ */
175
+ observeScrollFromViewport?: boolean;
164
176
  }
165
177
  export type Action = {
166
178
  type: "appendGroupMembers";
@@ -260,6 +260,11 @@ interface MessageListProps {
260
260
  * @defaultValue `false`
261
261
  */
262
262
  hideFlagRemarkField?: boolean;
263
+ /**
264
+ * Loads the most recent existing agent conversation if one is available. Used to set state as loading when enabled.
265
+ * @default false
266
+ */
267
+ loadLastAgentConversation?: boolean;
263
268
  }
264
269
  declare const CometChatMessageList: (props: MessageListProps) => import("react/jsx-runtime").JSX.Element;
265
270
  export { CometChatMessageList };
@@ -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>, addMessage: (message: CometChat.BaseMessage) => void, canFetchPreviousRef: MutableRefObject<boolean>, setDateHeader?: Function, parentMessageId?: number, hideGroupActionMessages?: boolean, showSmartReplies?: boolean, goToMessageId?: string, isAgentChat?: boolean, messageRepliedTo?: 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, canFetchPreviousRef: MutableRefObject<boolean>, setDateHeader?: Function, parentMessageId?: number, hideGroupActionMessages?: boolean, showSmartReplies?: boolean, goToMessageId?: string, isAgentChat?: boolean, messageRepliedTo?: string, loadLastAgentConversation?: boolean): void;
6
6
  export { useCometChatMessageList };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cometchat/chat-uikit-react",
3
- "version": "6.3.9",
3
+ "version": "6.3.11",
4
4
  "description": "Ready-to-use Chat UI Components for React(Javascript/Web)",
5
5
  "author": "CometChat",
6
6
  "exports": {
@@ -13,7 +13,7 @@
13
13
  "rxjs": "^7.8.1",
14
14
  "react-markdown": "^10.1.0",
15
15
  "@types/react-syntax-highlighter": "^15.5.13",
16
- "react-syntax-highlighter": "^15.6.1",
16
+ "react-syntax-highlighter": "^16.1.0",
17
17
  "remark-gfm": "^4.0.1"
18
18
  },
19
19
  "scripts": {
@@ -46,7 +46,7 @@
46
46
  "typescript": "^5.0.4",
47
47
  "webpack": "^5.68.0",
48
48
  "webpack-cli": "^4.9.2",
49
- "webpack-dev-server": "^4.7.4"
49
+ "webpack-dev-server": "^5.2.3"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@types/react": ">=18.0.0 <20.0.0",