@trops/dash-core 0.1.599 → 0.1.601
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 +7562 -598
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +97 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +97 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -47313,6 +47313,74 @@ var GeneralSection = function GeneralSection() {
|
|
|
47313
47313
|
_useState2 = _slicedToArray(_useState, 2),
|
|
47314
47314
|
dataDirectory = _useState2[0],
|
|
47315
47315
|
setDataDirectory = _useState2[1];
|
|
47316
|
+
|
|
47317
|
+
// Export Everything (Phase 4A) — kind: "success" | "error"
|
|
47318
|
+
var _useState3 = useState(false),
|
|
47319
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
47320
|
+
isExporting = _useState4[0],
|
|
47321
|
+
setIsExporting = _useState4[1];
|
|
47322
|
+
var _useState5 = useState(null),
|
|
47323
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
47324
|
+
exportFeedback = _useState6[0],
|
|
47325
|
+
setExportFeedback = _useState6[1];
|
|
47326
|
+
function handleExportEverything() {
|
|
47327
|
+
return _handleExportEverything.apply(this, arguments);
|
|
47328
|
+
}
|
|
47329
|
+
function _handleExportEverything() {
|
|
47330
|
+
_handleExportEverything = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
47331
|
+
var _window$mainApi, _window$mainApi$expor, result, _t;
|
|
47332
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
47333
|
+
while (1) switch (_context.prev = _context.next) {
|
|
47334
|
+
case 0:
|
|
47335
|
+
if (credentials !== null && credentials !== void 0 && credentials.appId) {
|
|
47336
|
+
_context.next = 1;
|
|
47337
|
+
break;
|
|
47338
|
+
}
|
|
47339
|
+
setExportFeedback({
|
|
47340
|
+
kind: "error",
|
|
47341
|
+
message: "No application context."
|
|
47342
|
+
});
|
|
47343
|
+
return _context.abrupt("return");
|
|
47344
|
+
case 1:
|
|
47345
|
+
setIsExporting(true);
|
|
47346
|
+
setExportFeedback(null);
|
|
47347
|
+
_context.prev = 2;
|
|
47348
|
+
_context.next = 3;
|
|
47349
|
+
return (_window$mainApi = window.mainApi) === null || _window$mainApi === void 0 || (_window$mainApi = _window$mainApi["export"]) === null || _window$mainApi === void 0 || (_window$mainApi$expor = _window$mainApi.exportEverything) === null || _window$mainApi$expor === void 0 ? void 0 : _window$mainApi$expor.call(_window$mainApi, credentials.appId);
|
|
47350
|
+
case 3:
|
|
47351
|
+
result = _context.sent;
|
|
47352
|
+
if (result !== null && result !== void 0 && result.success) {
|
|
47353
|
+
setExportFeedback({
|
|
47354
|
+
kind: "success",
|
|
47355
|
+
message: "Saved to ".concat(result.filePath)
|
|
47356
|
+
});
|
|
47357
|
+
} else if (result !== null && result !== void 0 && result.canceled) ; else {
|
|
47358
|
+
setExportFeedback({
|
|
47359
|
+
kind: "error",
|
|
47360
|
+
message: (result === null || result === void 0 ? void 0 : result.error) || "Export failed."
|
|
47361
|
+
});
|
|
47362
|
+
}
|
|
47363
|
+
_context.next = 5;
|
|
47364
|
+
break;
|
|
47365
|
+
case 4:
|
|
47366
|
+
_context.prev = 4;
|
|
47367
|
+
_t = _context["catch"](2);
|
|
47368
|
+
setExportFeedback({
|
|
47369
|
+
kind: "error",
|
|
47370
|
+
message: (_t === null || _t === void 0 ? void 0 : _t.message) || "Export failed."
|
|
47371
|
+
});
|
|
47372
|
+
case 5:
|
|
47373
|
+
_context.prev = 5;
|
|
47374
|
+
setIsExporting(false);
|
|
47375
|
+
return _context.finish(5);
|
|
47376
|
+
case 6:
|
|
47377
|
+
case "end":
|
|
47378
|
+
return _context.stop();
|
|
47379
|
+
}
|
|
47380
|
+
}, _callee, null, [[2, 4, 5, 6]]);
|
|
47381
|
+
}));
|
|
47382
|
+
return _handleExportEverything.apply(this, arguments);
|
|
47383
|
+
}
|
|
47316
47384
|
useEffect(function () {
|
|
47317
47385
|
var dashApi = appContext === null || appContext === void 0 ? void 0 : appContext.dashApi;
|
|
47318
47386
|
if (dashApi) {
|
|
@@ -47409,6 +47477,33 @@ var GeneralSection = function GeneralSection() {
|
|
|
47409
47477
|
onClick: handleOpenDataDirectory
|
|
47410
47478
|
})]
|
|
47411
47479
|
})]
|
|
47480
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
47481
|
+
className: "flex flex-col space-y-3",
|
|
47482
|
+
children: [/*#__PURE__*/jsx(SubHeading3, {
|
|
47483
|
+
title: "Backup",
|
|
47484
|
+
padding: false
|
|
47485
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
47486
|
+
className: "flex flex-row items-center justify-between py-3",
|
|
47487
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
47488
|
+
className: "flex flex-col",
|
|
47489
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
47490
|
+
className: "text-sm font-medium",
|
|
47491
|
+
children: "Export Everything"
|
|
47492
|
+
}), /*#__PURE__*/jsx("span", {
|
|
47493
|
+
className: "text-xs opacity-50",
|
|
47494
|
+
children: "Save a ZIP of your workspaces, themes, folders, and provider settings. Credentials are not included."
|
|
47495
|
+
}), exportFeedback && /*#__PURE__*/jsx("span", {
|
|
47496
|
+
className: "text-xs mt-1 ".concat(exportFeedback.kind === "success" ? "text-green-400" : "text-red-400"),
|
|
47497
|
+
"data-testid": "export-feedback",
|
|
47498
|
+
children: exportFeedback.message
|
|
47499
|
+
})]
|
|
47500
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
47501
|
+
title: isExporting ? "Exporting…" : "Export Everything",
|
|
47502
|
+
onClick: handleExportEverything,
|
|
47503
|
+
disabled: isExporting,
|
|
47504
|
+
"data-testid": "export-everything-button"
|
|
47505
|
+
})]
|
|
47506
|
+
})]
|
|
47412
47507
|
}), /*#__PURE__*/jsxs("div", {
|
|
47413
47508
|
className: "flex flex-col space-y-3",
|
|
47414
47509
|
children: [/*#__PURE__*/jsx(SubHeading3, {
|
|
@@ -49781,12 +49876,14 @@ var WidgetsSection = function WidgetsSection(_ref) {
|
|
|
49781
49876
|
className: isSelected ? "bg-white/10 opacity-100" : "",
|
|
49782
49877
|
children: /*#__PURE__*/jsxs("span", {
|
|
49783
49878
|
className: "flex flex-col",
|
|
49879
|
+
"data-testid": "widget-row-".concat(widget.name),
|
|
49784
49880
|
children: [/*#__PURE__*/jsxs("span", {
|
|
49785
49881
|
className: "flex items-center gap-2",
|
|
49786
49882
|
children: [widget.displayName || widget.name, widget.source === "builtin" && /*#__PURE__*/jsx(Tag3, {
|
|
49787
49883
|
text: "Built-in"
|
|
49788
49884
|
}), updates.has(widget.name) && /*#__PURE__*/jsx("span", {
|
|
49789
49885
|
className: "text-[10px] text-blue-400 font-medium",
|
|
49886
|
+
"data-testid": "widget-update-badge-".concat(widget.name),
|
|
49790
49887
|
children: "Update"
|
|
49791
49888
|
})]
|
|
49792
49889
|
}), (widget.scopedId || widget.name) && /*#__PURE__*/jsx("span", {
|