@floegence/floe-webapp-core 0.60.0 → 0.60.2
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/app/ActivityAppsMain.d.ts +2 -0
- package/dist/app/ActivityAppsMain.js +15 -12
- package/dist/components/file-browser/Breadcrumb.js +6 -6
- package/dist/components/file-browser/FileGridView.js +29 -27
- package/dist/components/file-browser/FileListView.js +15 -13
- package/dist/components/layout/KeepAliveStack.d.ts +2 -0
- package/dist/components/layout/KeepAliveStack.js +118 -101
- package/dist/components/ui/DirectoryPicker.d.ts +1 -1
- package/dist/components/ui/DirectoryPicker.js +36 -52
- package/dist/components/ui/picker/PickerBase.d.ts +6 -0
- package/dist/components/ui/picker/PickerBase.js +345 -232
- package/dist/context/ViewActivationContext.d.ts +4 -1
- package/dist/context/ViewActivationContext.js +14 -11
- package/dist/hooks/useResizeObserver.d.ts +5 -1
- package/dist/hooks/useResizeObserver.js +13 -14
- package/dist/hooks/useVirtualWindow.js +13 -13
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,154 +1,171 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createMemo as
|
|
3
|
-
import { ViewActivationProvider as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { deferAfterPaint as
|
|
6
|
-
var
|
|
1
|
+
import { insert as P, createComponent as g, effect as B, className as E, setStyleProperty as K, template as R, memo as N, setAttribute as z } from "solid-js/web";
|
|
2
|
+
import { createMemo as S, createSignal as k, untrack as F, createEffect as x, For as j, createRenderEffect as D, onCleanup as G, Suspense as H } from "solid-js";
|
|
3
|
+
import { ViewActivationProvider as J } from "../../context/ViewActivationContext.js";
|
|
4
|
+
import { cn as V } from "../../utils/cn.js";
|
|
5
|
+
import { deferAfterPaint as L } from "../../utils/defer.js";
|
|
6
|
+
var O = /* @__PURE__ */ R("<div>");
|
|
7
7
|
function M(e) {
|
|
8
8
|
return String(e ?? "").trim();
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const u = [],
|
|
10
|
+
function C(e) {
|
|
11
|
+
const u = [], s = /* @__PURE__ */ new Set();
|
|
12
12
|
for (const f of e) {
|
|
13
|
-
const
|
|
14
|
-
|
|
13
|
+
const a = M(f?.id);
|
|
14
|
+
a && (s.has(a) || (s.add(a), u.push(a)));
|
|
15
15
|
}
|
|
16
16
|
return u;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
for (const
|
|
21
|
-
const
|
|
22
|
-
|
|
18
|
+
function Q(e, u) {
|
|
19
|
+
const s = new Set(e), f = /* @__PURE__ */ new Map();
|
|
20
|
+
for (const a of u) {
|
|
21
|
+
const d = M(a?.id);
|
|
22
|
+
d && s.has(d) && (f.has(d) || f.set(d, a));
|
|
23
23
|
}
|
|
24
24
|
return f;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
const [u,
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
34
|
-
|
|
26
|
+
function T(e) {
|
|
27
|
+
const [u, s] = k(0), [f, a] = k(!1);
|
|
28
|
+
let d = 0;
|
|
29
|
+
D(() => {
|
|
30
|
+
const c = e.active(), t = e.activationMode();
|
|
31
|
+
d += 1;
|
|
32
|
+
const h = d;
|
|
33
|
+
if (!c) {
|
|
34
|
+
a(!1);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
const v = () => {
|
|
38
|
-
|
|
38
|
+
h !== d || !e.active() || F(f) || (a(!0), s((w) => w + 1));
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
|
|
40
|
+
t === "after-paint" ? L(v) : v();
|
|
41
|
+
}), G(() => {
|
|
42
|
+
d += 1;
|
|
43
43
|
});
|
|
44
|
-
const A =
|
|
44
|
+
const A = F(() => ({
|
|
45
45
|
id: e.id,
|
|
46
|
+
visible: e.active,
|
|
46
47
|
active: f,
|
|
47
48
|
activationSeq: u
|
|
48
49
|
}));
|
|
49
|
-
return g(
|
|
50
|
+
return g(J, {
|
|
50
51
|
value: A,
|
|
51
52
|
get children() {
|
|
52
|
-
var
|
|
53
|
-
return
|
|
54
|
-
var
|
|
55
|
-
return
|
|
53
|
+
var c = O();
|
|
54
|
+
return P(c, (() => {
|
|
55
|
+
var t = N(() => !!e.renderFallback);
|
|
56
|
+
return () => t() ? g(H, {
|
|
57
|
+
get fallback() {
|
|
58
|
+
return e.renderFallback(e.id);
|
|
59
|
+
},
|
|
60
|
+
get children() {
|
|
61
|
+
return e.children;
|
|
62
|
+
}
|
|
63
|
+
}) : e.children;
|
|
64
|
+
})()), B((t) => {
|
|
65
|
+
var h = e.class, v = e.id, w = e.active() ? void 0 : "true", b = !e.active(), y = e.active() ? "block" : "none";
|
|
66
|
+
return h !== t.e && E(c, t.e = h), v !== t.t && z(c, "data-floe-keep-alive-view", t.t = v), w !== t.a && z(c, "aria-hidden", t.a = w), b !== t.o && (c.inert = t.o = b), y !== t.i && K(c, "display", t.i = y), t;
|
|
56
67
|
}, {
|
|
57
68
|
e: void 0,
|
|
58
|
-
t: void 0
|
|
59
|
-
|
|
69
|
+
t: void 0,
|
|
70
|
+
a: void 0,
|
|
71
|
+
o: void 0,
|
|
72
|
+
i: void 0
|
|
73
|
+
}), c;
|
|
60
74
|
}
|
|
61
75
|
});
|
|
62
76
|
}
|
|
63
|
-
function
|
|
64
|
-
const u = () => e.lazyMount !== !1,
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
A((
|
|
68
|
-
let
|
|
69
|
-
const l = new Map(
|
|
70
|
-
for (const
|
|
71
|
-
|
|
72
|
-
for (const
|
|
73
|
-
const
|
|
74
|
-
|
|
77
|
+
function _(e) {
|
|
78
|
+
const u = () => e.lazyMount !== !1, s = () => e.keepMounted !== !1, f = () => e.activationMode ?? "sync", a = S(() => C(e.views)), [d, A] = k(F(() => Q(C(e.views), e.views))), c = S(() => M(e.activeId));
|
|
79
|
+
x(() => {
|
|
80
|
+
const n = a(), i = e.views;
|
|
81
|
+
A((r) => {
|
|
82
|
+
let o = !1;
|
|
83
|
+
const l = new Map(r), q = new Set(n);
|
|
84
|
+
for (const m of l.keys())
|
|
85
|
+
q.has(m) || (l.delete(m), o = !0);
|
|
86
|
+
for (const m of i) {
|
|
87
|
+
const I = M(m?.id);
|
|
88
|
+
I && q.has(I) && (l.has(I) || (l.set(I, m), o = !0));
|
|
75
89
|
}
|
|
76
|
-
return
|
|
90
|
+
return o ? l : r;
|
|
77
91
|
});
|
|
78
92
|
});
|
|
79
|
-
const
|
|
80
|
-
order:
|
|
81
|
-
byId:
|
|
82
|
-
})),
|
|
83
|
-
if (!
|
|
84
|
-
if (!u()) return new Set(
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
}, [v,
|
|
88
|
-
|
|
89
|
-
if (!
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
let
|
|
93
|
-
const
|
|
94
|
-
for (const l of
|
|
95
|
-
if (!
|
|
96
|
-
|
|
93
|
+
const t = S(() => ({
|
|
94
|
+
order: a(),
|
|
95
|
+
byId: d()
|
|
96
|
+
})), h = () => {
|
|
97
|
+
if (!s()) return /* @__PURE__ */ new Set();
|
|
98
|
+
if (!u()) return new Set(t().order);
|
|
99
|
+
const n = c();
|
|
100
|
+
return n ? t().byId.has(n) ? /* @__PURE__ */ new Set([n]) : /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set();
|
|
101
|
+
}, [v, w] = k(h());
|
|
102
|
+
x(() => {
|
|
103
|
+
if (!s()) return;
|
|
104
|
+
const n = new Set(t().order);
|
|
105
|
+
w((i) => {
|
|
106
|
+
let r = !1;
|
|
107
|
+
const o = /* @__PURE__ */ new Set();
|
|
108
|
+
for (const l of i) {
|
|
109
|
+
if (!n.has(l)) {
|
|
110
|
+
r = !0;
|
|
97
111
|
continue;
|
|
98
112
|
}
|
|
99
|
-
|
|
113
|
+
o.add(l);
|
|
100
114
|
}
|
|
101
|
-
return
|
|
115
|
+
return r ? o : i;
|
|
102
116
|
});
|
|
103
|
-
}),
|
|
104
|
-
if (!
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
return
|
|
117
|
+
}), x(() => {
|
|
118
|
+
if (!s() || !u()) return;
|
|
119
|
+
const n = c();
|
|
120
|
+
n && t().byId.has(n) && w((i) => {
|
|
121
|
+
if (i.has(n)) return i;
|
|
122
|
+
const r = new Set(i);
|
|
123
|
+
return r.add(n), r;
|
|
110
124
|
});
|
|
111
125
|
});
|
|
112
|
-
const
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
115
|
-
return
|
|
116
|
-
if (!u()) return
|
|
117
|
-
const
|
|
118
|
-
return
|
|
119
|
-
}),
|
|
120
|
-
const
|
|
121
|
-
return
|
|
126
|
+
const b = S(() => {
|
|
127
|
+
const n = t().order, i = c();
|
|
128
|
+
if (!s())
|
|
129
|
+
return i ? t().byId.has(i) ? [i] : [] : [];
|
|
130
|
+
if (!u()) return n;
|
|
131
|
+
const r = v();
|
|
132
|
+
return n.filter((o) => r.has(o) || o === i);
|
|
133
|
+
}), y = S(() => {
|
|
134
|
+
const n = c();
|
|
135
|
+
return n ? t().byId.has(n) : !1;
|
|
122
136
|
});
|
|
123
137
|
return (() => {
|
|
124
|
-
var
|
|
125
|
-
return
|
|
138
|
+
var n = O();
|
|
139
|
+
return P(n, g(j, {
|
|
126
140
|
get each() {
|
|
127
|
-
return
|
|
141
|
+
return b();
|
|
128
142
|
},
|
|
129
|
-
children: (
|
|
130
|
-
const
|
|
131
|
-
return g(
|
|
132
|
-
id:
|
|
133
|
-
active: () =>
|
|
143
|
+
children: (i) => {
|
|
144
|
+
const r = () => d().get(i);
|
|
145
|
+
return g(T, {
|
|
146
|
+
id: i,
|
|
147
|
+
active: () => c() === i,
|
|
134
148
|
activationMode: f,
|
|
149
|
+
get renderFallback() {
|
|
150
|
+
return e.renderFallback;
|
|
151
|
+
},
|
|
135
152
|
get class() {
|
|
136
|
-
return
|
|
153
|
+
return V("absolute inset-0", r()?.class);
|
|
137
154
|
},
|
|
138
155
|
get children() {
|
|
139
|
-
return
|
|
156
|
+
return r()?.render();
|
|
140
157
|
}
|
|
141
158
|
});
|
|
142
159
|
}
|
|
143
|
-
})),
|
|
144
|
-
var
|
|
145
|
-
return
|
|
160
|
+
})), B((i) => {
|
|
161
|
+
var r = V("relative h-full min-h-0 w-full", e.class), o = y() ? "block" : "none";
|
|
162
|
+
return r !== i.e && E(n, i.e = r), o !== i.t && K(n, "display", i.t = o), i;
|
|
146
163
|
}, {
|
|
147
164
|
e: void 0,
|
|
148
165
|
t: void 0
|
|
149
|
-
}),
|
|
166
|
+
}), n;
|
|
150
167
|
})();
|
|
151
168
|
}
|
|
152
169
|
export {
|
|
153
|
-
|
|
170
|
+
_ as KeepAliveStack
|
|
154
171
|
};
|
|
@@ -2,7 +2,7 @@ import { type BasePickerProps } from './picker/PickerBase';
|
|
|
2
2
|
export interface DirectoryPickerProps extends BasePickerProps {
|
|
3
3
|
/** Ordered absolute navigation suggestions. They never grant filesystem access or auto-confirm. */
|
|
4
4
|
suggestedPaths?: readonly string[];
|
|
5
|
-
/** Localized
|
|
5
|
+
/** Localized tab label for host-provided suggestions. */
|
|
6
6
|
suggestedPathsLabel?: string;
|
|
7
7
|
/** Receives the validated absolute directory path. */
|
|
8
8
|
onSelect: (path: string) => void;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createMemo as
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const t = r.currentPath();
|
|
1
|
+
import { createComponent as r, mergeProps as m, insert as a, effect as f, setAttribute as d, template as h } from "solid-js/web";
|
|
2
|
+
import { createMemo as P, createSignal as b } from "solid-js";
|
|
3
|
+
import { cn as v } from "../../utils/cn.js";
|
|
4
|
+
import { Button as o } from "./Button.js";
|
|
5
|
+
import { Dialog as C } from "./Dialog.js";
|
|
6
|
+
import { usePickerNavigation as x, PickerPanel as S, pickerCopy as k } from "./picker/PickerBase.js";
|
|
7
|
+
import { parsePickerPath as w } from "./picker/PickerNavigation.js";
|
|
8
|
+
var y = /* @__PURE__ */ h('<div class="flex w-full items-center gap-2"><span class="min-w-0 flex-1 truncate text-[11px] text-muted-foreground">');
|
|
9
|
+
function T(e) {
|
|
10
|
+
const l = P(() => [...new Set((e.suggestedPaths ?? []).map((t) => w(t)).filter(Boolean))]), [g, s] = b(!0), i = () => l().length > 0 && g(), n = x(e, () => e.open, void 0, () => s(!0)), u = () => {
|
|
11
|
+
if (e.disabled || i() || !n.valid()) return;
|
|
12
|
+
const t = n.currentPath();
|
|
14
13
|
e.onSelect(t), e.onOpenChange(!1);
|
|
15
14
|
};
|
|
16
|
-
return
|
|
15
|
+
return r(C, {
|
|
17
16
|
get open() {
|
|
18
17
|
return e.open;
|
|
19
18
|
},
|
|
@@ -24,65 +23,50 @@ function I(e) {
|
|
|
24
23
|
return e.title ?? "Select Directory";
|
|
25
24
|
},
|
|
26
25
|
get class() {
|
|
27
|
-
return
|
|
26
|
+
return v("max-w-lg", e.class);
|
|
28
27
|
},
|
|
29
28
|
get footer() {
|
|
30
29
|
return (() => {
|
|
31
|
-
var t =
|
|
32
|
-
return
|
|
30
|
+
var t = y(), c = t.firstChild;
|
|
31
|
+
return a(c, () => n.currentPath()), a(t, r(o, {
|
|
33
32
|
variant: "ghost",
|
|
34
33
|
size: "sm",
|
|
35
34
|
onClick: () => e.onOpenChange(!1),
|
|
36
35
|
get children() {
|
|
37
|
-
return e.cancelText ??
|
|
36
|
+
return e.cancelText ?? k(e).cancel;
|
|
38
37
|
}
|
|
39
|
-
}), null),
|
|
38
|
+
}), null), a(t, r(o, {
|
|
40
39
|
variant: "primary",
|
|
41
40
|
size: "sm",
|
|
42
|
-
onClick:
|
|
41
|
+
onClick: u,
|
|
43
42
|
get disabled() {
|
|
44
|
-
return !
|
|
43
|
+
return e.disabled || i() || !n.valid();
|
|
45
44
|
},
|
|
46
45
|
get children() {
|
|
47
46
|
return e.confirmText ?? "Select";
|
|
48
47
|
}
|
|
49
|
-
}), null),
|
|
48
|
+
}), null), f(() => d(c, "title", n.currentPath())), t;
|
|
50
49
|
})();
|
|
51
50
|
},
|
|
52
51
|
get children() {
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
r.navigate(l);
|
|
67
|
-
}, o(n, "data-picker-suggested-path", l), o(n, "title", l), o(n, "aria-label", l), i(n, a(p, {
|
|
68
|
-
class: "h-4 w-4 shrink-0 text-muted-foreground"
|
|
69
|
-
}), m), i(f, () => l.split("/").filter(Boolean).at(-1) ?? b(e).root), i(k, l), u((c) => {
|
|
70
|
-
var h = r.currentPath() === l ? "location" : void 0, x = e.disabled || !r.context();
|
|
71
|
-
return h !== c.e && o(n, "aria-current", c.e = h), x !== c.t && (n.disabled = c.t = x), c;
|
|
72
|
-
}, {
|
|
73
|
-
e: void 0,
|
|
74
|
-
t: void 0
|
|
75
|
-
}), n;
|
|
76
|
-
})()
|
|
77
|
-
}), null), u(() => o(t, "aria-label", e.suggestedPathsLabel ?? "Suggested directories")), t;
|
|
52
|
+
return r(S, m(e, {
|
|
53
|
+
source: n,
|
|
54
|
+
suggestions: {
|
|
55
|
+
get paths() {
|
|
56
|
+
return l();
|
|
57
|
+
},
|
|
58
|
+
get label() {
|
|
59
|
+
return e.suggestedPathsLabel ?? "Suggested directories";
|
|
60
|
+
},
|
|
61
|
+
get visible() {
|
|
62
|
+
return i();
|
|
63
|
+
},
|
|
64
|
+
onVisibilityChange: s
|
|
78
65
|
}
|
|
79
|
-
})
|
|
80
|
-
source: r
|
|
81
|
-
}))];
|
|
66
|
+
}));
|
|
82
67
|
}
|
|
83
68
|
});
|
|
84
69
|
}
|
|
85
|
-
w(["click"]);
|
|
86
70
|
export {
|
|
87
|
-
|
|
71
|
+
T as DirectoryPicker
|
|
88
72
|
};
|
|
@@ -62,6 +62,12 @@ export declare function usePickerNavigation(props: PickerDataProps, open: Access
|
|
|
62
62
|
/** Absolute directory navigation shared by all picker presentations. */
|
|
63
63
|
export declare function PickerPanel(props: PickerPanelProps & {
|
|
64
64
|
source: FilesystemPickerDataSource;
|
|
65
|
+
suggestions?: {
|
|
66
|
+
paths: readonly string[];
|
|
67
|
+
label: string;
|
|
68
|
+
visible: boolean;
|
|
69
|
+
onVisibilityChange: (visible: boolean) => void;
|
|
70
|
+
};
|
|
65
71
|
}): JSX.Element;
|
|
66
72
|
export declare const normalizePath: typeof parsePickerPath;
|
|
67
73
|
export { pickerParentPath as getParentPath } from './PickerNavigation';
|