@trops/dash-core 0.1.371 → 0.1.373

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
@@ -4733,7 +4733,10 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
4733
4733
  _useState2 = _slicedToArray(_useState, 2),
4734
4734
  packages = _useState2[0],
4735
4735
  setPackages = _useState2[1];
4736
- var _useState3 = React.useState(false),
4736
+ // Start in the loading state so the empty UI doesn't flash while the
4737
+ // initial debounce is pending — otherwise the sign-in nudge appears
4738
+ // briefly then disappears as soon as the registry returns results.
4739
+ var _useState3 = React.useState(true),
4737
4740
  _useState4 = _slicedToArray(_useState3, 2),
4738
4741
  isLoading = _useState4[0],
4739
4742
  setIsLoading = _useState4[1];
@@ -4749,47 +4752,87 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
4749
4752
  _useState0 = _slicedToArray(_useState9, 2),
4750
4753
  selectedPackageName = _useState0[0],
4751
4754
  setSelectedPackageName = _useState0[1];
4752
- var search = React.useCallback(/*#__PURE__*/function () {
4753
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(query) {
4754
- var _window$mainApi;
4755
- var result, _t;
4755
+
4756
+ // Auth state when the empty state shows up to a non-signed-in user,
4757
+ // they may not realize private packages they own are filtered out.
4758
+ var _useState1 = React.useState(null),
4759
+ _useState10 = _slicedToArray(_useState1, 2),
4760
+ registryAuthed = _useState10[0],
4761
+ setRegistryAuthed = _useState10[1];
4762
+ var _useState11 = React.useState(false),
4763
+ _useState12 = _slicedToArray(_useState11, 2),
4764
+ showAuthFromEmpty = _useState12[0],
4765
+ setShowAuthFromEmpty = _useState12[1];
4766
+ React.useEffect(function () {
4767
+ var cancelled = false;
4768
+ _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
4769
+ var _window$mainApi, status;
4756
4770
  return _regeneratorRuntime.wrap(function (_context) {
4757
4771
  while (1) switch (_context.prev = _context.next) {
4758
4772
  case 0:
4759
- if ((_window$mainApi = window.mainApi) !== null && _window$mainApi !== void 0 && (_window$mainApi = _window$mainApi.registry) !== null && _window$mainApi !== void 0 && _window$mainApi.searchDashboards) {
4760
- _context.next = 1;
4773
+ _context.prev = 0;
4774
+ _context.next = 1;
4775
+ return (_window$mainApi = window.mainApi) === null || _window$mainApi === void 0 || (_window$mainApi = _window$mainApi.registryAuth) === null || _window$mainApi === void 0 ? void 0 : _window$mainApi.getStatus();
4776
+ case 1:
4777
+ status = _context.sent;
4778
+ if (!cancelled) setRegistryAuthed(!!(status !== null && status !== void 0 && status.authenticated));
4779
+ _context.next = 3;
4780
+ break;
4781
+ case 2:
4782
+ _context.prev = 2;
4783
+ _context["catch"](0);
4784
+ if (!cancelled) setRegistryAuthed(false);
4785
+ case 3:
4786
+ case "end":
4787
+ return _context.stop();
4788
+ }
4789
+ }, _callee, null, [[0, 2]]);
4790
+ }))();
4791
+ return function () {
4792
+ cancelled = true;
4793
+ };
4794
+ }, [showAuthFromEmpty]);
4795
+ var search = React.useCallback(/*#__PURE__*/function () {
4796
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(query) {
4797
+ var _window$mainApi2;
4798
+ var result, _t2;
4799
+ return _regeneratorRuntime.wrap(function (_context2) {
4800
+ while (1) switch (_context2.prev = _context2.next) {
4801
+ case 0:
4802
+ if ((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && (_window$mainApi2 = _window$mainApi2.registry) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.searchDashboards) {
4803
+ _context2.next = 1;
4761
4804
  break;
4762
4805
  }
4763
4806
  setPackages([]);
4764
- return _context.abrupt("return");
4807
+ return _context2.abrupt("return");
4765
4808
  case 1:
4766
4809
  setIsLoading(true);
4767
4810
  setError(null);
4768
- _context.prev = 2;
4769
- _context.next = 3;
4811
+ _context2.prev = 2;
4812
+ _context2.next = 3;
4770
4813
  return window.mainApi.registry.searchDashboards(query || "", {});
4771
4814
  case 3:
4772
- result = _context.sent;
4815
+ result = _context2.sent;
4773
4816
  setPackages((result === null || result === void 0 ? void 0 : result.packages) || []);
4774
- _context.next = 5;
4817
+ _context2.next = 5;
4775
4818
  break;
4776
4819
  case 4:
4777
- _context.prev = 4;
4778
- _t = _context["catch"](2);
4779
- setError(_t.message || "Failed to search dashboard registry");
4820
+ _context2.prev = 4;
4821
+ _t2 = _context2["catch"](2);
4822
+ setError(_t2.message || "Failed to search dashboard registry");
4780
4823
  setPackages([]);
4781
4824
  case 5:
4782
- _context.prev = 5;
4825
+ _context2.prev = 5;
4783
4826
  setIsLoading(false);
4784
- return _context.finish(5);
4827
+ return _context2.finish(5);
4785
4828
  case 6:
4786
4829
  case "end":
4787
- return _context.stop();
4830
+ return _context2.stop();
4788
4831
  }
4789
- }, _callee, null, [[2, 4, 5, 6]]);
4832
+ }, _callee2, null, [[2, 4, 5, 6]]);
4790
4833
  }));
