@floegence/floe-webapp-core 0.35.34 → 0.35.35
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 +5 -1
- package/dist/components/file-browser/FileBrowser.js +29 -23
- package/dist/components/file-browser/FileBrowserContext.d.ts +3 -1
- package/dist/components/file-browser/FileBrowserContext.js +264 -248
- package/dist/components/file-browser/FileGridView.js +211 -160
- package/dist/components/file-browser/FileListView.js +332 -279
- package/dist/components/file-browser/types.d.ts +21 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
2
|
import { type FileContextMenuProps } from './FileContextMenu';
|
|
3
|
-
import type { FileItem, ViewMode, ContextMenuCallbacks, ContextMenuItem, FileListColumnRatios } from './types';
|
|
3
|
+
import type { FileItem, ViewMode, ContextMenuCallbacks, ContextMenuItem, FileListColumnRatios, FileBrowserRevealRequest } from './types';
|
|
4
4
|
export interface FileBrowserProps {
|
|
5
5
|
/** File tree data */
|
|
6
6
|
files: FileItem[];
|
|
@@ -26,6 +26,10 @@ export interface FileBrowserProps {
|
|
|
26
26
|
onSelect?: (items: FileItem[]) => void;
|
|
27
27
|
/** Callback when a file is opened */
|
|
28
28
|
onOpen?: (item: FileItem) => void;
|
|
29
|
+
/** Controlled programmatic reveal request for a specific item in the current directory. */
|
|
30
|
+
revealRequest?: FileBrowserRevealRequest | null;
|
|
31
|
+
/** Callback fired after the current reveal request has been consumed. */
|
|
32
|
+
onRevealRequestConsumed?: (requestId: string) => void;
|
|
29
33
|
/** Additional class names */
|
|
30
34
|
class?: string;
|
|
31
35
|
/** Custom header content */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createComponent as n, insert as i, use as k, memo as E, effect as B, className as K, template as I, delegateEvents as L } from "solid-js/web";
|
|
2
|
-
import { createSignal as O, onMount as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useLayout as
|
|
5
|
-
import { useFileBrowserDrag as
|
|
6
|
-
import { deferAfterPaint as
|
|
7
|
-
import { FileBrowserProvider as
|
|
2
|
+
import { createSignal as O, onMount as q, onCleanup as V, createEffect as H, Show as c } from "solid-js";
|
|
3
|
+
import { cn as N } from "../../utils/cn.js";
|
|
4
|
+
import { useLayout as T } from "../../context/LayoutContext.js";
|
|
5
|
+
import { useFileBrowserDrag as j } from "../../context/FileBrowserDragContext.js";
|
|
6
|
+
import { deferAfterPaint as G } from "../../utils/defer.js";
|
|
7
|
+
import { FileBrowserProvider as Q, useFileBrowser as J } from "./FileBrowserContext.js";
|
|
8
8
|
import { SidebarPane as U } from "../layout/SidebarPane.js";
|
|
9
9
|
import { DirectoryTree as X } from "./DirectoryTree.js";
|
|
10
10
|
import { FileListView as Y } from "./FileListView.js";
|
|
@@ -13,8 +13,8 @@ import { FileBrowserToolbar as p } from "./FileBrowserToolbar.js";
|
|
|
13
13
|
import { FileContextMenu as ee } from "./FileContextMenu.js";
|
|
14
14
|
import { FileBrowserDragPreview as te } from "./DragPreview.js";
|
|
15
15
|
var re = /* @__PURE__ */ I('<div class="border-b border-border">'), ne = /* @__PURE__ */ I('<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
|
|
17
|
-
return n(
|
|
16
|
+
function we(e) {
|
|
17
|
+
return n(Q, {
|
|
18
18
|
get files() {
|
|
19
19
|
return e.files;
|
|
20
20
|
},
|
|
@@ -54,6 +54,12 @@ function Ce(e) {
|
|
|
54
54
|
get onOpen() {
|
|
55
55
|
return e.onOpen;
|
|
56
56
|
},
|
|
57
|
+
get revealRequest() {
|
|
58
|
+
return e.revealRequest;
|
|
59
|
+
},
|
|
60
|
+
get onRevealRequestConsumed() {
|
|
61
|
+
return e.onRevealRequestConsumed;
|
|
62
|
+
},
|
|
57
63
|
get children() {
|
|
58
64
|
return n(ie, {
|
|
59
65
|
get class() {
|
|
@@ -100,26 +106,26 @@ function Ce(e) {
|
|
|
100
106
|
});
|
|
101
107
|
}
|
|
102
108
|
function ie(e) {
|
|
103
|
-
const r = J(), M =
|
|
104
|
-
let
|
|
105
|
-
|
|
109
|
+
const r = J(), M = T(), o = j(), h = () => M.isMobile(), [v, b] = O(null), R = () => v() ?? r.sidebarWidth(), D = () => e.sidebarResizable ?? !0, a = () => (e.enableDragDrop ?? !0) && !!o, d = () => e.instanceId ?? `filebrowser-${Math.random().toString(36).slice(2, 9)}`;
|
|
110
|
+
let C, w = null, x = null;
|
|
111
|
+
q(() => {
|
|
106
112
|
if (!o || !a()) return;
|
|
107
113
|
const t = {
|
|
108
114
|
instanceId: d(),
|
|
109
115
|
currentPath: r.currentPath,
|
|
110
116
|
files: r.files,
|
|
111
117
|
onDragMove: e.onDragMove,
|
|
112
|
-
getScrollContainer: () =>
|
|
118
|
+
getScrollContainer: () => w,
|
|
113
119
|
getSidebarScrollContainer: () => x,
|
|
114
120
|
optimisticRemove: r.optimisticRemove,
|
|
115
121
|
optimisticInsert: r.optimisticInsert
|
|
116
122
|
};
|
|
117
123
|
o.registerInstance(t);
|
|
118
|
-
}),
|
|
124
|
+
}), V(() => {
|
|
119
125
|
o && a() && o.unregisterInstance(d());
|
|
120
126
|
});
|
|
121
127
|
let S = !1, m = !1;
|
|
122
|
-
|
|
128
|
+
H(() => {
|
|
123
129
|
const t = h();
|
|
124
130
|
if (!S) {
|
|
125
131
|
S = !0, m = t, t && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar();
|
|
@@ -127,8 +133,8 @@ function ie(e) {
|
|
|
127
133
|
}
|
|
128
134
|
!m && t && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar(), m = t;
|
|
129
135
|
});
|
|
130
|
-
const
|
|
131
|
-
(t.metaKey || t.ctrlKey) && t.key.toLowerCase() === "f" && (t.preventDefault(), r.setFilterActive(!0),
|
|
136
|
+
const y = (t) => {
|
|
137
|
+
(t.metaKey || t.ctrlKey) && t.key.toLowerCase() === "f" && (t.preventDefault(), r.setFilterActive(!0), G(() => C?.focus()));
|
|
132
138
|
}, P = () => !r.sidebarCollapsed() || !h(), $ = () => {
|
|
133
139
|
b(r.sidebarWidth());
|
|
134
140
|
}, W = (t) => {
|
|
@@ -139,7 +145,7 @@ function ie(e) {
|
|
|
139
145
|
};
|
|
140
146
|
return (() => {
|
|
141
147
|
var t = ne(), s = t.firstChild, f = s.firstChild, g = f.firstChild, F = g.nextSibling, u = F.firstChild, A = u.firstChild, _ = u.nextSibling;
|
|
142
|
-
return t.$$keydown =
|
|
148
|
+
return t.$$keydown = y, i(t, n(c, {
|
|
143
149
|
get when() {
|
|
144
150
|
return e.header;
|
|
145
151
|
},
|
|
@@ -150,7 +156,7 @@ function ie(e) {
|
|
|
150
156
|
}), s), i(s, n(U, {
|
|
151
157
|
title: "Explorer",
|
|
152
158
|
get width() {
|
|
153
|
-
return
|
|
159
|
+
return R();
|
|
154
160
|
},
|
|
155
161
|
get open() {
|
|
156
162
|
return P();
|
|
@@ -159,7 +165,7 @@ function ie(e) {
|
|
|
159
165
|
return e.sidebarHeaderActions;
|
|
160
166
|
},
|
|
161
167
|
get resizable() {
|
|
162
|
-
return
|
|
168
|
+
return D();
|
|
163
169
|
},
|
|
164
170
|
onResize: W,
|
|
165
171
|
get onClose() {
|
|
@@ -182,12 +188,12 @@ function ie(e) {
|
|
|
182
188
|
});
|
|
183
189
|
}
|
|
184
190
|
}), f), i(f, n(p, {
|
|
185
|
-
filterInputRef: (l) =>
|
|
191
|
+
filterInputRef: (l) => C = l,
|
|
186
192
|
get endActions() {
|
|
187
193
|
return e.toolbarEndActions;
|
|
188
194
|
}
|
|
189
195
|
}), g), k((l) => {
|
|
190
|
-
|
|
196
|
+
w = l;
|
|
191
197
|
}, g), i(g, n(c, {
|
|
192
198
|
get when() {
|
|
193
199
|
return r.viewMode() === "list";
|
|
@@ -246,10 +252,10 @@ function ie(e) {
|
|
|
246
252
|
get children() {
|
|
247
253
|
return n(te, {});
|
|
248
254
|
}
|
|
249
|
-
}), null), B(() => K(t,
|
|
255
|
+
}), null), B(() => K(t, N("flex flex-col h-full min-h-0 bg-background", "border border-border rounded-lg overflow-hidden", "shadow-sm", e.class))), t;
|
|
250
256
|
})();
|
|
251
257
|
}
|
|
252
258
|
L(["keydown"]);
|
|
253
259
|
export {
|
|
254
|
-
|
|
260
|
+
we as FileBrowser
|
|
255
261
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
|
-
import type { FileItem, ViewMode, FileListColumnRatios, FileBrowserContextValue } from './types';
|
|
2
|
+
import type { FileItem, ViewMode, FileListColumnRatios, FileBrowserContextValue, FileBrowserRevealRequest } from './types';
|
|
3
3
|
export interface FileBrowserProviderProps {
|
|
4
4
|
children: JSX.Element;
|
|
5
5
|
files: FileItem[];
|
|
@@ -30,6 +30,8 @@ export interface FileBrowserProviderProps {
|
|
|
30
30
|
onPathChange?: (path: string, source: 'user' | 'programmatic') => void;
|
|
31
31
|
onSelect?: (items: FileItem[]) => void;
|
|
32
32
|
onOpen?: (item: FileItem) => void;
|
|
33
|
+
revealRequest?: FileBrowserRevealRequest | null;
|
|
34
|
+
onRevealRequestConsumed?: (requestId: string) => void;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* Provider for file browser state management
|