@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,212 +0,0 @@
|
|
|
1
|
-
import ErrorFilled from "@carbon/icons-react/es/ErrorFilled.js";
|
|
2
|
-
|
|
3
|
-
import Restart from "@carbon/icons-react/es/Restart.js";
|
|
4
|
-
|
|
5
|
-
import { Button, InlineNotification } from "@carbon/react";
|
|
6
|
-
|
|
7
|
-
import React, { useState, useRef, useImperativeHandle, useEffect } from "react";
|
|
8
|
-
|
|
9
|
-
import { useIntl } from "react-intl";
|
|
10
|
-
|
|
11
|
-
import { useSelector } from "react-redux";
|
|
12
|
-
|
|
13
|
-
import { ViewChangeReason, TourEndReason, BusEventType, MainWindowOpenReason } from "../../../../types/events/eventBusTypes.js";
|
|
14
|
-
|
|
15
|
-
import { useAriaAnnouncer } from "../../hooks/useAriaAnnouncer.js";
|
|
16
|
-
|
|
17
|
-
import { useLanguagePack } from "../../hooks/useLanguagePack.js";
|
|
18
|
-
|
|
19
|
-
import { useServiceManager } from "../../hooks/useServiceManager.js";
|
|
20
|
-
|
|
21
|
-
import "../../../../types/state/AppState.js";
|
|
22
|
-
|
|
23
|
-
import { formatMessage } from "../../utils/languages.js";
|
|
24
|
-
|
|
25
|
-
import { AnnounceOnMountComponent as AnnounceOnMountComponentExport } from "../util/AnnounceOnMountComponent.js";
|
|
26
|
-
|
|
27
|
-
import { HideComponent } from "../util/HideComponent.js";
|
|
28
|
-
|
|
29
|
-
import { MountChildrenOnDelay } from "../util/MountChildrenOnDelay.js";
|
|
30
|
-
|
|
31
|
-
import { TourCloseMinimizeComponent } from "./TourCloseMinimizeComponent.js";
|
|
32
|
-
|
|
33
|
-
import { TourControlsComponent as TourControlsComponentExport } from "./TourControlsComponent.js";
|
|
34
|
-
|
|
35
|
-
import { TourStepContentComponent as TourStepContentComponentExport } from "./TourStepContentComponent.js";
|
|
36
|
-
|
|
37
|
-
import { TourStepSkeletonComponent } from "./TourStepSkeletonComponent.js";
|
|
38
|
-
|
|
39
|
-
import { ViewType } from "../../../../types/instance/apiTypes.js";
|
|
40
|
-
|
|
41
|
-
/*
|
|
42
|
-
* Copyright IBM Corp. 2025
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
45
|
-
* LICENSE file in the root directory of this source tree.
|
|
46
|
-
*
|
|
47
|
-
* @license
|
|
48
|
-
*/ function TourContainer(props, ref) {
|
|
49
|
-
const languagePack = useLanguagePack();
|
|
50
|
-
const serviceManager = useServiceManager();
|
|
51
|
-
const ariaAnnouncer = useAriaAnnouncer();
|
|
52
|
-
const intl = useIntl();
|
|
53
|
-
const tourConfig = useSelector(state => state.config.public.tourConfig);
|
|
54
|
-
const {isHydrated: isHydrated} = useSelector(state => state);
|
|
55
|
-
const {viewState: viewState} = useSelector(state => state.persistedToBrowserStorage.launcherState);
|
|
56
|
-
const {activeTourCurrentStepIndex: activeTourCurrentStepIndex} = useSelector(state => state.persistedToBrowserStorage.chatState.persistedTourState);
|
|
57
|
-
const {activeTourStepItems: activeTourStepItems} = useSelector(state => state.tourState);
|
|
58
|
-
const [renderLoadingBar, setRenderLoadingBar] = useState(false);
|
|
59
|
-
const [renderErrorBanner, setRenderErrorBanner] = useState(false);
|
|
60
|
-
const [renderErrorScreen, setRenderErrorScreen] = useState(false);
|
|
61
|
-
const rootRef = useRef();
|
|
62
|
-
const tourControlsRef = useRef();
|
|
63
|
-
const namespace = serviceManager.namespace.originalName;
|
|
64
|
-
const languageKey = namespace ? "window_ariaTourRegionNamespace" : "window_ariaTourRegion";
|
|
65
|
-
const regionLabel = formatMessage(intl, languageKey, {
|
|
66
|
-
namespace: namespace
|
|
67
|
-
});
|
|
68
|
-
const hideTour = !viewState.tour;
|
|
69
|
-
let reservePreviousButtonSpace = true;
|
|
70
|
-
let hidePreviousButton = false;
|
|
71
|
-
let renderDoneButton = false;
|
|
72
|
-
let stepContentComponentsArray = [];
|
|
73
|
-
if (isHydrated && activeTourStepItems) {
|
|
74
|
-
reservePreviousButtonSpace = activeTourStepItems.length > 1;
|
|
75
|
-
hidePreviousButton = activeTourCurrentStepIndex <= 0;
|
|
76
|
-
renderDoneButton = activeTourCurrentStepIndex >= activeTourStepItems.length - 1;
|
|
77
|
-
stepContentComponentsArray = activeTourStepItems.map((step, index) => React.createElement(TourStepContentComponentExport, {
|
|
78
|
-
key: index,
|
|
79
|
-
stepGenericItem: step,
|
|
80
|
-
isCurrentStep: index === activeTourCurrentStepIndex
|
|
81
|
-
}));
|
|
82
|
-
} else if (!isHydrated) {
|
|
83
|
-
stepContentComponentsArray = [ React.createElement(TourStepSkeletonComponent, {
|
|
84
|
-
key: 0
|
|
85
|
-
}) ];
|
|
86
|
-
}
|
|
87
|
-
async function onOpenMainWindowClick() {
|
|
88
|
-
await serviceManager.actions.changeView(ViewType.MAIN_WINDOW, {
|
|
89
|
-
mainWindowOpenReason: MainWindowOpenReason.TOUR_OPENED_OTHER_VIEW
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
async function onDoneClick() {
|
|
93
|
-
await serviceManager.eventBus.fire({
|
|
94
|
-
type: BusEventType.TOUR_END,
|
|
95
|
-
reason: TourEndReason.DONE_CLICKED
|
|
96
|
-
}, serviceManager.instance);
|
|
97
|
-
await serviceManager.actions.endTour({
|
|
98
|
-
viewChangeReason: ViewChangeReason.TOUR_DONE
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
async function onCloseClick() {
|
|
102
|
-
await serviceManager.actions.endTour({
|
|
103
|
-
viewChangeReason: ViewChangeReason.TOUR_CLOSED
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
async function onMinimizeClick() {
|
|
107
|
-
await serviceManager.actions.changeView(ViewType.LAUNCHER, {
|
|
108
|
-
viewChangeReason: ViewChangeReason.TOUR_MINIMIZED
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function renderTourControlsComponent() {
|
|
112
|
-
return React.createElement(TourControlsComponentExport, {
|
|
113
|
-
ref: tourControlsRef,
|
|
114
|
-
hideChatButton: tourConfig?.hideChatButton,
|
|
115
|
-
reservePreviousButtonSpace: reservePreviousButtonSpace,
|
|
116
|
-
hidePreviousButton: hidePreviousButton,
|
|
117
|
-
disableNextButton: renderLoadingBar,
|
|
118
|
-
hideButtons: !isHydrated,
|
|
119
|
-
renderDoneButton: renderDoneButton,
|
|
120
|
-
onNextClick: () => {
|
|
121
|
-
serviceManager.actions.changeStepInTour({
|
|
122
|
-
nextStep: true
|
|
123
|
-
});
|
|
124
|
-
if (activeTourCurrentStepIndex + 1 === activeTourStepItems.length - 1) {
|
|
125
|
-
tourControlsRef.current?.requestFocus();
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
onPreviousClick: () => {
|
|
129
|
-
serviceManager.actions.changeStepInTour({
|
|
130
|
-
previousStep: true
|
|
131
|
-
});
|
|
132
|
-
if (activeTourCurrentStepIndex - 1 === 0) {
|
|
133
|
-
tourControlsRef.current?.requestFocus();
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
onOpenMainWindowClick: onOpenMainWindowClick,
|
|
137
|
-
onDoneClick: onDoneClick
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
function renderTourCloseMinimizeComponent() {
|
|
141
|
-
return React.createElement(TourCloseMinimizeComponent, {
|
|
142
|
-
hideMinimizeButton: tourConfig?.hideMinimizeButton,
|
|
143
|
-
onCloseClick: onCloseClick,
|
|
144
|
-
onMinimizeClick: onMinimizeClick
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
function renderTourStepStatusContainer() {
|
|
148
|
-
return React.createElement("div", {
|
|
149
|
-
className: "WACTour__StatusContainer"
|
|
150
|
-
}, renderErrorBanner && React.createElement(AnnounceOnMountComponentExport, null, React.createElement(InlineNotification, {
|
|
151
|
-
kind: "error",
|
|
152
|
-
title: languagePack.tour_errorFetchingStep,
|
|
153
|
-
lowContrast: true,
|
|
154
|
-
hideCloseButton: true,
|
|
155
|
-
onClick: () => setRenderErrorBanner(false)
|
|
156
|
-
})), renderLoadingBar && React.createElement(MountChildrenOnDelay, {
|
|
157
|
-
delay: 500
|
|
158
|
-
}, React.createElement("div", {
|
|
159
|
-
className: "WACLoadingBar__ConnectingAnimation"
|
|
160
|
-
})));
|
|
161
|
-
}
|
|
162
|
-
function renderTourErrorScreen() {
|
|
163
|
-
return React.createElement(AnnounceOnMountComponentExport, null, React.createElement("div", {
|
|
164
|
-
className: "WACTour__ErrorScreen"
|
|
165
|
-
}, React.createElement("div", {
|
|
166
|
-
className: "WACTour__ErrorHeader"
|
|
167
|
-
}, React.createElement(ErrorFilled, {
|
|
168
|
-
size: 20,
|
|
169
|
-
className: "WACTour__ErrorIcon"
|
|
170
|
-
}), languagePack.tour_errorTitle), React.createElement("div", {
|
|
171
|
-
className: "WACTour__ErrorBody"
|
|
172
|
-
}, React.createElement("div", {
|
|
173
|
-
className: "WACTour__ErrorText"
|
|
174
|
-
}, languagePack.tour_errorBody), React.createElement(Button, {
|
|
175
|
-
className: "WACTour__ErrorButton",
|
|
176
|
-
size: "sm",
|
|
177
|
-
kind: "tertiary",
|
|
178
|
-
renderIcon: props => React.createElement(Restart, {
|
|
179
|
-
size: 32,
|
|
180
|
-
...props
|
|
181
|
-
})
|
|
182
|
-
}, languagePack.buttons_retry))));
|
|
183
|
-
}
|
|
184
|
-
useImperativeHandle(ref, () => tourControlsRef.current);
|
|
185
|
-
useEffect(() => {
|
|
186
|
-
if (isHydrated && !hideTour && !renderErrorScreen) {
|
|
187
|
-
const tourInstructionsText = intl.formatMessage({
|
|
188
|
-
id: "tour_instructions"
|
|
189
|
-
}, {
|
|
190
|
-
chatButtonText: languagePack.tour_ariaChatButton
|
|
191
|
-
});
|
|
192
|
-
ariaAnnouncer(tourInstructionsText);
|
|
193
|
-
}
|
|
194
|
-
}, [ hideTour, ariaAnnouncer, languagePack, intl, isHydrated, renderErrorScreen ]);
|
|
195
|
-
useEffect(() => {
|
|
196
|
-
if (isHydrated || !hideTour) {
|
|
197
|
-
tourControlsRef.current?.requestFocus();
|
|
198
|
-
}
|
|
199
|
-
}, [ hideTour, isHydrated ]);
|
|
200
|
-
return React.createElement(HideComponent, {
|
|
201
|
-
hidden: hideTour
|
|
202
|
-
}, React.createElement("div", {
|
|
203
|
-
ref: rootRef,
|
|
204
|
-
className: "WACTour",
|
|
205
|
-
role: "region",
|
|
206
|
-
"aria-label": regionLabel
|
|
207
|
-
}, renderTourCloseMinimizeComponent(), renderErrorScreen && renderTourErrorScreen(), !renderErrorScreen && React.createElement(React.Fragment, null, stepContentComponentsArray, renderTourStepStatusContainer(), renderTourControlsComponent())));
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const TourContainerExport = React.memo(React.forwardRef(TourContainer));
|
|
211
|
-
|
|
212
|
-
export { TourContainerExport as default };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import ArrowLeft from "@carbon/icons-react/es/ArrowLeft.js";
|
|
2
|
-
|
|
3
|
-
import ArrowRight from "@carbon/icons-react/es/ArrowRight.js";
|
|
4
|
-
|
|
5
|
-
import Chat from "@carbon/icons-react/es/Chat.js";
|
|
6
|
-
|
|
7
|
-
import { Button } from "@carbon/react";
|
|
8
|
-
|
|
9
|
-
import cx from "classnames";
|
|
10
|
-
|
|
11
|
-
import React, { useRef, useImperativeHandle } from "react";
|
|
12
|
-
|
|
13
|
-
import { useLanguagePack } from "../../hooks/useLanguagePack.js";
|
|
14
|
-
|
|
15
|
-
import { doFocusRef } from "../../utils/domUtils.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 TourControlsComponent(props, ref) {
|
|
25
|
-
const {reservePreviousButtonSpace: reservePreviousButtonSpace, hidePreviousButton: hidePreviousButton, renderDoneButton: renderDoneButton, disableNextButton: disableNextButton, hideButtons: hideButtons, hideChatButton: hideChatButton, onOpenMainWindowClick: onOpenMainWindowClick, onNextClick: onNextClick, onPreviousClick: onPreviousClick, onDoneClick: onDoneClick} = props;
|
|
26
|
-
const {tour_ariaChatButton: tour_ariaChatButton, tour_ariaNextButton: tour_ariaNextButton, tour_ariaPreviousButton: tour_ariaPreviousButton, tour_doneButton: tour_doneButton} = useLanguagePack();
|
|
27
|
-
const nextButtonRef = useRef();
|
|
28
|
-
const doneButtonRef = useRef();
|
|
29
|
-
useImperativeHandle(ref, () => ({
|
|
30
|
-
requestFocus: () => {
|
|
31
|
-
setTimeout(() => {
|
|
32
|
-
if (doneButtonRef.current) {
|
|
33
|
-
doFocusRef(doneButtonRef);
|
|
34
|
-
} else {
|
|
35
|
-
doFocusRef(nextButtonRef);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}));
|
|
40
|
-
return React.createElement("div", {
|
|
41
|
-
className: cx("WACTour__Controls", {
|
|
42
|
-
"WACTour__Controls--empty": hideButtons
|
|
43
|
-
})
|
|
44
|
-
}, !hideChatButton && React.createElement("div", {
|
|
45
|
-
className: "WACTour__ControlsButton"
|
|
46
|
-
}, React.createElement(Button, {
|
|
47
|
-
className: "WACTour__MainWindowButton",
|
|
48
|
-
kind: "ghost",
|
|
49
|
-
size: "md",
|
|
50
|
-
hasIconOnly: true,
|
|
51
|
-
renderIcon: props => React.createElement(Chat, {
|
|
52
|
-
...props
|
|
53
|
-
}),
|
|
54
|
-
iconDescription: tour_ariaChatButton,
|
|
55
|
-
onClick: onOpenMainWindowClick,
|
|
56
|
-
"aria-label": tour_ariaChatButton
|
|
57
|
-
})), reservePreviousButtonSpace && React.createElement("div", {
|
|
58
|
-
className: "WACTour__ControlsButton"
|
|
59
|
-
}, React.createElement(Button, {
|
|
60
|
-
className: cx("WACTour__PreviousButton", {
|
|
61
|
-
"WACTour__ControlsButton--hidden": hidePreviousButton
|
|
62
|
-
}),
|
|
63
|
-
kind: "ghost",
|
|
64
|
-
size: "md",
|
|
65
|
-
hasIconOnly: true,
|
|
66
|
-
renderIcon: props => React.createElement(ArrowLeft, {
|
|
67
|
-
...props
|
|
68
|
-
}),
|
|
69
|
-
iconDescription: tour_ariaPreviousButton,
|
|
70
|
-
onClick: onPreviousClick,
|
|
71
|
-
"aria-label": tour_ariaPreviousButton
|
|
72
|
-
})), renderDoneButton && React.createElement("div", {
|
|
73
|
-
className: "WACTour__ControlsButton"
|
|
74
|
-
}, React.createElement(Button, {
|
|
75
|
-
ref: doneButtonRef,
|
|
76
|
-
className: "WACTour__DoneButton",
|
|
77
|
-
size: "md",
|
|
78
|
-
onClick: onDoneClick
|
|
79
|
-
}, tour_doneButton)), !renderDoneButton && React.createElement("div", {
|
|
80
|
-
className: "WACTour__ControlsButton"
|
|
81
|
-
}, React.createElement(Button, {
|
|
82
|
-
ref: nextButtonRef,
|
|
83
|
-
className: "WACTour__NextButton",
|
|
84
|
-
size: "md",
|
|
85
|
-
hasIconOnly: true,
|
|
86
|
-
renderIcon: props => React.createElement(ArrowRight, {
|
|
87
|
-
...props
|
|
88
|
-
}),
|
|
89
|
-
iconDescription: tour_ariaNextButton,
|
|
90
|
-
onClick: onNextClick,
|
|
91
|
-
disabled: disableNextButton,
|
|
92
|
-
"aria-label": tour_ariaNextButton
|
|
93
|
-
})));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const TourControlsComponentExport = React.forwardRef(TourControlsComponent);
|
|
97
|
-
|
|
98
|
-
export { TourControlsComponentExport as TourControlsComponent };
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import cx from "classnames";
|
|
2
|
-
|
|
3
|
-
import React, { useRef, useEffect, useState } from "react";
|
|
4
|
-
|
|
5
|
-
import { useSelector } from "react-redux";
|
|
6
|
-
|
|
7
|
-
import { useAriaAnnouncer } from "../../hooks/useAriaAnnouncer.js";
|
|
8
|
-
|
|
9
|
-
import { useLanguagePack } from "../../hooks/useLanguagePack.js";
|
|
10
|
-
|
|
11
|
-
import { getMediaDimensions } from "../../utils/messageUtils.js";
|
|
12
|
-
|
|
13
|
-
import { consoleError } from "../../utils/miscUtils.js";
|
|
14
|
-
|
|
15
|
-
import { InlineError } from "../responseTypes/error/InlineError.js";
|
|
16
|
-
|
|
17
|
-
import { Image as ImageExport } from "../responseTypes/image/Image.js";
|
|
18
|
-
|
|
19
|
-
import { RichText as RichTextExport } from "../responseTypes/util/RichText.js";
|
|
20
|
-
|
|
21
|
-
import { VideoComponent as VideoComponentExport } from "../responseTypes/video/VideoComponent.js";
|
|
22
|
-
|
|
23
|
-
import { MessageResponseTypes } from "../../../../types/messaging/Messages.js";
|
|
24
|
-
|
|
25
|
-
/*
|
|
26
|
-
* Copyright IBM Corp. 2025
|
|
27
|
-
*
|
|
28
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
29
|
-
* LICENSE file in the root directory of this source tree.
|
|
30
|
-
*
|
|
31
|
-
* @license
|
|
32
|
-
*/ function TourStepContentComponent(props) {
|
|
33
|
-
const {stepGenericItem: stepGenericItem, isCurrentStep: isCurrentStep} = props;
|
|
34
|
-
const ariaAnnouncer = useAriaAnnouncer();
|
|
35
|
-
const rootRef = useRef();
|
|
36
|
-
function showBottomBorder() {
|
|
37
|
-
const responseType = stepGenericItem.response_type;
|
|
38
|
-
switch (responseType) {
|
|
39
|
-
case MessageResponseTypes.TEXT:
|
|
40
|
-
return true;
|
|
41
|
-
|
|
42
|
-
case MessageResponseTypes.IMAGE:
|
|
43
|
-
return stepGenericItem?.description;
|
|
44
|
-
|
|
45
|
-
case MessageResponseTypes.VIDEO:
|
|
46
|
-
return stepGenericItem?.description;
|
|
47
|
-
|
|
48
|
-
default:
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function renderStepContent() {
|
|
53
|
-
const responseType = stepGenericItem.response_type;
|
|
54
|
-
switch (responseType) {
|
|
55
|
-
case MessageResponseTypes.TEXT:
|
|
56
|
-
return React.createElement(StepContentText, {
|
|
57
|
-
messageItem: stepGenericItem
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
case MessageResponseTypes.IMAGE:
|
|
61
|
-
return React.createElement(StepContentImage, {
|
|
62
|
-
messageItem: stepGenericItem
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
case MessageResponseTypes.VIDEO:
|
|
66
|
-
return React.createElement(StepContentVideo, {
|
|
67
|
-
messageItem: stepGenericItem,
|
|
68
|
-
isCurrentStep: isCurrentStep
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
default:
|
|
72
|
-
return React.createElement(StepContentUnsupportedError, {
|
|
73
|
-
messageItem: stepGenericItem,
|
|
74
|
-
isCurrentStep: isCurrentStep
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
if (isCurrentStep) {
|
|
80
|
-
setTimeout(() => ariaAnnouncer(rootRef.current));
|
|
81
|
-
}
|
|
82
|
-
}, [ isCurrentStep, stepGenericItem.response_type, ariaAnnouncer ]);
|
|
83
|
-
return React.createElement("div", {
|
|
84
|
-
className: "WACTourStep__Wrapper",
|
|
85
|
-
ref: rootRef
|
|
86
|
-
}, React.createElement("div", {
|
|
87
|
-
className: cx("WACTourStep", "WAC__message", {
|
|
88
|
-
"WACTourStep--hidden": !isCurrentStep,
|
|
89
|
-
WACTourStep__BottomBorder: showBottomBorder()
|
|
90
|
-
})
|
|
91
|
-
}, renderStepContent()));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function StepContentText(props) {
|
|
95
|
-
const {messageItem: messageItem} = props;
|
|
96
|
-
const {text: text} = messageItem;
|
|
97
|
-
return React.createElement("div", {
|
|
98
|
-
className: "WACTourStep__Text"
|
|
99
|
-
}, React.createElement(RichTextExport, {
|
|
100
|
-
text: text
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function StepContentImage(props) {
|
|
105
|
-
const {messageItem: messageItem} = props;
|
|
106
|
-
const {source: source, description: description, alt_text: alt_text} = messageItem;
|
|
107
|
-
const languagePack = useLanguagePack();
|
|
108
|
-
return React.createElement(ImageExport, {
|
|
109
|
-
imageError: languagePack.errors_imageSource,
|
|
110
|
-
source: source,
|
|
111
|
-
description: description,
|
|
112
|
-
altText: alt_text,
|
|
113
|
-
hideIconAndTitle: true
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function StepContentVideo(props) {
|
|
118
|
-
const {messageItem: messageItem, isCurrentStep: isCurrentStep} = props;
|
|
119
|
-
const {source: source, description: description, alt_text: alt_text} = messageItem;
|
|
120
|
-
const {viewState: viewState} = useSelector(state => state.persistedToBrowserStorage.launcherState);
|
|
121
|
-
const [isVideoPlaying, setIsVideoPlaying] = useState(false);
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
if (!isCurrentStep || !viewState.tour) {
|
|
124
|
-
setIsVideoPlaying(false);
|
|
125
|
-
}
|
|
126
|
-
}, [ isCurrentStep, viewState.tour ]);
|
|
127
|
-
return React.createElement(VideoComponentExport, {
|
|
128
|
-
source: source,
|
|
129
|
-
description: description,
|
|
130
|
-
baseHeight: getMediaDimensions(messageItem)?.base_height,
|
|
131
|
-
ariaLabel: alt_text,
|
|
132
|
-
playing: isVideoPlaying,
|
|
133
|
-
onPlay: () => setIsVideoPlaying(true),
|
|
134
|
-
onPause: () => setIsVideoPlaying(false),
|
|
135
|
-
hideIconAndTitle: true
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function StepContentUnsupportedError(props) {
|
|
140
|
-
const {messageItem: messageItem, isCurrentStep: isCurrentStep} = props;
|
|
141
|
-
const languagePack = useLanguagePack();
|
|
142
|
-
useEffect(() => {
|
|
143
|
-
if (isCurrentStep) {
|
|
144
|
-
consoleError(`The response type you tried to use "${messageItem.response_type}" is not valid within a tour step. The supported response types in tour steps are text, video, and image.`);
|
|
145
|
-
}
|
|
146
|
-
}, [ isCurrentStep, messageItem.response_type ]);
|
|
147
|
-
return React.createElement("div", {
|
|
148
|
-
className: "WACTourStep__UnsupportedResponse"
|
|
149
|
-
}, React.createElement(InlineError, {
|
|
150
|
-
text: languagePack.errors_generalContent
|
|
151
|
-
}));
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const TourStepContentComponentExport = React.memo(TourStepContentComponent);
|
|
155
|
-
|
|
156
|
-
export { TourStepContentComponentExport as TourStepContentComponent };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { SkeletonPlaceholder } from "../SkeletonPicker.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 TourStepSkeletonComponent() {
|
|
13
|
-
return React.createElement("div", {
|
|
14
|
-
className: "WACTourStep WACTourStep__Skeleton"
|
|
15
|
-
}, React.createElement(SkeletonPlaceholder, {
|
|
16
|
-
className: "WACTourStep__SkeletonPlaceholder"
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { TourStepSkeletonComponent };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React, { PureComponent } from "react";
|
|
2
|
-
|
|
3
|
-
import { withAriaAnnouncer } from "../../hocs/withAriaAnnouncer.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
|
-
*/ class AnnounceOnMountComponent extends PureComponent {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.state = {
|
|
16
|
-
isMounted: false
|
|
17
|
-
};
|
|
18
|
-
this.onceAnnounced = false;
|
|
19
|
-
}
|
|
20
|
-
componentDidMount() {
|
|
21
|
-
this.setState({
|
|
22
|
-
isMounted: true
|
|
23
|
-
});
|
|
24
|
-
if (!this.onceAnnounced) {
|
|
25
|
-
if (this.props.announceOnce) {
|
|
26
|
-
setTimeout(() => {
|
|
27
|
-
this.props.ariaAnnouncer(this.props.announceOnce);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
this.onceAnnounced = true;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
render() {
|
|
34
|
-
return React.createElement("div", {
|
|
35
|
-
"aria-live": "polite"
|
|
36
|
-
}, this.state.isMounted && this.props.children);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const AnnounceOnMountComponentExport = withAriaAnnouncer(AnnounceOnMountComponent);
|
|
41
|
-
|
|
42
|
-
export { AnnounceOnMountComponentExport as AnnounceOnMountComponent };
|
|
@@ -1,16 +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 IconHolder(props) {
|
|
11
|
-
return React.createElement("div", {
|
|
12
|
-
className: "WACIconHolder"
|
|
13
|
-
}, props.icon);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { IconHolder };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } 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 ImageWithFallback(props) {
|
|
11
|
-
const {url: url, alt: alt, fallback: fallback} = props;
|
|
12
|
-
const [hasError, setHasError] = useState(false);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
setHasError(false);
|
|
15
|
-
}, [ url ]);
|
|
16
|
-
let component;
|
|
17
|
-
if (!hasError && url) {
|
|
18
|
-
component = React.createElement("img", {
|
|
19
|
-
src: url,
|
|
20
|
-
alt: alt,
|
|
21
|
-
onError: () => setHasError(true)
|
|
22
|
-
});
|
|
23
|
-
} else {
|
|
24
|
-
component = fallback;
|
|
25
|
-
}
|
|
26
|
-
return React.createElement("div", {
|
|
27
|
-
className: "WACImageWithFallback"
|
|
28
|
-
}, component);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { ImageWithFallback };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { useShouldSanitizeHTML } from "../../hooks/useShouldSanitizeHTML.js";
|
|
4
|
-
|
|
5
|
-
import { sanitizeHTML } from "../../utils/htmlUtils.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 MaybeDangerouslySetInnerHTML({html: html, overrideSanitize: overrideSanitize, className: className, id: id, asSpan: asSpan}) {
|
|
15
|
-
let doSanitize = useShouldSanitizeHTML();
|
|
16
|
-
if (overrideSanitize !== undefined) {
|
|
17
|
-
doSanitize = overrideSanitize;
|
|
18
|
-
}
|
|
19
|
-
if (doSanitize) {
|
|
20
|
-
html = sanitizeHTML(html);
|
|
21
|
-
}
|
|
22
|
-
if (asSpan) {
|
|
23
|
-
return React.createElement("span", {
|
|
24
|
-
id: id,
|
|
25
|
-
className: className,
|
|
26
|
-
dangerouslySetInnerHTML: {
|
|
27
|
-
__html: html
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
return React.createElement("div", {
|
|
32
|
-
id: id,
|
|
33
|
-
className: className,
|
|
34
|
-
dangerouslySetInnerHTML: {
|
|
35
|
-
__html: html
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const MaybeDangerouslySetInnerHTMLExport = React.memo(MaybeDangerouslySetInnerHTML);
|
|
41
|
-
|
|
42
|
-
export { MaybeDangerouslySetInnerHTMLExport as MaybeDangerouslySetInnerHTML };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { PureComponent } 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
|
-
*/ class MountChildrenOnDelay extends PureComponent {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.state = {
|
|
14
|
-
showChildren: false
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
componentDidMount() {
|
|
18
|
-
this.onComponentDidMount = setTimeout(() => {
|
|
19
|
-
this.setState({
|
|
20
|
-
showChildren: true
|
|
21
|
-
});
|
|
22
|
-
}, this.props.delay);
|
|
23
|
-
}
|
|
24
|
-
componentWillUnmount() {
|
|
25
|
-
clearTimeout(this.onComponentDidMount);
|
|
26
|
-
this.onComponentDidMount = undefined;
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
if (!this.state.showChildren) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
return this.props.children;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
MountChildrenOnDelay.defaultProps = {
|
|
37
|
-
delay: 500
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export { MountChildrenOnDelay };
|
|
@@ -1,18 +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
|
-
*/ const VisuallyHidden = React.forwardRef((props, ref) => React.createElement("div", {
|
|
11
|
-
ref: ref,
|
|
12
|
-
...props,
|
|
13
|
-
className: `WACVisuallyHidden ${props.className || ""}`
|
|
14
|
-
}, props.children));
|
|
15
|
-
|
|
16
|
-
VisuallyHidden.displayName = "VisuallyHidden";
|
|
17
|
-
|
|
18
|
-
export { VisuallyHidden as default };
|