4791
4834
  return function (_x) {
4792
- return _ref2.apply(this, arguments);
4835
+ return _ref3.apply(this, arguments);
4793
4836
  };
4794
4837
  }(), []);
4795
4838
 
@@ -4868,12 +4911,27 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
4868
4911
  })]
4869
4912
  });
4870
4913
  } else if (packages.length === 0) {
4871
- listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
4872
- className: "px-4 py-8 text-center",
4873
- children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
4914
+ listBody = /*#__PURE__*/jsxRuntime.jsxs("div", {
4915
+ className: "px-4 py-8 text-center space-y-3",
4916
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
4874
4917
  className: "text-sm opacity-50",
4875
4918
  children: searchQuery ? "No dashboards match your search." : "No dashboard packages available."
4876
- })
4919
+ }), registryAuthed === false && /*#__PURE__*/jsxRuntime.jsxs("div", {
4920
+ className: "inline-flex flex-col items-center gap-2 px-4 py-3 rounded-lg bg-amber-900/15 border border-amber-700/30",
4921
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
4922
+ className: "text-xs text-amber-200",
4923
+ children: "Sign in to the registry to see your private dashboards."
4924
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
4925
+ title: "Sign in to Registry",
4926
+ bgColor: "bg-indigo-600",
4927
+ hoverBackgroundColor: "hover:bg-indigo-500",
4928
+ textSize: "text-sm",
4929
+ padding: "py-1 px-3",
4930
+ onClick: function onClick() {
4931
+ return setShowAuthFromEmpty(true);
4932
+ }
4933
+ })]
4934
+ })]
4877
4935
  });
4878
4936
  } else {
4879
4937
  listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -4923,6 +4981,18 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
4923
4981
  }), !isLoading && !error && packages.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
4924
4982
  className: "flex-shrink-0 px-4 py-2 text-[10px] opacity-40 border-t border-white/10",
4925
4983
  children: [packages.length, " dashboard", packages.length !== 1 ? "s" : ""]
4984
+ }), /*#__PURE__*/jsxRuntime.jsx(RegistryAuthModal, {
4985
+ isOpen: showAuthFromEmpty,
4986
+ setIsOpen: setShowAuthFromEmpty,
4987
+ onAuthenticated: function onAuthenticated() {
4988
+ setShowAuthFromEmpty(false);
4989
+ setRegistryAuthed(true);
4990
+ search(searchQuery);
4991
+ },
4992
+ onCancel: function onCancel() {
4993
+ return setShowAuthFromEmpty(false);
4994
+ },
4995
+ message: "Sign in to see your private dashboards and install ones you've published."
4926
4996
  })]
4927
4997
  });
4928
4998
  };
