@floegence/floe-webapp-core 0.35.32 → 0.35.34

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.
Files changed (29) hide show
  1. package/dist/components/file-browser/DirectoryTree.js +84 -86
  2. package/dist/components/file-browser/FileContextMenu.d.ts +2 -2
  3. package/dist/components/file-browser/FileContextMenu.js +300 -142
  4. package/dist/components/file-browser/FileGridView.js +50 -45
  5. package/dist/components/file-browser/FileIcons.d.ts +10 -2
  6. package/dist/components/file-browser/FileIcons.js +289 -181
  7. package/dist/components/file-browser/FileListView.js +99 -94
  8. package/dist/components/file-browser/contextMenuEvent.d.ts +10 -0
  9. package/dist/components/file-browser/contextMenuEvent.js +19 -0
  10. package/dist/components/file-browser/index.d.ts +2 -2
  11. package/dist/components/file-browser/longPressContextMenu.d.ts +1 -0
  12. package/dist/components/file-browser/longPressContextMenu.js +45 -32
  13. package/dist/components/file-browser/types.d.ts +23 -1
  14. package/dist/components/layout/Shell.d.ts +8 -0
  15. package/dist/components/layout/Shell.js +157 -138
  16. package/dist/components/layout/Sidebar.d.ts +2 -0
  17. package/dist/components/layout/Sidebar.js +39 -38
  18. package/dist/components/layout/sidebarVisibilityMotion.d.ts +22 -0
  19. package/dist/components/layout/sidebarVisibilityMotion.js +16 -0
  20. package/dist/components/ui/Dropdown.d.ts +0 -1
  21. package/dist/components/ui/Dropdown.js +150 -204
  22. package/dist/components/ui/menuUtils.d.ts +15 -0
  23. package/dist/components/ui/menuUtils.js +60 -0
  24. package/dist/components/ui/picker/PickerBase.js +90 -96
  25. package/dist/context/LayoutContext.d.ts +5 -0
  26. package/dist/context/LayoutContext.js +58 -46
  27. package/dist/file-browser.js +35 -31
  28. package/dist/full.js +411 -407
  29. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- import { insert as d, createComponent as c, effect as T, className as p, style as Z, memo as z, template as $, setAttribute as ee, setStyleProperty as te, delegateEvents as ne } from "solid-js/web";
2
- import { createSignal as _, createMemo as L, createEffect as K, on as G, For as N, Show as F } from "solid-js";
3
- import { cn as I } from "../../../utils/cn.js";
4
- import { deferAfterPaint as re } from "../../../utils/defer.js";
5
- import { Button as B } from "../Button.js";
1
+ import { insert as d, createComponent as s, effect as F, className as I, style as Y, memo as H, template as $, setAttribute as Z, setStyleProperty as ee, delegateEvents as te } from "solid-js/web";
2
+ import { createSignal as _, createMemo as L, createEffect as A, on as K, For as B, Show as T } from "solid-js";
3
+ import { cn as p } from "../../../utils/cn.js";
4
+ import { deferAfterPaint as ne } from "../../../utils/defer.js";
5
+ import { Button as z } from "../Button.js";
6
6
  import { Input as W } from "../Input.js";
