@trops/dash-core 0.1.101 → 0.1.103

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,13 @@ 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
+ setAuthorName(userProfile.displayName || userProfile.username || "");
30711
+ } else {
30712
+ // Token expired or invalid — treat as unauthenticated
30713
+ setAuthStatus("unauthenticated");
30707
30714
  }
30708
30715
  _context.next = 6;
30709
30716
  break;
@@ -30735,6 +30742,7 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30735
30742
  setProfile(null);
30736
30743
  setAuthFlow(null);
30737
30744
  setIsPolling(false);
30745
+ setAuthError(null);
30738
30746
  setAuthorName("");
30739
30747
  setDescription("");
30740
30748
  setSelectedTags([]);
@@ -30818,10 +30826,11 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30818
30826
  return _regeneratorRuntime.wrap(function (_context4) {
30819
30827
  while (1) switch (_context4.prev = _context4.next) {
30820
30828
  case 0:
30821
- _context4.prev = 0;
30822
- _context4.next = 1;
30829
+ setAuthError(null);
30830
+ _context4.prev = 1;
30831
+ _context4.next = 2;
30823
30832
  return window.mainApi.registryAuth.initiateLogin();
30824
- case 1:
30833
+ case 2:
30825
30834
  flow = _context4.sent;
30826
30835
  setAuthFlow(flow);
30827
30836
 
@@ -30882,16 +30891,17 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30882
30891
  }
30883
30892
  }, _callee3, null, [[0, 5]]);
30884
30893
  })), interval);
30885
- _context4.next = 3;
30894
+ _context4.next = 4;
30886
30895
  break;
30887
- case 2:
30888
- _context4.prev = 2;
30889
- _context4["catch"](0);
30890
30896
  case 3:
30897
+ _context4.prev = 3;
30898
+ _context4["catch"](1);
30899
+ setAuthError("Could not reach the registry. Check your connection and try again.");
30900
+ case 4:
30891
30901
  case "end":
30892
30902
  return _context4.stop();
30893
30903
  }
30894
- }, _callee4, null, [[0, 2]]);
30904
+ }, _callee4, null, [[1, 3]]);
30895
30905
  }));
30896
30906
  return _handleSignIn.apply(this, arguments);
30897
30907
  }
@@ -30999,11 +31009,25 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30999
31009
  children: [/*#__PURE__*/jsx("p", {
31000
31010
  className: "text-sm opacity-70",
31001
31011
  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"
31012
+ }), !authFlow && !isPolling && /*#__PURE__*/jsxs(Fragment, {
31013
+ children: [/*#__PURE__*/jsx("button", {
31014
+ type: "button",
31015
+ onClick: handleSignIn,
31016
+ 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",
31017
+ children: "Sign in to Registry"
31018
+ }), authError && /*#__PURE__*/jsx("div", {
31019
+ className: "bg-red-500/10 border border-red-500/20 rounded-lg p-3",
31020
+ children: /*#__PURE__*/jsxs("div", {
31021
+ className: "flex items-start gap-2",
31022
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
31023
+ icon: "circle-xmark",
31024
+ className: "h-3.5 w-3.5 text-red-400 mt-0.5 flex-shrink-0"
31025
+ }), /*#__PURE__*/jsx("span", {
31026
+ className: "text-xs text-red-300/90",
31027
+ children: authError
31028
+ })]
31029
+ })
31030
+ })]
31007
31031
  }), authFlow && isPolling && /*#__PURE__*/jsxs("div", {
31008
31032
  className: "bg-blue-500/10 border border-blue-500/20 rounded-lg p-4 space-y-3",
31009
31033
  children: [/*#__PURE__*/jsx("p", {
@@ -31029,11 +31053,14 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
31029
31053
  children: [/*#__PURE__*/jsx("p", {
31030
31054
  className: "text-sm opacity-70",
31031
31055
  children: "Provide details about your dashboard for the registry listing."
31032
- }), /*#__PURE__*/jsx(InputText, {
31033
- label: "Author Name *",
31034
- value: authorName,
31035
- onChange: setAuthorName,
31036
- placeholder: "Your name"
31056
+ }), /*#__PURE__*/jsxs("div", {
31057
+ children: [/*#__PURE__*/jsx("label", {
31058
+ className: "block text-sm font-medium opacity-70 mb-1",
31059
+ children: "Author Name"
31060
+ }), /*#__PURE__*/jsx("div", {
31061
+ className: "px-3 py-2 rounded-lg bg-white/5 border border-white/10 text-sm opacity-80",
31062
+ children: authorName || "—"
31063
+ })]
31037
31064
  }), /*#__PURE__*/jsx(TextArea, {
31038
31065
  label: "Description",
31039
31066
  value: description,