@floegence/floe-webapp-core 0.8.2 → 0.8.4

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.
package/dist/index42.js CHANGED
@@ -1,5 +1,5 @@
1
- import { delegateEvents as U, template as x, insert as s, createComponent as o, effect as $, className as g, setAttribute as j, memo as k, setStyleProperty as B } from "solid-js/web";
2
- import { createMemo as w, For as H, untrack as R, Show as b } from "solid-js";
1
+ import { delegateEvents as U, template as x, insert as s, createComponent as o, effect as y, className as g, setAttribute as j, memo as k, setStyleProperty as B } from "solid-js/web";
2
+ import { createMemo as w, For as H, untrack as R, Show as $ } from "solid-js";
3
3
  import { cn as v } from "./index69.js";
4
4
  import { useFileBrowser as T } from "./index41.js";
5
5
  import { FolderOpenIcon as X, FolderIcon as Y } from "./index48.js";
@@ -10,12 +10,12 @@ function ie(n) {
10
10
  const i = T(), r = w(() => i.files().filter((c) => c.type === "folder"));
11
11
  return (() => {
12
12
  var c = _();
13
- return c.$$contextmenu = (y) => y.preventDefault(), s(c, o(F, {
13
+ return c.$$contextmenu = (b) => b.preventDefault(), s(c, o(F, {
14
14
  get items() {
15
15
  return r();
16
16
  },
17
17
  depth: 0
18
- })), $(() => g(c, v("flex flex-col", n.class))), c;
18
+ })), y(() => g(c, v("flex flex-col", n.class))), c;
19
19
  })();
20
20
  }
21
21
  function F(n) {
@@ -33,7 +33,7 @@ function F(n) {
33
33
  });
34
34
  }
