@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.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,13 @@ 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
+ setAuthorName(userProfile.displayName || userProfile.username || "");
30730
+ } else {
30731
+ // Token expired or invalid — treat as unauthenticated
30732
+ setAuthStatus("unauthenticated");
30726
30733
  }
30727
30734
  _context.next = 6;
30728
30735
  break;
@@ -30754,6 +30761,7 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30754
30761
  setProfile(null);
30755
30762
  setAuthFlow(null);
30756
30763
  setIsPolling(false);
30764
+ setAuthError(null);
30757
30765
  setAuthorName("");
30758
30766
  setDescription("");
30759
30767
  setSelectedTags([]);
@@ -30837,10 +30845,11 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30837
30845
  return _regeneratorRuntime.wrap(function (_context4) {
30838
30846
  while (1) switch (_context4.prev = _context4.next) {
30839
30847
  case 0:
30840
- _context4.prev = 0;
30841
- _context4.next = 1;
30848
+ setAuthError(null);
30849
+ _context4.prev = 1;
30850
+ _context4.next = 2;
30842
30851
  return window.mainApi.registryAuth.initiateLogin();
30843
- case 1:
30852
+ case 2:
30844
30853
  flow = _context4.sent;
30845
30854
  setAuthFlow(flow);
30846
30855
 
@@ -30901,16 +30910,17 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
30901
30910
  }
30902
30911
  }, _callee3, null, [[0, 5]]);
30903
30912
  })), interval);
30904
- _context4.next = 3;
30913
+ _context4.next = 4;
30905
30914
  break;
30906
- case 2:
30907
- _context4.prev = 2;
30908
- _context4["catch"](0);
30909
30915
  case 3:
30916
+ _context4.prev = 3;
30917
+ _context4["catch"](1);
30918
+ setAuthError("Could not reach the registry. Check your connection and try again.");
30919
+ case 4:
30910
30920
  case "end":
30911
30921
  return _context4.stop();
30912
30922
  }
30913
- }, _callee4, null, [[0, 2]]);
30923
+ }, _callee4, null, [[1, 3]]);
30914
30924
  }));
30915
30925
  return _handleSignIn.apply(this, arguments);
30916
30926
  }
@@ -31018,11 +31028,25 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
31018
31028
  children: [/*#__PURE__*/jsxRuntime.jsx("p", {
31019
31029
  className: "text-sm opacity-70",
31020
31030
  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"
31031
+ }), !authFlow && !isPolling && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31032
+ children: [/*#__PURE__*/jsxRuntime.jsx("button", {
31033
+ type: "button",
31034
+ onClick: handleSignIn,
31035
+ 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",
31036
+ children: "Sign in to Registry"
31037
+ }), authError && /*#__PURE__*/jsxRuntime.jsx("div", {
31038
+ className: "bg-red-500/10 border border-red-500/20 rounded-lg p-3",
31039
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31040
+ className: "flex items-start gap-2",
31041
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
31042
+ icon: "circle-xmark",
31043
+ className: "h-3.5 w-3.5 text-red-400 mt-0.5 flex-shrink-0"
31044
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
31045
+ className: "text-xs text-red-300/90",
31046
+ children: authError
31047
+ })]
31048
+ })
31049
+ })]
31026
31050
  }), authFlow && isPolling && /*#__PURE__*/jsxRuntime.jsxs("div", {
31027
31051
  className: "bg-blue-500/10 border border-blue-500/20 rounded-lg p-4 space-y-3",
31028
31052
  children: [/*#__PURE__*/jsxRuntime.jsx("p", {
@@ -31048,11 +31072,14 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
31048
31072
  children: [/*#__PURE__*/jsxRuntime.jsx("p", {
31049
31073
  className: "text-sm opacity-70",
31050
31074
  children: "Provide details about your dashboard for the registry listing."
31051
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
31052
- label: "Author Name *",
31053
- value: authorName,
31054
- onChange: setAuthorName,
31055
- placeholder: "Your name"
31075
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
31076
+ children: [/*#__PURE__*/jsxRuntime.jsx("label", {
31077
+ className: "block text-sm font-medium opacity-70 mb-1",
31078
+ children: "Author Name"
31079
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
31080
+ className: "px-3 py-2 rounded-lg bg-white/5 border border-white/10 text-sm opacity-80",
31081
+ children: authorName || "—"
31082
+ })]
31056
31083
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.TextArea, {
31057
31084
  label: "Description",
31058
31085
  value: description,