@cometchat/chat-uikit-react-native 5.5.4 → 5.7.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/src/main/java/com/reactnativecometchatuikit/CometChatKeyboardModule.kt +101 -0
- package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +1 -0
- package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +78 -3
- package/android/src/main/java/com/reactnativecometchatuikit/KeyboardDirectionWatcher.kt +64 -0
- package/android/src/main/java/com/reactnativecometchatuikit/KeyboardLanguageDirection.kt +44 -0
- package/android/src/main/java/com/reactnativecometchatuikit/RichTextEditorView.kt +287 -49
- package/android/src/main/java/com/reactnativecometchatuikit/SafeFileName.java +78 -0
- package/ios/CCLocalFileGuard.h +19 -0
- package/ios/CCLocalFileGuard.m +34 -0
- package/ios/CometChatKeyboardModule.m +9 -0
- package/ios/CometChatKeyboardModule.swift +71 -0
- package/ios/FileManager.m +70 -6
- package/ios/KeyboardLanguageDirection.swift +24 -0
- package/ios/RichTextEditorView.swift +253 -51
- package/ios/RichTextEditorViewManager.m +1 -0
- package/ios/VideoManager.m +1 -1
- package/package.json +18 -3
- package/src/CometChatAIAssistantChatHistory/CometChatAIAssistantChatHistory.tsx +41 -57
- package/src/CometChatAIAssistantChatHistory/Skeleton.tsx +4 -1
- package/src/CometChatAIAssistantChatHistory/style.ts +5 -2
- package/src/CometChatCompactMessageComposer/CometChatCompactMessageComposer.tsx +145 -63
- package/src/CometChatCompactMessageComposer/styles.ts +7 -7
- package/src/CometChatConversations/CometChatConversations.tsx +276 -147
- package/src/CometChatConversations/Skeleton.tsx +4 -1
- package/src/CometChatConversations/style.ts +1 -1
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +39 -18
- package/src/CometChatGroupMembers/Skeleton.tsx +4 -1
- package/src/CometChatGroupMembers/style.ts +6 -4
- package/src/CometChatGroups/CometChatGroups.tsx +74 -58
- package/src/CometChatGroups/GroupsStyle.ts +1 -1
- package/src/CometChatGroups/Skeleton.tsx +4 -1
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +190 -96
- package/src/CometChatMessageComposer/styles.tsx +1 -1
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +28 -15
- package/src/CometChatMessageHeader/listners.ts +76 -56
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +8 -1
- package/src/CometChatMessageInformation/Skeleton.tsx +4 -1
- package/src/CometChatMessageList/CometChatMessageList.tsx +1465 -313
- package/src/CometChatMessageList/SwipeToReplyView.tsx +61 -0
- package/src/CometChatMessageList/style.ts +32 -32
- package/src/CometChatMessageList/swipeToReply.ts +25 -0
- package/src/CometChatNotificationFeed/CometChatNotificationFeed.tsx +81 -10
- package/src/CometChatNotificationFeed/style.ts +1 -1
- package/src/CometChatNotificationFeed/utils.ts +17 -18
- package/src/CometChatPinnedMessages/CometChatPinnedMessages.tsx +82 -3
- package/src/CometChatPinnedMessages/style.ts +5 -5
- package/src/CometChatRichTextEditor/RichTextEditorViewNativeComponent.ts +2 -0
- package/src/CometChatRichTextEditor/index.tsx +3 -0
- package/src/CometChatSavedMessages/CometChatSavedMessages.tsx +83 -15
- package/src/CometChatSavedMessages/style.ts +3 -3
- package/src/CometChatSearch/CometChatSearch.tsx +391 -136
- package/src/CometChatSearch/Skeleton.tsx +4 -1
- package/src/CometChatSearch/searchLabels.ts +26 -0
- package/src/CometChatSearch/style.ts +7 -7
- package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +34 -8
- package/src/CometChatThreadHeader/Header.tsx +2 -2
- package/src/CometChatUsers/CometChatUsers.tsx +10 -1
- package/src/CometChatUsers/Skeleton.tsx +4 -1
- package/src/CometChatUsers/style.ts +1 -1
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +27 -1
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +16 -4
- package/src/calls/CometChatCallLogs/Skeleton.tsx +4 -1
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +11 -3
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +10 -2
- package/src/extensions/CollaborativeBubble/style.ts +4 -4
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +1 -1
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +1 -1
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +11 -6
- package/src/extensions/LinkPreview/style.ts +6 -6
- package/src/extensions/Polls/Header.tsx +1 -1
- package/src/extensions/Polls/Polls.tsx +25 -12
- package/src/extensions/Polls/PollsBubble.tsx +10 -6
- package/src/extensions/Polls/style.ts +4 -4
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +2 -2
- package/src/extensions/Stickers/CometChatStickerKeyboard/Skeleton.tsx +1 -1
- package/src/extensions/Stickers/CometChatStickerKeyboard/style.ts +1 -1
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +4 -2
- package/src/index.ts +11 -1
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +102 -2
- package/src/shared/CometChatUiKit/UIKitSettings.ts +28 -0
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +10 -0
- package/src/shared/events/index.ts +4 -0
- package/src/shared/events/offline.ts +28 -0
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +18 -13
- package/src/shared/formatters/CometChatRichTextFormatter/index.tsx +15 -7
- package/src/shared/formatters/CometChatTextFormatter.ts +11 -0
- package/src/shared/formatters/CometChatUrlsFormatter/index.tsx +7 -4
- package/src/shared/framework/MessageDataSource.tsx +51 -108
- package/src/shared/helper/LocalizedDateHelper.ts +64 -4
- package/src/shared/helper/helperFunctions.ts +71 -4
- package/src/shared/helper/keyboardDirection.ts +54 -0
- package/src/shared/helper/layoutDirection.ts +205 -0
- package/src/shared/helper/pluralRules.ts +67 -0
- package/src/shared/helper/textDirection.ts +118 -0
- package/src/shared/icons/Icon.tsx +37 -2
- package/src/shared/icons/components/format-list-numbered-rtl.tsx +15 -0
- package/src/shared/index.ts +2 -0
- package/src/shared/offline/OfflineHub.ts +651 -0
- package/src/shared/offline/OfflineMediaBubble.tsx +49 -0
- package/src/shared/offline/OfflineViews.tsx +222 -0
- package/src/shared/offline/conversationPins.ts +137 -0
- package/src/shared/offline/conversations.ts +325 -0
- package/src/shared/offline/frameProbe.ts +24 -0
- package/src/shared/offline/gate.ts +94 -0
- package/src/shared/offline/groupActions.ts +81 -0
- package/src/shared/offline/identity.ts +162 -0
- package/src/shared/offline/index.ts +76 -0
- package/src/shared/offline/media.ts +247 -0
- package/src/shared/offline/notices.ts +84 -0
- package/src/shared/offline/reconcile.ts +296 -0
- package/src/shared/offline/searchOutcome.ts +62 -0
- package/src/shared/offline/send.ts +430 -0
- package/src/shared/offline/stateContract.ts +85 -0
- package/src/shared/offline/threadReplies.ts +125 -0
- package/src/shared/offline/twoPhase.ts +372 -0
- package/src/shared/offline/unsentActions.ts +168 -0
- package/src/shared/offline/useOfflineMediaUri.ts +87 -0
- package/src/shared/offline/useOfflineReconnect.ts +25 -0
- package/src/shared/offline/useOfflineSessionEnded.ts +22 -0
- package/src/shared/offline/useOfflineUploadTray.ts +76 -0
- package/src/shared/offline/usePresenceHidden.ts +33 -0
- package/src/shared/resources/CometChatLocalizeNew/CometChatLocalizationHelper.ts +2 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ar/translation.json +720 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/de/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json +75 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/es/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/fr/translation.json +75 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/hi/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/hu/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/lt/translation.json +82 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/ms/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/pt/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/ru/translation.json +90 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/sv/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/zh/translation.json +74 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/zh-tw/translation.json +74 -3
- package/src/shared/services/UploadQueueService.ts +106 -1
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +13 -12
- package/src/shared/utils/CometChatMessagePreview/style.ts +1 -1
- package/src/shared/utils/MessageReceiptUtils.ts +8 -0
- package/src/shared/utils/MessageUtils.tsx +14 -14
- package/src/shared/utils/PermissionUtil.ts +16 -5
- package/src/shared/utils/SavedMessagesHelper.ts +18 -1
- package/src/shared/utils/attachmentLimits.ts +3 -2
- package/src/shared/utils/catchUpCursor.ts +36 -0
- package/src/shared/utils/conversationUtils.ts +3 -5
- package/src/shared/utils/failedMessageRetry.ts +73 -0
- package/src/shared/utils/fileIconFontSize.ts +10 -0
- package/src/shared/utils/fileSizeLabel.ts +16 -0
- package/src/shared/utils/groupActionText.ts +75 -0
- package/src/shared/utils/messageIdentity.ts +38 -0
- package/src/shared/views/CometChatAIAssistantMessageBubble/CometChatAIAssistantMessageBubble.tsx +12 -8
- package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentPreview.style.ts +1 -1
- package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentPreviewItem.tsx +5 -3
- package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentTile.tsx +22 -17
- package/src/shared/views/CometChatAttachmentViewer/CometChatAttachmentViewer.tsx +45 -12
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +16 -10
- package/src/shared/views/CometChatAudiosBubble/CometChatAudiosBubble.tsx +20 -8
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +8 -4
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +6 -2
- package/src/shared/views/CometChatComposerErrorBanner.tsx +3 -1
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +8 -3
- package/src/shared/views/CometChatConversationStarter/CometChatConversationStarter.tsx +2 -2
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +5 -3
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +8 -8
- package/src/shared/views/CometChatEmojiKeyboard/style.ts +2 -2
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +13 -27
- package/src/shared/views/CometChatFilesBubble/CometChatFilesBubble.tsx +65 -15
- package/src/shared/views/CometChatImageViewerModal/ImageViewerModal.tsx +7 -3
- package/src/shared/views/CometChatImagesBubble/CometChatImagesBubble.tsx +56 -25
- package/src/shared/views/CometChatInlineAudioRecorder/CometChatInlineAudioRecorder.tsx +41 -21
- package/src/shared/views/CometChatInlineAudioRecorder/useAudioRecorder.ts +7 -3
- package/src/shared/views/CometChatLinkConfirmPopup/CometChatLinkConfirmPopup.tsx +7 -3
- package/src/shared/views/CometChatList/CometChatList.tsx +478 -21
- package/src/shared/views/CometChatList/Header.tsx +5 -2
- package/src/shared/views/CometChatList/sectionLetter.ts +44 -0
- package/src/shared/views/CometChatList/styles.ts +7 -7
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +6 -4
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPlayer.tsx +16 -10
- package/src/shared/views/CometChatMediaRecorder/Timer.tsx +5 -1
- package/src/shared/views/CometChatMediaViewer/CometChatMediaViewer.tsx +43 -16
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +24 -4
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +19 -2
- package/src/shared/views/CometChatNewMessageIndicator/CometChatNewMessageIndicator.tsx +3 -2
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +59 -12
- package/src/shared/views/CometChatReactionList/ReactionListStyle.tsx +2 -2
- package/src/shared/views/CometChatReactionList/Skeleton.tsx +4 -1
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +6 -2
- package/src/shared/views/CometChatReportDialog/CometChatReportDialog.tsx +7 -3
- package/src/shared/views/CometChatReportDialog/style.ts +1 -1
- package/src/shared/views/CometChatSmartReplies/CometChatSmartReplies.tsx +1 -1
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +4 -0
- package/src/shared/views/CometChatStreamMessageBubble/CometChatStreamMessageBubble.tsx +20 -13
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +3 -2
- package/src/shared/views/CometChatSuggestionList/Skeleton.tsx +1 -1
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +29 -3
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +20 -30
- package/src/shared/views/CometChatTooltipMenu/tooltipPosition.ts +43 -0
- package/src/shared/views/CometChatVideoBubble/style.ts +2 -2
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +4 -1
- package/src/shared/views/CometChatVideosBubble/CometChatVideosBubble.tsx +58 -24
- package/src/shared/views/CometChatVoiceNoteBubble/CometChatVoiceNoteBubble.tsx +24 -12
- package/src/shared/views/SenderLabel.tsx +41 -0
- package/src/theme/default/default.ts +1 -1
- package/src/theme/type.ts +17 -0
- 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
|
@@ -331,7 +331,7 @@ const getStatusInfoView = (
|
|
|
331
331
|
/>
|
|
332
332
|
{receiptsVisibility && isOutgoingMessage ? (
|
|
333
333
|
/* ToDoM Use Icon From Incoming/Outgoing bubble styles */
|
|
334
|
-
<View style={{
|
|
334
|
+
<View style={{ marginStart: 2, alignItems: "center", justifyContent: "center" }}>
|
|
335
335
|
<CometChatReceipt
|
|
336
336
|
receipt={messageState as MessageReceipt}
|
|
337
337
|
style={{
|
|
@@ -379,8 +379,8 @@ export const MessageUtils = {
|
|
|
379
379
|
isOutgoing && moderationStatus === "disapproved"
|
|
380
380
|
? deepMerge(baseStyle, {
|
|
381
381
|
containerStyle: {
|
|
382
|
-
|
|
383
|
-
|
|
382
|
+
borderBottomStartRadius: 0,
|
|
383
|
+
borderBottomEndRadius: 0,
|
|
384
384
|
overflow: "hidden",
|
|
385
385
|
},
|
|
386
386
|
})
|
|
@@ -440,7 +440,7 @@ export const getMessagePreviewInternal = (
|
|
|
440
440
|
name={iconName}
|
|
441
441
|
size={iconSize}
|
|
442
442
|
color={iconColor || theme?.color?.textSecondary}
|
|
443
|
-
containerStyle={{
|
|
443
|
+
containerStyle={{ marginEnd: theme?.spacing?.spacing?.s0_5 }}
|
|
444
444
|
/>
|
|
445
445
|
)}
|
|
446
446
|
<Text
|
|
@@ -579,10 +579,10 @@ export const ModerationBottomView = ({
|
|
|
579
579
|
{
|
|
580
580
|
marginHorizontal: -bubblePadH,
|
|
581
581
|
marginBottom: -bubblePadB,
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
582
|
+
borderTopStartRadius: 0,
|
|
583
|
+
borderTopEndRadius: 0,
|
|
584
|
+
borderBottomStartRadius: bubbleRadius,
|
|
585
|
+
borderBottomEndRadius: bubbleRadius,
|
|
586
586
|
flexDirection: "row",
|
|
587
587
|
alignItems: "center",
|
|
588
588
|
},
|
|
@@ -592,7 +592,7 @@ export const ModerationBottomView = ({
|
|
|
592
592
|
<Icon
|
|
593
593
|
name="message-blocked"
|
|
594
594
|
color={effective?.iconTintColor}
|
|
595
|
-
containerStyle={{
|
|
595
|
+
containerStyle={{ paddingStart: 12, paddingEnd: 4, alignSelf: "stretch" }}
|
|
596
596
|
/>
|
|
597
597
|
<Text
|
|
598
598
|
style={[
|
|
@@ -634,10 +634,10 @@ export const MimeErrorBottomView = ({
|
|
|
634
634
|
{
|
|
635
635
|
marginHorizontal: -bubblePadH,
|
|
636
636
|
marginBottom: -bubblePadB,
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
637
|
+
borderTopStartRadius: 0,
|
|
638
|
+
borderTopEndRadius: 0,
|
|
639
|
+
borderBottomStartRadius: bubbleRadius,
|
|
640
|
+
borderBottomEndRadius: bubbleRadius,
|
|
641
641
|
flexDirection: "row",
|
|
642
642
|
alignItems: "center",
|
|
643
643
|
},
|
|
@@ -647,7 +647,7 @@ export const MimeErrorBottomView = ({
|
|
|
647
647
|
<Icon
|
|
648
648
|
name="message-blocked"
|
|
649
649
|
color={effective?.iconTintColor}
|
|
650
|
-
containerStyle={{
|
|
650
|
+
containerStyle={{ paddingStart: 12, paddingEnd: 4, alignSelf: "stretch" }}
|
|
651
651
|
/>
|
|
652
652
|
<Text
|
|
653
653
|
style={[
|
|
@@ -108,7 +108,7 @@ class PermissionUtilIOS {
|
|
|
108
108
|
|
|
109
109
|
async startResourceBasedTask(resources: TPermissibleResources[]) {
|
|
110
110
|
const resourcePermStatuses = await this.get(resources);
|
|
111
|
-
|
|
111
|
+
const denied: TPermissibleResources[] = [];
|
|
112
112
|
for (let i = 0; i < resourcePermStatuses.length; i++) {
|
|
113
113
|
const resourcePermStatus = resourcePermStatuses[i];
|
|
114
114
|
if (
|
|
@@ -118,12 +118,23 @@ class PermissionUtilIOS {
|
|
|
118
118
|
await this.request([resources[i]]);
|
|
119
119
|
[resourcePermStatuses[i]] = await this.get([resources[i]]);
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
// iOS Restricted (Screen Time / MDM) can't be granted in-app either: block it like Denied.
|
|
122
|
+
if (
|
|
123
|
+
resourcePermStatuses[i] === this.status.Denied ||
|
|
124
|
+
resourcePermStatuses[i] === this.status.Restricted
|
|
125
|
+
) {
|
|
126
|
+
denied.push(resources[i]);
|
|
123
127
|
}
|
|
124
128
|
}
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
const allResourcesAllowed = denied.length === 0;
|
|
130
|
+
if (!allResourcesAllowed) {
|
|
131
|
+
// ENG-57317: name what was actually denied (a voice call asks for the microphone only).
|
|
132
|
+
const message = !denied.includes("mic")
|
|
133
|
+
? "CAMERA_PERMISSION"
|
|
134
|
+
: denied.includes("camera")
|
|
135
|
+
? "CAMERA_MICROPHONE_PERMISSION"
|
|
136
|
+
: "MICROPHONE_ACCESS_PERMISSION";
|
|
137
|
+
Alert.alert("", t(message), [
|
|
127
138
|
{
|
|
128
139
|
style: "cancel",
|
|
129
140
|
text: t("CANCEL"),
|
|
@@ -216,7 +216,24 @@ export const sourceLabelFor = (
|
|
|
216
216
|
};
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
|
-
*
|
|
219
|
+
* The Saved list's order: newest message first, by when it was *sent*, as the React UI Kit
|
|
220
|
+
* does (`sentAtDesc` in its saved-messages reducer). Pages arrive in the request's own order
|
|
221
|
+
* (oldest first within a page) and a later page can hold a message newer than anything
|
|
222
|
+
* already shown, so the order is re-established on every merge. Ties break on id so equal
|
|
223
|
+
* timestamps don't shuffle between renders. Guarded: a row from an event is not guaranteed
|
|
224
|
+
* to be a fully hydrated SDK instance, and an ordering helper must never throw.
|
|
225
|
+
*/
|
|
226
|
+
export const sentAtDesc = (a: CometChat.BaseMessage, b: CometChat.BaseMessage): number => {
|
|
227
|
+
const at = typeof a?.getSentAt === "function" ? Number(a.getSentAt()) || 0 : 0;
|
|
228
|
+
const bt = typeof b?.getSentAt === "function" ? Number(b.getSentAt()) || 0 : 0;
|
|
229
|
+
if (bt !== at) return bt - at;
|
|
230
|
+
const aid = typeof a?.getId === "function" ? Number(a.getId()) || 0 : 0;
|
|
231
|
+
const bid = typeof b?.getId === "function" ? Number(b.getId()) || 0 : 0;
|
|
232
|
+
return bid - aid;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* A fresh request for the logged-in user's saved messages, newest message first by send time.
|
|
220
237
|
*
|
|
221
238
|
* The ordinary messages request, filtered to saved rows. Deliberately carries NO
|
|
222
239
|
* uid/guid: `saved=1` is account-wide, and scoping it to a conversation would turn
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
+
import { localizeDigits } from '../helper/LocalizedDateHelper';
|
|
2
3
|
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
3
4
|
import {
|
|
4
5
|
DEFAULT_MAX_ATTACHMENT_COUNT,
|
|
@@ -103,7 +104,7 @@ export function acceptPickedAttachments<T>(
|
|
|
103
104
|
const remaining = Math.max(0, maxCount - existingCount);
|
|
104
105
|
if (files.length > remaining) {
|
|
105
106
|
// Over the limit → drop the ENTIRE pick (already-staged files are untouched).
|
|
106
|
-
showToast(t('ATTACHMENT_COUNT_EXCEEDED').replace('{max}', String(maxCount)));
|
|
107
|
+
showToast(t('ATTACHMENT_COUNT_EXCEEDED').replace('{max}', localizeDigits(String(maxCount))));
|
|
107
108
|
return [];
|
|
108
109
|
}
|
|
109
110
|
return files;
|
|
@@ -127,7 +128,7 @@ export async function toastAttachmentRejection(
|
|
|
127
128
|
const { fileSizeMax } = await getFileUploadLimits();
|
|
128
129
|
showToast(
|
|
129
130
|
t('ATTACHMENT_SIZE_EXCEEDED')
|
|
130
|
-
.replace('{max}',
|
|
131
|
+
.replace('{max}', localizeDigits(t('FILE_SIZE_MB').replace('{size}', String(Math.round(fileSizeMax / 1024 / 1024)))))
|
|
131
132
|
);
|
|
132
133
|
return;
|
|
133
134
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reconnect catch-up paging for the message list (plan D3).
|
|
3
|
+
*
|
|
4
|
+
* `getNewMessages` fetched forward from `lastID` and recursed only when a page held exactly 30
|
|
5
|
+
* messages, without ever moving the cursor: a full page re-fetched the same page forever, and a
|
|
6
|
+
* request with a different limit never paged at all. The next page now starts after the newest
|
|
7
|
+
* server id of the page just fetched, and paging stops on a page shorter than the request's own
|
|
8
|
+
* limit (or one that did not move the cursor).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
function numericId(message: any): number {
|
|
12
|
+
const raw = typeof message?.getId === "function" ? message.getId() : message?.id;
|
|
13
|
+
const id = typeof raw === "string" ? parseInt(raw, 10) : Number(raw);
|
|
14
|
+
return Number.isFinite(id) && id > 0 ? id : 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Newest server id in `messages` (0 when none has one). */
|
|
18
|
+
export function newestServerIdIn(messages: readonly any[] | null | undefined): number {
|
|
19
|
+
let newest = 0;
|
|
20
|
+
for (const message of messages ?? []) newest = Math.max(newest, numericId(message));
|
|
21
|
+
return newest;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The cursor for the next catch-up page, or `null` when catch-up is complete.
|
|
26
|
+
* @param page the page just fetched (any order)
|
|
27
|
+
* @param cursor the message id that page was fetched after
|
|
28
|
+
* @param limit the request's own page size
|
|
29
|
+
*/
|
|
30
|
+
export function nextCatchUpCursor(page: readonly any[] | null | undefined, cursor: number, limit: number): number | null {
|
|
31
|
+
const size = page?.length ?? 0;
|
|
32
|
+
const pageLimit = Number(limit) > 0 ? Number(limit) : 30;
|
|
33
|
+
if (size < pageLimit) return null;
|
|
34
|
+
const newest = newestServerIdIn(page);
|
|
35
|
+
return newest > (Number(cursor) || 0) ? newest : null;
|
|
36
|
+
}
|
|
@@ -106,16 +106,14 @@ export class CometChatConversationUtils {
|
|
|
106
106
|
|
|
107
107
|
if (lastMessage.getCategory() == "call") {
|
|
108
108
|
let color: ColorValue | undefined = theme?.color?.textSecondary;
|
|
109
|
-
|
|
109
|
+
const isAudio = lastMessage.getType() == "audio";
|
|
110
|
+
let text = t(isAudio ? "VOICE_CALL" : "VIDEO_CALL");
|
|
110
111
|
let iconName: IconName = "phone-incoming-fill";
|
|
111
|
-
if (lastMessage.getType() == "audio") {
|
|
112
|
-
text = "Voice call";
|
|
113
|
-
}
|
|
114
112
|
if (uid === lastMessage.getSender()?.getUid()) {
|
|
115
113
|
iconName = "phone-outgoing-fill";
|
|
116
114
|
} else if ((lastMessage as CometChat.Call).getAction() === "unanswered") {
|
|
117
115
|
color = theme?.color?.error;
|
|
118
|
-
text =
|
|
116
|
+
text = t(isAudio ? "MISSED_VOICE_CALL" : "MISSED_VIDEO_CALL");
|
|
119
117
|
}
|
|
120
118
|
|
|
121
119
|
return getMessagePreviewInternal(iconName, text, {iconColor: color, theme});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry of a failed own message on the offline-OFF path (plan D1).
|
|
3
|
+
*
|
|
4
|
+
* The bubble's "Retry" used to call a media-only resend that returned early for text and custom
|
|
5
|
+
* messages, so tapping Retry on a failed text did nothing. It also showed on moderation-
|
|
6
|
+
* disapproved rows (which have a server id and must not be re-sent) and re-sent them if media.
|
|
7
|
+
*
|
|
8
|
+
* Rules: Retry is offered only for a row the server never accepted (no server id) that was not
|
|
9
|
+
* rejected by moderation. It clears the kit's error marks and re-sends through the same public
|
|
10
|
+
* `CometChatUIKit.send*` path a first send uses, which re-emits ccMessageSent
|
|
11
|
+
* inprogress -> success/error; the list reconciles by muid in place.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export interface FailedMessageSenders {
|
|
15
|
+
sendText(message: any): Promise<unknown>;
|
|
16
|
+
sendMedia(message: any): Promise<unknown>;
|
|
17
|
+
sendCustom(message: any): Promise<unknown>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function serverId(message: any): unknown {
|
|
21
|
+
return typeof message?.getId === "function" ? message.getId() : message?.id;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Whether the failed row may offer Retry (no server id, not rejected by moderation). */
|
|
25
|
+
export function isRetryableFailedRow(message: any, moderationStatus?: string): boolean {
|
|
26
|
+
if (!message) return false;
|
|
27
|
+
if (moderationStatus === "disapproved") return false;
|
|
28
|
+
const id = serverId(message);
|
|
29
|
+
return id === undefined || id === null || id === "" || id === 0 || id === "0";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Remove the error marks the send paths stamp (data.metaData.error, metadata.error, .error). */
|
|
33
|
+
export function clearSendErrorMarks(message: any): void {
|
|
34
|
+
const data: any = message?.getData?.() || {};
|
|
35
|
+
if (data?.metaData?.error) {
|
|
36
|
+
delete data.metaData.error;
|
|
37
|
+
message?.setData?.(data);
|
|
38
|
+
}
|
|
39
|
+
const metadata: any = message?.getMetadata?.();
|
|
40
|
+
if (metadata?.error) {
|
|
41
|
+
delete metadata.error;
|
|
42
|
+
message?.setMetadata?.(metadata);
|
|
43
|
+
}
|
|
44
|
+
if (message && "error" in message) message.error = undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Which send a message goes through: "media", "custom" or "text"; `null` for anything else. */
|
|
48
|
+
export function resendKindOf(message: any): "text" | "media" | "custom" | null {
|
|
49
|
+
const category = message?.getCategory?.();
|
|
50
|
+
const type = message?.getType?.();
|
|
51
|
+
if (category === "custom") return "custom";
|
|
52
|
+
if (category === "message") {
|
|
53
|
+
if (type === "text") return "text";
|
|
54
|
+
if (type === "image" || type === "video" || type === "audio" || type === "file") return "media";
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Re-send a failed row. Returns false when the row may not be retried. Never throws. */
|
|
60
|
+
export function resendFailedMessage(message: any, senders: FailedMessageSenders, moderationStatus?: string): boolean {
|
|
61
|
+
try {
|
|
62
|
+
if (!isRetryableFailedRow(message, moderationStatus)) return false;
|
|
63
|
+
const kind = resendKindOf(message);
|
|
64
|
+
if (!kind) return false;
|
|
65
|
+
clearSendErrorMarks(message);
|
|
66
|
+
const send = kind === "media" ? senders.sendMedia : kind === "custom" ? senders.sendCustom : senders.sendText;
|
|
67
|
+
// On failure the send path re-applies the error mark and emits ccMessageSent(error).
|
|
68
|
+
send(message).catch(() => {});
|
|
69
|
+
return true;
|
|
70
|
+
} catch {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font size for the translated label drawn inside the search file icon (CometChatSearch).
|
|
3
|
+
* The label sits on a front page ~54 units wide; 15 is the design size for "FILE". Longer words
|
|
4
|
+
* (ARCHIVO, BESTAND, FASCICOLO) or wide CJK glyphs shrink so they stay inside the page.
|
|
5
|
+
*/
|
|
6
|
+
export function fileIconFontSize(label: string): number {
|
|
7
|
+
// ponytail: width estimate (CJK ≈ 1em, others ≈ 0.65em bold), not a text measurement.
|
|
8
|
+
const units = [...label].reduce((w, c) => w + (c.charCodeAt(0) >= 0x2e80 ? 1 : 0.65), 0);
|
|
9
|
+
return Math.min(15, 46 / Math.max(units, 1));
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getCometChatTranslation } from "../resources/CometChatLocalizeNew/LocalizationManager";
|
|
2
|
+
import { localizeDigits } from "../helper/LocalizedDateHelper";
|
|
3
|
+
|
|
4
|
+
const t = getCometChatTranslation();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A file size with its unit in the kit language ("1.5 MB" in English, "١.٥ ميغابايت" in Arabic).
|
|
8
|
+
* `size` is already rounded by the caller; only the unit and the digits change here (the decimal
|
|
9
|
+
* point stays ".").
|
|
10
|
+
*/
|
|
11
|
+
export function fileSizeLabel(
|
|
12
|
+
key: "FILE_SIZE_BYTES" | "FILE_SIZE_KB" | "FILE_SIZE_MB",
|
|
13
|
+
size: string | number
|
|
14
|
+
): string {
|
|
15
|
+
return localizeDigits(t(key).replace("{size}", String(size)));
|
|
16
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { sentenceWithNames, withSentenceDirection } from "../helper/textDirection";
|
|
2
|
+
|
|
3
|
+
// ENG-41314: the sentence for a group member action ("X added Y"), built from the translated
|
|
4
|
+
// template (placeholders ${byName}/${onName}/${role}) or a simple fallback when the key has no
|
|
5
|
+
// translation. Names are isolated and the sentence takes the template's direction. Pure, so it
|
|
6
|
+
// can be tested without the data source.
|
|
7
|
+
//
|
|
8
|
+
// RTL parity (Android GroupActionText.kt): when the logged-in user did the action ("You added
|
|
9
|
+
// Sara") or had it done to them ("Ann added you"), the sentence uses its own template, because the
|
|
10
|
+
// verb changes with the person in most languages. `you` is the actor form, `youTarget` the target
|
|
11
|
+
// form (joined / left have none).
|
|
12
|
+
const ACTIONS: Record<string, { key: string; word: string; needsOn: boolean; you: string; youTarget?: string }> = {
|
|
13
|
+
added: {
|
|
14
|
+
key: "MESSAGE_LIST_ACTION_ADDED", word: "ADDED", needsOn: true,
|
|
15
|
+
you: "MESSAGE_LIST_ACTION_YOU_ADDED", youTarget: "MESSAGE_LIST_ACTION_ADDED_YOU",
|
|
16
|
+
},
|
|
17
|
+
joined: { key: "MESSAGE_LIST_ACTION_JOINED", word: "JOINED", needsOn: false, you: "MESSAGE_LIST_ACTION_YOU_JOINED" },
|
|
18
|
+
left: { key: "MESSAGE_LIST_ACTION_LEFT", word: "LEFT", needsOn: false, you: "MESSAGE_LIST_ACTION_YOU_LEFT" },
|
|
19
|
+
kicked: {
|
|
20
|
+
key: "MESSAGE_LIST_ACTION_KICKED", word: "KICKED", needsOn: true,
|
|
21
|
+
you: "MESSAGE_LIST_ACTION_YOU_KICKED", youTarget: "MESSAGE_LIST_ACTION_KICKED_YOU",
|
|
22
|
+
},
|
|
23
|
+
banned: {
|
|
24
|
+
key: "MESSAGE_LIST_ACTION_BANNED", word: "BANNED", needsOn: true,
|
|
25
|
+
you: "MESSAGE_LIST_ACTION_YOU_BANNED", youTarget: "MESSAGE_LIST_ACTION_BANNED_YOU",
|
|
26
|
+
},
|
|
27
|
+
unbanned: {
|
|
28
|
+
key: "MESSAGE_LIST_ACTION_UNBANNED", word: "UNBANNED", needsOn: true,
|
|
29
|
+
you: "MESSAGE_LIST_ACTION_YOU_UNBANNED", youTarget: "MESSAGE_LIST_ACTION_UNBANNED_YOU",
|
|
30
|
+
},
|
|
31
|
+
scopeChanged: {
|
|
32
|
+
key: "MESSAGE_LIST_ACTION_SCOPE_CHANGED", word: "MADE", needsOn: true,
|
|
33
|
+
you: "MESSAGE_LIST_ACTION_YOU_SCOPE_CHANGED", youTarget: "MESSAGE_LIST_ACTION_SCOPE_CHANGED_YOU",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Whether the logged-in user did the action (`actor`) or had it done to them (`target`). */
|
|
38
|
+
export type GroupActionSelf = { actor?: boolean; target?: boolean };
|
|
39
|
+
|
|
40
|
+
export function groupActionText(
|
|
41
|
+
action: string,
|
|
42
|
+
by: string | undefined,
|
|
43
|
+
on: string | undefined,
|
|
44
|
+
t: (key: string) => string,
|
|
45
|
+
newScope = "",
|
|
46
|
+
serverText = "",
|
|
47
|
+
self: GroupActionSelf = {}
|
|
48
|
+
): string {
|
|
49
|
+
const translated = (key: string) => {
|
|
50
|
+
const s = t(key);
|
|
51
|
+
return s === key ? undefined : s;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const spec = ACTIONS[action];
|
|
55
|
+
// Server text, not a template: no placeholders to fill.
|
|
56
|
+
if (!spec) return withSentenceDirection(serverText);
|
|
57
|
+
|
|
58
|
+
// The actor form wins when the user is both. translate() already falls back to the kit's English
|
|
59
|
+
// you-form, so the plain template is used only when no bundle at all has the key.
|
|
60
|
+
const youKey = self.actor ? spec.you : self.target ? spec.youTarget : undefined;
|
|
61
|
+
const fallback = action === "scopeChanged"
|
|
62
|
+
? `\${byName} ${t(spec.word)} \${onName} \${role}`
|
|
63
|
+
: spec.needsOn
|
|
64
|
+
? `\${byName} ${t(spec.word)} \${onName}`
|
|
65
|
+
: `\${byName} ${t(spec.word)}`;
|
|
66
|
+
const role = newScope ? t(newScope.toUpperCase()) : "";
|
|
67
|
+
const template = ((youKey && translated(youKey)) || translated(spec.key) || fallback)
|
|
68
|
+
.replace("${role}", role)
|
|
69
|
+
.trim();
|
|
70
|
+
|
|
71
|
+
// A missing name reads "User" in the localized sentence. Not `serverText`: for an SDK-parsed
|
|
72
|
+
// action that is the SDK's English "%s kicked %s" with the empty name left blank.
|
|
73
|
+
const byName = by || "User";
|
|
74
|
+
return sentenceWithNames(template, spec.needsOn ? { byName, onName: on || "User" } : { byName });
|
|
75
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Null-safe identity checks for the message list's replace-in-place paths (plan D2).
|
|
3
|
+
*
|
|
4
|
+
* The list used to match `msg.getId() == edited.getId()` and `msg["muid"] == edited["muid"]`
|
|
5
|
+
* directly, so a message with no id (an unsent row) matched the first other row with no id
|
|
6
|
+
* (`undefined == undefined`), and a message with no muid matched any row without one. Two
|
|
7
|
+
* missing identities are never the same message.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
function present(value: unknown): value is string | number {
|
|
11
|
+
return value !== undefined && value !== null && value !== "" && value !== 0 && value !== "0";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function idOf(message: any): unknown {
|
|
15
|
+
if (!message) return undefined;
|
|
16
|
+
return typeof message.getId === "function" ? message.getId() : message.id;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function muidOf(message: any): unknown {
|
|
20
|
+
if (!message) return undefined;
|
|
21
|
+
return message["muid"] ?? (typeof message.getMuid === "function" ? message.getMuid() : undefined);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Same server id, and both actually have one. Loose compare: ids arrive as numbers or strings. */
|
|
25
|
+
export function sameMessageById(a: any, b: any): boolean {
|
|
26
|
+
const left = idOf(a);
|
|
27
|
+
const right = idOf(b);
|
|
28
|
+
// eslint-disable-next-line eqeqeq
|
|
29
|
+
return present(left) && present(right) && left == right;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Same muid, and both actually have one. */
|
|
33
|
+
export function sameMessageByMuid(a: any, b: any): boolean {
|
|
34
|
+
const left = muidOf(a);
|
|
35
|
+
const right = muidOf(b);
|
|
36
|
+
// eslint-disable-next-line eqeqeq
|
|
37
|
+
return present(left) && present(right) && left == right;
|
|
38
|
+
}
|
package/src/shared/views/CometChatAIAssistantMessageBubble/CometChatAIAssistantMessageBubble.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import Markdown from 'react-native-markdown-display';
|
|
|
4
4
|
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
5
5
|
import { CometChatCardView } from '@cometchat/cards-react-native';
|
|
6
6
|
import { useTheme } from '../../../theme';
|
|
7
|
+
import { CODE_DIRECTION } from '../../helper/layoutDirection';
|
|
7
8
|
import { CometChatTheme } from '../../../theme/type';
|
|
8
9
|
import { CometChatUIEventHandler, CometChatUIEvents } from '../../events';
|
|
9
10
|
|
|
@@ -56,7 +57,8 @@ const CometChatAIAssistantMessageBubble: React.FC<CometChatAIAssistantMessageBub
|
|
|
56
57
|
backgroundColor: bubbleStyle?.containerStyle?.backgroundColor || 'transparent',
|
|
57
58
|
borderRadius: bubbleStyle?.containerStyle?.borderRadius || theme.spacing.radius.r3,
|
|
58
59
|
minWidth: bubbleStyle?.containerStyle?.minWidth || 90,
|
|
59
|
-
|
|
60
|
+
// Fill the bubble (it gets fillWidth): markdown has no natural width to shrink to.
|
|
61
|
+
alignSelf: bubbleStyle?.containerStyle?.alignSelf || 'stretch',
|
|
60
62
|
maxWidth: '100%',
|
|
61
63
|
overflow: 'hidden',
|
|
62
64
|
...bubbleStyle?.containerStyle,
|
|
@@ -100,6 +102,7 @@ const CometChatAIAssistantMessageBubble: React.FC<CometChatAIAssistantMessageBub
|
|
|
100
102
|
padding: theme.spacing.padding.p0_5,
|
|
101
103
|
},
|
|
102
104
|
code_block: {
|
|
105
|
+
...CODE_DIRECTION,
|
|
103
106
|
backgroundColor: theme.color.background3,
|
|
104
107
|
color: bubbleStyle?.textStyle?.color || theme.color.receiveBubbleText,
|
|
105
108
|
borderRadius: theme.spacing.radius.r2,
|
|
@@ -107,6 +110,7 @@ const CometChatAIAssistantMessageBubble: React.FC<CometChatAIAssistantMessageBub
|
|
|
107
110
|
fontFamily: 'monospace',
|
|
108
111
|
},
|
|
109
112
|
fence: {
|
|
113
|
+
...CODE_DIRECTION,
|
|
110
114
|
backgroundColor: theme.color.background3,
|
|
111
115
|
color: bubbleStyle?.textStyle?.color || theme.color.receiveBubbleText,
|
|
112
116
|
borderRadius: theme.spacing.radius.r2,
|
|
@@ -137,7 +141,7 @@ const CometChatAIAssistantMessageBubble: React.FC<CometChatAIAssistantMessageBub
|
|
|
137
141
|
padding: 0,
|
|
138
142
|
},
|
|
139
143
|
th: {
|
|
140
|
-
|
|
144
|
+
borderEndWidth: 1,
|
|
141
145
|
borderBottomWidth: 1,
|
|
142
146
|
borderColor: theme.color.borderDefault,
|
|
143
147
|
backgroundColor: theme.color.background3,
|
|
@@ -148,10 +152,10 @@ const CometChatAIAssistantMessageBubble: React.FC<CometChatAIAssistantMessageBub
|
|
|
148
152
|
fontSize: bubbleStyle?.textStyle?.fontSize || theme.typography.body.regular.fontSize,
|
|
149
153
|
margin: 0,
|
|
150
154
|
borderTopWidth: 0,
|
|
151
|
-
|
|
155
|
+
borderStartWidth: 0,
|
|
152
156
|
},
|
|
153
157
|
td: {
|
|
154
|
-
|
|
158
|
+
borderEndWidth: 1,
|
|
155
159
|
borderBottomWidth: 1,
|
|
156
160
|
borderColor: theme.color.borderDefault,
|
|
157
161
|
backgroundColor: theme.color.background1,
|
|
@@ -161,7 +165,7 @@ const CometChatAIAssistantMessageBubble: React.FC<CometChatAIAssistantMessageBub
|
|
|
161
165
|
fontSize: bubbleStyle?.textStyle?.fontSize || theme.typography.body.regular.fontSize,
|
|
162
166
|
margin: 0,
|
|
163
167
|
borderTopWidth: 0,
|
|
164
|
-
|
|
168
|
+
borderStartWidth: 0,
|
|
165
169
|
},
|
|
166
170
|
tr: {
|
|
167
171
|
borderBottomWidth: 0,
|
|
@@ -219,9 +223,9 @@ const CometChatAIAssistantMessageBubble: React.FC<CometChatAIAssistantMessageBub
|
|
|
219
223
|
color: bubbleStyle?.textStyle?.color || theme.color.receiveBubbleText,
|
|
220
224
|
},
|
|
221
225
|
blockquote: {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
borderStartWidth: 3,
|
|
227
|
+
borderStartColor: theme.color.borderDefault,
|
|
228
|
+
paddingStart: theme.spacing.padding.p2,
|
|
225
229
|
color: theme.color.textSecondary,
|
|
226
230
|
},
|
|
227
231
|
link: {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import { useTheme } from '../../../theme';
|
|
12
12
|
import { useCompTheme } from '../../../theme/hook';
|
|
13
13
|
import { CometChatTheme } from '../../../theme/type';
|
|
14
|
+
import { useCometChatTranslation } from '../../resources/CometChatLocalizeNew';
|
|
14
15
|
import { SelectedAttachment } from '../../modals/SelectedAttachment';
|
|
15
16
|
import { deepMerge } from '../../helper/helperFunctions';
|
|
16
17
|
|
|
@@ -36,6 +37,7 @@ export const CometChatAttachmentPreviewItem = ({
|
|
|
36
37
|
style,
|
|
37
38
|
}: CometChatAttachmentPreviewItemProps) => {
|
|
38
39
|
const theme = useTheme();
|
|
40
|
+
const { t } = useCometChatTranslation();
|
|
39
41
|
const compTheme = useCompTheme();
|
|
40
42
|
const s = deepMerge(
|
|
41
43
|
theme.attachmentPreviewItemStyles ?? {},
|
|
@@ -197,7 +199,7 @@ export const CometChatAttachmentPreviewItem = ({
|
|
|
197
199
|
alignItems: 'center',
|
|
198
200
|
}}
|
|
199
201
|
accessibilityRole="button"
|
|
200
|
-
accessibilityLabel="
|
|
202
|
+
accessibilityLabel={t("ATTACHMENT_RETRY")}
|
|
201
203
|
>
|
|
202
204
|
<Text style={{ fontSize: theme.typography.heading2.regular.fontSize, color: theme.color.error }}>
|
|
203
205
|
{'⚠'}
|
|
@@ -238,7 +240,7 @@ export const CometChatAttachmentPreviewItem = ({
|
|
|
238
240
|
style={[{
|
|
239
241
|
position: 'absolute',
|
|
240
242
|
top: theme.spacing.spacing.s1,
|
|
241
|
-
|
|
243
|
+
end: theme.spacing.spacing.s1,
|
|
242
244
|
width: theme.spacing.spacing.s4,
|
|
243
245
|
height: theme.spacing.spacing.s4,
|
|
244
246
|
borderRadius: theme.spacing.radius.r2,
|
|
@@ -247,7 +249,7 @@ export const CometChatAttachmentPreviewItem = ({
|
|
|
247
249
|
alignItems: 'center',
|
|
248
250
|
}, s.removeButtonStyle]}
|
|
249
251
|
accessibilityRole="button"
|
|
250
|
-
accessibilityLabel="
|
|
252
|
+
accessibilityLabel={t("ATTACHMENT_REMOVE")}
|
|
251
253
|
>
|
|
252
254
|
<Text
|
|
253
255
|
style={{
|