@cometchat/chat-uikit-react 6.0.4 → 6.0.5

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.
@@ -319,4 +319,11 @@ height: 58px;
319
319
  }
320
320
  .cometchat-message-composer__secondary-button-view-attachment-button-5 .cometchat-popover__content{
321
321
  height: 285px;
322
+ }
323
+ .cometchat-message-composer .cometchat-edit-preview__subtitle{
324
+ height: fit-content;
325
+ max-height: 100px;
326
+ overflow: hidden;
327
+ text-overflow: ellipsis;
328
+ white-space: nowrap;
322
329
  }
@@ -119,7 +119,7 @@
119
119
  .cometchat-reaction-list__shimmer {
120
120
  display: flex;
121
121
  width: 280px;
122
- max-height: 300px;
122
+ height: 200px;
123
123
  flex-direction: column;
124
124
  align-items: flex-start;
125
125
  align-self: stretch;
@@ -319,4 +319,11 @@ height: 58px;
319
319
  }
320
320
  .cometchat-message-composer__secondary-button-view-attachment-button-5 .cometchat-popover__content{
321
321
  height: 285px;
322
+ }
323
+ .cometchat-message-composer .cometchat-edit-preview__subtitle{
324
+ height: fit-content;
325
+ max-height: 100px;
326
+ overflow: hidden;
327
+ text-overflow: ellipsis;
328
+ white-space: nowrap;
322
329
  }
@@ -119,7 +119,7 @@
119
119
  .cometchat-reaction-list__shimmer {
120
120
  display: flex;
121
121
  width: 280px;
122
- max-height: 300px;
122
+ height: 200px;
123
123
  flex-direction: column;
124
124
  align-items: flex-start;
125
125
  align-self: stretch;
@@ -37,6 +37,7 @@ type Args = {
37
37
  text: string;
38
38
  getCurrentInput: Function;
39
39
  isPartOfCurrentChatForUIEvent: (message: CometChat.BaseMessage) => boolean | undefined;
40
+ textMessageToEdit: CometChat.TextMessage | null;
40
41
  };
41
42
  export declare function useCometChatMessageComposer(args: Args): void;
42
43
  export {};
@@ -1,5 +1,6 @@
1
1
  import { CometChatMessageTemplate } from "../../modals";
2
2
  import { CalendarObject } from "../../utils/CalendarObject";
3
+ import { CometChatTextFormatter } from "../../formatters";
3
4
  interface MessageInformationProps {
4
5
  message: CometChat.BaseMessage;
5
6
  onClose?: () => void;
@@ -20,6 +21,15 @@ interface MessageInformationProps {
20
21
  * Template for customizing the appearance of the message.
21
22
  */
22
23
  template?: CometChatMessageTemplate;
24
+ /**
25
+ * Hides the visibility of receipt in the Message Information.
26
+ * @default false
27
+ */
28
+ hideReceipts?: boolean;
29
+ /**
30
+ * Array of text formatters for custom styling or formatting of message text bubbles.
31
+ */
32
+ textFormatters?: CometChatTextFormatter[];
23
33
  }
24
34
  declare const CometChatMessageInformation: (props: MessageInformationProps) => import("react/jsx-runtime").JSX.Element;
25
35
  export { CometChatMessageInformation };
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { CometChatMessageTemplate } from "../../modals";
3
3
  import { CalendarObject } from "../../utils/CalendarObject";
4
+ import { CometChatTextFormatter } from "../../formatters";
4
5
  interface CometChatThreadHeaderProps {
5
6
  /**
6
7
  * Hides the visibility of the date header.
@@ -47,6 +48,15 @@ interface CometChatThreadHeaderProps {
47
48
  * Format for the timestamp displayed next to messages.
48
49
  */
49
50
  messageSentAtDateTimeFormat?: CalendarObject;
51
+ /**
52
+ * Hides the visibility of receipt in the Thread Header.
53
+ * @default false
54
+ */
55
+ hideReceipts?: boolean;
56
+ /**
57
+ * Array of text formatters for custom styling or formatting of message text bubbles.
58
+ */
59
+ textFormatters?: CometChatTextFormatter[];
50
60
  }
51
61
  declare const CometChatThreadHeader: (props: CometChatThreadHeaderProps) => import("react/jsx-runtime").JSX.Element;
52
62
  export { CometChatThreadHeader };
@@ -29,6 +29,7 @@ export interface IOpenChat {
29
29
  }
30
30
  export interface IShowOngoingCall {
31
31
  child: any;
32
+ message?: CometChat.CustomMessage;
32
33
  }
33
34
  export interface IPanel {
34
35
  child?: any;
@@ -2,6 +2,7 @@
2
2
  import { CometChatMessageOption } from "./CometChatMessageOption";
3
3
  import { MessageBubbleAlignment } from "../Enums/Enums";
4
4
  import { CalendarObject } from "../utils/CalendarObject";
5
+ import { CometChatTextFormatter } from "../formatters";
5
6
  /**
6
7
  * CometChatMessageTemplate is a pre-defined structure for creating message views
7
8
  * that can be used as a starting point or blueprint for creating message views,
@@ -20,7 +21,7 @@ declare class CometChatMessageTemplate {
20
21
  * and Video bubble based on the type of the message.
21
22
  * @type {(message:CometChat.BaseMessage,alignment:MessageBubbleAlignment)=> Element | JSX.Element | null}
22
23
  */
23
- contentView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment) => Element | JSX.Element | null) | null;
24
+ contentView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, textFormatters?: CometChatTextFormatter[]) => Element | JSX.Element | null) | null;
24
25
  /**
25
26
  * Custom component to customize the complete message bubble.
26
27
  * By default, headerView, contentView and footerView collectively form a message bubble.
@@ -49,7 +50,7 @@ declare class CometChatMessageTemplate {
49
50
  * By default, it displays the receipt and the timestamp.
50
51
  * @type {(message:CometChat.BaseMessage,alignment:MessageBubbleAlignment)=> Element | JSX.Element | null}
51
52
  */
