@trops/dash-core 0.1.373 → 0.1.375

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
@@ -4720,6 +4720,31 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4720
4720
  });
4721
4721
  };
4722
4722
 
4723
+ function RegistrySignInBanner(_ref) {
4724
+ var visible = _ref.visible,
4725
+ onSignIn = _ref.onSignIn,
4726
+ _ref$noun = _ref.noun,
4727
+ noun = _ref$noun === void 0 ? "package" : _ref$noun;
4728
+ if (!visible) return null;
4729
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
4730
+ className: "flex-shrink-0 mx-4 mb-2 px-3 py-2 rounded-lg bg-amber-900/15 border border-amber-700/30 flex items-center gap-3",
4731
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
4732
+ className: "flex-1 min-w-0",
4733
+ children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.Paragraph, {
4734
+ className: "text-xs text-amber-200 leading-snug",
4735
+ children: ["Sign in to the registry to also see your private ", noun, "s and ones granted to you."]
4736
+ })
4737
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
4738
+ title: "Sign in",
4739
+ bgColor: "bg-indigo-600",
4740
+ hoverBackgroundColor: "hover:bg-indigo-500",
4741
+ textSize: "text-xs",
4742
+ padding: "py-1 px-3",
4743
+ onClick: onSignIn
4744
+ })]
4745
+ });
4746
+ }
4747
+
4723
4748
  var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
4724
4749
  var onBack = _ref.onBack,
4725
4750
  appId = _ref.appId,
@@ -4911,27 +4936,12 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
4911
4936
  })]
4912
4937
  });
4913
4938
  } else if (packages.length === 0) {
4914
- listBody = /*#__PURE__*/jsxRuntime.jsxs("div", {
4915
- className: "px-4 py-8 text-center space-y-3",
4916
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
4939
+ listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
4940
+ className: "px-4 py-8 text-center",
4941
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
4917
4942
  className: "text-sm opacity-50",
4918
4943
  children: searchQuery ? "No dashboards match your search." : "No dashboard packages available."
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
- })]
4944
+ })
4935
4945
  });
4936
4946
  } else {
4937
4947
  listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -4975,6 +4985,12 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
4975
4985
  placeholder: "Search dashboards...",
4976
4986
  inputClassName: "py-1.5 text-xs"
4977
4987
  })
4988
+ }), /*#__PURE__*/jsxRuntime.jsx(RegistrySignInBanner, {
4989
+ visible: registryAuthed === false,
4990
+ onSignIn: function onSignIn() {
4991
+ return setShowAuthFromEmpty(true);
4992
+ },
4993
+ noun: "dashboard"
4978
4994
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
4979
4995
  className: "flex-1 min-h-0 overflow-y-auto px-2",
4980
4996
  children: listBody
@@ -4984,11 +5000,32 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
4984
5000
  }), /*#__PURE__*/jsxRuntime.jsx(RegistryAuthModal, {
4985
5001
  isOpen: showAuthFromEmpty,
4986
5002
  setIsOpen: setShowAuthFromEmpty,
4987
- onAuthenticated: function onAuthenticated() {
4988
- setShowAuthFromEmpty(false);
4989
- setRegistryAuthed(true);
4990
- search(searchQuery);
4991
- },
5003
+ onAuthenticated: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
5004
+ var _window$mainApi3, _window$mainApi3$fetc;
5005
+ return _regeneratorRuntime.wrap(function (_context3) {
5006
+ while (1) switch (_context3.prev = _context3.next) {
5007
+ case 0:
5008
+ setShowAuthFromEmpty(false);
5009
+ setRegistryAuthed(true);
5010
+ // Force-refresh the cached registry index so the now-
5011
+ // authenticated user immediately sees their private packages.
5012
+ _context3.prev = 1;
5013
+ _context3.next = 2;
5014
+ return (_window$mainApi3 = window.mainApi) === null || _window$mainApi3 === void 0 || (_window$mainApi3 = _window$mainApi3.registry) === null || _window$mainApi3 === void 0 || (_window$mainApi3$fetc = _window$mainApi3.fetchIndex) === null || _window$mainApi3$fetc === void 0 ? void 0 : _window$mainApi3$fetc.call(_window$mainApi3, true);
5015
+ case 2:
5016
+ _context3.next = 4;
5017
+ break;
5018
+ case 3:
5019
+ _context3.prev = 3;
5020
+ _context3["catch"](1);
5021
+ case 4:
5022
+ search(searchQuery);
5023
+ case 5:
5024
+ case "end":
5025
+ return _context3.stop();
5026
+ }
5027
+ }, _callee3, null, [[1, 3]]);
5028
+ })),
4992
5029
  onCancel: function onCancel() {
4993
5030
  return setShowAuthFromEmpty(false);
4994
5031
  },
