@trops/dash-core 0.1.99 → 0.1.102

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
@@ -30648,38 +30648,42 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30648
30648
  _useState0 = _slicedToArray(_useState9, 2),
30649
30649
  isPolling = _useState0[0],
30650
30650
  setIsPolling = _useState0[1];
30651
+ var _useState1 = React.useState(null),
30652
+ _useState10 = _slicedToArray(_useState1, 2),
30653
+ authError = _useState10[0],
30654
+ setAuthError = _useState10[1];
30651
30655
 
30652
30656
  // Step 1: Details
30653
- var _useState1 = React.useState(""),
30654
- _useState10 = _slicedToArray(_useState1, 2),
30655
- authorName = _useState10[0],
30656
- setAuthorName = _useState10[1];
30657
30657
  var _useState11 = React.useState(""),
30658
30658
  _useState12 = _slicedToArray(_useState11, 2),
30659
- description = _useState12[0],
30660
- setDescription = _useState12[1];
30659
+ authorName = _useState12[0],
30660
+ setAuthorName = _useState12[1];
30661
+ var _useState13 = React.useState(""),
30662
+ _useState14 = _slicedToArray(_useState13, 2),
30663
+ description = _useState14[0],
30664
+ setDescription = _useState14[1];
30661
30665
 
30662
30666
  // Step 2: Tags
30663
- var _useState13 = React.useState([]),
30664
- _useState14 = _slicedToArray(_useState13, 2),
30665
- selectedTags = _useState14[0],
30666
- setSelectedTags = _useState14[1];
30667
+ var _useState15 = React.useState([]),
30668
+ _useState16 = _slicedToArray(_useState15, 2),
30669
+ selectedTags = _useState16[0],
30670
+ setSelectedTags = _useState16[1];
30667
30671
 
30668
30672
  // Step 3: Icon
30669
- var _useState15 = React.useState("grip"),
30670
- _useState16 = _slicedToArray(_useState15, 2),
30671
- icon = _useState16[0],
30672
- setIcon = _useState16[1];
30673
+ var _useState17 = React.useState("grip"),
30674
+ _useState18 = _slicedToArray(_useState17, 2),
30675
+ icon = _useState18[0],
30676
+ setIcon = _useState18[1];
30673
30677
 
30674
30678
  // Step 4: Publish
30675
- var _useState17 = React.useState(false),
30676
- _useState18 = _slicedToArray(_useState17, 2),
30677
- isPublishing = _useState18[0],
30678
- setIsPublishing = _useState18[1];
30679
- var _useState19 = React.useState(null),
30679
+ var _useState19 = React.useState(false),
30680
30680
  _useState20 = _slicedToArray(_useState19, 2),
30681
- result = _useState20[0],
30682
- setResult = _useState20[1];
30681
+ isPublishing = _useState20[0],
30682
+ setIsPublishing = _useState20[1];
30683
+ var _useState21 = React.useState(null),
30684
+ _useState22 = _slicedToArray(_useState21, 2),
30685
+ result = _useState22[0],
30686
+ setResult = _useState22[1];
30683
30687
 
30684
30688
  // Check auth status on mount
