@synnaxlabs/drift 0.42.3 → 0.43.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/README.md +48 -56
- package/dist/electron.cjs +1 -1
- package/dist/electron.js +9 -10
- package/dist/index.cjs +1 -1
- package/dist/index.js +219 -161
- package/dist/react.cjs +1 -1
- package/dist/react.js +2 -2
- package/dist/{selectors-B00IQPYW.js → selectors-CzAkOydY.js} +1 -1
- package/dist/selectors-DrXQNVVN.cjs +1 -0
- package/dist/src/external.d.ts +3 -3
- package/dist/src/external.d.ts.map +1 -1
- package/dist/src/{noop/index.d.ts → noop.d.ts} +13 -9
- package/dist/src/noop.d.ts.map +1 -0
- package/dist/src/runtime.d.ts.map +1 -1
- package/dist/src/sync.d.ts.map +1 -1
- package/dist/src/window.d.ts +6 -6
- package/dist/src/window.d.ts.map +1 -1
- package/dist/state-BGByXBtX.cjs +61 -0
- package/dist/state-C1PObbun.js +13735 -0
- package/dist/tauri.cjs +1 -1
- package/dist/tauri.js +33 -34
- package/package.json +15 -19
- package/dist/noop.cjs +0 -1
- package/dist/noop.js +0 -68
- package/dist/selectors-CGCIf0Ac.cjs +0 -1
- package/dist/src/noop/index.d.ts.map +0 -1
- package/dist/state-BX_5GHgM.js +0 -406
- package/dist/state-xseZCh_u.cjs +0 -1
- package/dist/window-Bj8OM9F9.cjs +0 -41
- package/dist/window-DwJfMpbK.js +0 -8620
package/dist/index.js
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
import { configureStore as j } from "@reduxjs/toolkit";
|
|
2
|
-
import { g, l as d, a as T, r as E,
|
|
3
|
-
import {
|
|
4
|
-
import { s as de, a as we, b as he, c as pe, d as ye, e as _e } from "./selectors-B00IQPYW.js";
|
|
2
|
+
import { M as w, g, l as d, a as T, r as E, A as y, K as F, I as N, b as M, i as V, c as $, s as U, d as K, e as Q, f as I, h as C, S as q, Z, j as X, k as B, m as G, n as Y, o as H, p as J, q as x, t as W, u as ee, v as se, w as ie, x as te, y as ae, z as oe, B as ne, C as ce, D as le, E as re, F as ue, G as fe } from "./state-C1PObbun.js";
|
|
3
|
+
import { s as de, a as we, b as he, c as ye, d as pe, e as _e } from "./selectors-CzAkOydY.js";
|
|
5
4
|
const be = new Error("request for lock canceled");
|
|
6
|
-
var
|
|
5
|
+
var ze = function(i, e, s, t) {
|
|
7
6
|
function a(o) {
|
|
8
|
-
return o instanceof s ? o : new s(function(
|
|
9
|
-
|
|
7
|
+
return o instanceof s ? o : new s(function(c) {
|
|
8
|
+
c(o);
|
|
10
9
|
});
|
|
11
10
|
}
|
|
12
|
-
return new (s || (s = Promise))(function(o,
|
|
13
|
-
function n(
|
|
11
|
+
return new (s || (s = Promise))(function(o, c) {
|
|
12
|
+
function n(l) {
|
|
14
13
|
try {
|
|
15
|
-
u(t.next(
|
|
14
|
+
u(t.next(l));
|
|
16
15
|
} catch (f) {
|
|
17
|
-
|
|
16
|
+
c(f);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function r(l) {
|
|
21
20
|
try {
|
|
22
|
-
u(t.throw(
|
|
21
|
+
u(t.throw(l));
|
|
23
22
|
} catch (f) {
|
|
24
|
-
|
|
23
|
+
c(f);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
function u(
|
|
28
|
-
|
|
26
|
+
function u(l) {
|
|
27
|
+
l.done ? o(l.value) : a(l.value).then(n, r);
|
|
29
28
|
}
|
|
30
29
|
u((t = t.apply(i, e || [])).next());
|
|
31
30
|
});
|
|
32
31
|
};
|
|
33
|
-
class
|
|
32
|
+
class me {
|
|
34
33
|
constructor(e, s = be) {
|
|
35
34
|
this._value = e, this._cancelError = s, this._queue = [], this._weightedWaiters = [];
|
|
36
35
|
}
|
|
@@ -38,17 +37,17 @@ class ze {
|
|
|
38
37
|
if (e <= 0)
|
|
39
38
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
40
39
|
return new Promise((t, a) => {
|
|
41
|
-
const o = { resolve: t, reject: a, weight: e, priority: s },
|
|
42
|
-
|
|
40
|
+
const o = { resolve: t, reject: a, weight: e, priority: s }, c = O(this._queue, (n) => s <= n.priority);
|
|
41
|
+
c === -1 && e <= this._value ? this._dispatchItem(o) : this._queue.splice(c + 1, 0, o);
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
44
|
runExclusive(e) {
|
|
46
|
-
return
|
|
47
|
-
const [o,
|
|
45
|
+
return ze(this, arguments, void 0, function* (s, t = 1, a = 0) {
|
|
46
|
+
const [o, c] = yield this.acquire(t, a);
|
|
48
47
|
try {
|
|
49
48
|
return yield s(o);
|
|
50
49
|
} finally {
|
|
51
|
-
|
|
50
|
+
c();
|
|
52
51
|
}
|
|
53
52
|
});
|
|
54
53
|
}
|
|
@@ -121,39 +120,39 @@ function O(i, e) {
|
|
|
121
120
|
return s;
|
|
122
121
|
return -1;
|
|
123
122
|
}
|
|
124
|
-
var
|
|
123
|
+
var ke = function(i, e, s, t) {
|
|
125
124
|
function a(o) {
|
|
126
|
-
return o instanceof s ? o : new s(function(
|
|
127
|
-
|
|
125
|
+
return o instanceof s ? o : new s(function(c) {
|
|
126
|
+
c(o);
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
|
-
return new (s || (s = Promise))(function(o,
|
|
131
|
-
function n(
|
|
129
|
+
return new (s || (s = Promise))(function(o, c) {
|
|
130
|
+
function n(l) {
|
|
132
131
|
try {
|
|
133
|
-
u(t.next(
|
|
132
|
+
u(t.next(l));
|
|
134
133
|
} catch (f) {
|
|
135
|
-
|
|
134
|
+
c(f);
|
|
136
135
|
}
|
|
137
136
|
}
|
|
138
|
-
function
|
|
137
|
+
function r(l) {
|
|
139
138
|
try {
|
|
140
|
-
u(t.throw(
|
|
139
|
+
u(t.throw(l));
|
|
141
140
|
} catch (f) {
|
|
142
|
-
|
|
141
|
+
c(f);
|
|
143
142
|
}
|
|
144
143
|
}
|
|
145
|
-
function u(
|
|
146
|
-
|
|
144
|
+
function u(l) {
|
|
145
|
+
l.done ? o(l.value) : a(l.value).then(n, r);
|
|
147
146
|
}
|
|
148
147
|
u((t = t.apply(i, e || [])).next());
|
|
149
148
|
});
|
|
150
149
|
};
|
|
151
|
-
class
|
|
150
|
+
class ve {
|
|
152
151
|
constructor(e) {
|
|
153
|
-
this._semaphore = new
|
|
152
|
+
this._semaphore = new me(1, e);
|
|
154
153
|
}
|
|
155
154
|
acquire() {
|
|
156
|
-
return
|
|
155
|
+
return ke(this, arguments, void 0, function* (e = 0) {
|
|
157
156
|
const [, s] = yield this._semaphore.acquire(1, e);
|
|
158
157
|
return s;
|
|
159
158
|
});
|
|
@@ -188,46 +187,46 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
|
|
|
188
187
|
__proto__: null,
|
|
189
188
|
by: Te,
|
|
190
189
|
unique: ge
|
|
191
|
-
}, Symbol.toStringTag, { value: "Module" })), L = "DA@", A = "://",
|
|
190
|
+
}, Symbol.toStringTag, { value: "Module" })), L = "DA@", A = "://", Me = (i, e) => L.concat(e, A, i), Ie = (i) => {
|
|
192
191
|
const [e, s] = i.split(A);
|
|
193
192
|
if (s == null) return [i, ""];
|
|
194
193
|
const [, t] = e.split(L);
|
|
195
194
|
return [s, t];
|
|
196
|
-
},
|
|
195
|
+
}, m = (i, e) => ({
|
|
197
196
|
...i,
|
|
198
|
-
type:
|
|
199
|
-
}),
|
|
200
|
-
const [e, s] =
|
|
197
|
+
type: Me(i.type, e)
|
|
198
|
+
}), Ce = (i) => {
|
|
199
|
+
const [e, s] = Ie(i.type);
|
|
201
200
|
return {
|
|
202
201
|
emitted: s != null && s.length > 0,
|
|
203
202
|
emitter: s,
|
|
204
203
|
action: { ...i, type: e }
|
|
205
204
|
};
|
|
206
|
-
},
|
|
205
|
+
}, qe = (i) => {
|
|
207
206
|
const {
|
|
208
207
|
centerCount: e,
|
|
209
208
|
processCount: s,
|
|
210
209
|
focusCount: t,
|
|
211
210
|
stage: a,
|
|
212
211
|
key: o,
|
|
213
|
-
prerenderLabel:
|
|
212
|
+
prerenderLabel: c,
|
|
214
213
|
reserved: n,
|
|
215
|
-
minimized:
|
|
214
|
+
minimized: r,
|
|
216
215
|
...u
|
|
217
216
|
} = i;
|
|
218
217
|
return u;
|
|
219
218
|
}, Oe = async (i, e, s, t) => {
|
|
220
219
|
const a = (await s.listLabels()).filter(
|
|
221
|
-
(
|
|
222
|
-
), o = Object.keys(i.windows).filter((
|
|
220
|
+
(l) => l !== w
|
|
221
|
+
), o = Object.keys(i.windows).filter((l) => l !== w);
|
|
223
222
|
g(t, "syncInitial"), d(t, "existing windows in runtime", a.sort()), d(t, "non-main windows in state", o.sort()), T(t);
|
|
224
|
-
const
|
|
225
|
-
for (const
|
|
226
|
-
!a.includes(
|
|
227
|
-
const n = s.label(),
|
|
228
|
-
if (
|
|
229
|
-
const u = { ...
|
|
230
|
-
await R(u,
|
|
223
|
+
const c = Ee.unique([...a, ...o]);
|
|
224
|
+
for (const l of c)
|
|
225
|
+
!a.includes(l) && s.isMain() ? (d(t, "state window not in runtime, creating", l), await P(s, l, i.windows[l], t)) : o.includes(l) || (d(t, "runtime window not in state, closing", l), await p(s, l, t));
|
|
226
|
+
const n = s.label(), r = i.windows[n];
|
|
227
|
+
if (r == null) return;
|
|
228
|
+
const u = { ...N };
|
|
229
|
+
await R(u, r, s, t), e(
|
|
231
230
|
E({ label: s.label(), ...await s.getProps() })
|
|
232
231
|
);
|
|
233
232
|
}, Le = async (i, e, s, t) => {
|
|
@@ -241,16 +240,16 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
|
|
|
241
240
|
{ prev: i.title, next: e.title },
|
|
242
241
|
async () => s.setTitle(e.title)
|
|
243
242
|
]);
|
|
244
|
-
const o = e.visible != null && e.visible !== i.visible,
|
|
243
|
+
const o = e.visible != null && e.visible !== i.visible, c = e.visible === !1, n = () => a.push([
|
|
245
244
|
"visible",
|
|
246
245
|
{ prev: i.visible, next: e.visible },
|
|
247
246
|
async () => {
|
|
248
247
|
if (await s.setVisible(e.visible), e.visible === !1) return;
|
|
249
|
-
let
|
|
250
|
-
|
|
248
|
+
let r = e.position;
|
|
249
|
+
r ?? (r = (await s.getProps()).position), r != null && (await s.setPosition(F.translate(r, { x: 1, y: 1 })), await s.setPosition(r));
|
|
251
250
|
}
|
|
252
251
|
]);
|
|
253
|
-
if (o &&
|
|
252
|
+
if (o && c && n(), e.skipTaskbar != null && e.skipTaskbar !== i.skipTaskbar && a.push([
|
|
254
253
|
"skipTaskbar",
|
|
255
254
|
{ prev: i.skipTaskbar, next: e.skipTaskbar },
|
|
256
255
|
async () => await s.setSkipTaskbar(e.skipTaskbar)
|
|
@@ -274,19 +273,19 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
|
|
|
274
273
|
"resizable",
|
|
275
274
|
{ prev: i.resizable, next: e.resizable },
|
|
276
275
|
async () => await s.setResizable(e.resizable)
|
|
277
|
-
]), e.minSize != null && !
|
|
276
|
+
]), e.minSize != null && !y.equals(e.minSize, i.minSize) && a.push([
|
|
278
277
|
"minSize",
|
|
279
278
|
{ prev: i.minSize, next: e.minSize },
|
|
280
279
|
async () => await s.setMinSize(e.minSize)
|
|
281
|
-
]), e.maxSize != null && !
|
|
280
|
+
]), e.maxSize != null && !y.equals(e.maxSize, i.maxSize) && a.push([
|
|
282
281
|
"maxSize",
|
|
283
282
|
{ prev: i.maxSize, next: e.maxSize },
|
|
284
283
|
async () => await s.setMaxSize(e.maxSize)
|
|
285
|
-
]), e.size != null && !
|
|
284
|
+
]), e.size != null && !y.equals(e.size, i.size) && a.push([
|
|
286
285
|
"size",
|
|
287
286
|
{ prev: i.size, next: e.size },
|
|
288
287
|
async () => await s.setSize(e.size)
|
|
289
|
-
]), e.position != null && !
|
|
288
|
+
]), e.position != null && !y.equals(e.position, i.position) && a.push([
|
|
290
289
|
"position",
|
|
291
290
|
{ prev: i.position, next: e.position },
|
|
292
291
|
async () => await s.setPosition(e.position)
|
|
@@ -309,75 +308,75 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
|
|
|
309
308
|
"alwaysOnTop",
|
|
310
309
|
{ prev: i.alwaysOnTop, next: e.alwaysOnTop },
|
|
311
310
|
async () => await s.setAlwaysOnTop(e.alwaysOnTop)
|
|
312
|
-
]), o && !
|
|
311
|
+
]), o && !c && n(), a.length !== 0) {
|
|
313
312
|
g(t, `syncCurrent, label: ${s.label()}, key: ${e.key}`);
|
|
314
|
-
for (const [
|
|
313
|
+
for (const [r, { prev: u, next: l }] of a) d(t, r, u, "->", l);
|
|
315
314
|
T(t);
|
|
316
|
-
for (const [, ,
|
|
315
|
+
for (const [, , r] of a) await r();
|
|
317
316
|
}
|
|
318
317
|
}, Ae = async (i, e, s, t) => {
|
|
319
|
-
const a = Object.keys(i.windows).filter((n) => !(n in e.windows)), o = Object.keys(e.windows).filter((n) => !(n in i.windows)),
|
|
320
|
-
if (
|
|
318
|
+
const a = Object.keys(i.windows).filter((n) => !(n in e.windows)), o = Object.keys(e.windows).filter((n) => !(n in i.windows)), c = s.isMain();
|
|
319
|
+
if (c && a.length > 0)
|
|
321
320
|
for (const n of a)
|
|
322
321
|
d(t, "syncMain", "closing", n), n === w && await Promise.all(
|
|
323
|
-
Object.keys(e.windows).filter((
|
|
324
|
-
), await
|
|
325
|
-
if (
|
|
322
|
+
Object.keys(e.windows).filter((r) => r !== w).map(async (r) => await p(s, r, t))
|
|
323
|
+
), await p(s, n, t);
|
|
324
|
+
if (c && o.length > 0)
|
|
326
325
|
for (const n of o)
|
|
327
|
-
await
|
|
328
|
-
},
|
|
326
|
+
await P(s, n, e.windows[n], t);
|
|
327
|
+
}, P = async (i, e, s, t) => (d(t, "createWindow", s), await i.create(e, qe(s))), p = async (i, e, s) => (d(s, "closeWindow", e), await i.close(e)), S = "[drift] - unexpected undefined action", k = "[drift] - unexpected undefined action type", _ = (i) => {
|
|
329
328
|
if (i.emitted ?? (i.emitted = !1), i.action == null)
|
|
330
329
|
throw console.warn(S, i), new Error(S);
|
|
331
330
|
if (i.action.type == null || i.action.type.length === 0)
|
|
332
|
-
throw console.warn(
|
|
333
|
-
}, Re = new
|
|
334
|
-
let { action: o, emitted:
|
|
335
|
-
const
|
|
336
|
-
_({ action: a, emitted:
|
|
337
|
-
const u =
|
|
331
|
+
throw console.warn(k, i), new Error(k);
|
|
332
|
+
}, Re = new ve(), Pe = [E.type, M.type], De = (i, e = !1) => (s) => (t) => (a) => {
|
|
333
|
+
let { action: o, emitted: c, emitter: n } = Ce(a);
|
|
334
|
+
const r = i.label();
|
|
335
|
+
_({ action: a, emitted: c, emitter: n });
|
|
336
|
+
const u = V(o.type);
|
|
338
337
|
if (u && d(e, "[drift] - middleware", {
|
|
339
338
|
action: o,
|
|
340
|
-
emitted:
|
|
339
|
+
emitted: c,
|
|
341
340
|
emitter: n,
|
|
342
|
-
host:
|
|
341
|
+
host: r
|
|
343
342
|
}), n === i.label()) return;
|
|
344
|
-
const
|
|
343
|
+
const l = u && !Pe.includes(o.type);
|
|
345
344
|
let f = null;
|
|
346
|
-
u && (f = s.getState().drift, o =
|
|
345
|
+
u && (f = s.getState().drift, o = $(
|
|
347
346
|
o,
|
|
348
347
|
f
|
|
349
348
|
));
|
|
350
|
-
const h = t(o), b =
|
|
349
|
+
const h = t(o), b = l ? s.getState().drift : null, D = U(c, o.type);
|
|
351
350
|
return Re.runExclusive(async () => {
|
|
352
351
|
try {
|
|
353
|
-
f !== null && b !== null && await Le(f, b, i, e),
|
|
354
|
-
} catch (
|
|
352
|
+
f !== null && b !== null && await Le(f, b, i, e), D && await i.emit({ action: o });
|
|
353
|
+
} catch (z) {
|
|
355
354
|
d(e, "[drift] - ERROR", {
|
|
356
|
-
error:
|
|
355
|
+
error: z.message,
|
|
357
356
|
action: o,
|
|
358
|
-
emitted:
|
|
357
|
+
emitted: c,
|
|
359
358
|
emitter: n,
|
|
360
|
-
host:
|
|
361
|
-
}), s.dispatch(
|
|
359
|
+
host: r
|
|
360
|
+
}), s.dispatch(K({ key: r, message: z.message }));
|
|
362
361
|
}
|
|
363
362
|
}), h;
|
|
364
363
|
}, je = (i, e, s = !1) => (t) => {
|
|
365
364
|
const a = i != null ? typeof i == "function" ? i(t) : i : t();
|
|
366
|
-
return [
|
|
367
|
-
},
|
|
365
|
+
return [De(e, s), ...a];
|
|
366
|
+
}, Fe = async ({
|
|
368
367
|
runtime: i,
|
|
369
368
|
preloadedState: e,
|
|
370
369
|
middleware: s,
|
|
371
370
|
debug: t = !1,
|
|
372
371
|
enablePrerender: a = !0,
|
|
373
372
|
defaultWindowProps: o,
|
|
374
|
-
...
|
|
373
|
+
...c
|
|
375
374
|
}) => {
|
|
376
375
|
await i.configure();
|
|
377
376
|
let n;
|
|
378
377
|
n = j({
|
|
379
|
-
...
|
|
380
|
-
preloadedState: await
|
|
378
|
+
...c,
|
|
379
|
+
preloadedState: await Ne(
|
|
381
380
|
t,
|
|
382
381
|
i,
|
|
383
382
|
() => n,
|
|
@@ -386,107 +385,166 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
|
|
|
386
385
|
),
|
|
387
386
|
middleware: je(s, i, t)
|
|
388
387
|
}), await Oe(n.getState().drift, n.dispatch, i, t);
|
|
389
|
-
const
|
|
388
|
+
const r = i.label();
|
|
390
389
|
return n.dispatch(
|
|
391
|
-
|
|
392
|
-
), n.dispatch(
|
|
393
|
-
},
|
|
390
|
+
Q({ enablePrerender: a, defaultWindowProps: o, debug: t, label: r })
|
|
391
|
+
), n.dispatch(I({ stage: "created" })), i.onCloseRequested(() => n == null ? void 0 : n.dispatch(C({}))), n;
|
|
392
|
+
}, Ne = async (i, e, s, t, a) => e.isMain() ? (await e.subscribe(({ action: c, emitter: n, sendState: r }) => {
|
|
394
393
|
const u = s();
|
|
395
394
|
if (u == null) return;
|
|
396
|
-
if (
|
|
397
|
-
_({ action:
|
|
395
|
+
if (c != null) {
|
|
396
|
+
_({ action: c, emitter: n }), u.dispatch(m(c, n));
|
|
398
397
|
return;
|
|
399
398
|
}
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
}), typeof a == "function" ?
|
|
399
|
+
const l = u.getState();
|
|
400
|
+
r === !0 && e.emit({ state: l }, n);
|
|
401
|
+
}), typeof a == "function" ? v(t, i, await a()) : v(t, i, a)) : await new Promise((c, n) => {
|
|
403
402
|
(async () => {
|
|
404
403
|
try {
|
|
405
|
-
await e.subscribe(({ action: u, emitter:
|
|
404
|
+
await e.subscribe(({ action: u, emitter: l, state: f }) => {
|
|
406
405
|
const h = s();
|
|
407
406
|
if (h == null)
|
|
408
|
-
return f != null ?
|
|
409
|
-
u != null && (_({ action: u, emitter:
|
|
407
|
+
return f != null ? c(f) : void 0;
|
|
408
|
+
u != null && (_({ action: u, emitter: l }), h.dispatch(m(u, l)));
|
|
410
409
|
}), await e.emit({ sendState: !0 }, w);
|
|
411
410
|
} catch (u) {
|
|
412
411
|
n(u);
|
|
413
412
|
}
|
|
414
413
|
})();
|
|
415
|
-
}), Ve =
|
|
414
|
+
}), Ve = Fe, v = (i, e, s) => {
|
|
416
415
|
if (s == null) return s;
|
|
417
|
-
const t = s[
|
|
416
|
+
const t = s[q];
|
|
418
417
|
return t.config.debug = e ?? t.config.debug, t.windows = Object.fromEntries(
|
|
419
418
|
Object.entries(t.windows).filter(([, a]) => a.reserved).map(([a, o]) => ((i == null ? void 0 : i.visible) != null && (o.visible = i.visible), o.focusCount = 0, o.centerCount = 0, o.processCount = 0, [a, o]))
|
|
420
419
|
), s;
|
|
421
|
-
}
|
|
420
|
+
};
|
|
421
|
+
class $e {
|
|
422
|
+
async emit() {
|
|
423
|
+
}
|
|
424
|
+
async subscribe() {
|
|
425
|
+
}
|
|
426
|
+
isMain() {
|
|
427
|
+
return !0;
|
|
428
|
+
}
|
|
429
|
+
label() {
|
|
430
|
+
return w;
|
|
431
|
+
}
|
|
432
|
+
onCloseRequested() {
|
|
433
|
+
}
|
|
434
|
+
async listLabels() {
|
|
435
|
+
return [];
|
|
436
|
+
}
|
|
437
|
+
async getProps() {
|
|
438
|
+
return {};
|
|
439
|
+
}
|
|
440
|
+
async create() {
|
|
441
|
+
}
|
|
442
|
+
async close() {
|
|
443
|
+
}
|
|
444
|
+
async focus() {
|
|
445
|
+
}
|
|
446
|
+
async setMinimized() {
|
|
447
|
+
}
|
|
448
|
+
async setMaximized() {
|
|
449
|
+
}
|
|
450
|
+
async setVisible() {
|
|
451
|
+
}
|
|
452
|
+
async setFullscreen() {
|
|
453
|
+
}
|
|
454
|
+
async center() {
|
|
455
|
+
}
|
|
456
|
+
async setPosition() {
|
|
457
|
+
}
|
|
458
|
+
async setSize() {
|
|
459
|
+
}
|
|
460
|
+
async setMinSize() {
|
|
461
|
+
}
|
|
462
|
+
async setMaxSize() {
|
|
463
|
+
}
|
|
464
|
+
async setResizable() {
|
|
465
|
+
}
|
|
466
|
+
async setSkipTaskbar() {
|
|
467
|
+
}
|
|
468
|
+
async setAlwaysOnTop() {
|
|
469
|
+
}
|
|
470
|
+
async setDecorations() {
|
|
471
|
+
}
|
|
472
|
+
async setTitle() {
|
|
473
|
+
}
|
|
474
|
+
async configure() {
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
const Ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
422
478
|
__proto__: null,
|
|
423
479
|
MAIN_WINDOW: w,
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
480
|
+
NoopRuntime: $e,
|
|
481
|
+
SLICE_NAME: q,
|
|
482
|
+
ZERO_SLICE_STATE: Z,
|
|
483
|
+
closeWindow: C,
|
|
484
|
+
completeProcess: X,
|
|
428
485
|
configureStore: Ve,
|
|
429
|
-
createWindow:
|
|
430
|
-
focusWindow:
|
|
431
|
-
reducer:
|
|
432
|
-
registerProcess:
|
|
433
|
-
reloadWindow:
|
|
486
|
+
createWindow: B,
|
|
487
|
+
focusWindow: G,
|
|
488
|
+
reducer: Y,
|
|
489
|
+
registerProcess: H,
|
|
490
|
+
reloadWindow: M,
|
|
434
491
|
selectSliceState: de,
|
|
435
492
|
selectWindow: we,
|
|
436
493
|
selectWindowAttribute: he,
|
|
437
|
-
selectWindowKey:
|
|
438
|
-
selectWindowLabel:
|
|
494
|
+
selectWindowKey: ye,
|
|
495
|
+
selectWindowLabel: pe,
|
|
439
496
|
selectWindows: _e,
|
|
440
|
-
setWindowAlwaysOnTop:
|
|
441
|
-
setWindowDecorations:
|
|
442
|
-
setWindowFullscreen:
|
|
443
|
-
setWindowMaxSize:
|
|
444
|
-
setWindowMaximized:
|
|
445
|
-
setWindowMinSize:
|
|
446
|
-
setWindowMinimized:
|
|
447
|
-
setWindowPosition:
|
|
448
|
-
setWindowProps:
|
|
449
|
-
setWindowResizable:
|
|
450
|
-
setWindowSize:
|
|
451
|
-
setWindowSkipTaskbar:
|
|
452
|
-
setWindowStage:
|
|
453
|
-
setWindowTitle:
|
|
454
|
-
setWindowVisible:
|
|
497
|
+
setWindowAlwaysOnTop: J,
|
|
498
|
+
setWindowDecorations: x,
|
|
499
|
+
setWindowFullscreen: W,
|
|
500
|
+
setWindowMaxSize: ee,
|
|
501
|
+
setWindowMaximized: se,
|
|
502
|
+
setWindowMinSize: ie,
|
|
503
|
+
setWindowMinimized: te,
|
|
504
|
+
setWindowPosition: ae,
|
|
505
|
+
setWindowProps: oe,
|
|
506
|
+
setWindowResizable: ne,
|
|
507
|
+
setWindowSize: ce,
|
|
508
|
+
setWindowSkipTaskbar: le,
|
|
509
|
+
setWindowStage: I,
|
|
510
|
+
setWindowTitle: re,
|
|
511
|
+
setWindowVisible: ue,
|
|
455
512
|
windowPropsZ: fe
|
|
456
513
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
457
514
|
export {
|
|
458
|
-
|
|
515
|
+
Ze as Drift,
|
|
459
516
|
w as MAIN_WINDOW,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
517
|
+
$e as NoopRuntime,
|
|
518
|
+
q as SLICE_NAME,
|
|
519
|
+
Z as ZERO_SLICE_STATE,
|
|
520
|
+
C as closeWindow,
|
|
521
|
+
X as completeProcess,
|
|
464
522
|
Ve as configureStore,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
523
|
+
B as createWindow,
|
|
524
|
+
G as focusWindow,
|
|
525
|
+
Y as reducer,
|
|
526
|
+
H as registerProcess,
|
|
527
|
+
M as reloadWindow,
|
|
470
528
|
de as selectSliceState,
|
|
471
529
|
we as selectWindow,
|
|
472
530
|
he as selectWindowAttribute,
|
|
473
|
-
|
|
474
|
-
|
|
531
|
+
ye as selectWindowKey,
|
|
532
|
+
pe as selectWindowLabel,
|
|
475
533
|
_e as selectWindows,
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
534
|
+
J as setWindowAlwaysOnTop,
|
|
535
|
+
x as setWindowDecorations,
|
|
536
|
+
W as setWindowFullscreen,
|
|
537
|
+
ee as setWindowMaxSize,
|
|
538
|
+
se as setWindowMaximized,
|
|
539
|
+
ie as setWindowMinSize,
|
|
540
|
+
te as setWindowMinimized,
|
|
541
|
+
ae as setWindowPosition,
|
|
542
|
+
oe as setWindowProps,
|
|
543
|
+
ne as setWindowResizable,
|
|
544
|
+
ce as setWindowSize,
|
|
545
|
+
le as setWindowSkipTaskbar,
|
|
546
|
+
I as setWindowStage,
|
|
547
|
+
re as setWindowTitle,
|
|
548
|
+
ue as setWindowVisible,
|
|
491
549
|
fe as windowPropsZ
|
|
492
550
|
};
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("react-redux"),a=require("proxy-memoize"),d=require("./selectors-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("react-redux"),a=require("proxy-memoize"),d=require("./selectors-DrXQNVVN.cjs"),i=require("./state-BGByXBtX.cjs"),y=e=>u.useSelector(n.useCallback(a.memoize(s=>d.selectWindow(s,e)),[e])),w=()=>u.useSelector(n.useCallback(a.memoize(d.selectWindows),[])),S=e=>u.useSelector(n.useCallback(a.memoize(s=>d.selectWindowKey(s,e)),[e])),W=(e,s)=>u.useSelector(n.useCallback(a.memoize(t=>d.selectWindowAttribute(t,e,s)),[e,s])),m=(e,s)=>{const t=y(s),o=u.useDispatch(),c=n.useRef(null);n.useEffect(()=>{if(t==null)return;const{stage:r}=t;if(r==="created"&&c.current==null){const l=e();l!=null&&(c.current=l),o(i.registerProcess({key:t.key}))}else(r==="closing"||r==="reloading")&&c.current!=null&&(c.current(),c.current=null,o(i.completeProcess({key:t.key})))},[t])},h=(e,s)=>{const t=y(s),o=u.useDispatch(),c=n.useRef(null),r=n.useRef(!1);n.useEffect(()=>{if(t==null)return;const{stage:l}=t;if(l==="created"&&c.current==null)r.current=!0,e().then(f=>{c.current=f??(async()=>{}),o(i.registerProcess({key:t.key}))}).catch(console.error).finally(()=>{r.current=!1});else if((l==="closing"||l==="reloading")&&c.current!=null){const f=c.current;c.current=null,f().then(()=>{c.current=null}).catch(console.error).finally(()=>{o(i.completeProcess({key:t.key}))})}},[t])},g=({store:e,emptyContent:s=null,children:t})=>{const[o,c]=n.useState(null),[r,l]=n.useState(null);if(r!=null)throw l(null),r;return o==null?(e instanceof Promise?e.then(c).catch(l):c(e),s):n.createElement(u.Provider,{store:o},t)};exports.Provider=g;exports.useAsyncWindowLifecycle=h;exports.useSelectWindow=y;exports.useSelectWindowAttribute=W;exports.useSelectWindowKey=S;exports.useSelectWindows=w;exports.useWindowLifecycle=m;
|
package/dist/react.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCallback as l, useRef as f, useEffect as m, useState as d, createElement as W } from "react";
|
|
2
2
|
import { useSelector as u, useDispatch as y, Provider as g } from "react-redux";
|
|
3
3
|
import { memoize as i } from "proxy-memoize";
|
|
4
|
-
import { a as k, e as S, c as P, b as v } from "./selectors-
|
|
5
|
-
import { o as w, j as p } from "./state-
|
|
4
|
+
import { a as k, e as S, c as P, b as v } from "./selectors-CzAkOydY.js";
|
|
5
|
+
import { o as w, j as p } from "./state-C1PObbun.js";
|
|
6
6
|
const h = (e) => u(
|
|
7
7
|
l(
|
|
8
8
|
i((r) => k(r, e)),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./state-BGByXBtX.cjs"),s=n=>n.drift,r=n=>Object.values(s(n).windows),c=(n,e)=>{const t=s(n);if(e==null)return t.windows[t.label];let l=t.windows[e];if(l!=null)return l;const o=t.keyLabels[e];return l=t.windows[o],l==null&&e!=null?null:l??t.windows[t.label]},u=(n,e)=>{const t=s(n);if(e==null)return t.labelKeys[t.label];const l=t.labelKeys[e];return l==null&&e==i.MAIN_WINDOW?i.MAIN_WINDOW:l},w=(n,e,t)=>{var l;return((l=c(n,e))==null?void 0:l[t])??null},d=(n,e)=>s(n).keyLabels[e];exports.selectSliceState=s;exports.selectWindow=c;exports.selectWindowAttribute=w;exports.selectWindowKey=u;exports.selectWindowLabel=d;exports.selectWindows=r;
|
package/dist/src/external.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { configureStore } from './configureStore';
|
|
2
|
-
export
|
|
2
|
+
export { NoopRuntime } from './noop';
|
|
3
|
+
export { type Runtime } from './runtime';
|
|
3
4
|
export { selectSliceState, selectWindow, selectWindowAttribute, selectWindowKey, selectWindowLabel, selectWindows, } from './selectors';
|
|
4
|
-
export type
|
|
5
|
-
export { closeWindow, completeProcess, createWindow, focusWindow, reducer, registerProcess, reloadWindow, setWindowAlwaysOnTop, setWindowDecorations, setWindowFullscreen, setWindowMaximized, setWindowMaxSize, setWindowMinimized, setWindowMinSize, setWindowPosition, setWindowProps, setWindowResizable, setWindowSize, setWindowSkipTaskbar, setWindowStage, setWindowTitle, setWindowVisible, SLICE_NAME, ZERO_SLICE_STATE, } from './state';
|
|
5
|
+
export { type Action, closeWindow, type CloseWindowPayload, completeProcess, createWindow, type CreateWindowPayload, focusWindow, type FocusWindowPayload, reducer, registerProcess, reloadWindow, type ReloadWindowPayload, setWindowAlwaysOnTop, type SetWindowAlwaysOnTopPayload, setWindowDecorations, type SetWindowDecorationsPayload, setWindowFullscreen, type SetWindowFullScreenPayload, setWindowMaximized, type SetWindowMaximizedPayload, setWindowMaxSize, type SetWindowMaxSizePayload, setWindowMinimized, type SetWindowMinimizedPayload, setWindowMinSize, type SetWindowMinSizePayload, setWindowPosition, type SetWindowPositionPayload, setWindowProps, type SetWindowPropsPayload, setWindowResizable, type SetWindowResizablePayload, setWindowSize, type SetWindowSizePayload, setWindowSkipTaskbar, type SetWindowSkipTaskbarPayload, setWindowStage, type SetWindowStagePayload, setWindowTitle, type SetWindowTitlePayload, setWindowVisible, type SetWindowVisiblePayload, SLICE_NAME, type SliceState, type StoreState, ZERO_SLICE_STATE, } from './state';
|
|
6
6
|
export { type WindowProps, windowPropsZ, type WindowStage, type WindowState, } from './window';
|
|
7
7
|
export { MAIN_WINDOW } from './window';
|
|
8
8
|
//# sourceMappingURL=external.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../src/external.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,
|
|
1
|
+
{"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../src/external.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,MAAM,EACX,WAAW,EACX,KAAK,kBAAkB,EACvB,eAAe,EACf,YAAY,EACZ,KAAK,mBAAmB,EACxB,WAAW,EACX,KAAK,kBAAkB,EACvB,OAAO,EACP,eAAe,EACf,YAAY,EACZ,KAAK,mBAAmB,EACxB,oBAAoB,EACpB,KAAK,2BAA2B,EAChC,oBAAoB,EACpB,KAAK,2BAA2B,EAChC,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,cAAc,EACd,KAAK,qBAAqB,EAC1B,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,aAAa,EACb,KAAK,oBAAoB,EACzB,oBAAoB,EACpB,KAAK,2BAA2B,EAChC,cAAc,EACd,KAAK,qBAAqB,EAC1B,cAAc,EACd,KAAK,qBAAqB,EAC1B,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,UAAU,EACV,KAAK,UAAU,EACf,KAAK,UAAU,EACf,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,WAAW,EAChB,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|