@carbon/ai-chat 0.4.0-rc.2 → 0.4.0-rc.4
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/dist/types/aiChatEntry.d.ts +4767 -0
- package/package.json +5 -4
- 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
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { uuid } from "../utils/lang/uuid.js";
|
|
4
|
-
|
|
5
|
-
import "../../../types/utilities/carbonTypes.js";
|
|
6
|
-
|
|
7
|
-
import { CarbonTheme } from "../../../types/config/PublicConfig.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
|
-
*/ function Avatar({theme: theme}) {
|
|
17
|
-
const a = `a-${uuid()}`;
|
|
18
|
-
const b = `b-${uuid()}`;
|
|
19
|
-
const c = `c-${uuid()}`;
|
|
20
|
-
const d = `d-${uuid()}`;
|
|
21
|
-
const e = `e-${uuid()}`;
|
|
22
|
-
if (theme === CarbonTheme.WHITE || theme === CarbonTheme.G10) {
|
|
23
|
-
return React.createElement("svg", {
|
|
24
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
-
viewBox: "0 0 32 32",
|
|
26
|
-
className: "cds--watsonx-avatar",
|
|
27
|
-
"aria-hidden": "true"
|
|
28
|
-
}, React.createElement("defs", null, React.createElement("linearGradient", {
|
|
29
|
-
id: a,
|
|
30
|
-
x1: "1186.526",
|
|
31
|
-
y1: "2863.168",
|
|
32
|
-
x2: "1199.825",
|
|
33
|
-
y2: "2845.109",
|
|
34
|
-
gradientTransform: "matrix(.8312 .55596 -.27409 .40979 -198.894 -1827.398)",
|
|
35
|
-
gradientUnits: "userSpaceOnUse"
|
|
36
|
-
}, React.createElement("stop", {
|
|
37
|
-
offset: ".3"
|
|
38
|
-
}), React.createElement("stop", {
|
|
39
|
-
offset: "1",
|
|
40
|
-
stopOpacity: "0"
|
|
41
|
-
})), React.createElement("linearGradient", {
|
|
42
|
-
id: b,
|
|
43
|
-
x1: "1189.388",
|
|
44
|
-
y1: "2911.794",
|
|
45
|
-
x2: "1200.478",
|
|
46
|
-
y2: "2896.735",
|
|
47
|
-
gradientTransform: "rotate(146.223 380.87 -882.286) scale(1 -.493)",
|
|
48
|
-
gradientUnits: "userSpaceOnUse"
|
|
49
|
-
}, React.createElement("stop", {
|
|
50
|
-
offset: ".3"
|
|
51
|
-
}), React.createElement("stop", {
|
|
52
|
-
offset: ".9",
|
|
53
|
-
stopOpacity: "0"
|
|
54
|
-
})), React.createElement("linearGradient", {
|
|
55
|
-
id: c,
|
|
56
|
-
x1: "-4995.033",
|
|
57
|
-
y1: "-20162.835",
|
|
58
|
-
x2: "-4981.733",
|
|
59
|
-
y2: "-20180.895",
|
|
60
|
-
gradientTransform: "rotate(-146.223 -971.422 -5714.55) scale(1 .493)",
|
|
61
|
-
gradientUnits: "userSpaceOnUse"
|
|
62
|
-
}, React.createElement("stop", {
|
|
63
|
-
offset: ".32"
|
|
64
|
-
}), React.createElement("stop", {
|
|
65
|
-
offset: ".354",
|
|
66
|
-
stopOpacity: ".798"
|
|
67
|
-
}), React.createElement("stop", {
|
|
68
|
-
offset: ".7",
|
|
69
|
-
stopOpacity: "0"
|
|
70
|
-
})), React.createElement("linearGradient", {
|
|
71
|
-
id: d,
|
|
72
|
-
x1: "0",
|
|
73
|
-
y1: "32",
|
|
74
|
-
x2: "32",
|
|
75
|
-
y2: "0",
|
|
76
|
-
gradientUnits: "userSpaceOnUse"
|
|
77
|
-
}, React.createElement("stop", {
|
|
78
|
-
offset: ".1",
|
|
79
|
-
stopColor: "#a56eff"
|
|
80
|
-
}), React.createElement("stop", {
|
|
81
|
-
offset: ".9",
|
|
82
|
-
stopColor: "#0f62fe"
|
|
83
|
-
})), React.createElement("mask", {
|
|
84
|
-
id: e,
|
|
85
|
-
x: "0",
|
|
86
|
-
y: "0",
|
|
87
|
-
width: "32",
|
|
88
|
-
height: "32",
|
|
89
|
-
maskUnits: "userSpaceOnUse"
|
|
90
|
-
}, React.createElement("path", {
|
|
91
|
-
d: "M16 1A14.915 14.915 0 0 0 5.502 5.286l1.4 1.429A12.922 12.922 0 0 1 16 3.001c.977 0 1.929.109 2.845.315-3.402.921-5.916 4.026-5.916 7.715 0 .782.118 1.537.328 2.252a7.978 7.978 0 0 0-2.188-.312c-3.704 0-6.819 2.534-7.726 5.957a12.954 12.954 0 0 1-.345-2.927c0-2.117.492-4.134 1.462-5.996l-1.773-.924A15.037 15.037 0 0 0 .999 16c0 8.271 6.729 15 15 15 3.949 0 7.678-1.522 10.498-4.286l-1.4-1.428A12.926 12.926 0 0 1 15.999 29c-3.648 0-6.945-1.516-9.309-3.945a5.959 5.959 0 0 1-1.621-4.086c0-3.309 2.691-6 6-6a6.006 6.006 0 0 1 5.897 7.107l1.967.367a7.971 7.971 0 0 0-.192-3.726 7.976 7.976 0 0 0 2.187.312c3.71 0 6.829-2.542 7.73-5.974.22.947.34 1.931.34 2.944 0 2.117-.492 4.134-1.462 5.995l1.773.924a15.034 15.034 0 0 0 1.688-6.919C31 7.729 24.272 1 16 1zm4.93 16.03c-3.309 0-6-2.692-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z",
|
|
92
|
-
style: {
|
|
93
|
-
fill: "#fff",
|
|
94
|
-
strokeWidth: 0
|
|
95
|
-
}
|
|
96
|
-
}), React.createElement("path", {
|
|
97
|
-
style: {
|
|
98
|
-
fill: `url(#${a})`,
|
|
99
|
-
strokeWidth: 0
|
|
100
|
-
},
|
|
101
|
-
d: "M8 9 0 0h16l2.305 3.304L8 9z"
|
|
102
|
-
}), React.createElement("path", {
|
|
103
|
-
style: {
|
|
104
|
-
fill: `url(#${b})`,
|
|
105
|
-
strokeWidth: 0
|
|
106
|
-
},
|
|
107
|
-
d: "m12 31 4.386-9L6 21 2 31h10z"
|
|
108
|
-
}), React.createElement("path", {
|
|
109
|
-
style: {
|
|
110
|
-
fill: `url(#${c})`,
|
|
111
|
-
strokeWidth: 0
|
|
112
|
-
},
|
|
113
|
-
d: "m24 23 8 9H16l-2.304-3.305L24 23z"
|
|
114
|
-
}), React.createElement("path", {
|
|
115
|
-
style: {
|
|
116
|
-
strokeWidth: 0
|
|
117
|
-
},
|
|
118
|
-
d: "M16 31h-4.283L15 22h2l-1 9z"
|
|
119
|
-
}))), React.createElement("g", {
|
|
120
|
-
style: {
|
|
121
|
-
mask: `url(#${e})`
|
|
122
|
-
}
|
|
123
|
-
}, React.createElement("path", {
|
|
124
|
-
style: {
|
|
125
|
-
fill: `url(#${d})`,
|
|
126
|
-
strokeWidth: 0
|
|
127
|
-
},
|
|
128
|
-
d: "M0 0h32v32H0z"
|
|
129
|
-
})), React.createElement("circle", {
|
|
130
|
-
cx: "6",
|
|
131
|
-
cy: "6",
|
|
132
|
-
r: "2",
|
|
133
|
-
style: {
|
|
134
|
-
fill: "#001d6c",
|
|
135
|
-
strokeWidth: 0
|
|
136
|
-
}
|
|
137
|
-
}), React.createElement("circle", {
|
|
138
|
-
cx: "26",
|
|
139
|
-
cy: "26",
|
|
140
|
-
r: "2",
|
|
141
|
-
style: {
|
|
142
|
-
fill: "#001d6c",
|
|
143
|
-
strokeWidth: 0
|
|
144
|
-
}
|
|
145
|
-
}), React.createElement("path", {
|
|
146
|
-
d: "M16 31c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5zm0-8c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3z",
|
|
147
|
-
style: {
|
|
148
|
-
fill: "#001d6c",
|
|
149
|
-
strokeWidth: 0
|
|
150
|
-
}
|
|
151
|
-
}));
|
|
152
|
-
}
|
|
153
|
-
return React.createElement("svg", {
|
|
154
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
155
|
-
viewBox: "0 0 32 32",
|
|
156
|
-
className: "cds--watsonx-avatar",
|
|
157
|
-
"aria-hidden": "true"
|
|
158
|
-
}, React.createElement("defs", null, React.createElement("linearGradient", {
|
|
159
|
-
id: a,
|
|
160
|
-
x1: "1196.653",
|
|
161
|
-
y1: "2930.892",
|
|
162
|
-
x2: "1209.953",
|
|
163
|
-
y2: "2912.832",
|
|
164
|
-
gradientTransform: "matrix(.8312 .55596 -.27409 .40979 -188.767 -1860.755)",
|
|
165
|
-
gradientUnits: "userSpaceOnUse"
|
|
166
|
-
}, React.createElement("stop", {
|
|
167
|
-
offset: ".3"
|
|
168
|
-
}), React.createElement("stop", {
|
|
169
|
-
offset: "1",
|
|
170
|
-
stopOpacity: "0"
|
|
171
|
-
})), React.createElement("linearGradient", {
|
|
172
|
-
id: b,
|
|
173
|
-
x1: "1299.261",
|
|
174
|
-
y1: "2844.072",
|
|
175
|
-
x2: "1310.351",
|
|
176
|
-
y2: "2829.012",
|
|
177
|
-
gradientTransform: "rotate(146.223 440.869 -882.286) scale(1 -.493)",
|
|
178
|
-
gradientUnits: "userSpaceOnUse"
|
|
179
|
-
}, React.createElement("stop", {
|
|
180
|
-
offset: ".3"
|
|
181
|
-
}), React.createElement("stop", {
|
|
182
|
-
offset: ".9",
|
|
183
|
-
stopOpacity: "0"
|
|
184
|
-
})), React.createElement("linearGradient", {
|
|
185
|
-
id: c,
|
|
186
|
-
x1: "-4885.16",
|
|
187
|
-
y1: "-20230.559",
|
|
188
|
-
x2: "-4871.86",
|
|
189
|
-
y2: "-20248.618",
|
|
190
|
-
gradientTransform: "rotate(-146.223 -911.421 -5714.55) scale(1 .493)",
|
|
191
|
-
gradientUnits: "userSpaceOnUse"
|
|
192
|
-
}, React.createElement("stop", {
|
|
193
|
-
offset: ".32"
|
|
194
|
-
}), React.createElement("stop", {
|
|
195
|
-
offset: ".354",
|
|
196
|
-
stopOpacity: ".798"
|
|
197
|
-
}), React.createElement("stop", {
|
|
198
|
-
offset: ".7",
|
|
199
|
-
stopOpacity: "0"
|
|
200
|
-
})), React.createElement("linearGradient", {
|
|
201
|
-
id: d,
|
|
202
|
-
x1: "0",
|
|
203
|
-
y1: "32",
|
|
204
|
-
x2: "32",
|
|
205
|
-
y2: "0",
|
|
206
|
-
gradientUnits: "userSpaceOnUse"
|
|
207
|
-
}, React.createElement("stop", {
|
|
208
|
-
offset: ".1",
|
|
209
|
-
stopColor: "#be95ff"
|
|
210
|
-
}), React.createElement("stop", {
|
|
211
|
-
offset: ".9",
|
|
212
|
-
stopColor: "#4589ff"
|
|
213
|
-
})), React.createElement("mask", {
|
|
214
|
-
id: e,
|
|
215
|
-
x: "0",
|
|
216
|
-
y: "0",
|
|
217
|
-
width: "32",
|
|
218
|
-
height: "32",
|
|
219
|
-
maskUnits: "userSpaceOnUse"
|
|
220
|
-
}, React.createElement("path", {
|
|
221
|
-
d: "M16 1A14.915 14.915 0 0 0 5.502 5.286l1.4 1.429A12.922 12.922 0 0 1 16 3.001c.977 0 1.929.109 2.845.315-3.402.921-5.916 4.026-5.916 7.715 0 .782.118 1.537.328 2.252a7.978 7.978 0 0 0-2.188-.312c-3.704 0-6.819 2.534-7.726 5.957a12.954 12.954 0 0 1-.345-2.927c0-2.117.492-4.134 1.462-5.996l-1.773-.924A15.037 15.037 0 0 0 .999 16c0 8.271 6.729 15 15 15 3.949 0 7.678-1.522 10.498-4.286l-1.4-1.428A12.926 12.926 0 0 1 15.999 29c-3.648 0-6.945-1.516-9.309-3.945a5.959 5.959 0 0 1-1.621-4.086c0-3.309 2.691-6 6-6a6.006 6.006 0 0 1 5.897 7.107l1.967.367a7.971 7.971 0 0 0-.192-3.726 7.976 7.976 0 0 0 2.187.312c3.71 0 6.829-2.542 7.73-5.974.22.947.34 1.931.34 2.944 0 2.117-.492 4.134-1.462 5.995l1.773.924a15.034 15.034 0 0 0 1.688-6.919c0-8.271-6.729-15-15-15zm4.93 16.03c-3.309 0-6-2.692-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z",
|
|
222
|
-
style: {
|
|
223
|
-
fill: "#fff",
|
|
224
|
-
strokeWidth: 0
|
|
225
|
-
}
|
|
226
|
-
}), React.createElement("path", {
|
|
227
|
-
style: {
|
|
228
|
-
fill: `url(#${a})`,
|
|
229
|
-
strokeWidth: 0
|
|
230
|
-
},
|
|
231
|
-
d: "M8 9 0 0h16l2.305 3.305L8 9z"
|
|
232
|
-
}), React.createElement("path", {
|
|
233
|
-
style: {
|
|
234
|
-
fill: `url(#${b})`,
|
|
235
|
-
strokeWidth: 0
|
|
236
|
-
},
|
|
237
|
-
d: "m12 31 4.386-9L6 21 2 31h10z"
|
|
238
|
-
}), React.createElement("path", {
|
|
239
|
-
style: {
|
|
240
|
-
fill: `url(#${c})`,
|
|
241
|
-
strokeWidth: 0
|
|
242
|
-
},
|
|
243
|
-
d: "m24 23 8 9H16l-2.305-3.305L24 23z"
|
|
244
|
-
}), React.createElement("path", {
|
|
245
|
-
style: {
|
|
246
|
-
strokeWidth: 0
|
|
247
|
-
},
|
|
248
|
-
d: "M16 31h-4.283L15 22h2l-1 9z"
|
|
249
|
-
}))), React.createElement("g", {
|
|
250
|
-
style: {
|
|
251
|
-
mask: `url(#${e})`
|
|
252
|
-
}
|
|
253
|
-
}, React.createElement("path", {
|
|
254
|
-
style: {
|
|
255
|
-
fill: `url(#${d})`,
|
|
256
|
-
strokeWidth: 0
|
|
257
|
-
},
|
|
258
|
-
d: "M0 0h32v32H0z"
|
|
259
|
-
})), React.createElement("circle", {
|
|
260
|
-
cx: "6",
|
|
261
|
-
cy: "6",
|
|
262
|
-
r: "2",
|
|
263
|
-
style: {
|
|
264
|
-
fill: "#f4f4f4",
|
|
265
|
-
strokeWidth: 0
|
|
266
|
-
}
|
|
267
|
-
}), React.createElement("circle", {
|
|
268
|
-
cx: "26",
|
|
269
|
-
cy: "26",
|
|
270
|
-
r: "2",
|
|
271
|
-
style: {
|
|
272
|
-
fill: "#f4f4f4",
|
|
273
|
-
strokeWidth: 0
|
|
274
|
-
}
|
|
275
|
-
}), React.createElement("path", {
|
|
276
|
-
d: "M16 31c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5zm0-8c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3z",
|
|
277
|
-
style: {
|
|
278
|
-
fill: "#f4f4f4",
|
|
279
|
-
strokeWidth: 0
|
|
280
|
-
}
|
|
281
|
-
}));
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
const AvatarExport = React.memo(Avatar);
|
|
285
|
-
|
|
286
|
-
export { AvatarExport as Avatar };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { useSelector } from "react-redux";
|
|
4
|
-
|
|
5
|
-
import { useLanguagePack } from "../hooks/useLanguagePack.js";
|
|
6
|
-
|
|
7
|
-
import { useServiceManager } from "../hooks/useServiceManager.js";
|
|
8
|
-
|
|
9
|
-
import { selectInputState } from "../store/selectors.js";
|
|
10
|
-
|
|
11
|
-
import { THROW_ERROR } from "../utils/constants.js";
|
|
12
|
-
|
|
13
|
-
import { BodyMessageComponents as BodyMessageTypeComponentsExport } from "./responseTypes/util/BodyMessageComponents.js";
|
|
14
|
-
|
|
15
|
-
import { FooterButtonComponents } from "./responseTypes/util/FooterButtonComponents.js";
|
|
16
|
-
|
|
17
|
-
/*
|
|
18
|
-
* Copyright IBM Corp. 2025
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
|
-
* LICENSE file in the root directory of this source tree.
|
|
22
|
-
*
|
|
23
|
-
* @license
|
|
24
|
-
*/ function BodyWithFooterComponent({localMessageItem: localMessageItem, fullMessage: fullMessage, isMessageForInput: isMessageForInput, requestFocus: requestFocus}) {
|
|
25
|
-
const serviceManager = useServiceManager();
|
|
26
|
-
const languagePack = useLanguagePack();
|
|
27
|
-
const appConfig = useSelector(state => state.config);
|
|
28
|
-
const inputState = useSelector(selectInputState);
|
|
29
|
-
return React.createElement(React.Fragment, null, React.createElement(BodyMessageTypeComponentsExport, {
|
|
30
|
-
message: localMessageItem,
|
|
31
|
-
originalMessage: fullMessage,
|
|
32
|
-
languagePack: languagePack,
|
|
33
|
-
requestInputFocus: requestFocus,
|
|
34
|
-
disableUserInputs: inputState.isReadonly,
|
|
35
|
-
config: appConfig,
|
|
36
|
-
isMessageForInput: isMessageForInput,
|
|
37
|
-
scrollElementIntoView: THROW_ERROR,
|
|
38
|
-
serviceManager: serviceManager,
|
|
39
|
-
hideFeedback: true,
|
|
40
|
-
allowNewFeedback: false
|
|
41
|
-
}), React.createElement(FooterButtonComponents, {
|
|
42
|
-
message: localMessageItem,
|
|
43
|
-
originalMessage: fullMessage,
|
|
44
|
-
languagePack: languagePack,
|
|
45
|
-
requestInputFocus: requestFocus,
|
|
46
|
-
disableUserInputs: inputState.isReadonly,
|
|
47
|
-
config: appConfig,
|
|
48
|
-
isMessageForInput: isMessageForInput,
|
|
49
|
-
scrollElementIntoView: THROW_ERROR,
|
|
50
|
-
serviceManager: serviceManager,
|
|
51
|
-
hideFeedback: true,
|
|
52
|
-
allowNewFeedback: false
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { BodyWithFooterComponent };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import Restart from "@carbon/icons-react/es/Restart.js";
|
|
2
|
-
|
|
3
|
-
import { unstable__ChatButton } from "@carbon/react";
|
|
4
|
-
|
|
5
|
-
import cx from "classnames";
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
|
|
9
|
-
import { useIntl } from "react-intl";
|
|
10
|
-
|
|
11
|
-
import { useSelector } from "react-redux";
|
|
12
|
-
|
|
13
|
-
import { ErrorMessageDark } from "./ErrorMessageDark.js";
|
|
14
|
-
|
|
15
|
-
import { ErrorMessageLight } from "./ErrorMessageLight.js";
|
|
16
|
-
|
|
17
|
-
import { BotHeader as BotHeaderExport } from "./header/BotHeader.js";
|
|
18
|
-
|
|
19
|
-
import { RichText as RichTextExport } from "./responseTypes/util/RichText.js";
|
|
20
|
-
|
|
21
|
-
import { ButtonSizeEnum, ButtonKindEnum } from "../../../types/utilities/carbonTypes.js";
|
|
22
|
-
|
|
23
|
-
import { OverlayPanelName } from "./OverlayPanel.js";
|
|
24
|
-
|
|
25
|
-
import { CarbonTheme } from "../../../types/config/PublicConfig.js";
|
|
26
|
-
|
|
27
|
-
/*
|
|
28
|
-
* Copyright IBM Corp. 2025
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
31
|
-
* LICENSE file in the root directory of this source tree.
|
|
32
|
-
*
|
|
33
|
-
* @license
|
|
34
|
-
*/ function CatastrophicError({onClose: onClose, languagePack: languagePack, onRestart: onRestart, showHeader: showHeader, botName: botName, headerDisplayName: headerDisplayName}) {
|
|
35
|
-
const intl = useIntl();
|
|
36
|
-
const carbonTheme = useSelector(state => state.theme.carbonTheme);
|
|
37
|
-
const isDarkTheme = carbonTheme === CarbonTheme.G90 || carbonTheme === CarbonTheme.G100;
|
|
38
|
-
const errorKey = "errors_communicating";
|
|
39
|
-
const errorBodyText = intl.formatMessage({
|
|
40
|
-
id: errorKey
|
|
41
|
-
}, {
|
|
42
|
-
botName: botName
|
|
43
|
-
});
|
|
44
|
-
return React.createElement("div", {
|
|
45
|
-
className: "WAC"
|
|
46
|
-
}, showHeader && React.createElement(BotHeaderExport, {
|
|
47
|
-
headerDisplayName: headerDisplayName,
|
|
48
|
-
onClose: onClose,
|
|
49
|
-
onToggleHomeScreen: null,
|
|
50
|
-
includeWriteableElement: false,
|
|
51
|
-
testIdPrefix: OverlayPanelName.CATASTROPHIC
|
|
52
|
-
}), React.createElement("div", {
|
|
53
|
-
className: cx("WACCatastrophicError", "WACPanelContent", {
|
|
54
|
-
"WACCatastrophicError--withHeader": showHeader
|
|
55
|
-
})
|
|
56
|
-
}, React.createElement("div", {
|
|
57
|
-
className: "WACCatastrophicError__ErrorTextContainer"
|
|
58
|
-
}, isDarkTheme && React.createElement(ErrorMessageDark, null), !isDarkTheme && React.createElement(ErrorMessageLight, null), React.createElement("div", {
|
|
59
|
-
className: "WACCatastrophicError__ErrorHeading"
|
|
60
|
-
}, languagePack.errors_somethingWrong), React.createElement("div", {
|
|
61
|
-
className: "WACCatastrophicError__ErrorBody"
|
|
62
|
-
}, React.createElement(RichTextExport, {
|
|
63
|
-
text: errorBodyText
|
|
64
|
-
})), onRestart && React.createElement(unstable__ChatButton, {
|
|
65
|
-
className: "WACCatastrophicError__RestartButton",
|
|
66
|
-
kind: ButtonKindEnum.TERTIARY,
|
|
67
|
-
size: ButtonSizeEnum.SMALL,
|
|
68
|
-
"aria-label": languagePack.buttons_restart,
|
|
69
|
-
onClick: onRestart,
|
|
70
|
-
renderIcon: Restart,
|
|
71
|
-
type: "button"
|
|
72
|
-
}, languagePack.buttons_retry))));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const CatastrophicErrorExport = React.memo(CatastrophicError);
|
|
76
|
-
|
|
77
|
-
export { CatastrophicErrorExport as CatastrophicError };
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import React, { Component } from "react";
|
|
2
|
-
|
|
3
|
-
import { injectIntl } from "react-intl";
|
|
4
|
-
|
|
5
|
-
import { useSelector } from "react-redux";
|
|
6
|
-
|
|
7
|
-
import MessagesComponent from "../containers/MessagesComponent.js";
|
|
8
|
-
|
|
9
|
-
import "../utils/constants.js";
|
|
10
|
-
|
|
11
|
-
import { doFocusRef, focusOnFirstFocusableItemInArrayOfElements } from "../utils/domUtils.js";
|
|
12
|
-
|
|
13
|
-
import { createUnmappingMemoizer } from "../utils/memoizerUtils.js";
|
|
14
|
-
|
|
15
|
-
import { consoleError, createDidCatchErrorData } from "../utils/miscUtils.js";
|
|
16
|
-
|
|
17
|
-
import { CatastrophicError as CatastrophicErrorExport } from "./CatastrophicError.js";
|
|
18
|
-
|
|
19
|
-
import { BotHeader as BotHeaderExport } from "./header/BotHeader.js";
|
|
20
|
-
|
|
21
|
-
import { Input as InputExport } from "./input/Input.js";
|
|
22
|
-
|
|
23
|
-
import { EndAgentChatModal } from "./modals/EndAgentChatModal.js";
|
|
24
|
-
|
|
25
|
-
import { RequestScreenShareModal } from "./modals/RequestScreenShareModal.js";
|
|
26
|
-
|
|
27
|
-
import WriteableElement from "./WriteableElement.js";
|
|
28
|
-
|
|
29
|
-
import { OverlayPanelName } from "./OverlayPanel.js";
|
|
30
|
-
|
|
31
|
-
import { WriteableElementName } from "../../../types/instance/ChatInstance.js";
|
|
32
|
-
|
|
33
|
-
/*
|
|
34
|
-
* Copyright IBM Corp. 2025
|
|
35
|
-
*
|
|
36
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
37
|
-
* LICENSE file in the root directory of this source tree.
|
|
38
|
-
*
|
|
39
|
-
* @license
|
|
40
|
-
*/ class Chat extends Component {
|
|
41
|
-
constructor() {
|
|
42
|
-
super(...arguments);
|
|
43
|
-
this.state = {
|
|
44
|
-
showEndChatConfirmation: false,
|
|
45
|
-
hasCaughtError: false
|
|
46
|
-
};
|
|
47
|
-
this.inputRef = React.createRef();
|
|
48
|
-
this.headerRef = React.createRef();
|
|
49
|
-
this.messagesRef = React.createRef();
|
|
50
|
-
this.messagesToArray = createUnmappingMemoizer();
|
|
51
|
-
this.hideConfirmEndChat = () => {
|
|
52
|
-
this.setState({
|
|
53
|
-
showEndChatConfirmation: false
|
|
54
|
-
});
|
|
55
|
-
setTimeout(() => {
|
|
56
|
-
this.requestInputFocus();
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
this.showConfirmEndChat = () => {
|
|
60
|
-
this.setState({
|
|
61
|
-
showEndChatConfirmation: true
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
this.confirmAgentEndChat = () => {
|
|
65
|
-
this.hideConfirmEndChat();
|
|
66
|
-
this.props.serviceManager.humanAgentService.endChat(true);
|
|
67
|
-
};
|
|
68
|
-
this.requestDefaultFocus = () => {
|
|
69
|
-
if (!this.headerRef?.current?.requestFocus()) {
|
|
70
|
-
doFocusRef(this.messagesRef.current?.scrollHandleRef);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
this.requestInputFocus = () => {
|
|
74
|
-
const {agentDisplayState: agentDisplayState} = this.props;
|
|
75
|
-
try {
|
|
76
|
-
if (agentDisplayState.isConnectingOrConnected && agentDisplayState.disableInput) {
|
|
77
|
-
if (this.messagesRef.current.requestAgentBannerFocus()) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (this.inputRef.current) {
|
|
82
|
-
if (this.props.inputState.fieldVisible && !this.shouldDisableInput()) {
|
|
83
|
-
this.inputRef.current.takeFocus();
|
|
84
|
-
} else {
|
|
85
|
-
const htmlElements = this.messagesRef.current.getLastOutputMessageElements();
|
|
86
|
-
if (!focusOnFirstFocusableItemInArrayOfElements(htmlElements)) {
|
|
87
|
-
this.requestDefaultFocus();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
} else {
|
|
91
|
-
this.requestDefaultFocus();
|
|
92
|
-
}
|
|
93
|
-
} catch (error) {
|
|
94
|
-
consoleError("An error occurred in Chat.requestInputFocus", error);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
this.doAutoScroll = options => {
|
|
98
|
-
this.messagesRef.current?.doAutoScroll(options);
|
|
99
|
-
};
|
|
100
|
-
this.getMessagesScrollBottom = () => this.messagesRef?.current?.getContainerScrollBottom();
|
|
101
|
-
this.onFilesSelectedForUpload = uploads => {
|
|
102
|
-
const isInputToAgent = this.props.agentDisplayState.isConnectingOrConnected;
|
|
103
|
-
if (isInputToAgent) {
|
|
104
|
-
this.props.serviceManager.humanAgentService.filesSelectedForUpload(uploads);
|
|
105
|
-
if (!this.props.inputState.allowMultipleFileUploads) {
|
|
106
|
-
this.requestInputFocus();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
async scrollOnHydrationComplete() {
|
|
112
|
-
this.doAutoScroll();
|
|
113
|
-
}
|
|
114
|
-
componentDidMount() {
|
|
115
|
-
if (this.props.isHydrationAnimationComplete) {
|
|
116
|
-
setTimeout(() => {
|
|
117
|
-
this.scrollOnHydrationComplete();
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
componentDidUpdate(prevProps) {
|
|
122
|
-
const {isHydrationAnimationComplete: isHydrationAnimationComplete, agentState: agentState} = this.props;
|
|
123
|
-
if (isHydrationAnimationComplete && !prevProps.isHydrationAnimationComplete) {
|
|
124
|
-
setTimeout(() => {
|
|
125
|
-
this.scrollOnHydrationComplete();
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
const connectingChanged = agentState.isConnecting !== prevProps.agentState.isConnecting;
|
|
129
|
-
if (this.state.showEndChatConfirmation && connectingChanged) {
|
|
130
|
-
this.hideConfirmEndChat();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
componentDidCatch(error, errorInfo) {
|
|
134
|
-
this.props.serviceManager.actions.errorOccurred(createDidCatchErrorData("Chat", error, errorInfo));
|
|
135
|
-
this.setState({
|
|
136
|
-
hasCaughtError: true
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
doScrollToMessage(messageID, animate = true) {
|
|
140
|
-
this.messagesRef.current?.doScrollToMessage(messageID, animate);
|
|
141
|
-
}
|
|
142
|
-
getMessageInput() {
|
|
143
|
-
return this.inputRef.current?.getMessageInput();
|
|
144
|
-
}
|
|
145
|
-
shouldDisableInput() {
|
|
146
|
-
return this.props.inputState.isReadonly || this.props.agentDisplayState.disableInput;
|
|
147
|
-
}
|
|
148
|
-
shouldDisableSend() {
|
|
149
|
-
const {isHydrated: isHydrated} = this.props;
|
|
150
|
-
return this.shouldDisableInput() || !isHydrated;
|
|
151
|
-
}
|
|
152
|
-
renderMessagesAndInput() {
|
|
153
|
-
const {languagePack: languagePack, messageState: messageState, intl: intl, allMessageItemsByID: allMessageItemsByID, isHydrated: isHydrated, serviceManager: serviceManager, inputState: inputState, onUserTyping: onUserTyping, agentState: agentState, botName: botName, onSendInput: onSendInput, locale: locale, useAITheme: useAITheme, carbonTheme: carbonTheme, agentDisplayState: agentDisplayState} = this.props;
|
|
154
|
-
const {fieldVisible: fieldVisible, files: files, allowFileUploads: allowFileUploads, allowedFileUploadTypes: allowedFileUploadTypes, allowMultipleFileUploads: allowMultipleFileUploads, stopStreamingButtonState: stopStreamingButtonState} = inputState;
|
|
155
|
-
const {fileUploadInProgress: fileUploadInProgress} = agentState;
|
|
156
|
-
const {inputPlaceholderKey: inputPlaceholderKey} = agentDisplayState;
|
|
157
|
-
const numFiles = files?.length ?? 0;
|
|
158
|
-
const anyCurrentFiles = numFiles > 0 || fileUploadInProgress;
|
|
159
|
-
const showUploadButtonDisabled = anyCurrentFiles && !allowMultipleFileUploads;
|
|
160
|
-
return React.createElement(React.Fragment, null, isHydrated && React.createElement("div", {
|
|
161
|
-
className: "WACMessagesContainer__NonInputContainer"
|
|
162
|
-
}, React.createElement(MessagesComponent, {
|
|
163
|
-
ref: this.messagesRef,
|
|
164
|
-
messageState: messageState,
|
|
165
|
-
localMessageItems: this.messagesToArray(messageState.localMessageIDs, allMessageItemsByID),
|
|
166
|
-
requestInputFocus: this.requestInputFocus,
|
|
167
|
-
botName: botName,
|
|
168
|
-
intl: intl,
|
|
169
|
-
onEndAgentChat: this.showConfirmEndChat,
|
|
170
|
-
locale: locale,
|
|
171
|
-
useAITheme: useAITheme,
|
|
172
|
-
carbonTheme: carbonTheme
|
|
173
|
-
})), React.createElement(WriteableElement, {
|
|
174
|
-
slotName: WriteableElementName.BEFORE_INPUT_ELEMENT,
|
|
175
|
-
id: `beforeInputElement${serviceManager.namespace.suffix}`
|
|
176
|
-
}), React.createElement(InputExport, {
|
|
177
|
-
ref: this.inputRef,
|
|
178
|
-
languagePack: languagePack,
|
|
179
|
-
serviceManager: serviceManager,
|
|
180
|
-
disableInput: this.shouldDisableInput(),
|
|
181
|
-
disableSend: this.shouldDisableSend(),
|
|
182
|
-
isInputVisible: fieldVisible,
|
|
183
|
-
onSendInput: onSendInput,
|
|
184
|
-
onUserTyping: onUserTyping,
|
|
185
|
-
showUploadButton: allowFileUploads,
|
|
186
|
-
disableUploadButton: showUploadButtonDisabled,
|
|
187
|
-
allowedFileUploadTypes: allowedFileUploadTypes,
|
|
188
|
-
allowMultipleFileUploads: allowMultipleFileUploads,
|
|
189
|
-
pendingUploads: files,
|
|
190
|
-
onFilesSelectedForUpload: this.onFilesSelectedForUpload,
|
|
191
|
-
placeholder: languagePack[inputPlaceholderKey],
|
|
192
|
-
isStopStreamingButtonVisible: stopStreamingButtonState.isVisible,
|
|
193
|
-
isStopStreamingButtonDisabled: stopStreamingButtonState.isDisabled,
|
|
194
|
-
testIdPrefix: OverlayPanelName.MAIN
|
|
195
|
-
}), this.state.showEndChatConfirmation && React.createElement(EndAgentChatModal, {
|
|
196
|
-
onConfirm: this.confirmAgentEndChat,
|
|
197
|
-
onCancel: this.hideConfirmEndChat
|
|
198
|
-
}), this.props.agentState.showScreenShareRequest && React.createElement(RequestScreenShareModal, null));
|
|
199
|
-
}
|
|
200
|
-
render() {
|
|
201
|
-
const {languagePack: languagePack, onClose: onClose, onCloseAndRestart: onCloseAndRestart, onRestart: onRestart, onToggleHomeScreen: onToggleHomeScreen, botName: botName, headerDisplayName: headerDisplayName, headerAvatarConfig: headerAvatarConfig} = this.props;
|
|
202
|
-
const {hasCaughtError: hasCaughtError} = this.state;
|
|
203
|
-
const className = "WAC";
|
|
204
|
-
return React.createElement("div", {
|
|
205
|
-
className: className
|
|
206
|
-
}, React.createElement(BotHeaderExport, {
|
|
207
|
-
ref: this.headerRef,
|
|
208
|
-
onClose: onClose,
|
|
209
|
-
onCloseAndRestart: onCloseAndRestart,
|
|
210
|
-
onRestart: onRestart,
|
|
211
|
-
headerDisplayName: headerDisplayName,
|
|
212
|
-
headerAvatarConfig: headerAvatarConfig,
|
|
213
|
-
onToggleHomeScreen: onToggleHomeScreen,
|
|
214
|
-
enableChatHeaderConfig: true,
|
|
215
|
-
includeWriteableElement: true,
|
|
216
|
-
testIdPrefix: OverlayPanelName.MAIN
|
|
217
|
-
}), React.createElement(NonHeaderBackground, null), React.createElement("div", {
|
|
218
|
-
className: "WACPanelContent WAC__ChatNonHeaderContainer"
|
|
219
|
-
}, hasCaughtError && React.createElement("div", {
|
|
220
|
-
className: "WAC__MessagesErrorHandler"
|
|
221
|
-
}, React.createElement(CatastrophicErrorExport, {
|
|
222
|
-
languagePack: languagePack,
|
|
223
|
-
onRestart: onRestart,
|
|
224
|
-
showHeader: false,
|
|
225
|
-
botName: botName,
|
|
226
|
-
headerDisplayName: headerDisplayName
|
|
227
|
-
})), !hasCaughtError && React.createElement("div", {
|
|
228
|
-
className: "WAC__messagesAndInputContainer"
|
|
229
|
-
}, this.renderMessagesAndInput())));
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
function NonHeaderBackground() {
|
|
234
|
-
const isVisible = useSelector(state => state.showNonHeaderBackgroundCover);
|
|
235
|
-
return isVisible ? React.createElement("div", {
|
|
236
|
-
className: "WACBackgroundCover WACBackgroundCover__NonHeader"
|
|
237
|
-
}) : null;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
var Chat$1 = injectIntl(Chat, {
|
|
241
|
-
forwardRef: true
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
export { Chat as ChatClass, Chat$1 as default };
|