@gooddata/sdk-ui-gen-ai 11.68.0-alpha.4 → 11.68.0-alpha.6
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/NOTICE +12065 -59791
- package/README.md +8 -0
- package/esm/components/messages/contents/CustomHyperlink.d.ts +3 -2
- package/esm/components/messages/contents/CustomHyperlink.d.ts.map +1 -1
- package/esm/components/messages/contents/CustomHyperlink.js +6 -8
- package/esm/context/dashboard.d.ts +2 -2
- package/esm/context/dashboard.d.ts.map +1 -1
- package/esm/context/dashboard.js +2 -1
- package/esm/context/hooks/useDashboardAmbientContext.d.ts.map +1 -1
- package/esm/context/hooks/useDashboardAmbientContext.js +4 -3
- package/esm/store/sideEffects/onEvent.js +9 -0
- package/package.json +22 -22
package/README.md
CHANGED
|
@@ -34,6 +34,14 @@ Omitting the prop keeps the bundled localized placeholder ("Ask here…" in Engl
|
|
|
34
34
|
An empty string hides the placeholder. The standalone input's existing `placeholder` prop remains
|
|
35
35
|
supported, with `inputPlaceholder` taking precedence when both are supplied.
|
|
36
36
|
|
|
37
|
+
## Links in assistant answers
|
|
38
|
+
|
|
39
|
+
External HTTP(S) links in assistant answers are displayed as non-clickable text; enabling external
|
|
40
|
+
navigation is outside the current link-rendering policy. Bare URLs and URLs used as Markdown link
|
|
41
|
+
labels retain their literal URL characters, including underscores. Markdown links with descriptive
|
|
42
|
+
labels display those labels without enabling external navigation. Supported internal `gooddata://`
|
|
43
|
+
links retain their existing navigation and permission checks.
|
|
44
|
+
|
|
37
45
|
## Headless copilot workflow (alpha)
|
|
38
46
|
|
|
39
47
|
`CopilotHandler` owns plain immutable workflow state; it requires no Redux setup.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
import { type IChatConversationLocal } from "../../../model.js";
|
|
2
3
|
export type CustomHyperlinkOwnProps = {
|
|
3
4
|
href: string;
|
|
4
|
-
text:
|
|
5
|
+
text: ReactNode;
|
|
5
6
|
};
|
|
6
7
|
type CustomHyperlinkProps = CustomHyperlinkOwnProps & {
|
|
7
8
|
conversation?: IChatConversationLocal;
|
|
@@ -10,7 +11,7 @@ type CustomHyperlinkProps = CustomHyperlinkOwnProps & {
|
|
|
10
11
|
* Similar to SDK Hyperlink, but can handle customer schemas
|
|
11
12
|
* used for links management
|
|
12
13
|
*/
|
|
13
|
-
export declare function CustomHyperlinkComponent({ href, text, conversation }: CustomHyperlinkProps): string | import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function CustomHyperlinkComponent({ href, text, conversation }: CustomHyperlinkProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
14
15
|
export declare function CustomHyperlink({ href, text }: CustomHyperlinkOwnProps): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export {};
|
|
16
17
|
//# sourceMappingURL=CustomHyperlink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomHyperlink.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/CustomHyperlink.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomHyperlink.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/CustomHyperlink.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAIjE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAKhE,MAAM,MAAM,uBAAuB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,KAAK,oBAAoB,GAAG,uBAAuB,GAAG;IAClD,YAAY,CAAC,EAAE,sBAAsB,CAAC;CACzC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,oBAAoB,2UA4F1F;AAiBD,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,uBAAuB,2CAItE"}
|
|
@@ -5,7 +5,6 @@ import { useSelector } from "react-redux";
|
|
|
5
5
|
import { conversationSelector } from "../../../store/messages/messagesSelectors.js";
|
|
6
6
|
import { getPublisherDocumentHref } from "../../../utils.js";
|
|
7
7
|
import { useConfig } from "../../ConfigContext.js";
|
|
8
|
-
import { removeMarkdown } from "../../utils/markdownUtils.js";
|
|
9
8
|
/**
|
|
10
9
|
* Similar to SDK Hyperlink, but can handle customer schemas
|
|
11
10
|
* used for links management
|
|
@@ -14,7 +13,6 @@ export function CustomHyperlinkComponent({ href, text, conversation }) {
|
|
|
14
13
|
const { linkHandler, allowNativeLinks, canManage, canAnalyze, canCreateDocument } = useConfig();
|
|
15
14
|
const canManageMetrics = canManage || canAnalyze;
|
|
16
15
|
const canManageVisualisations = canManage || canAnalyze;
|
|
17
|
-
const plainText = removeMarkdown(text);
|
|
18
16
|
const parsedRef = useMemo(() => {
|
|
19
17
|
if (!href) {
|
|
20
18
|
return null;
|
|
@@ -48,7 +46,7 @@ export function CustomHyperlinkComponent({ href, text, conversation }) {
|
|
|
48
46
|
};
|
|
49
47
|
}, [href]);
|
|
50
48
|
if (!parsedRef) {
|
|
51
|
-
return
|
|
49
|
+
return text;
|
|
52
50
|
}
|
|
53
51
|
const handleLinkClick = (e) => {
|
|
54
52
|
if (!linkHandler) {
|
|
@@ -68,20 +66,20 @@ export function CustomHyperlinkComponent({ href, text, conversation }) {
|
|
|
68
66
|
// If the link is for a metric and the user cannot manage metrics,
|
|
69
67
|
// we do not render the link
|
|
70
68
|
if (parsedRef.type === "metric" && !canManageMetrics) {
|
|
71
|
-
return
|
|
69
|
+
return text;
|
|
72
70
|
}
|
|
73
71
|
// If the link is for a visualization and the user cannot manage visualizations,
|
|
74
72
|
// we do not render the link
|
|
75
73
|
if (parsedRef.type === "visualization" && !canManageVisualisations) {
|
|
76
|
-
return
|
|
74
|
+
return text;
|
|
77
75
|
}
|
|
78
76
|
if (parsedRef.type === "report" && !canCreateDocument) {
|
|
79
|
-
return
|
|
77
|
+
return text;
|
|
80
78
|
}
|
|
81
79
|
if (allowNativeLinks) {
|
|
82
|
-
return (_jsx("a", { className: "gd-hyperlink", href: parsedRef.itemUrl, onClick: handleLinkClick, children: _jsx("span", { className: "gd-hyperlink-text", children:
|
|
80
|
+
return (_jsx("a", { className: "gd-hyperlink", href: parsedRef.itemUrl, onClick: handleLinkClick, children: _jsx("span", { className: "gd-hyperlink-text", children: text }) }));
|
|
83
81
|
}
|
|
84
|
-
return (_jsx("span", { className: "gd-hyperlink", onClick: handleLinkClick, children: _jsx("span", { className: "gd-hyperlink-text", children:
|
|
82
|
+
return (_jsx("span", { className: "gd-hyperlink", onClick: handleLinkClick, children: _jsx("span", { className: "gd-hyperlink-text", children: text }) }));
|
|
85
83
|
}
|
|
86
84
|
const getItemUrl = (workspaceId, id, objectType) => {
|
|
87
85
|
switch (objectType) {
|
|
@@ -1,8 +1,8 @@
|
|
|
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";
|
|
1
|
+
import { type FilterContextItem, type GenAIUserContextFilter, type IAttributeDisplayFormMetadataObject, type IDashboardDefinition, type IGenAIDashboardContext, type IGenAIDashboardLiveFilters, type IGenAIObjectReference, type IGenAIUserContext, type IGenAIWidgetDescriptor, type IInsight, type IWidget, type ObjRef } from "@gooddata/sdk-model";
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare function buildDashboardContext(dashboard: Omit<IGenAIDashboardContext, "definition">, definition?: IDashboardDefinition): IGenAIUserContext;
|
|
5
|
+
export declare function buildDashboardContext(dashboard: Omit<IGenAIDashboardContext, "definition" | "liveFilters">, definition?: IDashboardDefinition, liveFilters?: IGenAIDashboardLiveFilters): IGenAIUserContext;
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -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,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,MAAM,EAUd,MAAM,qBAAqB,CAAC;AAM7B;;GAEG;AACH,wBAAgB,qBAAqB,CACjC,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE,YAAY,CAAC,
|
|
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,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAEtB,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,MAAM,EAUd,MAAM,qBAAqB,CAAC;AAM7B;;GAEG;AACH,wBAAgB,qBAAqB,CACjC,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE,YAAY,GAAG,aAAa,CAAC,EACrE,UAAU,CAAC,EAAE,oBAAoB,EACjC,WAAW,CAAC,EAAE,0BAA0B,GACzC,iBAAiB,CAUnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAC9B,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,SAAS,GAAG,uBAAuB,GAAG,UAAU,EAC5D,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,WAAW,GAAG,YAAY,CAAC,CAAC,GACpF,sBAAsB,CAOxB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAC/B,OAAO,EAAE,iBAAiB,EAAE,EAC5B,YAAY,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,mCAAmC,CAAC,EAAE,KAAK,CAAC,GAC7E,sBAAsB,EAAE,CA+E1B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAC/B,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC,GAAG,SAAS,EACpE,YAAY,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC,EACtE,yCAAyC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAClE,WAAW,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,EAChD,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,GACtD;IAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAAC,iBAAiB,EAAE,qBAAqB,EAAE,CAAA;CAAE,CA6EnF"}
|
package/esm/context/dashboard.js
CHANGED
|
@@ -6,12 +6,13 @@ import { buildContext } from "./build.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
export function buildDashboardContext(dashboard, definition) {
|
|
9
|
+
export function buildDashboardContext(dashboard, definition, liveFilters) {
|
|
10
10
|
return buildContext({
|
|
11
11
|
view: {
|
|
12
12
|
dashboard: {
|
|
13
13
|
...dashboard,
|
|
14
14
|
...(definition ? { definition } : {}),
|
|
15
|
+
...(liveFilters ? { liveFilters } : {}),
|
|
15
16
|
},
|
|
16
17
|
},
|
|
17
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDashboardAmbientContext.d.ts","sourceRoot":"","sources":["../../../src/context/hooks/useDashboardAmbientContext.ts"],"names":[],"mappings":"AAOA,OAAO,EAEH,KAAK,0BAA0B,
|
|
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;AAQpC,wBAAgB,0BAA0B,CAAC,iBAAiB,CAAC,EAAE,0BAA0B,GAAG,IAAI,QAS/F"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
import { useDispatch, useSelector } from "react-redux";
|
|
4
4
|
import { idRef, serializeObjRef } from "@gooddata/sdk-model";
|
|
5
|
-
import { newDisplayFormMap, selectActiveTab, selectAllFiltersForWidgetByRefAcrossTabs, selectAllTabsWidgetContexts, selectAttributeFilterDisplayFormsMap, selectDashboardId, selectDashboardTitle,
|
|
5
|
+
import { newDisplayFormMap, selectActiveTab, selectAllFiltersForWidgetByRefAcrossTabs, selectAllTabsWidgetContexts, selectAttributeFilterDisplayFormsMap, selectDashboardAiDefinition, selectDashboardAiLiveFilters, selectDashboardId, selectDashboardTitle, selectFilterContextFilters, selectIsNewDashboard, selectVisualizationSwitcherActiveVisualizations, } from "@gooddata/sdk-ui-dashboard";
|
|
6
6
|
import { dashboardFilterToFilterContextItem } from "@gooddata/sdk-ui-dashboard/internal";
|
|
7
7
|
import { contextSetupEnabledSelector } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
8
8
|
import { setAmbientUserContextAction } from "../../store/chatWindow/chatWindowSlice.js";
|
|
@@ -44,7 +44,8 @@ function buildFromDashboard(dashboardSelector) {
|
|
|
44
44
|
.filter((f) => !!f), displayForms));
|
|
45
45
|
}
|
|
46
46
|
const activeTab = selectWithOptional(dashboardSelector, selectActiveTab);
|
|
47
|
-
const
|
|
47
|
+
const aiDefinition = selectWithOptional(dashboardSelector, selectDashboardAiDefinition);
|
|
48
|
+
const liveFilters = selectWithOptional(dashboardSelector, selectDashboardAiLiveFilters);
|
|
48
49
|
const visualizationSwitcherActiveVisualizations = selectWithDefault(dashboardSelector, selectVisualizationSwitcherActiveVisualizations, {});
|
|
49
50
|
const resultsEnvelopes = dashboardSelector((state) => state.executionResults.entities);
|
|
50
51
|
const results = Object.entries(resultsEnvelopes).reduce((acc, [key, value]) => {
|
|
@@ -60,7 +61,7 @@ function buildFromDashboard(dashboardSelector) {
|
|
|
60
61
|
widgets,
|
|
61
62
|
filters,
|
|
62
63
|
...(activeTab ? { activeTabId: activeTab.localIdentifier } : {}),
|
|
63
|
-
},
|
|
64
|
+
}, aiDefinition, liveFilters));
|
|
64
65
|
}
|
|
65
66
|
function selectWithDefault(dashboardSelector, selector, defaultValue) {
|
|
66
67
|
try {
|
|
@@ -389,6 +389,15 @@ function convertMessageTypeTo(content) {
|
|
|
389
389
|
return "CREATE_VISUALIZATION";
|
|
390
390
|
case "kda":
|
|
391
391
|
return "CHANGE_ANALYSIS";
|
|
392
|
+
case "dashboard":
|
|
393
|
+
return "BUILD_DASHBOARD";
|
|
394
|
+
case "alertProposal":
|
|
395
|
+
return "ALERT";
|
|
396
|
+
case "publisherDocument":
|
|
397
|
+
case "publisherDocumentV2":
|
|
398
|
+
return "BUILD_DOCUMENT";
|
|
399
|
+
case "searchResults":
|
|
400
|
+
return "SEARCH_ALL";
|
|
392
401
|
default:
|
|
393
402
|
return "GENERAL";
|
|
394
403
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-gen-ai",
|
|
3
|
-
"version": "11.68.0-alpha.
|
|
3
|
+
"version": "11.68.0-alpha.6",
|
|
4
4
|
"description": "GoodData GenAI SDK",
|
|
5
5
|
"license": "LicenseRef-LICENSE",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -57,21 +57,21 @@
|
|
|
57
57
|
"reselect": "5.1.1",
|
|
58
58
|
"tslib": "2.8.1",
|
|
59
59
|
"uuid": "11.1.1",
|
|
60
|
-
"@gooddata/
|
|
61
|
-
"@gooddata/sdk-
|
|
62
|
-
"@gooddata/
|
|
63
|
-
"@gooddata/sdk-pluggable-application-model": "11.68.0-alpha.
|
|
64
|
-
"@gooddata/sdk-ui": "11.68.0-alpha.
|
|
65
|
-
"@gooddata/sdk-ui-
|
|
66
|
-
"@gooddata/sdk-ui
|
|
67
|
-
"@gooddata/sdk-ui-dashboard": "11.68.0-alpha.
|
|
68
|
-
"@gooddata/sdk-ui-filters": "11.68.0-alpha.
|
|
69
|
-
"@gooddata/sdk-ui-geo": "11.68.0-alpha.
|
|
70
|
-
"@gooddata/sdk-ui-kit": "11.68.0-alpha.
|
|
71
|
-
"@gooddata/sdk-ui-
|
|
72
|
-
"@gooddata/sdk-ui-semantic-search": "11.68.0-alpha.
|
|
73
|
-
"@gooddata/sdk-ui-
|
|
74
|
-
"@gooddata/util": "11.68.0-alpha.
|
|
60
|
+
"@gooddata/sdk-backend-spi": "11.68.0-alpha.6",
|
|
61
|
+
"@gooddata/sdk-model": "11.68.0-alpha.6",
|
|
62
|
+
"@gooddata/api-client-tiger": "11.68.0-alpha.6",
|
|
63
|
+
"@gooddata/sdk-pluggable-application-model": "11.68.0-alpha.6",
|
|
64
|
+
"@gooddata/sdk-ui-charts": "11.68.0-alpha.6",
|
|
65
|
+
"@gooddata/sdk-ui-ext": "11.68.0-alpha.6",
|
|
66
|
+
"@gooddata/sdk-ui": "11.68.0-alpha.6",
|
|
67
|
+
"@gooddata/sdk-ui-dashboard": "11.68.0-alpha.6",
|
|
68
|
+
"@gooddata/sdk-ui-filters": "11.68.0-alpha.6",
|
|
69
|
+
"@gooddata/sdk-ui-geo": "11.68.0-alpha.6",
|
|
70
|
+
"@gooddata/sdk-ui-kit": "11.68.0-alpha.6",
|
|
71
|
+
"@gooddata/sdk-ui-theme-provider": "11.68.0-alpha.6",
|
|
72
|
+
"@gooddata/sdk-ui-semantic-search": "11.68.0-alpha.6",
|
|
73
|
+
"@gooddata/sdk-ui-pivot": "11.68.0-alpha.6",
|
|
74
|
+
"@gooddata/util": "11.68.0-alpha.6"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@microsoft/api-documenter": "7.30.20",
|
|
@@ -110,12 +110,12 @@
|
|
|
110
110
|
"svgo": "2.8.4",
|
|
111
111
|
"typescript": "7.0.2",
|
|
112
112
|
"vitest": "5.0.4",
|
|
113
|
-
"@gooddata/
|
|
114
|
-
"@gooddata/
|
|
115
|
-
"@gooddata/oxlint-config": "11.68.0-alpha.
|
|
116
|
-
"@gooddata/reference-workspace": "11.68.0-alpha.
|
|
117
|
-
"@gooddata/sdk-backend-mockingbird": "11.68.0-alpha.
|
|
118
|
-
"@gooddata/stylelint-config": "11.68.0-alpha.
|
|
113
|
+
"@gooddata/i18n-toolkit": "11.68.0-alpha.6",
|
|
114
|
+
"@gooddata/eslint-config": "11.68.0-alpha.6",
|
|
115
|
+
"@gooddata/oxlint-config": "11.68.0-alpha.6",
|
|
116
|
+
"@gooddata/reference-workspace": "11.68.0-alpha.6",
|
|
117
|
+
"@gooddata/sdk-backend-mockingbird": "11.68.0-alpha.6",
|
|
118
|
+
"@gooddata/stylelint-config": "11.68.0-alpha.6"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
121
|
"react": "^18.0.0 || ^19.0.0",
|