@multiplatform.one/desktop 9.16.1 → 10.0.0
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/cjs/dialog/index.cjs +37 -41
- package/dist/cjs/dialog/index.native.cjs +59 -0
- package/dist/cjs/dialog/index.native.js +38 -41
- package/dist/cjs/dialog/index.native.js.map +1 -1
- package/dist/cjs/dialog/index.tauri.cjs +58 -62
- package/dist/cjs/dialog/index.tauri.native.cjs +72 -0
- package/dist/cjs/dialog/index.tauri.native.js +58 -61
- package/dist/cjs/dialog/index.tauri.native.js.map +1 -1
- package/dist/cjs/fs/index.cjs +35 -39
- package/dist/cjs/fs/index.native.cjs +48 -0
- package/dist/cjs/fs/index.native.js +35 -38
- package/dist/cjs/fs/index.native.js.map +1 -1
- package/dist/cjs/fs/index.tauri.cjs +35 -39
- package/dist/cjs/fs/index.tauri.native.cjs +49 -0
- package/dist/cjs/fs/index.tauri.native.js +35 -38
- package/dist/cjs/fs/index.tauri.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -11
- package/dist/cjs/index.native.cjs +23 -0
- package/dist/cjs/index.native.js +9 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/paths/index.cjs +31 -35
- package/dist/cjs/paths/index.native.cjs +50 -0
- package/dist/cjs/paths/index.native.js +37 -40
- package/dist/cjs/paths/index.native.js.map +1 -1
- package/dist/cjs/paths/index.tauri.cjs +29 -41
- package/dist/cjs/paths/index.tauri.native.cjs +49 -0
- package/dist/cjs/paths/index.tauri.native.js +35 -46
- package/dist/cjs/paths/index.tauri.native.js.map +1 -1
- package/dist/cjs/updater/index.cjs +23 -27
- package/dist/cjs/updater/index.native.cjs +36 -0
- package/dist/cjs/updater/index.native.js +23 -26
- package/dist/cjs/updater/index.native.js.map +1 -1
- package/dist/cjs/updater/index.tauri.cjs +74 -87
- package/dist/cjs/updater/index.tauri.native.cjs +95 -0
- package/dist/cjs/updater/index.tauri.native.js +76 -88
- package/dist/cjs/updater/index.tauri.native.js.map +1 -1
- package/dist/esm/dialog/index.mjs +24 -23
- package/dist/esm/dialog/index.mjs.map +1 -1
- package/dist/esm/dialog/index.native.js +25 -24
- package/dist/esm/dialog/index.native.js.map +1 -1
- package/dist/esm/dialog/index.tauri.mjs +47 -45
- package/dist/esm/dialog/index.tauri.mjs.map +1 -1
- package/dist/esm/dialog/index.tauri.native.js +47 -45
- package/dist/esm/dialog/index.tauri.native.js.map +1 -1
- package/dist/esm/fs/index.mjs +22 -21
- package/dist/esm/fs/index.mjs.map +1 -1
- package/dist/esm/fs/index.native.js +22 -21
- package/dist/esm/fs/index.native.js.map +1 -1
- package/dist/esm/fs/index.tauri.mjs +24 -22
- package/dist/esm/fs/index.tauri.mjs.map +1 -1
- package/dist/esm/fs/index.tauri.native.js +24 -22
- package/dist/esm/fs/index.tauri.native.js.map +1 -1
- package/dist/esm/index.mjs +7 -5
- package/dist/esm/index.native.js +7 -5
- package/dist/esm/paths/index.mjs +18 -17
- package/dist/esm/paths/index.mjs.map +1 -1
- package/dist/esm/paths/index.native.js +24 -23
- package/dist/esm/paths/index.native.js.map +1 -1
- package/dist/esm/paths/index.tauri.mjs +17 -23
- package/dist/esm/paths/index.tauri.mjs.map +1 -1
- package/dist/esm/paths/index.tauri.native.js +23 -29
- package/dist/esm/paths/index.tauri.native.js.map +1 -1
- package/dist/esm/updater/index.mjs +10 -9
- package/dist/esm/updater/index.mjs.map +1 -1
- package/dist/esm/updater/index.native.js +10 -9
- package/dist/esm/updater/index.native.js.map +1 -1
- package/dist/esm/updater/index.tauri.mjs +58 -61
- package/dist/esm/updater/index.tauri.mjs.map +1 -1
- package/dist/esm/updater/index.tauri.native.js +60 -63
- package/dist/esm/updater/index.tauri.native.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
|
@@ -5,100 +5,87 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
12
|
};
|
|
13
13
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
21
|
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: true
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
30
25
|
}) : target, mod));
|
|
31
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: true
|
|
33
|
-
}), mod);
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
27
|
var index_tauri_exports = {};
|
|
35
|
-
__export(index_tauri_exports, {
|
|
36
|
-
updater: () => updater
|
|
37
|
-
});
|
|
28
|
+
__export(index_tauri_exports, { updater: () => updater });
|
|
38
29
|
module.exports = __toCommonJS(index_tauri_exports);
|
|
39
30
|
let _updater = null;
|
|
40
31
|
async function getUpdater() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
if (!_updater) {
|
|
33
|
+
_updater = await import("@tauri-apps/plugin-updater");
|
|
34
|
+
}
|
|
35
|
+
return _updater;
|
|
45
36
|
}
|
|
46
37
|
const updater = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
isSupported() {
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
38
|
+
async checkForUpdates() {
|
|
39
|
+
try {
|
|
40
|
+
const { check } = await getUpdater();
|
|
41
|
+
const update = await check();
|
|
42
|
+
if (update) {
|
|
43
|
+
return {
|
|
44
|
+
version: update.version,
|
|
45
|
+
date: update.date ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
46
|
+
body: update.body ?? void 0
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error("[updater] Failed to check for updates:", error);
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
async downloadAndInstall(onProgress) {
|
|
56
|
+
try {
|
|
57
|
+
const { check } = await getUpdater();
|
|
58
|
+
const update = await check();
|
|
59
|
+
if (!update) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
let downloaded = 0;
|
|
63
|
+
let contentLength = 0;
|
|
64
|
+
await update.downloadAndInstall((event) => {
|
|
65
|
+
switch (event.event) {
|
|
66
|
+
case "Started":
|
|
67
|
+
contentLength = event.data.contentLength ?? 0;
|
|
68
|
+
break;
|
|
69
|
+
case "Progress":
|
|
70
|
+
downloaded += event.data.chunkLength;
|
|
71
|
+
if (onProgress && contentLength > 0) {
|
|
72
|
+
onProgress(Math.round(downloaded / contentLength * 100));
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
case "Finished":
|
|
76
|
+
if (onProgress) {
|
|
77
|
+
onProgress(100);
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return true;
|
|
83
|
+
} catch (error) {
|
|
84
|
+
console.error("[updater] Failed to download and install update:", error);
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
isSupported() {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
27
|
+
}) : target, mod));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var index_tauri_exports = {};
|
|
30
|
+
__export(index_tauri_exports, { updater: () => updater });
|
|
31
|
+
module.exports = __toCommonJS(index_tauri_exports);
|
|
32
|
+
var _updater = null;
|
|
33
|
+
async function getUpdater() {
|
|
34
|
+
if (!_updater) {
|
|
35
|
+
_updater = await import("@tauri-apps/plugin-updater");
|
|
36
|
+
}
|
|
37
|
+
return _updater;
|
|
38
|
+
}
|
|
39
|
+
var updater = {
|
|
40
|
+
async checkForUpdates() {
|
|
41
|
+
try {
|
|
42
|
+
var { check } = await getUpdater();
|
|
43
|
+
var update = await check();
|
|
44
|
+
if (update) {
|
|
45
|
+
var _update_date, _update_body;
|
|
46
|
+
return {
|
|
47
|
+
version: update.version,
|
|
48
|
+
date: (_update_date = update.date) !== null && _update_date !== void 0 ? _update_date : (/* @__PURE__ */ new Date()).toISOString(),
|
|
49
|
+
body: (_update_body = update.body) !== null && _update_body !== void 0 ? _update_body : void 0
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.error("[updater] Failed to check for updates:", error);
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
async downloadAndInstall(onProgress) {
|
|
59
|
+
try {
|
|
60
|
+
var { check } = await getUpdater();
|
|
61
|
+
var update = await check();
|
|
62
|
+
if (!update) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
var downloaded = 0;
|
|
66
|
+
var contentLength = 0;
|
|
67
|
+
await update.downloadAndInstall(function(event) {
|
|
68
|
+
switch (event.event) {
|
|
69
|
+
case "Started":
|
|
70
|
+
var _event_data_contentLength;
|
|
71
|
+
contentLength = (_event_data_contentLength = event.data.contentLength) !== null && _event_data_contentLength !== void 0 ? _event_data_contentLength : 0;
|
|
72
|
+
break;
|
|
73
|
+
case "Progress":
|
|
74
|
+
downloaded += event.data.chunkLength;
|
|
75
|
+
if (onProgress && contentLength > 0) {
|
|
76
|
+
onProgress(Math.round(downloaded / contentLength * 100));
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
case "Finished":
|
|
80
|
+
if (onProgress) {
|
|
81
|
+
onProgress(100);
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return true;
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error("[updater] Failed to download and install update:", error);
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
isSupported() {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
@@ -7,103 +7,91 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
14
|
};
|
|
15
15
|
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
23
|
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
32
27
|
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
29
|
var index_tauri_exports = {};
|
|
37
|
-
__export(index_tauri_exports, {
|
|
38
|
-
updater: () => updater
|
|
39
|
-
});
|
|
30
|
+
__export(index_tauri_exports, { updater: () => updater });
|
|
40
31
|
module.exports = __toCommonJS(index_tauri_exports);
|
|
41
32
|
var _updater = null;
|
|
42
33
|
async function getUpdater() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
if (!_updater) {
|
|
35
|
+
_updater = await import("@tauri-apps/plugin-updater");
|
|
36
|
+
}
|
|
37
|
+
return _updater;
|
|
47
38
|
}
|
|
48
39
|
var updater = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
isSupported() {
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
40
|
+
async checkForUpdates() {
|
|
41
|
+
try {
|
|
42
|
+
var { check } = await getUpdater();
|
|
43
|
+
var update = await check();
|
|
44
|
+
if (update) {
|
|
45
|
+
var _update_date, _update_body;
|
|
46
|
+
return {
|
|
47
|
+
version: update.version,
|
|
48
|
+
date: (_update_date = update.date) !== null && _update_date !== void 0 ? _update_date : (/* @__PURE__ */ new Date()).toISOString(),
|
|
49
|
+
body: (_update_body = update.body) !== null && _update_body !== void 0 ? _update_body : void 0
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.error("[updater] Failed to check for updates:", error);
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
async downloadAndInstall(onProgress) {
|
|
59
|
+
try {
|
|
60
|
+
var { check } = await getUpdater();
|
|
61
|
+
var update = await check();
|
|
62
|
+
if (!update) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
var downloaded = 0;
|
|
66
|
+
var contentLength = 0;
|
|
67
|
+
await update.downloadAndInstall(function(event) {
|
|
68
|
+
switch (event.event) {
|
|
69
|
+
case "Started":
|
|
70
|
+
var _event_data_contentLength;
|
|
71
|
+
contentLength = (_event_data_contentLength = event.data.contentLength) !== null && _event_data_contentLength !== void 0 ? _event_data_contentLength : 0;
|
|
72
|
+
break;
|
|
73
|
+
case "Progress":
|
|
74
|
+
downloaded += event.data.chunkLength;
|
|
75
|
+
if (onProgress && contentLength > 0) {
|
|
76
|
+
onProgress(Math.round(downloaded / contentLength * 100));
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
case "Finished":
|
|
80
|
+
if (onProgress) {
|
|
81
|
+
onProgress(100);
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return true;
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error("[updater] Failed to download and install update:", error);
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
isSupported() {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
108
95
|
};
|
|
96
|
+
|
|
109
97
|
//# sourceMappingURL=index.tauri.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.tauri.native.js","names":[],"sources":["cjs/updater/index.tauri.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_tauri_exports = {};\n__export(index_tauri_exports, {\n updater: () => updater\n});\nmodule.exports = __toCommonJS(index_tauri_exports);\nvar _updater = null;\nasync function getUpdater() {\n if (!_updater) {\n _updater = await import(\"@tauri-apps/plugin-updater\");\n }\n return _updater;\n}\nvar updater = {\n async checkForUpdates() {\n try {\n var { check } = await getUpdater();\n var update = await check();\n if (update) {\n var _update_date, _update_body;\n return {\n version: update.version,\n date: (_update_date = update.date) !== null && _update_date !== void 0 ? _update_date : (/* @__PURE__ */ new Date()).toISOString(),\n body: (_update_body = update.body) !== null && _update_body !== void 0 ? _update_body : void 0\n };\n }\n return null;\n } catch (error) {\n console.error(\"[updater] Failed to check for updates:\", error);\n return null;\n }\n },\n async downloadAndInstall(onProgress) {\n try {\n var { check } = await getUpdater();\n var update = await check();\n if (!update) {\n return false;\n }\n var downloaded = 0;\n var contentLength = 0;\n await update.downloadAndInstall(function(event) {\n switch (event.event) {\n case \"Started\":\n var _event_data_contentLength;\n contentLength = (_event_data_contentLength = event.data.contentLength) !== null && _event_data_contentLength !== void 0 ? _event_data_contentLength : 0;\n break;\n case \"Progress\":\n downloaded += event.data.chunkLength;\n if (onProgress && contentLength > 0) {\n onProgress(Math.round(downloaded / contentLength * 100));\n }\n break;\n case \"Finished\":\n if (onProgress) {\n onProgress(100);\n }\n break;\n }\n });\n return true;\n } catch (error) {\n console.error(\"[updater] Failed to download and install update:\", error);\n return false;\n }\n },\n isSupported() {\n return true;\n }\n};\n//# sourceMappingURL=index.tauri.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,sBAAsB,CAAC;AAC3B,SAAS,qBAAqB,EAC5B,eAAe,QACjB,CAAC;AACD,OAAO,UAAU,aAAa,mBAAmB;AACjD,IAAI,WAAW;AACf,eAAe,aAAa;CAC1B,IAAI,CAAC,UAAU;EACb,WAAW,MAAM,OAAO;CAC1B;CACA,OAAO;AACT;AACA,IAAI,UAAU;CACZ,MAAM,kBAAkB;EACtB,IAAI;GACF,IAAI,EAAE,UAAU,MAAM,WAAW;GACjC,IAAI,SAAS,MAAM,MAAM;GACzB,IAAI,QAAQ;IACV,IAAI,cAAc;IAClB,OAAO;KACL,SAAS,OAAO;KAChB,OAAO,eAAe,OAAO,UAAU,QAAQ,iBAAiB,KAAK,IAAI,gCAAgC,IAAI,KAAK,EAAC,CAAE,YAAY;KACjI,OAAO,eAAe,OAAO,UAAU,QAAQ,iBAAiB,KAAK,IAAI,eAAe,KAAK;IAC/F;GACF;GACA,OAAO;EACT,SAAS,OAAO;GACd,QAAQ,MAAM,0CAA0C,KAAK;GAC7D,OAAO;EACT;CACF;CACA,MAAM,mBAAmB,YAAY;EACnC,IAAI;GACF,IAAI,EAAE,UAAU,MAAM,WAAW;GACjC,IAAI,SAAS,MAAM,MAAM;GACzB,IAAI,CAAC,QAAQ;IACX,OAAO;GACT;GACA,IAAI,aAAa;GACjB,IAAI,gBAAgB;GACpB,MAAM,OAAO,mBAAmB,SAAS,OAAO;IAC9C,QAAQ,MAAM,OAAd;KACE,KAAK;MACH,IAAI;MACJ,iBAAiB,4BAA4B,MAAM,KAAK,mBAAmB,QAAQ,8BAA8B,KAAK,IAAI,4BAA4B;MACtJ;KACF,KAAK;MACH,cAAc,MAAM,KAAK;MACzB,IAAI,cAAc,gBAAgB,GAAG;OACnC,WAAW,KAAK,MAAM,aAAa,gBAAgB,GAAG,CAAC;MACzD;MACA;KACF,KAAK;MACH,IAAI,YAAY;OACd,WAAW,GAAG;MAChB;MACA;IACJ;GACF,CAAC;GACD,OAAO;EACT,SAAS,OAAO;GACd,QAAQ,MAAM,oDAAoD,KAAK;GACvE,OAAO;EACT;CACF;CACA,cAAc;EACZ,OAAO;CACT;AACF"}
|
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
function browserDialog(name, api) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
const fn = typeof window === "undefined" ? void 0 : window[name];
|
|
3
|
+
if (typeof fn !== "function") {
|
|
4
|
+
throw new Error(`@multiplatform.one/desktop: dialog.${api} needs window.${name}, which this platform does not have. The dialog defaults are the browser's modal globals and are web-only; GNOME needs an Adw.AlertDialog backend in dialog/index.gnome.ts.`);
|
|
5
|
+
}
|
|
6
|
+
return fn.bind(window);
|
|
7
7
|
}
|
|
8
8
|
const dialog = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
async open(_options) {
|
|
10
|
+
return null;
|
|
11
|
+
},
|
|
12
|
+
async save(_options) {
|
|
13
|
+
return null;
|
|
14
|
+
},
|
|
15
|
+
async message(message, options) {
|
|
16
|
+
browserDialog("alert", "message")(options?.title ? `${options.title}
|
|
17
17
|
|
|
18
18
|
${message}` : message);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
},
|
|
20
|
+
async ask(message, options) {
|
|
21
|
+
return browserDialog("confirm", "ask")(options?.title ? `${options.title}
|
|
22
22
|
|
|
23
23
|
${message}` : message);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
},
|
|
25
|
+
async confirm(message, options) {
|
|
26
|
+
return browserDialog("confirm", "confirm")(options?.title ? `${options.title}
|
|
27
27
|
|
|
28
28
|
${message}` : message);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
},
|
|
30
|
+
async prompt(message, defaultValue = "") {
|
|
31
|
+
return browserDialog("prompt", "prompt")(message, defaultValue);
|
|
32
|
+
}
|
|
33
33
|
};
|
|
34
|
+
|
|
34
35
|
export { dialog };
|
|
35
36
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/dialog/index.js"],"sourcesContent":["function browserDialog(name, api) {\n const fn = typeof window === \"undefined\" ? void 0 : window[name];\n if (typeof fn !== \"function\") {\n throw new Error(\n `@multiplatform.one/desktop: dialog.${api} needs window.${name}, which this platform does not have. The dialog defaults are the browser's modal globals and are web-only; GNOME needs an Adw.AlertDialog backend in dialog/index.gnome.ts.`\n );\n }\n return fn.bind(window);\n}\nconst dialog = {\n async open(_options) {\n return null;\n },\n async save(_options) {\n return null;\n },\n async message(message, options) {\n browserDialog(\"alert\", \"message\")(options?.title ? `${options.title}\n\n${message}` : message);\n },\n async ask(message, options) {\n return browserDialog(\n \"confirm\",\n \"ask\"\n )(options?.title ? `${options.title}\n\n${message}` : message);\n },\n async confirm(message, options) {\n return browserDialog(\n \"confirm\",\n \"confirm\"\n )(options?.title ? `${options.title}\n\n${message}` : message);\n },\n async prompt(message, defaultValue = \"\") {\n return browserDialog(\"prompt\", \"prompt\")(message, defaultValue);\n }\n};\nexport {\n dialog\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";AAAA,SAAS,cAAc,MAAM,KAAK;CAChC,MAAM,KAAK,OAAO,WAAW,cAAc,KAAK,IAAI,OAAO;CAC3D,IAAI,OAAO,OAAO,YAAY;EAC5B,MAAM,IAAI,MACR,sCAAsC,IAAI,gBAAgB,KAAK,4KACjE;CACF;CACA,OAAO,GAAG,KAAK,MAAM;AACvB;AACA,MAAM,SAAS;CACb,MAAM,KAAK,UAAU;EACnB,OAAO;CACT;CACA,MAAM,KAAK,UAAU;EACnB,OAAO;CACT;CACA,MAAM,QAAQ,SAAS,SAAS;EAC9B,cAAc,SAAS,SAAS,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,MAAM;;EAEtE,YAAY,OAAO;CACnB;CACA,MAAM,IAAI,SAAS,SAAS;EAC1B,OAAO,cACL,WACA,KACF,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,MAAM;;EAEtC,YAAY,OAAO;CACnB;CACA,MAAM,QAAQ,SAAS,SAAS;EAC9B,OAAO,cACL,WACA,SACF,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,MAAM;;EAEtC,YAAY,OAAO;CACnB;CACA,MAAM,OAAO,SAAS,eAAe,IAAI;EACvC,OAAO,cAAc,UAAU,QAAQ,CAAC,CAAC,SAAS,YAAY;CAChE;AACF"}
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
function browserDialog(name, api) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var fn = typeof window === "undefined" ? void 0 : window[name];
|
|
3
|
+
if (typeof fn !== "function") {
|
|
4
|
+
throw new Error(`@multiplatform.one/desktop: dialog.${api} needs window.${name}, which this platform does not have. The dialog defaults are the browser's modal globals and are web-only; GNOME needs an Adw.AlertDialog backend in dialog/index.gnome.ts.`);
|
|
5
|
+
}
|
|
6
|
+
return fn.bind(window);
|
|
7
7
|
}
|
|
8
8
|
var dialog = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
async open(_options) {
|
|
10
|
+
return null;
|
|
11
|
+
},
|
|
12
|
+
async save(_options) {
|
|
13
|
+
return null;
|
|
14
|
+
},
|
|
15
|
+
async message(message, options) {
|
|
16
|
+
browserDialog("alert", "message")((options === null || options === void 0 ? void 0 : options.title) ? `${options.title}
|
|
17
17
|
|
|
18
18
|
${message}` : message);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
},
|
|
20
|
+
async ask(message, options) {
|
|
21
|
+
return browserDialog("confirm", "ask")((options === null || options === void 0 ? void 0 : options.title) ? `${options.title}
|
|
22
22
|
|
|
23
23
|
${message}` : message);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
},
|
|
25
|
+
async confirm(message, options) {
|
|
26
|
+
return browserDialog("confirm", "confirm")((options === null || options === void 0 ? void 0 : options.title) ? `${options.title}
|
|
27
27
|
|
|
28
28
|
${message}` : message);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
},
|
|
30
|
+
async prompt(message) {
|
|
31
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
32
|
+
return browserDialog("prompt", "prompt")(message, defaultValue);
|
|
33
|
+
}
|
|
34
34
|
};
|
|
35
|
+
|
|
35
36
|
export { dialog };
|
|
36
37
|
//# sourceMappingURL=index.native.js.map
|