52
- statusInfoView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipt?: boolean, messageSentAtDateTimeFormat?: CalendarObject) => Element | JSX.Element | null) | null;
53
+ statusInfoView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject) => Element | JSX.Element | null) | null;
53
54
  /**
54
55
  * List of available actions that any user can perform on a message, like reacting,
55
56
  * editing or deleting a message.
@@ -18,7 +18,7 @@ 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, hideReceipt?: boolean, messageSentAtDateTimeFormat?: CalendarObject): Element | JSX.Element | null;
21
+ abstract getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject): 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;
@@ -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, hideReceipt?: boolean, messageSentAtDateTimeFormat?: CalendarObject): JSX.Element | Element | null;
22
+ getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject): 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;
@@ -1,3 +1,4 @@
1
+ import { Receipts } from "../Enums/Enums";
1
2
  /**
2
3
  * Utility class for handling message receipt statuses.
3
4
  * It is used in CometChatConversations and CometChatMessageList components.
@@ -10,35 +11,7 @@ export declare class MessageReceiptUtils {
10
11
  * the corresponding receipt icon.
11
12
  *
12
13
  * @param {CometChat.BaseMessage} messageObject - The message object for which to get the receipt status.
13
- * @returns {receipts} - The receipt status icon.
14
+ * @returns {Receipts} - The receipt status icon.
14
15
  */
15
- static getReceiptStatus: (messageObject: CometChat.BaseMessage) => receipts;
16
- }
17
- /**
18
- * Enum representing different receipt statuses for a message.
19
- *
20
- * @readonly
21
- * @enum {number}
22
- */
23
- export declare enum receipts {
24
- /**
25
- * Status indicating that the message is waiting to be processed.
26
- */
27
- wait = 0,
28
- /**
29
- * Status indicating that the message has been sent.
30
- */
31
- sent = 1,
32
- /**
33
- * Status indicating that the message has been delivered.
34
- */
35
- delivered = 2,
36
- /**
37
- * Status indicating that the message has been read.
38
- */
39
- read = 3,
40
- /**
41
- * Status indicating that an error occurred with the message.
42
- */
43
- error = 4
16
+ static getReceiptStatus: (messageObject: CometChat.BaseMessage) => Receipts;
44
17
  }
@@ -1,6 +1,7 @@
1
1
  import { MessageBubbleAlignment } from "../Enums/Enums";
2
2
  import { CometChatMessageTemplate } from "../modals";
3
3
  import { CalendarObject } from "./CalendarObject";