@@ -6177,7 +6247,10 @@ var useRegistrySearch = function useRegistrySearch() {
6177
6247
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
6178
6248
  _ref$filterByCapabili = _ref.filterByCapabilities,
6179
6249
  filterByCapabilities = _ref$filterByCapabili === void 0 ? true : _ref$filterByCapabili;
6180
- var _useState = React.useState(false),
6250
+ // Start in the loading state so consumers don't briefly render an
6251
+ // empty-list state during the initial debounce window before the first
6252
+ // search fires.
6253
+ var _useState = React.useState(true),
6181
6254
  _useState2 = _slicedToArray(_useState, 2),
6182
6255
  isLoading = _useState2[0],
6183
6256
  setIsLoading = _useState2[1];
@@ -38235,7 +38308,9 @@ var DiscoverThemesDetail = function DiscoverThemesDetail(_ref) {
38235
38308
  _useState2 = _slicedToArray(_useState, 2),
38236
38309
  packages = _useState2[0],
38237
38310
  setPackages = _useState2[1];
38238
- var _useState3 = React.useState(false),
38311
+ // Start loading so the empty state with sign-in nudge doesn't flash
38312
+ // before the first fetch resolves.
38313
+ var _useState3 = React.useState(true),
38239
38314
  _useState4 = _slicedToArray(_useState3, 2),
38240
38315
  isLoading = _useState4[0],
38241
38316
  setIsLoading = _useState4[1];
@@ -38251,47 +38326,86 @@ var DiscoverThemesDetail = function DiscoverThemesDetail(_ref) {
38251
38326
  _useState0 = _slicedToArray(_useState9, 2),
38252
38327
  selectedPackageName = _useState0[0],
38253
38328
  setSelectedPackageName = _useState0[1];
38254
- var search = React.useCallback(/*#__PURE__*/function () {
38255
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(query) {
38256
- var _window$mainApi;
38257
- var result, _t;
38329
+
38330
+ // Auth state for the empty-state hint.
38331
+ var _useState1 = React.useState(null),
38332
+ _useState10 = _slicedToArray(_useState1, 2),
38333
+ registryAuthed = _useState10[0],
38334
+ setRegistryAuthed = _useState10[1];
38335
+ var _useState11 = React.useState(false),
38336
+ _useState12 = _slicedToArray(_useState11, 2),
38337
+ showAuthFromEmpty = _useState12[0],
38338
+ setShowAuthFromEmpty = _useState12[1];
38339
+ React.useEffect(function () {
38340
+ var cancelled = false;
38341
+ _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38342
+ var _window$mainApi, status;
38258
38343
  return _regeneratorRuntime.wrap(function (_context) {
38259
38344
  while (1) switch (_context.prev = _context.next) {
38260
38345
  case 0:
38261
- if ((_window$mainApi = window.mainApi) !== null && _window$mainApi !== void 0 && (_window$mainApi = _window$mainApi.registry) !== null && _window$mainApi !== void 0 && _window$mainApi.searchThemes) {
38262
- _context.next = 1;
38346
+ _context.prev = 0;
38347
+ _context.next = 1;
38348
+ return (_window$mainApi = window.mainApi) === null || _window$mainApi === void 0 || (_window$mainApi = _window$mainApi.registryAuth) === null || _window$mainApi === void 0 ? void 0 : _window$mainApi.getStatus();
38349
+ case 1:
38350
+ status = _context.sent;
38351
+ if (!cancelled) setRegistryAuthed(!!(status !== null && status !== void 0 && status.authenticated));
38352
+ _context.next = 3;
38353
+ break;
38354
+ case 2:
38355
+ _context.prev = 2;
38356
+ _context["catch"](0);
38357
+ if (!cancelled) setRegistryAuthed(false);
38358
+ case 3:
38359
+ case "end":
38360
+ return _context.stop();
38361
+ }
38362
+ }, _callee, null, [[0, 2]]);
38363
+ }))();
38364
+ return function () {
38365
+ cancelled = true;
38366
+ };
38367
+ }, [showAuthFromEmpty]);
38368
+ var search = React.useCallback(/*#__PURE__*/function () {
38369
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(query) {
38370
+ var _window$mainApi2;
38371
+ var result, _t2;
38372
+ return _regeneratorRuntime.wrap(function (_context2) {
38373
+ while (1) switch (_context2.prev = _context2.next) {
38374
+ case 0:
38375
+ if ((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && (_window$mainApi2 = _window$mainApi2.registry) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.searchThemes) {
38376
+ _context2.next = 1;
38263
38377
  break;
38264
38378
  }
38265
38379
  setPackages([]);
38266
- return _context.abrupt("return");
38380
+ return _context2.abrupt("return");
38267
38381
  case 1:
38268
38382
  setIsLoading(true);
38269
38383
  setError(null);
38270
- _context.prev = 2;
38271
- _context.next = 3;
38384
+ _context2.prev = 2;
38385
+ _context2.next = 3;
38272
38386
  return window.mainApi.registry.searchThemes(query || "", {});
38273
38387
  case 3:
38274
- result = _context.sent;
38388
+ result = _context2.sent;
38275
38389
  setPackages((result === null || result === void 0 ? void 0 : result.packages) || []);
38276
- _context.next = 5;
38390
+ _context2.next = 5;
38277
38391
  break;
38278
38392
  case 4:
38279
- _context.prev = 4;
38280
- _t = _context["catch"](2);
38281
- setError(_t.message || "Failed to search theme registry");
38393
+ _context2.prev = 4;
38394
+ _t2 = _context2["catch"](2);
38395
+ setError(_t2.message || "Failed to search theme registry");
38282
38396
  setPackages([]);
38283
38397
  case 5:
38284
- _context.prev = 5;
38398
+ _context2.prev = 5;
38285
38399
  setIsLoading(false);
38286
- return _context.finish(5);
38400
+ return _context2.finish(5);
38287
38401
  case 6:
38288
38402
  case "end":
38289
- return _context.stop();
38403
+ return _context2.stop();
38290
38404
  }
38291
- }, _callee, null, [[2, 4, 5, 6]]);
38405
+ }, _callee2, null, [[2, 4, 5, 6]]);
38292
38406
  }));
38293
38407
  return function (_x) {
38294
- return _ref2.apply(this, arguments);
38408
+ return _ref3.apply(this, arguments);
38295
38409
  };
38296
38410
  }(), []);
38297
38411
 
@@ -38370,12 +38484,27 @@ var DiscoverThemesDetail = function DiscoverThemesDetail(_ref) {
38370
38484
  })]
