@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
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import Music from "@carbon/icons-react/es/Music.js";
|
|
2
|
-
|
|
3
|
-
import { Tile } from "@carbon/react";
|
|
4
|
-
|
|
5
|
-
import cx from "classnames";
|
|
6
|
-
|
|
7
|
-
import React, { useState, useRef, useCallback, useEffect, Suspense } from "react";
|
|
8
|
-
|
|
9
|
-
import { useAriaAnnouncer } from "../../../hooks/useAriaAnnouncer.js";
|
|
10
|
-
|
|
11
|
-
import { useLanguagePack } from "../../../hooks/useLanguagePack.js";
|
|
12
|
-
|
|
13
|
-
import { usePrevious } from "../../../hooks/usePrevious.js";
|
|
14
|
-
|
|
15
|
-
import { RESPONSE_TYPE_TIMEOUT_MS } from "../../../utils/constants.js";
|
|
16
|
-
|
|
17
|
-
import { getResponsiveElementPaddingValue } from "../../../utils/miscUtils.js";
|
|
18
|
-
|
|
19
|
-
import { SkeletonPlaceholder, SkeletonText } from "../../SkeletonPicker.js";
|
|
20
|
-
|
|
21
|
-
import { InlineError } from "../error/InlineError.js";
|
|
22
|
-
|
|
23
|
-
import { TextHolderTile } from "./TextHolderTile.js";
|
|
24
|
-
|
|
25
|
-
import { MessageResponseTypes } from "../../../../../types/messaging/Messages.js";
|
|
26
|
-
|
|
27
|
-
import { lazyMediaPlayer } from "../../../../dynamic-imports/dynamic-imports.js";
|
|
28
|
-
|
|
29
|
-
import { useDynamicCSSProperties } from "../../../hooks/useCSSCustomProperties.js";
|
|
30
|
-
|
|
31
|
-
/*
|
|
32
|
-
* Copyright IBM Corp. 2025
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
35
|
-
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*
|
|
37
|
-
* @license
|
|
38
|
-
*/
|
|
39
|
-
const ReactPlayerComponent = lazyMediaPlayer();
|
|
40
|
-
|
|
41
|
-
function MediaPlayerComponent({type: type, source: source, title: title, description: description, ariaLabel: ariaLabel, isMixcloud: isMixcloud, baseHeight: baseHeight, doAutoScroll: doAutoScroll, playing: playing, onPlay: onPlay, onPause: onPause, hideIconAndTitle: hideIconAndTitle, needsAnnouncement: needsAnnouncement}) {
|
|
42
|
-
const [skeletonHidden, setSkeletonHidden] = useState(false);
|
|
43
|
-
const [errorLoading, setErrorLoading] = useState(false);
|
|
44
|
-
const {errors_audioSource: errors_audioSource, errors_videoSource: errors_videoSource} = useLanguagePack();
|
|
45
|
-
const ariaAnnouncer = useAriaAnnouncer();
|
|
46
|
-
const rootElementRef = useRef();
|
|
47
|
-
const paddingTop = isMixcloud ? "120px" : getResponsiveElementPaddingValue(baseHeight);
|
|
48
|
-
const inlineStyles = useDynamicCSSProperties({
|
|
49
|
-
paddingTop: paddingTop
|
|
50
|
-
});
|
|
51
|
-
const isAudio = type === MessageResponseTypes.AUDIO;
|
|
52
|
-
const errorMessage = isAudio ? errors_audioSource : errors_videoSource;
|
|
53
|
-
const prevSource = usePrevious(source);
|
|
54
|
-
const shouldAnnounceRef = useRef(needsAnnouncement);
|
|
55
|
-
const handleError = useCallback(() => {
|
|
56
|
-
setErrorLoading(true);
|
|
57
|
-
setSkeletonHidden(true);
|
|
58
|
-
}, []);
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
if (source !== prevSource && skeletonHidden) {
|
|
61
|
-
setSkeletonHidden(false);
|
|
62
|
-
}
|
|
63
|
-
}, [ prevSource, skeletonHidden, source ]);
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
let errorTimeout = null;
|
|
66
|
-
if (!skeletonHidden) {
|
|
67
|
-
errorTimeout = setTimeout(handleError, RESPONSE_TYPE_TIMEOUT_MS);
|
|
68
|
-
}
|
|
69
|
-
return () => {
|
|
70
|
-
clearTimeout(errorTimeout);
|
|
71
|
-
};
|
|
72
|
-
}, [ skeletonHidden, handleError ]);
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
if (skeletonHidden && shouldAnnounceRef.current) {
|
|
75
|
-
ariaAnnouncer(rootElementRef.current);
|
|
76
|
-
}
|
|
77
|
-
}, [ ariaAnnouncer, skeletonHidden ]);
|
|
78
|
-
const handleReady = useCallback(() => {
|
|
79
|
-
if (!skeletonHidden) {
|
|
80
|
-
setSkeletonHidden(true);
|
|
81
|
-
doAutoScroll?.();
|
|
82
|
-
}
|
|
83
|
-
}, [ doAutoScroll, skeletonHidden ]);
|
|
84
|
-
function renderMediaPlayerSkeleton() {
|
|
85
|
-
return React.createElement(Tile, {
|
|
86
|
-
className: "WACMediaPlayer__Skeleton"
|
|
87
|
-
}, React.createElement("div", {
|
|
88
|
-
className: "WACMediaPlayer__SkeletonContainer",
|
|
89
|
-
style: inlineStyles
|
|
90
|
-
}, React.createElement(SkeletonPlaceholder, {
|
|
91
|
-
className: "WACMediaPlayer__SkeletonPlayer"
|
|
92
|
-
})), (title || description) && React.createElement("div", {
|
|
93
|
-
className: "WACMediaPlayer__SkeletonTextContainer"
|
|
94
|
-
}, React.createElement(SkeletonText, {
|
|
95
|
-
paragraph: true,
|
|
96
|
-
lineCount: 2
|
|
97
|
-
})));
|
|
98
|
-
}
|
|
99
|
-
function renderMediaPlayerBackground() {
|
|
100
|
-
return React.createElement("div", {
|
|
101
|
-
className: cx("WACMediaPlayer__Background", {
|
|
102
|
-
"WACMediaPlayer__Background--audio": isAudio
|
|
103
|
-
})
|
|
104
|
-
}, isAudio && React.createElement(Music, {
|
|
105
|
-
size: 32,
|
|
106
|
-
className: "WACMediaPlayer__MusicIcon"
|
|
107
|
-
}));
|
|
108
|
-
}
|
|
109
|
-
function renderSuspenseFallback() {
|
|
110
|
-
return React.createElement("div", null);
|
|
111
|
-
}
|
|
112
|
-
return React.createElement(React.Fragment, null, !skeletonHidden && renderMediaPlayerSkeleton(), React.createElement("div", {
|
|
113
|
-
className: "WACMediaPlayer__Root",
|
|
114
|
-
ref: rootElementRef
|
|
115
|
-
}, errorLoading && React.createElement(InlineError, {
|
|
116
|
-
text: errorMessage
|
|
117
|
-
}), !errorLoading && React.createElement(Tile, {
|
|
118
|
-
className: cx("WACMediaPlayer", {
|
|
119
|
-
WAC__hidden: !skeletonHidden
|
|
120
|
-
})
|
|
121
|
-
}, React.createElement("div", {
|
|
122
|
-
className: "WACMediaPlayer__Wrapper",
|
|
123
|
-
style: inlineStyles
|
|
124
|
-
}, renderMediaPlayerBackground(), React.createElement(Suspense, {
|
|
125
|
-
fallback: renderSuspenseFallback()
|
|
126
|
-
}, React.createElement(ReactPlayerComponent, {
|
|
127
|
-
className: "WACMediaPlayer__Player",
|
|
128
|
-
url: source,
|
|
129
|
-
controls: true,
|
|
130
|
-
width: "100%",
|
|
131
|
-
height: "100%",
|
|
132
|
-
config: {
|
|
133
|
-
file: {
|
|
134
|
-
forceVideo: true,
|
|
135
|
-
attributes: {
|
|
136
|
-
controlsList: "nodownload",
|
|
137
|
-
"aria-label": ariaLabel || description || title
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
playsinline: true,
|
|
142
|
-
playing: playing,
|
|
143
|
-
onPlay: onPlay,
|
|
144
|
-
onPause: onPause,
|
|
145
|
-
onReady: handleReady,
|
|
146
|
-
onError: handleError,
|
|
147
|
-
pip: true
|
|
148
|
-
}))), (title || description) && React.createElement(TextHolderTile, {
|
|
149
|
-
title: title,
|
|
150
|
-
description: description,
|
|
151
|
-
hideTitle: hideIconAndTitle
|
|
152
|
-
}))));
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const MediaPlayerExport = React.memo(MediaPlayerComponent);
|
|
156
|
-
|
|
157
|
-
export { MediaPlayerExport as MediaPlayer };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import Description from "./Description.js";
|
|
4
|
-
|
|
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
|
-
*/ function Metablock({title: title = null, description: description = null, id: id = null, shouldRemoveHTMLBeforeMarkdownConversion: shouldRemoveHTMLBeforeMarkdownConversion = false}) {
|
|
13
|
-
return title || description ? React.createElement("div", {
|
|
14
|
-
className: "WAC__received--metablock",
|
|
15
|
-
id: id
|
|
16
|
-
}, title && React.createElement(Description, {
|
|
17
|
-
className: "WAC__received--metablock-content WACMetablock__Title",
|
|
18
|
-
text: title,
|
|
19
|
-
shouldRemoveHTMLBeforeMarkdownConversion: shouldRemoveHTMLBeforeMarkdownConversion
|
|
20
|
-
}), description && React.createElement(Description, {
|
|
21
|
-
className: "WAC__received--metablock-content WACMetablock__Description",
|
|
22
|
-
text: description,
|
|
23
|
-
shouldRemoveHTMLBeforeMarkdownConversion: shouldRemoveHTMLBeforeMarkdownConversion
|
|
24
|
-
})) : null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { Metablock as default };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { MarkdownText } from "../../../../react/components/markdownText/MarkdownText.js";
|
|
4
|
-
|
|
5
|
-
import { useShouldSanitizeHTML } from "../../../hooks/useShouldSanitizeHTML.js";
|
|
6
|
-
|
|
7
|
-
import { removeHTML } from "../../../utils/htmlUtils.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 RichText(props) {
|
|
17
|
-
const {text: text, shouldRemoveHTMLBeforeMarkdownConversion: shouldRemoveHTMLBeforeMarkdownConversion, overrideSanitize: overrideSanitize} = props;
|
|
18
|
-
const preformattedText = shouldRemoveHTMLBeforeMarkdownConversion ? removeHTML(text) : text;
|
|
19
|
-
let doSanitize = useShouldSanitizeHTML();
|
|
20
|
-
if (overrideSanitize !== undefined) {
|
|
21
|
-
doSanitize = overrideSanitize;
|
|
22
|
-
}
|
|
23
|
-
return React.createElement(MarkdownText, {
|
|
24
|
-
markdown: preformattedText,
|
|
25
|
-
sanitizeHTML: doSanitize
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const RichTextExport = React.memo(RichText);
|
|
30
|
-
|
|
31
|
-
export { RichTextExport as RichText, RichTextExport as default };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { convertPossibleStringifiedArrayToFirstString, convertToEmptyStringIfStringifiedNull } from "../../../utils/lang/stringUtils.js";
|
|
4
|
-
|
|
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
|
-
*/ function SearchResultBodyWithCitationHighlighted({relatedSearchResult: relatedSearchResult, citationItem: citationItem}) {
|
|
13
|
-
const elementsArray = [];
|
|
14
|
-
let searchString;
|
|
15
|
-
let citationString;
|
|
16
|
-
if (relatedSearchResult?.body) {
|
|
17
|
-
const searchStringFromBody = convertPossibleStringifiedArrayToFirstString(convertToEmptyStringIfStringifiedNull(relatedSearchResult.body));
|
|
18
|
-
searchString = searchStringFromBody.replace("<em>", "").replace("</em>", "");
|
|
19
|
-
}
|
|
20
|
-
if (citationItem?.text) {
|
|
21
|
-
citationString = convertPossibleStringifiedArrayToFirstString(convertToEmptyStringIfStringifiedNull(citationItem.text));
|
|
22
|
-
}
|
|
23
|
-
if (searchString && citationString) {
|
|
24
|
-
const startOfCitation = searchString.indexOf(citationString);
|
|
25
|
-
if (startOfCitation !== -1) {
|
|
26
|
-
elementsArray.push(React.createElement("span", {
|
|
27
|
-
key: 1
|
|
28
|
-
}, searchString.substring(0, startOfCitation)));
|
|
29
|
-
elementsArray.push(React.createElement("em", {
|
|
30
|
-
key: 2,
|
|
31
|
-
className: "WAC__highlight"
|
|
32
|
-
}, searchString.substring(startOfCitation, startOfCitation + citationString.length)));
|
|
33
|
-
elementsArray.push(React.createElement("span", {
|
|
34
|
-
key: 3
|
|
35
|
-
}, searchString.substring(startOfCitation + citationString.length)));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (elementsArray.length) {
|
|
39
|
-
return elementsArray;
|
|
40
|
-
}
|
|
41
|
-
if (searchString.length) {
|
|
42
|
-
return [ React.createElement("span", {
|
|
43
|
-
key: "search-string"
|
|
44
|
-
}, searchString) ];
|
|
45
|
-
}
|
|
46
|
-
return [ React.createElement("span", {
|
|
47
|
-
key: "citation-string"
|
|
48
|
-
}, citationString) ];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const SearchResultBodyWithCitationHighlightedExport = React.memo(SearchResultBodyWithCitationHighlighted);
|
|
52
|
-
|
|
53
|
-
export { SearchResultBodyWithCitationHighlightedExport as SearchResultBodyWithCitationHighlighted };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { useCallbackOnChange } from "../../../hooks/useCallbackOnChange.js";
|
|
4
|
-
|
|
5
|
-
import { useLanguagePack } from "../../../hooks/useLanguagePack.js";
|
|
6
|
-
|
|
7
|
-
import { InlineError } from "../error/InlineError.js";
|
|
8
|
-
|
|
9
|
-
import { RichText as RichTextExport } from "./RichText.js";
|
|
10
|
-
|
|
11
|
-
/*
|
|
12
|
-
* Copyright IBM Corp. 2025
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*
|
|
17
|
-
* @license
|
|
18
|
-
*/ function StreamingRichText(props) {
|
|
19
|
-
const {text: text, streamingState: streamingState, removeHTML: removeHTML, isStreamingError: isStreamingError, doAutoScroll: doAutoScroll} = props;
|
|
20
|
-
const languagePack = useLanguagePack();
|
|
21
|
-
useCallbackOnChange(streamingState?.chunks, doAutoScroll);
|
|
22
|
-
let textToUse;
|
|
23
|
-
if (streamingState && !streamingState.isDone) {
|
|
24
|
-
textToUse = streamingState.chunks.map(chunk => chunk.text).join("");
|
|
25
|
-
} else {
|
|
26
|
-
textToUse = text;
|
|
27
|
-
}
|
|
28
|
-
return React.createElement("div", {
|
|
29
|
-
className: "WACStreamingRichText"
|
|
30
|
-
}, React.createElement(RichTextExport, {
|
|
31
|
-
text: textToUse,
|
|
32
|
-
shouldRemoveHTMLBeforeMarkdownConversion: removeHTML
|
|
33
|
-
}), isStreamingError && React.createElement(InlineError, {
|
|
34
|
-
text: languagePack.conversationalSearch_streamingIncomplete
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { StreamingRichText };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import cx from "classnames";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
|
|
5
|
-
import VisuallyHidden from "../../util/VisuallyHidden.js";
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
* Copyright IBM Corp. 2025
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*
|
|
13
|
-
* @license
|
|
14
|
-
*/ function TextHolderTile({title: title, description: description, displayURL: displayURL, urlHostName: urlHostName, hideTitle: hideTitle}) {
|
|
15
|
-
return React.createElement("div", {
|
|
16
|
-
className: "WACTextHolderTile"
|
|
17
|
-
}, React.createElement("div", {
|
|
18
|
-
className: cx("WACTextHolderTile__Wrapper", "WACWidget__textEllipsis", {
|
|
19
|
-
WACTextHolderTile__IconMargin: !displayURL
|
|
20
|
-
})
|
|
21
|
-
}, !hideTitle && title && React.createElement("div", {
|
|
22
|
-
className: "WACTextHolderTile__Title"
|
|
23
|
-
}, title), description && React.createElement("div", {
|
|
24
|
-
className: cx("WACTextHolderTile__Description", {
|
|
25
|
-
WACTextHolderTile__DescriptionMargin: title
|
|
26
|
-
})
|
|
27
|
-
}, description), displayURL && React.createElement(React.Fragment, null, React.createElement(VisuallyHidden, null, urlHostName), React.createElement("div", {
|
|
28
|
-
className: cx("WACTextHolderTile__Url", "WACWidget__textEllipsis", {
|
|
29
|
-
WACTextHolderTile__UrlMargin: title || description
|
|
30
|
-
}),
|
|
31
|
-
"aria-hidden": true
|
|
32
|
-
}, displayURL))));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { TextHolderTile };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Tile } from "@carbon/react";
|
|
2
|
-
|
|
3
|
-
import cx from "classnames";
|
|
4
|
-
|
|
5
|
-
import React from "react";
|
|
6
|
-
|
|
7
|
-
import { CitationCardContent } from "./CitationCardContent.js";
|
|
8
|
-
|
|
9
|
-
import { ExpandToPanelCard } from "./ExpandToPanelCard.js";
|
|
10
|
-
|
|
11
|
-
import { isValidURL } from "../../../../utils/htmlUtils.js";
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* Copyright IBM Corp. 2025
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*
|
|
19
|
-
* @license
|
|
20
|
-
*/ var CitationType;
|
|
21
|
-
|
|
22
|
-
(function(CitationType) {
|
|
23
|
-
CitationType["URL"] = "url";
|
|
24
|
-
CitationType["EXPAND_IF_NEEDED"] = "expand";
|
|
25
|
-
})(CitationType || (CitationType = {}));
|
|
26
|
-
|
|
27
|
-
function CitationCard({citation: citation, isSelected: isSelected, onSelectCitation: onSelectCitation, relatedSearchResult: relatedSearchResult}) {
|
|
28
|
-
const {url: url} = citation;
|
|
29
|
-
function getType() {
|
|
30
|
-
if (url && isValidURL(url)) {
|
|
31
|
-
return CitationType.URL;
|
|
32
|
-
}
|
|
33
|
-
return CitationType.EXPAND_IF_NEEDED;
|
|
34
|
-
}
|
|
35
|
-
const type = getType();
|
|
36
|
-
const className = cx("WACCitationCard", {
|
|
37
|
-
"WACCitationCard--selected": isSelected,
|
|
38
|
-
"WACCitationCard--clickable": type === CitationType.URL,
|
|
39
|
-
"WACCitationCard--url": type === CitationType.URL,
|
|
40
|
-
"WACCitationCard--no-url": type !== CitationType.URL
|
|
41
|
-
}, "WACWidget__textEllipsis");
|
|
42
|
-
if (type === CitationType.URL) {
|
|
43
|
-
return React.createElement("a", {
|
|
44
|
-
className: className,
|
|
45
|
-
href: url,
|
|
46
|
-
target: "_blank",
|
|
47
|
-
rel: "noopener noreferrer",
|
|
48
|
-
onClick: onSelectCitation,
|
|
49
|
-
onFocus: onSelectCitation
|
|
50
|
-
}, React.createElement(Tile, null, React.createElement(CitationCardContent, {
|
|
51
|
-
citation: citation,
|
|
52
|
-
type: type
|
|
53
|
-
})));
|
|
54
|
-
}
|
|
55
|
-
return React.createElement(ExpandToPanelCard, {
|
|
56
|
-
citation: citation,
|
|
57
|
-
className: className,
|
|
58
|
-
onSelectCitation: onSelectCitation,
|
|
59
|
-
relatedSearchResult: relatedSearchResult
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const CitationCardExport = React.memo(CitationCard);
|
|
64
|
-
|
|
65
|
-
export { CitationCardExport as CitationCard, CitationType };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import Link from "@carbon/icons-react/es/Link.js";
|
|
2
|
-
|
|
3
|
-
import Maximize from "@carbon/icons-react/es/Maximize.js";
|
|
4
|
-
|
|
5
|
-
import React, { useRef, useLayoutEffect } from "react";
|
|
6
|
-
|
|
7
|
-
import { useLanguagePack } from "../../../../hooks/useLanguagePack.js";
|
|
8
|
-
|
|
9
|
-
import { useWindowSize } from "../../../../hooks/useWindowSize.js";
|
|
10
|
-
|
|
11
|
-
import { CitationType } from "./CitationCard.js";
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* Copyright IBM Corp. 2025
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*
|
|
19
|
-
* @license
|
|
20
|
-
*/ function CitationCardContent({citation: citation, type: type, setIsExpandable: setIsExpandable, isExpandable: isExpandable}) {
|
|
21
|
-
const languagePack = useLanguagePack();
|
|
22
|
-
const {width: width} = useWindowSize();
|
|
23
|
-
const {conversationalSearch_viewSourceDocument: conversationalSearch_viewSourceDocument} = languagePack;
|
|
24
|
-
const ref = useRef(null);
|
|
25
|
-
const {text: text} = citation;
|
|
26
|
-
useLayoutEffect(() => {
|
|
27
|
-
if (ref.current && !isExpandable && setIsExpandable) {
|
|
28
|
-
if (ref.current.clientHeight && ref.current.scrollHeight) {
|
|
29
|
-
setIsExpandable(ref.current.clientHeight < ref.current.scrollHeight);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}, [ text, isExpandable, setIsExpandable, width ]);
|
|
33
|
-
let label;
|
|
34
|
-
let icon;
|
|
35
|
-
if (type === CitationType.URL && citation.url) {
|
|
36
|
-
label = new URL(citation.url).hostname;
|
|
37
|
-
icon = React.createElement(Link, {
|
|
38
|
-
size: 16
|
|
39
|
-
});
|
|
40
|
-
} else if (isExpandable) {
|
|
41
|
-
icon = React.createElement(Maximize, {
|
|
42
|
-
size: 16
|
|
43
|
-
});
|
|
44
|
-
label = conversationalSearch_viewSourceDocument;
|
|
45
|
-
}
|
|
46
|
-
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
47
|
-
className: "WACCitationCard_Header"
|
|
48
|
-
}, React.createElement("div", {
|
|
49
|
-
className: "WACCitationCard_Title WACWidget__textEllipsis"
|
|
50
|
-
}, citation.title), React.createElement("div", {
|
|
51
|
-
ref: ref,
|
|
52
|
-
className: "WACCitationCard_Text"
|
|
53
|
-
}, text)), React.createElement("div", {
|
|
54
|
-
className: "WACCitationCard_Footer"
|
|
55
|
-
}, (label || icon) && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
56
|
-
className: "WACCitationCard_Label WACWidget__textEllipsis"
|
|
57
|
-
}, label), React.createElement("div", {
|
|
58
|
-
className: "WACCitationCard_Icon"
|
|
59
|
-
}, icon))));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { CitationCardContent };
|
package/dist/es/chat/shared/components/responseTypes/util/citations/CitationClickableCard.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright IBM Corp. 2025
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @license
|
|
10
|
-
*/ function CitationClickableCard({title: title, onClick: onClick, onSelectCitation: onSelectCitation, children: children, className: className}) {
|
|
11
|
-
return React.createElement("button", {
|
|
12
|
-
type: "button",
|
|
13
|
-
className: `${className} WACCitationCard--clickable`,
|
|
14
|
-
"aria-label": title,
|
|
15
|
-
onClick: () => {
|
|
16
|
-
onClick();
|
|
17
|
-
onSelectCitation?.();
|
|
18
|
-
},
|
|
19
|
-
onFocus: onSelectCitation
|
|
20
|
-
}, children);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { CitationClickableCard };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Tile } from "@carbon/react";
|
|
2
|
-
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
|
|
5
|
-
import { useServiceManager } from "../../../../hooks/useServiceManager.js";
|
|
6
|
-
|
|
7
|
-
import actions from "../../../../store/actions.js";
|
|
8
|
-
|
|
9
|
-
import { CitationType } from "./CitationCard.js";
|
|
10
|
-
|
|
11
|
-
import { CitationCardContent } from "./CitationCardContent.js";
|
|
12
|
-
|
|
13
|
-
import { CitationClickableCard } from "./CitationClickableCard.js";
|
|
14
|
-
|
|
15
|
-
/*
|
|
16
|
-
* Copyright IBM Corp. 2025
|
|
17
|
-
*
|
|
18
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
19
|
-
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*
|
|
21
|
-
* @license
|
|
22
|
-
*/ function ExpandToPanelCard({className: className, citation: citation, onSelectCitation: onSelectCitation, relatedSearchResult: relatedSearchResult}) {
|
|
23
|
-
const serviceManager = useServiceManager();
|
|
24
|
-
const {title: title} = citation;
|
|
25
|
-
const [isExpandable, setIsExpandable] = useState(Boolean(relatedSearchResult?.body));
|
|
26
|
-
function onViewSourcePanelButtonClick() {
|
|
27
|
-
serviceManager.store.dispatch(actions.setViewSourcePanelIsOpen(true, citation, relatedSearchResult));
|
|
28
|
-
}
|
|
29
|
-
function renderTile(className) {
|
|
30
|
-
return React.createElement(Tile, {
|
|
31
|
-
className: className
|
|
32
|
-
}, React.createElement(CitationCardContent, {
|
|
33
|
-
citation: citation,
|
|
34
|
-
type: CitationType.EXPAND_IF_NEEDED,
|
|
35
|
-
setIsExpandable: setIsExpandable,
|
|
36
|
-
isExpandable: isExpandable
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
if (isExpandable) {
|
|
40
|
-
return React.createElement(CitationClickableCard, {
|
|
41
|
-
className: className,
|
|
42
|
-
title: title,
|
|
43
|
-
onClick: onViewSourcePanelButtonClick,
|
|
44
|
-
onSelectCitation: onSelectCitation
|
|
45
|
-
}, renderTile());
|
|
46
|
-
}
|
|
47
|
-
return renderTile(className);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { ExpandToPanelCard };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } 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 actions from "../../../../store/actions.js";
|
|
10
|
-
|
|
11
|
-
import { BasePanelComponent as BasePanelComponentExport } from "../../../BasePanelComponent.js";
|
|
12
|
-
|
|
13
|
-
import { SearchResultBodyWithCitationHighlighted as SearchResultBodyWithCitationHighlightedExport } from "../SearchResultBody.js";
|
|
14
|
-
|
|
15
|
-
import { OverlayPanelName } from "../../../OverlayPanel.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 ViewSourcePanel(props, ref) {
|
|
25
|
-
const languagePack = useLanguagePack();
|
|
26
|
-
const {store: store} = useServiceManager();
|
|
27
|
-
const {isOpen: isOpen, citationItem: citationItem, relatedSearchResult: relatedSearchResult} = useSelector(state => state.viewSourcePanelState);
|
|
28
|
-
let content;
|
|
29
|
-
if (citationItem) {
|
|
30
|
-
if (relatedSearchResult) {
|
|
31
|
-
content = React.createElement(SearchResultBodyWithCitationHighlightedExport, {
|
|
32
|
-
relatedSearchResult: relatedSearchResult,
|
|
33
|
-
citationItem: citationItem
|
|
34
|
-
});
|
|
35
|
-
} else {
|
|
36
|
-
content = citationItem.text;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return React.createElement(BasePanelComponentExport, {
|
|
40
|
-
...props,
|
|
41
|
-
ref: ref,
|
|
42
|
-
className: "WACViewSourcePanel",
|
|
43
|
-
isOpen: isOpen,
|
|
44
|
-
onClickBack: () => store.dispatch(actions.setViewSourcePanelIsOpen(false)),
|
|
45
|
-
title: citationItem?.title,
|
|
46
|
-
labelBackButton: languagePack.general_ariaCloseInformationOverlay,
|
|
47
|
-
eventName: "Search citation panel opened",
|
|
48
|
-
eventDescription: "A user has opened the search citation panel",
|
|
49
|
-
testIdPrefix: OverlayPanelName.CONVERSATIONAL_SEARCH_CITATION
|
|
50
|
-
}, React.createElement("div", {
|
|
51
|
-
className: "WACViewSourcePanel__Content"
|
|
52
|
-
}, content));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const ViewSourcePanelExport = forwardRef(ViewSourcePanel);
|
|
56
|
-
|
|
57
|
-
export { ViewSourcePanelExport as ViewSourcePanel };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { MediaPlayer as MediaPlayerExport } from "../util/MediaPlayer.js";
|
|
4
|
-
|
|
5
|
-
import { MessageResponseTypes } from "../../../../../types/messaging/Messages.js";
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
* Copyright IBM Corp. 2025
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*
|
|
13
|
-
* @license
|
|
14
|
-
*/ function VideoComponent({...props}) {
|
|
15
|
-
return React.createElement(MediaPlayerExport, {
|
|
16
|
-
type: MessageResponseTypes.VIDEO,
|
|
17
|
-
...props
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const VideoComponentExport = React.memo(VideoComponent);
|
|
22
|
-
|
|
23
|
-
export { VideoComponentExport as VideoComponent };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import Close from "@carbon/icons-react/es/Close.js";
|
|
2
|
-
|
|
3
|
-
import Subtract from "@carbon/icons-react/es/Subtract.js";
|
|
4
|
-
|
|
5
|
-
import { Button } from "@carbon/react";
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
|
|
9
|
-
import { useLanguagePack } from "../../hooks/useLanguagePack.js";
|
|
10
|
-
|
|
11
|
-
/*
|
|
12
|
-
* Copyright IBM Corp. 2025
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*
|
|
17
|
-
* @license
|
|
18
|
-
*/ function TourCloseMinimizeComponent(props) {
|
|
19
|
-
const {hideMinimizeButton: hideMinimizeButton, onMinimizeClick: onMinimizeClick, onCloseClick: onCloseClick} = props;
|
|
20
|
-
const {tour_ariaMinimizeButton: tour_ariaMinimizeButton, tour_ariaCloseButton: tour_ariaCloseButton} = useLanguagePack();
|
|
21
|
-
return React.createElement("div", {
|
|
22
|
-
className: "WACTour__CloseMinimizeWrapper"
|
|
23
|
-
}, !hideMinimizeButton && React.createElement(React.Fragment, null, React.createElement(Button, {
|
|
24
|
-
className: "WACTour__CloseMinimizeButton WACTour__MinimizeButton",
|
|
25
|
-
kind: "ghost",
|
|
26
|
-
hasIconOnly: true,
|
|
27
|
-
renderIcon: Subtract,
|
|
28
|
-
iconDescription: tour_ariaMinimizeButton,
|
|
29
|
-
onClick: onMinimizeClick,
|
|
30
|
-
"aria-label": tour_ariaMinimizeButton
|
|
31
|
-
}), React.createElement("div", {
|
|
32
|
-
className: "WACTour__CloseMinimizeDivider"
|
|
33
|
-
})), React.createElement(Button, {
|
|
34
|
-
className: "WACTour__CloseMinimizeButton WACTour__CloseButton",
|
|
35
|
-
kind: "ghost",
|
|
36
|
-
hasIconOnly: true,
|
|
37
|
-
renderIcon: Close,
|
|
38
|
-
iconDescription: tour_ariaCloseButton,
|
|
39
|
-
onClick: onCloseClick,
|
|
40
|
-
"aria-label": tour_ariaCloseButton
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { TourCloseMinimizeComponent };
|