@trops/dash-core 0.1.122 → 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.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
- if (widget.providers && widget.providers.length > 0) {
13552
- widget.providers.forEach(function (provider) {
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 = !widget.providers || widget.providers.length === 0;
13585
+ matchesProvider = getUserConfigurableProviders(widget.providers).length === 0;
13578
13586
  } else {
13579
- matchesProvider = widget.providers && widget.providers.some(function (p) {
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
- }), ((_widget$providers = widget.providers) === null || _widget$providers === void 0 ? void 0 : _widget$providers.length) > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
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$providers2;
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$providers2 = widget.providers) === null || _widget$providers2 === void 0 ? void 0 : _widget$providers2.length) > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
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 && w.providers.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
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
- }), ((_widget$providers3 = widget.providers) === null || _widget$providers3 === void 0 ? void 0 : _widget$providers3.length) > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
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 && selectedWidget.providers.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
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) {
@@ -30011,6 +30017,7 @@ var TokenColorPickerPane = function TokenColorPickerPane(_ref) {
30011
30017
  var VALUE_OPTIONS = {
30012
30018
  textSize: ["text-xs", "text-sm", "text-base", "text-lg", "text-xl", "text-2xl", "text-3xl", "text-4xl", "text-5xl", "text-6xl"],
30013
30019
  fontWeight: ["font-thin", "font-extralight", "font-light", "font-normal", "font-medium", "font-semibold", "font-bold", "font-extrabold", "font-black"],
30020
+ borderWidth: ["border-0", "border", "border-2", "border-4", "border-8"],
30014
30021
  borderRadius: ["rounded-none", "rounded-sm", "rounded", "rounded-md", "rounded-lg", "rounded-xl", "rounded-2xl", "rounded-3xl", "rounded-full"],
30015
30022
  shadow: ["shadow-none", "shadow-sm", "shadow", "shadow-md", "shadow-lg", "shadow-xl", "shadow-2xl"],
30016
30023
  spacing: ["p-0", "p-1", "p-2", "p-3", "p-4", "p-5", "p-6", "p-8", "px-2 py-1", "px-3 py-1.5", "px-4 py-2", "px-6 py-3", "px-8 py-4"],
@@ -36919,14 +36926,14 @@ var InstalledWidgetDetail = function InstalledWidgetDetail(_ref) {
36919
36926
  className: "text-sm opacity-70",
36920
36927
  children: widget.workspace
36921
36928
  })]
36922
- }), widget.providers && widget.providers.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
36929
+ }), getUserConfigurableProviders(widget.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
36923
36930
  className: "flex flex-col space-y-1",
36924
36931
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
36925
36932
  className: "text-xs font-semibold opacity-50",
36926
36933
  children: "PROVIDERS"
36927
36934
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
36928
36935
  className: "flex flex-wrap gap-1.5",
36929
- children: widget.providers.map(function (p, i) {
36936
+ children: getUserConfigurableProviders(widget.providers).map(function (p, i) {
36930
36937
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
36931
36938
  className: "flex flex-col gap-1",
36932
36939
  children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
@@ -37125,22 +37132,22 @@ var RegistryPackageDetail = function RegistryPackageDetail(_ref) {
37125
37132
  }), w.description && /*#__PURE__*/jsxRuntime.jsx("div", {
37126
37133
  className: "text-xs opacity-50 mt-0.5",
37127
37134
  children: w.description
37128
- }), w.providers && w.providers.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
37135
+ }), getUserConfigurableProviders(w.providers).length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
37129
37136
  className: "space-y-1 mt-1",
37130
37137
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
37131
37138
  className: "flex gap-1 flex-wrap",
37132
- children: w.providers.map(function (p, pidx) {
37139
+ children: getUserConfigurableProviders(w.providers).map(function (p, pidx) {
37133
37140
  return /*#__PURE__*/jsxRuntime.jsxs("span", {
37134
37141
  className: "text-xs px-1.5 py-0.5 rounded bg-blue-900/30 text-blue-400",
37135
37142
  children: [p.type, p.required ? " *" : ""]
37136
37143
  }, pidx);
37137
37144
  })
37138
- }), w.providers.some(function (p) {
37145
+ }), getUserConfigurableProviders(w.providers).some(function (p) {
37139
37146
  var _p$requiredTools;
37140
37147
  return ((_p$requiredTools = p.requiredTools) === null || _p$requiredTools === void 0 ? void 0 : _p$requiredTools.length) > 0;
37141
37148
  }) && /*#__PURE__*/jsxRuntime.jsx("div", {
37142
37149
  className: "flex flex-wrap gap-1 ml-1",
37143
- children: w.providers.filter(function (p) {
37150
+ children: getUserConfigurableProviders(w.providers).filter(function (p) {
37144
37151
  var _p$requiredTools2;
37145
37152
  return ((_p$requiredTools2 = p.requiredTools) === null || _p$requiredTools2 === void 0 ? void 0 : _p$requiredTools2.length) > 0;
37146
37153
  }).flatMap(function (p) {
@@ -38075,7 +38082,7 @@ var WidgetsSection = function WidgetsSection(_ref) {
38075
38082
  }, [widgets]);
38076
38083
  var uniqueProviders = React.useMemo(function () {
38077
38084
  return _toConsumableArray(new Set(widgets.flatMap(function (w) {
38078
- return (w.providers || []).map(function (p) {
38085
+ return getUserConfigurableProviders(w.providers || []).map(function (p) {
38079
38086
  return p.type;
38080
38087
  });
38081
38088
  }))).sort();
@@ -38099,9 +38106,9 @@ var WidgetsSection = function WidgetsSection(_ref) {
38099
38106
  // Provider filter
38100
38107
  if (filterProvider !== "all") {
38101
38108
  if (filterProvider === "none") {
38102
- if (w.providers && w.providers.length > 0) return false;
38109
+ if (getUserConfigurableProviders(w.providers).length > 0) return false;
38103
38110
  } else {
38104
- if (!w.providers || !w.providers.some(function (p) {
38111
+ if (!getUserConfigurableProviders(w.providers).some(function (p) {
38105
38112
  return p.type === filterProvider;
38106
38113
  })) return false;
38107
38114
  }
@@ -43703,6 +43710,7 @@ exports.getNextLowestItemInLayout = getNextLowestItemInLayout;
43703
43710
  exports.getParentForLayoutItem = getParentForLayoutItem;
43704
43711
  exports.getParentWorkspaceForItem = getParentWorkspaceForItem;
43705
43712
  exports.getThemePresets = getThemePresets;
43713
+ exports.getUserConfigurableProviders = getUserConfigurableProviders;
43706
43714
  exports.getWidgetsForWorkspace = getWidgetsForWorkspace;
43707
43715
  exports.getWorkspacesForWorkspace = getWorkspacesForWorkspace;
43708
43716
  exports.headerTemplateToRows = headerTemplateToRows;