@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.
@@ -1,21 +1,22 @@
1
- import { createComponent as n, insert as i, use as k, memo as E, effect as B, className as L, template as S, delegateEvents as K } from "solid-js/web";
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 { isPrimaryModKeyPressed as Q } from "../../utils/keybind.js";
8
- import { FileBrowserProvider as J, useFileBrowser as U } from "./FileBrowserContext.js";
9
- import { SidebarPane as X } from "../layout/SidebarPane.js";
10
- import { DirectoryTree as Y } from "./DirectoryTree.js";
11
- import { FileListView as Z } from "./FileListView.js";
12
- import { FileGridView as p } from "./FileGridView.js";
13
- import { FileBrowserToolbar as ee } from "./FileBrowserToolbar.js";
14
- import { FileContextMenu as te } from "./FileContextMenu.js";
15
- import { FileBrowserDragPreview as re } from "./DragPreview.js";
16
- var ne = /* @__PURE__ */ S('<div class="border-b border-border">'), ie = /* @__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"></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]">');
17
- function Me(e) {
18
- return n(J, {
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(le, {
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 le(e) {
110
- const r = U(), I = T(), o = j(), h = () => I.isMobile(), [v, b] = O(null), R = () => v() ?? r.sidebarWidth(), D = () => e.sidebarResizable ?? !0, a = () => (e.enableDragDrop ?? !0) && !!o, s = () => e.instanceId ?? `filebrowser-${Math.random().toString(36).slice(2, 9)}`;
111
- let C, w = null, x = null;
112
- q(() => {
113
- if (!o || !a()) return;
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: s(),
116
+ instanceId: d(),
116
117
  currentPath: r.currentPath,
117
118
  files: r.files,
118
119
  onDragMove: e.onDragMove,
119
- getScrollContainer: () => w,
120
- getSidebarScrollContainer: () => x,
120
+ getScrollContainer: () => C,
121
+ getSidebarScrollContainer: () => w,
121
122
  optimisticRemove: r.optimisticRemove,
122
123
  optimisticInsert: r.optimisticInsert
123
124
  };
124
- o.registerInstance(t);
125
- }), V(() => {
126
- o && a() && o.unregisterInstance(s());
125
+ l.registerInstance(t);
126
+ }), L(() => {
127
+ l && o() && l.unregisterInstance(d());
127
128
  });
128
- let M = !1, m = !1;
129
- H(() => {
130
- const t = h();
129
+ let M = !1, g = !1;
130
+ _(() => {
131
+ const t = f();
131
132
  if (!M) {
132
- M = !0, m = t, t && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar();
133
+ M = !0, g = t, t && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar();
133
134
  return;
134
135
  }
135
- !m && t && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar(), m = t;
136
+ !g && t && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar(), g = t;
136
137
  });
137
- const y = (t) => {
138
- Q(t) && t.key.toLowerCase() === "f" && (t.preventDefault(), r.setFilterActive(!0), G(() => C?.focus()));
139
- }, P = () => !r.sidebarCollapsed() || !h(), $ = () => {
140
- b(r.sidebarWidth());
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
- b((d) => r.clampSidebarWidth((d ?? r.sidebarWidth()) + t));
143
- }, z = () => {
144
- const t = v();
145
- t !== null && (r.setSidebarWidth(t), b(null));
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 = ie(), d = t.firstChild, f = d.firstChild, g = f.firstChild, F = g.nextSibling, u = F.firstChild, A = u.firstChild, _ = u.nextSibling;
149
- return t.$$keydown = y, i(t, n(c, {
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 l = ne();
155
- return i(l, () => e.header), l;
155
+ var i = p();
156
+ return a(i, () => e.header), i;
156
157
  }
157
- }), d), i(d, n(X, {
158
+ }), s), a(s, n(G, {
158
159
  title: "Explorer",
159
160
  get width() {
160
- return R();
161
+ return x();
161
162
  },
162
163
  get open() {
163
- return P();
164
+ return y();
164
165
  },
165
166
  get headerActions() {
166
167
  return e.sidebarHeaderActions;
167
168
  },
168
169
  get resizable() {
169
- return D();
170
+ return R();
170
171
  },
171
172
  onResize: W,
172
173
  get onClose() {
173
174
  return r.toggleSidebar;
174
175
  },
175
- onResizeStart: $,
176
- onResizeEnd: z,
177
- bodyRef: (l) => {
178
- x = l;
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(Y, {
183
+ return n(j, {
183
184
  get instanceId() {
184
- return s();
185
+ return d();
185
186
  },
186
187
  get enableDragDrop() {
187
- return a();
188
+ return o();
188
189
  }
189
190
  });
190
191
  }
191
- }), f), i(f, n(ee, {
192
- filterInputRef: (l) => C = l,
192
+ }), u), a(u, n(U, {
193
+ filterInputRef: (i) => v = i,
193
194
  get endActions() {
194
195
  return e.toolbarEndActions;
195
196
  }
196
- }), g), k((l) => {
197
- w = l;
198
- }, g), i(g, n(c, {
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(p, {
204
+ return n(Q, {
204
205
  get instanceId() {
205
- return s();
206
+ return d();
206
207
  },
207
208
  get enableDragDrop() {
208
- return a();
209
+ return o();
209
210
  }
210
211
  });
211
212
  },
212
213
  get children() {
213
- return n(Z, {
214
+ return n(J, {
214
215
  get instanceId() {
215
- return s();
216
+ return d();
216
217
  },
217
218
  get enableDragDrop() {
218
- return a();
219
+ return o();
219
220
  }
220
221
  });
221
222
  }
222
- })), i(u, () => r.currentFiles().length, A), i(u, n(c, {
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), i(t, n(c, {
236
+ }), null), a(t, n(m, {
250
237
  get when() {
251
- return a();
238
+ return o();
252
239
  },
253
240
  get children() {
254
- return n(re, {});
241
+ return n(Z, {});
255
242
  }
256
- }), null), B(() => L(t, N("flex flex-col h-full min-h-0 bg-background", "border border-border rounded-lg overflow-hidden", "shadow-sm", e.class))), t;
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
- K(["keydown"]);
246
+ k(["keydown"]);
260
247
  export {
261
- Me as FileBrowser
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. Surface-scoped dialogs remain locally layered. */
11
+ /** Optional stacking layer for global dialogs. Overrides the placement provider default. */
12
12
  globalZIndex?: number;
13
13
  }
14
14
  /**