@floegence/floe-webapp-core 0.36.72 → 0.36.73

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,44 +1,45 @@
1
- import { use as ee, insert as f, createComponent as m, effect as p, className as N, setStyleProperty as L, addEventListener as ie, style as Ce, template as z, spread as be, mergeProps as Me, memo as ce, delegateEvents as De } from "solid-js/web";
2
- import { createMemo as te, createEffect as Ie, onCleanup as de, createSignal as ue, Show as P, For as me, untrack as $e } from "solid-js";
1
+ import { use as ee, insert as f, createComponent as m, effect as k, className as W, setStyleProperty as p, addEventListener as ie, style as be, template as _, spread as De, mergeProps as Ie, memo as ce, delegateEvents as Me } from "solid-js/web";
2
+ import { createMemo as te, createEffect as $e, onCleanup as de, createSignal as ue, Show as P, For as me, untrack as ze } from "solid-js";
3
3
  import { cn as E } from "../../utils/cn.js";
4
4
  import { useMediaQuery as re } from "../../hooks/useMediaQuery.js";
5
5
  import { useResizeObserver as _e } from "../../hooks/useResizeObserver.js";
6
- import { useVirtualWindow as ze } from "../../hooks/useVirtualWindow.js";
6
+ import { useVirtualWindow as ye } from "../../hooks/useVirtualWindow.js";
7
7
  import { useFileBrowser as fe } from "./FileBrowserContext.js";
8
- import { useFileBrowserDrag as ye } from "../../context/FileBrowserDragContext.js";
9
- import { FileItemIcon as Pe } from "./FileIcons.js";
10
- import { ChevronDown as Re } from "../icons/index.js";
11
- import { createLongPressContextMenuHandlers as Te } from "./longPressContextMenu.js";
8
+ import { useFileBrowserDrag as Pe } from "../../context/FileBrowserDragContext.js";
9
+ import { FileItemIcon as Re } from "./FileIcons.js";
10
+ import { FileItemDecorationBadge as Fe, fileItemDecorationNameClass as Te } from "./FileItemDecorations.js";
11
+ import { ChevronDown as ke } from "../icons/index.js";
12
+ import { createLongPressContextMenuHandlers as Ae } from "./longPressContextMenu.js";
12
13
  import { ResizeHandle as oe } from "../layout/ResizeHandle.js";
13
- import { fileBrowserTouchTargetAttrs as Fe } from "./touchInteractionGuard.js";
14
- import { createItemContextMenuEvent as ke } from "./contextMenuEvent.js";
15
- import { createFileBrowserMarqueeSelection as pe, FILE_BROWSER_MARQUEE_OVERLAY_CLASS as Ae } from "./useFileBrowserMarqueeSelection.js";
14
+ import { fileBrowserTouchTargetAttrs as Ee } from "./touchInteractionGuard.js";
15
+ import { createItemContextMenuEvent as Le } from "./contextMenuEvent.js";
16
+ import { createFileBrowserMarqueeSelection as We, FILE_BROWSER_MARQUEE_OVERLAY_CLASS as pe } from "./useFileBrowserMarqueeSelection.js";
16
17
  import { isPrimaryModKeyPressed as ae } from "../../utils/keybind.js";
