@floegence/floe-webapp-core 0.57.1 → 0.59.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.
@@ -6,12 +6,12 @@ import { useFileBrowserDrag as G } from "../../context/FileBrowserDragContext.js
6
6
  import { FileItemIcon as W } from "./FileIcons.js";
7
7
  var Y = /* @__PURE__ */ a('<div class="text-[10px] text-muted-foreground pl-6">and <!> more...'), q = /* @__PURE__ */ a("<span>Drop to move"), y = /* @__PURE__ */ a("<div>"), H = /* @__PURE__ */ a('<div class="flex items-center gap-2.5 text-xs text-foreground"><span class="flex-shrink-0 w-4 h-4"></span><span class="truncate font-medium">'), J = /* @__PURE__ */ a("<span>Cannot drop here"), K = /* @__PURE__ */ a('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'), L = /* @__PURE__ */ a('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>');
8
8
  const x = 3, P = 4, T = 4, Q = 0.2;
9
- function lt() {
9
+ function le() {
10
10
  const g = G(), n = () => g?.dragState(), S = () => n()?.isDragging ?? !1, C = () => n()?.isDragEnding ?? !1, [c, h] = F(null), [s, w] = F(!1);
11
11
  let _ = !1;
12
12
  V(() => {
13
- const t = S(), e = C();
14
- if (t && !e && !_ && (h(null), w(!1)), e && !_) {
13
+ const e = S(), t = C();
14
+ if (e && !t && !_ && (h(null), w(!1)), t && !_) {
15
15
  const r = n();
16
16
  if (r && r.draggedItems.length > 0) {
17
17
  const i = r.pointerPosition;
@@ -26,21 +26,21 @@ function lt() {
26
26
  }), w(!0);
27
27
  }
28
28
  }
29
- _ = e;
29
+ _ = t;
30
30
  });
31
31
  const R = () => S() || C() || s(), E = d(() => {
32
- const t = c();
33
- return t ? t.items.slice(0, x) : (n()?.draggedItems ?? []).slice(0, x).map((r) => r.item);
32
+ const e = c();
33
+ return e ? e.items.slice(0, x) : (n()?.draggedItems ?? []).slice(0, x).map((r) => r.item);
34
34
  }), v = d(() => {
35
- const t = c();
36
- return t ? t.items.length : n()?.draggedItems?.length ?? 0;
35
+ const e = c();
36
+ return e ? e.items.length : n()?.draggedItems?.length ?? 0;
37
37
  }), k = d(() => {
38
- const t = v();
39
- return t > x ? t - x : 0;
38
+ const e = v();
39
+ return e > x ? e - x : 0;
40
40
  }), b = d(() => {
41
- const t = c();
42
- if (t)
43
- return t.position;
41
+ const e = c();
42
+ if (e)
43
+ return e.position;
44
44
  const r = n()?.pointerPosition ?? {
45
45
  x: 0,
46
46
  y: 0
@@ -50,8 +50,8 @@ function lt() {
50
50
  y: r.y + T
51
51
  };
52
52
  }), z = d(() => {
53
- const t = c();
54
- return t?.committed && t?.target ? t.target : b();
53
+ const e = c();
54
+ return e?.committed && e?.target ? e.target : b();
55
55
  }), M = d(() => c()?.committed ?? !1), p = () => n()?.isValidDrop ?? !1, O = () => !!n()?.dropTarget, I = () => O() && !c();
56
56
  return o(U, {
57
57
  get children() {
@@ -90,38 +90,39 @@ function lt() {
90
90
  },
91
91
  get children() {
92
92
  return [(() => {
93
- var t = y();
94
- return l(t, o(j, {
93
+ var e = y();
94
+ return l(e, o(j, {
95
95
  get each() {
96
96
  return E();
97
97
  },
98
- children: (e) => (() => {
98
+ children: (t) => (() => {
99
99
  var r = H(), i = r.firstChild, D = i.nextSibling;
100
100
  return l(i, o(W, {
101
- item: e,
101
+ item: t,
102
+ size: 16,
102
103
  class: "w-4 h-4"
103
- })), l(D, () => e.name), r;
104
+ })), l(D, () => t.name), r;
104
105
  })()
105
- }), null), l(t, o(m, {
106
+ }), null), l(e, o(m, {
106
107
  get when() {
107
108
  return k() > 0;
108
109
  },
109
110
  get children() {
110
- var e = Y(), r = e.firstChild, i = r.nextSibling;
111
- return i.nextSibling, l(e, k, i), e;
111
+ var t = Y(), r = t.firstChild, i = r.nextSibling;
112
+ return i.nextSibling, l(t, k, i), t;
112
113
  }
113
- }), null), l(t, o(m, {
114
+ }), null), l(e, o(m, {
114
115
  get when() {
115
116
  return I();
116
117
  },
117
118
  get children() {
118
- var e = y();
119
- return l(e, o(m, {
119
+ var t = y();
120
+ return l(t, o(m, {
120
121
  get when() {
121
122
  return p();
122
123
  },
123
124
  get fallback() {
124
- return [o(tt, {
125
+ return [o(ee, {
125
126
  class: "w-3.5 h-3.5"
126
127
  }), J()];
127
128
  },
@@ -130,9 +131,9 @@ function lt() {
130
131
  class: "w-3.5 h-3.5"
131
132
  }), q()];
132
133
  }
133
- })), u(() => $(e, f("flex items-center gap-1.5 pt-1.5 mt-1 border-t border-border text-[11px] font-medium", "transition-colors duration-150", p() ? "text-success" : "text-error"))), e;
134
+ })), u(() => $(t, f("flex items-center gap-1.5 pt-1.5 mt-1 border-t border-border text-[11px] font-medium", "transition-colors duration-150", p() ? "text-success" : "text-error"))), t;
134
135
  }
135
- }), null), u(() => $(t, f(
136
+ }), null), u(() => $(e, f(
136
137
  "flex flex-col gap-1 p-2.5 rounded-lg",
137
138
  "bg-card border border-border",
138
139
  "shadow-md",
@@ -145,14 +146,14 @@ function lt() {
145
146
  I() && !p() && "border-error/60",
146
147
  // Committed state
147
148
  s() && M() && "border-success/60"
148
- ))), t;
149
+ ))), e;
149
150
  })(), o(m, {
150
151
  get when() {
151
152
  return v() > 1;
152
153
  },
153
154
  get children() {
154
- var t = y();
155
- return l(t, v), u(() => $(t, f(
155
+ var e = y();
156
+ return l(e, v), u(() => $(e, f(
156
157
  "absolute -top-2 -right-2",
157
158
  "min-w-[20px] h-5 px-1.5 rounded-full",
158
159
  "bg-foreground text-background",
@@ -161,7 +162,7 @@ function lt() {
161
162
  "shadow-sm",
162
163
  // Entrance animation (only when not exiting)
163
164
  !s() && "animate-in zoom-in-50 duration-200"
164
- ))), t;
165
+ ))), e;
165
166
  }
166
167
  })];
167
168
  }
@@ -179,12 +180,12 @@ function Z(g) {
179
180
  return u(() => A(n, "class", g.class)), n;
180
181
  })();
181
182
  }
182
- function tt(g) {
183
+ function ee(g) {
183
184
  return (() => {
184
185
  var n = L();
185
186
  return u(() => A(n, "class", g.class)), n;
186
187
  })();
187
188
  }
188
189
  export {
189
- lt as FileBrowserDragPreview
190
+ le as FileBrowserDragPreview
190
191
  };
@@ -1,68 +1,68 @@
1
- import { addEventListener as te, use as Q, insert as y, createComponent as C, effect as N, setStyleProperty as Y, className as q, style as ie, template as S, spread as me, mergeProps as fe, memo as he, delegateEvents as ve } from "solid-js/web";
2
- import { createSignal as oe, createMemo as W, createEffect as ne, onCleanup as ae, Show as B, For as le, untrack as xe } from "solid-js";
1
+ import { addEventListener as te, use as Q, insert as S, createComponent as b, effect as N, setStyleProperty as Y, className as q, style as ue, template as y, spread as ge, mergeProps as me, memo as fe, delegateEvents as he } from "solid-js/web";
2
+ import { createSignal as ie, createMemo as W, createEffect as ne, onCleanup as oe, Show as B, For as ae, untrack as ve } from "solid-js";
3
3
  import { cn as H } from "../../utils/cn.js";
4
- import { useResizeObserver as Ie } from "../../hooks/useResizeObserver.js";
5
- import { useVirtualWindow as we } from "../../hooks/useVirtualWindow.js";
6
- import { useFileBrowser as ce } from "./FileBrowserContext.js";
7
- import { useFileBrowserDrag as be } from "../../context/FileBrowserDragContext.js";
4
+ import { useResizeObserver as xe } from "../../hooks/useResizeObserver.js";
5
+ import { useVirtualWindow as Ie } from "../../hooks/useVirtualWindow.js";
6
+ import { useFileBrowser as le } from "./FileBrowserContext.js";
7
+ import { useFileBrowserDrag as we } from "../../context/FileBrowserDragContext.js";
8
8
  import { FileItemIcon as Ce } from "./FileIcons.js";
9
- import { FileItemDecorationBadge as De, fileItemDecorationNameClass as ye } from "./FileItemDecorations.js";
9
+ import { FileItemDecorationBadge as be, fileItemDecorationNameClass as De } from "./FileItemDecorations.js";
10
10
  import { createLongPressContextMenuHandlers as Se } from "./longPressContextMenu.js";
11
- import { fileBrowserTouchTargetAttrs as Me } from "./touchInteractionGuard.js";
12
- import { createItemContextMenuEvent as Te } from "./contextMenuEvent.js";
13
- import { createFileBrowserMarqueeSelection as Pe, FILE_BROWSER_MARQUEE_OVERLAY_CLASS as _e } from "./useFileBrowserMarqueeSelection.js";
11
+ import { fileBrowserTouchTargetAttrs as ye } from "./touchInteractionGuard.js";
12
+ import { createItemContextMenuEvent as Me } from "./contextMenuEvent.js";
13
+ import { createFileBrowserMarqueeSelection as Te, FILE_BROWSER_MARQUEE_OVERLAY_CLASS as Pe } from "./useFileBrowserMarqueeSelection.js";
14
14
  import { isPrimaryModKeyPressed as re } from "../../utils/keybind.js";
15
- var Fe = /* @__PURE__ */ S('<mark class="bg-warning/40 text-inherit rounded-sm">'), Ee = /* @__PURE__ */ S('<div class="grid gap-2">'), Le = /* @__PURE__ */ S('<div><div class=p-3><div class="w-full h-0"aria-hidden=true>'), Re = /* @__PURE__ */ S('<span>No files matching "<!>"'), ke = /* @__PURE__ */ S('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), $e = /* @__PURE__ */ S('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), Ae = /* @__PURE__ */ S("<span>This folder is empty"), He = /* @__PURE__ */ S("<div>"), qe = /* @__PURE__ */ S('<div class="absolute top-1.5 right-1.5 w-4 h-4 rounded-full bg-primary flex items-center justify-center"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round class="w-2.5 h-2.5 text-primary-foreground"><polyline points="20 6 9 17 4 12">'), Be = /* @__PURE__ */ S("<button type=button><div></div><span></span><div>");
16
- function Oe(e) {
15
+ var _e = /* @__PURE__ */ y('<mark class="bg-warning/40 text-inherit rounded-sm">'), Fe = /* @__PURE__ */ y('<div class="grid gap-2">'), Ee = /* @__PURE__ */ y('<div><div class=p-3><div class="w-full h-0"aria-hidden=true>'), Le = /* @__PURE__ */ y('<span>No files matching "<!>"'), Re = /* @__PURE__ */ y('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), $e = /* @__PURE__ */ y('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), ke = /* @__PURE__ */ y("<span>This folder is empty"), Ae = /* @__PURE__ */ y("<div>"), He = /* @__PURE__ */ y('<div class="absolute top-1.5 right-1.5 w-4 h-4 rounded-full bg-primary flex items-center justify-center"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round class="w-2.5 h-2.5 text-primary-foreground"><polyline points="20 6 9 17 4 12">'), qe = /* @__PURE__ */ y("<button type=button><div></div><span></span><div>");
16
+ function Be(e) {
17
17
  const r = W(() => {
18
18
  if (!e.match || e.match.matchedIndices.length === 0)
19
19
  return [{
20
20
  text: e.name,
21
21
  highlight: !1
22
22
  }];
23
- const d = [], M = new Set(e.match.matchedIndices);
23
+ const s = [], M = new Set(e.match.matchedIndices);
24
24
  let D = "", m = !1;
25
- for (let u = 0; u < e.name.length; u++) {
26
- const v = M.has(u);
27
- u === 0 ? (m = v, D = e.name[u]) : v === m ? D += e.name[u] : (d.push({
25
+ for (let d = 0; d < e.name.length; d++) {
26
+ const v = M.has(d);
27
+ d === 0 ? (m = v, D = e.name[d]) : v === m ? D += e.name[d] : (s.push({
28
28
  text: D,
29
29
  highlight: m
30
- }), D = e.name[u], m = v);
30
+ }), D = e.name[d], m = v);
31
31
  }
32
- return D && d.push({
32
+ return D && s.push({
33
33
  text: D,
34
34
  highlight: m
35
- }), d;
35
+ }), s;
36
36
  });
37
- return C(le, {
37
+ return b(ae, {
38
38
  get each() {
39
39
  return r();
40
40
  },
41
- children: (d) => C(B, {
41
+ children: (s) => b(B, {
42
42
  get when() {
43
- return d.highlight;
43
+ return s.highlight;
44
44
  },
45
45
  get fallback() {
46
- return he(() => d.text);
46
+ return fe(() => s.text);
47
47
  },
48
48
  get children() {
49
- var M = Fe();
50
- return y(M, () => d.text), M;
49
+ var M = _e();
50
+ return S(M, () => s.text), M;
51
51
  }
52
52
  })
53
53
  });
54
54
  }
55
- function tt(e) {
56
- const r = ce(), d = be(), M = () => (e.enableDragDrop ?? !0) && !!d, D = () => e.instanceId ?? "default", m = 112, u = 8, v = 180, T = 2, R = 6, [f, V] = oe(null), U = Ie(f), x = W(() => {
57
- const n = U()?.width ?? 0;
55
+ function et(e) {
56
+ const r = le(), s = we(), M = () => (e.enableDragDrop ?? !0) && !!s, D = () => e.instanceId ?? "default", m = 112, d = 8, v = 180, T = 2, R = 6, [f, V] = ie(null), z = xe(f), x = W(() => {
57
+ const n = z()?.width ?? 0;
58
58
  if (n <= 0) return T;
59
- const l = Math.floor((n + u) / (v + u));
59
+ const l = Math.floor((n + d) / (v + d));
60
60
  return Math.max(T, Math.min(R, l));
61
- }), E = () => m + u, c = we({
61
+ }), E = () => m + d, c = Ie({
62
62
  count: () => Math.ceil(r.currentFiles().length / Math.max(1, x())),
63
63
  itemSize: E,
64
64
  overscan: 2
65
- }), z = () => c.range().start * x(), k = () => Math.min(r.currentFiles().length, c.range().end * x()), $ = W(() => r.currentFiles().slice(z(), k())), P = /* @__PURE__ */ new Map(), O = (n, l) => {
65
+ }), j = () => c.range().start * x(), $ = () => Math.min(r.currentFiles().length, c.range().end * x()), k = W(() => r.currentFiles().slice(j(), $())), P = /* @__PURE__ */ new Map(), O = (n, l) => {
66
66
  if (l) {
67
67
  P.set(n, l);
68
68
  return;
@@ -80,22 +80,22 @@ function tt(e) {
80
80
  const l = E(), o = Math.floor(g.scrollTop / Math.max(1, l)) * Math.max(1, L), i = Math.floor(o / Math.max(1, n));
81
81
  g.scrollTop = i * l, c.onScroll(), L = n;
82
82
  });
83
- const X = (n) => {
83
+ const p = (n) => {
84
84
  if (!g) return;
85
- const b = Math.floor(n / Math.max(1, x())) * E(), o = b + E(), i = g.scrollTop, w = i + g.clientHeight;
86
- if (b < i) {
87
- g.scrollTop = b, c.onScroll();
85
+ const C = Math.floor(n / Math.max(1, x())) * E(), o = C + E(), i = g.scrollTop, w = i + g.clientHeight;
86
+ if (C < i) {
87
+ g.scrollTop = C, c.onScroll();
88
88
  return;
89
89
  }
90
90
  o > w && (g.scrollTop = Math.max(0, o - g.clientHeight), c.onScroll());
91
91
  };
92
92
  ne(() => {
93
93
  const n = r.revealRequest(), l = r.currentFiles();
94
- if (x(), $(), !n) return;
95
- const b = l.findIndex((w) => w.id === n.targetId);
96
- if (b < 0) return;
94
+ if (x(), k(), !n) return;
95
+ const C = l.findIndex((w) => w.id === n.targetId);
96
+ if (C < 0) return;
97
97
  if (!P.get(n.targetId)) {
98
- X(b);
98
+ p(C);
99
99
  return;
100
100
  }
101
101
  typeof cancelAnimationFrame == "function" && I && (cancelAnimationFrame(I), I = 0);
@@ -112,10 +112,10 @@ function tt(e) {
112
112
  return;
113
113
  }
114
114
  queueMicrotask(i);
115
- }), ae(() => {
115
+ }), oe(() => {
116
116
  typeof cancelAnimationFrame == "function" && I && cancelAnimationFrame(I);
117
117
  });
118
- const A = Pe({
118
+ const A = Te({
119
119
  getContainer: () => g,
120
120
  getOverlayHost: () => g,
121
121
  getVisibleItemIdsInOrder: () => r.currentFiles().map((n) => n.id),
@@ -125,29 +125,29 @@ function tt(e) {
125
125
  clearSelection: r.clearSelection
126
126
  });
127
127
  return (() => {
128
- var n = Le(), l = n.firstChild, b = l.firstChild;
128
+ var n = Ee(), l = n.firstChild, C = l.firstChild;
129
129
  return te(n, "pointerdown", A.onPointerDown, !0), te(n, "scroll", c.onScroll), Q((o) => {
130
130
  g = o, c.scrollRef(o), r.setScrollContainer(o);
131
- }, n), Q((o) => V(o), b), y(l, C(B, {
131
+ }, n), Q((o) => V(o), C), S(l, b(B, {
132
132
  get when() {
133
133
  return r.currentFiles().length > 0;
134
134
  },
135
135
  get fallback() {
136
136
  return (() => {
137
137
  var o = $e();
138
- return y(o, C(B, {
138
+ return S(o, b(B, {
139
139
  get when() {
140
140
  return r.filterQueryApplied().trim();
141
141
  },
142
142
  get fallback() {
143
- return Ae();
143
+ return ke();
144
144
  },
145
145
  get children() {
146
146
  return [(() => {
147
- var i = Re(), w = i.firstChild, _ = w.nextSibling;
148
- return _.nextSibling, y(i, () => r.filterQueryApplied(), _), i;
147
+ var i = Le(), w = i.firstChild, _ = w.nextSibling;
148
+ return _.nextSibling, S(i, () => r.filterQueryApplied(), _), i;
149
149
  })(), (() => {
150
- var i = ke();
150
+ var i = Re();
151
151
  return i.$$click = () => r.setFilterQuery(""), i;
152
152
  })()];
153
153
  }
@@ -155,12 +155,12 @@ function tt(e) {
155
155
  })();
156
156
  },
157
157
  get children() {
158
- var o = Ee();
159
- return y(o, C(le, {
158
+ var o = Fe();
159
+ return S(o, b(ae, {
160
160
  get each() {
161
- return $();
161
+ return k();
162
162
  },
163
- children: (i) => C(Xe, {
163
+ children: (i) => b(Oe, {
164
164
  item: i,
165
165
  get instanceId() {
166
166
  return D();
@@ -168,38 +168,38 @@ function tt(e) {
168
168
  get enableDragDrop() {
169
169
  return M();
170
170
  },
171
- dragContext: d,
171
+ dragContext: s,
172
172
  registerTile: O
173
173
  })
174
174
  })), N((i) => {
175
- var w = `repeat(${x()}, minmax(0, 1fr))`, _ = `${c.paddingTop()}px`, G = `${c.paddingBottom()}px`;
176
- return w !== i.e && Y(o, "grid-template-columns", i.e = w), _ !== i.t && Y(o, "padding-top", i.t = _), G !== i.a && Y(o, "padding-bottom", i.a = G), i;
175
+ var w = `repeat(${x()}, minmax(0, 1fr))`, _ = `${c.paddingTop()}px`, X = `${c.paddingBottom()}px`;
176
+ return w !== i.e && Y(o, "grid-template-columns", i.e = w), _ !== i.t && Y(o, "padding-top", i.t = _), X !== i.a && Y(o, "padding-bottom", i.a = X), i;
177
177
  }, {
178
178
  e: void 0,
179
179
  t: void 0,
180
180
  a: void 0
181
181
  }), o;
182
182
  }
183
- }), null), y(l, C(B, {
183
+ }), null), S(l, b(B, {
184
184
  get when() {
185
185
  return A.overlayStyle();
186
186
  },
187
187
  children: (o) => (() => {
188
- var i = He();
189
- return q(i, _e), N((w) => ie(i, o(), w)), i;
188
+ var i = Ae();
189
+ return q(i, Pe), N((w) => ue(i, o(), w)), i;
190
190
  })()
191
191
  }), null), N(() => q(n, H("relative h-full min-h-0 overflow-auto", e.class))), n;
192
192
  })();
193
193
  }
194
- function Xe(e) {
195
- const r = ce(), d = () => r.isSelected(e.item.id), M = () => r.getFilterMatchForId(e.item.id), D = xe(() => e.item), m = Se(r, D, {
194
+ function Oe(e) {
195
+ const r = le(), s = () => r.isSelected(e.item.id), M = () => r.getFilterMatchForId(e.item.id), D = ve(() => e.item), m = Se(r, D, {
196
196
  source: "grid"
197
197
  });
198
- let u, v = null, T = 0, R = 0, f = !1;
199
- const V = 5, U = 500;
198
+ let d, v = null, T = 0, R = 0, f = !1;
199
+ const V = 5, z = 500;
200
200
  let x = null;
201
- const [E, j] = oe(!1), c = () => u === "touch" || u === "pen", z = () => e.item.type === "folder", k = () => z() && e.enableDragDrop && e.dragContext, $ = () => {
202
- if (!k() || !e.dragContext) return !1;
201
+ const [E, U] = ie(!1), c = () => d === "touch" || d === "pen", j = () => e.item.type === "folder", $ = () => j() && e.enableDragDrop && e.dragContext, k = () => {
202
+ if (!$() || !e.dragContext) return !1;
203
203
  const t = e.dragContext.dragState();
204
204
  return t.isDragging ? e.dragContext.canDropOn(t.draggedItems, e.item.path, e.item, e.instanceId) : !1;
205
205
  }, P = () => {
@@ -215,14 +215,14 @@ function Xe(e) {
215
215
  }, I = (t) => {
216
216
  O(), g(), f && e.dragContext && e.dragContext.endDrag(t), v = null, f = !1;
217
217
  };
218
- ae(() => {
218
+ oe(() => {
219
219
  e.registerTile(e.item.id, null), I(!1);
220
220
  });
221
- const X = (t, a) => {
221
+ const p = (t, a) => {
222
222
  if (!e.enableDragDrop || !e.dragContext || f) return;
223
- f = !0, d() || r.selectItem(e.item.id, !1);
224
- const h = r.getSelectedItemsList(), s = (h.length > 0 && d() ? h : [e.item]).map((p) => ({
225
- item: p,
223
+ f = !0, s() || r.selectItem(e.item.id, !1);
224
+ const h = r.getSelectedItemsList(), u = (h.length > 0 && s() ? h : [e.item]).map((G) => ({
225
+ item: G,
226
226
  sourceInstanceId: e.instanceId,
227
227
  sourcePath: r.currentPath()
228
228
  }));
@@ -231,7 +231,7 @@ function Xe(e) {
231
231
  navigator.vibrate(50);
232
232
  } catch {
233
233
  }
234
- e.dragContext.startDrag(s, t, a);
234
+ e.dragContext.startDrag(u, t, a);
235
235
  }, A = (t) => {
236
236
  if (v !== t.pointerId) return;
237
237
  const a = t.clientX - T, h = t.clientY - R, F = Math.sqrt(a * a + h * h);
@@ -239,31 +239,31 @@ function Xe(e) {
239
239
  I(!1);
240
240
  return;
241
241
  }
242
- !c() && !f && F > V && X(t.clientX, t.clientY), f && e.dragContext && e.dragContext.updateDrag(t.clientX, t.clientY);
242
+ !c() && !f && F > V && p(t.clientX, t.clientY), f && e.dragContext && e.dragContext.updateDrag(t.clientX, t.clientY);
243
243
  }, n = (t) => {
244
244
  v === t.pointerId && (m.onPointerUp(), I(!0));
245
245
  }, l = (t) => {
246
246
  v === t.pointerId && (m.onPointerCancel(), I(!1));
247
- }, b = (t) => {
248
- u = t.pointerType, m.onPointerDown(t), !(t.pointerType === "mouse" && t.button !== 0) && (!e.enableDragDrop || !e.dragContext || (v = t.pointerId, T = t.clientX, R = t.clientY, f = !1, L(), c() && (O(), x = setTimeout(() => {
249
- v !== null && !f && X(T, R);
250
- }, U))));
247
+ }, C = (t) => {
248
+ d = t.pointerType, m.onPointerDown(t), !(t.pointerType === "mouse" && t.button !== 0) && (!e.enableDragDrop || !e.dragContext || (v = t.pointerId, T = t.clientX, R = t.clientY, f = !1, L(), c() && (O(), x = setTimeout(() => {
249
+ v !== null && !f && p(T, R);
250
+ }, z))));
251
251
  }, o = (t) => {
252
- u = t.pointerType, m.onPointerMove(t);
252
+ d = t.pointerType, m.onPointerMove(t);
253
253
  }, i = (t) => {
254
- if (!k() || !e.dragContext) return;
254
+ if (!$() || !e.dragContext) return;
255
255
  const a = e.dragContext.dragState();
256
256
  if (!a.isDragging) return;
257
- j(!0);
258
- const h = e.dragContext.canDropOn(a.draggedItems, e.item.path, e.item, e.instanceId), s = t.currentTarget?.getBoundingClientRect() ?? null;
257
+ U(!0);
258
+ const h = e.dragContext.canDropOn(a.draggedItems, e.item.path, e.item, e.instanceId), u = t.currentTarget?.getBoundingClientRect() ?? null;
259
259
  e.dragContext.setDropTarget({
260
260
  instanceId: e.instanceId,
261
261
  targetPath: e.item.path,
262
262
  targetItem: e.item
263
- }, h, s);
263
+ }, h, u);
264
264
  }, w = (t) => {
265
265
  if (!e.dragContext) return;
266
- j(!1);
266
+ U(!1);
267
267
  const a = e.dragContext.dragState();
268
268
  a.isDragging && a.dropTarget?.targetPath === e.item.path && e.dragContext.setDropTarget(null, !1);
269
269
  }, _ = (t) => {
@@ -282,39 +282,39 @@ function Xe(e) {
282
282
  }
283
283
  r.selectItem(e.item.id, re(t));
284
284
  }
285
- }, G = () => {
285
+ }, X = () => {
286
286
  c() || r.openItem(e.item);
287
- }, se = (t) => {
287
+ }, ce = (t) => {
288
288
  if (t.preventDefault(), t.stopPropagation(), c()) return;
289
289
  r.ensureContextMenuSelection(e.item.id);
290
290
  const a = r.getSelectedItemsList(), h = a.length > 0 ? a : [e.item];
291
- r.showContextMenu(Te({
291
+ r.showContextMenu(Me({
292
292
  x: t.clientX,
293
293
  y: t.clientY,
294
294
  triggerItem: e.item,
295
295
  items: h,
296
296
  source: "grid"
297
297
  }));
298
- }, de = () => e.dragContext?.dragState(), ue = () => de()?.isDragging ?? !1, K = () => E() && ue() && k();
298
+ }, se = () => e.dragContext?.dragState(), de = () => se()?.isDragging ?? !1, K = () => E() && de() && $();
299
299
  return (() => {
300
- var t = Be(), a = t.firstChild, h = a.nextSibling, F = h.nextSibling;
301
- return Q((s) => {
302
- e.registerTile(e.item.id, s);
303
- }, t), me(t, fe({
300
+ var t = qe(), a = t.firstChild, h = a.nextSibling, F = h.nextSibling;
301
+ return Q((u) => {
302
+ e.registerTile(e.item.id, u);
303
+ }, t), ge(t, me({
304
304
  get "data-file-browser-item-id"() {
305
305
  return e.item.id;
306
306
  },
307
307
  get "data-file-browser-item-path"() {
308
308
  return e.item.path;
309
309
  }
310
- }, Me, {
310
+ }, ye, {
311
311
  get title() {
312
312
  return e.item.name;
313
313
  },
314
314
  onClick: _,
315
- onDblClick: G,
316
- onContextMenu: se,
317
- onPointerDown: b,
315
+ onDblClick: X,
316
+ onContextMenu: ce,
317
+ onPointerDown: C,
318
318
  onPointerMove: o,
319
319
  onPointerEnter: i,
320
320
  onPointerLeave: w,
@@ -325,53 +325,51 @@ function Xe(e) {
325
325
  "hover:bg-accent/50 hover:scale-[1.02]",
326
326
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
327
327
  "active:scale-[0.98]",
328
- d() && "bg-accent ring-2 ring-primary/50",
328
+ s() && "bg-accent ring-2 ring-primary/50",
329
329
  // Drag state styling - being dragged items become translucent and shrink
330
330
  P() && "opacity-40 scale-90",
331
331
  // Drop target styling - enhanced visual feedback for folders
332
- K() && $() && ["bg-primary/15 ring-2 ring-primary/60", "scale-105 shadow-lg shadow-primary/15"],
333
- K() && !$() && ["bg-destructive/10 ring-2 ring-dashed ring-destructive/50"]
332
+ K() && k() && ["bg-primary/15 ring-2 ring-primary/60", "scale-105 shadow-lg shadow-primary/15"],
333
+ K() && !k() && ["bg-destructive/10 ring-2 ring-dashed ring-destructive/50"]
334
334
  );
335
335
  }
336
- }), !1, !0), y(t, C(B, {
336
+ }), !1, !0), S(t, b(B, {
337
337
  get when() {
338
- return d();
338
+ return s();
339
339
  },
340
340
  get children() {
341
- return qe();
341
+ return He();
342
342
  }
343
- }), a), y(a, C(Ce, {
343
+ }), a), S(a, b(Ce, {
344
344
  get item() {
345
345
  return e.item;
346
346
  },
347
- class: "w-8 h-8"
348
- }), null), y(a, C(De, {
347
+ size: 40,
348
+ class: "w-10 h-10"
349
+ }), null), S(a, b(be, {
349
350
  get item() {
350
351
  return e.item;
351
352
  },
352
353
  size: "md"
353
- }), null), y(h, C(Oe, {
354
+ }), null), S(h, b(Be, {
354
355
  get name() {
355
356
  return e.item.name;
356
357
  },
357
358
  get match() {
358
359
  return M();
359
360
  }
360
- })), N((s) => {
361
- var p = H("w-12 h-12 flex items-center justify-center rounded-lg", "relative", e.item.type !== "folder" && "bg-muted/50"), ge = e.item.type === "folder" ? {
362
- "background-color": "color-mix(in srgb, var(--floe-file-icon-warning, var(--warning)) 10%, transparent)"
363
- } : void 0, J = H("block w-full min-w-0 truncate px-1 text-xs text-center", "transition-colors duration-150", ye(e.item), d() && "font-medium"), Z = H("absolute inset-0 rounded-lg opacity-0 transition-opacity duration-300", "group-hover:opacity-100", "pointer-events-none"), ee = e.item.type === "folder" ? "radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--warning) 8%, transparent), transparent 70%)" : "radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--primary) 5%, transparent), transparent 70%)";
364
- return p !== s.e && q(a, s.e = p), s.t = ie(a, ge, s.t), J !== s.a && q(h, s.a = J), Z !== s.o && q(F, s.o = Z), ee !== s.i && Y(F, "background", s.i = ee), s;
361
+ })), N((u) => {
362
+ var G = H("w-12 h-12 flex items-center justify-center rounded-lg", "relative"), J = H("block w-full min-w-0 truncate px-1 text-xs text-center", "transition-colors duration-150", De(e.item), s() && "font-medium"), Z = H("absolute inset-0 rounded-lg opacity-0 transition-opacity duration-300", "group-hover:opacity-100", "pointer-events-none"), ee = e.item.type === "folder" ? "radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--warning) 8%, transparent), transparent 70%)" : "radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--primary) 5%, transparent), transparent 70%)";
363
+ return G !== u.e && q(a, u.e = G), J !== u.t && q(h, u.t = J), Z !== u.a && q(F, u.a = Z), ee !== u.o && Y(F, "background", u.o = ee), u;
365
364
  }, {
366
365
  e: void 0,
367
366
  t: void 0,
368
367
  a: void 0,
369
- o: void 0,
370
- i: void 0
368
+ o: void 0
371
369
  }), t;
372
370
  })();
373
371
  }
374
- ve(["pointerdown", "click"]);
372
+ he(["pointerdown", "click"]);
375
373
  export {
376
- tt as FileGridView
374
+ et as FileGridView
377
375
  };