@stacksjs/desktop 0.59.11 → 0.61.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -65,7 +65,7 @@ var transformCallback = function(callback, once = false) {
65
65
  if (once) {
66
66
  Reflect.deleteProperty(window, prop);
67
67
  }
68
- return callback?.(result);
68
+ return callback === null || callback === undefined ? undefined : callback(result);
69
69
  },
70
70
  writable: false,
71
71
  configurable: true
@@ -228,7 +228,7 @@ class Command extends EventEmitter {
228
228
  this.stderr = new EventEmitter;
229
229
  this.program = program;
230
230
  this.args = typeof args === "string" ? [args] : args;
231
- this.options = options ?? {};
231
+ this.options = options !== null && options !== undefined ? options : {};
232
232
  }
233
233
  static sidecar(program, args = [], options) {
234
234
  const instance = new Command(program, args, options);
@@ -347,106 +347,6 @@ async function hide() {
347
347
  });
348
348
  }
349
349
 
350
- // ../../../../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
- // ../../../../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
- // ../../../../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
350
  // ../../../../node_modules/@tauri-apps/api/clipboard.js
451
351
  var exports_clipboard = {};
452
352
  __export(exports_clipboard, {
@@ -534,51 +434,154 @@ async function save(options = {}) {
534
434
  });
535
435
  }
536
436
  async function message(message2, options) {
437
+ var _a, _b;
537
438
  const opts = typeof options === "string" ? { title: options } : options;
538
439
  return invokeTauriCommand({
539
440
  __tauriModule: "Dialog",
540
441
  message: {
541
442
  cmd: "messageDialog",
542
443
  message: message2.toString(),
543
- title: opts?.title?.toString(),
544
- type: opts?.type,
545
- buttonLabel: opts?.okLabel?.toString()
444
+ title: (_a = opts === null || opts === undefined ? undefined : opts.title) === null || _a === undefined ? undefined : _a.toString(),
445
+ type: opts === null || opts === undefined ? undefined : opts.type,
446
+ buttonLabel: (_b = opts === null || opts === undefined ? undefined : opts.okLabel) === null || _b === undefined ? undefined : _b.toString()
546
447
  }
547
448
  });
548
449
  }
549
450
  async function ask(message2, options) {
451
+ var _a, _b, _c, _d, _e;
550
452
  const opts = typeof options === "string" ? { title: options } : options;
551
453
  return invokeTauriCommand({
552
454
  __tauriModule: "Dialog",
553
455
  message: {
554
456
  cmd: "askDialog",
555
457
  message: message2.toString(),
556
- title: opts?.title?.toString(),
557
- type: opts?.type,
458
+ title: (_a = opts === null || opts === undefined ? undefined : opts.title) === null || _a === undefined ? undefined : _a.toString(),
459
+ type: opts === null || opts === undefined ? undefined : opts.type,
558
460
  buttonLabels: [
559
- opts?.okLabel?.toString() ?? "Yes",
560
- opts?.cancelLabel?.toString() ?? "No"
461
+ (_c = (_b = opts === null || opts === undefined ? undefined : opts.okLabel) === null || _b === undefined ? undefined : _b.toString()) !== null && _c !== undefined ? _c : "Yes",
462
+ (_e = (_d = opts === null || opts === undefined ? undefined : opts.cancelLabel) === null || _d === undefined ? undefined : _d.toString()) !== null && _e !== undefined ? _e : "No"
561
463
  ]
562
464
  }
563
465
  });
564
466
  }
565
467
  async function confirm(message2, options) {
468
+ var _a, _b, _c, _d, _e;
566
469
  const opts = typeof options === "string" ? { title: options } : options;
567
470
  return invokeTauriCommand({
568
471
  __tauriModule: "Dialog",
569
472
  message: {
570
473
  cmd: "confirmDialog",
571
474
  message: message2.toString(),
572
- title: opts?.title?.toString(),
573
- type: opts?.type,
475
+ title: (_a = opts === null || opts === undefined ? undefined : opts.title) === null || _a === undefined ? undefined : _a.toString(),
476
+ type: opts === null || opts === undefined ? undefined : opts.type,
574
477
  buttonLabels: [
575
- opts?.okLabel?.toString() ?? "Ok",
576
- opts?.cancelLabel?.toString() ?? "Cancel"
478
+ (_c = (_b = opts === null || opts === undefined ? undefined : opts.okLabel) === null || _b === undefined ? undefined : _b.toString()) !== null && _c !== undefined ? _c : "Ok",
479
+ (_e = (_d = opts === null || opts === undefined ? undefined : opts.cancelLabel) === null || _d === undefined ? undefined : _d.toString()) !== null && _e !== undefined ? _e : "Cancel"
577
480
  ]
578
481
  }
579
482
  });
580
483
  }
