@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.esm.js CHANGED
@@ -30629,38 +30629,42 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30629
30629
  _useState0 = _slicedToArray(_useState9, 2),
30630
30630
  isPolling = _useState0[0],
30631
30631
  setIsPolling = _useState0[1];
30632
+ var _useState1 = useState(null),
30633
+ _useState10 = _slicedToArray(_useState1, 2),
30634
+ authError = _useState10[0],
30635
+ setAuthError = _useState10[1];
30632
30636
 
30633
30637
  // Step 1: Details
30634
- var _useState1 = useState(""),
30635
- _useState10 = _slicedToArray(_useState1, 2),
30636
- authorName = _useState10[0],
30637
- setAuthorName = _useState10[1];
30638
30638
  var _useState11 = useState(""),
30639
30639
  _useState12 = _slicedToArray(_useState11, 2),
30640
- description = _useState12[0],
30641
- setDescription = _useState12[1];
30640
+ authorName = _useState12[0],
30641
+ setAuthorName = _useState12[1];
30642
+ var _useState13 = useState(""),
30643
+ _useState14 = _slicedToArray(_useState13, 2),
30644
+ description = _useState14[0],
30645
+ setDescription = _useState14[1];
30642
30646
 
30643
30647
  // Step 2: Tags
30644
- var _useState13 = useState([]),
30645
- _useState14 = _slicedToArray(_useState13, 2),
30646
- selectedTags = _useState14[0],
30647
- setSelectedTags = _useState14[1];
30648
+ var _useState15 = useState([]),
30649
+ _useState16 = _slicedToArray(_useState15, 2),
30650
+ selectedTags = _useState16[0],
30651
+ setSelectedTags = _useState16[1];
30648
30652
 
30649
30653
  // Step 3: Icon
30650
- var _useState15 = useState("grip"),
30651
- _useState16 = _slicedToArray(_useState15, 2),
30652
- icon = _useState16[0],
30653
- setIcon = _useState16[1];
30654
+ var _useState17 = useState("grip"),
30655
+ _useState18 = _slicedToArray(_useState17, 2),
30656
+ icon = _useState18[0],
30657
+ setIcon = _useState18[1];
30654
30658
 
30655
30659
  // Step 4: Publish
30656
- var _useState17 = useState(false),
30657
- _useState18 = _slicedToArray(_useState17, 2),
30658
- isPublishing = _useState18[0],
30659
- setIsPublishing = _useState18[1];
30660
- var _useState19 = useState(null),
30660
+ var _useState19 = useState(false),
30661
30661
  _useState20 = _slicedToArray(_useState19, 2),
30662
- result = _useState20[0],
30663
- setResult = _useState20[1];
30662
+ isPublishing = _useState20[0],
30663
+ setIsPublishing = _useState20[1];
30664
+ var _useState21 = useState(null),
30665
+ _useState22 = _slicedToArray(_useState21, 2),
30666
+ result = _useState22[0],
30667
+ setResult = _useState22[1];
30664
30668
 
30665
30669
  // Check auth status on mount
30666
30670
  useEffect(function () {
@@ -30700,10 +30704,15 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30700
30704
  }
30701
30705
  return _context.abrupt("return");
30702
30706
  case 4:
30703
- setProfile(userProfile);
30704
- setAuthStatus("authenticated");
30705
- if (userProfile !== null && userProfile !== void 0 && userProfile.displayName && !authorName) {
30706
- setAuthorName(userProfile.displayName);
30707
+ if (userProfile) {
30708
+ setProfile(userProfile);
30709
+ setAuthStatus("authenticated");
30710
+ if (userProfile.displayName && !authorName) {
30711
+ setAuthorName(userProfile.displayName);
30712
+ }
30713
+ } else {
30714
+ // Token expired or invalid — treat as unauthenticated
30715
+ setAuthStatus("unauthenticated");
30707
30716
  }
30708
30717
  _context.next = 6;
30709
30718
  break;
@@ -30735,6 +30744,7 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30735
30744
  setProfile(null);
30736
30745
  setAuthFlow(null);
30737
30746
  setIsPolling(false);
30747
+ setAuthError(null);
30738
30748
  setAuthorName("");
30739
30749
  setDescription("");
30740
30750
  setSelectedTags([]);
@@ -30818,10 +30828,11 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30818
30828
  return _regeneratorRuntime.wrap(function (_context4) {
30819
30829
  while (1) switch (_context4.prev = _context4.next) {
30820
30830
  case 0:
30821
- _context4.prev = 0;
30822
- _context4.next = 1;
30831
+ setAuthError(null);
30832
+ _context4.prev = 1;
30833
+ _context4.next = 2;
30823
30834
  return window.mainApi.registryAuth.initiateLogin();
30824
- case 1:
30835
+ case 2:
30825
30836
  flow = _context4.sent;
30826
30837
  setAuthFlow(flow);
30827
30838
 
@@ -30882,16 +30893,17 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30882
30893
  }
30883
30894
  }, _callee3, null, [[0, 5]]);
30884
30895
  })), interval);
30885
- _context4.next = 3;
30896
+ _context4.next = 4;
30886
30897
  break;
30887
- case 2:
30888
- _context4.prev = 2;
30889
- _context4["catch"](0);
30890
30898
  case 3:
30899
+ _context4.prev = 3;
30900
+ _context4["catch"](1);
30901
+ setAuthError("Could not reach the registry. Check your connection and try again.");
30902
+ case 4:
30891
30903
  case "end":
30892
30904
  return _context4.stop();
30893
30905
  }
30894
- }, _callee4, null, [[0, 2]]);
30906
+ }, _callee4, null, [[1, 3]]);
30895
30907
  }));
30896
30908
  return _handleSignIn.apply(this, arguments);
30897
30909
  }
@@ -30999,11 +31011,25 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30999
31011
  children: [/*#__PURE__*/jsx("p", {
31000
31012
  className: "text-sm opacity-70",
31001
31013
  children: "Sign in to the Dash Registry to publish your dashboard."
31002
- }), !authFlow && !isPolling && /*#__PURE__*/jsx("button", {
31003
- type: "button",
31004
- onClick: handleSignIn,
31005
- 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",
31006
- children: "Sign in to Registry"
31014
+ }), !authFlow && !isPolling && /*#__PURE__*/jsxs(Fragment, {
31015
+ children: [/*#__PURE__*/jsx("button", {
31016
+ type: "button",
31017
+ onClick: handleSignIn,
31018
+ 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",
31019
+ children: "Sign in to Registry"
31020
+ }), authError && /*#__PURE__*/jsx("div", {
31021
+ className: "bg-red-500/10 border border-red-500/20 rounded-lg p-3",
31022
+ children: /*#__PURE__*/jsxs("div", {
31023
+ className: "flex items-start gap-2",
31024
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
31025
+ icon: "circle-xmark",
31026
+ className: "h-3.5 w-3.5 text-red-400 mt-0.5 flex-shrink-0"
31027
+ }), /*#__PURE__*/jsx("span", {
31028
+ className: "text-xs text-red-300/90",
31029
+ children: authError
31030
+ })]
31031
+ })
31032
+ })]
31007
31033
  }), authFlow && isPolling && /*#__PURE__*/jsxs("div", {
31008
31034
  className: "bg-blue-500/10 border border-blue-500/20 rounded-lg p-4 space-y-3",
31009
31035
  children: [/*#__PURE__*/jsx("p", {