@carbon/ai-chat 0.4.0-rc.2 → 0.4.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/aiChatEntry.js +220 -14
- package/dist/es/chat.AppContainer.js +6491 -0
- package/dist/es/chat.AppState.js +40 -0
- package/dist/es/{chat/shared/components/BasePanelComponent.js → chat.BasePanelComponent.js} +3 -3
- package/dist/es/{chat/shared/components/panels/BodyAndFooterPanelComponent.js → chat.BodyAndFooterPanelComponent.js} +92 -9
- package/dist/es/chat.BodyWithFooterComponent.js +140 -0
- package/dist/es/{chat/shared/components/header/BotHeader.js → chat.BotHeader.js} +7 -9
- package/dist/es/{chat/shared/components/responseTypes/carousel/Carousel.js → chat.Carousel.js} +3 -3
- package/dist/es/chat.CatastrophicError.js +381 -0
- package/dist/es/chat.Chat.js +2009 -0
- package/dist/es/chat.Disclaimer.js +553 -0
- package/dist/es/chat.Header.js +1025 -0
- package/dist/es/{chat/shared/components/util/HideComponent.js → chat.HideComponent.js} +9 -2
- package/dist/es/{types/config/HomeScreenConfig.js → chat.HomeScreenConfig.js} +1 -1
- package/dist/es/{chat/shared/components/homeScreen/HomeScreen.js → chat.HomeScreenContainer.js} +159 -14
- package/dist/es/{chat/shared/components/homeScreen/HomeScreenHeader.js → chat.HomeScreenHeader.js} +3 -3
- package/dist/es/{chat/shared/services/haa/HumanAgentServiceImpl.js → chat.HumanAgentServiceImpl.js} +215 -17
- package/dist/es/{chat/shared/components/responseTypes/iframe/IFrameComponent.js → chat.IFrameComponent.js} +4 -8
- package/dist/es/chat.IFramePanel.js +151 -0
- package/dist/es/{chat/shared/components/input/Input.js → chat.Input.js} +214 -18
- package/dist/es/{types/config/ServiceDeskConfig.js → chat.LocalMessageItem.js} +17 -1
- package/dist/es/chat.MessageTypeComponent.js +3580 -0
- package/dist/es/{types/messaging/Messages.js → chat.Messages.js} +1 -1
- package/dist/es/chat.MountChildrenOnDelay.js +97 -0
- package/dist/es/{chat/shared/components/OverlayPanel.js → chat.PageObjectId.js} +70 -4
- package/dist/es/{chat/web-components/components/markdownText/src/markdownText.scss.js → chat.RichText.js} +347 -1
- package/dist/es/chat.TourContainer.js +524 -0
- package/dist/es/{chat/languages/en.json.js → chat.VideoComponent.js} +561 -1
- package/dist/es/chat.ViewSourcePanel.js +187 -0
- package/dist/es/{chat/shared/store/actions.js → chat.actions.js} +2 -2
- package/dist/es/{chat/shared/utils/browserUtils.js → chat.browserUtils.js} +1 -1
- package/dist/es/{types/utilities/carbonTypes.js → chat.carbonTypes.js} +2 -2
- package/dist/es/{chat/web-components/components/codeElement/src/codeElement.scss.js → chat.cds-aichat-code.js} +64 -1
- package/dist/es/{chat/shared/utils/constants.js → chat.constants.js} +4 -7
- package/dist/es/{types/events/eventBusTypes.js → chat.customElement.js} +32 -1
- package/dist/es/chat.dynamic-imports.js +192 -0
- package/dist/es/{chat/shared/utils/htmlUtils.js → chat.htmlUtils.js} +16 -2
- package/dist/es/{chat/shared/utils/messageUtils.js → chat.messageUtils.js} +54 -7
- package/dist/es/{chat/shared/utils/miscUtils.js → chat.miscUtils.js} +24 -5
- package/dist/es/chat.resolvablePromise.js +315 -0
- package/dist/es/{chat/shared/store/selectors.js → chat.selectors.js} +1 -1
- package/dist/es/{chat/shared/utils/lang/stringUtils.js → chat.stringUtils.js} +2 -2
- package/dist/es/{chat/shared/hooks/useCounter.js → chat.useCounter.js} +1 -1
- package/dist/es/{chat/shared/hooks/useOnMount.js → chat.useOnMount.js} +1 -1
- package/dist/es/{chat/shared/utils/domUtils.js → chat.usePrevious.js} +47 -1
- package/dist/es/{chat/shared/utils/lang/UUIDType.js → chat.uuid.js} +15 -3
- package/dist/es/web-components/cds-aichat-container/index.js +73 -4
- package/dist/es/web-components/cds-aichat-custom-element/index.js +1 -3
- package/dist/types/aiChatEntry.d.ts +4767 -0
- package/package.json +5 -4
- package/dist/es/chat/dynamic-imports/dynamic-imports.js +0 -96
- package/dist/es/chat/react/components/AppContainer.js +0 -197
- package/dist/es/chat/react/components/UserDefinedResponsePortalsContainer.js +0 -31
- package/dist/es/chat/react/components/WriteableElementsPortalsContainer.js +0 -28
- package/dist/es/chat/react/components/chainOfThought/ChainOfThought.js +0 -20
- package/dist/es/chat/react/components/chatHeader/ChatHeaderAvatar.js +0 -20
- package/dist/es/chat/react/components/chatHeader/ChatHeaderLink.js +0 -22
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenu.js +0 -27
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenuButton.js +0 -60
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenuItem.js +0 -24
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenuItemRadioGroup.js +0 -28
- package/dist/es/chat/react/components/chatHeader/ChatHeaderOverflowMenu.js +0 -69
- package/dist/es/chat/react/components/chatHeader/ChatHeaderTitle.js +0 -22
- package/dist/es/chat/react/components/feedback/FeedbackButtonsComponent.js +0 -20
- package/dist/es/chat/react/components/feedback/FeedbackComponent.js +0 -20
- package/dist/es/chat/react/components/inlineLoading/InlineLoadingComponent.js +0 -20
- package/dist/es/chat/react/components/markdownText/MarkdownText.js +0 -20
- package/dist/es/chat/react/components/stopStreamingButton/StopStreamingButton.js +0 -20
- package/dist/es/chat/react/components/table/Table.js +0 -20
- package/dist/es/chat/shared/Chat.js +0 -115
- package/dist/es/chat/shared/ChatInstanceImpl.js +0 -360
- package/dist/es/chat/shared/chatEntryFunctions.js +0 -46
- package/dist/es/chat/shared/components/Avatar.js +0 -286
- package/dist/es/chat/shared/components/BodyWithFooterComponent.js +0 -56
- package/dist/es/chat/shared/components/CatastrophicError.js +0 -77
- package/dist/es/chat/shared/components/Chat.js +0 -244
- package/dist/es/chat/shared/components/ChatBubbleDark.js +0 -124
- package/dist/es/chat/shared/components/ChatBubbleLight.js +0 -216
- package/dist/es/chat/shared/components/Disclaimer.js +0 -86
- package/dist/es/chat/shared/components/ErrorIcon.js +0 -20
- package/dist/es/chat/shared/components/ErrorMessageDark.js +0 -89
- package/dist/es/chat/shared/components/ErrorMessageLight.js +0 -135
- package/dist/es/chat/shared/components/HydrationPanel.js +0 -58
- package/dist/es/chat/shared/components/LatestWelcomeNodes.js +0 -26
- package/dist/es/chat/shared/components/ResponseStopped.js +0 -19
- package/dist/es/chat/shared/components/SkeletonPicker.js +0 -32
- package/dist/es/chat/shared/components/WriteableElement.js +0 -22
- package/dist/es/chat/shared/components/agent/AgentAvatar.js +0 -54
- package/dist/es/chat/shared/components/agent/AgentBanner.js +0 -109
- package/dist/es/chat/shared/components/agent/AgentBannerContainer.js +0 -28
- package/dist/es/chat/shared/components/agent/AvailabilityMessage.js +0 -49
- package/dist/es/chat/shared/components/aria/AriaAnnouncerComponent.js +0 -122
- package/dist/es/chat/shared/components/aria/AriaAnnouncerProvider.js +0 -48
- package/dist/es/chat/shared/components/aria/AriaLiveMessage.js +0 -22
- package/dist/es/chat/shared/components/header/AISlug.js +0 -22
- package/dist/es/chat/shared/components/header/Header.js +0 -460
- package/dist/es/chat/shared/components/header/SimpleHeader.js +0 -27
- package/dist/es/chat/shared/components/homeScreen/HomeScreenContainer.js +0 -68
- package/dist/es/chat/shared/components/launcher/Launcher.js +0 -88
- package/dist/es/chat/shared/components/launcher/LauncherComplex.js +0 -63
- package/dist/es/chat/shared/components/launcher/LauncherContainer.js +0 -73
- package/dist/es/chat/shared/components/launcher/LauncherDesktopContainer.js +0 -221
- package/dist/es/chat/shared/components/launcher/LauncherExtended.js +0 -244
- package/dist/es/chat/shared/components/launcher/LauncherMobileContainer.js +0 -175
- package/dist/es/chat/shared/components/launcher/launcherUtils.js +0 -16
- package/dist/es/chat/shared/components/modals/ConfirmModal.js +0 -67
- package/dist/es/chat/shared/components/modals/EndAgentChatModal.js +0 -46
- package/dist/es/chat/shared/components/modals/RequestScreenShareModal.js +0 -43
- package/dist/es/chat/shared/components/notifications/Notifications.js +0 -58
- package/dist/es/chat/shared/components/panels/CustomPanel.js +0 -136
- package/dist/es/chat/shared/components/responseTypes/agent/ConnectToAgent.js +0 -30
- package/dist/es/chat/shared/components/responseTypes/agent/RealConnectToAgent.js +0 -102
- package/dist/es/chat/shared/components/responseTypes/audio/AudioComponent.js +0 -26
- package/dist/es/chat/shared/components/responseTypes/buttonItem/BaseButtonItemComponent.js +0 -69
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemComponent.js +0 -48
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemCustomEventComponent.js +0 -42
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemPostBackComponent.js +0 -54
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemShowPanelComponent.js +0 -36
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemURLComponent.js +0 -42
- package/dist/es/chat/shared/components/responseTypes/card/CardItemComponent.js +0 -34
- package/dist/es/chat/shared/components/responseTypes/carousel/CarouselItemComponent.js +0 -39
- package/dist/es/chat/shared/components/responseTypes/conversationalSearch/ConversationalSearch.js +0 -92
- package/dist/es/chat/shared/components/responseTypes/conversationalSearch/ConversationalSearchText.js +0 -158
- package/dist/es/chat/shared/components/responseTypes/custom/UserDefinedResponse.js +0 -33
- package/dist/es/chat/shared/components/responseTypes/datePicker/DatePickerComponent.js +0 -176
- package/dist/es/chat/shared/components/responseTypes/error/InlineError.js +0 -32
- package/dist/es/chat/shared/components/responseTypes/grid/GridItemComponent.js +0 -109
- package/dist/es/chat/shared/components/responseTypes/iframe/IFrameMessage.js +0 -32
- package/dist/es/chat/shared/components/responseTypes/iframe/IFramePanel.js +0 -51
- package/dist/es/chat/shared/components/responseTypes/iframe/IFramePreviewCard.js +0 -64
- package/dist/es/chat/shared/components/responseTypes/iframe/InlineIFrame.js +0 -55
- package/dist/es/chat/shared/components/responseTypes/image/Image.js +0 -120
- package/dist/es/chat/shared/components/responseTypes/options/OptionComponent.js +0 -83
- package/dist/es/chat/shared/components/responseTypes/options/SelectComponent.js +0 -84
- package/dist/es/chat/shared/components/responseTypes/table/TableContainer.js +0 -96
- package/dist/es/chat/shared/components/responseTypes/text/TextArea.js +0 -68
- package/dist/es/chat/shared/components/responseTypes/tour/TourCard.js +0 -73
- package/dist/es/chat/shared/components/responseTypes/util/BodyMessageComponents.js +0 -65
- package/dist/es/chat/shared/components/responseTypes/util/ClickableImage.js +0 -36
- package/dist/es/chat/shared/components/responseTypes/util/Description.js +0 -21
- package/dist/es/chat/shared/components/responseTypes/util/FooterButtonComponents.js +0 -36
- package/dist/es/chat/shared/components/responseTypes/util/MediaPlayer.js +0 -157
- package/dist/es/chat/shared/components/responseTypes/util/Metablock.js +0 -27
- package/dist/es/chat/shared/components/responseTypes/util/RichText.js +0 -31
- package/dist/es/chat/shared/components/responseTypes/util/SearchResultBody.js +0 -53
- package/dist/es/chat/shared/components/responseTypes/util/StreamingRichText.js +0 -38
- package/dist/es/chat/shared/components/responseTypes/util/TextHolderTile.js +0 -35
- package/dist/es/chat/shared/components/responseTypes/util/citations/CitationCard.js +0 -65
- package/dist/es/chat/shared/components/responseTypes/util/citations/CitationCardContent.js +0 -62
- package/dist/es/chat/shared/components/responseTypes/util/citations/CitationClickableCard.js +0 -23
- package/dist/es/chat/shared/components/responseTypes/util/citations/ExpandToPanelCard.js +0 -50
- package/dist/es/chat/shared/components/responseTypes/util/citations/ViewSourcePanel.js +0 -57
- package/dist/es/chat/shared/components/responseTypes/video/VideoComponent.js +0 -23
- package/dist/es/chat/shared/components/tour/TourCloseMinimizeComponent.js +0 -44
- package/dist/es/chat/shared/components/tour/TourContainer.js +0 -212
- package/dist/es/chat/shared/components/tour/TourControlsComponent.js +0 -98
- package/dist/es/chat/shared/components/tour/TourStepContentComponent.js +0 -156
- package/dist/es/chat/shared/components/tour/TourStepSkeletonComponent.js +0 -20
- package/dist/es/chat/shared/components/util/AnnounceOnMountComponent.js +0 -42
- package/dist/es/chat/shared/components/util/IconHolder.js +0 -16
- package/dist/es/chat/shared/components/util/ImageWithFallback.js +0 -31
- package/dist/es/chat/shared/components/util/MaybeDangerouslySetInnerHTML.js +0 -42
- package/dist/es/chat/shared/components/util/MountChildrenOnDelay.js +0 -40
- package/dist/es/chat/shared/components/util/VisuallyHidden.js +0 -18
- package/dist/es/chat/shared/containers/App.js +0 -181
- package/dist/es/chat/shared/containers/MessageComponent.js +0 -465
- package/dist/es/chat/shared/containers/MessageTypeComponent.js +0 -496
- package/dist/es/chat/shared/containers/MessagesComponent.js +0 -469
- package/dist/es/chat/shared/containers/ModalPortal.js +0 -53
- package/dist/es/chat/shared/containers/main/MainWindow.js +0 -708
- package/dist/es/chat/shared/contexts/AriaAnnouncerContext.js +0 -12
- package/dist/es/chat/shared/contexts/HideComponentContext.js +0 -12
- package/dist/es/chat/shared/contexts/LanguagePackContext.js +0 -12
- package/dist/es/chat/shared/contexts/ModalPortalRootContext.js +0 -12
- package/dist/es/chat/shared/contexts/ServiceManagerContext.js +0 -12
- package/dist/es/chat/shared/contexts/WindowSizeContext.js +0 -12
- package/dist/es/chat/shared/environmentVariables.js +0 -13
- package/dist/es/chat/shared/events/ChatActionsImpl.js +0 -783
- package/dist/es/chat/shared/events/EventBus.js +0 -161
- package/dist/es/chat/shared/hocs/withAriaAnnouncer.js +0 -25
- package/dist/es/chat/shared/hocs/withServiceManager.js +0 -25
- package/dist/es/chat/shared/hooks/useAriaAnnouncer.js +0 -16
- package/dist/es/chat/shared/hooks/useCSSCustomProperties.js +0 -21
- package/dist/es/chat/shared/hooks/useCallbackOnChange.js +0 -24
- package/dist/es/chat/shared/hooks/useEffectDidUpdate.js +0 -21
- package/dist/es/chat/shared/hooks/useLanguagePack.js +0 -16
- package/dist/es/chat/shared/hooks/usePrevious.js +0 -18
- package/dist/es/chat/shared/hooks/useServiceManager.js +0 -16
- package/dist/es/chat/shared/hooks/useShouldSanitizeHTML.js +0 -15
- package/dist/es/chat/shared/hooks/useUUID.js +0 -22
- package/dist/es/chat/shared/hooks/useWindowSize.js +0 -16
- package/dist/es/chat/shared/loadServices.js +0 -72
- package/dist/es/chat/shared/schema/historyToMessages.js +0 -231
- package/dist/es/chat/shared/schema/inputItemToLocalItem.js +0 -30
- package/dist/es/chat/shared/schema/outputItemToLocalItem.js +0 -124
- package/dist/es/chat/shared/services/CustomPanelInstance.js +0 -26
- package/dist/es/chat/shared/services/CustomPanelManager.js +0 -23
- package/dist/es/chat/shared/services/HistoryService.js +0 -59
- package/dist/es/chat/shared/services/MessageService.js +0 -351
- package/dist/es/chat/shared/services/NamespaceService.js +0 -26
- package/dist/es/chat/shared/services/ServiceManager.js +0 -19
- package/dist/es/chat/shared/services/UserSessionStorageService.js +0 -89
- package/dist/es/chat/shared/services/haa/agentStatusMessage.js +0 -108
- package/dist/es/chat/shared/services/haa/humanAgentUtils.js +0 -114
- package/dist/es/chat/shared/services/mockStorage.js +0 -30
- package/dist/es/chat/shared/store/agentActions.js +0 -125
- package/dist/es/chat/shared/store/agentReducers.js +0 -215
- package/dist/es/chat/shared/store/doCreateStore.js +0 -142
- package/dist/es/chat/shared/store/reducerUtils.js +0 -320
- package/dist/es/chat/shared/store/reducers.js +0 -871
- package/dist/es/chat/shared/store/subscriptions.js +0 -55
- package/dist/es/chat/shared/store/tourReducerUtils.js +0 -51
- package/dist/es/chat/shared/utils/ListenerList.js +0 -26
- package/dist/es/chat/shared/utils/PageObjectId.js +0 -25
- package/dist/es/chat/shared/utils/animationUtils.js +0 -77
- package/dist/es/chat/shared/utils/colors.js +0 -71
- package/dist/es/chat/shared/utils/customizers.js +0 -16
- package/dist/es/chat/shared/utils/dateUtils.js +0 -38
- package/dist/es/chat/shared/utils/homeScreenUtils.js +0 -27
- package/dist/es/chat/shared/utils/intlUtils.js +0 -21
- package/dist/es/chat/shared/utils/lang/arrayUtils.js +0 -53
- package/dist/es/chat/shared/utils/lang/langUtils.js +0 -13
- package/dist/es/chat/shared/utils/lang/objectUtils.js +0 -19
- package/dist/es/chat/shared/utils/lang/promiseUtils.js +0 -25
- package/dist/es/chat/shared/utils/lang/uuid.js +0 -16
- package/dist/es/chat/shared/utils/languages.js +0 -156
- package/dist/es/chat/shared/utils/memoizerUtils.js +0 -38
- package/dist/es/chat/shared/utils/messageServiceUtils.js +0 -36
- package/dist/es/chat/shared/utils/resolvablePromise.js +0 -32
- package/dist/es/chat/shared/utils/styleUtils.js +0 -231
- package/dist/es/chat/shared/utils/timeUtils.js +0 -14
- package/dist/es/chat/shared/utils/viewStateUtils.js +0 -38
- package/dist/es/chat/web-components/components/chainOfThought/cds-aichat-chain-of-thought.js +0 -26
- package/dist/es/chat/web-components/components/chainOfThought/src/ChainOfThoughtElement.js +0 -130
- package/dist/es/chat/web-components/components/chainOfThought/src/chainOfThoughtElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/chainOfThought/src/chainOfThoughtElement.template.js +0 -186
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/cds-aichat-chat-header-avatar.js +0 -26
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/src/chatHeaderAvatar.template.js +0 -32
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/src/chatHeaderAvatarElement.js +0 -52
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/src/chatHeaderAvatarElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderLink/cds-aichat-chat-header-link.js +0 -44
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderLink/src/chatHeaderLinkElement.template.js +0 -28
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderTitle/cds-aichat-chat-header-title.js +0 -42
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderTitle/src/chatHeaderTitle.scss.js +0 -3
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderTitle/src/chatHeaderTitle.template.js +0 -20
- package/dist/es/chat/web-components/components/codeElement/cds-aichat-code.js +0 -66
- package/dist/es/chat/web-components/components/feedbackButtonsElement/cds-aichat-feedback-buttons.js +0 -26
- package/dist/es/chat/web-components/components/feedbackButtonsElement/src/FeedbackButtonsElement.js +0 -93
- package/dist/es/chat/web-components/components/feedbackButtonsElement/src/feedbackButtonsElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/feedbackButtonsElement/src/feedbackButtonsElement.template.js +0 -84
- package/dist/es/chat/web-components/components/feedbackElement/cds-aichat-feedback.js +0 -30
- package/dist/es/chat/web-components/components/feedbackElement/src/FeedbackElement.js +0 -157
- package/dist/es/chat/web-components/components/feedbackElement/src/feedbackElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/feedbackElement/src/feedbackElement.template.js +0 -95
- package/dist/es/chat/web-components/components/inlineLoadingElement/cds-aichat-inline-loading.js +0 -85
- package/dist/es/chat/web-components/components/inlineLoadingElement/src/styles.scss.js +0 -3
- package/dist/es/chat/web-components/components/markdownText/cds-aichat-markdown-text.js +0 -32
- package/dist/es/chat/web-components/components/markdownText/markdown/markdownToHTML.js +0 -28
- package/dist/es/chat/web-components/components/markdownText/markdown/utils/renderTokenTree.js +0 -191
- package/dist/es/chat/web-components/components/markdownText/markdown/workers/workerManager.js +0 -16
- package/dist/es/chat/web-components/components/markdownText/src/MarkdownElement.js +0 -70
- package/dist/es/chat/web-components/components/markdownText/src/markdownElement.template.js +0 -19
- package/dist/es/chat/web-components/components/roundedButton/cds-aichat-rounded-button.js +0 -29
- package/dist/es/chat/web-components/components/stopStreamingButton/cds-aichat-stop-streaming-button.js +0 -26
- package/dist/es/chat/web-components/components/stopStreamingButton/src/StopStreamingButtonElement.js +0 -49
- package/dist/es/chat/web-components/components/stopStreamingButton/src/stopStreamingButton.scss.js +0 -3
- package/dist/es/chat/web-components/components/stopStreamingButton/src/stopStreamingButton.template.js +0 -44
- package/dist/es/chat/web-components/components/table/cds-aichat-table.js +0 -229
- package/dist/es/chat/web-components/components/table/src/table.scss.js +0 -3
- package/dist/es/chat/web-components/components/table/src/table.template.js +0 -81
- package/dist/es/chat/web-components/components/table/src/tablePagination.template.js +0 -43
- package/dist/es/chat/web-components/components/table/src/tableSkeleton.template.js +0 -17
- package/dist/es/chat/web-components/components/tagListElement/cds-aichat-tag-list.js +0 -28
- package/dist/es/chat/web-components/components/tagListElement/src/TagListElement.js +0 -70
- package/dist/es/chat/web-components/components/tagListElement/src/tagListElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/tagListElement/src/tagListElement.template.js +0 -40
- package/dist/es/chat/web-components/decorators/customElement.js +0 -33
- package/dist/es/chat/web-components/internal/cds-aichat-internal.js +0 -78
- package/dist/es/chat/web-components/settings.js +0 -13
- package/dist/es/node_modules/@carbon/colors/es/index.js +0 -11
- package/dist/es/react/ChatContainer.js +0 -162
- package/dist/es/react/ChatCustomElement.js +0 -58
- package/dist/es/types/config/ChatHeaderConfig.js +0 -18
- package/dist/es/types/config/CornersType.js +0 -16
- package/dist/es/types/config/LauncherConfig.js +0 -19
- package/dist/es/types/config/PublicConfig.js +0 -36
- package/dist/es/types/instance/ChatInstance.js +0 -31
- package/dist/es/types/instance/apiTypes.js +0 -33
- package/dist/es/types/messaging/LocalMessageItem.js +0 -18
- package/dist/es/types/state/AppState.js +0 -18
- package/dist/es/types/utilities/Animation.js +0 -31
- package/dist/es/types/utilities/HasAddRemoveClassName.js +0 -27
- /package/dist/es/{chat/shared/styles/export.carbon.scss.js → chat.export.carbon.js} +0 -0
- /package/dist/es/{chat/shared/styles/export.scss.js → chat.export.js} +0 -0
- /package/dist/es/{chat/web-components/components/markdownText/markdown/utils/markdown.js → chat.markdown.js} +0 -0
- /package/dist/es/{chat/web-components/components/markdownText/markdown/utils/tokenTree.js → chat.tokenTree.js} +0 -0
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import dayjs from "dayjs";
|
|
2
|
-
|
|
3
|
-
import enLocaleData from "dayjs/locale/en.js";
|
|
4
|
-
|
|
5
|
-
import IntlMessageFormat from "intl-messageformat";
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
|
|
9
|
-
import { consoleError } from "./miscUtils.js";
|
|
10
|
-
|
|
11
|
-
import "../../../types/instance/apiTypes.js";
|
|
12
|
-
|
|
13
|
-
import enLanguagePack from "../../languages/en.json.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
|
-
*/ const locales = {
|
|
23
|
-
ar: () => import("dayjs/locale/ar.js"),
|
|
24
|
-
"ar-dz": () => import("dayjs/locale/ar-dz.js"),
|
|
25
|
-
"ar-kw": () => import("dayjs/locale/ar-kw.js"),
|
|
26
|
-
"ar-ly": () => import("dayjs/locale/ar-ly.js"),
|
|
27
|
-
"ar-ma": () => import("dayjs/locale/ar-ma.js"),
|
|
28
|
-
"ar-sa": () => import("dayjs/locale/ar-sa.js"),
|
|
29
|
-
"ar-tn": () => import("dayjs/locale/ar-tn.js"),
|
|
30
|
-
cs: () => import("dayjs/locale/cs.js"),
|
|
31
|
-
de: () => import("dayjs/locale/de.js"),
|
|
32
|
-
"de-at": () => import("dayjs/locale/de-at.js"),
|
|
33
|
-
"de-ch": () => import("dayjs/locale/de-ch.js"),
|
|
34
|
-
en: () => import("dayjs/locale/en.js"),
|
|
35
|
-
"en-au": () => import("dayjs/locale/en-au.js"),
|
|
36
|
-
"en-ca": () => import("dayjs/locale/en-ca.js"),
|
|
37
|
-
"en-gb": () => import("dayjs/locale/en-gb.js"),
|
|
38
|
-
"en-ie": () => import("dayjs/locale/en-ie.js"),
|
|
39
|
-
"en-il": () => import("dayjs/locale/en-il.js"),
|
|
40
|
-
"en-nz": () => import("dayjs/locale/en-nz.js"),
|
|
41
|
-
es: () => import("dayjs/locale/es.js"),
|
|
42
|
-
"es-do": () => import("dayjs/locale/es-do.js"),
|
|
43
|
-
"es-us": () => import("dayjs/locale/es-us.js"),
|
|
44
|
-
nl: () => import("dayjs/locale/nl.js"),
|
|
45
|
-
fr: () => import("dayjs/locale/fr.js"),
|
|
46
|
-
"fr-ca": () => import("dayjs/locale/fr-ca.js"),
|
|
47
|
-
"fr-ch": () => import("dayjs/locale/fr-ch.js"),
|
|
48
|
-
it: () => import("dayjs/locale/it.js"),
|
|
49
|
-
"it-ch": () => import("dayjs/locale/it-ch.js"),
|
|
50
|
-
ja: () => import("dayjs/locale/ja.js"),
|
|
51
|
-
ko: () => import("dayjs/locale/ko.js"),
|
|
52
|
-
pt: () => import("dayjs/locale/pt.js"),
|
|
53
|
-
"pt-br": () => import("dayjs/locale/pt-br.js"),
|
|
54
|
-
zh: () => import("dayjs/locale/zh-cn.js"),
|
|
55
|
-
"zh-cn": () => import("dayjs/locale/zh-cn.js"),
|
|
56
|
-
"zh-tw": () => import("dayjs/locale/zh-tw.js"),
|
|
57
|
-
"zh-mo": () => import("dayjs/locale/zh-tw.js"),
|
|
58
|
-
"zh-hk": () => import("dayjs/locale/zh-tw.js")
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
function isSupportedLocale(locale, object) {
|
|
62
|
-
if (!locale) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
locale = locale.toLowerCase().replace(/_/g, "-");
|
|
66
|
-
if (object[locale]) {
|
|
67
|
-
return locale;
|
|
68
|
-
}
|
|
69
|
-
const language = locale.substring(0, 2);
|
|
70
|
-
if (object[language]) {
|
|
71
|
-
return language;
|
|
72
|
-
}
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function findSupportedKey(requestedLocale, object, objectType) {
|
|
77
|
-
const requestedSupported = isSupportedLocale(requestedLocale, object);
|
|
78
|
-
if (requestedSupported) {
|
|
79
|
-
return requestedSupported;
|
|
80
|
-
}
|
|
81
|
-
if (requestedLocale) {
|
|
82
|
-
const keyList = JSON.stringify(Object.keys(object));
|
|
83
|
-
consoleError(`The requested locale "${requestedLocale}" does not contain a supported ${objectType}. We are defaulting to "en". The supported values are ${keyList}.`);
|
|
84
|
-
}
|
|
85
|
-
return "en";
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
async function loadLocale(requestedLocale) {
|
|
89
|
-
try {
|
|
90
|
-
const localeKey = findSupportedKey(requestedLocale, locales, "locale");
|
|
91
|
-
const localeModule = await locales[localeKey]();
|
|
92
|
-
if (localeModule) {
|
|
93
|
-
return localeModule.default;
|
|
94
|
-
}
|
|
95
|
-
consoleError(`The locale data for "${localeKey}" did not load. The application will default to "en".`);
|
|
96
|
-
} catch (error) {
|
|
97
|
-
consoleError(`An error occurred loading the locale data for "${requestedLocale}". The application will default to "en".`, error);
|
|
98
|
-
}
|
|
99
|
-
return enLocaleData;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
async function loadLanguagePack(providedLanguagePack) {
|
|
103
|
-
if (providedLanguagePack) {
|
|
104
|
-
return fillWithEnglish(providedLanguagePack);
|
|
105
|
-
}
|
|
106
|
-
return enLanguagePack;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function fillWithEnglish(languagePack) {
|
|
110
|
-
return {
|
|
111
|
-
...enLanguagePack,
|
|
112
|
-
...languagePack
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function handleBTag(chunks) {
|
|
117
|
-
return React.createElement("b", null, chunks);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function handleBRTag() {
|
|
121
|
-
return React.createElement("br", null);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function addHTMLSupport(values) {
|
|
125
|
-
values.b = handleBTag;
|
|
126
|
-
values.br = handleBRTag;
|
|
127
|
-
return values;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
async function loadDayjsLocale(locale) {
|
|
131
|
-
if (!dayjs.Ls[locale]) {
|
|
132
|
-
const previousLocale = dayjs.locale();
|
|
133
|
-
const localePack = await loadLocale(locale);
|
|
134
|
-
dayjs.locale(localePack);
|
|
135
|
-
dayjs.locale(previousLocale);
|
|
136
|
-
const isLoaded = Boolean(dayjs.Ls[locale]);
|
|
137
|
-
if (!isLoaded && locale.length === 2) {
|
|
138
|
-
throw Error("Locale is not recognized.");
|
|
139
|
-
} else if (!isLoaded) {
|
|
140
|
-
return loadDayjsLocale(locale.substring(0, 2));
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return locale;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function formatMessage(intl, id, values) {
|
|
147
|
-
return intl.formatMessage({
|
|
148
|
-
id: id
|
|
149
|
-
}, values);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function createEnglishFormat(key) {
|
|
153
|
-
return new IntlMessageFormat(enLanguagePack[key], "en-US");
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export { addHTMLSupport, createEnglishFormat, formatMessage, loadDayjsLocale, loadLanguagePack, loadLocale };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import memoizeOne from "memoize-one";
|
|
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 createUnmappingMemoizer() {
|
|
11
|
-
return memoizeOne((keys, map) => keys.map(key => map[key]), isUnmappingEqual);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function isUnmappingEqual(newArgs, oldArgs) {
|
|
15
|
-
const [keys1, map1] = newArgs;
|
|
16
|
-
const [keys2, map2] = oldArgs;
|
|
17
|
-
if (keys1 === keys2 && map1 === map2) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
if (keys1.length !== keys2.length) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
for (let index = 0; index <= keys1.length; index++) {
|
|
24
|
-
const key1 = keys1[index];
|
|
25
|
-
const key2 = keys2[index];
|
|
26
|
-
if (key1 !== key2) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
const value1 = map1[key1];
|
|
30
|
-
const value2 = map2[key2];
|
|
31
|
-
if (value1 !== value2) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { createUnmappingMemoizer };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright IBM Corp. 2025
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @license
|
|
8
|
-
*/
|
|
9
|
-
class MessageLoadingManager {
|
|
10
|
-
start(onExceededMaxSilentLoading, onEnd, onTimeout, msMaxSilentLoading, msMaxAttempt) {
|
|
11
|
-
this.hasExceededMaxSilentLoading = false;
|
|
12
|
-
this.onEnd = onEnd;
|
|
13
|
-
this.onSilentLoading = setTimeout(() => {
|
|
14
|
-
this.hasExceededMaxSilentLoading = true;
|
|
15
|
-
onExceededMaxSilentLoading();
|
|
16
|
-
}, msMaxSilentLoading);
|
|
17
|
-
this.onMaxAttempt = setTimeout(() => {
|
|
18
|
-
onTimeout();
|
|
19
|
-
}, msMaxAttempt);
|
|
20
|
-
}
|
|
21
|
-
end() {
|
|
22
|
-
if (this.onMaxAttempt) {
|
|
23
|
-
clearTimeout(this.onMaxAttempt);
|
|
24
|
-
}
|
|
25
|
-
if (this.onSilentLoading) {
|
|
26
|
-
clearTimeout(this.onSilentLoading);
|
|
27
|
-
}
|
|
28
|
-
if (this.onEnd) {
|
|
29
|
-
this.onEnd(this.hasExceededMaxSilentLoading);
|
|
30
|
-
}
|
|
31
|
-
this.hasExceededMaxSilentLoading = null;
|
|
32
|
-
this.onEnd = null;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { MessageLoadingManager };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright IBM Corp. 2025
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @license
|
|
8
|
-
*/
|
|
9
|
-
function resolvablePromise() {
|
|
10
|
-
let resolveFunction;
|
|
11
|
-
let rejectFunction;
|
|
12
|
-
const promise = new Promise((resolve, reject) => {
|
|
13
|
-
resolveFunction = resolve;
|
|
14
|
-
rejectFunction = reject;
|
|
15
|
-
});
|
|
16
|
-
promise.doResolve = resolveValue => {
|
|
17
|
-
promise.isResolved = true;
|
|
18
|
-
promise.isComplete = true;
|
|
19
|
-
resolveFunction(resolveValue);
|
|
20
|
-
};
|
|
21
|
-
promise.doReject = rejectValue => {
|
|
22
|
-
promise.isRejected = true;
|
|
23
|
-
promise.isComplete = true;
|
|
24
|
-
rejectFunction(rejectValue);
|
|
25
|
-
};
|
|
26
|
-
promise.isResolved = false;
|
|
27
|
-
promise.isRejected = false;
|
|
28
|
-
promise.isComplete = false;
|
|
29
|
-
return promise;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { resolvablePromise };
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { white, gray100, gray10, blue60, gray80 } from "../../../node_modules/@carbon/colors/es/index.js";
|
|
2
|
-
|
|
3
|
-
import { whiteOrBlackText, adjustLightness, calculateContrast, MIN_CONTRAST, hexCodeToRGB } from "./colors.js";
|
|
4
|
-
|
|
5
|
-
import { WA_CONSOLE_PREFIX } from "./constants.js";
|
|
6
|
-
|
|
7
|
-
import { CarbonTheme } from "../../../types/config/PublicConfig.js";
|
|
8
|
-
|
|
9
|
-
import { CarbonThemeClassNames } from "../../../types/utilities/carbonTypes.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
|
-
*/
|
|
19
|
-
const CSS_VAR_PREFIX = "--cds-";
|
|
20
|
-
|
|
21
|
-
const CSS_CHAT_PREFIX = "chat-";
|
|
22
|
-
|
|
23
|
-
const HEXADECIMAL_REGEX = /#([a-f0-9]{3}){1,2}\b/i;
|
|
24
|
-
|
|
25
|
-
const INTERNAL_OVERRIDES_LIGHT_THEME_MAP = {
|
|
26
|
-
"$chat-button": "#000000",
|
|
27
|
-
"$chat-button-text-hover": "#525252"
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const INTERNAL_OVERRIDES_DARK_THEME_MAP = {
|
|
31
|
-
"$chat-button": "#ffffff",
|
|
32
|
-
"$chat-button-text-hover": "#f4f4f4"
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
function convertCSSVariablesToString(cssVariables) {
|
|
36
|
-
const pieces = Object.keys(cssVariables).map(key => {
|
|
37
|
-
const value = cssVariables[key];
|
|
38
|
-
if (value === undefined) {
|
|
39
|
-
return "";
|
|
40
|
-
}
|
|
41
|
-
const fullName = key.startsWith("$") ? `${CSS_VAR_PREFIX}${key.replace(/^\$/, "")}` : `${CSS_VAR_PREFIX}${CSS_CHAT_PREFIX}${key}`;
|
|
42
|
-
return `${fullName}:${value};`;
|
|
43
|
-
});
|
|
44
|
-
let cssVariablesString = "";
|
|
45
|
-
const allValues = pieces.join("");
|
|
46
|
-
const prefix = "";
|
|
47
|
-
if (allValues.length > 0) {
|
|
48
|
-
const rule = `${prefix}.WACContainer .cds--white, ${prefix}.WACContainer .cds--g10, ${prefix}.WACContainer .cds--g90, ${prefix}.WACContainer .cds--g100`;
|
|
49
|
-
cssVariablesString = `${rule}${`, :host`}{${allValues}}`;
|
|
50
|
-
}
|
|
51
|
-
return cssVariablesString;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function remoteStylesToCSSVars(whiteLabelVariables, carbonTheme) {
|
|
55
|
-
const cssOverrides = {};
|
|
56
|
-
const primaryColor = whiteLabelVariables["BASE-primary-color"];
|
|
57
|
-
const secondaryColor = whiteLabelVariables["BASE-secondary-color"];
|
|
58
|
-
const accentColor = whiteLabelVariables["BASE-accent-color"];
|
|
59
|
-
if (primaryColor) {
|
|
60
|
-
cssOverrides["PRIMARY-color"] = primaryColor;
|
|
61
|
-
cssOverrides["PRIMARY-color-text"] = whiteOrBlackText(primaryColor);
|
|
62
|
-
cssOverrides["PRIMARY-color-hover"] = adjustLightness(primaryColor, -8);
|
|
63
|
-
cssOverrides["PRIMARY-color-active"] = adjustLightness(primaryColor, -10);
|
|
64
|
-
const useAccentColor = accentColor || blue60;
|
|
65
|
-
const tryFocusColor = carbonTheme === CarbonTheme.G90 || carbonTheme === CarbonTheme.G100 ? white : useAccentColor;
|
|
66
|
-
let useFocusColor;
|
|
67
|
-
if (calculateContrast(primaryColor, tryFocusColor) >= MIN_CONTRAST) {
|
|
68
|
-
useFocusColor = tryFocusColor;
|
|
69
|
-
} else if (tryFocusColor !== useAccentColor && calculateContrast(primaryColor, useAccentColor) >= MIN_CONTRAST) {
|
|
70
|
-
useFocusColor = useAccentColor;
|
|
71
|
-
} else if (tryFocusColor !== white && calculateContrast(primaryColor, white) >= MIN_CONTRAST) {
|
|
72
|
-
useFocusColor = white;
|
|
73
|
-
} else {
|
|
74
|
-
useFocusColor = gray100;
|
|
75
|
-
}
|
|
76
|
-
if (useFocusColor !== tryFocusColor) {
|
|
77
|
-
cssOverrides["PRIMARY-color-focus"] = useFocusColor;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (secondaryColor) {
|
|
81
|
-
cssOverrides["SECONDARY-color"] = secondaryColor;
|
|
82
|
-
cssOverrides["SECONDARY-color-text"] = whiteOrBlackText(secondaryColor);
|
|
83
|
-
} else if (carbonTheme === CarbonTheme.G90 || carbonTheme === CarbonTheme.G100) {
|
|
84
|
-
cssOverrides["SECONDARY-color"] = `var(${CSS_VAR_PREFIX}layer-02)`;
|
|
85
|
-
cssOverrides["SECONDARY-color-text"] = `var(${CSS_VAR_PREFIX}text-primary);`;
|
|
86
|
-
}
|
|
87
|
-
if (accentColor) {
|
|
88
|
-
const colorMap = ACCENT_COLOR_MAPS[carbonTheme];
|
|
89
|
-
const accentBlue20 = adjustLightness(accentColor, 40);
|
|
90
|
-
const accentBlue60Hover = adjustLightness(accentColor, -8);
|
|
91
|
-
const accentBlue80 = adjustLightness(accentColor, -20);
|
|
92
|
-
fillValues(cssOverrides, colorMap.blue20, accentBlue20);
|
|
93
|
-
fillValues(cssOverrides, colorMap.blue60, accentColor);
|
|
94
|
-
fillValues(cssOverrides, colorMap.blue60Hover, accentBlue60Hover);
|
|
95
|
-
fillValues(cssOverrides, colorMap.blue80, accentBlue80);
|
|
96
|
-
cssOverrides["LAUNCHER-color-background"] = accentColor;
|
|
97
|
-
cssOverrides["LAUNCHER-color-background-hover"] = accentBlue60Hover;
|
|
98
|
-
cssOverrides["LAUNCHER-color-background-active"] = accentBlue80;
|
|
99
|
-
cssOverrides["LAUNCHER-EXPANDED-MESSAGE-color-background"] = accentColor;
|
|
100
|
-
cssOverrides["LAUNCHER-EXPANDED-MESSAGE-color-hover"] = accentBlue60Hover;
|
|
101
|
-
cssOverrides["LAUNCHER-EXPANDED-MESSAGE-color-active"] = accentBlue80;
|
|
102
|
-
cssOverrides["ACCENT-color"] = accentColor;
|
|
103
|
-
const accentColorRGB = hexCodeToRGB(accentColor);
|
|
104
|
-
cssOverrides["ACCENT-color-r"] = accentColorRGB[0].toString();
|
|
105
|
-
cssOverrides["ACCENT-color-g"] = accentColorRGB[1].toString();
|
|
106
|
-
cssOverrides["ACCENT-color-b"] = accentColorRGB[2].toString();
|
|
107
|
-
cssOverrides["ACCENT-color-ghost-text"] = accentColor;
|
|
108
|
-
const accentColorBW = whiteOrBlackText(accentColor);
|
|
109
|
-
cssOverrides["ACCENT-color-text"] = accentColorBW;
|
|
110
|
-
cssOverrides["ACCENT-color-background-hover"] = accentBlue60Hover;
|
|
111
|
-
cssOverrides["ACCENT-color-background-active"] = accentBlue80;
|
|
112
|
-
cssOverrides["LAUNCHER-color-focus-border"] = accentColorBW;
|
|
113
|
-
cssOverrides["LAUNCHER-color-avatar"] = accentColorBW;
|
|
114
|
-
cssOverrides["LAUNCHER-EXPANDED-MESSAGE-color-text"] = accentColorBW;
|
|
115
|
-
cssOverrides["LAUNCHER-EXPANDED-MESSAGE-color-focus-border"] = accentColorBW;
|
|
116
|
-
cssOverrides["LAUNCHER-MOBILE-color-text"] = accentColorBW;
|
|
117
|
-
cssOverrides["ACCENT-color-bw"] = accentColorBW;
|
|
118
|
-
cssOverrides["ACCENT-color-bw-hover"] = adjustLightness(accentColorBW, -8);
|
|
119
|
-
cssOverrides["ACCENT-color-bw-active"] = adjustLightness(accentColorBW, -10);
|
|
120
|
-
cssOverrides["ACCENT-color-bw-inverse"] = accentColorBW === gray100 ? white : gray100;
|
|
121
|
-
cssOverrides["ACCENT-color-bw-gray"] = accentColorBW === gray100 ? gray80 : gray10;
|
|
122
|
-
cssOverrides["ACCENT-color-pastel"] = accentColorBW === gray100 ? adjustLightness(accentColor, 20) : adjustLightness(accentColor, -15);
|
|
123
|
-
}
|
|
124
|
-
return cssOverrides;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const ACCENT_COLOR_MAPS = {
|
|
128
|
-
white: {
|
|
129
|
-
blue20: [ "$highlight" ],
|
|
130
|
-
blue60: [ "$background-brand", "$interactive", "$border-interactive", "$button-primary", "$button-tertiary", "$icon-interactive", "$focus" ],
|
|
131
|
-
blue60Hover: [ "$button-primary-hover", "$button-tertiary-hover" ],
|
|
132
|
-
blue80: [ "$button-primary-active", "$button-tertiary-active" ]
|
|
133
|
-
},
|
|
134
|
-
g10: {
|
|
135
|
-
blue20: [ "$highlight" ],
|
|
136
|
-
blue60: [ "$background-brand", "$interactive", "$border-interactive", "$button-primary", "$button-tertiary", "$icon-interactive", "$focus" ],
|
|
137
|
-
blue60Hover: [ "$button-primary-hover", "$button-tertiary-hover" ],
|
|
138
|
-
blue80: [ "$button-primary-active", "$button-tertiary-active" ]
|
|
139
|
-
},
|
|
140
|
-
g90: {
|
|
141
|
-
blue20: [],
|
|
142
|
-
blue60: [ "$background-brand", "$interactive", "$border-interactive", "$button-primary", "$button-tertiary", "$focus-inverse" ],
|
|
143
|
-
blue60Hover: [ "$button-primary-hover", "$button-tertiary-hover" ],
|
|
144
|
-
blue80: [ "$button-primary-active", "$highlight", "$button-tertiary-active" ]
|
|
145
|
-
},
|
|
146
|
-
g100: {
|
|
147
|
-
blue20: [],
|
|
148
|
-
blue60: [ "$background-brand", "$interactive", "$border-interactive", "$button-primary", "$button-tertiary", "$focus-inverse" ],
|
|
149
|
-
blue60Hover: [ "$button-primary-hover", "$button-tertiary-hover" ],
|
|
150
|
-
blue80: [ "$button-primary-active", "$highlight", "$button-tertiary-active" ]
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
function fillValues(styles, propertyNames, value) {
|
|
155
|
-
propertyNames.forEach(propertyName => {
|
|
156
|
-
styles[propertyName] = value;
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function mergeCSSVariables(publicVars, whiteLabelVariables, carbonTheme, useAITheme) {
|
|
161
|
-
carbonTheme = carbonTheme || CarbonTheme.G10;
|
|
162
|
-
useAITheme = useAITheme || false;
|
|
163
|
-
publicVars = publicVars || {};
|
|
164
|
-
const internalOverrides = createInternalCSSOverridesMap(carbonTheme, useAITheme);
|
|
165
|
-
const result = {
|
|
166
|
-
...internalOverrides,
|
|
167
|
-
...publicVars
|
|
168
|
-
};
|
|
169
|
-
Object.entries(result).forEach(([key, value]) => {
|
|
170
|
-
if (key.startsWith("$") && !value.match(HEXADECIMAL_REGEX)) {
|
|
171
|
-
console.warn(`${WA_CONSOLE_PREFIX} You tried to call "updateCSSVariables" with an invalid value for "${key}": "${publicVars[key]}". You must use hexadecimal values for colors.`);
|
|
172
|
-
delete result[key];
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
const remoteVars = remoteStylesToCSSVars(whiteLabelVariables || {}, carbonTheme);
|
|
176
|
-
Object.entries(remoteVars).forEach(([key, value]) => {
|
|
177
|
-
if (value !== "" && publicVars[key] === undefined) {
|
|
178
|
-
result[key] = value;
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
return result;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function createInternalCSSOverridesMap(carbonTheme, useAITheme) {
|
|
185
|
-
let internalOverridesMap = {};
|
|
186
|
-
if (!useAITheme) {
|
|
187
|
-
if ([ CarbonTheme.G10, CarbonTheme.WHITE ].includes(carbonTheme)) {
|
|
188
|
-
internalOverridesMap = {
|
|
189
|
-
...internalOverridesMap,
|
|
190
|
-
...INTERNAL_OVERRIDES_LIGHT_THEME_MAP
|
|
191
|
-
};
|
|
192
|
-
} else if ([ CarbonTheme.G90, CarbonTheme.G100 ].includes(carbonTheme)) {
|
|
193
|
-
internalOverridesMap = {
|
|
194
|
-
...internalOverridesMap,
|
|
195
|
-
...INTERNAL_OVERRIDES_DARK_THEME_MAP
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
return internalOverridesMap;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function getThemeClassNames(themeState) {
|
|
203
|
-
let themeClassnames;
|
|
204
|
-
switch (themeState?.carbonTheme) {
|
|
205
|
-
case CarbonTheme.WHITE:
|
|
206
|
-
themeClassnames = CarbonThemeClassNames.WHITE;
|
|
207
|
-
break;
|
|
208
|
-
|
|
209
|
-
case CarbonTheme.G10:
|
|
210
|
-
themeClassnames = CarbonThemeClassNames.G10;
|
|
211
|
-
break;
|
|
212
|
-
|
|
213
|
-
case CarbonTheme.G90:
|
|
214
|
-
themeClassnames = CarbonThemeClassNames.G90;
|
|
215
|
-
break;
|
|
216
|
-
|
|
217
|
-
case CarbonTheme.G100:
|
|
218
|
-
themeClassnames = CarbonThemeClassNames.G100;
|
|
219
|
-
break;
|
|
220
|
-
|
|
221
|
-
default:
|
|
222
|
-
themeClassnames = CarbonThemeClassNames.G10;
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
if (themeState?.useAITheme) {
|
|
226
|
-
themeClassnames += " WAC--aiTheme";
|
|
227
|
-
}
|
|
228
|
-
return themeClassnames;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export { convertCSSVariablesToString, getThemeClassNames, mergeCSSVariables };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import dayjs from "dayjs";
|
|
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 timestampToTimeString(timestamp) {
|
|
11
|
-
return dayjs(timestamp).format("LT");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { timestampToTimeString };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { VIEW_STATE_ALL_CLOSED } from "../store/reducerUtils.js";
|
|
2
|
-
|
|
3
|
-
import { consoleError } from "./miscUtils.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 constructViewState(newView, appState) {
|
|
13
|
-
const {viewState: viewState} = appState.persistedToBrowserStorage.launcherState;
|
|
14
|
-
let newViewState;
|
|
15
|
-
if (typeof newView === "string") {
|
|
16
|
-
newViewState = {
|
|
17
|
-
...VIEW_STATE_ALL_CLOSED,
|
|
18
|
-
[newView]: true
|
|
19
|
-
};
|
|
20
|
-
} else {
|
|
21
|
-
newViewState = {
|
|
22
|
-
...viewState,
|
|
23
|
-
...newView
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
return newViewState;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function validateViewState(viewState, appState) {
|
|
30
|
-
const {activeTour: activeTour} = appState.persistedToBrowserStorage.launcherState;
|
|
31
|
-
if (viewState.tour && !activeTour) {
|
|
32
|
-
consoleError("Error changing the view. The new view was supposed to show a tour however there is no active tour to show." + " Changing the view has been canceled.");
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { constructViewState, validateViewState };
|
package/dist/es/chat/web-components/components/chainOfThought/cds-aichat-chain-of-thought.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
|
|
3
|
-
import { carbonElement } from "../../decorators/customElement.js";
|
|
4
|
-
|
|
5
|
-
import { ChainOfThoughtElement } from "./src/ChainOfThoughtElement.js";
|
|
6
|
-
|
|
7
|
-
import { chainOfThoughtElementTemplate } from "./src/chainOfThoughtElement.template.js";
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
* Copyright IBM Corp. 2025
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
13
|
-
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*
|
|
15
|
-
* @license
|
|
16
|
-
*/ const CHAIN_OF_THOUGHT_COMPONENT_TAG_NAME = `cds-aichat-chain-of-thought`;
|
|
17
|
-
|
|
18
|
-
let CDSChatChainOfThoughtElement = class CDSChatChainOfThoughtElement extends ChainOfThoughtElement {
|
|
19
|
-
render() {
|
|
20
|
-
return chainOfThoughtElementTemplate(this);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
CDSChatChainOfThoughtElement = __decorate([ carbonElement(CHAIN_OF_THOUGHT_COMPONENT_TAG_NAME) ], CDSChatChainOfThoughtElement);
|
|
25
|
-
|
|
26
|
-
export { CHAIN_OF_THOUGHT_COMPONENT_TAG_NAME, CDSChatChainOfThoughtElement as default };
|