@multiplatform.one/desktop 9.17.0 → 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.
Files changed (73) hide show
  1. package/dist/cjs/dialog/index.cjs +37 -41
  2. package/dist/cjs/dialog/index.native.cjs +59 -0
  3. package/dist/cjs/dialog/index.native.js +38 -41
  4. package/dist/cjs/dialog/index.native.js.map +1 -1
  5. package/dist/cjs/dialog/index.tauri.cjs +58 -62
  6. package/dist/cjs/dialog/index.tauri.native.cjs +72 -0
  7. package/dist/cjs/dialog/index.tauri.native.js +58 -61
  8. package/dist/cjs/dialog/index.tauri.native.js.map +1 -1
  9. package/dist/cjs/fs/index.cjs +35 -39
  10. package/dist/cjs/fs/index.native.cjs +48 -0
  11. package/dist/cjs/fs/index.native.js +35 -38
  12. package/dist/cjs/fs/index.native.js.map +1 -1
  13. package/dist/cjs/fs/index.tauri.cjs +35 -39
  14. package/dist/cjs/fs/index.tauri.native.cjs +49 -0
  15. package/dist/cjs/fs/index.tauri.native.js +35 -38
  16. package/dist/cjs/fs/index.tauri.native.js.map +1 -1
  17. package/dist/cjs/index.cjs +9 -11
  18. package/dist/cjs/index.native.cjs +23 -0
  19. package/dist/cjs/index.native.js +9 -10
  20. package/dist/cjs/index.native.js.map +1 -1
  21. package/dist/cjs/paths/index.cjs +31 -35
  22. package/dist/cjs/paths/index.native.cjs +50 -0
  23. package/dist/cjs/paths/index.native.js +37 -40
  24. package/dist/cjs/paths/index.native.js.map +1 -1
  25. package/dist/cjs/paths/index.tauri.cjs +29 -41
  26. package/dist/cjs/paths/index.tauri.native.cjs +49 -0
  27. package/dist/cjs/paths/index.tauri.native.js +35 -46
  28. package/dist/cjs/paths/index.tauri.native.js.map +1 -1
  29. package/dist/cjs/updater/index.cjs +23 -27
  30. package/dist/cjs/updater/index.native.cjs +36 -0
  31. package/dist/cjs/updater/index.native.js +23 -26
  32. package/dist/cjs/updater/index.native.js.map +1 -1
  33. package/dist/cjs/updater/index.tauri.cjs +74 -87
  34. package/dist/cjs/updater/index.tauri.native.cjs +95 -0
  35. package/dist/cjs/updater/index.tauri.native.js +76 -88
  36. package/dist/cjs/updater/index.tauri.native.js.map +1 -1
  37. package/dist/esm/dialog/index.mjs +24 -23
  38. package/dist/esm/dialog/index.mjs.map +1 -1
  39. package/dist/esm/dialog/index.native.js +25 -24
  40. package/dist/esm/dialog/index.native.js.map +1 -1
  41. package/dist/esm/dialog/index.tauri.mjs +47 -45
  42. package/dist/esm/dialog/index.tauri.mjs.map +1 -1
  43. package/dist/esm/dialog/index.tauri.native.js +47 -45
  44. package/dist/esm/dialog/index.tauri.native.js.map +1 -1
  45. package/dist/esm/fs/index.mjs +22 -21
  46. package/dist/esm/fs/index.mjs.map +1 -1
  47. package/dist/esm/fs/index.native.js +22 -21
  48. package/dist/esm/fs/index.native.js.map +1 -1
  49. package/dist/esm/fs/index.tauri.mjs +24 -22
  50. package/dist/esm/fs/index.tauri.mjs.map +1 -1
  51. package/dist/esm/fs/index.tauri.native.js +24 -22
  52. package/dist/esm/fs/index.tauri.native.js.map +1 -1
  53. package/dist/esm/index.mjs +7 -5
  54. package/dist/esm/index.native.js +7 -5
  55. package/dist/esm/paths/index.mjs +18 -17
  56. package/dist/esm/paths/index.mjs.map +1 -1
  57. package/dist/esm/paths/index.native.js +24 -23
  58. package/dist/esm/paths/index.native.js.map +1 -1
  59. package/dist/esm/paths/index.tauri.mjs +17 -23
  60. package/dist/esm/paths/index.tauri.mjs.map +1 -1
  61. package/dist/esm/paths/index.tauri.native.js +23 -29
  62. package/dist/esm/paths/index.tauri.native.js.map +1 -1
  63. package/dist/esm/updater/index.mjs +10 -9
  64. package/dist/esm/updater/index.mjs.map +1 -1
  65. package/dist/esm/updater/index.native.js +10 -9
  66. package/dist/esm/updater/index.native.js.map +1 -1
  67. package/dist/esm/updater/index.tauri.mjs +58 -61
  68. package/dist/esm/updater/index.tauri.mjs.map +1 -1
  69. package/dist/esm/updater/index.tauri.native.js +60 -63
  70. package/dist/esm/updater/index.tauri.native.js.map +1 -1
  71. package/package.json +2 -2
  72. package/dist/esm/index.mjs.map +0 -1
  73. package/dist/esm/index.native.js.map +0 -1
