@gooddata/sdk-ui-gen-ai 10.21.0-alpha.17 → 10.21.0-alpha.19
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/messages/contents/SearchContents.d.ts.map +1 -1
- package/esm/components/messages/contents/SearchContents.js +5 -3
- package/esm/components/messages/contents/SearchContents.js.map +1 -1
- package/esm/components/messages/contents/replaceLinks.d.ts +1 -1
- package/esm/components/messages/contents/replaceLinks.d.ts.map +1 -1
- package/esm/components/messages/contents/replaceLinks.js +7 -7
- package/esm/components/messages/contents/replaceLinks.js.map +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchContents.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/SearchContents.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchContents.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/SearchContents.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMnD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAYjE,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
// (C) 2024 GoodData Corporation
|
|
1
|
+
// (C) 2024-2025 GoodData Corporation
|
|
2
2
|
import React from "react";
|
|
3
3
|
import cx from "classnames";
|
|
4
4
|
import { replaceLinks } from "./replaceLinks.js";
|
|
5
5
|
import { MarkdownComponent } from "./Markdown.js";
|
|
6
|
+
import { useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
6
7
|
export const SearchContentsComponent = ({ content, useMarkdown }) => {
|
|
7
8
|
const className = cx("gd-gen-ai-chat__messages__content", "gd-gen-ai-chat__messages__content--search");
|
|
9
|
+
const workspace = useWorkspaceStrict();
|
|
8
10
|
const text = React.useMemo(() => {
|
|
9
|
-
return replaceLinks(content.text, content.searchResults);
|
|
10
|
-
}, [content.text, content.searchResults]);
|
|
11
|
+
return replaceLinks(content.text, content.searchResults, workspace);
|
|
12
|
+
}, [content.text, content.searchResults, workspace]);
|
|
11
13
|
return (React.createElement("div", { className: className },
|
|
12
14
|
React.createElement(MarkdownComponent, { allowMarkdown: useMarkdown }, text)));
|
|
13
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchContents.js","sourceRoot":"","sources":["../../../../src/components/messages/contents/SearchContents.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"SearchContents.js","sourceRoot":"","sources":["../../../../src/components/messages/contents/SearchContents.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOtD,MAAM,CAAC,MAAM,uBAAuB,GAAkC,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;IAC/F,MAAM,SAAS,GAAG,EAAE,CAAC,mCAAmC,EAAE,2CAA2C,CAAC,CAAC;IACvG,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IACvC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC5B,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IACxE,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IAErD,OAAO,CACH,6BAAK,SAAS,EAAE,SAAS;QACrB,oBAAC,iBAAiB,IAAC,aAAa,EAAE,WAAW,IAAG,IAAI,CAAqB,CACvE,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ISemanticSearchResultItem } from "@gooddata/sdk-model";
|
|
2
|
-
export declare const replaceLinks: (text: string, foundObjects: ISemanticSearchResultItem[]) => string;
|
|
2
|
+
export declare const replaceLinks: (text: string, foundObjects: ISemanticSearchResultItem[], workspaceId: string) => string;
|
|
3
3
|
//# sourceMappingURL=replaceLinks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceLinks.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/replaceLinks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAgBhE,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"replaceLinks.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/replaceLinks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAgBhE,eAAO,MAAM,YAAY,SACf,MAAM,gBACE,yBAAyB,EAAE,eAC5B,MAAM,KACpB,MAmBF,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
// (C) 2024 GoodData Corporation
|
|
2
|
-
const getFoundObjectLink = (obj) => {
|
|
1
|
+
// (C) 2024-2025 GoodData Corporation
|
|
2
|
+
const getFoundObjectLink = (obj, workspaceId) => {
|
|
3
3
|
switch (obj.type) {
|
|
4
4
|
case "visualization":
|
|
5
|
-
return `/analyze/#/${
|
|
5
|
+
return `/analyze/#/${workspaceId}/${obj.id}/edit`;
|
|
6
6
|
case "dashboard":
|
|
7
|
-
return `/dashboards/#/workspace/${
|
|
7
|
+
return `/dashboards/#/workspace/${workspaceId}/dashboard/${obj.id}`;
|
|
8
8
|
case "metric":
|
|
9
|
-
return `/metrics/#/${
|
|
9
|
+
return `/metrics/#/${workspaceId}/metric/${obj.id}`;
|
|
10
10
|
default:
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
const rx = /\{[^}][^.}]*\.[^}]+\}/g;
|
|
15
|
-
export const replaceLinks = (text, foundObjects) => {
|
|
15
|
+
export const replaceLinks = (text, foundObjects, workspaceId) => {
|
|
16
16
|
return text.replace(rx, (chunk) => {
|
|
17
17
|
const [objectType, ...objectIdChunks] = chunk.replace("{", "").replace("}", "").split(".");
|
|
18
18
|
const objectId = objectIdChunks.join(".");
|
|
@@ -20,7 +20,7 @@ export const replaceLinks = (text, foundObjects) => {
|
|
|
20
20
|
if (!obj) {
|
|
21
21
|
return chunk;
|
|
22
22
|
}
|
|
23
|
-
const href = getFoundObjectLink(obj);
|
|
23
|
+
const href = getFoundObjectLink(obj, workspaceId);
|
|
24
24
|
if (!href) {
|
|
25
25
|
return chunk;
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceLinks.js","sourceRoot":"","sources":["../../../../src/components/messages/contents/replaceLinks.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"replaceLinks.js","sourceRoot":"","sources":["../../../../src/components/messages/contents/replaceLinks.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAIrC,MAAM,kBAAkB,GAAG,CAAC,GAA8B,EAAE,WAAmB,EAAE,EAAE;IAC/E,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,eAAe;YAChB,OAAO,cAAc,WAAW,IAAI,GAAG,CAAC,EAAE,OAAO,CAAC;QACtD,KAAK,WAAW;YACZ,OAAO,2BAA2B,WAAW,cAAc,GAAG,CAAC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",
|
|
4
4
|
"description": "GoodData GenAI SDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"uuid": "^8.3.2",
|
|
46
46
|
"react-loading-skeleton": "^3.4.0",
|
|
47
47
|
"react-markdown": "^9.0.1",
|
|
48
|
-
"@gooddata/
|
|
49
|
-
"@gooddata/
|
|
50
|
-
"@gooddata/sdk-
|
|
51
|
-
"@gooddata/sdk-
|
|
52
|
-
"@gooddata/sdk-ui-charts": "10.21.0-alpha.
|
|
53
|
-
"@gooddata/sdk-ui-pivot": "10.21.0-alpha.
|
|
54
|
-
"@gooddata/
|
|
55
|
-
"@gooddata/
|
|
48
|
+
"@gooddata/api-client-tiger": "10.21.0-alpha.19",
|
|
49
|
+
"@gooddata/sdk-backend-spi": "10.21.0-alpha.19",
|
|
50
|
+
"@gooddata/sdk-model": "10.21.0-alpha.19",
|
|
51
|
+
"@gooddata/sdk-ui": "10.21.0-alpha.19",
|
|
52
|
+
"@gooddata/sdk-ui-charts": "10.21.0-alpha.19",
|
|
53
|
+
"@gooddata/sdk-ui-pivot": "10.21.0-alpha.19",
|
|
54
|
+
"@gooddata/sdk-ui-kit": "10.21.0-alpha.19",
|
|
55
|
+
"@gooddata/util": "10.21.0-alpha.19"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": "^16.10.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
"vitest-dom": "0.1.1",
|
|
102
102
|
"@types/react-native-listener": "~1.1.3",
|
|
103
103
|
"@types/uuid": "^8.3.4",
|
|
104
|
-
"@gooddata/i18n-toolkit": "10.21.0-alpha.
|
|
105
|
-
"@gooddata/reference-workspace": "10.21.0-alpha.
|
|
106
|
-
"@gooddata/sdk-backend-mockingbird": "10.21.0-alpha.
|
|
107
|
-
"@gooddata/sdk-ui-theme-provider": "10.21.0-alpha.
|
|
104
|
+
"@gooddata/i18n-toolkit": "10.21.0-alpha.19",
|
|
105
|
+
"@gooddata/reference-workspace": "10.21.0-alpha.19",
|
|
106
|
+
"@gooddata/sdk-backend-mockingbird": "10.21.0-alpha.19",
|
|
107
|
+
"@gooddata/sdk-ui-theme-provider": "10.21.0-alpha.19"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
110
|
"clean": "rm -rf ci dist esm coverage *.log styles/css tsconfig.tsbuildinfo",
|