@stacksjs/desktop 0.57.4 → 0.58.19
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/README.md +4 -4
- package/dist/index.js +3075 -0
- package/package.json +41 -24
- package/LICENSE.md +0 -21
- package/dist/drivers/index.d.ts +0 -1
- package/dist/drivers/index.mjs +0 -1
- package/dist/drivers/tauri/index.d.ts +0 -1
- package/dist/drivers/tauri/index.mjs +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +0 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1,3075 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
set: (newValue) => all[name] = () => newValue
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/shell.js
|
|
14
|
+
var exports_shell = {};
|
|
15
|
+
__export(exports_shell, {
|
|
16
|
+
open: () => {
|
|
17
|
+
{
|
|
18
|
+
return open;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
EventEmitter: () => {
|
|
22
|
+
{
|
|
23
|
+
return EventEmitter;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
Command: () => {
|
|
27
|
+
{
|
|
28
|
+
return Command;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
Child: () => {
|
|
32
|
+
{
|
|
33
|
+
return Child;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/tauri.js
|
|
39
|
+
var exports_tauri = {};
|
|
40
|
+
__export(exports_tauri, {
|
|
41
|
+
transformCallback: () => {
|
|
42
|
+
{
|
|
43
|
+
return transformCallback;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
invoke: () => {
|
|
47
|
+
{
|
|
48
|
+
return invoke;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
convertFileSrc: () => {
|
|
52
|
+
{
|
|
53
|
+
return convertFileSrc;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
var uid = function() {
|
|
58
|
+
return window.crypto.getRandomValues(new Uint32Array(1))[0];
|
|
59
|
+
};
|
|
60
|
+
var transformCallback = function(callback, once = false) {
|
|
61
|
+
const identifier = uid();
|
|
62
|
+
const prop = `_${identifier}`;
|
|
63
|
+
Object.defineProperty(window, prop, {
|
|
64
|
+
value: (result) => {
|
|
65
|
+
if (once) {
|
|
66
|
+
Reflect.deleteProperty(window, prop);
|
|
67
|
+
}
|
|
68
|
+
return callback?.(result);
|
|
69
|
+
},
|
|
70
|
+
writable: false,
|
|
71
|
+
configurable: true
|
|
72
|
+
});
|
|
73
|
+
return identifier;
|
|
74
|
+
};
|
|
75
|
+
async function invoke(cmd, args = {}) {
|
|
76
|
+
return new Promise((resolve, reject) => {
|
|
77
|
+
const callback = transformCallback((e) => {
|
|
78
|
+
resolve(e);
|
|
79
|
+
Reflect.deleteProperty(window, `_${error}`);
|
|
80
|
+
}, true);
|
|
81
|
+
const error = transformCallback((e) => {
|
|
82
|
+
reject(e);
|
|
83
|
+
Reflect.deleteProperty(window, `_${callback}`);
|
|
84
|
+
}, true);
|
|
85
|
+
window.__TAURI_IPC__({
|
|
86
|
+
cmd,
|
|
87
|
+
callback,
|
|
88
|
+
error,
|
|
89
|
+
...args
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
var convertFileSrc = function(filePath, protocol = "asset") {
|
|
94
|
+
return window.__TAURI__.convertFileSrc(filePath, protocol);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/helpers/tauri.js
|
|
98
|
+
async function invokeTauriCommand(command) {
|
|
99
|
+
return invoke("tauri", command);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/shell.js
|
|
103
|
+
async function execute(onEvent, program, args = [], options) {
|
|
104
|
+
if (typeof args === "object") {
|
|
105
|
+
Object.freeze(args);
|
|
106
|
+
}
|
|
107
|
+
return invokeTauriCommand({
|
|
108
|
+
__tauriModule: "Shell",
|
|
109
|
+
message: {
|
|
110
|
+
cmd: "execute",
|
|
111
|
+
program,
|
|
112
|
+
args,
|
|
113
|
+
options,
|
|
114
|
+
onEventFn: transformCallback(onEvent)
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
async function open(path, openWith) {
|
|
119
|
+
return invokeTauriCommand({
|
|
120
|
+
__tauriModule: "Shell",
|
|
121
|
+
message: {
|
|
122
|
+
cmd: "open",
|
|
123
|
+
path,
|
|
124
|
+
with: openWith
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
class EventEmitter {
|
|
130
|
+
constructor() {
|
|
131
|
+
this.eventListeners = Object.create(null);
|
|
132
|
+
}
|
|
133
|
+
addListener(eventName, listener) {
|
|
134
|
+
return this.on(eventName, listener);
|
|
135
|
+
}
|
|
136
|
+
removeListener(eventName, listener) {
|
|
137
|
+
return this.off(eventName, listener);
|
|
138
|
+
}
|
|
139
|
+
on(eventName, listener) {
|
|
140
|
+
if (eventName in this.eventListeners) {
|
|
141
|
+
this.eventListeners[eventName].push(listener);
|
|
142
|
+
} else {
|
|
143
|
+
this.eventListeners[eventName] = [listener];
|
|
144
|
+
}
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
once(eventName, listener) {
|
|
148
|
+
const wrapper = (...args) => {
|
|
149
|
+
this.removeListener(eventName, wrapper);
|
|
150
|
+
listener(...args);
|
|
151
|
+
};
|
|
152
|
+
return this.addListener(eventName, wrapper);
|
|
153
|
+
}
|
|
154
|
+
off(eventName, listener) {
|
|
155
|
+
if (eventName in this.eventListeners) {
|
|
156
|
+
this.eventListeners[eventName] = this.eventListeners[eventName].filter((l) => l !== listener);
|
|
157
|
+
}
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
160
|
+
removeAllListeners(event) {
|
|
161
|
+
if (event) {
|
|
162
|
+
delete this.eventListeners[event];
|
|
163
|
+
} else {
|
|
164
|
+
this.eventListeners = Object.create(null);
|
|
165
|
+
}
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
emit(eventName, ...args) {
|
|
169
|
+
if (eventName in this.eventListeners) {
|
|
170
|
+
const listeners = this.eventListeners[eventName];
|
|
171
|
+
for (const listener of listeners)
|
|
172
|
+
listener(...args);
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
listenerCount(eventName) {
|
|
178
|
+
if (eventName in this.eventListeners)
|
|
179
|
+
return this.eventListeners[eventName].length;
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
prependListener(eventName, listener) {
|
|
183
|
+
if (eventName in this.eventListeners) {
|
|
184
|
+
this.eventListeners[eventName].unshift(listener);
|
|
185
|
+
} else {
|
|
186
|
+
this.eventListeners[eventName] = [listener];
|
|
187
|
+
}
|
|
188
|
+
return this;
|
|
189
|
+
}
|
|
190
|
+
prependOnceListener(eventName, listener) {
|
|
191
|
+
const wrapper = (...args) => {
|
|
192
|
+
this.removeListener(eventName, wrapper);
|
|
193
|
+
listener(...args);
|
|
194
|
+
};
|
|
195
|
+
return this.prependListener(eventName, wrapper);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
class Child {
|
|
200
|
+
constructor(pid) {
|
|
201
|
+
this.pid = pid;
|
|
202
|
+
}
|
|
203
|
+
async write(data) {
|
|
204
|
+
return invokeTauriCommand({
|
|
205
|
+
__tauriModule: "Shell",
|
|
206
|
+
message: {
|
|
207
|
+
cmd: "stdinWrite",
|
|
208
|
+
pid: this.pid,
|
|
209
|
+
buffer: typeof data === "string" ? data : Array.from(data)
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
async kill() {
|
|
214
|
+
return invokeTauriCommand({
|
|
215
|
+
__tauriModule: "Shell",
|
|
216
|
+
message: {
|
|
217
|
+
cmd: "killChild",
|
|
218
|
+
pid: this.pid
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
class Command extends EventEmitter {
|
|
225
|
+
constructor(program, args = [], options) {
|
|
226
|
+
super();
|
|
227
|
+
this.stdout = new EventEmitter;
|
|
228
|
+
this.stderr = new EventEmitter;
|
|
229
|
+
this.program = program;
|
|
230
|
+
this.args = typeof args === "string" ? [args] : args;
|
|
231
|
+
this.options = options ?? {};
|
|
232
|
+
}
|
|
233
|
+
static sidecar(program, args = [], options) {
|
|
234
|
+
const instance = new Command(program, args, options);
|
|
235
|
+
instance.options.sidecar = true;
|
|
236
|
+
return instance;
|
|
237
|
+
}
|
|
238
|
+
async spawn() {
|
|
239
|
+
return execute((event) => {
|
|
240
|
+
switch (event.event) {
|
|
241
|
+
case "Error":
|
|
242
|
+
this.emit("error", event.payload);
|
|
243
|
+
break;
|
|
244
|
+
case "Terminated":
|
|
245
|
+
this.emit("close", event.payload);
|
|
246
|
+
break;
|
|
247
|
+
case "Stdout":
|
|
248
|
+
this.stdout.emit("data", event.payload);
|
|
249
|
+
break;
|
|
250
|
+
case "Stderr":
|
|
251
|
+
this.stderr.emit("data", event.payload);
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
}, this.program, this.args, this.options).then((pid) => new Child(pid));
|
|
255
|
+
}
|
|
256
|
+
async execute() {
|
|
257
|
+
return new Promise((resolve, reject) => {
|
|
258
|
+
this.on("error", reject);
|
|
259
|
+
const stdout = [];
|
|
260
|
+
const stderr = [];
|
|
261
|
+
this.stdout.on("data", (line) => {
|
|
262
|
+
stdout.push(line);
|
|
263
|
+
});
|
|
264
|
+
this.stderr.on("data", (line) => {
|
|
265
|
+
stderr.push(line);
|
|
266
|
+
});
|
|
267
|
+
this.on("close", (payload) => {
|
|
268
|
+
resolve({
|
|
269
|
+
code: payload.code,
|
|
270
|
+
signal: payload.signal,
|
|
271
|
+
stdout: stdout.join("\n"),
|
|
272
|
+
stderr: stderr.join("\n")
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
this.spawn().catch(reject);
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/app.js
|
|
281
|
+
var exports_app = {};
|
|
282
|
+
__export(exports_app, {
|
|
283
|
+
show: () => {
|
|
284
|
+
{
|
|
285
|
+
return show;
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
hide: () => {
|
|
289
|
+
{
|
|
290
|
+
return hide;
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
getVersion: () => {
|
|
294
|
+
{
|
|
295
|
+
return getVersion;
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
getTauriVersion: () => {
|
|
299
|
+
{
|
|
300
|
+
return getTauriVersion;
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
getName: () => {
|
|
304
|
+
{
|
|
305
|
+
return getName;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
async function getVersion() {
|
|
310
|
+
return invokeTauriCommand({
|
|
311
|
+
__tauriModule: "App",
|
|
312
|
+
message: {
|
|
313
|
+
cmd: "getAppVersion"
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
async function getName() {
|
|
318
|
+
return invokeTauriCommand({
|
|
319
|
+
__tauriModule: "App",
|
|
320
|
+
message: {
|
|
321
|
+
cmd: "getAppName"
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
async function getTauriVersion() {
|
|
326
|
+
return invokeTauriCommand({
|
|
327
|
+
__tauriModule: "App",
|
|
328
|
+
message: {
|
|
329
|
+
cmd: "getTauriVersion"
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
async function show() {
|
|
334
|
+
return invokeTauriCommand({
|
|
335
|
+
__tauriModule: "App",
|
|
336
|
+
message: {
|
|
337
|
+
cmd: "show"
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
async function hide() {
|
|
342
|
+
return invokeTauriCommand({
|
|
343
|
+
__tauriModule: "App",
|
|
344
|
+
message: {
|
|
345
|
+
cmd: "hide"
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/event.js
|
|
351
|
+
var exports_event = {};
|
|
352
|
+
__export(exports_event, {
|
|
353
|
+
once: () => {
|
|
354
|
+
{
|
|
355
|
+
return once2;
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
listen: () => {
|
|
359
|
+
{
|
|
360
|
+
return listen2;
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
emit: () => {
|
|
364
|
+
{
|
|
365
|
+
return emit2;
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
TauriEvent: () => {
|
|
369
|
+
{
|
|
370
|
+
return TauriEvent;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/helpers/event.js
|
|
376
|
+
async function _unlisten(event, eventId) {
|
|
377
|
+
return invokeTauriCommand({
|
|
378
|
+
__tauriModule: "Event",
|
|
379
|
+
message: {
|
|
380
|
+
cmd: "unlisten",
|
|
381
|
+
event,
|
|
382
|
+
eventId
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
async function emit(event, windowLabel, payload) {
|
|
387
|
+
await invokeTauriCommand({
|
|
388
|
+
__tauriModule: "Event",
|
|
389
|
+
message: {
|
|
390
|
+
cmd: "emit",
|
|
391
|
+
event,
|
|
392
|
+
windowLabel,
|
|
393
|
+
payload
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
async function listen(event, windowLabel, handler) {
|
|
398
|
+
return invokeTauriCommand({
|
|
399
|
+
__tauriModule: "Event",
|
|
400
|
+
message: {
|
|
401
|
+
cmd: "listen",
|
|
402
|
+
event,
|
|
403
|
+
windowLabel,
|
|
404
|
+
handler: transformCallback(handler)
|
|
405
|
+
}
|
|
406
|
+
}).then((eventId) => {
|
|
407
|
+
return async () => _unlisten(event, eventId);
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
async function once(event, windowLabel, handler) {
|
|
411
|
+
return listen(event, windowLabel, (eventData) => {
|
|
412
|
+
handler(eventData);
|
|
413
|
+
_unlisten(event, eventData.id).catch(() => {
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/event.js
|
|
419
|
+
async function listen2(event2, handler) {
|
|
420
|
+
return listen(event2, null, handler);
|
|
421
|
+
}
|
|
422
|
+
async function once2(event2, handler) {
|
|
423
|
+
return once(event2, null, handler);
|
|
424
|
+
}
|
|
425
|
+
async function emit2(event2, payload) {
|
|
426
|
+
return emit(event2, undefined, payload);
|
|
427
|
+
}
|
|
428
|
+
var TauriEvent;
|
|
429
|
+
(function(TauriEvent2) {
|
|
430
|
+
TauriEvent2["WINDOW_RESIZED"] = "tauri://resize";
|
|
431
|
+
TauriEvent2["WINDOW_MOVED"] = "tauri://move";
|
|
432
|
+
TauriEvent2["WINDOW_CLOSE_REQUESTED"] = "tauri://close-requested";
|
|
433
|
+
TauriEvent2["WINDOW_CREATED"] = "tauri://window-created";
|
|
434
|
+
TauriEvent2["WINDOW_DESTROYED"] = "tauri://destroyed";
|
|
435
|
+
TauriEvent2["WINDOW_FOCUS"] = "tauri://focus";
|
|
436
|
+
TauriEvent2["WINDOW_BLUR"] = "tauri://blur";
|
|
437
|
+
TauriEvent2["WINDOW_SCALE_FACTOR_CHANGED"] = "tauri://scale-change";
|
|
438
|
+
TauriEvent2["WINDOW_THEME_CHANGED"] = "tauri://theme-changed";
|
|
439
|
+
TauriEvent2["WINDOW_FILE_DROP"] = "tauri://file-drop";
|
|
440
|
+
TauriEvent2["WINDOW_FILE_DROP_HOVER"] = "tauri://file-drop-hover";
|
|
441
|
+
TauriEvent2["WINDOW_FILE_DROP_CANCELLED"] = "tauri://file-drop-cancelled";
|
|
442
|
+
TauriEvent2["MENU"] = "tauri://menu";
|
|
443
|
+
TauriEvent2["CHECK_UPDATE"] = "tauri://update";
|
|
444
|
+
TauriEvent2["UPDATE_AVAILABLE"] = "tauri://update-available";
|
|
445
|
+
TauriEvent2["INSTALL_UPDATE"] = "tauri://update-install";
|
|
446
|
+
TauriEvent2["STATUS_UPDATE"] = "tauri://update-status";
|
|
447
|
+
TauriEvent2["DOWNLOAD_PROGRESS"] = "tauri://update-download-progress";
|
|
448
|
+
})(TauriEvent || (TauriEvent = {}));
|
|
449
|
+
|
|
450
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/clipboard.js
|
|
451
|
+
var exports_clipboard = {};
|
|
452
|
+
__export(exports_clipboard, {
|
|
453
|
+
writeText: () => {
|
|
454
|
+
{
|
|
455
|
+
return writeText;
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
readText: () => {
|
|
459
|
+
{
|
|
460
|
+
return readText;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
async function writeText(text) {
|
|
465
|
+
return invokeTauriCommand({
|
|
466
|
+
__tauriModule: "Clipboard",
|
|
467
|
+
message: {
|
|
468
|
+
cmd: "writeText",
|
|
469
|
+
data: text
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
async function readText() {
|
|
474
|
+
return invokeTauriCommand({
|
|
475
|
+
__tauriModule: "Clipboard",
|
|
476
|
+
message: {
|
|
477
|
+
cmd: "readText",
|
|
478
|
+
data: null
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/dialog.js
|
|
484
|
+
var exports_dialog = {};
|
|
485
|
+
__export(exports_dialog, {
|
|
486
|
+
save: () => {
|
|
487
|
+
{
|
|
488
|
+
return save;
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
open: () => {
|
|
492
|
+
{
|
|
493
|
+
return open2;
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
message: () => {
|
|
497
|
+
{
|
|
498
|
+
return message;
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
confirm: () => {
|
|
502
|
+
{
|
|
503
|
+
return confirm;
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
ask: () => {
|
|
507
|
+
{
|
|
508
|
+
return ask;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
async function open2(options = {}) {
|
|
513
|
+
if (typeof options === "object") {
|
|
514
|
+
Object.freeze(options);
|
|
515
|
+
}
|
|
516
|
+
return invokeTauriCommand({
|
|
517
|
+
__tauriModule: "Dialog",
|
|
518
|
+
message: {
|
|
519
|
+
cmd: "openDialog",
|
|
520
|
+
options
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
async function save(options = {}) {
|
|
525
|
+
if (typeof options === "object") {
|
|
526
|
+
Object.freeze(options);
|
|
527
|
+
}
|
|
528
|
+
return invokeTauriCommand({
|
|
529
|
+
__tauriModule: "Dialog",
|
|
530
|
+
message: {
|
|
531
|
+
cmd: "saveDialog",
|
|
532
|
+
options
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
async function message(message2, options) {
|
|
537
|
+
const opts = typeof options === "string" ? { title: options } : options;
|
|
538
|
+
return invokeTauriCommand({
|
|
539
|
+
__tauriModule: "Dialog",
|
|
540
|
+
message: {
|
|
541
|
+
cmd: "messageDialog",
|
|
542
|
+
message: message2.toString(),
|
|
543
|
+
title: opts?.title?.toString(),
|
|
544
|
+
type: opts?.type,
|
|
545
|
+
buttonLabel: opts?.okLabel?.toString()
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
async function ask(message2, options) {
|
|
550
|
+
const opts = typeof options === "string" ? { title: options } : options;
|
|
551
|
+
return invokeTauriCommand({
|
|
552
|
+
__tauriModule: "Dialog",
|
|
553
|
+
message: {
|
|
554
|
+
cmd: "askDialog",
|
|
555
|
+
message: message2.toString(),
|
|
556
|
+
title: opts?.title?.toString(),
|
|
557
|
+
type: opts?.type,
|
|
558
|
+
buttonLabels: [
|
|
559
|
+
opts?.okLabel?.toString() ?? "Yes",
|
|
560
|
+
opts?.cancelLabel?.toString() ?? "No"
|
|
561
|
+
]
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
async function confirm(message2, options) {
|
|
566
|
+
const opts = typeof options === "string" ? { title: options } : options;
|
|
567
|
+
return invokeTauriCommand({
|
|
568
|
+
__tauriModule: "Dialog",
|
|
569
|
+
message: {
|
|
570
|
+
cmd: "confirmDialog",
|
|
571
|
+
message: message2.toString(),
|
|
572
|
+
title: opts?.title?.toString(),
|
|
573
|
+
type: opts?.type,
|
|
574
|
+
buttonLabels: [
|
|
575
|
+
opts?.okLabel?.toString() ?? "Ok",
|
|
576
|
+
opts?.cancelLabel?.toString() ?? "Cancel"
|
|
577
|
+
]
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/fs.js
|
|
583
|
+
var exports_fs = {};
|
|
584
|
+
__export(exports_fs, {
|
|
585
|
+
writeTextFile: () => {
|
|
586
|
+
{
|
|
587
|
+
return writeTextFile;
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
writeFile: () => {
|
|
591
|
+
{
|
|
592
|
+
return writeTextFile;
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
writeBinaryFile: () => {
|
|
596
|
+
{
|
|
597
|
+
return writeBinaryFile;
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
renameFile: () => {
|
|
601
|
+
{
|
|
602
|
+
return renameFile;
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
removeFile: () => {
|
|
606
|
+
{
|
|
607
|
+
return removeFile;
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
removeDir: () => {
|
|
611
|
+
{
|
|
612
|
+
return removeDir;
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
readTextFile: () => {
|
|
616
|
+
{
|
|
617
|
+
return readTextFile;
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
readDir: () => {
|
|
621
|
+
{
|
|
622
|
+
return readDir;
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
readBinaryFile: () => {
|
|
626
|
+
{
|
|
627
|
+
return readBinaryFile;
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
exists: () => {
|
|
631
|
+
{
|
|
632
|
+
return exists;
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
createDir: () => {
|
|
636
|
+
{
|
|
637
|
+
return createDir;
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
copyFile: () => {
|
|
641
|
+
{
|
|
642
|
+
return copyFile;
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
Dir: () => {
|
|
646
|
+
{
|
|
647
|
+
return BaseDirectory;
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
BaseDirectory: () => {
|
|
651
|
+
{
|
|
652
|
+
return BaseDirectory;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
async function readTextFile(filePath, options = {}) {
|
|
657
|
+
return invokeTauriCommand({
|
|
658
|
+
__tauriModule: "Fs",
|
|
659
|
+
message: {
|
|
660
|
+
cmd: "readTextFile",
|
|
661
|
+
path: filePath,
|
|
662
|
+
options
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
async function readBinaryFile(filePath, options = {}) {
|
|
667
|
+
const arr = await invokeTauriCommand({
|
|
668
|
+
__tauriModule: "Fs",
|
|
669
|
+
message: {
|
|
670
|
+
cmd: "readFile",
|
|
671
|
+
path: filePath,
|
|
672
|
+
options
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
return Uint8Array.from(arr);
|
|
676
|
+
}
|
|
677
|
+
async function writeTextFile(path, contents, options) {
|
|
678
|
+
if (typeof options === "object") {
|
|
679
|
+
Object.freeze(options);
|
|
680
|
+
}
|
|
681
|
+
if (typeof path === "object") {
|
|
682
|
+
Object.freeze(path);
|
|
683
|
+
}
|
|
684
|
+
const file = { path: "", contents: "" };
|
|
685
|
+
let fileOptions = options;
|
|
686
|
+
if (typeof path === "string") {
|
|
687
|
+
file.path = path;
|
|
688
|
+
} else {
|
|
689
|
+
file.path = path.path;
|
|
690
|
+
file.contents = path.contents;
|
|
691
|
+
}
|
|
692
|
+
if (typeof contents === "string") {
|
|
693
|
+
file.contents = contents ?? "";
|
|
694
|
+
} else {
|
|
695
|
+
fileOptions = contents;
|
|
696
|
+
}
|
|
697
|
+
return invokeTauriCommand({
|
|
698
|
+
__tauriModule: "Fs",
|
|
699
|
+
message: {
|
|
700
|
+
cmd: "writeFile",
|
|
701
|
+
path: file.path,
|
|
702
|
+
contents: Array.from(new TextEncoder().encode(file.contents)),
|
|
703
|
+
options: fileOptions
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
async function writeBinaryFile(path, contents, options) {
|
|
708
|
+
if (typeof options === "object") {
|
|
709
|
+
Object.freeze(options);
|
|
710
|
+
}
|
|
711
|
+
if (typeof path === "object") {
|
|
712
|
+
Object.freeze(path);
|
|
713
|
+
}
|
|
714
|
+
const file = { path: "", contents: [] };
|
|
715
|
+
let fileOptions = options;
|
|
716
|
+
if (typeof path === "string") {
|
|
717
|
+
file.path = path;
|
|
718
|
+
} else {
|
|
719
|
+
file.path = path.path;
|
|
720
|
+
file.contents = path.contents;
|
|
721
|
+
}
|
|
722
|
+
if (contents && "dir" in contents) {
|
|
723
|
+
fileOptions = contents;
|
|
724
|
+
} else if (typeof path === "string") {
|
|
725
|
+
file.contents = contents ?? [];
|
|
726
|
+
}
|
|
727
|
+
return invokeTauriCommand({
|
|
728
|
+
__tauriModule: "Fs",
|
|
729
|
+
message: {
|
|
730
|
+
cmd: "writeFile",
|
|
731
|
+
path: file.path,
|
|
732
|
+
contents: Array.from(file.contents instanceof ArrayBuffer ? new Uint8Array(file.contents) : file.contents),
|
|
733
|
+
options: fileOptions
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
async function readDir(dir, options = {}) {
|
|
738
|
+
return invokeTauriCommand({
|
|
739
|
+
__tauriModule: "Fs",
|
|
740
|
+
message: {
|
|
741
|
+
cmd: "readDir",
|
|
742
|
+
path: dir,
|
|
743
|
+
options
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
async function createDir(dir, options = {}) {
|
|
748
|
+
return invokeTauriCommand({
|
|
749
|
+
__tauriModule: "Fs",
|
|
750
|
+
message: {
|
|
751
|
+
cmd: "createDir",
|
|
752
|
+
path: dir,
|
|
753
|
+
options
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
async function removeDir(dir, options = {}) {
|
|
758
|
+
return invokeTauriCommand({
|
|
759
|
+
__tauriModule: "Fs",
|
|
760
|
+
message: {
|
|
761
|
+
cmd: "removeDir",
|
|
762
|
+
path: dir,
|
|
763
|
+
options
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
async function copyFile(source, destination, options = {}) {
|
|
768
|
+
return invokeTauriCommand({
|
|
769
|
+
__tauriModule: "Fs",
|
|
770
|
+
message: {
|
|
771
|
+
cmd: "copyFile",
|
|
772
|
+
source,
|
|
773
|
+
destination,
|
|
774
|
+
options
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
async function removeFile(file, options = {}) {
|
|
779
|
+
return invokeTauriCommand({
|
|
780
|
+
__tauriModule: "Fs",
|
|
781
|
+
message: {
|
|
782
|
+
cmd: "removeFile",
|
|
783
|
+
path: file,
|
|
784
|
+
options
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
async function renameFile(oldPath, newPath, options = {}) {
|
|
789
|
+
return invokeTauriCommand({
|
|
790
|
+
__tauriModule: "Fs",
|
|
791
|
+
message: {
|
|
792
|
+
cmd: "renameFile",
|
|
793
|
+
oldPath,
|
|
794
|
+
newPath,
|
|
795
|
+
options
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
async function exists(path, options = {}) {
|
|
800
|
+
return invokeTauriCommand({
|
|
801
|
+
__tauriModule: "Fs",
|
|
802
|
+
message: {
|
|
803
|
+
cmd: "exists",
|
|
804
|
+
path,
|
|
805
|
+
options
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
var BaseDirectory;
|
|
810
|
+
(function(BaseDirectory2) {
|
|
811
|
+
BaseDirectory2[BaseDirectory2["Audio"] = 1] = "Audio";
|
|
812
|
+
BaseDirectory2[BaseDirectory2["Cache"] = 2] = "Cache";
|
|
813
|
+
BaseDirectory2[BaseDirectory2["Config"] = 3] = "Config";
|
|
814
|
+
BaseDirectory2[BaseDirectory2["Data"] = 4] = "Data";
|
|
815
|
+
BaseDirectory2[BaseDirectory2["LocalData"] = 5] = "LocalData";
|
|
816
|
+
BaseDirectory2[BaseDirectory2["Desktop"] = 6] = "Desktop";
|
|
817
|
+
BaseDirectory2[BaseDirectory2["Document"] = 7] = "Document";
|
|
818
|
+
BaseDirectory2[BaseDirectory2["Download"] = 8] = "Download";
|
|
819
|
+
BaseDirectory2[BaseDirectory2["Executable"] = 9] = "Executable";
|
|
820
|
+
BaseDirectory2[BaseDirectory2["Font"] = 10] = "Font";
|
|
821
|
+
BaseDirectory2[BaseDirectory2["Home"] = 11] = "Home";
|
|
822
|
+
BaseDirectory2[BaseDirectory2["Picture"] = 12] = "Picture";
|
|
823
|
+
BaseDirectory2[BaseDirectory2["Public"] = 13] = "Public";
|
|
824
|
+
BaseDirectory2[BaseDirectory2["Runtime"] = 14] = "Runtime";
|
|
825
|
+
BaseDirectory2[BaseDirectory2["Template"] = 15] = "Template";
|
|
826
|
+
BaseDirectory2[BaseDirectory2["Video"] = 16] = "Video";
|
|
827
|
+
BaseDirectory2[BaseDirectory2["Resource"] = 17] = "Resource";
|
|
828
|
+
BaseDirectory2[BaseDirectory2["App"] = 18] = "App";
|
|
829
|
+
BaseDirectory2[BaseDirectory2["Log"] = 19] = "Log";
|
|
830
|
+
BaseDirectory2[BaseDirectory2["Temp"] = 20] = "Temp";
|
|
831
|
+
BaseDirectory2[BaseDirectory2["AppConfig"] = 21] = "AppConfig";
|
|
832
|
+
BaseDirectory2[BaseDirectory2["AppData"] = 22] = "AppData";
|
|
833
|
+
BaseDirectory2[BaseDirectory2["AppLocalData"] = 23] = "AppLocalData";
|
|
834
|
+
BaseDirectory2[BaseDirectory2["AppCache"] = 24] = "AppCache";
|
|
835
|
+
BaseDirectory2[BaseDirectory2["AppLog"] = 25] = "AppLog";
|
|
836
|
+
})(BaseDirectory || (BaseDirectory = {}));
|
|
837
|
+
|
|
838
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/globalShortcut.js
|
|
839
|
+
var exports_globalShortcut = {};
|
|
840
|
+
__export(exports_globalShortcut, {
|
|
841
|
+
unregisterAll: () => {
|
|
842
|
+
{
|
|
843
|
+
return unregisterAll;
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
unregister: () => {
|
|
847
|
+
{
|
|
848
|
+
return unregister;
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
registerAll: () => {
|
|
852
|
+
{
|
|
853
|
+
return registerAll;
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
register: () => {
|
|
857
|
+
{
|
|
858
|
+
return register;
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
isRegistered: () => {
|
|
862
|
+
{
|
|
863
|
+
return isRegistered;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
async function register(shortcut, handler) {
|
|
868
|
+
return invokeTauriCommand({
|
|
869
|
+
__tauriModule: "GlobalShortcut",
|
|
870
|
+
message: {
|
|
871
|
+
cmd: "register",
|
|
872
|
+
shortcut,
|
|
873
|
+
handler: transformCallback(handler)
|
|
874
|
+
}
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
async function registerAll(shortcuts, handler) {
|
|
878
|
+
return invokeTauriCommand({
|
|
879
|
+
__tauriModule: "GlobalShortcut",
|
|
880
|
+
message: {
|
|
881
|
+
cmd: "registerAll",
|
|
882
|
+
shortcuts,
|
|
883
|
+
handler: transformCallback(handler)
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
async function isRegistered(shortcut) {
|
|
888
|
+
return invokeTauriCommand({
|
|
889
|
+
__tauriModule: "GlobalShortcut",
|
|
890
|
+
message: {
|
|
891
|
+
cmd: "isRegistered",
|
|
892
|
+
shortcut
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
async function unregister(shortcut) {
|
|
897
|
+
return invokeTauriCommand({
|
|
898
|
+
__tauriModule: "GlobalShortcut",
|
|
899
|
+
message: {
|
|
900
|
+
cmd: "unregister",
|
|
901
|
+
shortcut
|
|
902
|
+
}
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
async function unregisterAll() {
|
|
906
|
+
return invokeTauriCommand({
|
|
907
|
+
__tauriModule: "GlobalShortcut",
|
|
908
|
+
message: {
|
|
909
|
+
cmd: "unregisterAll"
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/http.js
|
|
915
|
+
var exports_http = {};
|
|
916
|
+
__export(exports_http, {
|
|
917
|
+
getClient: () => {
|
|
918
|
+
{
|
|
919
|
+
return getClient;
|
|
920
|
+
}
|
|
921
|
+
},
|
|
922
|
+
fetch: () => {
|
|
923
|
+
{
|
|
924
|
+
return fetch;
|
|
925
|
+
}
|
|
926
|
+
},
|
|
927
|
+
ResponseType: () => {
|
|
928
|
+
{
|
|
929
|
+
return ResponseType;
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
Response: () => {
|
|
933
|
+
{
|
|
934
|
+
return Response;
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
Client: () => {
|
|
938
|
+
{
|
|
939
|
+
return Client;
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
Body: () => {
|
|
943
|
+
{
|
|
944
|
+
return Body;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
async function formBody(data) {
|
|
949
|
+
const form = {};
|
|
950
|
+
const append = async (key, v) => {
|
|
951
|
+
if (v !== null) {
|
|
952
|
+
let r;
|
|
953
|
+
if (typeof v === "string") {
|
|
954
|
+
r = v;
|
|
955
|
+
} else if (v instanceof Uint8Array || Array.isArray(v)) {
|
|
956
|
+
r = Array.from(v);
|
|
957
|
+
} else if (v instanceof File) {
|
|
958
|
+
r = {
|
|
959
|
+
file: Array.from(new Uint8Array(await v.arrayBuffer())),
|
|
960
|
+
mime: v.type,
|
|
961
|
+
fileName: v.name
|
|
962
|
+
};
|
|
963
|
+
} else if (typeof v.file === "string") {
|
|
964
|
+
r = { file: v.file, mime: v.mime, fileName: v.fileName };
|
|
965
|
+
} else {
|
|
966
|
+
r = { file: Array.from(v.file), mime: v.mime, fileName: v.fileName };
|
|
967
|
+
}
|
|
968
|
+
form[String(key)] = r;
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
if (data instanceof FormData) {
|
|
972
|
+
for (const [key, value] of data) {
|
|
973
|
+
await append(key, value);
|
|
974
|
+
}
|
|
975
|
+
} else {
|
|
976
|
+
for (const [key, value] of Object.entries(data)) {
|
|
977
|
+
await append(key, value);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return form;
|
|
981
|
+
}
|
|
982
|
+
async function getClient(options) {
|
|
983
|
+
return invokeTauriCommand({
|
|
984
|
+
__tauriModule: "Http",
|
|
985
|
+
message: {
|
|
986
|
+
cmd: "createClient",
|
|
987
|
+
options
|
|
988
|
+
}
|
|
989
|
+
}).then((id) => new Client(id));
|
|
990
|
+
}
|
|
991
|
+
async function fetch(url, options) {
|
|
992
|
+
if (defaultClient === null) {
|
|
993
|
+
defaultClient = await getClient();
|
|
994
|
+
}
|
|
995
|
+
return defaultClient.request({
|
|
996
|
+
url,
|
|
997
|
+
method: options?.method ?? "GET",
|
|
998
|
+
...options
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
var ResponseType;
|
|
1002
|
+
(function(ResponseType2) {
|
|
1003
|
+
ResponseType2[ResponseType2["JSON"] = 1] = "JSON";
|
|
1004
|
+
ResponseType2[ResponseType2["Text"] = 2] = "Text";
|
|
1005
|
+
ResponseType2[ResponseType2["Binary"] = 3] = "Binary";
|
|
1006
|
+
})(ResponseType || (ResponseType = {}));
|
|
1007
|
+
|
|
1008
|
+
class Body {
|
|
1009
|
+
constructor(type, payload) {
|
|
1010
|
+
this.type = type;
|
|
1011
|
+
this.payload = payload;
|
|
1012
|
+
}
|
|
1013
|
+
static form(data) {
|
|
1014
|
+
return new Body("Form", data);
|
|
1015
|
+
}
|
|
1016
|
+
static json(data) {
|
|
1017
|
+
return new Body("Json", data);
|
|
1018
|
+
}
|
|
1019
|
+
static text(value) {
|
|
1020
|
+
return new Body("Text", value);
|
|
1021
|
+
}
|
|
1022
|
+
static bytes(bytes) {
|
|
1023
|
+
return new Body("Bytes", Array.from(bytes instanceof ArrayBuffer ? new Uint8Array(bytes) : bytes));
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
class Response {
|
|
1028
|
+
constructor(response) {
|
|
1029
|
+
this.url = response.url;
|
|
1030
|
+
this.status = response.status;
|
|
1031
|
+
this.ok = this.status >= 200 && this.status < 300;
|
|
1032
|
+
this.headers = response.headers;
|
|
1033
|
+
this.rawHeaders = response.rawHeaders;
|
|
1034
|
+
this.data = response.data;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
class Client {
|
|
1039
|
+
constructor(id) {
|
|
1040
|
+
this.id = id;
|
|
1041
|
+
}
|
|
1042
|
+
async drop() {
|
|
1043
|
+
return invokeTauriCommand({
|
|
1044
|
+
__tauriModule: "Http",
|
|
1045
|
+
message: {
|
|
1046
|
+
cmd: "dropClient",
|
|
1047
|
+
client: this.id
|
|
1048
|
+
}
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
async request(options) {
|
|
1052
|
+
const jsonResponse = !options.responseType || options.responseType === ResponseType.JSON;
|
|
1053
|
+
if (jsonResponse) {
|
|
1054
|
+
options.responseType = ResponseType.Text;
|
|
1055
|
+
}
|
|
1056
|
+
if (options.body?.type === "Form") {
|
|
1057
|
+
options.body.payload = await formBody(options.body.payload);
|
|
1058
|
+
}
|
|
1059
|
+
return invokeTauriCommand({
|
|
1060
|
+
__tauriModule: "Http",
|
|
1061
|
+
message: {
|
|
1062
|
+
cmd: "httpRequest",
|
|
1063
|
+
client: this.id,
|
|
1064
|
+
options
|
|
1065
|
+
}
|
|
1066
|
+
}).then((res) => {
|
|
1067
|
+
const response = new Response(res);
|
|
1068
|
+
if (jsonResponse) {
|
|
1069
|
+
try {
|
|
1070
|
+
response.data = JSON.parse(response.data);
|
|
1071
|
+
} catch (e) {
|
|
1072
|
+
if (response.ok && response.data === "") {
|
|
1073
|
+
response.data = {};
|
|
1074
|
+
} else if (response.ok) {
|
|
1075
|
+
throw Error(`Failed to parse response \`${response.data}\` as JSON: ${e};
|
|
1076
|
+
try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
return response;
|
|
1080
|
+
}
|
|
1081
|
+
return response;
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
async get(url, options) {
|
|
1085
|
+
return this.request({
|
|
1086
|
+
method: "GET",
|
|
1087
|
+
url,
|
|
1088
|
+
...options
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
async post(url, body, options) {
|
|
1092
|
+
return this.request({
|
|
1093
|
+
method: "POST",
|
|
1094
|
+
url,
|
|
1095
|
+
body,
|
|
1096
|
+
...options
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
async put(url, body, options) {
|
|
1100
|
+
return this.request({
|
|
1101
|
+
method: "PUT",
|
|
1102
|
+
url,
|
|
1103
|
+
body,
|
|
1104
|
+
...options
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
async patch(url, options) {
|
|
1108
|
+
return this.request({
|
|
1109
|
+
method: "PATCH",
|
|
1110
|
+
url,
|
|
1111
|
+
...options
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
async delete(url, options) {
|
|
1115
|
+
return this.request({
|
|
1116
|
+
method: "DELETE",
|
|
1117
|
+
url,
|
|
1118
|
+
...options
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
var defaultClient = null;
|
|
1123
|
+
|
|
1124
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/mocks.js
|
|
1125
|
+
var exports_mocks = {};
|
|
1126
|
+
__export(exports_mocks, {
|
|
1127
|
+
mockWindows: () => {
|
|
1128
|
+
{
|
|
1129
|
+
return mockWindows;
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
mockIPC: () => {
|
|
1133
|
+
{
|
|
1134
|
+
return mockIPC;
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
mockConvertFileSrc: () => {
|
|
1138
|
+
{
|
|
1139
|
+
return mockConvertFileSrc;
|
|
1140
|
+
}
|
|
1141
|
+
},
|
|
1142
|
+
clearMocks: () => {
|
|
1143
|
+
{
|
|
1144
|
+
return clearMocks;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
});
|
|
1148
|
+
var mockIPC = function(cb) {
|
|
1149
|
+
window.__TAURI_IPC__ = async ({ cmd, callback, error, ...args }) => {
|
|
1150
|
+
try {
|
|
1151
|
+
window[`_${callback}`](await cb(cmd, args));
|
|
1152
|
+
} catch (err) {
|
|
1153
|
+
window[`_${error}`](err);
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
1157
|
+
var mockWindows = function(current, ...additionalWindows) {
|
|
1158
|
+
window.__TAURI_METADATA__ = {
|
|
1159
|
+
__windows: [current, ...additionalWindows].map((label) => ({ label })),
|
|
1160
|
+
__currentWindow: { label: current }
|
|
1161
|
+
};
|
|
1162
|
+
};
|
|
1163
|
+
var mockConvertFileSrc = function(osName, windowsProtocolScheme = "https") {
|
|
1164
|
+
window.__TAURI__ = window.__TAURI__ ?? {};
|
|
1165
|
+
window.__TAURI__.convertFileSrc = function(filePath, protocol = "asset") {
|
|
1166
|
+
const path = encodeURIComponent(filePath);
|
|
1167
|
+
return osName === "windows" ? `${windowsProtocolScheme}://${protocol}.localhost/${path}` : `${protocol}://localhost/${path}`;
|
|
1168
|
+
};
|
|
1169
|
+
};
|
|
1170
|
+
var clearMocks = function() {
|
|
1171
|
+
if (window.__TAURI__?.convertFileSrc)
|
|
1172
|
+
delete window.__TAURI__.convertFileSrc;
|
|
1173
|
+
if (window.__TAURI_IPC__)
|
|
1174
|
+
delete window.__TAURI_IPC__;
|
|
1175
|
+
if (window.__TAURI_METADATA__)
|
|
1176
|
+
delete window.__TAURI_METADATA__;
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/notification.js
|
|
1180
|
+
var exports_notification = {};
|
|
1181
|
+
__export(exports_notification, {
|
|
1182
|
+
sendNotification: () => {
|
|
1183
|
+
{
|
|
1184
|
+
return sendNotification;
|
|
1185
|
+
}
|
|
1186
|
+
},
|
|
1187
|
+
requestPermission: () => {
|
|
1188
|
+
{
|
|
1189
|
+
return requestPermission;
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1192
|
+
isPermissionGranted: () => {
|
|
1193
|
+
{
|
|
1194
|
+
return isPermissionGranted;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
});
|
|
1198
|
+
async function isPermissionGranted() {
|
|
1199
|
+
if (window.Notification.permission !== "default") {
|
|
1200
|
+
return Promise.resolve(window.Notification.permission === "granted");
|
|
1201
|
+
}
|
|
1202
|
+
return invokeTauriCommand({
|
|
1203
|
+
__tauriModule: "Notification",
|
|
1204
|
+
message: {
|
|
1205
|
+
cmd: "isNotificationPermissionGranted"
|
|
1206
|
+
}
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
async function requestPermission() {
|
|
1210
|
+
return window.Notification.requestPermission();
|
|
1211
|
+
}
|
|
1212
|
+
var sendNotification = function(options) {
|
|
1213
|
+
if (typeof options === "string") {
|
|
1214
|
+
new window.Notification(options);
|
|
1215
|
+
} else {
|
|
1216
|
+
new window.Notification(options.title, options);
|
|
1217
|
+
}
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/os.js
|
|
1221
|
+
var exports_os = {};
|
|
1222
|
+
__export(exports_os, {
|
|
1223
|
+
version: () => {
|
|
1224
|
+
{
|
|
1225
|
+
return version;
|
|
1226
|
+
}
|
|
1227
|
+
},
|
|
1228
|
+
type: () => {
|
|
1229
|
+
{
|
|
1230
|
+
return type;
|
|
1231
|
+
}
|
|
1232
|
+
},
|
|
1233
|
+
tempdir: () => {
|
|
1234
|
+
{
|
|
1235
|
+
return tempdir;
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1238
|
+
platform: () => {
|
|
1239
|
+
{
|
|
1240
|
+
return platform;
|
|
1241
|
+
}
|
|
1242
|
+
},
|
|
1243
|
+
locale: () => {
|
|
1244
|
+
{
|
|
1245
|
+
return locale;
|
|
1246
|
+
}
|
|
1247
|
+
},
|
|
1248
|
+
arch: () => {
|
|
1249
|
+
{
|
|
1250
|
+
return arch;
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
EOL: () => {
|
|
1254
|
+
{
|
|
1255
|
+
return EOL;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
|
|
1260
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/helpers/os-check.js
|
|
1261
|
+
var isWindows = function() {
|
|
1262
|
+
return navigator.appVersion.includes("Win");
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/os.js
|
|
1266
|
+
async function platform() {
|
|
1267
|
+
return invokeTauriCommand({
|
|
1268
|
+
__tauriModule: "Os",
|
|
1269
|
+
message: {
|
|
1270
|
+
cmd: "platform"
|
|
1271
|
+
}
|
|
1272
|
+
});
|
|
1273
|
+
}
|
|
1274
|
+
async function version() {
|
|
1275
|
+
return invokeTauriCommand({
|
|
1276
|
+
__tauriModule: "Os",
|
|
1277
|
+
message: {
|
|
1278
|
+
cmd: "version"
|
|
1279
|
+
}
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
async function type() {
|
|
1283
|
+
return invokeTauriCommand({
|
|
1284
|
+
__tauriModule: "Os",
|
|
1285
|
+
message: {
|
|
1286
|
+
cmd: "osType"
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
}
|
|
1290
|
+
async function arch() {
|
|
1291
|
+
return invokeTauriCommand({
|
|
1292
|
+
__tauriModule: "Os",
|
|
1293
|
+
message: {
|
|
1294
|
+
cmd: "arch"
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
async function tempdir() {
|
|
1299
|
+
return invokeTauriCommand({
|
|
1300
|
+
__tauriModule: "Os",
|
|
1301
|
+
message: {
|
|
1302
|
+
cmd: "tempdir"
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
async function locale() {
|
|
1307
|
+
return invokeTauriCommand({
|
|
1308
|
+
__tauriModule: "Os",
|
|
1309
|
+
message: {
|
|
1310
|
+
cmd: "locale"
|
|
1311
|
+
}
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
var EOL = isWindows() ? "\r\n" : "\n";
|
|
1315
|
+
|
|
1316
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/path.js
|
|
1317
|
+
var exports_path = {};
|
|
1318
|
+
__export(exports_path, {
|
|
1319
|
+
videoDir: () => {
|
|
1320
|
+
{
|
|
1321
|
+
return videoDir;
|
|
1322
|
+
}
|
|
1323
|
+
},
|
|
1324
|
+
templateDir: () => {
|
|
1325
|
+
{
|
|
1326
|
+
return templateDir;
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1329
|
+
sep: () => {
|
|
1330
|
+
{
|
|
1331
|
+
return sep;
|
|
1332
|
+
}
|
|
1333
|
+
},
|
|
1334
|
+
runtimeDir: () => {
|
|
1335
|
+
{
|
|
1336
|
+
return runtimeDir;
|
|
1337
|
+
}
|
|
1338
|
+
},
|
|
1339
|
+
resourceDir: () => {
|
|
1340
|
+
{
|
|
1341
|
+
return resourceDir;
|
|
1342
|
+
}
|
|
1343
|
+
},
|
|
1344
|
+
resolveResource: () => {
|
|
1345
|
+
{
|
|
1346
|
+
return resolveResource;
|
|
1347
|
+
}
|
|
1348
|
+
},
|
|
1349
|
+
resolve: () => {
|
|
1350
|
+
{
|
|
1351
|
+
return resolve;
|
|
1352
|
+
}
|
|
1353
|
+
},
|
|
1354
|
+
publicDir: () => {
|
|
1355
|
+
{
|
|
1356
|
+
return publicDir;
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
pictureDir: () => {
|
|
1360
|
+
{
|
|
1361
|
+
return pictureDir;
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
normalize: () => {
|
|
1365
|
+
{
|
|
1366
|
+
return normalize;
|
|
1367
|
+
}
|
|
1368
|
+
},
|
|
1369
|
+
logDir: () => {
|
|
1370
|
+
{
|
|
1371
|
+
return logDir;
|
|
1372
|
+
}
|
|
1373
|
+
},
|
|
1374
|
+
localDataDir: () => {
|
|
1375
|
+
{
|
|
1376
|
+
return localDataDir;
|
|
1377
|
+
}
|
|
1378
|
+
},
|
|
1379
|
+
join: () => {
|
|
1380
|
+
{
|
|
1381
|
+
return join;
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
isAbsolute: () => {
|
|
1385
|
+
{
|
|
1386
|
+
return isAbsolute;
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
homeDir: () => {
|
|
1390
|
+
{
|
|
1391
|
+
return homeDir;
|
|
1392
|
+
}
|
|
1393
|
+
},
|
|
1394
|
+
fontDir: () => {
|
|
1395
|
+
{
|
|
1396
|
+
return fontDir;
|
|
1397
|
+
}
|
|
1398
|
+
},
|
|
1399
|
+
extname: () => {
|
|
1400
|
+
{
|
|
1401
|
+
return extname;
|
|
1402
|
+
}
|
|
1403
|
+
},
|
|
1404
|
+
executableDir: () => {
|
|
1405
|
+
{
|
|
1406
|
+
return executableDir;
|
|
1407
|
+
}
|
|
1408
|
+
},
|
|
1409
|
+
downloadDir: () => {
|
|
1410
|
+
{
|
|
1411
|
+
return downloadDir;
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
documentDir: () => {
|
|
1415
|
+
{
|
|
1416
|
+
return documentDir;
|
|
1417
|
+
}
|
|
1418
|
+
},
|
|
1419
|
+
dirname: () => {
|
|
1420
|
+
{
|
|
1421
|
+
return dirname;
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
desktopDir: () => {
|
|
1425
|
+
{
|
|
1426
|
+
return desktopDir;
|
|
1427
|
+
}
|
|
1428
|
+
},
|
|
1429
|
+
delimiter: () => {
|
|
1430
|
+
{
|
|
1431
|
+
return delimiter;
|
|
1432
|
+
}
|
|
1433
|
+
},
|
|
1434
|
+
dataDir: () => {
|
|
1435
|
+
{
|
|
1436
|
+
return dataDir;
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
configDir: () => {
|
|
1440
|
+
{
|
|
1441
|
+
return configDir;
|
|
1442
|
+
}
|
|
1443
|
+
},
|
|
1444
|
+
cacheDir: () => {
|
|
1445
|
+
{
|
|
1446
|
+
return cacheDir;
|
|
1447
|
+
}
|
|
1448
|
+
},
|
|
1449
|
+
basename: () => {
|
|
1450
|
+
{
|
|
1451
|
+
return basename;
|
|
1452
|
+
}
|
|
1453
|
+
},
|
|
1454
|
+
audioDir: () => {
|
|
1455
|
+
{
|
|
1456
|
+
return audioDir;
|
|
1457
|
+
}
|
|
1458
|
+
},
|
|
1459
|
+
appLogDir: () => {
|
|
1460
|
+
{
|
|
1461
|
+
return appLogDir;
|
|
1462
|
+
}
|
|
1463
|
+
},
|
|
1464
|
+
appLocalDataDir: () => {
|
|
1465
|
+
{
|
|
1466
|
+
return appLocalDataDir;
|
|
1467
|
+
}
|
|
1468
|
+
},
|
|
1469
|
+
appDir: () => {
|
|
1470
|
+
{
|
|
1471
|
+
return appDir;
|
|
1472
|
+
}
|
|
1473
|
+
},
|
|
1474
|
+
appDataDir: () => {
|
|
1475
|
+
{
|
|
1476
|
+
return appDataDir;
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1479
|
+
appConfigDir: () => {
|
|
1480
|
+
{
|
|
1481
|
+
return appConfigDir;
|
|
1482
|
+
}
|
|
1483
|
+
},
|
|
1484
|
+
appCacheDir: () => {
|
|
1485
|
+
{
|
|
1486
|
+
return appCacheDir;
|
|
1487
|
+
}
|
|
1488
|
+
},
|
|
1489
|
+
BaseDirectory: () => {
|
|
1490
|
+
{
|
|
1491
|
+
return BaseDirectory;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
async function appDir() {
|
|
1496
|
+
return appConfigDir();
|
|
1497
|
+
}
|
|
1498
|
+
async function appConfigDir() {
|
|
1499
|
+
return invokeTauriCommand({
|
|
1500
|
+
__tauriModule: "Path",
|
|
1501
|
+
message: {
|
|
1502
|
+
cmd: "resolvePath",
|
|
1503
|
+
path: "",
|
|
1504
|
+
directory: BaseDirectory.AppConfig
|
|
1505
|
+
}
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
async function appDataDir() {
|
|
1509
|
+
return invokeTauriCommand({
|
|
1510
|
+
__tauriModule: "Path",
|
|
1511
|
+
message: {
|
|
1512
|
+
cmd: "resolvePath",
|
|
1513
|
+
path: "",
|
|
1514
|
+
directory: BaseDirectory.AppData
|
|
1515
|
+
}
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
async function appLocalDataDir() {
|
|
1519
|
+
return invokeTauriCommand({
|
|
1520
|
+
__tauriModule: "Path",
|
|
1521
|
+
message: {
|
|
1522
|
+
cmd: "resolvePath",
|
|
1523
|
+
path: "",
|
|
1524
|
+
directory: BaseDirectory.AppLocalData
|
|
1525
|
+
}
|
|
1526
|
+
});
|
|
1527
|
+
}
|
|
1528
|
+
async function appCacheDir() {
|
|
1529
|
+
return invokeTauriCommand({
|
|
1530
|
+
__tauriModule: "Path",
|
|
1531
|
+
message: {
|
|
1532
|
+
cmd: "resolvePath",
|
|
1533
|
+
path: "",
|
|
1534
|
+
directory: BaseDirectory.AppCache
|
|
1535
|
+
}
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
async function audioDir() {
|
|
1539
|
+
return invokeTauriCommand({
|
|
1540
|
+
__tauriModule: "Path",
|
|
1541
|
+
message: {
|
|
1542
|
+
cmd: "resolvePath",
|
|
1543
|
+
path: "",
|
|
1544
|
+
directory: BaseDirectory.Audio
|
|
1545
|
+
}
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
async function cacheDir() {
|
|
1549
|
+
return invokeTauriCommand({
|
|
1550
|
+
__tauriModule: "Path",
|
|
1551
|
+
message: {
|
|
1552
|
+
cmd: "resolvePath",
|
|
1553
|
+
path: "",
|
|
1554
|
+
directory: BaseDirectory.Cache
|
|
1555
|
+
}
|
|
1556
|
+
});
|
|
1557
|
+
}
|
|
1558
|
+
async function configDir() {
|
|
1559
|
+
return invokeTauriCommand({
|
|
1560
|
+
__tauriModule: "Path",
|
|
1561
|
+
message: {
|
|
1562
|
+
cmd: "resolvePath",
|
|
1563
|
+
path: "",
|
|
1564
|
+
directory: BaseDirectory.Config
|
|
1565
|
+
}
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
async function dataDir() {
|
|
1569
|
+
return invokeTauriCommand({
|
|
1570
|
+
__tauriModule: "Path",
|
|
1571
|
+
message: {
|
|
1572
|
+
cmd: "resolvePath",
|
|
1573
|
+
path: "",
|
|
1574
|
+
directory: BaseDirectory.Data
|
|
1575
|
+
}
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
async function desktopDir() {
|
|
1579
|
+
return invokeTauriCommand({
|
|
1580
|
+
__tauriModule: "Path",
|
|
1581
|
+
message: {
|
|
1582
|
+
cmd: "resolvePath",
|
|
1583
|
+
path: "",
|
|
1584
|
+
directory: BaseDirectory.Desktop
|
|
1585
|
+
}
|
|
1586
|
+
});
|
|
1587
|
+
}
|
|
1588
|
+
async function documentDir() {
|
|
1589
|
+
return invokeTauriCommand({
|
|
1590
|
+
__tauriModule: "Path",
|
|
1591
|
+
message: {
|
|
1592
|
+
cmd: "resolvePath",
|
|
1593
|
+
path: "",
|
|
1594
|
+
directory: BaseDirectory.Document
|
|
1595
|
+
}
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
async function downloadDir() {
|
|
1599
|
+
return invokeTauriCommand({
|
|
1600
|
+
__tauriModule: "Path",
|
|
1601
|
+
message: {
|
|
1602
|
+
cmd: "resolvePath",
|
|
1603
|
+
path: "",
|
|
1604
|
+
directory: BaseDirectory.Download
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
async function executableDir() {
|
|
1609
|
+
return invokeTauriCommand({
|
|
1610
|
+
__tauriModule: "Path",
|
|
1611
|
+
message: {
|
|
1612
|
+
cmd: "resolvePath",
|
|
1613
|
+
path: "",
|
|
1614
|
+
directory: BaseDirectory.Executable
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
async function fontDir() {
|
|
1619
|
+
return invokeTauriCommand({
|
|
1620
|
+
__tauriModule: "Path",
|
|
1621
|
+
message: {
|
|
1622
|
+
cmd: "resolvePath",
|
|
1623
|
+
path: "",
|
|
1624
|
+
directory: BaseDirectory.Font
|
|
1625
|
+
}
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
async function homeDir() {
|
|
1629
|
+
return invokeTauriCommand({
|
|
1630
|
+
__tauriModule: "Path",
|
|
1631
|
+
message: {
|
|
1632
|
+
cmd: "resolvePath",
|
|
1633
|
+
path: "",
|
|
1634
|
+
directory: BaseDirectory.Home
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
async function localDataDir() {
|
|
1639
|
+
return invokeTauriCommand({
|
|
1640
|
+
__tauriModule: "Path",
|
|
1641
|
+
message: {
|
|
1642
|
+
cmd: "resolvePath",
|
|
1643
|
+
path: "",
|
|
1644
|
+
directory: BaseDirectory.LocalData
|
|
1645
|
+
}
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1648
|
+
async function pictureDir() {
|
|
1649
|
+
return invokeTauriCommand({
|
|
1650
|
+
__tauriModule: "Path",
|
|
1651
|
+
message: {
|
|
1652
|
+
cmd: "resolvePath",
|
|
1653
|
+
path: "",
|
|
1654
|
+
directory: BaseDirectory.Picture
|
|
1655
|
+
}
|
|
1656
|
+
});
|
|
1657
|
+
}
|
|
1658
|
+
async function publicDir() {
|
|
1659
|
+
return invokeTauriCommand({
|
|
1660
|
+
__tauriModule: "Path",
|
|
1661
|
+
message: {
|
|
1662
|
+
cmd: "resolvePath",
|
|
1663
|
+
path: "",
|
|
1664
|
+
directory: BaseDirectory.Public
|
|
1665
|
+
}
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
async function resourceDir() {
|
|
1669
|
+
return invokeTauriCommand({
|
|
1670
|
+
__tauriModule: "Path",
|
|
1671
|
+
message: {
|
|
1672
|
+
cmd: "resolvePath",
|
|
1673
|
+
path: "",
|
|
1674
|
+
directory: BaseDirectory.Resource
|
|
1675
|
+
}
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
async function resolveResource(resourcePath) {
|
|
1679
|
+
return invokeTauriCommand({
|
|
1680
|
+
__tauriModule: "Path",
|
|
1681
|
+
message: {
|
|
1682
|
+
cmd: "resolvePath",
|
|
1683
|
+
path: resourcePath,
|
|
1684
|
+
directory: BaseDirectory.Resource
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
async function runtimeDir() {
|
|
1689
|
+
return invokeTauriCommand({
|
|
1690
|
+
__tauriModule: "Path",
|
|
1691
|
+
message: {
|
|
1692
|
+
cmd: "resolvePath",
|
|
1693
|
+
path: "",
|
|
1694
|
+
directory: BaseDirectory.Runtime
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
async function templateDir() {
|
|
1699
|
+
return invokeTauriCommand({
|
|
1700
|
+
__tauriModule: "Path",
|
|
1701
|
+
message: {
|
|
1702
|
+
cmd: "resolvePath",
|
|
1703
|
+
path: "",
|
|
1704
|
+
directory: BaseDirectory.Template
|
|
1705
|
+
}
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
async function videoDir() {
|
|
1709
|
+
return invokeTauriCommand({
|
|
1710
|
+
__tauriModule: "Path",
|
|
1711
|
+
message: {
|
|
1712
|
+
cmd: "resolvePath",
|
|
1713
|
+
path: "",
|
|
1714
|
+
directory: BaseDirectory.Video
|
|
1715
|
+
}
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
async function logDir() {
|
|
1719
|
+
return appLogDir();
|
|
1720
|
+
}
|
|
1721
|
+
async function appLogDir() {
|
|
1722
|
+
return invokeTauriCommand({
|
|
1723
|
+
__tauriModule: "Path",
|
|
1724
|
+
message: {
|
|
1725
|
+
cmd: "resolvePath",
|
|
1726
|
+
path: "",
|
|
1727
|
+
directory: BaseDirectory.AppLog
|
|
1728
|
+
}
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
async function resolve(...paths) {
|
|
1732
|
+
return invokeTauriCommand({
|
|
1733
|
+
__tauriModule: "Path",
|
|
1734
|
+
message: {
|
|
1735
|
+
cmd: "resolve",
|
|
1736
|
+
paths
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
async function normalize(path) {
|
|
1741
|
+
return invokeTauriCommand({
|
|
1742
|
+
__tauriModule: "Path",
|
|
1743
|
+
message: {
|
|
1744
|
+
cmd: "normalize",
|
|
1745
|
+
path
|
|
1746
|
+
}
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
async function join(...paths) {
|
|
1750
|
+
return invokeTauriCommand({
|
|
1751
|
+
__tauriModule: "Path",
|
|
1752
|
+
message: {
|
|
1753
|
+
cmd: "join",
|
|
1754
|
+
paths
|
|
1755
|
+
}
|
|
1756
|
+
});
|
|
1757
|
+
}
|
|
1758
|
+
async function dirname(path) {
|
|
1759
|
+
return invokeTauriCommand({
|
|
1760
|
+
__tauriModule: "Path",
|
|
1761
|
+
message: {
|
|
1762
|
+
cmd: "dirname",
|
|
1763
|
+
path
|
|
1764
|
+
}
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
async function extname(path) {
|
|
1768
|
+
return invokeTauriCommand({
|
|
1769
|
+
__tauriModule: "Path",
|
|
1770
|
+
message: {
|
|
1771
|
+
cmd: "extname",
|
|
1772
|
+
path
|
|
1773
|
+
}
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
async function basename(path, ext) {
|
|
1777
|
+
return invokeTauriCommand({
|
|
1778
|
+
__tauriModule: "Path",
|
|
1779
|
+
message: {
|
|
1780
|
+
cmd: "basename",
|
|
1781
|
+
path,
|
|
1782
|
+
ext
|
|
1783
|
+
}
|
|
1784
|
+
});
|
|
1785
|
+
}
|
|
1786
|
+
async function isAbsolute(path) {
|
|
1787
|
+
return invokeTauriCommand({
|
|
1788
|
+
__tauriModule: "Path",
|
|
1789
|
+
message: {
|
|
1790
|
+
cmd: "isAbsolute",
|
|
1791
|
+
path
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
var sep = isWindows() ? "\\" : "/";
|
|
1796
|
+
var delimiter = isWindows() ? ";" : ":";
|
|
1797
|
+
|
|
1798
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/process.js
|
|
1799
|
+
var exports_process = {};
|
|
1800
|
+
__export(exports_process, {
|
|
1801
|
+
relaunch: () => {
|
|
1802
|
+
{
|
|
1803
|
+
return relaunch;
|
|
1804
|
+
}
|
|
1805
|
+
},
|
|
1806
|
+
exit: () => {
|
|
1807
|
+
{
|
|
1808
|
+
return exit;
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
});
|
|
1812
|
+
async function exit(exitCode = 0) {
|
|
1813
|
+
return invokeTauriCommand({
|
|
1814
|
+
__tauriModule: "Process",
|
|
1815
|
+
message: {
|
|
1816
|
+
cmd: "exit",
|
|
1817
|
+
exitCode
|
|
1818
|
+
}
|
|
1819
|
+
});
|
|
1820
|
+
}
|
|
1821
|
+
async function relaunch() {
|
|
1822
|
+
return invokeTauriCommand({
|
|
1823
|
+
__tauriModule: "Process",
|
|
1824
|
+
message: {
|
|
1825
|
+
cmd: "relaunch"
|
|
1826
|
+
}
|
|
1827
|
+
});
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/updater.js
|
|
1831
|
+
var exports_updater = {};
|
|
1832
|
+
__export(exports_updater, {
|
|
1833
|
+
onUpdaterEvent: () => {
|
|
1834
|
+
{
|
|
1835
|
+
return onUpdaterEvent;
|
|
1836
|
+
}
|
|
1837
|
+
},
|
|
1838
|
+
installUpdate: () => {
|
|
1839
|
+
{
|
|
1840
|
+
return installUpdate;
|
|
1841
|
+
}
|
|
1842
|
+
},
|
|
1843
|
+
checkUpdate: () => {
|
|
1844
|
+
{
|
|
1845
|
+
return checkUpdate;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
});
|
|
1849
|
+
async function onUpdaterEvent(handler) {
|
|
1850
|
+
return listen2(TauriEvent.STATUS_UPDATE, (data) => {
|
|
1851
|
+
handler(data?.payload);
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1854
|
+
async function installUpdate() {
|
|
1855
|
+
let unlistenerFn;
|
|
1856
|
+
function cleanListener() {
|
|
1857
|
+
if (unlistenerFn) {
|
|
1858
|
+
unlistenerFn();
|
|
1859
|
+
}
|
|
1860
|
+
unlistenerFn = undefined;
|
|
1861
|
+
}
|
|
1862
|
+
return new Promise((resolve2, reject) => {
|
|
1863
|
+
function onStatusChange(statusResult) {
|
|
1864
|
+
if (statusResult.error) {
|
|
1865
|
+
cleanListener();
|
|
1866
|
+
reject(statusResult.error);
|
|
1867
|
+
return;
|
|
1868
|
+
}
|
|
1869
|
+
if (statusResult.status === "DONE") {
|
|
1870
|
+
cleanListener();
|
|
1871
|
+
resolve2();
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
onUpdaterEvent(onStatusChange).then((fn) => {
|
|
1875
|
+
unlistenerFn = fn;
|
|
1876
|
+
}).catch((e) => {
|
|
1877
|
+
cleanListener();
|
|
1878
|
+
throw e;
|
|
1879
|
+
});
|
|
1880
|
+
emit2(TauriEvent.INSTALL_UPDATE).catch((e) => {
|
|
1881
|
+
cleanListener();
|
|
1882
|
+
throw e;
|
|
1883
|
+
});
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
async function checkUpdate() {
|
|
1887
|
+
let unlistenerFn;
|
|
1888
|
+
function cleanListener() {
|
|
1889
|
+
if (unlistenerFn) {
|
|
1890
|
+
unlistenerFn();
|
|
1891
|
+
}
|
|
1892
|
+
unlistenerFn = undefined;
|
|
1893
|
+
}
|
|
1894
|
+
return new Promise((resolve2, reject) => {
|
|
1895
|
+
function onUpdateAvailable(manifest) {
|
|
1896
|
+
cleanListener();
|
|
1897
|
+
resolve2({
|
|
1898
|
+
manifest,
|
|
1899
|
+
shouldUpdate: true
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
function onStatusChange(statusResult) {
|
|
1903
|
+
if (statusResult.error) {
|
|
1904
|
+
cleanListener();
|
|
1905
|
+
reject(statusResult.error);
|
|
1906
|
+
return;
|
|
1907
|
+
}
|
|
1908
|
+
if (statusResult.status === "UPTODATE") {
|
|
1909
|
+
cleanListener();
|
|
1910
|
+
resolve2({
|
|
1911
|
+
shouldUpdate: false
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
once2(TauriEvent.UPDATE_AVAILABLE, (data) => {
|
|
1916
|
+
onUpdateAvailable(data?.payload);
|
|
1917
|
+
}).catch((e) => {
|
|
1918
|
+
cleanListener();
|
|
1919
|
+
throw e;
|
|
1920
|
+
});
|
|
1921
|
+
onUpdaterEvent(onStatusChange).then((fn) => {
|
|
1922
|
+
unlistenerFn = fn;
|
|
1923
|
+
}).catch((e) => {
|
|
1924
|
+
cleanListener();
|
|
1925
|
+
throw e;
|
|
1926
|
+
});
|
|
1927
|
+
emit2(TauriEvent.CHECK_UPDATE).catch((e) => {
|
|
1928
|
+
cleanListener();
|
|
1929
|
+
throw e;
|
|
1930
|
+
});
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
// /Users/chrisbreuer/Code/stacks/node_modules/@tauri-apps/api/window.js
|
|
1935
|
+
var exports_window = {};
|
|
1936
|
+
__export(exports_window, {
|
|
1937
|
+
primaryMonitor: () => {
|
|
1938
|
+
{
|
|
1939
|
+
return primaryMonitor;
|
|
1940
|
+
}
|
|
1941
|
+
},
|
|
1942
|
+
getCurrent: () => {
|
|
1943
|
+
{
|
|
1944
|
+
return getCurrent;
|
|
1945
|
+
}
|
|
1946
|
+
},
|
|
1947
|
+
getAll: () => {
|
|
1948
|
+
{
|
|
1949
|
+
return getAll;
|
|
1950
|
+
}
|
|
1951
|
+
},
|
|
1952
|
+
currentMonitor: () => {
|
|
1953
|
+
{
|
|
1954
|
+
return currentMonitor;
|
|
1955
|
+
}
|
|
1956
|
+
},
|
|
1957
|
+
availableMonitors: () => {
|
|
1958
|
+
{
|
|
1959
|
+
return availableMonitors;
|
|
1960
|
+
}
|
|
1961
|
+
},
|
|
1962
|
+
appWindow: () => {
|
|
1963
|
+
{
|
|
1964
|
+
return appWindow;
|
|
1965
|
+
}
|
|
1966
|
+
},
|
|
1967
|
+
WindowManager: () => {
|
|
1968
|
+
{
|
|
1969
|
+
return WindowManager;
|
|
1970
|
+
}
|
|
1971
|
+
},
|
|
1972
|
+
WebviewWindowHandle: () => {
|
|
1973
|
+
{
|
|
1974
|
+
return WebviewWindowHandle;
|
|
1975
|
+
}
|
|
1976
|
+
},
|
|
1977
|
+
WebviewWindow: () => {
|
|
1978
|
+
{
|
|
1979
|
+
return WebviewWindow;
|
|
1980
|
+
}
|
|
1981
|
+
},
|
|
1982
|
+
UserAttentionType: () => {
|
|
1983
|
+
{
|
|
1984
|
+
return UserAttentionType;
|
|
1985
|
+
}
|
|
1986
|
+
},
|
|
1987
|
+
PhysicalSize: () => {
|
|
1988
|
+
{
|
|
1989
|
+
return PhysicalSize;
|
|
1990
|
+
}
|
|
1991
|
+
},
|
|
1992
|
+
PhysicalPosition: () => {
|
|
1993
|
+
{
|
|
1994
|
+
return PhysicalPosition;
|
|
1995
|
+
}
|
|
1996
|
+
},
|
|
1997
|
+
LogicalSize: () => {
|
|
1998
|
+
{
|
|
1999
|
+
return LogicalSize;
|
|
2000
|
+
}
|
|
2001
|
+
},
|
|
2002
|
+
LogicalPosition: () => {
|
|
2003
|
+
{
|
|
2004
|
+
return LogicalPosition;
|
|
2005
|
+
}
|
|
2006
|
+
},
|
|
2007
|
+
CloseRequestedEvent: () => {
|
|
2008
|
+
{
|
|
2009
|
+
return CloseRequestedEvent;
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
});
|
|
2013
|
+
var getCurrent = function() {
|
|
2014
|
+
return new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, {
|
|
2015
|
+
skip: true
|
|
2016
|
+
});
|
|
2017
|
+
};
|
|
2018
|
+
var getAll = function() {
|
|
2019
|
+
return window.__TAURI_METADATA__.__windows.map((w) => new WebviewWindow(w.label, {
|
|
2020
|
+
skip: true
|
|
2021
|
+
}));
|
|
2022
|
+
};
|
|
2023
|
+
var mapMonitor = function(m) {
|
|
2024
|
+
return m === null ? null : {
|
|
2025
|
+
name: m.name,
|
|
2026
|
+
scaleFactor: m.scaleFactor,
|
|
2027
|
+
position: mapPhysicalPosition(m.position),
|
|
2028
|
+
size: mapPhysicalSize(m.size)
|
|
2029
|
+
};
|
|
2030
|
+
};
|
|
2031
|
+
var mapPhysicalPosition = function(m) {
|
|
2032
|
+
return new PhysicalPosition(m.x, m.y);
|
|
2033
|
+
};
|
|
2034
|
+
var mapPhysicalSize = function(m) {
|
|
2035
|
+
return new PhysicalSize(m.width, m.height);
|
|
2036
|
+
};
|
|
2037
|
+
async function currentMonitor() {
|
|
2038
|
+
return invokeTauriCommand({
|
|
2039
|
+
__tauriModule: "Window",
|
|
2040
|
+
message: {
|
|
2041
|
+
cmd: "manage",
|
|
2042
|
+
data: {
|
|
2043
|
+
cmd: {
|
|
2044
|
+
type: "currentMonitor"
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
}).then(mapMonitor);
|
|
2049
|
+
}
|
|
2050
|
+
async function primaryMonitor() {
|
|
2051
|
+
return invokeTauriCommand({
|
|
2052
|
+
__tauriModule: "Window",
|
|
2053
|
+
message: {
|
|
2054
|
+
cmd: "manage",
|
|
2055
|
+
data: {
|
|
2056
|
+
cmd: {
|
|
2057
|
+
type: "primaryMonitor"
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
}).then(mapMonitor);
|
|
2062
|
+
}
|
|
2063
|
+
async function availableMonitors() {
|
|
2064
|
+
return invokeTauriCommand({
|
|
2065
|
+
__tauriModule: "Window",
|
|
2066
|
+
message: {
|
|
2067
|
+
cmd: "manage",
|
|
2068
|
+
data: {
|
|
2069
|
+
cmd: {
|
|
2070
|
+
type: "availableMonitors"
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
}).then((ms) => ms.map(mapMonitor));
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
class LogicalSize {
|
|
2078
|
+
constructor(width, height) {
|
|
2079
|
+
this.type = "Logical";
|
|
2080
|
+
this.width = width;
|
|
2081
|
+
this.height = height;
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
class PhysicalSize {
|
|
2086
|
+
constructor(width, height) {
|
|
2087
|
+
this.type = "Physical";
|
|
2088
|
+
this.width = width;
|
|
2089
|
+
this.height = height;
|
|
2090
|
+
}
|
|
2091
|
+
toLogical(scaleFactor) {
|
|
2092
|
+
return new LogicalSize(this.width / scaleFactor, this.height / scaleFactor);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
class LogicalPosition {
|
|
2097
|
+
constructor(x, y) {
|
|
2098
|
+
this.type = "Logical";
|
|
2099
|
+
this.x = x;
|
|
2100
|
+
this.y = y;
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
class PhysicalPosition {
|
|
2105
|
+
constructor(x, y) {
|
|
2106
|
+
this.type = "Physical";
|
|
2107
|
+
this.x = x;
|
|
2108
|
+
this.y = y;
|
|
2109
|
+
}
|
|
2110
|
+
toLogical(scaleFactor) {
|
|
2111
|
+
return new LogicalPosition(this.x / scaleFactor, this.y / scaleFactor);
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
var UserAttentionType;
|
|
2115
|
+
(function(UserAttentionType2) {
|
|
2116
|
+
UserAttentionType2[UserAttentionType2["Critical"] = 1] = "Critical";
|
|
2117
|
+
UserAttentionType2[UserAttentionType2["Informational"] = 2] = "Informational";
|
|
2118
|
+
})(UserAttentionType || (UserAttentionType = {}));
|
|
2119
|
+
var localTauriEvents = ["tauri://created", "tauri://error"];
|
|
2120
|
+
|
|
2121
|
+
class WebviewWindowHandle {
|
|
2122
|
+
constructor(label) {
|
|
2123
|
+
this.label = label;
|
|
2124
|
+
this.listeners = Object.create(null);
|
|
2125
|
+
}
|
|
2126
|
+
async listen(event5, handler) {
|
|
2127
|
+
if (this._handleTauriEvent(event5, handler)) {
|
|
2128
|
+
return Promise.resolve(() => {
|
|
2129
|
+
const listeners = this.listeners[event5];
|
|
2130
|
+
listeners.splice(listeners.indexOf(handler), 1);
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2133
|
+
return listen(event5, this.label, handler);
|
|
2134
|
+
}
|
|
2135
|
+
async once(event5, handler) {
|
|
2136
|
+
if (this._handleTauriEvent(event5, handler)) {
|
|
2137
|
+
return Promise.resolve(() => {
|
|
2138
|
+
const listeners = this.listeners[event5];
|
|
2139
|
+
listeners.splice(listeners.indexOf(handler), 1);
|
|
2140
|
+
});
|
|
2141
|
+
}
|
|
2142
|
+
return once(event5, this.label, handler);
|
|
2143
|
+
}
|
|
2144
|
+
async emit(event5, payload) {
|
|
2145
|
+
if (localTauriEvents.includes(event5)) {
|
|
2146
|
+
for (const handler of this.listeners[event5] || []) {
|
|
2147
|
+
handler({ event: event5, id: -1, windowLabel: this.label, payload });
|
|
2148
|
+
}
|
|
2149
|
+
return Promise.resolve();
|
|
2150
|
+
}
|
|
2151
|
+
return emit(event5, this.label, payload);
|
|
2152
|
+
}
|
|
2153
|
+
_handleTauriEvent(event5, handler) {
|
|
2154
|
+
if (localTauriEvents.includes(event5)) {
|
|
2155
|
+
if (!(event5 in this.listeners)) {
|
|
2156
|
+
this.listeners[event5] = [handler];
|
|
2157
|
+
} else {
|
|
2158
|
+
this.listeners[event5].push(handler);
|
|
2159
|
+
}
|
|
2160
|
+
return true;
|
|
2161
|
+
}
|
|
2162
|
+
return false;
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
class WindowManager extends WebviewWindowHandle {
|
|
2167
|
+
async scaleFactor() {
|
|
2168
|
+
return invokeTauriCommand({
|
|
2169
|
+
__tauriModule: "Window",
|
|
2170
|
+
message: {
|
|
2171
|
+
cmd: "manage",
|
|
2172
|
+
data: {
|
|
2173
|
+
label: this.label,
|
|
2174
|
+
cmd: {
|
|
2175
|
+
type: "scaleFactor"
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
});
|
|
2180
|
+
}
|
|
2181
|
+
async innerPosition() {
|
|
2182
|
+
return invokeTauriCommand({
|
|
2183
|
+
__tauriModule: "Window",
|
|
2184
|
+
message: {
|
|
2185
|
+
cmd: "manage",
|
|
2186
|
+
data: {
|
|
2187
|
+
label: this.label,
|
|
2188
|
+
cmd: {
|
|
2189
|
+
type: "innerPosition"
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
}).then(({ x, y }) => new PhysicalPosition(x, y));
|
|
2194
|
+
}
|
|
2195
|
+
async outerPosition() {
|
|
2196
|
+
return invokeTauriCommand({
|
|
2197
|
+
__tauriModule: "Window",
|
|
2198
|
+
message: {
|
|
2199
|
+
cmd: "manage",
|
|
2200
|
+
data: {
|
|
2201
|
+
label: this.label,
|
|
2202
|
+
cmd: {
|
|
2203
|
+
type: "outerPosition"
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
}).then(({ x, y }) => new PhysicalPosition(x, y));
|
|
2208
|
+
}
|
|
2209
|
+
async innerSize() {
|
|
2210
|
+
return invokeTauriCommand({
|
|
2211
|
+
__tauriModule: "Window",
|
|
2212
|
+
message: {
|
|
2213
|
+
cmd: "manage",
|
|
2214
|
+
data: {
|
|
2215
|
+
label: this.label,
|
|
2216
|
+
cmd: {
|
|
2217
|
+
type: "innerSize"
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
}).then(({ width, height }) => new PhysicalSize(width, height));
|
|
2222
|
+
}
|
|
2223
|
+
async outerSize() {
|
|
2224
|
+
return invokeTauriCommand({
|
|
2225
|
+
__tauriModule: "Window",
|
|
2226
|
+
message: {
|
|
2227
|
+
cmd: "manage",
|
|
2228
|
+
data: {
|
|
2229
|
+
label: this.label,
|
|
2230
|
+
cmd: {
|
|
2231
|
+
type: "outerSize"
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
}).then(({ width, height }) => new PhysicalSize(width, height));
|
|
2236
|
+
}
|
|
2237
|
+
async isFullscreen() {
|
|
2238
|
+
return invokeTauriCommand({
|
|
2239
|
+
__tauriModule: "Window",
|
|
2240
|
+
message: {
|
|
2241
|
+
cmd: "manage",
|
|
2242
|
+
data: {
|
|
2243
|
+
label: this.label,
|
|
2244
|
+
cmd: {
|
|
2245
|
+
type: "isFullscreen"
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
});
|
|
2250
|
+
}
|
|
2251
|
+
async isMinimized() {
|
|
2252
|
+
return invokeTauriCommand({
|
|
2253
|
+
__tauriModule: "Window",
|
|
2254
|
+
message: {
|
|
2255
|
+
cmd: "manage",
|
|
2256
|
+
data: {
|
|
2257
|
+
label: this.label,
|
|
2258
|
+
cmd: {
|
|
2259
|
+
type: "isMinimized"
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
2265
|
+
async isMaximized() {
|
|
2266
|
+
return invokeTauriCommand({
|
|
2267
|
+
__tauriModule: "Window",
|
|
2268
|
+
message: {
|
|
2269
|
+
cmd: "manage",
|
|
2270
|
+
data: {
|
|
2271
|
+
label: this.label,
|
|
2272
|
+
cmd: {
|
|
2273
|
+
type: "isMaximized"
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
});
|
|
2278
|
+
}
|
|
2279
|
+
async isFocused() {
|
|
2280
|
+
return invokeTauriCommand({
|
|
2281
|
+
__tauriModule: "Window",
|
|
2282
|
+
message: {
|
|
2283
|
+
cmd: "manage",
|
|
2284
|
+
data: {
|
|
2285
|
+
label: this.label,
|
|
2286
|
+
cmd: {
|
|
2287
|
+
type: "isFocused"
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
});
|
|
2292
|
+
}
|
|
2293
|
+
async isDecorated() {
|
|
2294
|
+
return invokeTauriCommand({
|
|
2295
|
+
__tauriModule: "Window",
|
|
2296
|
+
message: {
|
|
2297
|
+
cmd: "manage",
|
|
2298
|
+
data: {
|
|
2299
|
+
label: this.label,
|
|
2300
|
+
cmd: {
|
|
2301
|
+
type: "isDecorated"
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
});
|
|
2306
|
+
}
|
|
2307
|
+
async isResizable() {
|
|
2308
|
+
return invokeTauriCommand({
|
|
2309
|
+
__tauriModule: "Window",
|
|
2310
|
+
message: {
|
|
2311
|
+
cmd: "manage",
|
|
2312
|
+
data: {
|
|
2313
|
+
label: this.label,
|
|
2314
|
+
cmd: {
|
|
2315
|
+
type: "isResizable"
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
});
|
|
2320
|
+
}
|
|
2321
|
+
async isMaximizable() {
|
|
2322
|
+
return invokeTauriCommand({
|
|
2323
|
+
__tauriModule: "Window",
|
|
2324
|
+
message: {
|
|
2325
|
+
cmd: "manage",
|
|
2326
|
+
data: {
|
|
2327
|
+
label: this.label,
|
|
2328
|
+
cmd: {
|
|
2329
|
+
type: "isMaximizable"
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
async isMinimizable() {
|
|
2336
|
+
return invokeTauriCommand({
|
|
2337
|
+
__tauriModule: "Window",
|
|
2338
|
+
message: {
|
|
2339
|
+
cmd: "manage",
|
|
2340
|
+
data: {
|
|
2341
|
+
label: this.label,
|
|
2342
|
+
cmd: {
|
|
2343
|
+
type: "isMinimizable"
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
async isClosable() {
|
|
2350
|
+
return invokeTauriCommand({
|
|
2351
|
+
__tauriModule: "Window",
|
|
2352
|
+
message: {
|
|
2353
|
+
cmd: "manage",
|
|
2354
|
+
data: {
|
|
2355
|
+
label: this.label,
|
|
2356
|
+
cmd: {
|
|
2357
|
+
type: "isClosable"
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
});
|
|
2362
|
+
}
|
|
2363
|
+
async isVisible() {
|
|
2364
|
+
return invokeTauriCommand({
|
|
2365
|
+
__tauriModule: "Window",
|
|
2366
|
+
message: {
|
|
2367
|
+
cmd: "manage",
|
|
2368
|
+
data: {
|
|
2369
|
+
label: this.label,
|
|
2370
|
+
cmd: {
|
|
2371
|
+
type: "isVisible"
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
});
|
|
2376
|
+
}
|
|
2377
|
+
async title() {
|
|
2378
|
+
return invokeTauriCommand({
|
|
2379
|
+
__tauriModule: "Window",
|
|
2380
|
+
message: {
|
|
2381
|
+
cmd: "manage",
|
|
2382
|
+
data: {
|
|
2383
|
+
label: this.label,
|
|
2384
|
+
cmd: {
|
|
2385
|
+
type: "title"
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
});
|
|
2390
|
+
}
|
|
2391
|
+
async theme() {
|
|
2392
|
+
return invokeTauriCommand({
|
|
2393
|
+
__tauriModule: "Window",
|
|
2394
|
+
message: {
|
|
2395
|
+
cmd: "manage",
|
|
2396
|
+
data: {
|
|
2397
|
+
label: this.label,
|
|
2398
|
+
cmd: {
|
|
2399
|
+
type: "theme"
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
});
|
|
2404
|
+
}
|
|
2405
|
+
async center() {
|
|
2406
|
+
return invokeTauriCommand({
|
|
2407
|
+
__tauriModule: "Window",
|
|
2408
|
+
message: {
|
|
2409
|
+
cmd: "manage",
|
|
2410
|
+
data: {
|
|
2411
|
+
label: this.label,
|
|
2412
|
+
cmd: {
|
|
2413
|
+
type: "center"
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
async requestUserAttention(requestType) {
|
|
2420
|
+
let requestType_ = null;
|
|
2421
|
+
if (requestType) {
|
|
2422
|
+
if (requestType === UserAttentionType.Critical) {
|
|
2423
|
+
requestType_ = { type: "Critical" };
|
|
2424
|
+
} else {
|
|
2425
|
+
requestType_ = { type: "Informational" };
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
return invokeTauriCommand({
|
|
2429
|
+
__tauriModule: "Window",
|
|
2430
|
+
message: {
|
|
2431
|
+
cmd: "manage",
|
|
2432
|
+
data: {
|
|
2433
|
+
label: this.label,
|
|
2434
|
+
cmd: {
|
|
2435
|
+
type: "requestUserAttention",
|
|
2436
|
+
payload: requestType_
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
async setResizable(resizable) {
|
|
2443
|
+
return invokeTauriCommand({
|
|
2444
|
+
__tauriModule: "Window",
|
|
2445
|
+
message: {
|
|
2446
|
+
cmd: "manage",
|
|
2447
|
+
data: {
|
|
2448
|
+
label: this.label,
|
|
2449
|
+
cmd: {
|
|
2450
|
+
type: "setResizable",
|
|
2451
|
+
payload: resizable
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
async setMaximizable(maximizable) {
|
|
2458
|
+
return invokeTauriCommand({
|
|
2459
|
+
__tauriModule: "Window",
|
|
2460
|
+
message: {
|
|
2461
|
+
cmd: "manage",
|
|
2462
|
+
data: {
|
|
2463
|
+
label: this.label,
|
|
2464
|
+
cmd: {
|
|
2465
|
+
type: "setMaximizable",
|
|
2466
|
+
payload: maximizable
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2472
|
+
async setMinimizable(minimizable) {
|
|
2473
|
+
return invokeTauriCommand({
|
|
2474
|
+
__tauriModule: "Window",
|
|
2475
|
+
message: {
|
|
2476
|
+
cmd: "manage",
|
|
2477
|
+
data: {
|
|
2478
|
+
label: this.label,
|
|
2479
|
+
cmd: {
|
|
2480
|
+
type: "setMinimizable",
|
|
2481
|
+
payload: minimizable
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
});
|
|
2486
|
+
}
|
|
2487
|
+
async setClosable(closable) {
|
|
2488
|
+
return invokeTauriCommand({
|
|
2489
|
+
__tauriModule: "Window",
|
|
2490
|
+
message: {
|
|
2491
|
+
cmd: "manage",
|
|
2492
|
+
data: {
|
|
2493
|
+
label: this.label,
|
|
2494
|
+
cmd: {
|
|
2495
|
+
type: "setClosable",
|
|
2496
|
+
payload: closable
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
});
|
|
2501
|
+
}
|
|
2502
|
+
async setTitle(title) {
|
|
2503
|
+
return invokeTauriCommand({
|
|
2504
|
+
__tauriModule: "Window",
|
|
2505
|
+
message: {
|
|
2506
|
+
cmd: "manage",
|
|
2507
|
+
data: {
|
|
2508
|
+
label: this.label,
|
|
2509
|
+
cmd: {
|
|
2510
|
+
type: "setTitle",
|
|
2511
|
+
payload: title
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
});
|
|
2516
|
+
}
|
|
2517
|
+
async maximize() {
|
|
2518
|
+
return invokeTauriCommand({
|
|
2519
|
+
__tauriModule: "Window",
|
|
2520
|
+
message: {
|
|
2521
|
+
cmd: "manage",
|
|
2522
|
+
data: {
|
|
2523
|
+
label: this.label,
|
|
2524
|
+
cmd: {
|
|
2525
|
+
type: "maximize"
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
});
|
|
2530
|
+
}
|
|
2531
|
+
async unmaximize() {
|
|
2532
|
+
return invokeTauriCommand({
|
|
2533
|
+
__tauriModule: "Window",
|
|
2534
|
+
message: {
|
|
2535
|
+
cmd: "manage",
|
|
2536
|
+
data: {
|
|
2537
|
+
label: this.label,
|
|
2538
|
+
cmd: {
|
|
2539
|
+
type: "unmaximize"
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
});
|
|
2544
|
+
}
|
|
2545
|
+
async toggleMaximize() {
|
|
2546
|
+
return invokeTauriCommand({
|
|
2547
|
+
__tauriModule: "Window",
|
|
2548
|
+
message: {
|
|
2549
|
+
cmd: "manage",
|
|
2550
|
+
data: {
|
|
2551
|
+
label: this.label,
|
|
2552
|
+
cmd: {
|
|
2553
|
+
type: "toggleMaximize"
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
});
|
|
2558
|
+
}
|
|
2559
|
+
async minimize() {
|
|
2560
|
+
return invokeTauriCommand({
|
|
2561
|
+
__tauriModule: "Window",
|
|
2562
|
+
message: {
|
|
2563
|
+
cmd: "manage",
|
|
2564
|
+
data: {
|
|
2565
|
+
label: this.label,
|
|
2566
|
+
cmd: {
|
|
2567
|
+
type: "minimize"
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
async unminimize() {
|
|
2574
|
+
return invokeTauriCommand({
|
|
2575
|
+
__tauriModule: "Window",
|
|
2576
|
+
message: {
|
|
2577
|
+
cmd: "manage",
|
|
2578
|
+
data: {
|
|
2579
|
+
label: this.label,
|
|
2580
|
+
cmd: {
|
|
2581
|
+
type: "unminimize"
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
});
|
|
2586
|
+
}
|
|
2587
|
+
async show() {
|
|
2588
|
+
return invokeTauriCommand({
|
|
2589
|
+
__tauriModule: "Window",
|
|
2590
|
+
message: {
|
|
2591
|
+
cmd: "manage",
|
|
2592
|
+
data: {
|
|
2593
|
+
label: this.label,
|
|
2594
|
+
cmd: {
|
|
2595
|
+
type: "show"
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
async hide() {
|
|
2602
|
+
return invokeTauriCommand({
|
|
2603
|
+
__tauriModule: "Window",
|
|
2604
|
+
message: {
|
|
2605
|
+
cmd: "manage",
|
|
2606
|
+
data: {
|
|
2607
|
+
label: this.label,
|
|
2608
|
+
cmd: {
|
|
2609
|
+
type: "hide"
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
async close() {
|
|
2616
|
+
return invokeTauriCommand({
|
|
2617
|
+
__tauriModule: "Window",
|
|
2618
|
+
message: {
|
|
2619
|
+
cmd: "manage",
|
|
2620
|
+
data: {
|
|
2621
|
+
label: this.label,
|
|
2622
|
+
cmd: {
|
|
2623
|
+
type: "close"
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
});
|
|
2628
|
+
}
|
|
2629
|
+
async setDecorations(decorations) {
|
|
2630
|
+
return invokeTauriCommand({
|
|
2631
|
+
__tauriModule: "Window",
|
|
2632
|
+
message: {
|
|
2633
|
+
cmd: "manage",
|
|
2634
|
+
data: {
|
|
2635
|
+
label: this.label,
|
|
2636
|
+
cmd: {
|
|
2637
|
+
type: "setDecorations",
|
|
2638
|
+
payload: decorations
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
async setAlwaysOnTop(alwaysOnTop) {
|
|
2645
|
+
return invokeTauriCommand({
|
|
2646
|
+
__tauriModule: "Window",
|
|
2647
|
+
message: {
|
|
2648
|
+
cmd: "manage",
|
|
2649
|
+
data: {
|
|
2650
|
+
label: this.label,
|
|
2651
|
+
cmd: {
|
|
2652
|
+
type: "setAlwaysOnTop",
|
|
2653
|
+
payload: alwaysOnTop
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
});
|
|
2658
|
+
}
|
|
2659
|
+
async setContentProtected(protected_) {
|
|
2660
|
+
return invokeTauriCommand({
|
|
2661
|
+
__tauriModule: "Window",
|
|
2662
|
+
message: {
|
|
2663
|
+
cmd: "manage",
|
|
2664
|
+
data: {
|
|
2665
|
+
label: this.label,
|
|
2666
|
+
cmd: {
|
|
2667
|
+
type: "setContentProtected",
|
|
2668
|
+
payload: protected_
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
});
|
|
2673
|
+
}
|
|
2674
|
+
async setSize(size) {
|
|
2675
|
+
if (!size || size.type !== "Logical" && size.type !== "Physical") {
|
|
2676
|
+
throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");
|
|
2677
|
+
}
|
|
2678
|
+
return invokeTauriCommand({
|
|
2679
|
+
__tauriModule: "Window",
|
|
2680
|
+
message: {
|
|
2681
|
+
cmd: "manage",
|
|
2682
|
+
data: {
|
|
2683
|
+
label: this.label,
|
|
2684
|
+
cmd: {
|
|
2685
|
+
type: "setSize",
|
|
2686
|
+
payload: {
|
|
2687
|
+
type: size.type,
|
|
2688
|
+
data: {
|
|
2689
|
+
width: size.width,
|
|
2690
|
+
height: size.height
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
});
|
|
2697
|
+
}
|
|
2698
|
+
async setMinSize(size) {
|
|
2699
|
+
if (size && size.type !== "Logical" && size.type !== "Physical") {
|
|
2700
|
+
throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");
|
|
2701
|
+
}
|
|
2702
|
+
return invokeTauriCommand({
|
|
2703
|
+
__tauriModule: "Window",
|
|
2704
|
+
message: {
|
|
2705
|
+
cmd: "manage",
|
|
2706
|
+
data: {
|
|
2707
|
+
label: this.label,
|
|
2708
|
+
cmd: {
|
|
2709
|
+
type: "setMinSize",
|
|
2710
|
+
payload: size ? {
|
|
2711
|
+
type: size.type,
|
|
2712
|
+
data: {
|
|
2713
|
+
width: size.width,
|
|
2714
|
+
height: size.height
|
|
2715
|
+
}
|
|
2716
|
+
} : null
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
async setMaxSize(size) {
|
|
2723
|
+
if (size && size.type !== "Logical" && size.type !== "Physical") {
|
|
2724
|
+
throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");
|
|
2725
|
+
}
|
|
2726
|
+
return invokeTauriCommand({
|
|
2727
|
+
__tauriModule: "Window",
|
|
2728
|
+
message: {
|
|
2729
|
+
cmd: "manage",
|
|
2730
|
+
data: {
|
|
2731
|
+
label: this.label,
|
|
2732
|
+
cmd: {
|
|
2733
|
+
type: "setMaxSize",
|
|
2734
|
+
payload: size ? {
|
|
2735
|
+
type: size.type,
|
|
2736
|
+
data: {
|
|
2737
|
+
width: size.width,
|
|
2738
|
+
height: size.height
|
|
2739
|
+
}
|
|
2740
|
+
} : null
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
});
|
|
2745
|
+
}
|
|
2746
|
+
async setPosition(position) {
|
|
2747
|
+
if (!position || position.type !== "Logical" && position.type !== "Physical") {
|
|
2748
|
+
throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");
|
|
2749
|
+
}
|
|
2750
|
+
return invokeTauriCommand({
|
|
2751
|
+
__tauriModule: "Window",
|
|
2752
|
+
message: {
|
|
2753
|
+
cmd: "manage",
|
|
2754
|
+
data: {
|
|
2755
|
+
label: this.label,
|
|
2756
|
+
cmd: {
|
|
2757
|
+
type: "setPosition",
|
|
2758
|
+
payload: {
|
|
2759
|
+
type: position.type,
|
|
2760
|
+
data: {
|
|
2761
|
+
x: position.x,
|
|
2762
|
+
y: position.y
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
async setFullscreen(fullscreen) {
|
|
2771
|
+
return invokeTauriCommand({
|
|
2772
|
+
__tauriModule: "Window",
|
|
2773
|
+
message: {
|
|
2774
|
+
cmd: "manage",
|
|
2775
|
+
data: {
|
|
2776
|
+
label: this.label,
|
|
2777
|
+
cmd: {
|
|
2778
|
+
type: "setFullscreen",
|
|
2779
|
+
payload: fullscreen
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2783
|
+
});
|
|
2784
|
+
}
|
|
2785
|
+
async setFocus() {
|
|
2786
|
+
return invokeTauriCommand({
|
|
2787
|
+
__tauriModule: "Window",
|
|
2788
|
+
message: {
|
|
2789
|
+
cmd: "manage",
|
|
2790
|
+
data: {
|
|
2791
|
+
label: this.label,
|
|
2792
|
+
cmd: {
|
|
2793
|
+
type: "setFocus"
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
});
|
|
2798
|
+
}
|
|
2799
|
+
async setIcon(icon) {
|
|
2800
|
+
return invokeTauriCommand({
|
|
2801
|
+
__tauriModule: "Window",
|
|
2802
|
+
message: {
|
|
2803
|
+
cmd: "manage",
|
|
2804
|
+
data: {
|
|
2805
|
+
label: this.label,
|
|
2806
|
+
cmd: {
|
|
2807
|
+
type: "setIcon",
|
|
2808
|
+
payload: {
|
|
2809
|
+
icon: typeof icon === "string" ? icon : Array.from(icon)
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
});
|
|
2815
|
+
}
|
|
2816
|
+
async setSkipTaskbar(skip) {
|
|
2817
|
+
return invokeTauriCommand({
|
|
2818
|
+
__tauriModule: "Window",
|
|
2819
|
+
message: {
|
|
2820
|
+
cmd: "manage",
|
|
2821
|
+
data: {
|
|
2822
|
+
label: this.label,
|
|
2823
|
+
cmd: {
|
|
2824
|
+
type: "setSkipTaskbar",
|
|
2825
|
+
payload: skip
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
async setCursorGrab(grab) {
|
|
2832
|
+
return invokeTauriCommand({
|
|
2833
|
+
__tauriModule: "Window",
|
|
2834
|
+
message: {
|
|
2835
|
+
cmd: "manage",
|
|
2836
|
+
data: {
|
|
2837
|
+
label: this.label,
|
|
2838
|
+
cmd: {
|
|
2839
|
+
type: "setCursorGrab",
|
|
2840
|
+
payload: grab
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
}
|
|
2844
|
+
});
|
|
2845
|
+
}
|
|
2846
|
+
async setCursorVisible(visible) {
|
|
2847
|
+
return invokeTauriCommand({
|
|
2848
|
+
__tauriModule: "Window",
|
|
2849
|
+
message: {
|
|
2850
|
+
cmd: "manage",
|
|
2851
|
+
data: {
|
|
2852
|
+
label: this.label,
|
|
2853
|
+
cmd: {
|
|
2854
|
+
type: "setCursorVisible",
|
|
2855
|
+
payload: visible
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
});
|
|
2860
|
+
}
|
|
2861
|
+
async setCursorIcon(icon) {
|
|
2862
|
+
return invokeTauriCommand({
|
|
2863
|
+
__tauriModule: "Window",
|
|
2864
|
+
message: {
|
|
2865
|
+
cmd: "manage",
|
|
2866
|
+
data: {
|
|
2867
|
+
label: this.label,
|
|
2868
|
+
cmd: {
|
|
2869
|
+
type: "setCursorIcon",
|
|
2870
|
+
payload: icon
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
});
|
|
2875
|
+
}
|
|
2876
|
+
async setCursorPosition(position) {
|
|
2877
|
+
if (!position || position.type !== "Logical" && position.type !== "Physical") {
|
|
2878
|
+
throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");
|
|
2879
|
+
}
|
|
2880
|
+
return invokeTauriCommand({
|
|
2881
|
+
__tauriModule: "Window",
|
|
2882
|
+
message: {
|
|
2883
|
+
cmd: "manage",
|
|
2884
|
+
data: {
|
|
2885
|
+
label: this.label,
|
|
2886
|
+
cmd: {
|
|
2887
|
+
type: "setCursorPosition",
|
|
2888
|
+
payload: {
|
|
2889
|
+
type: position.type,
|
|
2890
|
+
data: {
|
|
2891
|
+
x: position.x,
|
|
2892
|
+
y: position.y
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
});
|
|
2899
|
+
}
|
|
2900
|
+
async setIgnoreCursorEvents(ignore) {
|
|
2901
|
+
return invokeTauriCommand({
|
|
2902
|
+
__tauriModule: "Window",
|
|
2903
|
+
message: {
|
|
2904
|
+
cmd: "manage",
|
|
2905
|
+
data: {
|
|
2906
|
+
label: this.label,
|
|
2907
|
+
cmd: {
|
|
2908
|
+
type: "setIgnoreCursorEvents",
|
|
2909
|
+
payload: ignore
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
});
|
|
2914
|
+
}
|
|
2915
|
+
async startDragging() {
|
|
2916
|
+
return invokeTauriCommand({
|
|
2917
|
+
__tauriModule: "Window",
|
|
2918
|
+
message: {
|
|
2919
|
+
cmd: "manage",
|
|
2920
|
+
data: {
|
|
2921
|
+
label: this.label,
|
|
2922
|
+
cmd: {
|
|
2923
|
+
type: "startDragging"
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
});
|
|
2928
|
+
}
|
|
2929
|
+
async onResized(handler) {
|
|
2930
|
+
return this.listen(TauriEvent.WINDOW_RESIZED, (e) => {
|
|
2931
|
+
e.payload = mapPhysicalSize(e.payload);
|
|
2932
|
+
handler(e);
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
async onMoved(handler) {
|
|
2936
|
+
return this.listen(TauriEvent.WINDOW_MOVED, (e) => {
|
|
2937
|
+
e.payload = mapPhysicalPosition(e.payload);
|
|
2938
|
+
handler(e);
|
|
2939
|
+
});
|
|
2940
|
+
}
|
|
2941
|
+
async onCloseRequested(handler) {
|
|
2942
|
+
return this.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, (event5) => {
|
|
2943
|
+
const evt = new CloseRequestedEvent(event5);
|
|
2944
|
+
Promise.resolve(handler(evt)).then(() => {
|
|
2945
|
+
if (!evt.isPreventDefault()) {
|
|
2946
|
+
return this.close();
|
|
2947
|
+
}
|
|
2948
|
+
});
|
|
2949
|
+
});
|
|
2950
|
+
}
|
|
2951
|
+
async onFocusChanged(handler) {
|
|
2952
|
+
const unlistenFocus = await this.listen(TauriEvent.WINDOW_FOCUS, (event5) => {
|
|
2953
|
+
handler({ ...event5, payload: true });
|
|
2954
|
+
});
|
|
2955
|
+
const unlistenBlur = await this.listen(TauriEvent.WINDOW_BLUR, (event5) => {
|
|
2956
|
+
handler({ ...event5, payload: false });
|
|
2957
|
+
});
|
|
2958
|
+
return () => {
|
|
2959
|
+
unlistenFocus();
|
|
2960
|
+
unlistenBlur();
|
|
2961
|
+
};
|
|
2962
|
+
}
|
|
2963
|
+
async onScaleChanged(handler) {
|
|
2964
|
+
return this.listen(TauriEvent.WINDOW_SCALE_FACTOR_CHANGED, handler);
|
|
2965
|
+
}
|
|
2966
|
+
async onMenuClicked(handler) {
|
|
2967
|
+
return this.listen(TauriEvent.MENU, handler);
|
|
2968
|
+
}
|
|
2969
|
+
async onFileDropEvent(handler) {
|
|
2970
|
+
const unlistenFileDrop = await this.listen(TauriEvent.WINDOW_FILE_DROP, (event5) => {
|
|
2971
|
+
handler({ ...event5, payload: { type: "drop", paths: event5.payload } });
|
|
2972
|
+
});
|
|
2973
|
+
const unlistenFileHover = await this.listen(TauriEvent.WINDOW_FILE_DROP_HOVER, (event5) => {
|
|
2974
|
+
handler({ ...event5, payload: { type: "hover", paths: event5.payload } });
|
|
2975
|
+
});
|
|
2976
|
+
const unlistenCancel = await this.listen(TauriEvent.WINDOW_FILE_DROP_CANCELLED, (event5) => {
|
|
2977
|
+
handler({ ...event5, payload: { type: "cancel" } });
|
|
2978
|
+
});
|
|
2979
|
+
return () => {
|
|
2980
|
+
unlistenFileDrop();
|
|
2981
|
+
unlistenFileHover();
|
|
2982
|
+
unlistenCancel();
|
|
2983
|
+
};
|
|
2984
|
+
}
|
|
2985
|
+
async onThemeChanged(handler) {
|
|
2986
|
+
return this.listen(TauriEvent.WINDOW_THEME_CHANGED, handler);
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
class CloseRequestedEvent {
|
|
2991
|
+
constructor(event5) {
|
|
2992
|
+
this._preventDefault = false;
|
|
2993
|
+
this.event = event5.event;
|
|
2994
|
+
this.windowLabel = event5.windowLabel;
|
|
2995
|
+
this.id = event5.id;
|
|
2996
|
+
}
|
|
2997
|
+
preventDefault() {
|
|
2998
|
+
this._preventDefault = true;
|
|
2999
|
+
}
|
|
3000
|
+
isPreventDefault() {
|
|
3001
|
+
return this._preventDefault;
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
class WebviewWindow extends WindowManager {
|
|
3006
|
+
constructor(label, options = {}) {
|
|
3007
|
+
super(label);
|
|
3008
|
+
if (!options?.skip) {
|
|
3009
|
+
invokeTauriCommand({
|
|
3010
|
+
__tauriModule: "Window",
|
|
3011
|
+
message: {
|
|
3012
|
+
cmd: "createWebview",
|
|
3013
|
+
data: {
|
|
3014
|
+
options: {
|
|
3015
|
+
label,
|
|
3016
|
+
...options
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
3020
|
+
}).then(async () => this.emit("tauri://created")).catch(async (e) => this.emit("tauri://error", e));
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
static getByLabel(label) {
|
|
3024
|
+
if (getAll().some((w) => w.label === label)) {
|
|
3025
|
+
return new WebviewWindow(label, { skip: true });
|
|
3026
|
+
}
|
|
3027
|
+
return null;
|
|
3028
|
+
}
|
|
3029
|
+
static async getFocusedWindow() {
|
|
3030
|
+
for (const w of getAll()) {
|
|
3031
|
+
if (await w.isFocused()) {
|
|
3032
|
+
return w;
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
return null;
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
var appWindow;
|
|
3039
|
+
if ("__TAURI_METADATA__" in window) {
|
|
3040
|
+
appWindow = new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, {
|
|
3041
|
+
skip: true
|
|
3042
|
+
});
|
|
3043
|
+
} else {
|
|
3044
|
+
console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.`);
|
|
3045
|
+
appWindow = new WebviewWindow("main", {
|
|
3046
|
+
skip: true
|
|
3047
|
+
});
|
|
3048
|
+
}
|
|
3049
|
+
|
|
3050
|
+
// src/index.ts
|
|
3051
|
+
async function openShell(link) {
|
|
3052
|
+
await open(link);
|
|
3053
|
+
}
|
|
3054
|
+
var desktop = {
|
|
3055
|
+
app: exports_app,
|
|
3056
|
+
event: exports_event,
|
|
3057
|
+
clipboard: exports_clipboard,
|
|
3058
|
+
dialog: exports_dialog,
|
|
3059
|
+
fs: exports_fs,
|
|
3060
|
+
globalShortcut: exports_globalShortcut,
|
|
3061
|
+
http: exports_http,
|
|
3062
|
+
mocks: exports_mocks,
|
|
3063
|
+
notification: exports_notification,
|
|
3064
|
+
os: exports_os,
|
|
3065
|
+
path: exports_path,
|
|
3066
|
+
process: exports_process,
|
|
3067
|
+
shell: exports_shell,
|
|
3068
|
+
tauri: exports_tauri,
|
|
3069
|
+
updater: exports_updater,
|
|
3070
|
+
window: exports_window
|
|
3071
|
+
};
|
|
3072
|
+
export {
|
|
3073
|
+
openShell,
|
|
3074
|
+
desktop
|
|
3075
|
+
};
|