@gooddata/sdk-ui-gen-ai 11.60.0-alpha.2 → 11.60.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/GenAIChat.d.ts +1 -1
- package/esm/components/GenAIChat.d.ts.map +1 -1
- package/esm/components/GenAIChatContextIndicator.d.ts.map +1 -1
- package/esm/components/GenAIChatContextIndicator.js +12 -1
- package/esm/components/GenAIStandaloneInput.d.ts +10 -0
- package/esm/components/GenAIStandaloneInput.d.ts.map +1 -1
- package/esm/components/GenAIStandaloneInput.js +8 -3
- package/esm/components/GenAiChatAgentSwitching.d.ts +2 -0
- package/esm/components/GenAiChatAgentSwitching.d.ts.map +1 -1
- package/esm/components/GenAiChatAgentSwitching.js +2 -2
- package/esm/components/GenAiChatContextChooser.d.ts +1 -1
- package/esm/components/GenAiChatContextChooser.d.ts.map +1 -1
- package/esm/components/GenAiChatContextChooser.js +0 -3
- package/esm/components/Input.d.ts.map +1 -1
- package/esm/components/Input.js +3 -6
- package/esm/components/completion/plugins/rehype-references.js +2 -5
- package/esm/components/messages/components/SemanticSearchTreeView.d.ts.map +1 -1
- package/esm/components/messages/components/SemanticSearchTreeView.js +0 -2
- package/esm/components/messages/contents/CustomHyperlink.d.ts.map +1 -1
- package/esm/components/messages/contents/CustomHyperlink.js +4 -7
- package/esm/components/messages/conversationContents/ConversationDashboardContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationDashboardContent.js +20 -3
- package/esm/components/messages/conversationContents/ConversationErrorContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationErrorContent.js +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts +2 -1
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.js +15 -12
- package/esm/context/build.d.ts.map +1 -1
- package/esm/context/build.js +1 -3
- package/esm/context/hooks/useDashboardAmbientContext.d.ts +1 -1
- package/esm/context/hooks/useDashboardAmbientContext.d.ts.map +1 -1
- package/esm/context/hooks/useDashboardAmbientContext.js +3 -3
- package/esm/hooks/useGenAIStandaloneInputData.d.ts +2 -1
- package/esm/hooks/useGenAIStandaloneInputData.d.ts.map +1 -1
- package/esm/hooks/useGenAIStandaloneInputData.js +17 -4
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/localization/bundles/de-DE.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/de-DE.localization-bundle.js +5 -6
- package/esm/localization/bundles/en-AU.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-AU.localization-bundle.js +5 -6
- package/esm/localization/bundles/en-GB.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-GB.localization-bundle.js +5 -6
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +12 -16
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +15 -19
- package/esm/localization/bundles/es-419.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/es-419.localization-bundle.js +5 -6
- package/esm/localization/bundles/es-ES.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/es-ES.localization-bundle.js +5 -6
- package/esm/localization/bundles/fi-FI.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/fi-FI.localization-bundle.js +5 -6
- package/esm/localization/bundles/fr-CA.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/fr-CA.localization-bundle.js +5 -6
- package/esm/localization/bundles/fr-FR.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/fr-FR.localization-bundle.js +5 -6
- package/esm/localization/bundles/id-ID.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/id-ID.localization-bundle.js +5 -6
- package/esm/localization/bundles/it-IT.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/it-IT.localization-bundle.js +5 -6
- package/esm/localization/bundles/ja-JP.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/ja-JP.localization-bundle.js +5 -6
- package/esm/localization/bundles/ko-KR.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/ko-KR.localization-bundle.js +5 -6
- package/esm/localization/bundles/nl-NL.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/nl-NL.localization-bundle.js +5 -6
- package/esm/localization/bundles/pl-PL.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/pl-PL.localization-bundle.js +5 -6
- package/esm/localization/bundles/pt-BR.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/pt-BR.localization-bundle.js +5 -6
- package/esm/localization/bundles/pt-PT.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/pt-PT.localization-bundle.js +5 -6
- package/esm/localization/bundles/ru-RU.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/ru-RU.localization-bundle.js +5 -6
- package/esm/localization/bundles/sl-SI.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/sl-SI.localization-bundle.js +5 -6
- package/esm/localization/bundles/th-TH.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/th-TH.localization-bundle.js +5 -6
- package/esm/localization/bundles/tr-TR.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/tr-TR.localization-bundle.js +5 -6
- package/esm/localization/bundles/uk-UA.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/uk-UA.localization-bundle.js +5 -6
- package/esm/localization/bundles/vi-VN.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/vi-VN.localization-bundle.js +5 -6
- package/esm/localization/bundles/zh-HK.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/zh-HK.localization-bundle.js +5 -6
- package/esm/localization/bundles/zh-Hans.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/zh-Hans.localization-bundle.js +5 -6
- package/esm/localization/bundles/zh-Hant.localization-bundle.d.ts +4 -5
- package/esm/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/zh-Hant.localization-bundle.js +5 -6
- package/esm/model.d.ts +7 -2
- package/esm/model.d.ts.map +1 -1
- package/esm/model.js +2 -2
- package/esm/sdk-ui-gen-ai.d.ts +40 -3
- package/esm/store/messages/messagesSlice.d.ts +23 -11
- package/esm/store/messages/messagesSlice.d.ts.map +1 -1
- package/esm/store/messages/messagesSlice.js +13 -1
- package/esm/store/sideEffects/loadAgents.js +1 -0
- package/esm/store/sideEffects/onVisualizationSuccessSave.d.ts +1 -2
- package/esm/store/sideEffects/onVisualizationSuccessSave.d.ts.map +1 -1
- package/esm/store/sideEffects/onVisualizationSuccessSave.js +2 -5
- package/esm/utils.d.ts +2 -2
- package/esm/utils.d.ts.map +1 -1
- package/esm/utils.js +5 -9
- package/package.json +20 -20
- package/styles/css/main.css +63 -66
- package/styles/css/main.css.map +1 -1
- package/styles/css/messages.css +63 -66
- package/styles/css/messages.css.map +1 -1
- package/styles/scss/messages.scss +67 -13
|
@@ -39,7 +39,7 @@ export type GenAIAssistantProps = Omit<GenAiStoreProps, "children"> & {
|
|
|
39
39
|
* If its provided, the chat will automatically load the dashboards and related data
|
|
40
40
|
* from it.
|
|
41
41
|
*/
|
|
42
|
-
dashboardSelector?: DashboardSelectorEvaluator;
|
|
42
|
+
dashboardSelector?: DashboardSelectorEvaluator | null;
|
|
43
43
|
/**
|
|
44
44
|
* Customizations for the Gen AI assistant.
|
|
45
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChat.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAQ7E,OAAO,EAAkB,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEpG,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAInE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IAEvE;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChat.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAQ7E,OAAO,EAAkB,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEpG,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAInE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IAEvE;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAEtD;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAE1B;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CA0DxD;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,uBAAiB,CAAC"}
|
|
@@ -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":"AAoDA,KAAK,iCAAiC,GAAG;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,EAAE,iCAAiC,kDA8KxF"}
|
|
@@ -24,6 +24,15 @@ const msgs = defineMessages({
|
|
|
24
24
|
focusOn: {
|
|
25
25
|
id: "gd.gen-ai.context.focus_on",
|
|
26
26
|
},
|
|
27
|
+
stopUsingContext: {
|
|
28
|
+
id: "gd.gen-ai.context.stop_using_context",
|
|
29
|
+
},
|
|
30
|
+
startUsingContext: {
|
|
31
|
+
id: "gd.gen-ai.context.start_using_context",
|
|
32
|
+
},
|
|
33
|
+
context: {
|
|
34
|
+
id: "gd.gen-ai.context.context",
|
|
35
|
+
},
|
|
27
36
|
});
|
|
28
37
|
/**
|
|
29
38
|
* Shows what ambient context the assistant is answering about — the open dashboard and its live
|
|
@@ -79,7 +88,9 @@ export function GenAIChatContextIndicator({ onUpdate }) {
|
|
|
79
88
|
if (!item || !selectedContext) {
|
|
80
89
|
return null;
|
|
81
90
|
}
|
|
82
|
-
return (_jsx(UiChip, { isActionable: true, isExpandable: true, isActive: isOpen, ...getIconByObject(item), label: getSelectedTitle(selectedContext, emptyReferenceLabel), iconAction: selectedContext.activated ? "visible" : "invisible",
|
|
91
|
+
return (_jsx(UiChip, { isActionable: true, isExpandable: true, isActive: isOpen, ...getIconByObject(item), label: getSelectedTitle(selectedContext, emptyReferenceLabel), iconAction: selectedContext.activated ? "visible" : "invisible", actionIconTooltip: selectedContext.activated
|
|
92
|
+
? intl.formatMessage(msgs.stopUsingContext)
|
|
93
|
+
: intl.formatMessage(msgs.startUsingContext), tooltip: intl.formatMessage(msgs.context), variant: selectedContext.activated ? "normal" : "inactive", onClick: toggleDropdown, onAction: onAmbientToggleHandler(), accessibilityConfig: {
|
|
83
94
|
...accessibilityConfig,
|
|
84
95
|
deleteAriaLabel: intl.formatMessage(msgs.remove, {
|
|
85
96
|
title: getSelectedTitle(selectedContext, emptyReferenceLabel),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type AgentCustomSkill } from "@gooddata/sdk-model";
|
|
2
|
+
import { type GenAIAgent } from "../model.js";
|
|
1
3
|
import type { IGenAIAssistantSlots } from "./customized/types.js";
|
|
2
4
|
import { type GenAiStoreProps } from "./GenAiStore.js";
|
|
3
5
|
/**
|
|
@@ -16,6 +18,10 @@ export type GenAIStandaloneInputProps = Omit<GenAiStoreProps, "children"> & {
|
|
|
16
18
|
* Callback called when the user sets an agent.
|
|
17
19
|
*/
|
|
18
20
|
onAgentSet?: (agentId: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Callback called when the agents are loaded.
|
|
23
|
+
*/
|
|
24
|
+
onAgentsLoaded?: (agents: GenAIAgent[]) => void;
|
|
19
25
|
/**
|
|
20
26
|
* Additional class name for the input container.
|
|
21
27
|
*/
|
|
@@ -40,6 +46,10 @@ export type GenAIStandaloneInputProps = Omit<GenAiStoreProps, "children"> & {
|
|
|
40
46
|
* Customization slots for the assistant.
|
|
41
47
|
*/
|
|
42
48
|
slots?: IGenAIAssistantSlots;
|
|
49
|
+
/**
|
|
50
|
+
* Skills an agent must support to be listed in the input.
|
|
51
|
+
*/
|
|
52
|
+
requiredSkills?: AgentCustomSkill[];
|
|
43
53
|
};
|
|
44
54
|
/**
|
|
45
55
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIStandaloneInput.d.ts","sourceRoot":"","sources":["../../src/components/GenAIStandaloneInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GenAIStandaloneInput.d.ts","sourceRoot":"","sources":["../../src/components/GenAIStandaloneInput.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAWnE;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IACxE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B;;OAEG;IACH,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACvC,CAAC;AAsGF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAmBpE"}
|
|
@@ -19,16 +19,21 @@ const msgs = defineMessages({
|
|
|
19
19
|
id: "gd.gen-ai.input-placeholder",
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
|
-
function StandaloneInputContent({ onStart, onAgentSet, className, canManage, canAnalyze, placeholder, autofocus = true, }) {
|
|
22
|
+
function StandaloneInputContent({ onStart, onAgentSet, onAgentsLoaded, className, canManage, canAnalyze, placeholder, autofocus = true, requiredSkills, }) {
|
|
23
23
|
const intl = useIntl();
|
|
24
24
|
const [value, setValue] = useState("");
|
|
25
25
|
const [editorApi, setApi] = useState(null);
|
|
26
|
-
const { selectedAgentId, agentSwitchingEnabled } = useGenAIStandaloneInputData();
|
|
26
|
+
const { selectedAgentId, agentSwitchingEnabled, agents } = useGenAIStandaloneInputData(requiredSkills);
|
|
27
27
|
useEffect(() => {
|
|
28
28
|
if (selectedAgentId) {
|
|
29
29
|
onAgentSet?.(selectedAgentId);
|
|
30
30
|
}
|
|
31
31
|
}, [selectedAgentId, onAgentSet]);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (agents) {
|
|
34
|
+
onAgentsLoaded?.(agents);
|
|
35
|
+
}
|
|
36
|
+
}, [agents, onAgentsLoaded]);
|
|
32
37
|
const { isFullscreen, isBigScreen, isSmallScreen } = useFullscreenCheck();
|
|
33
38
|
const { onCompletion, used } = useCompletion([], { canManage, canAnalyze });
|
|
34
39
|
const { highlightExtension, atomicCursorExtension } = useHighlight(used);
|
|
@@ -60,7 +65,7 @@ function StandaloneInputContent({ onStart, onAgentSet, className, canManage, can
|
|
|
60
65
|
"gd-gen-ai-chat__input--big-screen": isBigScreen,
|
|
61
66
|
"gd-gen-ai-chat__input--small-screen": isSmallScreen,
|
|
62
67
|
"gd-gen-ai-chat__input--agent-switching": agentSwitchingEnabled,
|
|
63
|
-
}), children: _jsx("div", { className: "gd-gen-ai-chat__input__content", children: _jsxs("div", { className: "gd-gen-ai-chat__input__container", children: [_jsx("div", { className: "gd-gen-ai-chat__input__text", ...ref, children: _jsx(SyntaxHighlightingInput, { className: "gd-gen-ai-chat__input__mc", placeholder: placeholder ?? intl.formatMessage(msgs.placeholder), value: value, onApi: setApi, onChange: setValue, onKeyDown: handleKeyDown, beforeExtensions: beforeExtensions, extensions: extensions, onCompletion: onCompletion }) }), _jsx(GenAiChatAgentSwitching, { disabled: !value.trim(), agentDropdownDisabled: false, isAssistantLoading: false, isConversationsLoading: false, handleSubmit: handleSubmit })] }) }) }));
|
|
68
|
+
}), children: _jsx("div", { className: "gd-gen-ai-chat__input__content", children: _jsxs("div", { className: "gd-gen-ai-chat__input__container", children: [_jsx("div", { className: "gd-gen-ai-chat__input__text", ...ref, children: _jsx(SyntaxHighlightingInput, { className: "gd-gen-ai-chat__input__mc", placeholder: placeholder ?? intl.formatMessage(msgs.placeholder), value: value, onApi: setApi, onChange: setValue, onKeyDown: handleKeyDown, beforeExtensions: beforeExtensions, extensions: extensions, onCompletion: onCompletion }) }), _jsx(GenAiChatAgentSwitching, { agentsOverride: agents, disabled: !value.trim(), agentDropdownDisabled: false, isAssistantLoading: false, isConversationsLoading: false, handleSubmit: handleSubmit })] }) }) }));
|
|
64
69
|
}
|
|
65
70
|
const DEPENDENCIES_TO_LOAD = ["catalogItems", "agents"];
|
|
66
71
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type MouseEvent, type ReactNode } from "react";
|
|
2
|
+
import { type GenAIAgent } from "../model.js";
|
|
2
3
|
type GenAiChatAgentSwitchingOwnProps = {
|
|
3
4
|
disabled: boolean;
|
|
4
5
|
agentDropdownDisabled: boolean;
|
|
@@ -9,6 +10,7 @@ type GenAiChatAgentSwitchingOwnProps = {
|
|
|
9
10
|
setBusy?: (busy: boolean) => void;
|
|
10
11
|
setNoAgents?: (noAgents: boolean) => void;
|
|
11
12
|
leftContent?: ReactNode;
|
|
13
|
+
agentsOverride?: GenAIAgent[];
|
|
12
14
|
};
|
|
13
15
|
export declare function GenAiChatAgentSwitching(ownProps: GenAiChatAgentSwitchingOwnProps): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAiChatAgentSwitching.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatAgentSwitching.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAA0B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GenAiChatAgentSwitching.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatAgentSwitching.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAA0B,MAAM,OAAO,CAAC;AAQhF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AA8B9C,KAAK,+BAA+B,GAAG;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sBAAsB,EAAE,OAAO,CAAC;IAChC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC1D,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,cAAc,CAAC,EAAE,UAAU,EAAE,CAAC;CACjC,CAAC;AA8LF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,+BAA+B,2CAyChF"}
|
|
@@ -19,7 +19,7 @@ const msgs = defineMessages({
|
|
|
19
19
|
id: "gd.gen-ai.agent.unavailable",
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
|
-
function GenAiChatAgentSwitchingCore({ agentSwitchingEnabled, isAssistantLoading, isConversationsLoading, handleSubmit, conversations, conversation, agentDropdownDisabled, agents, selectedAgentId, selectedEffort, reasoningEffortEnabled, agentSwitchingActive, disabled, onMouseDown, setSelectedAgent, setSelectedEffort, setBusy, setNoAgents, leftContent, }) {
|
|
22
|
+
function GenAiChatAgentSwitchingCore({ agentSwitchingEnabled, isAssistantLoading, isConversationsLoading, handleSubmit, conversations, conversation, agentDropdownDisabled, agents, selectedAgentId, selectedEffort, reasoningEffortEnabled, agentSwitchingActive, disabled, onMouseDown, setSelectedAgent, setSelectedEffort, setBusy, setNoAgents, leftContent, agentsOverride, }) {
|
|
23
23
|
const intl = useIntl();
|
|
24
24
|
const { AgentChooserComponent } = useCustomization();
|
|
25
25
|
const sendLabel = intl.formatMessage(msgs.send);
|
|
@@ -28,7 +28,7 @@ function GenAiChatAgentSwitchingCore({ agentSwitchingEnabled, isAssistantLoading
|
|
|
28
28
|
agentSwitchingActive,
|
|
29
29
|
assistantLoading: isAssistantLoading,
|
|
30
30
|
conversationsLoading: isConversationsLoading,
|
|
31
|
-
agents,
|
|
31
|
+
agents: agentsOverride ?? agents,
|
|
32
32
|
selectedAgentId,
|
|
33
33
|
});
|
|
34
34
|
const effectiveSelectedAgentId = getEffectiveSelectedAgentId({
|
|
@@ -2,6 +2,6 @@ import { type IGenAIContextObject } from "../types.js";
|
|
|
2
2
|
type GenAiChatContextChooserOwnProps = {
|
|
3
3
|
onAddContext?: (context: IGenAIContextObject) => void;
|
|
4
4
|
};
|
|
5
|
-
export declare function GenAiChatContextChooser({ onAddContext }: GenAiChatContextChooserOwnProps): import("react/jsx-runtime").JSX.Element
|
|
5
|
+
export declare function GenAiChatContextChooser({ onAddContext }: GenAiChatContextChooserOwnProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=GenAiChatContextChooser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAiChatContextChooser.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatContextChooser.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAWvD,KAAK,+BAA+B,GAAG;IACnC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EAAE,YAAY,EAAE,EAAE,+BAA+B,
|
|
1
|
+
{"version":3,"file":"GenAiChatContextChooser.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatContextChooser.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAWvD,KAAK,+BAA+B,GAAG;IACnC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EAAE,YAAY,EAAE,EAAE,+BAA+B,2CAyExF"}
|
|
@@ -28,9 +28,6 @@ export function GenAiChatContextChooser({ onAddContext }) {
|
|
|
28
28
|
dispatch(initContextObjectsAction());
|
|
29
29
|
}
|
|
30
30
|
}, [dispatch, setSearch]);
|
|
31
|
-
if (!ambient) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
31
|
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: {
|
|
35
32
|
...accessibilityConfig,
|
|
36
33
|
ariaLabel: addContextLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAsD,MAAM,OAAO,CAAC;AAmCpG,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACzC,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAsD,MAAM,OAAO,CAAC;AAmCpG,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACzC,CAAC;AAiKF,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,aAAa,CAAkB,CAAC"}
|
package/esm/components/Input.js
CHANGED
|
@@ -24,11 +24,8 @@ const msgs = defineMessages({
|
|
|
24
24
|
placeholder: {
|
|
25
25
|
id: "gd.gen-ai.input-placeholder",
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
id: "gd.gen-ai.input-label
|
|
29
|
-
},
|
|
30
|
-
labelWin: {
|
|
31
|
-
id: "gd.gen-ai.input-label.win",
|
|
27
|
+
label: {
|
|
28
|
+
id: "gd.gen-ai.input-label",
|
|
32
29
|
},
|
|
33
30
|
});
|
|
34
31
|
const isMac = typeof navigator !== "undefined" &&
|
|
@@ -107,7 +104,7 @@ function InputComponent({ autofocus = false, canManage, canAnalyze, targetRef })
|
|
|
107
104
|
"gd-gen-ai-chat__input--empty": isEmpty,
|
|
108
105
|
"gd-gen-ai-chat__input--agent-switching": agentSwitchingEnabled,
|
|
109
106
|
"gd-gen-ai-chat__input--no-agents": hasNoAgents,
|
|
110
|
-
}), children: _jsxs("div", { className: "gd-gen-ai-chat__input__content", children: [_jsx(HintText, { focused: focused, where: "top" }), _jsxs("div", { className: "gd-gen-ai-chat__input__container", children: [_jsx("div", { className: "gd-gen-ai-chat__input__context", onMouseDown: handleContextMouseDown, children: _jsx(GenAIChatContextIndicator, { onUpdate: handleOnFocus }) }), _jsx("div", { ref: targetRef, onFocus: handleOnFocus }), _jsx("div", { className: "gd-gen-ai-chat__input__text", ...ref, children: _jsx(SyntaxHighlightingInput, { className: "gd-gen-ai-chat__input__mc", placeholder: intl.formatMessage(msgs.placeholder), label:
|
|
107
|
+
}), children: _jsxs("div", { className: "gd-gen-ai-chat__input__content", children: [_jsx(HintText, { focused: focused, where: "top" }), _jsxs("div", { className: "gd-gen-ai-chat__input__container", children: [_jsx("div", { className: "gd-gen-ai-chat__input__context", onMouseDown: handleContextMouseDown, children: _jsx(GenAIChatContextIndicator, { onUpdate: handleOnFocus }) }), _jsx("div", { ref: targetRef, onFocus: handleOnFocus }), _jsx("div", { className: "gd-gen-ai-chat__input__text", ...ref, children: _jsx(SyntaxHighlightingInput, { className: "gd-gen-ai-chat__input__mc", placeholder: intl.formatMessage(msgs.placeholder), label: intl.formatMessage(msgs.label), value: value, autocompletion: {
|
|
111
108
|
aboveCursor: true,
|
|
112
109
|
whenTyping: true,
|
|
113
110
|
whenTypingDelay: 300,
|
|
@@ -58,7 +58,7 @@ function iterateTree(node, references, tokens, callbacks, verbatim = false) {
|
|
|
58
58
|
if (!value.includes(PLACEHOLDER_START)) {
|
|
59
59
|
return [node];
|
|
60
60
|
}
|
|
61
|
-
return splitTextNode(node, references, tokens, callbacks.onTextNodeReference
|
|
61
|
+
return splitTextNode(node, references, tokens, callbacks.onTextNodeReference);
|
|
62
62
|
}
|
|
63
63
|
const inVerbatim = verbatim || VERBATIM_TAG_NAMES.includes(node.tagName);
|
|
64
64
|
if (node.children) {
|
|
@@ -80,7 +80,7 @@ function restorePlaceholders(value, tokens) {
|
|
|
80
80
|
return originalToken ?? match;
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
function splitTextNode(text, references, tokens, onTextNodeReference
|
|
83
|
+
function splitTextNode(text, references, tokens, onTextNodeReference) {
|
|
84
84
|
const nodes = [];
|
|
85
85
|
const regex = getPlaceholderRegex();
|
|
86
86
|
let lastIndex = 0;
|
|
@@ -97,9 +97,6 @@ function splitTextNode(text, references, tokens, onTextNodeReference, verbatim)
|
|
|
97
97
|
if (ref) {
|
|
98
98
|
pushText(text.value.slice(lastIndex, match.index));
|
|
99
99
|
nodes.push(...onTextNodeReference(text, ref));
|
|
100
|
-
if (verbatim) {
|
|
101
|
-
pushText(` ${originalToken}`);
|
|
102
|
-
}
|
|
103
100
|
lastIndex = match.index + match[0].length;
|
|
104
101
|
}
|
|
105
102
|
match = regex.exec(text.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SemanticSearchTreeView.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/components/SemanticSearchTreeView.tsx"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAGjC,MAAM,qBAAqB,CAAC;AAa7B,KAAK,2BAA2B,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,yBAAyB,EAAE,CAAC;IAC3C,aAAa,EAAE,2BAA2B,EAAE,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CAQxE;AAED,wBAAgB,0BAA0B,CAAC,EACvC,SAAS,EACT,aAAa,EACb,aAAa,EACb,SAAS,GACZ,EAAE,2BAA2B,
|
|
1
|
+
{"version":3,"file":"SemanticSearchTreeView.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/components/SemanticSearchTreeView.tsx"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAGjC,MAAM,qBAAqB,CAAC;AAa7B,KAAK,2BAA2B,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,yBAAyB,EAAE,CAAC;IAC3C,aAAa,EAAE,2BAA2B,EAAE,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CAQxE;AAED,wBAAgB,0BAA0B,CAAC,EACvC,SAAS,EACT,aAAa,EACb,aAAa,EACb,SAAS,GACZ,EAAE,2BAA2B,kDA2E7B"}
|
|
@@ -18,7 +18,6 @@ export function SemanticSearchTreeViewImpl({ workspace, searchResults, relations
|
|
|
18
18
|
const { canFullControl, canManage, canAnalyze, linkHandler } = useConfig();
|
|
19
19
|
const settings = useSelector(settingsSelector);
|
|
20
20
|
const canEdit = canFullControl || canManage || canAnalyze;
|
|
21
|
-
const useHostAnalyticalDesigner = Boolean(settings?.enableShellApplication_analyticalDesigner);
|
|
22
21
|
const useHostDashboards = Boolean(settings?.enableShellApplication_dashboards);
|
|
23
22
|
const items = buildSemanticSearchTreeViewItems({
|
|
24
23
|
intl,
|
|
@@ -29,7 +28,6 @@ export function SemanticSearchTreeViewImpl({ workspace, searchResults, relations
|
|
|
29
28
|
canEdit,
|
|
30
29
|
uiPathOptions: {
|
|
31
30
|
useHostedMetricEditor: true,
|
|
32
|
-
useHostedAnalyticalDesigner: useHostAnalyticalDesigner,
|
|
33
31
|
useHostedLdmModeler: true,
|
|
34
32
|
useHostedDashboards: useHostDashboards,
|
|
35
33
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomHyperlink.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/CustomHyperlink.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAMxE,MAAM,MAAM,uBAAuB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,oBAAoB,GAAG,uBAAuB,GAAG;IAClD,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CACrC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"CustomHyperlink.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/CustomHyperlink.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAMxE,MAAM,MAAM,uBAAuB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,oBAAoB,GAAG,uBAAuB,GAAG;IAClD,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CACrC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,oBAAoB,oDA0FtF;AAyBD,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,uBAAuB,2CAItE"}
|
|
@@ -11,7 +11,6 @@ import { removeMarkdown } from "../../utils/markdownUtils.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export function CustomHyperlinkComponent({ href, text, settings }) {
|
|
13
13
|
const { linkHandler, allowNativeLinks, canManage, canAnalyze } = useConfig();
|
|
14
|
-
const enableShellApplication_analyticalDesigner = Boolean(settings?.enableShellApplication_analyticalDesigner);
|
|
15
14
|
const enableShellApplication_dashboards = Boolean(settings?.enableShellApplication_dashboards);
|
|
16
15
|
const canManageMetrics = canManage || canAnalyze;
|
|
17
16
|
const canManageVisualisations = canManage || canAnalyze;
|
|
@@ -37,7 +36,7 @@ export function CustomHyperlinkComponent({ href, text, settings }) {
|
|
|
37
36
|
if (!workspaceId || !id) {
|
|
38
37
|
return null;
|
|
39
38
|
}
|
|
40
|
-
const itemUrl = getItemUrl(workspaceId, id, type,
|
|
39
|
+
const itemUrl = getItemUrl(workspaceId, id, type, enableShellApplication_dashboards);
|
|
41
40
|
if (!itemUrl) {
|
|
42
41
|
return null;
|
|
43
42
|
}
|
|
@@ -47,7 +46,7 @@ export function CustomHyperlinkComponent({ href, text, settings }) {
|
|
|
47
46
|
id,
|
|
48
47
|
itemUrl,
|
|
49
48
|
};
|
|
50
|
-
}, [href,
|
|
49
|
+
}, [href, enableShellApplication_dashboards]);
|
|
51
50
|
if (!parsedRef) {
|
|
52
51
|
return plainText;
|
|
53
52
|
}
|
|
@@ -80,12 +79,10 @@ export function CustomHyperlinkComponent({ href, text, settings }) {
|
|
|
80
79
|
}
|
|
81
80
|
return (_jsx("span", { className: "gd-hyperlink", onClick: handleLinkClick, children: _jsx("span", { className: "gd-hyperlink-text", children: plainText }) }));
|
|
82
81
|
}
|
|
83
|
-
const getItemUrl = (workspaceId, id, objectType,
|
|
82
|
+
const getItemUrl = (workspaceId, id, objectType, enableShellApplication_dashboards) => {
|
|
84
83
|
switch (objectType) {
|
|
85
84
|
case "visualization":
|
|
86
|
-
return
|
|
87
|
-
? `/workspace/${workspaceId}/analyze/#/${id}/edit`
|
|
88
|
-
: `/analyze/#/${workspaceId}/${id}/edit`;
|
|
85
|
+
return `/workspace/${workspaceId}/analyze/#/${id}/edit`;
|
|
89
86
|
case "dashboard":
|
|
90
87
|
return enableShellApplication_dashboards
|
|
91
88
|
? `/workspace/${workspaceId}/dashboards/#/dashboard/${id}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationDashboardContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationDashboardContent.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIhE,OAAO,KAAK,EAAE,0BAA0B,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAKzG,MAAM,MAAM,iCAAiC,GAAG;IAC5C,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,iCAAiC,
|
|
1
|
+
{"version":3,"file":"ConversationDashboardContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationDashboardContent.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIhE,OAAO,KAAK,EAAE,0BAA0B,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAKzG,MAAM,MAAM,iCAAiC,GAAG;IAC5C,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,iCAAiC,kDAuFpF"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2024-2026 GoodData Corporation
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import {
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
6
|
import { useSelector } from "react-redux";
|
|
7
7
|
import { useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
8
8
|
import { UiButton, UiIcon } from "@gooddata/sdk-ui-kit";
|
|
@@ -10,7 +10,7 @@ import { settingsSelector } from "../../../store/chatWindow/chatWindowSelectors.
|
|
|
10
10
|
import { getDashboardHref } from "../../../utils.js";
|
|
11
11
|
import { useConfig } from "../../ConfigContext.js";
|
|
12
12
|
export function ConversationDashboardContent(props) {
|
|
13
|
-
const { className, dashboard, insights, saved } = props;
|
|
13
|
+
const { className, dashboard, insights, saved, message } = props;
|
|
14
14
|
const intl = useIntl();
|
|
15
15
|
const config = useConfig();
|
|
16
16
|
const workspaceId = useWorkspaceStrict();
|
|
@@ -44,5 +44,22 @@ export function ConversationDashboardContent(props) {
|
|
|
44
44
|
if (!dashboard) {
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
-
return (
|
|
47
|
+
return (_jsx("div", { className: classNames, children: _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-dashboard-frame", children: [_jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-dashboard-icon", children: _jsx(UiIcon, { type: "dashboard", size: 14, color: "complementary-6", backgroundSize: 26, backgroundColor: "complementary-2" }) }), _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-dashboard-content", children: [_jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-dashboard-content-title", children: dashboard.title }), _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-dashboard-content-date", children: Intl.DateTimeFormat(intl.locale, {
|
|
48
|
+
dateStyle: "medium",
|
|
49
|
+
timeStyle: "short",
|
|
50
|
+
}).format(showDate(dashboard.created, message.createdAt)) })] }), _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-dashboard-item-buttons", children: _jsx(UiButton, { label: intl.formatMessage({ id: "gd.gen-ai.dashboard.open-dashboard" }), variant: "secondary", onClick: handleOpenDashboard }) })] }) }));
|
|
51
|
+
}
|
|
52
|
+
function showDate(...args) {
|
|
53
|
+
const dates = args.map((arg) => {
|
|
54
|
+
if (typeof arg === "string") {
|
|
55
|
+
if (!isNaN(Date.parse(arg))) {
|
|
56
|
+
return new Date(arg);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (typeof arg === "number") {
|
|
60
|
+
return new Date(arg);
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
});
|
|
64
|
+
return dates.find((date) => date !== null) ?? new Date();
|
|
48
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationErrorContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationErrorContent.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAKvE,MAAM,MAAM,6BAA6B,GAAG;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,EACP,WAAmB,EACnB,SAAS,EACT,MAAM,GACT,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"ConversationErrorContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationErrorContent.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAKvE,MAAM,MAAM,6BAA6B,GAAG;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,EACP,WAAmB,EACnB,SAAS,EACT,MAAM,GACT,EAAE,6BAA6B,2CAoE/B"}
|
|
@@ -17,7 +17,7 @@ export function ConversationErrorContent({ code, traceId, message, useMarkdown =
|
|
|
17
17
|
b: (parts) => _jsx("strong", { children: parts }),
|
|
18
18
|
}), []);
|
|
19
19
|
const classNames = cx("gd-gen-ai-chat__conversation__item__content", "gd-gen-ai-chat__conversation__item__content--error", className);
|
|
20
|
-
return (_jsxs("div", { className: classNames, children: [_jsx("div", { className: cx("gd-gen-ai-chat__error-info"), children: _jsx("div", { className: cx("gd-gen-ai-chat__content"), children: _jsxs("
|
|
20
|
+
return (_jsxs("div", { className: classNames, children: [_jsx("div", { className: cx("gd-gen-ai-chat__error-info"), children: _jsx("div", { className: cx("gd-gen-ai-chat__content"), children: _jsxs("div", { className: cx("gd-gen-ai-chat__error-message"), children: [reason === "METADATA_SYNC_IN_PROGRESS" ? (_jsx(FormattedMessage, { id: "gd.gen-ai.global-error.sync-in-progress", values: components })) : reason === "METADATA_SYNC_REQUEST_ERROR" ? (_jsx(FormattedMessage, { id: "gd.gen-ai.global-error.sync-failed", values: components })) : reason === "MODEL_NOT_COMPATIBLE" ? (_jsx(FormattedMessage, { id: "gd.gen-ai.global-model-not-compatible", values: components })) : (_jsx("div", { className: cx("gd-gen-ai-chat__error-raw"), children: _jsx(MarkdownComponent, { allowMarkdown: useMarkdown, children: message }) })), _jsx("span", { className: cx("gd-gen-ai-chat__show-more"), children: _jsx(UiButton, { size: "small", variant: "tertiary", onClick: () => setShowMore(!showMore), label: showMore
|
|
21
21
|
? formatMessage({ id: "gd.gen-ai.global-error.show-less" })
|
|
22
22
|
: formatMessage({ id: "gd.gen-ai.global-error.show-more" }) }) })] }) }) }), showMore ? (_jsx("div", { className: cx("gd-gen-ai-chat__error-details"), children: reason === "MODEL_NOT_COMPATIBLE" ? (_jsx(ModelNotCompatibleDetail, { onSettings: onSettings })) : (_jsx(ErrorDetail, { message: message, traceId: traceId, code: code })) })) : null] }));
|
|
23
23
|
}
|
|
@@ -3,9 +3,10 @@ import { type IChatConversationLocalItem, type IChatConversationMultipartLocalPa
|
|
|
3
3
|
import { type IWhatIfRenderableScenario } from "../../../whatIf/whatIfMapping.js";
|
|
4
4
|
import { type IGenAIAssistantConversationVisualizationContentProps } from "../../customized/types.js";
|
|
5
5
|
type IVisualisationMenuItemId = "button-save" | "button-open" | "button-copy";
|
|
6
|
-
export declare function getVisibleVisualisationMenuItemIds({ scenario, isVisualisationSaved, menuItems, }: {
|
|
6
|
+
export declare function getVisibleVisualisationMenuItemIds({ scenario, isVisualisationSaved, hasError, menuItems, }: {
|
|
7
7
|
scenario?: IWhatIfRenderableScenario;
|
|
8
8
|
menuItems?: IGenAIAssistantConversationVisualizationContentProps["menuItems"];
|
|
9
|
+
hasError?: boolean;
|
|
9
10
|
isVisualisationSaved: boolean;
|
|
10
11
|
}): IVisualisationMenuItemId[];
|
|
11
12
|
export type ConversationVisualizationContentProps = {
|
package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationVisualizationContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualizationContent.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAyBvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAY9G,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAE,KAAK,oDAAoD,EAAE,MAAM,2BAA2B,CAAC;AAuBtG,KAAK,wBAAwB,GAAG,aAAa,GAAG,aAAa,GAAG,aAAa,CAAC;AAE9E,wBAAgB,kCAAkC,CAAC,EAC/C,QAAQ,EACR,oBAAoB,EACpB,SAAS,GACZ,EAAE;IACC,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,SAAS,CAAC,EAAE,oDAAoD,CAAC,WAAW,CAAC,CAAC;IAC9E,oBAAoB,EAAE,OAAO,CAAC;CACjC,GAAG,wBAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"ConversationVisualizationContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualizationContent.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAyBvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAY9G,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAE,KAAK,oDAAoD,EAAE,MAAM,2BAA2B,CAAC;AAuBtG,KAAK,wBAAwB,GAAG,aAAa,GAAG,aAAa,GAAG,aAAa,CAAC;AAE9E,wBAAgB,kCAAkC,CAAC,EAC/C,QAAQ,EACR,oBAAoB,EACpB,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,SAAS,CAAC,EAAE,oDAAoD,CAAC,WAAW,CAAC,CAAC;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,EAAE,OAAO,CAAC;CACjC,GAAG,wBAAwB,EAAE,CAyB7B;AAED,MAAM,MAAM,qCAAqC,GAAG;IAChD,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,oDAAoD,CAAC,WAAW,CAAC,CAAC;CACjF,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,EAC7C,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,SAAS,GACZ,EAAE,qCAAqC,2CAqHvC"}
|
|
@@ -20,7 +20,7 @@ import { createKdaDefinitionFromDrill, getDashboardAttributeFilter } from "./use
|
|
|
20
20
|
import { useSaveCheck } from "./useSaveCheck.js";
|
|
21
21
|
const MORE_MENU_BUTTON_ID = "gd-gen-ai-chat__conversation__visualization__save__more-menu-button";
|
|
22
22
|
const overlayAlignPoints = [{ align: "br tr" }];
|
|
23
|
-
export function getVisibleVisualisationMenuItemIds({ scenario, isVisualisationSaved, menuItems, }) {
|
|
23
|
+
export function getVisibleVisualisationMenuItemIds({ scenario, isVisualisationSaved, hasError, menuItems, }) {
|
|
24
24
|
if (scenario && !scenario.isBaseline) {
|
|
25
25
|
return [];
|
|
26
26
|
}
|
|
@@ -28,10 +28,13 @@ export function getVisibleVisualisationMenuItemIds({ scenario, isVisualisationSa
|
|
|
28
28
|
const showOpenInAnalyzeMenuItem = menuItems?.openInAnalyze ?? true;
|
|
29
29
|
const showCopyLinkMenuItem = menuItems?.copyLink ?? true;
|
|
30
30
|
const items = [];
|
|
31
|
-
if (showSaveMenuItem) {
|
|
31
|
+
if (showSaveMenuItem && !hasError) {
|
|
32
32
|
items.push("button-save");
|
|
33
33
|
}
|
|
34
|
-
if (showOpenInAnalyzeMenuItem) {
|
|
34
|
+
if (showOpenInAnalyzeMenuItem && !hasError) {
|
|
35
|
+
items.push("button-open");
|
|
36
|
+
}
|
|
37
|
+
if (isVisualisationSaved && showOpenInAnalyzeMenuItem && hasError) {
|
|
35
38
|
items.push("button-open");
|
|
36
39
|
}
|
|
37
40
|
if (isVisualisationSaved && showCopyLinkMenuItem) {
|
|
@@ -98,6 +101,7 @@ function VisualisationMenu({ visualization, scenario, isVisualisationSaved, isVi
|
|
|
98
101
|
const itemIds = getVisibleVisualisationMenuItemIds({
|
|
99
102
|
scenario,
|
|
100
103
|
isVisualisationSaved,
|
|
104
|
+
hasError,
|
|
101
105
|
menuItems,
|
|
102
106
|
});
|
|
103
107
|
return itemIds.map((id) => {
|
|
@@ -146,7 +150,7 @@ function VisualisationMenu({ visualization, scenario, isVisualisationSaved, isVi
|
|
|
146
150
|
};
|
|
147
151
|
}
|
|
148
152
|
});
|
|
149
|
-
}, [intl, isVisualisationSaved, scenario, menuItems]);
|
|
153
|
+
}, [intl, isVisualisationSaved, scenario, menuItems, hasError]);
|
|
150
154
|
const handleButtonClick = useCallback((e, item) => {
|
|
151
155
|
switch (item.id) {
|
|
152
156
|
case "button-save":
|
|
@@ -188,7 +192,7 @@ function VisualisationMenu({ visualization, scenario, isVisualisationSaved, isVi
|
|
|
188
192
|
}
|
|
189
193
|
return (_jsxs("div", { className: cx("gd-gen-ai-chat__conversation__visualization__buttons", {
|
|
190
194
|
active: isMenuButtonOpen,
|
|
191
|
-
}), children: [visualization?.insight.visualizationUrl === "local:table" ? null : (_jsx("div", { className: cx("gd-gen-ai-chat__conversation__visualization__table"), children: _jsx(UiTooltip, { triggerBy: ["focus", "hover"], arrowPlacement: "bottom", anchor: _jsx(UiIconButton, { dataTestId: "gen-ai-visualization-toggle-button", onClick: () => {
|
|
195
|
+
}), children: [!hasError && visualization?.insight.visualizationUrl === "local:table" ? null : (_jsx("div", { className: cx("gd-gen-ai-chat__conversation__visualization__table"), children: _jsx(UiTooltip, { triggerBy: ["focus", "hover"], arrowPlacement: "bottom", anchor: _jsx(UiIconButton, { dataTestId: "gen-ai-visualization-toggle-button", onClick: () => {
|
|
192
196
|
onTable(!isTable);
|
|
193
197
|
}, icon: isTable ? "visualization" : "table", accessibilityConfig: {
|
|
194
198
|
role: "button",
|
|
@@ -287,7 +291,6 @@ function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
|
287
291
|
const config = useConfig();
|
|
288
292
|
const dispatch = useDispatch();
|
|
289
293
|
const workspaceId = useWorkspaceStrict();
|
|
290
|
-
const useHostedAnalyticalDesigner = Boolean(useSelector(settingsSelector)?.enableShellApplication_analyticalDesigner);
|
|
291
294
|
const onSave = useCallback(() => {
|
|
292
295
|
setSaveDialogOpen("save");
|
|
293
296
|
}, [setSaveDialogOpen]);
|
|
@@ -298,7 +301,7 @@ function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
|
298
301
|
if (isSaved) {
|
|
299
302
|
const visualizationStatus = "saved";
|
|
300
303
|
if (config.allowNativeLinks) {
|
|
301
|
-
window.location.href = getVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus
|
|
304
|
+
window.location.href = getVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus);
|
|
302
305
|
}
|
|
303
306
|
else {
|
|
304
307
|
config.linkHandler?.({
|
|
@@ -307,7 +310,7 @@ function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
|
307
310
|
workspaceId,
|
|
308
311
|
newTab: e.metaKey,
|
|
309
312
|
preventDefault: e.preventDefault.bind(e),
|
|
310
|
-
itemUrl: getVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus
|
|
313
|
+
itemUrl: getVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus),
|
|
311
314
|
visualization,
|
|
312
315
|
visualizationStatus,
|
|
313
316
|
action: "open",
|
|
@@ -318,7 +321,7 @@ function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
|
318
321
|
else {
|
|
319
322
|
setSaveDialogOpen("explore");
|
|
320
323
|
}
|
|
321
|
-
}, [config, setSaveDialogOpen, visualization, workspaceId
|
|
324
|
+
}, [config, setSaveDialogOpen, visualization, workspaceId]);
|
|
322
325
|
const onCopy = useCallback((e) => {
|
|
323
326
|
if (!visualization) {
|
|
324
327
|
return;
|
|
@@ -326,7 +329,7 @@ function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
|
326
329
|
const visualizationStatus = "saved";
|
|
327
330
|
let link = undefined;
|
|
328
331
|
if (config.allowNativeLinks) {
|
|
329
|
-
link = getAbsoluteVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus
|
|
332
|
+
link = getAbsoluteVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus);
|
|
330
333
|
}
|
|
331
334
|
else {
|
|
332
335
|
link = config.linkHandler?.({
|
|
@@ -335,7 +338,7 @@ function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
|
335
338
|
workspaceId,
|
|
336
339
|
newTab: e.metaKey,
|
|
337
340
|
preventDefault: e.preventDefault.bind(e),
|
|
338
|
-
itemUrl: getAbsoluteVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus
|
|
341
|
+
itemUrl: getAbsoluteVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus),
|
|
339
342
|
visualization,
|
|
340
343
|
visualizationStatus,
|
|
341
344
|
action: "copy",
|
|
@@ -345,7 +348,7 @@ function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
|
345
348
|
copy(link);
|
|
346
349
|
dispatch(copyToClipboardAction({ content: link }));
|
|
347
350
|
}
|
|
348
|
-
}, [visualization, config, workspaceId,
|
|
351
|
+
}, [visualization, config, workspaceId, dispatch]);
|
|
349
352
|
return {
|
|
350
353
|
onSave,
|
|
351
354
|
onOpen,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/context/build.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,iBAAiB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAIjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAE1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,QAAQ,EAAE,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE,GAAG,iBAAiB,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/context/build.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,iBAAiB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAIjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAE1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,QAAQ,EAAE,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE,GAAG,iBAAiB,GAAG,SAAS,CAoB3G"}
|
package/esm/context/build.js
CHANGED
|
@@ -20,9 +20,7 @@ export function mergeContexts(...contexts) {
|
|
|
20
20
|
return acc;
|
|
21
21
|
}
|
|
22
22
|
const dashboard = mergeDashboard(context.view?.dashboard, acc.view?.dashboard);
|
|
23
|
-
const view = {
|
|
24
|
-
...(dashboard ? { dashboard } : {}),
|
|
25
|
-
};
|
|
23
|
+
const view = dashboard ? { dashboard } : {};
|
|
26
24
|
const activeObject = mergeActiveObject(context.activeObject, acc.activeObject);
|
|
27
25
|
const referencedObjects = [...(acc?.referencedObjects ?? []), ...(context?.referencedObjects ?? [])];
|
|
28
26
|
return {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type DashboardSelectorEvaluator } from "@gooddata/sdk-ui-dashboard";
|
|
2
|
-
export declare function useDashboardAmbientContext(dashboardSelector?: DashboardSelectorEvaluator): void;
|
|
2
|
+
export declare function useDashboardAmbientContext(dashboardSelector?: DashboardSelectorEvaluator | null): void;
|
|
3
3
|
//# sourceMappingURL=useDashboardAmbientContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDashboardAmbientContext.d.ts","sourceRoot":"","sources":["../../../src/context/hooks/useDashboardAmbientContext.ts"],"names":[],"mappings":"AAOA,OAAO,EAEH,KAAK,0BAA0B,EAYlC,MAAM,4BAA4B,CAAC;AAOpC,wBAAgB,0BAA0B,CAAC,iBAAiB,CAAC,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"useDashboardAmbientContext.d.ts","sourceRoot":"","sources":["../../../src/context/hooks/useDashboardAmbientContext.ts"],"names":[],"mappings":"AAOA,OAAO,EAEH,KAAK,0BAA0B,EAYlC,MAAM,4BAA4B,CAAC;AAOpC,wBAAgB,0BAA0B,CAAC,iBAAiB,CAAC,EAAE,0BAA0B,GAAG,IAAI,QAQ/F"}
|
|
@@ -12,15 +12,15 @@ export function useDashboardAmbientContext(dashboardSelector) {
|
|
|
12
12
|
const used = useRef(false);
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
const context = dashboardSelector ? buildFromDashboard(dashboardSelector) : undefined;
|
|
15
|
-
setContext(dispatch, context, used);
|
|
15
|
+
setContext(dispatch, context, used, dashboardSelector);
|
|
16
16
|
}, [dashboardSelector, dispatch]);
|
|
17
17
|
}
|
|
18
|
-
function setContext(dispatch, context, used) {
|
|
18
|
+
function setContext(dispatch, context, used, dashboardSelector) {
|
|
19
19
|
if (context) {
|
|
20
20
|
dispatch(setAmbientUserContextAction({ userContext: context }));
|
|
21
21
|
used.current = true;
|
|
22
22
|
}
|
|
23
|
-
if (!context && used.current) {
|
|
23
|
+
if (!context && (used.current || dashboardSelector === null)) {
|
|
24
24
|
dispatch(setAmbientUserContextAction({ userContext: undefined }));
|
|
25
25
|
used.current = false;
|
|
26
26
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type AgentCustomSkill } from "@gooddata/sdk-model";
|
|
1
2
|
/**
|
|
2
3
|
* @public
|
|
3
4
|
*/
|
|
4
|
-
export declare function useGenAIStandaloneInputData(): {
|
|
5
|
+
export declare function useGenAIStandaloneInputData(requiredSkills?: AgentCustomSkill[]): {
|
|
5
6
|
agents: import("../model.js").GenAIAgent[] | undefined;
|
|
6
7
|
selectedAgentId: string | undefined;
|
|
7
8
|
conversationsLoaded: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGenAIStandaloneInputData.d.ts","sourceRoot":"","sources":["../../src/hooks/useGenAIStandaloneInputData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGenAIStandaloneInputData.d.ts","sourceRoot":"","sources":["../../src/hooks/useGenAIStandaloneInputData.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAU5D;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,cAAc,CAAC,EAAE,gBAAgB,EAAE;;;;;gCAQ7D,MAAM,GAAG,SAAS;EA4BnC"}
|