30685
30689
  React.useEffect(function () {
@@ -30719,10 +30723,15 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30719
30723
  }
30720
30724
  return _context.abrupt("return");
30721
30725
  case 4:
30722
- setProfile(userProfile);
30723
- setAuthStatus("authenticated");
30724
- if (userProfile !== null && userProfile !== void 0 && userProfile.displayName && !authorName) {
30725
- setAuthorName(userProfile.displayName);
30726
+ if (userProfile) {
30727
+ setProfile(userProfile);
30728
+ setAuthStatus("authenticated");
30729
+ if (userProfile.displayName && !authorName) {
30730
+ setAuthorName(userProfile.displayName);
30731
+ }
30732
+ } else {
30733
+ // Token expired or invalid — treat as unauthenticated
30734
+ setAuthStatus("unauthenticated");
30726
30735
  }
30727
30736
  _context.next = 6;
30728
30737
  break;
@@ -30754,6 +30763,7 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30754
30763
  setProfile(null);
30755
30764
  setAuthFlow(null);
30756
30765
  setIsPolling(false);
30766
+ setAuthError(null);
30757
30767
  setAuthorName("");
30758
30768
  setDescription("");
30759
30769
  setSelectedTags([]);
@@ -30837,10 +30847,11 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30837
30847
  return _regeneratorRuntime.wrap(function (_context4) {
30838
30848
  while (1) switch (_context4.prev = _context4.next) {
30839
30849
  case 0:
30840
- _context4.prev = 0;
30841
- _context4.next = 1;
30850
+ setAuthError(null);
30851
+ _context4.prev = 1;
30852
+ _context4.next = 2;
30842
30853
  return window.mainApi.registryAuth.initiateLogin();
30843
- case 1:
30854
+ case 2:
30844
30855
  flow = _context4.sent;
30845
30856
  setAuthFlow(flow);
30846
30857
 
@@ -30901,16 +30912,17 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30901
30912
  }
30902
30913
  }, _callee3, null, [[0, 5]]);
30903
30914
  })), interval);
30904
- _context4.next = 3;
30915
+ _context4.next = 4;
30905
30916
  break;
30906
- case 2:
30907
- _context4.prev = 2;
30908
- _context4["catch"](0);
30909
30917
  case 3:
30918
+ _context4.prev = 3;
30919
+ _context4["catch"](1);
30920
+ setAuthError("Could not reach the registry. Check your connection and try again.");
30921
+ case 4:
30910
30922
  case "end":
30911
30923
  return _context4.stop();
30912
30924
  }
30913
- }, _callee4, null, [[0, 2]]);
30925
+ }, _callee4, null, [[1, 3]]);
30914
30926
  }));
30915
30927
  return _handleSignIn.apply(this, arguments);
30916
30928
  }
@@ -31018,11 +31030,25 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
31018
31030
  children: [/*#__PURE__*/jsxRuntime.jsx("p", {
31019
31031
  className: "text-sm opacity-70",
31020
31032
  children: "Sign in to the Dash Registry to publish your dashboard."
31021
- }), !authFlow && !isPolling && /*#__PURE__*/jsxRuntime.jsx("button", {
31022
- type: "button",
31023
- onClick: handleSignIn,
31024
- className: "px-4 py-2 rounded-lg text-sm bg-blue-500/20 border border-blue-500/30 text-blue-300 hover:bg-blue-500/30 transition-colors cursor-pointer",
31025
- children: "Sign in to Registry"
31033
+ }), !authFlow && !isPolling && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31034
+ children: [/*#__PURE__*/jsxRuntime.jsx("button", {
31035
+ type: "button",
31036
+ onClick: handleSignIn,
31037
+ className: "px-4 py-2 rounded-lg text-sm bg-blue-500/20 border border-blue-500/30 text-blue-300 hover:bg-blue-500/30 transition-colors cursor-pointer",
31038
+ children: "Sign in to Registry"
31039
+ }), authError && /*#__PURE__*/jsxRuntime.jsx("div", {
31040
+ className: "bg-red-500/10 border border-red-500/20 rounded-lg p-3",
31041
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31042
+ className: "flex items-start gap-2",
31043
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
31044
+ icon: "circle-xmark",
31045
+ className: "h-3.5 w-3.5 text-red-400 mt-0.5 flex-shrink-0"
31046
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
31047
+ className: "text-xs text-red-300/90",
31048
+ children: authError
31049
+ })]
31050
+ })
31051
+ })]
31026
31052
  }), authFlow && isPolling && /*#__PURE__*/jsxRuntime.jsxs("div", {
31027
31053
  className: "bg-blue-500/10 border border-blue-500/20 rounded-lg p-4 space-y-3",
31028
31054
  children: [/*#__PURE__*/jsxRuntime.jsx("p", {