7
- import { ChevronRight as j, Check as oe, X as le, Plus as ie } from "../../icons/index.js";
8
- import { FolderOpenIcon as M, FolderIcon as ae } from "../../file-browser/FileIcons.js";
9
- var O = /* @__PURE__ */ $('<div class="flex items-center gap-1.5"><div class=flex-1>'), ce = /* @__PURE__ */ $('<p class="text-[11px] text-muted-foreground -mt-1">Creating in: '), se = /* @__PURE__ */ $("<button type=button><span>New Folder"), ue = /* @__PURE__ */ $('<nav class="flex items-center gap-0.5 min-w-0 overflow-x-auto py-0.5"aria-label="Selected path">'), V = /* @__PURE__ */ $("<button type=button>"), de = /* @__PURE__ */ $('<div class="flex items-center justify-center py-6 text-xs text-muted-foreground">'), he = /* @__PURE__ */ $("<div><button type=button><span>"), fe = /* @__PURE__ */ $("<div class=overflow-hidden>"), ge = /* @__PURE__ */ $('<div class="flex flex-col"><div><button type=button><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>'), me = /* @__PURE__ */ $('<span class="flex-shrink-0 w-4 h-4">');
7
+ import { ChevronRight as j, Check as re, X as oe, Plus as le } from "../../icons/index.js";
8
+ import { FolderOpenIcon as ie, FileItemIcon as ae } from "../../file-browser/FileIcons.js";
9
+ var M = /* @__PURE__ */ $('<div class="flex items-center gap-1.5"><div class=flex-1>'), ce = /* @__PURE__ */ $('<p class="text-[11px] text-muted-foreground -mt-1">Creating in: '), se = /* @__PURE__ */ $("<button type=button><span>New Folder"), ue = /* @__PURE__ */ $('<nav class="flex items-center gap-0.5 min-w-0 overflow-x-auto py-0.5"aria-label="Selected path">'), O = /* @__PURE__ */ $("<button type=button>"), de = /* @__PURE__ */ $('<div class="flex items-center justify-center py-6 text-xs text-muted-foreground">'), he = /* @__PURE__ */ $("<div><button type=button><span>"), fe = /* @__PURE__ */ $("<div class=overflow-hidden>"), ge = /* @__PURE__ */ $('<div class="flex flex-col"><div><button type=button><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>'), me = /* @__PURE__ */ $('<span class="flex-shrink-0 w-4 h-4">');
10
10
  function y(e) {
11
11
  const l = (e ?? "").trim();
12
12
  if (l === "" || l === "/") return "/";
13
13
  const n = l.replace(/\/+$/, "");
14
14
  return n.startsWith("/") ? n : "/" + n;
15
15
  }
