@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.
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +8 -2
- package/package.json +4 -4
package/dist/files.d.ts.map
CHANGED
|
@@ -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,
|
|
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.
|
|
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.
|
|
27
|
-
"@opendaw/lib-std": "^0.0.
|
|
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": "
|
|
34
|
+
"gitHead": "5e97da8bbe6085b04c34b9ff7e816b22225bf915"
|
|
35
35
|
}
|