@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.
- package/dist/components/file-browser/FileBrowser.js +38 -37
- package/dist/components/file-browser/FileBrowserContext.js +359 -297
- package/dist/components/file-browser/FileGridView.js +190 -167
- package/dist/components/file-browser/FileListView.js +328 -307
- package/dist/components/file-browser/index.d.ts +1 -1
- package/dist/components/file-browser/longPressContextMenu.js +32 -33
- package/dist/components/file-browser/types.d.ts +10 -0
- package/dist/components/file-browser/useFileBrowserMarqueeSelection.d.ts +16 -0
- package/dist/components/file-browser/useFileBrowserMarqueeSelection.js +69 -0
- package/dist/floe.css +8 -0
- package/dist/full.js +66 -64
- package/dist/index.js +53 -51
- package/dist/styles.css +1 -1
- package/dist/utils/keybind.d.ts +2 -0
- package/dist/utils/keybind.js +24 -16
- package/package.json +1 -1
|
@@ -1,103 +1,105 @@
|
|
|
1
|
-
import { addEventListener as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useResizeObserver as
|
|
5
|
-
import { useVirtualWindow as
|
|
6
|
-
import { useFileBrowser as
|
|
7
|
-
import { useFileBrowserDrag as
|
|
8
|
-
import { FileItemIcon as
|
|
9
|
-
import { createLongPressContextMenuHandlers as
|
|
10
|
-
import { fileBrowserTouchTargetAttrs as
|
|
11
|
-
import { createItemContextMenuEvent as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { addEventListener as te, use as z, insert as y, createComponent as D, effect as N, setStyleProperty as Y, className as H, style as ue, template as S, 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 q, For as ae, untrack as ve } from "solid-js";
|
|
3
|
+
import { cn as p } from "../../utils/cn.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
|
+
import { FileItemIcon as be } from "./FileIcons.js";
|
|
9
|
+
import { createLongPressContextMenuHandlers as Ce } from "./longPressContextMenu.js";
|
|
10
|
+
import { fileBrowserTouchTargetAttrs as De } from "./touchInteractionGuard.js";
|
|
11
|
+
import { createItemContextMenuEvent as Se } from "./contextMenuEvent.js";
|
|
12
|
+
import { createFileBrowserMarqueeSelection as ye, FILE_BROWSER_MARQUEE_OVERLAY_CLASS as Me } from "./useFileBrowserMarqueeSelection.js";
|
|
13
|
+
import { isPrimaryModKeyPressed as re } from "../../utils/keybind.js";
|
|
14
|
+
var Te = /* @__PURE__ */ S('<mark class="bg-warning/40 text-inherit rounded-sm">'), Pe = /* @__PURE__ */ S('<div class="grid gap-2">'), _e = /* @__PURE__ */ S('<div><div class=p-3><div class="w-full h-0"aria-hidden=true>'), Ee = /* @__PURE__ */ S('<span>No files matching "<!>"'), Fe = /* @__PURE__ */ S('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), Le = /* @__PURE__ */ S('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), Re = /* @__PURE__ */ S("<span>This folder is empty"), $e = /* @__PURE__ */ S("<div>"), ke = /* @__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">'), Ae = /* @__PURE__ */ S("<button type=button><div></div><span></span><div>");
|
|
15
|
+
function pe(e) {
|
|
16
|
+
const r = W(() => {
|
|
15
17
|
if (!e.match || e.match.matchedIndices.length === 0)
|
|
16
18
|
return [{
|
|
17
19
|
text: e.name,
|
|
18
20
|
highlight: !1
|
|
19
21
|
}];
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
for (let
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
text:
|
|
22
|
+
const s = [], M = new Set(e.match.matchedIndices);
|
|
23
|
+
let C = "", g = !1;
|
|
24
|
+
for (let d = 0; d < e.name.length; d++) {
|
|
25
|
+
const v = M.has(d);
|
|
26
|
+
d === 0 ? (g = v, C = e.name[d]) : v === g ? C += e.name[d] : (s.push({
|
|
27
|
+
text: C,
|
|
26
28
|
highlight: g
|
|
27
|
-
}),
|
|
29
|
+
}), C = e.name[d], g = v);
|
|
28
30
|
}
|
|
29
|
-
return
|
|
30
|
-
text:
|
|
31
|
+
return C && s.push({
|
|
32
|
+
text: C,
|
|
31
33
|
highlight: g
|
|
32
|
-
}),
|
|
34
|
+
}), s;
|
|
33
35
|
});
|
|
34
|
-
return D(
|
|
36
|
+
return D(ae, {
|
|
35
37
|
get each() {
|
|
36
38
|
return r();
|
|
37
39
|
},
|
|
38
|
-
children: (
|
|
40
|
+
children: (s) => D(q, {
|
|
39
41
|
get when() {
|
|
40
|
-
return
|
|
42
|
+
return s.highlight;
|
|
41
43
|
},
|
|
42
44
|
get fallback() {
|
|
43
|
-
return
|
|
45
|
+
return fe(() => s.text);
|
|
44
46
|
},
|
|
45
47
|
get children() {
|
|
46
|
-
var
|
|
47
|
-
return M
|
|
48
|
+
var M = Te();
|
|
49
|
+
return y(M, () => s.text), M;
|
|
48
50
|
}
|
|
49
51
|
})
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
|
-
function
|
|
53
|
-
const r =
|
|
54
|
-
const n =
|
|
55
|
-
if (n <= 0) return
|
|
56
|
-
const
|
|
57
|
-
return Math.max(
|
|
58
|
-
}), F = () => g +
|
|
59
|
-
count: () => Math.ceil(r.currentFiles().length / Math.max(1,
|
|
54
|
+
function Ke(e) {
|
|
55
|
+
const r = le(), s = we(), M = () => (e.enableDragDrop ?? !0) && !!s, C = () => e.instanceId ?? "default", g = 112, d = 8, v = 180, T = 2, R = 6, [m, V] = ie(null), U = xe(m), x = W(() => {
|
|
56
|
+
const n = U()?.width ?? 0;
|
|
57
|
+
if (n <= 0) return T;
|
|
58
|
+
const l = Math.floor((n + d) / (v + d));
|
|
59
|
+
return Math.max(T, Math.min(R, l));
|
|
60
|
+
}), F = () => g + d, c = Ie({
|
|
61
|
+
count: () => Math.ceil(r.currentFiles().length / Math.max(1, x())),
|
|
60
62
|
itemSize: F,
|
|
61
63
|
overscan: 2
|
|
62
|
-
}),
|
|
63
|
-
if (
|
|
64
|
-
|
|
64
|
+
}), Q = () => c.range().start * x(), $ = () => Math.min(r.currentFiles().length, c.range().end * x()), k = W(() => r.currentFiles().slice(Q(), $())), P = /* @__PURE__ */ new Map(), B = (n, l) => {
|
|
65
|
+
if (l) {
|
|
66
|
+
P.set(n, l);
|
|
65
67
|
return;
|
|
66
68
|
}
|
|
67
|
-
|
|
69
|
+
P.delete(n);
|
|
68
70
|
};
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
const n =
|
|
72
|
-
if (!
|
|
73
|
-
|
|
71
|
+
let f = null, L = T, I = 0;
|
|
72
|
+
ne(() => {
|
|
73
|
+
const n = x();
|
|
74
|
+
if (!f) {
|
|
75
|
+
L = n;
|
|
74
76
|
return;
|
|
75
77
|
}
|
|
76
|
-
if (n ===
|
|
77
|
-
const
|
|
78
|
-
|
|
78
|
+
if (n === L) return;
|
|
79
|
+
const l = F(), o = Math.floor(f.scrollTop / Math.max(1, l)) * Math.max(1, L), i = Math.floor(o / Math.max(1, n));
|
|
80
|
+
f.scrollTop = i * l, c.onScroll(), L = n;
|
|
79
81
|
});
|
|
80
|
-
const
|
|
81
|
-
if (!
|
|
82
|
-
const b = Math.floor(n / Math.max(1,
|
|
82
|
+
const O = (n) => {
|
|
83
|
+
if (!f) return;
|
|
84
|
+
const b = Math.floor(n / Math.max(1, x())) * F(), o = b + F(), i = f.scrollTop, w = i + f.clientHeight;
|
|
83
85
|
if (b < i) {
|
|
84
|
-
|
|
86
|
+
f.scrollTop = b, c.onScroll();
|
|
85
87
|
return;
|
|
86
88
|
}
|
|
87
|
-
|
|
89
|
+
o > w && (f.scrollTop = Math.max(0, o - f.clientHeight), c.onScroll());
|
|
88
90
|
};
|
|
89
|
-
|
|
90
|
-
const n = r.revealRequest(),
|
|
91
|
-
if (
|
|
92
|
-
const b =
|
|
91
|
+
ne(() => {
|
|
92
|
+
const n = r.revealRequest(), l = r.currentFiles();
|
|
93
|
+
if (x(), k(), !n) return;
|
|
94
|
+
const b = l.findIndex((w) => w.id === n.targetId);
|
|
93
95
|
if (b < 0) return;
|
|
94
|
-
if (!
|
|
95
|
-
|
|
96
|
+
if (!P.get(n.targetId)) {
|
|
97
|
+
O(b);
|
|
96
98
|
return;
|
|
97
99
|
}
|
|
98
100
|
typeof cancelAnimationFrame == "function" && I && (cancelAnimationFrame(I), I = 0);
|
|
99
101
|
const i = () => {
|
|
100
|
-
r.revealRequest()?.requestId === n.requestId && (
|
|
102
|
+
r.revealRequest()?.requestId === n.requestId && (P.get(n.targetId)?.scrollIntoView({
|
|
101
103
|
block: "nearest",
|
|
102
104
|
inline: "nearest"
|
|
103
105
|
}), r.selectItem(n.targetId, !1), r.consumeRevealRequest(n.requestId));
|
|
@@ -109,98 +111,115 @@ function Ye(e) {
|
|
|
109
111
|
return;
|
|
110
112
|
}
|
|
111
113
|
queueMicrotask(i);
|
|
112
|
-
}),
|
|
114
|
+
}), oe(() => {
|
|
113
115
|
typeof cancelAnimationFrame == "function" && I && cancelAnimationFrame(I);
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
});
|
|
117
|
+
const A = ye({
|
|
118
|
+
getContainer: () => f,
|
|
119
|
+
getVisibleItemIdsInOrder: () => r.currentFiles().map((n) => n.id),
|
|
120
|
+
getElementForId: (n) => P.get(n) ?? null,
|
|
121
|
+
getSelectedIds: () => [...r.selectedItems()],
|
|
122
|
+
replaceSelection: (n, l) => r.replaceSelection(n, l),
|
|
123
|
+
clearSelection: r.clearSelection
|
|
124
|
+
});
|
|
125
|
+
return (() => {
|
|
126
|
+
var n = _e(), l = n.firstChild, b = l.firstChild;
|
|
127
|
+
return te(n, "pointerdown", A.onPointerDown, !0), te(n, "scroll", c.onScroll), z((o) => {
|
|
128
|
+
f = o, c.scrollRef(o), r.setScrollContainer(o);
|
|
129
|
+
}, n), z((o) => V(o), b), y(l, D(q, {
|
|
119
130
|
get when() {
|
|
120
131
|
return r.currentFiles().length > 0;
|
|
121
132
|
},
|
|
122
133
|
get fallback() {
|
|
123
134
|
return (() => {
|
|
124
|
-
var
|
|
125
|
-
return
|
|
135
|
+
var o = Le();
|
|
136
|
+
return y(o, D(q, {
|
|
126
137
|
get when() {
|
|
127
138
|
return r.filterQueryApplied().trim();
|
|
128
139
|
},
|
|
129
140
|
get fallback() {
|
|
130
|
-
return
|
|
141
|
+
return Re();
|
|
131
142
|
},
|
|
132
143
|
get children() {
|
|
133
144
|
return [(() => {
|
|
134
|
-
var i =
|
|
135
|
-
return
|
|
145
|
+
var i = Ee(), w = i.firstChild, _ = w.nextSibling;
|
|
146
|
+
return _.nextSibling, y(i, () => r.filterQueryApplied(), _), i;
|
|
136
147
|
})(), (() => {
|
|
137
|
-
var i =
|
|
148
|
+
var i = Fe();
|
|
138
149
|
return i.$$click = () => r.setFilterQuery(""), i;
|
|
139
150
|
})()];
|
|
140
151
|
}
|
|
141
|
-
})),
|
|
152
|
+
})), o;
|
|
142
153
|
})();
|
|
143
154
|
},
|
|
144
155
|
get children() {
|
|
145
|
-
var
|
|
146
|
-
return
|
|
156
|
+
var o = Pe();
|
|
157
|
+
return y(o, D(ae, {
|
|
147
158
|
get each() {
|
|
148
|
-
return
|
|
159
|
+
return k();
|
|
149
160
|
},
|
|
150
|
-
children: (i) => D(
|
|
161
|
+
children: (i) => D(He, {
|
|
151
162
|
item: i,
|
|
152
163
|
get instanceId() {
|
|
153
|
-
return
|
|
164
|
+
return C();
|
|
154
165
|
},
|
|
155
166
|
get enableDragDrop() {
|
|
156
|
-
return
|
|
167
|
+
return M();
|
|
157
168
|
},
|
|
158
|
-
dragContext:
|
|
159
|
-
registerTile:
|
|
169
|
+
dragContext: s,
|
|
170
|
+
registerTile: B
|
|
160
171
|
})
|
|
161
|
-
})),
|
|
162
|
-
var
|
|
163
|
-
return
|
|
172
|
+
})), N((i) => {
|
|
173
|
+
var w = `repeat(${x()}, minmax(0, 1fr))`, _ = `${c.paddingTop()}px`, X = `${c.paddingBottom()}px`;
|
|
174
|
+
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;
|
|
164
175
|
}, {
|
|
165
176
|
e: void 0,
|
|
166
177
|
t: void 0,
|
|
167
178
|
a: void 0
|
|
168
|
-
}),
|
|
179
|
+
}), o;
|
|
169
180
|
}
|
|
170
|
-
}), null),
|
|
181
|
+
}), null), y(n, D(q, {
|
|
182
|
+
get when() {
|
|
183
|
+
return A.overlayStyle();
|
|
184
|
+
},
|
|
185
|
+
children: (o) => (() => {
|
|
186
|
+
var i = $e();
|
|
187
|
+
return H(i, Me), N((w) => ue(i, o(), w)), i;
|
|
188
|
+
})()
|
|
189
|
+
}), null), N(() => H(n, p("relative h-full min-h-0 overflow-auto", e.class))), n;
|
|
171
190
|
})();
|
|
172
191
|
}
|
|
173
|
-
function
|
|
174
|
-
const r =
|
|
192
|
+
function He(e) {
|
|
193
|
+
const r = le(), s = () => r.isSelected(e.item.id), M = () => r.getFilterMatchForId(e.item.id), C = ve(() => e.item), g = Ce(r, C, {
|
|
175
194
|
source: "grid"
|
|
176
195
|
});
|
|
177
|
-
let
|
|
178
|
-
const
|
|
179
|
-
let
|
|
180
|
-
const [F,
|
|
196
|
+
let d, v = null, T = 0, R = 0, m = !1;
|
|
197
|
+
const V = 5, U = 500;
|
|
198
|
+
let x = null;
|
|
199
|
+
const [F, j] = ie(!1), c = () => d === "touch" || d === "pen", Q = () => e.item.type === "folder", $ = () => Q() && e.enableDragDrop && e.dragContext, k = () => {
|
|
181
200
|
if (!$() || !e.dragContext) return !1;
|
|
182
201
|
const t = e.dragContext.dragState();
|
|
183
202
|
return t.isDragging ? e.dragContext.canDropOn(t.draggedItems, e.item.path, e.item, e.instanceId) : !1;
|
|
184
|
-
},
|
|
203
|
+
}, P = () => {
|
|
185
204
|
if (!e.dragContext) return !1;
|
|
186
205
|
const t = e.dragContext.dragState();
|
|
187
|
-
return t.isDragging ? t.draggedItems.some((
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
},
|
|
191
|
-
typeof document > "u" || (document.removeEventListener("pointermove",
|
|
192
|
-
},
|
|
193
|
-
typeof document > "u" || (document.addEventListener("pointermove",
|
|
206
|
+
return t.isDragging ? t.draggedItems.some((a) => a.item.id === e.item.id) : !1;
|
|
207
|
+
}, B = () => {
|
|
208
|
+
x !== null && (clearTimeout(x), x = null);
|
|
209
|
+
}, f = () => {
|
|
210
|
+
typeof document > "u" || (document.removeEventListener("pointermove", A, !0), document.removeEventListener("pointerup", n, !0), document.removeEventListener("pointercancel", l, !0));
|
|
211
|
+
}, L = () => {
|
|
212
|
+
typeof document > "u" || (document.addEventListener("pointermove", A, !0), document.addEventListener("pointerup", n, !0), document.addEventListener("pointercancel", l, !0));
|
|
194
213
|
}, I = (t) => {
|
|
195
|
-
|
|
214
|
+
B(), f(), m && e.dragContext && e.dragContext.endDrag(t), v = null, m = !1;
|
|
196
215
|
};
|
|
197
|
-
|
|
216
|
+
oe(() => {
|
|
198
217
|
e.registerTile(e.item.id, null), I(!1);
|
|
199
218
|
});
|
|
200
|
-
const
|
|
219
|
+
const O = (t, a) => {
|
|
201
220
|
if (!e.enableDragDrop || !e.dragContext || m) return;
|
|
202
|
-
m = !0,
|
|
203
|
-
const
|
|
221
|
+
m = !0, s() || r.selectItem(e.item.id, !1);
|
|
222
|
+
const h = r.getSelectedItemsList(), u = (h.length > 0 && s() ? h : [e.item]).map((G) => ({
|
|
204
223
|
item: G,
|
|
205
224
|
sourceInstanceId: e.instanceId,
|
|
206
225
|
sourcePath: r.currentPath()
|
|
@@ -210,42 +229,42 @@ function Le(e) {
|
|
|
210
229
|
navigator.vibrate(50);
|
|
211
230
|
} catch {
|
|
212
231
|
}
|
|
213
|
-
e.dragContext.startDrag(u, t,
|
|
214
|
-
},
|
|
215
|
-
if (
|
|
216
|
-
const
|
|
217
|
-
if (c() && !m &&
|
|
232
|
+
e.dragContext.startDrag(u, t, a);
|
|
233
|
+
}, A = (t) => {
|
|
234
|
+
if (v !== t.pointerId) return;
|
|
235
|
+
const a = t.clientX - T, h = t.clientY - R, E = Math.sqrt(a * a + h * h);
|
|
236
|
+
if (c() && !m && E > 10) {
|
|
218
237
|
I(!1);
|
|
219
238
|
return;
|
|
220
239
|
}
|
|
221
|
-
!c() && !m &&
|
|
222
|
-
},
|
|
223
|
-
|
|
240
|
+
!c() && !m && E > V && O(t.clientX, t.clientY), m && e.dragContext && e.dragContext.updateDrag(t.clientX, t.clientY);
|
|
241
|
+
}, n = (t) => {
|
|
242
|
+
v === t.pointerId && (g.onPointerUp(), I(!0));
|
|
243
|
+
}, l = (t) => {
|
|
244
|
+
v === t.pointerId && (g.onPointerCancel(), I(!1));
|
|
224
245
|
}, b = (t) => {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
246
|
+
d = t.pointerType, g.onPointerDown(t), !(t.pointerType === "mouse" && t.button !== 0) && (!e.enableDragDrop || !e.dragContext || (v = t.pointerId, T = t.clientX, R = t.clientY, m = !1, L(), c() && (B(), x = setTimeout(() => {
|
|
247
|
+
v !== null && !m && O(T, R);
|
|
248
|
+
}, U))));
|
|
249
|
+
}, o = (t) => {
|
|
250
|
+
d = t.pointerType, g.onPointerMove(t);
|
|
230
251
|
}, i = (t) => {
|
|
231
|
-
s = t.pointerType, g.onPointerMove(t);
|
|
232
|
-
}, C = (t) => {
|
|
233
252
|
if (!$() || !e.dragContext) return;
|
|
234
|
-
const
|
|
235
|
-
if (!
|
|
236
|
-
|
|
237
|
-
const
|
|
253
|
+
const a = e.dragContext.dragState();
|
|
254
|
+
if (!a.isDragging) return;
|
|
255
|
+
j(!0);
|
|
256
|
+
const h = e.dragContext.canDropOn(a.draggedItems, e.item.path, e.item, e.instanceId), u = t.currentTarget?.getBoundingClientRect() ?? null;
|
|
238
257
|
e.dragContext.setDropTarget({
|
|
239
258
|
instanceId: e.instanceId,
|
|
240
259
|
targetPath: e.item.path,
|
|
241
260
|
targetItem: e.item
|
|
242
|
-
},
|
|
243
|
-
},
|
|
261
|
+
}, h, u);
|
|
262
|
+
}, w = (t) => {
|
|
244
263
|
if (!e.dragContext) return;
|
|
245
|
-
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
},
|
|
264
|
+
j(!1);
|
|
265
|
+
const a = e.dragContext.dragState();
|
|
266
|
+
a.isDragging && a.dropTarget?.targetPath === e.item.path && e.dragContext.setDropTarget(null, !1);
|
|
267
|
+
}, _ = (t) => {
|
|
249
268
|
if (m) {
|
|
250
269
|
m = !1;
|
|
251
270
|
return;
|
|
@@ -255,81 +274,85 @@ function Le(e) {
|
|
|
255
274
|
r.openItem(e.item);
|
|
256
275
|
return;
|
|
257
276
|
}
|
|
258
|
-
|
|
277
|
+
if (t.shiftKey) {
|
|
278
|
+
r.selectRangeTo(e.item.id, re(t));
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
r.selectItem(e.item.id, re(t));
|
|
259
282
|
}
|
|
260
|
-
},
|
|
283
|
+
}, X = () => {
|
|
261
284
|
c() || r.openItem(e.item);
|
|
262
|
-
},
|
|
285
|
+
}, ce = (t) => {
|
|
263
286
|
if (t.preventDefault(), t.stopPropagation(), c()) return;
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
r.showContextMenu(
|
|
287
|
+
r.ensureContextMenuSelection(e.item.id);
|
|
288
|
+
const a = r.getSelectedItemsList(), h = a.length > 0 ? a : [e.item];
|
|
289
|
+
r.showContextMenu(Se({
|
|
267
290
|
x: t.clientX,
|
|
268
291
|
y: t.clientY,
|
|
269
292
|
triggerItem: e.item,
|
|
270
|
-
items:
|
|
293
|
+
items: h,
|
|
271
294
|
source: "grid"
|
|
272
295
|
}));
|
|
273
|
-
},
|
|
296
|
+
}, se = () => e.dragContext?.dragState(), de = () => se()?.isDragging ?? !1, K = () => F() && de() && $();
|
|
274
297
|
return (() => {
|
|
275
|
-
var t =
|
|
276
|
-
return
|
|
298
|
+
var t = Ae(), a = t.firstChild, h = a.nextSibling, E = h.nextSibling;
|
|
299
|
+
return z((u) => {
|
|
277
300
|
e.registerTile(e.item.id, u);
|
|
278
|
-
}, t),
|
|
301
|
+
}, t), ge(t, me({
|
|
279
302
|
get "data-file-browser-item-id"() {
|
|
280
303
|
return e.item.id;
|
|
281
304
|
},
|
|
282
305
|
get "data-file-browser-item-path"() {
|
|
283
306
|
return e.item.path;
|
|
284
307
|
}
|
|
285
|
-
},
|
|
308
|
+
}, De, {
|
|
286
309
|
get title() {
|
|
287
310
|
return e.item.name;
|
|
288
311
|
},
|
|
289
|
-
onClick:
|
|
290
|
-
onDblClick:
|
|
291
|
-
onContextMenu:
|
|
292
|
-
onPointerDown:
|
|
293
|
-
onPointerMove:
|
|
294
|
-
onPointerEnter:
|
|
295
|
-
onPointerLeave:
|
|
312
|
+
onClick: _,
|
|
313
|
+
onDblClick: X,
|
|
314
|
+
onContextMenu: ce,
|
|
315
|
+
onPointerDown: b,
|
|
316
|
+
onPointerMove: o,
|
|
317
|
+
onPointerEnter: i,
|
|
318
|
+
onPointerLeave: w,
|
|
296
319
|
get class() {
|
|
297
|
-
return
|
|
320
|
+
return p(
|
|
298
321
|
"group relative flex flex-col items-center gap-2 p-3 rounded-lg cursor-pointer h-28",
|
|
299
322
|
"transition-all duration-150 ease-out",
|
|
300
323
|
"hover:bg-accent/50 hover:scale-[1.02]",
|
|
301
324
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
302
325
|
"active:scale-[0.98]",
|
|
303
|
-
|
|
326
|
+
s() && "bg-accent ring-2 ring-primary/50",
|
|
304
327
|
// Drag state styling - being dragged items become translucent and shrink
|
|
305
|
-
|
|
328
|
+
P() && "opacity-40 scale-90",
|
|
306
329
|
// Drop target styling - enhanced visual feedback for folders
|
|
307
|
-
K() &&
|
|
308
|
-
K() && !
|
|
330
|
+
K() && k() && ["bg-primary/15 ring-2 ring-primary/60", "scale-105 shadow-lg shadow-primary/15"],
|
|
331
|
+
K() && !k() && ["bg-destructive/10 ring-2 ring-dashed ring-destructive/50"]
|
|
309
332
|
);
|
|
310
333
|
}
|
|
311
|
-
}), !1, !0),
|
|
334
|
+
}), !1, !0), y(t, D(q, {
|
|
312
335
|
get when() {
|
|
313
|
-
return
|
|
336
|
+
return s();
|
|
314
337
|
},
|
|
315
338
|
get children() {
|
|
316
|
-
return
|
|
339
|
+
return ke();
|
|
317
340
|
}
|
|
318
|
-
}),
|
|
341
|
+
}), a), y(a, D(be, {
|
|
319
342
|
get item() {
|
|
320
343
|
return e.item;
|
|
321
344
|
},
|
|
322
345
|
class: "w-8 h-8"
|
|
323
|
-
})),
|
|
346
|
+
})), y(h, D(pe, {
|
|
324
347
|
get name() {
|
|
325
348
|
return e.item.name;
|
|
326
349
|
},
|
|
327
350
|
get match() {
|
|
328
|
-
return
|
|
351
|
+
return M();
|
|
329
352
|
}
|
|
330
|
-
})),
|
|
331
|
-
var G =
|
|
332
|
-
return G !== u.e &&
|
|
353
|
+
})), N((u) => {
|
|
354
|
+
var G = p("w-12 h-12 flex items-center justify-center rounded-lg", "transition-transform duration-200", "group-hover:scale-110", e.item.type === "folder" ? "bg-warning/10" : "bg-muted/50"), J = p("block w-full min-w-0 truncate px-1 text-xs text-center", "transition-colors duration-150", s() && "font-medium"), Z = p("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%)";
|
|
355
|
+
return G !== u.e && H(a, u.e = G), J !== u.t && H(h, u.t = J), Z !== u.a && H(E, u.a = Z), ee !== u.o && Y(E, "background", u.o = ee), u;
|
|
333
356
|
}, {
|
|
334
357
|
e: void 0,
|
|
335
358
|
t: void 0,
|
|
@@ -338,7 +361,7 @@ function Le(e) {
|
|
|
338
361
|
}), t;
|
|
339
362
|
})();
|
|
340
363
|
}
|
|
341
|
-
|
|
364
|
+
he(["pointerdown", "click"]);
|
|
342
365
|
export {
|
|
343
|
-
|
|
366
|
+
Ke as FileGridView
|
|
344
367
|
};
|