@trops/dash-core 0.1.123 → 0.1.124
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 +33 -27
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +33 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13188,6 +13188,13 @@ function mcpJsonToFormState(jsonString, nextRowId) {
|
|
|
13188
13188
|
return result;
|
|
13189
13189
|
}
|
|
13190
13190
|
|
|
13191
|
+
var getUserConfigurableProviders = function getUserConfigurableProviders(providers) {
|
|
13192
|
+
if (!providers) return [];
|
|
13193
|
+
return providers.filter(function (p) {
|
|
13194
|
+
return p.providerClass !== "api";
|
|
13195
|
+
});
|
|
13196
|
+
};
|
|
13197
|
+
|
|
13191
13198
|
function _createForOfIteratorHelper$8(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$8(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13192
13199
|
function _unsupportedIterableToArray$8(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$8(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$8(r, a) : void 0; } }
|
|
13193
13200
|
function _arrayLikeToArray$8(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -13548,8 +13555,9 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
13548
13555
|
var providers = new Set();
|
|
13549
13556
|
providers.add("none"); // For widgets without providers
|
|
13550
13557
|
widgets.forEach(function (widget) {
|
|
13551
|
-
|
|
13552
|
-
|
|
13558
|
+
var configurable = getUserConfigurableProviders(widget.providers);
|
|
13559
|
+
if (configurable.length > 0) {
|
|
13560
|
+
configurable.forEach(function (provider) {
|
|
13553
13561
|
providers.add(provider.type);
|
|
13554
13562
|
});
|
|
13555
13563
|
}
|
|
@@ -13574,9 +13582,9 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
13574
13582
|
var matchesProvider = true;
|
|
13575
13583
|
if (selectedProvider !== "all") {
|
|
13576
13584
|
if (selectedProvider === "none") {
|
|
13577
|
-
matchesProvider =
|
|
13585
|
+
matchesProvider = getUserConfigurableProviders(widget.providers).length === 0;
|
|
13578
13586
|
} else {
|
|
13579
|
-
matchesProvider = widget.providers
|
|
13587
|
+
matchesProvider = getUserConfigurableProviders(widget.providers).some(function (p) {
|
|
13580
13588
|
return p.type === selectedProvider;
|
|
13581
13589
|
});
|
|
13582
13590
|
}
|
|
@@ -14003,7 +14011,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14003
14011
|
}
|
|
14004
14012
|
|
|
14005
14013
|
// Check providers: all required providers must be selected
|
|
14006
|
-
var hasRequiredProviders = selectedWidget.providers ? selectedWidget.providers.filter(function (p) {
|
|
14014
|
+
var hasRequiredProviders = selectedWidget.providers ? getUserConfigurableProviders(selectedWidget.providers).filter(function (p) {
|
|
14007
14015
|
return p.required === true;
|
|
14008
14016
|
}).every(function (p) {
|
|
14009
14017
|
return selectedProviders[p.type] && selectedProviders[p.type] !== "";
|
|
@@ -14125,7 +14133,6 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14125
14133
|
})
|
|
14126
14134
|
})
|
|
14127
14135
|
}), expandedPackages.has(group.name) && group.widgets.map(function (widget) {
|
|
14128
|
-
var _widget$providers;
|
|
14129
14136
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.MenuItem3, {
|
|
14130
14137
|
onClick: function onClick() {
|
|
14131
14138
|
return handleWidgetSelect(widget);
|
|
@@ -14145,9 +14152,9 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14145
14152
|
}), widget.description && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14146
14153
|
className: "text-xs opacity-50 truncate",
|
|
14147
14154
|
children: widget.description
|
|
14148
|
-
}), (
|
|
14155
|
+
}), getUserConfigurableProviders(widget.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14149
14156
|
className: "flex flex-wrap gap-1 mt-0.5",
|
|
14150
|
-
children: widget.providers.map(function (p) {
|
|
14157
|
+
children: getUserConfigurableProviders(widget.providers).map(function (p) {
|
|
14151
14158
|
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
14152
14159
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-blue-500/20 text-blue-300",
|
|
14153
14160
|
children: p.type
|
|
@@ -14169,7 +14176,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14169
14176
|
padding: true,
|
|
14170
14177
|
height: "h-full",
|
|
14171
14178
|
children: filteredWidgets.map(function (widget) {
|
|
14172
|
-
var _widget$
|
|
14179
|
+
var _widget$providers;
|
|
14173
14180
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.MenuItem3, {
|
|
14174
14181
|
onClick: function onClick() {
|
|
14175
14182
|
return handleWidgetSelect(widget);
|
|
@@ -14189,7 +14196,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14189
14196
|
}), widget.description && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14190
14197
|
className: "text-xs opacity-50 truncate",
|
|
14191
14198
|
children: widget.description
|
|
14192
|
-
}), ((_widget$
|
|
14199
|
+
}), ((_widget$providers = widget.providers) === null || _widget$providers === void 0 ? void 0 : _widget$providers.length) > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14193
14200
|
className: "flex flex-wrap gap-1 mt-0.5",
|
|
14194
14201
|
children: widget.providers.map(function (p) {
|
|
14195
14202
|
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -14277,9 +14284,9 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14277
14284
|
}), w.description && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14278
14285
|
className: "text-xs text-gray-400 mt-0.5",
|
|
14279
14286
|
children: w.description
|
|
14280
|
-
}), w.providers
|
|
14287
|
+
}), getUserConfigurableProviders(w.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14281
14288
|
className: "flex gap-1 mt-1",
|
|
14282
|
-
children: w.providers.map(function (p, pidx) {
|
|
14289
|
+
children: getUserConfigurableProviders(w.providers).map(function (p, pidx) {
|
|
14283
14290
|
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
14284
14291
|
className: "text-xs px-1.5 py-0.5 rounded bg-blue-900/30 text-blue-400",
|
|
14285
14292
|
children: [p.type, p.required ? " *" : ""]
|
|
@@ -14485,7 +14492,6 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14485
14492
|
children: groupedInstalledWidgets[groupName].length
|
|
14486
14493
|
})]
|
|
14487
14494
|
}), expandedGroups.has(groupName) && groupedInstalledWidgets[groupName].map(function (widget) {
|
|
14488
|
-
var _widget$providers3;
|
|
14489
14495
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.MenuItem3, {
|
|
14490
14496
|
onClick: function onClick() {
|
|
14491
14497
|
return handleWidgetSelect(widget);
|
|
@@ -14505,9 +14511,9 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14505
14511
|
}), widget.description && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14506
14512
|
className: "text-xs opacity-50 truncate",
|
|
14507
14513
|
children: widget.description
|
|
14508
|
-
}), (
|
|
14514
|
+
}), getUserConfigurableProviders(widget.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14509
14515
|
className: "flex flex-wrap gap-1 mt-0.5",
|
|
14510
|
-
children: widget.providers.map(function (p) {
|
|
14516
|
+
children: getUserConfigurableProviders(widget.providers).map(function (p) {
|
|
14511
14517
|
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
14512
14518
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-blue-500/20 text-blue-300",
|
|
14513
14519
|
children: p.type
|
|
@@ -14565,7 +14571,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14565
14571
|
className: "text-sm",
|
|
14566
14572
|
children: selectedWidget.description
|
|
14567
14573
|
})
|
|
14568
|
-
}), selectedWidget.providers
|
|
14574
|
+
}), getUserConfigurableProviders(selectedWidget.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14569
14575
|
className: "mb-2",
|
|
14570
14576
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
|
|
14571
14577
|
padding: false,
|
|
@@ -14573,7 +14579,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
14573
14579
|
children: "REQUIRED PROVIDERS"
|
|
14574
14580
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14575
14581
|
className: "space-y-2",
|
|
14576
|
-
children: selectedWidget.providers.map(function (providerReq, idx) {
|
|
14582
|
+
children: getUserConfigurableProviders(selectedWidget.providers).map(function (providerReq, idx) {
|
|
14577
14583
|
var _inlineCatalogEntry$m, _inlineCatalogEntry$m2, _inlineCatalogEntry$m3, _inlineCatalogEntry$m4, _inlineCatalogEntry$m5, _inlineTestResult$too;
|
|
14578
14584
|
// Get available providers of this type
|
|
14579
14585
|
var providersOfType = Object.values(availableProviders).filter(function (p) {
|
|
@@ -36920,14 +36926,14 @@ var InstalledWidgetDetail = function InstalledWidgetDetail(_ref) {
|
|
|
36920
36926
|
className: "text-sm opacity-70",
|
|
36921
36927
|
children: widget.workspace
|
|
36922
36928
|
})]
|
|
36923
|
-
}), widget.providers
|
|
36929
|
+
}), getUserConfigurableProviders(widget.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36924
36930
|
className: "flex flex-col space-y-1",
|
|
36925
36931
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36926
36932
|
className: "text-xs font-semibold opacity-50",
|
|
36927
36933
|
children: "PROVIDERS"
|
|
36928
36934
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36929
36935
|
className: "flex flex-wrap gap-1.5",
|
|
36930
|
-
children: widget.providers.map(function (p, i) {
|
|
36936
|
+
children: getUserConfigurableProviders(widget.providers).map(function (p, i) {
|
|
36931
36937
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36932
36938
|
className: "flex flex-col gap-1",
|
|
36933
36939
|
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
@@ -37126,22 +37132,22 @@ var RegistryPackageDetail = function RegistryPackageDetail(_ref) {
|
|
|
37126
37132
|
}), w.description && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37127
37133
|
className: "text-xs opacity-50 mt-0.5",
|
|
37128
37134
|
children: w.description
|
|
37129
|
-
}), w.providers
|
|
37135
|
+
}), getUserConfigurableProviders(w.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37130
37136
|
className: "space-y-1 mt-1",
|
|
37131
37137
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37132
37138
|
className: "flex gap-1 flex-wrap",
|
|
37133
|
-
children: w.providers.map(function (p, pidx) {
|
|
37139
|
+
children: getUserConfigurableProviders(w.providers).map(function (p, pidx) {
|
|
37134
37140
|
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
37135
37141
|
className: "text-xs px-1.5 py-0.5 rounded bg-blue-900/30 text-blue-400",
|
|
37136
37142
|
children: [p.type, p.required ? " *" : ""]
|
|
37137
37143
|
}, pidx);
|
|
37138
37144
|
})
|
|
37139
|
-
}), w.providers.some(function (p) {
|
|
37145
|
+
}), getUserConfigurableProviders(w.providers).some(function (p) {
|
|
37140
37146
|
var _p$requiredTools;
|
|
37141
37147
|
return ((_p$requiredTools = p.requiredTools) === null || _p$requiredTools === void 0 ? void 0 : _p$requiredTools.length) > 0;
|
|
37142
37148
|
}) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37143
37149
|
className: "flex flex-wrap gap-1 ml-1",
|
|
37144
|
-
children: w.providers.filter(function (p) {
|
|
37150
|
+
children: getUserConfigurableProviders(w.providers).filter(function (p) {
|
|
37145
37151
|
var _p$requiredTools2;
|
|
37146
37152
|
return ((_p$requiredTools2 = p.requiredTools) === null || _p$requiredTools2 === void 0 ? void 0 : _p$requiredTools2.length) > 0;
|
|
37147
37153
|
}).flatMap(function (p) {
|
|
@@ -38076,7 +38082,7 @@ var WidgetsSection = function WidgetsSection(_ref) {
|
|
|
38076
38082
|
}, [widgets]);
|
|
38077
38083
|
var uniqueProviders = React.useMemo(function () {
|
|
38078
38084
|
return _toConsumableArray(new Set(widgets.flatMap(function (w) {
|
|
38079
|
-
return (w.providers || []).map(function (p) {
|
|
38085
|
+
return getUserConfigurableProviders(w.providers || []).map(function (p) {
|
|
38080
38086
|
return p.type;
|
|
38081
38087
|
});
|
|
38082
38088
|
}))).sort();
|
|
@@ -38100,9 +38106,9 @@ var WidgetsSection = function WidgetsSection(_ref) {
|
|
|
38100
38106
|
// Provider filter
|
|
38101
38107
|
if (filterProvider !== "all") {
|
|
38102
38108
|
if (filterProvider === "none") {
|
|
38103
|
-
if (w.providers
|
|
38109
|
+
if (getUserConfigurableProviders(w.providers).length > 0) return false;
|
|
38104
38110
|
} else {
|
|
38105
|
-
if (!w.providers
|
|
38111
|
+
if (!getUserConfigurableProviders(w.providers).some(function (p) {
|
|
38106
38112
|
return p.type === filterProvider;
|
|
38107
38113
|
})) return false;
|
|
38108
38114
|
}
|
|
@@ -43704,6 +43710,7 @@ exports.getNextLowestItemInLayout = getNextLowestItemInLayout;
|
|
|
43704
43710
|
exports.getParentForLayoutItem = getParentForLayoutItem;
|
|
43705
43711
|
exports.getParentWorkspaceForItem = getParentWorkspaceForItem;
|
|
43706
43712
|
exports.getThemePresets = getThemePresets;
|
|
43713
|
+
exports.getUserConfigurableProviders = getUserConfigurableProviders;
|
|
43707
43714
|
exports.getWidgetsForWorkspace = getWidgetsForWorkspace;
|
|
43708
43715
|
exports.getWorkspacesForWorkspace = getWorkspacesForWorkspace;
|
|
43709
43716
|
exports.headerTemplateToRows = headerTemplateToRows;
|