@trops/dash-core 0.1.363 → 0.1.364

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
@@ -46117,22 +46117,26 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
46117
46117
  _useState4 = _slicedToArray(_useState3, 2),
46118
46118
  authError = _useState4[0],
46119
46119
  setAuthError = _useState4[1];
46120
- var _useState5 = React.useState("patch"),
46120
+ var _useState5 = React.useState(null),
46121
46121
  _useState6 = _slicedToArray(_useState5, 2),
46122
- bump = _useState6[0],
46123
- setBump = _useState6[1];
46124
- var _useState7 = React.useState("public"),
46122
+ username = _useState6[0],
46123
+ setUsername = _useState6[1];
46124
+ var _useState7 = React.useState("patch"),
46125
46125
  _useState8 = _slicedToArray(_useState7, 2),
46126
- visibility = _useState8[0],
46127
- setVisibility = _useState8[1];
46128
- var _useState9 = React.useState(false),
46126
+ bump = _useState8[0],
46127
+ setBump = _useState8[1];
46128
+ var _useState9 = React.useState("public"),
46129
46129
  _useState0 = _slicedToArray(_useState9, 2),
46130
- isPublishing = _useState0[0],
46131
- setIsPublishing = _useState0[1];
46132
- var _useState1 = React.useState(null),
46130
+ visibility = _useState0[0],
46131
+ setVisibility = _useState0[1];
46132
+ var _useState1 = React.useState(false),
46133
46133
  _useState10 = _slicedToArray(_useState1, 2),
46134
- result = _useState10[0],
46135
- setResult = _useState10[1];
46134
+ isPublishing = _useState10[0],
46135
+ setIsPublishing = _useState10[1];
46136
+ var _useState11 = React.useState(null),
46137
+ _useState12 = _slicedToArray(_useState11, 2),
46138
+ result = _useState12[0],
46139
+ setResult = _useState12[1];
46136
46140
 
46137
46141
  // Reset modal state on open
46138
46142
  React.useEffect(function () {
@@ -46144,12 +46148,12 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
46144
46148
  setResult(null);
46145
46149
  }, [isOpen]);
46146
46150
 
46147
- // Check auth status
46151
+ // Check auth status + fetch username for the "publishing as" preview
46148
46152
  React.useEffect(function () {
46149
46153
  if (!isOpen) return;
46150
46154
  var cancelled = false;
46151
46155
  _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
46152
- var status;
46156
+ var status, profile;
46153
46157
  return _regeneratorRuntime.wrap(function (_context) {
46154
46158
  while (1) switch (_context.prev = _context.next) {
46155
46159
  case 0:
@@ -46164,18 +46168,38 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
46164
46168
  }
46165
46169
  return _context.abrupt("return");
46166
46170
  case 2:
46167
- setAuthStatus(status !== null && status !== void 0 && status.authenticated ? "authenticated" : "unauthenticated");
46168
- _context.next = 4;
46169
- break;
46171
+ if (!(status !== null && status !== void 0 && status.authenticated)) {
46172
+ _context.next = 5;
46173
+ break;
46174
+ }
46175
+ _context.next = 3;
46176
+ return window.mainApi.registryAuth.getProfile();
46170
46177
  case 3:
46171
- _context.prev = 3;
46178
+ profile = _context.sent;
46179
+ if (!cancelled) {
46180
+ _context.next = 4;
46181
+ break;
46182
+ }
46183
+ return _context.abrupt("return");
46184
+ case 4:
46185
+ setUsername((profile === null || profile === void 0 ? void 0 : profile.username) || null);
46186
+ setAuthStatus(profile !== null && profile !== void 0 && profile.username ? "authenticated" : "unauthenticated");
46187
+ _context.next = 6;
46188
+ break;
46189
+ case 5:
46190
+ setAuthStatus("unauthenticated");
46191
+ case 6:
46192
+ _context.next = 8;
46193
+ break;
46194
+ case 7:
46195
+ _context.prev = 7;
46172
46196
  _context["catch"](0);
46173
46197
  if (!cancelled) setAuthStatus("unauthenticated");
46174
- case 4:
46198
+ case 8:
46175
46199
  case "end":
46176
46200
  return _context.stop();
46177
46201
  }
46178
- }, _callee, null, [[0, 3]]);
46202
+ }, _callee, null, [[0, 7]]);
46179
46203
  }))();
46180
46204
  return function () {
46181
46205
  cancelled = true;
@@ -46365,27 +46389,30 @@ var PublishWidgetModal = function PublishWidgetModal(_ref) {
46365
46389
  className: "flex gap-2",
46366
46390
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
46367
46391
  className: "opacity-50 w-28 flex-shrink-0",
46368
- children: "Package"
46392
+ children: "Local"
46369
46393
  }), /*#__PURE__*/jsxRuntime.jsxs("span", {
46370
- className: "font-mono text-xs",
46371
- children: [widget.scope ? "".concat(widget.scope, "/") : "", widget.name]
46394
+ className: "font-mono text-xs opacity-80",
46395
+ children: [widget.scope ? "@".concat(widget.scope, "/") : "", (widget.name || "").replace(/^@[^/]+\//, "")]
46372
46396
  })]
46373
46397
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
46374
46398
  className: "flex gap-2 mt-1",
46375
46399
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
46376
46400
  className: "opacity-50 w-28 flex-shrink-0",
46377
- children: "Current"
46401
+ children: "Publishing as"
46378
46402
  }), /*#__PURE__*/jsxRuntime.jsxs("span", {
46379
- children: ["v", currentVersion]
46403
+ className: "font-mono text-xs text-indigo-300",
46404
+ children: [username ? "@".concat(username, "/") : "", (widget.name || "").replace(/^@[^/]+\//, ""), /*#__PURE__*/jsxRuntime.jsxs("span", {
46405
+ className: "text-gray-400",
46406
+ children: [" v", newVersion]
46407
+ })]
46380
46408
  })]
46381
46409
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
46382
46410
  className: "flex gap-2 mt-1",
46383
46411
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
46384
46412
  className: "opacity-50 w-28 flex-shrink-0",
46385
- children: "Publishing as"
46413
+ children: "Current"
46386
46414
  }), /*#__PURE__*/jsxRuntime.jsxs("span", {
46387
- className: "text-indigo-300",
46388
- children: ["v", newVersion]
46415
+ children: ["v", currentVersion]
46389
46416
  })]
46390
46417
  })]
46391
46418
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {