flexdesk 0.14.0 → 0.14.1

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DataTable,
3
3
  createRafResizeObserver
4
- } from "./chunk-M2L4XW2U.js";
4
+ } from "./chunk-FBGP5KN5.js";
5
5
  import {
6
6
  ManagedWindow
7
7
  } from "./chunk-6JSOVNID.js";
@@ -2477,4 +2477,4 @@ export {
2477
2477
  openPlotPopoutWindow,
2478
2478
  openRawTracesWindow
2479
2479
  };
2480
- //# sourceMappingURL=chunk-IYMNDPWH.js.map
2480
+ //# sourceMappingURL=chunk-RQM5Z2MU.js.map
package/dist/flow.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-NNFTETK3.js";
4
4
  import {
5
5
  DataTable
6
- } from "./chunk-M2L4XW2U.js";
6
+ } from "./chunk-FBGP5KN5.js";
7
7
  import "./chunk-6JSOVNID.js";
8
8
  import "./chunk-FL5KFNQH.js";
9
9
  import {
package/dist/tiles.js CHANGED
@@ -28,8 +28,8 @@ import {
28
28
  purge,
29
29
  resize,
30
30
  strideDownsampleShared
31
- } from "./chunk-IYMNDPWH.js";
32
- import "./chunk-M2L4XW2U.js";
31
+ } from "./chunk-RQM5Z2MU.js";
32
+ import "./chunk-FBGP5KN5.js";
33
33
  import "./chunk-6JSOVNID.js";
34
34
  import "./chunk-FL5KFNQH.js";
35
35
  import {
@@ -1355,9 +1355,17 @@ var ChartTile = class extends TileBase {
1355
1355
  try {
1356
1356
  const P = await ensurePlotly();
1357
1357
  const uri = await P.toImage(this._plotEl, { format: "png", scale: 2 });
1358
+ const filename = `${slug(this.config.title || this.constructor.TITLE)}.png`;
1359
+ const dialogs = this.host?.dialogs;
1360
+ const result = dialogs ? await dialogs.saveFile({ data: uri.split(",")[1], filename, kind: "png" }) : null;
1361
+ if (result) {
1362
+ if (result.ok) this._notify("Download", `Chart saved to ${result.path}`, "success");
1363
+ else if (!result.cancelled) this._notify("Download failed", result.error || "The image could not be saved", "error");
1364
+ return;
1365
+ }
1358
1366
  const a = document.createElement("a");
1359
1367
  a.href = uri;
1360
- a.download = `${slug(this.config.title || this.constructor.TITLE)}.png`;
1368
+ a.download = filename;
1361
1369
  a.click();
1362
1370
  } catch (err) {
1363
1371
  this._notify("Download failed", `The image could not be made: ${err?.message || err}`, "error");