@floegence/floe-webapp-core 0.35.19 → 0.35.21

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,92 +1,92 @@
1
- import { use as et, insert as u, createComponent as m, effect as E, className as j, setStyleProperty as B, addEventListener as ct, template as _, spread as mt, mergeProps as ut, Dynamic as ft, memo as ot, delegateEvents as gt } from "solid-js/web";
2
- import { createMemo as tt, createSignal as at, Show as W, For as st, untrack as ht, onCleanup as xt } from "solid-js";
1
+ import { use as tt, insert as u, createComponent as m, effect as F, className as V, setStyleProperty as B, addEventListener as ct, template as _, spread as mt, mergeProps as ut, memo as rt, delegateEvents as ft } from "solid-js/web";
2
+ import { createMemo as Z, createSignal as ot, Show as W, For as at, untrack as gt, onCleanup as ht } from "solid-js";
3
3
  import { cn as H } from "../../utils/cn.js";
4
- import { useMediaQuery as nt } from "../../hooks/useMediaQuery.js";
5
- import { useResizeObserver as vt } from "../../hooks/useResizeObserver.js";
6
- import { useVirtualWindow as wt } from "../../hooks/useVirtualWindow.js";
7
- import { useFileBrowser as lt } from "./FileBrowserContext.js";
8
- import { useFileBrowserDrag as Ct } from "../../context/FileBrowserDragContext.js";
9
- import { FolderIcon as bt, getFileIcon as Dt } from "./FileIcons.js";
10
- import { ChevronDown as St } from "../icons/index.js";
11
- import { createLongPressContextMenuHandlers as $t } from "./longPressContextMenu.js";
12
- import { ResizeHandle as it } from "../layout/ResizeHandle.js";
13
- import { fileBrowserTouchTargetAttrs as Mt } from "./touchInteractionGuard.js";
14
- var zt = /* @__PURE__ */ _("<span class=truncate>"), _t = /* @__PURE__ */ _('<mark class="bg-warning/40 text-inherit rounded-sm">'), yt = /* @__PURE__ */ _("<span>"), It = /* @__PURE__ */ _('<div><button type=button class="group w-full flex items-center justify-start text-left px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Modified'), Pt = /* @__PURE__ */ _('<div class=shrink-0><button type=button class="group w-full flex items-center justify-start text-left px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Size'), kt = /* @__PURE__ */ _("<div>"), Tt = /* @__PURE__ */ _('<div><div class="flex items-center border-b border-border text-[11px] text-muted-foreground font-medium"><div><button type=button class="group w-full flex items-center min-w-0 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors"><span class="flex items-center gap-2 min-w-0"><span class="flex-shrink-0 w-4 h-4"aria-hidden=true></span><span class="flex items-center min-w-0"><span class=truncate>Name</span></span></span></button></div></div><div class="flex-1 min-h-0 overflow-auto">'), Lt = /* @__PURE__ */ _('<span>No files matching "<!>"'), pt = /* @__PURE__ */ _('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), Rt = /* @__PURE__ */ _('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), Wt = /* @__PURE__ */ _("<span>This folder is empty"), rt = /* @__PURE__ */ _('<div class="shrink-0 px-3 py-1.5 text-left text-muted-foreground truncate">'), Ft = /* @__PURE__ */ _('<button type=button><div class="flex items-center gap-2 flex-1 min-w-0 px-3 py-1.5"><span class="flex-shrink-0 w-4 h-4">');
15
- function Et(t) {
16
- const a = tt(() => {
4
+ import { useMediaQuery as et } from "../../hooks/useMediaQuery.js";
5
+ import { useResizeObserver as xt } from "../../hooks/useResizeObserver.js";
6
+ import { useVirtualWindow as vt } from "../../hooks/useVirtualWindow.js";
7
+ import { useFileBrowser as st } from "./FileBrowserContext.js";
8
+ import { useFileBrowserDrag as wt } from "../../context/FileBrowserDragContext.js";
9
+ import { FileItemIcon as Ct } from "./FileIcons.js";
10
+ import { ChevronDown as bt } from "../icons/index.js";
11
+ import { createLongPressContextMenuHandlers as Dt } from "./longPressContextMenu.js";
12
+ import { ResizeHandle as nt } from "../layout/ResizeHandle.js";
13
+ import { fileBrowserTouchTargetAttrs as St } from "./touchInteractionGuard.js";
14
+ var $t = /* @__PURE__ */ _("<span class=truncate>"), Mt = /* @__PURE__ */ _('<mark class="bg-warning/40 text-inherit rounded-sm">'), zt = /* @__PURE__ */ _("<span>"), _t = /* @__PURE__ */ _('<div><button type=button class="group w-full flex items-center justify-start text-left px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Modified'), yt = /* @__PURE__ */ _('<div class=shrink-0><button type=button class="group w-full flex items-center justify-start text-left px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Size'), It = /* @__PURE__ */ _("<div>"), Pt = /* @__PURE__ */ _('<div><div class="flex items-center border-b border-border text-[11px] text-muted-foreground font-medium"><div><button type=button class="group w-full flex items-center min-w-0 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors"><span class="flex items-center gap-2 min-w-0"><span class="flex-shrink-0 w-4 h-4"aria-hidden=true></span><span class="flex items-center min-w-0"><span class=truncate>Name</span></span></span></button></div></div><div class="flex-1 min-h-0 overflow-auto">'), kt = /* @__PURE__ */ _('<span>No files matching "<!>"'), Tt = /* @__PURE__ */ _('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), Lt = /* @__PURE__ */ _('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), pt = /* @__PURE__ */ _("<span>This folder is empty"), it = /* @__PURE__ */ _('<div class="shrink-0 px-3 py-1.5 text-left text-muted-foreground truncate">'), Rt = /* @__PURE__ */ _('<button type=button><div class="flex items-center gap-2 flex-1 min-w-0 px-3 py-1.5"><span class="flex-shrink-0 w-4 h-4">');
15
+ function Wt(t) {
16
+ const a = Z(() => {
17
17
  if (!t.match || t.match.matchedIndices.length === 0)
18
18
  return [{
19
19
  text: t.name,
20
20
  highlight: !1
21
21
  }];
22
- const C = [], T = new Set(t.match.matchedIndices);
23
- let S = "", $ = !1;
22
+ const C = [], L = new Set(t.match.matchedIndices);
23
+ let D = "", S = !1;
24
24
  for (let f = 0; f < t.name.length; f++) {
25
- const y = T.has(f);
26
- f === 0 ? ($ = y, S = t.name[f]) : y === $ ? S += t.name[f] : (C.push({
27
- text: S,
28
- highlight: $
29
- }), S = t.name[f], $ = y);
25
+ const y = L.has(f);
26
+ f === 0 ? (S = y, D = t.name[f]) : y === S ? D += t.name[f] : (C.push({
27
+ text: D,
28
+ highlight: S
29
+ }), D = t.name[f], S = y);
30
30
  }
31
- return S && C.push({
32
- text: S,
33
- highlight: $
31
+ return D && C.push({
32
+ text: D,
33
+ highlight: S
34
34
  }), C;
35
35
  });
36
36
  return (() => {
37
- var C = zt();
38
- return u(C, m(st, {
37
+ var C = $t();
38
+ return u(C, m(at, {
39
39
  get each() {
40
40
  return a();
41
41
  },
42
- children: (T) => m(W, {
42
+ children: (L) => m(W, {
43
43
  get when() {
44
- return T.highlight;
44
+ return L.highlight;
45
45
  },
46
46
  get fallback() {
47
- return ot(() => T.text);
47
+ return rt(() => L.text);
48
48
  },
49
49
  get children() {
50
- var S = _t();
51
- return u(S, () => T.text), S;
50
+ var D = Mt();
51
+ return u(D, () => L.text), D;
52
52
  }
53
53
  })
54
54
  })), C;
55
55
  })();
56
56
  }
57
- function Jt(t) {
58
- const a = lt(), C = Ct(), T = () => (t.enableDragDrop ?? !0) && !!C, S = () => t.instanceId ?? "default", $ = 32, f = wt({
57
+ function Kt(t) {
58
+ const a = st(), C = wt(), L = () => (t.enableDragDrop ?? !0) && !!C, D = () => t.instanceId ?? "default", S = 32, f = vt({
59
59
  count: () => a.currentFiles().length,
60
- itemSize: () => $,
60
+ itemSize: () => S,
61
61
  overscan: 12
62
- }), y = tt(() => {
62
+ }), y = Z(() => {
63
63
  const {
64
64
  start: r,
65
65
  end: n
66
66
  } = f.range();
67
67
  return a.currentFiles().slice(r, n);
68
- }), F = (r) => {
68
+ }), E = (r) => {
69
69
  const n = a.sortConfig();
70
70
  a.setSortConfig({
71
71
  field: r,
72
72
  direction: n.field === r && n.direction === "asc" ? "desc" : "asc"
73
73
  });
74
- }, O = (r) => r === void 0 ? "-" : r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : `${(r / (1024 * 1024)).toFixed(1)} MB`, M = (r) => r ? r.toLocaleDateString("en-US", {
74
+ }, O = (r) => r === void 0 ? "-" : r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : `${(r / (1024 * 1024)).toFixed(1)} MB`, $ = (r) => r ? r.toLocaleDateString("en-US", {
75
75
  month: "short",
76
76
  day: "numeric",
77
77
  year: "numeric"
78
78
  }) : "-", X = (r) => {
79
79
  const n = () => a.sortConfig(), l = () => n().field === r.field;
80
80
  return (() => {
81
- var d = yt();
82
- return u(d, m(St, {
81
+ var d = zt();
82
+ return u(d, m(bt, {
83
83
  get class() {
84
84
  return H("w-3 h-3 transition-transform duration-150", l() && n().direction === "asc" && "rotate-180");
85
85
  }
86
- })), E(() => j(d, H("ml-1 transition-all duration-150", l() ? "opacity-100" : "opacity-0 group-hover:opacity-40"))), d;
86
+ })), F(() => V(d, H("ml-1 transition-all duration-150", l() ? "opacity-100" : "opacity-0 group-hover:opacity-40"))), d;
87
87
  })();
88
- }, K = nt("(min-width: 640px)"), A = nt("(min-width: 768px)"), [q, U] = at(null), L = vt(q), N = (r, n, l) => Math.max(n, Math.min(l, r)), h = tt(() => {
89
- const r = L()?.width ?? 0, n = K(), l = A(), d = a.listColumnRatios(), x = 160, g = 120, v = 80, z = 128, o = 96;
88
+ }, j = et("(min-width: 640px)"), A = et("(min-width: 768px)"), [K, Y] = ot(null), p = xt(K), N = (r, n, l) => Math.max(n, Math.min(l, r)), h = Z(() => {
89
+ const r = p()?.width ?? 0, n = j(), l = A(), d = a.listColumnRatios(), x = 160, g = 120, w = 80, M = 128, o = 96;
90
90
  if (!n || r <= 0)
91
91
  return {
92
92
  width: r,
@@ -94,8 +94,8 @@ function Jt(t) {
94
94
  showSize: l,
95
95
  minName: x,
96
96
  minModified: g,
97
- minSize: v,
98
- modifiedWidth: z,
97
+ minSize: w,
98
+ modifiedWidth: M,
99
99
  sizeWidth: o
100
100
  };
101
101
  if (!l) {
@@ -107,44 +107,44 @@ function Jt(t) {
107
107
  showSize: l,
108
108
  minName: x,
109
109
  minModified: g,
110
- minSize: v,
110
+ minSize: w,
111
111
  modifiedWidth: P,
112
112
  sizeWidth: 0
113
113
  };
114
114
  }
115
- let i = Math.max(g, d.modifiedAt * r), s = Math.max(v, d.size * r);
115
+ let i = Math.max(g, d.modifiedAt * r), s = Math.max(w, d.size * r);
116
116
  const b = Math.max(0, r - x);
117
117
  if (i + s > b) {
118
- const I = i + s - b, k = Math.max(0, i - g), P = Math.max(0, s - v), p = k + P;
119
- p > 0 && (i -= I * (k / p), s -= I * (P / p));
118
+ const I = i + s - b, k = Math.max(0, i - g), P = Math.max(0, s - w), T = k + P;
119
+ T > 0 && (i -= I * (k / T), s -= I * (P / T));
120
120
  }
121
- return i = Math.max(g, i), s = Math.max(v, s), {
121
+ return i = Math.max(g, i), s = Math.max(w, s), {
122
122
  width: r,
123
123
  showModified: n,
124
124
  showSize: l,
125
125
  minName: x,
126
126
  minModified: g,
127
- minSize: v,
127
+ minSize: w,
128
128
  modifiedWidth: i,
129
129
  sizeWidth: s
130
130
  };
131
- }), G = () => h().modifiedWidth, Q = () => h().sizeWidth, V = (r) => {
131
+ }), G = () => h().modifiedWidth, U = () => h().sizeWidth, Q = (r) => {
132
132
  const n = h();
133
133
  if (!n.showModified || n.width <= 0) return;
134
134
  if (!n.showSize) {
135
135
  const I = a.listColumnRatios().size, k = Math.max(0, 1 - I);
136
136
  if (k <= 0) return;
137
- const P = n.width, p = n.modifiedWidth, Y = Math.max(0, P - p), e = n.minName - Y, c = p - n.minModified, w = N(r, e, c);
138
- if (w === 0) return;
139
- const D = Y + w, R = p - w, Z = D / P * k, dt = R / P * k;
137
+ const P = n.width, T = n.modifiedWidth, e = Math.max(0, P - T), c = n.minName - e, z = T - n.minModified, v = N(r, c, z);
138
+ if (v === 0) return;
139
+ const R = e + v, J = T - v, lt = R / P * k, dt = J / P * k;
140
140
  a.setListColumnRatios({
141
- name: Z,
141
+ name: lt,
142
142
  modifiedAt: dt,
143
143
  size: I
144
144
  });
145
145
  return;
146
146
  }
147
- const l = n.width, d = n.modifiedWidth, x = n.sizeWidth, g = Math.max(0, l - d - x), v = n.minName - g, z = d - n.minModified, o = N(r, v, z);
147
+ const l = n.width, d = n.modifiedWidth, x = n.sizeWidth, g = Math.max(0, l - d - x), w = n.minName - g, M = d - n.minModified, o = N(r, w, M);
148
148
  if (o === 0) return;
149
149
  const i = g + o, s = d - o;
150
150
  a.setListColumnRatios({
@@ -152,12 +152,12 @@ function Jt(t) {
152
152
  modifiedAt: s / l,
153
153
  size: x / l
154
154
  });
155
- }, J = (r) => {
155
+ }, q = (r) => {
156
156
  const n = h();
157
157
  if (!n.showSize || n.width <= 0) return;
158
- const l = n.width, d = n.modifiedWidth, x = n.sizeWidth, g = n.minModified - d, v = x - n.minSize, z = N(r, g, v);
159
- if (z === 0) return;
160
- const o = d + z, i = x - z, s = Math.max(0, l - o - i);
158
+ const l = n.width, d = n.modifiedWidth, x = n.sizeWidth, g = n.minModified - d, w = x - n.minSize, M = N(r, g, w);
159
+ if (M === 0) return;
160
+ const o = d + M, i = x - M, s = Math.max(0, l - o - i);
161
161
  a.setListColumnRatios({
162
162
  name: s / l,
163
163
  modifiedAt: o / l,
@@ -165,19 +165,19 @@ function Jt(t) {
165
165
  });
166
166
  };
167
167
  return (() => {
168
- var r = Tt(), n = r.firstChild, l = n.firstChild, d = l.firstChild, x = d.firstChild, g = x.firstChild, v = g.nextSibling;
169
- v.firstChild;
170
- var z = n.nextSibling;
171
- return et(U, n), d.$$click = () => F("name"), u(v, m(X, {
168
+ var r = Pt(), n = r.firstChild, l = n.firstChild, d = l.firstChild, x = d.firstChild, g = x.firstChild, w = g.nextSibling;
169
+ w.firstChild;
170
+ var M = n.nextSibling;
171
+ return tt(Y, n), d.$$click = () => E("name"), u(w, m(X, {
172
172
  field: "name"
173
173
  }), null), u(l, m(W, {
174
174
  get when() {
175
175
  return h().showModified;
176
176
  },
177
177
  get children() {
178
- return m(it, {
178
+ return m(nt, {
179
179
  direction: "horizontal",
180
- onResize: V
180
+ onResize: Q
181
181
  });
182
182
  }
183
183
  }), null), u(n, m(W, {
@@ -185,22 +185,22 @@ function Jt(t) {
185
185
  return h().showModified;
186
186
  },
187
187
  get children() {
188
- var o = It(), i = o.firstChild;
189
- return i.firstChild, i.$$click = () => F("modifiedAt"), u(i, m(X, {
188
+ var o = _t(), i = o.firstChild;
189
+ return i.firstChild, i.$$click = () => E("modifiedAt"), u(i, m(X, {
190
190
  field: "modifiedAt"
191
191
  }), null), u(o, m(W, {
192
192
  get when() {
193
193
  return h().showSize;
194
194
  },
195
195
  get children() {
196
- return m(it, {
196
+ return m(nt, {
197
197
  direction: "horizontal",
198
- onResize: J
198
+ onResize: q
199
199
  });
200
200
  }
201
- }), null), E((s) => {
201
+ }), null), F((s) => {
202
202
  var b = H("relative shrink-0", h().showSize && "border-r border-border"), I = `${G()}px`;
203
- return b !== s.e && j(o, s.e = b), I !== s.t && B(o, "width", s.t = I), s;
203
+ return b !== s.e && V(o, s.e = b), I !== s.t && B(o, "width", s.t = I), s;
204
204
  }, {
205
205
  e: void 0,
206
206
  t: void 0
@@ -211,33 +211,33 @@ function Jt(t) {
211
211
  return h().showSize;
212
212
  },
213
213
  get children() {
214
- var o = Pt(), i = o.firstChild;
215
- return i.firstChild, i.$$click = () => F("size"), u(i, m(X, {
214
+ var o = yt(), i = o.firstChild;
215
+ return i.firstChild, i.$$click = () => E("size"), u(i, m(X, {
216
216
  field: "size"
217
- }), null), E((s) => B(o, "width", `${Q()}px`)), o;
217
+ }), null), F((s) => B(o, "width", `${U()}px`)), o;
218
218
  }
219
- }), null), ct(z, "scroll", f.onScroll), et((o) => {
219
+ }), null), ct(M, "scroll", f.onScroll), tt((o) => {
220
220
  f.scrollRef(o), a.setScrollContainer(o);
221
- }, z), u(z, m(W, {
221
+ }, M), u(M, m(W, {
222
222
  get when() {
223
223
  return a.currentFiles().length > 0;
224
224
  },
225
225
  get fallback() {
226
226
  return (() => {
227
- var o = Rt();
227
+ var o = Lt();
228
228
  return u(o, m(W, {
229
229
  get when() {
230
230
  return a.filterQueryApplied().trim();
231
231
  },
232
232
  get fallback() {
233
- return Wt();
233
+ return pt();
234
234
  },
235
235
  get children() {
236
236
  return [(() => {
237
- var i = Lt(), s = i.firstChild, b = s.nextSibling;
237
+ var i = kt(), s = i.firstChild, b = s.nextSibling;
238
238
  return b.nextSibling, u(i, () => a.filterQueryApplied(), b), i;
239
239
  })(), (() => {
240
- var i = pt();
240
+ var i = Tt();
241
241
  return i.$$click = () => a.setFilterQuery(""), i;
242
242
  })()];
243
243
  }
@@ -245,15 +245,15 @@ function Jt(t) {
245
245
  })();
246
246
  },
247
247
  get children() {
248
- var o = kt();
249
- return u(o, m(st, {
248
+ var o = It();
249
+ return u(o, m(at, {
250
250
  get each() {
251
251
  return y();
252
252
  },
253
- children: (i) => m(At, {
253
+ children: (i) => m(Et, {
254
254
  item: i,
255
255
  formatSize: O,
256
- formatDate: M,
256
+ formatDate: $,
257
257
  get showModified() {
258
258
  return h().showModified;
259
259
  },
@@ -264,17 +264,17 @@ function Jt(t) {
264
264
  return G();
265
265
  },
266
266
  get sizeWidthPx() {
267
- return Q();
267
+ return U();
268
268
  },
269
269
  get instanceId() {
270
- return S();
270
+ return D();
271
271
  },
272
272
  get enableDragDrop() {
273
- return T();
273
+ return L();
274
274
  },
275
275
  dragContext: C
276
276
  })
277
- })), E((i) => {
277
+ })), F((i) => {
278
278
  var s = `${f.paddingTop()}px`, b = `${f.paddingBottom()}px`;
279
279
  return s !== i.e && B(o, "padding-top", i.e = s), b !== i.t && B(o, "padding-bottom", i.t = b), i;
280
280
  }, {
@@ -282,49 +282,49 @@ function Jt(t) {
282
282
  t: void 0
283
283
  }), o;
284
284
  }
285
- })), E((o) => {
285
+ })), F((o) => {
286
286
  var i = H("flex flex-col h-full min-h-0", t.class), s = H("relative flex-1 min-w-0", h().showModified && "border-r border-border");
287
- return i !== o.e && j(r, o.e = i), s !== o.t && j(l, o.t = s), o;
287
+ return i !== o.e && V(r, o.e = i), s !== o.t && V(l, o.t = s), o;
288
288
  }, {
289
289
  e: void 0,
290
290
  t: void 0
291
291
  }), r;
292
292
  })();
293
293
  }
294
- function At(t) {
295
- const a = lt(), C = () => a.isSelected(t.item.id), T = () => a.getFilterMatchForId(t.item.id), S = ht(() => t.item), $ = $t(a, S);
296
- let f, y = null, F = 0, O = 0, M = !1;
297
- const X = 5, K = 500;
294
+ function Et(t) {
295
+ const a = st(), C = () => a.isSelected(t.item.id), L = () => a.getFilterMatchForId(t.item.id), D = gt(() => t.item), S = Dt(a, D);
296
+ let f, y = null, E = 0, O = 0, $ = !1;
297
+ const X = 5, j = 500;
298
298
  let A = null;
299
- const [q, U] = at(!1), L = () => f === "touch" || f === "pen", N = () => t.item.type === "folder", h = () => N() && t.enableDragDrop && t.dragContext, G = () => {
299
+ const [K, Y] = ot(!1), p = () => f === "touch" || f === "pen", N = () => t.item.type === "folder", h = () => N() && t.enableDragDrop && t.dragContext, G = () => {
300
300
  if (!h() || !t.dragContext) return !1;
301
301
  const e = t.dragContext.dragState();
302
302
  return e.isDragging ? t.dragContext.canDropOn(e.draggedItems, t.item.path, t.item, t.instanceId) : !1;
303
- }, Q = () => {
303
+ }, U = () => {
304
304
  if (!t.dragContext) return !1;
305
305
  const e = t.dragContext.dragState();
306
306
  return e.isDragging ? e.draggedItems.some((c) => c.item.id === t.item.id) : !1;
307
- }, V = () => {
307
+ }, Q = () => {
308
308
  A !== null && (clearTimeout(A), A = null);
309
- }, J = () => {
309
+ }, q = () => {
310
310
  typeof document > "u" || (document.removeEventListener("pointermove", d, !0), document.removeEventListener("pointerup", x, !0), document.removeEventListener("pointercancel", g, !0));
311
311
  }, r = () => {
312
312
  typeof document > "u" || (document.addEventListener("pointermove", d, !0), document.addEventListener("pointerup", x, !0), document.addEventListener("pointercancel", g, !0));
313
313
  }, n = (e) => {
314
- V(), J(), M && t.dragContext && t.dragContext.endDrag(e), y = null, M = !1;
314
+ Q(), q(), $ && t.dragContext && t.dragContext.endDrag(e), y = null, $ = !1;
315
315
  };
316
- xt(() => {
316
+ ht(() => {
317
317
  n(!1);
318
318
  });
319
319
  const l = (e, c) => {
320
- if (!t.enableDragDrop || !t.dragContext || M) return;
321
- M = !0, C() || a.selectItem(t.item.id, !1);
322
- const w = a.getSelectedItemsList(), R = (w.length > 0 && C() ? w : [t.item]).map((Z) => ({
323
- item: Z,
320
+ if (!t.enableDragDrop || !t.dragContext || $) return;
321
+ $ = !0, C() || a.selectItem(t.item.id, !1);
322
+ const z = a.getSelectedItemsList(), R = (z.length > 0 && C() ? z : [t.item]).map((J) => ({
323
+ item: J,
324
324
  sourceInstanceId: t.instanceId,
325
325
  sourcePath: a.currentPath()
326
326
  }));
327
- if (L() && "vibrate" in navigator)
327
+ if (p() && "vibrate" in navigator)
328
328
  try {
329
329
  navigator.vibrate(50);
330
330
  } catch {
@@ -332,70 +332,70 @@ function At(t) {
332
332
  t.dragContext.startDrag(R, e, c);
333
333
  }, d = (e) => {
334
334
  if (y !== e.pointerId) return;
335
- const c = e.clientX - F, w = e.clientY - O, D = Math.sqrt(c * c + w * w);
336
- if (L() && !M && D > 10) {
335
+ const c = e.clientX - E, z = e.clientY - O, v = Math.sqrt(c * c + z * z);
336
+ if (p() && !$ && v > 10) {
337
337
  n(!1);
338
338
  return;
339
339
  }
340
- !L() && !M && D > X && l(e.clientX, e.clientY), M && t.dragContext && t.dragContext.updateDrag(e.clientX, e.clientY);
340
+ !p() && !$ && v > X && l(e.clientX, e.clientY), $ && t.dragContext && t.dragContext.updateDrag(e.clientX, e.clientY);
341
341
  }, x = (e) => {
342
- y === e.pointerId && ($.onPointerUp(), n(!0));
342
+ y === e.pointerId && (S.onPointerUp(), n(!0));
343
343
  }, g = (e) => {
344
- y === e.pointerId && ($.onPointerCancel(), n(!1));
345
- }, v = (e) => {
346
- f = e.pointerType, $.onPointerDown(e), !(e.pointerType === "mouse" && e.button !== 0) && (!t.enableDragDrop || !t.dragContext || (y = e.pointerId, F = e.clientX, O = e.clientY, M = !1, r(), L() && (V(), A = setTimeout(() => {
347
- y !== null && !M && l(F, O);
348
- }, K))));
349
- }, z = (e) => {
350
- f = e.pointerType, $.onPointerMove(e);
344
+ y === e.pointerId && (S.onPointerCancel(), n(!1));
345
+ }, w = (e) => {
346
+ f = e.pointerType, S.onPointerDown(e), !(e.pointerType === "mouse" && e.button !== 0) && (!t.enableDragDrop || !t.dragContext || (y = e.pointerId, E = e.clientX, O = e.clientY, $ = !1, r(), p() && (Q(), A = setTimeout(() => {
347
+ y !== null && !$ && l(E, O);
348
+ }, j))));
349
+ }, M = (e) => {
350
+ f = e.pointerType, S.onPointerMove(e);
351
351
  }, o = (e) => {
352
352
  if (!h() || !t.dragContext) return;
353
353
  const c = t.dragContext.dragState();
354
354
  if (!c.isDragging) return;
355
- U(!0);
356
- const w = t.dragContext.canDropOn(c.draggedItems, t.item.path, t.item, t.instanceId), R = e.currentTarget?.getBoundingClientRect() ?? null;
355
+ Y(!0);
356
+ const z = t.dragContext.canDropOn(c.draggedItems, t.item.path, t.item, t.instanceId), R = e.currentTarget?.getBoundingClientRect() ?? null;
357
357
  t.dragContext.setDropTarget({
358
358
  instanceId: t.instanceId,
359
359
  targetPath: t.item.path,
360
360
  targetItem: t.item
361
- }, w, R);
361
+ }, z, R);
362
362
  }, i = (e) => {
363
363
  if (!t.dragContext) return;
364
- U(!1);
364
+ Y(!1);
365
365
  const c = t.dragContext.dragState();
366
366
  c.isDragging && c.dropTarget?.targetPath === t.item.path && t.dragContext.setDropTarget(null, !1);
367
367
  }, s = (e) => {
368
- if (M) {
369
- M = !1;
368
+ if ($) {
369
+ $ = !1;
370
370
  return;
371
371
  }
372
- if (!$.consumeClickSuppression(e)) {
373
- if (L()) {
372
+ if (!S.consumeClickSuppression(e)) {
373
+ if (p()) {
374
374
  a.openItem(t.item);
375
375
  return;
376
376
  }
377
377
  a.selectItem(t.item.id, e.metaKey || e.ctrlKey);
378
378
  }
379
379
  }, b = () => {
380
- L() || a.openItem(t.item);
380
+ p() || a.openItem(t.item);
381
381
  }, I = (e) => {
382
- if (e.preventDefault(), e.stopPropagation(), L()) return;
382
+ if (e.preventDefault(), e.stopPropagation(), p()) return;
383
383
  C() || a.selectItem(t.item.id, !1);
384
- const c = a.getSelectedItemsList(), w = c.length > 0 ? c : [t.item];
384
+ const c = a.getSelectedItemsList(), z = c.length > 0 ? c : [t.item];
385
385
  a.showContextMenu({
386
386
  x: e.clientX,
387
387
  y: e.clientY,
388
- items: w
388
+ items: z
389
389
  });
390
- }, k = () => t.item.type === "folder" ? bt : Dt(t.item.extension), P = () => t.dragContext?.dragState(), p = () => P()?.isDragging ?? !1, Y = () => q() && p() && h();
390
+ }, k = () => t.dragContext?.dragState(), P = () => k()?.isDragging ?? !1, T = () => K() && P() && h();
391
391
  return (() => {
392
- var e = Ft(), c = e.firstChild, w = c.firstChild;
393
- return mt(e, ut(Mt, {
392
+ var e = Rt(), c = e.firstChild, z = c.firstChild;
393
+ return mt(e, ut(St, {
394
394
  onClick: s,
395
395
  onDblClick: b,
396
396
  onContextMenu: I,
397
- onPointerDown: v,
398
- onPointerMove: z,
397
+ onPointerDown: w,
398
+ onPointerMove: M,
399
399
  onPointerEnter: o,
400
400
  onPointerLeave: i,
401
401
  get class() {
@@ -406,47 +406,47 @@ function At(t) {
406
406
  "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring",
407
407
  C() && "bg-accent text-accent-foreground",
408
408
  // Drag state styling - being dragged items become translucent
409
- Q() && "opacity-40 scale-[0.98]",
409
+ U() && "opacity-40 scale-[0.98]",
410
410
  // Drop target styling - enhanced visual feedback
411
- Y() && G() && ["bg-primary/15 outline outline-2 outline-primary/60", "scale-[1.01] shadow-sm shadow-primary/10"],
412
- Y() && !G() && ["bg-destructive/10 outline outline-2 outline-dashed outline-destructive/50"]
411
+ T() && G() && ["bg-primary/15 outline outline-2 outline-primary/60", "scale-[1.01] shadow-sm shadow-primary/10"],
412
+ T() && !G() && ["bg-destructive/10 outline outline-2 outline-dashed outline-destructive/50"]
413
413
  );
414
414
  }
415
- }), !1, !0), u(w, m(ft, {
416
- get component() {
417
- return k();
415
+ }), !1, !0), u(z, m(Ct, {
416
+ get item() {
417
+ return t.item;
418
418
  },
419
419
  class: "w-4 h-4"
420
- })), u(c, m(Et, {
420
+ })), u(c, m(Wt, {
421
421
  get name() {
422
422
  return t.item.name;
423
423
  },
424
424
  get match() {
425
- return T();
425
+ return L();
426
426
  }
427
427
  }), null), u(e, m(W, {
428
428
  get when() {
429
429
  return t.showModified;
430
430
  },
431
431
  get children() {
432
- var D = rt();
433
- return u(D, () => t.formatDate(t.item.modifiedAt)), E((R) => B(D, "width", `${t.modifiedWidthPx}px`)), D;
432
+ var v = it();
433
+ return u(v, () => t.formatDate(t.item.modifiedAt)), F((R) => B(v, "width", `${t.modifiedWidthPx}px`)), v;
434
434
  }
435
435
  }), null), u(e, m(W, {
436
436
  get when() {
437
437
  return t.showSize;
438
438
  },
439
439
  get children() {
440
- var D = rt();
441
- return u(D, (() => {
442
- var R = ot(() => t.item.type === "folder");
440
+ var v = it();
441
+ return u(v, (() => {
442
+ var R = rt(() => t.item.type === "folder");
443
443
  return () => R() ? "-" : t.formatSize(t.item.size);
444
- })()), E((R) => B(D, "width", `${t.sizeWidthPx}px`)), D;
444
+ })()), F((R) => B(v, "width", `${t.sizeWidthPx}px`)), v;
445
445
  }
446
446
  }), null), e;
447
447
  })();
448
448
  }
449
- gt(["click"]);
449
+ ft(["click"]);
450
450
  export {
451
- Jt as FileListView
451
+ Kt as FileListView
452
452
  };
@@ -6,5 +6,5 @@ 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 { FolderIcon, FolderOpenIcon, FileIcon, CodeFileIcon, ShellScriptFileIcon, ImageFileIcon, DocumentFileIcon, ConfigFileIcon, StyleFileIcon, getFileIcon, } from './FileIcons';
10
- export type { FileItem, ViewMode, SortField, SortDirection, SortConfig, FileListColumnRatios, FileBrowserContextValue, ContextMenuActionType, ContextMenuItem, ContextMenuEvent, ContextMenuCallbacks, OptimisticUpdateType, OptimisticRemove, OptimisticUpdate, OptimisticInsert, OptimisticOperation, ScrollPosition, } from './types';
9
+ export { FolderIcon, FolderOpenIcon, FileIcon, CodeFileIcon, JavaScriptFileIcon, TypeScriptFileIcon, ShellScriptFileIcon, ImageFileIcon, DocumentFileIcon, ConfigFileIcon, StyleFileIcon, FileItemIcon, getFileIcon, resolveFileItemIcon, } from './FileIcons';
10
+ export type { FileItem, FileItemIconOverride, ViewMode, SortField, SortDirection, SortConfig, FileListColumnRatios, FileBrowserContextValue, ContextMenuActionType, ContextMenuItem, ContextMenuEvent, ContextMenuCallbacks, OptimisticUpdateType, OptimisticRemove, OptimisticUpdate, OptimisticInsert, OptimisticOperation, ScrollPosition, } from './types';
@@ -1,4 +1,7 @@
1
- import type { JSX, Accessor } from 'solid-js';
1
+ import type { JSX, Accessor, Component } from 'solid-js';
2
+ export type FileItemIconOverride = Component<{
3
+ class?: string;
4
+ }> | JSX.Element;
2
5
  /**
3
6
  * Represents a file or folder item in the browser
4
7
  */
@@ -11,7 +14,7 @@ export interface FileItem {
11
14
  modifiedAt?: Date;
12
15
  extension?: string;
13
16
  children?: FileItem[];
14
- icon?: JSX.Element;
17
+ icon?: FileItemIconOverride;
15
18
  }
16
19
  /**
17
20
  * View mode for the file browser main content area