17
- var Ee = /* @__PURE__ */ z("<span class=truncate>"), Le = /* @__PURE__ */ z('<mark class="bg-warning/40 text-inherit rounded-sm">'), We = /* @__PURE__ */ z("<span>"), He = /* @__PURE__ */ z('<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'), Be = /* @__PURE__ */ z('<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'), le = /* @__PURE__ */ z("<div>"), qe = /* @__PURE__ */ z('<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="relative flex-1 min-h-0 overflow-auto">'), Ne = /* @__PURE__ */ z('<span>No files matching "<!>"'), Oe = /* @__PURE__ */ z('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), Xe = /* @__PURE__ */ z('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), Ye = /* @__PURE__ */ z("<span>This folder is empty"), se = /* @__PURE__ */ z('<div class="shrink-0 px-3 py-1.5 text-left text-muted-foreground truncate">'), Ge = /* @__PURE__ */ z('<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">');
18
- function Ve(t) {
18
+ var ge = /* @__PURE__ */ _("<span>"), Be = /* @__PURE__ */ _('<mark class="bg-warning/40 text-inherit rounded-sm">'), He = /* @__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'), Ne = /* @__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'), le = /* @__PURE__ */ _("<div>"), qe = /* @__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="relative flex-1 min-h-0 overflow-auto">'), Oe = /* @__PURE__ */ _('<span>No files matching "<!>"'), Xe = /* @__PURE__ */ _('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), Ye = /* @__PURE__ */ _('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), Ge = /* @__PURE__ */ _("<span>This folder is empty"), se = /* @__PURE__ */ _('<div class="shrink-0 px-3 py-1.5 text-left text-muted-foreground truncate">'), Ve = /* @__PURE__ */ _('<button type=button><div class="flex items-center gap-2 flex-1 min-w-0 px-3 py-1.5"><span class="relative flex-shrink-0 w-4 h-4">');
19
+ function Ue(e) {
19
20
  const o = te(() => {
20
- if (!t.match || t.match.matchedIndices.length === 0)
21
+ if (!e.match || e.match.matchedIndices.length === 0)
21
22
  return [{
22
- text: t.name,
23
+ text: e.name,
23
24
  highlight: !1
24
25
  }];
25
- const D = [], R = new Set(t.match.matchedIndices);
26
- let I = "", C = !1;
27
- for (let g = 0; g < t.name.length; g++) {
26
+ const I = [], R = new Set(e.match.matchedIndices);
27
+ let M = "", C = !1;
28
+ for (let g = 0; g < e.name.length; g++) {
28
29
  const $ = R.has(g);
29
- g === 0 ? (C = $, I = t.name[g]) : $ === C ? I += t.name[g] : (D.push({
30
- text: I,
30
+ g === 0 ? (C = $, M = e.name[g]) : $ === C ? M += e.name[g] : (I.push({
31
+ text: M,
31
32
  highlight: C
32
- }), I = t.name[g], C = $);
33
+ }), M = e.name[g], C = $);
33
34
  }
34
- return I && D.push({
35
- text: I,
35
+ return M && I.push({
36
+ text: M,
36
37
  highlight: C
37
- }), D;
38
+ }), I;
38
39
  });
39
40
  return (() => {
40
- var D = Ee();
41
- return f(D, m(me, {
41
+ var I = ge();
42
+ return f(I, m(me, {
42
43
  get each() {
43
44
  return o();
44
45
  },
@@ -50,15 +51,15 @@ function Ve(t) {
50
51
  return ce(() => R.text);
51
52
  },
52
53
  get children() {
53
- var I = Le();
54
- return f(I, () => R.text), I;
54
+ var M = Be();
55
+ return f(M, () => R.text), M;
55
56
  }
56
57
  })
57
- })), D;
58
+ })), k(() => W(I, E("truncate", e.class))), I;
58
59
  })();
59
60
  }
