@floegence/floe-webapp-core 0.33.4 → 0.33.5
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.
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { onMount as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { createComponent as i, insert as l, addEventListener as P, use as A, memo as C, effect as N, className as L, setStyleProperty as W, template as u, delegateEvents as T } from "solid-js/web";
|
|
2
|
+
import { onMount as G, onCleanup as Q, createEffect as q, Show as a } from "solid-js";
|
|
3
|
+
import { cn as B } from "../../utils/cn.js";
|
|
4
4
|
import { useLayout as J } from "../../context/LayoutContext.js";
|
|
5
5
|
import { useFileBrowserDrag as U } from "../../context/FileBrowserDragContext.js";
|
|
6
6
|
import { deferAfterPaint as X } from "../../utils/defer.js";
|
|
@@ -9,12 +9,12 @@ import { ResizeHandle as p } from "../layout/ResizeHandle.js";
|
|
|
9
9
|
import { DirectoryTree as ee } from "./DirectoryTree.js";
|
|
10
10
|
import { FileListView as te } from "./FileListView.js";
|
|
11
11
|
import { FileGridView as re } from "./FileGridView.js";
|
|
12
|
-
import { FileBrowserToolbar as
|
|
13
|
-
import { FileContextMenu as
|
|
12
|
+
import { FileBrowserToolbar as ne } from "./FileBrowserToolbar.js";
|
|
13
|
+
import { FileContextMenu as ie } from "./FileContextMenu.js";
|
|
14
14
|
import { DragPreview as le } from "./DragPreview.js";
|
|
15
|
-
var ae = /* @__PURE__ */
|
|
16
|
-
function
|
|
17
|
-
return
|
|
15
|
+
var ae = /* @__PURE__ */ u('<div class="border-b border-border">'), oe = /* @__PURE__ */ u('<div class="min-w-0 flex items-center gap-1.5">'), se = /* @__PURE__ */ u('<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">'), de = /* @__PURE__ */ u('<div class="flex min-w-0 items-center gap-1.5">'), ue = /* @__PURE__ */ u('<div class="absolute inset-0 bg-background/60 backdrop-blur-sm z-[9]">'), ce = /* @__PURE__ */ u('<div><div class="flex flex-1 min-h-0 relative"><aside><div class="h-full flex flex-col"><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">Explorer</span></div><div class="flex-1 min-h-0 overflow-auto py-1"></div></div></aside><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 ke(e) {
|
|
17
|
+
return i(Y, {
|
|
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
|
|
58
|
+
return i(ge, {
|
|
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,42 +96,42 @@ function De(e) {
|
|
|
93
96
|
}
|
|
94
97
|
});
|
|
95
98
|
}
|
|
96
|
-
function
|
|
97
|
-
const r = Z(),
|
|
98
|
-
let
|
|
99
|
-
|
|
100
|
-
if (!
|
|
101
|
-
const
|
|
102
|
-
instanceId:
|
|
99
|
+
function ge(e) {
|
|
100
|
+
const r = Z(), K = J(), c = U(), s = () => K.isMobile(), M = () => r.sidebarWidth(), H = () => e.sidebarResizable ?? !0, d = () => (e.enableDragDrop ?? !0) && !!c, g = () => e.instanceId ?? `filebrowser-${Math.random().toString(36).slice(2, 9)}`;
|
|
101
|
+
let I, S = null, y = null;
|
|
102
|
+
G(() => {
|
|
103
|
+
if (!c || !d()) return;
|
|
104
|
+
const n = {
|
|
105
|
+
instanceId: g(),
|
|
103
106
|
currentPath: r.currentPath,
|
|
104
107
|
files: r.files,
|
|
105
108
|
onDragMove: e.onDragMove,
|
|
106
|
-
getScrollContainer: () =>
|
|
107
|
-
getSidebarScrollContainer: () =>
|
|
109
|
+
getScrollContainer: () => S,
|
|
110
|
+
getSidebarScrollContainer: () => y,
|
|
108
111
|
optimisticRemove: r.optimisticRemove,
|
|
109
112
|
optimisticInsert: r.optimisticInsert
|
|
110
113
|
};
|
|
111
|
-
|
|
114
|
+
c.registerInstance(n);
|
|
112
115
|
}), Q(() => {
|
|
113
|
-
|
|
116
|
+
c && d() && c.unregisterInstance(g());
|
|
114
117
|
});
|
|
115
|
-
let
|
|
118
|
+
let $ = !1, f = !1;
|
|
116
119
|
q(() => {
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
+
const n = s();
|
|
121
|
+
if (!$) {
|
|
122
|
+
$ = !0, f = n, n && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar();
|
|
120
123
|
return;
|
|
121
124
|
}
|
|
122
|
-
!f &&
|
|
125
|
+
!f && n && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar(), f = n;
|
|
123
126
|
});
|
|
124
|
-
const
|
|
125
|
-
(
|
|
126
|
-
}, D = () => !r.sidebarCollapsed() || !
|
|
127
|
+
const O = (n) => {
|
|
128
|
+
(n.metaKey || n.ctrlKey) && n.key.toLowerCase() === "f" && (n.preventDefault(), r.setFilterActive(!0), X(() => I?.focus()));
|
|
129
|
+
}, D = () => !r.sidebarCollapsed() || !s();
|
|
127
130
|
return (() => {
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
var
|
|
131
|
-
return
|
|
131
|
+
var n = ce(), v = n.firstChild, b = v.firstChild, k = b.firstChild, x = k.firstChild;
|
|
132
|
+
x.firstChild;
|
|
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, {
|
|
132
135
|
get when() {
|
|
133
136
|
return e.header;
|
|
134
137
|
},
|
|
@@ -136,86 +139,102 @@ function ue(e) {
|
|
|
136
139
|
var t = ae();
|
|
137
140
|
return l(t, () => e.header), t;
|
|
138
141
|
}
|
|
139
|
-
}),
|
|
142
|
+
}), v), l(x, i(a, {
|
|
140
143
|
get when() {
|
|
141
|
-
return
|
|
144
|
+
return e.sidebarHeaderActions || s();
|
|
142
145
|
},
|
|
143
146
|
get children() {
|
|
144
|
-
var t =
|
|
145
|
-
return
|
|
147
|
+
var t = de();
|
|
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;
|
|
146
165
|
}
|
|
147
|
-
}), null),
|
|
148
|
-
|
|
149
|
-
},
|
|
166
|
+
}), null), A((t) => {
|
|
167
|
+
y = t;
|
|
168
|
+
}, _), l(_, i(ee, {
|
|
150
169
|
get instanceId() {
|
|
151
|
-
return
|
|
170
|
+
return g();
|
|
152
171
|
},
|
|
153
172
|
get enableDragDrop() {
|
|
154
|
-
return
|
|
173
|
+
return d();
|
|
155
174
|
}
|
|
156
|
-
})), l(
|
|
175
|
+
})), l(b, i(a, {
|
|
157
176
|
get when() {
|
|
158
|
-
return
|
|
177
|
+
return C(() => !!(H() && D()))() && !s();
|
|
159
178
|
},
|
|
160
179
|
get children() {
|
|
161
|
-
return
|
|
180
|
+
return i(p, {
|
|
162
181
|
direction: "horizontal",
|
|
163
182
|
onResize: (t) => {
|
|
164
183
|
r.setSidebarWidth(r.sidebarWidth() + t);
|
|
165
184
|
}
|
|
166
185
|
});
|
|
167
186
|
}
|
|
168
|
-
}), null), l(
|
|
187
|
+
}), null), l(v, i(a, {
|
|
169
188
|
get when() {
|
|
170
|
-
return
|
|
189
|
+
return C(() => !!s())() && !r.sidebarCollapsed();
|
|
171
190
|
},
|
|
172
191
|
get children() {
|
|
173
|
-
var t =
|
|
192
|
+
var t = ue();
|
|
174
193
|
return P(t, "click", r.toggleSidebar, !0), t;
|
|
175
194
|
}
|
|
176
|
-
}),
|
|
177
|
-
filterInputRef: (t) =>
|
|
178
|
-
}),
|
|
179
|
-
|
|
180
|
-
},
|
|
195
|
+
}), w), l(w, i(ne, {
|
|
196
|
+
filterInputRef: (t) => I = t
|
|
197
|
+
}), h), A((t) => {
|
|
198
|
+
S = t;
|
|
199
|
+
}, h), l(h, i(a, {
|
|
181
200
|
get when() {
|
|
182
201
|
return r.viewMode() === "list";
|
|
183
202
|
},
|
|
184
203
|
get fallback() {
|
|
185
|
-
return
|
|
204
|
+
return i(re, {
|
|
186
205
|
get instanceId() {
|
|
187
|
-
return
|
|
206
|
+
return g();
|
|
188
207
|
},
|
|
189
208
|
get enableDragDrop() {
|
|
190
|
-
return
|
|
209
|
+
return d();
|
|
191
210
|
}
|
|
192
211
|
});
|
|
193
212
|
},
|
|
194
213
|
get children() {
|
|
195
|
-
return
|
|
214
|
+
return i(te, {
|
|
196
215
|
get instanceId() {
|
|
197
|
-
return
|
|
216
|
+
return g();
|
|
198
217
|
},
|
|
199
218
|
get enableDragDrop() {
|
|
200
|
-
return
|
|
219
|
+
return d();
|
|
201
220
|
}
|
|
202
221
|
});
|
|
203
222
|
}
|
|
204
|
-
})), l(
|
|
223
|
+
})), l(m, () => r.currentFiles().length, j), l(m, i(a, {
|
|
205
224
|
get when() {
|
|
206
225
|
return r.filterQueryApplied().trim();
|
|
207
226
|
},
|
|
208
227
|
get children() {
|
|
209
228
|
return [" ", "(filtered)"];
|
|
210
229
|
}
|
|
211
|
-
}), null), l(
|
|
230
|
+
}), null), l(m, i(a, {
|
|
212
231
|
get when() {
|
|
213
232
|
return r.selectedItems().size > 0;
|
|
214
233
|
},
|
|
215
234
|
get children() {
|
|
216
|
-
return [" · ",
|
|
235
|
+
return [" · ", C(() => r.selectedItems().size), " selected"];
|
|
217
236
|
}
|
|
218
|
-
}), null), l(
|
|
237
|
+
}), null), l(V, () => r.currentPath()), l(n, i(ie, {
|
|
219
238
|
get callbacks() {
|
|
220
239
|
return e.contextMenuCallbacks;
|
|
221
240
|
},
|
|
@@ -228,31 +247,31 @@ function ue(e) {
|
|
|
228
247
|
get hideItems() {
|
|
229
248
|
return e.hideContextMenuItems;
|
|
230
249
|
}
|
|
231
|
-
}), null), l(
|
|
250
|
+
}), null), l(n, i(a, {
|
|
232
251
|
get when() {
|
|
233
|
-
return
|
|
252
|
+
return d();
|
|
234
253
|
},
|
|
235
254
|
get children() {
|
|
236
|
-
return
|
|
255
|
+
return i(le, {});
|
|
237
256
|
}
|
|
238
|
-
}), null),
|
|
239
|
-
var
|
|
257
|
+
}), null), N((t) => {
|
|
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(
|
|
240
259
|
"flex-shrink-0 border-r border-border bg-sidebar relative",
|
|
241
260
|
"transition-all duration-200 ease-out",
|
|
242
261
|
"overflow-hidden",
|
|
243
262
|
// Mobile overlay
|
|
244
|
-
|
|
245
|
-
), z = D() ? `${
|
|
246
|
-
return
|
|
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;
|
|
247
266
|
}, {
|
|
248
267
|
e: void 0,
|
|
249
268
|
t: void 0,
|
|
250
269
|
a: void 0,
|
|
251
270
|
o: void 0
|
|
252
|
-
}),
|
|
271
|
+
}), n;
|
|
253
272
|
})();
|
|
254
273
|
}
|
|
255
|
-
|
|
274
|
+
T(["keydown", "click"]);
|
|
256
275
|
export {
|
|
257
|
-
|
|
276
|
+
ke as FileBrowser
|
|
258
277
|
};
|