@gooddata/sdk-ui-gen-ai 11.69.0-alpha.3 → 11.69.0-alpha.5
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 +250 -51
- package/esm/components/GenAIChatOverlay.js +4 -4
- package/esm/components/Input.d.ts.map +1 -1
- package/esm/components/Input.js +1 -2
- package/esm/components/customized/LandingQuestion.js +1 -1
- package/esm/components/customized/MessageTextContent.js +1 -1
- package/esm/components/customized/types.d.ts +5 -0
- package/esm/components/customized/types.d.ts.map +1 -1
- package/esm/components/messages/ConversationItemContents.d.ts +1 -1
- package/esm/components/messages/ConversationItemContents.d.ts.map +1 -1
- package/esm/components/messages/ConversationItemContents.js +2 -2
- package/esm/components/messages/contents/Markdown.d.ts.map +1 -1
- package/esm/components/messages/contents/Markdown.js +22 -4
- package/esm/components/messages/conversationContents/ConversationVisualisation.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualisation.js +19 -4
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.js +12 -2
- package/esm/components/utils/animation.d.ts +3 -0
- package/esm/components/utils/animation.d.ts.map +1 -1
- package/esm/components/utils/animation.js +6 -56
- package/esm/components/utils/markdownUtils.js +2 -2
- package/esm/copilot/CopilotHandler.d.ts +1 -0
- package/esm/copilot/CopilotHandler.d.ts.map +1 -1
- package/esm/copilot/CopilotHandler.js +12 -2
- package/esm/copilot/useDashboardCopilot.d.ts +56 -0
- package/esm/copilot/useDashboardCopilot.d.ts.map +1 -0
- package/esm/copilot/useDashboardCopilot.js +268 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -0
- package/esm/sdk-ui-gen-ai.d.ts +59 -0
- package/package.json +22 -23
- package/styles/css/animation.css +3 -31
- package/styles/css/animation.css.map +1 -1
- package/styles/css/main.css +28 -50
- package/styles/css/main.css.map +1 -1
- package/styles/css/messages.css +1 -1
- package/styles/css/window.css +0 -6
- package/styles/css/window.css.map +1 -1
- package/styles/scss/animation.scss +3 -36
- package/styles/scss/messages.scss +1 -1
- package/styles/scss/window.scss +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationItemContents.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ConversationItemContents.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGH,KAAK,0BAA0B,EAC/B,KAAK,iBAAiB,EACzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,kBAAkB,EAA0B,MAAM,0BAA0B,CAAC;AAO3F,KAAK,6BAA6B,GAAG;IACjC,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,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,EACrC,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,MAAM,GACT,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"ConversationItemContents.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ConversationItemContents.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGH,KAAK,0BAA0B,EAC/B,KAAK,iBAAiB,EACzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,kBAAkB,EAA0B,MAAM,0BAA0B,CAAC;AAO3F,KAAK,6BAA6B,GAAG;IACjC,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,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,EACrC,OAAO,EACP,MAAM,EACN,UAAU,EACV,IAAI,EACJ,SAAS,EACT,MAAM,GACT,EAAE,6BAA6B,kDAwF/B"}
|
|
@@ -8,7 +8,7 @@ import { ConversationClarifyingAnswersContent } from "./conversationContents/Con
|
|
|
8
8
|
import { ConversationSkillActivatedContent } from "./conversationContents/ConversationSkillActivatedContent.js";
|
|
9
9
|
import { ConversationToolCallContent } from "./conversationContents/ConversationToolCallContent.js";
|
|
10
10
|
import { ConversationToolResultContent } from "./conversationContents/ConversationToolResultContent.js";
|
|
11
|
-
export function ConversationItemContents({ message, groups, references, isLoading, isLast, }) {
|
|
11
|
+
export function ConversationItemContents({ message, groups, references, role, isLoading, isLast, }) {
|
|
12
12
|
const { MessageTextContentComponent, MessageErrorContentComponent, MessageReasoningContentComponent, MessageMultipartContentComponent, } = useCustomization();
|
|
13
13
|
const agents = useSelector(agentsSelector);
|
|
14
14
|
const content = message.content;
|
|
@@ -16,7 +16,7 @@ export function ConversationItemContents({ message, groups, references, isLoadin
|
|
|
16
16
|
return _jsx(MessageErrorContentComponent, { ...content, isLoading: isLoading });
|
|
17
17
|
}
|
|
18
18
|
if (content.type === "text") {
|
|
19
|
-
return (_jsx(MessageTextContentComponent, { text: content.text, objects: [...(content.objects ?? []), ...references], isLoading: isLoading }));
|
|
19
|
+
return (_jsx(MessageTextContentComponent, { text: content.text, useMarkdown: role !== "user", objects: [...(content.objects ?? []), ...references], isLoading: isLoading }));
|
|
20
20
|
}
|
|
21
21
|
if (content.type === "reasoning") {
|
|
22
22
|
const groupIndex = groups.findIndex((group) => group.messages.some((m) => m.localId === message.localId));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/Markdown.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAuD3D,KAAK,sBAAsB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAqB,EAAE,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/Markdown.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAuD3D,KAAK,sBAAsB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAqB,EAAE,EAAE,sBAAsB,2CAiCxG"}
|
|
@@ -40,10 +40,28 @@ export function MarkdownComponent({ children, references, allowMarkdown = false
|
|
|
40
40
|
return createReferenceTooltip(intl, props, references, catalogItems) ?? _jsx("span", { ...props });
|
|
41
41
|
},
|
|
42
42
|
}), [intl, references, catalogItems]);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
return (_jsx(Markdown, { remarkPlugins: allowMarkdown ? [remarkEmoji, remarkGfm, remarkReferences()] : [], rehypePlugins: [
|
|
44
|
+
...(allowMarkdown ? [] : [rehypePlainText(text)]),
|
|
45
|
+
rehypeReferences(references ?? [], tokens),
|
|
46
|
+
], components: componentMap, urlTransform: customUrlTransform, children: text }));
|
|
47
|
+
}
|
|
48
|
+
function rehypePlainText(text) {
|
|
49
|
+
return function () {
|
|
50
|
+
return function () {
|
|
51
|
+
// Replace parsed markup after conversion to HTML nodes to preserve whitespace as well as text.
|
|
52
|
+
return {
|
|
53
|
+
type: "root",
|
|
54
|
+
children: [
|
|
55
|
+
{
|
|
56
|
+
type: "element",
|
|
57
|
+
tagName: "p",
|
|
58
|
+
properties: {},
|
|
59
|
+
children: [{ type: "text", value: text }],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
47
65
|
}
|
|
48
66
|
const OBJECT_CLASS_NAME = "gd-gen-ai-chat__message__object";
|
|
49
67
|
function createReferenceTooltip(intl, props, references = [], catalogItems = []) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationVisualisation.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualisation.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAGH,KAAK,aAAa,EAElB,KAAK,gBAAgB,EAIrB,KAAK,WAAW,EAWnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAInB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationVisualisation.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualisation.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAGH,KAAK,aAAa,EAElB,KAAK,gBAAgB,EAIrB,KAAK,WAAW,EAWnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAInB,MAAM,kBAAkB,CAAC;AAyB1B,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AA2CpE,MAAM,MAAM,8BAA8B,GAAG;IACzC,OAAO,EAAE,0BAA0B,CAAC;IACpC,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACzD,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,CACX,IAAI,EAAE;QACF,aAAa,EAAE,kCAAkC,EAAE,CAAC;QACpD,KAAK,EAAE,WAAW,CAAC;KACtB,GAAG,IAAI,KACP,IAAI,CAAC;IACV,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EACtC,OAAO,EACP,YAAY,EACZ,UAAU,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,EACZ,cAAqB,EACrB,oBAA4B,EAC5B,yBAAiC,EACjC,mBAA0B,EAC1B,4BAAoC,GACvC,EAAE,8BAA8B,2CAsdhC"}
|
|
@@ -139,14 +139,14 @@ export function ConversationVisualisation({ message, colorPalette, separators, v
|
|
|
139
139
|
separators,
|
|
140
140
|
});
|
|
141
141
|
case "local:bar":
|
|
142
|
-
return renderBarChart(intl.locale, bucketsData, filters, sorts, colorPalette, handleSdkError, handleSuccess, handlerDrill, {
|
|
142
|
+
return renderBarChart(intl.locale, visualization, bucketsData, filters, sorts, colorPalette, handleSdkError, handleSuccess, handlerDrill, {
|
|
143
143
|
enableChangeAnalysis,
|
|
144
144
|
enableAccessibleChartTooltip,
|
|
145
145
|
execConfig,
|
|
146
146
|
separators,
|
|
147
147
|
});
|
|
148
148
|
case "local:column":
|
|
149
|
-
return renderColumnChart(intl.locale, bucketsData, filters, sorts, colorPalette, handleSdkError, handleSuccess, handlerDrill, {
|
|
149
|
+
return renderColumnChart(intl.locale, visualization, bucketsData, filters, sorts, colorPalette, handleSdkError, handleSuccess, handlerDrill, {
|
|
150
150
|
drillableItems,
|
|
151
151
|
enableChangeAnalysis,
|
|
152
152
|
enableAccessibleChartTooltip,
|
|
@@ -302,9 +302,10 @@ const renderAreaChart = (locale, visualization, buckets, filters, sortBy, colorP
|
|
|
302
302
|
stackMeasuresToPercent: controls?.["stackMeasuresToPercent"],
|
|
303
303
|
}, drillableItems: props.drillableItems, onDrill: onDrill, onError: onError, onExportReady: onSuccess, execConfig: props.execConfig }));
|
|
304
304
|
};
|
|
305
|
-
const renderBarChart = (locale, buckets, filters, sortBy, colorPalette, onError, onSuccess, onDrill, props) => {
|
|
305
|
+
const renderBarChart = (locale, visualization, buckets, filters, sortBy, colorPalette, onError, onSuccess, onDrill, props) => {
|
|
306
306
|
const { metrics, view, stack } = buckets;
|
|
307
307
|
const measures = stack[0] ? metrics.slice(0, 1) : metrics;
|
|
308
|
+
const secondaryAxis = getSecondaryAxisConfig(visualization.insight.properties["controls"]?.secondary_xaxis?.measures, measures);
|
|
308
309
|
return (_jsx(BarChart, { locale: locale, height: VIS_HEIGHT, measures: measures, viewBy: view, stackBy: stack[0], sortBy: sortsOver(sortBy, [...view, ...stack.slice(0, 1)], measures), config: {
|
|
309
310
|
...defaultsChartOptions,
|
|
310
311
|
...visualizationTooltipOptions,
|
|
@@ -314,11 +315,13 @@ const renderBarChart = (locale, buckets, filters, sortBy, colorPalette, onError,
|
|
|
314
315
|
// Better visibility with stacked bars if there are multiple metrics and dimensions
|
|
315
316
|
stackMeasures: stack.length >= 1,
|
|
316
317
|
enableAccessibleTooltip: props.enableAccessibleChartTooltip,
|
|
318
|
+
...(secondaryAxis ? { secondary_xaxis: secondaryAxis } : {}),
|
|
317
319
|
}, drillableItems: props.drillableItems, onDrill: onDrill, filters: filters, onError: onError, onExportReady: onSuccess, execConfig: props.execConfig }));
|
|
318
320
|
};
|
|
319
|
-
const renderColumnChart = (locale, buckets, filters, sortBy, colorPalette, onError, onSuccess, onDrill, props) => {
|
|
321
|
+
const renderColumnChart = (locale, visualization, buckets, filters, sortBy, colorPalette, onError, onSuccess, onDrill, props) => {
|
|
320
322
|
const { metrics, view, stack } = buckets;
|
|
321
323
|
const measures = stack[0] ? metrics.slice(0, 1) : metrics;
|
|
324
|
+
const secondaryAxis = getSecondaryAxisConfig(visualization.insight.properties["controls"]?.secondary_yaxis?.measures, measures);
|
|
322
325
|
return (_jsx(ColumnChart, { locale: locale, height: VIS_HEIGHT, measures: measures, viewBy: view, stackBy: stack[0], sortBy: sortsOver(sortBy, [...view, ...stack.slice(0, 1)], measures), config: {
|
|
323
326
|
...defaultsChartOptions,
|
|
324
327
|
...visualizationTooltipOptions,
|
|
@@ -328,6 +331,7 @@ const renderColumnChart = (locale, buckets, filters, sortBy, colorPalette, onErr
|
|
|
328
331
|
// Better visibility with stacked bars if there are multiple metrics and dimensions
|
|
329
332
|
stackMeasures: stack.length >= 1,
|
|
330
333
|
enableAccessibleTooltip: props.enableAccessibleChartTooltip,
|
|
334
|
+
...(secondaryAxis ? { secondary_yaxis: secondaryAxis } : {}),
|
|
331
335
|
}, drillableItems: props.drillableItems, onDrill: onDrill, filters: filters, onError: onError, onExportReady: onSuccess, execConfig: props.execConfig }));
|
|
332
336
|
};
|
|
333
337
|
const renderLineChart = (locale, visualization, buckets, filters, sortBy, colorPalette, onError, onSuccess, onDrill, props) => {
|
|
@@ -336,6 +340,7 @@ const renderLineChart = (locale, visualization, buckets, filters, sortBy, colorP
|
|
|
336
340
|
const anomalies = mapVisualizationAnomalyDetectionToChartConfig(visualization.insight.properties["controls"]);
|
|
337
341
|
const outliersConfig = mapVisualizationAnomalyDetectionToBackendConfig(visualization.insight.properties["controls"]);
|
|
338
342
|
const { metrics, trend, segment } = buckets;
|
|
343
|
+
const secondaryAxis = getSecondaryAxisConfig(visualization.insight.properties["controls"]?.secondary_yaxis?.measures, metrics);
|
|
339
344
|
return (_jsx(LineChart, { locale: locale, height: VIS_HEIGHT, measures: metrics, trendBy: trend[0], segmentBy: segment[0], filters: filters, sortBy: sortBy, config: {
|
|
340
345
|
...defaultsChartOptions,
|
|
341
346
|
...visualizationTooltipOptions,
|
|
@@ -345,6 +350,7 @@ const renderLineChart = (locale, visualization, buckets, filters, sortBy, colorP
|
|
|
345
350
|
enableAccessibleTooltip: props.enableAccessibleChartTooltip,
|
|
346
351
|
...(forecastConfig && forecast ? { forecast } : {}),
|
|
347
352
|
...(outliersConfig && anomalies ? { anomalies } : {}),
|
|
353
|
+
...(secondaryAxis ? { secondary_yaxis: secondaryAxis } : {}),
|
|
348
354
|
}, forecastConfig: forecastConfig, outliersConfig: outliersConfig, drillableItems: props.drillableItems, onDrill: onDrill, onError: onError, onExportReady: onSuccess, execConfig: props.execConfig }));
|
|
349
355
|
};
|
|
350
356
|
const renderSlicedChart = (Chart, locale, buckets, filters, sortBy, colorPalette, onError, onSuccess, onDrill, props) => {
|
|
@@ -550,6 +556,15 @@ function sortsOver(sortBy, attributes, measures) {
|
|
|
550
556
|
measureIdentifiers.every((id) => measureIds.includes(id)));
|
|
551
557
|
});
|
|
552
558
|
}
|
|
559
|
+
// The chart matches axis membership by exact measure local ID. Saved IDs of measures the chart does
|
|
560
|
+
// not receive (e.g. the extra measures a stacked bar drops) are left out; with none left, it keeps one axis.
|
|
561
|
+
function getSecondaryAxisConfig(secondaryMeasureIds, renderedMeasures) {
|
|
562
|
+
if (!Array.isArray(secondaryMeasureIds)) {
|
|
563
|
+
return undefined;
|
|
564
|
+
}
|
|
565
|
+
const measures = renderedMeasures.map(measureLocalId).filter((id) => secondaryMeasureIds.includes(id));
|
|
566
|
+
return measures.length > 0 ? { measures } : undefined;
|
|
567
|
+
}
|
|
553
568
|
function useBucketData(buckets) {
|
|
554
569
|
return useMemo(() => {
|
|
555
570
|
const metrics = buckets.find((b) => b.localIdentifier === "measures")?.items.filter(isMeasure) ?? [];
|
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":"
|
|
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;AAwBvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAa9G,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAGlF,OAAO,EACH,KAAK,oDAAoD,EAE5D,MAAM,2BAA2B,CAAC;AAmBnC,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;IAC9E,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,EAC7C,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,SAAS,EACT,uBAAuB,GAC1B,EAAE,qCAAqC,2CAwIvC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2024-2026 GoodData Corporation
|
|
3
|
-
import { useCallback, useId, useMemo, useRef, useState, } from "react";
|
|
3
|
+
import { useCallback, useEffect, useId, useMemo, useRef, useState, } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import copy from "copy-to-clipboard";
|
|
6
6
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
7
7
|
import { useDispatch, useSelector } from "react-redux";
|
|
8
8
|
import { insightVisualizationType } from "@gooddata/sdk-model";
|
|
9
9
|
import { isClusteringNotReceived, isDataTooLargeToCompute, isDataTooLargeToDisplay, isForecastNotReceived, isNegativeValues, isNoDataSdkError, useWorkspaceStrict, } from "@gooddata/sdk-ui";
|
|
10
|
+
import { DRILL_MENU_HOST_ATTRIBUTE, notifyDrillMenuExpandedChange } from "@gooddata/sdk-ui-charts";
|
|
10
11
|
import { canConvertToTable } from "@gooddata/sdk-ui-ext";
|
|
11
12
|
import { Dropdown, IconCopy, IconExternalLink, IconSave, UiIconButton, UiTooltip, } from "@gooddata/sdk-ui-kit";
|
|
12
13
|
import { catalogItemsSelector, colorPaletteSelector, settingsSelector, } from "../../../store/chatWindow/chatWindowSelectors.js";
|
|
@@ -206,6 +207,15 @@ function DrillState({ containerRef, filters, children, drillState, setDrillState
|
|
|
206
207
|
const intl = useIntl();
|
|
207
208
|
const dispatch = useDispatch();
|
|
208
209
|
const catalogItems = useSelector(catalogItemsSelector);
|
|
210
|
+
const openDrillEvent = drillState?.event;
|
|
211
|
+
useEffect(() => {
|
|
212
|
+
const target = openDrillEvent?.target;
|
|
213
|
+
if (!target) {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
notifyDrillMenuExpandedChange(target, true);
|
|
217
|
+
return () => notifyDrillMenuExpandedChange(target, false);
|
|
218
|
+
}, [openDrillEvent]);
|
|
209
219
|
return (_jsx(Dropdown, { enableAutoToggle: false, isOpen: Boolean(drillState), onToggle: (state) => {
|
|
210
220
|
if (!state) {
|
|
211
221
|
setDrillState(null);
|
|
@@ -233,7 +243,7 @@ function DrillState({ containerRef, filters, children, drillState, setDrillState
|
|
|
233
243
|
}, onClose: () => {
|
|
234
244
|
setDrillState(null);
|
|
235
245
|
} }));
|
|
236
|
-
}, renderButton: () => (_jsxs(_Fragment, { children: [children, _jsx(_Fragment, { children: drillState ? (_jsx("div", { className: "gd-gen-ai-chat__conversation__visualization__drill_overlay" })) : null })] })) }));
|
|
246
|
+
}, renderButton: () => (_jsxs(_Fragment, { children: [_jsx("div", { style: { display: "contents" }, [DRILL_MENU_HOST_ATTRIBUTE]: "true", children: children }), _jsx(_Fragment, { children: drillState ? (_jsx("div", { className: "gd-gen-ai-chat__conversation__visualization__drill_overlay" })) : null })] })) }));
|
|
237
247
|
}
|
|
238
248
|
function calculateOffset(container, drillEvent) {
|
|
239
249
|
const offest = getRelativeOffset(drillEvent?.target, container);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../src/components/utils/animation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../src/components/utils/animation.tsx"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,IAAU,EAAE,KAAiB,EAAE;;;CAAA,2CAMjE;AAED,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,2CAoCrE"}
|
|
@@ -1,63 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
|
-
import { useEffect,
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
+
import { UiAiThinkingIcon } from "@gooddata/sdk-ui-kit";
|
|
6
|
+
/**
|
|
7
|
+
* The shared "AI thinking" sparkle, centred in a box of the given size with the star at 60 % of it.
|
|
8
|
+
*/
|
|
5
9
|
export function AIThinkingLoader({ size = 200, color = "#14B2E2" }) {
|
|
6
|
-
|
|
7
|
-
const llRef = useRef(null);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
let running = true;
|
|
10
|
-
let timer = -1;
|
|
11
|
-
let sparkIndex = 0;
|
|
12
|
-
const rand = (min, max) => min + Math.random() * (max - min);
|
|
13
|
-
const blink = (el) => {
|
|
14
|
-
if (!el) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const rot = rand(-10, 10);
|
|
18
|
-
el.animate([
|
|
19
|
-
{
|
|
20
|
-
transform: "translate(-50%, -50%) scale(1) rotate(0deg)",
|
|
21
|
-
easing: "cubic-bezier(0.4, 0, 0.7, 1)",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
transform: `translate(-50%, -50%) scale(0) rotate(${rot}deg)`,
|
|
25
|
-
offset: 0.5,
|
|
26
|
-
easing: "cubic-bezier(0.2, 0.8, 0.2, 1)",
|
|
27
|
-
},
|
|
28
|
-
{ transform: "translate(-50%, -50%) scale(1) rotate(0deg)" },
|
|
29
|
-
], { duration: rand(260, 440) });
|
|
30
|
-
};
|
|
31
|
-
const loop = () => {
|
|
32
|
-
if (!running) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (Math.random() < 0.8) {
|
|
36
|
-
sparkIndex = 1 - sparkIndex;
|
|
37
|
-
}
|
|
38
|
-
blink(sparkIndex === 0 ? urRef.current : llRef.current);
|
|
39
|
-
timer = window.setTimeout(loop, rand(280, 1100));
|
|
40
|
-
};
|
|
41
|
-
loop();
|
|
42
|
-
return () => {
|
|
43
|
-
running = false;
|
|
44
|
-
clearTimeout(timer);
|
|
45
|
-
};
|
|
46
|
-
}, []);
|
|
47
|
-
const s = size / 200;
|
|
48
|
-
return (_jsxs("div", { className: "gd-gen-ai-chat__animations--loader", style: { width: size, height: size, perspective: 700 * s }, children: [_jsx("div", { className: "gd-gen-ai-chat__animations--loader--inner", style: {
|
|
49
|
-
width: 120 * s,
|
|
50
|
-
height: 120 * s,
|
|
51
|
-
}, children: _jsx("div", { className: "gd-gen-ai-chat__animations--loader--flip", style: {
|
|
52
|
-
width: 120 * s,
|
|
53
|
-
height: 120 * s,
|
|
54
|
-
}, children: _jsx("svg", { width: 120 * s, height: 120 * s, viewBox: "0 0 24 24", fill: "none", className: "gd-gen-ai-chat__animations--loader--svg", children: _jsx("path", { d: "M11.4 20.9999C11.4 18.8549 10.8654 17.286 10.0945 16.1296C9.32103 14.9694 8.28542 14.1885 7.2316 13.6616C6.17551 13.1336 5.1122 12.8664 4.30777 12.7323C3.9073 12.6656 3.57461 12.6328 3.34449 12.6163C3.22952 12.6081 3.13966 12.6042 3.08082 12.6022C3.0517 12.6013 3.03005 12.6001 3.01636 12.5999H2.99996C2.66858 12.5999 2.39996 12.3313 2.39996 11.9999C2.39996 11.6685 2.66859 11.3999 2.99996 11.3999H3.01636C3.03005 11.3997 3.0517 11.3985 3.08082 11.3976C3.13966 11.3956 3.22952 11.3917 3.34449 11.3835C3.57461 11.367 3.9073 11.3342 4.30777 11.2675C5.1122 11.1334 6.17551 10.8662 7.2316 10.3382C8.28541 9.81127 9.32103 9.0304 10.0945 7.87021C10.8654 6.71379 11.4 5.14491 11.4 2.9999C11.4 2.66853 11.6686 2.3999 12 2.3999C12.3313 2.39991 12.6 2.66853 12.6 2.9999C12.6 5.14491 13.1345 6.71379 13.9054 7.87021C14.6789 9.0304 15.7145 9.81127 16.7683 10.3382C17.8244 10.8662 18.8877 11.1334 19.6921 11.2675C20.0926 11.3342 20.4253 11.367 20.6554 11.3835C20.7704 11.3917 20.8603 11.3956 20.9191 11.3976C20.9482 11.3985 20.9699 11.3997 20.9835 11.3999H21L21.1207 11.4116C21.3942 11.4675 21.5999 11.7099 21.6 11.9999C21.6 12.29 21.3942 12.5323 21.1207 12.5882L21 12.5999H20.9835C20.9699 12.6001 20.9482 12.6013 20.9191 12.6022C20.8603 12.6042 20.7704 12.6081 20.6554 12.6163C20.4253 12.6328 20.0926 12.6656 19.6921 12.7323C18.8877 12.8664 17.8244 13.1336 16.7683 13.6616C15.7145 14.1885 14.6789 14.9694 13.9054 16.1296C13.1826 17.2138 12.6673 18.6607 12.6058 20.605L12.6 20.9999L12.5882 21.1206C12.5324 21.3942 12.29 21.5999 12 21.5999C11.6686 21.5999 11.4 21.3313 11.4 20.9999Z", fill: color }) }) }) }), _jsx("svg", { ref: urRef, width: 30 * s, height: 30 * s, viewBox: "16.5 2.1 5.3 5.3", fill: "none", className: "gd-gen-ai-chat__animations--loader--sparkle", style: {
|
|
55
|
-
left: 135.85 * s,
|
|
56
|
-
top: 64 * s,
|
|
57
|
-
}, children: _jsx("path", { d: "M18.9645 2.59958C19.0084 2.33334 19.3912 2.33334 19.4351 2.59958C19.6011 3.60808 20.3916 4.39853 21.4002 4.56465C21.6663 4.60849 21.6663 4.9913 21.4002 5.03516C20.3916 5.20128 19.6011 5.99171 19.4351 7.00022C19.3912 7.26646 19.0084 7.26646 18.9645 7.00022C18.7984 5.99171 18.0079 5.20128 16.9994 5.03516C16.7333 4.9913 16.7333 4.60849 16.9994 4.56465C18.0079 4.39853 18.7984 3.60808 18.9645 2.59958Z", fill: color }) }), _jsx("svg", { ref: llRef, width: 30 * s, height: 30 * s, viewBox: "2.1 16.5 5.3 5.3", fill: "none", className: "gd-gen-ai-chat__animations--loader--sparkle", style: {
|
|
58
|
-
left: 64 * s,
|
|
59
|
-
top: 135.85 * s,
|
|
60
|
-
}, children: _jsx("path", { d: "M4.56465 16.9994C4.60849 16.7333 4.9913 16.7333 5.03516 16.9994C5.20128 18.0079 5.99171 18.7984 7.00022 18.9645C7.26646 19.0083 7.26646 19.3912 7.00022 19.4351C5.99171 19.6011 5.20128 20.3916 5.03516 21.4002C4.9913 21.6663 4.60849 21.6663 4.56465 21.4002C4.39853 20.3916 3.60808 19.6011 2.59958 19.4351C2.33334 19.3912 2.33334 19.0083 2.59958 18.9645C3.60808 18.7984 4.39853 18.0079 4.56465 16.9994Z", fill: color }) })] }));
|
|
10
|
+
return (_jsx("div", { className: "gd-gen-ai-chat__animations--loader", style: { width: size, height: size }, children: _jsx(UiAiThinkingIcon, { size: size * 0.6, color: color }) }));
|
|
61
11
|
}
|
|
62
12
|
export function AIThinkingSummary({ headings }) {
|
|
63
13
|
const [currentHeading, setCurrentHeading] = useState(headings[headings.length - 1]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
|
-
const MARKDOWN_ESCAPE_PATTERN = /(\{[^{}]*\})|[\\`*_{}[\]()
|
|
3
|
-
const MARKDOWN_UNESCAPE_PATTERN = /\\([\\`*_{}[\]()
|
|
2
|
+
const MARKDOWN_ESCAPE_PATTERN = /(\{[^{}]*\})|[\\`*_{}[\]()#+\-.!:]/g;
|
|
3
|
+
const MARKDOWN_UNESCAPE_PATTERN = /\\([\\`*_{}[\]()#+\-.!:])/g;
|
|
4
4
|
export function escapeMarkdown(text) {
|
|
5
5
|
return text.replace(MARKDOWN_ESCAPE_PATTERN, (match, inBraces) => inBraces || `\\${match}`);
|
|
6
6
|
}
|
|
@@ -54,6 +54,7 @@ export declare class CopilotHandler<TBuild extends string = CopilotBuildType> {
|
|
|
54
54
|
hasDefinition: (target: ICopilotTarget<TBuild>) => boolean;
|
|
55
55
|
/** Permanently stop processing and release all listeners. Idempotent. */
|
|
56
56
|
dispose: () => void;
|
|
57
|
+
private hasPendingClarification;
|
|
57
58
|
private shouldApplyDefinition;
|
|
58
59
|
private update;
|
|
59
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotHandler.d.ts","sourceRoot":"","sources":["../../src/copilot/CopilotHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAStF,OAAO,EACH,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACtB,MAAM,YAAY,CAAC;AAUpB;;;;;;;;;GASG;AACH,qBAAa,cAAc,CAAC,MAAM,SAAS,MAAM,GAAG,gBAAgB;IAChE,OAAO,CAAC,KAAK,CAAkE;IAC/E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;IAC9D,OAAO,CAAC,QAAQ,CAAS;IAEzB,8EAA8E;IAC9E,YAAmB,aAAa,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAQ9D;IAED,+DAA+D;IACxD,WAAW,UAAW,SAAS,KAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"CopilotHandler.d.ts","sourceRoot":"","sources":["../../src/copilot/CopilotHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAStF,OAAO,EACH,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACtB,MAAM,YAAY,CAAC;AAUpB;;;;;;;;;GASG;AACH,qBAAa,cAAc,CAAC,MAAM,SAAS,MAAM,GAAG,gBAAgB;IAChE,OAAO,CAAC,KAAK,CAAkE;IAC/E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;IAC9D,OAAO,CAAC,QAAQ,CAAS;IAEzB,8EAA8E;IAC9E,YAAmB,aAAa,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAQ9D;IAED,+DAA+D;IACxD,WAAW,UAAW,SAAS,KAAG,IAAI,CAqD3C;IAEF,qEAAqE;IAC9D,UAAU,YAAa,eAAe,CAAC,MAAM,CAAC,KAAG,IAAI,CAE1D;IAEF,kEAAkE;IAC3D,eAAe,SAAU,MAAM,KAAG,IAAI,CAE3C;IAEF,8DAA8D;IACvD,gBAAgB,SAAU,MAAM,KAAG,IAAI,CAE5C;IAEF,4FAA4F;IACrF,gBAAgB,QAAO,IAAI,CAEhC;IAEF,mFAAmF;IAC5E,WAAW,WAAY,cAAc,CAAC,MAAM,CAAC,KAAG,IAAI,CAEzD;IAEF;;;OAGG;IACI,4BAA4B,WAAY,yBAAyB,CAAC,MAAM,CAAC,KAAG,MAAM,CAOvF;IAEF,kGAAkG;IAC3F,iBAAiB,kBAAmB,MAAM,UAAU,cAAc,CAAC,MAAM,CAAC,KAAG,IAAI,CAEtF;IAEF,sFAAsF;IAC/E,gCAAgC,kBAAmB,MAAM,KAAG,IAAI,CAErE;IAEF,oDAAoD;IAC7C,WAAW,QAAO,gBAAgB,CAAC,MAAM,CAAC,CAAe;IAEhE,sFAAsF;IAC/E,SAAS,aAAc,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAQrD;IAEF,+EAA+E;IACxE,SAAS,UAAW,aAAa,CAAC,MAAM,CAAC,KAAG,aAAa,CACrB;IAE3C,8EAA8E;IACvE,mBAAmB,SAAU,MAAM,KAAG,OAAO,CAAqD;IAEzG,6CAA6C;IACtC,iBAAiB,QAAO,MAAM,GAAG,SAAS,CAA4C;IAE7F,iFAAiF;IAC1E,gBAAgB,WAAY,cAAc,CAAC,MAAM,CAAC,KAAG,cAAc,GAAG,SAAS,CAC1C;IAE5C,4GAA4G;IACrG,aAAa,WAAY,cAAc,CAAC,MAAM,CAAC,KAAG,OAAO,CAG1D;IAEN,yEAAyE;IAClE,OAAO,QAAO,IAAI,CAGvB;IAEF,OAAO,CAAC,uBAAuB;IAoB/B,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,MAAM;CAgBjB"}
|
|
@@ -72,8 +72,8 @@ export class CopilotHandler {
|
|
|
72
72
|
event.type === "chatClarificationQuestions" &&
|
|
73
73
|
event.responses === undefined &&
|
|
74
74
|
event.questions.length > 0 &&
|
|
75
|
-
!
|
|
76
|
-
|
|
75
|
+
!this.hasPendingClarification(previous, event.interactionId) &&
|
|
76
|
+
this.hasPendingClarification(this.state, event.interactionId) &&
|
|
77
77
|
this.configuration.registrations.some(({ type }) => this.getStatus({
|
|
78
78
|
type,
|
|
79
79
|
objectId: this.state.context.objectId,
|
|
@@ -150,6 +150,16 @@ export class CopilotHandler {
|
|
|
150
150
|
this.disposed = true;
|
|
151
151
|
this.listeners.clear();
|
|
152
152
|
};
|
|
153
|
+
hasPendingClarification(snapshot, interactionId) {
|
|
154
|
+
return this.configuration.registrations.some(({ type }) => snapshot.requests.some((request) => !request.superseded &&
|
|
155
|
+
(request.type ?? request.generation) === type &&
|
|
156
|
+
request.pendingClarificationIds?.includes(interactionId)) ||
|
|
157
|
+
((snapshot.interaction.build?.type === type ||
|
|
158
|
+
(snapshot.generation === type &&
|
|
159
|
+
!snapshot.requests.some((request) => request.generation === type &&
|
|
160
|
+
request.revision > (snapshot.generationRevision ?? 0)))) &&
|
|
161
|
+
snapshot.interaction.pendingClarificationIds.includes(interactionId)));
|
|
162
|
+
}
|
|
153
163
|
shouldApplyDefinition(event, target) {
|
|
154
164
|
const { context } = this.state;
|
|
155
165
|
const builderTarget = context.builderTarget?.type === target.type ? context.builderTarget : undefined;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type IDashboardProps } from "@gooddata/sdk-ui-dashboard";
|
|
2
|
+
import { type GenAIAssistantProps } from "../components/GenAIChat.js";
|
|
3
|
+
import { type GenAiStoreProps } from "../components/GenAiStore.js";
|
|
4
|
+
import { CopilotHandler } from "./CopilotHandler.js";
|
|
5
|
+
import { type ICopilotInteractionComposingWithHandlerProps } from "./CopilotInteractionComposingWithHandler.js";
|
|
6
|
+
/** Props and actions connecting one dashboard to a shared assistant store. @alpha */
|
|
7
|
+
export interface IUseDashboardCopilotResult {
|
|
8
|
+
/** Hook-owned workflow handler, also usable by custom progress presentations. */
|
|
9
|
+
copilot: CopilotHandler;
|
|
10
|
+
/**
|
|
11
|
+
* Get props for the outer GenAiStore, not the nested assistant. Appends application event handlers
|
|
12
|
+
* after internal handlers and calls the internal onDispatcher before the application callback.
|
|
13
|
+
* Other props pass through unchanged. Call without arguments for the default connection.
|
|
14
|
+
*/
|
|
15
|
+
genAiStoreProps: (props?: Omit<GenAiStoreProps, "children">) => Omit<GenAiStoreProps, "children">;
|
|
16
|
+
/**
|
|
17
|
+
* Get props for Dashboard. Appends application event handlers after internal handlers and calls
|
|
18
|
+
* the internal onStateChange before the application callback. Merges config while keeping aiMode
|
|
19
|
+
* controlled by the copilot; other props pass through unchanged. Call without arguments for defaults.
|
|
20
|
+
*/
|
|
21
|
+
dashboardProps: (props?: IDashboardProps) => IDashboardProps;
|
|
22
|
+
/**
|
|
23
|
+
* Get props for the assistant inside the shared GenAiStore. Keeps dashboardSelector controlled by
|
|
24
|
+
* the hook to maintain ambient context; other props pass through unchanged. Attach chat event
|
|
25
|
+
* handlers to the outer store using genAiStoreProps. Call without arguments for defaults.
|
|
26
|
+
*/
|
|
27
|
+
assistantProps: (props?: GenAIAssistantProps) => GenAIAssistantProps;
|
|
28
|
+
/** Pass to CopilotInteractionComposingWithHandler around the dashboard. */
|
|
29
|
+
composingProps: Omit<ICopilotInteractionComposingWithHandlerProps, "children">;
|
|
30
|
+
/** Send a message in the current conversation. Ignored until the shared store is ready. */
|
|
31
|
+
sendMessage: (message: string) => void;
|
|
32
|
+
/** Start a new conversation and generate into a new, empty dashboard in edit mode. */
|
|
33
|
+
generateDashboard: (message: string) => void;
|
|
34
|
+
/** Clear creation intent; this does not cancel an assistant response already streaming. */
|
|
35
|
+
cancelGeneration: () => void;
|
|
36
|
+
/** Select the waiting workflow's originating conversation in the shared assistant. */
|
|
37
|
+
replyInChat: () => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Connect a dashboard and assistant using one CopilotHandler and one outer GenAiStore.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Call once per dashboard/assistant pair. Call `dashboardProps`, `genAiStoreProps`, and `assistantProps` with optional
|
|
44
|
+
* application props, then spread their results onto the respective components. These getters compose
|
|
45
|
+
* event handlers and connection callbacks so application customizations do not replace internal wiring.
|
|
46
|
+
* Spread `composingProps` directly;
|
|
47
|
+
* keep the assistant beside the dashboard and wrap only the dashboard in the composing presentation.
|
|
48
|
+
* Definitions are applied only to an initialized dashboard in edit mode. To generate a new dashboard,
|
|
49
|
+
* mount an empty Dashboard in edit mode before calling `generateDashboard`; this hook does not navigate
|
|
50
|
+
* or replace an existing saved dashboard. Remount the pair when changing backend or workspace.
|
|
51
|
+
*
|
|
52
|
+
* @returns Component props and actions for the connected dashboard and assistant.
|
|
53
|
+
* @alpha
|
|
54
|
+
*/
|
|
55
|
+
export declare function useDashboardCopilot(): IUseDashboardCopilotResult;
|
|
56
|
+
//# sourceMappingURL=useDashboardCopilot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDashboardCopilot.d.ts","sourceRoot":"","sources":["../../src/copilot/useDashboardCopilot.ts"],"names":[],"mappings":"AAMA,OAAO,EAGH,KAAK,eAAe,EAWvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAUnE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,KAAK,4CAA4C,EAAE,MAAM,6CAA6C,CAAC;AAKhH,qFAAqF;AACrF,MAAM,WAAW,0BAA0B;IACvC,iFAAiF;IACjF,OAAO,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,eAAe,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IAClG;;;;OAIG;IACH,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,eAAe,KAAK,eAAe,CAAC;IAC7D;;;;OAIG;IACH,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,mBAAmB,KAAK,mBAAmB,CAAC;IACrE,2EAA2E;IAC3E,cAAc,EAAE,IAAI,CAAC,4CAA4C,EAAE,UAAU,CAAC,CAAC;IAC/E,2FAA2F;IAC3F,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,sFAAsF;IACtF,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,2FAA2F;IAC3F,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,sFAAsF;IACtF,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,IAAI,0BAA0B,CAsEhE"}
|