@floegence/floe-webapp-core 0.72.0 → 0.74.0

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