@cometchat/chat-uikit-react-native 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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 +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/src/main/java/com/reactnativecometchatuikit/{RNSoundModule.java → CometChatSoundModule.java} +22 -22
- package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +1 -1
- package/ios/{RNSound.h → CometChatSoundModule.h} +1 -1
- package/ios/{RNSound.m → CometChatSoundModule.m} +2 -2
- package/lib/CometChatConversations/ConversationsConfiguration.d.ts +1 -0
- package/lib/CometChatDetails/DetailsConfiguration.d.ts +1 -0
- package/lib/CometChatGroupMembers/GroupMemberConfiguration.d.ts +1 -0
- package/lib/CometChatGroups/GroupsConfiguration.d.ts +1 -0
- package/lib/CometChatMessageComposer/CometChatMessageComposer.js +1 -7
- package/lib/CometChatMessageComposer/CometChatMessageComposer.js.map +1 -1
- package/lib/CometChatMessageHeader/MessageHeaderConfiguration.d.ts +1 -0
- package/lib/CometChatMessageList/CometChatMessageList.js +18 -49
- package/lib/CometChatMessageList/CometChatMessageList.js.map +1 -1
- package/lib/CometChatMessageList/MessageListConfiguration.d.ts +1 -0
- package/lib/CometChatMessages/MessagesConfiguration.d.ts +1 -0
- package/lib/CometChatTabs/TabItems.d.ts +1 -0
- package/lib/CometChatThreadedMessages/ThreadedMessagesConfiguration.d.ts +1 -0
- package/lib/calls/CometChatCallDetails/CallDetailsConfiguration.d.ts +1 -0
- package/lib/calls/CometChatCallHistory/CallHistoryConfiguration.d.ts +1 -0
- package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js +3 -3
- package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js.map +1 -1
- package/lib/extensions/ImageModeration/ImageModerationDecorator.d.ts +1 -0
- package/lib/extensions/ImageModeration/ImageModerationFilter.js +4 -4
- package/lib/extensions/ImageModeration/ImageModerationFilter.js.map +1 -1
- package/lib/extensions/LinkPreview/LinkPreviewExtentionDecorator.d.ts +1 -0
- package/lib/extensions/MessageTranslation/MessageTranslationDecorator.d.ts +1 -0
- 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 +2 -4
- package/lib/extensions/Stickers/StickersExtensionDecorator.js.map +1 -1
- package/lib/extensions/TextModeration/TextModerationExtensionDecorator.d.ts +1 -0
- package/lib/index.d.ts +0 -13
- package/lib/index.js +0 -14
- package/lib/index.js.map +1 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.d.ts +0 -2
- package/lib/shared/CometChatUiKit/CometChatUIKit.js +2 -13
- package/lib/shared/CometChatUiKit/CometChatUIKit.js.map +1 -1
- package/lib/shared/CometChatUiKit/UIKitSettings.d.ts +1 -5
- package/lib/shared/CometChatUiKit/UIKitSettings.js +1 -3
- package/lib/shared/CometChatUiKit/UIKitSettings.js.map +1 -1
- package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js +0 -2
- package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js.map +1 -1
- package/lib/shared/events/CometChatUIEventHandler/Listener.d.ts +1 -3
- package/lib/shared/events/CometChatUIEventHandler/Listener.js +1 -4
- package/lib/shared/events/CometChatUIEventHandler/Listener.js.map +1 -1
- package/lib/shared/events/CometChatUIEvents.d.ts +1 -2
- package/lib/shared/events/CometChatUIEvents.js +0 -1
- package/lib/shared/events/CometChatUIEvents.js.map +1 -1
- package/lib/shared/framework/DataSource.d.ts +2 -1
- package/lib/shared/framework/DataSourceDecorator.d.ts +2 -1
- 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 +1 -0
- package/lib/shared/modals/CometChatDetailsOption.d.ts +1 -0
- package/lib/shared/modals/CometChatMessageOption.d.ts +1 -0
- package/lib/shared/modals/CometChatMessageTemplate.d.ts +1 -0
- package/lib/shared/resources/CometChatLocalize/CometChatLocalize.d.ts +153 -230
- package/lib/shared/resources/CometChatLocalize/resources/ar/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/de/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/en/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/es/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/fr/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/hi/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/lt/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/ms/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/pt/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/ru/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/sv/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/zh/translation.json +0 -4
- package/lib/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +0 -4
- package/package.json +3 -3
- package/src/AI/AIAssistBot/AIAssistBotDecorator.tsx +164 -0
- package/src/AI/AIAssistBot/AIAssistBotExtension.tsx +22 -0
- package/src/AI/AIAssistBot/AIAssistBotStyle.ts +43 -0
- package/src/AI/AIAssistBot/AIAssistBotView.tsx +294 -0
- package/src/AI/AIAssistBot/configuration.ts +22 -0
- package/src/AI/AIAssistBot/resources/index.ts +5 -0
- package/src/AI/{configuration.ts → AIBaseConfiguration.ts} +3 -6
- package/src/AI/AIBaseStyle.ts +58 -0
- package/src/AI/AIConversationStarter/AIConversationStarter.ts +5 -19
- package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +145 -132
- package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +11 -6
- package/src/AI/AIConversationStarter/configuration.ts +10 -17
- package/src/AI/AIConversationSummary/AIConversationSummaryDecorator.tsx +175 -0
- package/src/AI/AIConversationSummary/AIConversationSummaryExtension.ts +21 -0
- package/src/AI/AIConversationSummary/AIConversationSummaryStyle.tsx +20 -0
- package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +190 -0
- package/src/AI/AIConversationSummary/configuration.ts +14 -0
- package/src/AI/AIConversationSummary/resources/close.png +0 -0
- package/src/AI/AIConversationSummary/resources/index.ts +5 -0
- package/src/AI/AIExtensionDataSource.ts +17 -12
- package/src/AI/AIOptionsStyle.ts +14 -0
- package/src/AI/AISmartReplies/AISmartReplies.ts +6 -15
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.tsx +302 -0
- package/src/AI/AISmartReplies/AISmartRepliesStyle.ts +1 -1
- package/src/AI/AISmartReplies/configuration.ts +4 -11
- package/src/AI/resources/index.ts +0 -2
- package/src/AI/utils.ts +3 -3
- package/src/CometChatConversations/CometChatConversations.tsx +56 -46
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +118 -5
- package/src/CometChatMessageComposer/MessageComposerConfiguration.tsx +3 -0
- package/src/CometChatMessageComposer/resources/index.ts +2 -0
- package/src/CometChatMessageComposer/styles.ts +1 -4
- package/src/CometChatMessageHeader/listners.ts +5 -4
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +35 -35
- package/src/CometChatMessageList/CometChatMessageList.tsx +284 -166
- package/src/CometChatMessages/CometChatMessages.tsx +8 -16
- package/src/CometChatMessages/MessagesConfiguration.ts +2 -2
- package/src/CometChatTabs/CometChatTabs.tsx +1 -1
- package/src/calls/CallUtils.ts +106 -45
- package/src/calls/CallingDetailsUtils.tsx +133 -15
- package/src/calls/CallingPackage.ts +16 -2
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +9 -10
- package/src/calls/CometChatCallLogDetails/CallLogDetailsConfiguration.ts +116 -0
- package/src/calls/CometChatCallLogDetails/CallLogDetailsStyle.ts +36 -0
- package/src/calls/CometChatCallLogDetails/CometChatCallLogDetails.tsx +308 -0
- package/src/calls/CometChatCallLogDetails/index.ts +12 -0
- package/src/calls/CometChatCallLogDetails/resources/CloseIcon.png +0 -0
- package/src/calls/{CometChatCallDetails → CometChatCallLogDetails}/style.ts +1 -0
- package/src/calls/{CometChatCallHistory/CallHistoryConfiguration.ts → CometChatCallLogHistory/CallLogHistoryConfiguration.ts} +15 -27
- package/src/calls/CometChatCallLogHistory/CallLogHistoryStyle.ts +46 -0
- package/src/calls/CometChatCallLogHistory/CometChatCallLogHistory.tsx +337 -0
- package/src/calls/CometChatCallLogHistory/index.ts +12 -0
- package/src/calls/CometChatCallLogHistory/resources/incomingcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/incomingvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/index.ts +29 -0
- package/src/calls/CometChatCallLogHistory/resources/missedcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/missedvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/outgoingcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/outgoingvideo.png +0 -0
- package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/style.ts +2 -1
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsConfiguration.ts +61 -0
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsStyle.ts +59 -0
- package/src/calls/CometChatCallLogParticipants/CometChatCallLogParticipants.tsx +220 -0
- package/src/calls/CometChatCallLogParticipants/index.ts +12 -0
- package/src/calls/CometChatCallLogParticipants/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogParticipants/resources/index.ts +4 -0
- package/src/calls/CometChatCallLogParticipants/style.ts +24 -0
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsConfiguration.ts +63 -0
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsStyle.ts +63 -0
- package/src/calls/CometChatCallLogRecordings/CometChatCallLogRecordings.tsx +253 -0
- package/src/calls/CometChatCallLogRecordings/index.ts +12 -0
- package/src/calls/CometChatCallLogRecordings/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogRecordings/resources/download.png +0 -0
- package/src/calls/CometChatCallLogRecordings/resources/index.ts +6 -0
- package/src/calls/CometChatCallLogRecordings/style.ts +24 -0
- package/src/calls/CometChatCallLogs/CallLogsConfiguration.ts +87 -0
- package/src/calls/CometChatCallLogs/CallLogsStyle.ts +95 -0
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +482 -0
- package/src/calls/CometChatCallLogs/index.ts +12 -0
- package/src/calls/CometChatCallLogs/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogs/resources/Info.png +0 -0
- package/src/calls/CometChatCallLogs/resources/Selection.png +0 -0
- package/src/calls/CometChatCallLogs/resources/Spinner.png +0 -0
- package/src/calls/CometChatCallLogs/resources/check.png +0 -0
- package/src/calls/CometChatCallLogs/resources/incomingcall.png +0 -0
- package/src/calls/CometChatCallLogs/resources/incomingvideo.png +0 -0
- package/src/calls/CometChatCallLogs/resources/index.ts +25 -0
- package/src/calls/CometChatCallLogs/resources/missedcall.png +0 -0
- package/src/calls/CometChatCallLogs/resources/missedvideo.png +0 -0
- package/src/calls/CometChatCallLogs/resources/outgoingcall.png +0 -0
- package/src/calls/CometChatCallLogs/resources/outgoingvideo.png +0 -0
- package/src/calls/CometChatCallLogs/style.ts +24 -0
- package/src/calls/CometChatCallLogsWithDetails/CallLogsWithDetailsConfiguration.ts +9 -0
- package/src/calls/{CometChatCallHistoryWithDetails/CometChatCallHistoryWithDetails.tsx → CometChatCallLogsWithDetails/CometChatCallLogsWithDetails.tsx} +17 -16
- package/src/calls/CometChatCallLogsWithDetails/index.ts +7 -0
- package/src/calls/index.ts +40 -1
- package/src/calls/resources/index.ts +3 -1
- package/src/calls/resources/nextarrow.png +0 -0
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +6 -14
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +1 -1
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +5 -3
- package/src/extensions/ThumbnailGeneration/resources/empty.png +0 -0
- package/src/extensions/ThumbnailGeneration/resources/index.ts +5 -0
- package/src/index.ts +134 -17
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +175 -63
- package/src/shared/CometChatUiKit/UIKitSettings.ts +2 -2
- package/src/shared/constants/UIKitConstants.ts +81 -47
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +47 -3
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +61 -2
- package/src/shared/events/ListenerInitializer.ts +73 -0
- package/src/shared/events/messages.ts +14 -0
- package/src/shared/framework/DataSource.ts +15 -0
- package/src/shared/framework/DataSourceDecorator.tsx +40 -0
- package/src/shared/framework/MessageDataSource.tsx +87 -4
- package/src/shared/index.ts +48 -0
- package/src/shared/modals/CometChatCallLogDetailsOptions.ts +23 -0
- package/src/shared/modals/CometChatCallLogDetailsTemplate.ts +16 -0
- package/src/shared/modals/InteractiveData/InteractiveActions/APIAction.ts +118 -0
- package/src/shared/modals/InteractiveData/InteractiveActions/CustomAction.ts +19 -0
- package/src/shared/modals/InteractiveData/InteractiveActions/URLNavigationAction.ts +34 -0
- package/src/shared/modals/InteractiveData/InteractiveActions/index.ts +3 -0
- package/src/shared/modals/InteractiveData/InteractiveData/InteractiveCardData.ts +69 -0
- package/src/shared/modals/InteractiveData/InteractiveData/InteractiveFormData.ts +119 -0
- package/src/shared/modals/InteractiveData/InteractiveData/index.ts +2 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/BaseInputElement.ts +102 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/BaseInteractiveElement.ts +45 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/ButtonElement.ts +61 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/CheckboxElement.ts +75 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/DropdownElement.ts +83 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/LabelElement.ts +32 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/OptionElement.ts +39 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/RadioButtonElement.ts +76 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/SingleSelectElement.ts +76 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/TextInputElement.ts +101 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/index.ts +10 -0
- package/src/shared/modals/InteractiveData/InteractiveEntities/ActionEntity.ts +41 -0
- package/src/shared/modals/InteractiveData/InteractiveEntities/ElementEntity.ts +64 -0
- package/src/shared/modals/InteractiveData/InteractiveEntities/index.ts +2 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/CardMessage.ts +142 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/CustomInteractiveMessage.ts +38 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/FormMessage.ts +152 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/index.ts +3 -0
- package/src/shared/modals/InteractiveData/index.ts +28 -0
- package/src/shared/modals/index.ts +23 -0
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +24 -7
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +22 -5
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +22 -4
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +22 -5
- package/src/shared/resources/CometChatSoundManager/CometChatSoundManager.js +2 -2
- package/src/shared/resources/CometChatSoundManager/sound.js +35 -35
- package/src/shared/resources/CometChatTheme/Palette.ts +16 -0
- package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +1 -1
- package/src/shared/utils/InteractiveMessageUtils.ts +20 -0
- package/src/shared/utils/NetworkUtils.tsx +20 -0
- package/src/shared/utils/conversationUtils.ts +9 -6
- package/src/shared/views/CometChatAICard/CometChatAICard.tsx +71 -0
- package/src/shared/views/CometChatAICard/resources/errormessage.png +0 -0
- package/src/shared/views/CometChatAICard/resources/index.ts +4 -0
- package/src/shared/views/CometChatAICard/resources/nomessage.png +0 -0
- package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +4 -0
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +11 -7
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +56 -47
- package/src/shared/views/CometChatBottomSheet/style.ts +0 -2
- package/src/shared/views/CometChatButton/CometChatButton.tsx +32 -22
- package/src/shared/views/CometChatCardBubble/CardBubbleStyle.tsx +47 -0
- package/src/shared/views/CometChatCardBubble/CometChatCardBubble.tsx +173 -0
- package/src/shared/views/CometChatCardBubble/index.tsx +1 -0
- package/src/shared/views/CometChatCheckBox/CheckBoxStyle.tsx +43 -0
- package/src/shared/views/CometChatCheckBox/CometChatCheckBox.tsx +79 -0
- package/src/shared/views/CometChatDate/CometChatDate.tsx +9 -6
- package/src/shared/views/CometChatDate/DateConfiguration.ts +4 -0
- package/src/shared/views/CometChatDate/style.ts +1 -1
- package/src/shared/views/CometChatDropDown/CometChatDropDown.tsx +126 -0
- package/src/shared/views/CometChatDropDown/DropDownStyle.tsx +39 -0
- package/src/shared/views/CometChatDropDown/resources/downArrowIcon.png +0 -0
- package/src/shared/views/CometChatDropDown/resources/index.js +5 -0
- package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +464 -0
- package/src/shared/views/CometChatFormBubble/FormBubbleStyle.tsx +91 -0
- package/src/shared/views/CometChatFormBubble/index.tsx +1 -0
- package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +13 -5
- package/src/shared/views/CometChatImageBubble/ImageBubbleStyle.ts +14 -3
- package/src/shared/views/CometChatLabel/CometChatLabel.tsx +27 -0
- package/src/shared/views/CometChatLabel/LabelStyle.ts +19 -0
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +31 -19
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +5 -4
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +1 -2
- package/src/shared/views/CometChatPanel/CometChatPanel.tsx +51 -0
- package/src/shared/views/CometChatPanel/PanelStyle.tsx +43 -0
- package/src/shared/views/CometChatPanel/resources/CloseIcon.png +0 -0
- package/src/shared/views/CometChatPanel/resources/index.ts +5 -0
- package/src/shared/views/CometChatQuickView/CometChatQuickView.tsx +66 -0
- package/src/shared/views/CometChatQuickView/QuickViewStyle.ts +55 -0
- package/src/shared/views/CometChatRadioButton/CometChatRadioButton.tsx +67 -0
- package/src/shared/views/CometChatRadioButton/RadioButtonStyle.tsx +38 -0
- package/src/shared/views/CometChatSingleSelect/CometChatSingleSelect.tsx +63 -0
- package/src/shared/views/CometChatSingleSelect/SingleStyle.tsx +35 -0
- package/src/shared/views/CometChatTextInput/CometChatTextInput.tsx +67 -0
- package/src/shared/views/CometChatTextInput/TextInputStyle.tsx +26 -0
- package/src/shared/views/index.ts +7 -1
- package/lib/AI/AIConversationStarter/AIConversationStarter.d.ts +0 -12
- package/lib/AI/AIConversationStarter/AIConversationStarter.js +0 -31
- package/lib/AI/AIConversationStarter/AIConversationStarter.js.map +0 -1
- package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.d.ts +0 -25
- package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js +0 -175
- package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js.map +0 -1
- package/lib/AI/AIConversationStarter/AIConversationStarterStyle.d.ts +0 -4
- package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js +0 -8
- package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js.map +0 -1
- package/lib/AI/AIConversationStarter/configuration.d.ts +0 -14
- package/lib/AI/AIConversationStarter/configuration.js +0 -16
- package/lib/AI/AIConversationStarter/configuration.js.map +0 -1
- package/lib/AI/AIConversationStarter/style.d.ts +0 -31
- package/lib/AI/AIConversationStarter/style.js +0 -62
- package/lib/AI/AIConversationStarter/style.js.map +0 -1
- package/lib/AI/AIEnabler.d.ts +0 -10
- package/lib/AI/AIEnabler.js +0 -102
- package/lib/AI/AIEnabler.js.map +0 -1
- package/lib/AI/AIEnablerDecorator.d.ts +0 -43
- package/lib/AI/AIEnablerDecorator.js +0 -251
- package/lib/AI/AIEnablerDecorator.js.map +0 -1
- package/lib/AI/AIExtensionDataSource.d.ts +0 -6
- package/lib/AI/AIExtensionDataSource.js +0 -10
- package/lib/AI/AIExtensionDataSource.js.map +0 -1
- package/lib/AI/AISmartReplies/AISmartReplies.d.ts +0 -10
- package/lib/AI/AISmartReplies/AISmartReplies.js +0 -23
- package/lib/AI/AISmartReplies/AISmartReplies.js.map +0 -1
- package/lib/AI/AISmartReplies/AISmartRepliesDecorator.d.ts +0 -7
- package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js +0 -12
- package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js.map +0 -1
- package/lib/AI/AISmartReplies/AISmartRepliesStyle.d.ts +0 -12
- package/lib/AI/AISmartReplies/AISmartRepliesStyle.js +0 -15
- package/lib/AI/AISmartReplies/AISmartRepliesStyle.js.map +0 -1
- package/lib/AI/AISmartReplies/configuration.d.ts +0 -14
- package/lib/AI/AISmartReplies/configuration.js +0 -16
- package/lib/AI/AISmartReplies/configuration.js.map +0 -1
- package/lib/AI/CardView.d.ts +0 -19
- package/lib/AI/CardView.js +0 -45
- package/lib/AI/CardView.js.map +0 -1
- package/lib/AI/CardViewStyle.d.ts +0 -29
- package/lib/AI/CardViewStyle.js +0 -36
- package/lib/AI/CardViewStyle.js.map +0 -1
- package/lib/AI/configuration.d.ts +0 -14
- package/lib/AI/configuration.js +0 -16
- package/lib/AI/configuration.js.map +0 -1
- package/lib/AI/resources/index.d.ts +0 -5
- package/lib/AI/resources/index.js +0 -6
- package/lib/AI/resources/index.js.map +0 -1
- package/lib/AI/style.d.ts +0 -115
- package/lib/AI/style.js +0 -139
- package/lib/AI/style.js.map +0 -1
- package/lib/AI/utils.d.ts +0 -38
- package/lib/AI/utils.js +0 -28
- package/lib/AI/utils.js.map +0 -1
- package/src/AI/AIEnabler.ts +0 -115
- package/src/AI/AIEnablerDecorator.tsx +0 -324
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.ts +0 -18
- package/src/calls/CometChatCallDetails/CallDetailsConfiguration.ts +0 -68
- package/src/calls/CometChatCallDetails/CallDetailsStyle.ts +0 -52
- package/src/calls/CometChatCallDetails/CometChatCallDetails.tsx +0 -268
- package/src/calls/CometChatCallDetails/index.ts +0 -9
- package/src/calls/CometChatCallHistory/CallHistoryStyle.ts +0 -34
- package/src/calls/CometChatCallHistory/CometChatCallHistory.tsx +0 -422
- package/src/calls/CometChatCallHistory/index.ts +0 -9
- package/src/calls/CometChatCallHistory/resources/index.ts +0 -17
- package/src/calls/CometChatCallHistoryWithDetails/HistoryWithDetailsConfiguration.ts +0 -7
- package/src/calls/CometChatCallHistoryWithDetails/HistoryWithDetailsStyle.ts +0 -3
- package/src/calls/CometChatCallHistoryWithDetails/index.ts +0 -8
- /package/src/{calls/CometChatCallDetails → AI/AIAssistBot}/resources/CloseIcon.png +0 -0
- /package/src/{AI → CometChatMessageComposer}/resources/ai.png +0 -0
- /package/src/calls/{CometChatCallDetails → CometChatCallLogDetails}/resources/index.ts +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Back.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Call.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Info.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Selection.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Spineer.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Video.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/check.png +0 -0
- /package/src/calls/{CometChatCallHistoryWithDetails → CometChatCallLogsWithDetails}/style.ts +0 -0
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
2
|
-
import { DataSourceDecorator, DataSource, CometChatTheme, CometChatUIEvents, localize, CometChatUIEventHandler, CometChatBottomSheet, FontStyleInterface, BorderStyleInterface, BaseStyle } from "../shared";
|
|
3
|
-
import { CometChatButton } from "../shared/views/CometChatButton";
|
|
4
|
-
|
|
5
|
-
import { CardView, Card } from "./CardView";
|
|
6
|
-
import { CardViewStyle } from "./CardViewStyle";
|
|
7
|
-
import { getRepliesWrapperStyle, getRepliesStyle, getCardViewStyle, getButtonStyles, getPopoverStyle, defaultViewStyle, viewContainerStyle, emptyLabelStyle, errorLabelStyle, getloadingStateStyle } from "./style";
|
|
8
|
-
import { ReceiverTypeConstants, ViewAlignment } from "../shared/constants/UIKitConstants";
|
|
9
|
-
import { Image, TouchableOpacity, View, Text, ScrollView, Keyboard } from "react-native";
|
|
10
|
-
import React, { useEffect, useRef, useState, JSX ,useContext} from "react";
|
|
11
|
-
import { AIBotIcon,loadingIcon,emptyIcon,errorIcon } from './resources';
|
|
12
|
-
import { CometChatContext } from "../shared/CometChatContext";
|
|
13
|
-
import { AIEnablerConfiguration } from "./configuration";
|
|
14
|
-
import { AIConfigurations, ICard, State } from "./utils";
|
|
15
|
-
import { AIConversationStarterConfiguration } from "./AIConversationStarter/configuration";
|
|
16
|
-
import { AISmartRepliesConfiguration } from "./AISmartReplies/configuration";
|
|
17
|
-
|
|
18
|
-
export class AIEnablerDecorator extends DataSourceDecorator {
|
|
19
|
-
smartReplyConfiguration: AISmartRepliesConfiguration = new AISmartRepliesConfiguration({});
|
|
20
|
-
conversationStarterConfiguration: AIConversationStarterConfiguration = new AIConversationStarterConfiguration({});
|
|
21
|
-
features?: AIConfigurations = {};
|
|
22
|
-
configuration?: AIEnablerConfiguration = new AIEnablerConfiguration({});
|
|
23
|
-
public newDataSource!: DataSource;
|
|
24
|
-
public showAiButton: boolean = false;
|
|
25
|
-
public theme!: CometChatTheme;
|
|
26
|
-
public id: any;
|
|
27
|
-
public user!: CometChat.User;
|
|
28
|
-
public group!: CometChat.Group;
|
|
29
|
-
public loggedInUser!: CometChat.User | null;
|
|
30
|
-
public cardViewStyle: CardViewStyle = {};
|
|
31
|
-
public buttonRef: any;
|
|
32
|
-
public setCallback: any;
|
|
33
|
-
public isPannelVisible:boolean = false;
|
|
34
|
-
public repliesView:JSX.Element;
|
|
35
|
-
public errorStateText:string = localize("SOMETHING_WRONG");
|
|
36
|
-
public emptyStateText:string = localize("NO_MESSAGES_FOUND");
|
|
37
|
-
public keyboardDidShowListener;
|
|
38
|
-
public keyboardDidHideListener;
|
|
39
|
-
onButtonClick = (id: string): void => {
|
|
40
|
-
if (id == "smart-replies") {
|
|
41
|
-
this.showDefaultPanel(State.loading)
|
|
42
|
-
this.getSmartReplies().then((replies) => {
|
|
43
|
-
if(!replies || (replies?.length && replies.length <= 0)){
|
|
44
|
-
this.showDefaultPanel(State.empty)
|
|
45
|
-
}
|
|
46
|
-
else{
|
|
47
|
-
this.repliesView = ( <View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 200, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, marginTop: 8 }}>
|
|
48
|
-
<ScrollView style={{ height: "100%", width: "100%" }}>
|
|
49
|
-
{replies}
|
|
50
|
-
</ScrollView>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</View>)
|
|
54
|
-
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.showPanel, {
|
|
55
|
-
alignment: ViewAlignment.composerBottom,
|
|
56
|
-
child: () => this.repliesView,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
this.isPannelVisible = true
|
|
61
|
-
|
|
62
|
-
})
|
|
63
|
-
.catch((err) => {
|
|
64
|
-
this.showDefaultPanel(State.error,err)
|
|
65
|
-
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
public cardsData: ICard = {}
|
|
70
|
-
constructor(dataSource: DataSource, features?: AIConfigurations, configuration?: AIEnablerConfiguration) {
|
|
71
|
-
super(dataSource);
|
|
72
|
-
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this.hideOnKeyboardShow);
|
|
73
|
-
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this.showOnKeyboardShow);
|
|
74
|
-
if (configuration) {
|
|
75
|
-
this.configuration = configuration;
|
|
76
|
-
}
|
|
77
|
-
this.newDataSource = dataSource;
|
|
78
|
-
this.features = features;
|
|
79
|
-
CometChat.getLoggedinUser().then(
|
|
80
|
-
(user: CometChat.User | null) => {
|
|
81
|
-
if (user) {
|
|
82
|
-
this.loggedInUser = user
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
getDataSource() {
|
|
88
|
-
return this.newDataSource;
|
|
89
|
-
}
|
|
90
|
-
getId(): string {
|
|
91
|
-
return "aienabler";
|
|
92
|
-
}
|
|
93
|
-
hideOnKeyboardShow = () => {
|
|
94
|
-
if(this.isPannelVisible){
|
|
95
|
-
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
|
|
96
|
-
alignment: ViewAlignment.composerBottom,
|
|
97
|
-
child: () => (null),
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
showOnKeyboardShow = () => {
|
|
102
|
-
if(this.isPannelVisible){
|
|
103
|
-
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
|
|
104
|
-
alignment: ViewAlignment.composerBottom,
|
|
105
|
-
child: () => this.repliesView,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
editReply(reply: string) {
|
|
110
|
-
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
|
|
111
|
-
alignment: ViewAlignment.composerBottom,
|
|
112
|
-
child: () => (null),
|
|
113
|
-
});
|
|
114
|
-
this.isPannelVisible = false;
|
|
115
|
-
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.ccComposeMessage, { text: reply });
|
|
116
|
-
this.keyboardDidShowListener?.remove();
|
|
117
|
-
this.keyboardDidHideListener?.remove();
|
|
118
|
-
}
|
|
119
|
-
closeBottomsheet = () => {
|
|
120
|
-
if (this.setCallback) {
|
|
121
|
-
this.setCallback(false)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
getSmartReplies(): Promise<JSX.Element> {
|
|
126
|
-
return new Promise((resolve, reject) => {
|
|
127
|
-
let receiverId: string = this.user ? this.user?.getUid() : this.group?.getGuid();
|
|
128
|
-
let receiverType: string = this.user ? ReceiverTypeConstants.user : ReceiverTypeConstants.group;
|
|
129
|
-
if (this.smartReplyConfiguration?.customView) {
|
|
130
|
-
CometChat.getSmartReplies(receiverId, receiverType).then((response: any) => {
|
|
131
|
-
this.smartReplyConfiguration.customView(response, this.closeBottomsheet).then((res)=>{
|
|
132
|
-
return resolve((<View>{res}</View>))
|
|
133
|
-
|
|
134
|
-
})
|
|
135
|
-
.catch((err: CometChat.CometChatException) => {
|
|
136
|
-
return reject(err)
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
})
|
|
140
|
-
.catch((err: CometChat.CometChatException) => {
|
|
141
|
-
return reject(err)
|
|
142
|
-
})
|
|
143
|
-
}
|
|
144
|
-
else if (this.smartReplyConfiguration?.onClick) {
|
|
145
|
-
this.smartReplyConfiguration?.onClick(this.user, this.group).then((response: any) => {
|
|
146
|
-
return resolve((<View>{response}</View>))
|
|
147
|
-
})
|
|
148
|
-
.catch((err: CometChat.CometChatException) => {
|
|
149
|
-
return reject(err)
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
CometChat.getSmartReplies(receiverId, receiverType).then((response: any) => {
|
|
155
|
-
let view: JSX.Element[] = []
|
|
156
|
-
Object.keys(response).forEach((reply) => {
|
|
157
|
-
if (response[reply] && response[reply] != "") {
|
|
158
|
-
view.push(
|
|
159
|
-
(<TouchableOpacity
|
|
160
|
-
style={getRepliesWrapperStyle(this.theme, this.smartReplyConfiguration?.smartRepliesStyle, this.configuration?.listItemStyle)}
|
|
161
|
-
key={response[reply]} // Make sure to set a unique key for each item
|
|
162
|
-
onPress={() => this.editReply(response[reply])}
|
|
163
|
-
>
|
|
164
|
-
<Text style={getRepliesStyle(this.theme, this.smartReplyConfiguration?.smartRepliesStyle, this.configuration?.listItemStyle)}>{response[reply]}</Text>
|
|
165
|
-
</TouchableOpacity>)
|
|
166
|
-
|
|
167
|
-
)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
})
|
|
173
|
-
return resolve((<View>{view}</View>))
|
|
174
|
-
|
|
175
|
-
})
|
|
176
|
-
.catch((err: CometChat.CometChatException) => {
|
|
177
|
-
return reject(err)
|
|
178
|
-
})
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
})
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
showDefaultPanel(state:State = State.loading, error?:CometChat.CometChatException) {
|
|
186
|
-
this.closeBottomsheet()
|
|
187
|
-
let LoadingView:JSX.Element = this.smartReplyConfiguration?.LoadingStateView || this.configuration.LoadingStateView
|
|
188
|
-
let EmptyView:JSX.Element = this.smartReplyConfiguration?.EmptyStateView || this.configuration.EmptyStateView
|
|
189
|
-
let ErrorView:JSX.Element = this.smartReplyConfiguration?.ErrorStateView || this.configuration.ErrorStateView
|
|
190
|
-
|
|
191
|
-
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.showPanel, {
|
|
192
|
-
alignment: ViewAlignment.composerBottom,
|
|
193
|
-
child: () => (
|
|
194
|
-
<View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 160, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" }}>
|
|
195
|
-
{state == State.loading ? LoadingView ? <LoadingView/> : <View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 160, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" }}>
|
|
196
|
-
<Image
|
|
197
|
-
source={this.configuration?.loadingIconURL ?? loadingIcon}
|
|
198
|
-
style={{ height: 32, width: 32,tintColor:this.cardViewStyle?.loadingIconTint}}
|
|
199
|
-
/>
|
|
200
|
-
<Text style={getloadingStateStyle(this.theme,this.cardViewStyle, this.smartReplyConfiguration?.smartRepliesStyle)}> {localize("GENERATING_REPLIES")}</Text>
|
|
201
|
-
</View>
|
|
202
|
-
|
|
203
|
-
:
|
|
204
|
-
|
|
205
|
-
state == State.empty ?
|
|
206
|
-
EmptyView ? <EmptyView/> : <View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 160, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" }}>
|
|
207
|
-
<Image
|
|
208
|
-
source={this.configuration?.emptyIconURL ?? emptyIcon}
|
|
209
|
-
style={{ height: 32, width: 32,tintColor:this.cardViewStyle?.emptyIconTint}}
|
|
210
|
-
/>
|
|
211
|
-
<Text style={emptyLabelStyle(this.cardViewStyle,this.smartReplyConfiguration.smartRepliesStyle)} > {this.emptyStateText}</Text>
|
|
212
|
-
</View>
|
|
213
|
-
: ErrorView ? ErrorView(error) :
|
|
214
|
-
<View style={{ width: this.cardViewStyle?.width || "100%", height: this.cardViewStyle?.height || 160, backgroundColor: this.cardViewStyle?.backgroundColor, borderRadius:this.cardViewStyle?.borderRadius, ...this.cardViewStyle?.border, justifyContent: "center", alignItems: "center" }}>
|
|
215
|
-
<Image
|
|
216
|
-
source={this.configuration?.errorIconURL ?? errorIcon}
|
|
217
|
-
style={{ height: 32, width: 32,tintColor:this.cardViewStyle?.errorIconTint}}
|
|
218
|
-
/>
|
|
219
|
-
<Text style={errorLabelStyle(this.cardViewStyle,this.smartReplyConfiguration.smartRepliesStyle)} >{this.errorStateText}</Text>
|
|
220
|
-
</View>
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
</View>
|
|
226
|
-
|
|
227
|
-
),
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
this.isPannelVisible = true;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
getAuxiliaryOptions(user?: CometChat.User, group?: CometChat.Group, id?: Map<string, any>, theme?: CometChatTheme) {
|
|
235
|
-
let contextTheme = useContext(CometChatContext)
|
|
236
|
-
if(contextTheme?.theme){
|
|
237
|
-
this.theme = contextTheme.theme
|
|
238
|
-
}
|
|
239
|
-
else{
|
|
240
|
-
this.theme = theme || new CometChatTheme({});
|
|
241
|
-
}
|
|
242
|
-
this.cardViewStyle = getCardViewStyle(this.theme, this.configuration?.listStyle,this.smartReplyConfiguration.smartRepliesStyle);
|
|
243
|
-
this.id = id;
|
|
244
|
-
this.user = user!;
|
|
245
|
-
this.group = group!;
|
|
246
|
-
let auxiliaryOptions = super.getAuxiliaryOptions(user, group, id, theme);
|
|
247
|
-
this.cardsData = {
|
|
248
|
-
smartReply: {
|
|
249
|
-
title: localize("SUGGEST_A_REPLIES"),
|
|
250
|
-
onClick: this.onButtonClick,
|
|
251
|
-
id: "smart-replies",
|
|
252
|
-
style: getButtonStyles(this.theme, this.smartReplyConfiguration?.smartRepliesStyle, this.configuration?.listItemStyle)
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
conversationStarter: {
|
|
256
|
-
title: "Conversation Starter",
|
|
257
|
-
onClick: this.onButtonClick,
|
|
258
|
-
id: "conversation-starter",
|
|
259
|
-
style: getButtonStyles(this.theme, this.conversationStarterConfiguration?.conversationStarterStyle)
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if (!(id as any).parentMessageId || Number((id as any).parentMessageId) <= 0 || (id as any).parentMessageId == undefined) {
|
|
267
|
-
|
|
268
|
-
auxiliaryOptions.unshift(this.getAIAuxiliaryButton(id, user, group, theme));
|
|
269
|
-
}
|
|
270
|
-
return auxiliaryOptions;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
getAIAuxiliaryButton(id: Map<string, any>, user?: CometChat.User, group?: CometChat.Group, theme?: CometChatTheme): JSX.Element {
|
|
274
|
-
const [aiFeatures, setAiFeatures] = useState(false);
|
|
275
|
-
let cards: Card[] = []
|
|
276
|
-
this.setCallback = setAiFeatures
|
|
277
|
-
if (this.features && Object.keys(this.features).length > 0) {
|
|
278
|
-
|
|
279
|
-
if (this.features?.["smart-replies"]?.enabled) {
|
|
280
|
-
this.smartReplyConfiguration = this.features?.["smart-replies"]?.configuration ?? new AISmartRepliesConfiguration({})
|
|
281
|
-
cards.push(this.cardsData.smartReply!)
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
return (<TouchableOpacity onPress={() => {
|
|
288
|
-
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.hidePanel, {
|
|
289
|
-
alignment: ViewAlignment.composerBottom,
|
|
290
|
-
child: () => (null),
|
|
291
|
-
});
|
|
292
|
-
if(this.isPannelVisible){
|
|
293
|
-
setAiFeatures(false);
|
|
294
|
-
this.isPannelVisible = false;
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
setAiFeatures(true);
|
|
298
|
-
|
|
299
|
-
}} style={{ justifyContent: "center" }}>
|
|
300
|
-
<Image
|
|
301
|
-
source={this.configuration?.buttonIconURL || AIBotIcon}
|
|
302
|
-
style={{ height: 32, width: 32, marginLeft: 8, marginRight: 8 , color:'red'}}
|
|
303
|
-
/>
|
|
304
|
-
{
|
|
305
|
-
<CometChatBottomSheet
|
|
306
|
-
isOpen={aiFeatures}
|
|
307
|
-
sliderMaxHeight={this.cardViewStyle?.height || 350}
|
|
308
|
-
onClose={() => {
|
|
309
|
-
setAiFeatures(false)
|
|
310
|
-
}}
|
|
311
|
-
|
|
312
|
-
>
|
|
313
|
-
<CardView
|
|
314
|
-
cardViewStyle={this.cardViewStyle}
|
|
315
|
-
buttons={cards}
|
|
316
|
-
/>
|
|
317
|
-
</CometChatBottomSheet>
|
|
318
|
-
}
|
|
319
|
-
</TouchableOpacity>)
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DataSource,DataSourceDecorator } from "../../shared";
|
|
2
|
-
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
3
|
-
import { AIButtonsStyle } from "../utils";
|
|
4
|
-
import { AISmartRepliesConfiguration } from "./configuration";
|
|
5
|
-
export class AISmartRepliesExtensionDecorator extends DataSourceDecorator {
|
|
6
|
-
public configuration?:AISmartRepliesConfiguration;
|
|
7
|
-
constructor(dataSource:DataSource,configuration?:AISmartRepliesConfiguration){
|
|
8
|
-
super(dataSource);
|
|
9
|
-
this.configuration = configuration;
|
|
10
|
-
}
|
|
11
|
-
override getId(): string {
|
|
12
|
-
return "aismartreply";
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { AvatarStyleInterface, CometChatDetailsTemplate, ImageType, ListItemStyleInterface } from "../../shared"
|
|
2
|
-
import { AvatarConfigurationInterface } from "../../shared/views/CometChatAvatar/AvatarConfiguration"
|
|
3
|
-
import { StatusIndicatorStyleInterface } from "../../shared/views/CometChatStatusIndicator/StatusIndicatorStyle"
|
|
4
|
-
// import { CometChatCallDetailsInterface } from "./CometChatCallDetails"
|
|
5
|
-
import { CometChat } from '@cometchat/chat-sdk-react-native'
|
|
6
|
-
import { CallDetailsStyleInterface } from "./CallDetailsStyle"
|
|
7
|
-
|
|
8
|
-
export interface CallDetailsConfigurationInterface {
|
|
9
|
-
showCloseButton?: boolean
|
|
10
|
-
closeButtonIconImage?: ImageType
|
|
11
|
-
hideProfile?: boolean
|
|
12
|
-
SubtitleView?: (props: { user?: CometChat.User, group?: CometChat.Group }) => JSX.Element
|
|
13
|
-
CustomProfileView?: (props: { user?: CometChat.User }) => JSX.Element
|
|
14
|
-
data?: (props: { message: CometChat.BaseMessage, user?: CometChat.User, group?: CometChat.Group }) => CometChatDetailsTemplate[]
|
|
15
|
-
disableUsersPresence?: boolean
|
|
16
|
-
onError?: (e: CometChat.CometChatException) => void
|
|
17
|
-
onBack?: () => void
|
|
18
|
-
avatarStyle?: AvatarStyleInterface
|
|
19
|
-
statusIndicatorStyle?: StatusIndicatorStyleInterface
|
|
20
|
-
listItemStyle?: ListItemStyleInterface
|
|
21
|
-
callDetailsStyle?: CallDetailsStyleInterface
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export class CallDetailsConfiguration implements CallDetailsConfigurationInterface {
|
|
25
|
-
showCloseButton?: boolean
|
|
26
|
-
closeButtonIconImage?: ImageType
|
|
27
|
-
hideProfile: boolean
|
|
28
|
-
SubtitleView: (props: { user?: CometChat.User; group?: CometChat.Group }) => JSX.Element
|
|
29
|
-
CustomProfileView: (props: { user?: CometChat.User }) => JSX.Element
|
|
30
|
-
data: (props: { message: CometChat.BaseMessage; user?: CometChat.User; group?: CometChat.Group }) => CometChatDetailsTemplate[]
|
|
31
|
-
disableUsersPresence: boolean
|
|
32
|
-
onError: (e: CometChat.CometChatException) => void
|
|
33
|
-
onBack: () => void
|
|
34
|
-
avatarStyle: AvatarStyleInterface
|
|
35
|
-
statusIndicatorStyle: StatusIndicatorStyleInterface
|
|
36
|
-
listItemStyle: ListItemStyleInterface
|
|
37
|
-
callDetailsStyle: CallDetailsStyleInterface
|
|
38
|
-
|
|
39
|
-
constructor({
|
|
40
|
-
showCloseButton,
|
|
41
|
-
closeButtonIconImage,
|
|
42
|
-
hideProfile,
|
|
43
|
-
SubtitleView,
|
|
44
|
-
CustomProfileView,
|
|
45
|
-
data,
|
|
46
|
-
disableUsersPresence,
|
|
47
|
-
onError,
|
|
48
|
-
onBack,
|
|
49
|
-
avatarStyle,
|
|
50
|
-
statusIndicatorStyle,
|
|
51
|
-
listItemStyle,
|
|
52
|
-
callDetailsStyle,
|
|
53
|
-
}: CallDetailsConfigurationInterface) {
|
|
54
|
-
this.showCloseButton = showCloseButton;
|
|
55
|
-
this.closeButtonIconImage = closeButtonIconImage;
|
|
56
|
-
this.hideProfile = hideProfile;
|
|
57
|
-
this.SubtitleView = SubtitleView;
|
|
58
|
-
this.CustomProfileView = CustomProfileView;
|
|
59
|
-
this.data = data;
|
|
60
|
-
this.disableUsersPresence = disableUsersPresence;
|
|
61
|
-
this.onError = onError;
|
|
62
|
-
this.onBack = onBack;
|
|
63
|
-
this.avatarStyle = avatarStyle;
|
|
64
|
-
this.statusIndicatorStyle = statusIndicatorStyle;
|
|
65
|
-
this.listItemStyle = listItemStyle;
|
|
66
|
-
this.callDetailsStyle = callDetailsStyle;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { BaseStyle, BaseStyleInterface, FontStyleInterface } from "../../shared";
|
|
2
|
-
|
|
3
|
-
export interface CallDetailsStyleInterface extends BaseStyleInterface {
|
|
4
|
-
titleFont?: FontStyleInterface,
|
|
5
|
-
titleColor?: string,
|
|
6
|
-
backIconTint?: string,
|
|
7
|
-
closeIconTint?: string,
|
|
8
|
-
onlineStatusColor?: string,
|
|
9
|
-
privateGroupIconBackground?: string,
|
|
10
|
-
protectedGroupIconBackground?: string,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class CallDetailsStyle extends BaseStyle {
|
|
14
|
-
titleFont?: FontStyleInterface
|
|
15
|
-
titleColor?: string
|
|
16
|
-
backIconTint?: string
|
|
17
|
-
closeIconTint?: string
|
|
18
|
-
onlineStatusColor?: string
|
|
19
|
-
privateGroupIconBackground?: string
|
|
20
|
-
protectedGroupIconBackground?: string
|
|
21
|
-
|
|
22
|
-
constructor({
|
|
23
|
-
titleFont,
|
|
24
|
-
titleColor,
|
|
25
|
-
backIconTint,
|
|
26
|
-
closeIconTint,
|
|
27
|
-
onlineStatusColor,
|
|
28
|
-
privateGroupIconBackground,
|
|
29
|
-
protectedGroupIconBackground,
|
|
30
|
-
backgroundColor,
|
|
31
|
-
border,
|
|
32
|
-
borderRadius,
|
|
33
|
-
height,
|
|
34
|
-
width,
|
|
35
|
-
}: CallDetailsStyleInterface) {
|
|
36
|
-
super({
|
|
37
|
-
backgroundColor,
|
|
38
|
-
border,
|
|
39
|
-
borderRadius,
|
|
40
|
-
height,
|
|
41
|
-
width,
|
|
42
|
-
});
|
|
43
|
-
this.titleFont = titleFont;
|
|
44
|
-
this.titleColor = titleColor;
|
|
45
|
-
this.backIconTint = backIconTint;
|
|
46
|
-
this.closeIconTint = closeIconTint;
|
|
47
|
-
this.onlineStatusColor = onlineStatusColor;
|
|
48
|
-
this.privateGroupIconBackground = privateGroupIconBackground;
|
|
49
|
-
this.protectedGroupIconBackground = protectedGroupIconBackground;
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
}
|