38371
38485
  });
38372
38486
  } else if (packages.length === 0) {
38373
- listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
38374
- className: "px-4 py-8 text-center",
38375
- children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
38487
+ listBody = /*#__PURE__*/jsxRuntime.jsxs("div", {
38488
+ className: "px-4 py-8 text-center space-y-3",
38489
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
38376
38490
  className: "text-sm opacity-50",
38377
38491
  children: searchQuery ? "No themes match your search." : "No theme packages available."
38378
- })
38492
+ }), registryAuthed === false && /*#__PURE__*/jsxRuntime.jsxs("div", {
38493
+ className: "inline-flex flex-col items-center gap-2 px-4 py-3 rounded-lg bg-amber-900/15 border border-amber-700/30",
38494
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
38495
+ className: "text-xs text-amber-200",
38496
+ children: "Sign in to the registry to see your private themes."
38497
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
38498
+ title: "Sign in to Registry",
38499
+ bgColor: "bg-indigo-600",
38500
+ hoverBackgroundColor: "hover:bg-indigo-500",
38501
+ textSize: "text-sm",
38502
+ padding: "py-1 px-3",
38503
+ onClick: function onClick() {
38504
+ return setShowAuthFromEmpty(true);
38505
+ }
38506
+ })]
38507
+ })]
38379
38508
  });
38380
38509
  } else {
38381
38510
  listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38427,6 +38556,18 @@ var DiscoverThemesDetail = function DiscoverThemesDetail(_ref) {
38427
38556
  }), !isLoading && !error && packages.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
38428
38557
  className: "flex-shrink-0 px-4 py-2 text-[10px] opacity-40 border-t border-white/10",
38429
38558
  children: [packages.length, " theme", packages.length !== 1 ? "s" : ""]
38559
+ }), /*#__PURE__*/jsxRuntime.jsx(RegistryAuthModal, {
38560
+ isOpen: showAuthFromEmpty,
38561
+ setIsOpen: setShowAuthFromEmpty,
38562
+ onAuthenticated: function onAuthenticated() {
38563
+ setShowAuthFromEmpty(false);
38564
+ setRegistryAuthed(true);
38565
+ search(searchQuery);
38566
+ },
38567
+ onCancel: function onCancel() {
38568
+ return setShowAuthFromEmpty(false);
38569
+ },
38570
+ message: "Sign in to see your private themes and install ones you've published."
38430
38571
  })]
38431
38572
  });
38432
38573
  };
