@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,69 @@
|
|
|
1
|
+
import { ButtonElement } from "../InteractiveElements/index";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents the data for an interactive card.
|
|
5
|
+
*/
|
|
6
|
+
export class InteractiveCardData {
|
|
7
|
+
private imageUrl?: string;
|
|
8
|
+
private text: string;
|
|
9
|
+
private cardActions: Array<ButtonElement>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of InteractiveCardData.
|
|
13
|
+
* @param text The text to display on the card.
|
|
14
|
+
* @param actions The actions to perform when the card is interacted with.
|
|
15
|
+
*/
|
|
16
|
+
constructor(text: string, cardActions: Array<ButtonElement>) {
|
|
17
|
+
this.text = text;
|
|
18
|
+
this.cardActions = cardActions;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Gets the Url of the image for the card.
|
|
23
|
+
* @returns The Url of the image.
|
|
24
|
+
*/
|
|
25
|
+
getImageUrl(): string {
|
|
26
|
+
return this.imageUrl || "";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Sets the image Url for the interactive card data.
|
|
31
|
+
* @param imageUrl - The Url of the image to be set.
|
|
32
|
+
*/
|
|
33
|
+
setImageUrl(imageUrl: string) {
|
|
34
|
+
this.imageUrl = imageUrl;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Gets the text to display on the card.
|
|
39
|
+
* @returns The text to display.
|
|
40
|
+
*/
|
|
41
|
+
getText(): string {
|
|
42
|
+
return this.text;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Gets the actions to perform when the card is interacted with.
|
|
47
|
+
* @returns The actions to perform.
|
|
48
|
+
*/
|
|
49
|
+
getCardActions(): Array<ButtonElement> {
|
|
50
|
+
return this.cardActions;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Creates an instance of InteractiveCardData from a JSON object.
|
|
55
|
+
* @param json The JSON object to create the instance from.
|
|
56
|
+
* @returns The created instance of InteractiveCardData.
|
|
57
|
+
*/
|
|
58
|
+
static fromJSON(json: any): InteractiveCardData {
|
|
59
|
+
const actions = json?.cardActions?.map((action: any) => {
|
|
60
|
+
return ButtonElement.fromJSON(action);
|
|
61
|
+
});
|
|
62
|
+
const interactiveCardData = new InteractiveCardData(
|
|
63
|
+
json.text,
|
|
64
|
+
actions
|
|
65
|
+
);
|
|
66
|
+
if (json.imageUrl) interactiveCardData.setImageUrl(json.imageUrl);
|
|
67
|
+
return interactiveCardData;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ButtonElement,
|
|
3
|
+
CheckboxElement,
|
|
4
|
+
DropdownElement,
|
|
5
|
+
LabelElement,
|
|
6
|
+
RadioButtonElement,
|
|
7
|
+
SingleSelectElement,
|
|
8
|
+
TextInputElement
|
|
9
|
+
} from "../InteractiveElements/index"
|
|
10
|
+
|
|
11
|
+
import { ElementEntity } from "../InteractiveEntities/ElementEntity";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the data of an interactive form.
|
|
15
|
+
*/
|
|
16
|
+
export class InteractiveFormData {
|
|
17
|
+
/**
|
|
18
|
+
* The title of the form.
|
|
19
|
+
*/
|
|
20
|
+
private title: string;
|
|
21
|
+
/**
|
|
22
|
+
* The goal completion text of the form.
|
|
23
|
+
*/
|
|
24
|
+
private goalCompletionText?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The form fields of the form.
|
|
27
|
+
*/
|
|
28
|
+
private formFields: Array<
|
|
29
|
+
LabelElement |
|
|
30
|
+
TextInputElement |
|
|
31
|
+
CheckboxElement |
|
|
32
|
+
DropdownElement |
|
|
33
|
+
RadioButtonElement |
|
|
34
|
+
SingleSelectElement |
|
|
35
|
+
ButtonElement
|
|
36
|
+
>;
|
|
37
|
+
/**
|
|
38
|
+
* The submit button of the form.
|
|
39
|
+
*/
|
|
40
|
+
private submitElement: ButtonElement;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new instance of InteractiveFormData.
|
|
43
|
+
* @param title - The title of the form.
|
|
44
|
+
* @param formFields - The form fields of the form.
|
|
45
|
+
* @param submitElement - The submit button of the form.
|
|
46
|
+
*/
|
|
47
|
+
constructor(title: string, formFields: Array<
|
|
48
|
+
LabelElement |
|
|
49
|
+
TextInputElement |
|
|
50
|
+
CheckboxElement |
|
|
51
|
+
DropdownElement |
|
|
52
|
+
RadioButtonElement |
|
|
53
|
+
SingleSelectElement |
|
|
54
|
+
ButtonElement
|
|
55
|
+
>, submitElement: ButtonElement) {
|
|
56
|
+
this.title = title || "";
|
|
57
|
+
this.formFields = formFields || [];
|
|
58
|
+
this.submitElement = submitElement;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Returns the form fields of the form.
|
|
63
|
+
* @returns An array of form fields.
|
|
64
|
+
*/
|
|
65
|
+
getFormFields(): Array<
|
|
66
|
+
LabelElement |
|
|
67
|
+
TextInputElement |
|
|
68
|
+
CheckboxElement |
|
|
69
|
+
DropdownElement |
|
|
70
|
+
RadioButtonElement |
|
|
71
|
+
SingleSelectElement |
|
|
72
|
+
ButtonElement
|
|
73
|
+
> {
|
|
74
|
+
return this.formFields;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns the title of the form.
|
|
79
|
+
* @returns The title of the form.
|
|
80
|
+
*/
|
|
81
|
+
getTitle(): string {
|
|
82
|
+
return this.title;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Returns the submit button of the form.
|
|
87
|
+
* @returns The submit button of the form.
|
|
88
|
+
*/
|
|
89
|
+
getSubmitElement(): ButtonElement {
|
|
90
|
+
return this.submitElement;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Returns the goal completion text of the form.
|
|
95
|
+
* @returns The goal completion text of the form.
|
|
96
|
+
*/
|
|
97
|
+
getGoalCompletionText(): string | undefined {
|
|
98
|
+
return this.goalCompletionText;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Sets the goal completion text of the form.
|
|
103
|
+
* @param goalCompletionText - The goal completion text of the form.
|
|
104
|
+
*/
|
|
105
|
+
setGoalCompletionText(goalCompletionText: string): void {
|
|
106
|
+
this.goalCompletionText = goalCompletionText;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static fromJSON(json: any): InteractiveFormData {
|
|
110
|
+
const formFields = (json?.formFields as [] || []).map((field: any) => {
|
|
111
|
+
return ElementEntity.fromJSON(field);
|
|
112
|
+
}) as any;
|
|
113
|
+
const submitElement = ButtonElement.fromJSON(json.submitElement);
|
|
114
|
+
const interactiveFormData = new InteractiveFormData(json.title, formFields, submitElement);
|
|
115
|
+
if (json.goalCompletionText)
|
|
116
|
+
interactiveFormData.setGoalCompletionText(json.goalCompletionText);
|
|
117
|
+
return interactiveFormData;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CheckboxElement,
|
|
3
|
+
DropdownElement,
|
|
4
|
+
RadioButtonElement,
|
|
5
|
+
SingleSelectElement,
|
|
6
|
+
TextInputElement
|
|
7
|
+
} from "./index";
|
|
8
|
+
|
|
9
|
+
import { ElementEntity } from "../InteractiveEntities/ElementEntity";
|
|
10
|
+
import { ElementType } from "../../../constants/UIKitConstants";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Represents the base input for a dynamic form element.
|
|
14
|
+
*/
|
|
15
|
+
export class BaseInputElement<T> extends ElementEntity {
|
|
16
|
+
/**
|
|
17
|
+
* The response of an input.
|
|
18
|
+
*/
|
|
19
|
+
private response?: T;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the input element is optional or required.
|
|
22
|
+
* */
|
|
23
|
+
private optional?: boolean = true;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new instance of the BaseInputElement class.
|
|
27
|
+
* @param {string} elementId - The unique identifier of the form element.
|
|
28
|
+
* @param {string} elementType - The type of the form element.
|
|
29
|
+
*/
|
|
30
|
+
constructor(elementId: string, elementType: string) {
|
|
31
|
+
super(elementId, elementType);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Sets the response of an input.
|
|
36
|
+
*/
|
|
37
|
+
setResponse(response: T): void {
|
|
38
|
+
this.response = response;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Returns the response of an input.
|
|
43
|
+
* @returns {T} The response of an input.
|
|
44
|
+
*/
|
|
45
|
+
getResponse(): T | undefined {
|
|
46
|
+
return this.response;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Returns whether the element is optional or required.
|
|
51
|
+
* @returns {boolean} Whether the element is optional or required.
|
|
52
|
+
*/
|
|
53
|
+
getOptional(): boolean | undefined {
|
|
54
|
+
return this.optional;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Sets whether the element is optional or required.
|
|
59
|
+
* @param {boolean} optional - Whether the element is optional or required.
|
|
60
|
+
*/
|
|
61
|
+
setOptional(optional: boolean | string): void {
|
|
62
|
+
let optionalValue: boolean;
|
|
63
|
+
if (typeof optional === "boolean" || typeof optional === "string") {
|
|
64
|
+
optionalValue = optional === "true" ? true : optional === "false" ? false : optional as boolean;
|
|
65
|
+
} else {
|
|
66
|
+
optionalValue = true;
|
|
67
|
+
}
|
|
68
|
+
this.optional = optionalValue;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static fromJSON(json: any): ElementEntity {
|
|
72
|
+
switch (json.elementType) {
|
|
73
|
+
case ElementType.text:
|
|
74
|
+
const element = TextInputElement.fromJSON(json);
|
|
75
|
+
element.setOptional(json.optional);
|
|
76
|
+
return element;
|
|
77
|
+
case ElementType.checkbox:
|
|
78
|
+
const checkboxElement = CheckboxElement.fromJSON(json);
|
|
79
|
+
checkboxElement.setOptional(json.optional);
|
|
80
|
+
return checkboxElement;
|
|
81
|
+
case ElementType.dropdown:
|
|
82
|
+
const dropdownElement = DropdownElement.fromJSON(json);
|
|
83
|
+
dropdownElement.setOptional(json.optional);
|
|
84
|
+
return dropdownElement;
|
|
85
|
+
case ElementType.radio:
|
|
86
|
+
const radioButtonElement = RadioButtonElement.fromJSON(json);
|
|
87
|
+
radioButtonElement.setOptional(json.optional);
|
|
88
|
+
return radioButtonElement;
|
|
89
|
+
case ElementType.singleSelect:
|
|
90
|
+
const singleSelectElement = SingleSelectElement.fromJSON(json);
|
|
91
|
+
singleSelectElement.setOptional(json.optional);
|
|
92
|
+
return singleSelectElement;
|
|
93
|
+
default:
|
|
94
|
+
return TextInputElement.fromJSON({
|
|
95
|
+
elementId: "1",
|
|
96
|
+
elementType: ElementType.text,
|
|
97
|
+
label: "Label",
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { APIAction, CustomAction, URLNavigationAction } from "../InteractiveActions";
|
|
2
|
+
import { ActionEntity, ElementEntity } from "../InteractiveEntities";
|
|
3
|
+
|
|
4
|
+
import { ButtonElement } from "./index";
|
|
5
|
+
import { ElementType } from "../../../constants/UIKitConstants";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Represents a base interactive element in a interactive message.
|
|
9
|
+
*/
|
|
10
|
+
export class BaseInteractiveElement extends ElementEntity {
|
|
11
|
+
/**
|
|
12
|
+
* Represents an action that can be performed on the message.
|
|
13
|
+
*/
|
|
14
|
+
private action: APIAction | URLNavigationAction | CustomAction;
|
|
15
|
+
|
|
16
|
+
constructor(elementId: string, elementType: string, action: APIAction | URLNavigationAction | CustomAction) {
|
|
17
|
+
super(elementId, elementType);
|
|
18
|
+
if (action instanceof APIAction || action instanceof URLNavigationAction || action instanceof CustomAction) {
|
|
19
|
+
this.action = action;
|
|
20
|
+
} else {
|
|
21
|
+
this.action = ActionEntity.fromJSON(action);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns the action associated with the bubble.
|
|
26
|
+
* @returns {APIAction | URLNavigationAction | CustomAction} The action associated with the bubble.
|
|
27
|
+
*/
|
|
28
|
+
getAction(): APIAction | URLNavigationAction | CustomAction {
|
|
29
|
+
return this.action;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static fromJSON(json: any): BaseInteractiveElement {
|
|
33
|
+
switch (json.elementType) {
|
|
34
|
+
case ElementType.button:
|
|
35
|
+
return ButtonElement.fromJSON(json);
|
|
36
|
+
default:
|
|
37
|
+
return ButtonElement.fromJSON({
|
|
38
|
+
elementId: "1",
|
|
39
|
+
elementType: ElementType.button,
|
|
40
|
+
buttonText: "Button",
|
|
41
|
+
action: new CustomAction()
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { APIAction, CustomAction, URLNavigationAction } from "../InteractiveActions";
|
|
2
|
+
|
|
3
|
+
import { ActionEntity } from "../InteractiveEntities/ActionEntity";
|
|
4
|
+
import { BaseInteractiveElement } from "./index";
|
|
5
|
+
import { ElementType } from "../../../constants/UIKitConstants";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Represents a button element that can be added to a interactive bubble.
|
|
9
|
+
*/
|
|
10
|
+
export class ButtonElement extends BaseInteractiveElement {
|
|
11
|
+
/**
|
|
12
|
+
* The text to display on the button.
|
|
13
|
+
*/
|
|
14
|
+
private buttonText: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the button should be disabled after it is interacted with.
|
|
17
|
+
* */
|
|
18
|
+
private disableAfterInteracted?: boolean = true;
|
|
19
|
+
/**
|
|
20
|
+
* Creates an instance of ButtonInput.
|
|
21
|
+
* @param elementId - The unique identifier for the button element.
|
|
22
|
+
* @param action - The action to be performed when the button is clicked.
|
|
23
|
+
* @param buttonText - The text to display on the button.
|
|
24
|
+
*/
|
|
25
|
+
constructor(elementId: string, action: APIAction | URLNavigationAction | CustomAction, buttonText: string) {
|
|
26
|
+
super(elementId, ElementType.button, action);
|
|
27
|
+
this.buttonText = buttonText || "";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Gets the text to display on the button.
|
|
32
|
+
* @returns The text to display on the button.
|
|
33
|
+
*/
|
|
34
|
+
getButtonText(): string {
|
|
35
|
+
return this.buttonText;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Gets whether the button should be disabled after it is interacted with.
|
|
40
|
+
* @returns Whether the button should be disabled after it is interacted with.
|
|
41
|
+
*/
|
|
42
|
+
getDisableAfterInteracted(): boolean | undefined {
|
|
43
|
+
return this.disableAfterInteracted;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Sets whether the button should be disabled after it is interacted with.
|
|
48
|
+
* @param disableAfterInteracted - Whether the button should be disabled after it is interacted with.
|
|
49
|
+
*/
|
|
50
|
+
setDisableAfterInteracted(disableAfterInteracted: boolean): void {
|
|
51
|
+
this.disableAfterInteracted = disableAfterInteracted;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static fromJSON(json: any): ButtonElement {
|
|
55
|
+
const action = ActionEntity.fromJSON(json.action);
|
|
56
|
+
const buttonElement = new ButtonElement(json.elementId, action, json.buttonText);
|
|
57
|
+
if (json.disableAfterInteracted)
|
|
58
|
+
buttonElement.setDisableAfterInteracted(json.disableAfterInteracted);
|
|
59
|
+
return buttonElement;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { BaseInputElement, OptionElement } from "./index";
|
|
2
|
+
|
|
3
|
+
import { ElementType } from "../../../constants/UIKitConstants";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a checkbox input element.
|
|
7
|
+
*/
|
|
8
|
+
export class CheckboxElement extends BaseInputElement<string[]> {
|
|
9
|
+
/** The label of the input element. */
|
|
10
|
+
private label: string;
|
|
11
|
+
/** The default values to be selected in the checkbox. */
|
|
12
|
+
private defaultValue?: string[];
|
|
13
|
+
/** The options available for the checkbox input element. */
|
|
14
|
+
private options: OptionElement[];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new instance of the CheckboxInput class.
|
|
18
|
+
* @param elementId The ID of the input element.
|
|
19
|
+
* @param label The label of the input element.
|
|
20
|
+
* @param options The options available for the checkbox input element.
|
|
21
|
+
*/
|
|
22
|
+
constructor(elementId: string, label: string, options: OptionElement[] = []) {
|
|
23
|
+
super(elementId, ElementType.checkbox);
|
|
24
|
+
this.label = label || "";
|
|
25
|
+
this.options = options.map((option) => {
|
|
26
|
+
if (option instanceof OptionElement) {
|
|
27
|
+
return option;
|
|
28
|
+
} else {
|
|
29
|
+
return OptionElement.fromJSON(option);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Gets the label of the input element.
|
|
36
|
+
* @returns The label of the input element.
|
|
37
|
+
*/
|
|
38
|
+
getLabel(): string {
|
|
39
|
+
return this.label;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Sets the default values to be selected in the checkbox.
|
|
44
|
+
* @param defaultValue The default values to be selected in the checkbox.
|
|
45
|
+
*/
|
|
46
|
+
setDefaultValue(defaultValue: string[]): void {
|
|
47
|
+
this.defaultValue = defaultValue;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Gets the default values to be selected in the checkbox.
|
|
52
|
+
* @returns The default values to be selected in the checkbox.
|
|
53
|
+
* */
|
|
54
|
+
getDefaultValue(): string[] | undefined {
|
|
55
|
+
return this.defaultValue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Gets the options available for the checkbox input element.
|
|
60
|
+
* @returns The options available for the checkbox input element.
|
|
61
|
+
*/
|
|
62
|
+
getOptions(): OptionElement[] {
|
|
63
|
+
return this.options;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static fromJSON(json: any): CheckboxElement {
|
|
67
|
+
const options = (json?.options as [] || []).map((option: any) => {
|
|
68
|
+
return OptionElement.fromJSON(option);
|
|
69
|
+
});
|
|
70
|
+
const checkboxElement = new CheckboxElement(json.elementId, json.label, options);
|
|
71
|
+
if (json.defaultValue)
|
|
72
|
+
checkboxElement.setDefaultValue(json.defaultValue);
|
|
73
|
+
return checkboxElement;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { BaseInputElement, OptionElement } from "./index";
|
|
2
|
+
|
|
3
|
+
import { ElementType } from "../../../constants/UIKitConstants";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a dropdown input element.
|
|
7
|
+
*/
|
|
8
|
+
export class DropdownElement extends BaseInputElement<string> {
|
|
9
|
+
/**
|
|
10
|
+
* The label of the input element.
|
|
11
|
+
*/
|
|
12
|
+
private label: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The default value to be selected in the dropdown.
|
|
16
|
+
*/
|
|
17
|
+
private defaultValue?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The options available for the dropdown input element.
|
|
21
|
+
*/
|
|
22
|
+
private options: OptionElement[];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new instance of DropdownInput.
|
|
26
|
+
* @param elementId - The ID of the input element.
|
|
27
|
+
* @param label - The label of the input element.
|
|
28
|
+
* @param options - The options available for the dropdown input element.
|
|
29
|
+
*/
|
|
30
|
+
constructor(elementId: string, label: string, options: OptionElement[] = []) {
|
|
31
|
+
super(elementId, ElementType.dropdown);
|
|
32
|
+
this.label = label || "";
|
|
33
|
+
this.options = options.map((option) => {
|
|
34
|
+
if (option instanceof OptionElement) {
|
|
35
|
+
return option;
|
|
36
|
+
} else {
|
|
37
|
+
return OptionElement.fromJSON(option);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Gets the label of the input element.
|
|
44
|
+
* @returns The label of the input element.
|
|
45
|
+
*/
|
|
46
|
+
getLabel(): string {
|
|
47
|
+
return this.label;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Gets the default value to be selected in the dropdown.
|
|
52
|
+
* @returns The default value to be selected in the dropdown.
|
|
53
|
+
*/
|
|
54
|
+
getDefaultValue(): string | undefined {
|
|
55
|
+
return this.defaultValue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Sets the default value to be selected in the dropdown.
|
|
60
|
+
* @param defaultValue - The default value to be selected in the dropdown.
|
|
61
|
+
*/
|
|
62
|
+
setDefaultValue(defaultValue: string): void {
|
|
63
|
+
this.defaultValue = defaultValue;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Gets the options available for the dropdown input element.
|
|
68
|
+
* @returns The options available for the dropdown input element.
|
|
69
|
+
*/
|
|
70
|
+
getOptions(): OptionElement[] {
|
|
71
|
+
return this.options;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static fromJSON(json: any): DropdownElement {
|
|
75
|
+
const options = (json?.options as [] || []).map((option: any) => {
|
|
76
|
+
return OptionElement.fromJSON(option);
|
|
77
|
+
});
|
|
78
|
+
const dropdownElement = new DropdownElement(json.elementId, json.label, options);
|
|
79
|
+
if (json.defaultValue)
|
|
80
|
+
dropdownElement.setDefaultValue(json.defaultValue);
|
|
81
|
+
return dropdownElement;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ElementEntity } from "../InteractiveEntities/ElementEntity";
|
|
2
|
+
import { ElementType } from "../../../constants/UIKitConstants";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents a label element.
|
|
6
|
+
*/
|
|
7
|
+
export class LabelElement extends ElementEntity {
|
|
8
|
+
/** The text to display in the label. */
|
|
9
|
+
private text: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new instance of the LabelElement class.
|
|
13
|
+
* @param {string} elementId - The unique identifier of the form element.
|
|
14
|
+
* @param {string} text - The text to display in the label.
|
|
15
|
+
*/
|
|
16
|
+
constructor(elementId: string, text: string) {
|
|
17
|
+
super(elementId, ElementType.label);
|
|
18
|
+
this.text = text || "";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Returns the text to display in the label.
|
|
23
|
+
* @returns {string} The text to display in the label.
|
|
24
|
+
*/
|
|
25
|
+
getText(): string {
|
|
26
|
+
return this.text;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static fromJSON(json: any): LabelElement {
|
|
30
|
+
return new LabelElement(json.elementId, json.text);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a option.
|
|
3
|
+
*/
|
|
4
|
+
export class OptionElement {
|
|
5
|
+
/** The unique identifier for the option. */
|
|
6
|
+
private label: string;
|
|
7
|
+
/** The display value for the option. */
|
|
8
|
+
private value: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new instance of the OptionElement class.
|
|
12
|
+
* @param {string} label - The unique identifier for the option.
|
|
13
|
+
* @param {string} value - The display value for the option.
|
|
14
|
+
*/
|
|
15
|
+
constructor(label: string, value: string) {
|
|
16
|
+
this.label = label || "";
|
|
17
|
+
this.value = value || "";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns the unique identifier for the option.
|
|
22
|
+
* @returns {string} The unique identifier for the option.
|
|
23
|
+
*/
|
|
24
|
+
getLabel(): string {
|
|
25
|
+
return this.label;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns the display value for the option.
|
|
30
|
+
* @returns {string} The display value for the option.
|
|
31
|
+
*/
|
|
32
|
+
getValue(): string {
|
|
33
|
+
return this.value;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static fromJSON(json: any): OptionElement {
|
|
37
|
+
return new OptionElement(json.label, json.value);
|
|
38
|
+
}
|
|
39
|
+
}
|