@trops/dash-core 0.1.54 → 0.1.55
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 +73 -74
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +73 -74
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27660,42 +27660,46 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27660
27660
|
var appContext = React.useContext(AppContext);
|
|
27661
27661
|
var providers = (appContext === null || appContext === void 0 ? void 0 : appContext.providers) || {};
|
|
27662
27662
|
var refreshProviders = appContext === null || appContext === void 0 ? void 0 : appContext.refreshProviders;
|
|
27663
|
-
var _useState = React.useState(
|
|
27663
|
+
var _useState = React.useState("credentials"),
|
|
27664
27664
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27665
|
-
|
|
27666
|
-
|
|
27667
|
-
var _useState3 = React.useState(
|
|
27665
|
+
providerTab = _useState2[0],
|
|
27666
|
+
setProviderTab = _useState2[1];
|
|
27667
|
+
var _useState3 = React.useState(null),
|
|
27668
27668
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
27669
|
-
|
|
27670
|
-
|
|
27669
|
+
selectedName = _useState4[0],
|
|
27670
|
+
setSelectedName = _useState4[1];
|
|
27671
27671
|
var _useState5 = React.useState(false),
|
|
27672
27672
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
27673
|
-
|
|
27674
|
-
|
|
27675
|
-
var _useState7 = React.useState(
|
|
27673
|
+
isCreating = _useState6[0],
|
|
27674
|
+
setIsCreating = _useState6[1];
|
|
27675
|
+
var _useState7 = React.useState(false),
|
|
27676
27676
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
27677
|
-
|
|
27678
|
-
|
|
27677
|
+
isEditing = _useState8[0],
|
|
27678
|
+
setIsEditing = _useState8[1];
|
|
27679
27679
|
var _useState9 = React.useState(""),
|
|
27680
27680
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
27681
|
-
|
|
27682
|
-
|
|
27683
|
-
var _useState1 = React.useState(
|
|
27681
|
+
formName = _useState0[0],
|
|
27682
|
+
setFormName = _useState0[1];
|
|
27683
|
+
var _useState1 = React.useState(""),
|
|
27684
27684
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
27685
|
-
|
|
27686
|
-
|
|
27687
|
-
var _useState11 = React.useState(
|
|
27685
|
+
formType = _useState10[0],
|
|
27686
|
+
setFormType = _useState10[1];
|
|
27687
|
+
var _useState11 = React.useState({}),
|
|
27688
27688
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
27689
|
-
|
|
27690
|
-
|
|
27691
|
-
var _useState13 = React.useState(
|
|
27689
|
+
formCredentials = _useState12[0],
|
|
27690
|
+
setFormCredentials = _useState12[1];
|
|
27691
|
+
var _useState13 = React.useState(null),
|
|
27692
27692
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
27693
|
-
|
|
27694
|
-
|
|
27693
|
+
deleteTarget = _useState14[0],
|
|
27694
|
+
setDeleteTarget = _useState14[1];
|
|
27695
27695
|
var _useState15 = React.useState(false),
|
|
27696
27696
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
27697
|
-
|
|
27698
|
-
|
|
27697
|
+
isAddingMcp = _useState16[0],
|
|
27698
|
+
setIsAddingMcp = _useState16[1];
|
|
27699
|
+
var _useState17 = React.useState(false),
|
|
27700
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
27701
|
+
isEditingMcp = _useState18[0],
|
|
27702
|
+
setIsEditingMcp = _useState18[1];
|
|
27699
27703
|
|
|
27700
27704
|
// Row ID counter for env/header rows in MCP edit mode
|
|
27701
27705
|
var nextRowIdRef = React.useRef(0);
|
|
@@ -27738,6 +27742,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27738
27742
|
credentials: credentials
|
|
27739
27743
|
}, function () {
|
|
27740
27744
|
resetForm();
|
|
27745
|
+
setProviderTab("credentials");
|
|
27741
27746
|
refreshProviders && refreshProviders();
|
|
27742
27747
|
}, function (e, err) {
|
|
27743
27748
|
return (void 0);
|
|
@@ -27746,6 +27751,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27746
27751
|
function handleStartEdit(name, provider) {
|
|
27747
27752
|
setSelectedName(name);
|
|
27748
27753
|
setIsCreating(false);
|
|
27754
|
+
setProviderTab(provider.providerClass === "mcp" ? "mcp" : "credentials");
|
|
27749
27755
|
if (provider.providerClass === "mcp") {
|
|
27750
27756
|
setIsEditingMcp(true);
|
|
27751
27757
|
setIsEditing(false);
|
|
@@ -27810,6 +27816,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27810
27816
|
setIsAddingMcp(false);
|
|
27811
27817
|
refreshProviders && refreshProviders();
|
|
27812
27818
|
setSelectedName(providerName);
|
|
27819
|
+
setProviderTab("mcp");
|
|
27813
27820
|
}, function (e, err) {
|
|
27814
27821
|
return (void 0);
|
|
27815
27822
|
});
|
|
@@ -27831,6 +27838,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27831
27838
|
mcpConfig: mcpConfig
|
|
27832
27839
|
}, function () {
|
|
27833
27840
|
setSelectedName(providerName);
|
|
27841
|
+
setProviderTab("mcp");
|
|
27834
27842
|
setIsEditingMcp(false);
|
|
27835
27843
|
resetForm();
|
|
27836
27844
|
refreshProviders && refreshProviders();
|
|
@@ -27855,19 +27863,39 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27855
27863
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27856
27864
|
}, [createRequested]);
|
|
27857
27865
|
var selectedProvider = selectedName && providers[selectedName] ? providers[selectedName] : null;
|
|
27858
|
-
var
|
|
27859
|
-
|
|
27860
|
-
|
|
27861
|
-
|
|
27862
|
-
|
|
27863
|
-
|
|
27866
|
+
var activeProviders = providerTab === "credentials" ? credentialProviders : mcpProviders;
|
|
27867
|
+
var activeIcon = providerTab === "credentials" ? "key" : "server";
|
|
27868
|
+
var listContent = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
27869
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27870
|
+
className: "px-2 pt-2",
|
|
27871
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3, {
|
|
27872
|
+
value: providerTab,
|
|
27873
|
+
onValueChange: setProviderTab,
|
|
27874
|
+
backgroundColor: "bg-transparent",
|
|
27875
|
+
spacing: "p-0",
|
|
27876
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.Tabs3.List, {
|
|
27877
|
+
className: "w-full flex",
|
|
27878
|
+
spacing: "p-0.5",
|
|
27879
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
|
|
27880
|
+
value: "credentials",
|
|
27881
|
+
className: "flex-1",
|
|
27882
|
+
children: "API Credentials"
|
|
27883
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
|
|
27884
|
+
value: "mcp",
|
|
27885
|
+
className: "flex-1",
|
|
27886
|
+
children: "MCP Servers"
|
|
27887
|
+
})]
|
|
27888
|
+
})
|
|
27889
|
+
})
|
|
27890
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(DashReact.Sidebar.Content, {
|
|
27891
|
+
children: [activeProviders.map(function (_ref8) {
|
|
27864
27892
|
var _ref9 = _slicedToArray(_ref8, 2),
|
|
27865
27893
|
name = _ref9[0],
|
|
27866
27894
|
provider = _ref9[1];
|
|
27867
27895
|
var isSelected = selectedName === name && !isCreating;
|
|
27868
27896
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
|
|
27869
27897
|
icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27870
|
-
icon:
|
|
27898
|
+
icon: activeIcon,
|
|
27871
27899
|
className: "h-3.5 w-3.5"
|
|
27872
27900
|
}),
|
|
27873
27901
|
active: isSelected,
|
|
@@ -27884,54 +27912,25 @@ var ProvidersSection = function ProvidersSection(_ref) {
|
|
|
27884
27912
|
className: isSelected ? "bg-white/10 opacity-100" : "",
|
|
27885
27913
|
children: name
|
|
27886
27914
|
}, name);
|
|
27887
|
-
})
|
|
27888
|
-
|
|
27889
|
-
|
|
27890
|
-
|
|
27891
|
-
|
|
27892
|
-
|
|
27893
|
-
var _ref1 = _slicedToArray(_ref0, 2),
|
|
27894
|
-
name = _ref1[0],
|
|
27895
|
-
provider = _ref1[1];
|
|
27896
|
-
var isSelected = selectedName === name && !isCreating;
|
|
27897
|
-
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
|
|
27898
|
-
icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27899
|
-
icon: "server",
|
|
27900
|
-
className: "h-3.5 w-3.5"
|
|
27901
|
-
}),
|
|
27902
|
-
active: isSelected,
|
|
27915
|
+
}), activeProviders.length === 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
27916
|
+
className: "text-sm opacity-40 py-8 text-center",
|
|
27917
|
+
children: providerTab === "credentials" ? "No API credentials configured" : "No MCP servers configured"
|
|
27918
|
+
}), providerTab === "mcp" && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27919
|
+
className: "px-3 py-3 mt-2 border-t border-white/10",
|
|
27920
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27903
27921
|
onClick: function onClick() {
|
|
27904
|
-
|
|
27922
|
+
setIsAddingMcp(true);
|
|
27923
|
+
setSelectedName(null);
|
|
27905
27924
|
setIsCreating(false);
|
|
27906
27925
|
setIsEditing(false);
|
|
27907
|
-
setIsAddingMcp(false);
|
|
27908
|
-
resetForm();
|
|
27909
27926
|
},
|
|
27910
|
-
|
|
27911
|
-
|
|
27912
|
-
|
|
27913
|
-
|
|
27914
|
-
|
|
27915
|
-
}
|
|
27927
|
+
className: "flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300 transition-colors w-full",
|
|
27928
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27929
|
+
icon: "plus",
|
|
27930
|
+
className: "h-3 w-3"
|
|
27931
|
+
}), "Add MCP Server"]
|
|
27932
|
+
})
|
|
27916
27933
|
})]
|
|
27917
|
-
}), providerEntries.length === 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
27918
|
-
className: "text-sm opacity-40 py-8 text-center",
|
|
27919
|
-
children: "No providers configured"
|
|
27920
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27921
|
-
className: "px-3 py-3 mt-2 border-t border-white/10",
|
|
27922
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27923
|
-
onClick: function onClick() {
|
|
27924
|
-
setIsAddingMcp(true);
|
|
27925
|
-
setSelectedName(null);
|
|
27926
|
-
setIsCreating(false);
|
|
27927
|
-
setIsEditing(false);
|
|
27928
|
-
},
|
|
27929
|
-
className: "flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300 transition-colors w-full",
|
|
27930
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27931
|
-
icon: "plus",
|
|
27932
|
-
className: "h-3 w-3"
|
|
27933
|
-
}), "Add MCP Server"]
|
|
27934
|
-
})
|
|
27935
27934
|
})]
|
|
27936
27935
|
});
|
|
27937
27936
|
var detailContent = null;
|