@@ -46936,37 +47077,78 @@ var DiscoverWidgetsDetail = function DiscoverWidgetsDetail(_ref) {
46936
47077
  toolConflictWarning = _useState4[0],
46937
47078
  setToolConflictWarning = _useState4[1];
46938
47079
 
46939
- // Install progress modal state
46940
- var _useState5 = React.useState(false),
47080
+ // Auth state used to nudge unauthenticated users toward signing in
47081
+ // when the empty state appears (so they realize private packages are
47082
+ // hidden behind auth).
47083
+ var _useState5 = React.useState(null),
46941
47084
  _useState6 = _slicedToArray(_useState5, 2),
46942
- showProgressModal = _useState6[0],
46943
- setShowProgressModal = _useState6[1];
46944
- var _useState7 = React.useState([]),
47085
+ registryAuthed = _useState6[0],
47086
+ setRegistryAuthed = _useState6[1];
47087
+ var _useState7 = React.useState(false),
46945
47088
  _useState8 = _slicedToArray(_useState7, 2),
46946
- progressWidgets = _useState8[0],
46947
- setProgressWidgets = _useState8[1];
47089
+ showAuthFromEmpty = _useState8[0],
47090
+ setShowAuthFromEmpty = _useState8[1];
47091
+ React.useEffect(function () {
47092
+ var cancelled = false;
47093
+ _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
47094
+ var _window$mainApi, status;
47095
+ return _regeneratorRuntime.wrap(function (_context) {
47096
+ while (1) switch (_context.prev = _context.next) {
47097
+ case 0:
47098
+ _context.prev = 0;
47099
+ _context.next = 1;
47100
+ return (_window$mainApi = window.mainApi) === null || _window$mainApi === void 0 || (_window$mainApi = _window$mainApi.registryAuth) === null || _window$mainApi === void 0 ? void 0 : _window$mainApi.getStatus();
47101
+ case 1:
47102
+ status = _context.sent;
47103
+ if (!cancelled) setRegistryAuthed(!!(status !== null && status !== void 0 && status.authenticated));
47104
+ _context.next = 3;
47105
+ break;
47106
+ case 2:
47107
+ _context.prev = 2;
47108
+ _context["catch"](0);
47109
+ if (!cancelled) setRegistryAuthed(false);
47110
+ case 3:
47111
+ case "end":
47112
+ return _context.stop();
47113
+ }
47114
+ }, _callee, null, [[0, 2]]);
47115
+ }))();
47116
+ return function () {
47117
+ cancelled = true;
47118
+ };
47119
+ }, [needsAuth, showAuthFromEmpty]);
47120
+
47121
+ // Install progress modal state
46948
47122
  var _useState9 = React.useState(false),
46949
47123
  _useState0 = _slicedToArray(_useState9, 2),
46950
- progressComplete = _useState0[0],
46951
- setProgressComplete = _useState0[1];
47124
+ showProgressModal = _useState0[0],
47125
+ setShowProgressModal = _useState0[1];
47126
+ var _useState1 = React.useState([]),
47127
+ _useState10 = _slicedToArray(_useState1, 2),
47128
+ progressWidgets = _useState10[0],
47129
+ setProgressWidgets = _useState10[1];
47130
+ var _useState11 = React.useState(false),
47131
+ _useState12 = _slicedToArray(_useState11, 2),
47132
+ progressComplete = _useState12[0],
47133
+ setProgressComplete = _useState12[1];
46952
47134
  var installActiveRef = React.useRef(false);
46953
47135
  var pendingInstallRef = React.useRef(null);
46954
47136
 
46955
47137
  // Track installed package names (same pattern as WidgetSidebar)
46956
- var _useState1 = React.useState(new Set()),
46957
- _useState10 = _slicedToArray(_useState1, 2),
46958
- installedPackageNames = _useState10[0],
46959
- setInstalledPackageNames = _useState10[1];
46960
- var loadInstalledPackages = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
47138
+ var _useState13 = React.useState(new Set()),
47139
+ _useState14 = _slicedToArray(_useState13, 2),
47140
+ installedPackageNames = _useState14[0],
47141
+ setInstalledPackageNames = _useState14[1];
47142
+ var loadInstalledPackages = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
46961
47143
  var widgets, names, _iterator, _step, w, folderName, _folderName;
46962
- return _regeneratorRuntime.wrap(function (_context) {
46963
- while (1) switch (_context.prev = _context.next) {
47144
+ return _regeneratorRuntime.wrap(function (_context2) {
47145
+ while (1) switch (_context2.prev = _context2.next) {
46964
47146
  case 0:
46965
- _context.prev = 0;
46966
- _context.next = 1;
47147
+ _context2.prev = 0;
47148
+ _context2.next = 1;
46967
47149
  return window.mainApi.widgets.list();
46968
47150
  case 1:
46969
- widgets = _context.sent;
47151
+ widgets = _context2.sent;
46970
47152
  names = new Set();
46971
47153
  _iterator = _createForOfIteratorHelper$7(widgets);
46972
47154
  try {
@@ -46991,16 +47173,16 @@ var DiscoverWidgetsDetail = function DiscoverWidgetsDetail(_ref) {
46991
47173
  _iterator.f();
46992
47174
  }
46993
47175
  setInstalledPackageNames(names);
46994
- _context.next = 3;
47176
+ _context2.next = 3;
46995
47177
  break;
46996
47178
  case 2:
46997
- _context.prev = 2;
46998
- _context["catch"](0);
47179
+ _context2.prev = 2;
47180
+ _context2["catch"](0);
46999
47181
  case 3:
47000
47182
  case "end":
47001
- return _context.stop();
47183
+ return _context2.stop();
47002
47184
  }
47003
- }, _callee, null, [[0, 2]]);
47185
+ }, _callee2, null, [[0, 2]]);
47004
47186
  })), []);
