@gooddata/sdk-ui-gen-ai 11.53.0 → 11.54.0-alpha.1
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/esm/components/GenAIChat.d.ts +7 -0
- package/esm/components/GenAIChat.d.ts.map +1 -1
- package/esm/components/GenAIChat.js +3 -1
- package/esm/components/GenAIChatContextIndicator.d.ts.map +1 -1
- package/esm/components/GenAIChatContextIndicator.js +31 -9
- package/esm/components/GenAIChatDialog.d.ts +2 -1
- package/esm/components/GenAIChatDialog.d.ts.map +1 -1
- package/esm/components/GenAIChatDialog.js +4 -4
- package/esm/components/GenAiChatContextChooser.js +1 -1
- package/esm/components/GenAiChatContextChooserBody.js +3 -3
- package/esm/components/hooks/useContextChangeAnnouncement.d.ts +9 -0
- package/esm/components/hooks/useContextChangeAnnouncement.d.ts.map +1 -0
- package/esm/components/hooks/useContextChangeAnnouncement.js +63 -0
- package/esm/components/hooks/useContextItems.js +1 -0
- package/esm/components/intelligence/data/deriveInteractionIntelligenceFromSteps.d.ts.map +1 -1
- package/esm/components/intelligence/data/deriveInteractionIntelligenceFromSteps.js +29 -2
- package/esm/components/messages/AssistantItem.d.ts.map +1 -1
- package/esm/components/messages/AssistantItem.js +1 -1
- package/esm/components/utils/icons.d.ts +3 -1
- package/esm/components/utils/icons.d.ts.map +1 -1
- package/esm/components/utils/icons.js +56 -3
- package/esm/context/collectContextReferences.d.ts.map +1 -1
- package/esm/context/collectContextReferences.js +4 -0
- package/esm/context/dashboard.d.ts +2 -2
- package/esm/context/dashboard.d.ts.map +1 -1
- package/esm/context/dashboard.js +10 -2
- package/esm/context/hooks/useDashboardAmbientContext.d.ts +3 -0
- package/esm/context/hooks/useDashboardAmbientContext.d.ts.map +1 -0
- package/esm/context/hooks/useDashboardAmbientContext.js +68 -0
- package/esm/hooks/useGenAiDispatcher.d.ts +11 -0
- package/esm/hooks/useGenAiDispatcher.d.ts.map +1 -0
- package/esm/hooks/useGenAiDispatcher.js +14 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +32 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +32 -0
- package/esm/sdk-ui-gen-ai.d.ts +17 -0
- package/esm/store/sideEffects/loadContextObjects.js +3 -3
- package/esm/types.d.ts +8 -0
- package/esm/types.d.ts.map +1 -1
- package/esm/utils.d.ts +1 -1
- package/esm/utils.d.ts.map +1 -1
- package/esm/utils.js +2 -1
- package/package.json +20 -20
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ComponentType } from "react";
|
|
2
|
+
import { type DashboardSelectorEvaluator } from "@gooddata/sdk-ui-dashboard";
|
|
2
3
|
import { type GenAIAssistantMode, type LinkHandlerEvent } from "./ConfigContext.js";
|
|
3
4
|
import { type GenAiStoreProps } from "./GenAiStore.js";
|
|
4
5
|
/**
|
|
@@ -33,6 +34,12 @@ export type GenAIAssistantProps = Omit<GenAiStoreProps, "children"> & {
|
|
|
33
34
|
* This will disable full control permissions for the user even if the user has them defined.
|
|
34
35
|
*/
|
|
35
36
|
disableFullControl?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Selector that is used to automatically build ambient context for the chat.
|
|
39
|
+
* If its provided, the chat will automatically load the dashboards and related data
|
|
40
|
+
* from it.
|
|
41
|
+
*/
|
|
42
|
+
dashboardSelector?: DashboardSelectorEvaluator;
|
|
36
43
|
/**
|
|
37
44
|
* Custom React node rendered when no conversation exists yet.
|
|
38
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChat.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["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D;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,uBAAiB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { BackendProvider, WorkspaceProvider, useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
3
|
+
import { useDashboardAmbientContext } from "../context/hooks/useDashboardAmbientContext.js";
|
|
3
4
|
import { IntlWrapper } from "../localization/IntlWrapper.js";
|
|
4
5
|
import { PermissionsProvider } from "../permissions/PermissionsContext.js";
|
|
5
6
|
import { usePermissions } from "../permissions/usePermissions.js";
|
|
@@ -24,7 +25,8 @@ export function GenAIAssistant(props) {
|
|
|
24
25
|
*/
|
|
25
26
|
export const GenAIChat = GenAIAssistant;
|
|
26
27
|
function GenAIContent(props) {
|
|
27
|
-
const { LandingScreenComponentProvider, DisclaimerComponentProvider, className, catalogItems } = props;
|
|
28
|
+
const { LandingScreenComponentProvider, DisclaimerComponentProvider, dashboardSelector, className, catalogItems, } = props;
|
|
28
29
|
const { permissions, loading } = usePermissions();
|
|
30
|
+
useDashboardAmbientContext(dashboardSelector);
|
|
29
31
|
return (_jsx(ConfigProvider, { catalogItems: catalogItems, canFullControl: props.disableFullControl ? false : (permissions.canManageProject ?? false), canManage: props.disableManage ? false : (permissions.canManageProject ?? false), canAnalyze: props.disableAnalyze ? false : (permissions.canCreateVisualization ?? false), children: _jsx(CustomizationProvider, { landingScreenComponentProvider: LandingScreenComponentProvider, disclaimerComponentProvider: DisclaimerComponentProvider, children: _jsx(GenAIChatWrapper, { initializing: loading, className: className }) }) }));
|
|
30
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatContextIndicator.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatContextIndicator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GenAIChatContextIndicator.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatContextIndicator.tsx"],"names":[],"mappings":"AA6BA,KAAK,iCAAiC,GAAG;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,EAAE,iCAAiC,kDAuExF"}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
|
-
import { useCallback } from "react";
|
|
4
|
-
import { useIntl } from "react-intl";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
|
+
import { defineMessages, useIntl } from "react-intl";
|
|
5
5
|
import { useDispatch, useSelector } from "react-redux";
|
|
6
|
-
import { UiChip } from "@gooddata/sdk-ui-kit";
|
|
6
|
+
import { UiChip, useIdPrefixed } from "@gooddata/sdk-ui-kit";
|
|
7
7
|
import { collectContextReferences } from "../context/collectContextReferences.js";
|
|
8
8
|
import { contextSetupEnabledSelector, userContextSelector } from "../store/chatWindow/chatWindowSelectors.js";
|
|
9
9
|
import { removeContextReferenceAction } from "../store/chatWindow/chatWindowSlice.js";
|
|
10
|
-
import {
|
|
10
|
+
import { useContextChangeAnnouncement } from "./hooks/useContextChangeAnnouncement.js";
|
|
11
|
+
import { getIconByObject, getTypeLabel } from "./utils/icons.js";
|
|
12
|
+
const msgs = defineMessages({
|
|
13
|
+
untitled: {
|
|
14
|
+
id: "gd.gen-ai.context.untitled",
|
|
15
|
+
},
|
|
16
|
+
remove: {
|
|
17
|
+
id: "gd.gen-ai.context.remove_context",
|
|
18
|
+
},
|
|
19
|
+
groupLabel: {
|
|
20
|
+
id: "gd.gen-ai.context.group.ariaLabel",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
11
23
|
/**
|
|
12
24
|
* Shows what ambient context the assistant is answering about — the open dashboard and its live
|
|
13
25
|
* filters (e.g. "Answering about: Revenue Dashboard · Region: Europe · Q1 2026"). Renders nothing
|
|
@@ -18,10 +30,11 @@ import { getIconByType } from "./utils/icons.js";
|
|
|
18
30
|
*/
|
|
19
31
|
export function GenAIChatContextIndicator({ onDelete }) {
|
|
20
32
|
const intl = useIntl();
|
|
21
|
-
const emptyReferenceLabel = intl.formatMessage(
|
|
33
|
+
const emptyReferenceLabel = intl.formatMessage(msgs.untitled);
|
|
34
|
+
const groupLabelId = useIdPrefixed("context-indicator-label");
|
|
22
35
|
const isContextSetupEnabled = useSelector(contextSetupEnabledSelector);
|
|
23
36
|
const context = useSelector(userContextSelector);
|
|
24
|
-
const references = collectContextReferences(context, emptyReferenceLabel);
|
|
37
|
+
const references = useMemo(() => collectContextReferences(context, emptyReferenceLabel), [context, emptyReferenceLabel]);
|
|
25
38
|
const dispatch = useDispatch();
|
|
26
39
|
const removeContextReference = useCallback((payload) => dispatch(removeContextReferenceAction(payload)), [dispatch]);
|
|
27
40
|
const onDeleteHandler = useCallback((reference) => {
|
|
@@ -30,8 +43,17 @@ export function GenAIChatContextIndicator({ onDelete }) {
|
|
|
30
43
|
onDelete?.();
|
|
31
44
|
};
|
|
32
45
|
}, [removeContextReference, onDelete]);
|
|
33
|
-
|
|
46
|
+
const announcement = useContextChangeAnnouncement(references);
|
|
47
|
+
if (!isContextSetupEnabled) {
|
|
34
48
|
return null;
|
|
35
49
|
}
|
|
36
|
-
return (
|
|
50
|
+
return (_jsxs(_Fragment, { children: [references.length > 0 ? (_jsxs(_Fragment, { children: [
|
|
51
|
+
_jsx("span", { className: "sr-only", id: groupLabelId, children: intl.formatMessage(msgs.groupLabel) }), _jsx("div", { className: "gd-gen-ai-chat__context-indicator", role: "group", "aria-labelledby": groupLabelId, children: references.map((reference, index) => (_jsx(UiChip, { isDisabled: true, isDeletable: true, ...getIconByObject(reference), label: reference.title, isExpandable: false, onDelete: onDeleteHandler(reference), accessibilityConfig: {
|
|
52
|
+
deleteAriaLabel: intl.formatMessage(msgs.remove, {
|
|
53
|
+
title: reference.title,
|
|
54
|
+
}),
|
|
55
|
+
iconBeforeAriaLabel: getTypeLabel(reference.type, intl),
|
|
56
|
+
} }, index))) })
|
|
57
|
+
] })) : null, _jsx("span", { className: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: announcement })
|
|
58
|
+
] }));
|
|
37
59
|
}
|
|
@@ -15,11 +15,12 @@ export type GenAIChatDialogProps = Omit<GenAiStoreProps, "children"> & {
|
|
|
15
15
|
returnFocusTo?: RefObject<HTMLElement | null> | string;
|
|
16
16
|
onLinkClick?: (linkClickEvent: LinkHandlerEvent) => string | undefined;
|
|
17
17
|
LandingScreenComponentProvider?: () => ComponentType;
|
|
18
|
+
DisclaimerComponentProvider?: () => ComponentType | null;
|
|
18
19
|
/**
|
|
19
20
|
* Set to false while the host renders its own overlay above the chat, so that Escape aimed at
|
|
20
21
|
* that overlay does not also close the chat (see GenAIChatOverlayExternalProps.closeOnEscape).
|
|
21
22
|
*/
|
|
22
23
|
closeOnEscape?: boolean;
|
|
23
24
|
};
|
|
24
|
-
export declare function GenAIChatDialog({ backend, workspace, locale, disabled, isOpen, onOpen, onClose, settings, className, dialogPosition, allowNativeLinks, returnFocusTo, objectTypes, includeTags, excludeTags, canManage, canAnalyze, canFullControl, eventHandlers, catalogItems, colorPalette, onLinkClick, onDispatcher, mode, LandingScreenComponentProvider, closeOnEscape }: GenAIChatDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function GenAIChatDialog({ backend, workspace, locale, disabled, isOpen, onOpen, onClose, settings, className, dialogPosition, allowNativeLinks, returnFocusTo, objectTypes, includeTags, excludeTags, canManage, canAnalyze, canFullControl, eventHandlers, catalogItems, colorPalette, onLinkClick, onDispatcher, mode, LandingScreenComponentProvider, DisclaimerComponentProvider, closeOnEscape }: GenAIChatDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
//# sourceMappingURL=GenAIChatDialog.d.ts.map
|
|
@@ -1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AS,EACT,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,cAAc,EACd,gBAAuB,EACvB,aAAa,EACb,WAAW,EACX,WAAW,EACX,WAAW,EACX,SAAiB,EACjB,UAAkB,EAClB,cAAsB,EACtB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,8BAA8B,EAC9B,2BAA2B,EAC3B,aAAa,EAChB,EAAE,oBAAoB,2CA+CtB"}
|
|
@@ -18,12 +18,12 @@ import { KeyDriverAnalysis } from "./KeyDriverAnalysis.js";
|
|
|
18
18
|
const DEFAULT_CHAT_Z_INDEX = 3000;
|
|
19
19
|
// - Must be more than DEFAULT_CHAT_Z_INDEX
|
|
20
20
|
const DEFAULT_KDA_Z_INDEX = 3050;
|
|
21
|
-
export function GenAIChatDialog({ backend, workspace, locale, disabled, isOpen, onOpen, onClose, settings, className, dialogPosition, allowNativeLinks = true, returnFocusTo, objectTypes, includeTags, excludeTags, canManage = false, canAnalyze = false, canFullControl = false, eventHandlers, catalogItems, colorPalette, onLinkClick, onDispatcher, mode, LandingScreenComponentProvider, closeOnEscape, }) {
|
|
21
|
+
export function GenAIChatDialog({ backend, workspace, locale, disabled, isOpen, onOpen, onClose, settings, className, dialogPosition, allowNativeLinks = true, returnFocusTo, objectTypes, includeTags, excludeTags, canManage = false, canAnalyze = false, canFullControl = false, eventHandlers, catalogItems, colorPalette, onLinkClick, onDispatcher, mode, LandingScreenComponentProvider, DisclaimerComponentProvider, closeOnEscape, }) {
|
|
22
22
|
const effectiveBackend = useBackendStrict(backend);
|
|
23
23
|
const effectiveWorkspace = useWorkspaceStrict(workspace);
|
|
24
|
-
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { backend: effectiveBackend, workspace: effectiveWorkspace, onDispatcher: onDispatcher, eventHandlers: eventHandlers, colorPalette: colorPalette, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, catalogItems: catalogItems, mode: mode, children: (genAIStore) => (_jsx(GenAIChatDialogContent, { genAIStore: genAIStore, backend: effectiveBackend, workspace: effectiveWorkspace, className: className, dialogPosition: dialogPosition, disabled: disabled, isOpen: isOpen, onOpen: onOpen, onClose: onClose, returnFocusTo: returnFocusTo, closeOnEscape: closeOnEscape, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, LandingScreenComponentProvider: LandingScreenComponentProvider })) }) }));
|
|
24
|
+
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { backend: effectiveBackend, workspace: effectiveWorkspace, onDispatcher: onDispatcher, eventHandlers: eventHandlers, colorPalette: colorPalette, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, catalogItems: catalogItems, mode: mode, children: (genAIStore) => (_jsx(GenAIChatDialogContent, { genAIStore: genAIStore, backend: effectiveBackend, workspace: effectiveWorkspace, className: className, dialogPosition: dialogPosition, disabled: disabled, isOpen: isOpen, onOpen: onOpen, onClose: onClose, returnFocusTo: returnFocusTo, closeOnEscape: closeOnEscape, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, LandingScreenComponentProvider: LandingScreenComponentProvider, DisclaimerComponentProvider: DisclaimerComponentProvider })) }) }));
|
|
25
25
|
}
|
|
26
|
-
function GenAIChatDialogContent({ genAIStore, backend, workspace, className, dialogPosition, disabled, isOpen, onOpen, onClose, returnFocusTo, onLinkClick, allowNativeLinks, catalogItems, canManage, canAnalyze, canFullControl, LandingScreenComponentProvider, closeOnEscape, }) {
|
|
26
|
+
function GenAIChatDialogContent({ genAIStore, backend, workspace, className, dialogPosition, disabled, isOpen, onOpen, onClose, returnFocusTo, onLinkClick, allowNativeLinks, catalogItems, canManage, canAnalyze, canFullControl, LandingScreenComponentProvider, DisclaimerComponentProvider, closeOnEscape, }) {
|
|
27
27
|
const open = useRef(onOpen);
|
|
28
28
|
open.current = onOpen;
|
|
29
29
|
const close = useRef(onClose);
|
|
@@ -63,6 +63,6 @@ function GenAIChatDialogContent({ genAIStore, backend, workspace, className, dia
|
|
|
63
63
|
const parentOverlayController = useOverlayController();
|
|
64
64
|
const chatOverlayController = useMemo(() => parentOverlayController ?? OverlayController.getInstance(DEFAULT_CHAT_Z_INDEX), [parentOverlayController]);
|
|
65
65
|
const kdaOverlayController = useMemo(() => parentOverlayController ?? OverlayController.getInstance(DEFAULT_KDA_Z_INDEX), [parentOverlayController]);
|
|
66
|
-
return (_jsx(BackendProvider, { backend: backend, children: _jsx(WorkspaceProvider, { workspace: workspace, children: _jsxs(OverlayControllerProvider, { overlayController: chatOverlayController, children: [isOpen && !disabled ? (_jsx(ConfigProvider, { allowNativeLinks: allowNativeLinks, linkHandler: onLinkClick, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, children: _jsx(CustomizationProvider, { landingScreenComponentProvider: LandingScreenComponentProvider, children: _jsx(GenAIChatOverlay, { className: className, dialogPosition: dialogPosition, returnFocusTo: returnFocusTo, closeOnEscape: closeOnEscape, onClose: onCloseHandler }) }) })) : null, _jsx(OverlayControllerProvider, { overlayController: kdaOverlayController, children: _jsx(KeyDriverAnalysis, {}) })
|
|
66
|
+
return (_jsx(BackendProvider, { backend: backend, children: _jsx(WorkspaceProvider, { workspace: workspace, children: _jsxs(OverlayControllerProvider, { overlayController: chatOverlayController, children: [isOpen && !disabled ? (_jsx(ConfigProvider, { allowNativeLinks: allowNativeLinks, linkHandler: onLinkClick, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, children: _jsx(CustomizationProvider, { landingScreenComponentProvider: LandingScreenComponentProvider, disclaimerComponentProvider: DisclaimerComponentProvider, children: _jsx(GenAIChatOverlay, { className: className, dialogPosition: dialogPosition, returnFocusTo: returnFocusTo, closeOnEscape: closeOnEscape, onClose: onCloseHandler }) }) })) : null, _jsx(OverlayControllerProvider, { overlayController: kdaOverlayController, children: _jsx(KeyDriverAnalysis, {}) })
|
|
67
67
|
] }) }) }));
|
|
68
68
|
}
|
|
@@ -30,7 +30,7 @@ export function GenAiChatContextChooser({ onAddContext }) {
|
|
|
30
30
|
if (!ambient) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
|
-
return (_jsx("div", { className: "gd-gen-ai-chat__input__context", children: _jsx(Dropdown, { alignPoints: [{ align: "tl bl", offset: { x: 0, y: 0 } }], closeOnEscape: true, fullscreenOnMobile: false, autofocusOnOpen: true, accessibilityConfig: {}, onOpenStateChanged: onOpenStateChanged, renderButton: ({ isOpen, toggleDropdown, accessibilityConfig }) => (_jsx(UiIconButton, { icon: "plus", variant: "tertiary", size: "small", dataTestId: "choose_context", isActive: isOpen, accessibilityConfig: {
|
|
33
|
+
return (_jsx("div", { className: "gd-gen-ai-chat__input__context", children: _jsx(Dropdown, { alignPoints: [{ align: "tl bl", offset: { x: 0, y: 0 } }], closeOnEscape: true, fullscreenOnMobile: false, autofocusOnOpen: true, accessibilityConfig: { popupRole: "dialog" }, onOpenStateChanged: onOpenStateChanged, renderButton: ({ isOpen, toggleDropdown, accessibilityConfig }) => (_jsx(UiIconButton, { icon: "plus", variant: "tertiary", size: "small", dataTestId: "choose_context", isActive: isOpen, accessibilityConfig: {
|
|
34
34
|
...accessibilityConfig,
|
|
35
35
|
ariaLabel: addContextLabel,
|
|
36
36
|
}, onClick: toggleDropdown, isDisabled: !search && !inputItems.length && !hasNextPage && !isLoading })), renderBody: ({ closeDropdown, ariaAttributes }) => (_jsx(GenAiChatContextChooserBody, { inputItems: inputItems, title: addContextLabel, titleId: titleId, search: search, onSearchChange: setSearch, isLoading: isLoading, hasNextPage: hasNextPage, loadNextPage: loadNextPage, ariaAttributes: ariaAttributes, closeDropdown: closeDropdown, onSelect: (item) => {
|
|
@@ -5,7 +5,7 @@ import cx from "classnames";
|
|
|
5
5
|
import { defineMessages, useIntl } from "react-intl";
|
|
6
6
|
import { useDebouncedState } from "@gooddata/sdk-ui";
|
|
7
7
|
import { DEFAULT_ITEM_HEIGHT, DETAILED_ANNOUNCEMENT_THRESHOLD, Input, NoData, ScopedIdStore, ShortenedText, UiIcon, UiPagedVirtualList, UiSearchResultsAnnouncement, UiSubmenuHeader, isTypingKey, useScopedIdStoreValue, } from "@gooddata/sdk-ui-kit";
|
|
8
|
-
import {
|
|
8
|
+
import { getIconByObject } from "./utils/icons.js";
|
|
9
9
|
const SEARCH_FIELD_VISIBILITY_THRESHOLD = 7;
|
|
10
10
|
const SEARCH_DEBOUNCE_MS = 300;
|
|
11
11
|
const MAX_VISIBLE_ITEMS = 7;
|
|
@@ -79,7 +79,7 @@ export function GenAiChatContextChooserBody({ inputItems, title, titleId, search
|
|
|
79
79
|
}, children: (item) => _jsx(ContextChooserItem, { item: item, onSelect: () => handleSelect(item) }) }) })) : (_jsx(NoData, { hasNoMatchingData: hasNoMatchingData, notFoundLabel: intl.formatMessage(msgs.noMatchingData), noDataLabel: intl.formatMessage(msgs.noDataAvailable) }))] }));
|
|
80
80
|
}
|
|
81
81
|
function ContextChooserItem({ item, onSelect }) {
|
|
82
|
-
const icon =
|
|
83
|
-
return (_jsxs("div", { className: "gd-list-item",
|
|
82
|
+
const icon = getIconByObject(item);
|
|
83
|
+
return (_jsxs("div", { className: "gd-list-item", onClick: onSelect, children: [icon.iconBefore ? _jsx(UiIcon, { size: 16, type: icon.iconBefore, color: icon.iconColor }) : null, _jsx(ShortenedText, { ellipsisPosition: "end", children: item.title })
|
|
84
84
|
] }));
|
|
85
85
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IGenAIContextObject } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Turns each change of the assistant context into one spoken sentence: what was added, what was
|
|
4
|
+
* removed, that the whole context was swapped (the user navigated to another dashboard), or that
|
|
5
|
+
* nothing is left.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function useContextChangeAnnouncement(references: IGenAIContextObject[]): string;
|
|
9
|
+
//# sourceMappingURL=useContextChangeAnnouncement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContextChangeAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useContextChangeAnnouncement.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAmB1D;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAwBtF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { defineMessages, useIntl } from "react-intl";
|
|
4
|
+
const msgs = defineMessages({
|
|
5
|
+
added: {
|
|
6
|
+
id: "gd.gen-ai.context.announcement.added",
|
|
7
|
+
},
|
|
8
|
+
removed: {
|
|
9
|
+
id: "gd.gen-ai.context.announcement.removed",
|
|
10
|
+
},
|
|
11
|
+
switched: {
|
|
12
|
+
id: "gd.gen-ai.context.announcement.switched",
|
|
13
|
+
},
|
|
14
|
+
empty: {
|
|
15
|
+
id: "gd.gen-ai.context.announcement.empty",
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
const ANNOUNCEMENT_DELAY = 250;
|
|
19
|
+
/**
|
|
20
|
+
* Turns each change of the assistant context into one spoken sentence: what was added, what was
|
|
21
|
+
* removed, that the whole context was swapped (the user navigated to another dashboard), or that
|
|
22
|
+
* nothing is left.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export function useContextChangeAnnouncement(references) {
|
|
26
|
+
const intl = useIntl();
|
|
27
|
+
const [announcement, setAnnouncement] = useState("");
|
|
28
|
+
const previousReferences = useRef(null);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const previous = previousReferences.current;
|
|
31
|
+
previousReferences.current = references;
|
|
32
|
+
if (previous === null) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const message = getAnnouncement(previous, references, intl);
|
|
36
|
+
if (!message) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
setAnnouncement("");
|
|
40
|
+
const timeout = setTimeout(() => setAnnouncement(message), ANNOUNCEMENT_DELAY);
|
|
41
|
+
return () => clearTimeout(timeout);
|
|
42
|
+
}, [references, intl]);
|
|
43
|
+
return announcement;
|
|
44
|
+
}
|
|
45
|
+
function getAnnouncement(previous, current, intl) {
|
|
46
|
+
const added = current.filter((item) => !previous.some((other) => other.id === item.id));
|
|
47
|
+
const removed = previous.filter((item) => !current.some((other) => other.id === item.id));
|
|
48
|
+
if (added.length === 0 && removed.length === 0) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
if (current.length === 0) {
|
|
52
|
+
return intl.formatMessage(msgs.empty);
|
|
53
|
+
}
|
|
54
|
+
if (added.length > 0 && removed.length > 0) {
|
|
55
|
+
return intl.formatMessage(msgs.switched, { titles: joinTitles(current) });
|
|
56
|
+
}
|
|
57
|
+
return added.length > 0
|
|
58
|
+
? intl.formatMessage(msgs.added, { titles: joinTitles(added) })
|
|
59
|
+
: intl.formatMessage(msgs.removed, { titles: joinTitles(removed) });
|
|
60
|
+
}
|
|
61
|
+
function joinTitles(references) {
|
|
62
|
+
return references.map((reference) => reference.title).join(", ");
|
|
63
|
+
}
|
|
@@ -73,6 +73,7 @@ function toContextObjects(items, type, emptyReferenceLabel) {
|
|
|
73
73
|
where: "referencedObjects",
|
|
74
74
|
title: item.title || emptyReferenceLabel || item.id,
|
|
75
75
|
nesting: 1,
|
|
76
|
+
...(item.visualizationUrl ? { visualizationUrl: item.visualizationUrl } : {}),
|
|
76
77
|
}));
|
|
77
78
|
}
|
|
78
79
|
function isSameObject(a, b) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deriveInteractionIntelligenceFromSteps.d.ts","sourceRoot":"","sources":["../../../../src/components/intelligence/data/deriveInteractionIntelligenceFromSteps.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAIxE,OAAO,KAAK,EAIR,wBAAwB,EACxB,8BAA8B,EAEjC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"deriveInteractionIntelligenceFromSteps.d.ts","sourceRoot":"","sources":["../../../../src/components/intelligence/data/deriveInteractionIntelligenceFromSteps.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAIxE,OAAO,KAAK,EAIR,wBAAwB,EACxB,8BAA8B,EAEjC,MAAM,YAAY,CAAC;AAmEpB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sCAAsC,CAClD,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,8BAA8B,GACtC,wBAAwB,CAoF1B;AAED;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAC/C,KAAK,EAAE,8BAA8B,GACtC,8BAA8B,CAgBhC"}
|
|
@@ -16,10 +16,36 @@ const CATEGORY_LABEL_MESSAGES = defineMessages({
|
|
|
16
16
|
});
|
|
17
17
|
/** `stepId` of the memory step. The backend records none for it, so this collides with no real one. */
|
|
18
18
|
const MEMORY_STEP_ID = "memory";
|
|
19
|
+
/**
|
|
20
|
+
* Skills hidden from the skill-routing card. Neither is user-configurable — Object search is
|
|
21
|
+
* auto-attached to every agent, Knowledge search comes from the agent's "AI knowledge" setting —
|
|
22
|
+
* so showing them implies a routing decision the model never made. The detail identifies skills
|
|
23
|
+
* by title only; these literals mirror the backend's `SearchSkill`/`KnowledgeSkill` title constants.
|
|
24
|
+
*/
|
|
25
|
+
const HIDDEN_SKILL_TITLES = ["Object search", "Knowledge search"];
|
|
26
|
+
/**
|
|
27
|
+
* Drops the hidden skills from a skill-routing detail, and the whole detail when no configurable
|
|
28
|
+
* skill was available — routing over auto-attached skills alone is no decision to display. Other
|
|
29
|
+
* categories pass through unchanged.
|
|
30
|
+
*/
|
|
31
|
+
function filterHiddenSkills(detail) {
|
|
32
|
+
if (detail.category !== "skillRouting") {
|
|
33
|
+
return detail;
|
|
34
|
+
}
|
|
35
|
+
const available = detail.available.filter((title) => !HIDDEN_SKILL_TITLES.includes(title));
|
|
36
|
+
if (available.length === 0) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
...detail,
|
|
41
|
+
available,
|
|
42
|
+
activated: detail.activated.filter((title) => !HIDDEN_SKILL_TITLES.includes(title)),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
19
45
|
/** The details of the work done before the first step — the memory applied to the turn. */
|
|
20
46
|
function preStepDetails(trace) {
|
|
21
47
|
return (trace.responseDetails ?? [])
|
|
22
|
-
.map(({ detail }) => detail)
|
|
48
|
+
.map(({ detail }) => (detail ? filterHiddenSkills(detail) : undefined))
|
|
23
49
|
.filter((detail) => !!detail);
|
|
24
50
|
}
|
|
25
51
|
/** How long that work took, and so the width of its step. 0 when it reported no duration. */
|
|
@@ -64,7 +90,8 @@ export function deriveInteractionIntelligenceFromSteps(responseId, trace) {
|
|
|
64
90
|
const index = position + firstStepIndex;
|
|
65
91
|
const actions = trace.detailsByStepId[step.stepId] ?? [];
|
|
66
92
|
const categoriesInStep = [];
|
|
67
|
-
for (const
|
|
93
|
+
for (const action of actions) {
|
|
94
|
+
const detail = action.detail ? filterHiddenSkills(action.detail) : undefined;
|
|
68
95
|
if (!detail) {
|
|
69
96
|
continue;
|
|
70
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantItem.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItem.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAMjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAQnE,KAAK,kBAAkB,GAAG;IACtB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AssistantItem.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItem.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAMjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAQnE,KAAK,kBAAkB,GAAG;IACtB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,kBAAkB,kDAiFrF"}
|
|
@@ -21,7 +21,7 @@ export function AssistantItemComponent({ message, groups, isLast }) {
|
|
|
21
21
|
const references = useToolsReferences(groups);
|
|
22
22
|
const [isInteractionIntelligenceOpen, setIsInteractionIntelligenceOpen] = useState(false);
|
|
23
23
|
const interactionIntelligenceEnabled = useSelector(interactionIntelligenceEnabledSelector);
|
|
24
|
-
const showInteractionIntelligence = interactionIntelligenceEnabled && !!message.responseId;
|
|
24
|
+
const showInteractionIntelligence = interactionIntelligenceEnabled && !!message.responseId && message.content.type !== "reasoning";
|
|
25
25
|
const interactionIntelligenceTotals = useInteractionIntelligenceTotals(showInteractionIntelligence ? message.responseId : "");
|
|
26
26
|
// The trigger only renders once its totals exist, so this is what actually shares the actions
|
|
27
27
|
// row with feedback — a message with no trace keeps its feedback exactly as before.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type IntlShape } from "react-intl";
|
|
1
2
|
import { type IconType, type ThemeColor } from "@gooddata/sdk-ui-kit";
|
|
2
3
|
import { type IGenAIContextObject } from "../../types.js";
|
|
3
|
-
export declare function
|
|
4
|
+
export declare function getIconByObject(object: Pick<IGenAIContextObject, "type" | "visualizationUrl">): {
|
|
4
5
|
iconBefore?: IconType;
|
|
5
6
|
iconColor?: ThemeColor;
|
|
6
7
|
};
|
|
8
|
+
export declare function getTypeLabel(type: IGenAIContextObject["type"], intl: IntlShape): string | undefined;
|
|
7
9
|
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/utils/icons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/utils/icons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAuC1D,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,kBAAkB,CAAC,GAAG;IAC7F,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,SAAS,CAAC,EAAE,UAAU,CAAC;CAC1B,CAgBA;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAUnG"}
|
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { defineMessages } from "react-intl";
|
|
3
|
+
const msgs = defineMessages({
|
|
4
|
+
typeDashboard: {
|
|
5
|
+
id: "gd.gen-ai.context.type.dashboard",
|
|
6
|
+
},
|
|
7
|
+
typeVisualization: {
|
|
8
|
+
id: "gd.gen-ai.context.type.visualization",
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const VISUALIZATION_TYPE_ICONS = {
|
|
12
|
+
area: "visualizationArea",
|
|
13
|
+
bar: "visualizationBar",
|
|
14
|
+
bubble: "visualizationBubble",
|
|
15
|
+
bullet: "visualizationBullet",
|
|
16
|
+
column: "visualizationColumn",
|
|
17
|
+
combo: "visualizationCombo",
|
|
18
|
+
combo2: "visualizationCombo",
|
|
19
|
+
dependencywheel: "visualizationDependencywheel",
|
|
20
|
+
donut: "visualizationDonut",
|
|
21
|
+
funnel: "visualizationFunnel",
|
|
22
|
+
headline: "visualizationHeadline",
|
|
23
|
+
heatmap: "visualizationHeatmap",
|
|
24
|
+
line: "visualizationLine",
|
|
25
|
+
pie: "visualizationPie",
|
|
26
|
+
pushpin: "visualizationPushpin",
|
|
27
|
+
pushpinnext: "visualizationPushpin",
|
|
28
|
+
pyramid: "visualizationPyramid",
|
|
29
|
+
repeater: "visualizationRepeater",
|
|
30
|
+
sankey: "visualizationSankey",
|
|
31
|
+
scatter: "visualizationScatter",
|
|
32
|
+
table: "visualizationTable",
|
|
33
|
+
tablenext: "visualizationTable",
|
|
34
|
+
treemap: "visualizationTreemap",
|
|
35
|
+
waterfall: "visualizationWaterfall",
|
|
36
|
+
xirr: "visualizationXirr",
|
|
37
|
+
};
|
|
38
|
+
export function getIconByObject(object) {
|
|
39
|
+
switch (object.type) {
|
|
4
40
|
case "dashboard":
|
|
5
41
|
return {
|
|
6
42
|
iconBefore: "dashboard",
|
|
@@ -9,10 +45,27 @@ export function getIconByType(type) {
|
|
|
9
45
|
case "visualization":
|
|
10
46
|
case "widget":
|
|
11
47
|
return {
|
|
12
|
-
iconBefore:
|
|
48
|
+
iconBefore: getVisualizationIcon(object.visualizationUrl),
|
|
13
49
|
iconColor: "complementary-6",
|
|
14
50
|
};
|
|
15
51
|
default:
|
|
16
52
|
return {};
|
|
17
53
|
}
|
|
18
54
|
}
|
|
55
|
+
export function getTypeLabel(type, intl) {
|
|
56
|
+
switch (type) {
|
|
57
|
+
case "dashboard":
|
|
58
|
+
return intl.formatMessage(msgs.typeDashboard);
|
|
59
|
+
case "visualization":
|
|
60
|
+
case "widget":
|
|
61
|
+
return intl.formatMessage(msgs.typeVisualization);
|
|
62
|
+
default:
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function getVisualizationIcon(visualizationUrl) {
|
|
67
|
+
const type = visualizationUrl?.split(":").at(-1);
|
|
68
|
+
return type && Object.hasOwn(VISUALIZATION_TYPE_ICONS, type)
|
|
69
|
+
? VISUALIZATION_TYPE_ICONS[type]
|
|
70
|
+
: "visualization";
|
|
71
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAGzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAwCvB;AAED,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAGzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAwCvB;AAED,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAuFvB"}
|
|
@@ -82,6 +82,7 @@ export function collectAvailableReferences(context, placeholderTitle) {
|
|
|
82
82
|
type: "widget",
|
|
83
83
|
context,
|
|
84
84
|
insightRef: widget.insightRef,
|
|
85
|
+
...(widget.visualizationUrl ? { visualizationUrl: widget.visualizationUrl } : {}),
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
break;
|
|
@@ -105,6 +106,9 @@ export function collectAvailableReferences(context, placeholderTitle) {
|
|
|
105
106
|
type: "widget",
|
|
106
107
|
context,
|
|
107
108
|
insightRef: visualization.insightRef,
|
|
109
|
+
...(visualization.visualizationUrl
|
|
110
|
+
? { visualizationUrl: visualization.visualizationUrl }
|
|
111
|
+
: {}),
|
|
108
112
|
});
|
|
109
113
|
}
|
|
110
114
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FilterContextItem, type GenAIUserContextFilter, type IAttributeDisplayFormMetadataObject, type IDashboardDefinition, type IGenAIDashboardContext, type IGenAIObjectReference, type IGenAIUserContext, type IGenAIWidgetDescriptor, type IWidget, type ObjRef } from "@gooddata/sdk-model";
|
|
1
|
+
import { type FilterContextItem, type GenAIUserContextFilter, type IAttributeDisplayFormMetadataObject, type IDashboardDefinition, type IGenAIDashboardContext, type IGenAIObjectReference, type IGenAIUserContext, type IGenAIWidgetDescriptor, type IInsight, type IWidget, type ObjRef } from "@gooddata/sdk-model";
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
@@ -14,7 +14,7 @@ export declare function buildFiltersContext(filters: FilterContextItem[], displa
|
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
-
export declare function buildWidgetsContext(widgetsMap: Pick<Map<ObjRef, IWidget>, "values" | "get"> | undefined, resultsIdMap?: Pick<Map<string, string | undefined>, "values" | "get">, visualizationSwitcherActiveVisualizations?: Record<string, string>): {
|
|
17
|
+
export declare function buildWidgetsContext(widgetsMap: Pick<Map<ObjRef, IWidget>, "values" | "get"> | undefined, resultsIdMap?: Pick<Map<string, string | undefined>, "values" | "get">, visualizationSwitcherActiveVisualizations?: Record<string, string>, insightsMap?: Pick<Map<ObjRef, IInsight>, "get">): {
|
|
18
18
|
widgets: IGenAIWidgetDescriptor[];
|
|
19
19
|
referencedObjects: IGenAIObjectReference[];
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/context/dashboard.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAEtB,KAAK,sBAAsB,EAC3B,KAAK,OAAO,EACZ,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/context/dashboard.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,mCAAmC,EACxC,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAEtB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ANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { isAttributeElementsByRef, isDashboardAttributeFilter, isDashboardDateFilter, isInsightWidget, isRichTextWidget, isVisualizationSwitcherWidget, objRefToString, serializeObjRef, } from "@gooddata/sdk-model";
|
|
2
|
+
import { insightVisualizationUrl, isAttributeElementsByRef, isDashboardAttributeFilter, isDashboardDateFilter, isInsightWidget, isRichTextWidget, isVisualizationSwitcherWidget, objRefToString, serializeObjRef, } from "@gooddata/sdk-model";
|
|
3
3
|
import { DEFAULT_MESSAGES } from "@gooddata/sdk-ui";
|
|
4
4
|
import { DateFilterHelpers } from "@gooddata/sdk-ui-filters";
|
|
5
5
|
import { buildContext } from "./build.js";
|
|
@@ -94,7 +94,7 @@ export function buildFiltersContext(filters, displayForms) {
|
|
|
94
94
|
/**
|
|
95
95
|
* @internal
|
|
96
96
|
*/
|
|
97
|
-
export function buildWidgetsContext(widgetsMap, resultsIdMap, visualizationSwitcherActiveVisualizations) {
|
|
97
|
+
export function buildWidgetsContext(widgetsMap, resultsIdMap, visualizationSwitcherActiveVisualizations, insightsMap) {
|
|
98
98
|
const widgets = [];
|
|
99
99
|
const referencedObjects = [];
|
|
100
100
|
if (!widgetsMap) {
|
|
@@ -114,6 +114,7 @@ export function buildWidgetsContext(widgetsMap, resultsIdMap, visualizationSwitc
|
|
|
114
114
|
widgets.push(buildWidgetContext(widget.title, widget.ref, "insight", {
|
|
115
115
|
insightRef: widget.insight,
|
|
116
116
|
resultId: resultsIdMap?.get(serializeObjRef(widget.ref)),
|
|
117
|
+
...visualizationUrlOf(insightsMap, widget.insight),
|
|
117
118
|
}));
|
|
118
119
|
referencedObjects.push({ type: "WIDGET", ref: widget.ref, title: widget.title });
|
|
119
120
|
}
|
|
@@ -127,10 +128,12 @@ export function buildWidgetsContext(widgetsMap, resultsIdMap, visualizationSwitc
|
|
|
127
128
|
resultId: activeVisualization
|
|
128
129
|
? resultsIdMap?.get(serializeObjRef(activeVisualization.ref))
|
|
129
130
|
: undefined,
|
|
131
|
+
...visualizationUrlOf(insightsMap, activeVisualization?.insight),
|
|
130
132
|
// All child insights, so the BE can execute the non-active children
|
|
131
133
|
// (which have no cached result).
|
|
132
134
|
visualizations: widget.visualizations.map((v) => buildWidgetContext(v.title, v.ref, "insight", {
|
|
133
135
|
insightRef: v.insight,
|
|
136
|
+
...visualizationUrlOf(insightsMap, v.insight),
|
|
134
137
|
})),
|
|
135
138
|
}));
|
|
136
139
|
referencedObjects.push({
|
|
@@ -147,6 +150,11 @@ export function buildWidgetsContext(widgetsMap, resultsIdMap, visualizationSwitc
|
|
|
147
150
|
}
|
|
148
151
|
return { widgets, referencedObjects };
|
|
149
152
|
}
|
|
153
|
+
//utils
|
|
154
|
+
function visualizationUrlOf(insightsMap, insightRef) {
|
|
155
|
+
const insight = insightRef ? insightsMap?.get(insightRef) : undefined;
|
|
156
|
+
return insight ? { visualizationUrl: insightVisualizationUrl(insight) } : {};
|
|
157
|
+
}
|
|
150
158
|
const GRANULARITY_TO_GENAI = {
|
|
151
159
|
"GDC.time.minute": "MINUTE",
|
|
152
160
|
"GDC.time.hour": "HOUR",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDashboardAmbientContext.d.ts","sourceRoot":"","sources":["../../../src/context/hooks/useDashboardAmbientContext.ts"],"names":[],"mappings":"AAOA,OAAO,EAEH,KAAK,0BAA0B,EAalC,MAAM,4BAA4B,CAAC;AAMpC,wBAAgB,0BAA0B,CAAC,iBAAiB,CAAC,EAAE,0BAA0B,QAQxF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { useDispatch } from "react-redux";
|
|
4
|
+
import { idRef } from "@gooddata/sdk-model";
|
|
5
|
+
import { newDisplayFormMap, newMapForObjectWithIdentity, selectActiveTab, selectAttributeFilterDisplayFormsMap, selectDashboardId, selectDashboardTitle, selectDashboardWorkingDefinition, selectFilterContextFilters, selectIsNewDashboard, selectVisualizationSwitcherActiveVisualizations, selectWidgetsMap, } from "@gooddata/sdk-ui-dashboard";
|
|
6
|
+
import { setAmbientUserContextAction } from "../../store/chatWindow/chatWindowSlice.js";
|
|
7
|
+
import { mergeContexts } from "../build.js";
|
|
8
|
+
import { buildDashboardContext, buildFiltersContext, buildWidgetsContext } from "../dashboard.js";
|
|
9
|
+
export function useDashboardAmbientContext(dashboardSelector) {
|
|
10
|
+
const dispatch = useDispatch();
|
|
11
|
+
const used = useRef(false);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const context = dashboardSelector ? buildFromDashboard(dashboardSelector) : undefined;
|
|
14
|
+
setContext(dispatch, context, used);
|
|
15
|
+
}, [dashboardSelector, dispatch]);
|
|
16
|
+
}
|
|
17
|
+
function setContext(dispatch, context, used) {
|
|
18
|
+
if (context) {
|
|
19
|
+
dispatch(setAmbientUserContextAction({ userContext: context }));
|
|
20
|
+
used.current = true;
|
|
21
|
+
}
|
|
22
|
+
if (!context && used.current) {
|
|
23
|
+
dispatch(setAmbientUserContextAction({ userContext: undefined }));
|
|
24
|
+
used.current = false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function buildFromDashboard(dashboardSelector) {
|
|
28
|
+
const dashboardId = selectWithDefault(dashboardSelector, selectDashboardId, "new-dashboard");
|
|
29
|
+
const dashboardTitle = selectWithDefault(dashboardSelector, selectDashboardTitle, "");
|
|
30
|
+
const isNewDashboard = selectWithDefault(dashboardSelector, selectIsNewDashboard, false);
|
|
31
|
+
const filterContextItems = selectWithDefault(dashboardSelector, selectFilterContextFilters, []);
|
|
32
|
+
const displayForms = selectWithDefault(dashboardSelector, selectAttributeFilterDisplayFormsMap, newDisplayFormMap([]));
|
|
33
|
+
const widgetsMap = selectWithDefault(dashboardSelector, selectWidgetsMap, newMapForObjectWithIdentity([]));
|
|
34
|
+
const activeTab = selectWithOptional(dashboardSelector, selectActiveTab);
|
|
35
|
+
const workingDefinition = selectWithOptional(dashboardSelector, selectDashboardWorkingDefinition);
|
|
36
|
+
const visualizationSwitcherActiveVisualizations = selectWithDefault(dashboardSelector, selectVisualizationSwitcherActiveVisualizations, {});
|
|
37
|
+
const resultsEnvelopes = dashboardSelector((state) => state.executionResults.entities);
|
|
38
|
+
const results = Object.entries(resultsEnvelopes).reduce((acc, [key, value]) => {
|
|
39
|
+
acc.set(key, value.executionResult?.resultId() ?? undefined);
|
|
40
|
+
return acc;
|
|
41
|
+
}, new Map());
|
|
42
|
+
const filters = buildFiltersContext(filterContextItems ?? [], displayForms);
|
|
43
|
+
const { widgets } = buildWidgetsContext(widgetsMap, results, visualizationSwitcherActiveVisualizations);
|
|
44
|
+
return mergeContexts(buildDashboardContext({
|
|
45
|
+
ref: idRef(dashboardId, "analyticalDashboard"),
|
|
46
|
+
isNew: isNewDashboard,
|
|
47
|
+
title: dashboardTitle,
|
|
48
|
+
widgets,
|
|
49
|
+
filters,
|
|
50
|
+
...(activeTab ? { activeTabId: activeTab.localIdentifier } : {}),
|
|
51
|
+
}, workingDefinition));
|
|
52
|
+
}
|
|
53
|
+
function selectWithDefault(dashboardSelector, selector, defaultValue) {
|
|
54
|
+
try {
|
|
55
|
+
return dashboardSelector(selector) ?? defaultValue;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return defaultValue;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function selectWithOptional(dashboardSelector, selector) {
|
|
62
|
+
try {
|
|
63
|
+
return dashboardSelector(selector);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type EnhancedStore } from "@reduxjs/toolkit";
|
|
2
|
+
/**
|
|
3
|
+
* Hook to retrieve the GenAI dispatcher.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This hook must be used within a GenAiStore component.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare function useGenAiDispatcher(): EnhancedStore["dispatch"];
|
|
11
|
+
//# sourceMappingURL=useGenAiDispatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGenAiDispatcher.d.ts","sourceRoot":"","sources":["../../src/hooks/useGenAiDispatcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,aAAa,CAAC,UAAU,CAAC,CAE9D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
// (C) 2024-2026 GoodData Corporation
|
|
3
|
+
import { useDispatch } from "react-redux";
|
|
4
|
+
/**
|
|
5
|
+
* Hook to retrieve the GenAI dispatcher.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This hook must be used within a GenAiStore component.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export function useGenAiDispatcher() {
|
|
13
|
+
return useDispatch();
|
|
14
|
+
}
|
package/esm/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { clearThreadAction, newMessageAction, startNewConversationAction, setCur
|
|
|
12
12
|
export { setFullscreenAction, setUserContextAction, setAmbientUserContextAction, } from "./store/chatWindow/chatWindowSlice.js";
|
|
13
13
|
export { type LinkHandlerEvent, type GenAIAssistantMode } from "./components/ConfigContext.js";
|
|
14
14
|
export { useGenAiChatAvailability } from "./hooks/useGenAiChatAvailability.js";
|
|
15
|
+
export { useGenAiDispatcher } from "./hooks/useGenAiDispatcher.js";
|
|
15
16
|
export { GenAiInteractionIntelligence, type IGenAiInteractionIntelligenceProps, } from "./components/intelligence/GenAiInteractionIntelligence.js";
|
|
16
17
|
export { type InteractionIntelligenceMode } from "./components/intelligence/data/types.js";
|
|
17
18
|
export { DefaultLandingScreen, type LandingScreenProps } from "./components/customized/LandingScreen.js";
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EACH,SAAS,EACT,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,mBAAmB,GAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EACH,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,mCAAmC,EACxC,KAAK,sBAAsB,EAC3B,KAAK,8BAA8B,GACtC,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,iCAAiC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ageEvent, isChatUserMessageEvent, isChatClosedEvent,
|
|
|
13
13
|
export { clearThreadAction, newMessageAction, startNewConversationAction, setCurrentConversationAction, setSelectedAgentAction, } from "./store/messages/messagesSlice.js";
|
|
14
14
|
export { setFullscreenAction, setUserContextAction, setAmbientUserContextAction, } from "./store/chatWindow/chatWindowSlice.js";
|
|
15
15
|
export { useGenAiChatAvailability } from "./hooks/useGenAiChatAvailability.js";
|
|
16
|
+
export { useGenAiDispatcher } from "./hooks/useGenAiDispatcher.js";
|
|
16
17
|
//interaction intelligence
|
|
17
18
|
export { GenAiInteractionIntelligence, } from "./components/intelligence/GenAiInteractionIntelligence.js";
|
|
18
19
|
//customization
|
|
@@ -127,6 +127,38 @@ export declare const en_US: {
|
|
|
127
127
|
text: string;
|
|
128
128
|
crowdinContext: string;
|
|
129
129
|
};
|
|
130
|
+
"gd.gen-ai.context.group.ariaLabel": {
|
|
131
|
+
text: string;
|
|
132
|
+
crowdinContext: string;
|
|
133
|
+
};
|
|
134
|
+
"gd.gen-ai.context.type.dashboard": {
|
|
135
|
+
text: string;
|
|
136
|
+
crowdinContext: string;
|
|
137
|
+
};
|
|
138
|
+
"gd.gen-ai.context.type.visualization": {
|
|
139
|
+
text: string;
|
|
140
|
+
crowdinContext: string;
|
|
141
|
+
};
|
|
142
|
+
"gd.gen-ai.context.announcement.added": {
|
|
143
|
+
text: string;
|
|
144
|
+
crowdinContext: string;
|
|
145
|
+
};
|
|
146
|
+
"gd.gen-ai.context.announcement.removed": {
|
|
147
|
+
text: string;
|
|
148
|
+
crowdinContext: string;
|
|
149
|
+
};
|
|
150
|
+
"gd.gen-ai.context.announcement.switched": {
|
|
151
|
+
text: string;
|
|
152
|
+
crowdinContext: string;
|
|
153
|
+
};
|
|
154
|
+
"gd.gen-ai.context.announcement.empty": {
|
|
155
|
+
text: string;
|
|
156
|
+
crowdinContext: string;
|
|
157
|
+
};
|
|
158
|
+
"gd.gen-ai.context.remove_context": {
|
|
159
|
+
text: string;
|
|
160
|
+
crowdinContext: string;
|
|
161
|
+
};
|
|
130
162
|
"gd.gen-ai.context.untitled": {
|
|
131
163
|
text: string;
|
|
132
164
|
crowdinContext: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.localization-bundle.d.ts","sourceRoot":"","sources":["../../../src/localization/bundles/en-US.localization-bundle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"en-US.localization-bundle.d.ts","sourceRoot":"","sources":["../../../src/localization/bundles/en-US.localization-bundle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAikCjB,CAAC"}
|
|
@@ -129,6 +129,38 @@ export const en_US = {
|
|
|
129
129
|
"text": "Close add context",
|
|
130
130
|
"crowdinContext": "Accessibility label for the button that closes the AI chatbot add-context dialog"
|
|
131
131
|
},
|
|
132
|
+
"gd.gen-ai.context.group.ariaLabel": {
|
|
133
|
+
"text": "Assistant context",
|
|
134
|
+
"crowdinContext": "Accessible name for the group of chips listing the dashboards and visualizations the AI chatbot answers about"
|
|
135
|
+
},
|
|
136
|
+
"gd.gen-ai.context.type.dashboard": {
|
|
137
|
+
"text": "Dashboard",
|
|
138
|
+
"crowdinContext": "Accessibility label for the icon marking an AI chatbot context item as a dashboard. Read before the item title."
|
|
139
|
+
},
|
|
140
|
+
"gd.gen-ai.context.type.visualization": {
|
|
141
|
+
"text": "Visualization",
|
|
142
|
+
"crowdinContext": "Accessibility label for the icon marking an AI chatbot context item as a visualization. Read before the item title."
|
|
143
|
+
},
|
|
144
|
+
"gd.gen-ai.context.announcement.added": {
|
|
145
|
+
"text": "{titles} added to the assistant context.",
|
|
146
|
+
"crowdinContext": "Screen reader announcement made when items are added to the AI chatbot context. The placeholder is a comma separated list of item titles."
|
|
147
|
+
},
|
|
148
|
+
"gd.gen-ai.context.announcement.removed": {
|
|
149
|
+
"text": "{titles} removed from the assistant context.",
|
|
150
|
+
"crowdinContext": "Screen reader announcement made when items are removed from the AI chatbot context. The placeholder is a comma separated list of item titles."
|
|
151
|
+
},
|
|
152
|
+
"gd.gen-ai.context.announcement.switched": {
|
|
153
|
+
"text": "Assistant context switched to {titles}.",
|
|
154
|
+
"crowdinContext": "Screen reader announcement made when the whole AI chatbot context is replaced, e.g. after navigating to another dashboard. The placeholder is a comma separated list of item titles."
|
|
155
|
+
},
|
|
156
|
+
"gd.gen-ai.context.announcement.empty": {
|
|
157
|
+
"text": "The assistant context is now empty.",
|
|
158
|
+
"crowdinContext": "Screen reader announcement made when the last item is removed from the AI chatbot context"
|
|
159
|
+
},
|
|
160
|
+
"gd.gen-ai.context.remove_context": {
|
|
161
|
+
"text": "Remove {title} from context",
|
|
162
|
+
"crowdinContext": "Accessibility label for the button that removes one item (a dashboard or a visualization) from the AI chatbot context. The placeholder is the item title."
|
|
163
|
+
},
|
|
132
164
|
"gd.gen-ai.context.untitled": {
|
|
133
165
|
"text": "Untitled",
|
|
134
166
|
"crowdinContext": "Label for untitled objects in the AI chatbot context"
|
package/esm/sdk-ui-gen-ai.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { ActionCreatorWithoutPayload } from '@reduxjs/toolkit';
|
|
|
8
8
|
import { ActionCreatorWithPayload } from '@reduxjs/toolkit';
|
|
9
9
|
import { CatalogItem } from '@gooddata/sdk-model';
|
|
10
10
|
import { ComponentType } from 'react';
|
|
11
|
+
import { DashboardSelectorEvaluator } from '@gooddata/sdk-ui-dashboard';
|
|
11
12
|
import { EnhancedStore } from '@reduxjs/toolkit';
|
|
12
13
|
import type { GenAIChatInteractionUserFeedback } from '@gooddata/sdk-model';
|
|
13
14
|
import type { GenAIChatRoutingUseCase } from '@gooddata/sdk-model';
|
|
@@ -443,6 +444,12 @@ export declare type GenAIAssistantProps = Omit<GenAiStoreProps, "children"> & {
|
|
|
443
444
|
* This will disable full control permissions for the user even if the user has them defined.
|
|
444
445
|
*/
|
|
445
446
|
disableFullControl?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* Selector that is used to automatically build ambient context for the chat.
|
|
449
|
+
* If its provided, the chat will automatically load the dashboards and related data
|
|
450
|
+
* from it.
|
|
451
|
+
*/
|
|
452
|
+
dashboardSelector?: DashboardSelectorEvaluator;
|
|
446
453
|
/**
|
|
447
454
|
* Custom React node rendered when no conversation exists yet.
|
|
448
455
|
*/
|
|
@@ -1087,6 +1094,16 @@ export declare type TextContents = {
|
|
|
1087
1094
|
*/
|
|
1088
1095
|
export declare function useGenAiChatAvailability(backend: IAnalyticalBackend, workspaceId?: string, enabled?: boolean, canManage?: boolean): boolean;
|
|
1089
1096
|
|
|
1097
|
+
/**
|
|
1098
|
+
* Hook to retrieve the GenAI dispatcher.
|
|
1099
|
+
*
|
|
1100
|
+
* @remarks
|
|
1101
|
+
* This hook must be used within a GenAiStore component.
|
|
1102
|
+
*
|
|
1103
|
+
* @public
|
|
1104
|
+
*/
|
|
1105
|
+
export declare function useGenAiDispatcher(): EnhancedStore["dispatch"];
|
|
1106
|
+
|
|
1090
1107
|
/**
|
|
1091
1108
|
* @public
|
|
1092
1109
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
import { call, cancelled, getContext, put, select } from "redux-saga/effects";
|
|
3
|
-
import { insightRef, insightTitle } from "@gooddata/sdk-model";
|
|
3
|
+
import { insightRef, insightTitle, insightVisualizationUrl } from "@gooddata/sdk-model";
|
|
4
4
|
import { toContextListItem } from "../../utils.js";
|
|
5
5
|
import { contextObjectsSearchSelector, contextObjectsSelector } from "../chatWindow/chatWindowSelectors.js";
|
|
6
6
|
import { contextObjectsLoadFailedAction, contextObjectsLoadingAction, contextObjectsPageLoadedAction, setContextObjectsAction, } from "../chatWindow/chatWindowSlice.js";
|
|
@@ -77,7 +77,7 @@ function* getExternalItems(kind) {
|
|
|
77
77
|
}
|
|
78
78
|
return options
|
|
79
79
|
.getVisualizations()
|
|
80
|
-
?.map((insight) => toContextListItem(insightRef(insight), insightTitle(insight)));
|
|
80
|
+
?.map((insight) => toContextListItem(insightRef(insight), insightTitle(insight), insightVisualizationUrl(insight)));
|
|
81
81
|
}
|
|
82
82
|
function* queryDashboardsPage(page, search) {
|
|
83
83
|
const backend = yield getContext("backend");
|
|
@@ -109,7 +109,7 @@ function* queryVisualizationsPage(page, search) {
|
|
|
109
109
|
const queryCall = query.query.bind(query);
|
|
110
110
|
const result = yield call(queryCall);
|
|
111
111
|
return {
|
|
112
|
-
items: result.items.map((insight) => toContextListItem(insightRef(insight), insightTitle(insight))),
|
|
112
|
+
items: result.items.map((insight) => toContextListItem(insightRef(insight), insightTitle(insight), insightVisualizationUrl(insight))),
|
|
113
113
|
hasNextPage: hasNextPage(result),
|
|
114
114
|
};
|
|
115
115
|
}
|
package/esm/types.d.ts
CHANGED
|
@@ -102,6 +102,10 @@ export interface IGenAIContextObject {
|
|
|
102
102
|
where: "view.dashboard" | "referencedObjects";
|
|
103
103
|
context?: IGenAIObjectReference;
|
|
104
104
|
insightRef?: ObjRef;
|
|
105
|
+
/**
|
|
106
|
+
* Visualization URL of the insight (e.g. `local:bar`).
|
|
107
|
+
*/
|
|
108
|
+
visualizationUrl?: string;
|
|
105
109
|
}
|
|
106
110
|
/**
|
|
107
111
|
* Kind of the object lists offered by the context chooser, on top of the ambient ones.
|
|
@@ -116,6 +120,10 @@ export interface IGenAIContextListItem {
|
|
|
116
120
|
id: string;
|
|
117
121
|
ref: ObjRef;
|
|
118
122
|
title: string;
|
|
123
|
+
/**
|
|
124
|
+
* Visualization URL of the insight (e.g. `local:bar`). Set for the visualizations only.
|
|
125
|
+
*/
|
|
126
|
+
visualizationUrl?: string;
|
|
119
127
|
}
|
|
120
128
|
/**
|
|
121
129
|
* State of a single object list offered by the context chooser.
|
package/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sour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AC9B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,eAAe,GAAG,QAAQ,CAAC;IACjC,KAAK,EAAE,gBAAgB,GAAG,mBAAmB,CAAC;IAC9C,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,eAAe,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC"}
|
package/esm/utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type IntlShape } from "react-intl";
|
|
|
2
2
|
import { type GenAIObjectReferenceType, type IAttributeOrMeasure, type ObjRef } from "@gooddata/sdk-model";
|
|
3
3
|
import { type IChatConversationLocal } from "./model.js";
|
|
4
4
|
import { type IGenAIContextListItem, type IGenAIContextObject } from "./types.js";
|
|
5
|
-
export declare function toContextListItem(ref: ObjRef, title: string): IGenAIContextListItem;
|
|
5
|
+
export declare function toContextListItem(ref: ObjRef, title: string, visualizationUrl?: string): IGenAIContextListItem;
|
|
6
6
|
export declare function getVisualizationHref(wsId: string, visId: string, status: "draft" | "saved", useHostedAnalyticalDesigner?: boolean): string;
|
|
7
7
|
export declare function getDashboardHref(wsId: string, dasId: string, status: "draft" | "saved", useHostedDashboards?: boolean): string;
|
|
8
8
|
export declare function getAbsoluteVisualizationHref(wsId: string, visId: string, status: "draft" | "saved", useHostedAnalyticalDesigner?: boolean): string;
|
package/esm/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,MAAM,EAEd,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAElF,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,MAAM,EAEd,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAElF,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,gBAAgB,CAAC,EAAE,MAAM,GAC1B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AAC,OAAO,EAAE,mBAAmB,EAAE;;;;EAMnE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,sBAAsB,GAAG,MAAM,CAS5F;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAgC9D;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,wBAAwB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAa3G;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG,wBAAwB,CAe3G"}
|
package/esm/utils.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
2
|
import { isIdentifierRef, } from "@gooddata/sdk-model";
|
|
3
3
|
import { REFERENCE_REGEX } from "./components/completion/references.js";
|
|
4
|
-
export function toContextListItem(ref, title) {
|
|
4
|
+
export function toContextListItem(ref, title, visualizationUrl) {
|
|
5
5
|
return {
|
|
6
6
|
id: isIdentifierRef(ref) ? ref.identifier : ref.uri,
|
|
7
7
|
ref,
|
|
8
8
|
title,
|
|
9
|
+
...(visualizationUrl ? { visualizationUrl } : {}),
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
export function getVisualizationHref(wsId, visId, status, useHostedAnalyticalDesigner) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-gen-ai",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.54.0-alpha.1",
|
|
4
4
|
"description": "GoodData GenAI SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -57,18 +57,18 @@
|
|
|
57
57
|
"reselect": "5.1.1",
|
|
58
58
|
"tslib": "2.8.1",
|
|
59
59
|
"uuid": "11.1.1",
|
|
60
|
-
"@gooddata/api-client-tiger": "11.
|
|
61
|
-
"@gooddata/sdk-backend-spi": "11.
|
|
62
|
-
"@gooddata/sdk-model": "11.
|
|
63
|
-
"@gooddata/sdk-ui-charts": "11.
|
|
64
|
-
"@gooddata/sdk-ui": "11.
|
|
65
|
-
"@gooddata/sdk-ui-dashboard": "11.
|
|
66
|
-
"@gooddata/sdk-ui-
|
|
67
|
-
"@gooddata/sdk-ui-
|
|
68
|
-
"@gooddata/sdk-ui-
|
|
69
|
-
"@gooddata/sdk-ui-
|
|
70
|
-
"@gooddata/sdk-ui-
|
|
71
|
-
"@gooddata/util": "11.
|
|
60
|
+
"@gooddata/api-client-tiger": "11.54.0-alpha.1",
|
|
61
|
+
"@gooddata/sdk-backend-spi": "11.54.0-alpha.1",
|
|
62
|
+
"@gooddata/sdk-model": "11.54.0-alpha.1",
|
|
63
|
+
"@gooddata/sdk-ui-charts": "11.54.0-alpha.1",
|
|
64
|
+
"@gooddata/sdk-ui": "11.54.0-alpha.1",
|
|
65
|
+
"@gooddata/sdk-ui-dashboard": "11.54.0-alpha.1",
|
|
66
|
+
"@gooddata/sdk-ui-kit": "11.54.0-alpha.1",
|
|
67
|
+
"@gooddata/sdk-ui-pivot": "11.54.0-alpha.1",
|
|
68
|
+
"@gooddata/sdk-ui-filters": "11.54.0-alpha.1",
|
|
69
|
+
"@gooddata/sdk-ui-theme-provider": "11.54.0-alpha.1",
|
|
70
|
+
"@gooddata/sdk-ui-semantic-search": "11.54.0-alpha.1",
|
|
71
|
+
"@gooddata/util": "11.54.0-alpha.1"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -111,13 +111,13 @@
|
|
|
111
111
|
"typescript": "5.9.3",
|
|
112
112
|
"vitest": "4.1.8",
|
|
113
113
|
"vitest-dom": "0.1.1",
|
|
114
|
-
"@gooddata/
|
|
115
|
-
"@gooddata/
|
|
116
|
-
"@gooddata/oxlint-config": "11.
|
|
117
|
-
"@gooddata/reference-workspace": "11.
|
|
118
|
-
"@gooddata/sdk-
|
|
119
|
-
"@gooddata/
|
|
120
|
-
"@gooddata/
|
|
114
|
+
"@gooddata/i18n-toolkit": "11.54.0-alpha.1",
|
|
115
|
+
"@gooddata/eslint-config": "11.54.0-alpha.1",
|
|
116
|
+
"@gooddata/oxlint-config": "11.54.0-alpha.1",
|
|
117
|
+
"@gooddata/reference-workspace": "11.54.0-alpha.1",
|
|
118
|
+
"@gooddata/sdk-ui-theme-provider": "11.54.0-alpha.1",
|
|
119
|
+
"@gooddata/stylelint-config": "11.54.0-alpha.1",
|
|
120
|
+
"@gooddata/sdk-backend-mockingbird": "11.54.0-alpha.1"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
123
|
"react": "^18.0.0 || ^19.0.0",
|