@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
|
@@ -2,7 +2,14 @@ import cx from "classnames";
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/*
|
|
6
|
+
* Copyright IBM Corp. 2025
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*
|
|
11
|
+
* @license
|
|
12
|
+
*/ const HideComponentContext = React.createContext(false);
|
|
6
13
|
|
|
7
14
|
/*
|
|
8
15
|
* Copyright IBM Corp. 2025
|
|
@@ -23,4 +30,4 @@ import { HideComponentContext } from "../../contexts/HideComponentContext.js";
|
|
|
23
30
|
}, children));
|
|
24
31
|
}
|
|
25
32
|
|
|
26
|
-
export { HideComponent };
|
|
33
|
+
export { HideComponent as H, HideComponentContext as a };
|
package/dist/es/{chat/shared/components/homeScreen/HomeScreen.js → chat.HomeScreenContainer.js}
RENAMED
|
@@ -1,34 +1,128 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
|
|
3
|
+
import { useSelector } from "react-redux";
|
|
4
|
+
|
|
5
|
+
import { u as useServiceManager, b as usePrevious } from "./chat.usePrevious.js";
|
|
6
|
+
|
|
7
|
+
import { O as OverlayPanelName, a as OverlayPanel, A as AnimationOutType, b as AnimationInType } from "./chat.PageObjectId.js";
|
|
8
|
+
|
|
1
9
|
import ArrowRight from "@carbon/icons-react/es/ArrowRight.js";
|
|
2
10
|
|
|
3
11
|
import { unstable__ChatButton } from "@carbon/react";
|
|
4
12
|
|
|
5
13
|
import cx from "classnames";
|
|
6
14
|
|
|
7
|
-
import
|
|
15
|
+
import { u as useLanguagePack } from "./chat.AppState.js";
|
|
8
16
|
|
|
9
|
-
import {
|
|
17
|
+
import { B as BrandColorKind } from "./chat.constants.js";
|
|
18
|
+
|
|
19
|
+
import { I as InputExport } from "./chat.Input.js";
|
|
20
|
+
|
|
21
|
+
import { a as WriteableElement } from "./chat.Header.js";
|
|
22
|
+
|
|
23
|
+
import { H as HomeScreenHeaderExport } from "./chat.HomeScreenHeader.js";
|
|
24
|
+
|
|
25
|
+
import { H as HomeScreenBackgroundType } from "./chat.HomeScreenConfig.js";
|
|
26
|
+
|
|
27
|
+
import { a as ButtonKindEnum, B as ButtonSizeEnum } from "./chat.carbonTypes.js";
|
|
28
|
+
|
|
29
|
+
import { W as WriteableElementName } from "./chat.dynamic-imports.js";
|
|
30
|
+
|
|
31
|
+
import { T as THREAD_ID_MAIN } from "./chat.messageUtils.js";
|
|
32
|
+
|
|
33
|
+
import "compute-scroll-into-view";
|
|
34
|
+
|
|
35
|
+
import "memoize-one";
|
|
36
|
+
|
|
37
|
+
import "tabbable";
|
|
38
|
+
|
|
39
|
+
import "./chat.browserUtils.js";
|
|
40
|
+
|
|
41
|
+
import "detect-browser";
|
|
42
|
+
|
|
43
|
+
import "./chat.HideComponent.js";
|
|
44
|
+
|
|
45
|
+
import "@carbon/icons-react/es/Attachment.js";
|
|
46
|
+
|
|
47
|
+
import "@carbon/icons-react/es/Send.js";
|
|
48
|
+
|
|
49
|
+
import "@carbon/icons-react/es/SendFilled.js";
|
|
50
|
+
|
|
51
|
+
import "@lit/react";
|
|
52
|
+
|
|
53
|
+
import "tslib";
|
|
54
|
+
|
|
55
|
+
import "./chat.customElement.js";
|
|
56
|
+
|
|
57
|
+
import "@carbon/web-components/es-custom/components/icon-button/index.js";
|
|
58
|
+
|
|
59
|
+
import "@carbon/icon-helpers";
|
|
60
|
+
|
|
61
|
+
import "@carbon/icons/es/stop--filled/16.js";
|
|
62
|
+
|
|
63
|
+
import "lit";
|
|
64
|
+
|
|
65
|
+
import "lit/directives/unsafe-svg.js";
|
|
66
|
+
|
|
67
|
+
import "bind-decorator";
|
|
10
68
|
|
|
11
|
-
import
|
|
69
|
+
import "lit/decorators.js";
|
|
12
70
|
|
|
13
|
-
import
|
|
71
|
+
import "./chat.useCounter.js";
|
|
14
72
|
|
|
15
|
-
import
|
|
73
|
+
import "./chat.actions.js";
|
|
16
74
|
|
|
17
|
-
import
|
|
75
|
+
import "./chat.uuid.js";
|
|
18
76
|
|
|
19
|
-
import
|
|
77
|
+
import "uuid";
|
|
20
78
|
|
|
21
|
-
import
|
|
79
|
+
import "./chat.selectors.js";
|
|
22
80
|
|
|
23
|
-
import
|
|
81
|
+
import "./chat.miscUtils.js";
|
|
24
82
|
|
|
25
|
-
import
|
|
83
|
+
import "@carbon/web-components/es-custom/components/slug/index.js";
|
|
26
84
|
|
|
27
|
-
import
|
|
85
|
+
import "@carbon/icons-react/es/Close.js";
|
|
28
86
|
|
|
29
|
-
import
|
|
87
|
+
import "@carbon/icons-react/es/CloseLarge.js";
|
|
30
88
|
|
|
31
|
-
import
|
|
89
|
+
import "@carbon/icons-react/es/DownToBottom.js";
|
|
90
|
+
|
|
91
|
+
import "@carbon/icons-react/es/Menu.js";
|
|
92
|
+
|
|
93
|
+
import "@carbon/icons-react/es/Restart.js";
|
|
94
|
+
|
|
95
|
+
import "@carbon/icons-react/es/SidePanelClose.js";
|
|
96
|
+
|
|
97
|
+
import "@carbon/icons-react/es/SubtractLarge.js";
|
|
98
|
+
|
|
99
|
+
import "@carbon/web-components/es-custom/components/ai-label/defs.js";
|
|
100
|
+
|
|
101
|
+
import "@carbon/web-components/es-custom/components/popover/defs.js";
|
|
102
|
+
|
|
103
|
+
import "@carbon/web-components/es-custom/components/skeleton-icon/index.js";
|
|
104
|
+
|
|
105
|
+
import "@carbon/web-components/es-custom/components/button/index.js";
|
|
106
|
+
|
|
107
|
+
import "@carbon/web-components/es-custom/components/overflow-menu/index.js";
|
|
108
|
+
|
|
109
|
+
import "@carbon/icons-react/es/ChevronDown.js";
|
|
110
|
+
|
|
111
|
+
import "@carbon/icons-react/es/ChevronUp.js";
|
|
112
|
+
|
|
113
|
+
import "@floating-ui/react";
|
|
114
|
+
|
|
115
|
+
import "focus-trap-react";
|
|
116
|
+
|
|
117
|
+
import "react-dom";
|
|
118
|
+
|
|
119
|
+
import "@carbon/web-components/es-custom/components/ai-label/ai-label-action-button.js";
|
|
120
|
+
|
|
121
|
+
import "@carbon/web-components/es-custom/components/ai-label/ai-label.js";
|
|
122
|
+
|
|
123
|
+
import "lodash-es/cloneDeep.js";
|
|
124
|
+
|
|
125
|
+
import "./chat.Messages.js";
|
|
32
126
|
|
|
33
127
|
/*
|
|
34
128
|
* Copyright IBM Corp. 2025
|
|
@@ -132,4 +226,55 @@ import { WriteableElementName } from "../../../../types/instance/ChatInstance.js
|
|
|
132
226
|
|
|
133
227
|
const HomeScreenExport = React.memo(HomeScreenComponent);
|
|
134
228
|
|
|
135
|
-
|
|
229
|
+
/*
|
|
230
|
+
* Copyright IBM Corp. 2025
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
233
|
+
* LICENSE file in the root directory of this source tree.
|
|
234
|
+
*
|
|
235
|
+
* @license
|
|
236
|
+
*/ function HomeScreenContainer({onClose: onClose, onCloseAndRestart: onCloseAndRestart, onPanelCloseStart: onPanelCloseStart, onPanelOpenStart: onPanelOpenStart, onPanelCloseEnd: onPanelCloseEnd, onPanelOpenEnd: onPanelOpenEnd, onSendBotInput: onSendBotInput, onSendButtonInput: onSendButtonInput, onRestart: onRestart, showHomeScreen: showHomeScreen, isHydrationAnimationComplete: isHydrationAnimationComplete, homeScreenInputRef: homeScreenInputRef, onToggleHomeScreen: onToggleHomeScreen}) {
|
|
237
|
+
const serviceManager = useServiceManager();
|
|
238
|
+
const homeScreenConfig = useSelector(state => state.homeScreenConfig);
|
|
239
|
+
const isCustomPanelOpen = useSelector(state => state.customPanelState.isOpen);
|
|
240
|
+
const prevIsHydrationAnimationComplete = usePrevious(isHydrationAnimationComplete);
|
|
241
|
+
const shouldHide = isCustomPanelOpen;
|
|
242
|
+
const subsequentRender = showHomeScreen && isHydrationAnimationComplete && prevIsHydrationAnimationComplete;
|
|
243
|
+
const handleSendInput = useCallback(text => {
|
|
244
|
+
onSendBotInput(text);
|
|
245
|
+
}, [ onSendBotInput ]);
|
|
246
|
+
const handlerStarterClick = useCallback(starter => {
|
|
247
|
+
onSendButtonInput({
|
|
248
|
+
label: starter.label,
|
|
249
|
+
value: {
|
|
250
|
+
input: {
|
|
251
|
+
text: starter.label
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}, THREAD_ID_MAIN);
|
|
255
|
+
}, [ onSendButtonInput ]);
|
|
256
|
+
return React.createElement(OverlayPanel, {
|
|
257
|
+
onOpenStart: onPanelOpenStart,
|
|
258
|
+
onOpenEnd: onPanelOpenEnd,
|
|
259
|
+
onCloseStart: onPanelCloseStart,
|
|
260
|
+
onCloseEnd: onPanelCloseEnd,
|
|
261
|
+
animationOnOpen: subsequentRender ? AnimationInType.FADE_IN : AnimationInType.NONE,
|
|
262
|
+
animationOnClose: AnimationOutType.FADE_OUT,
|
|
263
|
+
shouldOpen: showHomeScreen,
|
|
264
|
+
shouldHide: shouldHide,
|
|
265
|
+
serviceManager: serviceManager,
|
|
266
|
+
overlayPanelName: OverlayPanelName.HOME_SCREEN
|
|
267
|
+
}, React.createElement(HomeScreenExport, {
|
|
268
|
+
isHydrated: isHydrationAnimationComplete,
|
|
269
|
+
homeScreenMessageInputRef: homeScreenInputRef,
|
|
270
|
+
homeScreenConfig: homeScreenConfig,
|
|
271
|
+
onSendInput: handleSendInput,
|
|
272
|
+
onStarterClick: handlerStarterClick,
|
|
273
|
+
onClose: onClose,
|
|
274
|
+
onCloseAndRestart: onCloseAndRestart,
|
|
275
|
+
onRestart: onRestart,
|
|
276
|
+
onToggleHomeScreen: onToggleHomeScreen
|
|
277
|
+
}));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export { HomeScreenContainer, HomeScreenContainer as default };
|
package/dist/es/{chat/shared/components/homeScreen/HomeScreenHeader.js → chat.HomeScreenHeader.js}
RENAMED
|
@@ -2,9 +2,9 @@ import React, { forwardRef, useRef, useImperativeHandle, useCallback } from "rea
|
|
|
2
2
|
|
|
3
3
|
import { useSelector } from "react-redux";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { H as HeaderExport } from "./chat.Header.js";
|
|
6
6
|
|
|
7
|
-
import { OverlayPanelName } from "
|
|
7
|
+
import { O as OverlayPanelName } from "./chat.PageObjectId.js";
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* Copyright IBM Corp. 2025
|
|
@@ -49,4 +49,4 @@ import { OverlayPanelName } from "../OverlayPanel.js";
|
|
|
49
49
|
|
|
50
50
|
const HomeScreenHeaderExport = React.memo(forwardRef(HomeScreenHeader));
|
|
51
51
|
|
|
52
|
-
export { HomeScreenHeaderExport as
|
|
52
|
+
export { HomeScreenHeaderExport as H };
|
package/dist/es/{chat/shared/services/haa/HumanAgentServiceImpl.js → chat.HumanAgentServiceImpl.js}
RENAMED
|
@@ -2,37 +2,235 @@ import cloneDeep from "lodash-es/cloneDeep.js";
|
|
|
2
2
|
|
|
3
3
|
import merge from "lodash-es/merge.js";
|
|
4
4
|
|
|
5
|
-
import inputItemToLocalItem from "
|
|
5
|
+
import { d as deepFreeze, o as outputItemToLocalItem, u as updateFilesUploadInProgress, t as setIsConnecting, v as endChat, i as inputItemToLocalItem, b as createLocalMessageForInlineError, w as setIsScreenSharing, x as setIsReconnecting, y as setShowScreenShareRequest, z as updateCapabilities, A as setAgentAvailability, B as setAgentJoined, C as agentUpdateIsTyping, D as setAgentLeftChat, r as resolvablePromise, E as setPersistedServiceDeskState } from "./chat.resolvablePromise.js";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { a as actions } from "./chat.actions.js";
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import { E as ErrorType, S as ScreenShareState, M as MessageErrorState, A as AgentsOnlineStatus } from "./chat.LocalMessageItem.js";
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import "./chat.constants.js";
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { e as debugLog, b as consoleError, r as resolveOrTimeout } from "./chat.miscUtils.js";
|
|
14
14
|
|
|
15
|
-
import "
|
|
15
|
+
import { q as asyncForEach, I as createMessageResponseForItem, j as createMessageRequestForText, J as createMessageRequestForFileUpload, l as createMessageResponseForText, k as addDefaultsToMessage } from "./chat.messageUtils.js";
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { B as BusEventType } from "./chat.customElement.js";
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import { e as conditionalSetTimeout } from "./chat.browserUtils.js";
|
|
20
20
|
|
|
21
|
-
import {
|
|
21
|
+
import { A as AgentMessageType, b as MessageResponseTypes } from "./chat.Messages.js";
|
|
22
22
|
|
|
23
|
-
import {
|
|
23
|
+
import { F as FileStatusValue } from "./chat.dynamic-imports.js";
|
|
24
24
|
|
|
25
|
-
import
|
|
25
|
+
import "./chat.uuid.js";
|
|
26
26
|
|
|
27
|
-
import
|
|
27
|
+
import "uuid";
|
|
28
28
|
|
|
29
|
-
import
|
|
29
|
+
import "detect-browser";
|
|
30
30
|
|
|
31
|
-
import
|
|
31
|
+
import "memoize-one";
|
|
32
32
|
|
|
33
|
-
import
|
|
33
|
+
import "react";
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
/*
|
|
36
|
+
* Copyright IBM Corp. 2025
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
39
|
+
* LICENSE file in the root directory of this source tree.
|
|
40
|
+
*
|
|
41
|
+
* @license
|
|
42
|
+
*/ function getAgentStatusMessageText(agentMessageType, agentProfile, intl) {
|
|
43
|
+
const name = agentProfile?.nickname;
|
|
44
|
+
let messageKey;
|
|
45
|
+
switch (agentMessageType) {
|
|
46
|
+
case AgentMessageType.AGENT_JOINED:
|
|
47
|
+
{
|
|
48
|
+
messageKey = name ? "agent_agentJoinedName" : "agent_agentJoinedNoName";
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
case AgentMessageType.RELOAD_WARNING:
|
|
53
|
+
{
|
|
54
|
+
messageKey = "agent_youConnectedWarning";
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
case AgentMessageType.AGENT_LEFT_CHAT:
|
|
59
|
+
{
|
|
60
|
+
messageKey = name ? "agent_agentLeftChat" : "agent_agentLeftChatNoName";
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
case AgentMessageType.AGENT_ENDED_CHAT:
|
|
65
|
+
{
|
|
66
|
+
messageKey = name ? "agent_agentEndedChat" : "agent_agentEndedChatNoName";
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
case AgentMessageType.TRANSFER_TO_AGENT:
|
|
71
|
+
{
|
|
72
|
+
messageKey = name ? "agent_transferring" : "agent_transferringNoName";
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
case AgentMessageType.USER_ENDED_CHAT:
|
|
77
|
+
{
|
|
78
|
+
messageKey = "agent_youEndedChat";
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
case AgentMessageType.CHAT_WAS_ENDED:
|
|
83
|
+
{
|
|
84
|
+
messageKey = "agent_conversationWasEnded";
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
case AgentMessageType.DISCONNECTED:
|
|
89
|
+
{
|
|
90
|
+
messageKey = "agent_disconnected";
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
case AgentMessageType.RECONNECTED:
|
|
95
|
+
{
|
|
96
|
+
messageKey = "agent_reconnected";
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
case AgentMessageType.SHARING_REQUESTED:
|
|
101
|
+
{
|
|
102
|
+
messageKey = "agent_sharingRequested";
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
case AgentMessageType.SHARING_ACCEPTED:
|
|
107
|
+
{
|
|
108
|
+
messageKey = "agent_sharingAccepted";
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
case AgentMessageType.SHARING_DECLINED:
|
|
113
|
+
{
|
|
114
|
+
messageKey = "agent_sharingDeclined";
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
case AgentMessageType.SHARING_CANCELLED:
|
|
119
|
+
{
|
|
120
|
+
messageKey = "agent_sharingCancelled";
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
case AgentMessageType.SHARING_ENDED:
|
|
125
|
+
{
|
|
126
|
+
messageKey = "agent_sharingEnded";
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
default:
|
|
131
|
+
return "";
|
|
132
|
+
}
|
|
133
|
+
return messageKey && intl.formatMessage({
|
|
134
|
+
id: messageKey
|
|
135
|
+
}, {
|
|
136
|
+
personName: name
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/*
|
|
141
|
+
* Copyright IBM Corp. 2025
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
144
|
+
* LICENSE file in the root directory of this source tree.
|
|
145
|
+
*
|
|
146
|
+
* @license
|
|
147
|
+
*/ function toPair(localMessages, originalMessage) {
|
|
148
|
+
return {
|
|
149
|
+
localMessages: localMessages,
|
|
150
|
+
originalMessage: originalMessage
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async function createAgentLocalMessage(agentMessageType, serviceManager, agentProfile, fireEvents = true) {
|
|
155
|
+
const text = getAgentStatusMessageText(agentMessageType, agentProfile, serviceManager.intl);
|
|
156
|
+
const result = createAgentLocalMessageForType(agentMessageType);
|
|
157
|
+
const {originalMessage: originalMessage, localMessage: localMessage} = result;
|
|
158
|
+
localMessage.item.text = text;
|
|
159
|
+
if (agentProfile) {
|
|
160
|
+
if (!originalMessage.history) {
|
|
161
|
+
originalMessage.history = {};
|
|
162
|
+
}
|
|
163
|
+
originalMessage.history.agent_profile = agentProfile;
|
|
164
|
+
}
|
|
165
|
+
if (fireEvents) {
|
|
166
|
+
await serviceManager.fire({
|
|
167
|
+
type: BusEventType.AGENT_PRE_RECEIVE,
|
|
168
|
+
data: originalMessage
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
deepFreeze(originalMessage);
|
|
172
|
+
if (fireEvents) {
|
|
173
|
+
await serviceManager.fire({
|
|
174
|
+
type: BusEventType.AGENT_RECEIVE,
|
|
175
|
+
data: originalMessage
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function createAgentLocalMessageForType(agentMessageType) {
|
|
182
|
+
const messageItem = {
|
|
183
|
+
response_type: MessageResponseTypes.TEXT,
|
|
184
|
+
agent_message_type: agentMessageType
|
|
185
|
+
};
|
|
186
|
+
const originalMessage = createMessageResponseForItem(messageItem);
|
|
187
|
+
const localMessage = outputItemToLocalItem(messageItem, originalMessage);
|
|
188
|
+
return {
|
|
189
|
+
localMessage: localMessage,
|
|
190
|
+
originalMessage: originalMessage
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function createBotReturnMessage(languagePack) {
|
|
195
|
+
const {agent_botReturned: agent_botReturned} = languagePack;
|
|
196
|
+
if (!agent_botReturned) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
const {originalMessage: originalMessage, localMessage: localMessage} = createAgentLocalMessageForType(null);
|
|
200
|
+
localMessage.item.text = agent_botReturned;
|
|
201
|
+
return {
|
|
202
|
+
originalMessage: originalMessage,
|
|
203
|
+
localMessage: localMessage
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
async function addMessages(messagePairs, saveInHistory, fireHistoryEvent, showLiveMessages, serviceManager) {
|
|
208
|
+
if (showLiveMessages) {
|
|
209
|
+
await asyncForEach(messagePairs, async ({localMessages: localMessages, originalMessage: originalMessage}) => {
|
|
210
|
+
await asyncForEach(localMessages, async (localMessage, index) => {
|
|
211
|
+
await serviceManager.actions.handleUserDefinedResponseItems(localMessage, originalMessage);
|
|
212
|
+
serviceManager.store.dispatch(actions.addLocalMessageItem(localMessage, originalMessage, index === 0));
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async function addBotReturnMessage(botReturnDelay, wasSuspended, serviceManager) {
|
|
219
|
+
const botReturn = createBotReturnMessage(serviceManager.store.getState().languagePack);
|
|
220
|
+
if (botReturn) {
|
|
221
|
+
const initialRestartCount = serviceManager.restartCount;
|
|
222
|
+
conditionalSetTimeout(() => {
|
|
223
|
+
if (initialRestartCount === serviceManager.restartCount) {
|
|
224
|
+
addMessages([ toPair([ botReturn.localMessage ], botReturn.originalMessage) ], true, false, !wasSuspended, serviceManager);
|
|
225
|
+
}
|
|
226
|
+
}, botReturnDelay);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
async function addAgentEndChatMessage(agentMessageType, agentProfile, fireEvents, wasSuspended, serviceManager) {
|
|
231
|
+
const endChatMessage = await createAgentLocalMessage(agentMessageType, serviceManager, agentProfile, fireEvents);
|
|
232
|
+
await addMessages([ toPair([ endChatMessage.localMessage ], endChatMessage.originalMessage) ], true, false, !wasSuspended, serviceManager);
|
|
233
|
+
}
|
|
36
234
|
|
|
37
235
|
/*
|
|
38
236
|
* Copyright IBM Corp. 2025
|
|
@@ -671,4 +869,4 @@ function validateCustomServiceDesk(serviceDesk) {
|
|
|
671
869
|
}
|
|
672
870
|
}
|
|
673
871
|
|
|
674
|
-
export { HumanAgentServiceImpl, createService, validateCustomServiceDesk };
|
|
872
|
+
export { HumanAgentServiceImpl, createService, createService as default, validateCustomServiceDesk };
|
|
@@ -2,15 +2,11 @@ import { Loading } from "@carbon/react";
|
|
|
2
2
|
|
|
3
3
|
import React, { useState, useCallback, useEffect } from "react";
|
|
4
4
|
|
|
5
|
-
import { useAriaAnnouncer } from "
|
|
5
|
+
import { u as useAriaAnnouncer, I as InlineError, M as MountChildrenOnDelay } from "./chat.MountChildrenOnDelay.js";
|
|
6
6
|
|
|
7
|
-
import { useLanguagePack } from "
|
|
7
|
+
import { u as useLanguagePack } from "./chat.AppState.js";
|
|
8
8
|
|
|
9
|
-
import { RESPONSE_TYPE_TIMEOUT_MS } from "
|
|
10
|
-
|
|
11
|
-
import { MountChildrenOnDelay } from "../../util/MountChildrenOnDelay.js";
|
|
12
|
-
|
|
13
|
-
import { InlineError } from "../error/InlineError.js";
|
|
9
|
+
import { b as RESPONSE_TYPE_TIMEOUT_MS } from "./chat.constants.js";
|
|
14
10
|
|
|
15
11
|
/*
|
|
16
12
|
* Copyright IBM Corp. 2025
|
|
@@ -74,4 +70,4 @@ function renderErrorMessage(errorText) {
|
|
|
74
70
|
}));
|
|
75
71
|
}
|
|
76
72
|
|
|
77
|
-
export { IFrameComponent };
|
|
73
|
+
export { IFrameComponent as I };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
|
|
3
|
+
import { useSelector } from "react-redux";
|
|
4
|
+
|
|
5
|
+
import { u as useLanguagePack } from "./chat.AppState.js";
|
|
6
|
+
|
|
7
|
+
import { u as useServiceManager } from "./chat.usePrevious.js";
|
|
8
|
+
|
|
9
|
+
import { a as actions } from "./chat.actions.js";
|
|
10
|
+
|
|
11
|
+
import { B as BasePanelComponentExport } from "./chat.BasePanelComponent.js";
|
|
12
|
+
|
|
13
|
+
import { I as IFrameComponent } from "./chat.IFrameComponent.js";
|
|
14
|
+
|
|
15
|
+
import { O as OverlayPanelName } from "./chat.PageObjectId.js";
|
|
16
|
+
|
|
17
|
+
import "./chat.dynamic-imports.js";
|
|
18
|
+
|
|
19
|
+
import "compute-scroll-into-view";
|
|
20
|
+
|
|
21
|
+
import "memoize-one";
|
|
22
|
+
|
|
23
|
+
import "tabbable";
|
|
24
|
+
|
|
25
|
+
import "./chat.uuid.js";
|
|
26
|
+
|
|
27
|
+
import "uuid";
|
|
28
|
+
|
|
29
|
+
import "focus-trap-react";
|
|
30
|
+
|
|
31
|
+
import "./chat.browserUtils.js";
|
|
32
|
+
|
|
33
|
+
import "detect-browser";
|
|
34
|
+
|
|
35
|
+
import "./chat.Header.js";
|
|
36
|
+
|
|
37
|
+
import "@carbon/web-components/es-custom/components/slug/index.js";
|
|
38
|
+
|
|
39
|
+
import "@carbon/icons-react/es/Close.js";
|
|
40
|
+
|
|
41
|
+
import "@carbon/icons-react/es/CloseLarge.js";
|
|
42
|
+
|
|
43
|
+
import "@carbon/icons-react/es/DownToBottom.js";
|
|
44
|
+
|
|
45
|
+
import "@carbon/icons-react/es/Menu.js";
|
|
46
|
+
|
|
47
|
+
import "@carbon/icons-react/es/Restart.js";
|
|
48
|
+
|
|
49
|
+
import "@carbon/icons-react/es/SidePanelClose.js";
|
|
50
|
+
|
|
51
|
+
import "@carbon/icons-react/es/SubtractLarge.js";
|
|
52
|
+
|
|
53
|
+
import "@carbon/react";
|
|
54
|
+
|
|
55
|
+
import "@carbon/web-components/es-custom/components/ai-label/defs.js";
|
|
56
|
+
|
|
57
|
+
import "@carbon/web-components/es-custom/components/popover/defs.js";
|
|
58
|
+
|
|
59
|
+
import "classnames";
|
|
60
|
+
|
|
61
|
+
import "@lit/react";
|
|
62
|
+
|
|
63
|
+
import "tslib";
|
|
64
|
+
|
|
65
|
+
import "./chat.customElement.js";
|
|
66
|
+
|
|
67
|
+
import "@carbon/web-components/es-custom/components/skeleton-icon/index.js";
|
|
68
|
+
|
|
69
|
+
import "lit";
|
|
70
|
+
|
|
71
|
+
import "bind-decorator";
|
|
72
|
+
|
|
73
|
+
import "lit/decorators.js";
|
|
74
|
+
|
|
75
|
+
import "@carbon/web-components/es-custom/components/button/index.js";
|
|
76
|
+
|
|
77
|
+
import "@carbon/web-components/es-custom/components/overflow-menu/index.js";
|
|
78
|
+
|
|
79
|
+
import "./chat.carbonTypes.js";
|
|
80
|
+
|
|
81
|
+
import "@carbon/icons-react/es/ChevronDown.js";
|
|
82
|
+
|
|
83
|
+
import "@carbon/icons-react/es/ChevronUp.js";
|
|
84
|
+
|
|
85
|
+
import "@floating-ui/react";
|
|
86
|
+
|
|
87
|
+
import "./chat.HideComponent.js";
|
|
88
|
+
|
|
89
|
+
import "./chat.constants.js";
|
|
90
|
+
|
|
91
|
+
import "react-dom";
|
|
92
|
+
|
|
93
|
+
import "@carbon/web-components/es-custom/components/ai-label/ai-label-action-button.js";
|
|
94
|
+
|
|
95
|
+
import "@carbon/web-components/es-custom/components/ai-label/ai-label.js";
|
|
96
|
+
|
|
97
|
+
import "./chat.MountChildrenOnDelay.js";
|
|
98
|
+
|
|
99
|
+
import "@carbon/icons-react/es/ErrorFilled.js";
|
|
100
|
+
|
|
101
|
+
import "./chat.RichText.js";
|
|
102
|
+
|
|
103
|
+
import "lodash-es/throttle.js";
|
|
104
|
+
|
|
105
|
+
import "dompurify";
|
|
106
|
+
|
|
107
|
+
import "lit/directives/repeat.js";
|
|
108
|
+
|
|
109
|
+
import "lit/directives/unsafe-html.js";
|
|
110
|
+
|
|
111
|
+
import "./chat.htmlUtils.js";
|
|
112
|
+
|
|
113
|
+
import "./chat.stringUtils.js";
|
|
114
|
+
|
|
115
|
+
import "./chat.miscUtils.js";
|
|
116
|
+
|
|
117
|
+
/*
|
|
118
|
+
* Copyright IBM Corp. 2025
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
121
|
+
* LICENSE file in the root directory of this source tree.
|
|
122
|
+
*
|
|
123
|
+
* @license
|
|
124
|
+
*/ function IFramePanelComponent(props, ref) {
|
|
125
|
+
const languagePack = useLanguagePack();
|
|
126
|
+
const {store: store} = useServiceManager();
|
|
127
|
+
const {isOpen: isOpen, messageItem: messageItem} = useSelector(state => state.iFramePanelState);
|
|
128
|
+
const iframeTitle = messageItem?.title || messageItem?.source;
|
|
129
|
+
return React.createElement(BasePanelComponentExport, {
|
|
130
|
+
...props,
|
|
131
|
+
ref: ref,
|
|
132
|
+
className: "WACIFramePanel",
|
|
133
|
+
isOpen: isOpen,
|
|
134
|
+
onClickBack: () => store.dispatch(actions.closeIFramePanel()),
|
|
135
|
+
title: iframeTitle,
|
|
136
|
+
labelBackButton: languagePack.iframe_ariaClosePanel,
|
|
137
|
+
eventName: "IFrame panel opened",
|
|
138
|
+
eventDescription: "A user has opened the IFrame panel",
|
|
139
|
+
testIdPrefix: OverlayPanelName.IFRAME
|
|
140
|
+
}, React.createElement("div", {
|
|
141
|
+
className: "WACIFramePanel__Content"
|
|
142
|
+
}, React.createElement(IFrameComponent, {
|
|
143
|
+
key: messageItem?.source,
|
|
144
|
+
source: messageItem?.source,
|
|
145
|
+
title: iframeTitle
|
|
146
|
+
})));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const IFramePanelExport = React.memo(forwardRef(IFramePanelComponent));
|
|
150
|
+
|
|
151
|
+
export { IFramePanelExport as IFramePanel, IFramePanelExport as default };
|