16
- function H(e) {
16
+ function G(e) {
17
17
  const l = e.split("/").filter(Boolean), n = [];
18
18
  let r = "";
19
19
  for (let i = 0; i < l.length - 1; i++)
@@ -33,7 +33,7 @@ function xe(e, l) {
33
33
  const n = y(e ?? "/"), r = l ? y(l) : void 0;
34
34
  return !r || r === "/" ? n : n === r ? "/" : n.startsWith(r + "/") ? y(n.slice(r.length)) : n;
35
35
  }
36
- function pe(e) {
36
+ function Ie(e) {
37
37
  const l = () => (typeof e.homeLabel == "function" ? e.homeLabel() : e.homeLabel) ?? "Root", n = () => {
38
38
  const t = typeof e.homePath == "function" ? e.homePath() : e.homePath;
39
39
  return t ? y(t) : void 0;
@@ -50,34 +50,34 @@ function pe(e) {
50
50
  if (!a) return y(t);
51
51
  const h = y(t);
52
52
  return h === a ? "/" : a !== "/" && h.startsWith(a + "/") ? h.slice(a.length) || "/" : y(t);
53
- }, [b, v] = _(r()), [P, f] = _(/* @__PURE__ */ new Set(["/"])), [k, o] = _(i(r())), [x, w] = _(""), s = ve(e.files), g = L(() => e.files().filter((t) => t.type === "folder"));
54
- K(G(e.open, (t) => {
53
+ }, [b, v] = _(r()), [P, f] = _(/* @__PURE__ */ new Set(["/"])), [k, o] = _(i(r())), [x, w] = _(""), c = ve(e.files), g = L(() => e.files().filter((t) => t.type === "folder"));
54
+ A(K(e.open, (t) => {
55
55
  if (t) {
56
56
  const a = r();
57
57
  v(a), o(i(a)), w("");
58
- const h = H(a);
58
+ const h = G(a);
59
59
  f(/* @__PURE__ */ new Set(["/", ...h])), e.onReset?.(a);
60
60
  }
61
- })), K(G(b, (t) => {
61
+ })), A(K(b, (t) => {
62
62
  o(i(t)), w("");
63
63
  }));
64
64
  const S = (t) => {
65
65
  const a = y(t);
66
- return a === "/" || s().has(a);
66
+ return a === "/" || c().has(a);
67
67
  }, C = (t) => e.filter ? e.filter(t) : !0, E = (t) => {
68
- const a = H(t);
68
+ const a = G(t);
69
69
  f((h) => {
70
70
  const m = new Set(h);
71
71
  for (const D of a) m.add(D);
72
72
  return m.add(t), m;
73
73
  });
74
- }, q = (t) => {
74
+ }, X = (t) => {
75
75
  const a = P().has(t);
76
76
  f((h) => {
77
77
  const m = new Set(h);
78
78
  return m.has(t) ? m.delete(t) : m.add(t), m;
79
79
  }), a || e.onExpand?.(t);
80
- }, J = (t) => {
80
+ }, q = (t) => {
81
81
  if (!C(t)) return;
82
82
  v(t.path);
83
83
  const a = P().has(t.path);
@@ -85,14 +85,14 @@ function pe(e) {
85
85
  const m = new Set(h);
86
86
  return m.add(t.path), m;
87
87
  }), a || e.onExpand?.(t.path);
88
- }, Q = () => {
88
+ }, J = () => {
89
89
  v("/");
90
- }, R = () => {
90
+ }, N = () => {
91
91
  const t = u(k().trim());
92
92
  S(t) ? (v(t), w(""), E(t)) : w("Path not found");
93
- }, U = (t) => {
94
- t.key === "Enter" && (t.preventDefault(), R());
95
- }, Y = L(() => {
93
+ }, Q = (t) => {
94
+ t.key === "Enter" && (t.preventDefault(), N());
95
+ }, U = L(() => {
96
96
  const t = b(), a = l();
97
97
  if (t === "/" || t === "") return [{
98
98
  name: a,
@@ -103,9 +103,9 @@ function pe(e) {
103
103
  path: "/"
104
104
  }];
105
105
  let D = "";
106
- for (const A of h)
107
- D += "/" + A, m.push({
108
- name: A,
106
+ for (const R of h)
107
+ D += "/" + R, m.push({
108
+ name: R,
109
109
  path: D
110
110
  });
111
111
  return m;
@@ -114,21 +114,21 @@ function pe(e) {
114
114
  selectedPath: b,
115
115
  setSelectedPath: v,
116
116
  expandedPaths: P,
117
- toggleExpand: q,
117
+ toggleExpand: X,
118
118
  pathInput: k,
119
119
  setPathInput: o,
120
120
  pathInputError: x,
121
121
  setPathInputError: w,
122
- folderIndex: s,
122
+ folderIndex: c,
123
123
  rootFolders: g,
124
124
  isValidPath: S,
125
125
  isSelectable: C,
126
- handleSelectFolder: J,
127
- handleSelectRoot: Q,
128
- handlePathInputGo: R,
129
- handlePathInputKeyDown: U,
126
+ handleSelectFolder: q,
127
+ handleSelectRoot: J,
128
+ handlePathInputGo: N,
129
+ handlePathInputKeyDown: Q,
130
130
  expandToPath: E,
131
- breadcrumbSegments: Y,
131
+ breadcrumbSegments: U,
132
132
  handleBreadcrumbClick: (t) => {
133
133
  v(t), E(t);
134
134
  },
@@ -136,7 +136,7 @@ function pe(e) {
136
136
  toDisplayPath: i
137
137
  };
138
138
  }
139
- function Ie(e) {
139
+ function pe(e) {
140
140
  const [l, n] = _(!1), [r, i] = _(""), [u, b] = _(!1), v = () => {
141
141
  n(!0), i("");
142
142
  }, P = () => {
@@ -145,9 +145,9 @@ function Ie(e) {
145
145
  const o = r().trim();
146
146
  if (!o || u()) return;
147
147
  b(!0);
148
- const x = e.parentPath(), w = o, s = e.onCreateFolder;
149
- re(() => {
150
- s(x, w).then(() => {
148
+ const x = e.parentPath(), w = o, c = e.onCreateFolder;
149
+ ne(() => {
150
+ c(x, w).then(() => {
151
151
  n(!1), i("");
152
152
  }).catch((g) => {
153
153
  console.error("Failed to create folder:", g);
@@ -158,22 +158,22 @@ function Ie(e) {
158
158
  }, k = (o) => {
159
159
  o.key === "Enter" ? (o.preventDefault(), f()) : o.key === "Escape" && (o.preventDefault(), P());
160
160
  };
161
- return c(F, {
161
+ return s(T, {
162
162
  get when() {
163
163
  return l();
164
164
  },
165
165
  get fallback() {
166
166
  return (() => {
167
167
  var o = se(), x = o.firstChild;
168
- return o.$$click = v, d(o, c(ie, {
168
+ return o.$$click = v, d(o, s(le, {
169
169
  class: "w-3.5 h-3.5"
170
- }), x), T(() => p(o, I("flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", "hover:text-foreground transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded px-1 py-0.5"))), o;
170
+ }), x), F(() => I(o, p("flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", "hover:text-foreground transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded px-1 py-0.5"))), o;
171
171
  })();
172
172
  },
173
173
  get children() {
174
174
  return [(() => {
175
- var o = O(), x = o.firstChild;
176
- return d(x, c(W, {
175
+ var o = M(), x = o.firstChild;
176
+ return d(x, s(W, {
177
177
  size: "sm",
178
178
  get value() {
179
179
  return r();
@@ -185,7 +185,7 @@ function Ie(e) {
185
185
  return u();
186
186
  },
187
187
  autofocus: !0
188
- })), d(o, c(B, {
188
+ })), d(o, s(z, {
189
189
  variant: "primary",
190
190
  size: "sm",
191
191
  onClick: f,
@@ -196,11 +196,11 @@ function Ie(e) {
196
196
  return !r().trim();
197
197
  },
198
198
  get children() {
199
- return c(oe, {
199
+ return s(re, {
200
200
  class: "w-3.5 h-3.5"
201
201
  });
202
202
  }
203
- }), null), d(o, c(B, {
203
+ }), null), d(o, s(z, {
204
204
  variant: "ghost-destructive",
205
205
  size: "sm",
206
206
  onClick: P,
@@ -208,7 +208,7 @@ function Ie(e) {
208
208
  return u();
209
209
  },
210
210
  get children() {
211
- return c(le, {
211
+ return s(oe, {
212
212
  class: "w-3.5 h-3.5"
213
213
  });
214
214
  }
@@ -216,7 +216,7 @@ function Ie(e) {
216
216
  })(), (() => {
217
217
  var o = ce();
218
218
  return o.firstChild, d(o, (() => {
219
- var x = z(() => !!e.toDisplayPath);
219
+ var x = H(() => !!e.toDisplayPath);
220
220
  return () => x() ? e.toDisplayPath(e.parentPath()) : e.parentPath();
221
221
  })(), null), o;
222
222
  })()];
@@ -225,8 +225,8 @@ function Ie(e) {
225
225
  }
226
226
  function Ee(e) {
227
227
  return (() => {
228
- var l = O(), n = l.firstChild;
229
- return d(n, c(W, {
228
+ var l = M(), n = l.firstChild;
229
+ return d(n, s(W, {
230
230
  size: "sm",
231
231
  get value() {
232
232
  return e.value();
@@ -241,7 +241,7 @@ function Ee(e) {
241
241
  get error() {
242
242
  return e.error();
243
243
  }
244
- })), d(l, c(B, {
244
+ })), d(l, s(z, {
245
245
  variant: "outline",
246
246
  size: "sm",
247
247
  get onClick() {
@@ -254,22 +254,22 @@ function Ee(e) {
254
254
  function Fe(e) {
255
255
  return (() => {
256
256
  var l = ue();
257
- return d(l, c(N, {
257
+ return d(l, s(B, {
258
258
  get each() {
259
259
  return e.segments();
260
260
  },
261
- children: (n, r) => [c(F, {
261
+ children: (n, r) => [s(T, {
262
262
  get when() {
263
263
  return r() > 0;
264
264
  },
265
265
  get children() {
266
- return c(j, {
266
+ return s(j, {
267
267
  class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
268
268
  });
269
269
  }
270
270
  }), (() => {
271
- var i = V();
272
- return i.$$click = () => e.onClick(n.path), d(i, () => n.name), T(() => p(i, I("text-xs px-1 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", r() === e.segments().length - 1 ? "font-medium text-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"))), i;
271
+ var i = O();
272
+ return i.$$click = () => e.onClick(n.path), d(i, () => n.name), F(() => I(i, p("text-xs px-1 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", r() === e.segments().length - 1 ? "font-medium text-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"))), i;
273
273
  })()]
274
274
  })), l;
275
275
  })();
@@ -278,13 +278,13 @@ function Te(e) {
278
278
  const l = () => (typeof e.homeLabel == "function" ? e.homeLabel() : e.homeLabel) ?? "Root";
279
279
  return (() => {
280
280
  var n = he(), r = n.firstChild, i = r.firstChild;
281
- return r.$$click = () => e.onSelectRoot(), d(r, c(M, {
281
+ return r.$$click = () => e.onSelectRoot(), d(r, s(ie, {
282
282
  class: "w-4 h-4 flex-shrink-0"
283
- }), i), d(i, l), d(n, c(N, {
283
+ }), i), d(i, l), d(n, s(B, {
284
284
  get each() {
285
285
  return e.rootFolders();
286
286
  },
287
- children: (u) => c(X, {
287
+ children: (u) => s(V, {
288
288
  item: u,
289
289
  depth: 1,
290
290
  get selectedPath() {
@@ -303,7 +303,7 @@ function Te(e) {
303
303
  return e.isSelectable;
304
304
  }
305
305
  })
306
- }), null), d(n, c(F, {
306
+ }), null), d(n, s(T, {
307
307
  get when() {
308
308
  return e.rootFolders().length === 0;
309
309
  },
@@ -311,9 +311,9 @@ function Te(e) {
311
311
  var u = de();
312
312
  return d(u, () => e.emptyText ?? "No directories available"), u;
313
313
  }
314
- }), null), T((u) => {
315
- var b = I("border border-border rounded overflow-y-auto", e.class), v = e.style, P = I("flex items-center gap-1.5 w-full text-left text-xs py-1.5 px-2 cursor-pointer", "transition-colors duration-100", "hover:bg-accent/60", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", e.selectedPath() === "/" && "bg-accent text-accent-foreground font-medium");
316
- return b !== u.e && p(n, u.e = b), u.t = Z(n, v, u.t), P !== u.a && p(r, u.a = P), u;
314
+ }), null), F((u) => {
315
+ var b = p("border border-border rounded overflow-y-auto", e.class), v = e.style, P = p("flex items-center gap-1.5 w-full text-left text-xs py-1.5 px-2 cursor-pointer", "transition-colors duration-100", "hover:bg-accent/60", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", e.selectedPath() === "/" && "bg-accent text-accent-foreground font-medium");
316
+ return b !== u.e && I(n, u.e = b), u.t = Y(n, v, u.t), P !== u.a && I(r, u.a = P), u;
317
317
  }, {
318
318
  e: void 0,
319
319
  t: void 0,
@@ -321,7 +321,7 @@ function Te(e) {
321
321
  }), n;
322
322
  })();
323
323
  }
324
- function X(e) {
324
+ function V(e) {
325
325
  const l = () => e.expandedPaths().has(e.item.path), n = () => e.selectedPath() === e.item.path, r = () => e.isSelectable(e.item), i = L(() => e.item.children?.filter((f) => f.type === "folder") ?? []), u = () => i().length > 0, b = () => e.item.type === "folder", v = (f) => {
326
326
  f.stopPropagation(), e.onToggle(e.item.path);
327
327
  }, P = () => {
@@ -329,7 +329,7 @@ function X(e) {
329
329
  };
330
330
  return (() => {
331
331
  var f = ge(), k = f.firstChild, o = k.firstChild, x = o.firstChild, w = x.nextSibling;
332
- return d(k, c(F, {
332
+ return d(k, s(T, {
333
333
  get when() {
334
334
  return b();
335
335
  },
@@ -337,42 +337,36 @@ function X(e) {
337
337
  return me();
338
338
  },
339
339
  get children() {
340
- var s = V();
341
- return s.$$click = v, d(s, c(j, {
340
+ var c = O();
341
+ return c.$$click = v, d(c, s(j, {
342
342
  class: "w-3 h-3 opacity-60"
343
- })), T((g) => {
344
- var S = I("flex-shrink-0 w-4 h-4 flex items-center justify-center cursor-pointer", "transition-transform duration-150", l() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring"), C = l() ? "Collapse folder" : "Expand folder";
345
- return S !== g.e && p(s, g.e = S), C !== g.t && ee(s, "aria-label", g.t = C), g;
343
+ })), F((g) => {
344
+ var S = p("flex-shrink-0 w-4 h-4 flex items-center justify-center cursor-pointer", "transition-transform duration-150", l() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring"), C = l() ? "Collapse folder" : "Expand folder";
345
+ return S !== g.e && I(c, g.e = S), C !== g.t && Z(c, "aria-label", g.t = C), g;
346
346
  }, {
347
347
  e: void 0,
348
348
  t: void 0
349
- }), s;
349
+ }), c;
350
350
  }
351
- }), o), o.$$click = P, d(x, c(F, {
352
- get when() {
353
- return z(() => !!u())() && l();
351
+ }), o), o.$$click = P, d(x, s(ae, {
352
+ get item() {
353
+ return e.item;
354
354
  },
355
- get fallback() {
356
- return c(ae, {
357
- class: "w-4 h-4"
358
- });
355
+ get open() {
356
+ return l();
359
357
  },
360
- get children() {
361
- return c(M, {
362
- class: "w-4 h-4"
363
- });
364
- }
365
- })), d(w, () => e.item.name), d(f, c(F, {
358
+ class: "w-4 h-4"
359
+ })), d(w, () => e.item.name), d(f, s(T, {
366
360
  get when() {
367
- return z(() => !!l())() && u();
361
+ return H(() => !!l())() && u();
368
362
  },
369
363
  get children() {
370
- var s = fe();
371
- return d(s, c(N, {
364
+ var c = fe();
365
+ return d(c, s(B, {
372
366
  get each() {
373
367
  return i();
374
368
  },
375
- children: (g) => c(X, {
369
+ children: (g) => s(V, {
376
370
  item: g,
377
371
  get depth() {
378
372
  return e.depth + 1;
@@ -393,11 +387,11 @@ function X(e) {
393
387
  return e.isSelectable;
394
388
  }
395
389
  })
396
- })), s;
390
+ })), c;
397
391
  }
398
- }), null), T((s) => {
399
- var g = I("group flex items-center w-full text-xs", "transition-colors duration-100", r() ? "hover:bg-accent/60" : "opacity-50", n() && r() && "bg-accent text-accent-foreground font-medium"), S = `${4 + e.depth * 14}px`, C = !r(), E = I("flex items-center gap-1 flex-1 min-w-0 text-left py-1.5 pl-0.5 pr-2", r() ? "cursor-pointer" : "cursor-not-allowed", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring");
400
- return g !== s.e && p(k, s.e = g), S !== s.t && te(k, "padding-left", s.t = S), C !== s.a && (o.disabled = s.a = C), E !== s.o && p(o, s.o = E), s;
392
+ }), null), F((c) => {
393
+ var g = p("group flex items-center w-full text-xs", "transition-colors duration-100", r() ? "hover:bg-accent/60" : "opacity-50", n() && r() && "bg-accent text-accent-foreground font-medium"), S = `${4 + e.depth * 14}px`, C = !r(), E = p("flex items-center gap-1 flex-1 min-w-0 text-left py-1.5 pl-0.5 pr-2", r() ? "cursor-pointer" : "cursor-not-allowed", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring");
394
+ return g !== c.e && I(k, c.e = g), S !== c.t && ee(k, "padding-left", c.t = S), C !== c.a && (o.disabled = c.a = C), E !== c.o && I(o, c.o = E), c;
401
395
  }, {
402
396
  e: void 0,
403
397
  t: void 0,
@@ -406,16 +400,16 @@ function X(e) {
406
400
  }), f;
407
401
  })();
408
402
  }
409
- ne(["click"]);
403
+ te(["click"]);
410
404
  export {
411
- Ie as NewFolderSection,
405
+ pe as NewFolderSection,
412
406
  Ee as PathInputBar,
413
407
  Fe as PickerBreadcrumb,
414
408
  Te as PickerFolderTree,
415
- X as PickerTreeNode,
416
- H as getAncestorPaths,
409
+ V as PickerTreeNode,
410
+ G as getAncestorPaths,
417
411
  y as normalizePath,
418
412
  xe as resolvePickerInitialPath,
419
413
  ve as useFolderIndex,
420
- pe as usePickerTree
414
+ Ie as usePickerTree
421
415
  };
@@ -1,15 +1,20 @@
1
1
  import { type Accessor } from 'solid-js';
2
+ export type SidebarVisibilityMotion = 'animated' | 'instant';
2
3
  export interface LayoutContextValue {
3
4
  sidebarWidth: Accessor<number>;
4
5
  sidebarActiveTab: Accessor<string>;
5
6
  sidebarCollapsed: Accessor<boolean>;
7
+ sidebarVisibilityMotion: Accessor<SidebarVisibilityMotion>;
8
+ sidebarVisibilityMotionRevision: Accessor<number>;
6
9
  clampSidebarWidth: (width: number) => number;
7
10
  setSidebarWidth: (width: number) => void;
8
11
  setSidebarActiveTab: (tab: string, opts?: {
9
12
  openSidebar?: boolean;
13
+ visibilityMotion?: SidebarVisibilityMotion;
10
14
  }) => void;
11
15
  setSidebarCollapsed: (collapsed: boolean) => void;
12
16
  toggleSidebarCollapse: () => void;
17
+ clearSidebarVisibilityMotion: (revision: number) => void;
13
18
  terminalOpened: Accessor<boolean>;
14
19
  terminalHeight: Accessor<number>;
15
20
  toggleTerminal: () => void;
@@ -1,76 +1,88 @@
1
- import { createEffect as m } from "solid-js";
2
- import { createStore as p, produce as d } from "solid-js/store";
3
- import { createSimpleContext as h } from "./createSimpleContext.js";
4
- import { useResolvedFloeConfig as f } from "./FloeConfigContext.js";
1
+ import { createEffect as f } from "solid-js";
2
+ import { createStore as c, produce as r } from "solid-js/store";
3
+ import { createSimpleContext as u } from "./createSimpleContext.js";
4
+ import { useResolvedFloeConfig as v } from "./FloeConfigContext.js";
5
5
  const {
6
- Provider: w,
7
- use: y
8
- } = h({
6
+ Provider: x,
7
+ use: C
8
+ } = u({
9
9
  name: "Layout",
10
- init: u
10
+ init: g
11
11
  });
12
- function u() {
13
- const l = f(), a = () => l.config.layout, b = () => typeof window > "u" ? !1 : window.matchMedia(a().mobileQuery).matches, o = l.persist.load(a().storageKey, {}), c = {
12
+ function g() {
13
+ const n = v(), i = () => n.config.layout, p = () => typeof window > "u" ? !1 : window.matchMedia(i().mobileQuery).matches, s = n.persist.load(i().storageKey, {}), h = {
14
14
  sidebar: {
15
- width: o.sidebar?.width ?? a().sidebar.defaultWidth,
16
- activeTab: o.sidebar?.activeTab ?? a().sidebar.defaultActiveTab,
17
- collapsed: o.sidebar?.collapsed ?? a().sidebar.defaultCollapsed
15
+ width: s.sidebar?.width ?? i().sidebar.defaultWidth,
16
+ activeTab: s.sidebar?.activeTab ?? i().sidebar.defaultActiveTab,
17
+ collapsed: s.sidebar?.collapsed ?? i().sidebar.defaultCollapsed
18
18
  },
19
19
  terminal: {
20
- opened: o.terminal?.opened ?? a().terminal.defaultOpened,
21
- height: o.terminal?.height ?? a().terminal.defaultHeight
20
+ opened: s.terminal?.opened ?? i().terminal.defaultOpened,
21
+ height: s.terminal?.height ?? i().terminal.defaultHeight
22
22
  },
23
- isMobile: b()
24
- }, [i, t] = p(c), s = (e) => Math.max(a().sidebar.clamp.min, Math.min(a().sidebar.clamp.max, e));
25
- return m(() => {
23
+ isMobile: p()
24
+ }, [t, o] = c(h), [l, b] = c({
25
+ motion: "animated",
26
+ revision: 0
27
+ }), m = (e) => Math.max(i().sidebar.clamp.min, Math.min(i().sidebar.clamp.max, e));
28
+ return f(() => {
26
29
  const e = {
27
30
  sidebar: {
28
- width: i.sidebar.width,
29
- activeTab: i.sidebar.activeTab,
30
- collapsed: i.sidebar.collapsed
31
+ width: t.sidebar.width,
32
+ activeTab: t.sidebar.activeTab,
33
+ collapsed: t.sidebar.collapsed
31
34
  },
32
35
  terminal: {
33
- opened: i.terminal.opened,
34
- height: i.terminal.height
36
+ opened: t.terminal.opened,
37
+ height: t.terminal.height
35
38
  }
36
39
  };
37
- l.persist.debouncedSave(a().storageKey, e);
40
+ n.persist.debouncedSave(i().storageKey, e);
38
41
  }), {
39
42
  // Sidebar accessors
40
- sidebarWidth: () => i.sidebar.width,
41
- sidebarActiveTab: () => i.sidebar.activeTab,
42
- sidebarCollapsed: () => i.sidebar.collapsed,
43
- clampSidebarWidth: s,
43
+ sidebarWidth: () => t.sidebar.width,
44
+ sidebarActiveTab: () => t.sidebar.activeTab,
45
+ sidebarCollapsed: () => t.sidebar.collapsed,
46
+ sidebarVisibilityMotion: () => l.motion,
47
+ sidebarVisibilityMotionRevision: () => l.revision,
48
+ clampSidebarWidth: m,
44
49
  // Sidebar actions
45
- setSidebarWidth: (e) => t(d((r) => {
46
- r.sidebar.width = s(e);
50
+ setSidebarWidth: (e) => o(r((a) => {
51
+ a.sidebar.width = m(e);
47
52
  })),
48
- setSidebarActiveTab: (e, r) => t(d((n) => {
49
- n.sidebar.activeTab = e, r?.openSidebar !== !1 && (n.sidebar.collapsed = !1);
50
- })),
51
- setSidebarCollapsed: (e) => t(d((r) => {
52
- r.sidebar.collapsed = e;
53
+ setSidebarActiveTab: (e, a) => {
54
+ o(r((d) => {
55
+ d.sidebar.activeTab = e, a?.openSidebar !== !1 && (d.sidebar.collapsed = !1);
56
+ })), a?.visibilityMotion === "instant" && b(r((d) => {
57
+ d.motion = "instant", d.revision += 1;
58
+ }));
59
+ },
60
+ setSidebarCollapsed: (e) => o(r((a) => {
61
+ a.sidebar.collapsed = e;
53
62
  })),
54
- toggleSidebarCollapse: () => t(d((e) => {
63
+ toggleSidebarCollapse: () => o(r((e) => {
55
64
  e.sidebar.collapsed = !e.sidebar.collapsed;
56
65
  })),
66
+ clearSidebarVisibilityMotion: (e) => {
67
+ l.revision === e && b("motion", "animated");
68
+ },
57
69
  // Terminal accessors
58
- terminalOpened: () => i.terminal.opened,
59
- terminalHeight: () => i.terminal.height,
70
+ terminalOpened: () => t.terminal.opened,
71
+ terminalHeight: () => t.terminal.height,
60
72
  // Terminal actions
61
- toggleTerminal: () => t(d((e) => {
73
+ toggleTerminal: () => o(r((e) => {
62
74
  e.terminal.opened = !e.terminal.opened;
63
75
  })),
64
- setTerminalHeight: (e) => t(d((r) => {
65
- r.terminal.height = Math.max(a().terminal.clamp.min, Math.min(a().terminal.clamp.max, e));
76
+ setTerminalHeight: (e) => o(r((a) => {
77
+ a.terminal.height = Math.max(i().terminal.clamp.min, Math.min(i().terminal.clamp.max, e));
66
78
  })),
67
79
  // Mobile
68
- isMobile: () => i.isMobile,
69
- setIsMobile: (e) => t("isMobile", e)
80
+ isMobile: () => t.isMobile,
81
+ setIsMobile: (e) => o("isMobile", e)
70
82
  };
71
83
  }
72
84
  export {
73
- w as LayoutProvider,
74
- u as createLayoutService,
75
- y as useLayout
85
+ x as LayoutProvider,
86
+ g as createLayoutService,
87
+ C as useLayout
76
88
  };