@gooddata/sdk-ui-gen-ai 11.55.0-alpha.2 → 11.55.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/NOTICE +9 -9
- package/esm/components/ConfigContext.d.ts +1 -0
- package/esm/components/ConfigContext.d.ts.map +1 -1
- package/esm/components/CustomizationContext.d.ts +36 -0
- package/esm/components/CustomizationContext.d.ts.map +1 -0
- package/esm/components/CustomizationContext.js +18 -0
- package/esm/components/CustomizationProvider.d.ts +3 -12
- package/esm/components/CustomizationProvider.d.ts.map +1 -1
- package/esm/components/CustomizationProvider.js +109 -13
- package/esm/components/GenAIChatAgentDropdown.d.ts +2 -2
- package/esm/components/GenAIChatAgentDropdown.d.ts.map +1 -1
- package/esm/components/GenAIChatAgentDropdown.js +11 -7
- package/esm/components/GenAIChatContextIndicator.d.ts +2 -2
- package/esm/components/GenAIChatContextIndicator.d.ts.map +1 -1
- package/esm/components/GenAIChatContextIndicator.js +81 -13
- package/esm/components/GenAIChatWrapper.js +1 -1
- package/esm/components/GenAIStandaloneInput.d.ts +5 -0
- package/esm/components/GenAIStandaloneInput.d.ts.map +1 -1
- package/esm/components/GenAIStandaloneInput.js +3 -2
- package/esm/components/GenAiChatAgentSwitching.d.ts.map +1 -1
- package/esm/components/GenAiChatAgentSwitching.js +9 -3
- package/esm/components/GenAiChatContextChooser.d.ts.map +1 -1
- package/esm/components/GenAiChatContextChooser.js +4 -3
- package/esm/components/GenAiChatContextChooserBody.d.ts +3 -1
- package/esm/components/GenAiChatContextChooserBody.d.ts.map +1 -1
- package/esm/components/GenAiChatContextChooserBody.js +7 -4
- package/esm/components/GenAiConversations.d.ts +5 -0
- package/esm/components/GenAiConversations.d.ts.map +1 -1
- package/esm/components/GenAiConversations.js +2 -2
- package/esm/components/Input.js +1 -1
- package/esm/components/Messages.d.ts.map +1 -1
- package/esm/components/Messages.js +4 -5
- package/esm/components/customized/AgentChooser.d.ts +8 -0
- package/esm/components/customized/AgentChooser.d.ts.map +1 -0
- package/esm/components/customized/AgentChooser.js +11 -0
- package/esm/components/customized/AgentItem.d.ts +1 -1
- package/esm/components/customized/AgentItem.js +1 -1
- package/esm/components/customized/AssistantMessage.d.ts +8 -0
- package/esm/components/customized/AssistantMessage.d.ts.map +1 -0
- package/esm/components/customized/AssistantMessage.js +11 -0
- package/esm/components/customized/Disclaimer.d.ts +3 -1
- package/esm/components/customized/Disclaimer.d.ts.map +1 -1
- package/esm/components/customized/Disclaimer.js +3 -1
- package/esm/components/customized/Feedback.d.ts +8 -0
- package/esm/components/customized/Feedback.d.ts.map +1 -0
- package/esm/components/customized/Feedback.js +11 -0
- package/esm/components/customized/FollowUpButtons.d.ts +8 -0
- package/esm/components/customized/FollowUpButtons.d.ts.map +1 -0
- package/esm/components/customized/FollowUpButtons.js +11 -0
- package/esm/components/customized/FollowUpQuestion.d.ts +8 -0
- package/esm/components/customized/FollowUpQuestion.d.ts.map +1 -0
- package/esm/components/customized/FollowUpQuestion.js +11 -0
- package/esm/components/customized/LandingContainer.d.ts +6 -2
- package/esm/components/customized/LandingContainer.d.ts.map +1 -1
- package/esm/components/customized/LandingContainer.js +6 -2
- package/esm/components/customized/LandingQuestion.d.ts +6 -2
- package/esm/components/customized/LandingQuestion.d.ts.map +1 -1
- package/esm/components/customized/LandingQuestion.js +3 -1
- package/esm/components/customized/LandingScreen.d.ts +4 -2
- package/esm/components/customized/LandingScreen.d.ts.map +1 -1
- package/esm/components/customized/LandingScreen.js +3 -1
- package/esm/components/customized/LandingTitle.d.ts +7 -3
- package/esm/components/customized/LandingTitle.d.ts.map +1 -1
- package/esm/components/customized/LandingTitle.js +6 -2
- package/esm/components/customized/MessageErrorContent.d.ts +8 -0
- package/esm/components/customized/MessageErrorContent.d.ts.map +1 -0
- package/esm/components/customized/MessageErrorContent.js +11 -0
- package/esm/components/customized/MessageMultipartContent.d.ts +8 -0
- package/esm/components/customized/MessageMultipartContent.d.ts.map +1 -0
- package/esm/components/customized/MessageMultipartContent.js +11 -0
- package/esm/components/customized/MessageReasoningContent.d.ts +8 -0
- package/esm/components/customized/MessageReasoningContent.d.ts.map +1 -0
- package/esm/components/customized/MessageReasoningContent.js +11 -0
- package/esm/components/customized/MessageTextContent.d.ts +8 -0
- package/esm/components/customized/MessageTextContent.d.ts.map +1 -0
- package/esm/components/customized/MessageTextContent.js +11 -0
- package/esm/components/customized/UserMessage.d.ts +8 -0
- package/esm/components/customized/UserMessage.d.ts.map +1 -0
- package/esm/components/customized/UserMessage.js +11 -0
- package/esm/components/customized/types.d.ts +260 -1
- package/esm/components/customized/types.d.ts.map +1 -1
- package/esm/components/hooks/useContextChangeAnnouncement.d.ts +2 -2
- package/esm/components/hooks/useContextChangeAnnouncement.d.ts.map +1 -1
- package/esm/components/hooks/useContextChangeAnnouncement.js +9 -4
- package/esm/components/hooks/useContextItems.d.ts +9 -3
- package/esm/components/hooks/useContextItems.d.ts.map +1 -1
- package/esm/components/hooks/useContextItems.js +51 -8
- package/esm/components/hooks/useSettingsClick.d.ts.map +1 -1
- package/esm/components/hooks/useSettingsClick.js +2 -0
- package/esm/components/messages/AssistantItem.d.ts.map +1 -1
- package/esm/components/messages/AssistantItem.js +3 -3
- package/esm/components/messages/AssistantItemFeedback.d.ts +3 -6
- package/esm/components/messages/AssistantItemFeedback.d.ts.map +1 -1
- package/esm/components/messages/AssistantItemFeedback.js +3 -9
- package/esm/components/messages/AssistantItemFollowUpButtons.d.ts +14 -0
- package/esm/components/messages/AssistantItemFollowUpButtons.d.ts.map +1 -0
- package/esm/components/messages/AssistantItemFollowUpButtons.js +23 -0
- package/esm/components/messages/AssistantItemFollowUpQuestion.d.ts +14 -0
- package/esm/components/messages/AssistantItemFollowUpQuestion.d.ts.map +1 -0
- package/esm/components/messages/AssistantItemFollowUpQuestion.js +8 -0
- package/esm/components/messages/AssistantItemSuggestions.d.ts +3 -3
- package/esm/components/messages/AssistantItemSuggestions.d.ts.map +1 -1
- package/esm/components/messages/AssistantItemSuggestions.js +7 -15
- package/esm/components/messages/ConversationItemContents.d.ts.map +1 -1
- package/esm/components/messages/ConversationItemContents.js +7 -43
- package/esm/components/messages/components/SemanticSearchTreeView.d.ts.map +1 -1
- package/esm/components/messages/components/SemanticSearchTreeView.js +2 -0
- package/esm/components/messages/contents/CustomHyperlink.d.ts.map +1 -1
- package/esm/components/messages/contents/CustomHyperlink.js +1 -0
- package/esm/components/messages/contents/VisualizationContents.d.ts.map +1 -1
- package/esm/components/messages/contents/VisualizationContents.js +2 -0
- package/esm/components/messages/conversationContents/ConversationDashboardContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationDashboardContent.js +1 -0
- package/esm/components/messages/conversationContents/ConversationMultipartContent.d.ts +8 -0
- package/esm/components/messages/conversationContents/ConversationMultipartContent.d.ts.map +1 -0
- package/esm/components/messages/conversationContents/ConversationMultipartContent.js +40 -0
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.js +2 -0
- package/esm/components/utils/groupUtility.d.ts +3 -0
- package/esm/components/utils/groupUtility.d.ts.map +1 -1
- package/esm/context/addContextReference.d.ts +0 -2
- package/esm/context/addContextReference.d.ts.map +1 -1
- package/esm/context/addContextReference.js +12 -35
- package/esm/context/collectContextReferences.d.ts +2 -2
- package/esm/context/collectContextReferences.d.ts.map +1 -1
- package/esm/context/collectContextReferences.js +22 -20
- package/esm/context/removeContextReference.d.ts +2 -16
- package/esm/context/removeContextReference.d.ts.map +1 -1
- package/esm/context/removeContextReference.js +7 -70
- package/esm/context/selectContextReferences.d.ts +5 -0
- package/esm/context/selectContextReferences.d.ts.map +1 -0
- package/esm/context/selectContextReferences.js +68 -0
- package/esm/index.d.ts +12 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +10 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +8 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +8 -0
- package/esm/localization/bundles/zh-HK.localization-bundle.js +9 -9
- package/esm/sdk-ui-gen-ai.d.ts +378 -11
- package/esm/store/chatWindow/chatWindowSelectors.d.ts +2 -1
- package/esm/store/chatWindow/chatWindowSelectors.d.ts.map +1 -1
- package/esm/store/chatWindow/chatWindowSelectors.js +1 -0
- package/esm/store/chatWindow/chatWindowSlice.d.ts +2 -2
- package/esm/store/chatWindow/chatWindowSlice.d.ts.map +1 -1
- package/esm/store/chatWindow/chatWindowSlice.js +11 -6
- package/esm/store/sideEffects/onVisualizationSuccessSave.d.ts.map +1 -1
- package/esm/store/sideEffects/onVisualizationSuccessSave.js +2 -0
- package/esm/types.d.ts +22 -0
- package/esm/types.d.ts.map +1 -1
- package/esm/whatIf/whatIfMapping.d.ts +2 -2
- package/esm/whatIf/whatIfMapping.d.ts.map +1 -1
- package/esm/whatIf/whatIfMapping.js +3 -3
- package/package.json +21 -22
- package/styles/css/main.css +4 -0
- package/styles/css/main.css.map +1 -1
- package/styles/scss/main.scss +5 -0
|
@@ -4,11 +4,8 @@ export interface IAssistantItemFeedbackProps {
|
|
|
4
4
|
group: IChatMessagesGroup;
|
|
5
5
|
message: IChatConversationLocalItem;
|
|
6
6
|
isLast?: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* feedback stops being hover-revealed on older messages so the trigger sits flush left.
|
|
10
|
-
*/
|
|
11
|
-
hasInteractionIntelligenceTrigger?: boolean;
|
|
7
|
+
isHidden?: boolean;
|
|
8
|
+
isComplete?: boolean;
|
|
12
9
|
}
|
|
13
|
-
export declare function AssistantItemFeedback({ message,
|
|
10
|
+
export declare function AssistantItemFeedback({ message, isLast, isHidden, isComplete }: IAssistantItemFeedbackProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
11
|
//# sourceMappingURL=AssistantItemFeedback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantItemFeedback.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItemFeedback.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAKnE,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB
|
|
1
|
+
{"version":3,"file":"AssistantItemFeedback.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItemFeedback.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAKnE,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CAAC,EAClC,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,EACb,EAAE,2BAA2B,kDAgF7B"}
|
|
@@ -8,27 +8,21 @@ import { UiIconButton, UiTooltip } from "@gooddata/sdk-ui-kit";
|
|
|
8
8
|
import { setUserFeedback } from "../../store/messages/messagesSlice.js";
|
|
9
9
|
import { FeedbackPopup } from "./FeedbackPopup.js";
|
|
10
10
|
import { useUserFeedback } from "./useUserFeedback.js";
|
|
11
|
-
export function AssistantItemFeedback({ message,
|
|
11
|
+
export function AssistantItemFeedback({ message, isLast, isHidden, isComplete, }) {
|
|
12
12
|
const intl = useIntl();
|
|
13
13
|
const dispatch = useDispatch();
|
|
14
14
|
const setUserFeedbackAction = useCallback((payload) => {
|
|
15
15
|
dispatch(setUserFeedback(payload));
|
|
16
16
|
}, [dispatch]);
|
|
17
17
|
const { handlePositiveFeedbackClick, handleNegativeFeedbackClick, handleFeedbackSubmit } = useUserFeedback({ message, setUserFeedback: setUserFeedbackAction });
|
|
18
|
-
if (
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
if (message.content.type === "reasoning") {
|
|
18
|
+
if (!isComplete) {
|
|
22
19
|
return null;
|
|
23
20
|
}
|
|
24
21
|
const thumbsUpLabel = intl.formatMessage({ id: "gd.gen-ai.feedback.like" });
|
|
25
22
|
const thumbsDownLabel = intl.formatMessage({ id: "gd.gen-ai.feedback.dislike" });
|
|
26
23
|
const type = message.feedback?.feedback;
|
|
27
24
|
const isAssigned = type ? type !== "NONE" : false;
|
|
28
|
-
|
|
29
|
-
// older unrated messages instead of hover-revealed, so the trigger isn't pushed away from
|
|
30
|
-
// the left edge.
|
|
31
|
-
if (hasInteractionIntelligenceTrigger && !isLast && !isAssigned) {
|
|
25
|
+
if (isHidden && !isAssigned) {
|
|
32
26
|
return null;
|
|
33
27
|
}
|
|
34
28
|
return (_jsxs("div", { className: cx({
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type IChatSuggestion } from "@gooddata/sdk-backend-spi";
|
|
2
|
+
import { type IChatConversationLocalItem } from "../../model.js";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface IAssistantItemFollowUpButtonsProps {
|
|
7
|
+
message: IChatConversationLocalItem;
|
|
8
|
+
suggestions: IChatSuggestion[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function AssistantItemFollowUpButtons({ suggestions }: IAssistantItemFollowUpButtonsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
//# sourceMappingURL=AssistantItemFollowUpButtons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssistantItemFollowUpButtons.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItemFollowUpButtons.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAGjE,OAAO,EAAE,KAAK,0BAA0B,EAAgB,MAAM,gBAAgB,CAAC;AAK/E;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAC/C,OAAO,EAAE,0BAA0B,CAAC;IACpC,WAAW,EAAE,eAAe,EAAE,CAAC;CAClC;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,WAAW,EAAE,EAAE,kCAAkC,kDA2B/F"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
4
|
+
import { UiButton } from "@gooddata/sdk-ui-kit";
|
|
5
|
+
import { makeUserItem } from "../../model.js";
|
|
6
|
+
import { agentSwitchingActiveSelector } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
7
|
+
import { agentsAvailableSelector } from "../../store/messages/messagesSelectors.js";
|
|
8
|
+
import { newMessageAction } from "../../store/messages/messagesSlice.js";
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export function AssistantItemFollowUpButtons({ suggestions }) {
|
|
13
|
+
const dispatch = useDispatch();
|
|
14
|
+
const agentSwitchingActive = useSelector(agentSwitchingActiveSelector);
|
|
15
|
+
const agentsAvailable = useSelector(agentsAvailableSelector);
|
|
16
|
+
const isDisabled = agentSwitchingActive && agentsAvailable !== true;
|
|
17
|
+
if (suggestions.length === 0) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return (_jsx("div", { className: "gd-gen-ai-chat__conversation__visualization__suggestions", children: suggestions.map((suggestion) => (_jsx(UiButton, { label: suggestion.label, variant: "secondary", size: "small", isDisabled: isDisabled, onClick: () => {
|
|
21
|
+
dispatch(newMessageAction(makeUserItem({ type: "text", text: suggestion.query })));
|
|
22
|
+
}, tooltip: suggestion.query }, suggestion.label))) }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type IChatConversationLocalItem, type TextContentObject } from "../../model.js";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export interface IAssistantItemFollowUpQuestionProps {
|
|
6
|
+
message: IChatConversationLocalItem;
|
|
7
|
+
question: string;
|
|
8
|
+
references: TextContentObject[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function AssistantItemFollowUpQuestion({ question, references }: IAssistantItemFollowUpQuestionProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=AssistantItemFollowUpQuestion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssistantItemFollowUpQuestion.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItemFollowUpQuestion.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIzF;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAChD,OAAO,EAAE,0BAA0B,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,mCAAmC,2CAQ1G"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MarkdownComponent } from "./contents/Markdown.js";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export function AssistantItemFollowUpQuestion({ question, references }) {
|
|
7
|
+
return (_jsx("div", { className: "gd-gen-ai-chat__conversation__visualization__followUp", children: _jsx(MarkdownComponent, { allowMarkdown: true, references: references ?? [], children: question }) }));
|
|
8
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IChatConversationLocalItem, type TextContentObject } from "../../model.js";
|
|
2
2
|
export interface IAssistantItemSuggestionsProps {
|
|
3
3
|
showSuggestions?: boolean;
|
|
4
4
|
references?: TextContentObject[];
|
|
5
|
-
|
|
5
|
+
message: IChatConversationLocalItem;
|
|
6
6
|
type: "followUp" | "actions";
|
|
7
7
|
}
|
|
8
|
-
export declare function AssistantItemSuggestions({ type,
|
|
8
|
+
export declare function AssistantItemSuggestions({ type, message, showSuggestions, references }: IAssistantItemSuggestionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
//# sourceMappingURL=AssistantItemSuggestions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantItemSuggestions.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItemSuggestions.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssistantItemSuggestions.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItemSuggestions.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIzF,MAAM,WAAW,8BAA8B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;CAChC;AAED,wBAAgB,wBAAwB,CAAC,EACrC,IAAI,EACJ,OAAO,EACP,eAAe,EACf,UAAU,EACb,EAAE,8BAA8B,kDAgChC"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { agentsAvailableSelector } from "../../store/messages/messagesSelectors.js";
|
|
8
|
-
import { newMessageAction } from "../../store/messages/messagesSlice.js";
|
|
9
|
-
import { MarkdownComponent } from "./contents/Markdown.js";
|
|
10
|
-
export function AssistantItemSuggestions({ type, content, showSuggestions, references, }) {
|
|
11
|
-
const dispatch = useDispatch();
|
|
3
|
+
import { useSelector } from "react-redux";
|
|
4
|
+
import { settingsSelector } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
5
|
+
import { useCustomization } from "../CustomizationContext.js";
|
|
6
|
+
export function AssistantItemSuggestions({ type, message, showSuggestions, references, }) {
|
|
12
7
|
const settings = useSelector(settingsSelector);
|
|
13
|
-
const
|
|
14
|
-
const agentsAvailable = useSelector(agentsAvailableSelector);
|
|
15
|
-
const isDisabled = agentSwitchingActive && agentsAvailable !== true;
|
|
8
|
+
const { FollowUpButtonsComponent, FollowUpQuestionComponent } = useCustomization();
|
|
16
9
|
if (!showSuggestions || !settings?.enableAiAgenticSuggestions) {
|
|
17
10
|
return null;
|
|
18
11
|
}
|
|
12
|
+
const content = message.content;
|
|
19
13
|
if (content.type !== "multipart") {
|
|
20
14
|
return null;
|
|
21
15
|
}
|
|
@@ -23,7 +17,5 @@ export function AssistantItemSuggestions({ type, content, showSuggestions, refer
|
|
|
23
17
|
if (!suggestions) {
|
|
24
18
|
return null;
|
|
25
19
|
}
|
|
26
|
-
return (_jsxs(_Fragment, { children: [
|
|
27
|
-
dispatch(newMessageAction(makeUserItem({ type: "text", text: suggestion.query })));
|
|
28
|
-
}, tooltip: suggestion.query }, suggestion.label))) })) : null, suggestions.followUpQuestion && type === "followUp" ? (_jsx("div", { className: "gd-gen-ai-chat__conversation__visualization__followUp", children: _jsx(MarkdownComponent, { allowMarkdown: true, references: references ?? [], children: suggestions.followUpQuestion }) })) : null] }));
|
|
20
|
+
return (_jsxs(_Fragment, { children: [type === "actions" ? (_jsx(FollowUpButtonsComponent, { message: message, suggestions: suggestions.actions ?? [] })) : null, suggestions.followUpQuestion && type === "followUp" ? (_jsx(FollowUpQuestionComponent, { message: message, question: suggestions.followUpQuestion, references: references ?? [] })) : null] }));
|
|
29
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationItemContents.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ConversationItemContents.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConversationItemContents.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ConversationItemContents.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,0BAA0B,EAC/B,KAAK,iBAAiB,EACzB,MAAM,gBAAgB,CAAC;AAMxB,KAAK,6BAA6B,GAAG;IACjC,OAAO,EAAE,0BAA0B,CAAC;IACpC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,6BAA6B,kDA0DzG"}
|
|
@@ -1,57 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { useIntl } from "react-intl";
|
|
4
|
-
import { loadWhatIfScenarios } from "../../whatIf/whatIfMapping.js";
|
|
5
|
-
import { ConversationAlertProposalContent } from "./conversationContents/ConversationAlertProposalContent.js";
|
|
6
|
-
import { ConversationDashboardContent } from "./conversationContents/ConversationDashboardContent.js";
|
|
7
|
-
import { ConversationErrorContent } from "./conversationContents/ConversationErrorContent.js";
|
|
8
|
-
import { ConversationKdaContent } from "./conversationContents/ConversationKdaContent.js";
|
|
9
|
-
import { ConversationReasoningContent } from "./conversationContents/ConversationReasoningContent.js";
|
|
10
|
-
import { ConversationSearchContent } from "./conversationContents/ConversationSearchContent.js";
|
|
11
|
-
import { ConversationTextContent } from "./conversationContents/ConversationTextContent.js";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCustomization } from "../CustomizationContext.js";
|
|
12
3
|
import { ConversationToolCallContent } from "./conversationContents/ConversationToolCallContent.js";
|
|
13
4
|
import { ConversationToolResultContent } from "./conversationContents/ConversationToolResultContent.js";
|
|
14
|
-
import { ConversationVisualizationContent } from "./conversationContents/ConversationVisualizationContent.js";
|
|
15
|
-
import { ConversationWhatIfContent } from "./conversationContents/ConversationWhatIfContent.js";
|
|
16
5
|
export function ConversationItemContents({ message, references, isLoading }) {
|
|
17
|
-
const
|
|
6
|
+
const { MessageTextContentComponent, MessageErrorContentComponent, MessageReasoningContentComponent, MessageMultipartContentComponent, } = useCustomization();
|
|
18
7
|
const content = message.content;
|
|
19
8
|
if (content.type === "error") {
|
|
20
|
-
return
|
|
9
|
+
return _jsx(MessageErrorContentComponent, { ...content, isLoading: isLoading });
|
|
21
10
|
}
|
|
22
11
|
if (content.type === "text") {
|
|
23
|
-
return (_jsx(
|
|
12
|
+
return (_jsx(MessageTextContentComponent, { text: content.text, objects: [...(content.objects ?? []), ...references], isLoading: isLoading }));
|
|
24
13
|
}
|
|
25
14
|
if (content.type === "reasoning") {
|
|
26
|
-
return (_jsx(
|
|
15
|
+
return (_jsx(MessageReasoningContentComponent, { summary: content.summary, objects: [...(content.objects ?? []), ...references], isLoading: isLoading }));
|
|
27
16
|
}
|
|
28
17
|
if (content.type === "multipart") {
|
|
29
|
-
|
|
30
|
-
return (_jsx(_Fragment, { children: content.parts?.map((part, index) => {
|
|
31
|
-
if (part.type === "text") {
|
|
32
|
-
return (_jsx(ConversationTextContent, { useMarkdown: true, text: part.text, objects: [...(part.objects ?? []), ...references] }, index));
|
|
33
|
-
}
|
|
34
|
-
if (part.type === "alertProposal") {
|
|
35
|
-
return (_jsx(ConversationAlertProposalContent, { message: message, part: part, alertProposal: part.alertProposal, objects: [...(part.objects ?? []), ...references] }, index));
|
|
36
|
-
}
|
|
37
|
-
if (part.type === "visualization" && !whatIf) {
|
|
38
|
-
return part.visualization ? (_jsx(ConversationVisualizationContent, { message: message, part: part, visualization: part.visualization }, index)) : (_jsx("div", { className: "gd-gen-ai-chat__messages__content--error", children: intl.formatMessage({ id: "gd.gen-ai.visualization.unavailable" }) }, index));
|
|
39
|
-
}
|
|
40
|
-
if (part.type === "searchResults") {
|
|
41
|
-
return (_jsx(ConversationSearchContent, { results: part.searchResults, relationships: part.relationships, keywords: part.keywords }, index));
|
|
42
|
-
}
|
|
43
|
-
if (part.type === "kda") {
|
|
44
|
-
return _jsx(ConversationKdaContent, { kda: part.kda }, index);
|
|
45
|
-
}
|
|
46
|
-
if (part.type === "whatIf") {
|
|
47
|
-
return (_jsx(ConversationWhatIfContent, { message: message, part: part, whatIf: whatIf }, index));
|
|
48
|
-
}
|
|
49
|
-
if (part.type === "dashboard") {
|
|
50
|
-
return (_jsx(ConversationDashboardContent, { message: message, part: part, dashboard: part.dashboard, insights: part.insights, saved: part.saved }, index));
|
|
51
|
-
}
|
|
52
|
-
// Add more multipart types if needed
|
|
53
|
-
return null;
|
|
54
|
-
}) }));
|
|
18
|
+
return (_jsx(MessageMultipartContentComponent, { message: message, parts: content.parts ?? [], references: references }));
|
|
55
19
|
}
|
|
56
20
|
if (content.type === "toolCall") {
|
|
57
21
|
return (_jsx(ConversationToolCallContent, { name: content.name, isLoading: isLoading, arguments: content.arguments }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SemanticSearchTreeView.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/components/SemanticSearchTreeView.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAIhE,KAAK,2BAA2B,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,sBAAsB,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CAQxE;AAED,wBAAgB,0BAA0B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,2BAA2B,
|
|
1
|
+
{"version":3,"file":"SemanticSearchTreeView.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/components/SemanticSearchTreeView.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAIhE,KAAK,2BAA2B,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,sBAAsB,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,2CAQxE;AAED,wBAAgB,0BAA0B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,2BAA2B,kDA6ExG"}
|
|
@@ -50,6 +50,7 @@ export function SemanticSearchTreeViewImpl({ workspace, content, maxHeight }) {
|
|
|
50
50
|
itemUrl,
|
|
51
51
|
newTab,
|
|
52
52
|
preventDefault,
|
|
53
|
+
action: "open",
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
if (isSemanticSearchRelationship(data)) {
|
|
@@ -60,6 +61,7 @@ export function SemanticSearchTreeViewImpl({ workspace, content, maxHeight }) {
|
|
|
60
61
|
itemUrl,
|
|
61
62
|
newTab,
|
|
62
63
|
preventDefault,
|
|
64
|
+
action: "open",
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
67
|
}
|
|
@@ -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;AAKxE,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;AAKxE,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,oDA4FtF;AAyBD,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,uBAAuB,2CAItE"}
|
|
@@ -53,6 +53,7 @@ export function CustomHyperlinkComponent({ href, text, settings }) {
|
|
|
53
53
|
itemUrl: parsedRef.itemUrl,
|
|
54
54
|
newTab: e.metaKey,
|
|
55
55
|
preventDefault: e.preventDefault.bind(e),
|
|
56
|
+
action: "open",
|
|
56
57
|
});
|
|
57
58
|
};
|
|
58
59
|
// If the link is for a metric and the user cannot manage metrics,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisualizationContents.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/VisualizationContents.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAEH,KAAK,aAAa,EAarB,MAAM,qBAAqB,CAAC;AAgD7B,OAAO,EAAE,KAAK,qBAAqB,EAAqC,MAAM,mBAAmB,CAAC;AAMlG,OAAO,EAEH,0BAA0B,EAC7B,MAAM,8CAA8C,CAAC;AA+BtD,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,oBAAoB,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,KAAK,IAAI,CAAC;CAC3F,CAAC;AAEF,KAAK,6BAA6B,GAAG,IAAI,CACrC,0BAA0B,EACxB,cAAc,GACd,qBAAqB,GACrB,sBAAsB,GACtB,8BAA8B,GAC9B,sBAAsB,GACtB,aAAa,GACb,iBAAiB,GACjB,mBAAmB,GACnB,sBAAsB,CAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"VisualizationContents.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/VisualizationContents.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAEH,KAAK,aAAa,EAarB,MAAM,qBAAqB,CAAC;AAgD7B,OAAO,EAAE,KAAK,qBAAqB,EAAqC,MAAM,mBAAmB,CAAC;AAMlG,OAAO,EAEH,0BAA0B,EAC7B,MAAM,8CAA8C,CAAC;AA+BtD,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,oBAAoB,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,KAAK,IAAI,CAAC;CAC3F,CAAC;AAEF,KAAK,6BAA6B,GAAG,IAAI,CACrC,0BAA0B,EACxB,cAAc,GACd,qBAAqB,GACrB,sBAAsB,GACtB,8BAA8B,GAC9B,sBAAsB,GACtB,aAAa,GACb,iBAAiB,GACjB,mBAAmB,GACnB,sBAAsB,CAC3B,CAAC;AA6lCF,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,6BAA6B,2CAmClF"}
|
|
@@ -142,6 +142,7 @@ function VisualizationContentsComponentCore({ content, messageId, useMarkdown, c
|
|
|
142
142
|
preventDefault: e.preventDefault.bind(e),
|
|
143
143
|
itemUrl: getVisualizationHref(workspaceId, vis.savedVisualizationId, visualizationStatus, useHostedAnalyticalDesigner),
|
|
144
144
|
visualizationStatus,
|
|
145
|
+
action: "open",
|
|
145
146
|
});
|
|
146
147
|
e.stopPropagation();
|
|
147
148
|
};
|
|
@@ -181,6 +182,7 @@ function VisualizationContentsComponentCore({ content, messageId, useMarkdown, c
|
|
|
181
182
|
preventDefault: e.preventDefault.bind(e),
|
|
182
183
|
itemUrl: getAbsoluteVisualizationHref(workspaceId, visualization.savedVisualizationId, visualizationStatus, useHostedAnalyticalDesigner),
|
|
183
184
|
visualizationStatus,
|
|
185
|
+
action: "copy",
|
|
184
186
|
});
|
|
185
187
|
}
|
|
186
188
|
if (link) {
|
|
@@ -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,kDAwGpF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IChatConversationLocalItem, type IChatConversationMultipartLocalPart, type TextContentObject } from "../../../model.js";
|
|
2
|
+
export type ConversationMultipartContentProps = {
|
|
3
|
+
message: IChatConversationLocalItem;
|
|
4
|
+
parts: IChatConversationMultipartLocalPart[];
|
|
5
|
+
references: TextContentObject[];
|
|
6
|
+
};
|
|
7
|
+
export declare function ConversationMultipartContent({ message, parts, references }: ConversationMultipartContentProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=ConversationMultipartContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationMultipartContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationMultipartContent.tsx"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,iBAAiB,EACzB,MAAM,mBAAmB,CAAC;AAW3B,MAAM,MAAM,iCAAiC,GAAG;IAC5C,OAAO,EAAE,0BAA0B,CAAC;IACpC,KAAK,EAAE,mCAAmC,EAAE,CAAC;IAC7C,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACnC,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,EACzC,OAAO,EACP,KAAK,EACL,UAAU,EACb,EAAE,iCAAiC,2CAkFnC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2024-2026 GoodData Corporation
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { loadWhatIfScenarios } from "../../../whatIf/whatIfMapping.js";
|
|
5
|
+
import { ConversationAlertProposalContent } from "./ConversationAlertProposalContent.js";
|
|
6
|
+
import { ConversationDashboardContent } from "./ConversationDashboardContent.js";
|
|
7
|
+
import { ConversationKdaContent } from "./ConversationKdaContent.js";
|
|
8
|
+
import { ConversationSearchContent } from "./ConversationSearchContent.js";
|
|
9
|
+
import { ConversationTextContent } from "./ConversationTextContent.js";
|
|
10
|
+
import { ConversationVisualizationContent } from "./ConversationVisualizationContent.js";
|
|
11
|
+
import { ConversationWhatIfContent } from "./ConversationWhatIfContent.js";
|
|
12
|
+
export function ConversationMultipartContent({ message, parts, references, }) {
|
|
13
|
+
const intl = useIntl();
|
|
14
|
+
const whatIf = loadWhatIfScenarios(parts);
|
|
15
|
+
return (_jsx(_Fragment, { children: parts?.map((part, index) => {
|
|
16
|
+
if (part.type === "text") {
|
|
17
|
+
return (_jsx(ConversationTextContent, { useMarkdown: true, text: part.text, objects: [...(part.objects ?? []), ...references] }, index));
|
|
18
|
+
}
|
|
19
|
+
if (part.type === "alertProposal") {
|
|
20
|
+
return (_jsx(ConversationAlertProposalContent, { message: message, part: part, alertProposal: part.alertProposal, objects: [...(part.objects ?? []), ...references] }, index));
|
|
21
|
+
}
|
|
22
|
+
if (part.type === "visualization" && !whatIf) {
|
|
23
|
+
return part.visualization ? (_jsx(ConversationVisualizationContent, { message: message, part: part, visualization: part.visualization }, index)) : (_jsx("div", { className: "gd-gen-ai-chat__messages__content--error", children: intl.formatMessage({ id: "gd.gen-ai.visualization.unavailable" }) }, index));
|
|
24
|
+
}
|
|
25
|
+
if (part.type === "searchResults") {
|
|
26
|
+
return (_jsx(ConversationSearchContent, { results: part.searchResults, relationships: part.relationships, keywords: part.keywords }, index));
|
|
27
|
+
}
|
|
28
|
+
if (part.type === "kda") {
|
|
29
|
+
return _jsx(ConversationKdaContent, { kda: part.kda }, index);
|
|
30
|
+
}
|
|
31
|
+
if (part.type === "whatIf") {
|
|
32
|
+
return (_jsx(ConversationWhatIfContent, { message: message, part: part, whatIf: whatIf }, index));
|
|
33
|
+
}
|
|
34
|
+
if (part.type === "dashboard") {
|
|
35
|
+
return (_jsx(ConversationDashboardContent, { message: message, part: part, dashboard: part.dashboard, insights: part.insights, saved: part.saved }, index));
|
|
36
|
+
}
|
|
37
|
+
// Add more multipart types if needed
|
|
38
|
+
return null;
|
|
39
|
+
}) }));
|
|
40
|
+
}
|
|
@@ -306,6 +306,7 @@ function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
|
306
306
|
itemUrl: getVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus, useHostedAnalyticalDesigner),
|
|
307
307
|
visualization,
|
|
308
308
|
visualizationStatus,
|
|
309
|
+
action: "open",
|
|
309
310
|
});
|
|
310
311
|
e.stopPropagation();
|
|
311
312
|
}
|
|
@@ -333,6 +334,7 @@ function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
|
333
334
|
itemUrl: getAbsoluteVisualizationHref(workspaceId, visualization.insight.identifier, visualizationStatus, useHostedAnalyticalDesigner),
|
|
334
335
|
visualization,
|
|
335
336
|
visualizationStatus,
|
|
337
|
+
action: "copy",
|
|
336
338
|
});
|
|
337
339
|
}
|
|
338
340
|
if (link) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupUtility.d.ts","sourceRoot":"","sources":["../../../src/components/utils/groupUtility.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC9D,QAAQ,EAAE,0BAA0B,EAAE,CAAC;CAC1C;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,0BAA0B,EAAE,GAAG,kBAAkB,EAAE,CAmD1F"}
|
|
1
|
+
{"version":3,"file":"groupUtility.d.ts","sourceRoot":"","sources":["../../../src/components/utils/groupUtility.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC9D,QAAQ,EAAE,0BAA0B,EAAE,CAAC;CAC1C;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,0BAA0B,EAAE,GAAG,kBAAkB,EAAE,CAmD1F"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type IGenAIUserContext } from "@gooddata/sdk-model";
|
|
2
1
|
import { type IGenAIContextObject, type StoreContext } from "../types.js";
|
|
3
2
|
export declare function addContextReference(context: StoreContext, reference?: IGenAIContextObject): StoreContext;
|
|
4
|
-
export declare function addAmbientContextReferences(context: StoreContext, userContext?: IGenAIUserContext): StoreContext;
|
|
5
3
|
//# sourceMappingURL=addContextReference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addContextReference.d.ts","sourceRoot":"","sources":["../../src/context/addContextReference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addContextReference.d.ts","sourceRoot":"","sources":["../../src/context/addContextReference.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAG1E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CA6DxG"}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { areObjRefsEqual
|
|
2
|
+
import { areObjRefsEqual } from "@gooddata/sdk-model";
|
|
3
3
|
import { convertGenAiTypeToReferenceType } from "../utils.js";
|
|
4
|
-
import { mergeContexts } from "./build.js";
|
|
5
|
-
import { isReferenceChanged } from "./isReferenceChanged.js";
|
|
6
|
-
import { removeAmbientContribution, removeReferencesCoveredByAmbient } from "./removeContextReference.js";
|
|
7
4
|
export function addContextReference(context, reference) {
|
|
8
|
-
const {
|
|
5
|
+
const { active } = context;
|
|
9
6
|
if (!reference) {
|
|
10
7
|
return context;
|
|
11
8
|
}
|
|
12
|
-
if (reference.where === "view.dashboard"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
...
|
|
17
|
-
|
|
18
|
-
...active,
|
|
19
|
-
|
|
20
|
-
dashboard: ambientDashboard,
|
|
21
|
-
},
|
|
9
|
+
if (reference.where === "view.dashboard") {
|
|
10
|
+
return {
|
|
11
|
+
...context,
|
|
12
|
+
active: {
|
|
13
|
+
...active,
|
|
14
|
+
view: {
|
|
15
|
+
...active?.view,
|
|
16
|
+
dashboard: context.ambient?.view?.dashboard,
|
|
22
17
|
},
|
|
23
|
-
}
|
|
24
|
-
}
|
|
18
|
+
},
|
|
19
|
+
};
|
|
25
20
|
}
|
|
26
21
|
if (reference.where === "referencedObjects") {
|
|
27
22
|
const refContext = reference.context;
|
|
@@ -59,21 +54,3 @@ export function addContextReference(context, reference) {
|
|
|
59
54
|
}
|
|
60
55
|
return context;
|
|
61
56
|
}
|
|
62
|
-
function pruneForNewAmbient(active, previousAmbient, newAmbient) {
|
|
63
|
-
return removeReferencesCoveredByAmbient(removeAmbientContribution(active, previousAmbient), newAmbient);
|
|
64
|
-
}
|
|
65
|
-
export function addAmbientContextReferences(context, userContext) {
|
|
66
|
-
const referenceChanged = isReferenceChanged(context.ambient, userContext);
|
|
67
|
-
const updateActive = Boolean(!context.ambient || context.active?.view?.dashboard || referenceChanged);
|
|
68
|
-
return {
|
|
69
|
-
...context,
|
|
70
|
-
ambient: userContext,
|
|
71
|
-
...(updateActive
|
|
72
|
-
? {
|
|
73
|
-
active: mergeContexts(referenceChanged
|
|
74
|
-
? pruneForNewAmbient(context.active, context.ambient, userContext)
|
|
75
|
-
: context.active, userContext),
|
|
76
|
-
}
|
|
77
|
-
: {}),
|
|
78
|
-
};
|
|
79
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IGenAIUserContext } from "@gooddata/sdk-model";
|
|
2
|
-
import { type IGenAIContextObject } from "../types.js";
|
|
3
|
-
export declare function collectContextReferences(
|
|
2
|
+
import { type IGenAIContextObject, type SelectedContext } from "../types.js";
|
|
3
|
+
export declare function collectContextReferences(userContext: IGenAIUserContext | undefined, selectedContext: SelectedContext | undefined, placeholderTitle?: string): IGenAIContextObject[];
|
|
4
4
|
export declare function collectAvailableReferences(context: IGenAIUserContext | undefined, placeholderTitle?: string): IGenAIContextObject[];
|
|
5
5
|
//# sourceMappingURL=collectContextReferences.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAG7E,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,iBAAiB,GAAG,SAAS,EAC1C,eAAe,EAAE,eAAe,GAAG,SAAS,EAC5C,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CA0CvB;AAED,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAuFvB"}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { isIdentifierRef, serializeObjRef, } from "@gooddata/sdk-model";
|
|
2
|
+
import { areObjRefsEqual, isIdentifierRef, serializeObjRef, } from "@gooddata/sdk-model";
|
|
3
3
|
import { convertReferenceTypeToGenAiType } from "../utils.js";
|
|
4
|
-
export function collectContextReferences(
|
|
5
|
-
|
|
6
|
-
return [];
|
|
7
|
-
}
|
|
8
|
-
const references = [];
|
|
4
|
+
export function collectContextReferences(userContext, selectedContext, placeholderTitle) {
|
|
5
|
+
const userReferences = [];
|
|
9
6
|
// dashboard
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
const ref =
|
|
7
|
+
const userDashboard = userContext?.view?.dashboard;
|
|
8
|
+
if (userDashboard) {
|
|
9
|
+
const ref = userDashboard.ref;
|
|
13
10
|
const id = isIdentifierRef(ref) ? ref.identifier : ref.uri;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
if (!areObjRefsEqual(ref, selectedContext?.dashboard?.ref)) {
|
|
12
|
+
userReferences.push({
|
|
13
|
+
id,
|
|
14
|
+
ref,
|
|
15
|
+
nesting: 0,
|
|
16
|
+
type: "dashboard",
|
|
17
|
+
where: "view.dashboard",
|
|
18
|
+
title: userDashboard.title || placeholderTitle || id,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
22
21
|
}
|
|
23
22
|
// references
|
|
24
|
-
|
|
23
|
+
userContext?.referencedObjects?.forEach((obj) => {
|
|
24
|
+
if (areObjRefsEqual(obj.context?.ref, selectedContext?.dashboard?.ref)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
25
27
|
obj.objects.forEach((item) => {
|
|
26
28
|
const ref = item.ref;
|
|
27
29
|
const id = isIdentifierRef(ref) ? ref.identifier : ref.uri;
|
|
28
|
-
|
|
30
|
+
userReferences.push({
|
|
29
31
|
id,
|
|
30
32
|
ref,
|
|
31
33
|
nesting: 1,
|
|
@@ -35,7 +37,7 @@ export function collectContextReferences(context, placeholderTitle) {
|
|
|
35
37
|
});
|
|
36
38
|
});
|
|
37
39
|
});
|
|
38
|
-
return
|
|
40
|
+
return userReferences.sort((a, b) => a.nesting - b.nesting);
|
|
39
41
|
}
|
|
40
42
|
export function collectAvailableReferences(context, placeholderTitle) {
|
|
41
43
|
if (!context) {
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
export declare function removeContextReference(context: IGenAIUserContext | undefined, reference?: IGenAIContextObject): IGenAIUserContext | undefined;
|
|
4
|
-
/**
|
|
5
|
-
* Removes what `ambient` put in `context` on its own - the viewed dashboard and its own references.
|
|
6
|
-
* The user's own picks stay, the objects pinned from that dashboard included.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare function removeAmbientContribution(context: IGenAIUserContext | undefined, ambient: IGenAIUserContext | undefined): IGenAIUserContext | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Removes the references the newly opened dashboard covers itself - its own ref and the
|
|
12
|
-
* visualizations it renders - so nothing added earlier sits in the context twice.
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare function removeReferencesCoveredByAmbient(context: IGenAIUserContext | undefined, ambient: IGenAIUserContext | undefined): IGenAIUserContext | undefined;
|
|
16
|
-
export declare function removeUserContextReferences(context: IGenAIUserContext | undefined): IGenAIUserContext | undefined;
|
|
1
|
+
import { type IGenAIContextObject, type StoreContext } from "../types.js";
|
|
2
|
+
export declare function removeContextReference(context: StoreContext, reference?: IGenAIContextObject): StoreContext;
|
|
17
3
|
//# sourceMappingURL=removeContextReference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeContextReference.d.ts","sourceRoot":"","sources":["../../src/context/removeContextReference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"removeContextReference.d.ts","sourceRoot":"","sources":["../../src/context/removeContextReference.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAI1E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CAyC3G"}
|