@@ -5,37 +5,34 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
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
- 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;
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 __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
23
  var updater_exports = {};
26
- __export(updater_exports, {
27
- updater: () => updater
28
- });
24
+ __export(updater_exports, { updater: () => updater });
29
25
  module.exports = __toCommonJS(updater_exports);
30
26
  var updater = {
31
- async checkForUpdates() {
32
- return null;
33
- },
34
- async downloadAndInstall() {
35
- return false;
36
- },
37
- isSupported() {
38
- return false;
39
- }
27
+ async checkForUpdates() {
28
+ return null;
29
+ },
30
+ async downloadAndInstall() {
31
+ return false;
32
+ },
33
+ isSupported() {
34
+ return false;
35
+ }
40
36
  };
37
+
41
38
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","updater_exports","updater","module","exports","checkForUpdates","downloadAndInstall","isSupported"],"sources":["index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar updater_exports = {};\n__export(updater_exports, {\n updater: () => updater\n});\nmodule.exports = __toCommonJS(updater_exports);\nvar updater = {\n async checkForUpdates() {\n return null;\n },\n async downloadAndInstall() {\n return false;\n },\n isSupported() {\n return false;\n }\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC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ACDC,WAAWA,CAAA,EAAG;IACZ,OAAO,KAAK;EACd;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/updater/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar updater_exports = {};\n__export(updater_exports, {\n updater: () => updater\n});\nmodule.exports = __toCommonJS(updater_exports);\nvar updater = {\n async checkForUpdates() {\n return null;\n },\n async downloadAndInstall() {\n return false;\n },\n isSupported() {\n return false;\n }\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,kBAAkB,CAAC;AACvB,SAAS,iBAAiB,EACxB,eAAe,QACjB,CAAC;AACD,OAAO,UAAU,aAAa,eAAe;AAC7C,IAAI,UAAU;CACZ,MAAM,kBAAkB;EACtB,OAAO;CACT;CACA,MAAM,qBAAqB;EACzB,OAAO;CACT;CACA,cAAc;EACZ,OAAO;CACT;AACF"}
@@ -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
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
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
- 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;
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
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
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
- if (!_updater) {
42
- _updater = await import("@tauri-apps/plugin-updater");
43
- }
44
- return _updater;
32
+ if (!_updater) {
33
+ _updater = await import("@tauri-apps/plugin-updater");
34
+ }
35
+ return _updater;
45
36
  }
46
37
  const updater = {
47
- async checkForUpdates() {
48
- try {
49
- const {
50
- check
51
- } = await getUpdater();
52
- const update = await check();
53
- if (update) {
54
- return {
55
- version: update.version,
56
- date: update.date ?? (/* @__PURE__ */new Date()).toISOString(),
57
- body: update.body ?? void 0
58
- };
59
- }
60
- return null;
61
- } catch (error) {
62
- console.error("[updater] Failed to check for updates:", error);
63
- return null;
64
- }
65
- },
66
- async downloadAndInstall(onProgress) {
67
- try {
68
- const {
69
- check
70
- } = await getUpdater();
71
- const update = await check();
72
- if (!update) {
73
- return false;
74
- }
75
- let downloaded = 0;
76
- let contentLength = 0;
77
- await update.downloadAndInstall(event => {
78
- switch (event.event) {
79
- case "Started":
80
- contentLength = event.data.contentLength ?? 0;
81
- break;
82
- case "Progress":
83
- downloaded += event.data.chunkLength;
84
- if (onProgress && contentLength > 0) {
85
- onProgress(Math.round(downloaded / contentLength * 100));
86
- }
87
- break;
88
- case "Finished":
89
- if (onProgress) {
90
- onProgress(100);
91
- }
92
- break;
93
- }
94
- });
95
- return true;
96
- } catch (error) {
97
- console.error("[updater] Failed to download and install update:", error);
98
- return false;
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
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
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
- 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;
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
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
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
- if (!_updater) {
44
- _updater = await import("@tauri-apps/plugin-updater");
45
- }
46
- return _updater;
34
+ if (!_updater) {
35
+ _updater = await import("@tauri-apps/plugin-updater");
36
+ }
37
+ return _updater;
47
38
  }
48
39
  var updater = {
49
- async checkForUpdates() {
50
- try {
51
- var {
52
- check
53
- } = await getUpdater();
54
- var update = await check();
55
- if (update) {
56
- var _update_date, _update_body;
57
- return {
58
- version: update.version,
59
- date: (_update_date = update.date) !== null && _update_date !== void 0 ? _update_date : (/* @__PURE__ */new Date()).toISOString(),
60
- body: (_update_body = update.body) !== null && _update_body !== void 0 ? _update_body : void 0
61
- };
62
- }
63
- return null;
64
- } catch (error) {
65
- console.error("[updater] Failed to check for updates:", error);
66
- return null;
67
- }
68
- },
69
- async downloadAndInstall(onProgress) {
70
- try {
71
- var {
72
- check
73
- } = await getUpdater();
74
- var update = await check();
75
- if (!update) {
76
- return false;
77
- }
78
- var downloaded = 0;
79
- var contentLength = 0;
80
- await update.downloadAndInstall(function (event) {
81
- switch (event.event) {
82
- case "Started":
83
- var _event_data_contentLength;
84
- contentLength = (_event_data_contentLength = event.data.contentLength) !== null && _event_data_contentLength !== void 0 ? _event_data_contentLength : 0;
85
- break;
86
- case "Progress":
87
- downloaded += event.data.chunkLength;
88
- if (onProgress && contentLength > 0) {
89
- onProgress(Math.round(downloaded / contentLength * 100));
90
- }
91
- break;
92
- case "Finished":
93
- if (onProgress) {
94
- onProgress(100);
95
- }
96
- break;
97
- }
98
- });
99
- return true;
100
- } catch (error) {
101
- console.error("[updater] Failed to download and install update:", error);
102
- return false;
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,"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","index_tauri_exports","updater","module","exports","_updater","getUpdater","checkForUpdates","check","update","_update_date","_update_body","version","date","Date","toISOString","body","error","console","downloadAndInstall","onProgress","downloaded","contentLength","event","_event_data_contentLength","data","chunkLength","Math","round","isSupported"],"sources":["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":"AAAA,YAAY;;AACZ,IAAIA,QAAQ,GAAGC,MAAM,CAACC,MAAM;AAC5B,IAAIC,SAAS,GAAGF,MAAM,CAACG,cAAc;AACrC,IAAIC,gBAAgB,GAAGJ,MAAM,CAACK,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGN,MAAM,CAACO,mBAAmB;AAClD,IAAIC,YAAY,GAAGR,MAAM,CAACS,cAAc;AACxC,IAAIC,YAAY,GAAGV,MAAM,CAACW,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,C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C9D,OAAO,IAAI;IACb;EACF,CAAC;EACD,MAAME,kBAAkBA,CAACC,UAAU,EAAE;IACnC,IAAI;MACF,IAAI;QAAEZ;MAAM,CAAC,GAAG,MAAMF,UAAU,CAAC,CAAC;MAClC,IAAIG,MAAM,GAAG,MAAMD,KAAK,CAAC,CAAC;MAC1B,IAAI,CAACC,MAAM,EAAE;QACX,OAAO,KAAK;MACd;MACA,IAAIY,UAAU,GAAG,CAAC;MAClB,IAAIC,aAAa,GAAG,CAAC;MACrB,MAAMb,MAAM,CAACU,kBAAkB,CAAC,UAASI,KAAK,EAAE;QAC9C,QAAQA,KAAK,CAACA,KAAK;UACjB,KAAK,SAAS;YACZ,IAAIC,yBAAyB;YAC7BF,aAAa,GAAG,CAACE,yBAAyB,GAAGD,KAAK,CAACE,IAAI,CAACH,aAAa,MAAM,IAAI,IAAIE,yBAAyB,KAAK,KAAK,CAAC,GAAGA,yBAAyB,GAAG,CAAC;YACvJ;UACF,KAAK,UAAU;YACbH,UAAU,IAAIE,KAAK,CAACE,IAAI,CAACC,WAAW;YACpC,IAAIN,UAAU,IAAIE,aAAa,GAAG,CAAC,EAAE;cACnCF,UAAU,CAACO,IAAI,CAACC,KAAK,CAACP,UAAU,GAAGC,aAAa,GAAG,GAAG,CAAC,CAAC;YAC1D;YACA;UACF,KAAK,UAAU;YACb,IAAIF,UAAU,EAAE;cACdA,UAAU,CAAC,GAAG,CAAC;YACjB;YACA;QACJ;MACF,CAAC,CAAC;MACF,OAAO,IAAI;IACb,CAAC,CAAC,OAAOH,KAAK,EAAE;MACdC,OAAO,CAACD,KAAK,CAAC,kDAAkD,EAAEA,KAAK,CAAC;MACxE,OAAO,KAAK;IACd;EACF,CAAC;EACDY,WAAWA,CAAA,EAAG;IACZ,OAAO,IAAI;EACb;AACF,CAAC","ignoreList":[]}
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;CAA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BAAgB,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
- 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);
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
- 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}
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
- async ask(message, options) {
21
- return browserDialog("confirm", "ask")(options?.title ? `${options.title}
19
+ },
20
+ async ask(message, options) {
21
+ return browserDialog("confirm", "ask")(options?.title ? `${options.title}
22
22
 
23
23
  ${message}` : message);
24
- },
25
- async confirm(message, options) {
26
- return browserDialog("confirm", "confirm")(options?.title ? `${options.title}
24
+ },
25
+ async confirm(message, options) {
26
+ return browserDialog("confirm", "confirm")(options?.title ? `${options.title}
27
27
 
28
28
  ${message}` : message);
29
- },
30
- async prompt(message, defaultValue = "") {
31
- return browserDialog("prompt", "prompt")(message, defaultValue);
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