35
35
  function V(n) {
36
- const i = T(), r = () => i.isExpanded(n.item.path), c = () => i.currentPath() === n.item.path, y = R(() => n.item), f = z(i, y, {
36
+ const i = T(), r = () => i.isExpanded(n.item.path), c = () => i.currentPath() === n.item.path, b = R(() => n.item), f = z(i, b, {
37
37
  selectOnOpen: !1
38
38
  });
39
39
  let u;
@@ -49,7 +49,7 @@ function V(n) {
49
49
  }, I = (e) => {
50
50
  u = e.pointerType, f.onPointerCancel();
51
51
  }, L = (e) => {
52
- f.consumeClickSuppression(e) || i.setCurrentPath(n.item.path);
52
+ f.consumeClickSuppression(e) || i.navigateTo(b);
53
53
  }, N = (e) => {
54
54
  e.preventDefault(), e.stopPropagation(), !M() && i.showContextMenu({
55
55
  x: e.clientX,
@@ -61,7 +61,7 @@ function V(n) {
61
61
  };
62
62
  return (() => {
63
63
  var e = K(), d = e.firstChild, l = d.firstChild, C = l.firstChild, A = C.nextSibling;
64
- return s(d, o(b, {
64
+ return s(d, o($, {
65
65
  get when() {
66
66
  return m();
67
67
  },
@@ -72,15 +72,15 @@ function V(n) {
72
72
  var t = G();
73
73
  return t.$$click = O, s(t, o(q, {
74
74
  class: "w-3 h-3 opacity-50"
75
- })), $((a) => {
76
- var h = v("flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center cursor-pointer", "transition-transform duration-150", r() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring"), p = r() ? "Collapse folder" : "Expand folder";
77
- return h !== a.e && g(t, a.e = h), p !== a.t && j(t, "aria-label", a.t = p), a;
75
+ })), y((a) => {
76
+ var p = v("flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center cursor-pointer", "transition-transform duration-150", r() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring"), h = r() ? "Collapse folder" : "Expand folder";
77
+ return p !== a.e && g(t, a.e = p), h !== a.t && j(t, "aria-label", a.t = h), a;
78
78
  }, {
79
79
  e: void 0,
80
80
  t: void 0
81
81
  }), t;
82
82
  }
83
- }), l), l.addEventListener("pointercancel", I), l.$$pointerup = S, l.$$pointermove = E, l.$$pointerdown = D, l.$$contextmenu = N, l.$$click = L, s(C, o(b, {
83
+ }), l), l.addEventListener("pointercancel", I), l.$$pointerup = S, l.$$pointermove = E, l.$$pointerdown = D, l.$$contextmenu = N, l.$$click = L, s(C, o($, {
84
84
  get when() {
85
85
  return k(() => !!m())() && r();
86
86
  },
@@ -94,7 +94,7 @@ function V(n) {
94
94
  class: "w-4 h-4"
95
95
  });
96
96
  }
97
- })), s(A, () => n.item.name), s(l, o(b, {
97
+ })), s(A, () => n.item.name), s(l, o($, {
98
98
  get when() {
99
99
  return m();
100
100
  },
@@ -102,7 +102,7 @@ function V(n) {
102
102
  var t = J();
103
103
  return s(t, P), t;
104
104
  }
105
- }), null), s(e, o(b, {
105
+ }), null), s(e, o($, {
106
106
  get when() {
107
107
  return k(() => !!r())() && m();
108
108
  },
@@ -115,11 +115,11 @@ function V(n) {
115
115
  get depth() {
116
116
  return n.depth + 1;
117
117
  }
118
- })), $(() => g(t, v("overflow-hidden transition-all duration-200", r() ? "opacity-100" : "opacity-0"))), t;
118
+ })), y(() => g(t, v("overflow-hidden transition-all duration-200", r() ? "opacity-100" : "opacity-0"))), t;
119
119
  }
120
- }), null), $((t) => {
121
- var a = v("group flex items-center w-full py-1 text-xs", "transition-all duration-100", "hover:bg-sidebar-accent/60", c() && "bg-sidebar-accent text-sidebar-accent-foreground font-medium"), h = `${8 + n.depth * 12}px`, p = v("flex items-center gap-1 flex-1 min-w-0 text-left cursor-pointer pl-1", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring");
122
- return a !== t.e && g(d, t.e = a), h !== t.t && B(d, "padding-left", t.t = h), p !== t.a && g(l, t.a = p), t;
120
+ }), null), y((t) => {
121
+ var a = v("group flex items-center w-full py-1 text-xs", "transition-all duration-100", "hover:bg-sidebar-accent/60", c() && "bg-sidebar-accent text-sidebar-accent-foreground font-medium"), p = `${8 + n.depth * 12}px`, h = v("flex items-center gap-1 flex-1 min-w-0 text-left cursor-pointer pl-1", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-sidebar-ring");
122
+ return a !== t.e && g(d, t.e = a), p !== t.t && B(d, "padding-left", t.t = p), h !== t.a && g(l, t.a = h), t;
123
123
  }, {
124
124
  e: void 0,
125
125
  t: void 0,
package/dist/index43.js CHANGED
@@ -1,199 +1,341 @@
1
- import { delegateEvents as L, template as h, insert as s, createComponent as a, effect as S, className as F, Dynamic as A, memo as D, setStyleProperty as B } from "solid-js/web";
2
- import { Show as I, For as T, untrack as H, createMemo as N } from "solid-js";
3
- import { cn as y } from "./index69.js";
4
- import { useFileBrowser as z } from "./index41.js";
5
- import { FolderIcon as K, getFileIcon as Q } from "./index48.js";
6
- import { ChevronDown as U } from "./index34.js";
7
- import { createLongPressContextMenuHandlers as j } from "./index84.js";
8
- var E = /* @__PURE__ */ h("<span class=truncate>"), V = /* @__PURE__ */ h('<mark class="bg-warning/40 text-inherit rounded-sm">'), X = /* @__PURE__ */ h("<span>"), Y = /* @__PURE__ */ h('<div><div class="flex items-center border-b border-border text-[11px] text-muted-foreground font-medium"><button type=button class="group flex items-center flex-1 min-w-0 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Name</button><button type=button class="group hidden sm:flex items-center w-32 px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Modified</button><button type=button class="group hidden md:flex items-center w-24 px-3 py-2 text-right justify-end cursor-pointer hover:bg-muted/50 transition-colors">Size</button></div><div class="flex-1 min-h-0 overflow-auto">'), q = /* @__PURE__ */ h('<span>No files matching "<!>"'), G = /* @__PURE__ */ h('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), J = /* @__PURE__ */ h('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), O = /* @__PURE__ */ h("<span>This folder is empty"), R = /* @__PURE__ */ h('<button type=button style=animation-fill-mode:backwards><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"></span></div><div class="hidden sm:block w-32 px-3 py-1.5 text-muted-foreground truncate"></div><div class="hidden md:block w-24 px-3 py-1.5 text-right text-muted-foreground">');
9
- function W(n) {
10
- const i = N(() => {
11
- if (!n.match || n.match.matchedIndices.length === 0)
1
+ import { delegateEvents as te, template as g, use as ie, insert as a, createComponent as c, effect as k, setStyleProperty as F, className as E, Dynamic as ne, memo as j } from "solid-js/web";
2
+ import { createSignal as re, createMemo as O, Show as b, For as V, untrack as oe } from "solid-js";
3
+ import { cn as N } from "./index69.js";
4
+ import { useMediaQuery as Q } from "./index63.js";
5
+ import { useResizeObserver as se } from "./index65.js";
6
+ import { useFileBrowser as X } from "./index41.js";
7
+ import { FolderIcon as le, getFileIcon as de } from "./index48.js";
8
+ import { ChevronDown as ce } from "./index34.js";
9
+ import { createLongPressContextMenuHandlers as ae } from "./index84.js";
10
+ import { ResizeHandle as K } from "./index8.js";
11
+ var me = /* @__PURE__ */ g("<span class=truncate>"), he = /* @__PURE__ */ g('<mark class="bg-warning/40 text-inherit rounded-sm">'), ue = /* @__PURE__ */ g("<span>"), fe = /* @__PURE__ */ g('<div class="relative shrink-0"><button type=button class="group w-full flex items-center px-3 py-2 cursor-pointer hover:bg-muted/50 transition-colors">Modified'), xe = /* @__PURE__ */ g('<div class=shrink-0><button type=button class="group w-full flex items-center px-3 py-2 text-right justify-end cursor-pointer hover:bg-muted/50 transition-colors">Size'), ge = /* @__PURE__ */ g('<div><div class="flex items-center border-b border-border text-[11px] text-muted-foreground font-medium"><div class="relative flex-1 min-w-0"><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">Name</button></div></div><div class="flex-1 min-h-0 overflow-auto">'), $e = /* @__PURE__ */ g('<span>No files matching "<!>"'), we = /* @__PURE__ */ g('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), ve = /* @__PURE__ */ g('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), pe = /* @__PURE__ */ g("<span>This folder is empty"), ze = /* @__PURE__ */ g('<div class="shrink-0 px-3 py-1.5 text-muted-foreground truncate">'), Me = /* @__PURE__ */ g('<div class="shrink-0 px-3 py-1.5 text-right text-muted-foreground">'), _e = /* @__PURE__ */ g('<button type=button style=animation-fill-mode:backwards><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">');
12
+ function ye(r) {
13
+ const d = O(() => {
14
+ if (!r.match || r.match.matchedIndices.length === 0)
12
15
  return [{
13
- text: n.name,
16
+ text: r.name,
14
17
  highlight: !1
15
18
  }];
16
- const l = [], d = new Set(n.match.matchedIndices);
17
- let c = "", o = !1;
18
- for (let e = 0; e < n.name.length; e++) {
19
- const r = d.has(e);
20
- e === 0 ? (o = r, c = n.name[e]) : r === o ? c += n.name[e] : (l.push({
21
- text: c,
22
- highlight: o
23
- }), c = n.name[e], o = r);
19
+ const f = [], _ = new Set(r.match.matchedIndices);
20
+ let x = "", u = !1;
21
+ for (let m = 0; m < r.name.length; m++) {
22
+ const y = _.has(m);
23
+ m === 0 ? (u = y, x = r.name[m]) : y === u ? x += r.name[m] : (f.push({
24
+ text: x,
25
+ highlight: u
26
+ }), x = r.name[m], u = y);
24
27
  }
25
- return c && l.push({
26
- text: c,
27
- highlight: o
28
- }), l;
28
+ return x && f.push({
29
+ text: x,
30
+ highlight: u
31
+ }), f;
29
32
  });
30
33
  return (() => {
31
- var l = E();
32
- return s(l, a(T, {
34
+ var f = me();
35
+ return a(f, c(V, {
33
36
  get each() {
34
- return i();
37
+ return d();
35
38
  },
36
- children: (d) => a(I, {
39
+ children: (_) => c(b, {
37
40
  get when() {
38
- return d.highlight;
41
+ return _.highlight;
39
42
  },
40
43
  get fallback() {
41
- return D(() => d.text);
44
+ return j(() => _.text);
42
45
  },
43
46
  get children() {
44
- var c = V();
45
- return s(c, () => d.text), c;
47
+ var x = he();
48
+ return a(x, () => _.text), x;
46
49
  }
47
50
  })
48
- })), l;
51
+ })), f;
49
52
  })();
50
53
  }
51
- function ce(n) {
52
- const i = z(), l = (e) => {
53
- const r = i.sortConfig();
54
- i.setSortConfig({
55
- field: e,
56
- direction: r.field === e && r.direction === "asc" ? "desc" : "asc"
54
+ function Ae(r) {
55
+ const d = X(), f = (t) => {
56
+ const e = d.sortConfig();
57
+ d.setSortConfig({
58
+ field: t,
59
+ direction: e.field === t && e.direction === "asc" ? "desc" : "asc"
57
60
  });
58
- }, d = (e) => e === void 0 ? "-" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`, c = (e) => e ? e.toLocaleDateString("en-US", {
61
+ }, _ = (t) => t === void 0 ? "-" : t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`, x = (t) => t ? t.toLocaleDateString("en-US", {
59
62
  month: "short",
60
63
  day: "numeric",
61
64
  year: "numeric"
62
- }) : "-", o = (e) => {
63
- const r = () => i.sortConfig(), f = () => r().field === e.field;
65
+ }) : "-", u = (t) => {
66
+ const e = () => d.sortConfig(), i = () => e().field === t.field;
64
67
  return (() => {
65
- var u = X();
66
- return s(u, a(U, {
68
+ var o = ue();
69
+ return a(o, c(ce, {
67
70
  get class() {
68
- return y("w-3 h-3 transition-transform duration-150", f() && r().direction === "asc" && "rotate-180");
71
+ return N("w-3 h-3 transition-transform duration-150", i() && e().direction === "asc" && "rotate-180");
69
72
  }
70
- })), S(() => F(u, y("ml-1 transition-all duration-150", f() ? "opacity-100" : "opacity-0 group-hover:opacity-40"))), u;
73
+ })), k(() => E(o, N("ml-1 transition-all duration-150", i() ? "opacity-100" : "opacity-0 group-hover:opacity-40"))), o;
71
74
  })();
75
+ }, m = Q("(min-width: 640px)"), y = Q("(min-width: 768px)"), [A, L] = re(null), T = se(A), W = (t, e, i) => Math.max(e, Math.min(i, t)), $ = O(() => {
76
+ var D;
77
+ const t = ((D = T()) == null ? void 0 : D.width) ?? 0, e = m(), i = y(), o = d.listColumnRatios(), h = 160, s = 120, l = 80, v = 128, p = 96;
78
+ if (!e || t <= 0)
79
+ return {
80
+ width: t,
81
+ showModified: e,
82
+ showSize: i,
83
+ minName: h,
84
+ minModified: s,
85
+ minSize: l,
86
+ modifiedWidth: v,
87
+ sizeWidth: p
88
+ };
89
+ if (!i) {
90
+ const C = o.size, S = Math.max(0, 1 - C);
91
+ let M = (S > 0 ? o.modifiedAt / S : o.modifiedAt) * t;
92
+ return M = W(M, s, Math.max(s, t - h)), {
93
+ width: t,
94
+ showModified: e,
95
+ showSize: i,
96
+ minName: h,
97
+ minModified: s,
98
+ minSize: l,
99
+ modifiedWidth: M,
100
+ sizeWidth: 0
101
+ };
102
+ }
103
+ let w = Math.max(s, o.modifiedAt * t), z = Math.max(l, o.size * t);
104
+ const U = Math.max(0, t - h);
105
+ if (w + z > U) {
106
+ const C = w + z - U, S = Math.max(0, w - s), M = Math.max(0, z - l), P = S + M;
107
+ P > 0 && (w -= C * (S / P), z -= C * (M / P));
108
+ }
109
+ return w = Math.max(s, w), z = Math.max(l, z), {
110
+ width: t,
111
+ showModified: e,
112
+ showSize: i,
113
+ minName: h,
114
+ minModified: s,
115
+ minSize: l,
116
+ modifiedWidth: w,
117
+ sizeWidth: z
118
+ };
119
+ }), R = () => $().modifiedWidth, I = () => $().sizeWidth, H = (t) => {
120
+ const e = $();
121
+ if (!e.showModified || e.width <= 0) return;
122
+ if (!e.showSize) {
123
+ const D = d.listColumnRatios().size, C = Math.max(0, 1 - D);
124
+ if (C <= 0) return;
125
+ const S = e.width, M = e.modifiedWidth, P = Math.max(0, S - M), Y = e.minName - P, q = M - e.minModified, B = W(t, Y, q);
126
+ if (B === 0) return;
127
+ const G = P + B, J = M - B, Z = G / S * C, ee = J / S * C;
128
+ d.setListColumnRatios({
129
+ name: Z,
130
+ modifiedAt: ee,
131
+ size: D
132
+ });
133
+ return;
134
+ }
135
+ const i = e.width, o = e.modifiedWidth, h = e.sizeWidth, s = Math.max(0, i - o - h), l = e.minName - s, v = o - e.minModified, p = W(t, l, v);
136
+ if (p === 0) return;
137
+ const w = s + p, z = o - p;
138
+ d.setListColumnRatios({
139
+ name: w / i,
140
+ modifiedAt: z / i,
141
+ size: h / i
142
+ });
143
+ }, n = (t) => {
144
+ const e = $();
145
+ if (!e.showSize || e.width <= 0) return;
146
+ const i = e.width, o = e.modifiedWidth, h = e.sizeWidth, s = e.minModified - o, l = h - e.minSize, v = W(t, s, l);
147
+ if (v === 0) return;
148
+ const p = o + v, w = h - v, z = Math.max(0, i - p - w);
149
+ d.setListColumnRatios({
150
+ name: z / i,
151
+ modifiedAt: p / i,
152
+ size: w / i
153
+ });
72
154
  };
73
155
  return (() => {
74
- var e = Y(), r = e.firstChild, f = r.firstChild;
75
- f.firstChild;
76
- var u = f.nextSibling;
77
- u.firstChild;
78
- var v = u.nextSibling;
79
- v.firstChild;
80
- var _ = r.nextSibling;
81
- return f.$$click = () => l("name"), s(f, a(o, {
156
+ var t = ge(), e = t.firstChild, i = e.firstChild, o = i.firstChild;
157
+ o.firstChild;
158
+ var h = e.nextSibling;
159
+ return ie(L, e), o.$$click = () => f("name"), a(o, c(u, {
82
160
  field: "name"
83
- }), null), u.$$click = () => l("modifiedAt"), s(u, a(o, {
84
- field: "modifiedAt"
85
- }), null), v.$$click = () => l("size"), s(v, a(o, {
86
- field: "size"
87
- }), null), s(_, a(I, {
161
+ }), null), a(i, c(b, {
88
162
  get when() {
89
- return i.currentFiles().length > 0;
163
+ return $().showModified;
164
+ },
165
+ get children() {
166
+ return c(K, {
167
+ direction: "horizontal",
168
+ onResize: H
169
+ });
170
+ }
171
+ }), null), a(e, c(b, {
172
+ get when() {
173
+ return $().showModified;
174
+ },
175
+ get children() {
176
+ var s = fe(), l = s.firstChild;
177
+ return l.firstChild, l.$$click = () => f("modifiedAt"), a(l, c(u, {
178
+ field: "modifiedAt"
179
+ }), null), a(s, c(b, {
180
+ get when() {
181
+ return $().showSize;
182
+ },
183
+ get children() {
184
+ return c(K, {
185
+ direction: "horizontal",
186
+ onResize: n
187
+ });
188
+ }
189
+ }), null), k((v) => F(s, "width", `${R()}px`)), s;
190
+ }
191
+ }), null), a(e, c(b, {
192
+ get when() {
193
+ return $().showSize;
194
+ },
195
+ get children() {
196
+ var s = xe(), l = s.firstChild;
197
+ return l.firstChild, l.$$click = () => f("size"), a(l, c(u, {
198
+ field: "size"
199
+ }), null), k((v) => F(s, "width", `${I()}px`)), s;
200
+ }
201
+ }), null), a(h, c(b, {
202
+ get when() {
203
+ return d.currentFiles().length > 0;
90
204
  },
91
205
  get fallback() {
92
206
  return (() => {
93
- var x = J();
94
- return s(x, a(I, {
207
+ var s = ve();
208
+ return a(s, c(b, {
95
209
  get when() {
96
- return i.filterQuery().trim();
210
+ return d.filterQuery().trim();
97
211
  },
98
212
  get fallback() {
99
- return O();
213
+ return pe();
100
214
  },
101
215
  get children() {
102
216
  return [(() => {
103
- var m = q(), w = m.firstChild, p = w.nextSibling;
104
- return p.nextSibling, s(m, () => i.filterQuery(), p), m;
217
+ var l = $e(), v = l.firstChild, p = v.nextSibling;
218
+ return p.nextSibling, a(l, () => d.filterQuery(), p), l;
105
219
  })(), (() => {
106
- var m = G();
107
- return m.$$click = () => i.setFilterQuery(""), m;
220
+ var l = we();
221
+ return l.$$click = () => d.setFilterQuery(""), l;
108
222
  })()];
109
223
  }
110
- })), x;
224
+ })), s;
111
225
  })();
112
226
  },
113
227
  get children() {
114
- return a(T, {
228
+ return c(V, {
115
229
  get each() {
116
- return i.currentFiles();
230
+ return d.currentFiles();
117
231
  },
118
- children: (x, m) => a(Z, {
119
- item: x,
120
- formatSize: d,
121
- formatDate: c,
232
+ children: (s, l) => c(Se, {
233
+ item: s,
234
+ formatSize: _,
235
+ formatDate: x,
122
236
  get index() {
123
- return m();
237
+ return l();
238
+ },
239
+ get showModified() {
240
+ return $().showModified;
241
+ },
242
+ get showSize() {
243
+ return $().showSize;
244
+ },
245
+ get modifiedWidthPx() {
246
+ return R();
247
+ },
248
+ get sizeWidthPx() {
249
+ return I();
124
250
  }
125
251
  })
126
252
  });
127
253
  }
128
- })), S(() => F(e, y("flex flex-col h-full min-h-0", n.class))), e;
254
+ })), k(() => E(t, N("flex flex-col h-full min-h-0", r.class))), t;
129
255
  })();
130
256
  }
131
- function Z(n) {
132
- const i = z(), l = () => i.isSelected(n.item.id), d = () => i.getFilterMatch(n.item.name), c = H(() => n.item), o = j(i, c);
133
- let e;
134
- const r = () => e === "touch" || e === "pen", f = (t) => {
135
- e = t.pointerType, o.onPointerDown(t);
136
- }, u = (t) => {
137
- e = t.pointerType, o.onPointerMove(t);
138
- }, v = (t) => {
139
- e = t.pointerType, o.onPointerUp();
140
- }, _ = (t) => {
141
- e = t.pointerType, o.onPointerCancel();
142
- }, x = (t) => {
143
- if (!o.consumeClickSuppression(t)) {
144
- if (r()) {
145
- i.openItem(n.item);
257
+ function Se(r) {
258
+ const d = X(), f = () => d.isSelected(r.item.id), _ = () => d.getFilterMatch(r.item.name), x = oe(() => r.item), u = ae(d, x);
259
+ let m;
260
+ const y = () => m === "touch" || m === "pen", A = (n) => {
261
+ m = n.pointerType, u.onPointerDown(n);
262
+ }, L = (n) => {
263
+ m = n.pointerType, u.onPointerMove(n);
264
+ }, T = (n) => {
265
+ m = n.pointerType, u.onPointerUp();
266
+ }, W = (n) => {
267
+ m = n.pointerType, u.onPointerCancel();
268
+ }, $ = (n) => {
269
+ if (!u.consumeClickSuppression(n)) {
270
+ if (y()) {
271
+ d.openItem(r.item);
146
272
  return;
147
273
  }
148
- i.selectItem(n.item.id, t.metaKey || t.ctrlKey);
274
+ d.selectItem(r.item.id, n.metaKey || n.ctrlKey);
149
275
  }
150
- }, m = () => {
151
- r() || i.openItem(n.item);
152
- }, w = (t) => {
153
- if (t.preventDefault(), t.stopPropagation(), r()) return;
154
- l() || i.selectItem(n.item.id, !1);
155
- const $ = i.selectedItems(), C = i.currentFiles(), b = $.size > 0 ? C.filter((k) => $.has(k.id)) : [n.item];
156
- i.showContextMenu({
157
- x: t.clientX,
158
- y: t.clientY,
159
- items: b
276
+ }, R = () => {
277
+ y() || d.openItem(r.item);
278
+ }, I = (n) => {
279
+ if (n.preventDefault(), n.stopPropagation(), y()) return;
280
+ f() || d.selectItem(r.item.id, !1);
281
+ const t = d.selectedItems(), e = d.currentFiles(), i = t.size > 0 ? e.filter((o) => t.has(o.id)) : [r.item];
282
+ d.showContextMenu({
283
+ x: n.clientX,
284
+ y: n.clientY,
285
+ items: i
160
286
  });
161
- }, p = () => n.item.type === "folder" ? K : Q(n.item.extension);
287
+ }, H = () => r.item.type === "folder" ? le : de(r.item.extension);
162
288
  return (() => {
163
- var t = R(), $ = t.firstChild, C = $.firstChild, b = $.nextSibling, k = b.nextSibling;
164
- return t.addEventListener("pointercancel", _), t.$$pointerup = v, t.$$pointermove = u, t.$$pointerdown = f, t.$$contextmenu = w, t.$$dblclick = m, t.$$click = x, s(C, a(A, {
289
+ var n = _e(), t = n.firstChild, e = t.firstChild;
290
+ return n.addEventListener("pointercancel", W), n.$$pointerup = T, n.$$pointermove = L, n.$$pointerdown = A, n.$$contextmenu = I, n.$$dblclick = R, n.$$click = $, a(e, c(ne, {
165
291
  get component() {
166
- return p();
292
+ return H();
167
293
  },
168
294
  class: "w-4 h-4"
169
- })), s($, a(W, {
295
+ })), a(t, c(ye, {
170
296
  get name() {
171
- return n.item.name;
297
+ return r.item.name;
172
298
  },
173
299
  get match() {
174
- return d();
300
+ return _();
301
+ }
302
+ }), null), a(n, c(b, {
303
+ get when() {
304
+ return r.showModified;
305
+ },
306
+ get children() {
307
+ var i = ze();
308
+ return a(i, () => r.formatDate(r.item.modifiedAt)), k((o) => F(i, "width", `${r.modifiedWidthPx}px`)), i;
309
+ }
310
+ }), null), a(n, c(b, {
311
+ get when() {
312
+ return r.showSize;
313
+ },
314
+ get children() {
315
+ var i = Me();
316
+ return a(i, (() => {
317
+ var o = j(() => r.item.type === "folder");
318
+ return () => o() ? "-" : r.formatSize(r.item.size);
319
+ })()), k((o) => F(i, "width", `${r.sizeWidthPx}px`)), i;
175
320
  }
176
- }), null), s(b, () => n.formatDate(n.item.modifiedAt)), s(k, (() => {
177
- var g = D(() => n.item.type === "folder");
178
- return () => g() ? "-" : n.formatSize(n.item.size);
179
- })()), S((g) => {
180
- var P = y(
321
+ }), null), k((i) => {
322
+ var o = N(
181
323
  "group w-full flex items-center text-xs cursor-pointer",
182
324
  "transition-all duration-100",
183
325
  "hover:bg-accent/50",
184
326
  "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring",
185
- l() && "bg-accent text-accent-foreground",
327
+ f() && "bg-accent text-accent-foreground",
186
328
  // Staggered animation on mount
187
329
  "animate-in fade-in slide-in-from-top-2"
188
- ), M = `${Math.min(n.index * 20, 200)}ms`;
189
- return P !== g.e && F(t, g.e = P), M !== g.t && B(t, "animation-delay", g.t = M), g;
330
+ ), h = `${Math.min(r.index * 20, 200)}ms`;
331
+ return o !== i.e && E(n, i.e = o), h !== i.t && F(n, "animation-delay", i.t = h), i;
190
332
  }, {
191
333
  e: void 0,
192
334
  t: void 0
193
- }), t;
335
+ }), n;
194
336
  })();
195
337
  }
196
- L(["click", "dblclick", "contextmenu", "pointerdown", "pointermove", "pointerup"]);
338
+ te(["click", "dblclick", "contextmenu", "pointerdown", "pointermove", "pointerup"]);
197
339
  export {
198
- ce as FileListView
340
+ Ae as FileListView
199
341
  };