@cometchat/chat-uikit-react-native 5.0.1 → 5.1.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/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +87 -41
- package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +10 -0
- package/ios/SoundPlayer.m +8 -0
- package/lib/CometChatMessageList/CometChatMessageList.js +1 -1
- package/lib/CometChatMessageList/CometChatMessageList.js.map +1 -1
- package/lib/extensions/Stickers/StickersExtensionDecorator.d.ts +1 -2
- package/lib/extensions/Stickers/StickersExtensionDecorator.js +1 -2
- package/lib/extensions/Stickers/StickersExtensionDecorator.js.map +1 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.d.ts +2 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.js +2 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.js.map +1 -1
- package/lib/shared/index.d.ts +15 -13
- package/lib/shared/index.js +30 -12
- package/lib/shared/index.js.map +1 -1
- package/lib/shared/utils/CometChatMessagePreview/CometChatMessagePreview.d.ts +10 -1
- package/lib/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js +8 -0
- package/lib/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js.map +1 -1
- package/lib/shared/utils/CometChatMessagePreview/MessagePreviewStyle.d.ts +29 -0
- package/lib/shared/utils/CometChatMessagePreview/MessagePreviewStyle.js +29 -0
- package/lib/shared/utils/CometChatMessagePreview/MessagePreviewStyle.js.map +1 -0
- package/lib/shared/utils/CometChatMessagePreview/index.d.ts +2 -1
- package/lib/shared/utils/CometChatMessagePreview/index.js +3 -1
- package/lib/shared/utils/CometChatMessagePreview/index.js.map +1 -1
- package/lib/shared/utils/CometChatMessagePreview/style.d.ts +16 -16
- package/lib/shared/utils/MessageUtils.js +11 -10
- package/lib/shared/utils/MessageUtils.js.map +1 -1
- package/lib/shared/utils/index.d.ts +2 -2
- package/lib/shared/utils/index.js +2 -2
- package/lib/shared/utils/index.js.map +1 -1
- package/lib/theme/context.js +1 -1
- package/lib/theme/context.js.map +1 -1
- package/lib/theme/default/index.d.ts +6 -0
- package/lib/theme/default/index.js +178 -0
- package/lib/theme/default/index.js.map +1 -1
- package/lib/theme/provider.js +1 -1
- package/lib/theme/provider.js.map +1 -1
- package/package.json +6 -4
- package/react-native-cometchat-ui-kit.podspec +1 -1
- package/src/CometChatConversations/CometChatConversations.tsx +34 -29
- package/src/CometChatConversations/style.ts +5 -2
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +56 -44
- package/src/CometChatGroups/CometChatGroups.tsx +13 -10
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +203 -57
- package/src/CometChatMessageComposer/styles.tsx +2 -6
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +8 -48
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +8 -14
- package/src/CometChatMessageList/CometChatMessageList.tsx +18 -10
- package/src/CometChatMessageList/style.ts +0 -16
- package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +3 -2
- package/src/CometChatUsers/CometChatUsers.tsx +9 -8
- package/src/calls/CallUtils.ts +14 -14
- package/src/calls/CallingExtensionDecorator.tsx +13 -12
- package/src/calls/CometChatCallBubble/CometChatCallBubble.tsx +4 -3
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +15 -12
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +8 -6
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +4 -2
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +7 -6
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +7 -6
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +3 -2
- package/src/extensions/MessageTranslation/MessageTranslationBubble.tsx +3 -2
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +26 -17
- package/src/extensions/Polls/Polls.tsx +53 -17
- package/src/extensions/Polls/PollsDecorator.tsx +5 -3
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +5 -4
- package/src/extensions/Stickers/CometChatStickerKeyboard/hooks.ts +3 -2
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +5 -2
- package/src/index.ts +10 -4
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +1 -2
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +116 -32
- package/src/shared/framework/DataSource.ts +5 -2
- package/src/shared/framework/DataSourceDecorator.tsx +4 -4
- package/src/shared/framework/MessageDataSource.tsx +178 -46
- package/src/shared/helper/LocalizedDateHelper.ts +317 -0
- package/src/shared/helper/functions.js +69 -1
- package/src/shared/helper/useLocalizedDateHook.tsx +16 -0
- package/src/shared/index.ts +7 -2
- package/src/shared/resources/CometChatLocalizeNew/CometChatI18nProvider.tsx +106 -0
- package/src/shared/resources/CometChatLocalizeNew/CometChatLocalizationHelper.ts +99 -0
- package/src/shared/resources/CometChatLocalizeNew/CometChatLocalizeContext.tsx +15 -0
- package/src/shared/resources/CometChatLocalizeNew/LocalizationManager.ts +65 -0
- package/src/shared/resources/CometChatLocalizeNew/index.ts +25 -0
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/de/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/en/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/es/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/fr/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/hi/translation.json +11 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/hu/translation.json +10 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +456 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +456 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +456 -0
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/lt/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/ms/translation.json +10 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +456 -0
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/pt/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/ru/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/sv/translation.json +11 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +456 -0
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/zh/translation.json +11 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/zh-tw/translation.json +10 -1
- package/src/shared/resources/CometChatLocalizeNew/type.ts +7 -0
- package/src/shared/resources/CometChatLocalizeNew/useCometChatTranslationHook.ts +24 -0
- package/src/shared/resources/index.ts +2 -2
- package/src/shared/utils/CommonUtils.ts +2 -1
- package/src/shared/utils/PermissionUtil.ts +5 -4
- package/src/shared/utils/conversationUtils.ts +11 -9
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +8 -5
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +1 -1
- package/src/shared/views/CometChatDate/CometChatDate.tsx +17 -14
- package/src/shared/views/CometChatDateSeperator/CometChatDateSeparator.tsx +6 -4
- package/src/shared/views/CometChatDeletedBubble/CometChatDeletedBubble.tsx +3 -2
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +11 -8
- package/src/shared/views/CometChatList/CometChatList.tsx +5 -4
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPreview/CometChatAudioPreview.tsx +15 -9
- package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +5 -4
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +3 -2
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +7 -6
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +10 -7
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +1 -0
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +24 -47
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +68 -73
- package/src/theme/type.ts +0 -2
- package/lib/theme/default/default.d.ts +0 -6
- package/lib/theme/default/default.js +0 -179
- package/lib/theme/default/default.js.map +0 -1
- package/src/shared/resources/CometChatLocalize/CometChatLocalize.ts +0 -183
- package/src/shared/resources/CometChatLocalize/index.ts +0 -3
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +0 -447
|
@@ -11,7 +11,7 @@ import { StickersExtension } from "../../extensions/Stickers";
|
|
|
11
11
|
import { ThumbnailGenerationExtension } from "../../extensions/ThumbnailGeneration";
|
|
12
12
|
import { ListenerInitializer } from "../events/ListenerInitializer";
|
|
13
13
|
import { ChatConfigurator, ExtensionsDataSource } from "../framework";
|
|
14
|
-
import {
|
|
14
|
+
import { CometChatSoundManager } from "../resources";
|
|
15
15
|
import { getUnixTimestampInMilliseconds, messageStatus } from "../utils/CometChatMessageHelper";
|
|
16
16
|
import { permissionUtil } from "../utils/PermissionUtil";
|
|
17
17
|
import { CometChatUIKitHelper } from "./CometChatUIKitHelper";
|
|
@@ -380,5 +380,4 @@ export class CometChatUIKit {
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
static SoundManager: typeof CometChatSoundManager = CometChatSoundManager;
|
|
383
|
-
static Localize: typeof CometChatLocalize = CometChatLocalize;
|
|
384
383
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
2
2
|
import React, { JSX } from "react";
|
|
3
|
-
import { StyleProp, Text, TextStyle
|
|
3
|
+
import { ColorValue, StyleProp, Text, TextStyle } from "react-native";
|
|
4
4
|
import { CometChatUIKit } from "../../CometChatUiKit";
|
|
5
5
|
import {
|
|
6
6
|
MentionsTargetElement,
|
|
@@ -8,16 +8,38 @@ import {
|
|
|
8
8
|
MentionsVisibility,
|
|
9
9
|
} from "../../constants/UIKitConstants";
|
|
10
10
|
import { CometChatUIEventHandler, CometChatUIEvents } from "../../events";
|
|
11
|
-
import { localize } from "../../resources";
|
|
12
11
|
import { SuggestionItem } from "../../views/CometChatSuggestionList";
|
|
13
12
|
import { CometChatTextFormatter } from "../CometChatTextFormatter";
|
|
14
13
|
import { CometChatTheme } from "../../../theme/type";
|
|
14
|
+
import { deepMerge } from "../../helper/helperFunctions";
|
|
15
|
+
import { getCometChatTranslation } from "../../../shared";
|
|
16
|
+
|
|
17
|
+
const t = getCometChatTranslation();
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* Represents the CometChatMentionsFormatter class.
|
|
18
21
|
* This class extends the CometChatTextFormatter class and provides methods for handling mentions in text.
|
|
19
22
|
* @extends CometChatTextFormatter
|
|
20
23
|
*/
|
|
24
|
+
|
|
25
|
+
type MentionsSubStyle = {
|
|
26
|
+
textStyle?: TextStyle;
|
|
27
|
+
selfTextStyle?: TextStyle;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type MentionContext = "composer" | "conversation" | "incoming" | "outgoing";
|
|
31
|
+
|
|
32
|
+
function isCometChatTheme(t: unknown): t is CometChatTheme {
|
|
33
|
+
return (
|
|
34
|
+
!!t &&
|
|
35
|
+
typeof t === "object" &&
|
|
36
|
+
"typography" in t &&
|
|
37
|
+
"color" in t &&
|
|
38
|
+
typeof (t as any).typography === "object" &&
|
|
39
|
+
typeof (t as any).color === "object"
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
21
43
|
export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
22
44
|
/**
|
|
23
45
|
* List of users for mentions.
|
|
@@ -44,6 +66,29 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
44
66
|
*/
|
|
45
67
|
private customRequest?: CometChat.UsersRequestBuilder | CometChat.GroupMembersRequestBuilder;
|
|
46
68
|
|
|
69
|
+
private composerStyle: MentionsSubStyle;
|
|
70
|
+
private conversationStyle: MentionsSubStyle;
|
|
71
|
+
private incomingBubbleStyle: MentionsSubStyle;
|
|
72
|
+
private outgoingBubbleStyle: MentionsSubStyle;
|
|
73
|
+
private currentContext: MentionContext = "incoming";
|
|
74
|
+
private resolveStyle(isSelf: boolean): TextStyle {
|
|
75
|
+
let style: MentionsSubStyle;
|
|
76
|
+
switch (this.currentContext) {
|
|
77
|
+
case "composer":
|
|
78
|
+
style = this.composerStyle;
|
|
79
|
+
break;
|
|
80
|
+
case "conversation":
|
|
81
|
+
style = this.conversationStyle;
|
|
82
|
+
break;
|
|
83
|
+
case "outgoing":
|
|
84
|
+
style = this.outgoingBubbleStyle;
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
style = this.incomingBubbleStyle;
|
|
88
|
+
}
|
|
89
|
+
return isSelf ? (style.selfTextStyle ?? {}) : (style.textStyle ?? {});
|
|
90
|
+
}
|
|
91
|
+
|
|
47
92
|
/**
|
|
48
93
|
* Limit of unique users to be added in the composer.
|
|
49
94
|
*/
|
|
@@ -76,11 +121,33 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
76
121
|
* Initializes a new CometChatMentionsFormatter.
|
|
77
122
|
* @param {CometChat.User} loggedInUser - The user who is currently logged in.
|
|
78
123
|
*/
|
|
79
|
-
constructor(loggedInUser?: CometChat.User) {
|
|
124
|
+
constructor(themeOrUser?: CometChatTheme | CometChat.User, loggedInUser?: CometChat.User) {
|
|
80
125
|
super();
|
|
81
126
|
this.regexPattern = /<@uid:(.*?)>/g;
|
|
82
127
|
this.trackCharacter = "@";
|
|
83
|
-
|
|
128
|
+
|
|
129
|
+
const theme = isCometChatTheme(themeOrUser) ? themeOrUser : undefined;
|
|
130
|
+
this.loggedInUser = isCometChatTheme(themeOrUser)
|
|
131
|
+
? loggedInUser
|
|
132
|
+
: (themeOrUser as CometChat.User | undefined);
|
|
133
|
+
|
|
134
|
+
const fallback: MentionsSubStyle = {
|
|
135
|
+
textStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#6852D6" },
|
|
136
|
+
selfTextStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#FFAB00" },
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const fromTheme = (c: ColorValue): MentionsSubStyle => {
|
|
140
|
+
const baseStyle = theme?.typography?.body?.bold || {};
|
|
141
|
+
return {
|
|
142
|
+
textStyle: { ...baseStyle, color: c },
|
|
143
|
+
selfTextStyle: { ...baseStyle, color: theme?.color?.warning || "#FFAB00" },
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
this.incomingBubbleStyle = theme ? fromTheme(theme.color.receiveBubbleTextHighlight) : fallback;
|
|
148
|
+
this.outgoingBubbleStyle = theme ? fromTheme(theme.color.sendBubbleTextHighlight) : fallback;
|
|
149
|
+
this.composerStyle = this.incomingBubbleStyle; // reasonable defaults
|
|
150
|
+
this.conversationStyle = this.incomingBubbleStyle;
|
|
84
151
|
}
|
|
85
152
|
|
|
86
153
|
/**
|
|
@@ -282,13 +349,38 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
282
349
|
return this.mentionsStyle;
|
|
283
350
|
}
|
|
284
351
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
this
|
|
352
|
+
setComposerMentionStyle(s: MentionsSubStyle) {
|
|
353
|
+
this.composerStyle = deepMerge(this.composerStyle, s);
|
|
354
|
+
return this;
|
|
355
|
+
}
|
|
356
|
+
setConversationMentionStyle(s: MentionsSubStyle) {
|
|
357
|
+
this.conversationStyle = deepMerge(this.conversationStyle, s);
|
|
358
|
+
return this;
|
|
359
|
+
}
|
|
360
|
+
setIncomingBubbleMentionStyle(s: MentionsSubStyle) {
|
|
361
|
+
this.incomingBubbleStyle = deepMerge(this.incomingBubbleStyle, s);
|
|
362
|
+
return this;
|
|
363
|
+
}
|
|
364
|
+
setOutgoingBubbleMentionStyle(s: MentionsSubStyle) {
|
|
365
|
+
this.outgoingBubbleStyle = deepMerge(this.outgoingBubbleStyle, s);
|
|
366
|
+
return this;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/** maintain back-compat */
|
|
370
|
+
setMentionsStyle(patch?: CometChatTheme["mentionsStyle"]) {
|
|
371
|
+
if (!patch) return this;
|
|
372
|
+
const apply = (dst: MentionsSubStyle) => deepMerge(dst, patch);
|
|
373
|
+
this.setIncomingBubbleMentionStyle(apply(this.incomingBubbleStyle))
|
|
374
|
+
.setOutgoingBubbleMentionStyle(apply(this.outgoingBubbleStyle))
|
|
375
|
+
.setComposerMentionStyle(apply(this.composerStyle))
|
|
376
|
+
.setConversationMentionStyle(apply(this.conversationStyle));
|
|
377
|
+
return this;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** called from data-sources */
|
|
381
|
+
setContext(ctx: MentionContext) {
|
|
382
|
+
this.currentContext = ctx;
|
|
383
|
+
return this;
|
|
292
384
|
}
|
|
293
385
|
|
|
294
386
|
getFormattedText(
|
|
@@ -319,19 +411,6 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
319
411
|
this.temp(this.messageObject, uid);
|
|
320
412
|
return;
|
|
321
413
|
}
|
|
322
|
-
|
|
323
|
-
// let obj = { uid, trackCharacter: this.trackCharacter };
|
|
324
|
-
// CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.ccMentionClick, {
|
|
325
|
-
// item: {
|
|
326
|
-
// body: {
|
|
327
|
-
// CometChatUserGroupMembersObject: obj,
|
|
328
|
-
// message: this.messageObject ?? null,
|
|
329
|
-
// id: uid,
|
|
330
|
-
// },
|
|
331
|
-
// // event,
|
|
332
|
-
// source: "mentions", //add through enum
|
|
333
|
-
// }
|
|
334
|
-
// });
|
|
335
414
|
};
|
|
336
415
|
|
|
337
416
|
/**
|
|
@@ -361,7 +440,7 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
361
440
|
// Break the string into segments split by the regex
|
|
362
441
|
let match;
|
|
363
442
|
let lastIndex = 0;
|
|
364
|
-
let segments
|
|
443
|
+
let segments: any[] = [];
|
|
365
444
|
|
|
366
445
|
while ((match = regex.exec(inputText)) !== null) {
|
|
367
446
|
// Add preceding non-UID segment, if any
|
|
@@ -387,10 +466,15 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
387
466
|
if (userRegistry.hasOwnProperty(segment)) {
|
|
388
467
|
let _loggedInUser = this.loggedInUser || CometChatUIKit.loggedInUser;
|
|
389
468
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
469
|
+
const isSelf = _loggedInUser?.getUid() === segment;
|
|
470
|
+
const isOutgoing =
|
|
471
|
+
this.messageObject?.getSender()?.getUid() === _loggedInUser?.getUid();
|
|
472
|
+
|
|
473
|
+
if (this.target === MentionsTargetElement.textbubble) {
|
|
474
|
+
// Only for bubbles – keep whatever was set for conversation & composer
|
|
475
|
+
this.setContext(isOutgoing ? "outgoing" : "incoming");
|
|
476
|
+
}
|
|
477
|
+
const textStyle = this.resolveStyle(isSelf);
|
|
394
478
|
let onPressProp = this.temp
|
|
395
479
|
? { onPress: (event: any) => this.onMentionClick(event, segment) }
|
|
396
480
|
: {};
|
|
@@ -487,8 +571,8 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
487
571
|
}
|
|
488
572
|
|
|
489
573
|
getErrorString() {
|
|
490
|
-
return `${
|
|
491
|
-
this.limit === 1 ?
|
|
492
|
-
} ${
|
|
574
|
+
return `${t("MENTION_UPTO")} ${this.limit} ${
|
|
575
|
+
this.limit === 1 ? t("TIME") : t("TIMES")
|
|
576
|
+
} ${t("AT_A_TIME")}.`;
|
|
493
577
|
}
|
|
494
578
|
}
|
|
@@ -225,7 +225,10 @@ export interface DataSource {
|
|
|
225
225
|
additionalAuxiliaryHeaderOptionsParams?: AdditionalAuxiliaryHeaderOptionsParams
|
|
226
226
|
): JSX.Element | null;
|
|
227
227
|
|
|
228
|
-
getAllTextFormatters(loggedInUser?: CometChat.User): CometChatTextFormatter[];
|
|
229
|
-
getMentionsFormatter(
|
|
228
|
+
getAllTextFormatters(loggedInUser?: CometChat.User, theme?: CometChatTheme): CometChatTextFormatter[];
|
|
229
|
+
getMentionsFormatter(
|
|
230
|
+
loggedInUser?: CometChat.User,
|
|
231
|
+
theme?: CometChatTheme
|
|
232
|
+
): CometChatMentionsFormatter;
|
|
230
233
|
getUrlsFormatter(loggedInUser?: CometChat.User): CometChatUrlsFormatter;
|
|
231
234
|
}
|
|
@@ -304,15 +304,15 @@ export class DataSourceDecorator implements DataSource {
|
|
|
304
304
|
return this.dataSource.getAuxiliaryHeaderAppbarOptions(user, group, additionalAuxiliaryHeaderOptionsParams);
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
getAllTextFormatters(loggedInUser?: CometChat.User): CometChatTextFormatter[] {
|
|
307
|
+
getAllTextFormatters(loggedInUser?: CometChat.User, theme?: CometChatTheme): CometChatTextFormatter[] {
|
|
308
308
|
return [
|
|
309
|
-
this.dataSource.getMentionsFormatter(loggedInUser),
|
|
309
|
+
this.dataSource.getMentionsFormatter(loggedInUser, theme),
|
|
310
310
|
this.dataSource.getUrlsFormatter(loggedInUser),
|
|
311
311
|
];
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
-
getMentionsFormatter(loggedInUser?: CometChat.User): CometChatMentionsFormatter {
|
|
315
|
-
return this.dataSource.getMentionsFormatter(loggedInUser);
|
|
314
|
+
getMentionsFormatter(loggedInUser?: CometChat.User, theme?: CometChatTheme): CometChatMentionsFormatter {
|
|
315
|
+
return this.dataSource.getMentionsFormatter(loggedInUser, theme);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
getUrlsFormatter(loggedInUser?: CometChat.User): CometChatUrlsFormatter {
|