@opendaw/lib-dom 0.0.72 → 0.0.73

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 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAGA,yBAAiB,KAAK,CAAC;IACZ,MAAM,IAAI,GAAU,aAAa,WAAW,EAAE,UAAU,qBAAqB,KAAG,OAAO,CAAC,MAAM,CAkBpG,CAAA;IAEM,MAAM,IAAI,GAAU,UAAU,qBAAqB,KAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAgCvF,CAAA;CACJ"}
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAGA,yBAAiB,KAAK,CAAC;IACZ,MAAM,IAAI,GAAU,aAAa,WAAW,EAAE,UAAU,qBAAqB,KAAG,OAAO,CAAC,MAAM,CAwBpG,CAAA;IAEM,MAAM,IAAI,GAAU,UAAU,qBAAqB,KAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAgCvF,CAAA;CACJ"}
package/dist/files.js CHANGED
@@ -1,10 +1,16 @@
1
- import { Arrays, asDefined, isDefined } from "@opendaw/lib-std";
1
+ import { Arrays, asDefined, isDefined, RuntimeNotifier } from "@opendaw/lib-std";
2
2
  import { Promises } from "@opendaw/lib-runtime";
3
3
  export var Files;
4
4
  (function (Files) {
5
5
  Files.save = async (arrayBuffer, options) => {
6
6
  if (isDefined(window.showSaveFilePicker)) {
7
- const handle = await window.showSaveFilePicker(options);
7
+ const { status, error, value: handle } = await Promises.tryCatch(window.showSaveFilePicker(options));
8
+ if (status === "rejected") {
9
+ return RuntimeNotifier.info({
10
+ headline: "Could not show file picker",
11
+ message: String(error)
12
+ }).then(() => Promise.reject(error));
13
+ }
8
14
  const writable = await handle.createWritable();
9
15
  await writable.truncate(0);
10
16
  await writable.write(arrayBuffer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendaw/lib-dom",
3
- "version": "0.0.72",
3
+ "version": "0.0.73",
4
4
  "sideEffects": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,13 +23,13 @@
23
23
  "test": "vitest run"
24
24
  },
25
25
  "dependencies": {
26
- "@opendaw/lib-runtime": "^0.0.68",
27
- "@opendaw/lib-std": "^0.0.67",
26
+ "@opendaw/lib-runtime": "^0.0.69",
27
+ "@opendaw/lib-std": "^0.0.68",
28
28
  "@types/wicg-file-system-access": "^2023.10.6"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@opendaw/eslint-config": "^0.0.27",
32
32
  "@opendaw/typescript-config": "^0.0.28"
33
33
  },
34
- "gitHead": "410e32d862fae20e1ecfffcee7407451e6537655"
34
+ "gitHead": "5e97da8bbe6085b04c34b9ff7e816b22225bf915"
35
35
  }