@floegence/floe-webapp-core 0.86.51 → 0.86.52
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { insert as o, createComponent as l, use as
|
|
2
|
-
import { createSignal as E, createEffect as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { insert as o, createComponent as l, use as H, setAttribute as g, effect as P, className as de, memo as C, spread as te, mergeProps as re, template as f, delegateEvents as ce } from "solid-js/web";
|
|
2
|
+
import { createSignal as E, createEffect as T, on as ae, untrack as ue, createMemo as V, createUniqueId as ge, Show as h, For as N } from "solid-js";
|
|
3
|
+
import { cn as L } from "../../../utils/cn.js";
|
|
4
4
|
import { FileItemIcon as ve } from "../../file-browser/FileIcons.js";
|
|
5
|
-
import { FolderOpen as le, ChevronRight as
|
|
5
|
+
import { FolderOpen as le, ChevronRight as U } from "../../icons/index.js";
|
|
6
6
|
import { Button as z } from "../Button.js";
|
|
7
7
|
import { Input as j } from "../Input.js";
|
|
8
8
|
import { PickerDirectoryRow as ie, DirectoryFavoriteButton as fe } from "./DirectoryFavorites.js";
|
|
@@ -22,9 +22,9 @@ function oe(e, s) {
|
|
|
22
22
|
}
|
|
23
23
|
function Oe(e, s, n, y, _ = () => "browse") {
|
|
24
24
|
const [m, F] = E("browse"), k = be(() => e, n);
|
|
25
|
-
return
|
|
25
|
+
return T(ae(() => [s(), e.scopeKey], ([I]) => {
|
|
26
26
|
k.close(), I && (F(_()), e.directoryFavorites?.onRefresh?.(), y?.(), k.open(e.initialPath));
|
|
27
|
-
})),
|
|
27
|
+
})), T(() => e.onValidityChange?.(k.valid() && m() === "browse")), {
|
|
28
28
|
...k,
|
|
29
29
|
view: m,
|
|
30
30
|
setView: F
|
|
@@ -32,10 +32,10 @@ function Oe(e, s, n, y, _ = () => "browse") {
|
|
|
32
32
|
}
|
|
33
33
|
function We(e) {
|
|
34
34
|
const s = () => W(e), n = ue(() => e.source), y = V(() => n.entries().filter((d) => d.type === "folder")), _ = V(() => n.context()?.roots.filter((d) => !d.hidden) ?? []), m = ge(), [F, k] = E(""), [I, $] = E(""), A = () => n.view() !== "browse", w = () => !!(e.suggestions?.paths.length || e.directoryFavorites), x = V(() => [...new Set((e.directoryFavorites?.paths ?? []).map((d) => q(d)).filter(Boolean))]), D = V(() => n.view() === "suggestions" ? e.suggestions?.paths ?? [] : x().filter((d) => d.toLocaleLowerCase().includes(F().trim().toLocaleLowerCase())));
|
|
35
|
-
|
|
35
|
+
T(ae(() => e.scopeKey, () => {
|
|
36
36
|
k(""), $("");
|
|
37
37
|
}));
|
|
38
|
-
let
|
|
38
|
+
let K;
|
|
39
39
|
const G = V(() => [...e.suggestions?.paths.length ? [{
|
|
40
40
|
id: "suggestions",
|
|
41
41
|
label: e.suggestions.label,
|
|
@@ -49,7 +49,7 @@ function We(e) {
|
|
|
49
49
|
label: d.label,
|
|
50
50
|
path: d.pathAbs,
|
|
51
51
|
disabled: e.disabled || d.permissions?.read === !1
|
|
52
|
-
}))]),
|
|
52
|
+
}))]), B = () => {
|
|
53
53
|
if (A()) return n.view();
|
|
54
54
|
const d = q(n.pathInput(), n.context()?.homePathAbs);
|
|
55
55
|
return `root:${_().filter((i) => d === i.pathAbs || d.startsWith(i.pathAbs.replace(/\/$/, "") + "/")).sort((i, t) => t.pathAbs.length - i.pathAbs.length)[0]?.id ?? n.context()?.defaultRootId ?? _()[0]?.id}`;
|
|
@@ -69,9 +69,9 @@ function We(e) {
|
|
|
69
69
|
path: b,
|
|
70
70
|
name: i
|
|
71
71
|
}))];
|
|
72
|
-
}), Y = [],
|
|
73
|
-
n.setView("browse"), n.navigate(d),
|
|
74
|
-
}, Z = () =>
|
|
72
|
+
}), Y = [], S = (d) => {
|
|
73
|
+
n.setView("browse"), n.navigate(d), K?.focus();
|
|
74
|
+
}, Z = () => S(n.pathInput());
|
|
75
75
|
return (() => {
|
|
76
76
|
var d = pe(), b = d.firstChild;
|
|
77
77
|
return o(d, l(h, {
|
|
@@ -119,9 +119,9 @@ function We(e) {
|
|
|
119
119
|
const u = he(G(), t.id, r.key);
|
|
120
120
|
u && (r.preventDefault(), r.stopPropagation(), J.get(u)?.focus());
|
|
121
121
|
}, a.$$click = () => {
|
|
122
|
-
"path" in t ?
|
|
123
|
-
},
|
|
124
|
-
var u = `${m}-${t.id}`, v =
|
|
122
|
+
"path" in t ? S(t.path) : (n.setView(t.id), t.id === "favorites" && e.directoryFavorites?.onRefresh?.());
|
|
123
|
+
}, H((r) => J.set(t.id, r), a), g(a, "aria-controls", m), o(a, () => t.label), P((r) => {
|
|
124
|
+
var u = `${m}-${t.id}`, v = B() === t.id, p = B() === t.id ? 0 : -1, c = t.disabled, R = "path" in t ? t.path : t.label, M = L("min-w-0 cursor-pointer truncate border-b-2 px-0.5 py-2 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", B() === t.id ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground");
|
|
125
125
|
return u !== r.e && g(a, "id", r.e = u), v !== r.t && g(a, "aria-selected", r.t = v), p !== r.a && g(a, "tabindex", r.a = p), c !== r.o && (a.disabled = r.o = c), R !== r.i && g(a, "title", r.i = R), M !== r.n && de(a, r.n = M), r;
|
|
126
126
|
}, {
|
|
127
127
|
e: void 0,
|
|
@@ -142,8 +142,8 @@ function We(e) {
|
|
|
142
142
|
var i = ye(), t = i.firstChild;
|
|
143
143
|
return o(t, l(j, {
|
|
144
144
|
ref(a) {
|
|
145
|
-
var r =
|
|
146
|
-
typeof r == "function" ? r(a) :
|
|
145
|
+
var r = K;
|
|
146
|
+
typeof r == "function" ? r(a) : K = a;
|
|
147
147
|
},
|
|
148
148
|
size: "sm",
|
|
149
149
|
get "aria-label"() {
|
|
@@ -228,7 +228,7 @@ function We(e) {
|
|
|
228
228
|
return a() > 0;
|
|
229
229
|
},
|
|
230
230
|
get children() {
|
|
231
|
-
return l(
|
|
231
|
+
return l(U, {
|
|
232
232
|
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
233
233
|
});
|
|
234
234
|
}
|
|
@@ -271,7 +271,7 @@ function We(e) {
|
|
|
271
271
|
var i = O();
|
|
272
272
|
return te(i, re(() => e.scrollViewportProps, {
|
|
273
273
|
get class() {
|
|
274
|
-
return
|
|
274
|
+
return L("min-h-[120px] overflow-y-auto rounded border border-border", e.scrollViewportProps?.class);
|
|
275
275
|
},
|
|
276
276
|
get style() {
|
|
277
277
|
return {
|
|
@@ -330,13 +330,15 @@ function We(e) {
|
|
|
330
330
|
var r = Ae(), u = r.firstChild;
|
|
331
331
|
return r.$$keydown = (v) => X(v, a(), Y, y().length), r.$$click = () => {
|
|
332
332
|
n.navigate(t.path);
|
|
333
|
-
},
|
|
334
|
-
|
|
333
|
+
}, H((v) => {
|
|
334
|
+
T(() => {
|
|
335
|
+
Y[a()] = v;
|
|
336
|
+
});
|
|
335
337
|
}, r), o(r, l(ve, {
|
|
336
338
|
item: t,
|
|
337
339
|
size: 16,
|
|
338
340
|
class: "h-4 w-4 shrink-0"
|
|
339
|
-
}), u), o(u, () => t.name), o(r, l(
|
|
341
|
+
}), u), o(u, () => t.name), o(r, l(U, {
|
|
340
342
|
class: "h-3 w-3 shrink-0 text-muted-foreground"
|
|
341
343
|
}), null), P((v) => {
|
|
342
344
|
var p = t.path, c = e.disabled || e.filter?.(t) === !1;
|
|
@@ -410,7 +412,7 @@ function We(e) {
|
|
|
410
412
|
return C(() => n.view() === "favorites")() && e.directoryFavorites?.loading;
|
|
411
413
|
},
|
|
412
414
|
get class() {
|
|
413
|
-
return
|
|
415
|
+
return L("min-h-[180px] min-w-0 overflow-y-auto", e.scrollViewportProps?.class);
|
|
414
416
|
},
|
|
415
417
|
get style() {
|
|
416
418
|
return {
|
|
@@ -453,12 +455,14 @@ function We(e) {
|
|
|
453
455
|
get children() {
|
|
454
456
|
var r = Ve(), u = r.firstChild, v = u.firstChild, p = v.nextSibling;
|
|
455
457
|
return r.$$keydown = (c) => X(c, a(), Q, D().length), r.$$click = () => {
|
|
456
|
-
|
|
457
|
-
},
|
|
458
|
-
|
|
458
|
+
S(t);
|
|
459
|
+
}, H((c) => {
|
|
460
|
+
T(() => {
|
|
461
|
+
Q[a()] = c;
|
|
462
|
+
});
|
|
459
463
|
}, r), g(r, "title", t), g(r, "aria-label", t), o(r, l(le, {
|
|
460
464
|
class: "h-4 w-4 shrink-0 text-muted-foreground"
|
|
461
|
-
}), u), o(v, () => t.split("/").filter(Boolean).at(-1) ?? s().root), o(p, t), o(r, l(
|
|
465
|
+
}), u), o(v, () => t.split("/").filter(Boolean).at(-1) ?? s().root), o(p, t), o(r, l(U, {
|
|
462
466
|
class: "h-3 w-3 shrink-0 text-muted-foreground/60"
|
|
463
467
|
}), null), P((c) => {
|
|
464
468
|
var R = n.view() === "suggestions" ? t : void 0, M = n.view() === "favorites" ? t : void 0, ee = e.disabled || !n.context();
|
|
@@ -476,7 +480,7 @@ function We(e) {
|
|
|
476
480
|
})()];
|
|
477
481
|
}
|
|
478
482
|
}), null), P((i) => {
|
|
479
|
-
var t = n.pending(), a = w() ? "tabpanel" : void 0, r = w() ? `${m}-${
|
|
483
|
+
var t = n.pending(), a = w() ? "tabpanel" : void 0, r = w() ? `${m}-${B()}` : void 0;
|
|
480
484
|
return t !== i.e && g(d, "aria-busy", i.e = t), a !== i.t && g(b, "role", i.t = a), r !== i.a && g(b, "aria-labelledby", i.a = r), i;
|
|
481
485
|
}, {
|
|
482
486
|
e: void 0,
|