@floegence/floe-webapp-core 0.46.2 → 0.46.4
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 +77 -90
- package/dist/components/file-browser/FileBrowserStatusBar.d.ts +18 -0
- package/dist/components/file-browser/FileBrowserStatusBar.js +48 -0
- package/dist/components/file-browser/index.d.ts +1 -0
- package/dist/components/ui/Dialog.d.ts +1 -1
- package/dist/components/ui/Dialog.js +93 -92
- package/dist/components/ui/DialogPlacementContext.d.ts +16 -0
- package/dist/components/ui/DialogPlacementContext.js +26 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/file-browser.js +19 -17
- package/dist/full.js +443 -439
- package/dist/styles.css +1 -1
- package/dist/ui.js +103 -101
- package/package.json +1 -1
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { createComponent as n, insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useLayout as
|
|
5
|
-
import { useFileBrowserDrag as
|
|
6
|
-
import { deferAfterPaint as
|
|
7
|
-
import { isPrimaryModKeyPressed as
|
|
8
|
-
import { FileBrowserProvider as
|
|
9
|
-
import { SidebarPane as
|
|
10
|
-
import { DirectoryTree as
|
|
11
|
-
import { FileListView as
|
|
12
|
-
import { FileGridView as
|
|
13
|
-
import { FileBrowserToolbar as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { createComponent as n, insert as a, use as z, effect as A, className as $, template as S, delegateEvents as k } from "solid-js/web";
|
|
2
|
+
import { createSignal as B, onMount as E, onCleanup as L, createEffect as _, Show as m } from "solid-js";
|
|
3
|
+
import { cn as K } from "../../utils/cn.js";
|
|
4
|
+
import { useLayout as O } from "../../context/LayoutContext.js";
|
|
5
|
+
import { useFileBrowserDrag as q } from "../../context/FileBrowserDragContext.js";
|
|
6
|
+
import { deferAfterPaint as V } from "../../utils/defer.js";
|
|
7
|
+
import { isPrimaryModKeyPressed as H } from "../../utils/keybind.js";
|
|
8
|
+
import { FileBrowserProvider as N, useFileBrowser as T } from "./FileBrowserContext.js";
|
|
9
|
+
import { SidebarPane as G } from "../layout/SidebarPane.js";
|
|
10
|
+
import { DirectoryTree as j } from "./DirectoryTree.js";
|
|
11
|
+
import { FileListView as J } from "./FileListView.js";
|
|
12
|
+
import { FileGridView as Q } from "./FileGridView.js";
|
|
13
|
+
import { FileBrowserToolbar as U } from "./FileBrowserToolbar.js";
|
|
14
|
+
import { FileBrowserStatusBar as X } from "./FileBrowserStatusBar.js";
|
|
15
|
+
import { FileContextMenu as Y } from "./FileContextMenu.js";
|
|
16
|
+
import { FileBrowserDragPreview as Z } from "./DragPreview.js";
|
|
17
|
+
var p = /* @__PURE__ */ S('<div class="border-b border-border">'), ee = /* @__PURE__ */ S('<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">');
|
|
18
|
+
function Ce(e) {
|
|
19
|
+
return n(N, {
|
|
19
20
|
get files() {
|
|
20
21
|
return e.files;
|
|
21
22
|
},
|
|
@@ -62,7 +63,7 @@ function Me(e) {
|
|
|
62
63
|
return e.onRevealRequestConsumed;
|
|
63
64
|
},
|
|
64
65
|
get children() {
|
|
65
|
-
return n(
|
|
66
|
+
return n(te, {
|
|
66
67
|
get class() {
|
|
67
68
|
return e.class;
|
|
68
69
|
},
|
|
@@ -106,134 +107,120 @@ function Me(e) {
|
|
|
106
107
|
}
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
-
const r =
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
if (!
|
|
110
|
+
function te(e) {
|
|
111
|
+
const r = T(), I = O(), l = q(), f = () => I.isMobile(), [h, c] = B(null), x = () => h() ?? r.sidebarWidth(), R = () => e.sidebarResizable ?? !0, o = () => (e.enableDragDrop ?? !0) && !!l, d = () => e.instanceId ?? `filebrowser-${Math.random().toString(36).slice(2, 9)}`;
|
|
112
|
+
let v, C = null, w = null;
|
|
113
|
+
E(() => {
|
|
114
|
+
if (!l || !o()) return;
|
|
114
115
|
const t = {
|
|
115
|
-
instanceId:
|
|
116
|
+
instanceId: d(),
|
|
116
117
|
currentPath: r.currentPath,
|
|
117
118
|
files: r.files,
|
|
118
119
|
onDragMove: e.onDragMove,
|
|
119
|
-
getScrollContainer: () =>
|
|
120
|
-
getSidebarScrollContainer: () =>
|
|
120
|
+
getScrollContainer: () => C,
|
|
121
|
+
getSidebarScrollContainer: () => w,
|
|
121
122
|
optimisticRemove: r.optimisticRemove,
|
|
122
123
|
optimisticInsert: r.optimisticInsert
|
|
123
124
|
};
|
|
124
|
-
|
|
125
|
-
}),
|
|
126
|
-
|
|
125
|
+
l.registerInstance(t);
|
|
126
|
+
}), L(() => {
|
|
127
|
+
l && o() && l.unregisterInstance(d());
|
|
127
128
|
});
|
|
128
|
-
let M = !1,
|
|
129
|
-
|
|
130
|
-
const t =
|
|
129
|
+
let M = !1, g = !1;
|
|
130
|
+
_(() => {
|
|
131
|
+
const t = f();
|
|
131
132
|
if (!M) {
|
|
132
|
-
M = !0,
|
|
133
|
+
M = !0, g = t, t && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar();
|
|
133
134
|
return;
|
|
134
135
|
}
|
|
135
|
-
!
|
|
136
|
+
!g && t && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar(), g = t;
|
|
136
137
|
});
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
|
|
138
|
+
const D = (t) => {
|
|
139
|
+
H(t) && t.key.toLowerCase() === "f" && (t.preventDefault(), r.setFilterActive(!0), V(() => v?.focus()));
|
|
140
|
+
}, y = () => !r.sidebarCollapsed() || !f(), P = () => {
|
|
141
|
+
c(r.sidebarWidth());
|
|
141
142
|
}, W = (t) => {
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
const t =
|
|
145
|
-
t !== null && (r.setSidebarWidth(t),
|
|
143
|
+
c((s) => r.clampSidebarWidth((s ?? r.sidebarWidth()) + t));
|
|
144
|
+
}, F = () => {
|
|
145
|
+
const t = h();
|
|
146
|
+
t !== null && (r.setSidebarWidth(t), c(null));
|
|
146
147
|
};
|
|
147
148
|
return (() => {
|
|
148
|
-
var t =
|
|
149
|
-
return t.$$keydown =
|
|
149
|
+
var t = ee(), s = t.firstChild, u = s.firstChild, b = u.firstChild;
|
|
150
|
+
return t.$$keydown = D, a(t, n(m, {
|
|
150
151
|
get when() {
|
|
151
152
|
return e.header;
|
|
152
153
|
},
|
|
153
154
|
get children() {
|
|
154
|
-
var
|
|
155
|
-
return i
|
|
155
|
+
var i = p();
|
|
156
|
+
return a(i, () => e.header), i;
|
|
156
157
|
}
|
|
157
|
-
}),
|
|
158
|
+
}), s), a(s, n(G, {
|
|
158
159
|
title: "Explorer",
|
|
159
160
|
get width() {
|
|
160
|
-
return
|
|
161
|
+
return x();
|
|
161
162
|
},
|
|
162
163
|
get open() {
|
|
163
|
-
return
|
|
164
|
+
return y();
|
|
164
165
|
},
|
|
165
166
|
get headerActions() {
|
|
166
167
|
return e.sidebarHeaderActions;
|
|
167
168
|
},
|
|
168
169
|
get resizable() {
|
|
169
|
-
return
|
|
170
|
+
return R();
|
|
170
171
|
},
|
|
171
172
|
onResize: W,
|
|
172
173
|
get onClose() {
|
|
173
174
|
return r.toggleSidebar;
|
|
174
175
|
},
|
|
175
|
-
onResizeStart:
|
|
176
|
-
onResizeEnd:
|
|
177
|
-
bodyRef: (
|
|
178
|
-
|
|
176
|
+
onResizeStart: P,
|
|
177
|
+
onResizeEnd: F,
|
|
178
|
+
bodyRef: (i) => {
|
|
179
|
+
w = i;
|
|
179
180
|
},
|
|
180
181
|
bodyClass: "py-1",
|
|
181
182
|
get children() {
|
|
182
|
-
return n(
|
|
183
|
+
return n(j, {
|
|
183
184
|
get instanceId() {
|
|
184
|
-
return
|
|
185
|
+
return d();
|
|
185
186
|
},
|
|
186
187
|
get enableDragDrop() {
|
|
187
|
-
return
|
|
188
|
+
return o();
|
|
188
189
|
}
|
|
189
190
|
});
|
|
190
191
|
}
|
|
191
|
-
}),
|
|
192
|
-
filterInputRef: (
|
|
192
|
+
}), u), a(u, n(U, {
|
|
193
|
+
filterInputRef: (i) => v = i,
|
|
193
194
|
get endActions() {
|
|
194
195
|
return e.toolbarEndActions;
|
|
195
196
|
}
|
|
196
|
-
}),
|
|
197
|
-
|
|
198
|
-
},
|
|
197
|
+
}), b), z((i) => {
|
|
198
|
+
C = i;
|
|
199
|
+
}, b), a(b, n(m, {
|
|
199
200
|
get when() {
|
|
200
201
|
return r.viewMode() === "list";
|
|
201
202
|
},
|
|
202
203
|
get fallback() {
|
|
203
|
-
return n(
|
|
204
|
+
return n(Q, {
|
|
204
205
|
get instanceId() {
|
|
205
|
-
return
|
|
206
|
+
return d();
|
|
206
207
|
},
|
|
207
208
|
get enableDragDrop() {
|
|
208
|
-
return
|
|
209
|
+
return o();
|
|
209
210
|
}
|
|
210
211
|
});
|
|
211
212
|
},
|
|
212
213
|
get children() {
|
|
213
|
-
return n(
|
|
214
|
+
return n(J, {
|
|
214
215
|
get instanceId() {
|
|
215
|
-
return
|
|
216
|
+
return d();
|
|
216
217
|
},
|
|
217
218
|
get enableDragDrop() {
|
|
218
|
-
return
|
|
219
|
+
return o();
|
|
219
220
|
}
|
|
220
221
|
});
|
|
221
222
|
}
|
|
222
|
-
})),
|
|
223
|
-
get when() {
|
|
224
|
-
return r.filterQueryApplied().trim();
|
|
225
|
-
},
|
|
226
|
-
get children() {
|
|
227
|
-
return [" ", "(filtered)"];
|
|
228
|
-
}
|
|
229
|
-
}), null), i(u, n(c, {
|
|
230
|
-
get when() {
|
|
231
|
-
return r.selectedItems().size > 0;
|
|
232
|
-
},
|
|
233
|
-
get children() {
|
|
234
|
-
return [" · ", E(() => r.selectedItems().size), " selected"];
|
|
235
|
-
}
|
|
236
|
-
}), null), i(_, () => r.currentPath()), i(t, n(te, {
|
|
223
|
+
})), a(u, n(X, {}), null), a(t, n(Y, {
|
|
237
224
|
get callbacks() {
|
|
238
225
|
return e.contextMenuCallbacks;
|
|
239
226
|
},
|
|
@@ -246,17 +233,17 @@ function le(e) {
|
|
|
246
233
|
get hideItems() {
|
|
247
234
|
return e.hideContextMenuItems;
|
|
248
235
|
}
|
|
249
|
-
}), null),
|
|
236
|
+
}), null), a(t, n(m, {
|
|
250
237
|
get when() {
|
|
251
|
-
return
|
|
238
|
+
return o();
|
|
252
239
|
},
|
|
253
240
|
get children() {
|
|
254
|
-
return n(
|
|
241
|
+
return n(Z, {});
|
|
255
242
|
}
|
|
256
|
-
}), null),
|
|
243
|
+
}), null), A(() => $(t, K("flex flex-col h-full min-h-0 bg-background", "border border-border rounded-lg overflow-hidden", "shadow-sm", e.class))), t;
|
|
257
244
|
})();
|
|
258
245
|
}
|
|
259
|
-
|
|
246
|
+
k(["keydown"]);
|
|
260
247
|
export {
|
|
261
|
-
|
|
248
|
+
Ce as FileBrowser
|
|
262
249
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
export interface FileBrowserStatusBarProps {
|
|
3
|
+
/** Additional classes for the status bar container. */
|
|
4
|
+
class?: string;
|
|
5
|
+
/** Additional classes for the current-path label. */
|
|
6
|
+
pathClass?: string;
|
|
7
|
+
/** Localized item-count formatter. */
|
|
8
|
+
formatItemCount?: (count: number) => JSX.Element;
|
|
9
|
+
/** Localized label shown while a filter is applied. */
|
|
10
|
+
filteredLabel?: JSX.Element;
|
|
11
|
+
/** Localized selected-item-count formatter. */
|
|
12
|
+
formatSelectedCount?: (count: number) => JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Shared file-browser status presentation for primitive-based and complete browsers.
|
|
16
|
+
* Must be rendered inside a FileBrowserProvider.
|
|
17
|
+
*/
|
|
18
|
+
export declare function FileBrowserStatusBar(props: FileBrowserStatusBarProps): JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { insert as r, createComponent as f, effect as g, className as v, setAttribute as C, template as o } from "solid-js/web";
|
|
2
|
+
import { Show as h } from "solid-js";
|
|
3
|
+
import { cn as x } from "../../utils/cn.js";
|
|
4
|
+
import { useFileBrowser as $ } from "./FileBrowserContext.js";
|
|
5
|
+
var p = /* @__PURE__ */ o("<span aria-hidden=true>·"), w = /* @__PURE__ */ o("<span>"), _ = /* @__PURE__ */ o('<div data-file-browser-status-bar=true><div class="flex flex-wrap items-center gap-1.5"><span></span></div><div>');
|
|
6
|
+
function S(t) {
|
|
7
|
+
return `${t} ${t === 1 ? "item" : "items"}`;
|
|
8
|
+
}
|
|
9
|
+
function F(t) {
|
|
10
|
+
return `${t} selected`;
|
|
11
|
+
}
|
|
12
|
+
function P(t) {
|
|
13
|
+
const n = $(), s = () => n.currentFiles().length, i = () => n.selectedItems().size;
|
|
14
|
+
return (() => {
|
|
15
|
+
var a = _(), l = a.firstChild, b = l.firstChild, u = l.nextSibling;
|
|
16
|
+
return r(b, () => t.formatItemCount?.(s()) ?? S(s())), r(l, f(h, {
|
|
17
|
+
get when() {
|
|
18
|
+
return n.filterQueryApplied().trim();
|
|
19
|
+
},
|
|
20
|
+
get children() {
|
|
21
|
+
return [p(), (() => {
|
|
22
|
+
var e = w();
|
|
23
|
+
return r(e, () => t.filteredLabel ?? "Filtered"), e;
|
|
24
|
+
})()];
|
|
25
|
+
}
|
|
26
|
+
}), null), r(l, f(h, {
|
|
27
|
+
get when() {
|
|
28
|
+
return i() > 0;
|
|
29
|
+
},
|
|
30
|
+
get children() {
|
|
31
|
+
return [p(), (() => {
|
|
32
|
+
var e = w();
|
|
33
|
+
return r(e, () => t.formatSelectedCount?.(i()) ?? F(i())), e;
|
|
34
|
+
})()];
|
|
35
|
+
}
|
|
36
|
+
}), null), r(u, () => n.currentPath()), g((e) => {
|
|
37
|
+
var d = x("flex flex-wrap items-center justify-between gap-2 border-t border-border px-3 py-1 text-[10px] text-muted-foreground", t.class), m = x("max-w-[200px] truncate text-right", t.pathClass), c = n.currentPath();
|
|
38
|
+
return d !== e.e && v(a, e.e = d), m !== e.t && v(u, e.t = m), c !== e.a && C(u, "title", e.a = c), e;
|
|
39
|
+
}, {
|
|
40
|
+
e: void 0,
|
|
41
|
+
t: void 0,
|
|
42
|
+
a: void 0
|
|
43
|
+
}), a;
|
|
44
|
+
})();
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
P as FileBrowserStatusBar
|
|
48
|
+
};
|
|
@@ -6,6 +6,7 @@ export { FileGridView, type FileGridViewProps } from './FileGridView';
|
|
|
6
6
|
export { FileContextMenu, type FileContextMenuProps, type BuiltinContextMenuAction, type HideItemsValue } from './FileContextMenu';
|
|
7
7
|
export { Breadcrumb, type BreadcrumbProps } from './Breadcrumb';
|
|
8
8
|
export { FileBrowserToolbar, type FileBrowserToolbarProps } from './FileBrowserToolbar';
|
|
9
|
+
export { FileBrowserStatusBar, type FileBrowserStatusBarProps } from './FileBrowserStatusBar';
|
|
9
10
|
export { FileBrowserDragPreview } from './DragPreview';
|
|
10
11
|
export { FolderIcon, FolderOpenIcon, SymlinkFolderIcon, SymlinkFolderOpenIcon, FileIcon, SymlinkFileIcon, BrokenSymlinkIcon, CodeFileIcon, JavaScriptFileIcon, TypeScriptFileIcon, ShellScriptFileIcon, ImageFileIcon, VideoFileIcon, AudioFileIcon, DocumentFileIcon, ConfigFileIcon, StyleFileIcon, FileItemIcon, getFileIcon, resolveFileItemIcon, } from './FileIcons';
|
|
11
12
|
export type { FileItem, FileItemIconOverride, FileItemDecoration, FileItemDecorationBadge, FileItemDecorationTone, FileItemLinkKind, FileItemLinkTargetType, FileItemLinkMeta, FileBrowserRevealClearFilter, FileBrowserRevealRequest, ViewMode, SortField, SortDirection, SortConfig, FileListColumnRatios, FileBrowserContextValue, ContextMenuActionType, ContextMenuTargetKind, ContextMenuSource, ContextMenuDirectory, ContextMenuItem, ContextMenuEvent, ContextMenuCallbacks, OptimisticUpdateType, OptimisticRemove, OptimisticUpdate, OptimisticInsert, OptimisticOperation, ReplaceSelectionOptions, ScrollPosition, } from './types';
|
|
@@ -8,7 +8,7 @@ export interface DialogProps {
|
|
|
8
8
|
children: JSX.Element;
|
|
9
9
|
footer?: JSX.Element;
|
|
10
10
|
class?: string;
|
|
11
|
-
/** Optional stacking layer for global dialogs.
|
|
11
|
+
/** Optional stacking layer for global dialogs. Overrides the placement provider default. */
|
|
12
12
|
globalZIndex?: number;
|
|
13
13
|
}
|
|
14
14
|
/**
|