581
484
 
485
+ // ../../../../node_modules/@tauri-apps/api/event.js
486
+ var exports_event = {};
487
+ __export(exports_event, {
488
+ once: () => {
489
+ {
490
+ return once2;
491
+ }
492
+ },
493
+ listen: () => {
494
+ {
495
+ return listen2;
496
+ }
497
+ },
498
+ emit: () => {
499
+ {
500
+ return emit2;
501
+ }
502
+ },
503
+ TauriEvent: () => {
504
+ {
505
+ return TauriEvent;
506
+ }
507
+ }
508
+ });
509
+
510
+ // ../../../../node_modules/@tauri-apps/api/helpers/event.js
511
+ async function _unlisten(event, eventId) {
512
+ return invokeTauriCommand({
513
+ __tauriModule: "Event",
514
+ message: {
515
+ cmd: "unlisten",
516
+ event,
517
+ eventId
518
+ }
519
+ });
520
+ }
521
+ async function emit(event, windowLabel, payload) {
522
+ await invokeTauriCommand({
523
+ __tauriModule: "Event",
524
+ message: {
525
+ cmd: "emit",
526
+ event,
527
+ windowLabel,
528
+ payload
529
+ }
530
+ });
531
+ }
532
+ async function listen(event, windowLabel, handler) {
533
+ return invokeTauriCommand({
534
+ __tauriModule: "Event",
535
+ message: {
536
+ cmd: "listen",
537
+ event,
538
+ windowLabel,
539
+ handler: transformCallback(handler)
540
+ }
541
+ }).then((eventId) => {
542
+ return async () => _unlisten(event, eventId);
543
+ });
544
+ }
545
+ async function once(event, windowLabel, handler) {
546
+ return listen(event, windowLabel, (eventData) => {
547
+ handler(eventData);
548
+ _unlisten(event, eventData.id).catch(() => {
549
+ });
550
+ });
551
+ }
552
+
553
+ // ../../../../node_modules/@tauri-apps/api/event.js
554
+ async function listen2(event2, handler) {
555
+ return listen(event2, null, handler);
556
+ }
557
+ async function once2(event2, handler) {
558
+ return once(event2, null, handler);
559
+ }
560
+ async function emit2(event2, payload) {
561
+ return emit(event2, undefined, payload);
562
+ }
563
+ var TauriEvent;
564
+ (function(TauriEvent2) {
565
+ TauriEvent2["WINDOW_RESIZED"] = "tauri://resize";
566
+ TauriEvent2["WINDOW_MOVED"] = "tauri://move";
567
+ TauriEvent2["WINDOW_CLOSE_REQUESTED"] = "tauri://close-requested";
568
+ TauriEvent2["WINDOW_CREATED"] = "tauri://window-created";
569
+ TauriEvent2["WINDOW_DESTROYED"] = "tauri://destroyed";
570
+ TauriEvent2["WINDOW_FOCUS"] = "tauri://focus";
571
+ TauriEvent2["WINDOW_BLUR"] = "tauri://blur";
572
+ TauriEvent2["WINDOW_SCALE_FACTOR_CHANGED"] = "tauri://scale-change";
573
+ TauriEvent2["WINDOW_THEME_CHANGED"] = "tauri://theme-changed";
574
+ TauriEvent2["WINDOW_FILE_DROP"] = "tauri://file-drop";
575
+ TauriEvent2["WINDOW_FILE_DROP_HOVER"] = "tauri://file-drop-hover";
576
+ TauriEvent2["WINDOW_FILE_DROP_CANCELLED"] = "tauri://file-drop-cancelled";
577
+ TauriEvent2["MENU"] = "tauri://menu";
578
+ TauriEvent2["CHECK_UPDATE"] = "tauri://update";
579
+ TauriEvent2["UPDATE_AVAILABLE"] = "tauri://update-available";
580
+ TauriEvent2["INSTALL_UPDATE"] = "tauri://update-install";
581
+ TauriEvent2["STATUS_UPDATE"] = "tauri://update-status";
582
+ TauriEvent2["DOWNLOAD_PROGRESS"] = "tauri://update-download-progress";
583
+ })(TauriEvent || (TauriEvent = {}));
584
+
582
585
  // ../../../../node_modules/@tauri-apps/api/fs.js
583
586
  var exports_fs = {};