60
- function ut(t) {
61
- const o = fe(), D = ye(), R = () => (t.enableDragDrop ?? !0) && !!D, I = () => t.instanceId ?? "default", C = 32, g = ze({
61
+ function ft(e) {
62
+ const o = fe(), I = Pe(), R = () => (e.enableDragDrop ?? !0) && !!I, M = () => e.instanceId ?? "default", C = 32, g = ye({
62
63
  count: () => o.currentFiles().length,
63
64
  itemSize: () => C,
64
65
  overscan: 12
@@ -68,35 +69,35 @@ function ut(t) {
68
69
  end: i
69
70
  } = g.range();
70
71
  return o.currentFiles().slice(n, i);
71
- }), T = /* @__PURE__ */ new Map();
72
- let _ = null, x = 0;
72
+ }), F = /* @__PURE__ */ new Map();
73
+ let z = null, x = 0;
73
74
  const U = (n, i) => {
74
75
  if (i) {
75
- T.set(n, i);
76
+ F.set(n, i);
76
77
  return;
77
78
  }
78
- T.delete(n);
79
+ F.delete(n);
79
80
  }, Q = (n) => {
80
- if (!_) return;
81
- const i = n * C, l = i + C, c = _.scrollTop, h = c + _.clientHeight;
81
+ if (!z) return;
82
+ const i = n * C, l = i + C, c = z.scrollTop, h = c + z.clientHeight;
82
83
  if (i < c) {
83
- _.scrollTop = i, g.onScroll();
84
+ z.scrollTop = i, g.onScroll();
84
85
  return;
85
86
  }
86
- l > h && (_.scrollTop = Math.max(0, l - _.clientHeight), g.onScroll());
87
+ l > h && (z.scrollTop = Math.max(0, l - z.clientHeight), g.onScroll());
87
88
  };
88
- Ie(() => {
89
+ $e(() => {
89
90
  const n = o.revealRequest(), i = o.currentFiles();
90
91
  if ($(), !n) return;
91
92
  const l = i.findIndex((v) => v.id === n.targetId);
92
93
  if (l < 0) return;
93
- if (!T.get(n.targetId)) {
94
+ if (!F.get(n.targetId)) {
94
95
  Q(l);
95
96
  return;
96
97
  }
97
98
  typeof cancelAnimationFrame == "function" && x && (cancelAnimationFrame(x), x = 0);
98
99
  const h = () => {
99
- o.revealRequest()?.requestId === n.requestId && (T.get(n.targetId)?.scrollIntoView({
100
+ o.revealRequest()?.requestId === n.requestId && (F.get(n.targetId)?.scrollIntoView({
100
101
  block: "nearest",
101
102
  inline: "nearest"
102
103
  }), o.selectItem(n.targetId, !1), o.consumeRevealRequest(n.requestId));
@@ -111,7 +112,7 @@ function ut(t) {
111
112
  }), de(() => {
112
113
  typeof cancelAnimationFrame == "function" && x && cancelAnimationFrame(x);
113
114
  });
114
- const k = (n) => {
115
+ const A = (n) => {
115
116
  const i = o.sortConfig();
116
117
  o.setSortConfig({
117
118
  field: n,
@@ -121,26 +122,26 @@ function ut(t) {
121
122
  month: "short",
122
123
  day: "numeric",
123
124
  year: "numeric"
124
- }) : "-", y = pe({
125
- getContainer: () => _,
126
- getOverlayHost: () => _,
125
+ }) : "-", y = We({
126
+ getContainer: () => z,
127
+ getOverlayHost: () => z,
127
128
  getVisibleItemIdsInOrder: () => o.currentFiles().map((n) => n.id),
128
- getElementForId: (n) => T.get(n) ?? null,
129
+ getElementForId: (n) => F.get(n) ?? null,
129
130
  getSelectedIds: () => [...o.selectedItems()],
130
131
  replaceSelection: (n, i) => o.replaceSelection(n, i),
131
132
  clearSelection: o.clearSelection
132
- }), W = (n) => {
133
+ }), B = (n) => {
133
134
  const i = () => o.sortConfig(), l = () => i().field === n.field;
134
135
  return (() => {
135
- var c = We();
136
- return f(c, m(Re, {
136
+ var c = ge();
137
+ return f(c, m(ke, {
137
138
  get class() {
138
139
  return E("w-3 h-3 transition-transform duration-150", l() && i().direction === "asc" && "rotate-180");
139
140
  }
140
- })), p(() => N(c, E("ml-1 transition-all duration-150", l() ? "opacity-100" : "opacity-0 group-hover:opacity-40"))), c;
141
+ })), k(() => W(c, E("ml-1 transition-all duration-150", l() ? "opacity-100" : "opacity-0 group-hover:opacity-40"))), c;
141
142
  })();
142
- }, H = re("(min-width: 640px)"), X = re("(min-width: 768px)"), [K, Y] = ue(null), J = _e(K), A = (n, i, l) => Math.max(i, Math.min(l, n)), S = te(() => {
143
- const n = J()?.width ?? 0, i = H(), l = X(), c = o.listColumnRatios(), h = 160, v = 120, b = 80, M = 128, a = 96;
143
+ }, H = re("(min-width: 640px)"), X = re("(min-width: 768px)"), [K, Y] = ue(null), J = _e(K), L = (n, i, l) => Math.max(i, Math.min(l, n)), S = te(() => {
144
+ const n = J()?.width ?? 0, i = H(), l = X(), c = o.listColumnRatios(), h = 160, v = 120, b = 80, D = 128, a = 96;
144
145
  if (!i || n <= 0)
145
146
  return {
146
147
  width: n,
@@ -149,13 +150,13 @@ function ut(t) {
149
150
  minName: h,
150
151
  minModified: v,
151
152
  minSize: b,
152
- modifiedWidth: M,
153
+ modifiedWidth: D,
153
154
  sizeWidth: a
154
155
  };
155
156
  if (!l) {
156
157
  const u = c.size, d = Math.max(0, 1 - u);
157
158
  let w = (d > 0 ? c.modifiedAt / d : c.modifiedAt) * n;
158
- return w = A(w, v, Math.max(v, n - h)), {
159
+ return w = L(w, v, Math.max(v, n - h)), {
159
160
  width: n,
160
161
  showModified: i,
161
162
  showSize: l,
@@ -166,13 +167,13 @@ function ut(t) {
166
167
  sizeWidth: 0
167
168
  };
168
169
  }
169
- let r = Math.max(v, c.modifiedAt * n), e = Math.max(b, c.size * n);
170
+ let r = Math.max(v, c.modifiedAt * n), t = Math.max(b, c.size * n);
170
171
  const s = Math.max(0, n - h);
171
- if (r + e > s) {
172
- const u = r + e - s, d = Math.max(0, r - v), w = Math.max(0, e - b), F = d + w;
173
- F > 0 && (r -= u * (d / F), e -= u * (w / F));
172
+ if (r + t > s) {
173
+ const u = r + t - s, d = Math.max(0, r - v), w = Math.max(0, t - b), T = d + w;
174
+ T > 0 && (r -= u * (d / T), t -= u * (w / T));
174
175
  }
175
- return r = Math.max(v, r), e = Math.max(b, e), {
176
+ return r = Math.max(v, r), t = Math.max(b, t), {
176
177
  width: n,
177
178
  showModified: i,
178
179
  showSize: l,
@@ -180,40 +181,40 @@ function ut(t) {
180
181
  minModified: v,
181
182
  minSize: b,
182
183
  modifiedWidth: r,
183
- sizeWidth: e
184
+ sizeWidth: t
184
185
  };
185
- }), B = () => S().modifiedWidth, q = () => S().sizeWidth, G = (n) => {
186
+ }), N = () => S().modifiedWidth, q = () => S().sizeWidth, G = (n) => {
186
187
  const i = S();
187
188
  if (!i.showModified || i.width <= 0) return;
188
189
  if (!i.showSize) {
189
190
  const u = o.listColumnRatios().size, d = Math.max(0, 1 - u);
190
191
  if (d <= 0) return;
191
- const w = i.width, F = i.modifiedWidth, ne = Math.max(0, w - F), ge = i.minName - ne, he = F - i.minModified, Z = A(n, ge, he);
192
+ const w = i.width, T = i.modifiedWidth, ne = Math.max(0, w - T), he = i.minName - ne, xe = T - i.minModified, Z = L(n, he, xe);
192
193
  if (Z === 0) return;
193
- const xe = ne + Z, ve = F - Z, we = xe / w * d, Se = ve / w * d;
194
+ const ve = ne + Z, we = T - Z, Se = ve / w * d, Ce = we / w * d;
194
195
  o.setListColumnRatios({
195
- name: we,
196
- modifiedAt: Se,
196
+ name: Se,
197
+ modifiedAt: Ce,
197
198
  size: u
198
199
  });
199
200
  return;
200
201
  }
201
- const l = i.width, c = i.modifiedWidth, h = i.sizeWidth, v = Math.max(0, l - c - h), b = i.minName - v, M = c - i.minModified, a = A(n, b, M);
202
+ const l = i.width, c = i.modifiedWidth, h = i.sizeWidth, v = Math.max(0, l - c - h), b = i.minName - v, D = c - i.minModified, a = L(n, b, D);
202
203
  if (a === 0) return;
203
- const r = v + a, e = c - a;
204
+ const r = v + a, t = c - a;
204
205
  o.setListColumnRatios({
205
206
  name: r / l,
206
- modifiedAt: e / l,
207
+ modifiedAt: t / l,
207
208
  size: h / l
208
209
  });
209
210
  }, V = (n) => {
210
211
  const i = S();
211
212
  if (!i.showSize || i.width <= 0) return;
212
- const l = i.width, c = i.modifiedWidth, h = i.sizeWidth, v = i.minModified - c, b = h - i.minSize, M = A(n, v, b);
213
- if (M === 0) return;
214
- const a = c + M, r = h - M, e = Math.max(0, l - a - r);
213
+ const l = i.width, c = i.modifiedWidth, h = i.sizeWidth, v = i.minModified - c, b = h - i.minSize, D = L(n, v, b);
214
+ if (D === 0) return;
215
+ const a = c + D, r = h - D, t = Math.max(0, l - a - r);
215
216
  o.setListColumnRatios({
216
- name: e / l,
217
+ name: t / l,
217
218
  modifiedAt: a / l,
218
219
  size: r / l
219
220
  });
@@ -221,8 +222,8 @@ function ut(t) {
221
222
  return (() => {
222
223
  var n = qe(), i = n.firstChild, l = i.firstChild, c = l.firstChild, h = c.firstChild, v = h.firstChild, b = v.nextSibling;
223
224
  b.firstChild;
224
- var M = i.nextSibling;
225
- return ee(Y, i), c.$$click = () => k("name"), f(b, m(W, {
225
+ var D = i.nextSibling;
226
+ return ee(Y, i), c.$$click = () => A("name"), f(b, m(B, {
226
227
  field: "name"
227
228
  }), null), f(l, m(P, {
228
229
  get when() {
@@ -240,7 +241,7 @@ function ut(t) {
240
241
  },
241
242
  get children() {
242
243
  var a = He(), r = a.firstChild;
243
- return r.firstChild, r.$$click = () => k("modifiedAt"), f(r, m(W, {
244
+ return r.firstChild, r.$$click = () => A("modifiedAt"), f(r, m(B, {
244
245
  field: "modifiedAt"
245
246
  }), null), f(a, m(P, {
246
247
  get when() {
@@ -252,9 +253,9 @@ function ut(t) {
252
253
  onResize: V
253
254
  });
254
255
  }
255
- }), null), p((e) => {
256
- var s = E("relative shrink-0", S().showSize && "border-r border-border"), u = `${B()}px`;
257
- return s !== e.e && N(a, e.e = s), u !== e.t && L(a, "width", e.t = u), e;
256
+ }), null), k((t) => {
257
+ var s = E("relative shrink-0", S().showSize && "border-r border-border"), u = `${N()}px`;
258
+ return s !== t.e && W(a, t.e = s), u !== t.t && p(a, "width", t.t = u), t;
258
259
  }, {
259
260
  e: void 0,
260
261
  t: void 0
@@ -265,33 +266,33 @@ function ut(t) {
265
266
  return S().showSize;
266
267
  },
267
268
  get children() {
268
- var a = Be(), r = a.firstChild;
269
- return r.firstChild, r.$$click = () => k("size"), f(r, m(W, {
269
+ var a = Ne(), r = a.firstChild;
270
+ return r.firstChild, r.$$click = () => A("size"), f(r, m(B, {
270
271
  field: "size"
271
- }), null), p((e) => L(a, "width", `${q()}px`)), a;
272
+ }), null), k((t) => p(a, "width", `${q()}px`)), a;
272
273
  }
273
- }), null), ie(M, "pointerdown", y.onPointerDown, !0), ie(M, "scroll", g.onScroll), ee((a) => {
274
- _ = a, g.scrollRef(a), o.setScrollContainer(a);
275
- }, M), f(M, m(P, {
274
+ }), null), ie(D, "pointerdown", y.onPointerDown, !0), ie(D, "scroll", g.onScroll), ee((a) => {
275
+ z = a, g.scrollRef(a), o.setScrollContainer(a);
276
+ }, D), f(D, m(P, {
276
277
  get when() {
277
278
  return o.currentFiles().length > 0;
278
279
  },
279
280
  get fallback() {
280
281
  return (() => {
281
- var a = Xe();
282
+ var a = Ye();
282
283
  return f(a, m(P, {
283
284
  get when() {
284
285
  return o.filterQueryApplied().trim();
285
286
  },
286
287
  get fallback() {
287
- return Ye();
288
+ return Ge();
288
289
  },
289
290
  get children() {
290
291
  return [(() => {
291
- var r = Ne(), e = r.firstChild, s = e.nextSibling;
292
+ var r = Oe(), t = r.firstChild, s = t.nextSibling;
292
293
  return s.nextSibling, f(r, () => o.filterQueryApplied(), s), r;
293
294
  })(), (() => {
294
- var r = Oe();
295
+ var r = Xe();
295
296
  return r.$$click = () => o.setFilterQuery(""), r;
296
297
  })()];
297
298
  }
@@ -304,7 +305,7 @@ function ut(t) {
304
305
  get each() {
305
306
  return $();
306
307
  },
307
- children: (r) => m(Ue, {
308
+ children: (r) => m(Qe, {
308
309
  item: r,
309
310
  formatSize: j,
310
311
  formatDate: O,
@@ -315,78 +316,78 @@ function ut(t) {
315
316
  return S().showSize;
316
317
  },
317
318
  get modifiedWidthPx() {
318
- return B();
319
+ return N();
319
320
  },
320
321
  get sizeWidthPx() {
321
322
  return q();
322
323
  },
323
324
  get instanceId() {
324
- return I();
325
+ return M();
325
326
  },
326
327
  get enableDragDrop() {
327
328
  return R();
328
329
  },
329
- dragContext: D,
330
+ dragContext: I,
330
331
  registerRow: U
331
332
  })
332
- })), p((r) => {
333
- var e = `${g.paddingTop()}px`, s = `${g.paddingBottom()}px`;
334
- return e !== r.e && L(a, "padding-top", r.e = e), s !== r.t && L(a, "padding-bottom", r.t = s), r;
333
+ })), k((r) => {
334
+ var t = `${g.paddingTop()}px`, s = `${g.paddingBottom()}px`;
335
+ return t !== r.e && p(a, "padding-top", r.e = t), s !== r.t && p(a, "padding-bottom", r.t = s), r;
335
336
  }, {
336
337
  e: void 0,
337
338
  t: void 0
338
339
  }), a;
339
340
  }
340
- }), null), f(M, m(P, {
341
+ }), null), f(D, m(P, {
341
342
  get when() {
342
343
  return y.overlayStyle();
343
344
  },
344
345
  children: (a) => (() => {
345
346
  var r = le();
346
- return N(r, Ae), p((e) => Ce(r, a(), e)), r;
347
+ return W(r, pe), k((t) => be(r, a(), t)), r;
347
348
  })()
348
- }), null), p((a) => {
349
- var r = E("flex flex-col h-full min-h-0", t.class), e = E("relative flex-1 min-w-0", S().showModified && "border-r border-border");
350
- return r !== a.e && N(n, a.e = r), e !== a.t && N(l, a.t = e), a;
349
+ }), null), k((a) => {
350
+ var r = E("flex flex-col h-full min-h-0", e.class), t = E("relative flex-1 min-w-0", S().showModified && "border-r border-border");
351
+ return r !== a.e && W(n, a.e = r), t !== a.t && W(l, a.t = t), a;
351
352
  }, {
352
353
  e: void 0,
353
354
  t: void 0
354
355
  }), n;
355
356
  })();
356
357
  }
357
- function Ue(t) {
358
- const o = fe(), D = () => o.isSelected(t.item.id), R = () => o.getFilterMatchForId(t.item.id), I = $e(() => t.item), C = Te(o, I, {
358
+ function Qe(e) {
359
+ const o = fe(), I = () => o.isSelected(e.item.id), R = () => o.getFilterMatchForId(e.item.id), M = ze(() => e.item), C = Ae(o, M, {
359
360
  source: "list"
360
361
  });
361
- let g, $ = null, T = 0, _ = 0, x = !1;
362
+ let g, $ = null, F = 0, z = 0, x = !1;
362
363
  const U = 5, Q = 500;
363
- let k = null;
364
- const [j, O] = ue(!1), y = () => g === "touch" || g === "pen", W = () => t.item.type === "folder", H = () => W() && t.enableDragDrop && t.dragContext, X = () => {
365
- if (!H() || !t.dragContext) return !1;
366
- const e = t.dragContext.dragState();
367
- return e.isDragging ? t.dragContext.canDropOn(e.draggedItems, t.item.path, t.item, t.instanceId) : !1;
364
+ let A = null;
365
+ const [j, O] = ue(!1), y = () => g === "touch" || g === "pen", B = () => e.item.type === "folder", H = () => B() && e.enableDragDrop && e.dragContext, X = () => {
366
+ if (!H() || !e.dragContext) return !1;
367
+ const t = e.dragContext.dragState();
368
+ return t.isDragging ? e.dragContext.canDropOn(t.draggedItems, e.item.path, e.item, e.instanceId) : !1;
368
369
  }, K = () => {
369
- if (!t.dragContext) return !1;
370
- const e = t.dragContext.dragState();
371
- return e.isDragging ? e.draggedItems.some((s) => s.item.id === t.item.id) : !1;
370
+ if (!e.dragContext) return !1;
371
+ const t = e.dragContext.dragState();
372
+ return t.isDragging ? t.draggedItems.some((s) => s.item.id === e.item.id) : !1;
372
373
  }, Y = () => {
373
- k !== null && (clearTimeout(k), k = null);
374
+ A !== null && (clearTimeout(A), A = null);
374
375
  }, J = () => {
375
376
  typeof document > "u" || (document.removeEventListener("pointermove", q, !0), document.removeEventListener("pointerup", G, !0), document.removeEventListener("pointercancel", V, !0));
376
- }, A = () => {
377
+ }, L = () => {
377
378
  typeof document > "u" || (document.addEventListener("pointermove", q, !0), document.addEventListener("pointerup", G, !0), document.addEventListener("pointercancel", V, !0));
378
- }, S = (e) => {
379
- Y(), J(), x && t.dragContext && t.dragContext.endDrag(e), $ = null, x = !1;
379
+ }, S = (t) => {
380
+ Y(), J(), x && e.dragContext && e.dragContext.endDrag(t), $ = null, x = !1;
380
381
  };
381
382
  de(() => {
382
- t.registerRow(t.item.id, null), S(!1);
383
+ e.registerRow(e.item.id, null), S(!1);
383
384
  });
384
- const B = (e, s) => {
385
- if (!t.enableDragDrop || !t.dragContext || x) return;
386
- x = !0, D() || o.selectItem(t.item.id, !1);
387
- const u = o.getSelectedItemsList(), w = (u.length > 0 && D() ? u : [t.item]).map((F) => ({
388
- item: F,
389
- sourceInstanceId: t.instanceId,
385
+ const N = (t, s) => {
386
+ if (!e.enableDragDrop || !e.dragContext || x) return;
387
+ x = !0, I() || o.selectItem(e.item.id, !1);
388
+ const u = o.getSelectedItemsList(), w = (u.length > 0 && I() ? u : [e.item]).map((T) => ({
389
+ item: T,
390
+ sourceInstanceId: e.instanceId,
390
391
  sourcePath: o.currentPath()
391
392
  }));
392
393
  if (y() && "vibrate" in navigator)
@@ -394,83 +395,83 @@ function Ue(t) {
394
395
  navigator.vibrate(50);
395
396
  } catch {
396
397
  }
397
- t.dragContext.startDrag(w, e, s);
398
- }, q = (e) => {
399
- if ($ !== e.pointerId) return;
400
- const s = e.clientX - T, u = e.clientY - _, d = Math.sqrt(s * s + u * u);
398
+ e.dragContext.startDrag(w, t, s);
399
+ }, q = (t) => {
400
+ if ($ !== t.pointerId) return;
401
+ const s = t.clientX - F, u = t.clientY - z, d = Math.sqrt(s * s + u * u);
401
402
  if (y() && !x && d > 10) {
402
403
  S(!1);
403
404
  return;
404
405
  }
405
- !y() && !x && d > U && B(e.clientX, e.clientY), x && t.dragContext && t.dragContext.updateDrag(e.clientX, e.clientY);
406
- }, G = (e) => {
407
- $ === e.pointerId && (C.onPointerUp(), S(!0));
408
- }, V = (e) => {
409
- $ === e.pointerId && (C.onPointerCancel(), S(!1));
410
- }, n = (e) => {
411
- g = e.pointerType, C.onPointerDown(e), !(e.pointerType === "mouse" && e.button !== 0) && (!t.enableDragDrop || !t.dragContext || ($ = e.pointerId, T = e.clientX, _ = e.clientY, x = !1, A(), y() && (Y(), k = setTimeout(() => {
412
- $ !== null && !x && B(T, _);
406
+ !y() && !x && d > U && N(t.clientX, t.clientY), x && e.dragContext && e.dragContext.updateDrag(t.clientX, t.clientY);
407
+ }, G = (t) => {
408
+ $ === t.pointerId && (C.onPointerUp(), S(!0));
409
+ }, V = (t) => {
410
+ $ === t.pointerId && (C.onPointerCancel(), S(!1));
411
+ }, n = (t) => {
412
+ g = t.pointerType, C.onPointerDown(t), !(t.pointerType === "mouse" && t.button !== 0) && (!e.enableDragDrop || !e.dragContext || ($ = t.pointerId, F = t.clientX, z = t.clientY, x = !1, L(), y() && (Y(), A = setTimeout(() => {
413
+ $ !== null && !x && N(F, z);
413
414
  }, Q))));
414
- }, i = (e) => {
415
- g = e.pointerType, C.onPointerMove(e);
416
- }, l = (e) => {
417
- if (!H() || !t.dragContext) return;
418
- const s = t.dragContext.dragState();
415
+ }, i = (t) => {
416
+ g = t.pointerType, C.onPointerMove(t);
417
+ }, l = (t) => {
418
+ if (!H() || !e.dragContext) return;
419
+ const s = e.dragContext.dragState();
419
420
  if (!s.isDragging) return;
420
421
  O(!0);
421
- const u = t.dragContext.canDropOn(s.draggedItems, t.item.path, t.item, t.instanceId), w = e.currentTarget?.getBoundingClientRect() ?? null;
422
- t.dragContext.setDropTarget({
423
- instanceId: t.instanceId,
424
- targetPath: t.item.path,
425
- targetItem: t.item
422
+ const u = e.dragContext.canDropOn(s.draggedItems, e.item.path, e.item, e.instanceId), w = t.currentTarget?.getBoundingClientRect() ?? null;
423
+ e.dragContext.setDropTarget({
424
+ instanceId: e.instanceId,
425
+ targetPath: e.item.path,
426
+ targetItem: e.item
426
427
  }, u, w);
427
- }, c = (e) => {
428
- if (!t.dragContext) return;
428
+ }, c = (t) => {
429
+ if (!e.dragContext) return;
429
430
  O(!1);
430
- const s = t.dragContext.dragState();
431
- s.isDragging && s.dropTarget?.targetPath === t.item.path && t.dragContext.setDropTarget(null, !1);
432
- }, h = (e) => {
431
+ const s = e.dragContext.dragState();
432
+ s.isDragging && s.dropTarget?.targetPath === e.item.path && e.dragContext.setDropTarget(null, !1);
433
+ }, h = (t) => {
433
434
  if (x) {
434
435
  x = !1;
435
436
  return;
436
437
  }
437
- if (!C.consumeClickSuppression(e)) {
438
+ if (!C.consumeClickSuppression(t)) {
438
439
  if (y()) {
439
- o.openItem(t.item);
440
+ o.openItem(e.item);
440
441
  return;
441
442
  }
442
- if (e.shiftKey) {
443
- o.selectRangeTo(t.item.id, ae(e));
443
+ if (t.shiftKey) {
444
+ o.selectRangeTo(e.item.id, ae(t));
444
445
  return;
445
446
  }
446
- o.selectItem(t.item.id, ae(e));
447
+ o.selectItem(e.item.id, ae(t));
447
448
  }
448
449
  }, v = () => {
449
- y() || o.openItem(t.item);
450
- }, b = (e) => {
451
- if (e.preventDefault(), e.stopPropagation(), y()) return;
452
- o.ensureContextMenuSelection(t.item.id);
453
- const s = o.getSelectedItemsList(), u = s.length > 0 ? s : [t.item];
454
- o.showContextMenu(ke({
455
- x: e.clientX,
456
- y: e.clientY,
457
- triggerItem: t.item,
450
+ y() || o.openItem(e.item);
451
+ }, b = (t) => {
452
+ if (t.preventDefault(), t.stopPropagation(), y()) return;
453
+ o.ensureContextMenuSelection(e.item.id);
454
+ const s = o.getSelectedItemsList(), u = s.length > 0 ? s : [e.item];
455
+ o.showContextMenu(Le({
456
+ x: t.clientX,
457
+ y: t.clientY,
458
+ triggerItem: e.item,
458
459
  items: u,
459
460
  source: "list"
460
461
  }));
461
- }, M = () => t.dragContext?.dragState(), a = () => M()?.isDragging ?? !1, r = () => j() && a() && H();
462
+ }, D = () => e.dragContext?.dragState(), a = () => D()?.isDragging ?? !1, r = () => j() && a() && H();
462
463
  return (() => {
463
- var e = Ge(), s = e.firstChild, u = s.firstChild;
464
+ var t = Ve(), s = t.firstChild, u = s.firstChild;
464
465
  return ee((d) => {
465
- t.registerRow(t.item.id, d);
466
- }, e), be(e, Me({
466
+ e.registerRow(e.item.id, d);
467
+ }, t), De(t, Ie({
467
468
  get "data-file-browser-item-id"() {
468
- return t.item.id;
469
+ return e.item.id;
469
470
  },
470
471
  get "data-file-browser-item-path"() {
471
- return t.item.path;
472
+ return e.item.path;
472
473
  }
473
- }, Fe, {
474
+ }, Ee, {
474
475
  onClick: h,
475
476
  onDblClick: v,
476
477
  onContextMenu: b,
@@ -484,7 +485,7 @@ function Ue(t) {
484
485
  "transition-all duration-150 ease-out",
485
486
  "hover:bg-accent/50",
486
487
  "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring",
487
- D() && "bg-accent text-accent-foreground",
488
+ I() && "bg-accent text-accent-foreground",
488
489
  // Drag state styling - being dragged items become translucent
489
490
  K() && "opacity-40 scale-[0.98]",
490
491
  // Drop target styling - enhanced visual feedback
@@ -492,41 +493,49 @@ function Ue(t) {
492
493
  r() && !X() && ["bg-destructive/10 outline outline-2 outline-dashed outline-destructive/50"]
493
494
  );
494
495
  }
495
- }), !1, !0), f(u, m(Pe, {
496
+ }), !1, !0), f(u, m(Re, {
496
497
  get item() {
497
- return t.item;
498
+ return e.item;
498
499
  },
499
500
  class: "w-4 h-4"
500
- })), f(s, m(Ve, {
501
+ }), null), f(u, m(Fe, {
502
+ get item() {
503
+ return e.item;
504
+ },
505
+ size: "xs"
506
+ }), null), f(s, m(Ue, {
501
507
  get name() {
502
- return t.item.name;
508
+ return e.item.name;
503
509
  },
504
510
  get match() {
505
511
  return R();
512
+ },
513
+ get class() {
514
+ return Te(e.item);
506
515
  }
507
- }), null), f(e, m(P, {
516
+ }), null), f(t, m(P, {
508
517
  get when() {
509
- return t.showModified;
518
+ return e.showModified;
510
519
  },
511
520
  get children() {
512
521
  var d = se();
513
- return f(d, () => t.formatDate(t.item.modifiedAt)), p((w) => L(d, "width", `${t.modifiedWidthPx}px`)), d;
522
+ return f(d, () => e.formatDate(e.item.modifiedAt)), k((w) => p(d, "width", `${e.modifiedWidthPx}px`)), d;
514
523
  }
515
- }), null), f(e, m(P, {
524
+ }), null), f(t, m(P, {
516
525
  get when() {
517
- return t.showSize;
526
+ return e.showSize;
518
527
  },
519
528
  get children() {
520
529
  var d = se();
521
530
  return f(d, (() => {
522
- var w = ce(() => t.item.type === "folder");
523
- return () => w() ? "-" : t.formatSize(t.item.size);
524
- })()), p((w) => L(d, "width", `${t.sizeWidthPx}px`)), d;
531
+ var w = ce(() => e.item.type === "folder");
532
+ return () => w() ? "-" : e.formatSize(e.item.size);
533
+ })()), k((w) => p(d, "width", `${e.sizeWidthPx}px`)), d;
525
534
  }
526
- }), null), e;
535
+ }), null), t;
527
536
  })();
528
537
  }
529
- De(["click", "pointerdown"]);
538
+ Me(["click", "pointerdown"]);
530
539
  export {
531
- ut as FileListView
540
+ ft as FileListView
532
541
  };