@floegence/floe-webapp-core 0.33.4 → 0.33.6
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/components/file-browser/FileBrowser.d.ts +2 -0
- package/dist/components/file-browser/FileBrowser.js +101 -117
- package/dist/components/layout/SidebarPane.d.ts +19 -0
- package/dist/components/layout/SidebarPane.js +68 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/full.js +163 -161
- package/dist/layout.js +14 -12
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -30,6 +30,8 @@ export interface FileBrowserProps {
|
|
|
30
30
|
class?: string;
|
|
31
31
|
/** Custom header content */
|
|
32
32
|
header?: JSX.Element;
|
|
33
|
+
/** Actions rendered on the right side of the Explorer sidebar header */
|
|
34
|
+
sidebarHeaderActions?: JSX.Element;
|
|
33
35
|
/** Sidebar width in pixels */
|
|
34
36
|
sidebarWidth?: number;
|
|
35
37
|
/** Persisted sidebar width storage key (defaults to a shared user preference key) */
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { createComponent as n, insert as
|
|
2
|
-
import { onMount as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useLayout as
|
|
5
|
-
import { useFileBrowserDrag as
|
|
6
|
-
import { deferAfterPaint as
|
|
7
|
-
import { FileBrowserProvider as
|
|
8
|
-
import {
|
|
9
|
-
import { DirectoryTree as
|
|
10
|
-
import { FileListView as
|
|
11
|
-
import { FileGridView as
|
|
12
|
-
import { FileBrowserToolbar as
|
|
13
|
-
import { FileContextMenu as
|
|
14
|
-
import { DragPreview as
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
return n(
|
|
1
|
+
import { createComponent as n, insert as i, use as P, memo as _, effect as k, className as z, template as w, delegateEvents as W } from "solid-js/web";
|
|
2
|
+
import { onMount as A, onCleanup as K, createEffect as L, Show as u } from "solid-js";
|
|
3
|
+
import { cn as B } from "../../utils/cn.js";
|
|
4
|
+
import { useLayout as O } from "../../context/LayoutContext.js";
|
|
5
|
+
import { useFileBrowserDrag as E } from "../../context/FileBrowserDragContext.js";
|
|
6
|
+
import { deferAfterPaint as V } from "../../utils/defer.js";
|
|
7
|
+
import { FileBrowserProvider as H, useFileBrowser as N } from "./FileBrowserContext.js";
|
|
8
|
+
import { SidebarPane as T } from "../layout/SidebarPane.js";
|
|
9
|
+
import { DirectoryTree as j } from "./DirectoryTree.js";
|
|
10
|
+
import { FileListView as G } from "./FileListView.js";
|
|
11
|
+
import { FileGridView as Q } from "./FileGridView.js";
|
|
12
|
+
import { FileBrowserToolbar as q } from "./FileBrowserToolbar.js";
|
|
13
|
+
import { FileContextMenu as J } from "./FileContextMenu.js";
|
|
14
|
+
import { DragPreview as U } from "./DragPreview.js";
|
|
15
|
+
var X = /* @__PURE__ */ w('<div class="border-b border-border">'), Y = /* @__PURE__ */ w('<div><div class="flex flex-1 min-h-0 relative"><div class="flex-1 min-w-0 flex flex-col"><div class="flex-1 min-h-0"></div><div class="flex items-center justify-between px-3 py-1 border-t border-border text-[10px] text-muted-foreground"><span> items</span><span class="truncate max-w-[200px]">');
|
|
16
|
+
function me(e) {
|
|
17
|
+
return n(H, {
|
|
18
18
|
get files() {
|
|
19
19
|
return e.files;
|
|
20
20
|
},
|
|
@@ -55,13 +55,16 @@ function De(e) {
|
|
|
55
55
|
return e.onOpen;
|
|
56
56
|
},
|
|
57
57
|
get children() {
|
|
58
|
-
return n(
|
|
58
|
+
return n(Z, {
|
|
59
59
|
get class() {
|
|
60
60
|
return e.class;
|
|
61
61
|
},
|
|
62
62
|
get header() {
|
|
63
63
|
return e.header;
|
|
64
64
|
},
|
|
65
|
+
get sidebarHeaderActions() {
|
|
66
|
+
return e.sidebarHeaderActions;
|
|
67
|
+
},
|
|
65
68
|
get sidebarResizable() {
|
|
66
69
|
return e.sidebarResizable;
|
|
67
70
|
},
|
|
@@ -93,129 +96,124 @@ function De(e) {
|
|
|
93
96
|
}
|
|
94
97
|
});
|
|
95
98
|
}
|
|
96
|
-
function
|
|
97
|
-
const
|
|
98
|
-
let
|
|
99
|
-
|
|
100
|
-
if (!
|
|
101
|
-
const
|
|
102
|
-
instanceId:
|
|
103
|
-
currentPath:
|
|
104
|
-
files:
|
|
99
|
+
function Z(e) {
|
|
100
|
+
const t = N(), I = O(), o = E(), f = () => I.isMobile(), M = () => t.sidebarWidth(), S = () => e.sidebarResizable ?? !0, a = () => (e.enableDragDrop ?? !0) && !!o, s = () => e.instanceId ?? `filebrowser-${Math.random().toString(36).slice(2, 9)}`;
|
|
101
|
+
let h, C = null, x = null;
|
|
102
|
+
A(() => {
|
|
103
|
+
if (!o || !a()) return;
|
|
104
|
+
const r = {
|
|
105
|
+
instanceId: s(),
|
|
106
|
+
currentPath: t.currentPath,
|
|
107
|
+
files: t.files,
|
|
105
108
|
onDragMove: e.onDragMove,
|
|
106
|
-
getScrollContainer: () =>
|
|
107
|
-
getSidebarScrollContainer: () =>
|
|
108
|
-
optimisticRemove:
|
|
109
|
-
optimisticInsert:
|
|
109
|
+
getScrollContainer: () => C,
|
|
110
|
+
getSidebarScrollContainer: () => x,
|
|
111
|
+
optimisticRemove: t.optimisticRemove,
|
|
112
|
+
optimisticInsert: t.optimisticInsert
|
|
110
113
|
};
|
|
111
|
-
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
+
o.registerInstance(r);
|
|
115
|
+
}), K(() => {
|
|
116
|
+
o && a() && o.unregisterInstance(s());
|
|
114
117
|
});
|
|
115
|
-
let
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
119
|
-
|
|
118
|
+
let v = !1, g = !1;
|
|
119
|
+
L(() => {
|
|
120
|
+
const r = f();
|
|
121
|
+
if (!v) {
|
|
122
|
+
v = !0, g = r, r && e.hideSidebarOnMobile !== !1 && !t.sidebarCollapsed() && t.toggleSidebar();
|
|
120
123
|
return;
|
|
121
124
|
}
|
|
122
|
-
!
|
|
125
|
+
!g && r && e.hideSidebarOnMobile !== !1 && !t.sidebarCollapsed() && t.toggleSidebar(), g = r;
|
|
123
126
|
});
|
|
124
|
-
const
|
|
125
|
-
(
|
|
126
|
-
},
|
|
127
|
+
const D = (r) => {
|
|
128
|
+
(r.metaKey || r.ctrlKey) && r.key.toLowerCase() === "f" && (r.preventDefault(), t.setFilterActive(!0), V(() => h?.focus()));
|
|
129
|
+
}, y = () => !t.sidebarCollapsed() || !f();
|
|
127
130
|
return (() => {
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
var $ = v.nextSibling, x = c.nextSibling, b = x.firstChild, V = b.nextSibling, g = V.firstChild, A = g.firstChild, N = g.nextSibling;
|
|
131
|
-
return i.$$keydown = j, l(i, n(a, {
|
|
131
|
+
var r = Y(), m = r.firstChild, b = m.firstChild, c = b.firstChild, R = c.nextSibling, d = R.firstChild, $ = d.firstChild, F = d.nextSibling;
|
|
132
|
+
return r.$$keydown = D, i(r, n(u, {
|
|
132
133
|
get when() {
|
|
133
134
|
return e.header;
|
|
134
135
|
},
|
|
135
136
|
get children() {
|
|
136
|
-
var
|
|
137
|
-
return l
|
|
137
|
+
var l = X();
|
|
138
|
+
return i(l, () => e.header), l;
|
|
138
139
|
}
|
|
139
|
-
}),
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
}), m), i(m, n(T, {
|
|
141
|
+
title: "Explorer",
|
|
142
|
+
get width() {
|
|
143
|
+
return M();
|
|
142
144
|
},
|
|
143
|
-
get
|
|
144
|
-
|
|
145
|
-
return P(t, "click", r.toggleSidebar, !0), t;
|
|
146
|
-
}
|
|
147
|
-
}), null), L((t) => {
|
|
148
|
-
S = t;
|
|
149
|
-
}, $), l($, n(ee, {
|
|
150
|
-
get instanceId() {
|
|
151
|
-
return u();
|
|
145
|
+
get open() {
|
|
146
|
+
return y();
|
|
152
147
|
},
|
|
153
|
-
get
|
|
154
|
-
return
|
|
155
|
-
}
|
|
156
|
-
})), l(c, n(a, {
|
|
157
|
-
get when() {
|
|
158
|
-
return w(() => !!(E() && D()))() && !o();
|
|
148
|
+
get headerActions() {
|
|
149
|
+
return e.sidebarHeaderActions;
|
|
159
150
|
},
|
|
151
|
+
get resizable() {
|
|
152
|
+
return S();
|
|
153
|
+
},
|
|
154
|
+
onResize: (l) => {
|
|
155
|
+
t.setSidebarWidth(t.sidebarWidth() + l);
|
|
156
|
+
},
|
|
157
|
+
get onClose() {
|
|
158
|
+
return t.toggleSidebar;
|
|
159
|
+
},
|
|
160
|
+
bodyRef: (l) => {
|
|
161
|
+
x = l;
|
|
162
|
+
},
|
|
163
|
+
bodyClass: "py-1",
|
|
160
164
|
get children() {
|
|
161
|
-
return n(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
return n(j, {
|
|
166
|
+
get instanceId() {
|
|
167
|
+
return s();
|
|
168
|
+
},
|
|
169
|
+
get enableDragDrop() {
|
|
170
|
+
return a();
|
|
165
171
|
}
|
|
166
172
|
});
|
|
167
173
|
}
|
|
168
|
-
}),
|
|
174
|
+
}), b), i(b, n(q, {
|
|
175
|
+
filterInputRef: (l) => h = l
|
|
176
|
+
}), c), P((l) => {
|
|
177
|
+
C = l;
|
|
178
|
+
}, c), i(c, n(u, {
|
|
169
179
|
get when() {
|
|
170
|
-
return
|
|
171
|
-
},
|
|
172
|
-
get children() {
|
|
173
|
-
var t = se();
|
|
174
|
-
return P(t, "click", r.toggleSidebar, !0), t;
|
|
175
|
-
}
|
|
176
|
-
}), x), l(x, n(ie, {
|
|
177
|
-
filterInputRef: (t) => M = t
|
|
178
|
-
}), b), L((t) => {
|
|
179
|
-
I = t;
|
|
180
|
-
}, b), l(b, n(a, {
|
|
181
|
-
get when() {
|
|
182
|
-
return r.viewMode() === "list";
|
|
180
|
+
return t.viewMode() === "list";
|
|
183
181
|
},
|
|
184
182
|
get fallback() {
|
|
185
|
-
return n(
|
|
183
|
+
return n(Q, {
|
|
186
184
|
get instanceId() {
|
|
187
|
-
return
|
|
185
|
+
return s();
|
|
188
186
|
},
|
|
189
187
|
get enableDragDrop() {
|
|
190
|
-
return
|
|
188
|
+
return a();
|
|
191
189
|
}
|
|
192
190
|
});
|
|
193
191
|
},
|
|
194
192
|
get children() {
|
|
195
|
-
return n(
|
|
193
|
+
return n(G, {
|
|
196
194
|
get instanceId() {
|
|
197
|
-
return
|
|
195
|
+
return s();
|
|
198
196
|
},
|
|
199
197
|
get enableDragDrop() {
|
|
200
|
-
return
|
|
198
|
+
return a();
|
|
201
199
|
}
|
|
202
200
|
});
|
|
203
201
|
}
|
|
204
|
-
})),
|
|
202
|
+
})), i(d, () => t.currentFiles().length, $), i(d, n(u, {
|
|
205
203
|
get when() {
|
|
206
|
-
return
|
|
204
|
+
return t.filterQueryApplied().trim();
|
|
207
205
|
},
|
|
208
206
|
get children() {
|
|
209
207
|
return [" ", "(filtered)"];
|
|
210
208
|
}
|
|
211
|
-
}), null),
|
|
209
|
+
}), null), i(d, n(u, {
|
|
212
210
|
get when() {
|
|
213
|
-
return
|
|
211
|
+
return t.selectedItems().size > 0;
|
|
214
212
|
},
|
|
215
213
|
get children() {
|
|
216
|
-
return [" · ",
|
|
214
|
+
return [" · ", _(() => t.selectedItems().size), " selected"];
|
|
217
215
|
}
|
|
218
|
-
}), null),
|
|
216
|
+
}), null), i(F, () => t.currentPath()), i(r, n(J, {
|
|
219
217
|
get callbacks() {
|
|
220
218
|
return e.contextMenuCallbacks;
|
|
221
219
|
},
|
|
@@ -228,31 +226,17 @@ function ue(e) {
|
|
|
228
226
|
get hideItems() {
|
|
229
227
|
return e.hideContextMenuItems;
|
|
230
228
|
}
|
|
231
|
-
}), null),
|
|
229
|
+
}), null), i(r, n(u, {
|
|
232
230
|
get when() {
|
|
233
|
-
return
|
|
231
|
+
return a();
|
|
234
232
|
},
|
|
235
233
|
get children() {
|
|
236
|
-
return n(
|
|
234
|
+
return n(U, {});
|
|
237
235
|
}
|
|
238
|
-
}), null),
|
|
239
|
-
var _ = K("flex flex-col h-full min-h-0 bg-background", "border border-border rounded-lg overflow-hidden", "shadow-sm", e.class), R = K(
|
|
240
|
-
"flex-shrink-0 border-r border-border bg-sidebar relative",
|
|
241
|
-
"transition-all duration-200 ease-out",
|
|
242
|
-
"overflow-hidden",
|
|
243
|
-
// Mobile overlay
|
|
244
|
-
o() && !r.sidebarCollapsed() && "absolute inset-y-0 left-0 z-10 shadow-lg"
|
|
245
|
-
), z = D() ? `${C()}px` : "0px", F = `${C()}px`;
|
|
246
|
-
return _ !== t.e && W(i, t.e = _), R !== t.t && W(c, t.t = R), z !== t.a && B(c, "width", t.a = z), F !== t.o && B(k, "width", t.o = F), t;
|
|
247
|
-
}, {
|
|
248
|
-
e: void 0,
|
|
249
|
-
t: void 0,
|
|
250
|
-
a: void 0,
|
|
251
|
-
o: void 0
|
|
252
|
-
}), i;
|
|
236
|
+
}), null), k(() => z(r, B("flex flex-col h-full min-h-0 bg-background", "border border-border rounded-lg overflow-hidden", "shadow-sm", e.class))), r;
|
|
253
237
|
})();
|
|
254
238
|
}
|
|
255
|
-
|
|
239
|
+
W(["keydown"]);
|
|
256
240
|
export {
|
|
257
|
-
|
|
241
|
+
me as FileBrowser
|
|
258
242
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
export interface SidebarPaneProps {
|
|
3
|
+
children: JSX.Element;
|
|
4
|
+
title?: JSX.Element;
|
|
5
|
+
headerActions?: JSX.Element;
|
|
6
|
+
width?: number;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
resizable?: boolean;
|
|
9
|
+
onResize?: (delta: number) => void;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
mobileOverlay?: boolean;
|
|
12
|
+
mobileBackdrop?: boolean;
|
|
13
|
+
class?: string;
|
|
14
|
+
innerClass?: string;
|
|
15
|
+
bodyClass?: string;
|
|
16
|
+
backdropClass?: string;
|
|
17
|
+
bodyRef?: (el: HTMLDivElement) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function SidebarPane(props: SidebarPaneProps): JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { insert as i, createComponent as o, use as M, effect as k, className as a, setStyleProperty as C, template as s, delegateEvents as S } from "solid-js/web";
|
|
2
|
+
import { Show as l } from "solid-js";
|
|
3
|
+
import { useLayout as j } from "../../context/LayoutContext.js";
|
|
4
|
+
import { cn as d } from "../../utils/cn.js";
|
|
5
|
+
import { ResizeHandle as A } from "./ResizeHandle.js";
|
|
6
|
+
var O = /* @__PURE__ */ s('<div class="min-w-0 flex items-center gap-1.5">'), P = /* @__PURE__ */ s('<button type=button class="flex items-center justify-center w-5 h-5 rounded cursor-pointer hover:bg-sidebar-accent/80 transition-colors"aria-label="Close sidebar"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class="w-3.5 h-3.5"><path d="M18 6 6 18"></path><path d="m6 6 12 12">'), E = /* @__PURE__ */ s('<div class="flex min-w-0 items-center gap-1.5">'), H = /* @__PURE__ */ s('<aside><div><div class="flex items-center justify-between px-3 py-2 border-b border-sidebar-border"><span class="text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60"></span></div><div>'), L = /* @__PURE__ */ s("<div>");
|
|
7
|
+
function I(e) {
|
|
8
|
+
const z = j(), v = () => z.isMobile(), m = () => e.width ?? 240, c = () => e.open ?? !0, u = () => v() && e.mobileOverlay !== !1 && c(), w = () => u() && typeof e.onClose == "function", _ = () => u() && e.mobileBackdrop !== !1 && typeof e.onClose == "function", R = () => e.resizable && c() && !v() && typeof e.onResize == "function";
|
|
9
|
+
return [(() => {
|
|
10
|
+
var n = H(), h = n.firstChild, f = h.firstChild, B = f.firstChild, b = f.nextSibling;
|
|
11
|
+
return i(B, () => e.title), i(f, o(l, {
|
|
12
|
+
get when() {
|
|
13
|
+
return e.headerActions || w();
|
|
14
|
+
},
|
|
15
|
+
get children() {
|
|
16
|
+
var t = E();
|
|
17
|
+
return i(t, o(l, {
|
|
18
|
+
get when() {
|
|
19
|
+
return e.headerActions;
|
|
20
|
+
},
|
|
21
|
+
get children() {
|
|
22
|
+
var r = O();
|
|
23
|
+
return i(r, () => e.headerActions), r;
|
|
24
|
+
}
|
|
25
|
+
}), null), i(t, o(l, {
|
|
26
|
+
get when() {
|
|
27
|
+
return w();
|
|
28
|
+
},
|
|
29
|
+
get children() {
|
|
30
|
+
var r = P();
|
|
31
|
+
return r.$$click = () => e.onClose?.(), r;
|
|
32
|
+
}
|
|
33
|
+
}), null), t;
|
|
34
|
+
}
|
|
35
|
+
}), null), M((t) => e.bodyRef?.(t), b), i(b, () => e.children), i(n, o(l, {
|
|
36
|
+
get when() {
|
|
37
|
+
return R();
|
|
38
|
+
},
|
|
39
|
+
get children() {
|
|
40
|
+
return o(A, {
|
|
41
|
+
direction: "horizontal",
|
|
42
|
+
onResize: (t) => e.onResize?.(t)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}), null), k((t) => {
|
|
46
|
+
var r = d("flex-shrink-0 border-r border-border bg-sidebar relative", "transition-all duration-200 ease-out", "overflow-hidden", u() && "absolute inset-y-0 left-0 z-10 shadow-lg", e.class), g = c() ? `${m()}px` : "0px", x = d("h-full flex flex-col", e.innerClass), y = `${m()}px`, $ = d("flex-1 min-h-0 overflow-auto", e.bodyClass);
|
|
47
|
+
return r !== t.e && a(n, t.e = r), g !== t.t && C(n, "width", t.t = g), x !== t.a && a(h, t.a = x), y !== t.o && C(h, "width", t.o = y), $ !== t.i && a(b, t.i = $), t;
|
|
48
|
+
}, {
|
|
49
|
+
e: void 0,
|
|
50
|
+
t: void 0,
|
|
51
|
+
a: void 0,
|
|
52
|
+
o: void 0,
|
|
53
|
+
i: void 0
|
|
54
|
+
}), n;
|
|
55
|
+
})(), o(l, {
|
|
56
|
+
get when() {
|
|
57
|
+
return _();
|
|
58
|
+
},
|
|
59
|
+
get children() {
|
|
60
|
+
var n = L();
|
|
61
|
+
return n.$$click = () => e.onClose?.(), k(() => a(n, d("absolute inset-0 bg-background/60 backdrop-blur-sm z-[9]", e.backdropClass))), n;
|
|
62
|
+
}
|
|
63
|
+
})];
|
|
64
|
+
}
|
|
65
|
+
S(["click"]);
|
|
66
|
+
export {
|
|
67
|
+
I as SidebarPane
|
|
68
|
+
};
|
|
@@ -6,5 +6,6 @@ export { TopBarIconButton, type TopBarIconButtonProps } from './TopBarIconButton
|
|
|
6
6
|
export { BottomBar, BottomBarItem, StatusIndicator, type BottomBarProps, type BottomBarItemProps, type StatusIndicatorProps } from './BottomBar';
|
|
7
7
|
export { MobileTabBar, type MobileTabBarItem, type MobileTabBarProps } from './MobileTabBar';
|
|
8
8
|
export { ResizeHandle, type ResizeHandleProps } from './ResizeHandle';
|
|
9
|
+
export { SidebarPane, type SidebarPaneProps } from './SidebarPane';
|
|
9
10
|
export { Panel, PanelHeader, PanelContent, type PanelProps, type PanelHeaderProps, type PanelContentProps } from './Panel';
|
|
10
11
|
export { KeepAliveStack, type KeepAliveStackProps, type KeepAliveView } from './KeepAliveStack';
|