@floegence/floe-webapp-core 0.58.0 → 0.60.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.
- package/dist/components/file-browser/DirectoryTree.js +7 -6
- package/dist/components/file-browser/DragPreview.js +36 -35
- package/dist/components/file-browser/FileGridView.js +110 -112
- package/dist/components/file-browser/FileIcons.d.ts +18 -17
- package/dist/components/file-browser/FileIcons.js +119 -478
- package/dist/components/file-browser/FileListView.js +1 -0
- package/dist/components/file-browser/fileIconArtwork.generated.d.ts +5 -0
- package/dist/components/file-browser/fileIconArtwork.generated.js +1450 -0
- package/dist/components/file-browser/fileIconCatalog.d.ts +26 -0
- package/dist/components/file-browser/fileIconCatalog.js +33 -0
- package/dist/components/file-browser/fileIconCatalog.json.js +4 -0
- package/dist/components/file-browser/fileIconDrawing.d.ts +2 -0
- package/dist/components/file-browser/fileIconLabels.json.js +240 -0
- package/dist/components/file-browser/index.d.ts +1 -1
- package/dist/components/ui/DirectoryPicker.d.ts +4 -0
- package/dist/components/ui/DirectoryPicker.js +54 -24
- package/dist/components/ui/FileOpenPicker.js +1 -0
- package/dist/components/ui/FileSavePicker.js +1 -0
- package/dist/components/ui/picker/PickerBase.js +1 -0
- package/dist/file-icons.css +43 -0
- package/dist/floe.css +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { addEventListener as te, use as Q, insert as
|
|
2
|
-
import { createSignal as
|
|
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
|
|
5
|
-
import { useVirtualWindow as
|
|
6
|
-
import { useFileBrowser as
|
|
7
|
-
import { useFileBrowserDrag as
|
|
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
|
|
9
|
+
import { FileItemDecorationBadge as be, fileItemDecorationNameClass as De } from "./FileItemDecorations.js";
|
|
10
10
|
import { createLongPressContextMenuHandlers as Se } from "./longPressContextMenu.js";
|
|
11
|
-
import { fileBrowserTouchTargetAttrs as
|
|
12
|
-
import { createItemContextMenuEvent as
|
|
13
|
-
import { createFileBrowserMarqueeSelection as
|
|
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
|
|
16
|
-
function
|
|
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
|
|
23
|
+
const s = [], M = new Set(e.match.matchedIndices);
|
|
24
24
|
let D = "", m = !1;
|
|
25
|
-
for (let
|
|
26
|
-
const v = M.has(
|
|
27
|
-
|
|
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[
|
|
30
|
+
}), D = e.name[d], m = v);
|
|
31
31
|
}
|
|
32
|
-
return D &&
|
|
32
|
+
return D && s.push({
|
|
33
33
|
text: D,
|
|
34
34
|
highlight: m
|
|
35
|
-
}),
|
|
35
|
+
}), s;
|
|
36
36
|
});
|
|
37
|
-
return
|
|
37
|
+
return b(ae, {
|
|
38
38
|
get each() {
|
|
39
39
|
return r();
|
|
40
40
|
},
|
|
41
|
-
children: (
|
|
41
|
+
children: (s) => b(B, {
|
|
42
42
|
get when() {
|
|
43
|
-
return
|
|
43
|
+
return s.highlight;
|
|
44
44
|
},
|
|
45
45
|
get fallback() {
|
|
46
|
-
return
|
|
46
|
+
return fe(() => s.text);
|
|
47
47
|
},
|
|
48
48
|
get children() {
|
|
49
|
-
var M =
|
|
50
|
-
return
|
|
49
|
+
var M = _e();
|
|
50
|
+
return S(M, () => s.text), M;
|
|
51
51
|
}
|
|
52
52
|
})
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const r =
|
|
57
|
-
const n =
|
|
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 +
|
|
59
|
+
const l = Math.floor((n + d) / (v + d));
|
|
60
60
|
return Math.max(T, Math.min(R, l));
|
|
61
|
-
}), E = () => m +
|
|
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
|
-
}),
|
|
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
|
|
83
|
+
const p = (n) => {
|
|
84
84
|
if (!g) return;
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
g.scrollTop =
|
|
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(),
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
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
|
-
|
|
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
|
-
}),
|
|
115
|
+
}), oe(() => {
|
|
116
116
|
typeof cancelAnimationFrame == "function" && I && cancelAnimationFrame(I);
|
|
117
117
|
});
|
|
118
|
-
const A =
|
|
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 =
|
|
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),
|
|
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
|
|
138
|
+
return S(o, b(B, {
|
|
139
139
|
get when() {
|
|
140
140
|
return r.filterQueryApplied().trim();
|
|
141
141
|
},
|
|
142
142
|
get fallback() {
|
|
143
|
-
return
|
|
143
|
+
return ke();
|
|
144
144
|
},
|
|
145
145
|
get children() {
|
|
146
146
|
return [(() => {
|
|
147
|
-
var i =
|
|
148
|
-
return _.nextSibling,
|
|
147
|
+
var i = Le(), w = i.firstChild, _ = w.nextSibling;
|
|
148
|
+
return _.nextSibling, S(i, () => r.filterQueryApplied(), _), i;
|
|
149
149
|
})(), (() => {
|
|
150
|
-
var i =
|
|
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 =
|
|
159
|
-
return
|
|
158
|
+
var o = Fe();
|
|
159
|
+
return S(o, b(ae, {
|
|
160
160
|
get each() {
|
|
161
|
-
return
|
|
161
|
+
return k();
|
|
162
162
|
},
|
|
163
|
-
children: (i) =>
|
|
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:
|
|
171
|
+
dragContext: s,
|
|
172
172
|
registerTile: O
|
|
173
173
|
})
|
|
174
174
|
})), N((i) => {
|
|
175
|
-
var w = `repeat(${x()}, minmax(0, 1fr))`, _ = `${c.paddingTop()}px`,
|
|
176
|
-
return w !== i.e && Y(o, "grid-template-columns", i.e = w), _ !== i.t && Y(o, "padding-top", i.t = _),
|
|
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),
|
|
183
|
+
}), null), S(l, b(B, {
|
|
184
184
|
get when() {
|
|
185
185
|
return A.overlayStyle();
|
|
186
186
|
},
|
|
187
187
|
children: (o) => (() => {
|
|
188
|
-
var i =
|
|
189
|
-
return q(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
|
|
195
|
-
const r =
|
|
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
|
|
199
|
-
const V = 5,
|
|
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,
|
|
202
|
-
if (
|
|
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
|
-
|
|
218
|
+
oe(() => {
|
|
219
219
|
e.registerTile(e.item.id, null), I(!1);
|
|
220
220
|
});
|
|
221
|
-
const
|
|
221
|
+
const p = (t, a) => {
|
|
222
222
|
if (!e.enableDragDrop || !e.dragContext || f) return;
|
|
223
|
-
f = !0,
|
|
224
|
-
const h = r.getSelectedItemsList(),
|
|
225
|
-
item:
|
|
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(
|
|
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 &&
|
|
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
|
-
},
|
|
248
|
-
|
|
249
|
-
v !== null && !f &&
|
|
250
|
-
},
|
|
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
|
-
|
|
252
|
+
d = t.pointerType, m.onPointerMove(t);
|
|
253
253
|
}, i = (t) => {
|
|
254
|
-
if (
|
|
254
|
+
if (!$() || !e.dragContext) return;
|
|
255
255
|
const a = e.dragContext.dragState();
|
|
256
256
|
if (!a.isDragging) return;
|
|
257
|
-
|
|
258
|
-
const h = e.dragContext.canDropOn(a.draggedItems, e.item.path, e.item, e.instanceId),
|
|
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,
|
|
263
|
+
}, h, u);
|
|
264
264
|
}, w = (t) => {
|
|
265
265
|
if (!e.dragContext) return;
|
|
266
|
-
|
|
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
|
-
},
|
|
285
|
+
}, X = () => {
|
|
286
286
|
c() || r.openItem(e.item);
|
|
287
|
-
},
|
|
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(
|
|
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
|
-
},
|
|
298
|
+
}, se = () => e.dragContext?.dragState(), de = () => se()?.isDragging ?? !1, K = () => E() && de() && $();
|
|
299
299
|
return (() => {
|
|
300
|
-
var t =
|
|
301
|
-
return Q((
|
|
302
|
-
e.registerTile(e.item.id,
|
|
303
|
-
}, t),
|
|
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
|
-
},
|
|
310
|
+
}, ye, {
|
|
311
311
|
get title() {
|
|
312
312
|
return e.item.name;
|
|
313
313
|
},
|
|
314
314
|
onClick: _,
|
|
315
|
-
onDblClick:
|
|
316
|
-
onContextMenu:
|
|
317
|
-
onPointerDown:
|
|
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
|
-
|
|
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() &&
|
|
333
|
-
K() &&
|
|
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),
|
|
336
|
+
}), !1, !0), S(t, b(B, {
|
|
337
337
|
get when() {
|
|
338
|
-
return
|
|
338
|
+
return s();
|
|
339
339
|
},
|
|
340
340
|
get children() {
|
|
341
|
-
return
|
|
341
|
+
return He();
|
|
342
342
|
}
|
|
343
|
-
}), a),
|
|
343
|
+
}), a), S(a, b(Ce, {
|
|
344
344
|
get item() {
|
|
345
345
|
return e.item;
|
|
346
346
|
},
|
|
347
|
-
|
|
348
|
-
|
|
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),
|
|
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((
|
|
361
|
-
var
|
|
362
|
-
|
|
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
|
-
|
|
372
|
+
he(["pointerdown", "click"]);
|
|
375
373
|
export {
|
|
376
|
-
|
|
374
|
+
et as FileGridView
|
|
377
375
|
};
|
|
@@ -2,6 +2,8 @@ import { type Component, type JSX } from 'solid-js';
|
|
|
2
2
|
import type { FileItem } from './types';
|
|
3
3
|
export interface FileIconProps {
|
|
4
4
|
class?: string;
|
|
5
|
+
/** Rendered pixel size; 20 px and below use the approved compact artwork. */
|
|
6
|
+
size?: number;
|
|
5
7
|
}
|
|
6
8
|
type FileIconComponent = Component<FileIconProps>;
|
|
7
9
|
type ResolvableFileIcon = Pick<FileItem, 'name' | 'type' | 'extension' | 'icon' | 'link'>;
|
|
@@ -9,29 +11,28 @@ export type FileItemIconRenderer = FileIconComponent | JSX.Element;
|
|
|
9
11
|
export interface ResolveFileItemIconOptions {
|
|
10
12
|
open?: boolean;
|
|
11
13
|
}
|
|
12
|
-
export declare const FolderIcon:
|
|
13
|
-
export declare const FolderOpenIcon:
|
|
14
|
-
export declare const SymlinkFolderIcon:
|
|
15
|
-
export declare const SymlinkFolderOpenIcon:
|
|
16
|
-
export declare const FileIcon:
|
|
17
|
-
export declare const SymlinkFileIcon:
|
|
18
|
-
export declare const BrokenSymlinkIcon:
|
|
19
|
-
export declare const ArchiveFileIcon:
|
|
20
|
-
export declare const CodeFileIcon:
|
|
14
|
+
export declare const FolderIcon: FileIconComponent;
|
|
15
|
+
export declare const FolderOpenIcon: FileIconComponent;
|
|
16
|
+
export declare const SymlinkFolderIcon: FileIconComponent;
|
|
17
|
+
export declare const SymlinkFolderOpenIcon: FileIconComponent;
|
|
18
|
+
export declare const FileIcon: FileIconComponent;
|
|
19
|
+
export declare const SymlinkFileIcon: FileIconComponent;
|
|
20
|
+
export declare const BrokenSymlinkIcon: FileIconComponent;
|
|
21
|
+
export declare const ArchiveFileIcon: FileIconComponent;
|
|
22
|
+
export declare const CodeFileIcon: FileIconComponent;
|
|
21
23
|
export declare const JavaScriptFileIcon: FileIconComponent;
|
|
22
24
|
export declare const TypeScriptFileIcon: FileIconComponent;
|
|
23
25
|
export declare const ShellScriptFileIcon: FileIconComponent;
|
|
24
|
-
export declare const ImageFileIcon:
|
|
25
|
-
export declare const VideoFileIcon:
|
|
26
|
-
export declare const AudioFileIcon:
|
|
27
|
-
export declare const DocumentFileIcon:
|
|
28
|
-
export declare const ConfigFileIcon:
|
|
29
|
-
export declare const StyleFileIcon:
|
|
26
|
+
export declare const ImageFileIcon: FileIconComponent;
|
|
27
|
+
export declare const VideoFileIcon: FileIconComponent;
|
|
28
|
+
export declare const AudioFileIcon: FileIconComponent;
|
|
29
|
+
export declare const DocumentFileIcon: FileIconComponent;
|
|
30
|
+
export declare const ConfigFileIcon: FileIconComponent;
|
|
31
|
+
export declare const StyleFileIcon: FileIconComponent;
|
|
30
32
|
export declare function getFileIcon(extension?: string): FileIconComponent;
|
|
31
33
|
export declare function resolveFileItemIcon(item: ResolvableFileIcon, options?: ResolveFileItemIconOptions): FileItemIconRenderer;
|
|
32
|
-
export declare function FileItemIcon(props: {
|
|
34
|
+
export declare function FileItemIcon(props: FileIconProps & {
|
|
33
35
|
item: ResolvableFileIcon;
|
|
34
|
-
class?: string;
|
|
35
36
|
open?: boolean;
|
|
36
37
|
}): JSX.Element;
|
|
37
38
|
export {};
|