@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,19 @@
|
|
|
1
|
+
import { FontStyle } from "../../base";
|
|
2
|
+
|
|
3
|
+
export interface LabelStyleInterface {
|
|
4
|
+
labelColor?: string;
|
|
5
|
+
labelFont?: FontStyle;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class LabelStyle {
|
|
9
|
+
labelFont?: FontStyle;
|
|
10
|
+
labelColor?: string;
|
|
11
|
+
|
|
12
|
+
constructor({
|
|
13
|
+
labelFont = new FontStyle({}),
|
|
14
|
+
labelColor = "#000000",
|
|
15
|
+
}: LabelStyleInterface) {
|
|
16
|
+
this.labelFont = labelFont;
|
|
17
|
+
this.labelColor = labelColor;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -39,6 +39,7 @@ export interface CometChatListItemInterface {
|
|
|
39
39
|
options?: () => CometChatOptions[];
|
|
40
40
|
TailView?: React.FC;
|
|
41
41
|
hideSeparator?: boolean;
|
|
42
|
+
separatorColor?: string;
|
|
42
43
|
listItemStyle?: ListItemStyle;
|
|
43
44
|
onPress?: Function;
|
|
44
45
|
onLongPress?: Function;
|
|
@@ -64,6 +65,7 @@ export const CometChatListItem = (props: CometChatListItemInterface) => {
|
|
|
64
65
|
options,
|
|
65
66
|
TailView,
|
|
66
67
|
hideSeparator,
|
|
68
|
+
separatorColor,
|
|
67
69
|
headViewContainerStyle,
|
|
68
70
|
tailViewContainerStyle,
|
|
69
71
|
bodyViewContainerStyle,
|
|
@@ -221,7 +223,7 @@ export const CometChatListItem = (props: CometChatListItemInterface) => {
|
|
|
221
223
|
typeof item.icon === 'string' ? { uri: item.icon } : item.icon
|
|
222
224
|
}
|
|
223
225
|
/>
|
|
224
|
-
{item.title && item.title.length && (
|
|
226
|
+
{Boolean(item.title) && item.title.length > 0 && (
|
|
225
227
|
<Text
|
|
226
228
|
style={[
|
|
227
229
|
Style.optionTitleStyle,
|
|
@@ -236,14 +238,26 @@ export const CometChatListItem = (props: CometChatListItemInterface) => {
|
|
|
236
238
|
);
|
|
237
239
|
};
|
|
238
240
|
|
|
241
|
+
let ListComponent = ((onPress && typeof onPress == 'function') || (onLongPress && typeof onLongPress == 'function')) ? TouchableOpacity : View;
|
|
242
|
+
let listComponentProps = ((onPress && typeof onPress == 'function') || (onLongPress && typeof onLongPress == 'function')) ? {
|
|
243
|
+
activeOpacity: 1,
|
|
244
|
+
onPress: clickHandler,
|
|
245
|
+
onLongPress: longPressHandler
|
|
246
|
+
} : {};
|
|
247
|
+
|
|
248
|
+
let WrapperComponent = swipeRowOptions.length ? SwipeRow : React.Fragment;
|
|
249
|
+
let wrapperComponentProps = swipeRowOptions.length ? {
|
|
250
|
+
key: id,
|
|
251
|
+
onRowDidOpen: rowOpened,
|
|
252
|
+
onRowDidClose: rowClosed,
|
|
253
|
+
disableRightSwipe: true,
|
|
254
|
+
disableLeftSwipe: !swipeRowOptions.length,
|
|
255
|
+
rightOpenValue: 0 - translate
|
|
256
|
+
} : {};
|
|
257
|
+
|
|
239
258
|
return (
|
|
240
|
-
<
|
|
241
|
-
|
|
242
|
-
onRowDidOpen={rowOpened}
|
|
243
|
-
onRowDidClose={rowClosed}
|
|
244
|
-
disableRightSwipe={true}
|
|
245
|
-
disableLeftSwipe={!swipeRowOptions.length}
|
|
246
|
-
rightOpenValue={0 - translate}
|
|
259
|
+
<WrapperComponent
|
|
260
|
+
{...wrapperComponentProps}
|
|
247
261
|
>
|
|
248
262
|
<View
|
|
249
263
|
style={[
|
|
@@ -264,10 +278,8 @@ export const CometChatListItem = (props: CometChatListItemInterface) => {
|
|
|
264
278
|
)}
|
|
265
279
|
</View>
|
|
266
280
|
</View>
|
|
267
|
-
<
|
|
268
|
-
|
|
269
|
-
onPress={clickHandler}
|
|
270
|
-
onLongPress={longPressHandler}
|
|
281
|
+
<ListComponent
|
|
282
|
+
{...listComponentProps}
|
|
271
283
|
style={[
|
|
272
284
|
Style.container,
|
|
273
285
|
{
|
|
@@ -280,21 +292,21 @@ export const CometChatListItem = (props: CometChatListItemInterface) => {
|
|
|
280
292
|
},
|
|
281
293
|
]}
|
|
282
294
|
>
|
|
283
|
-
{(avatarURL || avatarName) && <AvatarView />}
|
|
295
|
+
{Boolean(avatarURL || avatarName) && <AvatarView />}
|
|
284
296
|
<View
|
|
285
297
|
style={[
|
|
286
298
|
Style.rightContainerStyle,
|
|
287
|
-
{ borderBottomWidth: hideSeparator ? 0 : 1 },
|
|
299
|
+
{ borderBottomWidth: hideSeparator ? 0 : 1, borderBottomColor: separatorColor || undefined },
|
|
288
300
|
]}
|
|
289
301
|
>
|
|
290
302
|
<View style={[Style.middleViewStyle, bodyViewContainerStyle ?? {}]}>
|
|
291
|
-
{title && <TitleView />}
|
|
292
|
-
{SubtitleView && <SubtitleView />}
|
|
303
|
+
{Boolean(title) && <TitleView />}
|
|
304
|
+
{Boolean(SubtitleView) && <SubtitleView />}
|
|
293
305
|
</View>
|
|
294
|
-
{TailView && <TailViewFc />}
|
|
306
|
+
{Boolean(TailView) && <TailViewFc />}
|
|
295
307
|
</View>
|
|
296
|
-
</
|
|
297
|
-
</
|
|
308
|
+
</ListComponent>
|
|
309
|
+
</WrapperComponent>
|
|
298
310
|
);
|
|
299
311
|
};
|
|
300
312
|
|
|
@@ -4,6 +4,7 @@ import { CometChatContext } from "../../CometChatContext";
|
|
|
4
4
|
import { CometChatContextType, BaseStyleInterface } from "../../base";
|
|
5
5
|
import { MessageBubbleAlignmentType } from "../../constants/UIKitConstants";
|
|
6
6
|
import { MessageBubbleStyle } from "./MessageBubbleStyle";
|
|
7
|
+
import { memo } from "react";
|
|
7
8
|
|
|
8
9
|
export interface CometChatMessageBubbleInterface {
|
|
9
10
|
id: string,
|
|
@@ -18,7 +19,7 @@ export interface CometChatMessageBubbleInterface {
|
|
|
18
19
|
style?: BaseStyleInterface,
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
export const CometChatMessageBubble = ({
|
|
22
|
+
export const CometChatMessageBubble = memo(({
|
|
22
23
|
HeaderView,
|
|
23
24
|
ReplyView,
|
|
24
25
|
ContentView,
|
|
@@ -56,12 +57,12 @@ export const CometChatMessageBubble = ({
|
|
|
56
57
|
alignment
|
|
57
58
|
}}>
|
|
58
59
|
<View style={{
|
|
59
|
-
height,
|
|
60
|
+
height, flexDirection: "row",
|
|
60
61
|
}}>
|
|
61
62
|
{
|
|
62
63
|
LeadingView && <LeadingView />
|
|
63
64
|
}
|
|
64
|
-
<View style={{marginStart: 4, maxWidth: "
|
|
65
|
+
<View style={{marginStart: 4, width, maxWidth: "80%"}}>
|
|
65
66
|
{
|
|
66
67
|
HeaderView && <HeaderView />
|
|
67
68
|
}
|
|
@@ -87,7 +88,7 @@ export const CometChatMessageBubble = ({
|
|
|
87
88
|
|
|
88
89
|
</View>
|
|
89
90
|
)
|
|
90
|
-
}
|
|
91
|
+
})
|
|
91
92
|
|
|
92
93
|
CometChatMessageBubble.defaultProps = {
|
|
93
94
|
alignment: "left"
|
|
@@ -122,13 +122,12 @@ export const CometChatMessageInput = (
|
|
|
122
122
|
} = props;
|
|
123
123
|
|
|
124
124
|
return (
|
|
125
|
-
<View style={{ backgroundColor:
|
|
125
|
+
<View style={{ backgroundColor: style.inputBackground ?? theme.palette.getAccent100(), marginHorizontal: 8, borderRadius: 8 }}>
|
|
126
126
|
<TextInput
|
|
127
127
|
ref={messageInputRef}
|
|
128
128
|
style={[
|
|
129
129
|
styles.textInput,
|
|
130
130
|
{
|
|
131
|
-
backgroundColor: style.inputBackground ?? 'transparent',
|
|
132
131
|
color: style.textColor ?? theme.palette.getAccent(),
|
|
133
132
|
maxHeight: maxHeight ?? 25 * 3,
|
|
134
133
|
},
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { View, Text, TouchableOpacity, Image } from 'react-native'
|
|
2
|
+
import React, { useContext } from 'react'
|
|
3
|
+
import { PanelStyle, PanelStyleInterface } from './PanelStyle'
|
|
4
|
+
import { CometChatContext } from '../../CometChatContext';
|
|
5
|
+
import { CloseIcon } from './resources';
|
|
6
|
+
|
|
7
|
+
export interface CometChatPanelInterface {
|
|
8
|
+
title: string,
|
|
9
|
+
hideCloseButton?: boolean,
|
|
10
|
+
style?: PanelStyleInterface,
|
|
11
|
+
textContent: string,
|
|
12
|
+
onClose: () => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const CometChatPanel = (props: CometChatPanelInterface) => {
|
|
16
|
+
const { hideCloseButton, style, textContent, title, onClose } = props;
|
|
17
|
+
|
|
18
|
+
const { theme } = useContext(CometChatContext);
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
backgroundColor, border, borderRadius, closeIconTint,
|
|
22
|
+
textColor, textFont, titleColor, titleFont
|
|
23
|
+
} = new PanelStyle({
|
|
24
|
+
closeIconTint: theme.palette.getAccent(),
|
|
25
|
+
border: { borderWidth: 1, borderColor: theme.palette.getPrimary() },
|
|
26
|
+
titleFont: theme.typography.title1,
|
|
27
|
+
titleColor: theme.palette.getAccent(),
|
|
28
|
+
textColor: theme.palette.getAccent600(),
|
|
29
|
+
textFont: theme.typography.text1,
|
|
30
|
+
backgroundColor: theme.palette.getPrimary40(),
|
|
31
|
+
...style,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const _onClose = () => {
|
|
35
|
+
onClose && onClose();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<View style={[{ backgroundColor: backgroundColor, borderRadius, padding: 10 }, { ...border }]}>
|
|
40
|
+
<View style={{ flexDirection: "row", justifyContent: "space-between", marginBottom: 10 }}>
|
|
41
|
+
<Text style={[titleFont, { color: titleColor }]}>{title}</Text>
|
|
42
|
+
{!hideCloseButton && <TouchableOpacity onPress={_onClose}>
|
|
43
|
+
<Image style={{ width: 20, height: 20, tintColor: closeIconTint }} source={CloseIcon} />
|
|
44
|
+
</TouchableOpacity>}
|
|
45
|
+
</View>
|
|
46
|
+
<Text style={[textFont, { color: textColor }]}>
|
|
47
|
+
{textContent}
|
|
48
|
+
</Text>
|
|
49
|
+
</View>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BaseStyle, FontStyle } from "../../base";
|
|
2
|
+
|
|
3
|
+
export interface PanelStyleInterface extends BaseStyle {
|
|
4
|
+
titleFont?: FontStyle,
|
|
5
|
+
titleColor?: string,
|
|
6
|
+
closeIconTint?: string,
|
|
7
|
+
textFont?: FontStyle,
|
|
8
|
+
textColor?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class PanelStyle extends BaseStyle {
|
|
12
|
+
titleFont?: FontStyle;
|
|
13
|
+
titleColor?: string;
|
|
14
|
+
closeIconTint?: string;
|
|
15
|
+
textFont?: FontStyle;
|
|
16
|
+
textColor?: string;
|
|
17
|
+
|
|
18
|
+
constructor({
|
|
19
|
+
height,
|
|
20
|
+
width,
|
|
21
|
+
backgroundColor,
|
|
22
|
+
border,
|
|
23
|
+
borderRadius,
|
|
24
|
+
closeIconTint,
|
|
25
|
+
titleFont,
|
|
26
|
+
titleColor,
|
|
27
|
+
textColor,
|
|
28
|
+
textFont
|
|
29
|
+
}: PanelStyleInterface) {
|
|
30
|
+
super({
|
|
31
|
+
backgroundColor,
|
|
32
|
+
border,
|
|
33
|
+
borderRadius,
|
|
34
|
+
height,
|
|
35
|
+
width
|
|
36
|
+
})
|
|
37
|
+
this.closeIconTint = closeIconTint;
|
|
38
|
+
this.titleColor = titleColor;
|
|
39
|
+
this.titleFont = titleFont;
|
|
40
|
+
this.textColor = textColor;
|
|
41
|
+
this.textFont = textFont;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { View, Text } from 'react-native'
|
|
2
|
+
import React, { useContext } from 'react'
|
|
3
|
+
import { QuickViewStyle, QuickViewStyleInterface } from './QuickViewStyle'
|
|
4
|
+
import { CometChatContextType } from '../../base'
|
|
5
|
+
import { CometChatContext } from '../../CometChatContext'
|
|
6
|
+
|
|
7
|
+
export interface CometChatQuickViewInterface {
|
|
8
|
+
title: string,
|
|
9
|
+
subtitle: string,
|
|
10
|
+
closeIconUrl?: string,
|
|
11
|
+
hideCloseIcon?: boolean,
|
|
12
|
+
quickViewStyle?: QuickViewStyleInterface,
|
|
13
|
+
}
|
|
14
|
+
const CometChatQuickView = (props: CometChatQuickViewInterface) => {
|
|
15
|
+
const { title, subtitle, closeIconUrl, hideCloseIcon, quickViewStyle } = props
|
|
16
|
+
const { theme } = useContext<CometChatContextType>(CometChatContext);
|
|
17
|
+
const _style = new QuickViewStyle({
|
|
18
|
+
backgroundColor: theme.palette.getBackgroundColor(),
|
|
19
|
+
borderRadius: 8,
|
|
20
|
+
titleFont: theme.typography.text1,
|
|
21
|
+
titleColor: theme.palette.getPrimary(),
|
|
22
|
+
subtitlFont: theme.typography.subtitle2,
|
|
23
|
+
subtitleColor: theme.palette.getAccent500(),
|
|
24
|
+
leadingBarTint: theme.palette.getPrimary(),
|
|
25
|
+
leadingBarWidth: 5,
|
|
26
|
+
...quickViewStyle
|
|
27
|
+
})
|
|
28
|
+
const {
|
|
29
|
+
height,
|
|
30
|
+
width,
|
|
31
|
+
backgroundColor,
|
|
32
|
+
border,
|
|
33
|
+
borderRadius,
|
|
34
|
+
titleFont,
|
|
35
|
+
titleColor,
|
|
36
|
+
subtitlFont,
|
|
37
|
+
subtitleColor,
|
|
38
|
+
leadingBarTint,
|
|
39
|
+
leadingBarWidth,
|
|
40
|
+
} = _style;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<View
|
|
44
|
+
style={{
|
|
45
|
+
height: height,
|
|
46
|
+
width: width,
|
|
47
|
+
backgroundColor: backgroundColor,
|
|
48
|
+
borderRadius: borderRadius,
|
|
49
|
+
borderColor: border.borderColor,
|
|
50
|
+
borderWidth: border.borderWidth,
|
|
51
|
+
flexDirection: "row",
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<View style={{
|
|
55
|
+
width: leadingBarWidth, backgroundColor: leadingBarTint,
|
|
56
|
+
borderTopLeftRadius: borderRadius, borderBottomLeftRadius: borderRadius
|
|
57
|
+
}} />
|
|
58
|
+
<View style={{ padding: 5 }}>
|
|
59
|
+
<Text style={{ ...titleFont, color: titleColor, marginBottom: 5 }}>{title}</Text>
|
|
60
|
+
<Text style={{ ...subtitlFont, color: subtitleColor }}>{subtitle}</Text>
|
|
61
|
+
</View>
|
|
62
|
+
</View>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default CometChatQuickView
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BaseStyle, BorderStyle, FontStyle } from "../../base";
|
|
2
|
+
|
|
3
|
+
export interface QuickViewStyleInterface extends BaseStyle {
|
|
4
|
+
background?: string;
|
|
5
|
+
titleFont?: FontStyle;
|
|
6
|
+
titleColor?: string;
|
|
7
|
+
subtitlFont?: FontStyle;
|
|
8
|
+
subtitleColor?: string;
|
|
9
|
+
closeIconTint?: string;
|
|
10
|
+
leadingBarTint?: string;
|
|
11
|
+
leadingBarWidth?: number;
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class QuickViewStyle extends BaseStyle {
|
|
16
|
+
background?: string;
|
|
17
|
+
titleFont?: FontStyle;
|
|
18
|
+
titleColor?: string;
|
|
19
|
+
subtitlFont?: FontStyle;
|
|
20
|
+
subtitleColor?: string;
|
|
21
|
+
closeIconTint?: string;
|
|
22
|
+
leadingBarTint?: string;
|
|
23
|
+
leadingBarWidth?: number;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
constructor({
|
|
27
|
+
height = "auto",
|
|
28
|
+
width = "auto",
|
|
29
|
+
backgroundColor = "rgba(20, 20, 20, 0.04)",
|
|
30
|
+
border = new BorderStyle({}),
|
|
31
|
+
borderRadius = 8,
|
|
32
|
+
titleFont = new FontStyle({}),
|
|
33
|
+
titleColor = "#000",
|
|
34
|
+
subtitlFont = new FontStyle({}),
|
|
35
|
+
subtitleColor = "#000",
|
|
36
|
+
closeIconTint = "#000",
|
|
37
|
+
leadingBarTint = "#000",
|
|
38
|
+
leadingBarWidth = 0,
|
|
39
|
+
}: QuickViewStyleInterface) {
|
|
40
|
+
super({
|
|
41
|
+
backgroundColor,
|
|
42
|
+
border,
|
|
43
|
+
borderRadius,
|
|
44
|
+
height,
|
|
45
|
+
width
|
|
46
|
+
});
|
|
47
|
+
this.titleFont = titleFont;
|
|
48
|
+
this.titleColor = titleColor;
|
|
49
|
+
this.subtitlFont = subtitlFont;
|
|
50
|
+
this.subtitleColor = subtitleColor;
|
|
51
|
+
this.closeIconTint = closeIconTint;
|
|
52
|
+
this.leadingBarTint = leadingBarTint;
|
|
53
|
+
this.leadingBarWidth = leadingBarWidth;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { View, Text, TouchableOpacity } from 'react-native'
|
|
2
|
+
import React, { useContext } from 'react'
|
|
3
|
+
import { RadioButtonElement } from '../../modals/InteractiveData'
|
|
4
|
+
import { CometChatContextType } from '../../base'
|
|
5
|
+
import { CometChatContext } from '../../CometChatContext'
|
|
6
|
+
import { RadioButtonStyle, RadioButtonStyleInterface } from './RadioButtonStyle'
|
|
7
|
+
|
|
8
|
+
export interface CometChatRadioButtonInterface {
|
|
9
|
+
data: RadioButtonElement,
|
|
10
|
+
showError: boolean,
|
|
11
|
+
selectedOption: string,
|
|
12
|
+
onChange: (value: string) => void,
|
|
13
|
+
style?: RadioButtonStyleInterface
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const CometChatRadioButton = (props: CometChatRadioButtonInterface) => {
|
|
17
|
+
const { data, onChange, selectedOption, showError, style } = props;
|
|
18
|
+
const { theme } = useContext<CometChatContextType>(CometChatContext);
|
|
19
|
+
|
|
20
|
+
const _style = new RadioButtonStyle({
|
|
21
|
+
activeBackgroundColor: theme.palette.getPrimary(),
|
|
22
|
+
inactiveBackgroundColor: theme.palette.getBackgroundColor(),
|
|
23
|
+
titleFont: theme.typography.subtitle1,
|
|
24
|
+
border: { borderColor: theme.palette.getAccent200(), borderWidth: 1 },
|
|
25
|
+
titleColor: theme.palette.getAccent(),
|
|
26
|
+
optionColor: theme.palette.getAccent(),
|
|
27
|
+
optionFont: theme.typography.subtitle1,
|
|
28
|
+
...style,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
activeBackgroundColor,
|
|
33
|
+
inactiveBackgroundColor,
|
|
34
|
+
titleFont,
|
|
35
|
+
titleColor,
|
|
36
|
+
optionColor,
|
|
37
|
+
optionFont,
|
|
38
|
+
borderColor,
|
|
39
|
+
borderWidth
|
|
40
|
+
} = _style;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<View style={{ marginVertical: 10 }}>
|
|
44
|
+
<Text style={[titleFont, { color: titleColor }]}>{data.getLabel()}{!data.getOptional() && "*"}</Text>
|
|
45
|
+
{data.getOptions().map((option, index) => (
|
|
46
|
+
<View key={index} style={{ flexDirection: "row", alignItems: "center", marginTop: 3 }}>
|
|
47
|
+
<TouchableOpacity style={{
|
|
48
|
+
height: 20, width: 20, borderRadius: 20, alignItems: "center", justifyContent: "center", backgroundColor: selectedOption !== option.getValue() ? inactiveBackgroundColor : undefined,
|
|
49
|
+
borderWidth: selectedOption === option.getValue() ? borderWidth + 1 : borderWidth, borderColor: showError ? theme.palette.getError() : borderColor, marginRight: 5,
|
|
50
|
+
}}
|
|
51
|
+
onPress={() => onChange(option.getValue())}
|
|
52
|
+
>
|
|
53
|
+
{selectedOption === option.getValue() && <View
|
|
54
|
+
style={{
|
|
55
|
+
borderRadius: 20, height: 12, width: 12,
|
|
56
|
+
backgroundColor: activeBackgroundColor,
|
|
57
|
+
}}
|
|
58
|
+
/>}
|
|
59
|
+
</TouchableOpacity>
|
|
60
|
+
<Text style={[optionFont, { color: optionColor }]}>{option.getLabel()}</Text>
|
|
61
|
+
</View>
|
|
62
|
+
))}
|
|
63
|
+
</View>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default CometChatRadioButton
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BorderStyle, BorderStyleInterface, FontStyle } from "../../base";
|
|
2
|
+
|
|
3
|
+
export interface RadioButtonStyleInterface {
|
|
4
|
+
titleFont?: FontStyle;
|
|
5
|
+
titleColor?: string;
|
|
6
|
+
border?: BorderStyleInterface;
|
|
7
|
+
activeBackgroundColor?: string;
|
|
8
|
+
inactiveBackgroundColor?: string;
|
|
9
|
+
optionColor?: string;
|
|
10
|
+
optionFont?: FontStyle;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class RadioButtonStyle extends BorderStyle {
|
|
14
|
+
titleFont?: FontStyle;
|
|
15
|
+
titleColor?: string;
|
|
16
|
+
activeBackgroundColor?: string;
|
|
17
|
+
inactiveBackgroundColor?: string;
|
|
18
|
+
optionColor?: string;
|
|
19
|
+
optionFont?: FontStyle;
|
|
20
|
+
|
|
21
|
+
constructor({
|
|
22
|
+
titleFont = new FontStyle({}),
|
|
23
|
+
titleColor = "",
|
|
24
|
+
activeBackgroundColor = "",
|
|
25
|
+
inactiveBackgroundColor = "",
|
|
26
|
+
optionColor = "",
|
|
27
|
+
optionFont = new FontStyle({}),
|
|
28
|
+
border = new BorderStyle({}),
|
|
29
|
+
}: RadioButtonStyleInterface) {
|
|
30
|
+
super(border);
|
|
31
|
+
this.titleFont = titleFont;
|
|
32
|
+
this.titleColor = titleColor;
|
|
33
|
+
this.activeBackgroundColor = activeBackgroundColor;
|
|
34
|
+
this.inactiveBackgroundColor = inactiveBackgroundColor;
|
|
35
|
+
this.optionColor = optionColor;
|
|
36
|
+
this.optionFont = optionFont;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { View, Text, TouchableOpacity } from 'react-native'
|
|
2
|
+
import React, { useContext } from 'react'
|
|
3
|
+
import { SingleSelectElement } from '../../modals/InteractiveData'
|
|
4
|
+
import { CometChatContextType } from '../../base'
|
|
5
|
+
import { CometChatContext } from '../../CometChatContext'
|
|
6
|
+
import { SingleSelectStyle, SingleSelectStyleInterface } from './SingleStyle'
|
|
7
|
+
|
|
8
|
+
export interface CometChatSingleSelectInterface {
|
|
9
|
+
data: SingleSelectElement,
|
|
10
|
+
showError: boolean,
|
|
11
|
+
selectedOption: string,
|
|
12
|
+
onChange: (value: string) => void,
|
|
13
|
+
style?: SingleSelectStyleInterface,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const CometChatSingleSelect = (props: CometChatSingleSelectInterface) => {
|
|
17
|
+
const { data, onChange, selectedOption, showError, style } = props;
|
|
18
|
+
const { theme } = useContext<CometChatContextType>(CometChatContext);
|
|
19
|
+
|
|
20
|
+
const _style = new SingleSelectStyle({
|
|
21
|
+
titleFont: theme.typography.subtitle1,
|
|
22
|
+
titleColor: theme.palette.getAccent(),
|
|
23
|
+
border: { borderWidth: 1, borderColor: theme.palette.getAccent200() },
|
|
24
|
+
optionFont: theme.typography.title2,
|
|
25
|
+
optionColorActive: theme.palette.getAccent900(),
|
|
26
|
+
optionColorInactive: theme.palette.getAccent300(),
|
|
27
|
+
...style,
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const {
|
|
31
|
+
titleFont,
|
|
32
|
+
titleColor,
|
|
33
|
+
border,
|
|
34
|
+
optionFont,
|
|
35
|
+
optionColorActive,
|
|
36
|
+
optionColorInactive
|
|
37
|
+
} = _style;
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<View style={{ marginVertical: 10 }}>
|
|
41
|
+
<Text style={[titleFont, { color: titleColor }]}>{data.getLabel()}{!data.getOptional() && "*"}</Text>
|
|
42
|
+
<View style={{ flex: 1, flexDirection: "row", marginTop: 3, flexWrap: "wrap" }}>
|
|
43
|
+
{data.getOptions().map((option, index) => (
|
|
44
|
+
<TouchableOpacity style={{
|
|
45
|
+
width: data.getOptions().length > 2 ? "100%" : "50%",
|
|
46
|
+
padding: 8, borderRadius: 5, marginTop: 2,
|
|
47
|
+
alignItems: "center", justifyContent: "center",
|
|
48
|
+
borderWidth: border.borderWidth, borderColor: showError ? theme.palette.getError() : border.borderColor,
|
|
49
|
+
}}
|
|
50
|
+
key={index}
|
|
51
|
+
onPress={() => onChange(option.getValue())}
|
|
52
|
+
>
|
|
53
|
+
<Text style={[optionFont, {
|
|
54
|
+
color: selectedOption === option.getValue() ? optionColorActive : optionColorInactive
|
|
55
|
+
}]}>{option.getLabel()}</Text>
|
|
56
|
+
</TouchableOpacity>
|
|
57
|
+
))}
|
|
58
|
+
</View>
|
|
59
|
+
</View>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default CometChatSingleSelect
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BorderStyle, BorderStyleInterface, FontStyle } from "../../base";
|
|
2
|
+
|
|
3
|
+
export interface SingleSelectStyleInterface {
|
|
4
|
+
titleFont?: FontStyle;
|
|
5
|
+
titleColor?: string;
|
|
6
|
+
border?: BorderStyleInterface;
|
|
7
|
+
optionColorActive?: string;
|
|
8
|
+
optionColorInactive?: string;
|
|
9
|
+
optionFont?: FontStyle;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class SingleSelectStyle {
|
|
13
|
+
titleFont?: FontStyle;
|
|
14
|
+
titleColor?: string;
|
|
15
|
+
border?: BorderStyleInterface;
|
|
16
|
+
optionColorActive?: string;
|
|
17
|
+
optionColorInactive?: string;
|
|
18
|
+
optionFont?: FontStyle;
|
|
19
|
+
|
|
20
|
+
constructor({
|
|
21
|
+
titleFont = new FontStyle({}),
|
|
22
|
+
titleColor = "",
|
|
23
|
+
border = new BorderStyle({}),
|
|
24
|
+
optionColorActive = "",
|
|
25
|
+
optionColorInactive = "",
|
|
26
|
+
optionFont = new FontStyle({}),
|
|
27
|
+
}: SingleSelectStyleInterface) {
|
|
28
|
+
this.titleFont = titleFont;
|
|
29
|
+
this.titleColor = titleColor;
|
|
30
|
+
this.border = border;
|
|
31
|
+
this.optionColorActive = optionColorActive;
|
|
32
|
+
this.optionColorInactive = optionColorInactive;
|
|
33
|
+
this.optionFont = optionFont;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { View, Text, TextInput } from 'react-native'
|
|
2
|
+
import React, { useContext, useEffect, useState, useRef } from 'react'
|
|
3
|
+
import { TextInputElement } from '../../modals/InteractiveData';
|
|
4
|
+
import { CometChatContextType } from '../../base';
|
|
5
|
+
import { CometChatContext } from '../../CometChatContext';
|
|
6
|
+
import { TextInputStyle, TextInputStyleInterface } from './TextInputStyle';
|
|
7
|
+
|
|
8
|
+
export interface CometChatTextInputInterface {
|
|
9
|
+
onChange?: (text: string) => void,
|
|
10
|
+
data: TextInputElement,
|
|
11
|
+
showError: boolean,
|
|
12
|
+
style?: TextInputStyleInterface
|
|
13
|
+
defaultValue?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const CometChatTextInput = (props: CometChatTextInputInterface) => {
|
|
17
|
+
const { onChange, data, showError, style, defaultValue } = props;
|
|
18
|
+
const { theme } = useContext<CometChatContextType>(CometChatContext);
|
|
19
|
+
const [value, setValue] = useState(defaultValue);
|
|
20
|
+
|
|
21
|
+
const _style = new TextInputStyle({
|
|
22
|
+
border: { borderWidth: 1, borderColor: theme.palette.getAccent200() },
|
|
23
|
+
titleFont: theme.typography.subtitle1,
|
|
24
|
+
titleColor: theme.palette.getAccent(),
|
|
25
|
+
placeholderColor: theme.palette.getAccent600(),
|
|
26
|
+
...style,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
titleFont,
|
|
31
|
+
titleColor,
|
|
32
|
+
placeholderColor,
|
|
33
|
+
borderColor,
|
|
34
|
+
borderWidth,
|
|
35
|
+
} = _style;
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
setValue(defaultValue);
|
|
39
|
+
}, [defaultValue]);
|
|
40
|
+
|
|
41
|
+
const _onChange = (text: string) => {
|
|
42
|
+
setValue(text);
|
|
43
|
+
if (onChange) {
|
|
44
|
+
onChange(text);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<View style={{ marginBottom: 10 }}>
|
|
50
|
+
<Text style={[titleFont, { color: titleColor }]}>{data.getLabel()}{!data.getOptional() && "*"}</Text>
|
|
51
|
+
<TextInput
|
|
52
|
+
// autoFocus={true}
|
|
53
|
+
value={value}
|
|
54
|
+
autoCorrect={false}
|
|
55
|
+
onChangeText={_onChange}
|
|
56
|
+
style={{
|
|
57
|
+
borderColor: showError ? theme.palette.getError() : borderColor, paddingHorizontal: 5, paddingVertical: 8,
|
|
58
|
+
borderWidth: borderWidth, borderRadius: 5, marginTop: 5,
|
|
59
|
+
}}
|
|
60
|
+
placeholder={data.getPlaceholder()}
|
|
61
|
+
placeholderTextColor={placeholderColor}
|
|
62
|
+
/>
|
|
63
|
+
</View>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default CometChatTextInput
|