dp-widgets-framework 1.0.4 → 1.0.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 +39 -69
- package/dist/index.js +39 -69
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -15083,7 +15083,14 @@ function BarChart({ orientation, title, data, options, className }) {
|
|
|
15083
15083
|
},
|
|
15084
15084
|
scales: {
|
|
15085
15085
|
x: {
|
|
15086
|
-
ticks: {
|
|
15086
|
+
ticks: {
|
|
15087
|
+
autoSkip: false,
|
|
15088
|
+
maxRotation: 45,
|
|
15089
|
+
minRotation: 45,
|
|
15090
|
+
font: {
|
|
15091
|
+
size: 10
|
|
15092
|
+
}
|
|
15093
|
+
},
|
|
15087
15094
|
},
|
|
15088
15095
|
y: { beginAtZero: true },
|
|
15089
15096
|
},
|
|
@@ -36617,7 +36624,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36617
36624
|
lowest_value: 0,
|
|
36618
36625
|
range: 0
|
|
36619
36626
|
}
|
|
36620
|
-
}
|
|
36627
|
+
},
|
|
36628
|
+
dataset_id: "home_generation_dataset"
|
|
36621
36629
|
};
|
|
36622
36630
|
}
|
|
36623
36631
|
else if (agentType === "Data Grid Agent") {
|
|
@@ -36636,7 +36644,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36636
36644
|
total_columns: 0,
|
|
36637
36645
|
numeric_columns: []
|
|
36638
36646
|
}
|
|
36639
|
-
}
|
|
36647
|
+
},
|
|
36648
|
+
dataset_id: "home_generation_dataset"
|
|
36640
36649
|
};
|
|
36641
36650
|
}
|
|
36642
36651
|
else if (agentType === "Bar Chart Agent") {
|
|
@@ -36660,7 +36669,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36660
36669
|
lowest_value: 0,
|
|
36661
36670
|
range: 0
|
|
36662
36671
|
}
|
|
36663
|
-
}
|
|
36672
|
+
},
|
|
36673
|
+
dataset_id: "home_generation_dataset"
|
|
36664
36674
|
};
|
|
36665
36675
|
}
|
|
36666
36676
|
else if (agentType === "Series Bar Chart Agent") {
|
|
@@ -36689,7 +36699,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36689
36699
|
series_totals: {},
|
|
36690
36700
|
series_averages: {}
|
|
36691
36701
|
}
|
|
36692
|
-
}
|
|
36702
|
+
},
|
|
36703
|
+
dataset_id: "home_generation_dataset"
|
|
36693
36704
|
};
|
|
36694
36705
|
}
|
|
36695
36706
|
else if (agentType === "Series Line Chart Agent") {
|
|
@@ -36716,9 +36727,10 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36716
36727
|
lowest_series: "",
|
|
36717
36728
|
range: 0,
|
|
36718
36729
|
series_totals: {},
|
|
36719
|
-
series_averages: {}
|
|
36730
|
+
series_averages: {},
|
|
36720
36731
|
}
|
|
36721
|
-
}
|
|
36732
|
+
},
|
|
36733
|
+
dataset_id: "home_generation_dataset"
|
|
36722
36734
|
};
|
|
36723
36735
|
}
|
|
36724
36736
|
else if (agentType === "Summary Agent") {
|
|
@@ -36738,7 +36750,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36738
36750
|
content_type: "text",
|
|
36739
36751
|
is_multiline: false
|
|
36740
36752
|
}
|
|
36741
|
-
}
|
|
36753
|
+
},
|
|
36754
|
+
dataset_id: "home_generation_dataset"
|
|
36742
36755
|
};
|
|
36743
36756
|
}
|
|
36744
36757
|
else {
|
|
@@ -37376,7 +37389,7 @@ const IconMap = {
|
|
|
37376
37389
|
'pie-chart': PieChart$1,
|
|
37377
37390
|
'chatbot': Bot,
|
|
37378
37391
|
};
|
|
37379
|
-
function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSelect, refreshKey, widgetBackendUrl, onSaveLayoutReady, openWidgetPallete = false, onCloseWidgetPallete, defaultAgentName = "adk-construction-project-agent" }) {
|
|
37392
|
+
function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSelect, refreshKey, widgetBackendUrl, onSaveLayoutReady, openWidgetPallete = false, onCloseWidgetPallete, defaultAgentName = "adk-construction-project-agent", userId }) {
|
|
37380
37393
|
const [widgets, setWidgets] = useState([]);
|
|
37381
37394
|
const [availableWidgets, setAvailableWidgets] = useState([]);
|
|
37382
37395
|
const [isLoading, setIsLoading] = useState(true);
|
|
@@ -37497,7 +37510,13 @@ function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSel
|
|
|
37497
37510
|
}
|
|
37498
37511
|
setIsLoading(true);
|
|
37499
37512
|
try {
|
|
37500
|
-
const response = await fetch(getApiUrl(`/api/pages/${pageId}`)
|
|
37513
|
+
const response = await fetch(getApiUrl(`/api/pages/${pageId}`), {
|
|
37514
|
+
method: "GET",
|
|
37515
|
+
headers: {
|
|
37516
|
+
"Content-Type": "application/json",
|
|
37517
|
+
"x-owner-id": userId || "",
|
|
37518
|
+
},
|
|
37519
|
+
});
|
|
37501
37520
|
if (!response.ok) {
|
|
37502
37521
|
throw new Error("Failed to load page data");
|
|
37503
37522
|
}
|
|
@@ -37562,9 +37581,15 @@ function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSel
|
|
|
37562
37581
|
throw new Error("Failed to save layout");
|
|
37563
37582
|
}
|
|
37564
37583
|
const savedData = await response.json();
|
|
37565
|
-
setPageData(savedData);
|
|
37566
|
-
// Update local widgets state to clear isFirstLoad flag
|
|
37567
|
-
setWidgets(prevWidgets => prevWidgets.map(widget => (
|
|
37584
|
+
// setPageData(savedData);
|
|
37585
|
+
// // Update local widgets state to clear isFirstLoad flag
|
|
37586
|
+
// setWidgets(prevWidgets => prevWidgets.map(widget => ({
|
|
37587
|
+
// ...widget,
|
|
37588
|
+
// config: {
|
|
37589
|
+
// ...widget.config,
|
|
37590
|
+
// isFirstLoad: false
|
|
37591
|
+
// }
|
|
37592
|
+
// })));
|
|
37568
37593
|
console.log('Layout saved successfully');
|
|
37569
37594
|
}
|
|
37570
37595
|
catch (err) {
|
|
@@ -37833,62 +37858,7 @@ function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSel
|
|
|
37833
37858
|
onCloseWidgetPallete === null || onCloseWidgetPallete === void 0 ? void 0 : onCloseWidgetPallete();
|
|
37834
37859
|
}, defaultAgentName: defaultAgentName }), jsxRuntimeExports.jsx(EditWidgetDialog, { initialText: editInitialQuery, isOpen: showEditModal, onClose: () => setShowEditModal(false), onSubmit: handleEditSubmit }), jsxRuntimeExports.jsx("div", { className: "min-h-full", onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, onClick: () => setSelectedWidget(null), children: isLoading ? (jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center h-full", children: jsxRuntimeExports.jsx(Loader2, { className: "h-8 w-8 animate-spin" }) })) : (jsxRuntimeExports.jsx(RGL, { className: "layout m-0 p-0", layouts: { lg: getLayoutFromWidgets() }, breakpoints: { lg: 1200, md: 996, sm: 768, xs: 480 }, cols: { lg: 12, md: 8, sm: 6, xs: 2 }, rowHeight: 100, isDraggable: isEditing, isResizable: isEditing, draggableHandle: ".drag-icon", onLayoutChange: handleLayoutChange, compactType: "vertical", containerPadding: [0, 0], resizeHandles: ["sw", "nw", "se", "ne"], children: widgets.map((w) => (jsxRuntimeExports.jsxs("div", { style: { borderColor: "rgb(147 197 253 / 1)" }, className: `border border-blue-300 rounded-xl p-4 shadow-lg overflow-hidden ${isEditing ? 'pb-20' : 'pb-14'}`, children: [isEditing &&
|
|
37835
37860
|
jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end mb-4 relative", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center drag-icon cursor-grab absolute left-1/2 -translate-x-1/2", children: [jsxRuntimeExports.jsx(GripHorizontal, { className: "" }), jsxRuntimeExports.jsx(GripHorizontal, { className: "-ml-[3px]" }), jsxRuntimeExports.jsx(GripHorizontal, { className: "-ml-[3px]" })] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 cursor-pointer justify-end", children: [jsxRuntimeExports.jsx(Trash2, { onClick: () => removeWidget(w.id), className: "w-5 h-5 text-red-700" }), jsxRuntimeExports.jsx(Edit, { onClick: () => onClickSettings && onClickSettings(w), className: "w-5 h-5 text-gray-600" })] })] }), jsxRuntimeExports.jsxs("div", { className: "w-full h-full relative", children: [(w === null || w === void 0 ? void 0 : w.type) === "chatbot" &&
|
|
37836
|
-
jsxRuntimeExports.jsxs("div", { className: "relative z-50", children: [jsxRuntimeExports.jsx("div", { onClick: () => handleClearChat(w.id), onMouseOver: () => setVisibleClearButton(true), onMouseLeave: () => setVisibleClearButton(false), className: "absolute z-40 flex align-middle justify-center gap-2 text-sm px-4 py-2 border-blue-300 rounded-sm dark:bg-white w-fit bg-gray-900 text-white dark:text-gray-900 cursor-pointer shadow-md transition-all", style: { top: "12px", right: "0", borderTopLeftRadius: "4px", borderBottomLeftRadius: "4px" }, children: jsxRuntimeExports.jsx(MessageCircleX, { className: "w-5 h-5" }) }), jsxRuntimeExports.jsx("span", { className: `absolute z-50 w-max py-1 text-xs px-2 rounded-sm dark:text-gray-900 dark:bg-white text-white bg-gray-900 ${visibleClearButton ? "block" : "hidden"}`, style: { top: "56px", right: "16px", borderRadius: "3px" }, children: "Clear Chat" })] }), jsxRuntimeExports.jsx(WidgetRenderer, { widget: w, widgetBackendUrl: widgetBackendUrl, onResetReady: handleResetReady, widgetIds: widgets.filter(widget => widget.type !== 'chatbot').map(widget => widget.id) })] })] }, w.id))) })
|
|
37837
|
-
// <ReactGridLayout
|
|
37838
|
-
// className="layout"
|
|
37839
|
-
// layout={getLayoutFromWidgets()}
|
|
37840
|
-
// cols={12}
|
|
37841
|
-
// rowHeight={50}
|
|
37842
|
-
// onLayoutChange={handleLayoutChange}
|
|
37843
|
-
// onDragStart={() => setIsDragging(true)}
|
|
37844
|
-
// onDragStop={() => setIsDragging(false)}
|
|
37845
|
-
// isDraggable={isEditing}
|
|
37846
|
-
// isResizable={isEditing}
|
|
37847
|
-
// useCSSTransforms
|
|
37848
|
-
// compactType={null}
|
|
37849
|
-
// margin={[8, 8]}
|
|
37850
|
-
// preventCollision={true}
|
|
37851
|
-
// >
|
|
37852
|
-
// {widgets.map((widget) => (
|
|
37853
|
-
// <div
|
|
37854
|
-
// key={widget.id}
|
|
37855
|
-
// className={cn(
|
|
37856
|
-
// "bg-background rounded-lg shadow-sm border overflow-hidden transition-all",
|
|
37857
|
-
// currentSelectedWidget?.id === widget.id &&
|
|
37858
|
-
// "ring-2 ring-primary ring-offset-2"
|
|
37859
|
-
// )}
|
|
37860
|
-
// onClick={(e) => handleWidgetClick(widget, e)}
|
|
37861
|
-
// onDoubleClick={(e) => handleWidgetDoubleClick(widget, e)}
|
|
37862
|
-
// >
|
|
37863
|
-
// {widget.config?.showHeader !== false && (
|
|
37864
|
-
// <div className="p-2 border-b flex items-center justify-between">
|
|
37865
|
-
// <span className="font-medium text-sm">
|
|
37866
|
-
// {widget.title}
|
|
37867
|
-
// </span>
|
|
37868
|
-
// {isEditing && (
|
|
37869
|
-
// <Button
|
|
37870
|
-
// variant="ghost"
|
|
37871
|
-
// size="sm"
|
|
37872
|
-
// onClick={() => removeWidget(widget.id)}
|
|
37873
|
-
// >
|
|
37874
|
-
// <Trash2 className="h-4 w-4" />
|
|
37875
|
-
// </Button>
|
|
37876
|
-
// )}
|
|
37877
|
-
// </div>
|
|
37878
|
-
// )}
|
|
37879
|
-
// <div
|
|
37880
|
-
// className={cn(
|
|
37881
|
-
// "h-full",
|
|
37882
|
-
// widget.config?.showHeader !== false &&
|
|
37883
|
-
// "h-[calc(100%-40px)]"
|
|
37884
|
-
// )}
|
|
37885
|
-
// >
|
|
37886
|
-
// <WidgetRenderer widget={widget} widgetBackendUrl={widgetBackendUrl} />
|
|
37887
|
-
// </div>
|
|
37888
|
-
// </div>
|
|
37889
|
-
// ))}
|
|
37890
|
-
// </ReactGridLayout>
|
|
37891
|
-
) })] }));
|
|
37861
|
+
jsxRuntimeExports.jsxs("div", { className: "relative z-50", children: [jsxRuntimeExports.jsx("div", { onClick: () => handleClearChat(w.id), onMouseOver: () => setVisibleClearButton(true), onMouseLeave: () => setVisibleClearButton(false), className: "absolute z-40 flex align-middle justify-center gap-2 text-sm px-4 py-2 border-blue-300 rounded-sm dark:bg-white w-fit bg-gray-900 text-white dark:text-gray-900 cursor-pointer shadow-md transition-all", style: { top: "12px", right: "0", borderTopLeftRadius: "4px", borderBottomLeftRadius: "4px" }, children: jsxRuntimeExports.jsx(MessageCircleX, { className: "w-5 h-5" }) }), jsxRuntimeExports.jsx("span", { className: `absolute z-50 w-max py-1 text-xs px-2 rounded-sm dark:text-gray-900 dark:bg-white text-white bg-gray-900 ${visibleClearButton ? "block" : "hidden"}`, style: { top: "56px", right: "16px", borderRadius: "3px" }, children: "Clear Chat" })] }), jsxRuntimeExports.jsx(WidgetRenderer, { widget: w, widgetBackendUrl: widgetBackendUrl, onResetReady: handleResetReady, widgetIds: widgets.filter(widget => widget.type !== 'chatbot').map(widget => widget.id) })] })] }, w.id))) })) })] }));
|
|
37892
37862
|
}
|
|
37893
37863
|
|
|
37894
37864
|
const Checkbox = React.forwardRef((_a, ref) => {
|
package/dist/index.js
CHANGED
|
@@ -15110,7 +15110,14 @@ function BarChart({ orientation, title, data, options, className }) {
|
|
|
15110
15110
|
},
|
|
15111
15111
|
scales: {
|
|
15112
15112
|
x: {
|
|
15113
|
-
ticks: {
|
|
15113
|
+
ticks: {
|
|
15114
|
+
autoSkip: false,
|
|
15115
|
+
maxRotation: 45,
|
|
15116
|
+
minRotation: 45,
|
|
15117
|
+
font: {
|
|
15118
|
+
size: 10
|
|
15119
|
+
}
|
|
15120
|
+
},
|
|
15114
15121
|
},
|
|
15115
15122
|
y: { beginAtZero: true },
|
|
15116
15123
|
},
|
|
@@ -36644,7 +36651,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36644
36651
|
lowest_value: 0,
|
|
36645
36652
|
range: 0
|
|
36646
36653
|
}
|
|
36647
|
-
}
|
|
36654
|
+
},
|
|
36655
|
+
dataset_id: "home_generation_dataset"
|
|
36648
36656
|
};
|
|
36649
36657
|
}
|
|
36650
36658
|
else if (agentType === "Data Grid Agent") {
|
|
@@ -36663,7 +36671,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36663
36671
|
total_columns: 0,
|
|
36664
36672
|
numeric_columns: []
|
|
36665
36673
|
}
|
|
36666
|
-
}
|
|
36674
|
+
},
|
|
36675
|
+
dataset_id: "home_generation_dataset"
|
|
36667
36676
|
};
|
|
36668
36677
|
}
|
|
36669
36678
|
else if (agentType === "Bar Chart Agent") {
|
|
@@ -36687,7 +36696,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36687
36696
|
lowest_value: 0,
|
|
36688
36697
|
range: 0
|
|
36689
36698
|
}
|
|
36690
|
-
}
|
|
36699
|
+
},
|
|
36700
|
+
dataset_id: "home_generation_dataset"
|
|
36691
36701
|
};
|
|
36692
36702
|
}
|
|
36693
36703
|
else if (agentType === "Series Bar Chart Agent") {
|
|
@@ -36716,7 +36726,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36716
36726
|
series_totals: {},
|
|
36717
36727
|
series_averages: {}
|
|
36718
36728
|
}
|
|
36719
|
-
}
|
|
36729
|
+
},
|
|
36730
|
+
dataset_id: "home_generation_dataset"
|
|
36720
36731
|
};
|
|
36721
36732
|
}
|
|
36722
36733
|
else if (agentType === "Series Line Chart Agent") {
|
|
@@ -36743,9 +36754,10 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36743
36754
|
lowest_series: "",
|
|
36744
36755
|
range: 0,
|
|
36745
36756
|
series_totals: {},
|
|
36746
|
-
series_averages: {}
|
|
36757
|
+
series_averages: {},
|
|
36747
36758
|
}
|
|
36748
|
-
}
|
|
36759
|
+
},
|
|
36760
|
+
dataset_id: "home_generation_dataset"
|
|
36749
36761
|
};
|
|
36750
36762
|
}
|
|
36751
36763
|
else if (agentType === "Summary Agent") {
|
|
@@ -36765,7 +36777,8 @@ function CopilotKitAgent({ widget, showHeader, styles, onResetReady, widgetIds,
|
|
|
36765
36777
|
content_type: "text",
|
|
36766
36778
|
is_multiline: false
|
|
36767
36779
|
}
|
|
36768
|
-
}
|
|
36780
|
+
},
|
|
36781
|
+
dataset_id: "home_generation_dataset"
|
|
36769
36782
|
};
|
|
36770
36783
|
}
|
|
36771
36784
|
else {
|
|
@@ -37403,7 +37416,7 @@ const IconMap = {
|
|
|
37403
37416
|
'pie-chart': lucideReact.PieChart,
|
|
37404
37417
|
'chatbot': lucideReact.Bot,
|
|
37405
37418
|
};
|
|
37406
|
-
function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSelect, refreshKey, widgetBackendUrl, onSaveLayoutReady, openWidgetPallete = false, onCloseWidgetPallete, defaultAgentName = "adk-construction-project-agent" }) {
|
|
37419
|
+
function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSelect, refreshKey, widgetBackendUrl, onSaveLayoutReady, openWidgetPallete = false, onCloseWidgetPallete, defaultAgentName = "adk-construction-project-agent", userId }) {
|
|
37407
37420
|
const [widgets, setWidgets] = React.useState([]);
|
|
37408
37421
|
const [availableWidgets, setAvailableWidgets] = React.useState([]);
|
|
37409
37422
|
const [isLoading, setIsLoading] = React.useState(true);
|
|
@@ -37524,7 +37537,13 @@ function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSel
|
|
|
37524
37537
|
}
|
|
37525
37538
|
setIsLoading(true);
|
|
37526
37539
|
try {
|
|
37527
|
-
const response = await fetch(getApiUrl(`/api/pages/${pageId}`)
|
|
37540
|
+
const response = await fetch(getApiUrl(`/api/pages/${pageId}`), {
|
|
37541
|
+
method: "GET",
|
|
37542
|
+
headers: {
|
|
37543
|
+
"Content-Type": "application/json",
|
|
37544
|
+
"x-owner-id": userId || "",
|
|
37545
|
+
},
|
|
37546
|
+
});
|
|
37528
37547
|
if (!response.ok) {
|
|
37529
37548
|
throw new Error("Failed to load page data");
|
|
37530
37549
|
}
|
|
@@ -37589,9 +37608,15 @@ function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSel
|
|
|
37589
37608
|
throw new Error("Failed to save layout");
|
|
37590
37609
|
}
|
|
37591
37610
|
const savedData = await response.json();
|
|
37592
|
-
setPageData(savedData);
|
|
37593
|
-
// Update local widgets state to clear isFirstLoad flag
|
|
37594
|
-
setWidgets(prevWidgets => prevWidgets.map(widget => (
|
|
37611
|
+
// setPageData(savedData);
|
|
37612
|
+
// // Update local widgets state to clear isFirstLoad flag
|
|
37613
|
+
// setWidgets(prevWidgets => prevWidgets.map(widget => ({
|
|
37614
|
+
// ...widget,
|
|
37615
|
+
// config: {
|
|
37616
|
+
// ...widget.config,
|
|
37617
|
+
// isFirstLoad: false
|
|
37618
|
+
// }
|
|
37619
|
+
// })));
|
|
37595
37620
|
console.log('Layout saved successfully');
|
|
37596
37621
|
}
|
|
37597
37622
|
catch (err) {
|
|
@@ -37860,62 +37885,7 @@ function WidgetDashboard({ pageId, isEditing, selectedWidget = null, onWidgetSel
|
|
|
37860
37885
|
onCloseWidgetPallete === null || onCloseWidgetPallete === void 0 ? void 0 : onCloseWidgetPallete();
|
|
37861
37886
|
}, defaultAgentName: defaultAgentName }), jsxRuntimeExports.jsx(EditWidgetDialog, { initialText: editInitialQuery, isOpen: showEditModal, onClose: () => setShowEditModal(false), onSubmit: handleEditSubmit }), jsxRuntimeExports.jsx("div", { className: "min-h-full", onDragOver: (e) => e.preventDefault(), onDrop: handleDrop, onClick: () => setSelectedWidget(null), children: isLoading ? (jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center h-full", children: jsxRuntimeExports.jsx(lucideReact.Loader2, { className: "h-8 w-8 animate-spin" }) })) : (jsxRuntimeExports.jsx(RGL, { className: "layout m-0 p-0", layouts: { lg: getLayoutFromWidgets() }, breakpoints: { lg: 1200, md: 996, sm: 768, xs: 480 }, cols: { lg: 12, md: 8, sm: 6, xs: 2 }, rowHeight: 100, isDraggable: isEditing, isResizable: isEditing, draggableHandle: ".drag-icon", onLayoutChange: handleLayoutChange, compactType: "vertical", containerPadding: [0, 0], resizeHandles: ["sw", "nw", "se", "ne"], children: widgets.map((w) => (jsxRuntimeExports.jsxs("div", { style: { borderColor: "rgb(147 197 253 / 1)" }, className: `border border-blue-300 rounded-xl p-4 shadow-lg overflow-hidden ${isEditing ? 'pb-20' : 'pb-14'}`, children: [isEditing &&
|
|
37862
37887
|
jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end mb-4 relative", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center drag-icon cursor-grab absolute left-1/2 -translate-x-1/2", children: [jsxRuntimeExports.jsx(lucideReact.GripHorizontal, { className: "" }), jsxRuntimeExports.jsx(lucideReact.GripHorizontal, { className: "-ml-[3px]" }), jsxRuntimeExports.jsx(lucideReact.GripHorizontal, { className: "-ml-[3px]" })] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 cursor-pointer justify-end", children: [jsxRuntimeExports.jsx(lucideReact.Trash2, { onClick: () => removeWidget(w.id), className: "w-5 h-5 text-red-700" }), jsxRuntimeExports.jsx(lucideReact.Edit, { onClick: () => onClickSettings && onClickSettings(w), className: "w-5 h-5 text-gray-600" })] })] }), jsxRuntimeExports.jsxs("div", { className: "w-full h-full relative", children: [(w === null || w === void 0 ? void 0 : w.type) === "chatbot" &&
|
|
37863
|
-
jsxRuntimeExports.jsxs("div", { className: "relative z-50", children: [jsxRuntimeExports.jsx("div", { onClick: () => handleClearChat(w.id), onMouseOver: () => setVisibleClearButton(true), onMouseLeave: () => setVisibleClearButton(false), className: "absolute z-40 flex align-middle justify-center gap-2 text-sm px-4 py-2 border-blue-300 rounded-sm dark:bg-white w-fit bg-gray-900 text-white dark:text-gray-900 cursor-pointer shadow-md transition-all", style: { top: "12px", right: "0", borderTopLeftRadius: "4px", borderBottomLeftRadius: "4px" }, children: jsxRuntimeExports.jsx(lucideReact.MessageCircleX, { className: "w-5 h-5" }) }), jsxRuntimeExports.jsx("span", { className: `absolute z-50 w-max py-1 text-xs px-2 rounded-sm dark:text-gray-900 dark:bg-white text-white bg-gray-900 ${visibleClearButton ? "block" : "hidden"}`, style: { top: "56px", right: "16px", borderRadius: "3px" }, children: "Clear Chat" })] }), jsxRuntimeExports.jsx(WidgetRenderer, { widget: w, widgetBackendUrl: widgetBackendUrl, onResetReady: handleResetReady, widgetIds: widgets.filter(widget => widget.type !== 'chatbot').map(widget => widget.id) })] })] }, w.id))) })
|
|
37864
|
-
// <ReactGridLayout
|
|
37865
|
-
// className="layout"
|
|
37866
|
-
// layout={getLayoutFromWidgets()}
|
|
37867
|
-
// cols={12}
|
|
37868
|
-
// rowHeight={50}
|
|
37869
|
-
// onLayoutChange={handleLayoutChange}
|
|
37870
|
-
// onDragStart={() => setIsDragging(true)}
|
|
37871
|
-
// onDragStop={() => setIsDragging(false)}
|
|
37872
|
-
// isDraggable={isEditing}
|
|
37873
|
-
// isResizable={isEditing}
|
|
37874
|
-
// useCSSTransforms
|
|
37875
|
-
// compactType={null}
|
|
37876
|
-
// margin={[8, 8]}
|
|
37877
|
-
// preventCollision={true}
|
|
37878
|
-
// >
|
|
37879
|
-
// {widgets.map((widget) => (
|
|
37880
|
-
// <div
|
|
37881
|
-
// key={widget.id}
|
|
37882
|
-
// className={cn(
|
|
37883
|
-
// "bg-background rounded-lg shadow-sm border overflow-hidden transition-all",
|
|
37884
|
-
// currentSelectedWidget?.id === widget.id &&
|
|
37885
|
-
// "ring-2 ring-primary ring-offset-2"
|
|
37886
|
-
// )}
|
|
37887
|
-
// onClick={(e) => handleWidgetClick(widget, e)}
|
|
37888
|
-
// onDoubleClick={(e) => handleWidgetDoubleClick(widget, e)}
|
|
37889
|
-
// >
|
|
37890
|
-
// {widget.config?.showHeader !== false && (
|
|
37891
|
-
// <div className="p-2 border-b flex items-center justify-between">
|
|
37892
|
-
// <span className="font-medium text-sm">
|
|
37893
|
-
// {widget.title}
|
|
37894
|
-
// </span>
|
|
37895
|
-
// {isEditing && (
|
|
37896
|
-
// <Button
|
|
37897
|
-
// variant="ghost"
|
|
37898
|
-
// size="sm"
|
|
37899
|
-
// onClick={() => removeWidget(widget.id)}
|
|
37900
|
-
// >
|
|
37901
|
-
// <Trash2 className="h-4 w-4" />
|
|
37902
|
-
// </Button>
|
|
37903
|
-
// )}
|
|
37904
|
-
// </div>
|
|
37905
|
-
// )}
|
|
37906
|
-
// <div
|
|
37907
|
-
// className={cn(
|
|
37908
|
-
// "h-full",
|
|
37909
|
-
// widget.config?.showHeader !== false &&
|
|
37910
|
-
// "h-[calc(100%-40px)]"
|
|
37911
|
-
// )}
|
|
37912
|
-
// >
|
|
37913
|
-
// <WidgetRenderer widget={widget} widgetBackendUrl={widgetBackendUrl} />
|
|
37914
|
-
// </div>
|
|
37915
|
-
// </div>
|
|
37916
|
-
// ))}
|
|
37917
|
-
// </ReactGridLayout>
|
|
37918
|
-
) })] }));
|
|
37888
|
+
jsxRuntimeExports.jsxs("div", { className: "relative z-50", children: [jsxRuntimeExports.jsx("div", { onClick: () => handleClearChat(w.id), onMouseOver: () => setVisibleClearButton(true), onMouseLeave: () => setVisibleClearButton(false), className: "absolute z-40 flex align-middle justify-center gap-2 text-sm px-4 py-2 border-blue-300 rounded-sm dark:bg-white w-fit bg-gray-900 text-white dark:text-gray-900 cursor-pointer shadow-md transition-all", style: { top: "12px", right: "0", borderTopLeftRadius: "4px", borderBottomLeftRadius: "4px" }, children: jsxRuntimeExports.jsx(lucideReact.MessageCircleX, { className: "w-5 h-5" }) }), jsxRuntimeExports.jsx("span", { className: `absolute z-50 w-max py-1 text-xs px-2 rounded-sm dark:text-gray-900 dark:bg-white text-white bg-gray-900 ${visibleClearButton ? "block" : "hidden"}`, style: { top: "56px", right: "16px", borderRadius: "3px" }, children: "Clear Chat" })] }), jsxRuntimeExports.jsx(WidgetRenderer, { widget: w, widgetBackendUrl: widgetBackendUrl, onResetReady: handleResetReady, widgetIds: widgets.filter(widget => widget.type !== 'chatbot').map(widget => widget.id) })] })] }, w.id))) })) })] }));
|
|
37919
37889
|
}
|
|
37920
37890
|
|
|
37921
37891
|
const Checkbox = React__namespace.forwardRef((_a, ref) => {
|