@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
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { CometChat } from '@cometchat/chat-sdk-react-native'
|
|
2
|
+
import React, { useContext, useEffect, useRef } from 'react'
|
|
3
|
+
import { FlatList, Image, Text, TouchableOpacity, View } from 'react-native'
|
|
4
|
+
import { StyleProp, ViewStyle } from "react-native/types";
|
|
5
|
+
import { AvatarStyleInterface, CometChatContext, CometChatDate, CometChatListItem, DatePattern, ListItemStyleInterface, localize } from '../../shared'
|
|
6
|
+
import { CallParticipantsStyle, CallParticipantsStyleInterface } from './CallLogParticipantsStyle'
|
|
7
|
+
import { BackIcon } from "./resources";
|
|
8
|
+
import { Style } from './style'
|
|
9
|
+
import { CallUtils } from '../CallUtils'
|
|
10
|
+
|
|
11
|
+
export interface CometChatCallLogParticipantsConfigurationInterface {
|
|
12
|
+
title?: string,
|
|
13
|
+
SubtitleView?: (param: { participant?: CometChat.BaseMessage }) => JSX.Element,
|
|
14
|
+
TailView?: (param: { participant?: CometChat.BaseMessage }) => JSX.Element,
|
|
15
|
+
ListItemView?: (param: { participant?: CometChat.BaseMessage }) => JSX.Element,
|
|
16
|
+
AppBarOptions?: () => JSX.Element,
|
|
17
|
+
/**
|
|
18
|
+
* Participant list
|
|
19
|
+
*/
|
|
20
|
+
data: any[],
|
|
21
|
+
datePattern?: DatePattern,
|
|
22
|
+
call: any,
|
|
23
|
+
hideSeperator?: boolean,
|
|
24
|
+
BackButton?: JSX.Element,
|
|
25
|
+
showBackButton?: boolean,
|
|
26
|
+
EmptyStateView?: () => JSX.Element,
|
|
27
|
+
emptyStateText?: string,
|
|
28
|
+
onItemPress?: (item: CometChat.BaseMessage) => void,
|
|
29
|
+
onError?: (e: CometChat.CometChatException) => void,
|
|
30
|
+
onBack?: () => void,
|
|
31
|
+
avatarStyle?: AvatarStyleInterface,
|
|
32
|
+
listItemStyle?: ListItemStyleInterface,
|
|
33
|
+
callLogParticipantsStyle?: CallParticipantsStyleInterface,
|
|
34
|
+
headViewContainerStyle?: StyleProp<ViewStyle>,
|
|
35
|
+
bodyViewContainerStyle?: StyleProp<ViewStyle>,
|
|
36
|
+
tailViewContainerStyle?: StyleProp<ViewStyle>,
|
|
37
|
+
}
|
|
38
|
+
export const CometChatParticipants = (props: CometChatCallLogParticipantsConfigurationInterface) => {
|
|
39
|
+
|
|
40
|
+
const {
|
|
41
|
+
title = localize("PARTICIPANTS"),
|
|
42
|
+
SubtitleView,
|
|
43
|
+
TailView,
|
|
44
|
+
ListItemView,
|
|
45
|
+
AppBarOptions,
|
|
46
|
+
call,
|
|
47
|
+
datePattern,
|
|
48
|
+
data,
|
|
49
|
+
hideSeperator,
|
|
50
|
+
BackButton,
|
|
51
|
+
showBackButton,
|
|
52
|
+
EmptyStateView,
|
|
53
|
+
emptyStateText,
|
|
54
|
+
onItemPress,
|
|
55
|
+
onError,
|
|
56
|
+
onBack,
|
|
57
|
+
avatarStyle,
|
|
58
|
+
listItemStyle,
|
|
59
|
+
callLogParticipantsStyle,
|
|
60
|
+
headViewContainerStyle,
|
|
61
|
+
bodyViewContainerStyle,
|
|
62
|
+
tailViewContainerStyle,
|
|
63
|
+
} = props;
|
|
64
|
+
|
|
65
|
+
const { theme } = useContext(CometChatContext);
|
|
66
|
+
|
|
67
|
+
const _style = new CallParticipantsStyle({
|
|
68
|
+
titleFont: theme.typography.heading,
|
|
69
|
+
titleColor: theme.palette.getAccent(),
|
|
70
|
+
backgroundColor: theme.palette.getBackgroundColor(),
|
|
71
|
+
emptyTextColor: theme?.palette?.getAccent400(),
|
|
72
|
+
emptyTextFont: theme?.typography?.subtitle1,
|
|
73
|
+
dateTextColor: theme.palette.getAccent(),
|
|
74
|
+
dateTextFont: theme.typography.subtitle2,
|
|
75
|
+
backIconTint: theme.palette.getPrimary(),
|
|
76
|
+
durationTextColor: theme.palette.getAccent(),
|
|
77
|
+
durationTextFont: theme.typography.subtitle1,
|
|
78
|
+
...callLogParticipantsStyle
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const {
|
|
82
|
+
backgroundColor,
|
|
83
|
+
height,
|
|
84
|
+
width,
|
|
85
|
+
border,
|
|
86
|
+
borderRadius,
|
|
87
|
+
titleColor,
|
|
88
|
+
titleFont,
|
|
89
|
+
emptyTextColor,
|
|
90
|
+
emptyTextFont,
|
|
91
|
+
dateTextColor,
|
|
92
|
+
dateTextFont,
|
|
93
|
+
backIconTint,
|
|
94
|
+
durationTextColor,
|
|
95
|
+
durationTextFont
|
|
96
|
+
} = _style;
|
|
97
|
+
|
|
98
|
+
const loggedInUser = useRef(null);
|
|
99
|
+
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
CometChat.getLoggedinUser()
|
|
102
|
+
.then(u => {
|
|
103
|
+
loggedInUser.current = u;
|
|
104
|
+
})
|
|
105
|
+
.catch(e => {
|
|
106
|
+
onError && onError(e);
|
|
107
|
+
});
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
110
|
+
const DefaultSubtitleView = ({ participant }) => {
|
|
111
|
+
if (SubtitleView)
|
|
112
|
+
return SubtitleView(participant);
|
|
113
|
+
return (
|
|
114
|
+
<View style={[Style.row]}>
|
|
115
|
+
<Text style={[{ color: durationTextColor }, durationTextFont]}>{CallUtils.convertMinutesToHoursMinutesSeconds(participant['totalDurationInMinutes'])}</Text>
|
|
116
|
+
</View>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const DefaultTailView = () => {
|
|
121
|
+
return (
|
|
122
|
+
<View style={[Style.row, { alignItems: "center" }]}>
|
|
123
|
+
{call?.getInitiatedAt() && <CometChatDate timeStamp={call?.getInitiatedAt() * 1000} pattern={datePattern || 'timeFormat'} style={{ textColor: dateTextColor, textFont: dateTextFont }} />}
|
|
124
|
+
</View>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const onPress = (item) => {
|
|
129
|
+
onItemPress && onItemPress(item);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const getCallDetails = (item) => {
|
|
134
|
+
return {
|
|
135
|
+
title: item['name'],
|
|
136
|
+
avatarUrl: item['avatar']
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const _render = ({ item, index }) => {
|
|
141
|
+
|
|
142
|
+
if (ListItemView)
|
|
143
|
+
return <ListItemView participant={item} />
|
|
144
|
+
|
|
145
|
+
const { title, avatarUrl } = getCallDetails(item);
|
|
146
|
+
|
|
147
|
+
return <React.Fragment key={index}>
|
|
148
|
+
<CometChatListItem
|
|
149
|
+
id={item.sessionId}
|
|
150
|
+
avatarName={title}
|
|
151
|
+
title={title}
|
|
152
|
+
listItemStyle={listItemStyle ? listItemStyle : { height: 70 }}
|
|
153
|
+
headViewContainerStyle={
|
|
154
|
+
headViewContainerStyle
|
|
155
|
+
? headViewContainerStyle
|
|
156
|
+
: { marginHorizontal: 10 }
|
|
157
|
+
}
|
|
158
|
+
bodyViewContainerStyle={
|
|
159
|
+
bodyViewContainerStyle ? bodyViewContainerStyle : {}
|
|
160
|
+
}
|
|
161
|
+
tailViewContainerStyle={
|
|
162
|
+
tailViewContainerStyle ? tailViewContainerStyle : {
|
|
163
|
+
marginHorizontal: 10,
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
avatarURL={avatarUrl}
|
|
167
|
+
SubtitleView={() =>
|
|
168
|
+
SubtitleView ? <SubtitleView participant={item} /> : <DefaultSubtitleView participant={item} />
|
|
169
|
+
}
|
|
170
|
+
TailView={TailView ? () => <TailView participant={item} /> : () => <DefaultTailView />}
|
|
171
|
+
avatarStyle={avatarStyle}
|
|
172
|
+
onPress={() => onPress(item)}
|
|
173
|
+
hideSeparator={hideSeperator}
|
|
174
|
+
/>
|
|
175
|
+
</React.Fragment>
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const EmptyView = () => {
|
|
179
|
+
if (EmptyStateView)
|
|
180
|
+
return <EmptyStateView />
|
|
181
|
+
return (
|
|
182
|
+
<View style={[Style.container]}>
|
|
183
|
+
<Text style={[{ color: emptyTextColor, ...emptyTextFont }]}>{emptyStateText || localize("NO_PARTICIPANTS")}</Text>
|
|
184
|
+
</View>
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<View style={{ backgroundColor, height, width, borderRadius, ...border }}>
|
|
190
|
+
<View style={[Style.row, Style.headerStyle, { height: 60 }]}>
|
|
191
|
+
<View style={Style.row}>
|
|
192
|
+
{
|
|
193
|
+
showBackButton ?
|
|
194
|
+
BackButton ??
|
|
195
|
+
<TouchableOpacity style={Style.imageStyle} onPress={onBack}>
|
|
196
|
+
<Image
|
|
197
|
+
source={BackIcon}
|
|
198
|
+
style={[Style.imageStyle, { tintColor: backIconTint }]}
|
|
199
|
+
/>
|
|
200
|
+
</TouchableOpacity> : null
|
|
201
|
+
}
|
|
202
|
+
<Text style={[{ color: titleColor, ...titleFont }]}>{title}</Text>
|
|
203
|
+
</View>
|
|
204
|
+
<View style={Style.row}>
|
|
205
|
+
{
|
|
206
|
+
AppBarOptions && <AppBarOptions />
|
|
207
|
+
}
|
|
208
|
+
</View>
|
|
209
|
+
</View>
|
|
210
|
+
{data.length == 0 ?
|
|
211
|
+
<EmptyView /> :
|
|
212
|
+
<FlatList
|
|
213
|
+
data={data}
|
|
214
|
+
keyExtractor={(item) => item.sessionId}
|
|
215
|
+
renderItem={_render}
|
|
216
|
+
/>
|
|
217
|
+
}
|
|
218
|
+
</View>
|
|
219
|
+
)
|
|
220
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CallLogParticipantsConfiguration, CallLogParticipantsConfigurationInterface } from './CallLogParticipantsConfiguration';
|
|
2
|
+
import { CallParticipantsStyle, CallParticipantsStyleInterface } from './CallLogParticipantsStyle';
|
|
3
|
+
import { CometChatParticipants, CometChatCallLogParticipantsConfigurationInterface } from './CometChatCallLogParticipants'
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
CallLogParticipantsConfiguration,
|
|
7
|
+
CallLogParticipantsConfigurationInterface,
|
|
8
|
+
CallParticipantsStyle,
|
|
9
|
+
CallParticipantsStyleInterface,
|
|
10
|
+
CometChatParticipants,
|
|
11
|
+
CometChatCallLogParticipantsConfigurationInterface
|
|
12
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
|
|
3
|
+
export const Style = StyleSheet.create({
|
|
4
|
+
container: {
|
|
5
|
+
flex: 1,
|
|
6
|
+
justifyContent: "center",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
},
|
|
9
|
+
headerStyle : {
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "space-between",
|
|
12
|
+
paddingEnd: 8,
|
|
13
|
+
paddingStart: 8
|
|
14
|
+
},
|
|
15
|
+
row: {
|
|
16
|
+
flexDirection: "row",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
},
|
|
19
|
+
imageStyle: {
|
|
20
|
+
height: 24,
|
|
21
|
+
width: 24,
|
|
22
|
+
alignSelf: "center",
|
|
23
|
+
}
|
|
24
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from "react-native/types";
|
|
2
|
+
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
3
|
+
import { DatePattern, ImageType, ListItemStyleInterface } from "../../shared";
|
|
4
|
+
import { CallRecordingsStyleInterface } from "./CallLogRecordingsStyle";
|
|
5
|
+
|
|
6
|
+
export interface CallLogRecordingsConfigurationInterface {
|
|
7
|
+
SubtitleView?: (param: { recording?: CometChat.BaseMessage }) => JSX.Element,
|
|
8
|
+
TailView?: (param: { recording?: CometChat.BaseMessage }) => JSX.Element,
|
|
9
|
+
ListItemView?: (param: { recording?: CometChat.BaseMessage }) => JSX.Element,
|
|
10
|
+
AppBarOptions?: () => JSX.Element,
|
|
11
|
+
/**
|
|
12
|
+
* Recording list
|
|
13
|
+
*/
|
|
14
|
+
data: any[],
|
|
15
|
+
datePattern?: DatePattern, //'timeFormat' | 'dayDateFormat' | 'dayDateTimeFormat',
|
|
16
|
+
hideSeperator?: boolean,
|
|
17
|
+
BackButton?: JSX.Element,
|
|
18
|
+
showBackButton?: boolean,
|
|
19
|
+
EmptyStateView?: () => JSX.Element,
|
|
20
|
+
onItemPress?: (item: CometChat.BaseMessage) => void,
|
|
21
|
+
onError?: (e: CometChat.CometChatException) => void,
|
|
22
|
+
onBack?: () => void,
|
|
23
|
+
hideDownloadButton?: boolean,
|
|
24
|
+
onDownloadIconPress?: (prop: { recording: CometChat.BaseMessage }) => void,
|
|
25
|
+
downloadIcon?: ImageType,
|
|
26
|
+
listItemStyle?: ListItemStyleInterface,
|
|
27
|
+
callLogRecordingsStyle?: CallRecordingsStyleInterface,
|
|
28
|
+
bodyViewContainerStyle?: StyleProp<ViewStyle>,
|
|
29
|
+
tailViewContainerStyle?: StyleProp<ViewStyle>,
|
|
30
|
+
}
|
|
31
|
+
export class CallLogRecordingsConfiguration implements CallLogRecordingsConfigurationInterface {
|
|
32
|
+
SubtitleView?: (param: { recording?: CometChat.BaseMessage }) => JSX.Element
|
|
33
|
+
TailView?: (param: { recording?: CometChat.BaseMessage }) => JSX.Element
|
|
34
|
+
ListItemView?: (param: { recording?: CometChat.BaseMessage }) => JSX.Element
|
|
35
|
+
AppBarOptions?: () => JSX.Element
|
|
36
|
+
/**
|
|
37
|
+
* Recording list
|
|
38
|
+
*/
|
|
39
|
+
data: any[]
|
|
40
|
+
datePattern: DatePattern; //'timeFormat' | 'dayDateFormat' | 'dayDateTimeFormat'
|
|
41
|
+
hideSeperator?: boolean
|
|
42
|
+
BackButton?: JSX.Element
|
|
43
|
+
showBackButton?: boolean
|
|
44
|
+
EmptyStateView?: () => JSX.Element
|
|
45
|
+
onItemPress?: (item: CometChat.BaseMessage) => void
|
|
46
|
+
onError?: (e: CometChat.CometChatException) => void
|
|
47
|
+
onBack?: () => void
|
|
48
|
+
hideDownloadButton?: boolean
|
|
49
|
+
onDownloadIconPress?: (prop: { recording: CometChat.BaseMessage }) => void
|
|
50
|
+
downloadIcon?: ImageType
|
|
51
|
+
listItemStyle?: ListItemStyleInterface
|
|
52
|
+
callLogRecordingsStyle?: CallRecordingsStyleInterface
|
|
53
|
+
bodyViewContainerStyle?: StyleProp<ViewStyle>
|
|
54
|
+
tailViewContainerStyle?: StyleProp<ViewStyle>
|
|
55
|
+
|
|
56
|
+
constructor(props: CallLogRecordingsConfigurationInterface) {
|
|
57
|
+
if (props) {
|
|
58
|
+
for (const [key, value] of Object.entries(props)) {
|
|
59
|
+
this[key] = value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BaseStyle, BaseStyleInterface, FontStyle, FontStyleInterface } from "../../shared";
|
|
2
|
+
|
|
3
|
+
export interface CallRecordingsStyleInterface extends BaseStyleInterface {
|
|
4
|
+
titleFont?: FontStyleInterface;
|
|
5
|
+
titleColor?: string;
|
|
6
|
+
dateTextFont?: FontStyleInterface;
|
|
7
|
+
dateTextColor?: string;
|
|
8
|
+
emptyTextFont?: FontStyleInterface;
|
|
9
|
+
emptyTextColor?: string;
|
|
10
|
+
backIconTint?: string;
|
|
11
|
+
durationTextFont?: FontStyleInterface;
|
|
12
|
+
durationTextColor?: string;
|
|
13
|
+
loadingIconTint?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class CallRecordingsStyle extends BaseStyle {
|
|
17
|
+
titleFont?: FontStyleInterface;
|
|
18
|
+
titleColor?: string;
|
|
19
|
+
dateTextFont?: FontStyleInterface;
|
|
20
|
+
dateTextColor?: string;
|
|
21
|
+
emptyTextFont?: FontStyleInterface;
|
|
22
|
+
emptyTextColor?: string;
|
|
23
|
+
backIconTint?: string;
|
|
24
|
+
durationTextFont?: FontStyleInterface;
|
|
25
|
+
durationTextColor?: string;
|
|
26
|
+
loadingIconTint?: string;
|
|
27
|
+
|
|
28
|
+
constructor({
|
|
29
|
+
titleFont = { fontSize: 20, fontWeight: "600"},
|
|
30
|
+
backgroundColor = "white",
|
|
31
|
+
border,
|
|
32
|
+
borderRadius,
|
|
33
|
+
height,
|
|
34
|
+
titleColor = "#000",
|
|
35
|
+
dateTextFont,
|
|
36
|
+
dateTextColor,
|
|
37
|
+
emptyTextColor,
|
|
38
|
+
emptyTextFont,
|
|
39
|
+
backIconTint,
|
|
40
|
+
loadingIconTint,
|
|
41
|
+
durationTextColor,
|
|
42
|
+
durationTextFont,
|
|
43
|
+
width
|
|
44
|
+
}: CallRecordingsStyleInterface) {
|
|
45
|
+
super({
|
|
46
|
+
backgroundColor: backgroundColor,
|
|
47
|
+
border: border,
|
|
48
|
+
borderRadius: borderRadius,
|
|
49
|
+
height: height,
|
|
50
|
+
width: width
|
|
51
|
+
});
|
|
52
|
+
this.titleColor = titleColor;
|
|
53
|
+
this.titleFont = titleFont;
|
|
54
|
+
this.dateTextFont = dateTextFont;
|
|
55
|
+
this.dateTextColor = dateTextColor;
|
|
56
|
+
this.emptyTextColor = emptyTextColor;
|
|
57
|
+
this.emptyTextFont = emptyTextFont;
|
|
58
|
+
this.backIconTint = backIconTint;
|
|
59
|
+
this.durationTextColor = durationTextColor;
|
|
60
|
+
this.durationTextFont = durationTextFont;
|
|
61
|
+
this.loadingIconTint = loadingIconTint;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { CometChat } from '@cometchat/chat-sdk-react-native'
|
|
2
|
+
import React, { useContext, useEffect, useRef, useState } from 'react'
|
|
3
|
+
import { FlatList, Image, Text, TouchableOpacity, View, NativeModules, Platform, ActivityIndicator } from 'react-native'
|
|
4
|
+
import { StyleProp, ViewStyle } from "react-native/types";
|
|
5
|
+
import { CometChatContext, CometChatDate, CometChatListItem, DatePattern, ImageType, ListItemStyleInterface, localize } from '../../shared'
|
|
6
|
+
import { CallRecordingsStyle, CallRecordingsStyleInterface } from './CallLogRecordingsStyle'
|
|
7
|
+
import { BackIcon, Download } from "./resources";
|
|
8
|
+
import { Style } from './style'
|
|
9
|
+
import { CallUtils } from '../CallUtils'
|
|
10
|
+
|
|
11
|
+
const { FileManager } = NativeModules;
|
|
12
|
+
export interface CometChatCallLogRecordingsConfigurationInterface {
|
|
13
|
+
title?: string,
|
|
14
|
+
SubtitleView?: (param: { recording?: CometChat.BaseMessage }) => JSX.Element,
|
|
15
|
+
TailView?: (param: { recording?: CometChat.BaseMessage }) => JSX.Element,
|
|
16
|
+
ListItemView?: (param: { recording?: CometChat.BaseMessage }) => JSX.Element,
|
|
17
|
+
AppBarOptions?: () => JSX.Element,
|
|
18
|
+
/**
|
|
19
|
+
* Recording list
|
|
20
|
+
*/
|
|
21
|
+
data: any[],
|
|
22
|
+
datePattern?: DatePattern,
|
|
23
|
+
hideSeperator?: boolean,
|
|
24
|
+
BackButton?: JSX.Element,
|
|
25
|
+
showBackButton?: boolean,
|
|
26
|
+
EmptyStateView?: () => JSX.Element,
|
|
27
|
+
emptyStateText?: string,
|
|
28
|
+
onItemPress?: (item: CometChat.BaseMessage) => void,
|
|
29
|
+
onError?: (e: CometChat.CometChatException) => void,
|
|
30
|
+
onBack?: () => void,
|
|
31
|
+
hideDownloadButton?: boolean,
|
|
32
|
+
onDownloadIconPress?: (prop: { recording: CometChat.BaseMessage }) => void,
|
|
33
|
+
downloadIcon?: ImageType,
|
|
34
|
+
listItemStyle?: ListItemStyleInterface,
|
|
35
|
+
callLogRecordingsStyle?: CallRecordingsStyleInterface,
|
|
36
|
+
bodyViewContainerStyle?: StyleProp<ViewStyle>,
|
|
37
|
+
tailViewContainerStyle?: StyleProp<ViewStyle>,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const CometChatRecordings = (props: CometChatCallLogRecordingsConfigurationInterface) => {
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
title = localize("RECORDINGS"),
|
|
44
|
+
SubtitleView,
|
|
45
|
+
TailView,
|
|
46
|
+
ListItemView,
|
|
47
|
+
AppBarOptions,
|
|
48
|
+
data,
|
|
49
|
+
hideSeperator,
|
|
50
|
+
BackButton,
|
|
51
|
+
showBackButton,
|
|
52
|
+
EmptyStateView,
|
|
53
|
+
emptyStateText,
|
|
54
|
+
onItemPress,
|
|
55
|
+
onError,
|
|
56
|
+
onBack,
|
|
57
|
+
onDownloadIconPress,
|
|
58
|
+
downloadIcon,
|
|
59
|
+
listItemStyle,
|
|
60
|
+
callLogRecordingsStyle,
|
|
61
|
+
bodyViewContainerStyle,
|
|
62
|
+
tailViewContainerStyle,
|
|
63
|
+
datePattern,
|
|
64
|
+
hideDownloadButton
|
|
65
|
+
} = props;
|
|
66
|
+
|
|
67
|
+
const { theme } = useContext(CometChatContext);
|
|
68
|
+
const [processing, setProcessing] = useState(false);
|
|
69
|
+
|
|
70
|
+
const _style = new CallRecordingsStyle({
|
|
71
|
+
titleFont: theme.typography.heading,
|
|
72
|
+
titleColor: theme.palette.getAccent(),
|
|
73
|
+
backgroundColor: theme.palette.getBackgroundColor(),
|
|
74
|
+
emptyTextColor: theme?.palette?.getAccent400(),
|
|
75
|
+
emptyTextFont: theme?.typography?.subtitle1,
|
|
76
|
+
backIconTint: theme.palette.getPrimary(),
|
|
77
|
+
durationTextColor: theme.palette.getAccent(),
|
|
78
|
+
durationTextFont: theme.typography.subtitle2,
|
|
79
|
+
dateTextColor: theme.palette.getAccent(),
|
|
80
|
+
dateTextFont: theme.typography.subtitle1,
|
|
81
|
+
loadingIconTint: theme.palette.getPrimary(),
|
|
82
|
+
...callLogRecordingsStyle
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const {
|
|
86
|
+
backgroundColor,
|
|
87
|
+
height,
|
|
88
|
+
width,
|
|
89
|
+
border,
|
|
90
|
+
borderRadius,
|
|
91
|
+
titleColor,
|
|
92
|
+
titleFont,
|
|
93
|
+
backIconTint,
|
|
94
|
+
dateTextColor,
|
|
95
|
+
dateTextFont,
|
|
96
|
+
durationTextColor,
|
|
97
|
+
durationTextFont,
|
|
98
|
+
emptyTextColor,
|
|
99
|
+
emptyTextFont,
|
|
100
|
+
loadingIconTint,
|
|
101
|
+
} = _style;
|
|
102
|
+
|
|
103
|
+
const loggedInUser = useRef(null);
|
|
104
|
+
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
CometChat.getLoggedinUser()
|
|
107
|
+
.then(u => {
|
|
108
|
+
loggedInUser.current = u;
|
|
109
|
+
})
|
|
110
|
+
.catch(e => {
|
|
111
|
+
onError && onError(e);
|
|
112
|
+
});
|
|
113
|
+
}, []);
|
|
114
|
+
|
|
115
|
+
const DefaultSubtitleView = ({ recording }) => {
|
|
116
|
+
if (SubtitleView)
|
|
117
|
+
return SubtitleView(recording);
|
|
118
|
+
return (
|
|
119
|
+
<View style={[Style.row, { marginTop: 2 }]}>
|
|
120
|
+
<Text style={{ color: durationTextColor, ...durationTextFont }}>
|
|
121
|
+
{
|
|
122
|
+
CallUtils.convertSecondsToHoursMinutesSeconds(recording['duration'])
|
|
123
|
+
}
|
|
124
|
+
</Text>
|
|
125
|
+
</View>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const DefaultTailView = ({ recording }) => {
|
|
130
|
+
const getFileName = (fileUrl) => {
|
|
131
|
+
return (fileUrl.substring(fileUrl.lastIndexOf("/") + 1, fileUrl.length)).replace(" ", "_");
|
|
132
|
+
}
|
|
133
|
+
const _onDownloadIconPress = async () => {
|
|
134
|
+
if (onDownloadIconPress) {
|
|
135
|
+
onDownloadIconPress({ recording });
|
|
136
|
+
} else {
|
|
137
|
+
if (processing) return;
|
|
138
|
+
|
|
139
|
+
setProcessing(true);
|
|
140
|
+
console.log("DOWNLOAD by Default")
|
|
141
|
+
try {
|
|
142
|
+
if (Platform.OS === "android") {
|
|
143
|
+
await FileManager.checkAndDownload(recording?.recording_url, getFileName(recording?.recording_url), async (isOpened: string) => {
|
|
144
|
+
console.log("android", isOpened);
|
|
145
|
+
});
|
|
146
|
+
setProcessing(false);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
FileManager.openFile(recording?.recording_url, getFileName(recording?.recording_url), async (isOpened: string) => {
|
|
150
|
+
console.log("ios", isOpened);
|
|
151
|
+
setProcessing(false);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch (e) {
|
|
156
|
+
console.log(e);
|
|
157
|
+
setProcessing(false);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return (
|
|
162
|
+
<View style={[Style.row, { alignItems: "center" }]}>
|
|
163
|
+
<CometChatDate timeStamp={recording['startTime'] * 1000} pattern={datePattern || 'dayDateFormat'} style={{ textColor: dateTextColor, textFont: dateTextFont }} />
|
|
164
|
+
{!hideDownloadButton && <View style={{ marginLeft: 5 }}>
|
|
165
|
+
{!processing ? <TouchableOpacity onPress={_onDownloadIconPress}>
|
|
166
|
+
<Image source={downloadIcon || Download} style={{ height: 20, width: 20, tintColor: loadingIconTint }} />
|
|
167
|
+
</TouchableOpacity> :
|
|
168
|
+
<ActivityIndicator size={"small"} color={loadingIconTint} />}
|
|
169
|
+
</View>}
|
|
170
|
+
</View>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const onPress = (item) => {
|
|
175
|
+
onItemPress && onItemPress(item);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const _render = ({ item, index }) => {
|
|
180
|
+
|
|
181
|
+
if (ListItemView)
|
|
182
|
+
return <ListItemView recording={item} />
|
|
183
|
+
|
|
184
|
+
const title = item['rid'];
|
|
185
|
+
|
|
186
|
+
return <React.Fragment key={index}>
|
|
187
|
+
<CometChatListItem
|
|
188
|
+
id={item.sessionId}
|
|
189
|
+
title={title}
|
|
190
|
+
listItemStyle={listItemStyle ? listItemStyle : { height: 70 }}
|
|
191
|
+
bodyViewContainerStyle={
|
|
192
|
+
bodyViewContainerStyle ? bodyViewContainerStyle : {
|
|
193
|
+
marginHorizontal: 10
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
tailViewContainerStyle={
|
|
197
|
+
tailViewContainerStyle ? tailViewContainerStyle : {
|
|
198
|
+
marginHorizontal: 10
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
SubtitleView={() =>
|
|
202
|
+
SubtitleView ? <SubtitleView recording={item} /> : <DefaultSubtitleView recording={item} />
|
|
203
|
+
}
|
|
204
|
+
TailView={TailView ? () => <TailView recording={item} /> : () => <DefaultTailView recording={item} />}
|
|
205
|
+
onPress={() => onPress(item)}
|
|
206
|
+
hideSeparator={hideSeperator}
|
|
207
|
+
/>
|
|
208
|
+
</React.Fragment>
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const EmptyView = () => {
|
|
212
|
+
if (EmptyStateView)
|
|
213
|
+
return <EmptyStateView />
|
|
214
|
+
return (
|
|
215
|
+
<View style={[Style.container]}>
|
|
216
|
+
<Text style={[{ color: emptyTextColor, ...emptyTextFont }]}>{emptyStateText || localize("NO_RECORDINGS")}</Text>
|
|
217
|
+
</View>
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return (
|
|
222
|
+
<View style={{ backgroundColor, height, width, borderRadius, ...border }}>
|
|
223
|
+
<View style={[Style.row, Style.headerStyle, { height: 60 }]}>
|
|
224
|
+
<View style={Style.row}>
|
|
225
|
+
{
|
|
226
|
+
showBackButton ?
|
|
227
|
+
BackButton ??
|
|
228
|
+
<TouchableOpacity style={Style.imageStyle} onPress={onBack}>
|
|
229
|
+
<Image
|
|
230
|
+
source={BackIcon}
|
|
231
|
+
style={[Style.imageStyle, { tintColor: backIconTint }]}
|
|
232
|
+
/>
|
|
233
|
+
</TouchableOpacity> : null
|
|
234
|
+
}
|
|
235
|
+
<Text style={[{ color: titleColor, ...titleFont }]}>{title}</Text>
|
|
236
|
+
</View>
|
|
237
|
+
<View style={Style.row}>
|
|
238
|
+
{
|
|
239
|
+
AppBarOptions && <AppBarOptions />
|
|
240
|
+
}
|
|
241
|
+
</View>
|
|
242
|
+
</View>
|
|
243
|
+
{data.length == 0 ?
|
|
244
|
+
<EmptyView /> :
|
|
245
|
+
<FlatList
|
|
246
|
+
data={data}
|
|
247
|
+
keyExtractor={(item) => item.sessionId}
|
|
248
|
+
renderItem={_render}
|
|
249
|
+
/>
|
|
250
|
+
}
|
|
251
|
+
</View>
|
|
252
|
+
)
|
|
253
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CallLogRecordingsConfiguration, CallLogRecordingsConfigurationInterface } from './CallLogRecordingsConfiguration';
|
|
2
|
+
import { CallRecordingsStyle, CallRecordingsStyleInterface } from './CallLogRecordingsStyle';
|
|
3
|
+
import { CometChatRecordings, CometChatCallLogRecordingsConfigurationInterface } from './CometChatCallLogRecordings';
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
CallLogRecordingsConfiguration,
|
|
7
|
+
CallLogRecordingsConfigurationInterface,
|
|
8
|
+
CallRecordingsStyle,
|
|
9
|
+
CallRecordingsStyleInterface,
|
|
10
|
+
CometChatRecordings,
|
|
11
|
+
CometChatCallLogRecordingsConfigurationInterface
|
|
12
|
+
}
|
|
Binary file
|
|
Binary file
|