@delta-comic/core 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useGlobalVar } from "@delta-comic/utils";
2
2
  import { defineStore } from "pinia";
3
- import { reactive, shallowReactive } from "vue";
3
+ import { reactive, shallowReactive, shallowRef, watch } from "vue";
4
4
  var _useTemp = useGlobalVar(defineStore("core:temp", (e) => {
5
5
  let t = shallowReactive(/* @__PURE__ */ new Map());
6
6
  return {
@@ -81,6 +81,730 @@ var SharedFunction = class {
81
81
  return Object.assign(i, a);
82
82
  }
83
83
  };
84
- export { SharedFunction, useTemp };
84
+ function __classPrivateFieldGet(e, t, n, r) {
85
+ if (n === "a" && !r) throw TypeError("Private accessor was defined without a getter");
86
+ if (typeof t == "function" ? e !== t || !r : !t.has(e)) throw TypeError("Cannot read private member from an object whose class did not declare it");
87
+ return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
88
+ }
89
+ function __classPrivateFieldSet(e, t, n, r, i) {
90
+ if (r === "m") throw TypeError("Private method is not writable");
91
+ if (r === "a" && !i) throw TypeError("Private accessor was defined without a setter");
92
+ if (typeof t == "function" ? e !== t || !i : !t.has(e)) throw TypeError("Cannot write private member to an object whose class did not declare it");
93
+ return r === "a" ? i.call(e, n) : i ? i.value = n : t.set(e, n), n;
94
+ }
95
+ var _Resource_rid, SERIALIZE_TO_IPC_FN = "__TAURI_TO_IPC_KEY__";
96
+ function transformCallback(e, t = !1) {
97
+ return window.__TAURI_INTERNALS__.transformCallback(e, t);
98
+ }
99
+ async function invoke(e, t = {}, n) {
100
+ return window.__TAURI_INTERNALS__.invoke(e, t, n);
101
+ }
102
+ var Resource = class {
103
+ get rid() {
104
+ return __classPrivateFieldGet(this, _Resource_rid, "f");
105
+ }
106
+ constructor(e) {
107
+ _Resource_rid.set(this, void 0), __classPrivateFieldSet(this, _Resource_rid, e, "f");
108
+ }
109
+ async close() {
110
+ return invoke("plugin:resources|close", { rid: this.rid });
111
+ }
112
+ };
113
+ _Resource_rid = /* @__PURE__ */ new WeakMap();
114
+ var LogicalSize = class {
115
+ constructor(...e) {
116
+ this.type = "Logical", e.length === 1 ? "Logical" in e[0] ? (this.width = e[0].Logical.width, this.height = e[0].Logical.height) : (this.width = e[0].width, this.height = e[0].height) : (this.width = e[0], this.height = e[1]);
117
+ }
118
+ toPhysical(e) {
119
+ return new PhysicalSize(this.width * e, this.height * e);
120
+ }
121
+ [SERIALIZE_TO_IPC_FN]() {
122
+ return {
123
+ width: this.width,
124
+ height: this.height
125
+ };
126
+ }
127
+ toJSON() {
128
+ return this[SERIALIZE_TO_IPC_FN]();
129
+ }
130
+ }, PhysicalSize = class {
131
+ constructor(...e) {
132
+ this.type = "Physical", e.length === 1 ? "Physical" in e[0] ? (this.width = e[0].Physical.width, this.height = e[0].Physical.height) : (this.width = e[0].width, this.height = e[0].height) : (this.width = e[0], this.height = e[1]);
133
+ }
134
+ toLogical(e) {
135
+ return new LogicalSize(this.width / e, this.height / e);
136
+ }
137
+ [SERIALIZE_TO_IPC_FN]() {
138
+ return {
139
+ width: this.width,
140
+ height: this.height
141
+ };
142
+ }
143
+ toJSON() {
144
+ return this[SERIALIZE_TO_IPC_FN]();
145
+ }
146
+ }, Size = class {
147
+ constructor(e) {
148
+ this.size = e;
149
+ }
150
+ toLogical(e) {
151
+ return this.size instanceof LogicalSize ? this.size : this.size.toLogical(e);
152
+ }
153
+ toPhysical(e) {
154
+ return this.size instanceof PhysicalSize ? this.size : this.size.toPhysical(e);
155
+ }
156
+ [SERIALIZE_TO_IPC_FN]() {
157
+ return { [`${this.size.type}`]: {
158
+ width: this.size.width,
159
+ height: this.size.height
160
+ } };
161
+ }
162
+ toJSON() {
163
+ return this[SERIALIZE_TO_IPC_FN]();
164
+ }
165
+ }, LogicalPosition = class {
166
+ constructor(...e) {
167
+ this.type = "Logical", e.length === 1 ? "Logical" in e[0] ? (this.x = e[0].Logical.x, this.y = e[0].Logical.y) : (this.x = e[0].x, this.y = e[0].y) : (this.x = e[0], this.y = e[1]);
168
+ }
169
+ toPhysical(e) {
170
+ return new PhysicalPosition(this.x * e, this.y * e);
171
+ }
172
+ [SERIALIZE_TO_IPC_FN]() {
173
+ return {
174
+ x: this.x,
175
+ y: this.y
176
+ };
177
+ }
178
+ toJSON() {
179
+ return this[SERIALIZE_TO_IPC_FN]();
180
+ }
181
+ }, PhysicalPosition = class {
182
+ constructor(...e) {
183
+ this.type = "Physical", e.length === 1 ? "Physical" in e[0] ? (this.x = e[0].Physical.x, this.y = e[0].Physical.y) : (this.x = e[0].x, this.y = e[0].y) : (this.x = e[0], this.y = e[1]);
184
+ }
185
+ toLogical(e) {
186
+ return new LogicalPosition(this.x / e, this.y / e);
187
+ }
188
+ [SERIALIZE_TO_IPC_FN]() {
189
+ return {
190
+ x: this.x,
191
+ y: this.y
192
+ };
193
+ }
194
+ toJSON() {
195
+ return this[SERIALIZE_TO_IPC_FN]();
196
+ }
197
+ }, Position = class {
198
+ constructor(e) {
199
+ this.position = e;
200
+ }
201
+ toLogical(e) {
202
+ return this.position instanceof LogicalPosition ? this.position : this.position.toLogical(e);
203
+ }
204
+ toPhysical(e) {
205
+ return this.position instanceof PhysicalPosition ? this.position : this.position.toPhysical(e);
206
+ }
207
+ [SERIALIZE_TO_IPC_FN]() {
208
+ return { [`${this.position.type}`]: {
209
+ x: this.position.x,
210
+ y: this.position.y
211
+ } };
212
+ }
213
+ toJSON() {
214
+ return this[SERIALIZE_TO_IPC_FN]();
215
+ }
216
+ }, TauriEvent;
217
+ (function(e) {
218
+ e.WINDOW_RESIZED = "tauri://resize", e.WINDOW_MOVED = "tauri://move", e.WINDOW_CLOSE_REQUESTED = "tauri://close-requested", e.WINDOW_DESTROYED = "tauri://destroyed", e.WINDOW_FOCUS = "tauri://focus", e.WINDOW_BLUR = "tauri://blur", e.WINDOW_SCALE_FACTOR_CHANGED = "tauri://scale-change", e.WINDOW_THEME_CHANGED = "tauri://theme-changed", e.WINDOW_CREATED = "tauri://window-created", e.WEBVIEW_CREATED = "tauri://webview-created", e.DRAG_ENTER = "tauri://drag-enter", e.DRAG_OVER = "tauri://drag-over", e.DRAG_DROP = "tauri://drag-drop", e.DRAG_LEAVE = "tauri://drag-leave";
219
+ })(TauriEvent ||= {});
220
+ async function _unlisten(e, t) {
221
+ window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e, t), await invoke("plugin:event|unlisten", {
222
+ event: e,
223
+ eventId: t
224
+ });
225
+ }
226
+ async function listen(e, t, n) {
227
+ return invoke("plugin:event|listen", {
228
+ event: e,
229
+ target: typeof n?.target == "string" ? {
230
+ kind: "AnyLabel",
231
+ label: n.target
232
+ } : n?.target ?? { kind: "Any" },
233
+ handler: transformCallback(t)
234
+ }).then((t) => async () => _unlisten(e, t));
235
+ }
236
+ async function once(e, t, n) {
237
+ return listen(e, (n) => {
238
+ _unlisten(e, n.id), t(n);
239
+ }, n);
240
+ }
241
+ async function emit(e, t) {
242
+ await invoke("plugin:event|emit", {
243
+ event: e,
244
+ payload: t
245
+ });
246
+ }
247
+ async function emitTo(e, t, n) {
248
+ await invoke("plugin:event|emit_to", {
249
+ target: typeof e == "string" ? {
250
+ kind: "AnyLabel",
251
+ label: e
252
+ } : e,
253
+ event: t,
254
+ payload: n
255
+ });
256
+ }
257
+ var Image = class e extends Resource {
258
+ constructor(e) {
259
+ super(e);
260
+ }
261
+ static async new(t, n, r) {
262
+ return invoke("plugin:image|new", {
263
+ rgba: transformImage(t),
264
+ width: n,
265
+ height: r
266
+ }).then((t) => new e(t));
267
+ }
268
+ static async fromBytes(t) {
269
+ return invoke("plugin:image|from_bytes", { bytes: transformImage(t) }).then((t) => new e(t));
270
+ }
271
+ static async fromPath(t) {
272
+ return invoke("plugin:image|from_path", { path: t }).then((t) => new e(t));
273
+ }
274
+ async rgba() {
275
+ return invoke("plugin:image|rgba", { rid: this.rid }).then((e) => new Uint8Array(e));
276
+ }
277
+ async size() {
278
+ return invoke("plugin:image|size", { rid: this.rid });
279
+ }
280
+ };
281
+ function transformImage(e) {
282
+ return e == null ? null : typeof e == "string" ? e : e instanceof Image ? e.rid : e;
283
+ }
284
+ var UserAttentionType;
285
+ (function(e) {
286
+ e[e.Critical = 1] = "Critical", e[e.Informational = 2] = "Informational";
287
+ })(UserAttentionType ||= {});
288
+ var CloseRequestedEvent = class {
289
+ constructor(e) {
290
+ this._preventDefault = !1, this.event = e.event, this.id = e.id;
291
+ }
292
+ preventDefault() {
293
+ this._preventDefault = !0;
294
+ }
295
+ isPreventDefault() {
296
+ return this._preventDefault;
297
+ }
298
+ }, ProgressBarStatus;
299
+ (function(e) {
300
+ e.None = "none", e.Normal = "normal", e.Indeterminate = "indeterminate", e.Paused = "paused", e.Error = "error";
301
+ })(ProgressBarStatus ||= {});
302
+ function getCurrentWindow() {
303
+ return new Window(window.__TAURI_INTERNALS__.metadata.currentWindow.label, { skip: !0 });
304
+ }
305
+ async function getAllWindows() {
306
+ return invoke("plugin:window|get_all_windows").then((e) => e.map((e) => new Window(e, { skip: !0 })));
307
+ }
308
+ var localTauriEvents = ["tauri://created", "tauri://error"], Window = class {
309
+ constructor(e, t = {}) {
310
+ this.label = e, this.listeners = Object.create(null), t?.skip || invoke("plugin:window|create", { options: {
311
+ ...t,
312
+ parent: typeof t.parent == "string" ? t.parent : t.parent?.label,
313
+ label: e
314
+ } }).then(async () => this.emit("tauri://created")).catch(async (e) => this.emit("tauri://error", e));
315
+ }
316
+ static async getByLabel(e) {
317
+ return (await getAllWindows()).find((t) => t.label === e) ?? null;
318
+ }
319
+ static getCurrent() {
320
+ return getCurrentWindow();
321
+ }
322
+ static async getAll() {
323
+ return getAllWindows();
324
+ }
325
+ static async getFocusedWindow() {
326
+ for (let e of await getAllWindows()) if (await e.isFocused()) return e;
327
+ return null;
328
+ }
329
+ async listen(e, t) {
330
+ return this._handleTauriEvent(e, t) ? () => {
331
+ let n = this.listeners[e];
332
+ n.splice(n.indexOf(t), 1);
333
+ } : listen(e, t, { target: {
334
+ kind: "Window",
335
+ label: this.label
336
+ } });
337
+ }
338
+ async once(e, t) {
339
+ return this._handleTauriEvent(e, t) ? () => {
340
+ let n = this.listeners[e];
341
+ n.splice(n.indexOf(t), 1);
342
+ } : once(e, t, { target: {
343
+ kind: "Window",
344
+ label: this.label
345
+ } });
346
+ }
347
+ async emit(e, t) {
348
+ if (localTauriEvents.includes(e)) {
349
+ for (let n of this.listeners[e] || []) n({
350
+ event: e,
351
+ id: -1,
352
+ payload: t
353
+ });
354
+ return;
355
+ }
356
+ return emit(e, t);
357
+ }
358
+ async emitTo(e, t, n) {
359
+ if (localTauriEvents.includes(t)) {
360
+ for (let e of this.listeners[t] || []) e({
361
+ event: t,
362
+ id: -1,
363
+ payload: n
364
+ });
365
+ return;
366
+ }
367
+ return emitTo(e, t, n);
368
+ }
369
+ _handleTauriEvent(e, t) {
370
+ return localTauriEvents.includes(e) ? (e in this.listeners ? this.listeners[e].push(t) : this.listeners[e] = [t], !0) : !1;
371
+ }
372
+ async scaleFactor() {
373
+ return invoke("plugin:window|scale_factor", { label: this.label });
374
+ }
375
+ async innerPosition() {
376
+ return invoke("plugin:window|inner_position", { label: this.label }).then((e) => new PhysicalPosition(e));
377
+ }
378
+ async outerPosition() {
379
+ return invoke("plugin:window|outer_position", { label: this.label }).then((e) => new PhysicalPosition(e));
380
+ }
381
+ async innerSize() {
382
+ return invoke("plugin:window|inner_size", { label: this.label }).then((e) => new PhysicalSize(e));
383
+ }
384
+ async outerSize() {
385
+ return invoke("plugin:window|outer_size", { label: this.label }).then((e) => new PhysicalSize(e));
386
+ }
387
+ async isFullscreen() {
388
+ return invoke("plugin:window|is_fullscreen", { label: this.label });
389
+ }
390
+ async isMinimized() {
391
+ return invoke("plugin:window|is_minimized", { label: this.label });
392
+ }
393
+ async isMaximized() {
394
+ return invoke("plugin:window|is_maximized", { label: this.label });
395
+ }
396
+ async isFocused() {
397
+ return invoke("plugin:window|is_focused", { label: this.label });
398
+ }
399
+ async isDecorated() {
400
+ return invoke("plugin:window|is_decorated", { label: this.label });
401
+ }
402
+ async isResizable() {
403
+ return invoke("plugin:window|is_resizable", { label: this.label });
404
+ }
405
+ async isMaximizable() {
406
+ return invoke("plugin:window|is_maximizable", { label: this.label });
407
+ }
408
+ async isMinimizable() {
409
+ return invoke("plugin:window|is_minimizable", { label: this.label });
410
+ }
411
+ async isClosable() {
412
+ return invoke("plugin:window|is_closable", { label: this.label });
413
+ }
414
+ async isVisible() {
415
+ return invoke("plugin:window|is_visible", { label: this.label });
416
+ }
417
+ async title() {
418
+ return invoke("plugin:window|title", { label: this.label });
419
+ }
420
+ async theme() {
421
+ return invoke("plugin:window|theme", { label: this.label });
422
+ }
423
+ async isAlwaysOnTop() {
424
+ return invoke("plugin:window|is_always_on_top", { label: this.label });
425
+ }
426
+ async center() {
427
+ return invoke("plugin:window|center", { label: this.label });
428
+ }
429
+ async requestUserAttention(e) {
430
+ let t = null;
431
+ return e && (t = e === UserAttentionType.Critical ? { type: "Critical" } : { type: "Informational" }), invoke("plugin:window|request_user_attention", {
432
+ label: this.label,
433
+ value: t
434
+ });
435
+ }
436
+ async setResizable(e) {
437
+ return invoke("plugin:window|set_resizable", {
438
+ label: this.label,
439
+ value: e
440
+ });
441
+ }
442
+ async setEnabled(e) {
443
+ return invoke("plugin:window|set_enabled", {
444
+ label: this.label,
445
+ value: e
446
+ });
447
+ }
448
+ async isEnabled() {
449
+ return invoke("plugin:window|is_enabled", { label: this.label });
450
+ }
451
+ async setMaximizable(e) {
452
+ return invoke("plugin:window|set_maximizable", {
453
+ label: this.label,
454
+ value: e
455
+ });
456
+ }
457
+ async setMinimizable(e) {
458
+ return invoke("plugin:window|set_minimizable", {
459
+ label: this.label,
460
+ value: e
461
+ });
462
+ }
463
+ async setClosable(e) {
464
+ return invoke("plugin:window|set_closable", {
465
+ label: this.label,
466
+ value: e
467
+ });
468
+ }
469
+ async setTitle(e) {
470
+ return invoke("plugin:window|set_title", {
471
+ label: this.label,
472
+ value: e
473
+ });
474
+ }
475
+ async maximize() {
476
+ return invoke("plugin:window|maximize", { label: this.label });
477
+ }
478
+ async unmaximize() {
479
+ return invoke("plugin:window|unmaximize", { label: this.label });
480
+ }
481
+ async toggleMaximize() {
482
+ return invoke("plugin:window|toggle_maximize", { label: this.label });
483
+ }
484
+ async minimize() {
485
+ return invoke("plugin:window|minimize", { label: this.label });
486
+ }
487
+ async unminimize() {
488
+ return invoke("plugin:window|unminimize", { label: this.label });
489
+ }
490
+ async show() {
491
+ return invoke("plugin:window|show", { label: this.label });
492
+ }
493
+ async hide() {
494
+ return invoke("plugin:window|hide", { label: this.label });
495
+ }
496
+ async close() {
497
+ return invoke("plugin:window|close", { label: this.label });
498
+ }
499
+ async destroy() {
500
+ return invoke("plugin:window|destroy", { label: this.label });
501
+ }
502
+ async setDecorations(e) {
503
+ return invoke("plugin:window|set_decorations", {
504
+ label: this.label,
505
+ value: e
506
+ });
507
+ }
508
+ async setShadow(e) {
509
+ return invoke("plugin:window|set_shadow", {
510
+ label: this.label,
511
+ value: e
512
+ });
513
+ }
514
+ async setEffects(e) {
515
+ return invoke("plugin:window|set_effects", {
516
+ label: this.label,
517
+ value: e
518
+ });
519
+ }
520
+ async clearEffects() {
521
+ return invoke("plugin:window|set_effects", {
522
+ label: this.label,
523
+ value: null
524
+ });
525
+ }
526
+ async setAlwaysOnTop(e) {
527
+ return invoke("plugin:window|set_always_on_top", {
528
+ label: this.label,
529
+ value: e
530
+ });
531
+ }
532
+ async setAlwaysOnBottom(e) {
533
+ return invoke("plugin:window|set_always_on_bottom", {
534
+ label: this.label,
535
+ value: e
536
+ });
537
+ }
538
+ async setContentProtected(e) {
539
+ return invoke("plugin:window|set_content_protected", {
540
+ label: this.label,
541
+ value: e
542
+ });
543
+ }
544
+ async setSize(e) {
545
+ return invoke("plugin:window|set_size", {
546
+ label: this.label,
547
+ value: e instanceof Size ? e : new Size(e)
548
+ });
549
+ }
550
+ async setMinSize(e) {
551
+ return invoke("plugin:window|set_min_size", {
552
+ label: this.label,
553
+ value: e instanceof Size ? e : e ? new Size(e) : null
554
+ });
555
+ }
556
+ async setMaxSize(e) {
557
+ return invoke("plugin:window|set_max_size", {
558
+ label: this.label,
559
+ value: e instanceof Size ? e : e ? new Size(e) : null
560
+ });
561
+ }
562
+ async setSizeConstraints(e) {
563
+ function t(e) {
564
+ return e ? { Logical: e } : null;
565
+ }
566
+ return invoke("plugin:window|set_size_constraints", {
567
+ label: this.label,
568
+ value: {
569
+ minWidth: t(e?.minWidth),
570
+ minHeight: t(e?.minHeight),
571
+ maxWidth: t(e?.maxWidth),
572
+ maxHeight: t(e?.maxHeight)
573
+ }
574
+ });
575
+ }
576
+ async setPosition(e) {
577
+ return invoke("plugin:window|set_position", {
578
+ label: this.label,
579
+ value: e instanceof Position ? e : new Position(e)
580
+ });
581
+ }
582
+ async setFullscreen(e) {
583
+ return invoke("plugin:window|set_fullscreen", {
584
+ label: this.label,
585
+ value: e
586
+ });
587
+ }
588
+ async setSimpleFullscreen(e) {
589
+ return invoke("plugin:window|set_simple_fullscreen", {
590
+ label: this.label,
591
+ value: e
592
+ });
593
+ }
594
+ async setFocus() {
595
+ return invoke("plugin:window|set_focus", { label: this.label });
596
+ }
597
+ async setFocusable(e) {
598
+ return invoke("plugin:window|set_focusable", {
599
+ label: this.label,
600
+ value: e
601
+ });
602
+ }
603
+ async setIcon(e) {
604
+ return invoke("plugin:window|set_icon", {
605
+ label: this.label,
606
+ value: transformImage(e)
607
+ });
608
+ }
609
+ async setSkipTaskbar(e) {
610
+ return invoke("plugin:window|set_skip_taskbar", {
611
+ label: this.label,
612
+ value: e
613
+ });
614
+ }
615
+ async setCursorGrab(e) {
616
+ return invoke("plugin:window|set_cursor_grab", {
617
+ label: this.label,
618
+ value: e
619
+ });
620
+ }
621
+ async setCursorVisible(e) {
622
+ return invoke("plugin:window|set_cursor_visible", {
623
+ label: this.label,
624
+ value: e
625
+ });
626
+ }
627
+ async setCursorIcon(e) {
628
+ return invoke("plugin:window|set_cursor_icon", {
629
+ label: this.label,
630
+ value: e
631
+ });
632
+ }
633
+ async setBackgroundColor(e) {
634
+ return invoke("plugin:window|set_background_color", { color: e });
635
+ }
636
+ async setCursorPosition(e) {
637
+ return invoke("plugin:window|set_cursor_position", {
638
+ label: this.label,
639
+ value: e instanceof Position ? e : new Position(e)
640
+ });
641
+ }
642
+ async setIgnoreCursorEvents(e) {
643
+ return invoke("plugin:window|set_ignore_cursor_events", {
644
+ label: this.label,
645
+ value: e
646
+ });
647
+ }
648
+ async startDragging() {
649
+ return invoke("plugin:window|start_dragging", { label: this.label });
650
+ }
651
+ async startResizeDragging(e) {
652
+ return invoke("plugin:window|start_resize_dragging", {
653
+ label: this.label,
654
+ value: e
655
+ });
656
+ }
657
+ async setBadgeCount(e) {
658
+ return invoke("plugin:window|set_badge_count", {
659
+ label: this.label,
660
+ value: e
661
+ });
662
+ }
663
+ async setBadgeLabel(e) {
664
+ return invoke("plugin:window|set_badge_label", {
665
+ label: this.label,
666
+ value: e
667
+ });
668
+ }
669
+ async setOverlayIcon(e) {
670
+ return invoke("plugin:window|set_overlay_icon", {
671
+ label: this.label,
672
+ value: e ? transformImage(e) : void 0
673
+ });
674
+ }
675
+ async setProgressBar(e) {
676
+ return invoke("plugin:window|set_progress_bar", {
677
+ label: this.label,
678
+ value: e
679
+ });
680
+ }
681
+ async setVisibleOnAllWorkspaces(e) {
682
+ return invoke("plugin:window|set_visible_on_all_workspaces", {
683
+ label: this.label,
684
+ value: e
685
+ });
686
+ }
687
+ async setTitleBarStyle(e) {
688
+ return invoke("plugin:window|set_title_bar_style", {
689
+ label: this.label,
690
+ value: e
691
+ });
692
+ }
693
+ async setTheme(e) {
694
+ return invoke("plugin:window|set_theme", {
695
+ label: this.label,
696
+ value: e
697
+ });
698
+ }
699
+ async onResized(e) {
700
+ return this.listen(TauriEvent.WINDOW_RESIZED, (t) => {
701
+ t.payload = new PhysicalSize(t.payload), e(t);
702
+ });
703
+ }
704
+ async onMoved(e) {
705
+ return this.listen(TauriEvent.WINDOW_MOVED, (t) => {
706
+ t.payload = new PhysicalPosition(t.payload), e(t);
707
+ });
708
+ }
709
+ async onCloseRequested(e) {
710
+ return this.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, async (t) => {
711
+ let n = new CloseRequestedEvent(t);
712
+ await e(n), n.isPreventDefault() || await this.destroy();
713
+ });
714
+ }
715
+ async onDragDropEvent(e) {
716
+ let t = await this.listen(TauriEvent.DRAG_ENTER, (t) => {
717
+ e({
718
+ ...t,
719
+ payload: {
720
+ type: "enter",
721
+ paths: t.payload.paths,
722
+ position: new PhysicalPosition(t.payload.position)
723
+ }
724
+ });
725
+ }), n = await this.listen(TauriEvent.DRAG_OVER, (t) => {
726
+ e({
727
+ ...t,
728
+ payload: {
729
+ type: "over",
730
+ position: new PhysicalPosition(t.payload.position)
731
+ }
732
+ });
733
+ }), r = await this.listen(TauriEvent.DRAG_DROP, (t) => {
734
+ e({
735
+ ...t,
736
+ payload: {
737
+ type: "drop",
738
+ paths: t.payload.paths,
739
+ position: new PhysicalPosition(t.payload.position)
740
+ }
741
+ });
742
+ }), i = await this.listen(TauriEvent.DRAG_LEAVE, (t) => {
743
+ e({
744
+ ...t,
745
+ payload: { type: "leave" }
746
+ });
747
+ });
748
+ return () => {
749
+ t(), r(), n(), i();
750
+ };
751
+ }
752
+ async onFocusChanged(e) {
753
+ let t = await this.listen(TauriEvent.WINDOW_FOCUS, (t) => {
754
+ e({
755
+ ...t,
756
+ payload: !0
757
+ });
758
+ }), n = await this.listen(TauriEvent.WINDOW_BLUR, (t) => {
759
+ e({
760
+ ...t,
761
+ payload: !1
762
+ });
763
+ });
764
+ return () => {
765
+ t(), n();
766
+ };
767
+ }
768
+ async onScaleChanged(e) {
769
+ return this.listen(TauriEvent.WINDOW_SCALE_FACTOR_CHANGED, e);
770
+ }
771
+ async onThemeChanged(e) {
772
+ return this.listen(TauriEvent.WINDOW_THEME_CHANGED, e);
773
+ }
774
+ }, BackgroundThrottlingPolicy;
775
+ (function(e) {
776
+ e.Disabled = "disabled", e.Throttle = "throttle", e.Suspend = "suspend";
777
+ })(BackgroundThrottlingPolicy ||= {});
778
+ var ScrollBarStyle;
779
+ (function(e) {
780
+ e.Default = "default", e.FluentOverlay = "fluentOverlay";
781
+ })(ScrollBarStyle ||= {});
782
+ var Effect;
783
+ (function(e) {
784
+ e.AppearanceBased = "appearanceBased", e.Light = "light", e.Dark = "dark", e.MediumLight = "mediumLight", e.UltraDark = "ultraDark", e.Titlebar = "titlebar", e.Selection = "selection", e.Menu = "menu", e.Popover = "popover", e.Sidebar = "sidebar", e.HeaderView = "headerView", e.Sheet = "sheet", e.WindowBackground = "windowBackground", e.HudWindow = "hudWindow", e.FullScreenUI = "fullScreenUI", e.Tooltip = "tooltip", e.ContentBackground = "contentBackground", e.UnderWindowBackground = "underWindowBackground", e.UnderPageBackground = "underPageBackground", e.Mica = "mica", e.Blur = "blur", e.Acrylic = "acrylic", e.Tabbed = "tabbed", e.TabbedDark = "tabbedDark", e.TabbedLight = "tabbedLight";
785
+ })(Effect ||= {});
786
+ var EffectState;
787
+ (function(e) {
788
+ e.FollowsWindowActiveState = "followsWindowActiveState", e.Active = "active", e.Inactive = "inactive";
789
+ })(EffectState ||= {});
790
+ var isFullscreen = useGlobalVar((() => {
791
+ let e = shallowRef(!1), t = getCurrentWindow();
792
+ return t.isFullscreen().then((t) => e.value = t), watch(e, (e) => {
793
+ t.setFullscreen(e);
794
+ }), e;
795
+ })(), "core/isFc");
796
+ const useFullscreen = () => ({
797
+ isFullscreen,
798
+ entry() {
799
+ isFullscreen.value = !0;
800
+ },
801
+ exit() {
802
+ isFullscreen.value = !1;
803
+ },
804
+ toggle() {
805
+ isFullscreen.value = !isFullscreen.value;
806
+ }
807
+ });
808
+ export { SharedFunction, useFullscreen, useTemp };
85
809
 
86
810
  //# sourceMappingURL=index.js.map