@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.
- package/dist/index.d.ts +44 -53
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/CometChatMessageComposer.css +7 -0
- package/dist/styles/CometChatReactionList.css +1 -1
- package/dist/styles/components/CometChatMessageComposer.css +7 -0
- package/dist/styles/components/CometChatReactionList.css +1 -1
- package/dist/types/components/CometChatMessageComposer/useCometChatMessageComposer.d.ts +1 -0
- package/dist/types/components/CometChatMessageInformation/CometChatMessageInformation.d.ts +10 -0
- package/dist/types/components/CometChatThreadHeader/CometChatThreadHeader.d.ts +10 -0
- package/dist/types/events/CometChatUIEvents.d.ts +1 -0
- package/dist/types/modals/CometChatMessageTemplate.d.ts +3 -2
- package/dist/types/utils/DataSource.d.ts +1 -1
- package/dist/types/utils/DataSourceDecorator.d.ts +1 -1
- package/dist/types/utils/MessageReceiptUtils.d.ts +3 -30
- package/dist/types/utils/MessageUtils.d.ts +4 -3
- package/dist/types/utils/MessagesDataSource.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1113,6 +1113,18 @@ declare class CometChatMessageOption extends CometChatOption {
|
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
1115
1115
|
|
|
1116
|
+
/**
|
|
1117
|
+
* Class that handles the text formatting for URLs in CometChat.
|
|
1118
|
+
* CometChatUrlsFormatter is a child class of CometChatTextFormatter.
|
|
1119
|
+
* It extends the functionality of text formatting to specifically handle URLs.
|
|
1120
|
+
* It is used in extension decorators like link preview, message translation, and dataSource utils.
|
|
1121
|
+
*/
|
|
1122
|
+
declare class CometChatUrlsFormatter extends CometChatTextFormatter {
|
|
1123
|
+
constructor(regexPatterns: Array<RegExp>);
|
|
1124
|
+
protected onRegexMatch(inputText?: string | null): string;
|
|
1125
|
+
registerEventListeners(element: HTMLElement, classList: DOMTokenList): HTMLElement;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1116
1128
|
/**
|
|
1117
1129
|
* CometChatMessageTemplate is a pre-defined structure for creating message views
|
|
1118
1130
|
* that can be used as a starting point or blueprint for creating message views,
|
|
@@ -1131,7 +1143,7 @@ declare class CometChatMessageTemplate {
|
|
|
1131
1143
|
* and Video bubble based on the type of the message.
|
|
1132
1144
|
* @type {(message:CometChat.BaseMessage,alignment:MessageBubbleAlignment)=> Element | JSX.Element | null}
|
|
1133
1145
|
*/
|
|
1134
|
-
contentView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment) => Element | JSX.Element | null) | null;
|
|
1146
|
+
contentView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, textFormatters?: CometChatTextFormatter[]) => Element | JSX.Element | null) | null;
|
|
1135
1147
|
/**
|
|
1136
1148
|
* Custom component to customize the complete message bubble.
|
|
1137
1149
|
* By default, headerView, contentView and footerView collectively form a message bubble.
|
|
@@ -1160,7 +1172,7 @@ declare class CometChatMessageTemplate {
|
|
|
1160
1172
|
* By default, it displays the receipt and the timestamp.
|
|
1161
1173
|
* @type {(message:CometChat.BaseMessage,alignment:MessageBubbleAlignment)=> Element | JSX.Element | null}
|
|
1162
1174
|
*/
|
|
1163
|
-
statusInfoView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment,
|
|
1175
|
+
statusInfoView: ((message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject) => Element | JSX.Element | null) | null;
|
|
1164
1176
|
/**
|
|
1165
1177
|
* List of available actions that any user can perform on a message, like reacting,
|
|
1166
1178
|
* editing or deleting a message.
|
|
@@ -1246,18 +1258,6 @@ declare class ConversationUtils {
|
|
|
1246
1258
|
static getLastMessageCall(conversation: CometChat.Conversation): any;
|
|
1247
1259
|
}
|
|
1248
1260
|
|
|
1249
|
-
/**
|
|
1250
|
-
* Class that handles the text formatting for URLs in CometChat.
|
|
1251
|
-
* CometChatUrlsFormatter is a child class of CometChatTextFormatter.
|
|
1252
|
-
* It extends the functionality of text formatting to specifically handle URLs.
|
|
1253
|
-
* It is used in extension decorators like link preview, message translation, and dataSource utils.
|
|
1254
|
-
*/
|
|
1255
|
-
declare class CometChatUrlsFormatter extends CometChatTextFormatter {
|
|
1256
|
-
constructor(regexPatterns: Array<RegExp>);
|
|
1257
|
-
protected onRegexMatch(inputText?: string | null): string;
|
|
1258
|
-
registerEventListeners(element: HTMLElement, classList: DOMTokenList): HTMLElement;
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
1261
|
type ComposerId = {
|
|
1262
1262
|
parentMessageId: number | null;
|
|
1263
1263
|
user: string | null;
|
|
@@ -1298,7 +1298,7 @@ declare class MessagesDataSource implements DataSource {
|
|
|
1298
1298
|
* @param {CometChat.BaseMessage} item - The message bubble for which the receipt needs to be fetched
|
|
1299
1299
|
* @returns {JSX.Element | null} Returns JSX.Element for receipt of a message bubble or null
|
|
1300
1300
|
*/
|
|
1301
|
-
getBubbleStatusInfoReceipt: (item: CometChat$1.BaseMessage,
|
|
1301
|
+
getBubbleStatusInfoReceipt: (item: CometChat$1.BaseMessage, hideReceipts?: boolean) => JSX.Element | null;
|
|
1302
1302
|
/**
|
|
1303
1303
|
* Function for displaying the timestamp next to messages.
|
|
1304
1304
|
* @returns CalendarObject
|
|
@@ -1321,7 +1321,7 @@ declare class MessagesDataSource implements DataSource {
|
|
|
1321
1321
|
* @returns {JSX.Element | null} Returns JSX.Element for status and date of a message bubble or null
|
|
1322
1322
|
*/
|
|
1323
1323
|
getBubbleStatusInfoDate: (item: CometChat$1.BaseMessage, messageSentAtDateTimeFormat?: CalendarObject) => JSX.Element | null;
|
|
1324
|
-
getStatusInfoView: (_messageObject: CometChat$1.BaseMessage, _alignment: MessageBubbleAlignment,
|
|
1324
|
+
getStatusInfoView: (_messageObject: CometChat$1.BaseMessage, _alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject) => react_jsx_runtime.JSX.Element | null;
|
|
1325
1325
|
getBottomView(_messageObject: CometChat$1.BaseMessage, _alignment: MessageBubbleAlignment): null;
|
|
1326
1326
|
getTextMessageTemplate(additionalConfigurations?: additionalParams): CometChatMessageTemplate;
|
|
1327
1327
|
getAudioMessageTemplate(): CometChatMessageTemplate;
|
|
@@ -1885,7 +1885,7 @@ declare abstract class DataSource {
|
|
|
1885
1885
|
abstract getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
1886
1886
|
abstract getFileMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
1887
1887
|
abstract getBottomView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment): Element | JSX.Element | null;
|
|
1888
|
-
abstract getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment,
|
|
1888
|
+
abstract getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject): Element | JSX.Element | null;
|
|
1889
1889
|
abstract getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, otherParams: Object | undefined): Element | JSX.Element;
|
|
1890
1890
|
abstract getImageMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
|
|
1891
1891
|
abstract getVideoMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): Element | JSX.Element;
|
|
@@ -2088,7 +2088,7 @@ declare abstract class DataSourceDecorator implements DataSource {
|
|
|
2088
2088
|
getVideoMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
2089
2089
|
getAudioMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
2090
2090
|
getFileMessageOptions(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, group?: CometChat.Group, additionalParams?: Object | undefined): Array<CometChatActionsIcon | CometChatActionsView>;
|
|
2091
|
-
getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment,
|
|
2091
|
+
getStatusInfoView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment, hideReceipts?: boolean, messageSentAtDateTimeFormat?: CalendarObject): JSX.Element | Element | null;
|
|
2092
2092
|
getBottomView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignment): JSX.Element | Element | null;
|
|
2093
2093
|
getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: Object | undefined): JSX.Element | Element;
|
|
2094
2094
|
getImageMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignment): JSX.Element | Element;
|
|
@@ -2654,7 +2654,7 @@ declare class LinkPreviewExtensionDecorator extends DataSourceDecorator {
|
|
|
2654
2654
|
* @param {any} [additionalConfigurations] - Additional configurations for formatting.
|
|
2655
2655
|
* @returns {JSX.Element} The JSX element representing the message content view.
|
|
2656
2656
|
*/
|
|
2657
|
-
getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: any): JSX.Element | Element;
|
|
2657
|
+
getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: any): react_jsx_runtime.JSX.Element | Element;
|
|
2658
2658
|
/**
|
|
2659
2659
|
* Retrieves the style for the link preview wrapper.
|
|
2660
2660
|
* @returns {object} The style object for the link preview wrapper.
|
|
@@ -2748,7 +2748,7 @@ declare class MessageTranslationExtensionDecorator extends DataSourceDecorator {
|
|
|
2748
2748
|
* @param {any} [additionalConfigurations] - Optional additional configurations for the content view.
|
|
2749
2749
|
* @returns {JSX.Element} The content view for the text message.
|
|
2750
2750
|
*/
|
|
2751
|
-
getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: any): JSX.Element | Element;
|
|
2751
|
+
getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignment, additionalConfigurations?: any): react_jsx_runtime.JSX.Element | Element;
|
|
2752
2752
|
/**
|
|
2753
2753
|
* Checks if an option with the specified ID already exists in the options list.
|
|
2754
2754
|
*
|
|
@@ -4453,6 +4453,15 @@ interface MessageInformationProps {
|
|
|
4453
4453
|
* Template for customizing the appearance of the message.
|
|
4454
4454
|
*/
|
|
4455
4455
|
template?: CometChatMessageTemplate;
|
|
4456
|
+
/**
|
|
4457
|
+
* Hides the visibility of receipt in the Message Information.
|
|
4458
|
+
* @default false
|
|
4459
|
+
*/
|
|
4460
|
+
hideReceipts?: boolean;
|
|
4461
|
+
/**
|
|
4462
|
+
* Array of text formatters for custom styling or formatting of message text bubbles.
|
|
4463
|
+
*/
|
|
4464
|
+
textFormatters?: CometChatTextFormatter[];
|
|
4456
4465
|
}
|
|
4457
4466
|
declare const CometChatMessageInformation: (props: MessageInformationProps) => react_jsx_runtime.JSX.Element;
|
|
4458
4467
|
|
|
@@ -4645,6 +4654,7 @@ interface IOpenChat {
|
|
|
4645
4654
|
}
|
|
4646
4655
|
interface IShowOngoingCall {
|
|
4647
4656
|
child: any;
|
|
4657
|
+
message?: CometChat.CustomMessage;
|
|
4648
4658
|
}
|
|
4649
4659
|
interface IPanel {
|
|
4650
4660
|
child?: any;
|
|
@@ -5348,37 +5358,9 @@ declare class MessageReceiptUtils {
|
|
|
5348
5358
|
* the corresponding receipt icon.
|
|
5349
5359
|
*
|
|
5350
5360
|
* @param {CometChat.BaseMessage} messageObject - The message object for which to get the receipt status.
|
|
5351
|
-
* @returns {
|
|
5361
|
+
* @returns {Receipts} - The receipt status icon.
|
|
5352
5362
|
*/
|
|
5353
|
-
static getReceiptStatus: (messageObject: CometChat.BaseMessage) =>
|
|
5354
|
-
}
|
|
5355
|
-
/**
|
|
5356
|
-
* Enum representing different receipt statuses for a message.
|
|
5357
|
-
*
|
|
5358
|
-
* @readonly
|
|
5359
|
-
* @enum {number}
|
|
5360
|
-
*/
|
|
5361
|
-
declare enum receipts {
|
|
5362
|
-
/**
|
|
5363
|
-
* Status indicating that the message is waiting to be processed.
|
|
5364
|
-
*/
|
|
5365
|
-
wait = 0,
|
|
5366
|
-
/**
|
|
5367
|
-
* Status indicating that the message has been sent.
|
|
5368
|
-
*/
|
|
5369
|
-
sent = 1,
|
|
5370
|
-
/**
|
|
5371
|
-
* Status indicating that the message has been delivered.
|
|
5372
|
-
*/
|
|
5373
|
-
delivered = 2,
|
|
5374
|
-
/**
|
|
5375
|
-
* Status indicating that the message has been read.
|
|
5376
|
-
*/
|
|
5377
|
-
read = 3,
|
|
5378
|
-
/**
|
|
5379
|
-
* Status indicating that an error occurred with the message.
|
|
5380
|
-
*/
|
|
5381
|
-
error = 4
|
|
5363
|
+
static getReceiptStatus: (messageObject: CometChat.BaseMessage) => Receipts;
|
|
5382
5364
|
}
|
|
5383
5365
|
|
|
5384
5366
|
/**
|
|
@@ -5393,7 +5375,7 @@ declare class MessageUtils {
|
|
|
5393
5375
|
* @param {CometChatMessageTemplate} template - The message template to use for rendering the content view.
|
|
5394
5376
|
* @returns {object | null} - The content view for the message, or null if not found.
|
|
5395
5377
|
*/
|
|
5396
|
-
getContentView(message: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment?: MessageBubbleAlignment): any;
|
|
5378
|
+
getContentView(message: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment?: MessageBubbleAlignment, textFormatters?: CometChatTextFormatter[]): any;
|
|
5397
5379
|
/**
|
|
5398
5380
|
* Retrieves the content view for a message based on the provided template.
|
|
5399
5381
|
*
|
|
@@ -5401,7 +5383,7 @@ declare class MessageUtils {
|
|
|
5401
5383
|
* @param {CometChatMessageTemplate} template - The message template to use for rendering the content view.
|
|
5402
5384
|
* @returns {object | null} - The content view for the message, or null if not found.
|
|
5403
5385
|
*/
|
|
5404
|
-
getStatusInfoView(message: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment?: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject): any;
|
|
5386
|
+
getStatusInfoView(message: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment?: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject, hideReceipts?: boolean): any;
|
|
5405
5387
|
/**
|
|
5406
5388
|
* Retrieves the bubble wrapper for a message based on the provided template.
|
|
5407
5389
|
*
|
|
@@ -5419,7 +5401,7 @@ declare class MessageUtils {
|
|
|
5419
5401
|
* @param {MessageBubbleAlignment} alignment - The alignment of the message bubble (left or right).
|
|
5420
5402
|
* @returns {JSX.Element} - The message bubble component.
|
|
5421
5403
|
*/
|
|
5422
|
-
getMessageBubble(baseMessage: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject): any;
|
|
5404
|
+
getMessageBubble(baseMessage: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject, hideReceipts?: boolean, textFormatters?: CometChatTextFormatter[]): any;
|
|
5423
5405
|
/**
|
|
5424
5406
|
*
|
|
5425
5407
|
* @param {(CometChat.User | CometChat.GroupMember | any)} user
|
|
@@ -5901,6 +5883,15 @@ interface CometChatThreadHeaderProps {
|
|
|
5901
5883
|
* Format for the timestamp displayed next to messages.
|
|
5902
5884
|
*/
|
|
5903
5885
|
messageSentAtDateTimeFormat?: CalendarObject;
|
|
5886
|
+
/**
|
|
5887
|
+
* Hides the visibility of receipt in the Thread Header.
|
|
5888
|
+
* @default false
|
|
5889
|
+
*/
|
|
5890
|
+
hideReceipts?: boolean;
|
|
5891
|
+
/**
|
|
5892
|
+
* Array of text formatters for custom styling or formatting of message text bubbles.
|
|
5893
|
+
*/
|
|
5894
|
+
textFormatters?: CometChatTextFormatter[];
|
|
5904
5895
|
}
|
|
5905
5896
|
declare const CometChatThreadHeader: (props: CometChatThreadHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
5906
5897
|
|