584
587
  __export(exports_fs, {
@@ -690,7 +693,7 @@ async function writeTextFile(path, contents, options) {
690
693
  file.contents = path.contents;
691
694
  }
692
695
  if (typeof contents === "string") {
693
- file.contents = contents ?? "";
696
+ file.contents = contents !== null && contents !== undefined ? contents : "";
694
697
  } else {
695
698
  fileOptions = contents;
696
699
  }
@@ -722,7 +725,7 @@ async function writeBinaryFile(path, contents, options) {
722
725
  if (contents && "dir" in contents) {
723
726
  fileOptions = contents;
724
727
  } else if (typeof path === "string") {
725
- file.contents = contents ?? [];
728
+ file.contents = contents !== null && contents !== undefined ? contents : [];
726
729
  }
727
730
  return invokeTauriCommand({
728
731
  __tauriModule: "Fs",
@@ -989,12 +992,13 @@ async function getClient(options) {
989
992
  }).then((id) => new Client(id));
990
993
  }
991
994
  async function fetch(url, options) {
995
+ var _a;
992
996
  if (defaultClient === null) {
993
997
  defaultClient = await getClient();
994
998
  }
995
999
  return defaultClient.request({
996
1000
  url,
997
- method: options?.method ?? "GET",
1001
+ method: (_a = options === null || options === undefined ? undefined : options.method) !== null && _a !== undefined ? _a : "GET",
998
1002
  ...options
999
1003
  });
1000
1004
  }
@@ -1049,11 +1053,12 @@ class Client {
1049
1053
  });
1050
1054
  }
1051
1055
  async request(options) {
1056
+ var _a;
1052
1057
  const jsonResponse = !options.responseType || options.responseType === ResponseType.JSON;
1053
1058
  if (jsonResponse) {
1054
1059
  options.responseType = ResponseType.Text;
1055
1060
  }
1056
- if (options.body?.type === "Form") {
1061
+ if (((_a = options.body) === null || _a === undefined ? undefined : _a.type) === "Form") {
1057
1062
  options.body.payload = await formBody(options.body.payload);
1058
1063
  }
1059
1064
  return invokeTauriCommand({
@@ -1161,14 +1166,16 @@ var mockWindows = function(current, ...additionalWindows) {
1161
1166
  };
1162
1167
  };
1163
1168
  var mockConvertFileSrc = function(osName, windowsProtocolScheme = "https") {
1164
- window.__TAURI__ = window.__TAURI__ ?? {};
1169
+ var _a;
1170
+ window.__TAURI__ = (_a = window.__TAURI__) !== null && _a !== undefined ? _a : {};
1165
1171
  window.__TAURI__.convertFileSrc = function(filePath, protocol = "asset") {
1166
1172
  const path = encodeURIComponent(filePath);
1167
1173
  return osName === "windows" ? `${windowsProtocolScheme}://${protocol}.localhost/${path}` : `${protocol}://localhost/${path}`;
1168
1174
  };
1169
1175
  };
1170
1176
  var clearMocks = function() {
1171
- if (window.__TAURI__?.convertFileSrc)
1177
+ var _a;
1178
+ if ((_a = window.__TAURI__) === null || _a === undefined ? undefined : _a.convertFileSrc)
1172
1179
  delete window.__TAURI__.convertFileSrc;
1173
1180
  if (window.__TAURI_IPC__)
1174
1181
  delete window.__TAURI_IPC__;
@@ -1848,7 +1855,7 @@ __export(exports_updater, {
1848
1855
  });
1849
1856
  async function onUpdaterEvent(handler) {
1850
1857
  return listen2(TauriEvent.STATUS_UPDATE, (data) => {
1851
- handler(data?.payload);
1858
+ handler(data === null || data === undefined ? undefined : data.payload);
1852
1859
  });
1853
1860
  }
1854
1861
  async function installUpdate() {
@@ -1913,7 +1920,7 @@ async function checkUpdate() {
1913
1920
  }
1914
1921
  }
1915
1922
  once2(TauriEvent.UPDATE_AVAILABLE, (data) => {
1916
- onUpdateAvailable(data?.payload);
1923
+ onUpdateAvailable(data === null || data === undefined ? undefined : data.payload);
1917
1924
  }).catch((e) => {
1918
1925
  cleanListener();
1919
1926
  throw e;
@@ -3005,7 +3012,7 @@ class CloseRequestedEvent {
3005
3012
  class WebviewWindow extends WindowManager {
3006
3013
  constructor(label, options = {}) {
3007
3014
  super(label);
3008
- if (!options?.skip) {
3015
+ if (!(options === null || options === undefined ? undefined : options.skip)) {
3009
3016
  invokeTauriCommand({
3010
3017
  __tauriModule: "Window",
3011
3018
  message: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/desktop",
3
3
  "type": "module",
4
- "version": "0.59.11",
4
+ "version": "0.61.1",
5
5
  "description": "The Stacks Desktop engine.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -49,10 +49,10 @@
49
49
  "src"
50
50
  ],
51
51
  "scripts": {
52
- "dev": "bunx vite ../../dashboard -c ../vite/src/desktop.ts",
52
+ "dev": "bunx vite ../../dashboard -c ../vite-config/src/desktop.ts",
53
53
  "dev:app": "tauri dev",
54
54
  "build": "bun --bun build.ts",
55
- "build:app": "bunx vite build ../../dashboard -c ../vite/src/desktop.ts",
55
+ "build:app": "bunx vite build ../../dashboard -c ../vite-config/src/desktop.ts",
56
56
  "tauri:build": "tauri build",
57
57
  "typecheck": "bun --bun tsc --noEmit",
58
58
  "prepublishOnly": "bun run build"
@@ -60,20 +60,20 @@
60
60
  "peerDependencies": {
61
61
  "@stacksjs/build": "latest",
62
62
  "@stacksjs/server": "latest",
63
- "@tauri-apps/api": "^1.5.3",
64
- "@tauri-apps/cli": "^1.5.10",
63
+ "@tauri-apps/api": "^1.5.6",
64
+ "@tauri-apps/cli": "^1.5.14",
65
65
  "unified-network": "^0.6.4",
66
- "unstorage": "^1.10.1",
67
- "vue": "^3.4.21"
66
+ "unstorage": "^1.10.2",
67
+ "vue": "^3.4.27"
68
68
  },
69
69
  "dependencies": {
70
70
  "@stacksjs/build": "latest",
71
71
  "@stacksjs/server": "latest",
72
- "@tauri-apps/api": "^1.5.3",
73
- "@tauri-apps/cli": "^1.5.10",
72
+ "@tauri-apps/api": "^1.5.6",
73
+ "@tauri-apps/cli": "^1.5.14",
74
74
  "unified-network": "^0.6.4",
75
- "unstorage": "^1.10.1",
76
- "vue": "^3.4.21"
75
+ "unstorage": "^1.10.2",
76
+ "vue": "^3.4.27"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@stacksjs/development": "latest"
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { open as shellOpen } from '@tauri-apps/api/shell'
2
2
 
3
3
  import * as app from '@tauri-apps/api/app'
4
- import * as event from '@tauri-apps/api/event'
5
4
  import * as clipboard from '@tauri-apps/api/clipboard'
6
5
  import * as dialog from '@tauri-apps/api/dialog'
6
+ import * as event from '@tauri-apps/api/event'
7
7
  import * as fs from '@tauri-apps/api/fs'
8
8
  import * as globalShortcut from '@tauri-apps/api/globalShortcut'
9
9
  import * as http from '@tauri-apps/api/http'
package/dist/index.d.ts DELETED
@@ -1,36 +0,0 @@
1
- import * as app from '@tauri-apps/api/app';
2
- import * as event from '@tauri-apps/api/event';
3
- import * as clipboard from '@tauri-apps/api/clipboard';
4
- import * as dialog from '@tauri-apps/api/dialog';
5
- import * as fs from '@tauri-apps/api/fs';
6
- import * as globalShortcut from '@tauri-apps/api/globalShortcut';
7
- import * as http from '@tauri-apps/api/http';
8
- import * as mocks from '@tauri-apps/api/mocks';
9
- import * as notification from '@tauri-apps/api/notification';
10
- import * as os from '@tauri-apps/api/os';
11
- import * as path from '@tauri-apps/api/path';
12
- import * as process from '@tauri-apps/api/process';
13
- import * as shell from '@tauri-apps/api/shell';
14
- import * as tauri from '@tauri-apps/api/tauri';
15
- import * as updater from '@tauri-apps/api/updater';
16
- import * as window from '@tauri-apps/api/window';
17
- export declare const desktop: {
18
- app: typeof app;
19
- event: typeof event;
20
- clipboard: typeof clipboard;
21
- dialog: typeof dialog;
22
- fs: typeof fs;
23
- globalShortcut: typeof globalShortcut;
24
- http: typeof http;
25
- mocks: typeof mocks;
26
- notification: typeof notification;
27
- os: typeof os;
28
- path: typeof path;
29
- process: typeof process;
30
- shell: typeof shell;
31
- tauri: typeof tauri;
32
- updater: typeof updater;
33
- window: typeof window;
34
- };
35
- export declare function openShell(link: string): Promise<void>;
36
- export * from './system-tray';
@@ -1 +0,0 @@
1
- export declare const testingThis = "testing this";