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