@seedprotocol/react 0.7.13-next.1553.gd3c731a → 0.7.13-next.1564.gb56e6c2
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 +521 -520
- package/dist/index.js.map +1 -1
- package/dist/services.d.ts +5 -2
- package/dist/services.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import e, { createContext as t, useCallback as n, useContext as r, useEffect as i, useInsertionEffect as a, useMemo as o, useRef as s, useState as c, useSyncExternalStore as l } from "react";
|
|
3
3
|
import { flushSync as u } from "react-dom";
|
|
4
|
-
import { BaseArweaveClient as d, BaseDb as f, BaseFileManager as p, ClientManagerState as m, ClientNotInitializedError as h, EAS_SEED_DATA_SYNCED_TO_DB_EVENT as g, FILES_CHANGED_EVENT as _, Item as v, ItemProperty as y, ItemPropertySaveValidationError as b, MachineIds as x, Model as S, ModelProperty as C, SEED_PROTOCOL_SCHEMA_NAME as w, Schema as T, client as E, easName as D, easSyncProcesses as O, ensureImageLocal as ee, entityLoadError as
|
|
5
|
-
import { debounce as
|
|
6
|
-
import
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { QueryClient as
|
|
4
|
+
import { BaseArweaveClient as d, BaseDb as f, BaseFileManager as p, ClientManagerState as m, ClientNotInitializedError as h, EAS_SEED_DATA_SYNCED_TO_DB_EVENT as g, FILES_CHANGED_EVENT as _, Item as v, ItemProperty as y, ItemPropertySaveValidationError as b, MachineIds as x, Model as S, ModelProperty as C, SEED_PROTOCOL_SCHEMA_NAME as w, Schema as T, client as E, easName as D, easSyncProcesses as O, ensureImageLocal as ee, entityLoadError as te, eventEmitter as k, getAddressesForItemsFilter as ne, getArweaveReadBaseUrls as A, getClient as j, getPropertySchema as M, getVersionData as re, isChangeFeedRunning as ie, isClientReadySnapshot as N, isValidEasAttestationUid as ae, loadAllSchemasFromDb as oe, mapUrlAttribute as se, metadata as P, modelSchemas as ce, models as F, nextArweaveGatewayUrl as I, normalizeArweaveTxIdForEnsure as le, normalizeFeedItemFields as ue, ownedSeedsSql as de, pickLatestMetadataRowPerProperty as fe, placeholderUidSql as pe, properties as L, publisherInAddressListSql as R, rehostArweaveLinksInHtml as me, resolveMediaRef as he, schemas as z, seeds as B, watchEntityRows as ge } from "@seedprotocol/sdk";
|
|
5
|
+
import { debounce as _e, orderBy as ve, startCase as V } from "lodash-es";
|
|
6
|
+
import ye from "debug";
|
|
7
|
+
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
8
|
+
import { QueryClient as be, QueryClientContext as xe, QueryClientProvider as Se, useQuery as G, useQueryClient as K } from "@tanstack/react-query";
|
|
9
9
|
import { and as Ce, desc as we, eq as q, gt as Te, isNotNull as Ee, isNull as De, or as Oe } from "drizzle-orm";
|
|
10
10
|
import ke from "pluralize";
|
|
11
11
|
//#region src/client.ts
|
|
12
|
-
var Ae = (e) =>
|
|
12
|
+
var Ae = (e) => j().subscribeService(e), je = () => j().getService(), Me = () => l(Ae, je, je);
|
|
13
13
|
function J(e) {
|
|
14
14
|
let t = Me(), r = s(e);
|
|
15
15
|
r.current = e;
|
|
@@ -18,14 +18,14 @@ function J(e) {
|
|
|
18
18
|
next: e,
|
|
19
19
|
error: e,
|
|
20
20
|
complete: e
|
|
21
|
-
}), r =
|
|
21
|
+
}), r = j().subscribeService(e);
|
|
22
22
|
return () => {
|
|
23
23
|
n.unsubscribe(), r();
|
|
24
24
|
};
|
|
25
25
|
}, [t]), a = () => r.current(t.getSnapshot());
|
|
26
26
|
return l(i, a, a);
|
|
27
27
|
}
|
|
28
|
-
var Y = () => J(
|
|
28
|
+
var Y = () => J(N);
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/useHeldEntities.ts
|
|
31
31
|
function X(e, t, n) {
|
|
@@ -66,9 +66,9 @@ function Le({ queryClient: e, children: t }) {
|
|
|
66
66
|
exact: !1
|
|
67
67
|
}), a((e) => e + 1);
|
|
68
68
|
}, [e]);
|
|
69
|
-
return i(() => (
|
|
70
|
-
|
|
71
|
-
}), [o]), /* @__PURE__ */
|
|
69
|
+
return i(() => (k.on(Ne, o), k.on(Pe, o), () => {
|
|
70
|
+
k.off(Ne, o), k.off(Pe, o);
|
|
71
|
+
}), [o]), /* @__PURE__ */ U(Fe.Provider, {
|
|
72
72
|
value: r,
|
|
73
73
|
children: t
|
|
74
74
|
});
|
|
@@ -168,7 +168,7 @@ function We(e) {
|
|
|
168
168
|
}
|
|
169
169
|
function Ge(e) {
|
|
170
170
|
let t = Ue(), { defaultOptions: n, ...r } = e ?? {};
|
|
171
|
-
return new
|
|
171
|
+
return new be({
|
|
172
172
|
...r,
|
|
173
173
|
defaultOptions: n ? We(n) : t
|
|
174
174
|
});
|
|
@@ -181,18 +181,18 @@ var Ke, qe = !1, Je = () => {
|
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
function Ye() {
|
|
184
|
-
return r(
|
|
184
|
+
return r(xe) || (!qe && Je() && (qe = !0, console.warn("[@seedprotocol/react] A Seed hook ran outside SeedProvider (no QueryClientProvider found), so it uses a shared fallback QueryClient. Wrap the app in <SeedProvider>: from 0.8 these hooks will throw without it.")), Ke ?? (Ke = Ge()), Ke);
|
|
185
185
|
}
|
|
186
186
|
//#endregion
|
|
187
187
|
//#region src/item.ts
|
|
188
|
-
var Xe =
|
|
188
|
+
var Xe = ye("seedSdk:react:item"), Ze = (e) => [
|
|
189
189
|
"seed",
|
|
190
190
|
"item",
|
|
191
191
|
e ?? null
|
|
192
192
|
], Qe = ({ modelName: e, seedLocalId: t, seedUid: r }) => {
|
|
193
193
|
let a = t || r, [, l] = c(0), [, u] = c(0), [, d] = c(0), [f, p] = c(!1), [m, h] = c(null), _ = s(!1), y = Y(), b = Ye(), x = o(() => Ze(a), [a]), S = s(x);
|
|
194
194
|
S.current = x;
|
|
195
|
-
let C =
|
|
195
|
+
let C = G({
|
|
196
196
|
queryKey: x,
|
|
197
197
|
queryFn: async () => {
|
|
198
198
|
let n = v.peekReady(a) ?? await v.find({
|
|
@@ -219,8 +219,8 @@ var Xe = ve("seedSdk:react:item"), Ze = (e) => [
|
|
|
219
219
|
let e = () => {
|
|
220
220
|
l((e) => e + 1), b.invalidateQueries({ queryKey: S.current });
|
|
221
221
|
};
|
|
222
|
-
return
|
|
223
|
-
|
|
222
|
+
return k.on(g, e), () => {
|
|
223
|
+
k.off(g, e);
|
|
224
224
|
};
|
|
225
225
|
}, [b]), i(() => {
|
|
226
226
|
if (_.current = !1, p(!1), h(null), !w) return;
|
|
@@ -272,7 +272,7 @@ var Xe = ve("seedSdk:react:item"), Ze = (e) => [
|
|
|
272
272
|
let t = /* @__PURE__ */ new Map(), n = [];
|
|
273
273
|
for (let r of e ?? []) {
|
|
274
274
|
if (!r.localId) continue;
|
|
275
|
-
let e =
|
|
275
|
+
let e = ae(r.uid) ? r.uid.toLowerCase() : "", i = r.lastVersionPublishedAt || r.attestationCreatedAt || r.createdAt;
|
|
276
276
|
i && t.set(r.localId, i), n.push(`${r.localId}:${e}:${i ?? ""}`);
|
|
277
277
|
}
|
|
278
278
|
return {
|
|
@@ -292,13 +292,13 @@ var Xe = ve("seedSdk:react:item"), Ze = (e) => [
|
|
|
292
292
|
schemaName: o ?? null
|
|
293
293
|
}] : []
|
|
294
294
|
], at = ({ modelName: e, modelFileId: t, schemaName: r, deleted: a = !1, includeEas: l = !1, addressFilter: u }) => {
|
|
295
|
-
let d = Y(), p = Ie(), m =
|
|
295
|
+
let d = Y(), p = Ie(), m = K();
|
|
296
296
|
i(() => {
|
|
297
297
|
let e = () => {
|
|
298
298
|
m.invalidateQueries({ queryKey: ["seed", "items"] });
|
|
299
299
|
};
|
|
300
|
-
return
|
|
301
|
-
|
|
300
|
+
return k.on(g, e), () => {
|
|
301
|
+
k.off(g, e);
|
|
302
302
|
};
|
|
303
303
|
}, [m]);
|
|
304
304
|
let h = s([]), _ = s(/* @__PURE__ */ new Set()), y = s(0), b = s(0), [x, S] = c(null);
|
|
@@ -308,7 +308,7 @@ var Xe = ve("seedSdk:react:item"), Ze = (e) => [
|
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
310
|
let e = !1;
|
|
311
|
-
return
|
|
311
|
+
return ne(u).then((t) => {
|
|
312
312
|
e || S(t);
|
|
313
313
|
}), () => {
|
|
314
314
|
e = !0;
|
|
@@ -326,7 +326,7 @@ var Xe = ve("seedSdk:react:item"), Ze = (e) => [
|
|
|
326
326
|
i(() => {
|
|
327
327
|
_.current = /* @__PURE__ */ new Set();
|
|
328
328
|
}, [C]);
|
|
329
|
-
let { data: w = nt, isLoading: T, isFetching: E, dataUpdatedAt: O, error: ee } =
|
|
329
|
+
let { data: w = nt, isLoading: T, isFetching: E, dataUpdatedAt: O, error: ee } = G({
|
|
330
330
|
queryKey: C,
|
|
331
331
|
queryFn: async ({ signal: n }) => (y.current++, await v.all(e, a, {
|
|
332
332
|
hold: !1,
|
|
@@ -342,40 +342,40 @@ var Xe = ve("seedSdk:react:item"), Ze = (e) => [
|
|
|
342
342
|
gcTime: 0
|
|
343
343
|
});
|
|
344
344
|
h.current = w;
|
|
345
|
-
let
|
|
346
|
-
|
|
347
|
-
m.invalidateQueries({ queryKey:
|
|
345
|
+
let te = s(C);
|
|
346
|
+
te.current = C, X(w, tt, n(() => {
|
|
347
|
+
m.invalidateQueries({ queryKey: te.current });
|
|
348
348
|
}, [m]));
|
|
349
|
-
let
|
|
350
|
-
if (!
|
|
349
|
+
let A = d ? f.getAppDb() : null, j = Z(o(() => {
|
|
350
|
+
if (!A || (u === "owned" || u === "watched") && x === null) return null;
|
|
351
351
|
let t = [];
|
|
352
|
-
l || t.push(
|
|
353
|
-
let n =
|
|
354
|
-
return
|
|
355
|
-
localId:
|
|
356
|
-
uid:
|
|
357
|
-
type:
|
|
358
|
-
schemaUid:
|
|
359
|
-
createdAt:
|
|
360
|
-
attestationCreatedAt:
|
|
352
|
+
l || t.push(pe(B.uid)), e && t.push(q(B.type, D(e))), u === "owned" ? t.push(de(x ?? [])) : u === "watched" && t.push(R(B.publisher, x ?? [])), a ? t.push(q(B._markedForDeletion, 1)) : (t.push(Oe(De(B._markedForDeletion), q(B._markedForDeletion, 0))), t.push(Oe(De(B.revokedAt), q(B.revokedAt, 0))));
|
|
353
|
+
let n = re();
|
|
354
|
+
return A.with(n).select({
|
|
355
|
+
localId: B.localId,
|
|
356
|
+
uid: B.uid,
|
|
357
|
+
type: B.type,
|
|
358
|
+
schemaUid: B.schemaUid,
|
|
359
|
+
createdAt: B.createdAt,
|
|
360
|
+
attestationCreatedAt: B.attestationCreatedAt,
|
|
361
361
|
lastVersionPublishedAt: n.lastVersionPublishedAt,
|
|
362
|
-
_markedForDeletion:
|
|
363
|
-
}).from(
|
|
362
|
+
_markedForDeletion: B._markedForDeletion
|
|
363
|
+
}).from(B).leftJoin(n, q(B.localId, n.seedLocalId)).where(Ce(Te(n.versionsCount, 0), ...t)).groupBy(B.localId);
|
|
364
364
|
}, [
|
|
365
|
-
|
|
365
|
+
A,
|
|
366
366
|
d,
|
|
367
367
|
e,
|
|
368
368
|
a,
|
|
369
369
|
l,
|
|
370
370
|
u,
|
|
371
371
|
x
|
|
372
|
-
])),
|
|
373
|
-
|
|
374
|
-
let
|
|
372
|
+
])), M = s(rt(void 0)), ie = rt(j);
|
|
373
|
+
ie.signature !== M.current.signature && (M.current = ie);
|
|
374
|
+
let N = M.current;
|
|
375
375
|
return i(() => {
|
|
376
|
-
if (!d || !
|
|
376
|
+
if (!d || !j) return;
|
|
377
377
|
let e = /* @__PURE__ */ new Set();
|
|
378
|
-
for (let t of
|
|
378
|
+
for (let t of j) {
|
|
379
379
|
let n = t.localId || t.uid;
|
|
380
380
|
n && e.add(n);
|
|
381
381
|
}
|
|
@@ -387,13 +387,13 @@ var Xe = ve("seedSdk:react:item"), Ze = (e) => [
|
|
|
387
387
|
e.size === 0 && t.size > 0 || (dt(t, e) ? _.current = e : dt(_.current, e) && (y.current > b.current || E) || (_.current = e, b.current = y.current, m.invalidateQueries({ queryKey: C })));
|
|
388
388
|
}, [
|
|
389
389
|
d,
|
|
390
|
-
|
|
390
|
+
j,
|
|
391
391
|
m,
|
|
392
392
|
C,
|
|
393
393
|
O,
|
|
394
394
|
E
|
|
395
395
|
]), {
|
|
396
|
-
items: o(() =>
|
|
396
|
+
items: o(() => ve(w, [(e) => e.seedLocalId && N.sortTimes.get(e.seedLocalId) || e.lastVersionPublishedAt || e.attestationCreatedAt || e.createdAt], ["desc"]), [w, N]),
|
|
397
397
|
isLoading: T || !d,
|
|
398
398
|
error: ee
|
|
399
399
|
};
|
|
@@ -470,7 +470,7 @@ function dt(e, t) {
|
|
|
470
470
|
//#endregion
|
|
471
471
|
//#region src/entityRows.ts
|
|
472
472
|
function ft(e, t) {
|
|
473
|
-
let n = Y() &&
|
|
473
|
+
let n = Y() && ie(), r = Ve(n ? null : t), [a, o] = c({
|
|
474
474
|
data: void 0,
|
|
475
475
|
error: null
|
|
476
476
|
}), l = e && t ? `${JSON.stringify(e)}|${String(Re(t))}` : null, u = s({
|
|
@@ -487,7 +487,7 @@ function ft(e, t) {
|
|
|
487
487
|
});
|
|
488
488
|
let { watch: e, query: t } = u.current;
|
|
489
489
|
if (!n || !l || !e || !t) return;
|
|
490
|
-
let r =
|
|
490
|
+
let r = ge(e, () => t.all(), (e) => o({
|
|
491
491
|
data: [...e],
|
|
492
492
|
error: null
|
|
493
493
|
}), {
|
|
@@ -502,7 +502,7 @@ function ft(e, t) {
|
|
|
502
502
|
}
|
|
503
503
|
//#endregion
|
|
504
504
|
//#region src/itemProperty.ts
|
|
505
|
-
var pt =
|
|
505
|
+
var pt = ye("seedSdk:react:property"), mt = ye("seedSdk:react:itemProperties"), ht = (e, t, n) => [
|
|
506
506
|
"seed",
|
|
507
507
|
"itemProperty",
|
|
508
508
|
e ?? null,
|
|
@@ -524,7 +524,7 @@ function gt(e, t) {
|
|
|
524
524
|
m,
|
|
525
525
|
u,
|
|
526
526
|
d
|
|
527
|
-
]), g = o(() => ht(h?.seedLocalId, h?.seedUid, h?.propertyName ?? ""), [h]), _ =
|
|
527
|
+
]), g = o(() => ht(h?.seedLocalId, h?.seedUid, h?.propertyName ?? ""), [h]), _ = G({
|
|
528
528
|
queryKey: g,
|
|
529
529
|
queryFn: async () => {
|
|
530
530
|
if (!h) return null;
|
|
@@ -588,7 +588,7 @@ function _t(e, t = 300) {
|
|
|
588
588
|
a,
|
|
589
589
|
c,
|
|
590
590
|
l
|
|
591
|
-
])), p = s(""), m = vt(u), h = o(() =>
|
|
591
|
+
])), p = s(""), m = vt(u), h = o(() => _e((e) => {
|
|
592
592
|
e.setValue(p.current);
|
|
593
593
|
}, t), [t]);
|
|
594
594
|
i(() => () => h.flush(), [h]);
|
|
@@ -648,13 +648,13 @@ async function bt(e, t) {
|
|
|
648
648
|
let o;
|
|
649
649
|
if (r.length > 0) {
|
|
650
650
|
let e = r[0];
|
|
651
|
-
o = e.modelName ?? e.modelType, o && typeof o == "string" && (o =
|
|
651
|
+
o = e.modelName ?? e.modelType, o && typeof o == "string" && (o = V(o));
|
|
652
652
|
}
|
|
653
653
|
let s = await n.select({
|
|
654
|
-
type:
|
|
655
|
-
modelFileId:
|
|
656
|
-
}).from(
|
|
657
|
-
!o && s.length > 0 && s[0].type && (o =
|
|
654
|
+
type: B.type,
|
|
655
|
+
modelFileId: B.modelFileId
|
|
656
|
+
}).from(B).where(t ? q(B.uid, t) : q(B.localId, e)).limit(1), c = s[0]?.modelFileId ?? void 0;
|
|
657
|
+
!o && s.length > 0 && s[0].type && (o = V(s[0].type));
|
|
658
658
|
let l = [];
|
|
659
659
|
if (o) try {
|
|
660
660
|
let { Model: e } = await import("@seedprotocol/sdk"), t = await e.resolveAsync(o, { modelFileId: c });
|
|
@@ -681,7 +681,7 @@ async function bt(e, t) {
|
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
if (e || t) {
|
|
684
|
-
let a = await n.select({ createdAt:
|
|
684
|
+
let a = await n.select({ createdAt: B.createdAt }).from(B).where(t ? q(B.uid, t) : q(B.localId, e)).limit(1);
|
|
685
685
|
if (a.length > 0 && a[0].createdAt) {
|
|
686
686
|
let n = "createdAt";
|
|
687
687
|
if (!i.some((e) => e.propertyName === n) && o) try {
|
|
@@ -704,7 +704,7 @@ async function bt(e, t) {
|
|
|
704
704
|
return i;
|
|
705
705
|
}
|
|
706
706
|
function xt(e) {
|
|
707
|
-
let t = Y(), n =
|
|
707
|
+
let t = Y(), n = K(), r = s(void 0), a = o(() => typeof e == "string" ? {
|
|
708
708
|
type: "itemId",
|
|
709
709
|
itemId: e
|
|
710
710
|
} : typeof e == "object" ? {
|
|
@@ -719,7 +719,7 @@ function xt(e) {
|
|
|
719
719
|
"seed",
|
|
720
720
|
"itemProperties",
|
|
721
721
|
u
|
|
722
|
-
], [u]), { data: p = [], isLoading: m, error: h } =
|
|
722
|
+
], [u]), { data: p = [], isLoading: m, error: h } = G({
|
|
723
723
|
queryKey: d,
|
|
724
724
|
queryFn: () => bt(c, l),
|
|
725
725
|
enabled: t && !!u,
|
|
@@ -733,28 +733,28 @@ function xt(e) {
|
|
|
733
733
|
if (!e) return mt("[useItemProperties] Query: returning null (no db)"), null;
|
|
734
734
|
mt(`[useItemProperties] Query: creating query for seedLocalId=${c}, seedUid=${l}`);
|
|
735
735
|
let n = l ? e.select({
|
|
736
|
-
propertyName:
|
|
737
|
-
propertyValue:
|
|
738
|
-
seedLocalId:
|
|
739
|
-
seedUid:
|
|
740
|
-
modelType:
|
|
741
|
-
schemaUid:
|
|
742
|
-
createdAt:
|
|
743
|
-
attestationCreatedAt:
|
|
744
|
-
localId:
|
|
745
|
-
revokedAt:
|
|
746
|
-
}).from(
|
|
747
|
-
propertyName:
|
|
748
|
-
propertyValue:
|
|
749
|
-
seedLocalId:
|
|
750
|
-
seedUid:
|
|
751
|
-
modelType:
|
|
752
|
-
schemaUid:
|
|
753
|
-
createdAt:
|
|
754
|
-
attestationCreatedAt:
|
|
755
|
-
localId:
|
|
756
|
-
revokedAt:
|
|
757
|
-
}).from(
|
|
736
|
+
propertyName: P.propertyName,
|
|
737
|
+
propertyValue: P.propertyValue,
|
|
738
|
+
seedLocalId: P.seedLocalId,
|
|
739
|
+
seedUid: P.seedUid,
|
|
740
|
+
modelType: P.modelType,
|
|
741
|
+
schemaUid: P.schemaUid,
|
|
742
|
+
createdAt: P.createdAt,
|
|
743
|
+
attestationCreatedAt: P.attestationCreatedAt,
|
|
744
|
+
localId: P.localId,
|
|
745
|
+
revokedAt: P.revokedAt
|
|
746
|
+
}).from(P).where(Ce(q(P.seedUid, l), Ee(P.propertyName))) : c ? e.select({
|
|
747
|
+
propertyName: P.propertyName,
|
|
748
|
+
propertyValue: P.propertyValue,
|
|
749
|
+
seedLocalId: P.seedLocalId,
|
|
750
|
+
seedUid: P.seedUid,
|
|
751
|
+
modelType: P.modelType,
|
|
752
|
+
schemaUid: P.schemaUid,
|
|
753
|
+
createdAt: P.createdAt,
|
|
754
|
+
attestationCreatedAt: P.attestationCreatedAt,
|
|
755
|
+
localId: P.localId,
|
|
756
|
+
revokedAt: P.revokedAt
|
|
757
|
+
}).from(P).where(Ce(q(P.seedLocalId, c), Ee(P.propertyName))) : null;
|
|
758
758
|
return mt("[useItemProperties] Query: created query object", { queryType: l ? "seedUid" : "seedLocalId" }), n;
|
|
759
759
|
}, [
|
|
760
760
|
t,
|
|
@@ -766,7 +766,7 @@ function xt(e) {
|
|
|
766
766
|
} : c ? {
|
|
767
767
|
seedLocalId: c,
|
|
768
768
|
tables: ["metadata"]
|
|
769
|
-
} : null, [c, l]), g).data, v = o(() => !_ || _.length === 0 ? [] :
|
|
769
|
+
} : null, [c, l]), g).data, v = o(() => !_ || _.length === 0 ? [] : fe(_), [_]);
|
|
770
770
|
return i(() => {
|
|
771
771
|
if (!t || !c && !l || v === void 0) return;
|
|
772
772
|
let e = JSON.stringify(v.map((e) => ({
|
|
@@ -809,7 +809,7 @@ var St = () => {
|
|
|
809
809
|
}
|
|
810
810
|
let i = n.getService().subscribe(() => {
|
|
811
811
|
if (n.status === "error") {
|
|
812
|
-
let e =
|
|
812
|
+
let e = te(n);
|
|
813
813
|
o(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to create item property")), r(!1);
|
|
814
814
|
}
|
|
815
815
|
n.status === "ready" && (o(null), r(!1));
|
|
@@ -848,7 +848,7 @@ var St = () => {
|
|
|
848
848
|
m.PROCESS_SCHEMA_FILES,
|
|
849
849
|
m.ADD_MODELS_TO_DB,
|
|
850
850
|
m.IDLE
|
|
851
|
-
]), Tt = (e) => typeof e == "string" && wt.has(e), Et = () => ({ dbsAreReady: J((e) => e.status === "active" && Tt(e.value)) }), Dt =
|
|
851
|
+
]), Tt = (e) => typeof e == "string" && wt.has(e), Et = () => ({ dbsAreReady: J((e) => e.status === "active" && Tt(e.value)) }), Dt = ye("seedSdk:react:services"), Ot = [
|
|
852
852
|
"idle",
|
|
853
853
|
"ready",
|
|
854
854
|
"done",
|
|
@@ -936,13 +936,14 @@ var St = () => {
|
|
|
936
936
|
};
|
|
937
937
|
}, Bt = () => ({
|
|
938
938
|
status: J((e) => e.status === "active" ? e.value : "stopped"),
|
|
939
|
-
internalStatus: J((e) => e.status === "active" ? Tt(e.value) ? "ready" : e.value : "stopped")
|
|
939
|
+
internalStatus: J((e) => e.status === "active" ? Tt(e.value) ? "ready" : e.value : "stopped"),
|
|
940
|
+
stopReason: J((e) => e.status === "active" ? void 0 : e.context.stopReason ?? "stop")
|
|
940
941
|
}), Vt = (e) => e instanceof Error ? e : Error(String(e));
|
|
941
942
|
function Ht(e) {
|
|
942
943
|
let t = s(null), r = s(0), [a, o] = c(!1), [l, u] = c(null), d = n(() => u(null), []), f = n((n) => {
|
|
943
944
|
let r = (t) => {
|
|
944
945
|
if (n.status === "error") {
|
|
945
|
-
let r =
|
|
946
|
+
let r = te(n) ?? t.context?._loadingError?.error;
|
|
946
947
|
u(r instanceof Error ? r : Error(e)), o(!1);
|
|
947
948
|
} else n.status === "ready" && (u(null), o(!1));
|
|
948
949
|
}, i = n.getService();
|
|
@@ -988,7 +989,7 @@ function Ht(e) {
|
|
|
988
989
|
}
|
|
989
990
|
//#endregion
|
|
990
991
|
//#region src/schema.ts
|
|
991
|
-
var Ut =
|
|
992
|
+
var Ut = ye("seedSdk:react:schema"), Wt = (e) => {
|
|
992
993
|
let [t, r] = c(null), [a, o] = c(!!e), [s, l] = c(null), d = Y(), f = n(async (e, t) => {
|
|
993
994
|
o(!0), l(null);
|
|
994
995
|
try {
|
|
@@ -1042,10 +1043,10 @@ var Ut = ve("seedSdk:react:schema"), Wt = (e) => {
|
|
|
1042
1043
|
async function Gt(e) {
|
|
1043
1044
|
if (e === w) return !0;
|
|
1044
1045
|
let t = f.getAppDb();
|
|
1045
|
-
return !t || (await t.select({ id:
|
|
1046
|
+
return !t || (await t.select({ id: z.id }).from(z).where(Oe(q(z.name, e), q(z.schemaFileId, e))).limit(1)).length > 0;
|
|
1046
1047
|
}
|
|
1047
1048
|
var Kt = ["seed", "schemas"], qt = [], Jt = (e) => T.retain(e), Yt = () => {
|
|
1048
|
-
let e = Y(), t = Ye(), r = s(void 0), a = s([]), { data: c = qt, isLoading: l, error: u } =
|
|
1049
|
+
let e = Y(), t = Ye(), r = s(void 0), a = s([]), { data: c = qt, isLoading: l, error: u } = G({
|
|
1049
1050
|
queryKey: Kt,
|
|
1050
1051
|
queryFn: () => T.all({ waitForReady: !0 }),
|
|
1051
1052
|
enabled: e
|
|
@@ -1053,7 +1054,7 @@ var Kt = ["seed", "schemas"], qt = [], Jt = (e) => T.retain(e), Yt = () => {
|
|
|
1053
1054
|
a.current = c, X(c, Jt, n(() => {
|
|
1054
1055
|
t.invalidateQueries({ queryKey: Kt });
|
|
1055
1056
|
}, [t]));
|
|
1056
|
-
let d = e ? f.getAppDb() : null, p = Z(o(() => d ? d.select().from(
|
|
1057
|
+
let d = e ? f.getAppDb() : null, p = Z(o(() => d ? d.select().from(z).orderBy(z.name, we(z.version)) : null, [d, e]));
|
|
1057
1058
|
return i(() => {
|
|
1058
1059
|
if (typeof BroadcastChannel > "u") return;
|
|
1059
1060
|
let e = new BroadcastChannel("seed-schemas-invalidate"), n = () => {
|
|
@@ -1120,7 +1121,7 @@ var Kt = ["seed", "schemas"], qt = [], Jt = (e) => T.retain(e), Yt = () => {
|
|
|
1120
1121
|
}, Qt = () => {
|
|
1121
1122
|
let [e, t] = c(), r = s(/* @__PURE__ */ new Map()), a = Y(), o = n(async () => {
|
|
1122
1123
|
if (a) try {
|
|
1123
|
-
let e = await
|
|
1124
|
+
let e = await oe(), n = /* @__PURE__ */ new Set();
|
|
1124
1125
|
for (let t of e) {
|
|
1125
1126
|
let e = t.schema.metadata?.name;
|
|
1126
1127
|
e && n.add(e);
|
|
@@ -1154,7 +1155,7 @@ var Kt = ["seed", "schemas"], qt = [], Jt = (e) => T.retain(e), Yt = () => {
|
|
|
1154
1155
|
"models",
|
|
1155
1156
|
e
|
|
1156
1157
|
], tn = [], nn = (e) => S.retain(e), rn = (e) => e.getService().getSnapshot().status === "active", an = (e) => {
|
|
1157
|
-
let t = Y(), r = Ye(), a = s(null), c = o(() => en(e), [e]), { data: l = tn, isLoading: u, error: d } =
|
|
1158
|
+
let t = Y(), r = Ye(), a = s(null), c = o(() => en(e), [e]), { data: l = tn, isLoading: u, error: d } = G({
|
|
1158
1159
|
queryKey: c,
|
|
1159
1160
|
queryFn: async () => {
|
|
1160
1161
|
let t = await S.all(e, { waitForReady: !1 }), n = r.getQueryData(c), i = a.current;
|
|
@@ -1182,9 +1183,9 @@ var Kt = ["seed", "schemas"], qt = [], Jt = (e) => T.retain(e), Yt = () => {
|
|
|
1182
1183
|
function _() {
|
|
1183
1184
|
let t = f.getAppDb();
|
|
1184
1185
|
return !t || !e ? null : t.select({
|
|
1185
|
-
modelFileId:
|
|
1186
|
-
modelName:
|
|
1187
|
-
}).from(
|
|
1186
|
+
modelFileId: F.schemaFileId,
|
|
1187
|
+
modelName: F.name
|
|
1188
|
+
}).from(z).innerJoin(ce, q(z.id, ce.schemaId)).innerJoin(F, q(ce.modelId, F.id)).where(Oe(q(z.schemaFileId, e), q(z.name, e)));
|
|
1188
1189
|
}
|
|
1189
1190
|
let v = Z(o(() => {
|
|
1190
1191
|
if (!e || !t) return null;
|
|
@@ -1293,14 +1294,14 @@ var Kt = ["seed", "schemas"], qt = [], Jt = (e) => T.retain(e), Yt = () => {
|
|
|
1293
1294
|
async function dn(e) {
|
|
1294
1295
|
let t = f.getAppDb();
|
|
1295
1296
|
if (!t) throw new h();
|
|
1296
|
-
return (await t.select({ name:
|
|
1297
|
+
return (await t.select({ name: z.name }).from(z).where(Oe(q(z.name, e), q(z.schemaFileId, e))).limit(1))[0]?.name ?? void 0;
|
|
1297
1298
|
}
|
|
1298
1299
|
var fn = (e, t) => {
|
|
1299
1300
|
let { model: r } = on(e, t), a = Y(), c = Ye(), l = hn(r), u = r?.id, d = o(() => [
|
|
1300
1301
|
"seed",
|
|
1301
1302
|
"modelProperties",
|
|
1302
1303
|
u ?? ""
|
|
1303
|
-
], [u]), { data: p = ln, isLoading: m, error: h } =
|
|
1304
|
+
], [u]), { data: p = ln, isLoading: m, error: h } = G({
|
|
1304
1305
|
queryKey: d,
|
|
1305
1306
|
queryFn: () => C.all(u, { waitForReady: !0 }),
|
|
1306
1307
|
enabled: a && !!u
|
|
@@ -1309,11 +1310,11 @@ var fn = (e, t) => {
|
|
|
1309
1310
|
c.invalidateQueries({ queryKey: d });
|
|
1310
1311
|
}, [c, d]));
|
|
1311
1312
|
let g = a ? f.getAppDb() : null, _ = Z(o(() => !g || !l ? null : g.select({
|
|
1312
|
-
id:
|
|
1313
|
-
name:
|
|
1314
|
-
dataType:
|
|
1315
|
-
schemaFileId:
|
|
1316
|
-
}).from(
|
|
1313
|
+
id: L.id,
|
|
1314
|
+
name: L.name,
|
|
1315
|
+
dataType: L.dataType,
|
|
1316
|
+
schemaFileId: L.schemaFileId
|
|
1317
|
+
}).from(L).where(q(L.modelId, l)), [
|
|
1317
1318
|
g,
|
|
1318
1319
|
a,
|
|
1319
1320
|
l
|
|
@@ -1375,7 +1376,7 @@ var fn = (e, t) => {
|
|
|
1375
1376
|
let n = await S.createById(e);
|
|
1376
1377
|
if (!n) return;
|
|
1377
1378
|
let r = n.modelName ?? n.name;
|
|
1378
|
-
if (r) return
|
|
1379
|
+
if (r) return M(r, t, {
|
|
1379
1380
|
modelFileId: e,
|
|
1380
1381
|
schemaName: n.schemaName
|
|
1381
1382
|
});
|
|
@@ -1433,7 +1434,7 @@ function _n(...e) {
|
|
|
1433
1434
|
return;
|
|
1434
1435
|
}
|
|
1435
1436
|
let e = await dn(b.schemaId);
|
|
1436
|
-
t = e ? await
|
|
1437
|
+
t = e ? await M(b.modelName, b.propertyName, { schemaName: e }) : void 0, n = b.modelName;
|
|
1437
1438
|
}
|
|
1438
1439
|
if (t && n) {
|
|
1439
1440
|
let e = C.create({
|
|
@@ -1477,7 +1478,7 @@ function _n(...e) {
|
|
|
1477
1478
|
return i(() => {
|
|
1478
1479
|
if (!f || !D) return;
|
|
1479
1480
|
v.current?.unsubscribe();
|
|
1480
|
-
let e =
|
|
1481
|
+
let e = _e(w, 100), t = f.getService().subscribe(() => {
|
|
1481
1482
|
e();
|
|
1482
1483
|
});
|
|
1483
1484
|
return v.current = t, () => {
|
|
@@ -1552,7 +1553,7 @@ var vn = () => {
|
|
|
1552
1553
|
};
|
|
1553
1554
|
}, xn = ["seed", "imageFiles"];
|
|
1554
1555
|
function Sn() {
|
|
1555
|
-
let e = Y(), t = Ye(), { data: n = [], isLoading: r, error: a, refetch: o } =
|
|
1556
|
+
let e = Y(), t = Ye(), { data: n = [], isLoading: r, error: a, refetch: o } = G({
|
|
1556
1557
|
queryKey: xn,
|
|
1557
1558
|
queryFn: () => p.listImageFiles(),
|
|
1558
1559
|
enabled: e
|
|
@@ -1563,8 +1564,8 @@ function Sn() {
|
|
|
1563
1564
|
}, n = (e) => {
|
|
1564
1565
|
e.some((e) => e.includes("/images/")) && t.invalidateQueries({ queryKey: xn });
|
|
1565
1566
|
};
|
|
1566
|
-
return
|
|
1567
|
-
|
|
1567
|
+
return k.on("file-saved", e), k.on(_, n), () => {
|
|
1568
|
+
k.off("file-saved", e), k.off(_, n);
|
|
1568
1569
|
};
|
|
1569
1570
|
}, [t]), {
|
|
1570
1571
|
imageFiles: n,
|
|
@@ -1577,7 +1578,7 @@ function Sn() {
|
|
|
1577
1578
|
//#region src/useFiles.ts
|
|
1578
1579
|
var Cn = ["seed", "files"];
|
|
1579
1580
|
function wn(e = "files") {
|
|
1580
|
-
let t = Y(), n = Ye(), r = o(() => [...Cn, e], [e]), { data: a = [], isLoading: s, error: c, refetch: l } =
|
|
1581
|
+
let t = Y(), n = Ye(), r = o(() => [...Cn, e], [e]), { data: a = [], isLoading: s, error: c, refetch: l } = G({
|
|
1581
1582
|
queryKey: r,
|
|
1582
1583
|
queryFn: () => p.listFiles(e),
|
|
1583
1584
|
enabled: t
|
|
@@ -1588,8 +1589,8 @@ function wn(e = "files") {
|
|
|
1588
1589
|
}, i = (t) => {
|
|
1589
1590
|
t.some((t) => t.includes(`/${e}/`)) && n.invalidateQueries({ queryKey: r });
|
|
1590
1591
|
};
|
|
1591
|
-
return
|
|
1592
|
-
|
|
1592
|
+
return k.on("file-saved", t), k.on(_, i), () => {
|
|
1593
|
+
k.off("file-saved", t), k.off(_, i);
|
|
1593
1594
|
};
|
|
1594
1595
|
}, [
|
|
1595
1596
|
n,
|
|
@@ -1650,8 +1651,8 @@ function Nn({ queryClient: e }) {
|
|
|
1650
1651
|
exact: !1
|
|
1651
1652
|
});
|
|
1652
1653
|
};
|
|
1653
|
-
return
|
|
1654
|
-
|
|
1654
|
+
return k.on(g, t), () => {
|
|
1655
|
+
k.off(g, t), jn = null;
|
|
1655
1656
|
};
|
|
1656
1657
|
}, [e]), null;
|
|
1657
1658
|
}
|
|
@@ -1680,13 +1681,13 @@ function Fn({ children: e, config: t, addresses: n, onInitError: r, queryClient:
|
|
|
1680
1681
|
window.parent && window.parent !== window && (window.parent.__TEST_SEED_QUERY_CLIENT__ = s);
|
|
1681
1682
|
} catch {}
|
|
1682
1683
|
}
|
|
1683
|
-
return /* @__PURE__ */
|
|
1684
|
+
return /* @__PURE__ */ U(Se, {
|
|
1684
1685
|
client: s,
|
|
1685
|
-
children: /* @__PURE__ */
|
|
1686
|
+
children: /* @__PURE__ */ W(Le, {
|
|
1686
1687
|
queryClient: s,
|
|
1687
1688
|
children: [
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
t && /* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ U(Nn, { queryClient: s }),
|
|
1690
|
+
t && /* @__PURE__ */ U(Pn, {
|
|
1690
1691
|
config: t,
|
|
1691
1692
|
addresses: n,
|
|
1692
1693
|
onInitError: r
|
|
@@ -1699,7 +1700,7 @@ function Fn({ children: e, config: t, addresses: n, onInitError: r, queryClient:
|
|
|
1699
1700
|
//#endregion
|
|
1700
1701
|
//#region src/SeedClientGate.tsx
|
|
1701
1702
|
function In() {
|
|
1702
|
-
return /* @__PURE__ */
|
|
1703
|
+
return /* @__PURE__ */ U("div", {
|
|
1703
1704
|
style: {
|
|
1704
1705
|
display: "flex",
|
|
1705
1706
|
alignItems: "center",
|
|
@@ -1737,7 +1738,7 @@ function Rn({ initConfig: e, schema: t, loadingComponent: n, wrapperClassName: r
|
|
|
1737
1738
|
u.current ? u.current(e) : console.error("[SeedClientGate] client init failed", e);
|
|
1738
1739
|
});
|
|
1739
1740
|
}, [p, m]);
|
|
1740
|
-
let h = n ?? /* @__PURE__ */
|
|
1741
|
+
let h = n ?? /* @__PURE__ */ U(In, {}), g = r ? void 0 : {
|
|
1741
1742
|
position: "relative",
|
|
1742
1743
|
display: "flex",
|
|
1743
1744
|
height: "100vh",
|
|
@@ -1752,15 +1753,15 @@ function Rn({ initConfig: e, schema: t, loadingComponent: n, wrapperClassName: r
|
|
|
1752
1753
|
justifyContent: "center"
|
|
1753
1754
|
}
|
|
1754
1755
|
};
|
|
1755
|
-
return /* @__PURE__ */
|
|
1756
|
+
return /* @__PURE__ */ W("div", {
|
|
1756
1757
|
className: r,
|
|
1757
1758
|
style: g,
|
|
1758
|
-
children: [/* @__PURE__ */
|
|
1759
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1759
1760
|
className: a,
|
|
1760
1761
|
style: _,
|
|
1761
1762
|
"aria-hidden": l,
|
|
1762
1763
|
children: h
|
|
1763
|
-
}), /* @__PURE__ */
|
|
1764
|
+
}), /* @__PURE__ */ U("div", {
|
|
1764
1765
|
style: {
|
|
1765
1766
|
flex: 1,
|
|
1766
1767
|
display: l ? "flex" : "none",
|
|
@@ -1948,61 +1949,61 @@ function or(e, t) {
|
|
|
1948
1949
|
//#endregion
|
|
1949
1950
|
//#region src/OPFSFilesManager/icons.tsx
|
|
1950
1951
|
var sr = {
|
|
1951
|
-
check: /* @__PURE__ */
|
|
1952
|
-
chevronLeft: /* @__PURE__ */
|
|
1953
|
-
chevronRight: /* @__PURE__ */
|
|
1954
|
-
copy: /* @__PURE__ */
|
|
1952
|
+
check: /* @__PURE__ */ U("path", { d: "M20 6 9 17l-5-5" }),
|
|
1953
|
+
chevronLeft: /* @__PURE__ */ U("path", { d: "m15 18-6-6 6-6" }),
|
|
1954
|
+
chevronRight: /* @__PURE__ */ U("path", { d: "m9 18 6-6-6-6" }),
|
|
1955
|
+
copy: /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("rect", {
|
|
1955
1956
|
width: "14",
|
|
1956
1957
|
height: "14",
|
|
1957
1958
|
x: "8",
|
|
1958
1959
|
y: "8",
|
|
1959
1960
|
rx: "2",
|
|
1960
1961
|
ry: "2"
|
|
1961
|
-
}), /* @__PURE__ */
|
|
1962
|
-
database: /* @__PURE__ */
|
|
1963
|
-
/* @__PURE__ */
|
|
1962
|
+
}), /* @__PURE__ */ U("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })] }),
|
|
1963
|
+
database: /* @__PURE__ */ W(H, { children: [
|
|
1964
|
+
/* @__PURE__ */ U("ellipse", {
|
|
1964
1965
|
cx: "12",
|
|
1965
1966
|
cy: "5",
|
|
1966
1967
|
rx: "9",
|
|
1967
1968
|
ry: "3"
|
|
1968
1969
|
}),
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
/* @__PURE__ */
|
|
1970
|
+
/* @__PURE__ */ U("path", { d: "M3 5V19A9 3 0 0 0 21 19V5" }),
|
|
1971
|
+
/* @__PURE__ */ U("path", { d: "M3 12A9 3 0 0 0 21 12" })
|
|
1971
1972
|
] }),
|
|
1972
|
-
download: /* @__PURE__ */
|
|
1973
|
-
/* @__PURE__ */
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
/* @__PURE__ */
|
|
1973
|
+
download: /* @__PURE__ */ W(H, { children: [
|
|
1974
|
+
/* @__PURE__ */ U("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1975
|
+
/* @__PURE__ */ U("polyline", { points: "7 10 12 15 17 10" }),
|
|
1976
|
+
/* @__PURE__ */ U("line", {
|
|
1976
1977
|
x1: "12",
|
|
1977
1978
|
x2: "12",
|
|
1978
1979
|
y1: "15",
|
|
1979
1980
|
y2: "3"
|
|
1980
1981
|
})
|
|
1981
1982
|
] }),
|
|
1982
|
-
file: /* @__PURE__ */
|
|
1983
|
-
fileCode: /* @__PURE__ */
|
|
1984
|
-
/* @__PURE__ */
|
|
1985
|
-
/* @__PURE__ */
|
|
1986
|
-
/* @__PURE__ */
|
|
1987
|
-
/* @__PURE__ */
|
|
1983
|
+
file: /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }), /* @__PURE__ */ U("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })] }),
|
|
1984
|
+
fileCode: /* @__PURE__ */ W(H, { children: [
|
|
1985
|
+
/* @__PURE__ */ U("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
1986
|
+
/* @__PURE__ */ U("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
|
|
1987
|
+
/* @__PURE__ */ U("path", { d: "m10 13-2 2 2 2" }),
|
|
1988
|
+
/* @__PURE__ */ U("path", { d: "m14 17 2-2-2-2" })
|
|
1988
1989
|
] }),
|
|
1989
|
-
fileJson: /* @__PURE__ */
|
|
1990
|
-
/* @__PURE__ */
|
|
1991
|
-
/* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
1993
|
-
/* @__PURE__ */
|
|
1990
|
+
fileJson: /* @__PURE__ */ W(H, { children: [
|
|
1991
|
+
/* @__PURE__ */ U("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
1992
|
+
/* @__PURE__ */ U("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
|
|
1993
|
+
/* @__PURE__ */ U("path", { d: "M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1" }),
|
|
1994
|
+
/* @__PURE__ */ U("path", { d: "M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1" })
|
|
1994
1995
|
] }),
|
|
1995
|
-
fileText: /* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
1997
|
-
/* @__PURE__ */
|
|
1998
|
-
/* @__PURE__ */
|
|
1999
|
-
/* @__PURE__ */
|
|
2000
|
-
/* @__PURE__ */
|
|
1996
|
+
fileText: /* @__PURE__ */ W(H, { children: [
|
|
1997
|
+
/* @__PURE__ */ U("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
1998
|
+
/* @__PURE__ */ U("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
|
|
1999
|
+
/* @__PURE__ */ U("path", { d: "M10 9H8" }),
|
|
2000
|
+
/* @__PURE__ */ U("path", { d: "M16 13H8" }),
|
|
2001
|
+
/* @__PURE__ */ U("path", { d: "M16 17H8" })
|
|
2001
2002
|
] }),
|
|
2002
|
-
folder: /* @__PURE__ */
|
|
2003
|
-
folderOpen: /* @__PURE__ */
|
|
2004
|
-
image: /* @__PURE__ */
|
|
2005
|
-
/* @__PURE__ */
|
|
2003
|
+
folder: /* @__PURE__ */ U("path", { d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }),
|
|
2004
|
+
folderOpen: /* @__PURE__ */ U("path", { d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" }),
|
|
2005
|
+
image: /* @__PURE__ */ W(H, { children: [
|
|
2006
|
+
/* @__PURE__ */ U("rect", {
|
|
2006
2007
|
width: "18",
|
|
2007
2008
|
height: "18",
|
|
2008
2009
|
x: "3",
|
|
@@ -2010,64 +2011,64 @@ var sr = {
|
|
|
2010
2011
|
rx: "2",
|
|
2011
2012
|
ry: "2"
|
|
2012
2013
|
}),
|
|
2013
|
-
/* @__PURE__ */
|
|
2014
|
+
/* @__PURE__ */ U("circle", {
|
|
2014
2015
|
cx: "9",
|
|
2015
2016
|
cy: "9",
|
|
2016
2017
|
r: "2"
|
|
2017
2018
|
}),
|
|
2018
|
-
/* @__PURE__ */
|
|
2019
|
+
/* @__PURE__ */ U("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
|
|
2019
2020
|
] }),
|
|
2020
|
-
imageOff: /* @__PURE__ */
|
|
2021
|
-
/* @__PURE__ */
|
|
2021
|
+
imageOff: /* @__PURE__ */ W(H, { children: [
|
|
2022
|
+
/* @__PURE__ */ U("line", {
|
|
2022
2023
|
x1: "2",
|
|
2023
2024
|
x2: "22",
|
|
2024
2025
|
y1: "2",
|
|
2025
2026
|
y2: "22"
|
|
2026
2027
|
}),
|
|
2027
|
-
/* @__PURE__ */
|
|
2028
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ U("path", { d: "M10.41 10.41a2 2 0 1 1-2.83-2.83" }),
|
|
2029
|
+
/* @__PURE__ */ U("line", {
|
|
2029
2030
|
x1: "13.5",
|
|
2030
2031
|
x2: "6",
|
|
2031
2032
|
y1: "13.5",
|
|
2032
2033
|
y2: "21"
|
|
2033
2034
|
}),
|
|
2034
|
-
/* @__PURE__ */
|
|
2035
|
+
/* @__PURE__ */ U("line", {
|
|
2035
2036
|
x1: "18",
|
|
2036
2037
|
x2: "21",
|
|
2037
2038
|
y1: "12",
|
|
2038
2039
|
y2: "15"
|
|
2039
2040
|
}),
|
|
2040
|
-
/* @__PURE__ */
|
|
2041
|
-
/* @__PURE__ */
|
|
2041
|
+
/* @__PURE__ */ U("path", { d: "M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59" }),
|
|
2042
|
+
/* @__PURE__ */ U("path", { d: "M21 15V5a2 2 0 0 0-2-2H9" })
|
|
2042
2043
|
] }),
|
|
2043
|
-
layers: /* @__PURE__ */
|
|
2044
|
-
/* @__PURE__ */
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2044
|
+
layers: /* @__PURE__ */ W(H, { children: [
|
|
2045
|
+
/* @__PURE__ */ U("path", { d: "m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z" }),
|
|
2046
|
+
/* @__PURE__ */ U("path", { d: "m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65" }),
|
|
2047
|
+
/* @__PURE__ */ U("path", { d: "m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65" })
|
|
2047
2048
|
] }),
|
|
2048
|
-
layoutGrid: /* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2049
|
+
layoutGrid: /* @__PURE__ */ W(H, { children: [
|
|
2050
|
+
/* @__PURE__ */ U("rect", {
|
|
2050
2051
|
width: "7",
|
|
2051
2052
|
height: "7",
|
|
2052
2053
|
x: "3",
|
|
2053
2054
|
y: "3",
|
|
2054
2055
|
rx: "1"
|
|
2055
2056
|
}),
|
|
2056
|
-
/* @__PURE__ */
|
|
2057
|
+
/* @__PURE__ */ U("rect", {
|
|
2057
2058
|
width: "7",
|
|
2058
2059
|
height: "7",
|
|
2059
2060
|
x: "14",
|
|
2060
2061
|
y: "3",
|
|
2061
2062
|
rx: "1"
|
|
2062
2063
|
}),
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
+
/* @__PURE__ */ U("rect", {
|
|
2064
2065
|
width: "7",
|
|
2065
2066
|
height: "7",
|
|
2066
2067
|
x: "14",
|
|
2067
2068
|
y: "14",
|
|
2068
2069
|
rx: "1"
|
|
2069
2070
|
}),
|
|
2070
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ U("rect", {
|
|
2071
2072
|
width: "7",
|
|
2072
2073
|
height: "7",
|
|
2073
2074
|
x: "3",
|
|
@@ -2075,51 +2076,51 @@ var sr = {
|
|
|
2075
2076
|
rx: "1"
|
|
2076
2077
|
})
|
|
2077
2078
|
] }),
|
|
2078
|
-
list: /* @__PURE__ */
|
|
2079
|
-
/* @__PURE__ */
|
|
2080
|
-
/* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2083
|
-
/* @__PURE__ */
|
|
2084
|
-
/* @__PURE__ */
|
|
2079
|
+
list: /* @__PURE__ */ W(H, { children: [
|
|
2080
|
+
/* @__PURE__ */ U("path", { d: "M3 12h.01" }),
|
|
2081
|
+
/* @__PURE__ */ U("path", { d: "M3 18h.01" }),
|
|
2082
|
+
/* @__PURE__ */ U("path", { d: "M3 6h.01" }),
|
|
2083
|
+
/* @__PURE__ */ U("path", { d: "M8 12h13" }),
|
|
2084
|
+
/* @__PURE__ */ U("path", { d: "M8 18h13" }),
|
|
2085
|
+
/* @__PURE__ */ U("path", { d: "M8 6h13" })
|
|
2085
2086
|
] }),
|
|
2086
|
-
refresh: /* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2088
|
-
/* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
/* @__PURE__ */
|
|
2087
|
+
refresh: /* @__PURE__ */ W(H, { children: [
|
|
2088
|
+
/* @__PURE__ */ U("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
2089
|
+
/* @__PURE__ */ U("path", { d: "M21 3v5h-5" }),
|
|
2090
|
+
/* @__PURE__ */ U("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
2091
|
+
/* @__PURE__ */ U("path", { d: "M8 16H3v5" })
|
|
2091
2092
|
] }),
|
|
2092
|
-
search: /* @__PURE__ */
|
|
2093
|
+
search: /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("circle", {
|
|
2093
2094
|
cx: "11",
|
|
2094
2095
|
cy: "11",
|
|
2095
2096
|
r: "8"
|
|
2096
|
-
}), /* @__PURE__ */
|
|
2097
|
-
trash: /* @__PURE__ */
|
|
2098
|
-
/* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2101
|
-
/* @__PURE__ */
|
|
2097
|
+
}), /* @__PURE__ */ U("path", { d: "m21 21-4.3-4.3" })] }),
|
|
2098
|
+
trash: /* @__PURE__ */ W(H, { children: [
|
|
2099
|
+
/* @__PURE__ */ U("path", { d: "M3 6h18" }),
|
|
2100
|
+
/* @__PURE__ */ U("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
|
|
2101
|
+
/* @__PURE__ */ U("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }),
|
|
2102
|
+
/* @__PURE__ */ U("line", {
|
|
2102
2103
|
x1: "10",
|
|
2103
2104
|
x2: "10",
|
|
2104
2105
|
y1: "11",
|
|
2105
2106
|
y2: "17"
|
|
2106
2107
|
}),
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
+
/* @__PURE__ */ U("line", {
|
|
2108
2109
|
x1: "14",
|
|
2109
2110
|
x2: "14",
|
|
2110
2111
|
y1: "11",
|
|
2111
2112
|
y2: "17"
|
|
2112
2113
|
})
|
|
2113
2114
|
] }),
|
|
2114
|
-
triangleAlert: /* @__PURE__ */
|
|
2115
|
-
/* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2115
|
+
triangleAlert: /* @__PURE__ */ W(H, { children: [
|
|
2116
|
+
/* @__PURE__ */ U("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
2117
|
+
/* @__PURE__ */ U("path", { d: "M12 9v4" }),
|
|
2118
|
+
/* @__PURE__ */ U("path", { d: "M12 17h.01" })
|
|
2118
2119
|
] }),
|
|
2119
|
-
x: /* @__PURE__ */
|
|
2120
|
+
x: /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("path", { d: "M18 6 6 18" }), /* @__PURE__ */ U("path", { d: "m6 6 12 12" })] })
|
|
2120
2121
|
};
|
|
2121
2122
|
function $({ name: e, size: t = 16, strokeWidth: n = 2, className: r }) {
|
|
2122
|
-
return /* @__PURE__ */
|
|
2123
|
+
return /* @__PURE__ */ U("svg", {
|
|
2123
2124
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2124
2125
|
width: t,
|
|
2125
2126
|
height: t,
|
|
@@ -2145,7 +2146,7 @@ function lr({ className: e, onCancel: t, onSubmit: n, children: r }) {
|
|
|
2145
2146
|
return e && !e.open && (e.showModal(), e.querySelector("[data-initial-focus]")?.focus()), () => {
|
|
2146
2147
|
e?.open && e.close();
|
|
2147
2148
|
};
|
|
2148
|
-
}, []), /* @__PURE__ */
|
|
2149
|
+
}, []), /* @__PURE__ */ U("dialog", {
|
|
2149
2150
|
ref: a,
|
|
2150
2151
|
className: ["seed-fm-dialog", e].filter(Boolean).join(" "),
|
|
2151
2152
|
"aria-labelledby": "seed-fm-delete-title",
|
|
@@ -2155,7 +2156,7 @@ function lr({ className: e, onCancel: t, onSubmit: n, children: r }) {
|
|
|
2155
2156
|
onClick: (e) => {
|
|
2156
2157
|
e.target === e.currentTarget && t();
|
|
2157
2158
|
},
|
|
2158
|
-
children: /* @__PURE__ */
|
|
2159
|
+
children: /* @__PURE__ */ U("form", {
|
|
2159
2160
|
method: "dialog",
|
|
2160
2161
|
onSubmit: (e) => {
|
|
2161
2162
|
e.preventDefault(), n();
|
|
@@ -2166,30 +2167,30 @@ function lr({ className: e, onCancel: t, onSubmit: n, children: r }) {
|
|
|
2166
2167
|
}
|
|
2167
2168
|
function ur({ entries: e, rootPath: t, warning: n, deleteActionFor: r, onCancel: i, onConfirm: a, className: o }) {
|
|
2168
2169
|
let [s, l] = c(!0), u = e.flatMap((e) => e.variants), d = u.reduce((e, t) => e + t.file.size, 0), f = e.length + (s ? u.length : 0), p = t ? `${t}/` : "", m = r(s), h = m.label ? `${m.label}?` : e.length === 1 ? `Delete ${or(e[0].file.name, 32)}?` : `Delete ${e.length} files?`;
|
|
2169
|
-
return /* @__PURE__ */
|
|
2170
|
+
return /* @__PURE__ */ W(lr, {
|
|
2170
2171
|
className: o,
|
|
2171
2172
|
onCancel: i,
|
|
2172
2173
|
onSubmit: () => a(s),
|
|
2173
2174
|
children: [
|
|
2174
|
-
/* @__PURE__ */
|
|
2175
|
+
/* @__PURE__ */ U("h3", {
|
|
2175
2176
|
id: "seed-fm-delete-title",
|
|
2176
2177
|
children: h
|
|
2177
2178
|
}),
|
|
2178
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ W("p", { children: [
|
|
2179
2180
|
"This removes ",
|
|
2180
2181
|
e.length === 1 ? "it" : "them",
|
|
2181
2182
|
" from this browser’s private storage. Copies on Arweave or other devices aren’t affected. You can’t undo this."
|
|
2182
2183
|
] }),
|
|
2183
|
-
/* @__PURE__ */
|
|
2184
|
+
/* @__PURE__ */ W("ul", { children: [e.slice(0, cr).map((e) => /* @__PURE__ */ W("li", { children: [/* @__PURE__ */ U("code", {
|
|
2184
2185
|
title: e.file.path,
|
|
2185
2186
|
children: e.file.path.startsWith(p) ? e.file.path.slice(p.length) : e.file.path
|
|
2186
|
-
}), /* @__PURE__ */
|
|
2187
|
+
}), /* @__PURE__ */ U("span", { children: Q(e.file.size) })] }, e.file.path)), e.length > cr && /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W("span", { children: [
|
|
2187
2188
|
"and ",
|
|
2188
2189
|
e.length - cr,
|
|
2189
2190
|
" more"
|
|
2190
2191
|
] }) })] }),
|
|
2191
|
-
u.length > 0 && /* @__PURE__ */
|
|
2192
|
-
/* @__PURE__ */
|
|
2192
|
+
u.length > 0 && /* @__PURE__ */ W("label", { children: [
|
|
2193
|
+
/* @__PURE__ */ U("input", {
|
|
2193
2194
|
type: "checkbox",
|
|
2194
2195
|
className: "seed-fm-checkbox",
|
|
2195
2196
|
checked: s,
|
|
@@ -2203,23 +2204,23 @@ function ur({ entries: e, rootPath: t, warning: n, deleteActionFor: r, onCancel:
|
|
|
2203
2204
|
Q(d),
|
|
2204
2205
|
")"
|
|
2205
2206
|
] }),
|
|
2206
|
-
n && /* @__PURE__ */
|
|
2207
|
+
n && /* @__PURE__ */ W("div", {
|
|
2207
2208
|
className: "seed-fm-warning",
|
|
2208
2209
|
role: "alert",
|
|
2209
|
-
children: [/* @__PURE__ */
|
|
2210
|
+
children: [/* @__PURE__ */ U($, {
|
|
2210
2211
|
name: "triangleAlert",
|
|
2211
2212
|
size: 16
|
|
2212
|
-
}), /* @__PURE__ */
|
|
2213
|
+
}), /* @__PURE__ */ U("span", { children: n })]
|
|
2213
2214
|
}),
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ W("div", {
|
|
2215
2216
|
className: "seed-fm-dialog-actions",
|
|
2216
|
-
children: [/* @__PURE__ */
|
|
2217
|
+
children: [/* @__PURE__ */ U("button", {
|
|
2217
2218
|
type: "button",
|
|
2218
2219
|
className: "seed-fm-btn",
|
|
2219
2220
|
onClick: i,
|
|
2220
2221
|
"data-initial-focus": !0,
|
|
2221
2222
|
children: "Cancel"
|
|
2222
|
-
}), /* @__PURE__ */
|
|
2223
|
+
}), /* @__PURE__ */ U("button", {
|
|
2223
2224
|
type: "submit",
|
|
2224
2225
|
className: `seed-fm-btn ${m.destructive ? "seed-fm-btn--danger" : "seed-fm-btn--primary"}`,
|
|
2225
2226
|
children: m.label ?? `Delete ${f} ${f === 1 ? "file" : "files"}`
|
|
@@ -2230,16 +2231,16 @@ function ur({ entries: e, rootPath: t, warning: n, deleteActionFor: r, onCancel:
|
|
|
2230
2231
|
}
|
|
2231
2232
|
function dr({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy: a, onDownload: o, onCancel: s, onConfirm: l, className: u }) {
|
|
2232
2233
|
let [d, f] = c(!1), p = t.reduce((e, t) => e + t.size, 0), m = `${e.path}/`, h = `${t.length} ${t.length === 1 ? "file" : "files"}`, g = t.length - e.fileCount;
|
|
2233
|
-
return /* @__PURE__ */
|
|
2234
|
+
return /* @__PURE__ */ W(lr, {
|
|
2234
2235
|
className: u,
|
|
2235
2236
|
onCancel: s,
|
|
2236
2237
|
onSubmit: l,
|
|
2237
2238
|
children: [
|
|
2238
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ U("h3", {
|
|
2239
2240
|
id: "seed-fm-delete-title",
|
|
2240
2241
|
children: i.label ? `${i.label}?` : `Delete the “${or(e.name, 32)}” folder?`
|
|
2241
2242
|
}),
|
|
2242
|
-
/* @__PURE__ */
|
|
2243
|
+
/* @__PURE__ */ W("p", { children: [
|
|
2243
2244
|
"This removes the folder and the ",
|
|
2244
2245
|
h,
|
|
2245
2246
|
" in it (",
|
|
@@ -2247,24 +2248,24 @@ function dr({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy:
|
|
|
2247
2248
|
g > 0 && `, including ${g} resized ${g === 1 ? "copy" : "copies"}`,
|
|
2248
2249
|
") from this browser’s private storage. Copies on Arweave or other devices aren’t affected."
|
|
2249
2250
|
] }),
|
|
2250
|
-
/* @__PURE__ */
|
|
2251
|
+
/* @__PURE__ */ W("div", {
|
|
2251
2252
|
className: "seed-fm-irreversible",
|
|
2252
|
-
children: [/* @__PURE__ */
|
|
2253
|
+
children: [/* @__PURE__ */ U($, {
|
|
2253
2254
|
name: "triangleAlert",
|
|
2254
2255
|
size: 16
|
|
2255
|
-
}), /* @__PURE__ */
|
|
2256
|
+
}), /* @__PURE__ */ W("span", { children: [/* @__PURE__ */ U("strong", { children: "This can’t be undone." }), " Once deleted, these files can’t be recovered from this browser."] })]
|
|
2256
2257
|
}),
|
|
2257
|
-
/* @__PURE__ */
|
|
2258
|
+
/* @__PURE__ */ W("ul", { children: [t.slice(0, cr).map((e) => /* @__PURE__ */ W("li", { children: [/* @__PURE__ */ U("code", {
|
|
2258
2259
|
title: e.path,
|
|
2259
2260
|
children: e.path.slice(m.length)
|
|
2260
|
-
}), /* @__PURE__ */
|
|
2261
|
+
}), /* @__PURE__ */ U("span", { children: Q(e.size) })] }, e.path)), t.length > cr && /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W("span", { children: [
|
|
2261
2262
|
"and ",
|
|
2262
2263
|
t.length - cr,
|
|
2263
2264
|
" more"
|
|
2264
2265
|
] }) })] }),
|
|
2265
|
-
/* @__PURE__ */
|
|
2266
|
+
/* @__PURE__ */ W("div", {
|
|
2266
2267
|
className: "seed-fm-keepcopy",
|
|
2267
|
-
children: [/* @__PURE__ */
|
|
2268
|
+
children: [/* @__PURE__ */ U("span", { children: d ? "Saved a copy to your computer." : "Want a copy first? Save the folder to your computer." }), /* @__PURE__ */ W("button", {
|
|
2268
2269
|
type: "button",
|
|
2269
2270
|
className: "seed-fm-btn",
|
|
2270
2271
|
disabled: a,
|
|
@@ -2272,7 +2273,7 @@ function dr({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy:
|
|
|
2272
2273
|
await o() && f(!0);
|
|
2273
2274
|
},
|
|
2274
2275
|
children: [
|
|
2275
|
-
/* @__PURE__ */
|
|
2276
|
+
/* @__PURE__ */ U($, {
|
|
2276
2277
|
name: d ? "check" : "download",
|
|
2277
2278
|
size: 15
|
|
2278
2279
|
}),
|
|
@@ -2281,7 +2282,7 @@ function dr({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy:
|
|
|
2281
2282
|
]
|
|
2282
2283
|
})]
|
|
2283
2284
|
}),
|
|
2284
|
-
n > 0 && /* @__PURE__ */
|
|
2285
|
+
n > 0 && /* @__PURE__ */ W("p", { children: [
|
|
2285
2286
|
n,
|
|
2286
2287
|
" other ",
|
|
2287
2288
|
n === 1 ? "file" : "files",
|
|
@@ -2290,23 +2291,23 @@ function dr({ folder: e, files: t, hiddenCount: n, warning: r, action: i, busy:
|
|
|
2290
2291
|
" ",
|
|
2291
2292
|
"hidden here and won’t be deleted, so the folder itself will stay."
|
|
2292
2293
|
] }),
|
|
2293
|
-
r && /* @__PURE__ */
|
|
2294
|
+
r && /* @__PURE__ */ W("div", {
|
|
2294
2295
|
className: "seed-fm-warning",
|
|
2295
2296
|
role: "alert",
|
|
2296
|
-
children: [/* @__PURE__ */
|
|
2297
|
+
children: [/* @__PURE__ */ U($, {
|
|
2297
2298
|
name: "triangleAlert",
|
|
2298
2299
|
size: 16
|
|
2299
|
-
}), /* @__PURE__ */
|
|
2300
|
+
}), /* @__PURE__ */ U("span", { children: r })]
|
|
2300
2301
|
}),
|
|
2301
|
-
/* @__PURE__ */
|
|
2302
|
+
/* @__PURE__ */ W("div", {
|
|
2302
2303
|
className: "seed-fm-dialog-actions",
|
|
2303
|
-
children: [/* @__PURE__ */
|
|
2304
|
+
children: [/* @__PURE__ */ U("button", {
|
|
2304
2305
|
type: "button",
|
|
2305
2306
|
className: "seed-fm-btn",
|
|
2306
2307
|
onClick: s,
|
|
2307
2308
|
"data-initial-focus": !0,
|
|
2308
2309
|
children: "Cancel"
|
|
2309
|
-
}), /* @__PURE__ */
|
|
2310
|
+
}), /* @__PURE__ */ U("button", {
|
|
2310
2311
|
type: "submit",
|
|
2311
2312
|
disabled: a,
|
|
2312
2313
|
className: `seed-fm-btn ${i.destructive ? "seed-fm-btn--danger" : "seed-fm-btn--primary"}`,
|
|
@@ -2567,29 +2568,29 @@ function Kr({ entry: e, size: t, children: n }) {
|
|
|
2567
2568
|
l && Gr(e) ? "seed-fm-thumb--checker" : "",
|
|
2568
2569
|
r === "image" && o === "loading" ? "seed-fm-skeleton" : ""
|
|
2569
2570
|
].filter(Boolean).join(" "), d;
|
|
2570
|
-
return d = l ? /* @__PURE__ */
|
|
2571
|
+
return d = l ? /* @__PURE__ */ U("img", {
|
|
2571
2572
|
src: a,
|
|
2572
2573
|
alt: "",
|
|
2573
2574
|
decoding: "async",
|
|
2574
2575
|
draggable: !1,
|
|
2575
2576
|
onError: s
|
|
2576
|
-
}) : t === "mini" ? /* @__PURE__ */
|
|
2577
|
+
}) : t === "mini" ? /* @__PURE__ */ U($, {
|
|
2577
2578
|
name: c ? "imageOff" : Ur[r].icon,
|
|
2578
2579
|
size: 16
|
|
2579
|
-
}) : r === "image" && !c ? null : /* @__PURE__ */
|
|
2580
|
+
}) : r === "image" && !c ? null : /* @__PURE__ */ W("span", {
|
|
2580
2581
|
className: "seed-fm-kind",
|
|
2581
|
-
children: [/* @__PURE__ */
|
|
2582
|
+
children: [/* @__PURE__ */ U($, {
|
|
2582
2583
|
name: c ? "imageOff" : Ur[r].icon,
|
|
2583
2584
|
size: 28,
|
|
2584
2585
|
strokeWidth: 1.6
|
|
2585
|
-
}), c ? /* @__PURE__ */
|
|
2586
|
+
}), c ? /* @__PURE__ */ U("span", {
|
|
2586
2587
|
className: "seed-fm-kind-error",
|
|
2587
2588
|
children: "Can’t decode image"
|
|
2588
|
-
}) : /* @__PURE__ */
|
|
2589
|
+
}) : /* @__PURE__ */ U("span", {
|
|
2589
2590
|
className: "seed-fm-ext",
|
|
2590
2591
|
children: hr(e.file)
|
|
2591
2592
|
})]
|
|
2592
|
-
}), /* @__PURE__ */
|
|
2593
|
+
}), /* @__PURE__ */ W("span", {
|
|
2593
2594
|
ref: i,
|
|
2594
2595
|
className: u,
|
|
2595
2596
|
style: Wr(r),
|
|
@@ -2599,14 +2600,14 @@ function Kr({ entry: e, size: t, children: n }) {
|
|
|
2599
2600
|
//#endregion
|
|
2600
2601
|
//#region src/OPFSFilesManager/FileGrid.tsx
|
|
2601
2602
|
function qr({ entries: e, selected: t, onActivate: n, onToggle: r, className: i, tileClassName: a }) {
|
|
2602
|
-
return /* @__PURE__ */
|
|
2603
|
+
return /* @__PURE__ */ U("ul", {
|
|
2603
2604
|
className: ["seed-fm-grid", i].filter(Boolean).join(" "),
|
|
2604
2605
|
role: "listbox",
|
|
2605
2606
|
"aria-label": "Files",
|
|
2606
2607
|
"aria-multiselectable": "true",
|
|
2607
2608
|
children: e.map((e, i) => {
|
|
2608
2609
|
let { file: o, variants: s } = e, c = t.has(o.path);
|
|
2609
|
-
return /* @__PURE__ */
|
|
2610
|
+
return /* @__PURE__ */ W("li", {
|
|
2610
2611
|
role: "option",
|
|
2611
2612
|
tabIndex: 0,
|
|
2612
2613
|
"aria-selected": c,
|
|
@@ -2618,10 +2619,10 @@ function qr({ entries: e, selected: t, onActivate: n, onToggle: r, className: i,
|
|
|
2618
2619
|
onKeyDown: (t) => {
|
|
2619
2620
|
t.target === t.currentTarget && (t.key === "Enter" ? (t.preventDefault(), n(e, i, t)) : t.key === " " && (t.preventDefault(), r(e, i, t.shiftKey)));
|
|
2620
2621
|
},
|
|
2621
|
-
children: [/* @__PURE__ */
|
|
2622
|
+
children: [/* @__PURE__ */ W(Kr, {
|
|
2622
2623
|
entry: e,
|
|
2623
2624
|
size: "tile",
|
|
2624
|
-
children: [/* @__PURE__ */
|
|
2625
|
+
children: [/* @__PURE__ */ U("button", {
|
|
2625
2626
|
type: "button",
|
|
2626
2627
|
className: "seed-fm-check",
|
|
2627
2628
|
tabIndex: -1,
|
|
@@ -2629,16 +2630,16 @@ function qr({ entries: e, selected: t, onActivate: n, onToggle: r, className: i,
|
|
|
2629
2630
|
onClick: (t) => {
|
|
2630
2631
|
t.stopPropagation(), r(e, i, t.shiftKey);
|
|
2631
2632
|
},
|
|
2632
|
-
children: c && /* @__PURE__ */
|
|
2633
|
+
children: c && /* @__PURE__ */ U($, {
|
|
2633
2634
|
name: "check",
|
|
2634
2635
|
size: 14,
|
|
2635
2636
|
strokeWidth: 3
|
|
2636
2637
|
})
|
|
2637
|
-
}), s.length > 0 && /* @__PURE__ */
|
|
2638
|
+
}), s.length > 0 && /* @__PURE__ */ W("span", {
|
|
2638
2639
|
className: "seed-fm-badge",
|
|
2639
2640
|
title: "Resized copies are grouped with this image",
|
|
2640
2641
|
children: [
|
|
2641
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ U($, {
|
|
2642
2643
|
name: "layers",
|
|
2643
2644
|
size: 11,
|
|
2644
2645
|
strokeWidth: 2.2
|
|
@@ -2648,18 +2649,18 @@ function qr({ entries: e, selected: t, onActivate: n, onToggle: r, className: i,
|
|
|
2648
2649
|
s.length === 1 ? "size" : "sizes"
|
|
2649
2650
|
]
|
|
2650
2651
|
})]
|
|
2651
|
-
}), /* @__PURE__ */
|
|
2652
|
+
}), /* @__PURE__ */ W("span", {
|
|
2652
2653
|
className: "seed-fm-tile-meta",
|
|
2653
|
-
children: [/* @__PURE__ */
|
|
2654
|
+
children: [/* @__PURE__ */ U("span", {
|
|
2654
2655
|
className: "seed-fm-tile-name",
|
|
2655
2656
|
children: or(o.name, 24)
|
|
2656
|
-
}), /* @__PURE__ */
|
|
2657
|
+
}), /* @__PURE__ */ W("span", {
|
|
2657
2658
|
className: "seed-fm-tile-sub",
|
|
2658
2659
|
children: [
|
|
2659
2660
|
Q(o.size),
|
|
2660
2661
|
" ·",
|
|
2661
2662
|
" ",
|
|
2662
|
-
/* @__PURE__ */
|
|
2663
|
+
/* @__PURE__ */ U("time", {
|
|
2663
2664
|
dateTime: new Date(o.lastModified).toISOString(),
|
|
2664
2665
|
title: ar(o.lastModified),
|
|
2665
2666
|
children: ir(o.lastModified)
|
|
@@ -2679,14 +2680,14 @@ function Jr({ entries: e, selected: t, cwd: n, onActivate: r, onToggle: a, onTog
|
|
|
2679
2680
|
p.current && (p.current.indeterminate = m > 0 && !h);
|
|
2680
2681
|
}, [m, h]);
|
|
2681
2682
|
let g = n ? `${n}/` : "";
|
|
2682
|
-
return /* @__PURE__ */
|
|
2683
|
+
return /* @__PURE__ */ U("div", {
|
|
2683
2684
|
className: "seed-fm-list-wrap",
|
|
2684
|
-
children: /* @__PURE__ */
|
|
2685
|
+
children: /* @__PURE__ */ W("table", {
|
|
2685
2686
|
className: ["seed-fm-list", d].filter(Boolean).join(" "),
|
|
2686
|
-
children: [/* @__PURE__ */
|
|
2687
|
-
/* @__PURE__ */
|
|
2687
|
+
children: [/* @__PURE__ */ U("thead", { children: /* @__PURE__ */ W("tr", { children: [
|
|
2688
|
+
/* @__PURE__ */ U("th", {
|
|
2688
2689
|
style: { width: 28 },
|
|
2689
|
-
children: /* @__PURE__ */
|
|
2690
|
+
children: /* @__PURE__ */ U("input", {
|
|
2690
2691
|
ref: p,
|
|
2691
2692
|
type: "checkbox",
|
|
2692
2693
|
className: "seed-fm-checkbox",
|
|
@@ -2695,34 +2696,34 @@ function Jr({ entries: e, selected: t, cwd: n, onActivate: r, onToggle: a, onTog
|
|
|
2695
2696
|
"aria-label": "Select all"
|
|
2696
2697
|
})
|
|
2697
2698
|
}),
|
|
2698
|
-
/* @__PURE__ */
|
|
2699
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ U("th", { children: "Name" }),
|
|
2700
|
+
/* @__PURE__ */ U("th", {
|
|
2700
2701
|
className: "seed-fm-col-type",
|
|
2701
2702
|
children: "Type"
|
|
2702
2703
|
}),
|
|
2703
|
-
/* @__PURE__ */
|
|
2704
|
+
/* @__PURE__ */ U("th", {
|
|
2704
2705
|
className: "seed-fm-num seed-fm-col-size",
|
|
2705
2706
|
children: "Size"
|
|
2706
2707
|
}),
|
|
2707
|
-
/* @__PURE__ */
|
|
2708
|
+
/* @__PURE__ */ U("th", {
|
|
2708
2709
|
className: "seed-fm-col-modified",
|
|
2709
2710
|
children: "Modified"
|
|
2710
2711
|
}),
|
|
2711
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ U("th", { children: /* @__PURE__ */ U("span", {
|
|
2712
2713
|
className: "seed-fm-visually-hidden",
|
|
2713
2714
|
children: "Actions"
|
|
2714
2715
|
}) })
|
|
2715
|
-
] }) }), /* @__PURE__ */
|
|
2716
|
+
] }) }), /* @__PURE__ */ U("tbody", { children: e.map((e, n) => {
|
|
2716
2717
|
let { file: i } = e, o = t.has(i.path), s = u(e);
|
|
2717
|
-
return /* @__PURE__ */
|
|
2718
|
+
return /* @__PURE__ */ W("tr", {
|
|
2718
2719
|
"data-path": i.path,
|
|
2719
2720
|
"aria-selected": o,
|
|
2720
2721
|
className: ["seed-fm-row", f].filter(Boolean).join(" "),
|
|
2721
2722
|
onClick: (t) => r(e, n, t),
|
|
2722
2723
|
children: [
|
|
2723
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ U("td", {
|
|
2724
2725
|
onClick: (e) => e.stopPropagation(),
|
|
2725
|
-
children: /* @__PURE__ */
|
|
2726
|
+
children: /* @__PURE__ */ U("input", {
|
|
2726
2727
|
type: "checkbox",
|
|
2727
2728
|
className: "seed-fm-checkbox",
|
|
2728
2729
|
checked: o,
|
|
@@ -2731,61 +2732,61 @@ function Jr({ entries: e, selected: t, cwd: n, onActivate: r, onToggle: a, onTog
|
|
|
2731
2732
|
"aria-label": `Select ${i.name}`
|
|
2732
2733
|
})
|
|
2733
2734
|
}),
|
|
2734
|
-
/* @__PURE__ */
|
|
2735
|
+
/* @__PURE__ */ U("td", { children: /* @__PURE__ */ W("span", {
|
|
2735
2736
|
className: "seed-fm-namecell",
|
|
2736
|
-
children: [/* @__PURE__ */
|
|
2737
|
+
children: [/* @__PURE__ */ U(Kr, {
|
|
2737
2738
|
entry: e,
|
|
2738
2739
|
size: "mini"
|
|
2739
|
-
}), /* @__PURE__ */
|
|
2740
|
+
}), /* @__PURE__ */ W("span", { children: [/* @__PURE__ */ U("button", {
|
|
2740
2741
|
type: "button",
|
|
2741
2742
|
className: "seed-fm-row-name seed-fm-row-open",
|
|
2742
2743
|
onClick: (t) => {
|
|
2743
2744
|
t.stopPropagation(), r(e, n, t);
|
|
2744
2745
|
},
|
|
2745
2746
|
children: i.name
|
|
2746
|
-
}), i.path.slice(g.length) !== i.name && /* @__PURE__ */
|
|
2747
|
+
}), i.path.slice(g.length) !== i.name && /* @__PURE__ */ U("span", {
|
|
2747
2748
|
className: "seed-fm-row-path",
|
|
2748
2749
|
children: i.path.slice(g.length)
|
|
2749
2750
|
})] })]
|
|
2750
2751
|
}) }),
|
|
2751
|
-
/* @__PURE__ */
|
|
2752
|
+
/* @__PURE__ */ U("td", {
|
|
2752
2753
|
className: "seed-fm-col-type",
|
|
2753
|
-
children: /* @__PURE__ */
|
|
2754
|
+
children: /* @__PURE__ */ W("span", {
|
|
2754
2755
|
className: "seed-fm-type",
|
|
2755
2756
|
style: Wr(mr(i)),
|
|
2756
|
-
children: [fr(i), i.detectedType && /* @__PURE__ */
|
|
2757
|
+
children: [fr(i), i.detectedType && /* @__PURE__ */ U("small", { children: "detected" })]
|
|
2757
2758
|
})
|
|
2758
2759
|
}),
|
|
2759
|
-
/* @__PURE__ */
|
|
2760
|
+
/* @__PURE__ */ U("td", {
|
|
2760
2761
|
className: "seed-fm-num seed-fm-col-size",
|
|
2761
2762
|
title: `${i.size.toLocaleString()} bytes`,
|
|
2762
2763
|
children: Q(e.totalSize)
|
|
2763
2764
|
}),
|
|
2764
|
-
/* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ U("td", {
|
|
2765
2766
|
className: "seed-fm-when seed-fm-col-modified",
|
|
2766
2767
|
title: ar(i.lastModified),
|
|
2767
2768
|
children: ir(i.lastModified)
|
|
2768
2769
|
}),
|
|
2769
|
-
/* @__PURE__ */
|
|
2770
|
+
/* @__PURE__ */ W("td", {
|
|
2770
2771
|
className: "seed-fm-actions",
|
|
2771
2772
|
onClick: (e) => e.stopPropagation(),
|
|
2772
|
-
children: [/* @__PURE__ */
|
|
2773
|
+
children: [/* @__PURE__ */ U("button", {
|
|
2773
2774
|
type: "button",
|
|
2774
2775
|
className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
|
|
2775
2776
|
"aria-label": `Download ${i.name}`,
|
|
2776
2777
|
title: "Download",
|
|
2777
2778
|
onClick: () => c(e),
|
|
2778
|
-
children: /* @__PURE__ */
|
|
2779
|
+
children: /* @__PURE__ */ U($, {
|
|
2779
2780
|
name: "download",
|
|
2780
2781
|
size: 15
|
|
2781
2782
|
})
|
|
2782
|
-
}), /* @__PURE__ */
|
|
2783
|
+
}), /* @__PURE__ */ U("button", {
|
|
2783
2784
|
type: "button",
|
|
2784
2785
|
className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
|
|
2785
2786
|
"aria-label": s.label ? `${s.label}: ${i.name}` : `Delete ${i.name}`,
|
|
2786
2787
|
title: s.label ?? "Delete",
|
|
2787
2788
|
onClick: () => l(e),
|
|
2788
|
-
children: /* @__PURE__ */
|
|
2789
|
+
children: /* @__PURE__ */ U($, {
|
|
2789
2790
|
name: "trash",
|
|
2790
2791
|
size: 15
|
|
2791
2792
|
})
|
|
@@ -2856,7 +2857,7 @@ function Qr({ entry: e, onClose: t, onPrevious: n, onNext: r, onDownload: a, onD
|
|
|
2856
2857
|
b.current?.focus();
|
|
2857
2858
|
}, []);
|
|
2858
2859
|
let x = `seed-fm-panel-${encodeURIComponent(f.path)}`, S = p.reduce((e, t) => e + t.file.size, 0), C;
|
|
2859
|
-
if (h.kind === "image" && !v) C = /* @__PURE__ */
|
|
2860
|
+
if (h.kind === "image" && !v) C = /* @__PURE__ */ U("img", {
|
|
2860
2861
|
src: h.url,
|
|
2861
2862
|
alt: `Preview of ${f.name}`,
|
|
2862
2863
|
onLoad: (e) => _({
|
|
@@ -2865,13 +2866,13 @@ function Qr({ entry: e, onClose: t, onPrevious: n, onNext: r, onDownload: a, onD
|
|
|
2865
2866
|
}),
|
|
2866
2867
|
onError: () => y(!0)
|
|
2867
2868
|
});
|
|
2868
|
-
else if (h.kind === "text") C = /* @__PURE__ */
|
|
2869
|
+
else if (h.kind === "text") C = /* @__PURE__ */ W("pre", { children: [h.text, h.truncated && "\n…"] });
|
|
2869
2870
|
else if (h.kind === "loading") C = null;
|
|
2870
2871
|
else {
|
|
2871
2872
|
let e = h.kind === "none" ? h.message : "The browser can’t decode this image. The file may be corrupt or not an image.";
|
|
2872
|
-
C = /* @__PURE__ */
|
|
2873
|
+
C = /* @__PURE__ */ W("span", {
|
|
2873
2874
|
className: "seed-fm-preview-note",
|
|
2874
|
-
children: [/* @__PURE__ */
|
|
2875
|
+
children: [/* @__PURE__ */ U($, {
|
|
2875
2876
|
name: v ? "imageOff" : Ur[m].icon,
|
|
2876
2877
|
size: 32,
|
|
2877
2878
|
strokeWidth: 1.5
|
|
@@ -2879,50 +2880,50 @@ function Qr({ entry: e, onClose: t, onPrevious: n, onNext: r, onDownload: a, onD
|
|
|
2879
2880
|
});
|
|
2880
2881
|
}
|
|
2881
2882
|
let w = h.kind === "image" && !v && /png|webp|gif|avif|svg/.test(fr(f));
|
|
2882
|
-
return /* @__PURE__ */
|
|
2883
|
+
return /* @__PURE__ */ W("aside", {
|
|
2883
2884
|
className: ["seed-fm-panel", d].filter(Boolean).join(" "),
|
|
2884
2885
|
role: "dialog",
|
|
2885
2886
|
"aria-modal": "false",
|
|
2886
2887
|
"aria-labelledby": x,
|
|
2887
2888
|
children: [
|
|
2888
|
-
/* @__PURE__ */
|
|
2889
|
+
/* @__PURE__ */ W("div", {
|
|
2889
2890
|
className: "seed-fm-panel-head",
|
|
2890
2891
|
children: [
|
|
2891
|
-
/* @__PURE__ */
|
|
2892
|
+
/* @__PURE__ */ U("h3", {
|
|
2892
2893
|
id: x,
|
|
2893
2894
|
title: f.name,
|
|
2894
2895
|
children: f.name
|
|
2895
2896
|
}),
|
|
2896
|
-
/* @__PURE__ */
|
|
2897
|
+
/* @__PURE__ */ U("button", {
|
|
2897
2898
|
type: "button",
|
|
2898
2899
|
className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
|
|
2899
2900
|
"aria-label": "Previous file",
|
|
2900
2901
|
disabled: !n,
|
|
2901
2902
|
onClick: n ?? void 0,
|
|
2902
|
-
children: /* @__PURE__ */
|
|
2903
|
+
children: /* @__PURE__ */ U($, { name: "chevronLeft" })
|
|
2903
2904
|
}),
|
|
2904
|
-
/* @__PURE__ */
|
|
2905
|
+
/* @__PURE__ */ U("button", {
|
|
2905
2906
|
type: "button",
|
|
2906
2907
|
className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
|
|
2907
2908
|
"aria-label": "Next file",
|
|
2908
2909
|
disabled: !r,
|
|
2909
2910
|
onClick: r ?? void 0,
|
|
2910
|
-
children: /* @__PURE__ */
|
|
2911
|
+
children: /* @__PURE__ */ U($, { name: "chevronRight" })
|
|
2911
2912
|
}),
|
|
2912
|
-
/* @__PURE__ */
|
|
2913
|
+
/* @__PURE__ */ U("button", {
|
|
2913
2914
|
ref: b,
|
|
2914
2915
|
type: "button",
|
|
2915
2916
|
className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
|
|
2916
2917
|
"aria-label": "Close details",
|
|
2917
2918
|
onClick: t,
|
|
2918
|
-
children: /* @__PURE__ */
|
|
2919
|
+
children: /* @__PURE__ */ U($, { name: "x" })
|
|
2919
2920
|
})
|
|
2920
2921
|
]
|
|
2921
2922
|
}),
|
|
2922
|
-
/* @__PURE__ */
|
|
2923
|
+
/* @__PURE__ */ W("div", {
|
|
2923
2924
|
className: "seed-fm-panel-body",
|
|
2924
2925
|
children: [
|
|
2925
|
-
/* @__PURE__ */
|
|
2926
|
+
/* @__PURE__ */ U("div", {
|
|
2926
2927
|
className: [
|
|
2927
2928
|
"seed-fm-preview",
|
|
2928
2929
|
w ? "seed-fm-thumb--checker" : "",
|
|
@@ -2931,78 +2932,78 @@ function Qr({ entry: e, onClose: t, onPrevious: n, onNext: r, onDownload: a, onD
|
|
|
2931
2932
|
style: Wr(m),
|
|
2932
2933
|
children: C
|
|
2933
2934
|
}),
|
|
2934
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ W("dl", {
|
|
2935
2936
|
className: "seed-fm-details",
|
|
2936
2937
|
children: [
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
/* @__PURE__ */
|
|
2938
|
+
/* @__PURE__ */ U("dt", { children: "Path" }),
|
|
2939
|
+
/* @__PURE__ */ U("dd", { children: /* @__PURE__ */ W("span", {
|
|
2939
2940
|
className: "seed-fm-path",
|
|
2940
|
-
children: [/* @__PURE__ */
|
|
2941
|
+
children: [/* @__PURE__ */ U("code", { children: f.path }), /* @__PURE__ */ U("button", {
|
|
2941
2942
|
type: "button",
|
|
2942
2943
|
className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon",
|
|
2943
2944
|
"aria-label": "Copy path",
|
|
2944
2945
|
title: "Copy path",
|
|
2945
2946
|
onClick: u,
|
|
2946
|
-
children: /* @__PURE__ */
|
|
2947
|
+
children: /* @__PURE__ */ U($, {
|
|
2947
2948
|
name: "copy",
|
|
2948
2949
|
size: 13
|
|
2949
2950
|
})
|
|
2950
2951
|
})]
|
|
2951
2952
|
}) }),
|
|
2952
|
-
/* @__PURE__ */
|
|
2953
|
-
/* @__PURE__ */
|
|
2953
|
+
/* @__PURE__ */ U("dt", { children: "Size" }),
|
|
2954
|
+
/* @__PURE__ */ W("dd", { children: [
|
|
2954
2955
|
Q(f.size),
|
|
2955
2956
|
" ",
|
|
2956
|
-
/* @__PURE__ */
|
|
2957
|
+
/* @__PURE__ */ W("small", { children: [f.size.toLocaleString(), " bytes"] })
|
|
2957
2958
|
] }),
|
|
2958
|
-
/* @__PURE__ */
|
|
2959
|
-
/* @__PURE__ */
|
|
2959
|
+
/* @__PURE__ */ U("dt", { children: "Type" }),
|
|
2960
|
+
/* @__PURE__ */ W("dd", { children: [fr(f), f.detectedType && /* @__PURE__ */ W("small", { children: [
|
|
2960
2961
|
" from file contents. File.type is “",
|
|
2961
2962
|
f.type,
|
|
2962
2963
|
"”"
|
|
2963
2964
|
] })] }),
|
|
2964
|
-
g && /* @__PURE__ */
|
|
2965
|
+
g && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("dt", { children: "Dimensions" }), /* @__PURE__ */ W("dd", { children: [
|
|
2965
2966
|
g.width.toLocaleString(),
|
|
2966
2967
|
" × ",
|
|
2967
2968
|
g.height.toLocaleString(),
|
|
2968
2969
|
" px"
|
|
2969
2970
|
] })] }),
|
|
2970
|
-
/* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
2971
|
+
/* @__PURE__ */ U("dt", { children: "Modified" }),
|
|
2972
|
+
/* @__PURE__ */ W("dd", { children: [
|
|
2972
2973
|
ar(f.lastModified),
|
|
2973
2974
|
" ",
|
|
2974
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ U("small", { children: ir(f.lastModified) })
|
|
2975
2976
|
] })
|
|
2976
2977
|
]
|
|
2977
2978
|
}),
|
|
2978
|
-
p.length > 0 && /* @__PURE__ */
|
|
2979
|
+
p.length > 0 && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ W("div", {
|
|
2979
2980
|
className: "seed-fm-section-label",
|
|
2980
2981
|
children: ["Resized copies · ", Q(S)]
|
|
2981
|
-
}), /* @__PURE__ */
|
|
2982
|
+
}), /* @__PURE__ */ U("ul", {
|
|
2982
2983
|
className: "seed-fm-variants",
|
|
2983
|
-
children: p.map((e) => /* @__PURE__ */
|
|
2984
|
+
children: p.map((e) => /* @__PURE__ */ W("li", {
|
|
2984
2985
|
title: e.file.path,
|
|
2985
|
-
children: [/* @__PURE__ */
|
|
2986
|
+
children: [/* @__PURE__ */ W("span", { children: [e.width, "w · webp"] }), /* @__PURE__ */ U("span", { children: Q(e.file.size) })]
|
|
2986
2987
|
}, e.file.path))
|
|
2987
2988
|
})] })
|
|
2988
2989
|
]
|
|
2989
2990
|
}),
|
|
2990
|
-
/* @__PURE__ */
|
|
2991
|
+
/* @__PURE__ */ W("div", {
|
|
2991
2992
|
className: "seed-fm-panel-foot",
|
|
2992
|
-
children: [/* @__PURE__ */
|
|
2993
|
+
children: [/* @__PURE__ */ W("button", {
|
|
2993
2994
|
type: "button",
|
|
2994
2995
|
className: "seed-fm-btn seed-fm-btn--primary",
|
|
2995
2996
|
onClick: a,
|
|
2996
|
-
children: [/* @__PURE__ */
|
|
2997
|
+
children: [/* @__PURE__ */ U($, {
|
|
2997
2998
|
name: "download",
|
|
2998
2999
|
size: 15
|
|
2999
3000
|
}), " Download"]
|
|
3000
|
-
}), /* @__PURE__ */
|
|
3001
|
+
}), /* @__PURE__ */ W("button", {
|
|
3001
3002
|
type: "button",
|
|
3002
3003
|
className: `seed-fm-btn${l.destructive ? " seed-fm-btn--danger-text" : ""}`,
|
|
3003
3004
|
onClick: o,
|
|
3004
3005
|
children: [
|
|
3005
|
-
/* @__PURE__ */
|
|
3006
|
+
/* @__PURE__ */ U($, {
|
|
3006
3007
|
name: "trash",
|
|
3007
3008
|
size: 15
|
|
3008
3009
|
}),
|
|
@@ -3349,27 +3350,27 @@ function xi({ files: e, estimate: t }) {
|
|
|
3349
3350
|
size: i,
|
|
3350
3351
|
color: "var(--seed-border-strong)"
|
|
3351
3352
|
}] : []];
|
|
3352
|
-
return /* @__PURE__ */
|
|
3353
|
+
return /* @__PURE__ */ W("div", {
|
|
3353
3354
|
className: "seed-fm-usage",
|
|
3354
3355
|
title: "From navigator.storage.estimate(). Browsers round these numbers.",
|
|
3355
|
-
children: [/* @__PURE__ */
|
|
3356
|
+
children: [/* @__PURE__ */ W("div", {
|
|
3356
3357
|
className: "seed-fm-usage-row",
|
|
3357
|
-
children: [/* @__PURE__ */
|
|
3358
|
-
/* @__PURE__ */
|
|
3358
|
+
children: [/* @__PURE__ */ W("span", { children: [
|
|
3359
|
+
/* @__PURE__ */ U("strong", { children: Q(t ? t.usage : r) }),
|
|
3359
3360
|
" ",
|
|
3360
3361
|
t ? "used by this site" : `in ${gi(e.length, "file")}`
|
|
3361
|
-
] }), t && /* @__PURE__ */
|
|
3362
|
-
}), a > 0 && /* @__PURE__ */
|
|
3362
|
+
] }), t && /* @__PURE__ */ W("span", { children: [Q(t.quota), " available"] })]
|
|
3363
|
+
}), a > 0 && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
3363
3364
|
className: "seed-fm-meter",
|
|
3364
3365
|
role: "img",
|
|
3365
3366
|
"aria-label": "Storage used, by file type",
|
|
3366
|
-
children: o.map((e) => /* @__PURE__ */
|
|
3367
|
+
children: o.map((e) => /* @__PURE__ */ U("span", { style: {
|
|
3367
3368
|
width: `${e.size / a * 100}%`,
|
|
3368
3369
|
background: e.color
|
|
3369
3370
|
} }, e.label))
|
|
3370
|
-
}), /* @__PURE__ */
|
|
3371
|
+
}), /* @__PURE__ */ U("ul", {
|
|
3371
3372
|
className: "seed-fm-legend",
|
|
3372
|
-
children: o.map((e) => /* @__PURE__ */
|
|
3373
|
+
children: o.map((e) => /* @__PURE__ */ W("li", {
|
|
3373
3374
|
style: { "--seed-swatch": e.color },
|
|
3374
3375
|
children: [
|
|
3375
3376
|
e.label,
|
|
@@ -3381,19 +3382,19 @@ function xi({ files: e, estimate: t }) {
|
|
|
3381
3382
|
});
|
|
3382
3383
|
}
|
|
3383
3384
|
function Si({ icon: e, title: t, children: n, tone: r, action: i }) {
|
|
3384
|
-
return /* @__PURE__ */
|
|
3385
|
+
return /* @__PURE__ */ W("div", {
|
|
3385
3386
|
className: `seed-fm-state${r === "error" ? " seed-fm-state--error" : ""}`,
|
|
3386
3387
|
role: r === "error" ? "alert" : void 0,
|
|
3387
3388
|
children: [
|
|
3388
|
-
/* @__PURE__ */
|
|
3389
|
+
/* @__PURE__ */ U("span", {
|
|
3389
3390
|
className: "seed-fm-state-icon",
|
|
3390
|
-
children: /* @__PURE__ */
|
|
3391
|
+
children: /* @__PURE__ */ U($, {
|
|
3391
3392
|
name: e,
|
|
3392
3393
|
size: 22
|
|
3393
3394
|
})
|
|
3394
3395
|
}),
|
|
3395
|
-
/* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
3396
|
+
/* @__PURE__ */ U("h3", { children: t }),
|
|
3397
|
+
/* @__PURE__ */ U("p", { children: n }),
|
|
3397
3398
|
i
|
|
3398
3399
|
]
|
|
3399
3400
|
});
|
|
@@ -3402,58 +3403,58 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3402
3403
|
a(() => {
|
|
3403
3404
|
p !== "none" && ii();
|
|
3404
3405
|
}, [p]);
|
|
3405
|
-
let S = _i(e), C = S ? S.split("/").pop() : "OPFS", w = (e, t) => [t, h[e]].filter(Boolean).join(" "), { files: T, isLoading: E, hasLoaded: D, error: O, errorName: ee, refetch:
|
|
3406
|
-
i(() =>
|
|
3407
|
-
let
|
|
3408
|
-
i(() =>
|
|
3409
|
-
let [
|
|
3410
|
-
x ? x(e, t, n) :
|
|
3411
|
-
},
|
|
3412
|
-
query:
|
|
3413
|
-
sort:
|
|
3406
|
+
let S = _i(e), C = S ? S.split("/").pop() : "OPFS", w = (e, t) => [t, h[e]].filter(Boolean).join(" "), { files: T, isLoading: E, hasLoaded: D, error: O, errorName: ee, refetch: te } = $n({ rootPath: e }), k = o(() => t ? T.filter(t) : T, [T, t]), ne = ai(T), [A, j] = c(_);
|
|
3407
|
+
i(() => j(_), [_]);
|
|
3408
|
+
let M = o(() => Sr(k, A), [k, A]), [re, ie] = c(S);
|
|
3409
|
+
i(() => ie(S), [S]);
|
|
3410
|
+
let [N, ae] = c(""), [oe, se] = c("name"), [P, ce] = c(g), [F, I] = c(() => /* @__PURE__ */ new Set()), le = s(null), [ue, de] = c(null), fe = s(null), [pe, L] = c(null), [R, me] = c(null), [he, z] = c(!1), { toasts: B, showToast: ge } = yi(), _e = (e, t, n) => {
|
|
3411
|
+
x ? x(e, t, n) : ge(e, t);
|
|
3412
|
+
}, ve = o(() => wr(M, re, {
|
|
3413
|
+
query: N,
|
|
3414
|
+
sort: oe
|
|
3414
3415
|
}), [
|
|
3416
|
+
M,
|
|
3417
|
+
re,
|
|
3415
3418
|
N,
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
ae
|
|
3419
|
-
]), H = _e.entries, ve = H.length ? H.filter((e) => mr(e.file) === "image").length / H.length : 0, ye = F ?? (ve >= .5 ? "grid" : "list"), be = o(() => new Map(N.map((e) => [e.file.path, e])), [N]), xe = o(() => [...I].map((e) => be.get(e)).filter((e) => !!e), [I, be]), K = le ? be.get(le) ?? null : null, Se = K ? H.indexOf(K) : -1;
|
|
3419
|
+
oe
|
|
3420
|
+
]), V = ve.entries, ye = V.length ? V.filter((e) => mr(e.file) === "image").length / V.length : 0, be = P ?? (ye >= .5 ? "grid" : "list"), xe = o(() => new Map(M.map((e) => [e.file.path, e])), [M]), Se = o(() => [...F].map((e) => xe.get(e)).filter((e) => !!e), [F, xe]), G = ue ? xe.get(ue) ?? null : null, K = G ? V.indexOf(G) : -1;
|
|
3420
3421
|
i(() => {
|
|
3421
|
-
|
|
3422
|
-
let t = new Set([...e].filter((e) =>
|
|
3422
|
+
I((e) => {
|
|
3423
|
+
let t = new Set([...e].filter((e) => xe.has(e)));
|
|
3423
3424
|
return t.size === e.size ? e : t;
|
|
3424
3425
|
});
|
|
3425
|
-
}, [
|
|
3426
|
+
}, [xe]);
|
|
3426
3427
|
let Ce = (e) => {
|
|
3427
|
-
|
|
3428
|
+
ie(e), ae(""), I(/* @__PURE__ */ new Set()), le.current = null, de(null);
|
|
3428
3429
|
}, we = (e, t, n) => {
|
|
3429
|
-
let r =
|
|
3430
|
-
|
|
3430
|
+
let r = le.current;
|
|
3431
|
+
I((i) => {
|
|
3431
3432
|
let a = new Set(i);
|
|
3432
3433
|
if (n && r != null) {
|
|
3433
3434
|
let [e, n] = r < t ? [r, t] : [t, r];
|
|
3434
|
-
for (let t of
|
|
3435
|
+
for (let t of V.slice(e, n + 1)) a.add(t.file.path);
|
|
3435
3436
|
} else a.has(e.file.path) ? a.delete(e.file.path) : a.add(e.file.path);
|
|
3436
3437
|
return a;
|
|
3437
|
-
}), (!n || r == null) && (
|
|
3438
|
+
}), (!n || r == null) && (le.current = t);
|
|
3438
3439
|
}, q = (e) => {
|
|
3439
|
-
|
|
3440
|
+
ue || (fe.current = document.activeElement), de(e);
|
|
3440
3441
|
}, Te = () => {
|
|
3441
|
-
|
|
3442
|
+
de(null), fe.current?.focus?.(), fe.current = null;
|
|
3442
3443
|
}, Ee = (e, t, n) => {
|
|
3443
3444
|
let r = n.shiftKey || n.metaKey || n.ctrlKey;
|
|
3444
|
-
|
|
3445
|
+
F.size > 0 || r ? we(e, t, n.shiftKey) : q(e.file.path);
|
|
3445
3446
|
}, De = () => {
|
|
3446
|
-
let e =
|
|
3447
|
-
|
|
3447
|
+
let e = V.every((e) => F.has(e.file.path));
|
|
3448
|
+
I((t) => {
|
|
3448
3449
|
let n = new Set(t);
|
|
3449
|
-
for (let t of
|
|
3450
|
+
for (let t of V) e ? n.delete(t.file.path) : n.add(t.file.path);
|
|
3450
3451
|
return n;
|
|
3451
3452
|
});
|
|
3452
3453
|
}, Oe = (e) => S && e.startsWith(`${S}/`) ? e.slice(S.length + 1) : e, ke = async (e, t) => {
|
|
3453
3454
|
l ? await l(e, t) : vi(e.name, t);
|
|
3454
3455
|
}, Ae = async (e, t) => {
|
|
3455
3456
|
if (e.length === 0) return !1;
|
|
3456
|
-
|
|
3457
|
+
z(!0);
|
|
3457
3458
|
try {
|
|
3458
3459
|
if (e.length === 1 && !t) {
|
|
3459
3460
|
let [t] = e;
|
|
@@ -3470,19 +3471,19 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3470
3471
|
size: r.size,
|
|
3471
3472
|
type: "application/zip",
|
|
3472
3473
|
lastModified: Date.now()
|
|
3473
|
-
}, r),
|
|
3474
|
+
}, r), _e(`Saved ${i} with ${gi(e.length, "file")}`, "success", {
|
|
3474
3475
|
kind: "download",
|
|
3475
3476
|
paths: e.map((e) => e.path),
|
|
3476
3477
|
fileName: i
|
|
3477
3478
|
}), !0;
|
|
3478
3479
|
} catch (t) {
|
|
3479
|
-
return
|
|
3480
|
+
return _e(`Couldn’t download: ${hi(t)}`, "error", {
|
|
3480
3481
|
kind: "download",
|
|
3481
3482
|
paths: e.map((e) => e.path),
|
|
3482
3483
|
error: hi(t)
|
|
3483
3484
|
}), !1;
|
|
3484
3485
|
} finally {
|
|
3485
|
-
|
|
3486
|
+
z(!1);
|
|
3486
3487
|
}
|
|
3487
3488
|
}, je = (e) => Ae(e.map((e) => e.file)), Me = (e, t) => e.flatMap((e) => [e.file, ...t ? e.variants.map((e) => e.file) : []]), J = (e) => {
|
|
3488
3489
|
let t = b?.(e);
|
|
@@ -3491,7 +3492,7 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3491
3492
|
destructive: t?.destructive !== !1
|
|
3492
3493
|
};
|
|
3493
3494
|
}, Y = (e) => J(Me(e, !0)), X = async (e, t) => {
|
|
3494
|
-
|
|
3495
|
+
z(!0);
|
|
3495
3496
|
let i = [], a = [], o = [], s = !1;
|
|
3496
3497
|
try {
|
|
3497
3498
|
let r = await navigator.storage.getDirectory();
|
|
@@ -3518,16 +3519,16 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3518
3519
|
error: hi(e)
|
|
3519
3520
|
});
|
|
3520
3521
|
}
|
|
3521
|
-
|
|
3522
|
+
I((e) => {
|
|
3522
3523
|
let t = new Set(e);
|
|
3523
3524
|
return i.forEach((e) => t.delete(e)), t;
|
|
3524
|
-
}),
|
|
3525
|
+
}), ue && i.includes(ue) && de(null), await te(), z(!1);
|
|
3525
3526
|
let c = [s ? `Deleted the ${t.name} folder (${gi(i.length, "file")})` : i.length > 0 ? `Deleted ${gi(i.length, "file")}` : "Nothing deleted"];
|
|
3526
3527
|
if (o.length && c.push(`${o.length} kept by onBeforeDelete`), a.length) {
|
|
3527
3528
|
let e = a.map((e) => e.path ? `${e.path.split("/").pop()}: ${e.error}` : e.error);
|
|
3528
3529
|
c.push(`${a.length} failed (${e.join("; ")})`);
|
|
3529
3530
|
}
|
|
3530
|
-
t && !s && !a.length && c.push(`The ${t.name} folder still has files, so it was kept`),
|
|
3531
|
+
t && !s && !a.length && c.push(`The ${t.name} folder still has files, so it was kept`), _e(c.join(". "), a.length ? "error" : "success", {
|
|
3531
3532
|
kind: "delete",
|
|
3532
3533
|
deleted: i,
|
|
3533
3534
|
skipped: o,
|
|
@@ -3540,23 +3541,23 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3540
3541
|
}, Ne = async (e) => {
|
|
3541
3542
|
if (e.length === 0) return;
|
|
3542
3543
|
if (!y) {
|
|
3543
|
-
|
|
3544
|
+
L(e);
|
|
3544
3545
|
return;
|
|
3545
3546
|
}
|
|
3546
3547
|
let t = Me(e, !0);
|
|
3547
3548
|
await y(t) && await X(t);
|
|
3548
|
-
}, Pe = (e) =>
|
|
3549
|
+
}, Pe = (e) => k.filter((t) => t.path.startsWith(`${e.path}/`)), Fe = async (e) => {
|
|
3549
3550
|
if (!y) {
|
|
3550
|
-
|
|
3551
|
+
me(e);
|
|
3551
3552
|
return;
|
|
3552
3553
|
}
|
|
3553
3554
|
let t = Pe(e);
|
|
3554
3555
|
await y(t) && await X(t, e);
|
|
3555
3556
|
}, Ie = (e) => {
|
|
3556
|
-
let t = () =>
|
|
3557
|
+
let t = () => _e("Path copied", "success", {
|
|
3557
3558
|
kind: "copy-path",
|
|
3558
3559
|
path: e
|
|
3559
|
-
}), n = (t) =>
|
|
3560
|
+
}), n = (t) => _e("Couldn’t copy. Select the path text instead.", "error", {
|
|
3560
3561
|
kind: "copy-path",
|
|
3561
3562
|
path: e,
|
|
3562
3563
|
error: t === void 0 ? "Clipboard unavailable" : hi(t)
|
|
@@ -3567,71 +3568,71 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3567
3568
|
n(e);
|
|
3568
3569
|
}
|
|
3569
3570
|
}, Le = (e) => {
|
|
3570
|
-
if (
|
|
3571
|
+
if (pe || R) return;
|
|
3571
3572
|
let t = e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement;
|
|
3572
3573
|
if (e.key === "Escape") {
|
|
3573
|
-
if (
|
|
3574
|
-
else if (
|
|
3574
|
+
if (ue) Te();
|
|
3575
|
+
else if (F.size > 0) I(/* @__PURE__ */ new Set());
|
|
3575
3576
|
else return;
|
|
3576
3577
|
e.preventDefault();
|
|
3577
|
-
} else if (
|
|
3578
|
-
let t =
|
|
3579
|
-
t &&
|
|
3578
|
+
} else if (G && !t && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
3579
|
+
let t = V[K + (e.key === "ArrowRight" ? 1 : -1)];
|
|
3580
|
+
t && de(t.file.path), e.preventDefault();
|
|
3580
3581
|
}
|
|
3581
|
-
}, Z = o(() =>
|
|
3582
|
+
}, Z = o(() => k.some((e) => yr(e.path)), [k]), Re = /(^|\/)images(\/\d+)?$/.test(re), ze = [{
|
|
3582
3583
|
label: C,
|
|
3583
3584
|
path: S
|
|
3584
|
-
}, ...(
|
|
3585
|
+
}, ...(re.length > S.length ? re.slice(S ? S.length + 1 : 0).split("/") : []).map((e, t, n) => ({
|
|
3585
3586
|
label: e,
|
|
3586
3587
|
path: [S, ...n.slice(0, t + 1)].filter(Boolean).join("/")
|
|
3587
|
-
}))], Be = `h${f}`, Ve =
|
|
3588
|
-
if (!qn()) He = /* @__PURE__ */
|
|
3588
|
+
}))], Be = `h${f}`, Ve = Se.reduce((e, t) => e + t.file.size, 0), He;
|
|
3589
|
+
if (!qn()) He = /* @__PURE__ */ U(Si, {
|
|
3589
3590
|
icon: "triangleAlert",
|
|
3590
3591
|
tone: "error",
|
|
3591
3592
|
title: "This browser doesn’t support private file storage",
|
|
3592
3593
|
children: "OPFS isn’t available here. Some private browsing windows and older browsers turn it off. Try a current version of Chrome, Edge, Firefox, or Safari in a normal window."
|
|
3593
3594
|
});
|
|
3594
3595
|
else if (O) {
|
|
3595
|
-
let e = /* @__PURE__ */
|
|
3596
|
+
let e = /* @__PURE__ */ W("button", {
|
|
3596
3597
|
type: "button",
|
|
3597
3598
|
className: "seed-fm-btn",
|
|
3598
|
-
onClick: () =>
|
|
3599
|
-
children: [/* @__PURE__ */
|
|
3599
|
+
onClick: () => te(),
|
|
3600
|
+
children: [/* @__PURE__ */ U($, {
|
|
3600
3601
|
name: "refresh",
|
|
3601
3602
|
size: 15
|
|
3602
3603
|
}), " Try again"]
|
|
3603
3604
|
});
|
|
3604
|
-
He = ee === "NotFoundError" && S ? /* @__PURE__ */
|
|
3605
|
+
He = ee === "NotFoundError" && S ? /* @__PURE__ */ W(Si, {
|
|
3605
3606
|
icon: "triangleAlert",
|
|
3606
3607
|
tone: "error",
|
|
3607
3608
|
title: `Can’t open ${S}`,
|
|
3608
3609
|
action: e,
|
|
3609
3610
|
children: [
|
|
3610
3611
|
"The folder ",
|
|
3611
|
-
/* @__PURE__ */
|
|
3612
|
+
/* @__PURE__ */ U("code", { children: S }),
|
|
3612
3613
|
" doesn’t exist in this browser’s private storage yet. Check the",
|
|
3613
3614
|
" ",
|
|
3614
|
-
/* @__PURE__ */
|
|
3615
|
+
/* @__PURE__ */ U("code", { children: "rootPath" }),
|
|
3615
3616
|
" prop, or open the app once so the SDK creates it."
|
|
3616
3617
|
]
|
|
3617
|
-
}) : /* @__PURE__ */
|
|
3618
|
+
}) : /* @__PURE__ */ U(Si, {
|
|
3618
3619
|
icon: "triangleAlert",
|
|
3619
3620
|
tone: "error",
|
|
3620
3621
|
title: "Can’t read private storage",
|
|
3621
3622
|
action: e,
|
|
3622
3623
|
children: O
|
|
3623
3624
|
});
|
|
3624
|
-
} else He = D ?
|
|
3625
|
+
} else He = D ? M.length === 0 ? /* @__PURE__ */ U(Si, {
|
|
3625
3626
|
icon: "folderOpen",
|
|
3626
3627
|
title: `No files in ${C} yet`,
|
|
3627
3628
|
children: "Files show up here when the app saves images, JSON, or HTML to this browser’s private storage, for example after you add an image to a post or sync content from Arweave."
|
|
3628
|
-
}) :
|
|
3629
|
+
}) : ve.folders.length === 0 && V.length === 0 ? N ? /* @__PURE__ */ W(Si, {
|
|
3629
3630
|
icon: "search",
|
|
3630
|
-
title: `No matches for “${
|
|
3631
|
-
action: /* @__PURE__ */
|
|
3631
|
+
title: `No matches for “${N}”`,
|
|
3632
|
+
action: /* @__PURE__ */ U("button", {
|
|
3632
3633
|
type: "button",
|
|
3633
3634
|
className: "seed-fm-btn",
|
|
3634
|
-
onClick: () =>
|
|
3635
|
+
onClick: () => ae(""),
|
|
3635
3636
|
children: "Clear search"
|
|
3636
3637
|
}),
|
|
3637
3638
|
children: [
|
|
@@ -3639,27 +3640,27 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3639
3640
|
ze[ze.length - 1].label,
|
|
3640
3641
|
" and every folder inside it."
|
|
3641
3642
|
]
|
|
3642
|
-
}) : /* @__PURE__ */
|
|
3643
|
+
}) : /* @__PURE__ */ U(Si, {
|
|
3643
3644
|
icon: "folderOpen",
|
|
3644
3645
|
title: "This folder is empty",
|
|
3645
3646
|
children: "Everything in it has been deleted or filtered out."
|
|
3646
|
-
}) : /* @__PURE__ */
|
|
3647
|
+
}) : /* @__PURE__ */ W(H, { children: [ve.folders.length > 0 && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
3647
3648
|
className: "seed-fm-section-label",
|
|
3648
3649
|
children: "Folders"
|
|
3649
|
-
}), /* @__PURE__ */
|
|
3650
|
+
}), /* @__PURE__ */ U("ul", {
|
|
3650
3651
|
className: "seed-fm-folders",
|
|
3651
|
-
children:
|
|
3652
|
+
children: ve.folders.map((e) => /* @__PURE__ */ W("li", { children: [/* @__PURE__ */ W("button", {
|
|
3652
3653
|
type: "button",
|
|
3653
3654
|
className: w("folder", "seed-fm-folder"),
|
|
3654
3655
|
onClick: () => Ce(e.path),
|
|
3655
|
-
children: [/* @__PURE__ */
|
|
3656
|
+
children: [/* @__PURE__ */ U($, {
|
|
3656
3657
|
name: "folder",
|
|
3657
3658
|
size: 20,
|
|
3658
3659
|
strokeWidth: 1.75
|
|
3659
|
-
}), /* @__PURE__ */
|
|
3660
|
+
}), /* @__PURE__ */ W("span", { children: [/* @__PURE__ */ U("span", {
|
|
3660
3661
|
className: "seed-fm-folder-name",
|
|
3661
3662
|
children: e.name
|
|
3662
|
-
}), /* @__PURE__ */
|
|
3663
|
+
}), /* @__PURE__ */ W("span", {
|
|
3663
3664
|
className: "seed-fm-folder-meta",
|
|
3664
3665
|
children: [
|
|
3665
3666
|
gi(e.fileCount, "file"),
|
|
@@ -3667,32 +3668,32 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3667
3668
|
Q(e.size)
|
|
3668
3669
|
]
|
|
3669
3670
|
})] })]
|
|
3670
|
-
}), /* @__PURE__ */
|
|
3671
|
+
}), /* @__PURE__ */ U("button", {
|
|
3671
3672
|
type: "button",
|
|
3672
3673
|
className: "seed-fm-btn seed-fm-btn--ghost seed-fm-btn--icon seed-fm-folder-delete",
|
|
3673
3674
|
"aria-label": `Delete folder ${e.name}`,
|
|
3674
3675
|
title: "Delete folder",
|
|
3675
|
-
disabled:
|
|
3676
|
+
disabled: he,
|
|
3676
3677
|
onClick: () => Fe(e),
|
|
3677
|
-
children: /* @__PURE__ */
|
|
3678
|
+
children: /* @__PURE__ */ U($, {
|
|
3678
3679
|
name: "trash",
|
|
3679
3680
|
size: 15
|
|
3680
3681
|
})
|
|
3681
3682
|
})] }, e.path))
|
|
3682
|
-
})] }),
|
|
3683
|
+
})] }), V.length > 0 && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
3683
3684
|
className: "seed-fm-section-label",
|
|
3684
|
-
children:
|
|
3685
|
-
}),
|
|
3686
|
-
entries:
|
|
3687
|
-
selected:
|
|
3685
|
+
children: N ? gi(V.length, "result") : "Files"
|
|
3686
|
+
}), be === "grid" ? /* @__PURE__ */ U(qr, {
|
|
3687
|
+
entries: V,
|
|
3688
|
+
selected: F,
|
|
3688
3689
|
onActivate: Ee,
|
|
3689
3690
|
onToggle: we,
|
|
3690
3691
|
className: h.grid,
|
|
3691
3692
|
tileClassName: h.tile
|
|
3692
|
-
}) : /* @__PURE__ */
|
|
3693
|
-
entries:
|
|
3694
|
-
selected:
|
|
3695
|
-
cwd:
|
|
3693
|
+
}) : /* @__PURE__ */ U(Jr, {
|
|
3694
|
+
entries: V,
|
|
3695
|
+
selected: F,
|
|
3696
|
+
cwd: re,
|
|
3696
3697
|
onActivate: Ee,
|
|
3697
3698
|
onToggle: we,
|
|
3698
3699
|
onToggleAll: De,
|
|
@@ -3701,67 +3702,67 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3701
3702
|
deleteActionFor: (e) => Y([e]),
|
|
3702
3703
|
className: h.list,
|
|
3703
3704
|
rowClassName: h.row
|
|
3704
|
-
})] })] }) : /* @__PURE__ */
|
|
3705
|
+
})] })] }) : /* @__PURE__ */ U("ul", {
|
|
3705
3706
|
className: w("grid", "seed-fm-grid"),
|
|
3706
3707
|
"aria-busy": "true",
|
|
3707
3708
|
"aria-label": "Loading files",
|
|
3708
|
-
children: Array.from({ length: 8 }, (e, t) => /* @__PURE__ */
|
|
3709
|
+
children: Array.from({ length: 8 }, (e, t) => /* @__PURE__ */ U("li", {
|
|
3709
3710
|
className: "seed-fm-tile",
|
|
3710
|
-
children: /* @__PURE__ */
|
|
3711
|
+
children: /* @__PURE__ */ U("span", { className: "seed-fm-thumb seed-fm-skeleton" })
|
|
3711
3712
|
}, t))
|
|
3712
3713
|
});
|
|
3713
|
-
let Ue =
|
|
3714
|
-
return /* @__PURE__ */
|
|
3714
|
+
let Ue = pe ? Me(pe, !0) : [], We = R ? Pe(R) : [], Ge = F.size > 0 ? Y(Se) : null;
|
|
3715
|
+
return /* @__PURE__ */ W("div", {
|
|
3715
3716
|
className: [w("root", "seed-fm"), m].filter(Boolean).join(" "),
|
|
3716
3717
|
"data-seed-theme": p === "none" ? void 0 : p,
|
|
3717
|
-
"data-selecting":
|
|
3718
|
+
"data-selecting": F.size > 0 || void 0,
|
|
3718
3719
|
onKeyDown: Le,
|
|
3719
3720
|
children: [
|
|
3720
|
-
/* @__PURE__ */
|
|
3721
|
+
/* @__PURE__ */ W("div", {
|
|
3721
3722
|
className: "seed-fm-frame",
|
|
3722
3723
|
children: [
|
|
3723
|
-
/* @__PURE__ */
|
|
3724
|
+
/* @__PURE__ */ W("header", {
|
|
3724
3725
|
className: w("header", "seed-fm-header"),
|
|
3725
3726
|
children: [
|
|
3726
|
-
/* @__PURE__ */
|
|
3727
|
+
/* @__PURE__ */ W("div", {
|
|
3727
3728
|
className: "seed-fm-titles",
|
|
3728
|
-
children: [/* @__PURE__ */
|
|
3729
|
+
children: [/* @__PURE__ */ U(Be, {
|
|
3729
3730
|
className: "seed-fm-title",
|
|
3730
3731
|
children: u
|
|
3731
|
-
}), d && /* @__PURE__ */
|
|
3732
|
+
}), d && /* @__PURE__ */ U("p", {
|
|
3732
3733
|
className: "seed-fm-description",
|
|
3733
3734
|
children: d
|
|
3734
3735
|
})]
|
|
3735
3736
|
}),
|
|
3736
|
-
D && !O && /* @__PURE__ */
|
|
3737
|
-
files:
|
|
3738
|
-
estimate:
|
|
3737
|
+
D && !O && /* @__PURE__ */ U(xi, {
|
|
3738
|
+
files: k,
|
|
3739
|
+
estimate: ne
|
|
3739
3740
|
}),
|
|
3740
|
-
/* @__PURE__ */
|
|
3741
|
+
/* @__PURE__ */ U("button", {
|
|
3741
3742
|
type: "button",
|
|
3742
3743
|
className: "seed-fm-btn seed-fm-btn--icon",
|
|
3743
|
-
onClick: () =>
|
|
3744
|
+
onClick: () => te(),
|
|
3744
3745
|
"aria-label": "Refresh",
|
|
3745
3746
|
title: "Refresh",
|
|
3746
3747
|
"data-busy": E && D,
|
|
3747
|
-
children: /* @__PURE__ */
|
|
3748
|
+
children: /* @__PURE__ */ U($, {
|
|
3748
3749
|
name: "refresh",
|
|
3749
3750
|
size: 15
|
|
3750
3751
|
})
|
|
3751
3752
|
})
|
|
3752
3753
|
]
|
|
3753
3754
|
}),
|
|
3754
|
-
D && !O &&
|
|
3755
|
+
D && !O && M.length > 0 && /* @__PURE__ */ W("div", {
|
|
3755
3756
|
className: w("toolbar", "seed-fm-toolbar"),
|
|
3756
3757
|
children: [
|
|
3757
|
-
/* @__PURE__ */
|
|
3758
|
+
/* @__PURE__ */ U("nav", {
|
|
3758
3759
|
"aria-label": "Folder",
|
|
3759
|
-
children: /* @__PURE__ */
|
|
3760
|
+
children: /* @__PURE__ */ U("ol", {
|
|
3760
3761
|
className: "seed-fm-crumbs",
|
|
3761
|
-
children: ze.map((e, t) => /* @__PURE__ */
|
|
3762
|
+
children: ze.map((e, t) => /* @__PURE__ */ W("li", { children: [t > 0 && /* @__PURE__ */ U($, {
|
|
3762
3763
|
name: "chevronRight",
|
|
3763
3764
|
size: 14
|
|
3764
|
-
}), /* @__PURE__ */
|
|
3765
|
+
}), /* @__PURE__ */ U("button", {
|
|
3765
3766
|
type: "button",
|
|
3766
3767
|
onClick: () => Ce(e.path),
|
|
3767
3768
|
"aria-current": t === ze.length - 1 ? "page" : void 0,
|
|
@@ -3769,122 +3770,122 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3769
3770
|
})] }, e.path || "/"))
|
|
3770
3771
|
})
|
|
3771
3772
|
}),
|
|
3772
|
-
/* @__PURE__ */
|
|
3773
|
+
/* @__PURE__ */ W("label", {
|
|
3773
3774
|
className: "seed-fm-search",
|
|
3774
|
-
children: [/* @__PURE__ */
|
|
3775
|
+
children: [/* @__PURE__ */ U($, {
|
|
3775
3776
|
name: "search",
|
|
3776
3777
|
size: 14
|
|
3777
|
-
}), /* @__PURE__ */
|
|
3778
|
+
}), /* @__PURE__ */ U("input", {
|
|
3778
3779
|
type: "search",
|
|
3779
|
-
value:
|
|
3780
|
-
onChange: (e) =>
|
|
3780
|
+
value: N,
|
|
3781
|
+
onChange: (e) => ae(e.target.value),
|
|
3781
3782
|
placeholder: "Search names and paths",
|
|
3782
3783
|
"aria-label": "Search files"
|
|
3783
3784
|
})]
|
|
3784
3785
|
}),
|
|
3785
|
-
/* @__PURE__ */
|
|
3786
|
+
/* @__PURE__ */ W("select", {
|
|
3786
3787
|
className: "seed-fm-select",
|
|
3787
|
-
value:
|
|
3788
|
-
onChange: (e) =>
|
|
3788
|
+
value: oe,
|
|
3789
|
+
onChange: (e) => se(e.target.value),
|
|
3789
3790
|
"aria-label": "Sort by",
|
|
3790
3791
|
children: [
|
|
3791
|
-
/* @__PURE__ */
|
|
3792
|
+
/* @__PURE__ */ U("option", {
|
|
3792
3793
|
value: "name",
|
|
3793
3794
|
children: "Name"
|
|
3794
3795
|
}),
|
|
3795
|
-
/* @__PURE__ */
|
|
3796
|
+
/* @__PURE__ */ U("option", {
|
|
3796
3797
|
value: "modified",
|
|
3797
3798
|
children: "Recently modified"
|
|
3798
3799
|
}),
|
|
3799
|
-
/* @__PURE__ */
|
|
3800
|
+
/* @__PURE__ */ U("option", {
|
|
3800
3801
|
value: "size",
|
|
3801
3802
|
children: "Largest"
|
|
3802
3803
|
})
|
|
3803
3804
|
]
|
|
3804
3805
|
}),
|
|
3805
|
-
/* @__PURE__ */
|
|
3806
|
+
/* @__PURE__ */ W("div", {
|
|
3806
3807
|
className: "seed-fm-viewtoggle",
|
|
3807
3808
|
role: "group",
|
|
3808
3809
|
"aria-label": "View",
|
|
3809
|
-
children: [/* @__PURE__ */
|
|
3810
|
+
children: [/* @__PURE__ */ U("button", {
|
|
3810
3811
|
type: "button",
|
|
3811
|
-
"aria-pressed":
|
|
3812
|
+
"aria-pressed": be === "grid",
|
|
3812
3813
|
"aria-label": "Grid view",
|
|
3813
|
-
onClick: () =>
|
|
3814
|
-
children: /* @__PURE__ */
|
|
3814
|
+
onClick: () => ce("grid"),
|
|
3815
|
+
children: /* @__PURE__ */ U($, {
|
|
3815
3816
|
name: "layoutGrid",
|
|
3816
3817
|
size: 15
|
|
3817
3818
|
})
|
|
3818
|
-
}), /* @__PURE__ */
|
|
3819
|
+
}), /* @__PURE__ */ U("button", {
|
|
3819
3820
|
type: "button",
|
|
3820
|
-
"aria-pressed":
|
|
3821
|
+
"aria-pressed": be === "list",
|
|
3821
3822
|
"aria-label": "List view",
|
|
3822
|
-
onClick: () =>
|
|
3823
|
-
children: /* @__PURE__ */
|
|
3823
|
+
onClick: () => ce("list"),
|
|
3824
|
+
children: /* @__PURE__ */ U($, {
|
|
3824
3825
|
name: "list",
|
|
3825
3826
|
size: 15
|
|
3826
3827
|
})
|
|
3827
3828
|
})]
|
|
3828
3829
|
}),
|
|
3829
|
-
Z && Re && /* @__PURE__ */
|
|
3830
|
+
Z && Re && /* @__PURE__ */ W("p", {
|
|
3830
3831
|
className: "seed-fm-hint",
|
|
3831
3832
|
children: [
|
|
3832
|
-
/* @__PURE__ */
|
|
3833
|
+
/* @__PURE__ */ U($, {
|
|
3833
3834
|
name: "layers",
|
|
3834
3835
|
size: 13
|
|
3835
3836
|
}),
|
|
3836
|
-
|
|
3837
|
-
/* @__PURE__ */
|
|
3837
|
+
A ? "Resized copies are grouped with their original image." : "Resized copies are shown in their size folders.",
|
|
3838
|
+
/* @__PURE__ */ U("button", {
|
|
3838
3839
|
type: "button",
|
|
3839
3840
|
className: "seed-fm-linkbtn",
|
|
3840
3841
|
onClick: () => {
|
|
3841
|
-
|
|
3842
|
+
j(!A), I(/* @__PURE__ */ new Set());
|
|
3842
3843
|
},
|
|
3843
|
-
children:
|
|
3844
|
+
children: A ? "Show as folders" : "Group with originals"
|
|
3844
3845
|
})
|
|
3845
3846
|
]
|
|
3846
3847
|
})
|
|
3847
3848
|
]
|
|
3848
3849
|
}),
|
|
3849
|
-
/* @__PURE__ */
|
|
3850
|
+
/* @__PURE__ */ U("div", {
|
|
3850
3851
|
className: w("body", "seed-fm-body"),
|
|
3851
3852
|
children: He
|
|
3852
3853
|
}),
|
|
3853
|
-
Ge && /* @__PURE__ */
|
|
3854
|
+
Ge && /* @__PURE__ */ W("div", {
|
|
3854
3855
|
className: w("batchBar", "seed-fm-batch"),
|
|
3855
3856
|
role: "toolbar",
|
|
3856
3857
|
"aria-label": "Selected files",
|
|
3857
3858
|
children: [
|
|
3858
|
-
/* @__PURE__ */
|
|
3859
|
+
/* @__PURE__ */ W("span", {
|
|
3859
3860
|
className: "seed-fm-batch-count",
|
|
3860
3861
|
"aria-live": "polite",
|
|
3861
3862
|
children: [
|
|
3862
|
-
|
|
3863
|
+
F.size,
|
|
3863
3864
|
" selected ",
|
|
3864
|
-
/* @__PURE__ */
|
|
3865
|
+
/* @__PURE__ */ W("span", { children: ["· ", Q(Ve)] })
|
|
3865
3866
|
]
|
|
3866
3867
|
}),
|
|
3867
|
-
/* @__PURE__ */
|
|
3868
|
+
/* @__PURE__ */ W("button", {
|
|
3868
3869
|
type: "button",
|
|
3869
3870
|
className: "seed-fm-btn",
|
|
3870
|
-
disabled:
|
|
3871
|
-
onClick: () => je(
|
|
3871
|
+
disabled: he,
|
|
3872
|
+
onClick: () => je(Se),
|
|
3872
3873
|
children: [
|
|
3873
|
-
/* @__PURE__ */
|
|
3874
|
+
/* @__PURE__ */ U($, {
|
|
3874
3875
|
name: "download",
|
|
3875
3876
|
size: 15
|
|
3876
3877
|
}),
|
|
3877
3878
|
" ",
|
|
3878
|
-
|
|
3879
|
+
F.size > 1 ? "Download .zip" : "Download"
|
|
3879
3880
|
]
|
|
3880
3881
|
}),
|
|
3881
|
-
/* @__PURE__ */
|
|
3882
|
+
/* @__PURE__ */ W("button", {
|
|
3882
3883
|
type: "button",
|
|
3883
3884
|
className: `seed-fm-btn${Ge.destructive ? " seed-fm-btn--danger-text" : ""}`,
|
|
3884
|
-
disabled:
|
|
3885
|
-
onClick: () => Ne(
|
|
3885
|
+
disabled: he,
|
|
3886
|
+
onClick: () => Ne(Se),
|
|
3886
3887
|
children: [
|
|
3887
|
-
/* @__PURE__ */
|
|
3888
|
+
/* @__PURE__ */ U($, {
|
|
3888
3889
|
name: "trash",
|
|
3889
3890
|
size: 15
|
|
3890
3891
|
}),
|
|
@@ -3892,12 +3893,12 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3892
3893
|
Ge.label ?? "Delete"
|
|
3893
3894
|
]
|
|
3894
3895
|
}),
|
|
3895
|
-
/* @__PURE__ */
|
|
3896
|
+
/* @__PURE__ */ U("button", {
|
|
3896
3897
|
type: "button",
|
|
3897
3898
|
className: "seed-fm-btn seed-fm-btn--icon",
|
|
3898
3899
|
"aria-label": "Clear selection",
|
|
3899
|
-
onClick: () =>
|
|
3900
|
-
children: /* @__PURE__ */
|
|
3900
|
+
onClick: () => I(/* @__PURE__ */ new Set()),
|
|
3901
|
+
children: /* @__PURE__ */ U($, {
|
|
3901
3902
|
name: "x",
|
|
3902
3903
|
size: 15
|
|
3903
3904
|
})
|
|
@@ -3906,49 +3907,49 @@ function Ci({ rootPath: e, filter: t, onBeforeDelete: n, onAfterDelete: r, onDow
|
|
|
3906
3907
|
})
|
|
3907
3908
|
]
|
|
3908
3909
|
}),
|
|
3909
|
-
|
|
3910
|
-
entry:
|
|
3910
|
+
G && /* @__PURE__ */ U(Qr, {
|
|
3911
|
+
entry: G,
|
|
3911
3912
|
className: h.panel,
|
|
3912
3913
|
onClose: Te,
|
|
3913
|
-
onPrevious:
|
|
3914
|
-
onNext:
|
|
3915
|
-
onDownload: () => je([
|
|
3916
|
-
onDelete: () => Ne([
|
|
3917
|
-
deleteAction: Y([
|
|
3918
|
-
onCopyPath: () => Ie(
|
|
3914
|
+
onPrevious: K > 0 ? () => de(V[K - 1].file.path) : null,
|
|
3915
|
+
onNext: K >= 0 && K < V.length - 1 ? () => de(V[K + 1].file.path) : null,
|
|
3916
|
+
onDownload: () => je([G]),
|
|
3917
|
+
onDelete: () => Ne([G]),
|
|
3918
|
+
deleteAction: Y([G]),
|
|
3919
|
+
onCopyPath: () => Ie(G.file.path)
|
|
3919
3920
|
}, "panel"),
|
|
3920
|
-
|
|
3921
|
-
entries:
|
|
3921
|
+
pe && /* @__PURE__ */ U(ur, {
|
|
3922
|
+
entries: pe,
|
|
3922
3923
|
rootPath: S,
|
|
3923
3924
|
warning: v(Ue),
|
|
3924
|
-
deleteActionFor: (e) => J(Me(
|
|
3925
|
+
deleteActionFor: (e) => J(Me(pe, e)),
|
|
3925
3926
|
className: h.dialog,
|
|
3926
|
-
onCancel: () =>
|
|
3927
|
+
onCancel: () => L(null),
|
|
3927
3928
|
onConfirm: (e) => {
|
|
3928
|
-
let t = Me(
|
|
3929
|
-
|
|
3929
|
+
let t = Me(pe, e);
|
|
3930
|
+
L(null), X(t);
|
|
3930
3931
|
}
|
|
3931
3932
|
}),
|
|
3932
|
-
|
|
3933
|
-
folder:
|
|
3933
|
+
R && /* @__PURE__ */ U(dr, {
|
|
3934
|
+
folder: R,
|
|
3934
3935
|
files: We,
|
|
3935
|
-
hiddenCount: T.filter((e) => e.path.startsWith(`${
|
|
3936
|
+
hiddenCount: T.filter((e) => e.path.startsWith(`${R.path}/`)).length - We.length,
|
|
3936
3937
|
warning: v(We),
|
|
3937
3938
|
action: J(We),
|
|
3938
|
-
busy:
|
|
3939
|
+
busy: he,
|
|
3939
3940
|
className: h.dialog,
|
|
3940
|
-
onDownload: () => Ae(We,
|
|
3941
|
-
onCancel: () =>
|
|
3941
|
+
onDownload: () => Ae(We, R),
|
|
3942
|
+
onCancel: () => me(null),
|
|
3942
3943
|
onConfirm: () => {
|
|
3943
|
-
|
|
3944
|
+
me(null), X(We, R);
|
|
3944
3945
|
}
|
|
3945
3946
|
}),
|
|
3946
|
-
!x && /* @__PURE__ */
|
|
3947
|
+
!x && /* @__PURE__ */ U("ul", {
|
|
3947
3948
|
className: "seed-fm-toasts",
|
|
3948
3949
|
"aria-live": "polite",
|
|
3949
|
-
children:
|
|
3950
|
+
children: B.map((e) => /* @__PURE__ */ W("li", {
|
|
3950
3951
|
className: w("toast", `seed-fm-toast${e.tone === "error" ? " seed-fm-toast--error" : ""}`),
|
|
3951
|
-
children: [/* @__PURE__ */
|
|
3952
|
+
children: [/* @__PURE__ */ U($, {
|
|
3952
3953
|
name: e.tone === "error" ? "triangleAlert" : "check",
|
|
3953
3954
|
size: 15,
|
|
3954
3955
|
strokeWidth: 2.5
|
|
@@ -3968,7 +3969,7 @@ var wi = (e) => {
|
|
|
3968
3969
|
}
|
|
3969
3970
|
};
|
|
3970
3971
|
function Ti(e) {
|
|
3971
|
-
let { imageProperty: t, filename: r, width: a, enabled: s = !0 } = e, [l, u] = c(null), [f, p] = c("idle"), m = t?.refResolvedValue, h = t?.value, g = typeof h == "string" ? h : void 0, _ = wi(t), v = o(() =>
|
|
3972
|
+
let { imageProperty: t, filename: r, width: a, enabled: s = !0 } = e, [l, u] = c(null), [f, p] = c("idle"), m = t?.refResolvedValue, h = t?.value, g = typeof h == "string" ? h : void 0, _ = wi(t), v = o(() => le(_) ?? le(r) ?? le(m) ?? le(g), [
|
|
3972
3973
|
_,
|
|
3973
3974
|
r,
|
|
3974
3975
|
m,
|
|
@@ -3981,7 +3982,7 @@ function Ti(e) {
|
|
|
3981
3982
|
if (!v) return [];
|
|
3982
3983
|
let e = [];
|
|
3983
3984
|
try {
|
|
3984
|
-
for (let t of
|
|
3985
|
+
for (let t of A()) {
|
|
3985
3986
|
let n = `${t.replace(/\/$/, "")}/raw/${v}`;
|
|
3986
3987
|
e.includes(n) || e.push(n);
|
|
3987
3988
|
}
|
|
@@ -4036,7 +4037,7 @@ function Ti(e) {
|
|
|
4036
4037
|
}
|
|
4037
4038
|
//#endregion
|
|
4038
4039
|
//#region src/SeedImage.tsx
|
|
4039
|
-
var Ei =
|
|
4040
|
+
var Ei = ye("seedSdk:react:SeedImage"), Di = /* @__PURE__ */ new Map(), Oi = (e) => {
|
|
4040
4041
|
let t = e.match(/^(.*[\/\\])?([^\/\\]+?)(\.[^.\/\\]*)?$/);
|
|
4041
4042
|
return t && t[2] ? t[2] : e;
|
|
4042
4043
|
};
|
|
@@ -4122,16 +4123,16 @@ var ji = e.memo(e.forwardRef(({ imageProperty: t, width: n, filename: r, ensure:
|
|
|
4122
4123
|
]);
|
|
4123
4124
|
let E = (e) => typeof e == "string" && e.startsWith("blob:"), D = !!l || !!d || !!C || !!x && E(x);
|
|
4124
4125
|
if (!D && !g && !v) return null;
|
|
4125
|
-
let O = l || d || C || (E(x) ? x : void 0) || (a && !D ? v : void 0) || "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", { onError: ee, ...
|
|
4126
|
+
let O = l || d || C || (E(x) ? x : void 0) || (a && !D ? v : void 0) || "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", { onError: ee, ...te } = o, k = (e) => {
|
|
4126
4127
|
v && O === v && y(), ee?.(e);
|
|
4127
4128
|
};
|
|
4128
|
-
return /* @__PURE__ */
|
|
4129
|
+
return /* @__PURE__ */ U("img", {
|
|
4129
4130
|
src: O,
|
|
4130
4131
|
alt: o.alt || t.propertyName || "Image",
|
|
4131
4132
|
width: n,
|
|
4132
|
-
...
|
|
4133
|
+
...te,
|
|
4133
4134
|
ref: s,
|
|
4134
|
-
onError:
|
|
4135
|
+
onError: k
|
|
4135
4136
|
});
|
|
4136
4137
|
}));
|
|
4137
4138
|
//#endregion
|
|
@@ -4160,7 +4161,7 @@ function Mi(e) {
|
|
|
4160
4161
|
error: null
|
|
4161
4162
|
});
|
|
4162
4163
|
try {
|
|
4163
|
-
let r = await
|
|
4164
|
+
let r = await he(String(t), { treatAs: a }), i = r.status === "ready" && r.source === "localBlob" ? r.href : void 0;
|
|
4164
4165
|
if (e) {
|
|
4165
4166
|
i && URL.revokeObjectURL(i);
|
|
4166
4167
|
return;
|
|
@@ -4218,7 +4219,7 @@ function Ni({ value: e, enabled: t, treatAs: n, render: r, alt: i, ...a }) {
|
|
|
4218
4219
|
src: o,
|
|
4219
4220
|
alt: i ?? ""
|
|
4220
4221
|
};
|
|
4221
|
-
return r ? /* @__PURE__ */
|
|
4222
|
+
return r ? /* @__PURE__ */ U(H, { children: r(s) }) : /* @__PURE__ */ U("img", { ...s });
|
|
4222
4223
|
}
|
|
4223
4224
|
//#endregion
|
|
4224
4225
|
//#region src/SeedMediaFile.tsx
|
|
@@ -4252,7 +4253,7 @@ function Ii({ value: e, enabled: t, treatAs: n, download: r, render: i, children
|
|
|
4252
4253
|
rel: s ?? (u && d === "_blank" ? "noopener noreferrer" : void 0),
|
|
4253
4254
|
children: a ?? Pi(l)
|
|
4254
4255
|
};
|
|
4255
|
-
return i ? /* @__PURE__ */
|
|
4256
|
+
return i ? /* @__PURE__ */ U(H, { children: i(f) }) : /* @__PURE__ */ U("a", { ...f });
|
|
4256
4257
|
}
|
|
4257
4258
|
//#endregion
|
|
4258
4259
|
//#region src/SeedMediaAudio.tsx
|
|
@@ -4268,7 +4269,7 @@ function Li({ value: e, enabled: t, treatAs: n, render: r, controls: i = !0, ...
|
|
|
4268
4269
|
src: o,
|
|
4269
4270
|
controls: i
|
|
4270
4271
|
};
|
|
4271
|
-
return r ? /* @__PURE__ */
|
|
4272
|
+
return r ? /* @__PURE__ */ U(H, { children: r(s) }) : /* @__PURE__ */ U("audio", { ...s });
|
|
4272
4273
|
}
|
|
4273
4274
|
//#endregion
|
|
4274
4275
|
//#region src/SeedMediaVideo.tsx
|
|
@@ -4284,7 +4285,7 @@ function Ri({ value: e, enabled: t, treatAs: n, render: r, controls: i = !0, ...
|
|
|
4284
4285
|
src: o,
|
|
4285
4286
|
controls: i
|
|
4286
4287
|
};
|
|
4287
|
-
return r ? /* @__PURE__ */
|
|
4288
|
+
return r ? /* @__PURE__ */ U(H, { children: r(s) }) : /* @__PURE__ */ U("video", { ...s });
|
|
4288
4289
|
}
|
|
4289
4290
|
//#endregion
|
|
4290
4291
|
//#region src/SeedHtml.tsx
|
|
@@ -4309,7 +4310,7 @@ function Hi(e) {
|
|
|
4309
4310
|
for (let e of Vi) {
|
|
4310
4311
|
let r = t.getAttribute(e);
|
|
4311
4312
|
if (!r) continue;
|
|
4312
|
-
let i =
|
|
4313
|
+
let i = se(e, r, (e) => I(e));
|
|
4313
4314
|
i !== void 0 && (t.setAttribute(e, i), n = !0);
|
|
4314
4315
|
}
|
|
4315
4316
|
n && t.tagName.toLowerCase() === "source" && t.parentElement?.load?.();
|
|
@@ -4317,11 +4318,11 @@ function Hi(e) {
|
|
|
4317
4318
|
return e.addEventListener("error", t, !0), () => e.removeEventListener("error", t, !0);
|
|
4318
4319
|
}
|
|
4319
4320
|
function Ui({ html: t, sanitize: n, render: r, ...i }) {
|
|
4320
|
-
let a = e.useRef(null), o = e.useMemo(() => zi(t) ? n(
|
|
4321
|
+
let a = e.useRef(null), o = e.useMemo(() => zi(t) ? n(me(t)) : void 0, [t, n]);
|
|
4321
4322
|
return e.useEffect(() => {
|
|
4322
4323
|
let e = a.current;
|
|
4323
4324
|
return e ? Hi(e) : void 0;
|
|
4324
|
-
}, [o, r]), o === void 0 ? null : r ? /* @__PURE__ */
|
|
4325
|
+
}, [o, r]), o === void 0 ? null : r ? /* @__PURE__ */ U(H, { children: r({ html: o }) }) : /* @__PURE__ */ U("div", {
|
|
4325
4326
|
...i,
|
|
4326
4327
|
ref: a,
|
|
4327
4328
|
dangerouslySetInnerHTML: { __html: o }
|
|
@@ -4379,7 +4380,7 @@ function qi(e, t) {
|
|
|
4379
4380
|
//#region src/SeedJson.tsx
|
|
4380
4381
|
function Ji({ value: e, format: t, formatOptions: n, render: r, ...i }) {
|
|
4381
4382
|
let a = t ? t(e) : qi(e, n);
|
|
4382
|
-
return r ? /* @__PURE__ */
|
|
4383
|
+
return r ? /* @__PURE__ */ U(H, { children: r({ text: a }) }) : /* @__PURE__ */ U("pre", {
|
|
4383
4384
|
...i,
|
|
4384
4385
|
children: a
|
|
4385
4386
|
});
|
|
@@ -4387,9 +4388,9 @@ function Ji({ value: e, format: t, formatOptions: n, render: r, ...i }) {
|
|
|
4387
4388
|
//#endregion
|
|
4388
4389
|
//#region src/useNormalizedFeedItemFields.ts
|
|
4389
4390
|
function Yi(e, t) {
|
|
4390
|
-
return o(() => e ?
|
|
4391
|
+
return o(() => e ? ue(e, t) : {}, [e, t]);
|
|
4391
4392
|
}
|
|
4392
4393
|
//#endregion
|
|
4393
|
-
export { Ne as ADDRESSES_PERSISTED_EVENT, Cn as FILES_QUERY_KEY_PREFIX, Pe as LOCAL_COPIES_REMOVED_EVENT, Ci as OPFSFilesManager, ri as OPFS_FILES_MANAGER_CSS, Rn as SeedClientGate, Ui as SeedHtml, ji as SeedImage, Ji as SeedJson, Li as SeedMediaAudio, Ii as SeedMediaFile, Ni as SeedMediaImage, Ri as SeedMediaVideo, Fn as SeedProvider, Hi as attachArweaveLoadFailover, Ge as createSeedQueryClient, qi as formatSeedJson, ht as getItemPropertyQueryKey, Ze as getItemQueryKey, Nt as getPercentComplete, Ue as getSeedQueryDefaultOptions, kt as getServiceName, jt as getServiceUniqueKey, At as getServiceValue, Mn as invalidateItemPropertiesForItem,
|
|
4394
|
+
export { Ne as ADDRESSES_PERSISTED_EVENT, Cn as FILES_QUERY_KEY_PREFIX, Pe as LOCAL_COPIES_REMOVED_EVENT, Ci as OPFSFilesManager, ri as OPFS_FILES_MANAGER_CSS, Rn as SeedClientGate, Ui as SeedHtml, ji as SeedImage, Ji as SeedJson, Li as SeedMediaAudio, Ii as SeedMediaFile, Ni as SeedMediaImage, Ri as SeedMediaVideo, Fn as SeedProvider, Hi as attachArweaveLoadFailover, Ge as createSeedQueryClient, qi as formatSeedJson, ht as getItemPropertyQueryKey, Ze as getItemQueryKey, Nt as getPercentComplete, Ue as getSeedQueryDefaultOptions, kt as getServiceName, jt as getServiceUniqueKey, At as getServiceValue, Mn as invalidateItemPropertiesForItem, N as isClientReadySnapshot, Tt as isDbReadyState, We as mergeSeedQueryDefaults, Qt as useAllSchemaVersions, J as useClientSelector, Me as useClientService, lt as useCreateItem, St as useCreateItemProperty, sn as useCreateModel, vn as useCreateModelProperty, Xt as useCreateSchema, Et as useDbsAreReady, _t as useDebouncedItemProperty, bn as useDeleteItem, Ct as useDestroyItemProperty, cn as useDestroyModel, yn as useDestroyModelProperty, Zt as useDestroySchema, An as useEasSyncProcessById, On as useEasSyncProcesses, kn as useEasSyncProcessesNonActiveCount, Dn as useEasSyncProcessesState, Ti as useEnsureLocalImage, wn as useFiles, Bt as useGlobalServiceStatus, Lt as useHasSavedSnapshots, Sn as useImageFiles, Y as useIsClientReady, Ft as useIsDbReady, Qe as useItem, xt as useItemProperties, gt as useItemProperty, at as useItems, Z as useLiveQuery, Ve as useLiveQueryState, on as useModel, fn as useModelProperties, _n as useModelProperty, an as useModels, Yi as useNormalizedFeedItemFields, $n as useOPFSFiles, It as usePersistedSnapshots, ut as usePublishItem, Mi as useResolvedMediaRef, Wt as useSchema, Yt as useSchemas, Ie as useSeedAddressRevision, $t as useSeedProtocolSchema, Pt as useService, zt as useServices, ai as useStorageEstimate, Hr as useThumbnail };
|
|
4394
4395
|
|
|
4395
4396
|
//# sourceMappingURL=index.js.map
|