@@ -38484,27 +38521,12 @@ var DiscoverThemesDetail = function DiscoverThemesDetail(_ref) {
38484
38521
  })]
38485
38522
  });
38486
38523
  } else if (packages.length === 0) {
38487
- listBody = /*#__PURE__*/jsxRuntime.jsxs("div", {
38488
- className: "px-4 py-8 text-center space-y-3",
38489
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
38524
+ listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
38525
+ className: "px-4 py-8 text-center",
38526
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
38490
38527
  className: "text-sm opacity-50",
38491
38528
  children: searchQuery ? "No themes match your search." : "No theme packages available."
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
- })]
38529
+ })
38508
38530
  });
38509
38531
  } else {
38510
38532
  listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38550,6 +38572,12 @@ var DiscoverThemesDetail = function DiscoverThemesDetail(_ref) {
38550
38572
  placeholder: "Search themes...",
38551
38573
  inputClassName: "py-1.5 text-xs"
38552
38574
  })
38575
+ }), /*#__PURE__*/jsxRuntime.jsx(RegistrySignInBanner, {
38576
+ visible: registryAuthed === false,
38577
+ onSignIn: function onSignIn() {
38578
+ return setShowAuthFromEmpty(true);
38579
+ },
38580
+ noun: "theme"
38553
38581
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
38554
38582
  className: "flex-1 min-h-0 overflow-y-auto px-2",
38555
38583
  children: listBody
@@ -38559,11 +38587,32 @@ var DiscoverThemesDetail = function DiscoverThemesDetail(_ref) {
38559
38587
  }), /*#__PURE__*/jsxRuntime.jsx(RegistryAuthModal, {
38560
38588
  isOpen: showAuthFromEmpty,
38561
38589
  setIsOpen: setShowAuthFromEmpty,
38562
- onAuthenticated: function onAuthenticated() {
38563
- setShowAuthFromEmpty(false);
38564
- setRegistryAuthed(true);
38565
- search(searchQuery);
38566
- },
38590
+ onAuthenticated: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
38591
+ var _window$mainApi3, _window$mainApi3$fetc;
38592
+ return _regeneratorRuntime.wrap(function (_context3) {
38593
+ while (1) switch (_context3.prev = _context3.next) {
38594
+ case 0:
38595
+ setShowAuthFromEmpty(false);
38596
+ setRegistryAuthed(true);
38597
+ // Force-refresh the cached registry index so the now-
38598
+ // authenticated user immediately sees their private packages.
38599
+ _context3.prev = 1;
38600
+ _context3.next = 2;
38601
+ return (_window$mainApi3 = window.mainApi) === null || _window$mainApi3 === void 0 || (_window$mainApi3 = _window$mainApi3.registry) === null || _window$mainApi3 === void 0 || (_window$mainApi3$fetc = _window$mainApi3.fetchIndex) === null || _window$mainApi3$fetc === void 0 ? void 0 : _window$mainApi3$fetc.call(_window$mainApi3, true);
38602
+ case 2:
38603
+ _context3.next = 4;
38604
+ break;
38605
+ case 3:
38606
+ _context3.prev = 3;
38607
+ _context3["catch"](1);
38608
+ case 4:
38609
+ search(searchQuery);
38610
+ case 5:
38611
+ case "end":
38612
+ return _context3.stop();
38613
+ }
38614
+ }, _callee3, null, [[1, 3]]);
38615
+ })),
38567
38616
  onCancel: function onCancel() {
38568
38617
  return setShowAuthFromEmpty(false);
38569
38618
  },
