@floegence/floe-webapp-core 0.33.5 → 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.js +97 -132
- 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
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { onMount as
|
|
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
3
|
import { cn as B } from "../../utils/cn.js";
|
|
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
|
|
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,7 +55,7 @@ function ke(e) {
|
|
|
55
55
|
return e.onOpen;
|
|
56
56
|
},
|
|
57
57
|
get children() {
|
|
58
|
-
return
|
|
58
|
+
return n(Z, {
|
|
59
59
|
get class() {
|
|
60
60
|
return e.class;
|
|
61
61
|
},
|
|
@@ -96,145 +96,124 @@ function ke(e) {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
const
|
|
101
|
-
let
|
|
102
|
-
|
|
103
|
-
if (!
|
|
104
|
-
const
|
|
105
|
-
instanceId:
|
|
106
|
-
currentPath:
|
|
107
|
-
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,
|
|
108
108
|
onDragMove: e.onDragMove,
|
|
109
|
-
getScrollContainer: () =>
|
|
110
|
-
getSidebarScrollContainer: () =>
|
|
111
|
-
optimisticRemove:
|
|
112
|
-
optimisticInsert:
|
|
109
|
+
getScrollContainer: () => C,
|
|
110
|
+
getSidebarScrollContainer: () => x,
|
|
111
|
+
optimisticRemove: t.optimisticRemove,
|
|
112
|
+
optimisticInsert: t.optimisticInsert
|
|
113
113
|
};
|
|
114
|
-
|
|
115
|
-
}),
|
|
116
|
-
|
|
114
|
+
o.registerInstance(r);
|
|
115
|
+
}), K(() => {
|
|
116
|
+
o && a() && o.unregisterInstance(s());
|
|
117
117
|
});
|
|
118
|
-
let
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
|
|
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();
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
!
|
|
125
|
+
!g && r && e.hideSidebarOnMobile !== !1 && !t.sidebarCollapsed() && t.toggleSidebar(), g = r;
|
|
126
126
|
});
|
|
127
|
-
const
|
|
128
|
-
(
|
|
129
|
-
},
|
|
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();
|
|
130
130
|
return (() => {
|
|
131
|
-
var
|
|
132
|
-
|
|
133
|
-
var _ = x.nextSibling, w = b.nextSibling, h = w.firstChild, E = h.nextSibling, m = E.firstChild, j = m.firstChild, V = m.nextSibling;
|
|
134
|
-
return n.$$keydown = O, l(n, i(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, {
|
|
135
133
|
get when() {
|
|
136
134
|
return e.header;
|
|
137
135
|
},
|
|
138
136
|
get children() {
|
|
139
|
-
var
|
|
140
|
-
return l
|
|
137
|
+
var l = X();
|
|
138
|
+
return i(l, () => e.header), l;
|
|
141
139
|
}
|
|
142
|
-
}),
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
}), m), i(m, n(T, {
|
|
141
|
+
title: "Explorer",
|
|
142
|
+
get width() {
|
|
143
|
+
return M();
|
|
145
144
|
},
|
|
146
|
-
get
|
|
147
|
-
|
|
148
|
-
return l(t, i(a, {
|
|
149
|
-
get when() {
|
|
150
|
-
return e.sidebarHeaderActions;
|
|
151
|
-
},
|
|
152
|
-
get children() {
|
|
153
|
-
var o = oe();
|
|
154
|
-
return l(o, () => e.sidebarHeaderActions), o;
|
|
155
|
-
}
|
|
156
|
-
}), null), l(t, i(a, {
|
|
157
|
-
get when() {
|
|
158
|
-
return s();
|
|
159
|
-
},
|
|
160
|
-
get children() {
|
|
161
|
-
var o = se();
|
|
162
|
-
return P(o, "click", r.toggleSidebar, !0), o;
|
|
163
|
-
}
|
|
164
|
-
}), null), t;
|
|
165
|
-
}
|
|
166
|
-
}), null), A((t) => {
|
|
167
|
-
y = t;
|
|
168
|
-
}, _), l(_, i(ee, {
|
|
169
|
-
get instanceId() {
|
|
170
|
-
return g();
|
|
145
|
+
get open() {
|
|
146
|
+
return y();
|
|
171
147
|
},
|
|
172
|
-
get
|
|
173
|
-
return
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
148
|
+
get headerActions() {
|
|
149
|
+
return e.sidebarHeaderActions;
|
|
150
|
+
},
|
|
151
|
+
get resizable() {
|
|
152
|
+
return S();
|
|
153
|
+
},
|
|
154
|
+
onResize: (l) => {
|
|
155
|
+
t.setSidebarWidth(t.sidebarWidth() + l);
|
|
178
156
|
},
|
|
157
|
+
get onClose() {
|
|
158
|
+
return t.toggleSidebar;
|
|
159
|
+
},
|
|
160
|
+
bodyRef: (l) => {
|
|
161
|
+
x = l;
|
|
162
|
+
},
|
|
163
|
+
bodyClass: "py-1",
|
|
179
164
|
get children() {
|
|
180
|
-
return
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
165
|
+
return n(j, {
|
|
166
|
+
get instanceId() {
|
|
167
|
+
return s();
|
|
168
|
+
},
|
|
169
|
+
get enableDragDrop() {
|
|
170
|
+
return a();
|
|
184
171
|
}
|
|
185
172
|
});
|
|
186
173
|
}
|
|
187
|
-
}),
|
|
174
|
+
}), b), i(b, n(q, {
|
|
175
|
+
filterInputRef: (l) => h = l
|
|
176
|
+
}), c), P((l) => {
|
|
177
|
+
C = l;
|
|
178
|
+
}, c), i(c, n(u, {
|
|
188
179
|
get when() {
|
|
189
|
-
return
|
|
190
|
-
},
|
|
191
|
-
get children() {
|
|
192
|
-
var t = ue();
|
|
193
|
-
return P(t, "click", r.toggleSidebar, !0), t;
|
|
194
|
-
}
|
|
195
|
-
}), w), l(w, i(ne, {
|
|
196
|
-
filterInputRef: (t) => I = t
|
|
197
|
-
}), h), A((t) => {
|
|
198
|
-
S = t;
|
|
199
|
-
}, h), l(h, i(a, {
|
|
200
|
-
get when() {
|
|
201
|
-
return r.viewMode() === "list";
|
|
180
|
+
return t.viewMode() === "list";
|
|
202
181
|
},
|
|
203
182
|
get fallback() {
|
|
204
|
-
return
|
|
183
|
+
return n(Q, {
|
|
205
184
|
get instanceId() {
|
|
206
|
-
return
|
|
185
|
+
return s();
|
|
207
186
|
},
|
|
208
187
|
get enableDragDrop() {
|
|
209
|
-
return
|
|
188
|
+
return a();
|
|
210
189
|
}
|
|
211
190
|
});
|
|
212
191
|
},
|
|
213
192
|
get children() {
|
|
214
|
-
return
|
|
193
|
+
return n(G, {
|
|
215
194
|
get instanceId() {
|
|
216
|
-
return
|
|
195
|
+
return s();
|
|
217
196
|
},
|
|
218
197
|
get enableDragDrop() {
|
|
219
|
-
return
|
|
198
|
+
return a();
|
|
220
199
|
}
|
|
221
200
|
});
|
|
222
201
|
}
|
|
223
|
-
})),
|
|
202
|
+
})), i(d, () => t.currentFiles().length, $), i(d, n(u, {
|
|
224
203
|
get when() {
|
|
225
|
-
return
|
|
204
|
+
return t.filterQueryApplied().trim();
|
|
226
205
|
},
|
|
227
206
|
get children() {
|
|
228
207
|
return [" ", "(filtered)"];
|
|
229
208
|
}
|
|
230
|
-
}), null),
|
|
209
|
+
}), null), i(d, n(u, {
|
|
231
210
|
get when() {
|
|
232
|
-
return
|
|
211
|
+
return t.selectedItems().size > 0;
|
|
233
212
|
},
|
|
234
213
|
get children() {
|
|
235
|
-
return [" · ",
|
|
214
|
+
return [" · ", _(() => t.selectedItems().size), " selected"];
|
|
236
215
|
}
|
|
237
|
-
}), null),
|
|
216
|
+
}), null), i(F, () => t.currentPath()), i(r, n(J, {
|
|
238
217
|
get callbacks() {
|
|
239
218
|
return e.contextMenuCallbacks;
|
|
240
219
|
},
|
|
@@ -247,31 +226,17 @@ function ge(e) {
|
|
|
247
226
|
get hideItems() {
|
|
248
227
|
return e.hideContextMenuItems;
|
|
249
228
|
}
|
|
250
|
-
}), null),
|
|
229
|
+
}), null), i(r, n(u, {
|
|
251
230
|
get when() {
|
|
252
|
-
return
|
|
231
|
+
return a();
|
|
253
232
|
},
|
|
254
233
|
get children() {
|
|
255
|
-
return
|
|
234
|
+
return n(U, {});
|
|
256
235
|
}
|
|
257
|
-
}), null),
|
|
258
|
-
var o = B("flex flex-col h-full min-h-0 bg-background", "border border-border rounded-lg overflow-hidden", "shadow-sm", e.class), R = B(
|
|
259
|
-
"flex-shrink-0 border-r border-border bg-sidebar relative",
|
|
260
|
-
"transition-all duration-200 ease-out",
|
|
261
|
-
"overflow-hidden",
|
|
262
|
-
// Mobile overlay
|
|
263
|
-
s() && !r.sidebarCollapsed() && "absolute inset-y-0 left-0 z-10 shadow-lg"
|
|
264
|
-
), z = D() ? `${M()}px` : "0px", F = `${M()}px`;
|
|
265
|
-
return o !== t.e && L(n, t.e = o), R !== t.t && L(b, t.t = R), z !== t.a && W(b, "width", t.a = z), F !== t.o && W(k, "width", t.o = F), t;
|
|
266
|
-
}, {
|
|
267
|
-
e: void 0,
|
|
268
|
-
t: void 0,
|
|
269
|
-
a: void 0,
|
|
270
|
-
o: void 0
|
|
271
|
-
}), n;
|
|
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;
|
|
272
237
|
})();
|
|
273
238
|
}
|
|
274
|
-
|
|
239
|
+
W(["keydown"]);
|
|
275
240
|
export {
|
|
276
|
-
|
|
241
|
+
me as FileBrowser
|
|
277
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';
|