@synnaxlabs/drift 0.55.0 → 0.56.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/drift.cjs +1 -1
- package/dist/drift.js +79 -79
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/{selectors-BXRepCOf.cjs → selectors-CTO0z-Ti.cjs} +1 -1
- package/dist/{selectors-BJDn7YrO.js → selectors-Ce7v7pQ7.js} +1 -1
- package/dist/{state-B0AhlJI7.js → state-CK9lLOo9.js} +40 -40
- package/dist/{state-CynG0Zxv.cjs → state-j_OGVu9F.cjs} +1 -1
- package/dist/tauri.cjs +1 -1
- package/dist/tauri.js +292 -286
- package/dist/{window-Cuphmj99.js → window-BXogI37G.js} +4578 -3738
- package/dist/window-DTPpKYT1.cjs +75 -0
- package/package.json +19 -19
- package/dist/window-CXsPQtRu.cjs +0 -50
package/dist/tauri.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { c as e,
|
|
2
|
-
import { p as c } from "./state-
|
|
3
|
-
//#region ../node_modules/.pnpm/@tauri-apps+api@2.
|
|
4
|
-
function
|
|
1
|
+
import { c as e, d as t, f as n, l as r, m as i, r as a, s as o, u as s } from "./window-BXogI37G.js";
|
|
2
|
+
import { p as c } from "./state-CK9lLOo9.js";
|
|
3
|
+
//#region ../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/external/tslib/tslib.es6.js
|
|
4
|
+
function ee(e, t, n, r) {
|
|
5
5
|
if (n === "a" && !r) throw TypeError("Private accessor was defined without a getter");
|
|
6
6
|
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");
|
|
7
7
|
return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function l(e, t, n, r, i) {
|
|
10
10
|
if (r === "m") throw TypeError("Private method is not writable");
|
|
11
11
|
if (r === "a" && !i) throw TypeError("Private accessor was defined without a setter");
|
|
12
12
|
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");
|
|
13
13
|
return r === "a" ? i.call(e, n) : i ? i.value = n : t.set(e, n), n;
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region ../node_modules/.pnpm/@tauri-apps+api@2.
|
|
16
|
+
//#region ../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/core.js
|
|
17
17
|
var u, d = "__TAURI_TO_IPC_KEY__";
|
|
18
|
-
function
|
|
18
|
+
function te(e, t = !1) {
|
|
19
19
|
return window.__TAURI_INTERNALS__.transformCallback(e, t);
|
|
20
20
|
}
|
|
21
|
-
async function
|
|
21
|
+
async function f(e, t = {}, n) {
|
|
22
22
|
return window.__TAURI_INTERNALS__.invoke(e, t, n);
|
|
23
23
|
}
|
|
24
|
-
var
|
|
24
|
+
var ne = class {
|
|
25
25
|
get rid() {
|
|
26
|
-
return
|
|
26
|
+
return ee(this, u, "f");
|
|
27
27
|
}
|
|
28
28
|
constructor(e) {
|
|
29
|
-
u.set(this, void 0),
|
|
29
|
+
u.set(this, void 0), l(this, u, e, "f");
|
|
30
30
|
}
|
|
31
31
|
async close() {
|
|
32
|
-
return
|
|
32
|
+
return f("plugin:resources|close", { rid: this.rid });
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
u = /* @__PURE__ */ new WeakMap();
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region ../node_modules/.pnpm/@tauri-apps+api@2.
|
|
38
|
-
var
|
|
37
|
+
//#region ../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/event.js
|
|
38
|
+
var p;
|
|
39
39
|
(function(e) {
|
|
40
|
-
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";
|
|
41
|
-
})(
|
|
42
|
-
async function
|
|
43
|
-
window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e, t), await
|
|
40
|
+
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.WINDOW_SUSPENDED = "tauri://suspended", e.WINDOW_RESUMED = "tauri://resumed", 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";
|
|
41
|
+
})(p ||= {});
|
|
42
|
+
async function m(e, t) {
|
|
43
|
+
window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e, t), await f("plugin:event|unlisten", {
|
|
44
44
|
event: e,
|
|
45
45
|
eventId: t
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
async function
|
|
49
|
-
return
|
|
48
|
+
async function h(e, t, n) {
|
|
49
|
+
return f("plugin:event|listen", {
|
|
50
50
|
event: e,
|
|
51
51
|
target: typeof n?.target == "string" ? {
|
|
52
52
|
kind: "AnyLabel",
|
|
53
53
|
label: n.target
|
|
54
54
|
} : n?.target ?? { kind: "Any" },
|
|
55
|
-
handler:
|
|
56
|
-
}).then((t) => async () =>
|
|
55
|
+
handler: te(t)
|
|
56
|
+
}).then((t) => async () => m(e, t));
|
|
57
57
|
}
|
|
58
|
-
async function
|
|
59
|
-
return
|
|
60
|
-
|
|
58
|
+
async function g(e, t, n) {
|
|
59
|
+
return h(e, (n) => {
|
|
60
|
+
m(e, n.id), t(n);
|
|
61
61
|
}, n);
|
|
62
62
|
}
|
|
63
|
-
async function
|
|
64
|
-
await
|
|
63
|
+
async function _(e, t) {
|
|
64
|
+
await f("plugin:event|emit", {
|
|
65
65
|
event: e,
|
|
66
66
|
payload: t
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
async function
|
|
70
|
-
await
|
|
69
|
+
async function v(e, t, n) {
|
|
70
|
+
await f("plugin:event|emit_to", {
|
|
71
71
|
target: typeof e == "string" ? {
|
|
72
72
|
kind: "AnyLabel",
|
|
73
73
|
label: e
|
|
@@ -77,13 +77,13 @@ async function y(e, t, n) {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
//#endregion
|
|
80
|
-
//#region ../node_modules/.pnpm/@tauri-apps+api@2.
|
|
81
|
-
var
|
|
80
|
+
//#region ../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/dpi.js
|
|
81
|
+
var y = class {
|
|
82
82
|
constructor(...e) {
|
|
83
83
|
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]);
|
|
84
84
|
}
|
|
85
85
|
toPhysical(e) {
|
|
86
|
-
return new
|
|
86
|
+
return new b(this.width * e, this.height * e);
|
|
87
87
|
}
|
|
88
88
|
[d]() {
|
|
89
89
|
return {
|
|
@@ -94,12 +94,12 @@ var b = class {
|
|
|
94
94
|
toJSON() {
|
|
95
95
|
return this[d]();
|
|
96
96
|
}
|
|
97
|
-
},
|
|
97
|
+
}, b = class {
|
|
98
98
|
constructor(...e) {
|
|
99
99
|
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]);
|
|
100
100
|
}
|
|
101
101
|
toLogical(e) {
|
|
102
|
-
return new
|
|
102
|
+
return new y(this.width / e, this.height / e);
|
|
103
103
|
}
|
|
104
104
|
[d]() {
|
|
105
105
|
return {
|
|
@@ -110,15 +110,15 @@ var b = class {
|
|
|
110
110
|
toJSON() {
|
|
111
111
|
return this[d]();
|
|
112
112
|
}
|
|
113
|
-
},
|
|
113
|
+
}, x = class {
|
|
114
114
|
constructor(e) {
|
|
115
115
|
this.size = e;
|
|
116
116
|
}
|
|
117
117
|
toLogical(e) {
|
|
118
|
-
return this.size instanceof
|
|
118
|
+
return this.size instanceof y ? this.size : this.size.toLogical(e);
|
|
119
119
|
}
|
|
120
120
|
toPhysical(e) {
|
|
121
|
-
return this.size instanceof
|
|
121
|
+
return this.size instanceof b ? this.size : this.size.toPhysical(e);
|
|
122
122
|
}
|
|
123
123
|
[d]() {
|
|
124
124
|
return { [`${this.size.type}`]: {
|
|
@@ -129,12 +129,12 @@ var b = class {
|
|
|
129
129
|
toJSON() {
|
|
130
130
|
return this[d]();
|
|
131
131
|
}
|
|
132
|
-
},
|
|
132
|
+
}, S = class {
|
|
133
133
|
constructor(...e) {
|
|
134
134
|
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]);
|
|
135
135
|
}
|
|
136
136
|
toPhysical(e) {
|
|
137
|
-
return new
|
|
137
|
+
return new C(this.x * e, this.y * e);
|
|
138
138
|
}
|
|
139
139
|
[d]() {
|
|
140
140
|
return {
|
|
@@ -145,12 +145,12 @@ var b = class {
|
|
|
145
145
|
toJSON() {
|
|
146
146
|
return this[d]();
|
|
147
147
|
}
|
|
148
|
-
},
|
|
148
|
+
}, C = class {
|
|
149
149
|
constructor(...e) {
|
|
150
150
|
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]);
|
|
151
151
|
}
|
|
152
152
|
toLogical(e) {
|
|
153
|
-
return new
|
|
153
|
+
return new S(this.x / e, this.y / e);
|
|
154
154
|
}
|
|
155
155
|
[d]() {
|
|
156
156
|
return {
|
|
@@ -161,15 +161,15 @@ var b = class {
|
|
|
161
161
|
toJSON() {
|
|
162
162
|
return this[d]();
|
|
163
163
|
}
|
|
164
|
-
},
|
|
164
|
+
}, w = class {
|
|
165
165
|
constructor(e) {
|
|
166
166
|
this.position = e;
|
|
167
167
|
}
|
|
168
168
|
toLogical(e) {
|
|
169
|
-
return this.position instanceof
|
|
169
|
+
return this.position instanceof S ? this.position : this.position.toLogical(e);
|
|
170
170
|
}
|
|
171
171
|
toPhysical(e) {
|
|
172
|
-
return this.position instanceof
|
|
172
|
+
return this.position instanceof C ? this.position : this.position.toPhysical(e);
|
|
173
173
|
}
|
|
174
174
|
[d]() {
|
|
175
175
|
return { [`${this.position.type}`]: {
|
|
@@ -180,40 +180,40 @@ var b = class {
|
|
|
180
180
|
toJSON() {
|
|
181
181
|
return this[d]();
|
|
182
182
|
}
|
|
183
|
-
},
|
|
183
|
+
}, re = class e extends ne {
|
|
184
184
|
constructor(e) {
|
|
185
185
|
super(e);
|
|
186
186
|
}
|
|
187
187
|
static async new(t, n, r) {
|
|
188
|
-
return
|
|
189
|
-
rgba:
|
|
188
|
+
return f("plugin:image|new", {
|
|
189
|
+
rgba: T(t),
|
|
190
190
|
width: n,
|
|
191
191
|
height: r
|
|
192
192
|
}).then((t) => new e(t));
|
|
193
193
|
}
|
|
194
194
|
static async fromBytes(t) {
|
|
195
|
-
return
|
|
195
|
+
return f("plugin:image|from_bytes", { bytes: T(t) }).then((t) => new e(t));
|
|
196
196
|
}
|
|
197
197
|
static async fromPath(t) {
|
|
198
|
-
return
|
|
198
|
+
return f("plugin:image|from_path", { path: t }).then((t) => new e(t));
|
|
199
199
|
}
|
|
200
200
|
async rgba() {
|
|
201
|
-
return
|
|
201
|
+
return f("plugin:image|rgba", { rid: this.rid }).then((e) => new Uint8Array(e));
|
|
202
202
|
}
|
|
203
203
|
async size() {
|
|
204
|
-
return
|
|
204
|
+
return f("plugin:image|size", { rid: this.rid });
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
|
-
function
|
|
208
|
-
return e == null ? null : typeof e == "string" ? e : e instanceof
|
|
207
|
+
function T(e) {
|
|
208
|
+
return e == null ? null : typeof e == "string" ? e : e instanceof re ? e.rid : e;
|
|
209
209
|
}
|
|
210
210
|
//#endregion
|
|
211
|
-
//#region ../node_modules/.pnpm/@tauri-apps+api@2.
|
|
212
|
-
var
|
|
211
|
+
//#region ../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/window.js
|
|
212
|
+
var E;
|
|
213
213
|
(function(e) {
|
|
214
214
|
e[e.Critical = 1] = "Critical", e[e.Informational = 2] = "Informational";
|
|
215
|
-
})(
|
|
216
|
-
var
|
|
215
|
+
})(E ||= {});
|
|
216
|
+
var D = class {
|
|
217
217
|
constructor(e) {
|
|
218
218
|
this._preventDefault = !1, this.event = e.event, this.id = e.id;
|
|
219
219
|
}
|
|
@@ -223,42 +223,42 @@ var k = class {
|
|
|
223
223
|
isPreventDefault() {
|
|
224
224
|
return this._preventDefault;
|
|
225
225
|
}
|
|
226
|
-
},
|
|
226
|
+
}, O;
|
|
227
227
|
(function(e) {
|
|
228
228
|
e.None = "none", e.Normal = "normal", e.Indeterminate = "indeterminate", e.Paused = "paused", e.Error = "error";
|
|
229
|
-
})(
|
|
230
|
-
function
|
|
231
|
-
return new
|
|
229
|
+
})(O ||= {});
|
|
230
|
+
function k() {
|
|
231
|
+
return new M(window.__TAURI_INTERNALS__.metadata.currentWindow.label, { skip: !0 });
|
|
232
232
|
}
|
|
233
|
-
async function
|
|
234
|
-
return
|
|
233
|
+
async function A() {
|
|
234
|
+
return f("plugin:window|get_all_windows").then((e) => e.map((e) => new M(e, { skip: !0 })));
|
|
235
235
|
}
|
|
236
|
-
var
|
|
236
|
+
var j = ["tauri://created", "tauri://error"], M = class {
|
|
237
237
|
constructor(e, t = {}) {
|
|
238
|
-
this.label = e, this.listeners = Object.create(null), t?.skip ||
|
|
238
|
+
this.label = e, this.listeners = Object.create(null), t?.skip || f("plugin:window|create", { options: {
|
|
239
239
|
...t,
|
|
240
240
|
parent: typeof t.parent == "string" ? t.parent : t.parent?.label,
|
|
241
241
|
label: e
|
|
242
242
|
} }).then(async () => this.emit("tauri://created")).catch(async (e) => this.emit("tauri://error", e));
|
|
243
243
|
}
|
|
244
244
|
static async getByLabel(e) {
|
|
245
|
-
return (await
|
|
245
|
+
return (await A()).find((t) => t.label === e) ?? null;
|
|
246
246
|
}
|
|
247
247
|
static getCurrent() {
|
|
248
|
-
return
|
|
248
|
+
return k();
|
|
249
249
|
}
|
|
250
250
|
static async getAll() {
|
|
251
|
-
return
|
|
251
|
+
return A();
|
|
252
252
|
}
|
|
253
253
|
static async getFocusedWindow() {
|
|
254
|
-
for (let e of await
|
|
254
|
+
for (let e of await A()) if (await e.isFocused()) return e;
|
|
255
255
|
return null;
|
|
256
256
|
}
|
|
257
257
|
async listen(e, t) {
|
|
258
258
|
return this._handleTauriEvent(e, t) ? () => {
|
|
259
259
|
let n = this.listeners[e];
|
|
260
260
|
n.splice(n.indexOf(t), 1);
|
|
261
|
-
} :
|
|
261
|
+
} : h(e, t, { target: {
|
|
262
262
|
kind: "Window",
|
|
263
263
|
label: this.label
|
|
264
264
|
} });
|
|
@@ -267,13 +267,13 @@ var N = ["tauri://created", "tauri://error"], P = class {
|
|
|
267
267
|
return this._handleTauriEvent(e, t) ? () => {
|
|
268
268
|
let n = this.listeners[e];
|
|
269
269
|
n.splice(n.indexOf(t), 1);
|
|
270
|
-
} :
|
|
270
|
+
} : g(e, t, { target: {
|
|
271
271
|
kind: "Window",
|
|
272
272
|
label: this.label
|
|
273
273
|
} });
|
|
274
274
|
}
|
|
275
275
|
async emit(e, t) {
|
|
276
|
-
if (
|
|
276
|
+
if (j.includes(e)) {
|
|
277
277
|
for (let n of this.listeners[e] || []) n({
|
|
278
278
|
event: e,
|
|
279
279
|
id: -1,
|
|
@@ -281,10 +281,10 @@ var N = ["tauri://created", "tauri://error"], P = class {
|
|
|
281
281
|
});
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
|
-
return
|
|
284
|
+
return _(e, t);
|
|
285
285
|
}
|
|
286
286
|
async emitTo(e, t, n) {
|
|
287
|
-
if (
|
|
287
|
+
if (j.includes(t)) {
|
|
288
288
|
for (let e of this.listeners[t] || []) e({
|
|
289
289
|
event: t,
|
|
290
290
|
id: -1,
|
|
@@ -292,206 +292,212 @@ var N = ["tauri://created", "tauri://error"], P = class {
|
|
|
292
292
|
});
|
|
293
293
|
return;
|
|
294
294
|
}
|
|
295
|
-
return
|
|
295
|
+
return v(e, t, n);
|
|
296
296
|
}
|
|
297
297
|
_handleTauriEvent(e, t) {
|
|
298
|
-
return
|
|
298
|
+
return j.includes(e) ? (e in this.listeners ? this.listeners[e].push(t) : this.listeners[e] = [t], !0) : !1;
|
|
299
299
|
}
|
|
300
300
|
async scaleFactor() {
|
|
301
|
-
return
|
|
301
|
+
return f("plugin:window|scale_factor", { label: this.label });
|
|
302
302
|
}
|
|
303
303
|
async innerPosition() {
|
|
304
|
-
return
|
|
304
|
+
return f("plugin:window|inner_position", { label: this.label }).then((e) => new C(e));
|
|
305
305
|
}
|
|
306
306
|
async outerPosition() {
|
|
307
|
-
return
|
|
307
|
+
return f("plugin:window|outer_position", { label: this.label }).then((e) => new C(e));
|
|
308
308
|
}
|
|
309
309
|
async innerSize() {
|
|
310
|
-
return
|
|
310
|
+
return f("plugin:window|inner_size", { label: this.label }).then((e) => new b(e));
|
|
311
311
|
}
|
|
312
312
|
async outerSize() {
|
|
313
|
-
return
|
|
313
|
+
return f("plugin:window|outer_size", { label: this.label }).then((e) => new b(e));
|
|
314
314
|
}
|
|
315
315
|
async isFullscreen() {
|
|
316
|
-
return
|
|
316
|
+
return f("plugin:window|is_fullscreen", { label: this.label });
|
|
317
317
|
}
|
|
318
318
|
async isMinimized() {
|
|
319
|
-
return
|
|
319
|
+
return f("plugin:window|is_minimized", { label: this.label });
|
|
320
320
|
}
|
|
321
321
|
async isMaximized() {
|
|
322
|
-
return
|
|
322
|
+
return f("plugin:window|is_maximized", { label: this.label });
|
|
323
323
|
}
|
|
324
324
|
async isFocused() {
|
|
325
|
-
return
|
|
325
|
+
return f("plugin:window|is_focused", { label: this.label });
|
|
326
326
|
}
|
|
327
327
|
async isDecorated() {
|
|
328
|
-
return
|
|
328
|
+
return f("plugin:window|is_decorated", { label: this.label });
|
|
329
329
|
}
|
|
330
330
|
async isResizable() {
|
|
331
|
-
return
|
|
331
|
+
return f("plugin:window|is_resizable", { label: this.label });
|
|
332
332
|
}
|
|
333
333
|
async isMaximizable() {
|
|
334
|
-
return
|
|
334
|
+
return f("plugin:window|is_maximizable", { label: this.label });
|
|
335
335
|
}
|
|
336
336
|
async isMinimizable() {
|
|
337
|
-
return
|
|
337
|
+
return f("plugin:window|is_minimizable", { label: this.label });
|
|
338
338
|
}
|
|
339
339
|
async isClosable() {
|
|
340
|
-
return
|
|
340
|
+
return f("plugin:window|is_closable", { label: this.label });
|
|
341
341
|
}
|
|
342
342
|
async isVisible() {
|
|
343
|
-
return
|
|
343
|
+
return f("plugin:window|is_visible", { label: this.label });
|
|
344
344
|
}
|
|
345
345
|
async title() {
|
|
346
|
-
return
|
|
346
|
+
return f("plugin:window|title", { label: this.label });
|
|
347
347
|
}
|
|
348
348
|
async theme() {
|
|
349
|
-
return
|
|
349
|
+
return f("plugin:window|theme", { label: this.label });
|
|
350
350
|
}
|
|
351
351
|
async isAlwaysOnTop() {
|
|
352
|
-
return
|
|
352
|
+
return f("plugin:window|is_always_on_top", { label: this.label });
|
|
353
|
+
}
|
|
354
|
+
async activityName() {
|
|
355
|
+
return f("plugin:window|activity_name", { label: this.label });
|
|
356
|
+
}
|
|
357
|
+
async sceneIdentifier() {
|
|
358
|
+
return f("plugin:window|scene_identifier", { label: this.label });
|
|
353
359
|
}
|
|
354
360
|
async center() {
|
|
355
|
-
return
|
|
361
|
+
return f("plugin:window|center", { label: this.label });
|
|
356
362
|
}
|
|
357
363
|
async requestUserAttention(e) {
|
|
358
364
|
let t = null;
|
|
359
|
-
return e && (t = e ===
|
|
365
|
+
return e && (t = e === E.Critical ? { type: "Critical" } : { type: "Informational" }), f("plugin:window|request_user_attention", {
|
|
360
366
|
label: this.label,
|
|
361
367
|
value: t
|
|
362
368
|
});
|
|
363
369
|
}
|
|
364
370
|
async setResizable(e) {
|
|
365
|
-
return
|
|
371
|
+
return f("plugin:window|set_resizable", {
|
|
366
372
|
label: this.label,
|
|
367
373
|
value: e
|
|
368
374
|
});
|
|
369
375
|
}
|
|
370
376
|
async setEnabled(e) {
|
|
371
|
-
return
|
|
377
|
+
return f("plugin:window|set_enabled", {
|
|
372
378
|
label: this.label,
|
|
373
379
|
value: e
|
|
374
380
|
});
|
|
375
381
|
}
|
|
376
382
|
async isEnabled() {
|
|
377
|
-
return
|
|
383
|
+
return f("plugin:window|is_enabled", { label: this.label });
|
|
378
384
|
}
|
|
379
385
|
async setMaximizable(e) {
|
|
380
|
-
return
|
|
386
|
+
return f("plugin:window|set_maximizable", {
|
|
381
387
|
label: this.label,
|
|
382
388
|
value: e
|
|
383
389
|
});
|
|
384
390
|
}
|
|
385
391
|
async setMinimizable(e) {
|
|
386
|
-
return
|
|
392
|
+
return f("plugin:window|set_minimizable", {
|
|
387
393
|
label: this.label,
|
|
388
394
|
value: e
|
|
389
395
|
});
|
|
390
396
|
}
|
|
391
397
|
async setClosable(e) {
|
|
392
|
-
return
|
|
398
|
+
return f("plugin:window|set_closable", {
|
|
393
399
|
label: this.label,
|
|
394
400
|
value: e
|
|
395
401
|
});
|
|
396
402
|
}
|
|
397
403
|
async setTitle(e) {
|
|
398
|
-
return
|
|
404
|
+
return f("plugin:window|set_title", {
|
|
399
405
|
label: this.label,
|
|
400
406
|
value: e
|
|
401
407
|
});
|
|
402
408
|
}
|
|
403
409
|
async maximize() {
|
|
404
|
-
return
|
|
410
|
+
return f("plugin:window|maximize", { label: this.label });
|
|
405
411
|
}
|
|
406
412
|
async unmaximize() {
|
|
407
|
-
return
|
|
413
|
+
return f("plugin:window|unmaximize", { label: this.label });
|
|
408
414
|
}
|
|
409
415
|
async toggleMaximize() {
|
|
410
|
-
return
|
|
416
|
+
return f("plugin:window|toggle_maximize", { label: this.label });
|
|
411
417
|
}
|
|
412
418
|
async minimize() {
|
|
413
|
-
return
|
|
419
|
+
return f("plugin:window|minimize", { label: this.label });
|
|
414
420
|
}
|
|
415
421
|
async unminimize() {
|
|
416
|
-
return
|
|
422
|
+
return f("plugin:window|unminimize", { label: this.label });
|
|
417
423
|
}
|
|
418
424
|
async show() {
|
|
419
|
-
return
|
|
425
|
+
return f("plugin:window|show", { label: this.label });
|
|
420
426
|
}
|
|
421
427
|
async hide() {
|
|
422
|
-
return
|
|
428
|
+
return f("plugin:window|hide", { label: this.label });
|
|
423
429
|
}
|
|
424
430
|
async close() {
|
|
425
|
-
return
|
|
431
|
+
return f("plugin:window|close", { label: this.label });
|
|
426
432
|
}
|
|
427
433
|
async destroy() {
|
|
428
|
-
return
|
|
434
|
+
return f("plugin:window|destroy", { label: this.label });
|
|
429
435
|
}
|
|
430
436
|
async setDecorations(e) {
|
|
431
|
-
return
|
|
437
|
+
return f("plugin:window|set_decorations", {
|
|
432
438
|
label: this.label,
|
|
433
439
|
value: e
|
|
434
440
|
});
|
|
435
441
|
}
|
|
436
442
|
async setShadow(e) {
|
|
437
|
-
return
|
|
443
|
+
return f("plugin:window|set_shadow", {
|
|
438
444
|
label: this.label,
|
|
439
445
|
value: e
|
|
440
446
|
});
|
|
441
447
|
}
|
|
442
448
|
async setEffects(e) {
|
|
443
|
-
return
|
|
449
|
+
return f("plugin:window|set_effects", {
|
|
444
450
|
label: this.label,
|
|
445
451
|
value: e
|
|
446
452
|
});
|
|
447
453
|
}
|
|
448
454
|
async clearEffects() {
|
|
449
|
-
return
|
|
455
|
+
return f("plugin:window|set_effects", {
|
|
450
456
|
label: this.label,
|
|
451
457
|
value: null
|
|
452
458
|
});
|
|
453
459
|
}
|
|
454
460
|
async setAlwaysOnTop(e) {
|
|
455
|
-
return
|
|
461
|
+
return f("plugin:window|set_always_on_top", {
|
|
456
462
|
label: this.label,
|
|
457
463
|
value: e
|
|
458
464
|
});
|
|
459
465
|
}
|
|
460
466
|
async setAlwaysOnBottom(e) {
|
|
461
|
-
return
|
|
467
|
+
return f("plugin:window|set_always_on_bottom", {
|
|
462
468
|
label: this.label,
|
|
463
469
|
value: e
|
|
464
470
|
});
|
|
465
471
|
}
|
|
466
472
|
async setContentProtected(e) {
|
|
467
|
-
return
|
|
473
|
+
return f("plugin:window|set_content_protected", {
|
|
468
474
|
label: this.label,
|
|
469
475
|
value: e
|
|
470
476
|
});
|
|
471
477
|
}
|
|
472
478
|
async setSize(e) {
|
|
473
|
-
return
|
|
479
|
+
return f("plugin:window|set_size", {
|
|
474
480
|
label: this.label,
|
|
475
|
-
value: e instanceof
|
|
481
|
+
value: e instanceof x ? e : new x(e)
|
|
476
482
|
});
|
|
477
483
|
}
|
|
478
484
|
async setMinSize(e) {
|
|
479
|
-
return
|
|
485
|
+
return f("plugin:window|set_min_size", {
|
|
480
486
|
label: this.label,
|
|
481
|
-
value: e instanceof
|
|
487
|
+
value: e instanceof x ? e : e ? new x(e) : null
|
|
482
488
|
});
|
|
483
489
|
}
|
|
484
490
|
async setMaxSize(e) {
|
|
485
|
-
return
|
|
491
|
+
return f("plugin:window|set_max_size", {
|
|
486
492
|
label: this.label,
|
|
487
|
-
value: e instanceof
|
|
493
|
+
value: e instanceof x ? e : e ? new x(e) : null
|
|
488
494
|
});
|
|
489
495
|
}
|
|
490
496
|
async setSizeConstraints(e) {
|
|
491
497
|
function t(e) {
|
|
492
498
|
return e ? { Logical: e } : null;
|
|
493
499
|
}
|
|
494
|
-
return
|
|
500
|
+
return f("plugin:window|set_size_constraints", {
|
|
495
501
|
label: this.label,
|
|
496
502
|
value: {
|
|
497
503
|
minWidth: t(e?.minWidth),
|
|
@@ -502,172 +508,172 @@ var N = ["tauri://created", "tauri://error"], P = class {
|
|
|
502
508
|
});
|
|
503
509
|
}
|
|
504
510
|
async setPosition(e) {
|
|
505
|
-
return
|
|
511
|
+
return f("plugin:window|set_position", {
|
|
506
512
|
label: this.label,
|
|
507
|
-
value: e instanceof
|
|
513
|
+
value: e instanceof w ? e : new w(e)
|
|
508
514
|
});
|
|
509
515
|
}
|
|
510
516
|
async setFullscreen(e) {
|
|
511
|
-
return
|
|
517
|
+
return f("plugin:window|set_fullscreen", {
|
|
512
518
|
label: this.label,
|
|
513
519
|
value: e
|
|
514
520
|
});
|
|
515
521
|
}
|
|
516
522
|
async setSimpleFullscreen(e) {
|
|
517
|
-
return
|
|
523
|
+
return f("plugin:window|set_simple_fullscreen", {
|
|
518
524
|
label: this.label,
|
|
519
525
|
value: e
|
|
520
526
|
});
|
|
521
527
|
}
|
|
522
528
|
async setFocus() {
|
|
523
|
-
return
|
|
529
|
+
return f("plugin:window|set_focus", { label: this.label });
|
|
524
530
|
}
|
|
525
531
|
async setFocusable(e) {
|
|
526
|
-
return
|
|
532
|
+
return f("plugin:window|set_focusable", {
|
|
527
533
|
label: this.label,
|
|
528
534
|
value: e
|
|
529
535
|
});
|
|
530
536
|
}
|
|
531
537
|
async setIcon(e) {
|
|
532
|
-
return
|
|
538
|
+
return f("plugin:window|set_icon", {
|
|
533
539
|
label: this.label,
|
|
534
|
-
value:
|
|
540
|
+
value: T(e)
|
|
535
541
|
});
|
|
536
542
|
}
|
|
537
543
|
async setSkipTaskbar(e) {
|
|
538
|
-
return
|
|
544
|
+
return f("plugin:window|set_skip_taskbar", {
|
|
539
545
|
label: this.label,
|
|
540
546
|
value: e
|
|
541
547
|
});
|
|
542
548
|
}
|
|
543
549
|
async setCursorGrab(e) {
|
|
544
|
-
return
|
|
550
|
+
return f("plugin:window|set_cursor_grab", {
|
|
545
551
|
label: this.label,
|
|
546
552
|
value: e
|
|
547
553
|
});
|
|
548
554
|
}
|
|
549
555
|
async setCursorVisible(e) {
|
|
550
|
-
return
|
|
556
|
+
return f("plugin:window|set_cursor_visible", {
|
|
551
557
|
label: this.label,
|
|
552
558
|
value: e
|
|
553
559
|
});
|
|
554
560
|
}
|
|
555
561
|
async setCursorIcon(e) {
|
|
556
|
-
return
|
|
562
|
+
return f("plugin:window|set_cursor_icon", {
|
|
557
563
|
label: this.label,
|
|
558
564
|
value: e
|
|
559
565
|
});
|
|
560
566
|
}
|
|
561
567
|
async setBackgroundColor(e) {
|
|
562
|
-
return
|
|
568
|
+
return f("plugin:window|set_background_color", { color: e });
|
|
563
569
|
}
|
|
564
570
|
async setCursorPosition(e) {
|
|
565
|
-
return
|
|
571
|
+
return f("plugin:window|set_cursor_position", {
|
|
566
572
|
label: this.label,
|
|
567
|
-
value: e instanceof
|
|
573
|
+
value: e instanceof w ? e : new w(e)
|
|
568
574
|
});
|
|
569
575
|
}
|
|
570
576
|
async setIgnoreCursorEvents(e) {
|
|
571
|
-
return
|
|
577
|
+
return f("plugin:window|set_ignore_cursor_events", {
|
|
572
578
|
label: this.label,
|
|
573
579
|
value: e
|
|
574
580
|
});
|
|
575
581
|
}
|
|
576
582
|
async startDragging() {
|
|
577
|
-
return
|
|
583
|
+
return f("plugin:window|start_dragging", { label: this.label });
|
|
578
584
|
}
|
|
579
585
|
async startResizeDragging(e) {
|
|
580
|
-
return
|
|
586
|
+
return f("plugin:window|start_resize_dragging", {
|
|
581
587
|
label: this.label,
|
|
582
588
|
value: e
|
|
583
589
|
});
|
|
584
590
|
}
|
|
585
591
|
async setBadgeCount(e) {
|
|
586
|
-
return
|
|
592
|
+
return f("plugin:window|set_badge_count", {
|
|
587
593
|
label: this.label,
|
|
588
594
|
value: e
|
|
589
595
|
});
|
|
590
596
|
}
|
|
591
597
|
async setBadgeLabel(e) {
|
|
592
|
-
return
|
|
598
|
+
return f("plugin:window|set_badge_label", {
|
|
593
599
|
label: this.label,
|
|
594
600
|
value: e
|
|
595
601
|
});
|
|
596
602
|
}
|
|
597
603
|
async setOverlayIcon(e) {
|
|
598
|
-
return
|
|
604
|
+
return f("plugin:window|set_overlay_icon", {
|
|
599
605
|
label: this.label,
|
|
600
|
-
value: e ?
|
|
606
|
+
value: e ? T(e) : void 0
|
|
601
607
|
});
|
|
602
608
|
}
|
|
603
609
|
async setProgressBar(e) {
|
|
604
|
-
return
|
|
610
|
+
return f("plugin:window|set_progress_bar", {
|
|
605
611
|
label: this.label,
|
|
606
612
|
value: e
|
|
607
613
|
});
|
|
608
614
|
}
|
|
609
615
|
async setVisibleOnAllWorkspaces(e) {
|
|
610
|
-
return
|
|
616
|
+
return f("plugin:window|set_visible_on_all_workspaces", {
|
|
611
617
|
label: this.label,
|
|
612
618
|
value: e
|
|
613
619
|
});
|
|
614
620
|
}
|
|
615
621
|
async setTitleBarStyle(e) {
|
|
616
|
-
return
|
|
622
|
+
return f("plugin:window|set_title_bar_style", {
|
|
617
623
|
label: this.label,
|
|
618
624
|
value: e
|
|
619
625
|
});
|
|
620
626
|
}
|
|
621
627
|
async setTheme(e) {
|
|
622
|
-
return
|
|
628
|
+
return f("plugin:window|set_theme", {
|
|
623
629
|
label: this.label,
|
|
624
630
|
value: e
|
|
625
631
|
});
|
|
626
632
|
}
|
|
627
633
|
async onResized(e) {
|
|
628
|
-
return this.listen(
|
|
629
|
-
t.payload = new
|
|
634
|
+
return this.listen(p.WINDOW_RESIZED, (t) => {
|
|
635
|
+
t.payload = new b(t.payload), e(t);
|
|
630
636
|
});
|
|
631
637
|
}
|
|
632
638
|
async onMoved(e) {
|
|
633
|
-
return this.listen(
|
|
634
|
-
t.payload = new
|
|
639
|
+
return this.listen(p.WINDOW_MOVED, (t) => {
|
|
640
|
+
t.payload = new C(t.payload), e(t);
|
|
635
641
|
});
|
|
636
642
|
}
|
|
637
643
|
async onCloseRequested(e) {
|
|
638
|
-
return this.listen(
|
|
639
|
-
let n = new
|
|
644
|
+
return this.listen(p.WINDOW_CLOSE_REQUESTED, async (t) => {
|
|
645
|
+
let n = new D(t);
|
|
640
646
|
await e(n), n.isPreventDefault() || await this.destroy();
|
|
641
647
|
});
|
|
642
648
|
}
|
|
643
649
|
async onDragDropEvent(e) {
|
|
644
|
-
let t = await this.listen(
|
|
650
|
+
let t = await this.listen(p.DRAG_ENTER, (t) => {
|
|
645
651
|
e({
|
|
646
652
|
...t,
|
|
647
653
|
payload: {
|
|
648
654
|
type: "enter",
|
|
649
655
|
paths: t.payload.paths,
|
|
650
|
-
position: new
|
|
656
|
+
position: new C(t.payload.position)
|
|
651
657
|
}
|
|
652
658
|
});
|
|
653
|
-
}), n = await this.listen(
|
|
659
|
+
}), n = await this.listen(p.DRAG_OVER, (t) => {
|
|
654
660
|
e({
|
|
655
661
|
...t,
|
|
656
662
|
payload: {
|
|
657
663
|
type: "over",
|
|
658
|
-
position: new
|
|
664
|
+
position: new C(t.payload.position)
|
|
659
665
|
}
|
|
660
666
|
});
|
|
661
|
-
}), r = await this.listen(
|
|
667
|
+
}), r = await this.listen(p.DRAG_DROP, (t) => {
|
|
662
668
|
e({
|
|
663
669
|
...t,
|
|
664
670
|
payload: {
|
|
665
671
|
type: "drop",
|
|
666
672
|
paths: t.payload.paths,
|
|
667
|
-
position: new
|
|
673
|
+
position: new C(t.payload.position)
|
|
668
674
|
}
|
|
669
675
|
});
|
|
670
|
-
}), i = await this.listen(
|
|
676
|
+
}), i = await this.listen(p.DRAG_LEAVE, (t) => {
|
|
671
677
|
e({
|
|
672
678
|
...t,
|
|
673
679
|
payload: { type: "leave" }
|
|
@@ -678,12 +684,12 @@ var N = ["tauri://created", "tauri://error"], P = class {
|
|
|
678
684
|
};
|
|
679
685
|
}
|
|
680
686
|
async onFocusChanged(e) {
|
|
681
|
-
let t = await this.listen(
|
|
687
|
+
let t = await this.listen(p.WINDOW_FOCUS, (t) => {
|
|
682
688
|
e({
|
|
683
689
|
...t,
|
|
684
690
|
payload: !0
|
|
685
691
|
});
|
|
686
|
-
}), n = await this.listen(
|
|
692
|
+
}), n = await this.listen(p.WINDOW_BLUR, (t) => {
|
|
687
693
|
e({
|
|
688
694
|
...t,
|
|
689
695
|
payload: !1
|
|
@@ -694,19 +700,19 @@ var N = ["tauri://created", "tauri://error"], P = class {
|
|
|
694
700
|
};
|
|
695
701
|
}
|
|
696
702
|
async onScaleChanged(e) {
|
|
697
|
-
return this.listen(
|
|
703
|
+
return this.listen(p.WINDOW_SCALE_FACTOR_CHANGED, e);
|
|
698
704
|
}
|
|
699
705
|
async onThemeChanged(e) {
|
|
700
|
-
return this.listen(
|
|
706
|
+
return this.listen(p.WINDOW_THEME_CHANGED, e);
|
|
701
707
|
}
|
|
702
|
-
},
|
|
708
|
+
}, N;
|
|
703
709
|
(function(e) {
|
|
704
710
|
e.Disabled = "disabled", e.Throttle = "throttle", e.Suspend = "suspend";
|
|
705
|
-
})(
|
|
706
|
-
var
|
|
711
|
+
})(N ||= {});
|
|
712
|
+
var P;
|
|
707
713
|
(function(e) {
|
|
708
714
|
e.Default = "default", e.FluentOverlay = "fluentOverlay";
|
|
709
|
-
})(
|
|
715
|
+
})(P ||= {});
|
|
710
716
|
var F;
|
|
711
717
|
(function(e) {
|
|
712
718
|
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";
|
|
@@ -715,32 +721,32 @@ var I;
|
|
|
715
721
|
(function(e) {
|
|
716
722
|
e.FollowsWindowActiveState = "followsWindowActiveState", e.Active = "active", e.Inactive = "inactive";
|
|
717
723
|
})(I ||= {});
|
|
718
|
-
function
|
|
724
|
+
function ie(e) {
|
|
719
725
|
return e === null ? null : {
|
|
720
726
|
name: e.name,
|
|
721
727
|
scaleFactor: e.scaleFactor,
|
|
722
|
-
position: new
|
|
723
|
-
size: new
|
|
728
|
+
position: new C(e.position),
|
|
729
|
+
size: new b(e.size),
|
|
724
730
|
workArea: {
|
|
725
|
-
position: new
|
|
726
|
-
size: new
|
|
731
|
+
position: new C(e.workArea.position),
|
|
732
|
+
size: new b(e.workArea.size)
|
|
727
733
|
}
|
|
728
734
|
};
|
|
729
735
|
}
|
|
730
|
-
async function
|
|
731
|
-
return
|
|
736
|
+
async function ae() {
|
|
737
|
+
return f("plugin:window|available_monitors").then((e) => e.map(ie));
|
|
732
738
|
}
|
|
733
739
|
//#endregion
|
|
734
|
-
//#region ../node_modules/.pnpm/@tauri-apps+api@2.
|
|
735
|
-
function
|
|
736
|
-
return new
|
|
740
|
+
//#region ../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/webview.js
|
|
741
|
+
function L() {
|
|
742
|
+
return new B(k(), window.__TAURI_INTERNALS__.metadata.currentWebview.label, { skip: !0 });
|
|
737
743
|
}
|
|
738
|
-
async function
|
|
739
|
-
return
|
|
744
|
+
async function R() {
|
|
745
|
+
return f("plugin:webview|get_all_webviews").then((e) => e.map((e) => new B(new M(e.windowLabel, { skip: !0 }), e.label, { skip: !0 })));
|
|
740
746
|
}
|
|
741
|
-
var
|
|
747
|
+
var z = ["tauri://created", "tauri://error"], B = class {
|
|
742
748
|
constructor(e, t, n) {
|
|
743
|
-
this.window = e, this.label = t, this.listeners = Object.create(null), n?.skip ||
|
|
749
|
+
this.window = e, this.label = t, this.listeners = Object.create(null), n?.skip || f("plugin:webview|create_webview", {
|
|
744
750
|
windowLabel: e.label,
|
|
745
751
|
options: {
|
|
746
752
|
...n,
|
|
@@ -749,19 +755,19 @@ var B = ["tauri://created", "tauri://error"], V = class {
|
|
|
749
755
|
}).then(async () => this.emit("tauri://created")).catch(async (e) => this.emit("tauri://error", e));
|
|
750
756
|
}
|
|
751
757
|
static async getByLabel(e) {
|
|
752
|
-
return (await
|
|
758
|
+
return (await R()).find((t) => t.label === e) ?? null;
|
|
753
759
|
}
|
|
754
760
|
static getCurrent() {
|
|
755
|
-
return
|
|
761
|
+
return L();
|
|
756
762
|
}
|
|
757
763
|
static async getAll() {
|
|
758
|
-
return
|
|
764
|
+
return R();
|
|
759
765
|
}
|
|
760
766
|
async listen(e, t) {
|
|
761
767
|
return this._handleTauriEvent(e, t) ? () => {
|
|
762
768
|
let n = this.listeners[e];
|
|
763
769
|
n.splice(n.indexOf(t), 1);
|
|
764
|
-
} :
|
|
770
|
+
} : h(e, t, { target: {
|
|
765
771
|
kind: "Webview",
|
|
766
772
|
label: this.label
|
|
767
773
|
} });
|
|
@@ -770,13 +776,13 @@ var B = ["tauri://created", "tauri://error"], V = class {
|
|
|
770
776
|
return this._handleTauriEvent(e, t) ? () => {
|
|
771
777
|
let n = this.listeners[e];
|
|
772
778
|
n.splice(n.indexOf(t), 1);
|
|
773
|
-
} :
|
|
779
|
+
} : g(e, t, { target: {
|
|
774
780
|
kind: "Webview",
|
|
775
781
|
label: this.label
|
|
776
782
|
} });
|
|
777
783
|
}
|
|
778
784
|
async emit(e, t) {
|
|
779
|
-
if (
|
|
785
|
+
if (z.includes(e)) {
|
|
780
786
|
for (let n of this.listeners[e] || []) n({
|
|
781
787
|
event: e,
|
|
782
788
|
id: -1,
|
|
@@ -784,10 +790,10 @@ var B = ["tauri://created", "tauri://error"], V = class {
|
|
|
784
790
|
});
|
|
785
791
|
return;
|
|
786
792
|
}
|
|
787
|
-
return
|
|
793
|
+
return _(e, t);
|
|
788
794
|
}
|
|
789
795
|
async emitTo(e, t, n) {
|
|
790
|
-
if (
|
|
796
|
+
if (z.includes(t)) {
|
|
791
797
|
for (let e of this.listeners[t] || []) e({
|
|
792
798
|
event: t,
|
|
793
799
|
id: -1,
|
|
@@ -795,93 +801,93 @@ var B = ["tauri://created", "tauri://error"], V = class {
|
|
|
795
801
|
});
|
|
796
802
|
return;
|
|
797
803
|
}
|
|
798
|
-
return
|
|
804
|
+
return v(e, t, n);
|
|
799
805
|
}
|
|
800
806
|
_handleTauriEvent(e, t) {
|
|
801
|
-
return
|
|
807
|
+
return z.includes(e) ? (e in this.listeners ? this.listeners[e].push(t) : this.listeners[e] = [t], !0) : !1;
|
|
802
808
|
}
|
|
803
809
|
async position() {
|
|
804
|
-
return
|
|
810
|
+
return f("plugin:webview|webview_position", { label: this.label }).then((e) => new C(e));
|
|
805
811
|
}
|
|
806
812
|
async size() {
|
|
807
|
-
return
|
|
813
|
+
return f("plugin:webview|webview_size", { label: this.label }).then((e) => new b(e));
|
|
808
814
|
}
|
|
809
815
|
async close() {
|
|
810
|
-
return
|
|
816
|
+
return f("plugin:webview|webview_close", { label: this.label });
|
|
811
817
|
}
|
|
812
818
|
async setSize(e) {
|
|
813
|
-
return
|
|
819
|
+
return f("plugin:webview|set_webview_size", {
|
|
814
820
|
label: this.label,
|
|
815
|
-
value: e instanceof
|
|
821
|
+
value: e instanceof x ? e : new x(e)
|
|
816
822
|
});
|
|
817
823
|
}
|
|
818
824
|
async setPosition(e) {
|
|
819
|
-
return
|
|
825
|
+
return f("plugin:webview|set_webview_position", {
|
|
820
826
|
label: this.label,
|
|
821
|
-
value: e instanceof
|
|
827
|
+
value: e instanceof w ? e : new w(e)
|
|
822
828
|
});
|
|
823
829
|
}
|
|
824
830
|
async setFocus() {
|
|
825
|
-
return
|
|
831
|
+
return f("plugin:webview|set_webview_focus", { label: this.label });
|
|
826
832
|
}
|
|
827
833
|
async setAutoResize(e) {
|
|
828
|
-
return
|
|
834
|
+
return f("plugin:webview|set_webview_auto_resize", {
|
|
829
835
|
label: this.label,
|
|
830
836
|
value: e
|
|
831
837
|
});
|
|
832
838
|
}
|
|
833
839
|
async hide() {
|
|
834
|
-
return
|
|
840
|
+
return f("plugin:webview|webview_hide", { label: this.label });
|
|
835
841
|
}
|
|
836
842
|
async show() {
|
|
837
|
-
return
|
|
843
|
+
return f("plugin:webview|webview_show", { label: this.label });
|
|
838
844
|
}
|
|
839
845
|
async setZoom(e) {
|
|
840
|
-
return
|
|
846
|
+
return f("plugin:webview|set_webview_zoom", {
|
|
841
847
|
label: this.label,
|
|
842
848
|
value: e
|
|
843
849
|
});
|
|
844
850
|
}
|
|
845
851
|
async reparent(e) {
|
|
846
|
-
return
|
|
852
|
+
return f("plugin:webview|reparent", {
|
|
847
853
|
label: this.label,
|
|
848
854
|
window: typeof e == "string" ? e : e.label
|
|
849
855
|
});
|
|
850
856
|
}
|
|
851
857
|
async clearAllBrowsingData() {
|
|
852
|
-
return
|
|
858
|
+
return f("plugin:webview|clear_all_browsing_data");
|
|
853
859
|
}
|
|
854
860
|
async setBackgroundColor(e) {
|
|
855
|
-
return
|
|
861
|
+
return f("plugin:webview|set_webview_background_color", { color: e });
|
|
856
862
|
}
|
|
857
863
|
async onDragDropEvent(e) {
|
|
858
|
-
let t = await this.listen(
|
|
864
|
+
let t = await this.listen(p.DRAG_ENTER, (t) => {
|
|
859
865
|
e({
|
|
860
866
|
...t,
|
|
861
867
|
payload: {
|
|
862
868
|
type: "enter",
|
|
863
869
|
paths: t.payload.paths,
|
|
864
|
-
position: new
|
|
870
|
+
position: new C(t.payload.position)
|
|
865
871
|
}
|
|
866
872
|
});
|
|
867
|
-
}), n = await this.listen(
|
|
873
|
+
}), n = await this.listen(p.DRAG_OVER, (t) => {
|
|
868
874
|
e({
|
|
869
875
|
...t,
|
|
870
876
|
payload: {
|
|
871
877
|
type: "over",
|
|
872
|
-
position: new
|
|
878
|
+
position: new C(t.payload.position)
|
|
873
879
|
}
|
|
874
880
|
});
|
|
875
|
-
}), r = await this.listen(
|
|
881
|
+
}), r = await this.listen(p.DRAG_DROP, (t) => {
|
|
876
882
|
e({
|
|
877
883
|
...t,
|
|
878
884
|
payload: {
|
|
879
885
|
type: "drop",
|
|
880
886
|
paths: t.payload.paths,
|
|
881
|
-
position: new
|
|
887
|
+
position: new C(t.payload.position)
|
|
882
888
|
}
|
|
883
889
|
});
|
|
884
|
-
}), i = await this.listen(
|
|
890
|
+
}), i = await this.listen(p.DRAG_LEAVE, (t) => {
|
|
885
891
|
e({
|
|
886
892
|
...t,
|
|
887
893
|
payload: { type: "leave" }
|
|
@@ -893,36 +899,36 @@ var B = ["tauri://created", "tauri://error"], V = class {
|
|
|
893
899
|
}
|
|
894
900
|
};
|
|
895
901
|
//#endregion
|
|
896
|
-
//#region ../node_modules/.pnpm/@tauri-apps+api@2.
|
|
897
|
-
function
|
|
898
|
-
return new
|
|
902
|
+
//#region ../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/webviewWindow.js
|
|
903
|
+
function V() {
|
|
904
|
+
return new U(L().label, { skip: !0 });
|
|
899
905
|
}
|
|
900
|
-
async function
|
|
901
|
-
return
|
|
906
|
+
async function H() {
|
|
907
|
+
return f("plugin:window|get_all_windows").then((e) => e.map((e) => new U(e, { skip: !0 })));
|
|
902
908
|
}
|
|
903
|
-
var
|
|
909
|
+
var U = class e {
|
|
904
910
|
constructor(e, t = {}) {
|
|
905
|
-
this.label = e, this.listeners = Object.create(null), t?.skip ||
|
|
911
|
+
this.label = e, this.listeners = Object.create(null), t?.skip || f("plugin:webview|create_webview_window", { options: {
|
|
906
912
|
...t,
|
|
907
913
|
parent: typeof t.parent == "string" ? t.parent : t.parent?.label,
|
|
908
914
|
label: e
|
|
909
915
|
} }).then(async () => this.emit("tauri://created")).catch(async (e) => this.emit("tauri://error", e));
|
|
910
916
|
}
|
|
911
917
|
static async getByLabel(t) {
|
|
912
|
-
let n = (await
|
|
918
|
+
let n = (await H()).find((e) => e.label === t) ?? null;
|
|
913
919
|
return n ? new e(n.label, { skip: !0 }) : null;
|
|
914
920
|
}
|
|
915
921
|
static getCurrent() {
|
|
916
|
-
return
|
|
922
|
+
return V();
|
|
917
923
|
}
|
|
918
924
|
static async getAll() {
|
|
919
|
-
return
|
|
925
|
+
return H();
|
|
920
926
|
}
|
|
921
927
|
async listen(e, t) {
|
|
922
928
|
return this._handleTauriEvent(e, t) ? () => {
|
|
923
929
|
let n = this.listeners[e];
|
|
924
930
|
n.splice(n.indexOf(t), 1);
|
|
925
|
-
} :
|
|
931
|
+
} : h(e, t, { target: {
|
|
926
932
|
kind: "WebviewWindow",
|
|
927
933
|
label: this.label
|
|
928
934
|
} });
|
|
@@ -931,17 +937,17 @@ var W = class e {
|
|
|
931
937
|
return this._handleTauriEvent(e, t) ? () => {
|
|
932
938
|
let n = this.listeners[e];
|
|
933
939
|
n.splice(n.indexOf(t), 1);
|
|
934
|
-
} :
|
|
940
|
+
} : g(e, t, { target: {
|
|
935
941
|
kind: "WebviewWindow",
|
|
936
942
|
label: this.label
|
|
937
943
|
} });
|
|
938
944
|
}
|
|
939
945
|
async setBackgroundColor(e) {
|
|
940
|
-
return
|
|
946
|
+
return f("plugin:window|set_background_color", { color: e }).then(() => f("plugin:webview|set_webview_background_color", { color: e }));
|
|
941
947
|
}
|
|
942
948
|
};
|
|
943
|
-
|
|
944
|
-
function
|
|
949
|
+
W(U, [M, B]);
|
|
950
|
+
function W(e, t) {
|
|
945
951
|
(Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
946
952
|
Object.getOwnPropertyNames(t.prototype).forEach((n) => {
|
|
947
953
|
typeof e.prototype == "object" && e.prototype && n in e.prototype || Object.defineProperty(e.prototype, n, Object.getOwnPropertyDescriptor(t.prototype, n) ?? Object.create(null));
|
|
@@ -950,37 +956,37 @@ function G(e, t) {
|
|
|
950
956
|
}
|
|
951
957
|
//#endregion
|
|
952
958
|
//#region src/serialization/index.ts
|
|
953
|
-
var
|
|
959
|
+
var G = (e) => JSON.stringify(e), K = (e) => JSON.parse(e), q = "drift://action", oe = "tauri://error", se = "tauri://created", ce = (e) => /* @__PURE__ */ Error(`Window not found: ${e}`), J = 250, le = r.seconds(1), ue = r.seconds(1), Y = (e) => {
|
|
954
960
|
if (e != null) return {
|
|
955
|
-
width: Math.max(e.width,
|
|
956
|
-
height: Math.max(e.height,
|
|
961
|
+
width: Math.max(e.width, J),
|
|
962
|
+
height: Math.max(e.height, J)
|
|
957
963
|
};
|
|
958
|
-
},
|
|
964
|
+
}, X = (e) => {
|
|
959
965
|
let { size: t, maxSize: n } = e;
|
|
960
966
|
return {
|
|
961
967
|
...e,
|
|
962
|
-
maxSize:
|
|
963
|
-
size:
|
|
968
|
+
maxSize: Y(n),
|
|
969
|
+
size: Y(t)
|
|
964
970
|
};
|
|
965
|
-
}, de = async () => (await
|
|
966
|
-
let n = Q(
|
|
967
|
-
width:
|
|
968
|
-
height:
|
|
971
|
+
}, de = async () => (await ae()).map((t) => {
|
|
972
|
+
let n = Q(t.position, t.scaleFactor), r = {
|
|
973
|
+
width: t.size.width,
|
|
974
|
+
height: t.size.height
|
|
969
975
|
};
|
|
970
|
-
return
|
|
971
|
-
}), Z = async (
|
|
976
|
+
return e.construct(n, r);
|
|
977
|
+
}), Z = async (t) => (await de()).some((n) => e.contains(n, t)), fe = class {
|
|
972
978
|
win;
|
|
973
979
|
unsubscribe;
|
|
974
980
|
fullscreenPoll = null;
|
|
975
981
|
monitorChangePoll = null;
|
|
976
982
|
constructor(e) {
|
|
977
|
-
this.win = e ??
|
|
983
|
+
this.win = e ?? V(), this.unsubscribe = {};
|
|
978
984
|
}
|
|
979
985
|
async configure() {
|
|
980
986
|
await this.startFullscreenPoll(), this.startMonitorChangePoll();
|
|
981
987
|
}
|
|
982
988
|
async startFullscreenPoll() {
|
|
983
|
-
if (
|
|
989
|
+
if (o.getOS() !== "macOS") return;
|
|
984
990
|
let e = (await this.getProps()).fullscreen;
|
|
985
991
|
this.fullscreenPoll != null && clearInterval(this.fullscreenPoll), this.fullscreenPoll = setInterval(() => {
|
|
986
992
|
this.win.isFullscreen().then((t) => {
|
|
@@ -989,12 +995,12 @@ var K = (e) => JSON.stringify(e), q = (e) => JSON.parse(e), J = "drift://action"
|
|
|
989
995
|
fullscreen: t
|
|
990
996
|
}) }, void 0, "WHITELIST").catch(console.error));
|
|
991
997
|
}).catch(console.error);
|
|
992
|
-
},
|
|
998
|
+
}, le.milliseconds);
|
|
993
999
|
}
|
|
994
1000
|
startMonitorChangePoll() {
|
|
995
|
-
|
|
1001
|
+
o.getOS() !== "macOS" && (this.monitorChangePoll != null && clearInterval(this.monitorChangePoll), this.monitorChangePoll = setInterval(() => {
|
|
996
1002
|
this.repositionIfOffScreen().catch(console.error);
|
|
997
|
-
},
|
|
1003
|
+
}, ue.milliseconds));
|
|
998
1004
|
}
|
|
999
1005
|
async repositionIfOffScreen() {
|
|
1000
1006
|
if (await this.win.isMinimized()) return;
|
|
@@ -1011,17 +1017,17 @@ var K = (e) => JSON.stringify(e), q = (e) => JSON.parse(e), J = "drift://action"
|
|
|
1011
1017
|
Object.values(this.unsubscribe).forEach((e) => e?.()), this.fullscreenPoll != null && clearInterval(this.fullscreenPoll), this.monitorChangePoll != null && clearInterval(this.monitorChangePoll), this.unsubscribe = {};
|
|
1012
1018
|
}
|
|
1013
1019
|
async emit(e, t, n = this.label()) {
|
|
1014
|
-
let r =
|
|
1020
|
+
let r = G({
|
|
1015
1021
|
...e,
|
|
1016
1022
|
emitter: n
|
|
1017
1023
|
});
|
|
1018
|
-
if (t == null) return await
|
|
1019
|
-
let i = await
|
|
1020
|
-
if (i == null) throw
|
|
1021
|
-
await i.emit(
|
|
1024
|
+
if (t == null) return await _(q, r);
|
|
1025
|
+
let i = await U.getByLabel(t);
|
|
1026
|
+
if (i == null) throw ce(t);
|
|
1027
|
+
await i.emit(q, r);
|
|
1022
1028
|
}
|
|
1023
1029
|
async subscribe(e) {
|
|
1024
|
-
this.release(), await this.startFullscreenPoll(), this.startMonitorChangePoll(), this.unsubscribe[
|
|
1030
|
+
this.release(), await this.startFullscreenPoll(), this.startMonitorChangePoll(), this.unsubscribe[q] = await h(q, (t) => e(K(t.payload)));
|
|
1025
1031
|
let t = pe();
|
|
1026
1032
|
for (let { key: e, handler: r, debounce: i } of t) this.unsubscribe[e] = await this.win.listen(e, n(() => {
|
|
1027
1033
|
r(this.win).then((e) => {
|
|
@@ -1034,45 +1040,45 @@ var K = (e) => JSON.stringify(e), q = (e) => JSON.parse(e), J = "drift://action"
|
|
|
1034
1040
|
t.preventDefault(), e();
|
|
1035
1041
|
});
|
|
1036
1042
|
}
|
|
1037
|
-
async create(
|
|
1038
|
-
|
|
1039
|
-
let { size:
|
|
1040
|
-
|
|
1043
|
+
async create(e, t) {
|
|
1044
|
+
t = s.copy(t);
|
|
1045
|
+
let { size: n, minSize: r, maxSize: i, position: a, ...o } = X(t);
|
|
1046
|
+
n?.width != null && (n.width = Math.max(n.width, J)), n?.height != null && (n.height = Math.max(n.height, J)), i?.width != null && (i.width = Math.max(i.width, J)), i?.height != null && (i.height = Math.max(i.height, J)), a != null && (await Z(a) || (a.x = 0, a.y = 0));
|
|
1041
1047
|
try {
|
|
1042
|
-
let
|
|
1043
|
-
x:
|
|
1044
|
-
y:
|
|
1045
|
-
width:
|
|
1046
|
-
height:
|
|
1047
|
-
minWidth:
|
|
1048
|
-
minHeight:
|
|
1049
|
-
maxWidth:
|
|
1050
|
-
maxHeight:
|
|
1048
|
+
let t = new U(e, {
|
|
1049
|
+
x: a?.x,
|
|
1050
|
+
y: a?.y,
|
|
1051
|
+
width: n?.width,
|
|
1052
|
+
height: n?.height,
|
|
1053
|
+
minWidth: r?.width,
|
|
1054
|
+
minHeight: r?.height,
|
|
1055
|
+
maxWidth: i?.width,
|
|
1056
|
+
maxHeight: i?.height,
|
|
1051
1057
|
titleBarStyle: "overlay",
|
|
1052
1058
|
dragDropEnabled: !1,
|
|
1053
|
-
...
|
|
1059
|
+
...o
|
|
1054
1060
|
});
|
|
1055
|
-
return await new Promise((
|
|
1056
|
-
|
|
1061
|
+
return await new Promise((e, n) => {
|
|
1062
|
+
t.once(oe, (e) => n(Error(JSON.stringify(e.payload)))), t.once(se, () => e());
|
|
1057
1063
|
});
|
|
1058
1064
|
} catch (e) {
|
|
1059
1065
|
console.error(e);
|
|
1060
1066
|
}
|
|
1061
1067
|
}
|
|
1062
1068
|
async close(e) {
|
|
1063
|
-
let t = await
|
|
1069
|
+
let t = await U.getByLabel(e);
|
|
1064
1070
|
if (t != null) try {
|
|
1065
1071
|
await t.destroy();
|
|
1066
1072
|
} catch (t) {
|
|
1067
1073
|
console.error(t, e);
|
|
1068
1074
|
}
|
|
1069
1075
|
else {
|
|
1070
|
-
let t = await
|
|
1076
|
+
let t = await H();
|
|
1071
1077
|
console.error("Window not found", e, t.map((e) => e.label));
|
|
1072
1078
|
}
|
|
1073
1079
|
}
|
|
1074
1080
|
async listLabels() {
|
|
1075
|
-
return (await
|
|
1081
|
+
return (await H()).map((e) => e.label);
|
|
1076
1082
|
}
|
|
1077
1083
|
async focus() {
|
|
1078
1084
|
return await this.win.setFocus();
|
|
@@ -1093,20 +1099,20 @@ var K = (e) => JSON.stringify(e), q = (e) => JSON.parse(e), J = "drift://action"
|
|
|
1093
1099
|
return await this.win.center();
|
|
1094
1100
|
}
|
|
1095
1101
|
async setPosition(e) {
|
|
1096
|
-
let t = new
|
|
1102
|
+
let t = new S(e.x, e.y);
|
|
1097
1103
|
await Z(e) || (t.x = 0, t.y = 0), await this.win.setPosition(t);
|
|
1098
1104
|
}
|
|
1099
1105
|
async setSize(e) {
|
|
1100
|
-
e =
|
|
1106
|
+
e = Y(e), await this.win.setSize(new y(e.width, e.height));
|
|
1101
1107
|
}
|
|
1102
1108
|
async setMinSize(e) {
|
|
1103
|
-
e =
|
|
1109
|
+
e = Y(e), await this.win.setMinSize(new y(e.width, e.height));
|
|
1104
1110
|
}
|
|
1105
1111
|
async setMaxSize(e) {
|
|
1106
|
-
e =
|
|
1112
|
+
e = Y(e), await this.win.setMaxSize(new y(e.width, e.height));
|
|
1107
1113
|
}
|
|
1108
1114
|
async setResizable(e) {
|
|
1109
|
-
return
|
|
1115
|
+
return p.WINDOW_RESIZED in this.unsubscribe && !e && (this.unsubscribe[p.WINDOW_RESIZED]?.(), delete this.unsubscribe[p.WINDOW_RESIZED]), await this.win.setResizable(e);
|
|
1110
1116
|
}
|
|
1111
1117
|
async setSkipTaskbar(e) {
|
|
1112
1118
|
return await this.win.setSkipTaskbar(e);
|
|
@@ -1132,7 +1138,7 @@ var K = (e) => JSON.stringify(e), q = (e) => JSON.parse(e), J = "drift://action"
|
|
|
1132
1138
|
}
|
|
1133
1139
|
}, pe = () => [
|
|
1134
1140
|
{
|
|
1135
|
-
key:
|
|
1141
|
+
key: p.WINDOW_RESIZED,
|
|
1136
1142
|
debounce: 200,
|
|
1137
1143
|
handler: async (e) => {
|
|
1138
1144
|
let t = await e.scaleFactor(), n = await e.isVisible();
|
|
@@ -1147,7 +1153,7 @@ var K = (e) => JSON.stringify(e), q = (e) => JSON.parse(e), J = "drift://action"
|
|
|
1147
1153
|
}
|
|
1148
1154
|
},
|
|
1149
1155
|
{
|
|
1150
|
-
key:
|
|
1156
|
+
key: p.WINDOW_MOVED,
|
|
1151
1157
|
debounce: 200,
|
|
1152
1158
|
handler: async (e) => {
|
|
1153
1159
|
let t = await e?.scaleFactor();
|
|
@@ -1161,7 +1167,7 @@ var K = (e) => JSON.stringify(e), q = (e) => JSON.parse(e), J = "drift://action"
|
|
|
1161
1167
|
}
|
|
1162
1168
|
},
|
|
1163
1169
|
{
|
|
1164
|
-
key:
|
|
1170
|
+
key: p.WINDOW_BLUR,
|
|
1165
1171
|
debounce: 0,
|
|
1166
1172
|
handler: async (e) => c({
|
|
1167
1173
|
focus: !1,
|
|
@@ -1169,7 +1175,7 @@ var K = (e) => JSON.stringify(e), q = (e) => JSON.parse(e), J = "drift://action"
|
|
|
1169
1175
|
})
|
|
1170
1176
|
},
|
|
1171
1177
|
{
|
|
1172
|
-
key:
|
|
1178
|
+
key: p.WINDOW_FOCUS,
|
|
1173
1179
|
debounce: 0,
|
|
1174
1180
|
handler: async (e) => c({
|
|
1175
1181
|
focus: !0,
|
|
@@ -1178,6 +1184,6 @@ var K = (e) => JSON.stringify(e), q = (e) => JSON.parse(e), J = "drift://action"
|
|
|
1178
1184
|
label: e.label
|
|
1179
1185
|
})
|
|
1180
1186
|
}
|
|
1181
|
-
], Q = (e,
|
|
1187
|
+
], Q = (e, n) => t.scale(e, 1 / n), $ = (e, t) => i.scale(e, 1 / t);
|
|
1182
1188
|
//#endregion
|
|
1183
1189
|
export { fe as TauriRuntime };
|