@trops/dash-core 0.1.716 → 0.1.718

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
@@ -3353,12 +3353,16 @@ function useWidgetUpdates() {
3353
3353
  _useState0 = _slicedToArray(_useState9, 2),
3354
3354
  updateError = _useState0[0],
3355
3355
  setUpdateError = _useState0[1];
3356
+ // AppWrapper calls this hook (via useAppUpdates) from the component that
3357
+ // PROVIDES AppContext, so useContext comes back empty there. Fall back to
3358
+ // the context AppWrapper broadcasts on window when the check runs
3359
+ // (see computeBatchPreflight).
3360
+ var appProviders = ((_useContext = React.useContext(AppContext)) === null || _useContext === void 0 ? void 0 : _useContext.providers) || null;
3356
3361
  // batchStatus tracks the per-package progress during an updatePackages
3357
3362
  // run so the "Update all" modal can show pending/in-progress/done/failed
3358
3363
  // pips next to each row. Cleared (Map -> empty) when isBatchUpdating
3359
3364
  // flips back to false; consumers that want to keep showing a per-package
3360
3365
  // result after the batch finished should snapshot it themselves.
3361
- var appProviders = ((_useContext = React.useContext(AppContext)) === null || _useContext === void 0 ? void 0 : _useContext.providers) || null;
3362
3366
  var _useState1 = React.useState(new Map()),
3363
3367
  _useState10 = _slicedToArray(_useState1, 2),
3364
3368
  batchStatus = _useState10[0],
@@ -3992,7 +3996,7 @@ function useWidgetUpdates() {
3992
3996
  _context5.prev = 8;
3993
3997
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
3994
3998
  var _manifest$permissions, _manifest$permissions2;
3995
- var _step5$value, packageId, manifest, declaredMcp, byComponent, pkgWidgets, _iterator6, _step6, _normalizeGrantsByPro, _byComponent$w$name, w, matchingRow, widgetId, grantedMcp, declaredForWidget, missingServers, _t6;
3999
+ var _step5$value, packageId, manifest, declaredMcp, byComponent, pkgWidgets, _iterator6, _step6, _normalizeGrantsByPro, _window$__dashAppCont, _byComponent$w$name, w, matchingRow, widgetId, grantedMcp, declaredForWidget, missingServers, _t6;
3996
4000
  return _regeneratorRuntime.wrap(function (_context4) {
3997
4001
  while (1) switch (_context4.prev = _context4.next) {
3998
4002
  case 0:
@@ -4027,7 +4031,7 @@ function useWidgetUpdates() {
4027
4031
  // declared permissions by provider type ("algolia"). Compare
4028
4032
  // against a type-keyed copy; the original is what gets merged
4029
4033
  // and saved back.
4030
- grantedMcp = matchingRow ? ((_normalizeGrantsByPro = normalizeGrantsByProviderType([matchingRow], appProviders)[0]) === null || _normalizeGrantsByPro === void 0 || (_normalizeGrantsByPro = _normalizeGrantsByPro.granted) === null || _normalizeGrantsByPro === void 0 ? void 0 : _normalizeGrantsByPro.servers) || {} : {};
4034
+ grantedMcp = matchingRow ? ((_normalizeGrantsByPro = normalizeGrantsByProviderType([matchingRow], appProviders || ((_window$__dashAppCont = window.__dashAppContext) === null || _window$__dashAppCont === void 0 ? void 0 : _window$__dashAppCont.providers) || null)[0]) === null || _normalizeGrantsByPro === void 0 || (_normalizeGrantsByPro = _normalizeGrantsByPro.granted) === null || _normalizeGrantsByPro === void 0 ? void 0 : _normalizeGrantsByPro.servers) || {} : {};
4031
4035
  declaredForWidget = byComponent ? ((_byComponent$w$name = byComponent[w.name]) === null || _byComponent$w$name === void 0 ? void 0 : _byComponent$w$name.servers) || {} : declaredMcp;
4032
4036
  missingServers = diffMcpServers(declaredForWidget, grantedMcp);
4033
4037
  if (!(Object.keys(missingServers).length === 0)) {
@@ -64056,14 +64060,6 @@ var DashboardsPage = function DashboardsPage(_ref5) {
64056
64060
  }],
64057
64061
  value: view,
64058
64062
  onChange: setView
64059
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
64060
- className: "flex-1"
64061
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
64062
- title: "Browse marketplace",
64063
- size: "sm",
64064
- onClick: function onClick() {
64065
- return setMode("marketplace");
64066
- }
64067
64063
  })]
64068
64064
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
64069
64065
  className: "flex-1 min-h-0 grid grid-cols-3 gap-4",