@cometchat/chat-uikit-react-native 4.0.0 → 4.0.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/LICENSE.md +3 -0
- package/README.md +1 -1
- package/lib/AI/AIConversationStarter/AIConversationStarter.d.ts +12 -0
- package/lib/AI/AIConversationStarter/AIConversationStarter.js +31 -0
- package/lib/AI/AIConversationStarter/AIConversationStarter.js.map +1 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.d.ts +25 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js +175 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js.map +1 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterStyle.d.ts +4 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js +8 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js.map +1 -0
- package/lib/AI/AIConversationStarter/configuration.d.ts +14 -0
- package/lib/AI/AIConversationStarter/configuration.js +16 -0
- package/lib/AI/AIConversationStarter/configuration.js.map +1 -0
- package/lib/AI/AIConversationStarter/style.d.ts +31 -0
- package/lib/AI/AIConversationStarter/style.js +62 -0
- package/lib/AI/AIConversationStarter/style.js.map +1 -0
- package/lib/AI/AIEnabler.d.ts +10 -0
- package/lib/AI/AIEnabler.js +102 -0
- package/lib/AI/AIEnabler.js.map +1 -0
- package/lib/AI/AIEnablerDecorator.d.ts +43 -0
- package/lib/AI/AIEnablerDecorator.js +251 -0
- package/lib/AI/AIEnablerDecorator.js.map +1 -0
- package/lib/AI/AIExtensionDataSource.d.ts +6 -0
- package/lib/AI/AIExtensionDataSource.js +10 -0
- package/lib/AI/AIExtensionDataSource.js.map +1 -0
- package/lib/AI/AISmartReplies/AISmartReplies.d.ts +10 -0
- package/lib/AI/AISmartReplies/AISmartReplies.js +23 -0
- package/lib/AI/AISmartReplies/AISmartReplies.js.map +1 -0
- package/lib/AI/AISmartReplies/AISmartRepliesDecorator.d.ts +7 -0
- package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js +12 -0
- package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js.map +1 -0
- package/lib/AI/AISmartReplies/AISmartRepliesStyle.d.ts +12 -0
- package/lib/AI/AISmartReplies/AISmartRepliesStyle.js +15 -0
- package/lib/AI/AISmartReplies/AISmartRepliesStyle.js.map +1 -0
- package/lib/AI/AISmartReplies/configuration.d.ts +14 -0
- package/lib/AI/AISmartReplies/configuration.js +16 -0
- package/lib/AI/AISmartReplies/configuration.js.map +1 -0
- package/lib/AI/CardView.d.ts +19 -0
- package/lib/AI/CardView.js +45 -0
- package/lib/AI/CardView.js.map +1 -0
- package/lib/AI/CardViewStyle.d.ts +29 -0
- package/lib/AI/CardViewStyle.js +36 -0
- package/lib/AI/CardViewStyle.js.map +1 -0
- package/lib/AI/configuration.d.ts +14 -0
- package/lib/AI/configuration.js +16 -0
- package/lib/AI/configuration.js.map +1 -0
- package/lib/AI/resources/index.d.ts +5 -0
- package/lib/AI/resources/index.js +6 -0
- package/lib/AI/resources/index.js.map +1 -0
- package/lib/AI/style.d.ts +115 -0
- package/lib/AI/style.js +139 -0
- package/lib/AI/style.js.map +1 -0
- package/lib/AI/utils.d.ts +38 -0
- package/lib/AI/utils.js +28 -0
- package/lib/AI/utils.js.map +1 -0
- package/lib/CometChatConversations/ConversationsConfiguration.d.ts +0 -1
- package/lib/CometChatDetails/DetailsConfiguration.d.ts +0 -1
- package/lib/CometChatGroupMembers/GroupMemberConfiguration.d.ts +0 -1
- package/lib/CometChatGroups/GroupsConfiguration.d.ts +0 -1
- package/lib/CometChatMessageComposer/CometChatMessageComposer.js +7 -1
- package/lib/CometChatMessageComposer/CometChatMessageComposer.js.map +1 -1
- package/lib/CometChatMessageHeader/MessageHeaderConfiguration.d.ts +0 -1
- package/lib/CometChatMessageList/CometChatMessageList.js +49 -18
- package/lib/CometChatMessageList/CometChatMessageList.js.map +1 -1
- package/lib/CometChatMessageList/MessageListConfiguration.d.ts +0 -1
- package/lib/CometChatMessages/MessagesConfiguration.d.ts +0 -1
- package/lib/CometChatTabs/TabItems.d.ts +0 -1
- package/lib/CometChatThreadedMessages/ThreadedMessagesConfiguration.d.ts +0 -1
- package/lib/calls/CometChatCallDetails/CallDetailsConfiguration.d.ts +0 -1
- package/lib/calls/CometChatCallHistory/CallHistoryConfiguration.d.ts +0 -1
- package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js +3 -3
- package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js.map +1 -1
- package/lib/extensions/ImageModeration/ImageModerationDecorator.d.ts +0 -1
- package/lib/extensions/ImageModeration/ImageModerationFilter.js +4 -4
- package/lib/extensions/ImageModeration/ImageModerationFilter.js.map +1 -1
- package/lib/extensions/LinkPreview/LinkPreviewExtentionDecorator.d.ts +0 -1
- package/lib/extensions/MessageTranslation/MessageTranslationDecorator.d.ts +0 -1
- package/lib/extensions/SmartReplies/SmartRepliesDecorator.js +1 -1
- package/lib/extensions/SmartReplies/SmartRepliesDecorator.js.map +1 -1
- package/lib/extensions/Stickers/StickersExtensionDecorator.d.ts +1 -1
- package/lib/extensions/Stickers/StickersExtensionDecorator.js +4 -2
- package/lib/extensions/Stickers/StickersExtensionDecorator.js.map +1 -1
- package/lib/extensions/TextModeration/TextModerationExtensionDecorator.d.ts +0 -1
- package/lib/index.d.ts +13 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.d.ts +2 -0
- package/lib/shared/CometChatUiKit/CometChatUIKit.js +13 -2
- package/lib/shared/CometChatUiKit/CometChatUIKit.js.map +1 -1
- package/lib/shared/CometChatUiKit/UIKitSettings.d.ts +5 -1
- package/lib/shared/CometChatUiKit/UIKitSettings.js +3 -1
- package/lib/shared/CometChatUiKit/UIKitSettings.js.map +1 -1
- package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js +2 -0
- package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js.map +1 -1
- package/lib/shared/events/CometChatUIEventHandler/Listener.d.ts +3 -1
- package/lib/shared/events/CometChatUIEventHandler/Listener.js +4 -1
- package/lib/shared/events/CometChatUIEventHandler/Listener.js.map +1 -1
- package/lib/shared/events/CometChatUIEvents.d.ts +2 -1
- package/lib/shared/events/CometChatUIEvents.js +1 -0
- package/lib/shared/events/CometChatUIEvents.js.map +1 -1
- package/lib/shared/framework/DataSource.d.ts +1 -2
- package/lib/shared/framework/DataSourceDecorator.d.ts +1 -2
- package/lib/shared/framework/DataSourceDecorator.js +2 -2
- package/lib/shared/framework/DataSourceDecorator.js.map +1 -1
- package/lib/shared/framework/MessageDataSource.d.ts +1 -1
- package/lib/shared/framework/MessageDataSource.js +2 -2
- package/lib/shared/framework/MessageDataSource.js.map +1 -1
- package/lib/shared/helper/types/index.d.ts +0 -1
- package/lib/shared/modals/CometChatDetailsOption.d.ts +0 -1
- package/lib/shared/modals/CometChatMessageOption.d.ts +0 -1
- package/lib/shared/modals/CometChatMessageTemplate.d.ts +0 -1
- package/lib/shared/resources/CometChatLocalize/CometChatLocalize.d.ts +230 -153
- package/lib/shared/resources/CometChatLocalize/resources/ar/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/de/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/en/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/es/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/fr/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/hi/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/lt/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/ms/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/pt/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/ru/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/sv/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/zh/translation.json +4 -0
- package/lib/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +4 -0
- package/package.json +3 -3
- package/src/AI/AIConversationStarter/AIConversationStarter.ts +33 -0
- package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +232 -0
- package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +8 -0
- package/src/AI/AIConversationStarter/configuration.ts +18 -0
- package/src/AI/AIConversationStarter/style.ts +76 -0
- package/src/AI/AIEnabler.ts +115 -0
- package/src/AI/AIEnablerDecorator.tsx +324 -0
- package/src/AI/AIExtensionDataSource.ts +12 -0
- package/src/AI/AISmartReplies/AISmartReplies.ts +28 -0
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.ts +18 -0
- package/src/AI/AISmartReplies/AISmartRepliesStyle.ts +16 -0
- package/src/AI/AISmartReplies/configuration.ts +17 -0
- package/src/AI/CardView.tsx +81 -0
- package/src/AI/CardViewStyle.ts +37 -0
- package/src/AI/configuration.ts +17 -0
- package/src/AI/resources/ai-empty.png +0 -0
- package/src/AI/resources/ai-error.png +0 -0
- package/src/AI/resources/ai.png +0 -0
- package/src/AI/resources/index.ts +11 -0
- package/src/AI/resources/spineer.png +0 -0
- package/src/AI/style.ts +177 -0
- package/src/AI/utils.ts +39 -0
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +13 -4
- package/src/CometChatMessageList/CometChatMessageList.tsx +24 -17
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +1 -1
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +4 -2
- package/src/index.ts +15 -0
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +20 -7
- package/src/shared/CometChatUiKit/UIKitSettings.ts +8 -0
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +2 -0
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +5 -1
- package/src/shared/events/CometChatUIEvents.ts +1 -0
- package/src/shared/framework/DataSource.ts +1 -1
- package/src/shared/framework/DataSourceDecorator.tsx +2 -2
- package/src/shared/framework/MessageDataSource.tsx +2 -2
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +4 -0
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +4 -0
- package/LICENSE +0 -21
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.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/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/.gitignore +0 -3
- package/android/.idea/gradle.xml +0 -13
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
- package/src/.DS_Store +0 -0
- package/src/CometChatMessageInformation/.DS_Store +0 -0
- package/src/calls/CometChatCallHistory/.DS_Store +0 -0
- package/src/shared/framework/.DS_Store +0 -0
- package/src/shared/views/.DS_Store +0 -0
- package/src/shared/views/CometChatAudioBubble/.DS_Store +0 -0
- package/src/shared/views/CometChatFileBubble/.DS_Store +0 -0
|
@@ -13,10 +13,14 @@
|
|
|
13
13
|
"CUSTOM_MESSAGE_POLL": "📊 استطلاع للرأي",
|
|
14
14
|
"CUSTOM_MESSAGE_STICKER": "💟 ملصق",
|
|
15
15
|
"CUSTOM_MESSAGE_DOCUMENT": "📃 وثيقة",
|
|
16
|
+
"NO_REPLIES_FOUND": "لم يتم العثور على أي ردود",
|
|
16
17
|
"CUSTOM_MESSAGE_WHITEBOARD": "📝 السبورة",
|
|
17
18
|
"ONLINE": "عبر الإنترنت",
|
|
18
19
|
"ADMINISTRATOR": "مدير",
|
|
19
20
|
"MODERATOR": "مدير الجلسة",
|
|
21
|
+
"SUGGEST_A_REPLIES": "اقترح ردًا",
|
|
22
|
+
"GENERATIONG_ICEBREAKER": "توليد كاسحات الجليد",
|
|
23
|
+
"GENERATING_REPLIES": "توليد الردود",
|
|
20
24
|
"PARTICIPANT": "مشارك",
|
|
21
25
|
"PUBLIC": "عامة",
|
|
22
26
|
"PRIVATE": "خاص",
|
|
@@ -13,13 +13,17 @@
|
|
|
13
13
|
"CUSTOM_MESSAGE_POLL": "📊 Umfrage",
|
|
14
14
|
"CUSTOM_MESSAGE_STICKER": "💟 Aufkleber",
|
|
15
15
|
"CUSTOM_MESSAGE_DOCUMENT": "📃 Dokument",
|
|
16
|
+
"NO_REPLIES_FOUND": "Keine Antworten gefunden",
|
|
16
17
|
"CUSTOM_MESSAGE_WHITEBOARD": "📝 Whiteboard",
|
|
17
18
|
"ONLINE": "Online",
|
|
18
19
|
"ADMINISTRATOR": "Verwalter",
|
|
19
20
|
"MODERATOR": "Moderator",
|
|
21
|
+
"GENERATING_REPLIES": "Antworten generieren",
|
|
20
22
|
"PARTICIPANT": "Teilnehmerin",
|
|
21
23
|
"PUBLIC": "Öffentlich",
|
|
22
24
|
"PRIVATE": "Privat",
|
|
25
|
+
"SUGGEST_A_REPLIES": "Schlage eine Antwort vor",
|
|
26
|
+
"GENERATIONG_ICEBREAKER": "Eisbrecher erzeugen",
|
|
23
27
|
"PASSWORD_PROTECTED": "Passwort-geschützt",
|
|
24
28
|
"PRIVACY_AND_SECURITY": "Datenschutz und Sicherheit",
|
|
25
29
|
"PREFERENCES": "Präferenzen",
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
"ADMINISTRATOR": "Administrator",
|
|
19
19
|
"MODERATOR": "Moderator",
|
|
20
20
|
"PARTICIPANT": "Participant",
|
|
21
|
+
"SUGGEST_A_REPLIES": "Suggest a reply",
|
|
22
|
+
"GENERATIONG_ICEBREAKER": "Generating icebreakers",
|
|
21
23
|
"PUBLIC": "Public",
|
|
24
|
+
"NO_REPLIES_FOUND": "No Replies Found",
|
|
22
25
|
"PRIVATE": "Private",
|
|
23
26
|
"PASSWORD_PROTECTED": "Password Protected",
|
|
24
27
|
"PRIVACY_AND_SECURITY": "Privacy and Security",
|
|
@@ -215,6 +218,7 @@
|
|
|
215
218
|
"NO_PHOTOS": "No Photos",
|
|
216
219
|
"NO_VIDEOS": "No Videos",
|
|
217
220
|
"NO_DOCUMENTS": "No Documents",
|
|
221
|
+
"GENERATING_REPLIES": "Generating replies",
|
|
218
222
|
"JOIN": "Join",
|
|
219
223
|
"DELETE_CONFIRM_MESSAGE": "Would you like to delete this conversation? This conversation will be deleted from all of your devices.",
|
|
220
224
|
"CHAT_ERROR_MESSAGE": "Can't load chats. Please try again",
|
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
"ONLINE": "En línea",
|
|
18
18
|
"ADMINISTRATOR": "Administrador",
|
|
19
19
|
"MODERATOR": "Moderador",
|
|
20
|
+
"NO_REPLIES_FOUND": "No se encontraron respuestas",
|
|
20
21
|
"PARTICIPANT": "Participante",
|
|
22
|
+
"GENERATING_REPLIES": "Generación de respuestas",
|
|
23
|
+
"SUGGEST_A_REPLIES": "Sugerir una respuesta",
|
|
24
|
+
"GENERATIONG_ICEBREAKER": "Generando rompehielos",
|
|
21
25
|
"PUBLIC": "Público",
|
|
22
26
|
"PRIVATE": "Privado",
|
|
23
27
|
"PASSWORD_PROTECTED": "Protegido con contraseña",
|
|
@@ -17,8 +17,12 @@
|
|
|
17
17
|
"ONLINE": "En ligne",
|
|
18
18
|
"ADMINISTRATOR": "Administrateur",
|
|
19
19
|
"MODERATOR": "Modérateur",
|
|
20
|
+
"NO_REPLIES_FOUND": "Aucune réponse trouvée",
|
|
20
21
|
"PARTICIPANT": "Participant",
|
|
22
|
+
"GENERATING_REPLIES": "Génération de réponses",
|
|
21
23
|
"PUBLIC": "Public",
|
|
24
|
+
"SUGGEST_A_REPLIES": "Suggérer une réponse",
|
|
25
|
+
"GENERATIONG_ICEBREAKER": "Génération de brise-glaces",
|
|
22
26
|
"PRIVATE": "Privé",
|
|
23
27
|
"PASSWORD_PROTECTED": "Mot de passe",
|
|
24
28
|
"PRIVACY_AND_SECURITY": "Confidentialité et sécurité",
|
|
@@ -13,12 +13,16 @@
|
|
|
13
13
|
"CUSTOM_MESSAGE_POLL": "📊 पोल",
|
|
14
14
|
"CUSTOM_MESSAGE_STICKER": "💟 स्टीकर",
|
|
15
15
|
"CUSTOM_MESSAGE_DOCUMENT": "📃 दस्तावेज़",
|
|
16
|
+
"SUGGEST_A_REPLIES": "जवाब सुझाएं",
|
|
17
|
+
"GENERATIONG_ICEBREAKER": "आइसब्रेकर उत्पन्न करना",
|
|
16
18
|
"CUSTOM_MESSAGE_WHITEBOARD": "📝 व्हाइटबोर्ड",
|
|
17
19
|
"ONLINE": "ऑनलाइन",
|
|
20
|
+
"NO_REPLIES_FOUND": "कोई जवाब नहीं मिला",
|
|
18
21
|
"ADMINISTRATOR": "प्रशासक",
|
|
19
22
|
"MODERATOR": "मॉडरेटर",
|
|
20
23
|
"PARTICIPANT": "प्रतिभागी",
|
|
21
24
|
"PUBLIC": "पब्लिक",
|
|
25
|
+
"GENERATING_REPLIES": "जवाब जनरेट करना",
|
|
22
26
|
"PRIVATE": "निजी",
|
|
23
27
|
"PASSWORD_PROTECTED": "कूटशब्द सुरक्षित",
|
|
24
28
|
"PRIVACY_AND_SECURITY": "गोपनीयता और सुरक्षा",
|
|
@@ -17,12 +17,16 @@
|
|
|
17
17
|
"ONLINE": "Prisijungę",
|
|
18
18
|
"ADMINISTRATOR": "Administratorius",
|
|
19
19
|
"MODERATOR": "Moderatorius",
|
|
20
|
+
"NO_REPLIES_FOUND": "Nessuna risposta trovata",
|
|
21
|
+
"SUGGEST_A_REPLIES": "Suggerisci una risposta",
|
|
22
|
+
"GENERATIONG_ICEBREAKER": "Generazione di rompighiaccio",
|
|
20
23
|
"PARTICIPANT": "Dalyvis",
|
|
21
24
|
"PUBLIC": "Vieša",
|
|
22
25
|
"PRIVATE": "Privati",
|
|
23
26
|
"PASSWORD_PROTECTED": "Apsaugota slaptažodžiu",
|
|
24
27
|
"PRIVACY_AND_SECURITY": "Privatumas ir saugumas",
|
|
25
28
|
"PREFERENCES": "Pasirinkimai",
|
|
29
|
+
"GENERATING_REPLIES": "Generazione di risposte",
|
|
26
30
|
"MEMBERS": "Nariai",
|
|
27
31
|
"TODAY": "Šiandien",
|
|
28
32
|
"YESTERDAY": "Vakar",
|
|
@@ -13,12 +13,16 @@
|
|
|
13
13
|
"CUSTOM_MESSAGE_POLL": "📊 Undian",
|
|
14
14
|
"CUSTOM_MESSAGE_STICKER": "💟 Pelekat",
|
|
15
15
|
"CUSTOM_MESSAGE_DOCUMENT": "📃 Dokumen",
|
|
16
|
+
"SUGGEST_A_REPLIES": "Cadangkan balasan",
|
|
17
|
+
"GENERATIONG_ICEBREAKER": "Menjana pemecah ais",
|
|
16
18
|
"CUSTOM_MESSAGE_WHITEBOARD": "📝 Papan Putih",
|
|
17
19
|
"ONLINE": "Dalam Talian",
|
|
20
|
+
"NO_REPLIES_FOUND": "Tiada Balasan Ditemui",
|
|
18
21
|
"ADMINISTRATOR": "Pentadbir",
|
|
19
22
|
"MODERATOR": "Moderator",
|
|
20
23
|
"PARTICIPANT": "Peserta",
|
|
21
24
|
"PUBLIC": "Awam",
|
|
25
|
+
"GENERATING_REPLIES": "Menjana balasan",
|
|
22
26
|
"PRIVATE": "Persendirian",
|
|
23
27
|
"PASSWORD_PROTECTED": "Dilindungi",
|
|
24
28
|
"PRIVACY_AND_SECURITY": "Privasi dan Keselamatan",
|
|
@@ -16,9 +16,13 @@
|
|
|
16
16
|
"CUSTOM_MESSAGE_WHITEBOARD": "📝 quadro branco",
|
|
17
17
|
"ONLINE": "On-line",
|
|
18
18
|
"ADMINISTRATOR": "Administrador",
|
|
19
|
+
"NO_REPLIES_FOUND": "Nenhuma resposta encontrada",
|
|
19
20
|
"MODERATOR": "Moderador",
|
|
20
21
|
"PARTICIPANT": "Participante",
|
|
22
|
+
"GENERATING_REPLIES": "Gerando respostas",
|
|
21
23
|
"PUBLIC": "Público",
|
|
24
|
+
"SUGGEST_A_REPLIES": "Sugira uma resposta",
|
|
25
|
+
"GENERATIONG_ICEBREAKER": "Gerando quebra-gelos",
|
|
22
26
|
"PRIVATE": "Privado",
|
|
23
27
|
"PASSWORD_PROTECTED": "Protegido por senha",
|
|
24
28
|
"PRIVACY_AND_SECURITY": "Privacidade e Segurança",
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
"MESSAGE_VIDEO": "📹 Видео",
|
|
9
9
|
"MESSAGE_AUDIO": "🎵 Аудио",
|
|
10
10
|
"CUSTOM_MESSAGE": "У вас есть сообщение",
|
|
11
|
+
"SUGGEST_A_REPLIES": "Предложите ответ",
|
|
12
|
+
"GENERATIONG_ICEBREAKER": "Генерация ледоколов",
|
|
11
13
|
"MISSED_VOICE_CALL": "Пропущенный голосовой вызов",
|
|
12
14
|
"MISSED_VIDEO_CALL": "Пропущенный видеовызов",
|
|
13
15
|
"CUSTOM_MESSAGE_POLL": "📊 Опрос",
|
|
@@ -15,7 +17,9 @@
|
|
|
15
17
|
"CUSTOM_MESSAGE_DOCUMENT": "📃 Документ",
|
|
16
18
|
"CUSTOM_MESSAGE_WHITEBOARD": "📝 Доска",
|
|
17
19
|
"ONLINE": "В сети",
|
|
20
|
+
"GENERATING_REPLIES": "Генерация ответов",
|
|
18
21
|
"ADMINISTRATOR": "Администратор",
|
|
22
|
+
"NO_REPLIES_FOUND": "Ответов не найдено",
|
|
19
23
|
"MODERATOR": "Модератор",
|
|
20
24
|
"PARTICIPANT": "Участник",
|
|
21
25
|
"PUBLIC": "Публичный",
|
|
@@ -16,8 +16,12 @@
|
|
|
16
16
|
"CUSTOM_MESSAGE_WHITEBOARD": "📝 Whiteboard",
|
|
17
17
|
"ONLINE": "Online",
|
|
18
18
|
"ADMINISTRATOR": "Administrator",
|
|
19
|
+
"SUGGEST_A_REPLIES": "Föreslå ett svar",
|
|
20
|
+
"GENERATIONG_ICEBREAKER": "Generera isbrytare",
|
|
21
|
+
"NO_REPLIES_FOUND": "Inga svar hittades",
|
|
19
22
|
"MODERATOR": "Moderator",
|
|
20
23
|
"PARTICIPANT": "Deltagare",
|
|
24
|
+
"GENERATING_REPLIES": "Generera svar",
|
|
21
25
|
"PUBLIC": "Publikt",
|
|
22
26
|
"PRIVATE": "Privat",
|
|
23
27
|
"PASSWORD_PROTECTED": "Lösenordsskyddat",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"MESSAGE_VIDEO": "📹 视频",
|
|
9
9
|
"MESSAGE_AUDIO": "🎵 音频",
|
|
10
10
|
"CUSTOM_MESSAGE": "你有一个消息",
|
|
11
|
+
"NO_REPLIES_FOUND": "未找到回复",
|
|
11
12
|
"MISSED_VOICE_CALL": "未接语音通话",
|
|
12
13
|
"MISSED_VIDEO_CALL": "未接视频通话",
|
|
13
14
|
"CUSTOM_MESSAGE_POLL": "📊 民意调查",
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
"ADMINISTRATOR": "管理员",
|
|
19
20
|
"MODERATOR": "版主",
|
|
20
21
|
"PARTICIPANT": "参与者",
|
|
22
|
+
"GENERATING_REPLIES": "生成回复",
|
|
21
23
|
"PUBLIC": "公开",
|
|
22
24
|
"PRIVATE": "私人",
|
|
23
25
|
"PASSWORD_PROTECTED": "密码保护",
|
|
@@ -28,6 +30,8 @@
|
|
|
28
30
|
"YESTERDAY": "昨天",
|
|
29
31
|
"SUNDAY": "周日",
|
|
30
32
|
"MONDAY": "周一",
|
|
33
|
+
"SUGGEST_A_REPLIES": "建议回复",
|
|
34
|
+
"GENERATIONG_ICEBREAKER": "生成破冰船",
|
|
31
35
|
"TUESDAY": "周二",
|
|
32
36
|
"WEDNESDAY": "周三",
|
|
33
37
|
"THURSDAY": "周四",
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"CUSTOM_MESSAGE_STICKER": "💟 貼紙",
|
|
15
15
|
"CUSTOM_MESSAGE_DOCUMENT": "📃 文件",
|
|
16
16
|
"CUSTOM_MESSAGE_WHITEBOARD": "📝 白板",
|
|
17
|
+
"GENERATING_REPLIES": "生成回复",
|
|
17
18
|
"ONLINE": "線上",
|
|
19
|
+
"NO_REPLIES_FOUND": "找不到回覆",
|
|
18
20
|
"ADMINISTRATOR": "管理員",
|
|
19
21
|
"MODERATOR": "版主",
|
|
20
22
|
"PARTICIPANT": "參與者",
|
|
@@ -28,6 +30,8 @@
|
|
|
28
30
|
"YESTERDAY": "昨天",
|
|
29
31
|
"TYPING": "輸入...",
|
|
30
32
|
"IS_TYPING": "正在輸入...",
|
|
33
|
+
"SUGGEST_A_REPLIES": "建議回覆",
|
|
34
|
+
"GENERATIONG_ICEBREAKER": "生成破冰船",
|
|
31
35
|
"CLOSE": "關閉",
|
|
32
36
|
"ENTER_GROUP_NAME": "輸入群組名稱",
|
|
33
37
|
"ADD_MEMBERS": "加入成員",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cometchat/chat-uikit-react-native",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "CometChat React Native UI Kit is a collection of custom UI Components designed to build text , chat and calling features in your application. The UI Kit is developed to keep developers in mind and aims to reduce development efforts significantly",
|
|
5
5
|
"main": "src/index",
|
|
6
6
|
"module": "src/index",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"repository": "https://github.com/cometchat-pro/cometchat-pro-react-native-ui-kit",
|
|
40
40
|
"author": "Inscripts",
|
|
41
|
-
"license": "
|
|
41
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
42
42
|
"bugs": {
|
|
43
43
|
"url": "https://github.com/cometchat-pro/cometchat-pro-react-native-ui-kit/issues"
|
|
44
44
|
},
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@types/react": "17.0.21"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@cometchat/chat-sdk-react-native": "^4.0.
|
|
73
|
+
"@cometchat/chat-sdk-react-native": "^4.0.2",
|
|
74
74
|
"@react-native-async-storage/async-storage": "^1.17.10",
|
|
75
75
|
"@react-native-community/clipboard": "^1.5.1"
|
|
76
76
|
},
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AIConversationStarterDecorator } from "./AIConversationStarterDecorator";
|
|
2
|
+
import { ExtensionsDataSource,ChatConfigurator } from "../../shared";
|
|
3
|
+
import { AIExtensionDataSource } from "../AIExtensionDataSource";
|
|
4
|
+
import { AIConversationStarterConfiguration } from "./configuration";
|
|
5
|
+
import { AIEnablerConfiguration } from "../configuration";
|
|
6
|
+
export class AIConversationStarterExtension extends AIExtensionDataSource {
|
|
7
|
+
configuration?:AIConversationStarterConfiguration;
|
|
8
|
+
constructor(configuration?:AIConversationStarterConfiguration){
|
|
9
|
+
super()
|
|
10
|
+
this.configuration = configuration
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
override addExtension(): void {
|
|
14
|
+
ChatConfigurator.enable((dataSource: any) => new AIConversationStarterDecorator(dataSource,this.configuration));
|
|
15
|
+
}
|
|
16
|
+
override getExtensionId(): string {
|
|
17
|
+
return "conversation-starter";
|
|
18
|
+
}
|
|
19
|
+
override enable(): void {
|
|
20
|
+
this.addExtension()
|
|
21
|
+
}
|
|
22
|
+
override getConfiguration():AIConversationStarterConfiguration{
|
|
23
|
+
return this.configuration
|
|
24
|
+
}
|
|
25
|
+
override setConfiguration(config?:AIEnablerConfiguration):void{
|
|
26
|
+
this.configuration = {...this.configuration,...config}
|
|
27
|
+
this.configuration.conversationStarterStyle = {
|
|
28
|
+
...this.configuration.conversationStarterStyle,
|
|
29
|
+
...(config?.listItemStyle || config?.listStyle)
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
|
|
2
|
+
import { CometChatTheme, CometChatUIEventHandler, CometChatUIEvents, DataSource,DataSourceDecorator, MessageEvents, localize } from "../../shared";
|
|
3
|
+
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
4
|
+
import { MessageStatusConstants, ReceiverTypeConstants, ViewAlignment } from "../../shared/constants/UIKitConstants";
|
|
5
|
+
import { Image, TouchableOpacity,View,Text,ScrollView } from "react-native";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { loadingIcon,emptyIcon,errorIcon } from "../resources";
|
|
8
|
+
|
|
9
|
+
import { emptyLabelStyle, errorLabelStyle } from "./style";
|
|
10
|
+
import { getCardViewStyle , getRepliesWrapperStyle, getRepliesStyle,getloadingStateStyle} from "./style";
|
|
11
|
+
import { State } from "../utils";
|
|
12
|
+
import { AIConversationStarterConfiguration } from "./configuration";
|
|
13
|
+
import { CardViewStyle } from "../CardViewStyle";
|
|
14
|
+
export class AIConversationStarterDecorator extends DataSourceDecorator {
|
|
15
|
+
public configuration?:AIConversationStarterConfiguration;
|
|
16
|
+
public currentMessage:CometChat.BaseMessage | null = null;
|
|
17
|
+
public loggedInUser!:CometChat.User | null;
|
|
18
|
+
messageListenerId = 'message_' + new Date().getTime();
|
|
19
|
+
public user!: CometChat.User;
|
|
20
|
+
public group!: CometChat.Group;
|
|
21
|
+
public cardViewStyle:CardViewStyle = {};
|
|
22
|
+
public errorStateText:string = localize("SOMETHING_WRONG");
|
|
23
|
+
public emptyStateText:string = localize("NO_MESSAGES_FOUND");
|
|
24
|
+
public theme:CometChatTheme;
|
|
25
|
+
constructor(dataSource:DataSource, configuration?:AIConversationStarterConfiguration){
|
|
26
|
+
|
|
27
|
+
super(dataSource)
|
|
28
|
+
this.configuration = configuration;
|
|
29
|
+
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
CometChat.getLoggedinUser()
|
|
32
|
+
.then((u) => {
|
|
33
|
+
this.loggedInUser = u;
|
|
34
|
+
})
|
|
35
|
+
.catch((err) => console.log(err));
|
|
36
|
+
|
|
37
|
+
CometChatUIEventHandler.addMessageListener(
|
|
38
|
+
MessageEvents.ccActiveChatChanged,
|
|
39
|
+
{
|
|
40
|
+
ccActiveChatChanged: ({message,user,group,theme,parentMessageId}) => {
|
|
41
|
+
this.user = user;
|
|
42
|
+
this.group = group;
|
|
43
|
+
if(theme){
|
|
44
|
+
this.theme = theme;
|
|
45
|
+
}
|
|
46
|
+
else{
|
|
47
|
+
this.theme = new CometChatTheme({});
|
|
48
|
+
}
|
|
49
|
+
if(!message && !parentMessageId){
|
|
50
|
+
this.attachMessageListener()
|
|
51
|
+
this.showDefaultPanel(State.loading)
|
|
52
|
+
this.getConversationStarter().then((replies) => {
|
|
53
|
+
if(!replies || (replies?.length && replies.length <= 0)){
|
|
54
|
+
this.showDefaultPanel(State.empty)
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
else{
|
|
58
|
+
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.showPanel, {
|
|
59
|
+
alignment: ViewAlignment.composerTop,
|
|
60
|
+
child: () => (
|
|
61
|
+
<View style={{boxShadow:this.cardViewStyle?.boxShadow, width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 130, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border }}>
|
|
62
|
+
<ScrollView style={{ height: "100%", width: "100%" }}>
|
|
63
|
+
{replies}
|
|
64
|
+
</ScrollView>
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
</View>
|
|
68
|
+
|
|
69
|
+
),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
})
|
|
74
|
+
.catch((err) => {
|
|
75
|
+
console.log(err);
|
|
76
|
+
this.showDefaultPanel(State.error)
|
|
77
|
+
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
ccMessageSent: ({ message, status }) => {
|
|
82
|
+
if(status == MessageStatusConstants.success && message?.sender?.uid == this.loggedInUser?.uid){
|
|
83
|
+
this.closePanel();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}, 1000);
|
|
89
|
+
}
|
|
90
|
+
override getId(): string {
|
|
91
|
+
return "aiconversationstarter";
|
|
92
|
+
}
|
|
93
|
+
showDefaultPanel(state:State = State.loading,error?:CometChat.CometChatException) {
|
|
94
|
+
let LoadingView:JSX.Element = this.configuration?.LoadingStateView
|
|
95
|
+
let EmptyView:JSX.Element = this.configuration?.EmptyStateView
|
|
96
|
+
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.showPanel, {
|
|
97
|
+
alignment: ViewAlignment.composerTop,
|
|
98
|
+
child: () => (
|
|
99
|
+
<View style={{ width: this.cardViewStyle?.width || "100%", height: 'auto', backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" }}>
|
|
100
|
+
{state == State.loading ? LoadingView ? <LoadingView/> : <View style={{ width: this.cardViewStyle?.width || "100%", height: "auto", backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center",flexDirection:"row",paddingBottom:8 }}>
|
|
101
|
+
<Image
|
|
102
|
+
source={this.configuration?.loadingIconURL ?? loadingIcon}
|
|
103
|
+
style={{ height: 32, width: 32,tintColor:this.cardViewStyle?.loadingIconTint}}
|
|
104
|
+
/>
|
|
105
|
+
<Text style={getloadingStateStyle(this.theme,this.configuration)}> {localize("GENERATIONG_ICEBREAKER")}</Text>
|
|
106
|
+
</View>
|
|
107
|
+
|
|
108
|
+
:
|
|
109
|
+
|
|
110
|
+
state == State.empty ? EmptyView ? <EmptyView/> : <View style={{ width: this.cardViewStyle?.width || "100%", height: 'auto', backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" ,flexDirection:"row",paddingBottom:8}}>
|
|
111
|
+
<Image
|
|
112
|
+
source={this.configuration?.emptyIconURL ?? emptyIcon}
|
|
113
|
+
style={{ height: 32, width: 32,tintColor:this.cardViewStyle?.emptyIconTint}}
|
|
114
|
+
/>
|
|
115
|
+
<Text style={emptyLabelStyle(this.cardViewStyle)} >{this.emptyStateText}</Text>
|
|
116
|
+
</View>
|
|
117
|
+
: this.configuration?.ErrorStateView ? this.configuration?.ErrorStateView(error) :
|
|
118
|
+
<View style={{ width: this.cardViewStyle?.width || "100%", height: 'auto', backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center",flexDirection:"row",paddingBottom:8 }}>
|
|
119
|
+
<Image
|
|
120
|
+
source={this.configuration?.errorIconURL ?? errorIcon}
|
|
121
|
+
style={{ height: 32, width: 32,tintColor:this.cardViewStyle?.errorIconTint}}
|
|
122
|
+
/>
|
|
123
|
+
<Text style={errorLabelStyle(this.cardViewStyle)} >{this.errorStateText}</Text>
|
|
124
|
+
</View>
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
</View>
|
|
130
|
+
|
|
131
|
+
),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
editReply(reply: string) {
|
|
135
|
+
this.closePanel();
|
|
136
|
+
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.ccComposeMessage, { text: reply });
|
|
137
|
+
}
|
|
138
|
+
closePanel = () => {
|
|
139
|
+
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
|
|
140
|
+
alignment: ViewAlignment.composerTop,
|
|
141
|
+
child: () => (null),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
closeIfMessageReceived(message){
|
|
145
|
+
if(message?.receiverId == this.loggedInUser?.uid){
|
|
146
|
+
this.closePanel()
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
getConversationStarter(): Promise<JSX.Element> {
|
|
150
|
+
return new Promise((resolve, reject) => {
|
|
151
|
+
let receiverId: string = this.user ? this.user?.getUid() : this.group?.getGuid();
|
|
152
|
+
let receiverType: string = this.user ? ReceiverTypeConstants.user : ReceiverTypeConstants.group;
|
|
153
|
+
if (this.configuration?.customView) {
|
|
154
|
+
CometChat.getConversationStarter(receiverId, receiverType).then((response: any) => {
|
|
155
|
+
this.configuration.customView(response).then((res)=>{
|
|
156
|
+
return resolve((<View>{res}</View>))
|
|
157
|
+
|
|
158
|
+
})
|
|
159
|
+
.catch((err: CometChat.CometChatException) => {
|
|
160
|
+
return reject(err)
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
})
|
|
164
|
+
.catch((err: CometChat.CometChatException) => {
|
|
165
|
+
return reject(err)
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
else if (this.configuration?.onLoad) {
|
|
169
|
+
this.configuration?.onLoad(this.user, this.group).then((response: any) => {
|
|
170
|
+
return resolve((<View>{response}</View>))
|
|
171
|
+
})
|
|
172
|
+
.catch((err: CometChat.CometChatException) => {
|
|
173
|
+
return reject(err)
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
CometChat.getConversationStarter(receiverId, receiverType).then((response: any) => {
|
|
179
|
+
let view: JSX.Element[] = [];
|
|
180
|
+
Object.keys(response).forEach((reply) => {
|
|
181
|
+
if (response[reply] && response[reply] != "") {
|
|
182
|
+
view.push(
|
|
183
|
+
(<TouchableOpacity
|
|
184
|
+
style={getRepliesWrapperStyle(this.theme, this.configuration?.conversationStarterStyle)}
|
|
185
|
+
key={response[reply]}
|
|
186
|
+
onPress={() => this.editReply(response[reply])}
|
|
187
|
+
>
|
|
188
|
+
<Text style={getRepliesStyle(this.theme, this.configuration?.conversationStarterStyle)}>{response[reply]}</Text>
|
|
189
|
+
</TouchableOpacity>)
|
|
190
|
+
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
})
|
|
196
|
+
return resolve((<View>{view}</View>))
|
|
197
|
+
|
|
198
|
+
})
|
|
199
|
+
.catch((err: CometChat.CometChatException) => {
|
|
200
|
+
return reject(err)
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
attachMessageListener(){
|
|
207
|
+
|
|
208
|
+
this.cardViewStyle = getCardViewStyle(this.theme,this.configuration?.conversationStarterStyle)
|
|
209
|
+
CometChat.addMessageListener(
|
|
210
|
+
this.messageListenerId,
|
|
211
|
+
new CometChat.MessageListener({
|
|
212
|
+
onTextMessageReceived: (textMessage) => {
|
|
213
|
+
this.closeIfMessageReceived(textMessage)
|
|
214
|
+
|
|
215
|
+
},
|
|
216
|
+
onMediaMessageReceived: (mediaMessage) => {
|
|
217
|
+
this.closeIfMessageReceived(mediaMessage)
|
|
218
|
+
|
|
219
|
+
},
|
|
220
|
+
onCustomMessageReceived: (customMessage) => {
|
|
221
|
+
this.closeIfMessageReceived(customMessage)
|
|
222
|
+
|
|
223
|
+
}
|
|
224
|
+
})
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {CometChat} from '@cometchat/chat-sdk-react-native'
|
|
2
|
+
import { AIConversationStarterStyle } from './AIConversationStarterStyle';
|
|
3
|
+
import { loadingIcon, errorIcon, emptyIcon } from '../resources';
|
|
4
|
+
export class AIConversationStarterConfiguration {
|
|
5
|
+
onLoad?:(user?:CometChat.User,group?:CometChat.Group)=>Promise<Object>;
|
|
6
|
+
conversationStarterStyle?:AIConversationStarterStyle;
|
|
7
|
+
customView?:(response:Object) => Promise<Object>;
|
|
8
|
+
ErrorStateView?: (e?: CometChat.CometChatException) => JSX.Element;
|
|
9
|
+
EmptyStateView?: () => JSX.Element;
|
|
10
|
+
LoadingStateView?: () => JSX.Element;
|
|
11
|
+
loadingIconURL?:string = loadingIcon;
|
|
12
|
+
errorIconURL?:string = errorIcon;
|
|
13
|
+
emptyIconURL?:string = emptyIcon;
|
|
14
|
+
constructor(props: Partial<AIConversationStarterConfiguration>) {
|
|
15
|
+
Object.assign(this, props);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { BorderStyle, CometChatTheme } from "../../shared";
|
|
2
|
+
import { AIConversationStarterStyle } from "../utils";
|
|
3
|
+
import { CardViewStyle } from "../CardViewStyle";
|
|
4
|
+
import { StyleSheet } from 'react-native';
|
|
5
|
+
|
|
6
|
+
export function getCardViewStyle(theme:CometChatTheme, style:AIConversationStarterStyle) {
|
|
7
|
+
const defaultStyle:AIConversationStarterStyle = StyleSheet.create({
|
|
8
|
+
emptyStateTextColor: theme?.palette?.getAccent600(),
|
|
9
|
+
loadingStateTextColor: theme?.palette?.getAccent600(),
|
|
10
|
+
errorStateTextColor: theme?.palette?.getAccent600(),
|
|
11
|
+
emptyStateTextFont: theme?.typography?.title2,
|
|
12
|
+
errorStateTextFont: theme?.typography?.title2,
|
|
13
|
+
loadingStateTextFont: theme?.typography?.title2,
|
|
14
|
+
backgroundColor: theme?.palette?.getBackgroundColor(),
|
|
15
|
+
loadingIconTint: theme?.palette?.getAccent600(),
|
|
16
|
+
errorIconTint: theme?.palette?.getAccent600(),
|
|
17
|
+
emptyIconTint: theme?.palette?.getAccent600(),
|
|
18
|
+
border: {},
|
|
19
|
+
borderRadius: 8,
|
|
20
|
+
height: 130,
|
|
21
|
+
width: "100%",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return StyleSheet.flatten([defaultStyle, style]);
|
|
25
|
+
}
|
|
26
|
+
export function getRepliesStyle(theme, configStyles) {
|
|
27
|
+
let fontFamily = configStyles?.repliesTextFont || theme?.typography?.text3;
|
|
28
|
+
return StyleSheet.create({
|
|
29
|
+
|
|
30
|
+
...fontFamily,
|
|
31
|
+
color: configStyles?.repliesTextColor || theme?.palette?.getAccent700(),
|
|
32
|
+
backgroundColor: theme?.palette?.getBackgroundColor(),
|
|
33
|
+
textAlign: 'left',
|
|
34
|
+
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function getloadingStateStyle(theme, configStyles:AIConversationStarterStyle){
|
|
39
|
+
let fontFamily = configStyles?.loadingStateTextFont|| theme?.typography?.title2;
|
|
40
|
+
|
|
41
|
+
return StyleSheet.create({
|
|
42
|
+
|
|
43
|
+
...fontFamily,
|
|
44
|
+
color: configStyles?.loadingStateTextColor || theme?.palette?.getAccent700(),
|
|
45
|
+
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export function errorLabelStyle(style:CardViewStyle) {
|
|
49
|
+
return {
|
|
50
|
+
...style?.errorStateTextFont,
|
|
51
|
+
color: style?.errorStateTextColor,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function emptyLabelStyle(style:CardViewStyle) {
|
|
56
|
+
return {
|
|
57
|
+
...style?.emptyStateTextFont,
|
|
58
|
+
color: style?.emptyStateTextColor,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function getRepliesWrapperStyle(theme:CometChatTheme, configStyles:AIConversationStarterStyle) {
|
|
63
|
+
|
|
64
|
+
return StyleSheet.create({
|
|
65
|
+
|
|
66
|
+
flexDirection: 'row',
|
|
67
|
+
padding: 8,
|
|
68
|
+
margin:4,
|
|
69
|
+
backgroundColor: configStyles?.repliesTextBackgroundColor || theme?.palette?.getBackgroundColor(),
|
|
70
|
+
...new BorderStyle({borderWidth:1,borderStyle:"solid",borderColor:theme?.palette.getAccent200()}),
|
|
71
|
+
borderRadius: configStyles?.repliesTextBorderRadius || 8,
|
|
72
|
+
boxSizing: 'border-box',
|
|
73
|
+
cursor: 'pointer',
|
|
74
|
+
|
|
75
|
+
});
|
|
76
|
+
}
|