@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,19 +19,24 @@ import { TextModerationExtension } from "../../extensions/TextModeration";
|
|
|
19
19
|
import { ThumbnailGenerationExtension } from "../../extensions/ThumbnailGeneration";
|
|
20
20
|
import { CometChatSoundManager } from "../utils";
|
|
21
21
|
import { CometChatLocalize } from "../resources";
|
|
22
|
-
import {
|
|
22
|
+
import { CardMessage, CustomInteractiveMessage, FormMessage } from "../modals/InteractiveData";
|
|
23
|
+
import { ListenerInitializer } from "../events/ListenerInitializer";
|
|
23
24
|
import { AIConversationStarterExtension } from "../../AI/AIConversationStarter/AIConversationStarter";
|
|
25
|
+
import { AIExtensionDataSource } from "../../AI/AIExtensionDataSource";
|
|
26
|
+
import { AISmartRepliesExtension } from "../../AI/AISmartReplies/AISmartReplies";
|
|
27
|
+
import { AIConversationSummaryExtension } from "../../AI/AIConversationSummary/AIConversationSummaryExtension";
|
|
28
|
+
import { AIAssistBotExtension } from "../../AI/AIAssistBot/AIAssistBotExtension";
|
|
24
29
|
|
|
25
30
|
export class CometChatUIKit {
|
|
26
31
|
static uiKitSettings: UIKitSettings;
|
|
27
|
-
|
|
32
|
+
static aiFeatures:AIExtensionDataSource[]
|
|
28
33
|
static init(uiKitSettings: UIKitSettings): Promise<boolean> {
|
|
29
34
|
|
|
30
35
|
//perform sdk init taking values from uiKitSettings
|
|
31
36
|
CometChatUIKit.uiKitSettings = {
|
|
32
37
|
...uiKitSettings
|
|
33
38
|
};
|
|
34
|
-
console.log(uiKitSettings?.overrideAdminHost,uiKitSettings.overrideClientHost)
|
|
39
|
+
console.log(uiKitSettings?.overrideAdminHost, uiKitSettings.overrideClientHost)
|
|
35
40
|
var appSetting = new CometChat.AppSettingsBuilder()
|
|
36
41
|
.subscribePresenceForAllUsers()
|
|
37
42
|
.autoEstablishSocketConnection(uiKitSettings.autoEstablishSocketConnection)
|
|
@@ -39,11 +44,13 @@ console.log(uiKitSettings?.overrideAdminHost,uiKitSettings.overrideClientHost)
|
|
|
39
44
|
.overrideClientHost(uiKitSettings?.overrideClientHost)
|
|
40
45
|
.setRegion(uiKitSettings.region)
|
|
41
46
|
|
|
47
|
+
|
|
42
48
|
appSetting.subscriptionType = uiKitSettings.subscriptionType;
|
|
43
49
|
|
|
44
50
|
return CometChat.init(uiKitSettings.appId, appSetting.build()).then(
|
|
45
51
|
() => {
|
|
46
52
|
CometChat.setSource("uikit-v4", Platform.OS, "react-native")
|
|
53
|
+
ListenerInitializer.attachListeners();
|
|
47
54
|
}, error => {
|
|
48
55
|
// console.log("Initialization failed with error:", error);
|
|
49
56
|
}
|
|
@@ -62,6 +69,13 @@ console.log(uiKitSettings?.overrideAdminHost,uiKitSettings.overrideClientHost)
|
|
|
62
69
|
new PollsExtension(),
|
|
63
70
|
new ReactionsExtension(),
|
|
64
71
|
new ImageModerationExtension()
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
static defaultAIFeatures: AIExtensionDataSource[] = [
|
|
75
|
+
new AISmartRepliesExtension(),
|
|
76
|
+
new AIConversationStarterExtension(),
|
|
77
|
+
new AIConversationSummaryExtension(),
|
|
78
|
+
new AIAssistBotExtension()
|
|
65
79
|
]
|
|
66
80
|
|
|
67
81
|
private static enableExtensions() {
|
|
@@ -72,18 +86,18 @@ console.log(uiKitSettings?.overrideAdminHost,uiKitSettings.overrideClientHost)
|
|
|
72
86
|
new CallingExtension().enable();
|
|
73
87
|
}
|
|
74
88
|
let extensionList: ExtensionsDataSource[] = this.uiKitSettings?.extensions || this.defaultExtensions;
|
|
89
|
+
let aiFeaturesList: AIExtensionDataSource[] = this.uiKitSettings?.aiFeatures || this.defaultAIFeatures;
|
|
75
90
|
|
|
76
91
|
if (extensionList.length > 0) {
|
|
77
92
|
extensionList.forEach((extension: ExtensionsDataSource) => {
|
|
78
93
|
extension?.enable();
|
|
79
94
|
});
|
|
80
95
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
96
|
+
if(aiFeaturesList.length > 0){
|
|
97
|
+
aiFeaturesList.forEach((aiFeatures: AIExtensionDataSource) => {
|
|
98
|
+
aiFeatures.enable();
|
|
99
|
+
})
|
|
100
|
+
}
|
|
87
101
|
|
|
88
102
|
|
|
89
103
|
}
|
|
@@ -160,68 +174,166 @@ console.log(uiKitSettings?.overrideAdminHost,uiKitSettings.overrideClientHost)
|
|
|
160
174
|
|
|
161
175
|
//---------- Helper methods to send messages ----------
|
|
162
176
|
///[sendCustomMessage] used to send a custom message
|
|
163
|
-
static sendCustomMessage(message: CometChat.CustomMessage
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
177
|
+
static sendCustomMessage(message: CometChat.CustomMessage): Promise<CometChat.CustomMessage | CometChat.BaseMessage> {
|
|
178
|
+
return new Promise((resolve, reject) => {
|
|
179
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.inprogress);
|
|
180
|
+
CometChat.sendCustomMessage(message)
|
|
181
|
+
.then(customMessage => {
|
|
182
|
+
CometChatUIKitHelper.onMessageSent(customMessage, messageStatus.success);
|
|
183
|
+
resolve(customMessage);
|
|
184
|
+
})
|
|
185
|
+
.catch(err => {
|
|
186
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.error);
|
|
187
|
+
reject(err);
|
|
188
|
+
});
|
|
189
|
+
});
|
|
174
190
|
}
|
|
175
191
|
|
|
176
192
|
///[sendMediaMessage] used to send a media message
|
|
177
|
-
static sendMediaMessage(message: CometChat.MediaMessage
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
if (hasAttachment == undefined) {
|
|
185
|
-
let file = message['files'][0];
|
|
186
|
-
if (file == undefined) {
|
|
187
|
-
onError && onError(new CometChat.CometChatException({
|
|
188
|
-
code: "Invalid Media message object",
|
|
189
|
-
message: "file object not found."
|
|
190
|
-
}))
|
|
193
|
+
static sendMediaMessage(message: CometChat.MediaMessage): Promise<CometChat.MediaMessage | CometChat.BaseMessage> {
|
|
194
|
+
return new Promise((resolve, reject) => {
|
|
195
|
+
let hasAttachment;
|
|
196
|
+
try {
|
|
197
|
+
hasAttachment = message.getAttachment();
|
|
198
|
+
} catch (error) {
|
|
199
|
+
console.log("no attachment found");
|
|
191
200
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
201
|
+
if (hasAttachment == undefined) {
|
|
202
|
+
let file = message['files'][0];
|
|
203
|
+
if (file == undefined) {
|
|
204
|
+
reject(new CometChat.CometChatException({
|
|
205
|
+
code: "Invalid Media message object",
|
|
206
|
+
message: "file object not found."
|
|
207
|
+
}));
|
|
208
|
+
}
|
|
200
209
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
let attachmentObject: CometChat.Attachment = new CometChat.Attachment(file);
|
|
211
|
+
attachmentObject.setName(file['name']);
|
|
212
|
+
attachmentObject.setExtension((file['name'].lastIndexOf('.') + 1).toString());
|
|
213
|
+
attachmentObject.setMimeType(file['type']);
|
|
214
|
+
attachmentObject.setSize(0);
|
|
215
|
+
attachmentObject.setUrl(file['uri']);
|
|
216
|
+
message.setAttachment(attachmentObject);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.inprogress);
|
|
220
|
+
CometChat.sendMediaMessage(message)
|
|
221
|
+
.then(mediaMessage => {
|
|
222
|
+
CometChatUIKitHelper.onMessageSent(mediaMessage, messageStatus.success);
|
|
223
|
+
resolve(mediaMessage);
|
|
224
|
+
})
|
|
225
|
+
.catch(err => {
|
|
226
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.error);
|
|
227
|
+
reject(err);
|
|
228
|
+
});
|
|
229
|
+
});
|
|
211
230
|
}
|
|
212
231
|
|
|
213
232
|
///[sendTextMessage] used to send a text message
|
|
214
|
-
static sendTextMessage(message: CometChat.TextMessage
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
233
|
+
static sendTextMessage(message: CometChat.TextMessage): Promise<CometChat.TextMessage | CometChat.BaseMessage> {
|
|
234
|
+
return new Promise((resolve, reject) => {
|
|
235
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.inprogress);
|
|
236
|
+
CometChat.sendMessage(message)
|
|
237
|
+
.then(textMessage => {
|
|
238
|
+
CometChatUIKitHelper.onMessageSent(textMessage, messageStatus.success);
|
|
239
|
+
resolve(textMessage);
|
|
240
|
+
})
|
|
241
|
+
.catch(err => {
|
|
242
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.error);
|
|
243
|
+
reject(err);
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Sends a FormMessage message and emits events based on the message status.
|
|
250
|
+
* @param message - The FormMessage message to be sent.
|
|
251
|
+
* @param disableLocalEvents - A boolean indicating whether to disable local events or not. Default value is false.
|
|
252
|
+
*/
|
|
253
|
+
static sendFormMessage(message: FormMessage, disableLocalEvents: boolean = false): Promise<CometChat.TextMessage | CometChat.BaseMessage> {
|
|
254
|
+
return new Promise((resolve, reject) => {
|
|
255
|
+
if (!disableLocalEvents) {
|
|
256
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.inprogress);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
CometChat.sendInteractiveMessage(message)
|
|
260
|
+
.then((message: CometChat.BaseMessage) => {
|
|
261
|
+
console.log("message sent successfully", message.getSentAt())
|
|
262
|
+
if (!disableLocalEvents) {
|
|
263
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.success);
|
|
264
|
+
}
|
|
265
|
+
resolve(message);
|
|
266
|
+
})
|
|
267
|
+
.catch((error: CometChat.CometChatException) => {
|
|
268
|
+
console.log("error while sending message", { error })
|
|
269
|
+
message.setMetadata({ error });
|
|
270
|
+
// if (!disableLocalEvents) {
|
|
271
|
+
// CometChatUIKitHelper.onMessageSent(message, messageStatus.error);
|
|
272
|
+
// }
|
|
273
|
+
reject(error);
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Sends a Card message and emits events based on the message status.
|
|
280
|
+
* @param message - The Card message to be sent.
|
|
281
|
+
* @param disableLocalEvents - A boolean indicating whether to disable local events or not. Default value is false.
|
|
282
|
+
*/
|
|
283
|
+
static sendCardMessage(message: CardMessage, disableLocalEvents: boolean = false): Promise<CometChat.TextMessage | CometChat.BaseMessage> {
|
|
284
|
+
return new Promise((resolve, reject) => {
|
|
285
|
+
if (!disableLocalEvents) {
|
|
286
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.inprogress);
|
|
287
|
+
}
|
|
288
|
+
console.log("message", JSON.stringify(message));
|
|
289
|
+
|
|
290
|
+
CometChat.sendInteractiveMessage(message)
|
|
291
|
+
.then((message: CometChat.BaseMessage) => {
|
|
292
|
+
console.log("message sent successfully", message.getSentAt())
|
|
293
|
+
if (!disableLocalEvents) {
|
|
294
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.success);
|
|
295
|
+
}
|
|
296
|
+
resolve(message);
|
|
297
|
+
})
|
|
298
|
+
.catch((error: CometChat.CometChatException) => {
|
|
299
|
+
console.log("error while sending message", { error })
|
|
300
|
+
message.setMetadata({ error });
|
|
301
|
+
// if (!disableLocalEvents) {
|
|
302
|
+
// CometChatUIKitHelper.onMessageSent(message, messageStatus.error);
|
|
303
|
+
// }
|
|
304
|
+
reject(error);
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Sends a Custom Interactive message and emits events based on the message status.
|
|
311
|
+
* @param message - The Custom Interactive message to be sent.
|
|
312
|
+
* @param disableLocalEvents - A boolean indicating whether to disable local events or not. Default value is false.
|
|
313
|
+
*/
|
|
314
|
+
static sendCustomInteractiveMessage(message: CustomInteractiveMessage, disableLocalEvents: boolean = false): Promise<CometChat.TextMessage | CometChat.BaseMessage> {
|
|
315
|
+
return new Promise((resolve, reject) => {
|
|
316
|
+
if (!disableLocalEvents) {
|
|
317
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.inprogress);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
CometChat.sendInteractiveMessage(message)
|
|
321
|
+
.then((message: CometChat.BaseMessage) => {
|
|
322
|
+
console.log("message sent successfully", message.getSentAt())
|
|
323
|
+
if (!disableLocalEvents) {
|
|
324
|
+
CometChatUIKitHelper.onMessageSent(message, messageStatus.success);
|
|
325
|
+
}
|
|
326
|
+
resolve(message);
|
|
327
|
+
})
|
|
328
|
+
.catch((error: CometChat.CometChatException) => {
|
|
329
|
+
console.log("error while sending message", { error })
|
|
330
|
+
message.setMetadata({ error });
|
|
331
|
+
// if (!disableLocalEvents) {
|
|
332
|
+
// CometChatUIKitHelper.onMessageSent(message, messageStatus.error);
|
|
333
|
+
// }
|
|
334
|
+
reject(error);
|
|
335
|
+
});
|
|
336
|
+
});
|
|
225
337
|
}
|
|
226
338
|
|
|
227
339
|
static getDataSource() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AIExtensionDataSource } from "../../AI/AIExtensionDataSource"
|
|
2
2
|
import { ExtensionsDataSource } from "../framework"
|
|
3
3
|
|
|
4
4
|
export type UIKitSettings = {
|
|
@@ -12,7 +12,7 @@ export type UIKitSettings = {
|
|
|
12
12
|
deviceToken?: string,
|
|
13
13
|
googleApiKey?: string,
|
|
14
14
|
disableCalling?: boolean,
|
|
15
|
-
aiFeatures?:
|
|
15
|
+
aiFeatures?:AIExtensionDataSource[],
|
|
16
16
|
extensions?:ExtensionsDataSource[]
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -53,38 +53,38 @@ export const PASSWORD_GROUP_COLOR = "rgb(247, 165, 0)";
|
|
|
53
53
|
const wordBoundary = {
|
|
54
54
|
start: `(?:^|:|;|'|"|,|{|}|\\.|\\s|\\!|\\?|\\(|\\)|\\[|\\]|\\*)`,
|
|
55
55
|
end: `(?=$|:|;|'|"|,|{|}|\\.|\\s|\\!|\\?|\\(|\\)|\\[|\\]|\\*)`,
|
|
56
|
-
|
|
56
|
+
};
|
|
57
57
|
|
|
58
58
|
export const emailPattern =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
wordBoundary.start +
|
|
60
|
+
`[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}` +
|
|
61
|
+
wordBoundary.end
|
|
62
62
|
|
|
63
63
|
export const urlPattern =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
wordBoundary.start +
|
|
65
|
+
`((https?://|www\\.|pic\\.)[-\\w;/?:@&=+$\\|\\_.!~*\\|'()\\[\\]%#,☺]+[\\w/#](\\(\\))?)` +
|
|
66
|
+
wordBoundary.end
|
|
67
67
|
|
|
68
68
|
export const phoneNumPattern =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
wordBoundary.start +
|
|
70
|
+
`(?:\\+?(\\d{1,3}))?([-. (]*(\\d{3})[-. )]*)?((\\d{3})[-. ]*(\\d{2,4})(?:[-.x ]*(\\d+))?)` +
|
|
71
|
+
wordBoundary.end
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
export const MetadataConstants = {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
liveReaction: "live_reaction",
|
|
76
|
+
file: "file",
|
|
77
|
+
extensions: {
|
|
78
|
+
thumbnailGeneration: "thumbnail-generation",
|
|
79
|
+
polls: "polls",
|
|
80
|
+
document: "document",
|
|
81
|
+
whiteboard: "whiteboard",
|
|
82
|
+
xssFilter: "xss-filter",
|
|
83
|
+
dataMasking: "data-masking",
|
|
84
|
+
profanityFilter: "profanity-filter",
|
|
85
|
+
reactions: "reactions",
|
|
86
|
+
linkPreview: "link-preview",
|
|
87
|
+
},
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
export const GroupOptionConstants = {
|
|
@@ -106,7 +106,7 @@ export const GroupMemberOptionConstants = {
|
|
|
106
106
|
ban: "ban",
|
|
107
107
|
unban: "unban",
|
|
108
108
|
changeScope: "changeScope",
|
|
109
|
-
view:'viewMember',
|
|
109
|
+
view: 'viewMember',
|
|
110
110
|
addMembers: 'addMembers',
|
|
111
111
|
deleteGroup: 'deleteGroup',
|
|
112
112
|
leave: 'leave',
|
|
@@ -157,9 +157,9 @@ export const GroupMemberOptionChangeScope: string[] = [
|
|
|
157
157
|
export const ONE_SECOND_IN_MS = 1000;
|
|
158
158
|
|
|
159
159
|
export const PATTERN = [
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
1 * ONE_SECOND_IN_MS,
|
|
161
|
+
2 * ONE_SECOND_IN_MS,
|
|
162
|
+
3 * ONE_SECOND_IN_MS
|
|
163
163
|
];
|
|
164
164
|
|
|
165
165
|
export const CallContstatnts = {
|
|
@@ -183,10 +183,11 @@ export const MessageCategoryConstants = {
|
|
|
183
183
|
custom: CometChat.CATEGORY_CUSTOM,
|
|
184
184
|
action: CometChat.CATEGORY_ACTION,
|
|
185
185
|
call: CometChat.CATEGORY_CALL,
|
|
186
|
+
interactive: CometChat.CATEGORY_INTERACTIVE,
|
|
186
187
|
};
|
|
187
188
|
|
|
188
189
|
export const DefaultActionSheetItems = {
|
|
189
|
-
takeAPhoto:
|
|
190
|
+
takeAPhoto: "takeAPhoto",
|
|
190
191
|
photoAndVideoLibrary: "photoAndVideoLibrary",
|
|
191
192
|
document: "photoAndVideoLibrary",
|
|
192
193
|
poll: "poll",
|
|
@@ -197,27 +198,30 @@ export const DefaultActionSheetItems = {
|
|
|
197
198
|
|
|
198
199
|
|
|
199
200
|
export const MessageTypeConstants = {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
201
|
+
text: CometChat.MESSAGE_TYPE.TEXT,
|
|
202
|
+
file: CometChat.MESSAGE_TYPE.FILE,
|
|
203
|
+
image: CometChat.MESSAGE_TYPE.IMAGE,
|
|
204
|
+
takePhoto: 'takePhoto',
|
|
205
|
+
audio: CometChat.MESSAGE_TYPE.AUDIO,
|
|
206
|
+
video: CometChat.MESSAGE_TYPE.VIDEO,
|
|
207
|
+
groupMember: CometChat.ACTION_TYPE.TYPE_GROUP_MEMBER,
|
|
208
|
+
messageEdited: CometChat.ACTION_TYPE.MESSAGE_EDITED,
|
|
209
|
+
messageDeleted: CometChat.ACTION_TYPE.MESSSAGE_DELETED,
|
|
210
|
+
poll: "extension_poll",
|
|
211
|
+
sticker: "extension_sticker",
|
|
212
|
+
document: "extension_document",
|
|
213
|
+
whiteboard: "extension_whiteboard",
|
|
214
|
+
meeting: "meeting",
|
|
215
|
+
location: "location",
|
|
216
|
+
groupActions: "groupActions",
|
|
217
|
+
form: "form",
|
|
218
|
+
card: "card",
|
|
219
|
+
customInteractive: "customInteractive",
|
|
216
220
|
};
|
|
217
221
|
|
|
218
222
|
export const ReceiverTypeConstants = {
|
|
219
|
-
|
|
220
|
-
|
|
223
|
+
user: CometChat.RECEIVER_TYPE.USER,
|
|
224
|
+
group: CometChat.RECEIVER_TYPE.GROUP,
|
|
221
225
|
};
|
|
222
226
|
|
|
223
227
|
export const UserStatusConstants = {
|
|
@@ -345,4 +349,34 @@ export const ComponentIds = {
|
|
|
345
349
|
VIEW_MEMBERS: 'ViewMembers',
|
|
346
350
|
BANNED_MEMBERS: 'BannedMembers',
|
|
347
351
|
TRANSFER_OWNERSHIP: 'TransferOwnership'
|
|
348
|
-
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export enum ElementType {
|
|
355
|
+
label = "label",
|
|
356
|
+
text = "textInput",
|
|
357
|
+
dropdown = "dropdown",
|
|
358
|
+
checkbox = "checkbox",
|
|
359
|
+
radio = "radio",
|
|
360
|
+
button = "button",
|
|
361
|
+
singleSelect = "singleSelect",
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export enum ButtonAction {
|
|
365
|
+
apiAction = "apiAction",
|
|
366
|
+
urlNavigation = "urlNavigation",
|
|
367
|
+
custom = "custom"
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export enum HTTPSRequestMethods {
|
|
371
|
+
POST = "POST",
|
|
372
|
+
PUT = "PUT",
|
|
373
|
+
DELETE = "DELETE",
|
|
374
|
+
PATCH = "PATCH",
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export enum goalType {
|
|
378
|
+
allOf = CometChat.GoalType.ALL_OF,
|
|
379
|
+
anyOf = CometChat.GoalType.ANY_OF,
|
|
380
|
+
anyAction = CometChat.GoalType.ANY_ACTION,
|
|
381
|
+
none = CometChat.GoalType.NONE
|
|
382
|
+
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
PanelListener,
|
|
11
11
|
UserListener,
|
|
12
12
|
UserUIEventListener,
|
|
13
|
-
UIEventListener,
|
|
13
|
+
UIEventListener,
|
|
14
14
|
UIListener
|
|
15
15
|
} from "./Listener";
|
|
16
16
|
|
|
@@ -127,6 +127,49 @@ export class CometChatUIEventHandler {
|
|
|
127
127
|
case listener._eventListener.ccActiveChatChanged?.name:
|
|
128
128
|
listener._eventListener.ccActiveChatChanged(param);
|
|
129
129
|
break
|
|
130
|
+
case listener._eventListener.onTextMessageReceived?.name:
|
|
131
|
+
listener._eventListener.onTextMessageReceived(param);
|
|
132
|
+
break
|
|
133
|
+
case listener._eventListener.onMediaMessageReceived?.name:
|
|
134
|
+
listener._eventListener.onMediaMessageReceived(param);
|
|
135
|
+
break
|
|
136
|
+
case listener._eventListener.onCustomMessageReceived?.name:
|
|
137
|
+
listener._eventListener.onCustomMessageReceived(param);
|
|
138
|
+
break
|
|
139
|
+
case listener._eventListener.onTypingStarted?.name:
|
|
140
|
+
listener._eventListener.onTypingStarted(param);
|
|
141
|
+
break
|
|
142
|
+
case listener._eventListener.onTypingEnded?.name:
|
|
143
|
+
listener._eventListener.onTypingEnded(param);
|
|
144
|
+
break
|
|
145
|
+
case listener._eventListener.onMessagesDelivered?.name:
|
|
146
|
+
listener._eventListener.onMessagesDelivered(param);
|
|
147
|
+
break
|
|
148
|
+
case listener._eventListener.onMessagesRead?.name:
|
|
149
|
+
listener._eventListener.onMessagesRead(param);
|
|
150
|
+
break
|
|
151
|
+
case listener._eventListener.onMessageEdited?.name:
|
|
152
|
+
listener._eventListener.onMessageEdited(param);
|
|
153
|
+
break
|
|
154
|
+
case listener._eventListener.onMessageDeleted?.name:
|
|
155
|
+
listener._eventListener.onMessageDeleted(param);
|
|
156
|
+
break
|
|
157
|
+
case listener._eventListener.onTransientMessageReceived?.name:
|
|
158
|
+
listener._eventListener.onTransientMessageReceived(param);
|
|
159
|
+
break
|
|
160
|
+
case listener._eventListener.onFormMessageReceived?.name:
|
|
161
|
+
listener._eventListener.onFormMessageReceived(param);
|
|
162
|
+
break
|
|
163
|
+
case listener._eventListener.onCardMessageReceived?.name:
|
|
164
|
+
listener._eventListener.onCardMessageReceived(param);
|
|
165
|
+
break
|
|
166
|
+
case listener._eventListener.onCustomInteractiveMessageReceived?.name:
|
|
167
|
+
listener._eventListener.onCustomInteractiveMessageReceived(param);
|
|
168
|
+
break
|
|
169
|
+
case listener._eventListener.onInteractionGoalCompleted?.name:
|
|
170
|
+
listener._eventListener.onInteractionGoalCompleted(param);
|
|
171
|
+
break
|
|
172
|
+
|
|
130
173
|
}
|
|
131
174
|
});
|
|
132
175
|
}
|
|
@@ -301,8 +344,9 @@ export class CometChatUIEventHandler {
|
|
|
301
344
|
break;
|
|
302
345
|
case listener._eventListener.ccToggleBottomSheet?.name:
|
|
303
346
|
listener._eventListener.ccToggleBottomSheet(param);
|
|
304
|
-
|
|
305
|
-
|
|
347
|
+
break;
|
|
348
|
+
case listener._eventListener.ccComposeMessage?.name:
|
|
349
|
+
listener._eventListener.ccComposeMessage(param);
|
|
306
350
|
break;
|
|
307
351
|
}
|
|
308
352
|
})
|
|
@@ -15,7 +15,22 @@ type MessageUIEvents = {
|
|
|
15
15
|
ccMessageRead?: Function,
|
|
16
16
|
ccMessageDelivered?: Function,
|
|
17
17
|
ccMessageError?: Function,
|
|
18
|
-
ccActiveChatChanged?:Function,
|
|
18
|
+
ccActiveChatChanged?: Function,
|
|
19
|
+
onTextMessageReceived?: Function,
|
|
20
|
+
onMediaMessageReceived?: Function,
|
|
21
|
+
onCustomMessageReceived?: Function,
|
|
22
|
+
onTypingStarted?: Function,
|
|
23
|
+
onTypingEnded?: Function,
|
|
24
|
+
onMessagesDelivered?: Function,
|
|
25
|
+
onMessagesRead?: Function,
|
|
26
|
+
onMessageEdited?: Function,
|
|
27
|
+
onMessageDeleted?: Function,
|
|
28
|
+
onTransientMessageReceived?: Function,
|
|
29
|
+
onFormMessageReceived?: Function,
|
|
30
|
+
onCardMessageReceived?: Function,
|
|
31
|
+
onCustomInteractiveMessageReceived?: Function,
|
|
32
|
+
onInteractionGoalCompleted?: Function,
|
|
33
|
+
|
|
19
34
|
// ccMessageForwarded?:Function,
|
|
20
35
|
}
|
|
21
36
|
export class MessageUIEventListener {
|
|
@@ -26,7 +41,21 @@ export class MessageUIEventListener {
|
|
|
26
41
|
ccMessageRead?: Function = undefined;
|
|
27
42
|
ccMessageDelivered?: Function = undefined;
|
|
28
43
|
ccMessageError?: Function = undefined;
|
|
29
|
-
ccActiveChatChanged?:Function=undefined;
|
|
44
|
+
ccActiveChatChanged?: Function = undefined;
|
|
45
|
+
onTextMessageReceived?: Function = undefined;
|
|
46
|
+
onMediaMessageReceived?: Function = undefined;
|
|
47
|
+
onCustomMessageReceived?: Function = undefined;
|
|
48
|
+
onTypingStarted?: Function = undefined;
|
|
49
|
+
onTypingEnded?: Function = undefined;
|
|
50
|
+
onMessagesDelivered?: Function = undefined;
|
|
51
|
+
onMessagesRead?: Function = undefined;
|
|
52
|
+
onMessageEdited?: Function = undefined;
|
|
53
|
+
onMessageDeleted?: Function = undefined;
|
|
54
|
+
onTransientMessageReceived?: Function = undefined;
|
|
55
|
+
onFormMessageReceived?: Function = undefined;
|
|
56
|
+
onCardMessageReceived?: Function = undefined;
|
|
57
|
+
onCustomInteractiveMessageReceived?: Function = undefined;
|
|
58
|
+
onInteractionGoalCompleted?: Function = undefined;
|
|
30
59
|
// ccMessageForwarded?:Function = undefined;
|
|
31
60
|
constructor({
|
|
32
61
|
ccMessageSent,
|
|
@@ -37,6 +66,20 @@ export class MessageUIEventListener {
|
|
|
37
66
|
ccMessageDelivered,
|
|
38
67
|
ccMessageError,
|
|
39
68
|
ccActiveChatChanged,
|
|
69
|
+
onTextMessageReceived,
|
|
70
|
+
onMediaMessageReceived,
|
|
71
|
+
onCustomMessageReceived,
|
|
72
|
+
onTypingStarted,
|
|
73
|
+
onTypingEnded,
|
|
74
|
+
onMessagesDelivered,
|
|
75
|
+
onMessagesRead,
|
|
76
|
+
onMessageEdited,
|
|
77
|
+
onMessageDeleted,
|
|
78
|
+
onTransientMessageReceived,
|
|
79
|
+
onFormMessageReceived,
|
|
80
|
+
onCardMessageReceived,
|
|
81
|
+
onCustomInteractiveMessageReceived,
|
|
82
|
+
onInteractionGoalCompleted,
|
|
40
83
|
// ccMessageForwarded,
|
|
41
84
|
}: MessageUIEvents) {
|
|
42
85
|
if (!isFalsy(ccMessageError)) this.ccMessageError = ccMessageError;
|
|
@@ -47,6 +90,22 @@ export class MessageUIEventListener {
|
|
|
47
90
|
if (!isFalsy(ccMessageEdited)) this.ccMessageEdited = ccMessageEdited;
|
|
48
91
|
if (!isFalsy(ccMessageDeleted)) this.ccMessageDeleted = ccMessageDeleted;
|
|
49
92
|
if (!isFalsy(ccActiveChatChanged)) this.ccActiveChatChanged = ccActiveChatChanged;
|
|
93
|
+
if (!isFalsy(onTextMessageReceived)) this.onTextMessageReceived = onTextMessageReceived;
|
|
94
|
+
if (!isFalsy(onMediaMessageReceived)) this.onMediaMessageReceived = onMediaMessageReceived;
|
|
95
|
+
if (!isFalsy(onCustomMessageReceived)) this.onCustomMessageReceived = onCustomMessageReceived;
|
|
96
|
+
if (!isFalsy(onTypingStarted)) this.onTypingStarted = onTypingStarted;
|
|
97
|
+
if (!isFalsy(onTypingEnded)) this.onTypingEnded = onTypingEnded;
|
|
98
|
+
if (!isFalsy(onMessagesDelivered)) this.onMessagesDelivered = onMessagesDelivered;
|
|
99
|
+
if (!isFalsy(onMessagesRead)) this.onMessagesRead = onMessagesRead;
|
|
100
|
+
if (!isFalsy(onMessageEdited)) this.onMessageEdited = onMessageEdited;
|
|
101
|
+
if (!isFalsy(onMessageDeleted)) this.onMessageDeleted = onMessageDeleted;
|
|
102
|
+
if (!isFalsy(onMessageDeleted)) this.onMessageDeleted = onMessageDeleted;
|
|
103
|
+
if (!isFalsy(onTransientMessageReceived)) this.onTransientMessageReceived = onTransientMessageReceived;
|
|
104
|
+
if (!isFalsy(onFormMessageReceived)) this.onFormMessageReceived = onFormMessageReceived;
|
|
105
|
+
if (!isFalsy(onCardMessageReceived)) this.onCardMessageReceived = onCardMessageReceived;
|
|
106
|
+
if (!isFalsy(onCustomInteractiveMessageReceived)) this.onCustomInteractiveMessageReceived = onCustomInteractiveMessageReceived;
|
|
107
|
+
if (!isFalsy(onInteractionGoalCompleted)) this.onInteractionGoalCompleted = onInteractionGoalCompleted;
|
|
108
|
+
|
|
50
109
|
// if (!isFalsy(ccMessageForwarded)) this.ccMessageForwarded = ccMessageForwarded;
|
|
51
110
|
}
|
|
52
111
|
}
|