@cometchat/chat-uikit-react-native 5.2.11 → 5.3.1
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/build.gradle +3 -0
- package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +4 -1
- package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +909 -10
- package/android/src/main/java/com/reactnativecometchatuikit/RichTextEditorPackage.kt +24 -0
- package/android/src/main/java/com/reactnativecometchatuikit/RichTextEditorView.kt +5382 -0
- package/android/src/main/java/com/reactnativecometchatuikit/RichTextEditorViewManager.kt +452 -0
- package/ios/FileManager.m +430 -3
- package/ios/RichTextEditorView.swift +5504 -0
- package/ios/RichTextEditorViewManager.m +66 -0
- package/ios/RichTextEditorViewManager.swift +291 -0
- package/ios/ToolbarIcons.swift +736 -0
- package/package.json +1 -1
- package/react-native-cometchat-ui-kit.podspec +1 -1
- package/src/CometChatCompactMessageComposer/CometChatCompactMessageComposer.tsx +4602 -0
- package/src/CometChatCompactMessageComposer/SingleLineTextComposerConfiguration.tsx +568 -0
- package/src/CometChatCompactMessageComposer/heightUtils.ts +204 -0
- package/src/CometChatCompactMessageComposer/index.ts +56 -0
- package/src/CometChatCompactMessageComposer/resources/index.ts +5 -0
- package/src/CometChatCompactMessageComposer/styles.ts +291 -0
- package/src/CometChatConversations/CometChatConversations.tsx +141 -14
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +6 -0
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +1 -20
- package/src/CometChatMessageComposer/styles.tsx +0 -1
- package/src/CometChatMessageList/CometChatMessageList.tsx +76 -30
- package/src/CometChatRichTextEditor/RichTextEditorViewNativeComponent.ts +105 -0
- package/src/CometChatRichTextEditor/index.tsx +385 -0
- package/src/CometChatRichTextEditor/types.ts +162 -0
- package/src/CometChatSearch/CometChatSearch.tsx +35 -29
- package/src/calls/CallUtils.ts +4 -4
- package/src/index.ts +48 -1
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +2 -0
- package/src/shared/constants/UIKitConstants.ts +12 -1
- package/src/shared/events/ListenerInitializer.ts +6 -0
- package/src/shared/events/messages.ts +2 -0
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +5 -5
- package/src/shared/formatters/CometChatRichTextFormatter/index.tsx +768 -0
- package/src/shared/formatters/index.ts +3 -0
- package/src/shared/framework/MessageDataSource.tsx +93 -2
- package/src/shared/helper/composerHelpers.ts +553 -0
- package/src/shared/helper/useKeyboard.tsx +7 -17
- package/src/shared/icons/components/code-blocks.tsx +13 -0
- package/src/shared/icons/components/code.tsx +11 -0
- package/src/shared/icons/components/format-bold.tsx +11 -0
- package/src/shared/icons/components/format-italic.tsx +11 -0
- package/src/shared/icons/components/format-list-bulleted.tsx +11 -0
- package/src/shared/icons/components/format-list-numbered.tsx +11 -0
- package/src/shared/icons/components/format-quote.tsx +13 -0
- package/src/shared/icons/components/format-strikethrough.tsx +13 -0
- package/src/shared/icons/components/format-underlined.tsx +11 -0
- package/src/shared/icons/components/smileys-&-people.tsx +1 -1
- package/src/shared/icons/icon-mapping.tsx +18 -0
- package/src/shared/index.ts +54 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/de/translation.json +37 -32
- package/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json +5 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/es/translation.json +17 -12
- package/src/shared/resources/CometChatLocalizeNew/resources/fr/translation.json +505 -500
- package/src/shared/resources/CometChatLocalizeNew/resources/hi/translation.json +18 -13
- package/src/shared/resources/CometChatLocalizeNew/resources/hu/translation.json +17 -12
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +504 -499
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +504 -499
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +504 -499
- package/src/shared/resources/CometChatLocalizeNew/resources/lt/translation.json +18 -13
- package/src/shared/resources/CometChatLocalizeNew/resources/ms/translation.json +17 -12
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +505 -500
- package/src/shared/resources/CometChatLocalizeNew/resources/pt/translation.json +17 -12
- package/src/shared/resources/CometChatLocalizeNew/resources/ru/translation.json +17 -12
- package/src/shared/resources/CometChatLocalizeNew/resources/sv/translation.json +18 -13
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +505 -500
- package/src/shared/resources/CometChatLocalizeNew/resources/zh/translation.json +17 -12
- package/src/shared/resources/CometChatLocalizeNew/resources/zh-tw/translation.json +18 -13
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +132 -11
- package/src/shared/utils/CometChatMessagePreview/style.ts +1 -3
- package/src/shared/utils/CommonUtils.ts +18 -1
- package/src/shared/utils/MarkdownUtils.ts +143 -0
- package/src/shared/utils/MentionUtils.ts +37 -0
- package/src/shared/utils/MessageReceiptUtils.ts +5 -4
- package/src/shared/utils/MessageUtils.tsx +5 -3
- package/src/shared/utils/index.ts +5 -0
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +1 -1
- package/src/shared/views/CometChatInlineAudioRecorder/AudioWaveformVisualizer.tsx +417 -0
- package/src/shared/views/CometChatInlineAudioRecorder/CometChatInlineAudioRecorder.tsx +537 -0
- package/src/shared/views/CometChatInlineAudioRecorder/index.ts +34 -0
- package/src/shared/views/CometChatInlineAudioRecorder/style.ts +155 -0
- package/src/shared/views/CometChatInlineAudioRecorder/types.ts +303 -0
- package/src/shared/views/CometChatInlineAudioRecorder/useAudioRecorder.ts +1336 -0
- package/src/shared/views/CometChatLinkConfirmPopup/CometChatLinkConfirmPopup.tsx +183 -0
- package/src/shared/views/CometChatLinkConfirmPopup/index.ts +13 -0
- package/src/shared/views/CometChatLinkConfirmPopup/style.ts +128 -0
- package/src/shared/views/CometChatList/Header.tsx +2 -1
- package/src/shared/views/CometChatListItem/style.ts +1 -0
- package/src/shared/views/CometChatSendButtonView/CometChatSendButtonView.tsx +32 -29
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +64 -16
- package/src/shared/views/index.ts +39 -0
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
ActionItemInterface,
|
|
5
5
|
AdditionalParams,
|
|
6
|
+
AudioWaveformVisualizerProps,
|
|
6
7
|
//Add Call events here already exposed in Calls
|
|
7
8
|
//Framework
|
|
8
9
|
ChatConfigurator,
|
|
@@ -27,6 +28,9 @@ import {
|
|
|
27
28
|
CometChatGroupsEvents,
|
|
28
29
|
CometChatImageBubble,
|
|
29
30
|
CometChatImageBubbleInterface,
|
|
31
|
+
CometChatInlineAudioRecorder,
|
|
32
|
+
CometChatInlineAudioRecorderProps,
|
|
33
|
+
CometChatInlineAudioRecorderStyle,
|
|
30
34
|
CometChatListActionsInterface,
|
|
31
35
|
//View
|
|
32
36
|
CometChatListItem,
|
|
@@ -62,6 +66,8 @@ import {
|
|
|
62
66
|
CometChatUIKitHelper,
|
|
63
67
|
CometChatUiKitConstants,
|
|
64
68
|
CometChatUrlsFormatter,
|
|
69
|
+
CometChatRichTextFormatter,
|
|
70
|
+
RichTextStyle,
|
|
65
71
|
CometChatVideoBubble,
|
|
66
72
|
CometChatVideoBubbleInterface,
|
|
67
73
|
ConversationType,
|
|
@@ -74,9 +80,12 @@ import {
|
|
|
74
80
|
MessageEvents,
|
|
75
81
|
MessageListAlignmentType,
|
|
76
82
|
MessageTimeAlignmentType,
|
|
83
|
+
RecorderState,
|
|
77
84
|
SelectionMode,
|
|
78
85
|
SuggestionItem,
|
|
79
86
|
UIKitSettings,
|
|
87
|
+
UseAudioRecorderReturn,
|
|
88
|
+
WaveformStyle,
|
|
80
89
|
messageStatus,
|
|
81
90
|
Icon,
|
|
82
91
|
MenuItemInterface,
|
|
@@ -120,6 +129,12 @@ import {
|
|
|
120
129
|
CometChatMessageComposerInterface,
|
|
121
130
|
} from "./CometChatMessageComposer";
|
|
122
131
|
|
|
132
|
+
import {
|
|
133
|
+
CometChatCompactMessageComposer,
|
|
134
|
+
CometChatCompactMessageComposerInterface,
|
|
135
|
+
SingleLineMessageComposerStyleInterface,
|
|
136
|
+
} from "./CometChatCompactMessageComposer";
|
|
137
|
+
|
|
123
138
|
import { CometChatAIAssistantChatHistory } from "./CometChatAIAssistantChatHistory";
|
|
124
139
|
|
|
125
140
|
import { CometChatThreadHeader, CometChatThreadHeaderInterface } from "./CometChatThreadHeader";
|
|
@@ -210,6 +225,7 @@ export {
|
|
|
210
225
|
CometChatAIAssistantChatHistory,
|
|
211
226
|
CometChatImageBubble,
|
|
212
227
|
CometChatIncomingCall,
|
|
228
|
+
CometChatInlineAudioRecorder,
|
|
213
229
|
//
|
|
214
230
|
//
|
|
215
231
|
CometChatListItem,
|
|
@@ -219,6 +235,7 @@ export {
|
|
|
219
235
|
/* Text Formatters */
|
|
220
236
|
CometChatMentionsFormatter,
|
|
221
237
|
CometChatMessageComposer,
|
|
238
|
+
CometChatCompactMessageComposer,
|
|
222
239
|
CometChatMessageInformation,
|
|
223
240
|
CometChatMessageList,
|
|
224
241
|
CometChatMessagePreview,
|
|
@@ -245,6 +262,8 @@ export {
|
|
|
245
262
|
CometChatUIKitHelper,
|
|
246
263
|
CometChatUiKitConstants,
|
|
247
264
|
CometChatUrlsFormatter,
|
|
265
|
+
CometChatRichTextFormatter,
|
|
266
|
+
RichTextStyle,
|
|
248
267
|
CometChatUsers,
|
|
249
268
|
CometChatVideoBubble,
|
|
250
269
|
DataSourceDecorator,
|
|
@@ -305,6 +324,8 @@ export type {
|
|
|
305
324
|
CometChatGroupMembersInterface,
|
|
306
325
|
CometChatFileBubbleInterface,
|
|
307
326
|
CometChatImageBubbleInterface,
|
|
327
|
+
CometChatInlineAudioRecorderProps,
|
|
328
|
+
CometChatInlineAudioRecorderStyle,
|
|
308
329
|
CometChatListActionsInterface,
|
|
309
330
|
CometChatListItemInterface,
|
|
310
331
|
CometChatListStylesInterface,
|
|
@@ -313,10 +334,12 @@ export type {
|
|
|
313
334
|
CometChatMessageListActionsInterface,
|
|
314
335
|
CometChatMessageListInterface,
|
|
315
336
|
CometChatMessageComposerInterface,
|
|
316
|
-
|
|
337
|
+
CometChatCompactMessageComposerInterface,
|
|
338
|
+
SingleLineMessageComposerStyleInterface,
|
|
317
339
|
CometChatMessageOption,
|
|
318
340
|
ActionItemInterface,
|
|
319
341
|
AdditionalParams,
|
|
342
|
+
AudioWaveformVisualizerProps,
|
|
320
343
|
SelectionMode,
|
|
321
344
|
CometChatReactionsInterface,
|
|
322
345
|
CometChatReactionListInterface,
|
|
@@ -340,12 +363,36 @@ export type {
|
|
|
340
363
|
ConversationInterface,
|
|
341
364
|
LinkPreviewBubbleInterface,
|
|
342
365
|
PollsConfigurationInterface,
|
|
366
|
+
RecorderState,
|
|
343
367
|
StickerConfigurationInterface,
|
|
344
368
|
ConversationType,
|
|
345
369
|
DataSource,
|
|
346
370
|
MessageListAlignmentType,
|
|
347
371
|
MessageTimeAlignmentType,
|
|
348
372
|
MessageBubbleAlignmentType,
|
|
373
|
+
UseAudioRecorderReturn,
|
|
374
|
+
WaveformStyle,
|
|
349
375
|
CometChatTheme,
|
|
350
376
|
MenuItemInterface
|
|
351
377
|
};
|
|
378
|
+
|
|
379
|
+
// Rich Text Editor
|
|
380
|
+
export { default as RichTextEditor } from './CometChatRichTextEditor';
|
|
381
|
+
export type {
|
|
382
|
+
RichTextEditorRef,
|
|
383
|
+
ContentChangeEvent,
|
|
384
|
+
ActiveStylesState,
|
|
385
|
+
RichTextEditorProps,
|
|
386
|
+
RichTextEditorPropsExtended,
|
|
387
|
+
} from './CometChatRichTextEditor';
|
|
388
|
+
export type {
|
|
389
|
+
Selection,
|
|
390
|
+
StyleRange,
|
|
391
|
+
Block,
|
|
392
|
+
BlockType,
|
|
393
|
+
TextAlignment,
|
|
394
|
+
EditorVariant,
|
|
395
|
+
ToolbarOption,
|
|
396
|
+
SelectionChangeEvent,
|
|
397
|
+
RichTextEditorRef as RichTextEditorRefType,
|
|
398
|
+
} from './CometChatRichTextEditor/types';
|
|
@@ -199,6 +199,8 @@ export class CometChatUIKit {
|
|
|
199
199
|
}
|
|
200
200
|
if (authToken) {
|
|
201
201
|
let user = await CometChat.login(authToken).catch((e) => Promise.reject(e));
|
|
202
|
+
CometChatUIKit.setLoggedInUser(user);
|
|
203
|
+
CometChatUIKit.setConversationUpdateSettings(await CometChat.getConversationUpdateSettings());
|
|
202
204
|
this.enableExtensions();
|
|
203
205
|
return user;
|
|
204
206
|
}
|
|
@@ -61,7 +61,8 @@ export const emailPattern =
|
|
|
61
61
|
wordBoundary.start + `[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}` + wordBoundary.end;
|
|
62
62
|
|
|
63
63
|
export const urlPattern =
|
|
64
|
-
`((https?://|www\\.|pic\\.)[-\\w;/?:@&=+$\\|\\_.!~*\\|'()\\[\\]%#,☺]+[\\w/#](\\(\\))
|
|
64
|
+
`((https?://|ftp://|www\\.|pic\\.)[-\\w;/?:@&=+$\\|\\_.!~*\\|'()\\[\\]%#,☺]+[\\w/#](\\(\\))?` +
|
|
65
|
+
`|[a-zA-Z0-9][-a-zA-Z0-9]*(?:\\.[a-zA-Z0-9][-a-zA-Z0-9]*)*\\.[a-zA-Z]{2,}(?:[:/][-\\w;/?:@&=+$\\|\\_.!~*\\|'()\\[\\]%#,☺]*[\\w/#](\\(\\))?)?)` +
|
|
65
66
|
wordBoundary.end;
|
|
66
67
|
|
|
67
68
|
export const phoneNumPattern =
|
|
@@ -452,3 +453,13 @@ export enum MentionsTargetElement {
|
|
|
452
453
|
textbubble,
|
|
453
454
|
conversation,
|
|
454
455
|
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Enum for Enter key behavior in the composer.
|
|
459
|
+
* On iOS, Enter always inserts a new line regardless of this setting.
|
|
460
|
+
* @platform Android
|
|
461
|
+
*/
|
|
462
|
+
export enum EnterKeyBehavior {
|
|
463
|
+
SendMessage = "sendMessage",
|
|
464
|
+
NewLine = "newLine",
|
|
465
|
+
}
|
|
@@ -90,6 +90,12 @@ export class ListenerInitializer {
|
|
|
90
90
|
},
|
|
91
91
|
onMessageModerated: (message: CometChat.BaseMessage) => {
|
|
92
92
|
CometChatUIEventHandler.emitMessageEvent(MessageEvents.onMessageModerated, message);
|
|
93
|
+
},
|
|
94
|
+
onMessagesDeliveredToAll: (messageReceipt: CometChat.MessageReceipt) => {
|
|
95
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.onMessagesDeliveredToAll, messageReceipt);
|
|
96
|
+
},
|
|
97
|
+
onMessagesReadByAll: (messageReceipt: CometChat.MessageReceipt) => {
|
|
98
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.onMessagesReadByAll, messageReceipt);
|
|
93
99
|
}
|
|
94
100
|
});
|
|
95
101
|
}
|
|
@@ -26,4 +26,6 @@ export enum MessageEvents {
|
|
|
26
26
|
onMessageReactionRemoved = "onMessageReactionRemoved",
|
|
27
27
|
onMessageModerated = "onMessageModerated",
|
|
28
28
|
onAIAssistantMessageReceived = "onAIAssistantMessageReceived",
|
|
29
|
+
onMessagesDeliveredToAll = "onMessagesDeliveredToAll",
|
|
30
|
+
onMessagesReadByAll = "onMessagesReadByAll",
|
|
29
31
|
}
|
|
@@ -172,12 +172,12 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
172
172
|
};
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
// Composer-specific style with
|
|
175
|
+
// Composer-specific style — bold text with subtle background pill (original behavior)
|
|
176
176
|
const composerFallback: MentionsSubStyle = {
|
|
177
177
|
textStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#6852D6" },
|
|
178
178
|
selfTextStyle: { fontWeight: "700", fontSize: 14, lineHeight: 19.6, color: "#FFAB00" },
|
|
179
|
-
backgroundColor: "rgba(104, 82, 214, 0.15)",
|
|
180
|
-
selfBackgroundColor: "rgba(255, 171, 0, 0.2)",
|
|
179
|
+
backgroundColor: "rgba(104, 82, 214, 0.15)",
|
|
180
|
+
selfBackgroundColor: "rgba(255, 171, 0, 0.2)",
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
const composerFromTheme = (): MentionsSubStyle => {
|
|
@@ -186,8 +186,8 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
186
186
|
return {
|
|
187
187
|
textStyle: { ...baseStyle, color: primaryColor },
|
|
188
188
|
selfTextStyle: { ...baseStyle, color: theme?.color?.warning || "#FFAB00" },
|
|
189
|
-
backgroundColor: "rgba(104, 82, 214, 0.15)",
|
|
190
|
-
selfBackgroundColor: "rgba(255, 171, 0, 0.2)",
|
|
189
|
+
backgroundColor: "rgba(104, 82, 214, 0.15)",
|
|
190
|
+
selfBackgroundColor: "rgba(255, 171, 0, 0.2)",
|
|
191
191
|
};
|
|
192
192
|
};
|
|
193
193
|
|