4
+ import { CometChatTextFormatter } from "../formatters";
4
5
  /**
5
6
  * Utility class for handling message display and styling.
6
7
  * It is used in CometChatMessageInformation component.
@@ -13,7 +14,7 @@ export declare class MessageUtils {
13
14
  * @param {CometChatMessageTemplate} template - The message template to use for rendering the content view.
14
15
  * @returns {object | null} - The content view for the message, or null if not found.
15
16
  */
16
- getContentView(message: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment?: MessageBubbleAlignment): any;
17
+ getContentView(message: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment?: MessageBubbleAlignment, textFormatters?: CometChatTextFormatter[]): any;
17
18
  /**
18
19
  * Retrieves the content view for a message based on the provided template.
19
20
  *
@@ -21,7 +22,7 @@ export declare class MessageUtils {
21
22
  * @param {CometChatMessageTemplate} template - The message template to use for rendering the content view.
22
23
  * @returns {object | null} - The content view for the message, or null if not found.
23
24
  */
24
- getStatusInfoView(message: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment?: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject): any;
25
+ getStatusInfoView(message: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment?: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject, hideReceipts?: boolean): any;
25
26
  /**
26
27
  * Retrieves the bubble wrapper for a message based on the provided template.
27
28
  *
@@ -39,7 +40,7 @@ export declare class MessageUtils {
39
40
  * @param {MessageBubbleAlignment} alignment - The alignment of the message bubble (left or right).
40
41
  * @returns {JSX.Element} - The message bubble component.
41
42
  */
42
- getMessageBubble(baseMessage: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject): any;
43
+ getMessageBubble(baseMessage: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject, hideReceipts?: boolean, textFormatters?: CometChatTextFormatter[]): any;
43
44
  /**
44
45
  *
45
46
  * @param {(CometChat.User | CometChat.GroupMember | any)} user
@@ -48,7 +48,7 @@ export declare class MessagesDataSource implements DataSource {
48
48
  * @param {CometChat.BaseMessage} item - The message bubble for which the receipt needs to be fetched
49
49
  * @returns {JSX.Element | null} Returns JSX.Element for receipt of a message bubble or null
50
50
  */
51
- getBubbleStatusInfoReceipt: (item: CometChat.BaseMessage, hideReceipt?: boolean) => JSX.Element | null;
51
+ getBubbleStatusInfoReceipt: (item: CometChat.BaseMessage, hideReceipts?: boolean) => JSX.Element | null;
52
52
  /**
53
53
  * Function for displaying the timestamp next to messages.
54
54
  * @returns CalendarObject
@@ -71,7 +71,7 @@ export declare class MessagesDataSource implements DataSource {
71
71
  * @returns {JSX.Element | null} Returns JSX.Element for status and date of a message bubble or null
72
72
  */
73
73
  getBubbleStatusInfoDate: (item: CometChat.BaseMessage, messageSentAtDateTimeFormat?: CalendarObject) => JSX.Element | null;
74
- getStatusInfoView: (_messageObject: CometChat.BaseMessage, _alignment: MessageBubbleAlignment, hideReceipt?: boolean, messageSentAtDateTimeFormat?: CalendarObject) => import("react/jsx-runtime").JSX.Element | null;
74
+ getStatusInfoView: (_messageObject: CometChat.BaseMessage, _alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject) => import("react/jsx-runtime").JSX.Element | null;
75
75
  getBottomView(_messageObject: CometChat.BaseMessage, _alignment: MessageBubbleAlignment): null;
76
76
  getTextMessageTemplate(additionalConfigurations?: additionalParams): CometChatMessageTemplate;
77
77
  getAudioMessageTemplate(): CometChatMessageTemplate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cometchat/chat-uikit-react",
3
- "version": "6.0.4",
3
+ "version": "6.0.5",
4
4
  "description": "Ready-to-use Chat UI Components for React(Javascript/Web)",
5
5
  "author": "CometChat",
6
6
  "exports": {
@@ -8,7 +8,7 @@
8
8
  "./css-variables.css": "./dist/styles/css-variables.css"
9
9
  },
10
10
  "dependencies": {
11
- "@cometchat/chat-sdk-javascript": "^4.0.11",
11
+ "@cometchat/chat-sdk-javascript": "^4.0.12",
12
12
  "@rollup/plugin-json": "^6.1.0",
13
13
  "rxjs": "^7.8.1"
14
14
  },