@carbon/ai-chat 0.4.0-rc.2 → 0.4.0-rc.3
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/dist/es/aiChatEntry.js +220 -14
- package/dist/es/chat.AppContainer.js +6491 -0
- package/dist/es/chat.AppState.js +40 -0
- package/dist/es/{chat/shared/components/BasePanelComponent.js → chat.BasePanelComponent.js} +3 -3
- package/dist/es/{chat/shared/components/panels/BodyAndFooterPanelComponent.js → chat.BodyAndFooterPanelComponent.js} +92 -9
- package/dist/es/chat.BodyWithFooterComponent.js +140 -0
- package/dist/es/{chat/shared/components/header/BotHeader.js → chat.BotHeader.js} +7 -9
- package/dist/es/{chat/shared/components/responseTypes/carousel/Carousel.js → chat.Carousel.js} +3 -3
- package/dist/es/chat.CatastrophicError.js +381 -0
- package/dist/es/chat.Chat.js +2009 -0
- package/dist/es/chat.Disclaimer.js +553 -0
- package/dist/es/chat.Header.js +1025 -0
- package/dist/es/{chat/shared/components/util/HideComponent.js → chat.HideComponent.js} +9 -2
- package/dist/es/{types/config/HomeScreenConfig.js → chat.HomeScreenConfig.js} +1 -1
- package/dist/es/{chat/shared/components/homeScreen/HomeScreen.js → chat.HomeScreenContainer.js} +159 -14
- package/dist/es/{chat/shared/components/homeScreen/HomeScreenHeader.js → chat.HomeScreenHeader.js} +3 -3
- package/dist/es/{chat/shared/services/haa/HumanAgentServiceImpl.js → chat.HumanAgentServiceImpl.js} +215 -17
- package/dist/es/{chat/shared/components/responseTypes/iframe/IFrameComponent.js → chat.IFrameComponent.js} +4 -8
- package/dist/es/chat.IFramePanel.js +151 -0
- package/dist/es/{chat/shared/components/input/Input.js → chat.Input.js} +214 -18
- package/dist/es/{types/config/ServiceDeskConfig.js → chat.LocalMessageItem.js} +17 -1
- package/dist/es/chat.MessageTypeComponent.js +3580 -0
- package/dist/es/{types/messaging/Messages.js → chat.Messages.js} +1 -1
- package/dist/es/chat.MountChildrenOnDelay.js +97 -0
- package/dist/es/{chat/shared/components/OverlayPanel.js → chat.PageObjectId.js} +70 -4
- package/dist/es/{chat/web-components/components/markdownText/src/markdownText.scss.js → chat.RichText.js} +347 -1
- package/dist/es/chat.TourContainer.js +524 -0
- package/dist/es/{chat/languages/en.json.js → chat.VideoComponent.js} +561 -1
- package/dist/es/chat.ViewSourcePanel.js +187 -0
- package/dist/es/{chat/shared/store/actions.js → chat.actions.js} +2 -2
- package/dist/es/{chat/shared/utils/browserUtils.js → chat.browserUtils.js} +1 -1
- package/dist/es/{types/utilities/carbonTypes.js → chat.carbonTypes.js} +2 -2
- package/dist/es/{chat/web-components/components/codeElement/src/codeElement.scss.js → chat.cds-aichat-code.js} +64 -1
- package/dist/es/{chat/shared/utils/constants.js → chat.constants.js} +4 -7
- package/dist/es/{types/events/eventBusTypes.js → chat.customElement.js} +32 -1
- package/dist/es/chat.dynamic-imports.js +192 -0
- package/dist/es/{chat/shared/utils/htmlUtils.js → chat.htmlUtils.js} +16 -2
- package/dist/es/{chat/shared/utils/messageUtils.js → chat.messageUtils.js} +54 -7
- package/dist/es/{chat/shared/utils/miscUtils.js → chat.miscUtils.js} +24 -5
- package/dist/es/chat.resolvablePromise.js +315 -0
- package/dist/es/{chat/shared/store/selectors.js → chat.selectors.js} +1 -1
- package/dist/es/{chat/shared/utils/lang/stringUtils.js → chat.stringUtils.js} +2 -2
- package/dist/es/{chat/shared/hooks/useCounter.js → chat.useCounter.js} +1 -1
- package/dist/es/{chat/shared/hooks/useOnMount.js → chat.useOnMount.js} +1 -1
- package/dist/es/{chat/shared/utils/domUtils.js → chat.usePrevious.js} +47 -1
- package/dist/es/{chat/shared/utils/lang/UUIDType.js → chat.uuid.js} +15 -3
- package/dist/es/web-components/cds-aichat-container/index.js +73 -4
- package/dist/es/web-components/cds-aichat-custom-element/index.js +1 -3
- package/package.json +2 -2
- package/dist/es/chat/dynamic-imports/dynamic-imports.js +0 -96
- package/dist/es/chat/react/components/AppContainer.js +0 -197
- package/dist/es/chat/react/components/UserDefinedResponsePortalsContainer.js +0 -31
- package/dist/es/chat/react/components/WriteableElementsPortalsContainer.js +0 -28
- package/dist/es/chat/react/components/chainOfThought/ChainOfThought.js +0 -20
- package/dist/es/chat/react/components/chatHeader/ChatHeaderAvatar.js +0 -20
- package/dist/es/chat/react/components/chatHeader/ChatHeaderLink.js +0 -22
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenu.js +0 -27
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenuButton.js +0 -60
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenuItem.js +0 -24
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenuItemRadioGroup.js +0 -28
- package/dist/es/chat/react/components/chatHeader/ChatHeaderOverflowMenu.js +0 -69
- package/dist/es/chat/react/components/chatHeader/ChatHeaderTitle.js +0 -22
- package/dist/es/chat/react/components/feedback/FeedbackButtonsComponent.js +0 -20
- package/dist/es/chat/react/components/feedback/FeedbackComponent.js +0 -20
- package/dist/es/chat/react/components/inlineLoading/InlineLoadingComponent.js +0 -20
- package/dist/es/chat/react/components/markdownText/MarkdownText.js +0 -20
- package/dist/es/chat/react/components/stopStreamingButton/StopStreamingButton.js +0 -20
- package/dist/es/chat/react/components/table/Table.js +0 -20
- package/dist/es/chat/shared/Chat.js +0 -115
- package/dist/es/chat/shared/ChatInstanceImpl.js +0 -360
- package/dist/es/chat/shared/chatEntryFunctions.js +0 -46
- package/dist/es/chat/shared/components/Avatar.js +0 -286
- package/dist/es/chat/shared/components/BodyWithFooterComponent.js +0 -56
- package/dist/es/chat/shared/components/CatastrophicError.js +0 -77
- package/dist/es/chat/shared/components/Chat.js +0 -244
- package/dist/es/chat/shared/components/ChatBubbleDark.js +0 -124
- package/dist/es/chat/shared/components/ChatBubbleLight.js +0 -216
- package/dist/es/chat/shared/components/Disclaimer.js +0 -86
- package/dist/es/chat/shared/components/ErrorIcon.js +0 -20
- package/dist/es/chat/shared/components/ErrorMessageDark.js +0 -89
- package/dist/es/chat/shared/components/ErrorMessageLight.js +0 -135
- package/dist/es/chat/shared/components/HydrationPanel.js +0 -58
- package/dist/es/chat/shared/components/LatestWelcomeNodes.js +0 -26
- package/dist/es/chat/shared/components/ResponseStopped.js +0 -19
- package/dist/es/chat/shared/components/SkeletonPicker.js +0 -32
- package/dist/es/chat/shared/components/WriteableElement.js +0 -22
- package/dist/es/chat/shared/components/agent/AgentAvatar.js +0 -54
- package/dist/es/chat/shared/components/agent/AgentBanner.js +0 -109
- package/dist/es/chat/shared/components/agent/AgentBannerContainer.js +0 -28
- package/dist/es/chat/shared/components/agent/AvailabilityMessage.js +0 -49
- package/dist/es/chat/shared/components/aria/AriaAnnouncerComponent.js +0 -122
- package/dist/es/chat/shared/components/aria/AriaAnnouncerProvider.js +0 -48
- package/dist/es/chat/shared/components/aria/AriaLiveMessage.js +0 -22
- package/dist/es/chat/shared/components/header/AISlug.js +0 -22
- package/dist/es/chat/shared/components/header/Header.js +0 -460
- package/dist/es/chat/shared/components/header/SimpleHeader.js +0 -27
- package/dist/es/chat/shared/components/homeScreen/HomeScreenContainer.js +0 -68
- package/dist/es/chat/shared/components/launcher/Launcher.js +0 -88
- package/dist/es/chat/shared/components/launcher/LauncherComplex.js +0 -63
- package/dist/es/chat/shared/components/launcher/LauncherContainer.js +0 -73
- package/dist/es/chat/shared/components/launcher/LauncherDesktopContainer.js +0 -221
- package/dist/es/chat/shared/components/launcher/LauncherExtended.js +0 -244
- package/dist/es/chat/shared/components/launcher/LauncherMobileContainer.js +0 -175
- package/dist/es/chat/shared/components/launcher/launcherUtils.js +0 -16
- package/dist/es/chat/shared/components/modals/ConfirmModal.js +0 -67
- package/dist/es/chat/shared/components/modals/EndAgentChatModal.js +0 -46
- package/dist/es/chat/shared/components/modals/RequestScreenShareModal.js +0 -43
- package/dist/es/chat/shared/components/notifications/Notifications.js +0 -58
- package/dist/es/chat/shared/components/panels/CustomPanel.js +0 -136
- package/dist/es/chat/shared/components/responseTypes/agent/ConnectToAgent.js +0 -30
- package/dist/es/chat/shared/components/responseTypes/agent/RealConnectToAgent.js +0 -102
- package/dist/es/chat/shared/components/responseTypes/audio/AudioComponent.js +0 -26
- package/dist/es/chat/shared/components/responseTypes/buttonItem/BaseButtonItemComponent.js +0 -69
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemComponent.js +0 -48
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemCustomEventComponent.js +0 -42
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemPostBackComponent.js +0 -54
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemShowPanelComponent.js +0 -36
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemURLComponent.js +0 -42
- package/dist/es/chat/shared/components/responseTypes/card/CardItemComponent.js +0 -34
- package/dist/es/chat/shared/components/responseTypes/carousel/CarouselItemComponent.js +0 -39
- package/dist/es/chat/shared/components/responseTypes/conversationalSearch/ConversationalSearch.js +0 -92
- package/dist/es/chat/shared/components/responseTypes/conversationalSearch/ConversationalSearchText.js +0 -158
- package/dist/es/chat/shared/components/responseTypes/custom/UserDefinedResponse.js +0 -33
- package/dist/es/chat/shared/components/responseTypes/datePicker/DatePickerComponent.js +0 -176
- package/dist/es/chat/shared/components/responseTypes/error/InlineError.js +0 -32
- package/dist/es/chat/shared/components/responseTypes/grid/GridItemComponent.js +0 -109
- package/dist/es/chat/shared/components/responseTypes/iframe/IFrameMessage.js +0 -32
- package/dist/es/chat/shared/components/responseTypes/iframe/IFramePanel.js +0 -51
- package/dist/es/chat/shared/components/responseTypes/iframe/IFramePreviewCard.js +0 -64
- package/dist/es/chat/shared/components/responseTypes/iframe/InlineIFrame.js +0 -55
- package/dist/es/chat/shared/components/responseTypes/image/Image.js +0 -120
- package/dist/es/chat/shared/components/responseTypes/options/OptionComponent.js +0 -83
- package/dist/es/chat/shared/components/responseTypes/options/SelectComponent.js +0 -84
- package/dist/es/chat/shared/components/responseTypes/table/TableContainer.js +0 -96
- package/dist/es/chat/shared/components/responseTypes/text/TextArea.js +0 -68
- package/dist/es/chat/shared/components/responseTypes/tour/TourCard.js +0 -73
- package/dist/es/chat/shared/components/responseTypes/util/BodyMessageComponents.js +0 -65
- package/dist/es/chat/shared/components/responseTypes/util/ClickableImage.js +0 -36
- package/dist/es/chat/shared/components/responseTypes/util/Description.js +0 -21
- package/dist/es/chat/shared/components/responseTypes/util/FooterButtonComponents.js +0 -36
- package/dist/es/chat/shared/components/responseTypes/util/MediaPlayer.js +0 -157
- package/dist/es/chat/shared/components/responseTypes/util/Metablock.js +0 -27
- package/dist/es/chat/shared/components/responseTypes/util/RichText.js +0 -31
- package/dist/es/chat/shared/components/responseTypes/util/SearchResultBody.js +0 -53
- package/dist/es/chat/shared/components/responseTypes/util/StreamingRichText.js +0 -38
- package/dist/es/chat/shared/components/responseTypes/util/TextHolderTile.js +0 -35
- package/dist/es/chat/shared/components/responseTypes/util/citations/CitationCard.js +0 -65
- package/dist/es/chat/shared/components/responseTypes/util/citations/CitationCardContent.js +0 -62
- package/dist/es/chat/shared/components/responseTypes/util/citations/CitationClickableCard.js +0 -23
- package/dist/es/chat/shared/components/responseTypes/util/citations/ExpandToPanelCard.js +0 -50
- package/dist/es/chat/shared/components/responseTypes/util/citations/ViewSourcePanel.js +0 -57
- package/dist/es/chat/shared/components/responseTypes/video/VideoComponent.js +0 -23
- package/dist/es/chat/shared/components/tour/TourCloseMinimizeComponent.js +0 -44
- package/dist/es/chat/shared/components/tour/TourContainer.js +0 -212
- package/dist/es/chat/shared/components/tour/TourControlsComponent.js +0 -98
- package/dist/es/chat/shared/components/tour/TourStepContentComponent.js +0 -156
- package/dist/es/chat/shared/components/tour/TourStepSkeletonComponent.js +0 -20
- package/dist/es/chat/shared/components/util/AnnounceOnMountComponent.js +0 -42
- package/dist/es/chat/shared/components/util/IconHolder.js +0 -16
- package/dist/es/chat/shared/components/util/ImageWithFallback.js +0 -31
- package/dist/es/chat/shared/components/util/MaybeDangerouslySetInnerHTML.js +0 -42
- package/dist/es/chat/shared/components/util/MountChildrenOnDelay.js +0 -40
- package/dist/es/chat/shared/components/util/VisuallyHidden.js +0 -18
- package/dist/es/chat/shared/containers/App.js +0 -181
- package/dist/es/chat/shared/containers/MessageComponent.js +0 -465
- package/dist/es/chat/shared/containers/MessageTypeComponent.js +0 -496
- package/dist/es/chat/shared/containers/MessagesComponent.js +0 -469
- package/dist/es/chat/shared/containers/ModalPortal.js +0 -53
- package/dist/es/chat/shared/containers/main/MainWindow.js +0 -708
- package/dist/es/chat/shared/contexts/AriaAnnouncerContext.js +0 -12
- package/dist/es/chat/shared/contexts/HideComponentContext.js +0 -12
- package/dist/es/chat/shared/contexts/LanguagePackContext.js +0 -12
- package/dist/es/chat/shared/contexts/ModalPortalRootContext.js +0 -12
- package/dist/es/chat/shared/contexts/ServiceManagerContext.js +0 -12
- package/dist/es/chat/shared/contexts/WindowSizeContext.js +0 -12
- package/dist/es/chat/shared/environmentVariables.js +0 -13
- package/dist/es/chat/shared/events/ChatActionsImpl.js +0 -783
- package/dist/es/chat/shared/events/EventBus.js +0 -161
- package/dist/es/chat/shared/hocs/withAriaAnnouncer.js +0 -25
- package/dist/es/chat/shared/hocs/withServiceManager.js +0 -25
- package/dist/es/chat/shared/hooks/useAriaAnnouncer.js +0 -16
- package/dist/es/chat/shared/hooks/useCSSCustomProperties.js +0 -21
- package/dist/es/chat/shared/hooks/useCallbackOnChange.js +0 -24
- package/dist/es/chat/shared/hooks/useEffectDidUpdate.js +0 -21
- package/dist/es/chat/shared/hooks/useLanguagePack.js +0 -16
- package/dist/es/chat/shared/hooks/usePrevious.js +0 -18
- package/dist/es/chat/shared/hooks/useServiceManager.js +0 -16
- package/dist/es/chat/shared/hooks/useShouldSanitizeHTML.js +0 -15
- package/dist/es/chat/shared/hooks/useUUID.js +0 -22
- package/dist/es/chat/shared/hooks/useWindowSize.js +0 -16
- package/dist/es/chat/shared/loadServices.js +0 -72
- package/dist/es/chat/shared/schema/historyToMessages.js +0 -231
- package/dist/es/chat/shared/schema/inputItemToLocalItem.js +0 -30
- package/dist/es/chat/shared/schema/outputItemToLocalItem.js +0 -124
- package/dist/es/chat/shared/services/CustomPanelInstance.js +0 -26
- package/dist/es/chat/shared/services/CustomPanelManager.js +0 -23
- package/dist/es/chat/shared/services/HistoryService.js +0 -59
- package/dist/es/chat/shared/services/MessageService.js +0 -351
- package/dist/es/chat/shared/services/NamespaceService.js +0 -26
- package/dist/es/chat/shared/services/ServiceManager.js +0 -19
- package/dist/es/chat/shared/services/UserSessionStorageService.js +0 -89
- package/dist/es/chat/shared/services/haa/agentStatusMessage.js +0 -108
- package/dist/es/chat/shared/services/haa/humanAgentUtils.js +0 -114
- package/dist/es/chat/shared/services/mockStorage.js +0 -30
- package/dist/es/chat/shared/store/agentActions.js +0 -125
- package/dist/es/chat/shared/store/agentReducers.js +0 -215
- package/dist/es/chat/shared/store/doCreateStore.js +0 -142
- package/dist/es/chat/shared/store/reducerUtils.js +0 -320
- package/dist/es/chat/shared/store/reducers.js +0 -871
- package/dist/es/chat/shared/store/subscriptions.js +0 -55
- package/dist/es/chat/shared/store/tourReducerUtils.js +0 -51
- package/dist/es/chat/shared/utils/ListenerList.js +0 -26
- package/dist/es/chat/shared/utils/PageObjectId.js +0 -25
- package/dist/es/chat/shared/utils/animationUtils.js +0 -77
- package/dist/es/chat/shared/utils/colors.js +0 -71
- package/dist/es/chat/shared/utils/customizers.js +0 -16
- package/dist/es/chat/shared/utils/dateUtils.js +0 -38
- package/dist/es/chat/shared/utils/homeScreenUtils.js +0 -27
- package/dist/es/chat/shared/utils/intlUtils.js +0 -21
- package/dist/es/chat/shared/utils/lang/arrayUtils.js +0 -53
- package/dist/es/chat/shared/utils/lang/langUtils.js +0 -13
- package/dist/es/chat/shared/utils/lang/objectUtils.js +0 -19
- package/dist/es/chat/shared/utils/lang/promiseUtils.js +0 -25
- package/dist/es/chat/shared/utils/lang/uuid.js +0 -16
- package/dist/es/chat/shared/utils/languages.js +0 -156
- package/dist/es/chat/shared/utils/memoizerUtils.js +0 -38
- package/dist/es/chat/shared/utils/messageServiceUtils.js +0 -36
- package/dist/es/chat/shared/utils/resolvablePromise.js +0 -32
- package/dist/es/chat/shared/utils/styleUtils.js +0 -231
- package/dist/es/chat/shared/utils/timeUtils.js +0 -14
- package/dist/es/chat/shared/utils/viewStateUtils.js +0 -38
- package/dist/es/chat/web-components/components/chainOfThought/cds-aichat-chain-of-thought.js +0 -26
- package/dist/es/chat/web-components/components/chainOfThought/src/ChainOfThoughtElement.js +0 -130
- package/dist/es/chat/web-components/components/chainOfThought/src/chainOfThoughtElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/chainOfThought/src/chainOfThoughtElement.template.js +0 -186
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/cds-aichat-chat-header-avatar.js +0 -26
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/src/chatHeaderAvatar.template.js +0 -32
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/src/chatHeaderAvatarElement.js +0 -52
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/src/chatHeaderAvatarElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderLink/cds-aichat-chat-header-link.js +0 -44
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderLink/src/chatHeaderLinkElement.template.js +0 -28
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderTitle/cds-aichat-chat-header-title.js +0 -42
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderTitle/src/chatHeaderTitle.scss.js +0 -3
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderTitle/src/chatHeaderTitle.template.js +0 -20
- package/dist/es/chat/web-components/components/codeElement/cds-aichat-code.js +0 -66
- package/dist/es/chat/web-components/components/feedbackButtonsElement/cds-aichat-feedback-buttons.js +0 -26
- package/dist/es/chat/web-components/components/feedbackButtonsElement/src/FeedbackButtonsElement.js +0 -93
- package/dist/es/chat/web-components/components/feedbackButtonsElement/src/feedbackButtonsElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/feedbackButtonsElement/src/feedbackButtonsElement.template.js +0 -84
- package/dist/es/chat/web-components/components/feedbackElement/cds-aichat-feedback.js +0 -30
- package/dist/es/chat/web-components/components/feedbackElement/src/FeedbackElement.js +0 -157
- package/dist/es/chat/web-components/components/feedbackElement/src/feedbackElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/feedbackElement/src/feedbackElement.template.js +0 -95
- package/dist/es/chat/web-components/components/inlineLoadingElement/cds-aichat-inline-loading.js +0 -85
- package/dist/es/chat/web-components/components/inlineLoadingElement/src/styles.scss.js +0 -3
- package/dist/es/chat/web-components/components/markdownText/cds-aichat-markdown-text.js +0 -32
- package/dist/es/chat/web-components/components/markdownText/markdown/markdownToHTML.js +0 -28
- package/dist/es/chat/web-components/components/markdownText/markdown/utils/renderTokenTree.js +0 -191
- package/dist/es/chat/web-components/components/markdownText/markdown/workers/workerManager.js +0 -16
- package/dist/es/chat/web-components/components/markdownText/src/MarkdownElement.js +0 -70
- package/dist/es/chat/web-components/components/markdownText/src/markdownElement.template.js +0 -19
- package/dist/es/chat/web-components/components/roundedButton/cds-aichat-rounded-button.js +0 -29
- package/dist/es/chat/web-components/components/stopStreamingButton/cds-aichat-stop-streaming-button.js +0 -26
- package/dist/es/chat/web-components/components/stopStreamingButton/src/StopStreamingButtonElement.js +0 -49
- package/dist/es/chat/web-components/components/stopStreamingButton/src/stopStreamingButton.scss.js +0 -3
- package/dist/es/chat/web-components/components/stopStreamingButton/src/stopStreamingButton.template.js +0 -44
- package/dist/es/chat/web-components/components/table/cds-aichat-table.js +0 -229
- package/dist/es/chat/web-components/components/table/src/table.scss.js +0 -3
- package/dist/es/chat/web-components/components/table/src/table.template.js +0 -81
- package/dist/es/chat/web-components/components/table/src/tablePagination.template.js +0 -43
- package/dist/es/chat/web-components/components/table/src/tableSkeleton.template.js +0 -17
- package/dist/es/chat/web-components/components/tagListElement/cds-aichat-tag-list.js +0 -28
- package/dist/es/chat/web-components/components/tagListElement/src/TagListElement.js +0 -70
- package/dist/es/chat/web-components/components/tagListElement/src/tagListElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/tagListElement/src/tagListElement.template.js +0 -40
- package/dist/es/chat/web-components/decorators/customElement.js +0 -33
- package/dist/es/chat/web-components/internal/cds-aichat-internal.js +0 -78
- package/dist/es/chat/web-components/settings.js +0 -13
- package/dist/es/node_modules/@carbon/colors/es/index.js +0 -11
- package/dist/es/react/ChatContainer.js +0 -162
- package/dist/es/react/ChatCustomElement.js +0 -58
- package/dist/es/types/config/ChatHeaderConfig.js +0 -18
- package/dist/es/types/config/CornersType.js +0 -16
- package/dist/es/types/config/LauncherConfig.js +0 -19
- package/dist/es/types/config/PublicConfig.js +0 -36
- package/dist/es/types/instance/ChatInstance.js +0 -31
- package/dist/es/types/instance/apiTypes.js +0 -33
- package/dist/es/types/messaging/LocalMessageItem.js +0 -18
- package/dist/es/types/state/AppState.js +0 -18
- package/dist/es/types/utilities/Animation.js +0 -31
- package/dist/es/types/utilities/HasAddRemoveClassName.js +0 -27
- /package/dist/es/{chat/shared/styles/export.carbon.scss.js → chat.export.carbon.js} +0 -0
- /package/dist/es/{chat/shared/styles/export.scss.js → chat.export.js} +0 -0
- /package/dist/es/{chat/web-components/components/markdownText/markdown/utils/markdown.js → chat.markdown.js} +0 -0
- /package/dist/es/{chat/web-components/components/markdownText/markdown/utils/tokenTree.js → chat.tokenTree.js} +0 -0
package/dist/es/chat/web-components/components/feedbackButtonsElement/cds-aichat-feedback-buttons.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
|
|
3
|
-
import { carbonElement } from "../../decorators/customElement.js";
|
|
4
|
-
|
|
5
|
-
import { FeedbackButtonsElement } from "./src/FeedbackButtonsElement.js";
|
|
6
|
-
|
|
7
|
-
import { feedbackButtonsElementTemplate } from "./src/feedbackButtonsElement.template.js";
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
* Copyright IBM Corp. 2025
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
13
|
-
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*
|
|
15
|
-
* @license
|
|
16
|
-
*/ const FEEDBACK_BUTTONS_COMPONENT_TAG_NAME = `cds-aichat-feedback-buttons`;
|
|
17
|
-
|
|
18
|
-
let CDSChatFeedbackButtonsElement = class CDSChatFeedbackButtonsElement extends FeedbackButtonsElement {
|
|
19
|
-
render() {
|
|
20
|
-
return feedbackButtonsElementTemplate(this);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
CDSChatFeedbackButtonsElement = __decorate([ carbonElement(FEEDBACK_BUTTONS_COMPONENT_TAG_NAME) ], CDSChatFeedbackButtonsElement);
|
|
25
|
-
|
|
26
|
-
export { FEEDBACK_BUTTONS_COMPONENT_TAG_NAME, CDSChatFeedbackButtonsElement as default };
|
package/dist/es/chat/web-components/components/feedbackButtonsElement/src/FeedbackButtonsElement.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
|
|
3
|
-
import { LitElement, unsafeCSS, css } from "lit";
|
|
4
|
-
|
|
5
|
-
import { property } from "lit/decorators.js";
|
|
6
|
-
|
|
7
|
-
import css_248z from "./feedbackButtonsElement.scss.js";
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
* Copyright IBM Corp. 2025
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
13
|
-
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*
|
|
15
|
-
* @license
|
|
16
|
-
*/ class FeedbackButtonsElement extends LitElement {}
|
|
17
|
-
|
|
18
|
-
FeedbackButtonsElement.styles = css`
|
|
19
|
-
${unsafeCSS(css_248z)}
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
__decorate([ property({
|
|
23
|
-
type: Boolean,
|
|
24
|
-
attribute: "is-positive-open",
|
|
25
|
-
reflect: true
|
|
26
|
-
}) ], FeedbackButtonsElement.prototype, "isPositiveOpen", void 0);
|
|
27
|
-
|
|
28
|
-
__decorate([ property({
|
|
29
|
-
type: Boolean,
|
|
30
|
-
attribute: "is-negative-open",
|
|
31
|
-
reflect: true
|
|
32
|
-
}) ], FeedbackButtonsElement.prototype, "isNegativeOpen", void 0);
|
|
33
|
-
|
|
34
|
-
__decorate([ property({
|
|
35
|
-
type: Boolean,
|
|
36
|
-
attribute: "is-positive-selected",
|
|
37
|
-
reflect: true
|
|
38
|
-
}) ], FeedbackButtonsElement.prototype, "isPositiveSelected", void 0);
|
|
39
|
-
|
|
40
|
-
__decorate([ property({
|
|
41
|
-
type: Boolean,
|
|
42
|
-
attribute: "has-positive-details",
|
|
43
|
-
reflect: true
|
|
44
|
-
}) ], FeedbackButtonsElement.prototype, "hasPositiveDetails", void 0);
|
|
45
|
-
|
|
46
|
-
__decorate([ property({
|
|
47
|
-
type: Boolean,
|
|
48
|
-
attribute: "has-negative-details",
|
|
49
|
-
reflect: true
|
|
50
|
-
}) ], FeedbackButtonsElement.prototype, "hasNegativeDetails", void 0);
|
|
51
|
-
|
|
52
|
-
__decorate([ property({
|
|
53
|
-
type: Boolean,
|
|
54
|
-
attribute: "is-negative-selected",
|
|
55
|
-
reflect: true
|
|
56
|
-
}) ], FeedbackButtonsElement.prototype, "isNegativeSelected", void 0);
|
|
57
|
-
|
|
58
|
-
__decorate([ property({
|
|
59
|
-
type: Boolean,
|
|
60
|
-
attribute: "is-positive-disabled",
|
|
61
|
-
reflect: true
|
|
62
|
-
}) ], FeedbackButtonsElement.prototype, "isPositiveDisabled", void 0);
|
|
63
|
-
|
|
64
|
-
__decorate([ property({
|
|
65
|
-
type: Boolean,
|
|
66
|
-
attribute: "is-negative-disabled",
|
|
67
|
-
reflect: true
|
|
68
|
-
}) ], FeedbackButtonsElement.prototype, "isNegativeDisabled", void 0);
|
|
69
|
-
|
|
70
|
-
__decorate([ property({
|
|
71
|
-
type: String,
|
|
72
|
-
attribute: "positive-label",
|
|
73
|
-
reflect: true
|
|
74
|
-
}) ], FeedbackButtonsElement.prototype, "positiveLabel", void 0);
|
|
75
|
-
|
|
76
|
-
__decorate([ property({
|
|
77
|
-
type: String,
|
|
78
|
-
attribute: "negative-label",
|
|
79
|
-
reflect: true
|
|
80
|
-
}) ], FeedbackButtonsElement.prototype, "negativeLabel", void 0);
|
|
81
|
-
|
|
82
|
-
__decorate([ property({
|
|
83
|
-
type: String,
|
|
84
|
-
attribute: "panel-id",
|
|
85
|
-
reflect: true
|
|
86
|
-
}) ], FeedbackButtonsElement.prototype, "panelID", void 0);
|
|
87
|
-
|
|
88
|
-
__decorate([ property({
|
|
89
|
-
type: Object,
|
|
90
|
-
attribute: "on-click"
|
|
91
|
-
}) ], FeedbackButtonsElement.prototype, "onClick", void 0);
|
|
92
|
-
|
|
93
|
-
export { FeedbackButtonsElement };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import "@carbon/web-components/es-custom/components/textarea/index.js";
|
|
2
|
-
|
|
3
|
-
import "@carbon/web-components/es-custom/components/icon-button/index.js";
|
|
4
|
-
|
|
5
|
-
import { toString } from "@carbon/icon-helpers";
|
|
6
|
-
|
|
7
|
-
import ThumbsDown16 from "@carbon/icons/es/thumbs-down/16.js";
|
|
8
|
-
|
|
9
|
-
import ThumbsDownFilled16 from "@carbon/icons/es/thumbs-down--filled/16.js";
|
|
10
|
-
|
|
11
|
-
import ThumbsUp16 from "@carbon/icons/es/thumbs-up/16.js";
|
|
12
|
-
|
|
13
|
-
import ThumbsUpFilled16 from "@carbon/icons/es/thumbs-up--filled/16.js";
|
|
14
|
-
|
|
15
|
-
import { nothing, html } from "lit";
|
|
16
|
-
|
|
17
|
-
import { unsafeSVG } from "lit/directives/unsafe-svg.js";
|
|
18
|
-
|
|
19
|
-
import { CSS_CLASS_PREFIX } from "../../../settings.js";
|
|
20
|
-
|
|
21
|
-
import "../../../../../types/instance/apiTypes.js";
|
|
22
|
-
|
|
23
|
-
import enLanguagePack from "../../../../languages/en.json.js";
|
|
24
|
-
|
|
25
|
-
/*
|
|
26
|
-
* Copyright IBM Corp. 2025
|
|
27
|
-
*
|
|
28
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
29
|
-
* LICENSE file in the root directory of this source tree.
|
|
30
|
-
*
|
|
31
|
-
* @license
|
|
32
|
-
*/ const ThumbsDown16svg = toString(ThumbsDown16);
|
|
33
|
-
|
|
34
|
-
const ThumbsDownFilled16svg = toString(ThumbsDownFilled16);
|
|
35
|
-
|
|
36
|
-
const ThumbsUp16svg = toString(ThumbsUp16);
|
|
37
|
-
|
|
38
|
-
const ThumbsUpFilled16svg = toString(ThumbsUpFilled16);
|
|
39
|
-
|
|
40
|
-
function feedbackButtonsElementTemplate(customElementClass) {
|
|
41
|
-
const {isPositiveOpen: isPositiveOpen, isNegativeOpen: isNegativeOpen, isPositiveSelected: isPositiveSelected, isNegativeSelected: isNegativeSelected, hasPositiveDetails: hasPositiveDetails, hasNegativeDetails: hasNegativeDetails, isPositiveDisabled: isPositiveDisabled, isNegativeDisabled: isNegativeDisabled, positiveLabel: positiveLabel, negativeLabel: negativeLabel, panelID: panelID, onClick: onClick} = customElementClass;
|
|
42
|
-
return html`<div class="${CSS_CLASS_PREFIX}-feedback-buttons">
|
|
43
|
-
<cds-custom-icon-button
|
|
44
|
-
class="${CSS_CLASS_PREFIX}-feedback-buttons-positive"
|
|
45
|
-
size="sm"
|
|
46
|
-
align="top-left"
|
|
47
|
-
kind="ghost"
|
|
48
|
-
role="button"
|
|
49
|
-
disabled="${isPositiveDisabled || nothing}"
|
|
50
|
-
aria-expanded="${isPositiveDisabled || !hasPositiveDetails ? nothing : isPositiveOpen}"
|
|
51
|
-
aria-pressed="${isPositiveSelected || nothing}"
|
|
52
|
-
aria-controls="${panelID}-feedback-positive"
|
|
53
|
-
@click="${() => onClick(true)}"
|
|
54
|
-
>
|
|
55
|
-
<span slot="icon"
|
|
56
|
-
>${unsafeSVG(isPositiveSelected ? ThumbsUpFilled16svg : ThumbsUp16svg)}</span
|
|
57
|
-
>
|
|
58
|
-
<span slot="tooltip-content"
|
|
59
|
-
>${positiveLabel || enLanguagePack.feedback_positiveLabel}</span
|
|
60
|
-
>
|
|
61
|
-
</cds-custom-icon-button>
|
|
62
|
-
<cds-custom-icon-button
|
|
63
|
-
class="${CSS_CLASS_PREFIX}-feedback-buttons-negative"
|
|
64
|
-
size="sm"
|
|
65
|
-
align="top-left"
|
|
66
|
-
kind="ghost"
|
|
67
|
-
role="button"
|
|
68
|
-
disabled="${isNegativeDisabled || nothing}"
|
|
69
|
-
aria-expanded="${isNegativeDisabled || !hasNegativeDetails ? nothing : isNegativeOpen}"
|
|
70
|
-
aria-pressed="${isNegativeSelected || nothing}"
|
|
71
|
-
aria-controls="${panelID}-feedback-positive"
|
|
72
|
-
@click="${() => onClick(false)}"
|
|
73
|
-
>
|
|
74
|
-
<span slot="icon"
|
|
75
|
-
>${unsafeSVG(isNegativeSelected ? ThumbsDownFilled16svg : ThumbsDown16svg)}</span
|
|
76
|
-
>
|
|
77
|
-
<span slot="tooltip-content"
|
|
78
|
-
>${negativeLabel || enLanguagePack.feedback_negativeLabel}</span
|
|
79
|
-
>
|
|
80
|
-
</cds-custom-icon-button>
|
|
81
|
-
</div>`;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export { feedbackButtonsElementTemplate };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
|
|
3
|
-
import "../tagListElement/cds-aichat-tag-list.js";
|
|
4
|
-
|
|
5
|
-
import "../roundedButton/cds-aichat-rounded-button.js";
|
|
6
|
-
|
|
7
|
-
import { carbonElement } from "../../decorators/customElement.js";
|
|
8
|
-
|
|
9
|
-
import { FeedbackElement } from "./src/FeedbackElement.js";
|
|
10
|
-
|
|
11
|
-
import { feedbackElementTemplate } from "./src/feedbackElement.template.js";
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* Copyright IBM Corp. 2025
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*
|
|
19
|
-
* @license
|
|
20
|
-
*/ const FEEDBACK_COMPONENT_TAG_NAME = `cds-aichat-feedback`;
|
|
21
|
-
|
|
22
|
-
let CDSChatFeedbackElement = class CDSChatFeedbackElement extends FeedbackElement {
|
|
23
|
-
render() {
|
|
24
|
-
return feedbackElementTemplate(this);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
CDSChatFeedbackElement = __decorate([ carbonElement(FEEDBACK_COMPONENT_TAG_NAME) ], CDSChatFeedbackElement);
|
|
29
|
-
|
|
30
|
-
export { FEEDBACK_COMPONENT_TAG_NAME, CDSChatFeedbackElement as default };
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
|
|
3
|
-
import { bind } from "bind-decorator";
|
|
4
|
-
|
|
5
|
-
import { LitElement, unsafeCSS, css } from "lit";
|
|
6
|
-
|
|
7
|
-
import { property, state } from "lit/decorators.js";
|
|
8
|
-
|
|
9
|
-
import css_248z from "./feedbackElement.scss.js";
|
|
10
|
-
|
|
11
|
-
/*
|
|
12
|
-
* Copyright IBM Corp. 2025
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*
|
|
17
|
-
* @license
|
|
18
|
-
*/ class FeedbackElement extends LitElement {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.showTextArea = true;
|
|
22
|
-
this.showPrompt = true;
|
|
23
|
-
}
|
|
24
|
-
updated(changedProperties) {
|
|
25
|
-
if (changedProperties.has("initialValues")) {
|
|
26
|
-
this._setInitialValues(this.initialValues);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
_setInitialValues(values) {
|
|
30
|
-
if (values) {
|
|
31
|
-
this._textInput = values.text;
|
|
32
|
-
this._initialSelectedCategories = values.selectedCategories;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
_handleTextInput(event) {
|
|
36
|
-
this._textInput = event.currentTarget.value;
|
|
37
|
-
}
|
|
38
|
-
_handleSubmit() {
|
|
39
|
-
this.onSubmit?.({
|
|
40
|
-
text: this._textInput,
|
|
41
|
-
selectedCategories: this._selectedCategories
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
_handleCancel() {
|
|
45
|
-
this.onClose?.();
|
|
46
|
-
}
|
|
47
|
-
_handleCategoryChange(selectedCategories) {
|
|
48
|
-
this._selectedCategories = selectedCategories;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
FeedbackElement.styles = css`
|
|
53
|
-
${unsafeCSS(css_248z)}
|
|
54
|
-
`;
|
|
55
|
-
|
|
56
|
-
__decorate([ property({
|
|
57
|
-
type: String,
|
|
58
|
-
attribute: "class",
|
|
59
|
-
reflect: true
|
|
60
|
-
}) ], FeedbackElement.prototype, "class", void 0);
|
|
61
|
-
|
|
62
|
-
__decorate([ property({
|
|
63
|
-
type: String,
|
|
64
|
-
reflect: true
|
|
65
|
-
}) ], FeedbackElement.prototype, "id", void 0);
|
|
66
|
-
|
|
67
|
-
__decorate([ property({
|
|
68
|
-
type: Boolean,
|
|
69
|
-
attribute: "is-open",
|
|
70
|
-
reflect: true
|
|
71
|
-
}) ], FeedbackElement.prototype, "isOpen", void 0);
|
|
72
|
-
|
|
73
|
-
__decorate([ property({
|
|
74
|
-
type: Boolean,
|
|
75
|
-
attribute: "is-readonly",
|
|
76
|
-
reflect: true
|
|
77
|
-
}) ], FeedbackElement.prototype, "isReadonly", void 0);
|
|
78
|
-
|
|
79
|
-
__decorate([ property({
|
|
80
|
-
type: Object,
|
|
81
|
-
attribute: "on-close"
|
|
82
|
-
}) ], FeedbackElement.prototype, "onClose", void 0);
|
|
83
|
-
|
|
84
|
-
__decorate([ property({
|
|
85
|
-
type: Object,
|
|
86
|
-
attribute: "on-submit"
|
|
87
|
-
}) ], FeedbackElement.prototype, "onSubmit", void 0);
|
|
88
|
-
|
|
89
|
-
__decorate([ property({
|
|
90
|
-
type: Object,
|
|
91
|
-
attribute: "initial-values",
|
|
92
|
-
reflect: true
|
|
93
|
-
}) ], FeedbackElement.prototype, "initialValues", void 0);
|
|
94
|
-
|
|
95
|
-
__decorate([ property({
|
|
96
|
-
type: String,
|
|
97
|
-
attribute: "title",
|
|
98
|
-
reflect: true
|
|
99
|
-
}) ], FeedbackElement.prototype, "title", void 0);
|
|
100
|
-
|
|
101
|
-
__decorate([ property({
|
|
102
|
-
type: String,
|
|
103
|
-
attribute: "prompt",
|
|
104
|
-
reflect: true
|
|
105
|
-
}) ], FeedbackElement.prototype, "prompt", void 0);
|
|
106
|
-
|
|
107
|
-
__decorate([ property({
|
|
108
|
-
type: Object,
|
|
109
|
-
attribute: "categories",
|
|
110
|
-
reflect: true
|
|
111
|
-
}) ], FeedbackElement.prototype, "categories", void 0);
|
|
112
|
-
|
|
113
|
-
__decorate([ property({
|
|
114
|
-
type: String,
|
|
115
|
-
attribute: "disclaimer",
|
|
116
|
-
reflect: true
|
|
117
|
-
}) ], FeedbackElement.prototype, "disclaimer", void 0);
|
|
118
|
-
|
|
119
|
-
__decorate([ property({
|
|
120
|
-
type: String,
|
|
121
|
-
attribute: "text-area-placeholder",
|
|
122
|
-
reflect: true
|
|
123
|
-
}) ], FeedbackElement.prototype, "placeholder", void 0);
|
|
124
|
-
|
|
125
|
-
__decorate([ property({
|
|
126
|
-
type: String,
|
|
127
|
-
attribute: "cancel-label",
|
|
128
|
-
reflect: true
|
|
129
|
-
}) ], FeedbackElement.prototype, "cancelLabel", void 0);
|
|
130
|
-
|
|
131
|
-
__decorate([ property({
|
|
132
|
-
type: String,
|
|
133
|
-
attribute: "submit-label",
|
|
134
|
-
reflect: true
|
|
135
|
-
}) ], FeedbackElement.prototype, "submitLabel", void 0);
|
|
136
|
-
|
|
137
|
-
__decorate([ property({
|
|
138
|
-
type: Boolean,
|
|
139
|
-
attribute: "show-text-area",
|
|
140
|
-
reflect: true
|
|
141
|
-
}) ], FeedbackElement.prototype, "showTextArea", void 0);
|
|
142
|
-
|
|
143
|
-
__decorate([ property({
|
|
144
|
-
type: Boolean,
|
|
145
|
-
attribute: "show-prompt",
|
|
146
|
-
reflect: true
|
|
147
|
-
}) ], FeedbackElement.prototype, "showPrompt", void 0);
|
|
148
|
-
|
|
149
|
-
__decorate([ state() ], FeedbackElement.prototype, "_textInput", void 0);
|
|
150
|
-
|
|
151
|
-
__decorate([ state() ], FeedbackElement.prototype, "_initialSelectedCategories", void 0);
|
|
152
|
-
|
|
153
|
-
__decorate([ state() ], FeedbackElement.prototype, "_selectedCategories", void 0);
|
|
154
|
-
|
|
155
|
-
__decorate([ bind ], FeedbackElement.prototype, "_handleCategoryChange", null);
|
|
156
|
-
|
|
157
|
-
export { FeedbackElement };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var css_248z = ".cds--aichat-container{\n box-sizing:border-box;\n border:1px solid var(--cds-chat-bubble-border, #e0e0e0);\n border-radius:var(--cds-chat-BASE-border-radius-med);\n animation:fade-in 600ms forwards;\n background-color:var(--cds-chat-shell-background, #ffffff);\n container-type:inline-size;\n inline-size:100%;\n margin-block-start:0.25rem;\n}\n\n.cds--aichat-is-closed{\n display:none;\n}\n\n.cds--aichat-title-row{\n display:flex;\n margin-block-start:0.75rem;\n margin-inline:1rem 0.5rem;\n}\n\n.cds--aichat-title{\n flex:1;\n font-size:var(--cds-chat-BASE-font-size-xlarge);\n line-height:var(--cds-chat-BASE-line-height-xlarge);\n}\n\n.cds--aichat-close{\n margin-inline-start:0.5rem;\n}\n\n.cds--aichat-disclaimer,\n.cds--aichat-prompt{\n color:var(--cds-text-secondary, #525252);\n font-size:var(--cds-chat-BASE-font-size-small);\n line-height:var(--cds-chat-BASE-line-height-small);\n margin-block-start:0.5rem;\n margin-inline:1rem;\n}\n\n.cds--aichat-categories{\n margin-block-start:0.5rem;\n margin-inline:1rem;\n}\n\n.cds--aichat-feedback-text{\n margin-block-start:0.5rem;\n margin-inline:1rem;\n}\n\n.cds--aichat-buttons{\n display:flex;\n inline-size:100%;\n margin-block-start:1rem;\n}\n\n.cds--aichat-submit{\n flex:1;\n --cds-aichat-rounded-button-bottom-right:var(\n --cds-chat-BASE-border-radius-med\n );\n --cds-aichat-rounded-button-width:100%;\n --cds-aichat-rounded-button-max-width:100%;\n}\n\n.cds--aichat-cancel{\n flex:1;\n --cds-aichat-rounded-button-bottom-left:var(\n --cds-chat-BASE-border-radius-med\n );\n --cds-aichat-rounded-button-width:100%;\n --cds-aichat-rounded-button-max-width:100%;\n}\n\n@keyframes fade-in{\n from{\n opacity:0;\n }\n to{\n opacity:1;\n }\n}";
|
|
2
|
-
|
|
3
|
-
export { css_248z as default };
|
package/dist/es/chat/web-components/components/feedbackElement/src/feedbackElement.template.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import "@carbon/web-components/es-custom/components/button/index.js";
|
|
2
|
-
|
|
3
|
-
import "@carbon/web-components/es-custom/components/icon-button/index.js";
|
|
4
|
-
|
|
5
|
-
import "@carbon/web-components/es-custom/components/layer/index.js";
|
|
6
|
-
|
|
7
|
-
import "@carbon/web-components/es-custom/components/textarea/index.js";
|
|
8
|
-
|
|
9
|
-
import "../../tagListElement/cds-aichat-tag-list.js";
|
|
10
|
-
|
|
11
|
-
import cx from "classnames";
|
|
12
|
-
|
|
13
|
-
import { nothing, html } from "lit";
|
|
14
|
-
|
|
15
|
-
import { CSS_CLASS_PREFIX } from "../../../settings.js";
|
|
16
|
-
|
|
17
|
-
import "../../../../../types/instance/apiTypes.js";
|
|
18
|
-
|
|
19
|
-
import enLanguagePack from "../../../../languages/en.json.js";
|
|
20
|
-
|
|
21
|
-
/*
|
|
22
|
-
* Copyright IBM Corp. 2025
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*
|
|
27
|
-
* @license
|
|
28
|
-
*/
|
|
29
|
-
const MAX_TEXT_COUNT = 1e3;
|
|
30
|
-
|
|
31
|
-
function feedbackElementTemplate(customElementClass) {
|
|
32
|
-
const {_handleCancel: handleCancel, _handleSubmit: handleSubmit, _handleTextInput: handleTextInput, _initialSelectedCategories: initialSelectedCategories, _textInput: textInput, _handleCategoryChange: handleCategoryChange, id: id, isReadonly: isReadonly, isOpen: isOpen, title: title, prompt: prompt, placeholder: placeholder, categories: categories, disclaimer: disclaimer, showTextArea: showTextArea, showPrompt: showPrompt, submitLabel: submitLabel, cancelLabel: cancelLabel} = customElementClass;
|
|
33
|
-
return html`<div
|
|
34
|
-
class="${cx(`${CSS_CLASS_PREFIX}-container`, {
|
|
35
|
-
[`${CSS_CLASS_PREFIX}-is-closed`]: !isOpen
|
|
36
|
-
})}"
|
|
37
|
-
>
|
|
38
|
-
<div class="${CSS_CLASS_PREFIX}-title-row">
|
|
39
|
-
<div class="${CSS_CLASS_PREFIX}-title">
|
|
40
|
-
${title || enLanguagePack.feedback_defaultTitle}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
${showPrompt ? html`<div class="${CSS_CLASS_PREFIX}-prompt">
|
|
44
|
-
${prompt || enLanguagePack.feedback_defaultPrompt}
|
|
45
|
-
</div>` : ""}
|
|
46
|
-
${categories?.length ? html`<div class="${CSS_CLASS_PREFIX}-categories">
|
|
47
|
-
<cds-aichat-tag-list
|
|
48
|
-
.tags=${categories}
|
|
49
|
-
.initialSelectedTags=${initialSelectedCategories}
|
|
50
|
-
.onTagsChanged=${handleCategoryChange}
|
|
51
|
-
>
|
|
52
|
-
</cds-aichat-tag-list>
|
|
53
|
-
</div>` : ""}
|
|
54
|
-
${showTextArea ? html`<div class="${CSS_CLASS_PREFIX}-feedback-text">
|
|
55
|
-
<cds-custom-layer level="1">
|
|
56
|
-
<cds-custom-textarea
|
|
57
|
-
id="${id}-text-area"
|
|
58
|
-
value="${textInput}"
|
|
59
|
-
class="${CSS_CLASS_PREFIX}-feedback-text-area"
|
|
60
|
-
?disabled="${isReadonly}"
|
|
61
|
-
placeholder="${placeholder || enLanguagePack.feedback_defaultPlaceholder}"
|
|
62
|
-
rows="3"
|
|
63
|
-
max-count="${MAX_TEXT_COUNT}"
|
|
64
|
-
@input=${handleTextInput}
|
|
65
|
-
></cds-custom-textarea>
|
|
66
|
-
</cds-custom-layer>
|
|
67
|
-
</div>` : ""}
|
|
68
|
-
${disclaimer ? html`<div class="${CSS_CLASS_PREFIX}-disclaimer">
|
|
69
|
-
<cds-aichat-markdown-text
|
|
70
|
-
markdown="${disclaimer}"
|
|
71
|
-
></cds-aichat-markdown-text>
|
|
72
|
-
</div>` : ""}
|
|
73
|
-
<div class="${CSS_CLASS_PREFIX}-buttons">
|
|
74
|
-
<cds-aichat-rounded-button
|
|
75
|
-
class="${CSS_CLASS_PREFIX}-cancel"
|
|
76
|
-
disabled=${isReadonly || nothing}
|
|
77
|
-
size="lg"
|
|
78
|
-
kind="secondary"
|
|
79
|
-
@click=${handleCancel}
|
|
80
|
-
>
|
|
81
|
-
${cancelLabel || enLanguagePack.feedback_cancelLabel}
|
|
82
|
-
</cds-aichat-rounded-button>
|
|
83
|
-
<cds-aichat-rounded-button
|
|
84
|
-
class="${CSS_CLASS_PREFIX}-submit"
|
|
85
|
-
disabled=${isReadonly || nothing}
|
|
86
|
-
size="lg"
|
|
87
|
-
@click=${handleSubmit}
|
|
88
|
-
>
|
|
89
|
-
${submitLabel || enLanguagePack.feedback_submitLabel}
|
|
90
|
-
</cds-aichat-rounded-button>
|
|
91
|
-
</div>
|
|
92
|
-
</div>`;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export { feedbackElementTemplate };
|
package/dist/es/chat/web-components/components/inlineLoadingElement/cds-aichat-inline-loading.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
|
|
3
|
-
import { LitElement, html, unsafeCSS, css } from "lit";
|
|
4
|
-
|
|
5
|
-
import { property } from "lit/decorators.js";
|
|
6
|
-
|
|
7
|
-
import { carbonElement } from "../../decorators/customElement.js";
|
|
8
|
-
|
|
9
|
-
import { WEB_COMPONENT_PREFIX } from "../../settings.js";
|
|
10
|
-
|
|
11
|
-
import css_248z from "./src/styles.scss.js";
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* Copyright IBM Corp. 2025
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*
|
|
19
|
-
* @license
|
|
20
|
-
*/ const INLINE_LOADING_TAG_NAME = `${WEB_COMPONENT_PREFIX}-inline-loading`;
|
|
21
|
-
|
|
22
|
-
let CDSInlineLoadingElement = class CDSInlineLoadingElement extends LitElement {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
this.bounce = false;
|
|
26
|
-
this.loop = false;
|
|
27
|
-
this.quickLoad = false;
|
|
28
|
-
this.carbonTheme = "g10";
|
|
29
|
-
}
|
|
30
|
-
getAnimationEffect() {
|
|
31
|
-
const classNames = [];
|
|
32
|
-
if (this.quickLoad === true) {
|
|
33
|
-
classNames.push("quick-load");
|
|
34
|
-
}
|
|
35
|
-
if (this.bounce === true && this.loop === true) {
|
|
36
|
-
classNames.push("vertical");
|
|
37
|
-
}
|
|
38
|
-
if (this.bounce === false && this.loop === true) {
|
|
39
|
-
classNames.push("linear");
|
|
40
|
-
}
|
|
41
|
-
if (this.bounce === true && this.loop === false) {
|
|
42
|
-
classNames.push("vertical--no-loop");
|
|
43
|
-
}
|
|
44
|
-
if (classNames.length) {
|
|
45
|
-
return classNames.join(" ");
|
|
46
|
-
}
|
|
47
|
-
return "linear--no-loop";
|
|
48
|
-
}
|
|
49
|
-
render() {
|
|
50
|
-
return html`<div
|
|
51
|
-
data-carbon-theme=${this.carbonTheme}
|
|
52
|
-
class=${this.getAnimationEffect()}
|
|
53
|
-
>
|
|
54
|
-
<svg class="dots" viewBox="0 0 32 32">
|
|
55
|
-
<circle class="dot dot--left" cx="8" cy="16" />
|
|
56
|
-
<circle class="dot dot--center" cx="16" cy="16" r="2" />
|
|
57
|
-
<circle class="dot dot--right" cx="24" cy="16" r="2" />
|
|
58
|
-
</svg>
|
|
59
|
-
</div>`;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
CDSInlineLoadingElement.styles = css`
|
|
64
|
-
${unsafeCSS(css_248z)}
|
|
65
|
-
`;
|
|
66
|
-
|
|
67
|
-
__decorate([ property({
|
|
68
|
-
type: Boolean
|
|
69
|
-
}) ], CDSInlineLoadingElement.prototype, "bounce", void 0);
|
|
70
|
-
|
|
71
|
-
__decorate([ property({
|
|
72
|
-
type: Boolean
|
|
73
|
-
}) ], CDSInlineLoadingElement.prototype, "loop", void 0);
|
|
74
|
-
|
|
75
|
-
__decorate([ property({
|
|
76
|
-
type: Boolean
|
|
77
|
-
}) ], CDSInlineLoadingElement.prototype, "quickLoad", void 0);
|
|
78
|
-
|
|
79
|
-
__decorate([ property({
|
|
80
|
-
type: String
|
|
81
|
-
}) ], CDSInlineLoadingElement.prototype, "carbonTheme", void 0);
|
|
82
|
-
|
|
83
|
-
CDSInlineLoadingElement = __decorate([ carbonElement(INLINE_LOADING_TAG_NAME) ], CDSInlineLoadingElement);
|
|
84
|
-
|
|
85
|
-
export { CDSInlineLoadingElement, INLINE_LOADING_TAG_NAME };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var css_248z = ".dots{\n block-size:32px;\n inline-size:32px;\n}\n\n.dot{\n fill:none;\n r:0;\n stroke-width:0;\n transform:translateY(0);\n}\n\n[data-carbon-theme=white] .dot,\n[data-carbon-theme=g10] .dot{\n stroke:#001d6c;\n}\n\n[data-carbon-theme=g90] .dot,\n[data-carbon-theme=g100] .dot{\n stroke:#f4f4f4;\n}\n\n@media screen and (prefers-reduced-motion: reduce){\n .linear .dot--left{\n animation:none;\n animation-delay:1s, 1s, 2s, 2s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1, 1, infinite, infinite;\n transform-origin:25% 50%;\n }\n}\n.linear .dot--left{\n animation:linear-load-size, linear-load-stroke, linear-loop-size, linear-loop-stroke;\n animation-delay:1s, 1s, 2s, 2s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1, 1, infinite, infinite;\n transform-origin:25% 50%;\n}\n@media screen and (prefers-reduced-motion: reduce){\n .linear .dot--center{\n animation:none;\n animation-delay:1.167s, 1.167s, 2.167s, 2.167s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1, 1, infinite, infinite;\n transform-origin:50% 50%;\n }\n}\n.linear .dot--center{\n animation:linear-load-size, linear-load-stroke, linear-loop-size, linear-loop-stroke;\n animation-delay:1.167s, 1.167s, 2.167s, 2.167s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1, 1, infinite, infinite;\n transform-origin:50% 50%;\n}\n@media screen and (prefers-reduced-motion: reduce){\n .linear .dot--right{\n animation:none;\n animation-delay:1.334s, 1.334s, 2.334s, 2.334s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1, 1, infinite, infinite;\n transform-origin:75% 50%;\n }\n}\n.linear .dot--right{\n animation:linear-load-size, linear-load-stroke, linear-loop-size, linear-loop-stroke;\n animation-delay:1.334s, 1.334s, 2.334s, 2.334s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1, 1, infinite, infinite;\n transform-origin:75% 50%;\n}\n\n[dir=rtl] .linear .dot--left{\n animation-delay:1.334s, 1.334s, 2.334s, 2.334s, 7.334s, 7.334s;\n}\n[dir=rtl] .linear .dot--center{\n animation-delay:1.167s, 1.167s, 2.167s, 2.167s, 7.167s, 7.167s;\n}\n[dir=rtl] .linear .dot--right{\n animation-delay:1s, 1s, 2s, 2s, 7s, 7s;\n}\n\n@media screen and (prefers-reduced-motion: reduce){\n .linear--no-loop .dot--left{\n animation:none;\n animation-delay:1s, 1s, 2s, 2s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1;\n transform-origin:25% 50%;\n }\n}\n.linear--no-loop .dot--left{\n animation:linear-load-size, linear-load-stroke, linear-unload-size, linear-unload-stroke;\n animation-delay:1s, 1s, 2s, 2s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1;\n transform-origin:25% 50%;\n}\n@media screen and (prefers-reduced-motion: reduce){\n .linear--no-loop .dot--center{\n animation:none;\n animation-delay:1.167s, 1.167s, 2.167s, 2.167s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1;\n transform-origin:50% 50%;\n }\n}\n.linear--no-loop .dot--center{\n animation:linear-load-size, linear-load-stroke, linear-unload-size, linear-unload-stroke;\n animation-delay:1.167s, 1.167s, 2.167s, 2.167s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1;\n transform-origin:50% 50%;\n}\n@media screen and (prefers-reduced-motion: reduce){\n .linear--no-loop .dot--right{\n animation:none;\n animation-delay:1.334s, 1.334s, 2.334s, 2.334s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1;\n transform-origin:75% 50%;\n }\n}\n.linear--no-loop .dot--right{\n animation:linear-load-size, linear-load-stroke, linear-unload-size, linear-unload-stroke;\n animation-delay:1.334s, 1.334s, 2.334s, 2.334s;\n animation-duration:1s;\n animation-fill-mode:forwards;\n animation-iteration-count:1;\n transform-origin:75% 50%;\n}\n\n[dir=rtl] .linear--no-loop .dot--left{\n animation-delay:1.334s, 1.334s, 2.334s, 2.334s;\n}\n[dir=rtl] .linear--no-loop .dot--center{\n animation-delay:1.167s, 1.167s, 2.167s, 2.167s;\n}\n[dir=rtl] .linear--no-loop .dot--right{\n animation-delay:1s, 1s, 2s, 2s;\n}\n\n@keyframes linear-load-size{\n 0%{\n animation-timing-function:cubic-bezier(0, 0, 0.3, 1);\n r:0;\n }\n 25%{\n animation-timing-function:cubic-bezier(0, 0, 0.3, 1);\n r:2.5px;\n }\n 83.3%{\n r:0.875px;\n }\n 100%{\n r:0.875px;\n }\n}\n@keyframes linear-load-stroke{\n 0%{\n animation-timing-function:cubic-bezier(0, 0, 0.3, 1);\n stroke-width:0;\n }\n 8.33%{\n stroke-width:1.72;\n }\n 100%{\n stroke-width:1.72;\n }\n}\n@keyframes linear-loop-size{\n 0%{\n animation-timing-function:cubic-bezier(0, 0, 0.3, 1);\n r:0.875px;\n }\n 25%{\n animation-timing-function:cubic-bezier(0, 0, 0.3, 1);\n r:2.5px;\n }\n 91.66%{\n r:0.875px;\n }\n 100%{\n r:0.875px;\n }\n}\n@keyframes linear-loop-stroke{\n 0%{\n animation-timing-function:cubic-bezier(0.4, 0.14, 1, 1);\n stroke-width:1.72;\n }\n 100%{\n stroke-width:1.72;\n }\n}\n@keyframes linear-unload-size{\n 0%{\n r:0.875px;\n }\n 8.33%{\n r:0.875px;\n }\n 33.33%{\n animation-timing-function:cubic-bezier(0.4, 0.14, 1, 1);\n r:2.5px;\n }\n 58.33%{\n r:0;\n }\n 100%{\n r:0;\n }\n}\n@keyframes linear-unload-stroke{\n 0%{\n stroke-width:1.72;\n }\n 50%{\n stroke-width:1.72;\n }\n 58.33%{\n stroke-width:0;\n }\n 100%{\n stroke-width:0;\n }\n}\n@media (prefers-reduced-motion: reduce){\n .dot--left,\n .dot--center,\n .dot--right{\n animation:none;\n transition:none;\n }\n}";
|
|
2
|
-
|
|
3
|
-
export { css_248z as default };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
|
|
3
|
-
import { unsafeCSS, css } from "lit";
|
|
4
|
-
|
|
5
|
-
import { carbonElement } from "../../decorators/customElement.js";
|
|
6
|
-
|
|
7
|
-
import MarkdownTextElement from "./src/MarkdownElement.js";
|
|
8
|
-
|
|
9
|
-
import { markdownTextTemplate } from "./src/markdownElement.template.js";
|
|
10
|
-
|
|
11
|
-
import css_248z from "./src/markdownText.scss.js";
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* Copyright IBM Corp. 2025
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*
|
|
19
|
-
* @license
|
|
20
|
-
*/ let CDSChatMarkdownTextElement = class CDSChatMarkdownTextElement extends MarkdownTextElement {
|
|
21
|
-
render() {
|
|
22
|
-
return markdownTextTemplate(this);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
CDSChatMarkdownTextElement.styles = css`
|
|
27
|
-
${unsafeCSS(css_248z)}
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
CDSChatMarkdownTextElement = __decorate([ carbonElement("cds-aichat-markdown-text") ], CDSChatMarkdownTextElement);
|
|
31
|
-
|
|
32
|
-
export { CDSChatMarkdownTextElement as default };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { render, html } from "lit";
|
|
2
|
-
|
|
3
|
-
import { renderTokenTree } from "./utils/renderTokenTree.js";
|
|
4
|
-
|
|
5
|
-
import { getMarkdownWorker } from "./workers/workerManager.js";
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
* Copyright IBM Corp. 2025
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*
|
|
13
|
-
* @license
|
|
14
|
-
*/ function templateToString(result) {
|
|
15
|
-
const container = document.createElement("div");
|
|
16
|
-
render(result, container);
|
|
17
|
-
const htmlString = container.innerHTML;
|
|
18
|
-
render(html``, container);
|
|
19
|
-
return htmlString;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async function processMarkdown(value, sanitzeHTML = false) {
|
|
23
|
-
const tokenTree = await getMarkdownWorker(value, undefined);
|
|
24
|
-
const html = templateToString(renderTokenTree(tokenTree, sanitzeHTML));
|
|
25
|
-
return html;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { processMarkdown };
|