@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
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./resources";
|
|
20
20
|
import { ConversationsStyle, ConversationsStyleInterface } from "./ConversationsStyle";
|
|
21
21
|
import { ImageType } from "../shared";
|
|
22
|
-
import { GroupTypeConstants, MessageStatusConstants, PASSWORD_GROUP_COLOR, PRIVATE_GROUP_COLOR, ReceiverTypeConstants } from "../shared/constants/UIKitConstants";
|
|
22
|
+
import { GroupTypeConstants, MessageCategoryConstants, MessageStatusConstants, PASSWORD_GROUP_COLOR, PRIVATE_GROUP_COLOR, ReceiverTypeConstants } from "../shared/constants/UIKitConstants";
|
|
23
23
|
import { AvatarStyle, BadgeStyle, CometChatBadge, CometChatDate, CometChatListItem, CometChatReceipt, DateStyle, StatusIndicatorStyle } from "../shared";
|
|
24
24
|
import { ListItemStyle, ListItemStyleInterface } from "../shared";
|
|
25
25
|
import { CometChatContextType, MessageReceipt, SelectionMode } from "../shared/base/Types";
|
|
@@ -31,6 +31,7 @@ import { CometChatUIEventHandler } from "../shared/events/CometChatUIEventHandle
|
|
|
31
31
|
import { StatusIndicatorStyleInterface } from "../shared/views/CometChatStatusIndicator/StatusIndicatorStyle";
|
|
32
32
|
import { DateStyleInterface } from "../shared/views/CometChatDate/DateStyle";
|
|
33
33
|
import { BadgeStyleInterface } from "../shared/views/CometChatBadge";
|
|
34
|
+
import { InteractiveMessageUtils } from "../shared/utils/InteractiveMessageUtils";
|
|
34
35
|
|
|
35
36
|
const conversationListenerId = "chatlist_" + new Date().getTime();
|
|
36
37
|
const userListenerId = "chatlist_user_" + new Date().getTime();
|
|
@@ -371,7 +372,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
371
372
|
// console.log("typing event", conversation);
|
|
372
373
|
let isTyping = args[1];
|
|
373
374
|
let newConversation = conversation
|
|
374
|
-
if (isTyping) {
|
|
375
|
+
if (isTyping && newConversation?.['lastMessage']?.["typing"]) {
|
|
375
376
|
newConversation['lastMessage']["typing"] = args[0].receiverType === 'group' ?
|
|
376
377
|
`${args[0].sender.name} : ${localize("IS_TYPING")}` :
|
|
377
378
|
localize("IS_TYPING");
|
|
@@ -390,6 +391,9 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
390
391
|
const updateLastMessage = (newMessage) => {
|
|
391
392
|
CometChat.CometChatHelper.getConversationFromMessage(newMessage)
|
|
392
393
|
.then(conversation => {
|
|
394
|
+
if (newMessage.getCategory() === MessageCategoryConstants.interactive) {
|
|
395
|
+
newMessage = InteractiveMessageUtils.convertInteractiveMessage(newMessage);
|
|
396
|
+
}
|
|
393
397
|
const oldConversation: CometChat.Conversation = conversationListRef.current.getListItem(conversation['conversationId']);
|
|
394
398
|
if (oldConversation == undefined) {
|
|
395
399
|
CometChat.CometChatHelper.getConversationFromMessage(newMessage)
|
|
@@ -442,7 +446,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
442
446
|
* When a text message / media message / custom message is received
|
|
443
447
|
*/
|
|
444
448
|
const messageEventHandler = (...args) => {
|
|
445
|
-
|
|
449
|
+
let message = args[0];
|
|
446
450
|
!disableReadReceipt && markMessageAsDelivered(message);
|
|
447
451
|
updateLastMessage(message);
|
|
448
452
|
}
|
|
@@ -458,10 +462,10 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
458
462
|
conversation.setLastMessage(message);
|
|
459
463
|
conversationListRef.current.updateList(conversation);
|
|
460
464
|
} else {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
+
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
466
|
+
.then(newConversation => {
|
|
467
|
+
conversationListRef.current.addItemToList(newConversation, 0);
|
|
468
|
+
});
|
|
465
469
|
}
|
|
466
470
|
}
|
|
467
471
|
|
|
@@ -737,42 +741,6 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
737
741
|
})
|
|
738
742
|
);
|
|
739
743
|
|
|
740
|
-
CometChat.addMessageListener(
|
|
741
|
-
conversationListenerId,
|
|
742
|
-
new CometChat.MessageListener({
|
|
743
|
-
onTextMessageReceived: (textMessage) => {
|
|
744
|
-
messageEventHandler(textMessage);
|
|
745
|
-
CometChatSoundManager.play("incomingMessage");
|
|
746
|
-
},
|
|
747
|
-
onMediaMessageReceived: (mediaMessage) => {
|
|
748
|
-
messageEventHandler(mediaMessage);
|
|
749
|
-
CometChatSoundManager.play("incomingMessage");
|
|
750
|
-
},
|
|
751
|
-
onCustomMessageReceived: (customMessage) => {
|
|
752
|
-
messageEventHandler(customMessage);
|
|
753
|
-
CometChatSoundManager.play("incomingMessage");
|
|
754
|
-
},
|
|
755
|
-
onMessageDeleted: (deletedMessage) => {
|
|
756
|
-
messageEventHandler(deletedMessage);
|
|
757
|
-
},
|
|
758
|
-
onMessageEdited: (editedMessage) => {
|
|
759
|
-
messageEventHandler(editedMessage);
|
|
760
|
-
},
|
|
761
|
-
onMessagesRead: (messageReceipt) => {
|
|
762
|
-
messageEventHandler(messageReceipt);
|
|
763
|
-
},
|
|
764
|
-
onMessagesDelivered: (messageReveipt) => {
|
|
765
|
-
messageEventHandler(messageReveipt);
|
|
766
|
-
},
|
|
767
|
-
onTypingStarted: (typingIndicator) => {
|
|
768
|
-
typingEventHandler(typingIndicator, true);
|
|
769
|
-
},
|
|
770
|
-
onTypingEnded: (typingIndicator) => {
|
|
771
|
-
typingEventHandler(typingIndicator, false);
|
|
772
|
-
},
|
|
773
|
-
})
|
|
774
|
-
);
|
|
775
|
-
|
|
776
744
|
CometChatUIEventHandler.addConversationListener(
|
|
777
745
|
conversationListenerId,
|
|
778
746
|
{
|
|
@@ -829,6 +797,49 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
829
797
|
conversationListRef.current.updateList(conversation)
|
|
830
798
|
}
|
|
831
799
|
})
|
|
800
|
+
},
|
|
801
|
+
onTextMessageReceived: (textMessage) => {
|
|
802
|
+
console.log("onTextMessageReceived", textMessage);
|
|
803
|
+
messageEventHandler(textMessage);
|
|
804
|
+
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
805
|
+
},
|
|
806
|
+
onMediaMessageReceived: (mediaMessage) => {
|
|
807
|
+
messageEventHandler(mediaMessage);
|
|
808
|
+
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
809
|
+
},
|
|
810
|
+
onCustomMessageReceived: (customMessage) => {
|
|
811
|
+
messageEventHandler(customMessage);
|
|
812
|
+
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
813
|
+
},
|
|
814
|
+
onMessageDeleted: (deletedMessage) => {
|
|
815
|
+
messageEventHandler(deletedMessage);
|
|
816
|
+
},
|
|
817
|
+
onMessageEdited: (editedMessage) => {
|
|
818
|
+
messageEventHandler(editedMessage);
|
|
819
|
+
},
|
|
820
|
+
onMessagesRead: (messageReceipt) => {
|
|
821
|
+
messageEventHandler(messageReceipt);
|
|
822
|
+
},
|
|
823
|
+
onMessagesDelivered: (messageReveipt) => {
|
|
824
|
+
messageEventHandler(messageReveipt);
|
|
825
|
+
},
|
|
826
|
+
onTypingStarted: (typingIndicator) => {
|
|
827
|
+
typingEventHandler(typingIndicator, true);
|
|
828
|
+
},
|
|
829
|
+
onTypingEnded: (typingIndicator) => {
|
|
830
|
+
typingEventHandler(typingIndicator, false);
|
|
831
|
+
},
|
|
832
|
+
onFormMessageReceived: (formMessage) => {
|
|
833
|
+
messageEventHandler(formMessage);
|
|
834
|
+
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
835
|
+
},
|
|
836
|
+
onCardMessageReceived: (cardMessage) => {
|
|
837
|
+
messageEventHandler(cardMessage);
|
|
838
|
+
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
839
|
+
},
|
|
840
|
+
onCustomInteractiveMessageReceived: (customInteractiveMessage) => {
|
|
841
|
+
messageEventHandler(customInteractiveMessage);
|
|
842
|
+
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
832
843
|
}
|
|
833
844
|
}
|
|
834
845
|
);
|
|
@@ -853,10 +864,10 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
853
864
|
})
|
|
854
865
|
|
|
855
866
|
},
|
|
856
|
-
ccGroupMemberBanned: ({message}) => {
|
|
867
|
+
ccGroupMemberBanned: ({ message }) => {
|
|
857
868
|
groupHandler(message);
|
|
858
869
|
},
|
|
859
|
-
ccGroupMemberUnBanned: ({message}) => {
|
|
870
|
+
ccGroupMemberUnBanned: ({ message }) => {
|
|
860
871
|
groupHandler(message)
|
|
861
872
|
},
|
|
862
873
|
ccOwnershipChanged: ({ message }) => {
|
|
@@ -931,7 +942,6 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
931
942
|
)
|
|
932
943
|
|
|
933
944
|
return () => {
|
|
934
|
-
CometChat.removeMessageListener(conversationListenerId);
|
|
935
945
|
CometChat.removeUserListener(userListenerId);
|
|
936
946
|
CometChat.removeCallListener(callListenerId);
|
|
937
947
|
CometChat.removeGroupListener(groupListenerId);
|
|
@@ -49,6 +49,7 @@ import { CometChatContextType } from '../shared/base/Types';
|
|
|
49
49
|
import { CometChatUIEventHandler } from '../shared/events/CometChatUIEventHandler/CometChatUIEventHandler';
|
|
50
50
|
import { CometChatMessageComposerActionInterface } from '../shared/helper/types';
|
|
51
51
|
import { CometChatMediaRecorder, MediaRecorderStyle } from '../shared/views/CometChatMediaRecorder';
|
|
52
|
+
import { AIOptionsStyle } from '../AI/AIOptionsStyle';
|
|
52
53
|
const { FileManager } = NativeModules;
|
|
53
54
|
|
|
54
55
|
const uiEventListenerShow = 'uiEvent_show_' + new Date().getTime();
|
|
@@ -175,6 +176,35 @@ const RecordAudio = (props: any) => {
|
|
|
175
176
|
) : null;
|
|
176
177
|
}
|
|
177
178
|
|
|
179
|
+
const AIOptions = (props: any) => {
|
|
180
|
+
const {
|
|
181
|
+
aiStyle,
|
|
182
|
+
shouldShow = false,
|
|
183
|
+
onClose = () => { },
|
|
184
|
+
cometChatBottomSheetStyle = { backgroundColor: aiStyle.backgroundColor, paddingHorizontal: 0 },
|
|
185
|
+
sheetRef,
|
|
186
|
+
aiOptions,
|
|
187
|
+
...otherProps
|
|
188
|
+
} = props;
|
|
189
|
+
|
|
190
|
+
return shouldShow ? (
|
|
191
|
+
<CometChatBottomSheet
|
|
192
|
+
ref={sheetRef}
|
|
193
|
+
onClose={onClose}
|
|
194
|
+
style={cometChatBottomSheetStyle}
|
|
195
|
+
>
|
|
196
|
+
|
|
197
|
+
<CometChatActionSheet
|
|
198
|
+
actions={aiOptions}
|
|
199
|
+
style={{ ...aiStyle, paddingHorizontal: 0 }}
|
|
200
|
+
{...otherProps}
|
|
201
|
+
onPress={props.onClick}
|
|
202
|
+
hideHeader={true}
|
|
203
|
+
/>
|
|
204
|
+
</CometChatBottomSheet>
|
|
205
|
+
) : null;
|
|
206
|
+
}
|
|
207
|
+
|
|
178
208
|
const LiveReaction = (props: any) => {
|
|
179
209
|
const { show = false, reaction } = props;
|
|
180
210
|
if (show) {
|
|
@@ -464,6 +494,14 @@ export interface CometChatMessageComposerInterface {
|
|
|
464
494
|
* @description callback(error)→ void
|
|
465
495
|
*/
|
|
466
496
|
onError?: (error: any) => void;
|
|
497
|
+
/**
|
|
498
|
+
* AI Icon URL.
|
|
499
|
+
*/
|
|
500
|
+
AIIconURL?: string;
|
|
501
|
+
/**
|
|
502
|
+
* AI Options Style.
|
|
503
|
+
*/
|
|
504
|
+
aiOptionsStyle?: AIOptionsStyle;
|
|
467
505
|
}
|
|
468
506
|
export const CometChatMessageComposer = React.forwardRef(
|
|
469
507
|
(props: CometChatMessageComposerInterface, ref) => {
|
|
@@ -505,20 +543,21 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
505
543
|
deleteIconUrl,
|
|
506
544
|
stopIconUrl,
|
|
507
545
|
submitIconUrl,
|
|
546
|
+
AIIconURL,
|
|
547
|
+
aiOptionsStyle
|
|
508
548
|
} = props;
|
|
509
549
|
|
|
510
550
|
const defaultAttachmentOptions =
|
|
511
551
|
ChatConfigurator.dataSource.getAttachmentOptions(user, group, id);
|
|
512
552
|
|
|
513
553
|
const composerIdMap = new Map().set('parentMessageId', parentMessageId);
|
|
514
|
-
|
|
554
|
+
const defaultAuxiliaryButtonOptions =
|
|
515
555
|
ChatConfigurator.getDataSource().getAuxiliaryOptions(
|
|
516
556
|
user,
|
|
517
557
|
group,
|
|
518
558
|
composerIdMap,
|
|
519
559
|
theme
|
|
520
560
|
);
|
|
521
|
-
|
|
522
561
|
|
|
523
562
|
const loggedInUser = React.useRef<any>({});
|
|
524
563
|
const chatWith = React.useRef<any>(null);
|
|
@@ -531,6 +570,9 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
531
570
|
const [showEmojiboard, setShowEmojiboard] = React.useState(false);
|
|
532
571
|
const [showActionSheet, setShowActionSheet] = React.useState(false);
|
|
533
572
|
const [showRecordAudio, setShowRecordAudio] = React.useState(false);
|
|
573
|
+
const [showAIOptions, setShowAIOptions] = React.useState(false);
|
|
574
|
+
const [AIOptionItems, setAIOptionItems] = React.useState([]);
|
|
575
|
+
const [rootAIOptionItems, setRootAIOptionItems] = React.useState([]);
|
|
534
576
|
const [actionSheetItems, setActionSheetItems] = React.useState([]);
|
|
535
577
|
const [messagePreview, setMessagePreview] = React.useState(null);
|
|
536
578
|
const [CustomView, setCustomView] = React.useState(null);
|
|
@@ -540,6 +582,18 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
540
582
|
|
|
541
583
|
const bottomSheetRef = React.useRef<any>(null);
|
|
542
584
|
|
|
585
|
+
const AIStyles = new AIOptionsStyle({
|
|
586
|
+
//NEED TO ADD DEFAULT STYLE HERE
|
|
587
|
+
backgroundColor: theme.palette.getBackgroundColor(),
|
|
588
|
+
listItemBackground: theme.palette.getBackgroundColor(),
|
|
589
|
+
listItemTitleFont: theme.typography.subtitle1,
|
|
590
|
+
listItemTitleColor: theme.palette.getAccent(),
|
|
591
|
+
listItemBorderRadius: 0,
|
|
592
|
+
optionsSeparatorTint: theme.palette.getAccent200(),
|
|
593
|
+
borderRadius: 0,
|
|
594
|
+
...aiOptionsStyle,
|
|
595
|
+
})
|
|
596
|
+
|
|
543
597
|
let isTyping = null;
|
|
544
598
|
|
|
545
599
|
/**
|
|
@@ -898,6 +952,10 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
898
952
|
);
|
|
899
953
|
};
|
|
900
954
|
|
|
955
|
+
const shouldShowAIOptions = () => {
|
|
956
|
+
return AIOptionItems.length > 0;
|
|
957
|
+
}
|
|
958
|
+
|
|
901
959
|
const AuxiliaryButtonViewElem = () => {
|
|
902
960
|
if (AuxiliaryButtonView)
|
|
903
961
|
return (
|
|
@@ -906,6 +964,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
906
964
|
else if (defaultAuxiliaryButtonOptions)
|
|
907
965
|
return <View style={{ flexDirection: "row", alignItems: "center" }}>
|
|
908
966
|
{defaultAuxiliaryButtonOptions}
|
|
967
|
+
{shouldShowAIOptions() && <AIOptionsButtonView />}
|
|
909
968
|
{!hideVoiceRecording && <RecordAudioButtonView />}
|
|
910
969
|
</View>;
|
|
911
970
|
|
|
@@ -976,6 +1035,16 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
976
1035
|
onClick={() => setShowRecordAudio(true)}
|
|
977
1036
|
/>
|
|
978
1037
|
}
|
|
1038
|
+
const AIOptionsButtonView = () => {
|
|
1039
|
+
return <ImageButton
|
|
1040
|
+
image={AIIconURL || ICONS.AI}
|
|
1041
|
+
imageStyle={Style.imageStyle}
|
|
1042
|
+
onClick={() => {
|
|
1043
|
+
setShowAIOptions(true)
|
|
1044
|
+
setAIOptionItems(rootAIOptionItems)
|
|
1045
|
+
}}
|
|
1046
|
+
/>
|
|
1047
|
+
}
|
|
979
1048
|
|
|
980
1049
|
//fetch logged in user
|
|
981
1050
|
useEffect(() => {
|
|
@@ -1059,21 +1128,55 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1059
1128
|
};
|
|
1060
1129
|
})
|
|
1061
1130
|
);
|
|
1131
|
+
|
|
1132
|
+
const aiOptions = ChatConfigurator.dataSource.getAIOptions(user, group, theme, composerIdMap, AIStyles);
|
|
1133
|
+
let newAiOptions = _getAIOptions(aiOptions);
|
|
1134
|
+
setAIOptionItems(newAiOptions);
|
|
1135
|
+
setRootAIOptionItems(newAiOptions);
|
|
1062
1136
|
}, [user, group, id, parentMessageId]);
|
|
1063
1137
|
|
|
1138
|
+
const _getAIOptions = (options) => {
|
|
1139
|
+
let newOptions = [...options];
|
|
1140
|
+
let newAiOptions = newOptions.map((item) => {
|
|
1141
|
+
if (typeof item.onPress === 'function')
|
|
1142
|
+
return {
|
|
1143
|
+
...item,
|
|
1144
|
+
onPress: () => {
|
|
1145
|
+
setShowAIOptions(false)
|
|
1146
|
+
item.onPress(user)
|
|
1147
|
+
},
|
|
1148
|
+
};
|
|
1149
|
+
return {
|
|
1150
|
+
...item,
|
|
1151
|
+
onPress: () => { },
|
|
1152
|
+
};
|
|
1153
|
+
})
|
|
1154
|
+
return newAiOptions;
|
|
1155
|
+
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1064
1158
|
useEffect(() => {
|
|
1065
1159
|
CometChatUIEventHandler.addMessageListener(editMessageListenerID, {
|
|
1066
1160
|
ccMessageEdited: (item) => previewMessage(item),
|
|
1067
1161
|
});
|
|
1068
1162
|
CometChatUIEventHandler.addUIListener(UiEventListenerID, {
|
|
1069
1163
|
ccToggleBottomSheet: (item) => {
|
|
1164
|
+
if (item?.bots) {
|
|
1165
|
+
let newAiOptions = _getAIOptions(item.bots)
|
|
1166
|
+
setAIOptionItems(newAiOptions);
|
|
1167
|
+
setShowAIOptions(true)
|
|
1168
|
+
return;
|
|
1169
|
+
} else if (item?.botView) {
|
|
1170
|
+
setCustomView(() => item.child);
|
|
1171
|
+
return;
|
|
1172
|
+
}
|
|
1070
1173
|
setIsVisible(false);
|
|
1071
1174
|
bottomSheetRef.current?.togglePanel();
|
|
1072
1175
|
},
|
|
1073
|
-
ccComposeMessage: (text)=>{
|
|
1176
|
+
ccComposeMessage: (text) => {
|
|
1074
1177
|
setIsVisible(false);
|
|
1075
1178
|
bottomSheetRef.current?.togglePanel();
|
|
1076
|
-
|
|
1179
|
+
|
|
1077
1180
|
setInputMessage(text?.text)
|
|
1078
1181
|
|
|
1079
1182
|
}
|
|
@@ -1129,7 +1232,9 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1129
1232
|
|
|
1130
1233
|
return (
|
|
1131
1234
|
<>
|
|
1235
|
+
{!isVisible && CustomView && <CustomView />}
|
|
1132
1236
|
<Modal
|
|
1237
|
+
animationType="slide"
|
|
1133
1238
|
visible={isVisible}
|
|
1134
1239
|
onRequestClose={() => {
|
|
1135
1240
|
setIsVisible(false);
|
|
@@ -1147,7 +1252,6 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1147
1252
|
style={[
|
|
1148
1253
|
Style.container,
|
|
1149
1254
|
{
|
|
1150
|
-
backgroundColor: theme.palette.getAccent100(),
|
|
1151
1255
|
paddingTop: CustomViewHeader ? 0 : 8
|
|
1152
1256
|
},
|
|
1153
1257
|
messageComposerStyle,
|
|
@@ -1218,6 +1322,15 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1218
1322
|
stopIconUrl={stopIconUrl}
|
|
1219
1323
|
submitIconUrl={submitIconUrl}
|
|
1220
1324
|
/>
|
|
1325
|
+
<AIOptions
|
|
1326
|
+
sheetRef={bottomSheetRef}
|
|
1327
|
+
shouldShow={showAIOptions}
|
|
1328
|
+
onClose={() => {
|
|
1329
|
+
setShowAIOptions(false)
|
|
1330
|
+
}}
|
|
1331
|
+
aiOptions={AIOptionItems}
|
|
1332
|
+
aiStyle={AIStyles}
|
|
1333
|
+
/>
|
|
1221
1334
|
{HeaderView ? (
|
|
1222
1335
|
<HeaderView />
|
|
1223
1336
|
) : (
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
//@ts-ignore
|
|
8
8
|
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
9
9
|
import { MediaRecorderStyle } from '../shared/views/CometChatMediaRecorder';
|
|
10
|
+
import { AIOptionsStyle } from '../AI/AIOptionsStyle';
|
|
10
11
|
export interface MessageComposerConfigurationInterface
|
|
11
12
|
extends Omit<
|
|
12
13
|
CometChatMessageComposerInterface,
|
|
@@ -72,6 +73,8 @@ export class MessageComposerConfiguration {
|
|
|
72
73
|
composerId: string | number;
|
|
73
74
|
}) => JSX.Element;
|
|
74
75
|
text?: string;
|
|
76
|
+
AIIconURL?: string;
|
|
77
|
+
AIOptionsStyle?: AIOptionsStyle;
|
|
75
78
|
constructor(props: MessageComposerConfigurationInterface) {
|
|
76
79
|
if (props)
|
|
77
80
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -6,6 +6,7 @@ import IMAGE from './image.png'
|
|
|
6
6
|
import CLOSE from './close.png';
|
|
7
7
|
import STICKER from "./stickers.png";
|
|
8
8
|
import MICROPHONE from "./microphone.png";
|
|
9
|
+
import AI from './ai.png'
|
|
9
10
|
|
|
10
11
|
export const ICONS ={
|
|
11
12
|
HEART,
|
|
@@ -16,4 +17,5 @@ export const ICONS ={
|
|
|
16
17
|
CLOSE,
|
|
17
18
|
STICKER,
|
|
18
19
|
MICROPHONE,
|
|
20
|
+
AI
|
|
19
21
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//@ts-ignore
|
|
2
2
|
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
3
|
+
import { CometChatUIEventHandler } from '../shared';
|
|
3
4
|
|
|
4
5
|
export const listners = {
|
|
5
6
|
addListener: {
|
|
@@ -18,9 +19,9 @@ export const listners = {
|
|
|
18
19
|
})
|
|
19
20
|
),
|
|
20
21
|
messageListener: ({ msgTypingListenerId, msgTypingIndicator }) =>
|
|
21
|
-
|
|
22
|
+
CometChatUIEventHandler.addMessageListener(
|
|
22
23
|
msgTypingListenerId,
|
|
23
|
-
|
|
24
|
+
{
|
|
24
25
|
onTypingStarted: (typistDetails) => {
|
|
25
26
|
console.log('onTypingStarted', typistDetails);
|
|
26
27
|
|
|
@@ -30,7 +31,7 @@ export const listners = {
|
|
|
30
31
|
console.log('onTypingEnded', typistDetails);
|
|
31
32
|
msgTypingIndicator(typistDetails, '');
|
|
32
33
|
},
|
|
33
|
-
}
|
|
34
|
+
}
|
|
34
35
|
),
|
|
35
36
|
groupListener: ({ groupListenerId, handleGroupListener }) =>
|
|
36
37
|
CometChat.addGroupListener(
|
|
@@ -65,7 +66,7 @@ export const listners = {
|
|
|
65
66
|
CometChat.removeUserListener(userStatusListenerId),
|
|
66
67
|
|
|
67
68
|
removeMessageListener: ({ msgTypingListenerId }) =>
|
|
68
|
-
|
|
69
|
+
CometChatUIEventHandler.removeMessageListener(msgTypingListenerId),
|
|
69
70
|
|
|
70
71
|
removeGroupListener: ({ groupListenerId }) =>
|
|
71
72
|
CometChat.removeGroupListener(groupListenerId),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState } from 'react'
|
|
2
2
|
import { Dimensions, FlatList, Image, Text, TouchableOpacity, View, ScrollView } from 'react-native'
|
|
3
3
|
import { CometChat } from '@cometchat/chat-sdk-react-native'
|
|
4
|
-
import { AvatarStyleInterface, CometChatContext, CometChatDate, CometChatListItem, CometChatMessageTemplate, CometChatReceipt, ImageType, ListItemStyleInterface, StatusIndicatorStyleInterface, localize } from '../shared'
|
|
4
|
+
import { AvatarStyleInterface, CometChatContext, CometChatDate, CometChatListItem, CometChatMessageTemplate, CometChatReceipt, CometChatUIEventHandler, ImageType, ListItemStyleInterface, StatusIndicatorStyleInterface, localize } from '../shared'
|
|
5
5
|
import { MessageInformationStyleInterface } from './MessageInformationStyle'
|
|
6
6
|
import { MessageUtils } from '../shared/utils/MessageUtils'
|
|
7
7
|
import { Style } from "./styles";
|
|
@@ -191,16 +191,16 @@ export const CometChatMessageInformation = (props: CometChatMessageInformationIn
|
|
|
191
191
|
|
|
192
192
|
useEffect(() => {
|
|
193
193
|
//add listener for message delivery
|
|
194
|
-
|
|
194
|
+
CometChatUIEventHandler.addMessageListener(
|
|
195
195
|
listenerId,
|
|
196
|
-
|
|
196
|
+
{
|
|
197
197
|
onMessagesDelivered: (messageReceipt) => {
|
|
198
198
|
updateMessageReceipt(messageReceipt);
|
|
199
199
|
},
|
|
200
200
|
onMessagesRead: (messageReceipt) => {
|
|
201
201
|
updateMessageReceipt(messageReceipt);
|
|
202
202
|
},
|
|
203
|
-
}
|
|
203
|
+
}
|
|
204
204
|
)
|
|
205
205
|
}, []);
|
|
206
206
|
|
|
@@ -210,28 +210,28 @@ export const CometChatMessageInformation = (props: CometChatMessageInformationIn
|
|
|
210
210
|
|
|
211
211
|
const LoadingView = () => {
|
|
212
212
|
if (LoadingStateView)
|
|
213
|
-
|
|
213
|
+
return <LoadingStateView />
|
|
214
214
|
return <View style={[Style.viewContainer]}>
|
|
215
|
-
|
|
215
|
+
<Image source={loadingIcon || LoadingIcon} style={[Style.imageStyle, { tintColor: "black" }]} />
|
|
216
216
|
</View>
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
const ErrorView = () => {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
220
|
+
if (ErrorStateView)
|
|
221
|
+
return <ErrorStateView />
|
|
222
|
+
return <View style={[Style.viewContainer]}>
|
|
223
|
+
<Text>{errorStateText || localize("SOMETHING_WRONG")}</Text>
|
|
224
|
+
</View>
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
const EmptyView = () => {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
228
|
+
if (EmptyStateView)
|
|
229
|
+
return <EmptyStateView />
|
|
230
|
+
return (
|
|
231
|
+
<View style={[Style.viewContainer]}>
|
|
232
|
+
<Text>{emptyStateText || localize("No_RECIPIENT")}</Text>
|
|
233
|
+
</View>
|
|
234
|
+
)
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
return (
|
|
@@ -245,7 +245,7 @@ export const CometChatMessageInformation = (props: CometChatMessageInformationIn
|
|
|
245
245
|
Style.container,
|
|
246
246
|
border
|
|
247
247
|
]}>
|
|
248
|
-
<View style={{flexDirection: "row"}}>
|
|
248
|
+
<View style={{ flexDirection: "row" }}>
|
|
249
249
|
<TouchableOpacity onPress={onBack}>
|
|
250
250
|
<Image
|
|
251
251
|
source={backIcon}
|
|
@@ -256,13 +256,13 @@ export const CometChatMessageInformation = (props: CometChatMessageInformationIn
|
|
|
256
256
|
}}
|
|
257
257
|
/>
|
|
258
258
|
</TouchableOpacity>
|
|
259
|
-
<View style={{flex: 1, alignItems: "center"}}>
|
|
260
|
-
<Text style={{color: titleTextColor, ...titleTextFont}}>{title}</Text>
|
|
259
|
+
<View style={{ flex: 1, alignItems: "center" }}>
|
|
260
|
+
<Text style={{ color: titleTextColor, ...titleTextFont }}>{title}</Text>
|
|
261
261
|
</View>
|
|
262
262
|
</View>
|
|
263
263
|
|
|
264
264
|
<View>
|
|
265
|
-
<Text style={{color: dividerTint || theme.palette.getAccent500(), ...theme.typography.text1 }}>{localize("MESSAGE")}</Text>
|
|
265
|
+
<Text style={{ color: dividerTint || theme.palette.getAccent500(), ...theme.typography.text1 }}>{localize("MESSAGE")}</Text>
|
|
266
266
|
</View>
|
|
267
267
|
<View style={[Style.divider, { backgroundColor: dividerTint || theme.palette.getAccent200() }]} />
|
|
268
268
|
<View style={Style.msgBubbleContainer}>
|
|
@@ -276,26 +276,26 @@ export const CometChatMessageInformation = (props: CometChatMessageInformationIn
|
|
|
276
276
|
alignment: "right",
|
|
277
277
|
theme
|
|
278
278
|
})
|
|
279
|
-
}
|
|
280
|
-
|
|
279
|
+
}
|
|
280
|
+
</ScrollView>
|
|
281
281
|
</View>
|
|
282
282
|
<View style={[Style.divider, { backgroundColor: dividerTint || theme.palette.getAccent200() }]} />
|
|
283
283
|
<View>
|
|
284
|
-
<Text style={{color: dividerTint || theme.palette.getAccent500(), ...theme.typography.text1 }}>{localize("RECEIPT_INFORMATION")}</Text>
|
|
284
|
+
<Text style={{ color: dividerTint || theme.palette.getAccent500(), ...theme.typography.text1 }}>{localize("RECEIPT_INFORMATION")}</Text>
|
|
285
285
|
</View>
|
|
286
286
|
<View style={[Style.divider, { backgroundColor: dividerTint || theme.palette.getAccent200() }]} />
|
|
287
287
|
{
|
|
288
288
|
listState == "loading" && recipients.length == 0 ?
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
289
|
+
<LoadingView /> :
|
|
290
|
+
listState == "error" && recipients.length == 0 ?
|
|
291
|
+
<ErrorView /> :
|
|
292
|
+
recipients.length == 0 ?
|
|
293
|
+
<EmptyView /> :
|
|
294
|
+
<FlatList
|
|
295
|
+
style={{ flex: 1, backgroundColor: 'transparent' }}
|
|
296
|
+
data={recipients}
|
|
297
|
+
renderItem={renderReceipients}
|
|
298
|
+
/>
|
|
299
299
|
}
|
|
300
300
|
</View>
|
|
301
301
|
)
|