@floegence/floe-webapp-core 0.35.19 → 0.35.20
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/DragPreview.js +42 -44
- package/dist/components/file-browser/FileGridView.js +61 -61
- package/dist/components/file-browser/FileIcons.d.ts +15 -4
- package/dist/components/file-browser/FileIcons.js +386 -50
- package/dist/components/file-browser/FileListView.js +151 -151
- package/dist/components/file-browser/index.d.ts +2 -2
- package/dist/components/file-browser/types.d.ts +5 -2
- package/dist/components/ui/FileSavePicker.js +56 -58
- package/dist/file-browser.js +25 -21
- package/dist/full.js +396 -392
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { createComponent as o, Portal as
|
|
2
|
-
import { createSignal as F, createEffect as
|
|
3
|
-
import { Presence as
|
|
1
|
+
import { createComponent as o, Portal as N, insert as a, effect as u, className as $, memo as V, template as l, setAttribute as A } from "solid-js/web";
|
|
2
|
+
import { createSignal as F, createEffect as j, createMemo as d, Show as m, For as B } from "solid-js";
|
|
3
|
+
import { Presence as U, Motion as X } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
|
|
4
4
|
import { cn as f } from "../../utils/cn.js";
|
|
5
|
-
import { useFileBrowserDrag as
|
|
6
|
-
import {
|
|
7
|
-
var
|
|
8
|
-
const x = 3, P = 4, T = 4,
|
|
9
|
-
function
|
|
10
|
-
const g =
|
|
5
|
+
import { useFileBrowserDrag as G } from "../../context/FileBrowserDragContext.js";
|
|
6
|
+
import { FileItemIcon as W } from "./FileIcons.js";
|
|
7
|
+
var Y = /* @__PURE__ */ l('<div class="text-[10px] text-muted-foreground pl-6">and <!> more...'), q = /* @__PURE__ */ l("<span>Drop to move"), y = /* @__PURE__ */ l("<div>"), H = /* @__PURE__ */ l('<div class="flex items-center gap-2.5 text-xs text-foreground"><span class="flex-shrink-0 w-4 h-4"></span><span class="truncate font-medium">'), J = /* @__PURE__ */ l("<span>Cannot drop here"), K = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><polyline points="20 6 9 17 4 12">'), L = /* @__PURE__ */ l('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><line x1=18 y1=6 x2=6 y2=18></line><line x1=6 y1=6 x2=18 y2=18>');
|
|
8
|
+
const x = 3, P = 4, T = 4, Q = 0.2;
|
|
9
|
+
function at() {
|
|
10
|
+
const g = G(), n = () => g?.dragState(), S = () => n()?.isDragging ?? !1, C = () => n()?.isDragEnding ?? !1, [c, h] = F(null), [s, w] = F(!1);
|
|
11
11
|
let _ = !1;
|
|
12
|
-
|
|
12
|
+
j(() => {
|
|
13
13
|
const t = S(), e = C();
|
|
14
14
|
if (t && !e && !_ && (h(null), w(!1)), e && !_) {
|
|
15
15
|
const r = n();
|
|
16
16
|
if (r && r.draggedItems.length > 0) {
|
|
17
17
|
const i = r.pointerPosition;
|
|
18
18
|
h({
|
|
19
|
-
items: r.draggedItems.map((
|
|
19
|
+
items: r.draggedItems.map((D) => D.item),
|
|
20
20
|
position: {
|
|
21
21
|
x: i.x + P,
|
|
22
22
|
y: i.y + T
|
|
@@ -52,17 +52,17 @@ function dt() {
|
|
|
52
52
|
}), z = d(() => {
|
|
53
53
|
const t = c();
|
|
54
54
|
return t?.committed && t?.target ? t.target : b();
|
|
55
|
-
}), M = d(() => c()?.committed ?? !1), p = () => n()?.isValidDrop ?? !1, O = () => !!n()?.dropTarget, I = () => O() && !c()
|
|
56
|
-
return o(
|
|
55
|
+
}), M = d(() => c()?.committed ?? !1), p = () => n()?.isValidDrop ?? !1, O = () => !!n()?.dropTarget, I = () => O() && !c();
|
|
56
|
+
return o(U, {
|
|
57
57
|
get children() {
|
|
58
58
|
return o(m, {
|
|
59
59
|
get when() {
|
|
60
|
-
return
|
|
60
|
+
return V(() => !!R())() && E().length > 0;
|
|
61
61
|
},
|
|
62
62
|
get children() {
|
|
63
|
-
return o(
|
|
63
|
+
return o(N, {
|
|
64
64
|
get children() {
|
|
65
|
-
return o(
|
|
65
|
+
return o(X.div, {
|
|
66
66
|
get class() {
|
|
67
67
|
return f("fixed top-0 left-0 pointer-events-none z-[9999]", "will-change-transform");
|
|
68
68
|
},
|
|
@@ -81,7 +81,7 @@ function dt() {
|
|
|
81
81
|
},
|
|
82
82
|
get transition() {
|
|
83
83
|
return {
|
|
84
|
-
duration: s() ?
|
|
84
|
+
duration: s() ? Q : 0,
|
|
85
85
|
easing: "ease-out"
|
|
86
86
|
};
|
|
87
87
|
},
|
|
@@ -90,51 +90,49 @@ function dt() {
|
|
|
90
90
|
},
|
|
91
91
|
get children() {
|
|
92
92
|
return [(() => {
|
|
93
|
-
var t =
|
|
94
|
-
return
|
|
93
|
+
var t = y();
|
|
94
|
+
return a(t, o(B, {
|
|
95
95
|
get each() {
|
|
96
96
|
return E();
|
|
97
97
|
},
|
|
98
98
|
children: (e) => (() => {
|
|
99
|
-
var r =
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
return N(e);
|
|
103
|
-
},
|
|
99
|
+
var r = H(), i = r.firstChild, D = i.nextSibling;
|
|
100
|
+
return a(i, o(W, {
|
|
101
|
+
item: e,
|
|
104
102
|
class: "w-4 h-4"
|
|
105
|
-
})),
|
|
103
|
+
})), a(D, () => e.name), r;
|
|
106
104
|
})()
|
|
107
|
-
}), null),
|
|
105
|
+
}), null), a(t, o(m, {
|
|
108
106
|
get when() {
|
|
109
107
|
return k() > 0;
|
|
110
108
|
},
|
|
111
109
|
get children() {
|
|
112
|
-
var e =
|
|
113
|
-
return i.nextSibling,
|
|
110
|
+
var e = Y(), r = e.firstChild, i = r.nextSibling;
|
|
111
|
+
return i.nextSibling, a(e, k, i), e;
|
|
114
112
|
}
|
|
115
|
-
}), null),
|
|
113
|
+
}), null), a(t, o(m, {
|
|
116
114
|
get when() {
|
|
117
115
|
return I();
|
|
118
116
|
},
|
|
119
117
|
get children() {
|
|
120
|
-
var e =
|
|
121
|
-
return
|
|
118
|
+
var e = y();
|
|
119
|
+
return a(e, o(m, {
|
|
122
120
|
get when() {
|
|
123
121
|
return p();
|
|
124
122
|
},
|
|
125
123
|
get fallback() {
|
|
126
|
-
return [o(
|
|
124
|
+
return [o(tt, {
|
|
127
125
|
class: "w-3.5 h-3.5"
|
|
128
|
-
}),
|
|
126
|
+
}), J()];
|
|
129
127
|
},
|
|
130
128
|
get children() {
|
|
131
|
-
return [o(
|
|
129
|
+
return [o(Z, {
|
|
132
130
|
class: "w-3.5 h-3.5"
|
|
133
|
-
}),
|
|
131
|
+
}), q()];
|
|
134
132
|
}
|
|
135
|
-
})), u(() =>
|
|
133
|
+
})), u(() => $(e, f("flex items-center gap-1.5 pt-1.5 mt-1 border-t border-border text-[11px] font-medium", "transition-colors duration-150", p() ? "text-success" : "text-error"))), e;
|
|
136
134
|
}
|
|
137
|
-
}), null), u(() =>
|
|
135
|
+
}), null), u(() => $(t, f(
|
|
138
136
|
"flex flex-col gap-1 p-2.5 rounded-lg",
|
|
139
137
|
"bg-card border border-border",
|
|
140
138
|
"shadow-md",
|
|
@@ -153,8 +151,8 @@ function dt() {
|
|
|
153
151
|
return v() > 1;
|
|
154
152
|
},
|
|
155
153
|
get children() {
|
|
156
|
-
var t =
|
|
157
|
-
return
|
|
154
|
+
var t = y();
|
|
155
|
+
return a(t, v), u(() => $(t, f(
|
|
158
156
|
"absolute -top-2 -right-2",
|
|
159
157
|
"min-w-[20px] h-5 px-1.5 rounded-full",
|
|
160
158
|
"bg-foreground text-background",
|
|
@@ -175,18 +173,18 @@ function dt() {
|
|
|
175
173
|
}
|
|
176
174
|
});
|
|
177
175
|
}
|
|
178
|
-
function
|
|
176
|
+
function Z(g) {
|
|
179
177
|
return (() => {
|
|
180
|
-
var n =
|
|
178
|
+
var n = K();
|
|
181
179
|
return u(() => A(n, "class", g.class)), n;
|
|
182
180
|
})();
|
|
183
181
|
}
|
|
184
|
-
function
|
|
182
|
+
function tt(g) {
|
|
185
183
|
return (() => {
|
|
186
|
-
var n =
|
|
184
|
+
var n = L();
|
|
187
185
|
return u(() => A(n, "class", g.class)), n;
|
|
188
186
|
})();
|
|
189
187
|
}
|
|
190
188
|
export {
|
|
191
|
-
|
|
189
|
+
at as DragPreview
|
|
192
190
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { addEventListener as se, use as W, insert as w, createComponent as b, effect as Y, setStyleProperty as X, className as G, template as C, spread as
|
|
2
|
-
import { createSignal as q, createMemo as j, createEffect as
|
|
1
|
+
import { addEventListener as se, use as W, insert as w, createComponent as b, effect as Y, setStyleProperty as X, className as G, template as C, spread as ce, mergeProps as de, setAttribute as ge, memo as ue, delegateEvents as me } from "solid-js/web";
|
|
2
|
+
import { createSignal as q, createMemo as j, createEffect as fe, Show as A, For as J, untrack as he, onCleanup as ve } from "solid-js";
|
|
3
3
|
import { cn as $ } from "../../utils/cn.js";
|
|
4
|
-
import { useResizeObserver as
|
|
5
|
-
import { useVirtualWindow as
|
|
4
|
+
import { useResizeObserver as xe } from "../../hooks/useResizeObserver.js";
|
|
5
|
+
import { useVirtualWindow as be } from "../../hooks/useVirtualWindow.js";
|
|
6
6
|
import { useFileBrowser as Z } from "./FileBrowserContext.js";
|
|
7
|
-
import { useFileBrowserDrag as
|
|
8
|
-
import {
|
|
9
|
-
import { createLongPressContextMenuHandlers as
|
|
10
|
-
import { fileBrowserTouchTargetAttrs as
|
|
11
|
-
var
|
|
12
|
-
function
|
|
7
|
+
import { useFileBrowserDrag as Ce } from "../../context/FileBrowserDragContext.js";
|
|
8
|
+
import { FileItemIcon as De } from "./FileIcons.js";
|
|
9
|
+
import { createLongPressContextMenuHandlers as Ie } from "./longPressContextMenu.js";
|
|
10
|
+
import { fileBrowserTouchTargetAttrs as we } from "./touchInteractionGuard.js";
|
|
11
|
+
var ye = /* @__PURE__ */ C('<mark class="bg-warning/40 text-inherit rounded-sm">'), Pe = /* @__PURE__ */ C('<div class="grid gap-2">'), Se = /* @__PURE__ */ C('<div><div class=p-3><div class="w-full h-0"aria-hidden=true>'), Me = /* @__PURE__ */ C('<span>No files matching "<!>"'), Te = /* @__PURE__ */ C('<button type=button class="px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors">Clear Filter'), _e = /* @__PURE__ */ C('<div class="flex flex-col items-center justify-center h-32 gap-2 text-xs text-muted-foreground">'), Ee = /* @__PURE__ */ C("<span>This folder is empty"), Le = /* @__PURE__ */ C('<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">'), $e = /* @__PURE__ */ C("<button type=button><div></div><span></span><div>");
|
|
12
|
+
function ke(e) {
|
|
13
13
|
const n = j(() => {
|
|
14
14
|
if (!e.match || e.match.matchedIndices.length === 0)
|
|
15
15
|
return [{
|
|
@@ -39,60 +39,60 @@ function Re(e) {
|
|
|
39
39
|
return o.highlight;
|
|
40
40
|
},
|
|
41
41
|
get fallback() {
|
|
42
|
-
return
|
|
42
|
+
return ue(() => o.text);
|
|
43
43
|
},
|
|
44
44
|
get children() {
|
|
45
|
-
var D =
|
|
45
|
+
var D = ye();
|
|
46
46
|
return w(D, () => o.text), D;
|
|
47
47
|
}
|
|
48
48
|
})
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const n = Z(), o =
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const x = Math.floor((
|
|
51
|
+
function je(e) {
|
|
52
|
+
const n = Z(), o = Ce(), D = () => (e.enableDragDrop ?? !0) && !!o, h = () => e.instanceId ?? "default", u = 112, l = 8, f = 180, y = 2, E = 6, [m, O] = q(null), p = xe(m), v = j(() => {
|
|
53
|
+
const c = p()?.width ?? 0;
|
|
54
|
+
if (c <= 0) return y;
|
|
55
|
+
const x = Math.floor((c + l) / (f + l));
|
|
56
56
|
return Math.max(y, Math.min(E, x));
|
|
57
|
-
}), k = () => u + l,
|
|
57
|
+
}), k = () => u + l, s = be({
|
|
58
58
|
count: () => Math.ceil(n.currentFiles().length / Math.max(1, v())),
|
|
59
59
|
itemSize: k,
|
|
60
60
|
overscan: 2
|
|
61
|
-
}), N = () =>
|
|
61
|
+
}), N = () => s.range().start * v(), L = () => Math.min(n.currentFiles().length, s.range().end * v()), F = j(() => n.currentFiles().slice(N(), L()));
|
|
62
62
|
let _ = null, P = y;
|
|
63
|
-
return
|
|
64
|
-
const
|
|
63
|
+
return fe(() => {
|
|
64
|
+
const c = v();
|
|
65
65
|
if (!_) {
|
|
66
|
-
P =
|
|
66
|
+
P = c;
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
if (
|
|
70
|
-
const x = k(), a = Math.floor(_.scrollTop / Math.max(1, x)) * Math.max(1, P), r = Math.floor(a / Math.max(1,
|
|
71
|
-
_.scrollTop = r * x,
|
|
69
|
+
if (c === P) return;
|
|
70
|
+
const x = k(), a = Math.floor(_.scrollTop / Math.max(1, x)) * Math.max(1, P), r = Math.floor(a / Math.max(1, c));
|
|
71
|
+
_.scrollTop = r * x, s.onScroll(), P = c;
|
|
72
72
|
}), (() => {
|
|
73
|
-
var
|
|
74
|
-
return se(
|
|
75
|
-
_ = a,
|
|
76
|
-
},
|
|
73
|
+
var c = Se(), x = c.firstChild, S = x.firstChild;
|
|
74
|
+
return se(c, "scroll", s.onScroll), W((a) => {
|
|
75
|
+
_ = a, s.scrollRef(a), n.setScrollContainer(a);
|
|
76
|
+
}, c), W((a) => O(a), S), w(x, b(A, {
|
|
77
77
|
get when() {
|
|
78
78
|
return n.currentFiles().length > 0;
|
|
79
79
|
},
|
|
80
80
|
get fallback() {
|
|
81
81
|
return (() => {
|
|
82
|
-
var a =
|
|
82
|
+
var a = _e();
|
|
83
83
|
return w(a, b(A, {
|
|
84
84
|
get when() {
|
|
85
85
|
return n.filterQueryApplied().trim();
|
|
86
86
|
},
|
|
87
87
|
get fallback() {
|
|
88
|
-
return
|
|
88
|
+
return Ee();
|
|
89
89
|
},
|
|
90
90
|
get children() {
|
|
91
91
|
return [(() => {
|
|
92
|
-
var r =
|
|
92
|
+
var r = Me(), M = r.firstChild, I = M.nextSibling;
|
|
93
93
|
return I.nextSibling, w(r, () => n.filterQueryApplied(), I), r;
|
|
94
94
|
})(), (() => {
|
|
95
|
-
var r =
|
|
95
|
+
var r = Te();
|
|
96
96
|
return r.$$click = () => n.setFilterQuery(""), r;
|
|
97
97
|
})()];
|
|
98
98
|
}
|
|
@@ -100,12 +100,12 @@ function ze(e) {
|
|
|
100
100
|
})();
|
|
101
101
|
},
|
|
102
102
|
get children() {
|
|
103
|
-
var a =
|
|
103
|
+
var a = Pe();
|
|
104
104
|
return w(a, b(J, {
|
|
105
105
|
get each() {
|
|
106
106
|
return F();
|
|
107
107
|
},
|
|
108
|
-
children: (r) => b(
|
|
108
|
+
children: (r) => b(Fe, {
|
|
109
109
|
item: r,
|
|
110
110
|
get instanceId() {
|
|
111
111
|
return h();
|
|
@@ -116,7 +116,7 @@ function ze(e) {
|
|
|
116
116
|
dragContext: o
|
|
117
117
|
})
|
|
118
118
|
})), Y((r) => {
|
|
119
|
-
var M = `repeat(${v()}, minmax(0, 1fr))`, I = `${
|
|
119
|
+
var M = `repeat(${v()}, minmax(0, 1fr))`, I = `${s.paddingTop()}px`, H = `${s.paddingBottom()}px`;
|
|
120
120
|
return M !== r.e && X(a, "grid-template-columns", r.e = M), I !== r.t && X(a, "padding-top", r.t = I), H !== r.a && X(a, "padding-bottom", r.a = H), r;
|
|
121
121
|
}, {
|
|
122
122
|
e: void 0,
|
|
@@ -124,15 +124,15 @@ function ze(e) {
|
|
|
124
124
|
a: void 0
|
|
125
125
|
}), a;
|
|
126
126
|
}
|
|
127
|
-
}), null), Y(() => G(
|
|
127
|
+
}), null), Y(() => G(c, $("h-full min-h-0 overflow-auto", e.class))), c;
|
|
128
128
|
})();
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
const n = Z(), o = () => n.isSelected(e.item.id), D = () => n.getFilterMatchForId(e.item.id), h =
|
|
130
|
+
function Fe(e) {
|
|
131
|
+
const n = Z(), o = () => n.isSelected(e.item.id), D = () => n.getFilterMatchForId(e.item.id), h = he(() => e.item), u = Ie(n, h);
|
|
132
132
|
let l, f = null, y = 0, E = 0, m = !1;
|
|
133
133
|
const O = 5, p = 500;
|
|
134
134
|
let v = null;
|
|
135
|
-
const [k, B] = q(!1),
|
|
135
|
+
const [k, B] = q(!1), s = () => l === "touch" || l === "pen", N = () => e.item.type === "folder", L = () => N() && e.enableDragDrop && e.dragContext, F = () => {
|
|
136
136
|
if (!L() || !e.dragContext) return !1;
|
|
137
137
|
const t = e.dragContext.dragState();
|
|
138
138
|
return t.isDragging ? e.dragContext.canDropOn(t.draggedItems, e.item.path, e.item, e.instanceId) : !1;
|
|
@@ -142,14 +142,14 @@ function Xe(e) {
|
|
|
142
142
|
return t.isDragging ? t.draggedItems.some((i) => i.item.id === e.item.id) : !1;
|
|
143
143
|
}, P = () => {
|
|
144
144
|
v !== null && (clearTimeout(v), v = null);
|
|
145
|
-
},
|
|
145
|
+
}, c = () => {
|
|
146
146
|
typeof document > "u" || (document.removeEventListener("pointermove", r, !0), document.removeEventListener("pointerup", M, !0), document.removeEventListener("pointercancel", I, !0));
|
|
147
147
|
}, x = () => {
|
|
148
148
|
typeof document > "u" || (document.addEventListener("pointermove", r, !0), document.addEventListener("pointerup", M, !0), document.addEventListener("pointercancel", I, !0));
|
|
149
149
|
}, S = (t) => {
|
|
150
|
-
P(),
|
|
150
|
+
P(), c(), m && e.dragContext && e.dragContext.endDrag(t), f = null, m = !1;
|
|
151
151
|
};
|
|
152
|
-
|
|
152
|
+
ve(() => {
|
|
153
153
|
S(!1);
|
|
154
154
|
});
|
|
155
155
|
const a = (t, i) => {
|
|
@@ -160,7 +160,7 @@ function Xe(e) {
|
|
|
160
160
|
sourceInstanceId: e.instanceId,
|
|
161
161
|
sourcePath: n.currentPath()
|
|
162
162
|
}));
|
|
163
|
-
if (
|
|
163
|
+
if (s() && "vibrate" in navigator)
|
|
164
164
|
try {
|
|
165
165
|
navigator.vibrate(50);
|
|
166
166
|
} catch {
|
|
@@ -169,17 +169,17 @@ function Xe(e) {
|
|
|
169
169
|
}, r = (t) => {
|
|
170
170
|
if (f !== t.pointerId) return;
|
|
171
171
|
const i = t.clientX - y, g = t.clientY - E, T = Math.sqrt(i * i + g * g);
|
|
172
|
-
if (
|
|
172
|
+
if (s() && !m && T > 10) {
|
|
173
173
|
S(!1);
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
!
|
|
176
|
+
!s() && !m && T > O && a(t.clientX, t.clientY), m && e.dragContext && e.dragContext.updateDrag(t.clientX, t.clientY);
|
|
177
177
|
}, M = (t) => {
|
|
178
178
|
f === t.pointerId && (u.onPointerUp(), S(!0));
|
|
179
179
|
}, I = (t) => {
|
|
180
180
|
f === t.pointerId && (u.onPointerCancel(), S(!1));
|
|
181
181
|
}, H = (t) => {
|
|
182
|
-
l = t.pointerType, u.onPointerDown(t), !(t.pointerType === "mouse" && t.button !== 0) && (!e.enableDragDrop || !e.dragContext || (f = t.pointerId, y = t.clientX, E = t.clientY, m = !1, x(),
|
|
182
|
+
l = t.pointerType, u.onPointerDown(t), !(t.pointerType === "mouse" && t.button !== 0) && (!e.enableDragDrop || !e.dragContext || (f = t.pointerId, y = t.clientX, E = t.clientY, m = !1, x(), s() && (P(), v = setTimeout(() => {
|
|
183
183
|
f !== null && !m && a(y, E);
|
|
184
184
|
}, p))));
|
|
185
185
|
}, ee = (t) => {
|
|
@@ -206,16 +206,16 @@ function Xe(e) {
|
|
|
206
206
|
return;
|
|
207
207
|
}
|
|
208
208
|
if (!u.consumeClickSuppression(t)) {
|
|
209
|
-
if (
|
|
209
|
+
if (s()) {
|
|
210
210
|
n.openItem(e.item);
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
213
|
n.selectItem(e.item.id, t.metaKey || t.ctrlKey);
|
|
214
214
|
}
|
|
215
215
|
}, ie = () => {
|
|
216
|
-
|
|
216
|
+
s() || n.openItem(e.item);
|
|
217
217
|
}, ae = (t) => {
|
|
218
|
-
if (t.preventDefault(), t.stopPropagation(),
|
|
218
|
+
if (t.preventDefault(), t.stopPropagation(), s()) return;
|
|
219
219
|
o() || n.selectItem(e.item.id, !1);
|
|
220
220
|
const i = n.getSelectedItemsList(), g = i.length > 0 ? i : [e.item];
|
|
221
221
|
n.showContextMenu({
|
|
@@ -223,10 +223,10 @@ function Xe(e) {
|
|
|
223
223
|
y: t.clientY,
|
|
224
224
|
items: g
|
|
225
225
|
});
|
|
226
|
-
}, oe = () => e.
|
|
226
|
+
}, oe = () => e.dragContext?.dragState(), le = () => oe()?.isDragging ?? !1, U = () => k() && le() && L();
|
|
227
227
|
return (() => {
|
|
228
|
-
var t =
|
|
229
|
-
return
|
|
228
|
+
var t = $e(), i = t.firstChild, g = i.nextSibling, T = g.nextSibling;
|
|
229
|
+
return ce(t, de(we, {
|
|
230
230
|
onClick: re,
|
|
231
231
|
onDblClick: ie,
|
|
232
232
|
onContextMenu: ae,
|
|
@@ -254,14 +254,14 @@ function Xe(e) {
|
|
|
254
254
|
return o();
|
|
255
255
|
},
|
|
256
256
|
get children() {
|
|
257
|
-
return
|
|
257
|
+
return Le();
|
|
258
258
|
}
|
|
259
|
-
}), i), w(i, b(
|
|
260
|
-
get
|
|
261
|
-
return
|
|
259
|
+
}), i), w(i, b(De, {
|
|
260
|
+
get item() {
|
|
261
|
+
return e.item;
|
|
262
262
|
},
|
|
263
263
|
class: "w-8 h-8"
|
|
264
|
-
})), w(g, b(
|
|
264
|
+
})), w(g, b(ke, {
|
|
265
265
|
get name() {
|
|
266
266
|
return e.item.name;
|
|
267
267
|
},
|
|
@@ -270,7 +270,7 @@ function Xe(e) {
|
|
|
270
270
|
}
|
|
271
271
|
})), Y((d) => {
|
|
272
272
|
var R = $("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"), V = $("text-xs text-center line-clamp-2 w-full px-1", "transition-colors duration-150", o() && "font-medium"), z = e.item.name, Q = $("absolute inset-0 rounded-lg opacity-0 transition-opacity duration-300", "group-hover:opacity-100", "pointer-events-none"), K = 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%)";
|
|
273
|
-
return R !== d.e && G(i, d.e = R), V !== d.t && G(g, d.t = V), z !== d.a &&
|
|
273
|
+
return R !== d.e && G(i, d.e = R), V !== d.t && G(g, d.t = V), z !== d.a && ge(g, "title", d.a = z), Q !== d.o && G(T, d.o = Q), K !== d.i && X(T, "background", d.i = K), d;
|
|
274
274
|
}, {
|
|
275
275
|
e: void 0,
|
|
276
276
|
t: void 0,
|
|
@@ -280,7 +280,7 @@ function Xe(e) {
|
|
|
280
280
|
}), t;
|
|
281
281
|
})();
|
|
282
282
|
}
|
|
283
|
-
|
|
283
|
+
me(["click"]);
|
|
284
284
|
export {
|
|
285
|
-
|
|
285
|
+
je as FileGridView
|
|
286
286
|
};
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import { type JSX } from 'solid-js';
|
|
2
|
-
|
|
1
|
+
import { type Component, type JSX } from 'solid-js';
|
|
2
|
+
import type { FileItem } from './types';
|
|
3
|
+
export interface FileIconProps {
|
|
3
4
|
class?: string;
|
|
4
5
|
}
|
|
6
|
+
type FileIconComponent = Component<FileIconProps>;
|
|
7
|
+
type ResolvableFileIcon = Pick<FileItem, 'name' | 'type' | 'extension' | 'icon'>;
|
|
8
|
+
export type FileItemIconRenderer = FileIconComponent | JSX.Element;
|
|
5
9
|
export declare const FolderIcon: (props: FileIconProps) => JSX.Element;
|
|
6
10
|
export declare const FolderOpenIcon: (props: FileIconProps) => JSX.Element;
|
|
7
11
|
export declare const FileIcon: (props: FileIconProps) => JSX.Element;
|
|
8
12
|
export declare const CodeFileIcon: (props: FileIconProps) => JSX.Element;
|
|
9
|
-
export declare const
|
|
13
|
+
export declare const JavaScriptFileIcon: FileIconComponent;
|
|
14
|
+
export declare const TypeScriptFileIcon: FileIconComponent;
|
|
15
|
+
export declare const ShellScriptFileIcon: FileIconComponent;
|
|
10
16
|
export declare const ImageFileIcon: (props: FileIconProps) => JSX.Element;
|
|
11
17
|
export declare const DocumentFileIcon: (props: FileIconProps) => JSX.Element;
|
|
12
18
|
export declare const ConfigFileIcon: (props: FileIconProps) => JSX.Element;
|
|
13
19
|
export declare const StyleFileIcon: (props: FileIconProps) => JSX.Element;
|
|
14
|
-
export declare function getFileIcon(extension?: string):
|
|
20
|
+
export declare function getFileIcon(extension?: string): FileIconComponent;
|
|
21
|
+
export declare function resolveFileItemIcon(item: ResolvableFileIcon): FileItemIconRenderer;
|
|
22
|
+
export declare function FileItemIcon(props: {
|
|
23
|
+
item: ResolvableFileIcon;
|
|
24
|
+
class?: string;
|
|
25
|
+
}): JSX.Element;
|
|
15
26
|
export {};
|