47005
47187
  React.useEffect(function () {
47006
47188
  loadInstalledPackages();
@@ -47087,9 +47269,9 @@ var DiscoverWidgetsDetail = function DiscoverWidgetsDetail(_ref) {
47087
47269
  var p = _step3.value;
47088
47270
  if (!((_p$requiredTools = p.requiredTools) !== null && _p$requiredTools !== void 0 && _p$requiredTools.length) || p.providerClass !== "mcp") return 1; // continue
47089
47271
  // Find matching user provider
47090
- var matchingProviders = Object.entries(providers).filter(function (_ref3) {
47091
- var _ref4 = _slicedToArray(_ref3, 2),
47092
- prov = _ref4[1];
47272
+ var matchingProviders = Object.entries(providers).filter(function (_ref4) {
47273
+ var _ref5 = _slicedToArray(_ref4, 2),
47274
+ prov = _ref5[1];
47093
47275
  return prov.type === p.type && prov.providerClass === "mcp" && prov.allowedTools;
47094
47276
  });
47095
47277
  var _iterator4 = _createForOfIteratorHelper$7(matchingProviders),
@@ -47230,6 +47412,20 @@ var DiscoverWidgetsDetail = function DiscoverWidgetsDetail(_ref) {
47230
47412
  },
47231
47413
  onCancel: clearNeedsAuth,
47232
47414
  message: "Sign in to install this widget from the Dash Registry."
47415
+ }), /*#__PURE__*/jsxRuntime.jsx(RegistryAuthModal, {
47416
+ isOpen: showAuthFromEmpty,
47417
+ setIsOpen: setShowAuthFromEmpty,
47418
+ onAuthenticated: function onAuthenticated() {
47419
+ setShowAuthFromEmpty(false);
47420
+ setRegistryAuthed(true);
47421
+ // Trigger a refresh of the list now that the user can see
47422
+ // their private packages.
47423
+ retry();
47424
+ },
47425
+ onCancel: function onCancel() {
47426
+ return setShowAuthFromEmpty(false);
47427
+ },
47428
+ message: "Sign in to see your private packages and install widgets you've published."
47233
47429
  })]
47234
47430
  });
47235
47431
  }
@@ -47265,12 +47461,27 @@ var DiscoverWidgetsDetail = function DiscoverWidgetsDetail(_ref) {
47265
47461
  })]
47266
47462
  });
47267
47463
  } else if (packages.length === 0) {
47268
- listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
47269
- className: "px-4 py-8 text-center",
47270
- children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
47464
+ listBody = /*#__PURE__*/jsxRuntime.jsxs("div", {
47465
+ className: "px-4 py-8 text-center space-y-3",
47466
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
47271
47467
  className: "text-sm opacity-50",
47272
47468
  children: searchQuery ? "No packages match your search." : "No packages available."
47273
- })
47469
+ }), registryAuthed === false && /*#__PURE__*/jsxRuntime.jsxs("div", {
47470
+ className: "inline-flex flex-col items-center gap-2 px-4 py-3 rounded-lg bg-amber-900/15 border border-amber-700/30",
47471
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
47472
+ className: "text-xs text-amber-200",
47473
+ children: "Sign in to the registry to see your private packages."
47474
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
47475
+ title: "Sign in to Registry",
47476
+ bgColor: "bg-indigo-600",
47477
+ hoverBackgroundColor: "hover:bg-indigo-500",
47478
+ textSize: "text-sm",
47479
+ padding: "py-1 px-3",
47480
+ onClick: function onClick() {
47481
+ return setShowAuthFromEmpty(true);
47482
+ }
47483
+ })]
47484
+ })]
47274
47485
  });
47275
47486
  } else {
47276
47487
  listBody = /*#__PURE__*/jsxRuntime.jsx("div", {