@@ -47461,27 +47510,12 @@ var DiscoverWidgetsDetail = function DiscoverWidgetsDetail(_ref) {
47461
47510
  })]
47462
47511
  });
47463
47512
  } else if (packages.length === 0) {
47464
- listBody = /*#__PURE__*/jsxRuntime.jsxs("div", {
47465
- className: "px-4 py-8 text-center space-y-3",
47466
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
47513
+ listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
47514
+ className: "px-4 py-8 text-center",
47515
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Paragraph, {
47467
47516
  className: "text-sm opacity-50",
47468
47517
  children: searchQuery ? "No packages match your search." : "No packages available."
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
- })]
47518
+ })
47485
47519
  });
47486
47520
  } else {
47487
47521
  listBody = /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -47548,6 +47582,12 @@ var DiscoverWidgetsDetail = function DiscoverWidgetsDetail(_ref) {
47548
47582
  className: "rounded"
47549
47583
  }), "Show all packages"]
47550
47584
  })]
47585
+ }), /*#__PURE__*/jsxRuntime.jsx(RegistrySignInBanner, {
47586
+ visible: registryAuthed === false,
47587
+ onSignIn: function onSignIn() {
47588
+ return setShowAuthFromEmpty(true);
47589
+ },
47590
+ noun: "widget"
47551
47591
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
47552
47592
  className: "flex-1 min-h-0 overflow-y-auto px-2",
47553
47593
  children: listBody
@@ -47568,6 +47608,40 @@ var DiscoverWidgetsDetail = function DiscoverWidgetsDetail(_ref) {
47568
47608
  onCancel: function onCancel() {
47569
47609
  return setToolConflictWarning(null);
47570
47610
  }
47611
+ }), /*#__PURE__*/jsxRuntime.jsx(RegistryAuthModal, {
47612
+ isOpen: showAuthFromEmpty,
47613
+ setIsOpen: setShowAuthFromEmpty,
47614
+ onAuthenticated: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
47615
+ var _window$mainApi2, _window$mainApi2$fetc;
47616
+ return _regeneratorRuntime.wrap(function (_context3) {
47617
+ while (1) switch (_context3.prev = _context3.next) {
47618
+ case 0:
47619
+ setShowAuthFromEmpty(false);
47620
+ setRegistryAuthed(true);
47621
+ // Force-refresh the cached registry index so the now-
47622
+ // authenticated user immediately sees their private packages
47623
+ // (the previous anon-cache fetch otherwise lingers for 5 min).
47624
+ _context3.prev = 1;
47625
+ _context3.next = 2;
47626
+ return (_window$mainApi2 = window.mainApi) === null || _window$mainApi2 === void 0 || (_window$mainApi2 = _window$mainApi2.registry) === null || _window$mainApi2 === void 0 || (_window$mainApi2$fetc = _window$mainApi2.fetchIndex) === null || _window$mainApi2$fetc === void 0 ? void 0 : _window$mainApi2$fetc.call(_window$mainApi2, true);
47627
+ case 2:
47628
+ _context3.next = 4;
47629
+ break;
47630
+ case 3:
47631
+ _context3.prev = 3;
47632
+ _context3["catch"](1);
47633
+ case 4:
47634
+ retry();
47635
+ case 5:
47636
+ case "end":
47637
+ return _context3.stop();
47638
+ }
47639
+ }, _callee3, null, [[1, 3]]);
47640
+ })),
47641
+ onCancel: function onCancel() {
47642
+ return setShowAuthFromEmpty(false);
47643
+ },
47644
+ message: "Sign in to see your private widgets and ones granted to you."
47571
47645
  })]
47572
47646
  });
47573
47647
  };