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