@trops/dash-core 0.1.413 → 0.1.415
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/electron/index.js +52 -8
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +39 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +39 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -50479,6 +50479,13 @@ var PackageItem = function PackageItem(_ref6) {
|
|
|
50479
50479
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
50480
50480
|
deleting = _useState18[0],
|
|
50481
50481
|
setDeleting = _useState18[1];
|
|
50482
|
+
// Last delete-attempt error. Rendered inline next to the delete
|
|
50483
|
+
// button so a failed attempt surfaces its cause (auth expired, 404,
|
|
50484
|
+
// server 500, network) instead of silently resetting.
|
|
50485
|
+
var _useState19 = useState(null),
|
|
50486
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
50487
|
+
deleteError = _useState20[0],
|
|
50488
|
+
setDeleteError = _useState20[1];
|
|
50482
50489
|
function handleSave() {
|
|
50483
50490
|
return _handleSave2.apply(this, arguments);
|
|
50484
50491
|
}
|
|
@@ -50528,34 +50535,44 @@ var PackageItem = function PackageItem(_ref6) {
|
|
|
50528
50535
|
}
|
|
50529
50536
|
function _handleDelete() {
|
|
50530
50537
|
_handleDelete = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
50531
|
-
var _window$mainApi5, result;
|
|
50538
|
+
var _window$mainApi5, result, _t4;
|
|
50532
50539
|
return _regeneratorRuntime.wrap(function (_context4) {
|
|
50533
50540
|
while (1) switch (_context4.prev = _context4.next) {
|
|
50534
50541
|
case 0:
|
|
50535
50542
|
setDeleting(true);
|
|
50543
|
+
setDeleteError(null);
|
|
50536
50544
|
_context4.prev = 1;
|
|
50537
50545
|
_context4.next = 2;
|
|
50538
50546
|
return (_window$mainApi5 = window.mainApi) === null || _window$mainApi5 === void 0 || (_window$mainApi5 = _window$mainApi5.registryAuth) === null || _window$mainApi5 === void 0 ? void 0 : _window$mainApi5.deletePackage(pkg.scope, pkg.name);
|
|
50539
50547
|
case 2:
|
|
50540
50548
|
result = _context4.sent;
|
|
50541
|
-
if (result) {
|
|
50542
|
-
|
|
50549
|
+
if (!(result !== null && result !== void 0 && result.success)) {
|
|
50550
|
+
_context4.next = 3;
|
|
50551
|
+
break;
|
|
50543
50552
|
}
|
|
50544
|
-
|
|
50545
|
-
|
|
50553
|
+
onDeleted === null || onDeleted === void 0 || onDeleted();
|
|
50554
|
+
return _context4.abrupt("return");
|
|
50546
50555
|
case 3:
|
|
50547
|
-
|
|
50548
|
-
|
|
50556
|
+
// New error-surface format: `{ success, error, status }`. Show
|
|
50557
|
+
// the server-reported reason so the user (or the next bug
|
|
50558
|
+
// reporter) knows exactly why the delete failed.
|
|
50559
|
+
setDeleteError((result === null || result === void 0 ? void 0 : result.error) || (result !== null && result !== void 0 && result.status ? "Delete failed (".concat(result.status, ")") : "Delete failed — no response from registry."));
|
|
50560
|
+
_context4.next = 5;
|
|
50561
|
+
break;
|
|
50549
50562
|
case 4:
|
|
50550
50563
|
_context4.prev = 4;
|
|
50564
|
+
_t4 = _context4["catch"](1);
|
|
50565
|
+
setDeleteError("Unexpected error: ".concat((_t4 === null || _t4 === void 0 ? void 0 : _t4.message) || String(_t4)));
|
|
50566
|
+
case 5:
|
|
50567
|
+
_context4.prev = 5;
|
|
50551
50568
|
setDeleting(false);
|
|
50552
50569
|
setConfirmingDelete(false);
|
|
50553
|
-
return _context4.finish(
|
|
50554
|
-
case
|
|
50570
|
+
return _context4.finish(5);
|
|
50571
|
+
case 6:
|
|
50555
50572
|
case "end":
|
|
50556
50573
|
return _context4.stop();
|
|
50557
50574
|
}
|
|
50558
|
-
}, _callee4, null, [[1,
|
|
50575
|
+
}, _callee4, null, [[1, 4, 5, 6]]);
|
|
50559
50576
|
}));
|
|
50560
50577
|
return _handleDelete.apply(this, arguments);
|
|
50561
50578
|
}
|
|
@@ -50621,8 +50638,9 @@ var PackageItem = function PackageItem(_ref6) {
|
|
|
50621
50638
|
})]
|
|
50622
50639
|
}), /*#__PURE__*/jsxs("div", {
|
|
50623
50640
|
className: "flex items-center justify-between",
|
|
50624
|
-
children: [/*#__PURE__*/
|
|
50625
|
-
|
|
50641
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
50642
|
+
className: "flex items-center gap-3",
|
|
50643
|
+
children: [confirmingDelete ? /*#__PURE__*/jsxs("div", {
|
|
50626
50644
|
className: "flex items-center gap-2",
|
|
50627
50645
|
children: [/*#__PURE__*/jsx("button", {
|
|
50628
50646
|
type: "button",
|
|
@@ -50633,7 +50651,8 @@ var PackageItem = function PackageItem(_ref6) {
|
|
|
50633
50651
|
}), /*#__PURE__*/jsx("button", {
|
|
50634
50652
|
type: "button",
|
|
50635
50653
|
onClick: function onClick() {
|
|
50636
|
-
|
|
50654
|
+
setConfirmingDelete(false);
|
|
50655
|
+
setDeleteError(null);
|
|
50637
50656
|
},
|
|
50638
50657
|
className: "text-xs opacity-50 hover:opacity-80 cursor-pointer",
|
|
50639
50658
|
children: "Cancel"
|
|
@@ -50641,11 +50660,16 @@ var PackageItem = function PackageItem(_ref6) {
|
|
|
50641
50660
|
}) : /*#__PURE__*/jsx("button", {
|
|
50642
50661
|
type: "button",
|
|
50643
50662
|
onClick: function onClick() {
|
|
50644
|
-
|
|
50663
|
+
setConfirmingDelete(true);
|
|
50664
|
+
setDeleteError(null);
|
|
50645
50665
|
},
|
|
50646
50666
|
className: "text-xs text-red-400/70 hover:text-red-400 cursor-pointer",
|
|
50647
50667
|
children: "Delete"
|
|
50648
|
-
})
|
|
50668
|
+
}), deleteError && /*#__PURE__*/jsx("span", {
|
|
50669
|
+
className: "text-[11px] text-red-400 max-w-sm truncate",
|
|
50670
|
+
title: deleteError,
|
|
50671
|
+
children: deleteError
|
|
50672
|
+
})]
|
|
50649
50673
|
}), /*#__PURE__*/jsxs("div", {
|
|
50650
50674
|
className: "flex items-center gap-2",
|
|
50651
50675
|
children: [/*#__PURE__*/jsx("button", {
|