@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/index.js CHANGED
@@ -47331,6 +47331,74 @@ var GeneralSection = function GeneralSection() {
47331
47331
  _useState2 = _slicedToArray(_useState, 2),
47332
47332
  dataDirectory = _useState2[0],
47333
47333
  setDataDirectory = _useState2[1];
47334
+
47335
+ // Export Everything (Phase 4A) — kind: "success" | "error"
47336
+ var _useState3 = React.useState(false),
47337
+ _useState4 = _slicedToArray(_useState3, 2),
47338
+ isExporting = _useState4[0],
47339
+ setIsExporting = _useState4[1];
47340
+ var _useState5 = React.useState(null),
47341
+ _useState6 = _slicedToArray(_useState5, 2),
47342
+ exportFeedback = _useState6[0],
47343
+ setExportFeedback = _useState6[1];
47344
+ function handleExportEverything() {
47345
+ return _handleExportEverything.apply(this, arguments);
47346
+ }
47347
+ function _handleExportEverything() {
47348
+ _handleExportEverything = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
47349
+ var _window$mainApi, _window$mainApi$expor, result, _t;
47350
+ return _regeneratorRuntime.wrap(function (_context) {
47351
+ while (1) switch (_context.prev = _context.next) {
47352
+ case 0:
47353
+ if (credentials !== null && credentials !== void 0 && credentials.appId) {
47354
+ _context.next = 1;
47355
+ break;
47356
+ }
47357
+ setExportFeedback({
47358
+ kind: "error",
47359
+ message: "No application context."
47360
+ });
47361
+ return _context.abrupt("return");
47362
+ case 1:
47363
+ setIsExporting(true);
47364
+ setExportFeedback(null);
47365
+ _context.prev = 2;
47366
+ _context.next = 3;
47367
+ 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);
47368
+ case 3:
47369
+ result = _context.sent;
47370
+ if (result !== null && result !== void 0 && result.success) {
47371
+ setExportFeedback({
47372
+ kind: "success",
47373
+ message: "Saved to ".concat(result.filePath)
47374
+ });
47375
+ } else if (result !== null && result !== void 0 && result.canceled) ; else {
47376
+ setExportFeedback({
47377
+ kind: "error",
47378
+ message: (result === null || result === void 0 ? void 0 : result.error) || "Export failed."
47379
+ });
47380
+ }
47381
+ _context.next = 5;
47382
+ break;
47383
+ case 4:
47384
+ _context.prev = 4;
47385
+ _t = _context["catch"](2);
47386
+ setExportFeedback({
47387
+ kind: "error",
47388
+ message: (_t === null || _t === void 0 ? void 0 : _t.message) || "Export failed."
47389
+ });
47390
+ case 5:
47391
+ _context.prev = 5;
47392
+ setIsExporting(false);
47393
+ return _context.finish(5);
47394
+ case 6:
47395
+ case "end":
47396
+ return _context.stop();
47397
+ }
47398
+ }, _callee, null, [[2, 4, 5, 6]]);
47399
+ }));
47400
+ return _handleExportEverything.apply(this, arguments);
47401
+ }
47334
47402
  React.useEffect(function () {
47335
47403
  var dashApi = appContext === null || appContext === void 0 ? void 0 : appContext.dashApi;
47336
47404
  if (dashApi) {
@@ -47427,6 +47495,33 @@ var GeneralSection = function GeneralSection() {
47427
47495
  onClick: handleOpenDataDirectory
47428
47496
  })]
47429
47497
  })]
47498
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
47499
+ className: "flex flex-col space-y-3",
47500
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
47501
+ title: "Backup",
47502
+ padding: false
47503
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
47504
+ className: "flex flex-row items-center justify-between py-3",
47505
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
47506
+ className: "flex flex-col",
47507
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
47508
+ className: "text-sm font-medium",
47509
+ children: "Export Everything"
47510
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
47511
+ className: "text-xs opacity-50",
47512
+ children: "Save a ZIP of your workspaces, themes, folders, and provider settings. Credentials are not included."
47513
+ }), exportFeedback && /*#__PURE__*/jsxRuntime.jsx("span", {
47514
+ className: "text-xs mt-1 ".concat(exportFeedback.kind === "success" ? "text-green-400" : "text-red-400"),
47515
+ "data-testid": "export-feedback",
47516
+ children: exportFeedback.message
47517
+ })]
47518
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
47519
+ title: isExporting ? "Exporting…" : "Export Everything",
47520
+ onClick: handleExportEverything,
47521
+ disabled: isExporting,
47522
+ "data-testid": "export-everything-button"
47523
+ })]
47524
+ })]
47430
47525
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
47431
47526
  className: "flex flex-col space-y-3",
47432
47527
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
@@ -49799,12 +49894,14 @@ var WidgetsSection = function WidgetsSection(_ref) {
49799
49894
  className: isSelected ? "bg-white/10 opacity-100" : "",
49800
49895
  children: /*#__PURE__*/jsxRuntime.jsxs("span", {
49801
49896
  className: "flex flex-col",
49897
+ "data-testid": "widget-row-".concat(widget.name),
49802
49898
  children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
49803
49899
  className: "flex items-center gap-2",
49804
49900
  children: [widget.displayName || widget.name, widget.source === "builtin" && /*#__PURE__*/jsxRuntime.jsx(DashReact.Tag3, {
49805
49901
  text: "Built-in"
49806
49902
  }), updates.has(widget.name) && /*#__PURE__*/jsxRuntime.jsx("span", {
49807
49903
  className: "text-[10px] text-blue-400 font-medium",
49904
+ "data-testid": "widget-update-badge-".concat(widget.name),
49808
49905
  children: "Update"
49809
49906
  })]
49810
49907
  }), (widget.scopedId || widget.name) && /*#__PURE__*/jsxRuntime.jsx("span", {