@floegence/floe-webapp-core 0.35.13 → 0.35.15
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/deck/WidgetResizeHandle.js +34 -33
- package/dist/components/file-browser/FileBrowser.js +77 -70
- package/dist/components/file-browser/FileBrowserContext.js +141 -140
- package/dist/components/file-browser/types.d.ts +1 -0
- package/dist/components/layout/ActivityBar.js +21 -21
- package/dist/components/layout/MobileTabBar.js +12 -12
- package/dist/components/layout/ResizeHandle.d.ts +2 -0
- package/dist/components/layout/ResizeHandle.js +38 -37
- package/dist/components/layout/Shell.js +164 -140
- package/dist/components/layout/Sidebar.js +8 -8
- package/dist/components/layout/SidebarPane.d.ts +2 -0
- package/dist/components/layout/SidebarPane.js +22 -16
- package/dist/components/ui/CommandPalette.js +47 -46
- package/dist/components/ui/FloatingWindow.d.ts +5 -1
- package/dist/components/ui/FloatingWindow.js +267 -194
- package/dist/components/ui/floatingWindowGeometry.d.ts +41 -0
- package/dist/components/ui/floatingWindowGeometry.js +65 -0
- package/dist/context/FileBrowserDragContext.js +45 -43
- package/dist/context/LayoutContext.d.ts +1 -0
- package/dist/context/LayoutContext.js +20 -19
- package/dist/floe.css +19 -0
- package/dist/hooks/useDeckDrag.js +39 -35
- package/dist/hooks/useFileBrowserDrag.js +74 -81
- package/dist/styles.css +1 -1
- package/dist/utils/hotInteraction.d.ts +9 -0
- package/dist/utils/hotInteraction.js +34 -0
- package/package.json +10 -10
- package/LICENSE +0 -21
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createSignal as p, createEffect as I, createMemo as
|
|
3
|
-
import { createStore as
|
|
4
|
-
import { useResolvedFloeConfig as
|
|
5
|
-
import { deferAfterPaint as
|
|
6
|
-
const ye =
|
|
1
|
+
import { createComponent as St } from "solid-js/web";
|
|
2
|
+
import { createSignal as p, createEffect as I, createMemo as D, useContext as gt, createContext as It, untrack as wt } from "solid-js";
|
|
3
|
+
import { createStore as le, produce as de } from "solid-js/store";
|
|
4
|
+
import { useResolvedFloeConfig as yt } from "../../context/FloeConfigContext.js";
|
|
5
|
+
import { deferAfterPaint as xt, deferNonBlocking as y } from "../../utils/defer.js";
|
|
6
|
+
const ye = It(), E = {
|
|
7
7
|
name: 0.65,
|
|
8
8
|
modifiedAt: 0.2,
|
|
9
9
|
size: 0.15
|
|
10
|
-
},
|
|
11
|
-
function
|
|
10
|
+
}, fe = "fileBrowser:listColumnRatios", ue = 220, Ct = "fileBrowser:sidebarWidth", Pt = 160, At = 520, me = "fileBrowser:viewMode", he = "fileBrowser:sortConfig", pe = "fileBrowser:expandedFolders", Se = "fileBrowser:sidebarCollapsed";
|
|
11
|
+
function N(n, i) {
|
|
12
12
|
const o = typeof n == "number" && Number.isFinite(n) ? n : i;
|
|
13
|
-
return Math.max(
|
|
13
|
+
return Math.max(Pt, Math.min(At, Math.round(o)));
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Et(n, i) {
|
|
16
16
|
return n === "list" || n === "grid" ? n : i;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function bt(n, i) {
|
|
19
19
|
if (!n || typeof n != "object") return i;
|
|
20
20
|
const o = n, d = o.field, l = o.direction;
|
|
21
21
|
return !(d === "name" || d === "size" || d === "modifiedAt" || d === "type") || !(l === "asc" || l === "desc") ? i : {
|
|
@@ -23,7 +23,7 @@ function Et(n, i) {
|
|
|
23
23
|
direction: l
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Mt(n) {
|
|
27
27
|
if (!Array.isArray(n)) return ["/"];
|
|
28
28
|
const i = [], o = /* @__PURE__ */ new Set();
|
|
29
29
|
for (const d of n) {
|
|
@@ -33,7 +33,7 @@ function bt(n) {
|
|
|
33
33
|
}
|
|
34
34
|
return o.has("/") || i.unshift("/"), i;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Ft(n) {
|
|
37
37
|
const i = [], o = /* @__PURE__ */ new Set();
|
|
38
38
|
for (const d of n) {
|
|
39
39
|
if (typeof d != "string") continue;
|
|
@@ -48,7 +48,7 @@ function ge(n) {
|
|
|
48
48
|
i[o] = !0;
|
|
49
49
|
return i;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function Lt(n, i) {
|
|
52
52
|
if (n.length !== i.length) return !1;
|
|
53
53
|
for (let o = 0; o < n.length; o += 1)
|
|
54
54
|
if (n[o] !== i[o]) return !1;
|
|
@@ -73,71 +73,71 @@ function we(n, i) {
|
|
|
73
73
|
}
|
|
74
74
|
return o;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
const i =
|
|
76
|
+
function Dt(n) {
|
|
77
|
+
const i = yt(), o = (e) => {
|
|
78
78
|
const t = (e ?? "").trim();
|
|
79
79
|
return t === "" ? "/" : t;
|
|
80
|
-
}, d = (n.persistenceKey ?? "").trim(), l = !!d, u = (e) => d ? `${d}:${e}` : e, x = l ?
|
|
80
|
+
}, d = (n.persistenceKey ?? "").trim(), l = !!d, u = (e) => d ? `${d}:${e}` : e, x = l ? Et(i.persist.load(u(me), n.initialViewMode ?? "list"), n.initialViewMode ?? "list") : n.initialViewMode ?? "list", g = {
|
|
81
81
|
field: "name",
|
|
82
82
|
direction: "asc"
|
|
83
|
-
}, xe = l ?
|
|
84
|
-
let
|
|
83
|
+
}, xe = l ? bt(i.persist.load(u(he), g), g) : g, W = l ? Mt(i.persist.load(u(pe), ["/"])) : ["/"], Ce = l ? i.persist.load(u(Se), !1) === !0 : !1, Pe = () => typeof n.path == "string" ? o(n.path) : o(n.initialPath ?? "/"), [C, k] = p(Pe()), [K, Ae] = le({}), [b, Ee] = p([]), [U, be] = p(x), [F, Me] = p(xe), Fe = Ie(i.persist.load(fe, n.initialListColumnRatios ?? E)), [V, Le] = p(Fe), G = (n.sidebarWidthStorageKey ?? "").trim() || Ct, _e = N(i.persist.load(G, n.initialSidebarWidth ?? ue), n.initialSidebarWidth ?? ue), [L, ve] = p(_e), [_, q] = le(ge(W)), [X, Y] = p(W), [j, Be] = p(Ce), [Re, Q] = p(null), [H, $] = p(""), [v, B] = p(""), [Oe, J] = p(!1);
|
|
84
|
+
let R = 0;
|
|
85
85
|
I(() => {
|
|
86
|
-
const e =
|
|
87
|
-
|
|
88
|
-
const t =
|
|
86
|
+
const e = H().trim();
|
|
87
|
+
R += 1;
|
|
88
|
+
const t = R;
|
|
89
89
|
if (!e) {
|
|
90
|
-
|
|
90
|
+
B("");
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
t ===
|
|
93
|
+
xt(() => {
|
|
94
|
+
t === R && B(e);
|
|
95
95
|
});
|
|
96
96
|
}), I(() => {
|
|
97
|
-
i.persist.debouncedSave(
|
|
97
|
+
i.persist.debouncedSave(fe, V());
|
|
98
98
|
}), I(() => {
|
|
99
|
-
i.persist.debouncedSave(
|
|
99
|
+
i.persist.debouncedSave(G, L());
|
|
100
100
|
}), I(() => {
|
|
101
|
-
l && i.persist.debouncedSave(u(
|
|
101
|
+
l && i.persist.debouncedSave(u(me), U());
|
|
102
102
|
}), I(() => {
|
|
103
|
-
l && i.persist.debouncedSave(u(
|
|
103
|
+
l && i.persist.debouncedSave(u(he), F());
|
|
104
104
|
}), I(() => {
|
|
105
105
|
if (!l) return;
|
|
106
|
-
const e = [...
|
|
107
|
-
i.persist.debouncedSave(u(
|
|
106
|
+
const e = [...X()].sort((t, r) => t.localeCompare(r));
|
|
107
|
+
i.persist.debouncedSave(u(pe), e);
|
|
108
108
|
}), I(() => {
|
|
109
|
-
l && i.persist.debouncedSave(u(
|
|
109
|
+
l && i.persist.debouncedSave(u(Se), j());
|
|
110
110
|
});
|
|
111
|
-
const Te = (e) => be(e), ze = (e) => Me(e), De = () => n.homeLabel ?? "Root",
|
|
112
|
-
const t =
|
|
113
|
-
Ae(
|
|
111
|
+
const Te = (e) => be(e), ze = (e) => Me(e), De = (e) => N(e, L()), Ne = () => n.homeLabel ?? "Root", We = () => new Set(b()), ke = () => new Set(X()), M = (e) => {
|
|
112
|
+
const t = Ft(e), r = ge(t);
|
|
113
|
+
Ae(de((s) => {
|
|
114
114
|
for (const c of Object.keys(s))
|
|
115
115
|
c in r || delete s[c];
|
|
116
116
|
for (const c of t)
|
|
117
117
|
s[c] = !0;
|
|
118
|
-
})), Ee((s) =>
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
if (
|
|
123
|
-
|
|
118
|
+
})), Ee((s) => Lt(s, t) ? s : t);
|
|
119
|
+
}, Z = (e) => {
|
|
120
|
+
_[e] !== !0 && (q(e, !0), Y((t) => t.includes(e) ? t : [...t, e]));
|
|
121
|
+
}, Ke = (e) => {
|
|
122
|
+
if (_[e] === !0) {
|
|
123
|
+
q(de((t) => {
|
|
124
124
|
delete t[e];
|
|
125
|
-
})),
|
|
125
|
+
})), Y((t) => t.filter((r) => r !== e));
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
}, [
|
|
130
|
-
let w = null,
|
|
128
|
+
Z(e);
|
|
129
|
+
}, [ee, P] = p([]);
|
|
130
|
+
let w = null, O = {
|
|
131
131
|
top: 0,
|
|
132
132
|
left: 0
|
|
133
133
|
};
|
|
134
|
-
const
|
|
134
|
+
const te = () => n.files, ne = (e) => {
|
|
135
135
|
const t = o(e);
|
|
136
136
|
if (t === "/") return "/";
|
|
137
137
|
const r = t.split("/").filter(Boolean);
|
|
138
138
|
return r.pop(), r.length ? "/" + r.join("/") : "/";
|
|
139
|
-
},
|
|
140
|
-
const r =
|
|
139
|
+
}, Ue = (e, t) => {
|
|
140
|
+
const r = ee();
|
|
141
141
|
if (r.length === 0) return e;
|
|
142
142
|
let s = [...e];
|
|
143
143
|
const c = o(t);
|
|
@@ -152,13 +152,13 @@ function zt(n) {
|
|
|
152
152
|
const m = o(a.oldPath), f = s.findIndex((S) => o(S.path) === m);
|
|
153
153
|
if (f !== -1) {
|
|
154
154
|
const S = a.updates.path ?? s[f].path;
|
|
155
|
-
|
|
155
|
+
ne(S) === c ? s[f] = {
|
|
156
156
|
...s[f],
|
|
157
157
|
...a.updates
|
|
158
158
|
} : s.splice(f, 1);
|
|
159
159
|
} else {
|
|
160
160
|
const S = a.updates.path;
|
|
161
|
-
S &&
|
|
161
|
+
S && ne(S);
|
|
162
162
|
}
|
|
163
163
|
break;
|
|
164
164
|
}
|
|
@@ -168,16 +168,16 @@ function zt(n) {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
return s;
|
|
171
|
-
},
|
|
171
|
+
}, Ve = D(() => {
|
|
172
172
|
const e = /* @__PURE__ */ new Map(), t = (s) => {
|
|
173
173
|
for (const c of s)
|
|
174
174
|
c.type === "folder" && (e.set(o(c.path), c.children ?? []), c.children?.length && t(c.children));
|
|
175
|
-
}, r =
|
|
175
|
+
}, r = te();
|
|
176
176
|
return e.set("/", r), t(r), e;
|
|
177
|
-
}),
|
|
177
|
+
}), Ge = D(() => {
|
|
178
178
|
const e = o(C());
|
|
179
|
-
let t =
|
|
180
|
-
t =
|
|
179
|
+
let t = Ve().get(e) ?? [];
|
|
180
|
+
t = Ue(t, e);
|
|
181
181
|
const r = F(), s = [...t].sort((a, m) => {
|
|
182
182
|
if (a.type !== m.type) return a.type === "folder" ? -1 : 1;
|
|
183
183
|
let f = 0;
|
|
@@ -203,11 +203,11 @@ function zt(n) {
|
|
|
203
203
|
items: s,
|
|
204
204
|
nameLowerById: c
|
|
205
205
|
};
|
|
206
|
-
}),
|
|
206
|
+
}), T = D(() => {
|
|
207
207
|
const {
|
|
208
208
|
items: e,
|
|
209
209
|
nameLowerById: t
|
|
210
|
-
} =
|
|
210
|
+
} = Ge(), s = v().trim().toLowerCase(), c = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
211
211
|
if (!s) {
|
|
212
212
|
for (let h = 0; h < e.length; h++) {
|
|
213
213
|
const A = e[h];
|
|
@@ -223,9 +223,9 @@ function zt(n) {
|
|
|
223
223
|
const f = [];
|
|
224
224
|
let S = 0;
|
|
225
225
|
for (const h of e) {
|
|
226
|
-
const A = t.get(h.id) ?? h.name.toLowerCase(),
|
|
227
|
-
|
|
228
|
-
matchedIndices:
|
|
226
|
+
const A = t.get(h.id) ?? h.name.toLowerCase(), ae = we(A, s);
|
|
227
|
+
ae && (f.push(h), c.set(h.id, {
|
|
228
|
+
matchedIndices: ae
|
|
229
229
|
}), a.set(h.id, h), m.set(h.id, S), S += 1);
|
|
230
230
|
}
|
|
231
231
|
return {
|
|
@@ -234,8 +234,8 @@ function zt(n) {
|
|
|
234
234
|
fileById: a,
|
|
235
235
|
indexById: m
|
|
236
236
|
};
|
|
237
|
-
}),
|
|
238
|
-
const t =
|
|
237
|
+
}), qe = () => T().items, oe = (e) => {
|
|
238
|
+
const t = T(), r = [];
|
|
239
239
|
for (const s of e) {
|
|
240
240
|
const c = t.fileById.get(s);
|
|
241
241
|
if (!c) continue;
|
|
@@ -246,166 +246,167 @@ function zt(n) {
|
|
|
246
246
|
});
|
|
247
247
|
}
|
|
248
248
|
return r.sort((s, c) => s.index - c.index), r.map((s) => s.item);
|
|
249
|
-
},
|
|
250
|
-
M([]),
|
|
249
|
+
}, ie = () => {
|
|
250
|
+
M([]), $(""), B(""), J(!1);
|
|
251
251
|
const e = n.onSelect;
|
|
252
252
|
y(() => e?.([]));
|
|
253
253
|
};
|
|
254
254
|
I(() => {
|
|
255
255
|
if (typeof n.path != "string") return;
|
|
256
256
|
const e = o(n.path);
|
|
257
|
-
e !== C() && (
|
|
257
|
+
e !== C() && (k(e), ie());
|
|
258
258
|
});
|
|
259
|
-
const
|
|
259
|
+
const z = (e) => {
|
|
260
260
|
const t = o(e);
|
|
261
261
|
if (t === C()) return;
|
|
262
|
-
|
|
262
|
+
k(t), ie();
|
|
263
263
|
const r = n.onNavigate;
|
|
264
264
|
y(() => r?.(t));
|
|
265
265
|
const s = n.onPathChange;
|
|
266
266
|
y(() => s?.(t, "user"));
|
|
267
|
-
},
|
|
267
|
+
}, Xe = (e) => {
|
|
268
268
|
Le(Ie(e));
|
|
269
|
-
},
|
|
269
|
+
}, Ye = () => {
|
|
270
270
|
const e = C();
|
|
271
271
|
if (e === "/" || e === "") return;
|
|
272
272
|
const t = e.split("/").filter(Boolean);
|
|
273
|
-
t.pop(),
|
|
274
|
-
},
|
|
275
|
-
e.type === "folder" && (
|
|
276
|
-
},
|
|
277
|
-
const r = t ?
|
|
273
|
+
t.pop(), z(t.length ? "/" + t.join("/") : "/");
|
|
274
|
+
}, se = (e) => {
|
|
275
|
+
e.type === "folder" && (z(e.path), Z(e.path));
|
|
276
|
+
}, je = (e, t = !1) => {
|
|
277
|
+
const r = t ? K[e] === !0 ? b().filter((c) => c !== e) : [...b(), e] : [e];
|
|
278
278
|
M(r);
|
|
279
279
|
const s = n.onSelect;
|
|
280
280
|
if (s) {
|
|
281
281
|
const c = [...r];
|
|
282
282
|
y(() => {
|
|
283
|
-
const a =
|
|
283
|
+
const a = wt(() => oe(c));
|
|
284
284
|
s(a);
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
},
|
|
287
|
+
}, Qe = () => {
|
|
288
288
|
M([]);
|
|
289
289
|
const e = n.onSelect;
|
|
290
290
|
y(() => e?.([]));
|
|
291
|
-
},
|
|
292
|
-
ve((t) =>
|
|
293
|
-
},
|
|
294
|
-
|
|
295
|
-
},
|
|
296
|
-
const t =
|
|
291
|
+
}, He = (e) => K[e] === !0, $e = (e) => Ke(e), Je = (e) => _[e] === !0, Ze = () => Be((e) => !e), et = (e) => {
|
|
292
|
+
ve((t) => N(e, t));
|
|
293
|
+
}, tt = (e) => Q(e), nt = () => Q(null), ot = (e) => {
|
|
294
|
+
$(e);
|
|
295
|
+
}, it = (e) => {
|
|
296
|
+
const t = v().trim();
|
|
297
297
|
if (!t) return null;
|
|
298
298
|
const r = we(e.toLowerCase(), t.toLowerCase());
|
|
299
299
|
return r ? {
|
|
300
300
|
matchedIndices: r
|
|
301
301
|
} : null;
|
|
302
|
-
},
|
|
302
|
+
}, st = (e) => T().matchById.get(e) ?? null, rt = () => oe(b()), ct = (e) => {
|
|
303
303
|
if (e.type === "folder")
|
|
304
|
-
|
|
304
|
+
se(e);
|
|
305
305
|
else {
|
|
306
306
|
const t = n.onOpen;
|
|
307
307
|
y(() => t?.(e));
|
|
308
308
|
}
|
|
309
|
-
},
|
|
309
|
+
}, at = (e) => {
|
|
310
310
|
e.length !== 0 && P((t) => [...t, {
|
|
311
311
|
type: "remove",
|
|
312
312
|
paths: e
|
|
313
313
|
}]);
|
|
314
|
-
},
|
|
314
|
+
}, lt = (e, t) => {
|
|
315
315
|
P((r) => [...r, {
|
|
316
316
|
type: "update",
|
|
317
317
|
oldPath: e,
|
|
318
318
|
updates: t
|
|
319
319
|
}]);
|
|
320
|
-
},
|
|
320
|
+
}, dt = (e, t) => {
|
|
321
321
|
P((r) => [...r, {
|
|
322
322
|
type: "insert",
|
|
323
323
|
parentPath: e,
|
|
324
324
|
item: t
|
|
325
325
|
}]);
|
|
326
|
-
}, dt = () => {
|
|
327
|
-
P([]);
|
|
328
326
|
}, ft = () => {
|
|
329
327
|
P([]);
|
|
330
|
-
}, ut = () =>
|
|
328
|
+
}, ut = () => {
|
|
329
|
+
P([]);
|
|
330
|
+
}, mt = () => ee().length > 0, ht = (e) => {
|
|
331
331
|
w = e;
|
|
332
|
-
},
|
|
332
|
+
}, re = () => w ? {
|
|
333
333
|
top: w.scrollTop,
|
|
334
334
|
left: w.scrollLeft
|
|
335
335
|
} : {
|
|
336
336
|
top: 0,
|
|
337
337
|
left: 0
|
|
338
|
-
},
|
|
338
|
+
}, ce = (e) => {
|
|
339
339
|
w && (w.scrollTop = e.top, w.scrollLeft = e.left);
|
|
340
|
-
},
|
|
340
|
+
}, pt = {
|
|
341
341
|
currentPath: C,
|
|
342
|
-
setCurrentPath:
|
|
343
|
-
navigateUp:
|
|
344
|
-
navigateTo:
|
|
345
|
-
homeLabel:
|
|
346
|
-
selectedItems:
|
|
347
|
-
selectItem:
|
|
348
|
-
clearSelection:
|
|
349
|
-
isSelected:
|
|
350
|
-
getSelectedItemsList:
|
|
351
|
-
viewMode:
|
|
342
|
+
setCurrentPath: z,
|
|
343
|
+
navigateUp: Ye,
|
|
344
|
+
navigateTo: se,
|
|
345
|
+
homeLabel: Ne,
|
|
346
|
+
selectedItems: We,
|
|
347
|
+
selectItem: je,
|
|
348
|
+
clearSelection: Qe,
|
|
349
|
+
isSelected: He,
|
|
350
|
+
getSelectedItemsList: rt,
|
|
351
|
+
viewMode: U,
|
|
352
352
|
setViewMode: Te,
|
|
353
353
|
sortConfig: F,
|
|
354
354
|
setSortConfig: ze,
|
|
355
|
-
listColumnRatios:
|
|
356
|
-
setListColumnRatios:
|
|
357
|
-
expandedFolders:
|
|
358
|
-
toggleFolder:
|
|
359
|
-
isExpanded:
|
|
360
|
-
files:
|
|
361
|
-
currentFiles:
|
|
362
|
-
filterQuery:
|
|
363
|
-
setFilterQuery:
|
|
364
|
-
filterQueryApplied:
|
|
355
|
+
listColumnRatios: V,
|
|
356
|
+
setListColumnRatios: Xe,
|
|
357
|
+
expandedFolders: ke,
|
|
358
|
+
toggleFolder: $e,
|
|
359
|
+
isExpanded: Je,
|
|
360
|
+
files: te,
|
|
361
|
+
currentFiles: qe,
|
|
362
|
+
filterQuery: H,
|
|
363
|
+
setFilterQuery: ot,
|
|
364
|
+
filterQueryApplied: v,
|
|
365
365
|
isFilterActive: Oe,
|
|
366
|
-
setFilterActive:
|
|
367
|
-
getFilterMatch:
|
|
368
|
-
getFilterMatchForId:
|
|
369
|
-
sidebarCollapsed:
|
|
370
|
-
toggleSidebar:
|
|
371
|
-
sidebarWidth:
|
|
372
|
-
|
|
366
|
+
setFilterActive: J,
|
|
367
|
+
getFilterMatch: it,
|
|
368
|
+
getFilterMatchForId: st,
|
|
369
|
+
sidebarCollapsed: j,
|
|
370
|
+
toggleSidebar: Ze,
|
|
371
|
+
sidebarWidth: L,
|
|
372
|
+
clampSidebarWidth: De,
|
|
373
|
+
setSidebarWidth: et,
|
|
373
374
|
contextMenu: Re,
|
|
374
|
-
showContextMenu:
|
|
375
|
-
hideContextMenu:
|
|
376
|
-
openItem:
|
|
375
|
+
showContextMenu: tt,
|
|
376
|
+
hideContextMenu: nt,
|
|
377
|
+
openItem: ct,
|
|
377
378
|
// Optimistic updates
|
|
378
|
-
optimisticRemove:
|
|
379
|
-
optimisticUpdate:
|
|
380
|
-
optimisticInsert:
|
|
381
|
-
clearOptimisticUpdates:
|
|
382
|
-
rollbackOptimisticUpdates:
|
|
383
|
-
hasOptimisticUpdates:
|
|
379
|
+
optimisticRemove: at,
|
|
380
|
+
optimisticUpdate: lt,
|
|
381
|
+
optimisticInsert: dt,
|
|
382
|
+
clearOptimisticUpdates: ft,
|
|
383
|
+
rollbackOptimisticUpdates: ut,
|
|
384
|
+
hasOptimisticUpdates: mt,
|
|
384
385
|
// Scroll position management
|
|
385
|
-
setScrollContainer:
|
|
386
|
-
getScrollPosition:
|
|
387
|
-
setScrollPosition:
|
|
388
|
-
saveScrollPosition: () => (
|
|
386
|
+
setScrollContainer: ht,
|
|
387
|
+
getScrollPosition: re,
|
|
388
|
+
setScrollPosition: ce,
|
|
389
|
+
saveScrollPosition: () => (O = re(), O),
|
|
389
390
|
restoreScrollPosition: () => {
|
|
390
391
|
requestAnimationFrame(() => {
|
|
391
|
-
|
|
392
|
+
ce(O);
|
|
392
393
|
});
|
|
393
394
|
}
|
|
394
395
|
};
|
|
395
|
-
return
|
|
396
|
-
value:
|
|
396
|
+
return St(ye.Provider, {
|
|
397
|
+
value: pt,
|
|
397
398
|
get children() {
|
|
398
399
|
return n.children;
|
|
399
400
|
}
|
|
400
401
|
});
|
|
401
402
|
}
|
|
402
|
-
function
|
|
403
|
-
const n =
|
|
403
|
+
function Nt() {
|
|
404
|
+
const n = gt(ye);
|
|
404
405
|
if (!n)
|
|
405
406
|
throw new Error("useFileBrowser must be used within a FileBrowserProvider");
|
|
406
407
|
return n;
|
|
407
408
|
}
|
|
408
409
|
export {
|
|
409
|
-
|
|
410
|
-
|
|
410
|
+
Dt as FileBrowserProvider,
|
|
411
|
+
Nt as useFileBrowser
|
|
411
412
|
};
|
|
@@ -206,6 +206,7 @@ export interface FileBrowserContextValue {
|
|
|
206
206
|
sidebarCollapsed: Accessor<boolean>;
|
|
207
207
|
toggleSidebar: () => void;
|
|
208
208
|
sidebarWidth: Accessor<number>;
|
|
209
|
+
clampSidebarWidth: (width: number) => number;
|
|
209
210
|
setSidebarWidth: (width: number) => void;
|
|
210
211
|
contextMenu: Accessor<ContextMenuEvent | null>;
|
|
211
212
|
showContextMenu: (event: ContextMenuEvent) => void;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { insert as
|
|
1
|
+
import { insert as a, createComponent as l, effect as f, className as b, template as s, Dynamic as A, memo as k, setAttribute as y, delegateEvents as w } from "solid-js/web";
|
|
2
2
|
import { createMemo as v, For as x, Show as g } from "solid-js";
|
|
3
3
|
import { cn as m } from "../../utils/cn.js";
|
|
4
4
|
import { deferNonBlocking as I } from "../../utils/defer.js";
|
|
5
5
|
import { Tooltip as $ } from "../ui/Tooltip.js";
|
|
6
6
|
import { resolveActivityBarClick as _ } from "./activityBarBehavior.js";
|
|
7
|
-
var B = /* @__PURE__ */
|
|
7
|
+
var B = /* @__PURE__ */ s('<div class="flex flex-col">'), p = /* @__PURE__ */ s('<div data-floe-shell-slot=activity-bar style=border-right-color:var(--activity-bar-border)><div class="flex flex-col">'), S = /* @__PURE__ */ s('<div class="absolute left-0 top-0 w-1 h-full bg-primary rounded-r">'), j = /* @__PURE__ */ s("<span>"), N = /* @__PURE__ */ s("<button type=button>");
|
|
8
8
|
function V(e) {
|
|
9
|
-
const
|
|
9
|
+
const o = v(() => e.activeId), r = v(() => e.collapsed ?? !1), t = v(() => e.onActiveChange), c = v(() => e.onCollapsedChange), u = (i) => {
|
|
10
10
|
if (i.onClick) {
|
|
11
11
|
I(() => i.onClick());
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const n = _({
|
|
15
15
|
clickedId: i.id,
|
|
16
|
-
activeId:
|
|
16
|
+
activeId: o(),
|
|
17
17
|
collapsed: r(),
|
|
18
18
|
behavior: i.collapseBehavior
|
|
19
19
|
});
|
|
20
|
-
n.nextActiveId !==
|
|
20
|
+
n.nextActiveId !== o() && (typeof n.openSidebar == "boolean" ? t()(n.nextActiveId, {
|
|
21
21
|
openSidebar: n.openSidebar
|
|
22
22
|
}) : t()(n.nextActiveId)), typeof n.nextCollapsed == "boolean" && c()?.(n.nextCollapsed);
|
|
23
23
|
};
|
|
24
24
|
return (() => {
|
|
25
25
|
var i = p(), n = i.firstChild;
|
|
26
|
-
return
|
|
26
|
+
return a(n, l(x, {
|
|
27
27
|
get each() {
|
|
28
28
|
return e.items;
|
|
29
29
|
},
|
|
30
30
|
children: (d) => l(C, {
|
|
31
31
|
item: d,
|
|
32
32
|
get isActive() {
|
|
33
|
-
return
|
|
33
|
+
return o() === d.id;
|
|
34
34
|
},
|
|
35
|
-
onClick: () =>
|
|
35
|
+
onClick: () => u(d)
|
|
36
36
|
})
|
|
37
|
-
})),
|
|
37
|
+
})), a(i, l(g, {
|
|
38
38
|
get when() {
|
|
39
39
|
return e.bottomItems?.length;
|
|
40
40
|
},
|
|
41
41
|
get children() {
|
|
42
42
|
var d = B();
|
|
43
|
-
return
|
|
43
|
+
return a(d, l(x, {
|
|
44
44
|
get each() {
|
|
45
45
|
return e.bottomItems;
|
|
46
46
|
},
|
|
47
47
|
children: (h) => l(C, {
|
|
48
48
|
item: h,
|
|
49
49
|
isActive: !1,
|
|
50
|
-
onClick: () =>
|
|
50
|
+
onClick: () => u(h)
|
|
51
51
|
})
|
|
52
52
|
})), d;
|
|
53
53
|
}
|
|
@@ -55,7 +55,7 @@ function V(e) {
|
|
|
55
55
|
})();
|
|
56
56
|
}
|
|
57
57
|
function C(e) {
|
|
58
|
-
const
|
|
58
|
+
const o = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
|
|
59
59
|
return l($, {
|
|
60
60
|
get content() {
|
|
61
61
|
return e.item.label;
|
|
@@ -64,32 +64,32 @@ function C(e) {
|
|
|
64
64
|
delay: 0,
|
|
65
65
|
get children() {
|
|
66
66
|
var r = N();
|
|
67
|
-
return r.$$click = () => e.onClick(),
|
|
67
|
+
return r.$$click = () => e.onClick(), a(r, l(g, {
|
|
68
68
|
get when() {
|
|
69
69
|
return e.isActive;
|
|
70
70
|
},
|
|
71
71
|
get children() {
|
|
72
72
|
return S();
|
|
73
73
|
}
|
|
74
|
-
}), null),
|
|
74
|
+
}), null), a(r, l(A, {
|
|
75
75
|
get component() {
|
|
76
76
|
return e.item.icon;
|
|
77
77
|
},
|
|
78
78
|
class: "w-5 h-5"
|
|
79
|
-
}), null),
|
|
79
|
+
}), null), a(r, l(g, {
|
|
80
80
|
get when() {
|
|
81
|
-
return
|
|
81
|
+
return o();
|
|
82
82
|
},
|
|
83
83
|
get children() {
|
|
84
84
|
var t = j();
|
|
85
|
-
return
|
|
86
|
-
var c = k(() => typeof
|
|
87
|
-
return () => c() ? "99+" :
|
|
85
|
+
return a(t, (() => {
|
|
86
|
+
var c = k(() => typeof o() == "number" && o() > 99);
|
|
87
|
+
return () => c() ? "99+" : o();
|
|
88
88
|
})()), f(() => b(t, m("absolute top-0.5 right-0.5 min-w-3.5 h-3.5 px-1", "flex items-center justify-center", "text-[9px] font-medium rounded-full", "bg-activity-bar-badge text-activity-bar-badge-foreground"))), t;
|
|
89
89
|
}
|
|
90
90
|
}), null), f((t) => {
|
|
91
|
-
var c = m("relative w-full aspect-square flex items-center justify-center cursor-pointer", "transition-
|
|
92
|
-
return c !== t.e && b(r, t.e = c),
|
|
91
|
+
var c = m("relative w-full aspect-square flex items-center justify-center cursor-pointer", "transition-[color,background-color] duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset", e.isActive ? "text-activity-bar-foreground-active bg-accent/80" : "text-activity-bar-foreground hover:text-activity-bar-foreground-active hover:bg-accent/40"), u = e.item.label, i = e.isActive;
|
|
92
|
+
return c !== t.e && b(r, t.e = c), u !== t.t && y(r, "aria-label", t.t = u), i !== t.a && y(r, "aria-pressed", t.a = i), t;
|
|
93
93
|
}, {
|
|
94
94
|
e: void 0,
|
|
95
95
|
t: void 0,
|