@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,20 @@
|
|
|
1
|
+
export class CometChatNetworkUtils {
|
|
2
|
+
|
|
3
|
+
static async fetcher({ url, method, body, headers }: { url: string, method: string, body: any, headers: any }) {
|
|
4
|
+
try {
|
|
5
|
+
const res = await fetch(url, {
|
|
6
|
+
method: method,
|
|
7
|
+
body: JSON.stringify(body),
|
|
8
|
+
headers: {
|
|
9
|
+
"Content-Type": "application/json",
|
|
10
|
+
...headers,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
const json = await res.json();
|
|
14
|
+
return res;
|
|
15
|
+
} catch (error) {
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -14,7 +14,7 @@ export class CometChatConversationUtils {
|
|
|
14
14
|
return options;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
static getLastMessage(conversation
|
|
17
|
+
static getLastMessage(conversation: CometChat.Conversation): CometChat.BaseMessage {
|
|
18
18
|
let msg = conversation.getLastMessage();
|
|
19
19
|
if (!msg) {
|
|
20
20
|
return undefined;
|
|
@@ -36,12 +36,12 @@ export class CometChatConversationUtils {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
static
|
|
39
|
+
static getMessagePreview = (lastMessage: CometChat.BaseMessage): string => {
|
|
40
40
|
|
|
41
|
-
if (lastMessage!=undefined) {
|
|
41
|
+
if (lastMessage != undefined) {
|
|
42
42
|
|
|
43
43
|
if (lastMessage.getDeletedAt() !== undefined) {
|
|
44
|
-
|
|
44
|
+
return localize("THIS_MESSAGE_DELETED");
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
let groupText = "", msgText = "";
|
|
@@ -66,8 +66,11 @@ export class CometChatConversationUtils {
|
|
|
66
66
|
} else if (lastMessage.getCategory() == CometChat.CATEGORY_CUSTOM as CometChat.MessageCategory) {
|
|
67
67
|
msgText = lastMessage.getType();
|
|
68
68
|
} else if (lastMessage.getCategory() == CometChat.CATEGORY_ACTION as CometChat.MessageCategory) {
|
|
69
|
-
msgText =(lastMessage as CometChat.Action).getMessage();
|
|
70
|
-
} else {
|
|
69
|
+
msgText = (lastMessage as CometChat.Action).getMessage();
|
|
70
|
+
} else if (lastMessage.getCategory() === CometChat.CATEGORY_INTERACTIVE) {
|
|
71
|
+
msgText = lastMessage.getType() === "form" ? `${localize('FORM')} 📋` : `${localize('CARD')} 🪧`;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
71
74
|
msgText = lastMessage['metaData']?.pushNotification;
|
|
72
75
|
}
|
|
73
76
|
return (msgText)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { View, Text, ActivityIndicator, Image } from 'react-native'
|
|
2
|
+
import React, { useContext } from 'react'
|
|
3
|
+
import { AIBaseStyle, AIBaseStyleInterface } from '../../../AI/AIBaseStyle';
|
|
4
|
+
import { CometChatContext } from '../../CometChatContext';
|
|
5
|
+
import { ErrorMessageIcon, NoMessageIcon } from './resources';
|
|
6
|
+
|
|
7
|
+
const enum States {
|
|
8
|
+
loading = "loading",
|
|
9
|
+
error = "error",
|
|
10
|
+
empty = "empty",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CometChatAICardInterface {
|
|
14
|
+
state: "loading" | "error" | "empty",
|
|
15
|
+
style: AIBaseStyleInterface,
|
|
16
|
+
loadingIconTint?: string,
|
|
17
|
+
errorIconTint?: string,
|
|
18
|
+
emptyIconTint?: string,
|
|
19
|
+
loadingIconURL?: string,
|
|
20
|
+
errorIconURL?: string,
|
|
21
|
+
emptyIconURL?: string,
|
|
22
|
+
loadingStateText?: string,
|
|
23
|
+
errorStateText?: string,
|
|
24
|
+
emptyStateText?: string,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const CometChatAICard = (props: CometChatAICardInterface) => {
|
|
28
|
+
const { state, style,
|
|
29
|
+
loadingStateText, loadingIconURL,
|
|
30
|
+
emptyIconURL, emptyStateText,
|
|
31
|
+
errorIconURL, errorStateText } = props;
|
|
32
|
+
|
|
33
|
+
const { theme } = useContext(CometChatContext);
|
|
34
|
+
|
|
35
|
+
const { emptyStateTextColor, emptyStateTextFont, emptyIconTint,
|
|
36
|
+
errorStateTextColor, errorStateTextFont, errorIconTint,
|
|
37
|
+
loadingStateTextColor, loadingStateTextFont, loadingIconTint
|
|
38
|
+
} = new AIBaseStyle({
|
|
39
|
+
emptyIconTint: theme.palette.getAccent(),
|
|
40
|
+
emptyStateTextColor: theme.palette.getAccent(),
|
|
41
|
+
emptyStateTextFont: theme.typography.subtitle1,
|
|
42
|
+
errorIconTint: theme.palette.getAccent(),
|
|
43
|
+
errorStateTextColor: theme.palette.getAccent(),
|
|
44
|
+
errorStateTextFont: theme.typography.subtitle1,
|
|
45
|
+
loadingIconTint: theme.palette.getAccent(),
|
|
46
|
+
loadingStateTextColor: theme.palette.getAccent(),
|
|
47
|
+
loadingStateTextFont: theme.typography.subtitle1,
|
|
48
|
+
...style,
|
|
49
|
+
})
|
|
50
|
+
return (
|
|
51
|
+
<View>
|
|
52
|
+
{props.children ? props.children :
|
|
53
|
+
state === States.loading ? <View style={{ flexDirection: "row", alignItems: "center", padding: 10 }}>
|
|
54
|
+
{!loadingIconURL ? <ActivityIndicator color={loadingIconTint} /> :
|
|
55
|
+
<Image style={{ width: 25, height: 25, tintColor: loadingIconTint }} source={loadingIconURL} />}
|
|
56
|
+
<Text style={[loadingStateTextFont, { color: loadingStateTextColor, marginLeft: 10 }]}>{loadingStateText}</Text>
|
|
57
|
+
</View>
|
|
58
|
+
: state === States.error ? <View style={{ flexDirection: "row", alignItems: "center", padding: 10 }}>
|
|
59
|
+
<Image style={{ width: 25, height: 25, tintColor: errorIconTint }} source={errorIconURL || ErrorMessageIcon} />
|
|
60
|
+
<Text style={[errorStateTextFont, { color: errorStateTextColor, marginLeft: 10 }]}>{errorStateText}</Text>
|
|
61
|
+
</View>
|
|
62
|
+
: state === States.empty ? <View style={{ flexDirection: "row", alignItems: "center", padding: 10 }}>
|
|
63
|
+
<Image style={{ width: 25, height: 25, tintColor: emptyIconTint }} source={emptyIconURL || NoMessageIcon} />
|
|
64
|
+
<Text style={[emptyStateTextFont, { color: emptyStateTextColor, marginLeft: 10 }]}>{emptyStateText}</Text>
|
|
65
|
+
</View>
|
|
66
|
+
: null}
|
|
67
|
+
</View>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default CometChatAICard
|
|
Binary file
|
|
Binary file
|
|
@@ -10,6 +10,7 @@ export interface ActionSheetStylesInterface extends BaseStyleInterface {
|
|
|
10
10
|
listItemIconBackground?: string;
|
|
11
11
|
listItemIconBorderRadius?: number;
|
|
12
12
|
actionSheetSeparatorTint?: string;
|
|
13
|
+
paddingHorizontal?: number;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -26,6 +27,7 @@ export class ActionSheetStyles extends BaseStyle {
|
|
|
26
27
|
listItemIconBackground: string;
|
|
27
28
|
listItemIconBorderRadius: number;
|
|
28
29
|
actionSheetSeparatorTint: string;
|
|
30
|
+
paddingHorizontal?: number;
|
|
29
31
|
/**
|
|
30
32
|
* @param {object} param0
|
|
31
33
|
* @param {any} width
|
|
@@ -56,6 +58,7 @@ export class ActionSheetStyles extends BaseStyle {
|
|
|
56
58
|
listItemIconBorderRadius = 0,
|
|
57
59
|
listItemTitleFont = new FontStyle({fontSize: 17, fontWeight: "400"}),
|
|
58
60
|
listItemTitleColor = "",
|
|
61
|
+
paddingHorizontal,
|
|
59
62
|
}: ActionSheetStylesInterface) {
|
|
60
63
|
super({
|
|
61
64
|
width,
|
|
@@ -72,5 +75,6 @@ export class ActionSheetStyles extends BaseStyle {
|
|
|
72
75
|
this.listItemTitleColor = listItemTitleColor;
|
|
73
76
|
this.listItemIconBackground = listItemIconBackground;
|
|
74
77
|
this.listItemIconBorderRadius = listItemIconBorderRadius;
|
|
78
|
+
this.paddingHorizontal = paddingHorizontal;
|
|
75
79
|
}
|
|
76
80
|
}
|
|
@@ -38,11 +38,12 @@ const OptionListView = ({
|
|
|
38
38
|
paddingHorizontal: 10,
|
|
39
39
|
borderRadius: cornerRadius || 0,
|
|
40
40
|
backgroundColor: backgroundColor || theme.palette.getAccent50(),
|
|
41
|
+
justifyContent: !iconUrl ? 'center' : undefined,
|
|
41
42
|
},
|
|
42
43
|
]}
|
|
43
44
|
onPress={onPress}
|
|
44
45
|
>
|
|
45
|
-
<Image
|
|
46
|
+
{Boolean(iconUrl) && <Image
|
|
46
47
|
source={iconUrl}
|
|
47
48
|
style={[
|
|
48
49
|
Style.listItemImageStyle,
|
|
@@ -57,7 +58,7 @@ const OptionListView = ({
|
|
|
57
58
|
listItemIconBorderRadius || style?.listItemIconBorderRadius || 0,
|
|
58
59
|
},
|
|
59
60
|
]}
|
|
60
|
-
/>
|
|
61
|
+
/>}
|
|
61
62
|
<Text
|
|
62
63
|
style={[
|
|
63
64
|
{
|
|
@@ -145,6 +146,7 @@ interface CometChatActionSheetInterface {
|
|
|
145
146
|
hideLayoutMode: boolean;
|
|
146
147
|
actions: ActionItemInterface[];
|
|
147
148
|
style: ActionSheetStyles;
|
|
149
|
+
hideHeader?: boolean;
|
|
148
150
|
}
|
|
149
151
|
export const CometChatActionSheet = (props: CometChatActionSheetInterface) => {
|
|
150
152
|
const { theme } = useContext<CometChatContextType>(CometChatContext);
|
|
@@ -155,6 +157,8 @@ export const CometChatActionSheet = (props: CometChatActionSheetInterface) => {
|
|
|
155
157
|
listItemTitleColor: theme.palette.getAccent(),
|
|
156
158
|
titleColor: theme.palette.getAccent(),
|
|
157
159
|
titleFont: theme.typography.name,
|
|
160
|
+
backgroundColor: props.style?.backgroundColor,
|
|
161
|
+
paddingHorizontal: props.style?.paddingHorizontal
|
|
158
162
|
}),
|
|
159
163
|
...props.style,
|
|
160
164
|
};
|
|
@@ -166,7 +170,7 @@ export const CometChatActionSheet = (props: CometChatActionSheetInterface) => {
|
|
|
166
170
|
|
|
167
171
|
const _render = ({ item }) => {
|
|
168
172
|
return (
|
|
169
|
-
<OptionListView key={item.id} {...item} iconUrl={item.icon || item.iconUrl} theme={theme} style={style} />
|
|
173
|
+
<OptionListView key={item.id} {...item} iconUrl={item.icon || item.iconUrl} theme={theme} backgroundColor={style.listItemBackground} style={style} />
|
|
170
174
|
);
|
|
171
175
|
};
|
|
172
176
|
const _renderGrid = ({ item }) => (
|
|
@@ -188,7 +192,7 @@ export const CometChatActionSheet = (props: CometChatActionSheetInterface) => {
|
|
|
188
192
|
style={{
|
|
189
193
|
height: 1,
|
|
190
194
|
backgroundColor:
|
|
191
|
-
props.style?.actionSheetSeparatorTint ||
|
|
195
|
+
props.style?.actionSheetSeparatorTint || props.style?.optionsSeparatorTint ||
|
|
192
196
|
theme.palette.getAccent200(),
|
|
193
197
|
}}
|
|
194
198
|
/>
|
|
@@ -238,12 +242,12 @@ export const CometChatActionSheet = (props: CometChatActionSheetInterface) => {
|
|
|
238
242
|
width: style?.width,
|
|
239
243
|
backgroundColor: style?.backgroundColor || 'transparent',
|
|
240
244
|
borderRadius: style?.borderRadius,
|
|
241
|
-
paddingHorizontal: 10,
|
|
245
|
+
paddingHorizontal: style?.paddingHorizontal ?? 10,
|
|
242
246
|
},
|
|
243
247
|
style?.border,
|
|
244
248
|
]}
|
|
245
249
|
>
|
|
246
|
-
<View style={Style.headerStyle}>
|
|
250
|
+
{!props.hideHeader && <View style={Style.headerStyle}>
|
|
247
251
|
<Text
|
|
248
252
|
style={[
|
|
249
253
|
Style.titleStyle,
|
|
@@ -259,7 +263,7 @@ export const CometChatActionSheet = (props: CometChatActionSheetInterface) => {
|
|
|
259
263
|
{props.title}
|
|
260
264
|
</Text>
|
|
261
265
|
{getLayoutModeIcon()}
|
|
262
|
-
</View>
|
|
266
|
+
</View>}
|
|
263
267
|
{getList()}
|
|
264
268
|
</View>
|
|
265
269
|
);
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PanResponder,
|
|
8
8
|
TouchableOpacity,
|
|
9
9
|
View,
|
|
10
|
-
Modal,
|
|
10
|
+
Modal, ScrollView, KeyboardAvoidingView, Platform
|
|
11
11
|
} from 'react-native';
|
|
12
12
|
import { Styles } from './style';
|
|
13
13
|
import { CometChatContext } from '../../CometChatContext';
|
|
@@ -26,9 +26,12 @@ export interface CometChatBottomSheetInterface {
|
|
|
26
26
|
shadowColor?: string;
|
|
27
27
|
backgroundColor?: string;
|
|
28
28
|
lineColor?: string;
|
|
29
|
+
lineHeight?: number,
|
|
30
|
+
paddingHorizontal?: number,
|
|
31
|
+
borderRadius?: number,
|
|
29
32
|
};
|
|
30
33
|
}
|
|
31
|
-
const CometChatBottomSheet = forwardRef((props: CometChatBottomSheetInterface,ref) => {
|
|
34
|
+
const CometChatBottomSheet = forwardRef((props: CometChatBottomSheetInterface, ref) => {
|
|
32
35
|
const { theme } = useContext<CometChatContextType>(CometChatContext);
|
|
33
36
|
const {
|
|
34
37
|
sliderMaxHeight,
|
|
@@ -98,62 +101,68 @@ const CometChatBottomSheet = forwardRef((props: CometChatBottomSheetInterface,re
|
|
|
98
101
|
BackHandler.removeEventListener('hardwareBackPress', _onBackPress);
|
|
99
102
|
};
|
|
100
103
|
}, []);
|
|
101
|
-
|
|
104
|
+
|
|
102
105
|
return (
|
|
103
106
|
<Modal
|
|
104
107
|
transparent={true}
|
|
105
108
|
visible={isOpen}
|
|
106
109
|
onRequestClose={() => togglePanel()}
|
|
107
110
|
>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
onStartShouldSetResponder={() => togglePanel()}
|
|
112
|
-
/>
|
|
113
|
-
<Animated.View
|
|
114
|
-
onLayout={_setSize}
|
|
115
|
-
{..._parentPanResponder?.panHandlers}
|
|
116
|
-
style={{
|
|
117
|
-
...Styles.containerStyle,
|
|
118
|
-
backgroundColor:
|
|
119
|
-
style?.backgroundColor ?? theme.palette.getBackgroundColor(),
|
|
120
|
-
shadowColor: style?.shadowColor ?? theme.palette.getAccent(),
|
|
121
|
-
maxHeight: sliderMaxHeight,
|
|
122
|
-
transform: [
|
|
123
|
-
{ translateY: panelHeightValue },
|
|
124
|
-
{ scale: isOpen ? 1 : 0 },
|
|
125
|
-
],
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
111
|
+
<KeyboardAvoidingView style={{ flex: 1 }} behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
112
|
+
>
|
|
113
|
+
<ScrollView contentContainerStyle={Styles.wrapperStyle}>
|
|
128
114
|
<View
|
|
129
|
-
style={Styles.
|
|
130
|
-
{
|
|
115
|
+
style={Styles.greyWrapperStyle}
|
|
116
|
+
onStartShouldSetResponder={() => togglePanel()}
|
|
117
|
+
/>
|
|
118
|
+
<Animated.View
|
|
119
|
+
onLayout={_setSize}
|
|
120
|
+
{..._parentPanResponder?.panHandlers}
|
|
121
|
+
style={{
|
|
122
|
+
...Styles.containerStyle,
|
|
123
|
+
backgroundColor:
|
|
124
|
+
style?.backgroundColor ?? theme.palette.getBackgroundColor(),
|
|
125
|
+
shadowColor: style?.shadowColor ?? theme.palette.getAccent(),
|
|
126
|
+
maxHeight: sliderMaxHeight,
|
|
127
|
+
transform: [
|
|
128
|
+
{ translateY: panelHeightValue },
|
|
129
|
+
{ scale: isOpen ? 1 : 0 },
|
|
130
|
+
],
|
|
131
|
+
paddingHorizontal: style?.paddingHorizontal || 5,
|
|
132
|
+
borderTopLeftRadius: style?.borderRadius || 30,
|
|
133
|
+
borderTopRightRadius: style?.borderRadius || 30,
|
|
134
|
+
}}
|
|
131
135
|
>
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
style={{ height: 30 }}
|
|
136
|
+
<View
|
|
137
|
+
style={Styles.outerContentStyle}
|
|
138
|
+
{..._childPanResponder?.panHandlers}
|
|
136
139
|
>
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
140
|
+
<TouchableOpacity
|
|
141
|
+
onPress={togglePanel.bind(this)}
|
|
142
|
+
activeOpacity={1}
|
|
143
|
+
style={{ height: style.lineHeight || 30 }}
|
|
144
|
+
>
|
|
145
|
+
<View style={Styles.lineContainerStyle}>
|
|
146
|
+
<View
|
|
147
|
+
style={[
|
|
148
|
+
Styles.lineStyle,
|
|
149
|
+
{
|
|
150
|
+
backgroundColor:
|
|
151
|
+
style?.lineColor ?? theme.palette.getAccent200(),
|
|
152
|
+
},
|
|
153
|
+
]}
|
|
154
|
+
/>
|
|
155
|
+
</View>
|
|
156
|
+
</TouchableOpacity>
|
|
157
|
+
<View style={Styles.innerContentStyle}>
|
|
158
|
+
{typeof children === 'function'
|
|
159
|
+
? children(_handleScrollEndDrag)
|
|
160
|
+
: children}
|
|
147
161
|
</View>
|
|
148
|
-
</TouchableOpacity>
|
|
149
|
-
<View style={Styles.innerContentStyle}>
|
|
150
|
-
{typeof children === 'function'
|
|
151
|
-
? children(_handleScrollEndDrag)
|
|
152
|
-
: children}
|
|
153
162
|
</View>
|
|
154
|
-
</View>
|
|
155
|
-
</
|
|
156
|
-
</
|
|
163
|
+
</Animated.View>
|
|
164
|
+
</ScrollView>
|
|
165
|
+
</KeyboardAvoidingView>
|
|
157
166
|
</Modal>
|
|
158
167
|
);
|
|
159
168
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { View, TouchableOpacity, Text, Image } from "react-native";
|
|
2
|
+
import { View, TouchableOpacity, Text, Image, ActivityIndicator } from "react-native";
|
|
3
3
|
import { ImageType } from '../../base';
|
|
4
4
|
import { ButtonStyle, ButtonStyleInterface } from './CometChatButtonStyle';
|
|
5
5
|
import { CometChatContext } from '../../CometChatContext';
|
|
@@ -10,7 +10,7 @@ export interface CometChatButtonInterface {
|
|
|
10
10
|
iconUrl?: ImageType,
|
|
11
11
|
style?: ButtonStyleInterface,
|
|
12
12
|
onPress?: () => void,
|
|
13
|
-
|
|
13
|
+
isLoading?: boolean,
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const CometChatButton = (props: CometChatButtonInterface) => {
|
|
@@ -18,7 +18,8 @@ export const CometChatButton = (props: CometChatButtonInterface) => {
|
|
|
18
18
|
iconUrl,
|
|
19
19
|
onPress,
|
|
20
20
|
style,
|
|
21
|
-
text
|
|
21
|
+
text,
|
|
22
|
+
isLoading
|
|
22
23
|
} = props;
|
|
23
24
|
|
|
24
25
|
const { theme } = useContext(CometChatContext);
|
|
@@ -41,25 +42,34 @@ export const CometChatButton = (props: CometChatButtonInterface) => {
|
|
|
41
42
|
});
|
|
42
43
|
|
|
43
44
|
return (
|
|
44
|
-
<TouchableOpacity onPress={onPress} style={{alignItems: "center", backgroundColor, borderRadius}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
45
|
+
<TouchableOpacity onPress={onPress} style={[{ alignItems: "center", backgroundColor, borderRadius }, !iconUrl && {
|
|
46
|
+
height, width, justifyContent: "center",
|
|
47
|
+
}]}>
|
|
48
|
+
{!isLoading ? <>
|
|
49
|
+
{Boolean(iconUrl) && <View style={[Style.container, { backgroundColor: iconBackgroundColor, borderRadius: iconCornerRadius, ...border }]}>
|
|
50
|
+
<Image
|
|
51
|
+
source={iconUrl}
|
|
52
|
+
resizeMode="contain"
|
|
53
|
+
style={{
|
|
54
|
+
height,
|
|
55
|
+
width,
|
|
56
|
+
backgroundColor: iconBackgroundColor,
|
|
57
|
+
borderRadius: iconCornerRadius,
|
|
58
|
+
tintColor: iconTint,
|
|
59
|
+
...iconBorder,
|
|
60
|
+
}} />
|
|
61
|
+
</View>}
|
|
62
|
+
{
|
|
63
|
+
Boolean(text) && <Text style={{
|
|
64
|
+
color: textColor,
|
|
65
|
+
...textFont
|
|
66
|
+
}}>{text}</Text>
|
|
67
|
+
}
|
|
68
|
+
</>
|
|
69
|
+
:
|
|
70
|
+
<View style={{ position: "absolute", alignSelf: "center" }}>
|
|
71
|
+
<ActivityIndicator size="small" color={textColor} />
|
|
72
|
+
</View>
|
|
63
73
|
}
|
|
64
74
|
</TouchableOpacity>
|
|
65
75
|
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BaseStyle, FontStyle } from "../../base";
|
|
2
|
+
import { ButtonStyleInterface } from "../CometChatButton";
|
|
3
|
+
import { ImageBubbleStyleInterface } from "../CometChatImageBubble";
|
|
4
|
+
|
|
5
|
+
export interface CardBubbleStyleInterface extends BaseStyle {
|
|
6
|
+
textFont?: FontStyle;
|
|
7
|
+
textColor?: string;
|
|
8
|
+
padding?: number;
|
|
9
|
+
buttonStyle?: ButtonStyleInterface;
|
|
10
|
+
imageStyle?: ImageBubbleStyleInterface;
|
|
11
|
+
imageResizeMode?: "cover" | "contain" | "stretch" | "repeat" | "center";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class CardBubbleStyle extends BaseStyle {
|
|
15
|
+
textFont?: FontStyle;
|
|
16
|
+
textColor?: string;
|
|
17
|
+
padding?: number;
|
|
18
|
+
buttonStyle?: ButtonStyleInterface;
|
|
19
|
+
imageStyle?: ImageBubbleStyleInterface;
|
|
20
|
+
imageResizeMode?: "cover" | "contain" | "stretch" | "repeat" | "center";
|
|
21
|
+
|
|
22
|
+
constructor({
|
|
23
|
+
height = "auto",
|
|
24
|
+
width = "auto",
|
|
25
|
+
backgroundColor,
|
|
26
|
+
borderRadius,
|
|
27
|
+
textFont,
|
|
28
|
+
textColor,
|
|
29
|
+
padding,
|
|
30
|
+
buttonStyle,
|
|
31
|
+
imageStyle,
|
|
32
|
+
imageResizeMode = "cover",
|
|
33
|
+
}: CardBubbleStyleInterface) {
|
|
34
|
+
super({
|
|
35
|
+
backgroundColor,
|
|
36
|
+
borderRadius,
|
|
37
|
+
height,
|
|
38
|
+
width
|
|
39
|
+
});
|
|
40
|
+
this.textFont = textFont;
|
|
41
|
+
this.textColor = textColor;
|
|
42
|
+
this.padding = padding;
|
|
43
|
+
this.buttonStyle = buttonStyle;
|
|
44
|
+
this.imageStyle = imageStyle;
|
|
45
|
+
this.imageResizeMode = imageResizeMode;
|
|
46
|
+
}
|
|
47
|
+
}
|