dp-widgets-framework 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +5 -7
- package/dist/index.js +5 -7
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -36075,15 +36075,13 @@ const createInitialChartState = (agentType, widgetIds, datasetId) => {
|
|
|
36075
36075
|
const baseState = { dataset_id: datasetId || "home_generation_dataset" };
|
|
36076
36076
|
switch (agentType) {
|
|
36077
36077
|
case "Pie Chart Agent":
|
|
36078
|
-
return {
|
|
36079
|
-
pie_chart_data: {
|
|
36078
|
+
return Object.assign({ pie_chart_data: {
|
|
36080
36079
|
title: "",
|
|
36081
36080
|
type: "pie",
|
|
36082
36081
|
chart_type: "financial",
|
|
36083
36082
|
data: { labels: [], values: [], percentages: [], total: 0 },
|
|
36084
36083
|
metadata: { categories: 0, largest_category: "", largest_value: 0, largest_percentage: 0 }
|
|
36085
|
-
}
|
|
36086
|
-
};
|
|
36084
|
+
} }, baseState);
|
|
36087
36085
|
case "Line Chart Agent":
|
|
36088
36086
|
case "Bar Chart Agent":
|
|
36089
36087
|
return Object.assign({ bar_chart_data: {
|
|
@@ -36124,7 +36122,7 @@ const createInitialChartState = (agentType, widgetIds, datasetId) => {
|
|
|
36124
36122
|
metadata: { created_at: "", content_type: "text", is_multiline: false }
|
|
36125
36123
|
} }, baseState);
|
|
36126
36124
|
default:
|
|
36127
|
-
return { widget_ids: widgetIds };
|
|
36125
|
+
return Object.assign({ widget_ids: widgetIds }, baseState);
|
|
36128
36126
|
}
|
|
36129
36127
|
};
|
|
36130
36128
|
const loadAgentState = async (widgetBackendUrl, threadId, agentName) => {
|
|
@@ -36682,7 +36680,7 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36682
36680
|
// Listen for triggerAgent events for this widget
|
|
36683
36681
|
useEffect(() => {
|
|
36684
36682
|
const handleTriggerAgent = (event) => {
|
|
36685
|
-
const { widgetId, query, agentType: eventAgentType,
|
|
36683
|
+
const { widgetId, query, agentType: eventAgentType, datasetId } = event.detail;
|
|
36686
36684
|
console.log('event.detail==>', event.detail);
|
|
36687
36685
|
if (widgetId === widget.id) {
|
|
36688
36686
|
let messageContent = query;
|
|
@@ -37095,7 +37093,7 @@ function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSel
|
|
|
37095
37093
|
widgetId: editingWidget.id,
|
|
37096
37094
|
query: newQuery,
|
|
37097
37095
|
agentType: (_a = editingWidget.config) === null || _a === void 0 ? void 0 : _a.agentType,
|
|
37098
|
-
|
|
37096
|
+
datasetId: datasetId
|
|
37099
37097
|
}
|
|
37100
37098
|
});
|
|
37101
37099
|
window.dispatchEvent(event);
|
package/dist/index.js
CHANGED
|
@@ -36102,15 +36102,13 @@ const createInitialChartState = (agentType, widgetIds, datasetId) => {
|
|
|
36102
36102
|
const baseState = { dataset_id: datasetId || "home_generation_dataset" };
|
|
36103
36103
|
switch (agentType) {
|
|
36104
36104
|
case "Pie Chart Agent":
|
|
36105
|
-
return {
|
|
36106
|
-
pie_chart_data: {
|
|
36105
|
+
return Object.assign({ pie_chart_data: {
|
|
36107
36106
|
title: "",
|
|
36108
36107
|
type: "pie",
|
|
36109
36108
|
chart_type: "financial",
|
|
36110
36109
|
data: { labels: [], values: [], percentages: [], total: 0 },
|
|
36111
36110
|
metadata: { categories: 0, largest_category: "", largest_value: 0, largest_percentage: 0 }
|
|
36112
|
-
}
|
|
36113
|
-
};
|
|
36111
|
+
} }, baseState);
|
|
36114
36112
|
case "Line Chart Agent":
|
|
36115
36113
|
case "Bar Chart Agent":
|
|
36116
36114
|
return Object.assign({ bar_chart_data: {
|
|
@@ -36151,7 +36149,7 @@ const createInitialChartState = (agentType, widgetIds, datasetId) => {
|
|
|
36151
36149
|
metadata: { created_at: "", content_type: "text", is_multiline: false }
|
|
36152
36150
|
} }, baseState);
|
|
36153
36151
|
default:
|
|
36154
|
-
return { widget_ids: widgetIds };
|
|
36152
|
+
return Object.assign({ widget_ids: widgetIds }, baseState);
|
|
36155
36153
|
}
|
|
36156
36154
|
};
|
|
36157
36155
|
const loadAgentState = async (widgetBackendUrl, threadId, agentName) => {
|
|
@@ -36709,7 +36707,7 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36709
36707
|
// Listen for triggerAgent events for this widget
|
|
36710
36708
|
React.useEffect(() => {
|
|
36711
36709
|
const handleTriggerAgent = (event) => {
|
|
36712
|
-
const { widgetId, query, agentType: eventAgentType,
|
|
36710
|
+
const { widgetId, query, agentType: eventAgentType, datasetId } = event.detail;
|
|
36713
36711
|
console.log('event.detail==>', event.detail);
|
|
36714
36712
|
if (widgetId === widget.id) {
|
|
36715
36713
|
let messageContent = query;
|
|
@@ -37122,7 +37120,7 @@ function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSel
|
|
|
37122
37120
|
widgetId: editingWidget.id,
|
|
37123
37121
|
query: newQuery,
|
|
37124
37122
|
agentType: (_a = editingWidget.config) === null || _a === void 0 ? void 0 : _a.agentType,
|
|
37125
|
-
|
|
37123
|
+
datasetId: datasetId
|
|
37126
37124
|
}
|
|
37127
37125
|
});
|
|
37128
37126
|
window.dispatchEvent(event);
|