@floegence/floe-webapp-core 0.33.3 → 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 n, insert as l, addEventListener as P, use as L, memo as w, effect as T, className as W, setStyleProperty as B, template as m, delegateEvents as G } from "solid-js/web";
2
- import { onMount as H, onCleanup as Q, createEffect as q, Show as a } from "solid-js";
3
- import { cn as K } from "../../utils/cn.js";
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 ie } from "./FileBrowserToolbar.js";
13
- import { FileContextMenu as ne } from "./FileContextMenu.js";
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__ */ m('<div class="border-b border-border">'), oe = /* @__PURE__ */ m('<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">'), se = /* @__PURE__ */ m('<div class="absolute inset-0 bg-background/60 backdrop-blur-sm z-[9]">'), de = /* @__PURE__ */ m('<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 De(e) {
17
- return n(Y, {
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 n(ue, {
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 ue(e) {
97
- const r = Z(), O = J(), d = U(), o = () => O.isMobile(), C = () => r.sidebarWidth(), E = () => e.sidebarResizable ?? !0, s = () => (e.enableDragDrop ?? !0) && !!d, u = () => e.instanceId ?? `filebrowser-${Math.random().toString(36).slice(2, 9)}`;
98
- let M, I = null, S = null;
99
- H(() => {
100
- if (!d || !s()) return;
101
- const i = {
102
- instanceId: u(),
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: () => I,
107
- getSidebarScrollContainer: () => S,
109
+ getScrollContainer: () => S,
110
+ getSidebarScrollContainer: () => y,
108
111
  optimisticRemove: r.optimisticRemove,
109
112
  optimisticInsert: r.optimisticInsert
110
113
  };
111
- d.registerInstance(i);
114
+ c.registerInstance(n);
112
115
  }), Q(() => {
113
- d && s() && d.unregisterInstance(u());
116
+ c && d() && c.unregisterInstance(g());
114
117
  });
115
- let y = !1, f = !1;
118
+ let $ = !1, f = !1;
116
119
  q(() => {
117
- const i = o();
118
- if (!y) {
119
- y = !0, f = i, i && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar();
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 && i && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar(), f = i;
125
+ !f && n && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar(), f = n;
123
126
  });
124
- const j = (i) => {
125
- (i.metaKey || i.ctrlKey) && i.key.toLowerCase() === "f" && (i.preventDefault(), r.setFilterActive(!0), X(() => M?.focus()));
126
- }, D = () => !r.sidebarCollapsed() || !o();
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 i = de(), h = i.firstChild, c = h.firstChild, k = c.firstChild, v = k.firstChild;
129
- v.firstChild;
130
- var $ = v.nextSibling, x = c.nextSibling, b = x.firstChild, V = b.nextSibling, g = V.firstChild, A = g.firstChild, N = g.nextSibling;
131
- return i.$$keydown = j, l(i, n(a, {
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
- }), h), l(v, n(a, {
142
+ }), v), l(x, i(a, {
140
143
  get when() {
141
- return o();
144
+ return e.sidebarHeaderActions || s();
142
145
  },
143
146
  get children() {
144
- var t = oe();
145
- return P(t, "click", r.toggleSidebar, !0), t;
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), L((t) => {
148
- S = t;
149
- }, $), l($, n(ee, {
166
+ }), null), A((t) => {
167
+ y = t;
168
+ }, _), l(_, i(ee, {
150
169
  get instanceId() {
151
- return u();
170
+ return g();
152
171
  },
153
172
  get enableDragDrop() {
154
- return s();
173
+ return d();
155
174
  }
156
- })), l(c, n(a, {
175
+ })), l(b, i(a, {
157
176
  get when() {
158
- return w(() => !!(E() && D()))() && !o();
177
+ return C(() => !!(H() && D()))() && !s();
159
178
  },
160
179
  get children() {
161
- return n(p, {
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(h, n(a, {
187
+ }), null), l(v, i(a, {
169
188
  get when() {
170
- return w(() => !!o())() && !r.sidebarCollapsed();
189
+ return C(() => !!s())() && !r.sidebarCollapsed();
171
190
  },
172
191
  get children() {
173
- var t = se();
192
+ var t = ue();
174
193
  return P(t, "click", r.toggleSidebar, !0), t;
175
194
  }
176
- }), x), l(x, n(ie, {
177
- filterInputRef: (t) => M = t
178
- }), b), L((t) => {
179
- I = t;
180
- }, b), l(b, n(a, {
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 n(re, {
204
+ return i(re, {
186
205
  get instanceId() {
187
- return u();
206
+ return g();
188
207
  },
189
208
  get enableDragDrop() {
190
- return s();
209
+ return d();
191
210
  }
192
211
  });
193
212
  },
194
213
  get children() {
195
- return n(te, {
214
+ return i(te, {
196
215
  get instanceId() {
197
- return u();
216
+ return g();
198
217
  },
199
218
  get enableDragDrop() {
200
- return s();
219
+ return d();
201
220
  }
202
221
  });
203
222
  }
204
- })), l(g, () => r.currentFiles().length, A), l(g, n(a, {
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(g, n(a, {
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 [" · ", w(() => r.selectedItems().size), " selected"];
235
+ return [" · ", C(() => r.selectedItems().size), " selected"];
217
236
  }
218
- }), null), l(N, () => r.currentPath()), l(i, n(ne, {
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(i, n(a, {
250
+ }), null), l(n, i(a, {
232
251
  get when() {
233
- return s();
252
+ return d();
234
253
  },
235
254
  get children() {
236
- return n(le, {});
255
+ return i(le, {});
237
256
  }
238
- }), null), T((t) => {
239
- var _ = K("flex flex-col h-full min-h-0 bg-background", "border border-border rounded-lg overflow-hidden", "shadow-sm", e.class), R = K(
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
- o() && !r.sidebarCollapsed() && "absolute inset-y-0 left-0 z-10 shadow-lg"
245
- ), z = D() ? `${C()}px` : "0px", F = `${C()}px`;
246
- return _ !== t.e && W(i, t.e = _), R !== t.t && W(c, t.t = R), z !== t.a && B(c, "width", t.a = z), F !== t.o && B(k, "width", t.o = F), t;
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
- }), i;
271
+ }), n;
253
272
  })();
254
273
  }
255
- G(["keydown", "click"]);
274
+ T(["keydown", "click"]);
256
275
  export {
257
- De as FileBrowser
276
+ ke as FileBrowser
258
277
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.33.3",
3
+ "version": "0.33.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",