@cometchat/chat-uikit-react-native 5.0.0-beta.1 → 5.0.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/README.md +2 -3
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/src/main/java/com/reactnativecometchatuikit/CometChatSoundModule.java +29 -44
- package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +12 -0
- package/ios/FileManager.m +26 -9
- package/package.json +11 -36
- package/src/CometChatConversations/CometChatConversations.tsx +287 -147
- package/src/CometChatConversations/Skeleton.tsx +116 -73
- package/src/CometChatConversations/style.ts +17 -22
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +439 -227
- package/src/CometChatGroupMembers/style.ts +2 -4
- package/src/CometChatGroups/CometChatGroups.tsx +239 -135
- package/src/CometChatGroups/GroupsStyle.ts +20 -17
- package/src/CometChatGroups/Skeleton.tsx +198 -288
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +208 -73
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +97 -43
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +4 -2
- package/src/CometChatMessageList/CometChatMessageList.tsx +200 -76
- package/src/CometChatMessageList/style.ts +4 -4
- package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +77 -11
- package/src/CometChatThreadHeader/style.ts +2 -2
- package/src/CometChatUsers/CometChatUsers.tsx +203 -51
- package/src/CometChatUsers/Skeleton.tsx +174 -159
- package/src/CometChatUsers/style.ts +21 -18
- package/src/calls/CallingConfiguration.ts +4 -3
- package/src/calls/CallingExtensionDecorator.tsx +5 -3
- package/src/calls/CometChatCallButtons/CometChatCallButtonConfiguration.ts +4 -2
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +10 -8
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +240 -97
- package/src/calls/CometChatCallLogs/Skeleton.tsx +175 -91
- package/src/calls/CometChatCallLogs/index.ts +1 -0
- package/src/calls/CometChatCallLogs/style.ts +85 -43
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +42 -29
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +36 -10
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +39 -12
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +5 -4
- package/src/extensions/Polls/PollsDecorator.tsx +30 -9
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +34 -16
- package/src/index.ts +3 -1
- package/src/shared/base/Types.ts +31 -1
- package/src/shared/framework/DataSource.ts +64 -20
- package/src/shared/framework/DataSourceDecorator.tsx +46 -37
- package/src/shared/framework/MessageDataSource.tsx +518 -316
- package/src/shared/index.ts +3 -1
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/hu/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +3 -2
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +3 -2
- package/src/shared/utils/MessageUtils.tsx +41 -20
- package/src/shared/utils/conversationUtils.ts +2 -2
- package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +22 -1
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +20 -8
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +177 -123
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +76 -10
- package/src/shared/views/CometChatConfirmDialog/style.ts +2 -2
- package/src/shared/views/CometChatDate/CometChatDate.tsx +26 -18
- package/src/shared/views/CometChatDateSeperator/CometChatDateSeparator.tsx +22 -16
- package/src/shared/views/CometChatDeletedBubble/CometChatDeletedBubble.tsx +17 -5
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +65 -35
- package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +22 -11
- package/src/shared/views/CometChatImageBubble/CometChatImageLoader.tsx +47 -18
- package/src/shared/views/CometChatList/CometChatList.tsx +70 -46
- package/src/shared/views/CometChatList/Header.tsx +122 -37
- package/src/shared/views/CometChatList/styles.ts +1 -0
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +116 -30
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +52 -30
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +36 -22
- package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +41 -13
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +132 -17
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +30 -2
- package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +10 -6
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +20 -13
- package/src/shared/views/CometChatStatusIndicator/styles.ts +26 -13
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +25 -2
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +94 -14
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +52 -16
- package/src/shared/views/CometChatTooltipMenu/index.ts +2 -1
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +29 -9
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +20 -2
- package/src/shared/views/ErrorEmptyView/ErrorEmptyView.tsx +29 -14
- package/src/shared/views/index.ts +2 -0
- package/src/theme/default/index.ts +5 -5
- package/src/theme/type.ts +2 -2
- package/src/shared/views/CometChatPanel/CometChatPanel.tsx +0 -57
- package/src/shared/views/CometChatPanel/PanelStyle.tsx +0 -43
- package/src/shared/views/CometChatPanel/resources/CloseIcon.png +0 -0
- package/src/shared/views/CometChatPanel/resources/index.ts +0 -3
package/src/shared/index.ts
CHANGED
|
@@ -79,7 +79,8 @@ import {
|
|
|
79
79
|
CometChatVideoBubbleInterface,
|
|
80
80
|
DateStyle,
|
|
81
81
|
SuggestionItem,
|
|
82
|
-
CometChatReceipt
|
|
82
|
+
CometChatReceipt,
|
|
83
|
+
MenuItemInterface
|
|
83
84
|
} from "./views";
|
|
84
85
|
|
|
85
86
|
import {
|
|
@@ -128,6 +129,7 @@ export type {
|
|
|
128
129
|
AdditionalParams,
|
|
129
130
|
CometChatAudioBubbleInterface,
|
|
130
131
|
BadgeStyle,
|
|
132
|
+
MenuItemInterface
|
|
131
133
|
};
|
|
132
134
|
|
|
133
135
|
export {
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
"TAP_TO_REMOVE": "انقر للإزالة",
|
|
403
403
|
"ADD_CONTACTS": "أضف جهات الاتصال لبدء المحادثات ورؤيتها مدرجة هنا.",
|
|
404
404
|
"SCOPE_CHANGE_INFO": "يمكنك تغيير الأدوار لإدارة أذونات المجموعة والمسؤوليات",
|
|
405
|
-
"SOMETHING_WENT_WRONG": "يبدو أن خطأ
|
|
405
|
+
"SOMETHING_WENT_WRONG": "يبدو أن هناك خطأ ما.",
|
|
406
406
|
"MENTION_UPTO": "يمكنك ذكر ما يصل إلى",
|
|
407
407
|
"TIME": "وقت",
|
|
408
408
|
"TIMES": "مرات",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "بيانات اعتماد التطبيق",
|
|
443
443
|
"REGION": " منطقة ",
|
|
444
444
|
"WRONG_TEXT":" يبدو أن شيئًا ما قد حدث بشكل خاطئ.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"يرجى المحاولة مرة أخرى."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"يرجى المحاولة مرة أخرى.",
|
|
446
|
+
"BLOCKED_USER_DESC": "لا يمكن إرسال رسالة لأن المستخدم محظور"
|
|
446
447
|
}
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
"TAP_TO_REMOVE": "Zum Entfernen antippen",
|
|
402
402
|
"ADD_CONTACTS": "Fügen Sie Kontakte hinzu, um Gespräche zu starten und sie hier aufgelistet zu sehen.",
|
|
403
403
|
"SCOPE_CHANGE_INFO": "Sie können Rollen ändern, um Gruppenberechtigungen und Verantwortlichkeiten zu verwalten",
|
|
404
|
-
"SOMETHING_WENT_WRONG": "Es
|
|
404
|
+
"SOMETHING_WENT_WRONG": "Es scheint, dass etwas schiefgelaufen ist.",
|
|
405
405
|
"MENTION_UPTO": "Sie können bis zu erwähnen",
|
|
406
406
|
"TIME": "Zeit",
|
|
407
407
|
"TIMES": "mal",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "App-Anmeldeinformationen",
|
|
443
443
|
"REGION": "Region",
|
|
444
444
|
"WRONG_TEXT":"Sieht so aus, als ob etwas schiefgelaufen ist.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"Bitte versuchen Sie es noch einmal."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"Bitte versuchen Sie es noch einmal.",
|
|
446
|
+
"BLOCKED_USER_DESC": "Nachricht kann nicht gesendet werden, da der Benutzer blockiert ist"
|
|
446
447
|
}
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
"TAP_TO_REMOVE": "Tap to remove",
|
|
402
402
|
"ADD_CONTACTS": "Add contacts to start conversations and see them listed here.",
|
|
403
403
|
"SCOPE_CHANGE_INFO": "You can change roles to manage group permissions and responsibilities",
|
|
404
|
-
"SOMETHING_WENT_WRONG": "Looks like something went wrong
|
|
404
|
+
"SOMETHING_WENT_WRONG": "Looks like something went wrong.",
|
|
405
405
|
"MENTION_UPTO": "You can mention up to",
|
|
406
406
|
"TIME": "time",
|
|
407
407
|
"TIMES": "times",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "App Credentials",
|
|
443
443
|
"REGION": "Region",
|
|
444
444
|
"WRONG_TEXT":"Looks like something went wrong.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"Please try again."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"Please try again.",
|
|
446
|
+
"BLOCKED_USER_DESC": "Can't send a message as the user is blocked"
|
|
446
447
|
}
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
"TAP_TO_REMOVE": "Pulsa para eliminar",
|
|
402
402
|
"ADD_CONTACTS": "Agrega contactos para iniciar conversaciones y verlos listados aquí.",
|
|
403
403
|
"SCOPE_CHANGE_INFO": "Puedes cambiar roles para gestionar los permisos y responsabilidades del grupo",
|
|
404
|
-
"SOMETHING_WENT_WRONG": "Parece que algo salió mal.
|
|
404
|
+
"SOMETHING_WENT_WRONG": "Parece que algo salió mal.",
|
|
405
405
|
"MENTION_UPTO": "Puedes mencionar hasta",
|
|
406
406
|
"TIME": "tiempo",
|
|
407
407
|
"TIMES": "veces",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "Credenciales de la aplicación",
|
|
443
443
|
"REGION": "Región",
|
|
444
444
|
"WRONG_TEXT":"Parece que algo salió mal.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"Por favor, inténtalo de nuevo."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"Por favor, inténtalo de nuevo.",
|
|
446
|
+
"BLOCKED_USER_DESC": "No se puede enviar un mensaje porque el usuario está bloqueado"
|
|
446
447
|
}
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
"TAP_TO_REMOVE": "Touchez pour supprimer",
|
|
402
402
|
"ADD_CONTACTS": "Ajoutez des contacts pour commencer des conversations et les voir listés ici.",
|
|
403
403
|
"SCOPE_CHANGE_INFO": "Vous pouvez modifier les rôles pour gérer les autorisations et les responsabilités du groupe",
|
|
404
|
-
"SOMETHING_WENT_WRONG": "Il semble que quelque chose
|
|
404
|
+
"SOMETHING_WENT_WRONG": "Il semble que quelque chose se soit mal passé.",
|
|
405
405
|
"MENTION_UPTO": "Vous pouvez citer jusqu'à",
|
|
406
406
|
"TIME": "temps",
|
|
407
407
|
"TIMES": "temps",
|
|
@@ -441,5 +441,6 @@
|
|
|
441
441
|
"APP_CREDENTIALS" : "Identifiants de l'application",
|
|
442
442
|
"REGION": "Région",
|
|
443
443
|
"WRONG_TEXT":"On dirait que quelque chose a mal tourné.",
|
|
444
|
-
"WRONG_TEXT_TRY_AGAIN":"Veuillez réessayer."
|
|
444
|
+
"WRONG_TEXT_TRY_AGAIN":"Veuillez réessayer.",
|
|
445
|
+
"BLOCKED_USER_DESC": "Impossible d'envoyer un message car l'utilisateur est bloqué"
|
|
445
446
|
}
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
"OOPS!": "उफ़!",
|
|
403
403
|
"ADD_CONTACTS": "संपर्क जोड़ें ताकि बातचीत शुरू हो और उन्हें यहां सूचीबद्ध देखें।",
|
|
404
404
|
"SCOPE_CHANGE_INFO": "आप समूह अनुमतियों और जिम्मेदारियों को प्रबंधित करने के लिए भूमिकाएँ बदल सकते हैं",
|
|
405
|
-
"SOMETHING_WENT_WRONG": "लगता है कुछ गलत हो
|
|
405
|
+
"SOMETHING_WENT_WRONG": "लगता है कुछ गलत हो गया है।",
|
|
406
406
|
"MENTION_UPTO": "आप निम्नलिखित का उल्लेख कर सकते हैं",
|
|
407
407
|
"TIME": "पहर",
|
|
408
408
|
"TIMES": "समय",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "ऐप क्रेडेंशियल्स",
|
|
443
443
|
"REGION": "क्षेत्र",
|
|
444
444
|
"WRONG_TEXT":"लगता है कुछ गलत हो गया।",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"कृपया पुनः प्रयास करें।"
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"कृपया पुनः प्रयास करें।",
|
|
446
|
+
"BLOCKED_USER_DESC": "संदेश नहीं भेज सकते क्योंकि उपयोगकर्ता अवरुद्ध है"
|
|
446
447
|
}
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
"TAP_TO_REMOVE": "Koppintson az eltávolításhoz",
|
|
403
403
|
"ADD_CONTACTS": "Adjon hozzá kapcsolatokat, hogy beszélgetéseket kezdjen és itt láthassa őket felsorolva.",
|
|
404
404
|
"SCOPE_CHANGE_INFO": "Megváltoztathatja a szerepeket a csoport jogosultságainak és felelősségeinek kezeléséhez",
|
|
405
|
-
"SOMETHING_WENT_WRONG": "Úgy tűnik, valami hiba történt.
|
|
405
|
+
"SOMETHING_WENT_WRONG": "Úgy tűnik, valami hiba történt.",
|
|
406
406
|
"MENTION_UPTO": "Megemlítheti akár",
|
|
407
407
|
"TIME": "idő",
|
|
408
408
|
"TIMES": "alkalmak",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "Alkalmazás hitelesítő adatai",
|
|
443
443
|
"REGION": "Régió",
|
|
444
444
|
"WRONG_TEXT":"Úgy tűnik, valami félrement.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"Kérjük, próbáld meg újra."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"Kérjük, próbáld meg újra.",
|
|
446
|
+
"BLOCKED_USER_DESC": "Nem lehet üzenetet küldeni, mert a felhasználó le van tiltva"
|
|
446
447
|
}
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
"TAP_TO_REMOVE": "Tocca per rimuovere",
|
|
403
403
|
"ADD_CONTACTS": "Aggiungi contatti per iniziare conversazioni e vederli elencati qui.",
|
|
404
404
|
"SCOPE_CHANGE_INFO": "Puoi cambiare ruoli per gestire le autorizzazioni e le responsabilità del gruppo",
|
|
405
|
-
"SOMETHING_WENT_WRONG": "
|
|
405
|
+
"SOMETHING_WENT_WRONG": "Atrodo, kažkas nutiko ne taip.",
|
|
406
406
|
"MENTION_UPTO": "Puoi menzionare fino a",
|
|
407
407
|
"TIME": "tempo",
|
|
408
408
|
"TIMES": "volte",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "Programėlės prisijungimo duomenys",
|
|
443
443
|
"REGION": "Regionas",
|
|
444
444
|
"WRONG_TEXT":"Atrodo, kažkas nutiko ne taip.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"Prašome bandyti dar kartą."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"Prašome bandyti dar kartą.",
|
|
446
|
+
"BLOCKED_USER_DESC": "Negalima išsiųsti žinutės, nes naudotojas yra užblokuotas"
|
|
446
447
|
}
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
"TAP_TO_REMOVE": "Ketik untuk membuang",
|
|
403
403
|
"ADD_CONTACTS": "Tambah kenalan untuk memulakan perbualan dan lihat senarai di sini.",
|
|
404
404
|
"SCOPE_CHANGE_INFO": "Anda boleh menukar peranan untuk menguruskan kebenaran dan tanggungjawab kumpulan",
|
|
405
|
-
"SOMETHING_WENT_WRONG": "Nampaknya
|
|
405
|
+
"SOMETHING_WENT_WRONG": "Nampaknya sesuatu telah berlaku kesilapan.",
|
|
406
406
|
"MENTION_UPTO": "Anda boleh menyebut sehingga",
|
|
407
407
|
"TIME": "masa",
|
|
408
408
|
"TIMES": "kali",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "Kredensial Aplikasi",
|
|
443
443
|
"REGION": "Wilayah",
|
|
444
444
|
"WRONG_TEXT":"Nampaknya ada sesuatu yang tidak kena.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"Sila cuba lagi."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"Sila cuba lagi.",
|
|
446
|
+
"BLOCKED_USER_DESC": "Tidak dapat menghantar mesej kerana pengguna telah disekat"
|
|
446
447
|
}
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
"TAP_TO_REMOVE": "Toque para remover",
|
|
403
403
|
"ADD_CONTACTS": "Adicione contatos para iniciar conversas e vê-los listados aqui.",
|
|
404
404
|
"SCOPE_CHANGE_INFO": "Você pode alterar os papéis para gerenciar permissões e responsabilidades do grupo",
|
|
405
|
-
"SOMETHING_WENT_WRONG": "Parece que algo deu errado.
|
|
405
|
+
"SOMETHING_WENT_WRONG": "Parece que algo deu errado.",
|
|
406
406
|
"MENTION_UPTO": "Você pode mencionar até",
|
|
407
407
|
"TIME": "horas",
|
|
408
408
|
"TIMES": "vezes",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "Credenciais do aplicativo",
|
|
443
443
|
"REGION": "Região",
|
|
444
444
|
"WRONG_TEXT":"Parece que algo deu errado.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"Por favor, tente novamente."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"Por favor, tente novamente.",
|
|
446
|
+
"BLOCKED_USER_DESC": "Não é possível enviar uma mensagem, pois o usuário está bloqueado"
|
|
446
447
|
}
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
"TAP_TO_REMOVE": "Нажмите, чтобы удалить",
|
|
403
403
|
"ADD_CONTACTS": "Добавьте контакты, чтобы начать разговоры, и они отобразятся здесь.",
|
|
404
404
|
"SCOPE_CHANGE_INFO": "Вы можете изменить роли, чтобы управлять разрешениями и обязанностями группы",
|
|
405
|
-
"SOMETHING_WENT_WRONG": "Похоже, что-то пошло не так.
|
|
405
|
+
"SOMETHING_WENT_WRONG": "Похоже, что-то пошло не так.",
|
|
406
406
|
"MENTION_UPTO": "Вы можете упомянуть до",
|
|
407
407
|
"TIME": "время",
|
|
408
408
|
"TIMES": "раз",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "Учетные данные приложения",
|
|
443
443
|
"REGION": "Регион",
|
|
444
444
|
"WRONG_TEXT":"Похоже, что что-то пошло не так.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"Пожалуйста, попробуйте ещё раз."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"Пожалуйста, попробуйте ещё раз.",
|
|
446
|
+
"BLOCKED_USER_DESC": "Невозможно отправить сообщение, так как пользователь заблокирован"
|
|
446
447
|
}
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
"TAP_TO_REMOVE": "Tryck för att ta bort",
|
|
403
403
|
"ADD_CONTACTS": "Lägg till kontakter för att starta konversationer och se dem listade här.",
|
|
404
404
|
"SCOPE_CHANGE_INFO": "Du kan ändra roller för att hantera gruppbehörigheter och ansvar",
|
|
405
|
-
"SOMETHING_WENT_WRONG": "Det verkar som att något gick fel.
|
|
405
|
+
"SOMETHING_WENT_WRONG": "Det verkar som att något gick fel.",
|
|
406
406
|
"MENTION_UPTO": "Du kan nämna upp till",
|
|
407
407
|
"TIME": "tid",
|
|
408
408
|
"TIMES": "gånger",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "Appreferenser",
|
|
443
443
|
"REGION": "Region",
|
|
444
444
|
"WRONG_TEXT":"Det verkar som att något gick fel.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"Vänligen försök igen."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"Vänligen försök igen.",
|
|
446
|
+
"BLOCKED_USER_DESC": "Kan inte skicka ett meddelande eftersom användaren är blockerad"
|
|
446
447
|
}
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
"TAP_TO_REMOVE": "点按即可移除",
|
|
403
403
|
"ADD_CONTACTS": " 添加联系人以开始对话并在此处查看列表。",
|
|
404
404
|
"SCOPE_CHANGE_INFO": "您可以更改角色以管理组权限和职责",
|
|
405
|
-
"SOMETHING_WENT_WRONG": "
|
|
405
|
+
"SOMETHING_WENT_WRONG": "看起来出了点问题。",
|
|
406
406
|
"MENTION_UPTO": "你最多可以提一下",
|
|
407
407
|
"TIME": "时间",
|
|
408
408
|
"TIMES": "倍",
|
|
@@ -442,5 +442,6 @@
|
|
|
442
442
|
"APP_CREDENTIALS" : "应用凭据",
|
|
443
443
|
"REGION": "地区",
|
|
444
444
|
"WRONG_TEXT":"看起来出了点问题.",
|
|
445
|
-
"WRONG_TEXT_TRY_AGAIN":"请再试一次."
|
|
445
|
+
"WRONG_TEXT_TRY_AGAIN":"请再试一次.",
|
|
446
|
+
"BLOCKED_USER_DESC": "无法发送消息,因为用户已被屏蔽"
|
|
446
447
|
}
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
"TAP_TO_REMOVE": "點擊以移除",
|
|
402
402
|
"ADD_CONTACTS": "添加聯絡人以開始對話並在此處查看列表。",
|
|
403
403
|
"SCOPE_CHANGE_INFO": "您可以更改角色以管理群組權限和職責",
|
|
404
|
-
"SOMETHING_WENT_WRONG": "
|
|
404
|
+
"SOMETHING_WENT_WRONG": "看起來出了點問題。",
|
|
405
405
|
"MENTION_UPTO": "您最多可以提到",
|
|
406
406
|
"TIME": "時間",
|
|
407
407
|
"TIMES": "倍",
|
|
@@ -441,5 +441,6 @@
|
|
|
441
441
|
"APP_CREDENTIALS" : "應用程式憑證",
|
|
442
442
|
"REGION": "地區",
|
|
443
443
|
"WRONG_TEXT":"看起來出了點問題.",
|
|
444
|
-
"WRONG_TEXT_TRY_AGAIN":"請再試一次."
|
|
444
|
+
"WRONG_TEXT_TRY_AGAIN":"請再試一次.",
|
|
445
|
+
"BLOCKED_USER_DESC": "無法傳送訊息,因為該用戶已被封鎖"
|
|
445
446
|
}
|
|
@@ -19,12 +19,15 @@ import { deepMerge } from "../helper/helperFunctions";
|
|
|
19
19
|
import { CometChatDate } from "../views/CometChatDate";
|
|
20
20
|
import { CometChatAvatar, CometChatReceipt } from "../views";
|
|
21
21
|
|
|
22
|
-
type
|
|
22
|
+
type MessageViewParamsType = {
|
|
23
23
|
message: CometChat.BaseMessage;
|
|
24
24
|
templates?: CometChatMessageTemplate[];
|
|
25
25
|
alignment?: MessageBubbleAlignmentType;
|
|
26
26
|
theme: CometChatTheme;
|
|
27
27
|
isThreaded?: boolean;
|
|
28
|
+
datePattern?: (message: CometChat.BaseMessage) => string;
|
|
29
|
+
receiptsVisibility?: boolean;
|
|
30
|
+
avatarVisibility?: boolean;
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
const getOverridenBubbleStyles = (theme: CometChatTheme) => {
|
|
@@ -130,9 +133,13 @@ const MessageContentView = (props: {
|
|
|
130
133
|
};
|
|
131
134
|
|
|
132
135
|
const getLeadingView = useCallback(
|
|
133
|
-
(
|
|
136
|
+
(
|
|
137
|
+
item: CometChat.BaseMessage,
|
|
138
|
+
theme: CometChatTheme,
|
|
139
|
+
avatarVisibility = true
|
|
140
|
+
): JSX.Element | undefined => {
|
|
141
|
+
if (!avatarVisibility) return undefined;
|
|
134
142
|
let _style = getBubbleStyle(item, theme);
|
|
135
|
-
|
|
136
143
|
if (
|
|
137
144
|
item.getSender()?.getUid() !== CometChatUIKit.loggedInUser?.getUid() &&
|
|
138
145
|
item.getCategory() != MessageCategoryConstants.action
|
|
@@ -215,7 +222,9 @@ const getStatusInfoView = (
|
|
|
215
222
|
| CometChat.InteractiveMessage
|
|
216
223
|
| CometChat.BaseMessage
|
|
217
224
|
| any,
|
|
218
|
-
theme: CometChatTheme
|
|
225
|
+
theme: CometChatTheme,
|
|
226
|
+
receiptsVisibility: boolean = true,
|
|
227
|
+
datePattern?: (message: CometChat.BaseMessage) => string
|
|
219
228
|
): JSX.Element | undefined => {
|
|
220
229
|
const loggedInUser = CometChatUIKit.loggedInUser!;
|
|
221
230
|
|
|
@@ -243,13 +252,14 @@ const getStatusInfoView = (
|
|
|
243
252
|
>
|
|
244
253
|
<CometChatDate
|
|
245
254
|
timeStamp={
|
|
246
|
-
(item.getDeletedAt() || item.
|
|
255
|
+
(item.getDeletedAt() || item.getSentAt()) *
|
|
247
256
|
1000 || getSentAtTimestamp(item)
|
|
248
257
|
}
|
|
249
258
|
pattern={"timeFormat"}
|
|
259
|
+
customDateString={datePattern && datePattern(item)}
|
|
250
260
|
style={_style.dateStyles}
|
|
251
261
|
/>
|
|
252
|
-
{isOutgoingMessage ? (
|
|
262
|
+
{receiptsVisibility && isOutgoingMessage ? (
|
|
253
263
|
/* ToDoM Use Icon From Incoming/Outgoing bubble styles */
|
|
254
264
|
<View style={{ marginLeft: 2, alignItems: "center", justifyContent: "center" }}>
|
|
255
265
|
<CometChatReceipt
|
|
@@ -269,8 +279,16 @@ const getStatusInfoView = (
|
|
|
269
279
|
};
|
|
270
280
|
|
|
271
281
|
export const MessageUtils = {
|
|
272
|
-
getMessageView: (params:
|
|
273
|
-
const {
|
|
282
|
+
getMessageView: (params: MessageViewParamsType) => {
|
|
283
|
+
const {
|
|
284
|
+
message,
|
|
285
|
+
templates,
|
|
286
|
+
alignment,
|
|
287
|
+
theme,
|
|
288
|
+
datePattern,
|
|
289
|
+
receiptsVisibility,
|
|
290
|
+
avatarVisibility,
|
|
291
|
+
} = params;
|
|
274
292
|
const templatesMap = getTemplatesMap(templates!);
|
|
275
293
|
let hasTemplate = templatesMap.get(`${message.getCategory()}_${message.getType()}`);
|
|
276
294
|
if (templates!.length > 0) {
|
|
@@ -292,7 +310,9 @@ export const MessageUtils = {
|
|
|
292
310
|
MessageContentView({ message, alignment: alignment!, theme: theme! })
|
|
293
311
|
}
|
|
294
312
|
LeadingView={
|
|
295
|
-
message.getReceiverType() === "group"
|
|
313
|
+
message.getReceiverType() === "group"
|
|
314
|
+
? getLeadingView(message, theme, avatarVisibility)
|
|
315
|
+
: undefined
|
|
296
316
|
}
|
|
297
317
|
HeaderView={
|
|
298
318
|
message.getReceiverType() === "group" ? getHeaderView(message, theme) : undefined
|
|
@@ -300,7 +320,7 @@ export const MessageUtils = {
|
|
|
300
320
|
BottomView={hasTemplate?.BottomView && hasTemplate?.BottomView(message, alignment!)}
|
|
301
321
|
StatusInfoView={
|
|
302
322
|
(hasTemplate?.StatusInfoView && hasTemplate!.StatusInfoView(message, alignment!)) ||
|
|
303
|
-
getStatusInfoView(message, theme)
|
|
323
|
+
getStatusInfoView(message, theme, receiptsVisibility, datePattern)
|
|
304
324
|
}
|
|
305
325
|
style={style}
|
|
306
326
|
/>
|
|
@@ -311,23 +331,24 @@ export const MessageUtils = {
|
|
|
311
331
|
export const getMessagePreviewInternal = (
|
|
312
332
|
iconName: IconName,
|
|
313
333
|
text: string,
|
|
314
|
-
{iconColor, theme}
|
|
334
|
+
{ iconColor, theme }: { iconColor?: ColorValue; theme?: CometChatTheme }
|
|
315
335
|
) => {
|
|
316
|
-
|
|
317
336
|
return (
|
|
318
337
|
<>
|
|
319
|
-
{iconName &&
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
338
|
+
{iconName && (
|
|
339
|
+
<Icon
|
|
340
|
+
name={iconName}
|
|
341
|
+
size={theme?.spacing?.spacing?.s4}
|
|
342
|
+
color={iconColor || theme?.color?.textSecondary}
|
|
343
|
+
containerStyle={{ marginRight: theme?.spacing?.spacing?.s0_5 }}
|
|
344
|
+
/>
|
|
345
|
+
)}
|
|
325
346
|
<Text
|
|
326
347
|
numberOfLines={1}
|
|
327
348
|
ellipsizeMode='tail'
|
|
328
349
|
style={{
|
|
329
|
-
color: theme
|
|
330
|
-
...theme
|
|
350
|
+
color: theme?.color?.textSecondary,
|
|
351
|
+
...theme?.typography?.body?.regular,
|
|
331
352
|
flexShrink: 2,
|
|
332
353
|
}}
|
|
333
354
|
>
|
|
@@ -47,7 +47,7 @@ export class CometChatConversationUtils {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
if (lastMessage.getCategory() == "call") {
|
|
50
|
-
let color: ColorValue = theme
|
|
50
|
+
let color: ColorValue | undefined = theme?.color?.textSecondary;
|
|
51
51
|
let text = "Video call";
|
|
52
52
|
let iconName: IconName = "phone-incoming-fill";
|
|
53
53
|
if (lastMessage.getType() == "audio") {
|
|
@@ -56,7 +56,7 @@ export class CometChatConversationUtils {
|
|
|
56
56
|
if (uid === lastMessage.getSender().getUid()) {
|
|
57
57
|
iconName = "phone-outgoing-fill";
|
|
58
58
|
} else if ((lastMessage as CometChat.Call).getAction() === "unanswered") {
|
|
59
|
-
color = theme
|
|
59
|
+
color = theme?.color?.error;
|
|
60
60
|
text = "Missed " + text.toLowerCase();
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -4,22 +4,43 @@ import { useCompTheme, useTheme } from "../../../theme/hook";
|
|
|
4
4
|
import { CometChatTheme } from "../../../theme/type";
|
|
5
5
|
import { deepMerge } from "../../helper/helperFunctions";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Properties for the CometChatAvatar component.
|
|
9
|
+
*/
|
|
7
10
|
interface CometChatAvatarProps {
|
|
11
|
+
/**
|
|
12
|
+
* The image source for the avatar.
|
|
13
|
+
* Can be a remote URI string, an object with a URI property, or a local require() number.
|
|
14
|
+
*/
|
|
8
15
|
image?: ImageSourcePropType;
|
|
16
|
+
/**
|
|
17
|
+
* The name to display if no valid image is provided.
|
|
18
|
+
*/
|
|
9
19
|
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Custom style for the avatar component, overriding theme styles.
|
|
22
|
+
*/
|
|
10
23
|
style?: CometChatTheme["avatarStyle"];
|
|
11
24
|
}
|
|
12
25
|
|
|
26
|
+
/**
|
|
27
|
+
* A functional component that renders a user's avatar.
|
|
28
|
+
*
|
|
29
|
+
* Props for the avatar.
|
|
30
|
+
* The rendered avatar view.
|
|
31
|
+
*/
|
|
13
32
|
export const CometChatAvatar = (props: CometChatAvatarProps) => {
|
|
14
33
|
const theme = useTheme();
|
|
15
34
|
const compTheme = useCompTheme();
|
|
16
35
|
|
|
17
36
|
const { image, name, style = {} } = props;
|
|
18
37
|
|
|
38
|
+
// Merges theme styles with component styles and custom styles.
|
|
19
39
|
const avatarStyle = useMemo(() => {
|
|
20
40
|
return deepMerge(theme.avatarStyle, compTheme.avatarStyle ?? {}, style);
|
|
21
41
|
}, [theme.avatarStyle, style, compTheme.avatarStyle]);
|
|
22
42
|
|
|
43
|
+
// Returns an Image view if a valid image is provided, otherwise a text view with initials.
|
|
23
44
|
const getImageView = useCallback(() => {
|
|
24
45
|
const imageSource = typeof image === "string" ? { uri: image } : image;
|
|
25
46
|
if (
|
|
@@ -34,4 +55,4 @@ export const CometChatAvatar = (props: CometChatAvatarProps) => {
|
|
|
34
55
|
}, [image, name, avatarStyle.imageStyle, avatarStyle.textStyle]);
|
|
35
56
|
|
|
36
57
|
return <View style={[avatarStyle.containerStyle]}>{getImageView()}</View>;
|
|
37
|
-
};
|
|
58
|
+
};
|
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
2
|
import { Text, View } from "react-native";
|
|
3
3
|
import { useTheme } from "../../../theme";
|
|
4
|
-
import { useCompTheme } from "../../../theme/hook";
|
|
5
4
|
import { deepMerge } from "../../helper/helperFunctions";
|
|
6
5
|
import { BadgeStyle } from "./styles";
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
10
|
-
* CometChatBadge is a component useful when returning the number of unread messages in a chat.
|
|
11
|
-
* This component is used to return the unread message count with custom style.
|
|
12
|
-
*
|
|
13
|
-
* @author CometChat
|
|
14
|
-
*
|
|
8
|
+
* Props for the CometChatBadge component.
|
|
15
9
|
*/
|
|
16
10
|
export interface CometChatBadgeProps {
|
|
11
|
+
/**
|
|
12
|
+
* The count to display on the badge.
|
|
13
|
+
* If the count exceeds 999, it will be shown as "999+".
|
|
14
|
+
*/
|
|
17
15
|
count: number | string;
|
|
16
|
+
/**
|
|
17
|
+
* Custom style for the badge.
|
|
18
|
+
*/
|
|
18
19
|
style?: Partial<BadgeStyle>;
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* CometChatBadge component renders the unread message count as a badge.
|
|
24
|
+
*
|
|
25
|
+
* This component returns a badge with custom styling that displays the number of unread messages.
|
|
26
|
+
*
|
|
27
|
+
* Props for the component.
|
|
28
|
+
* The rendered badge element or null if count is 0.
|
|
29
|
+
*/
|
|
21
30
|
export const CometChatBadge = (props: CometChatBadgeProps) => {
|
|
22
31
|
const { style = {}, count = 0 } = props;
|
|
23
32
|
const theme = useTheme();
|
|
24
33
|
|
|
34
|
+
// Merge the theme's badge style with any custom styles provided.
|
|
25
35
|
const badgeStyle = useMemo(() => {
|
|
26
36
|
return deepMerge(theme.badgeStyle, style ?? {});
|
|
27
37
|
}, [theme.badgeStyle, style]);
|
|
28
38
|
|
|
39
|
+
// Convert count to text, formatting as "999+" if count is greater than 999.
|
|
29
40
|
const countText: string = useMemo(() => {
|
|
30
41
|
if (Number.isInteger(count)) {
|
|
31
42
|
if ((count as number) === 0) return "";
|
|
@@ -35,6 +46,7 @@ export const CometChatBadge = (props: CometChatBadgeProps) => {
|
|
|
35
46
|
return count.toString();
|
|
36
47
|
}, [count]);
|
|
37
48
|
|
|
49
|
+
// If count is zero or an empty string, do not render the badge.
|
|
38
50
|
if (countText.length === 0) return null;
|
|
39
51
|
|
|
40
52
|
return (
|
|
@@ -42,4 +54,4 @@ export const CometChatBadge = (props: CometChatBadgeProps) => {
|
|
|
42
54
|
<Text style={[badgeStyle.textStyle]}>{countText}</Text>
|
|
43
55
|
</View>
|
|
44
56
|
);
|
|
45
|
-
};
|
|
57
|
+
};
|