@floegence/floe-webapp-core 0.35.47 → 0.35.49

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