@floegence/floe-webapp-core 0.35.21 → 0.35.23
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/chat.css +33 -7
- package/dist/components/chat/blocks/FileBlock.js +42 -27
- package/dist/components/chat/blocks/ToolCallBlock.js +150 -149
- package/dist/components/file-browser/Breadcrumb.js +73 -72
- package/dist/components/file-browser/DragPreview.d.ts +2 -2
- package/dist/components/file-browser/DragPreview.js +15 -15
- package/dist/components/file-browser/FileBrowser.js +13 -13
- package/dist/components/file-browser/index.d.ts +1 -0
- package/dist/components/layout/ActivityBar.d.ts +1 -0
- package/dist/components/layout/ActivityBar.js +51 -45
- package/dist/components/layout/MobileTabBar.d.ts +1 -0
- package/dist/components/layout/MobileTabBar.js +109 -65
- package/dist/components/layout/Shell.js +190 -158
- package/dist/components/layout/Sidebar.d.ts +1 -0
- package/dist/components/layout/Sidebar.js +33 -31
- package/dist/components/layout/SidebarPane.d.ts +1 -0
- package/dist/components/layout/SidebarPane.js +40 -37
- package/dist/components/layout/TopBar.d.ts +1 -0
- package/dist/components/layout/TopBar.js +23 -22
- package/dist/components/ui/Dropdown.d.ts +13 -0
- package/dist/components/ui/Dropdown.js +263 -145
- package/dist/components/ui/Tabs.d.ts +4 -0
- package/dist/components/ui/Tabs.js +207 -149
- package/dist/context/FloeConfigContext.d.ts +17 -0
- package/dist/context/FloeConfigContext.js +34 -25
- package/dist/context/NotificationContext.js +76 -69
- package/dist/file-browser.js +19 -17
- package/dist/full.js +302 -300
- package/dist/styles/tokens.d.ts +4 -4
- package/dist/styles/tokens.js +55 -14
- package/dist/styles.css +1 -1
- package/dist/themes/light.css +2 -2
- package/package.json +1 -1
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { insert as E, createComponent as a, memo as $, effect as D, className as L, template as b, use as H, delegateEvents as P } from "solid-js/web";
|
|
2
|
+
import { createSignal as B, onMount as y, createMemo as I, For as O, Show as k, onCleanup as F } from "solid-js";
|
|
3
|
+
import { cn as x } from "../../utils/cn.js";
|
|
4
4
|
import { useFileBrowser as G } from "./FileBrowserContext.js";
|
|
5
|
-
import { ChevronRight as
|
|
5
|
+
import { ChevronRight as M } from "../icons/index.js";
|
|
6
6
|
import { Dropdown as z } from "../ui/Dropdown.js";
|
|
7
|
-
var X = /* @__PURE__ */
|
|
8
|
-
const p = 16, J = 28,
|
|
9
|
-
function V(
|
|
10
|
-
const
|
|
11
|
-
return Math.min(
|
|
7
|
+
var X = /* @__PURE__ */ b("<nav aria-label=Breadcrumb>"), j = /* @__PURE__ */ b("<span>…"), q = /* @__PURE__ */ b('<button type=button><span class="truncate max-w-[120px] block">');
|
|
8
|
+
const p = 16, J = 28, T = 12, K = 7, Q = 120, U = 100;
|
|
9
|
+
function V(n) {
|
|
10
|
+
const t = n.length * K;
|
|
11
|
+
return Math.min(t + T, Q + T);
|
|
12
12
|
}
|
|
13
|
-
function ce(
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
-
if (!
|
|
13
|
+
function ce(n) {
|
|
14
|
+
const t = G();
|
|
15
|
+
let o;
|
|
16
|
+
const [r, c] = B(0);
|
|
17
|
+
y(() => {
|
|
18
|
+
if (!o) return;
|
|
19
19
|
const e = () => {
|
|
20
|
-
|
|
20
|
+
o && c(o.offsetWidth);
|
|
21
21
|
};
|
|
22
22
|
e();
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const s = new ResizeObserver(e);
|
|
24
|
+
s.observe(o), F(() => s.disconnect());
|
|
25
25
|
});
|
|
26
|
-
const
|
|
27
|
-
const e =
|
|
26
|
+
const h = I(() => {
|
|
27
|
+
const e = t.currentPath(), s = t.homeLabel();
|
|
28
28
|
if (e === "/" || e === "")
|
|
29
29
|
return [{
|
|
30
|
-
name:
|
|
30
|
+
name: s,
|
|
31
31
|
path: "/"
|
|
32
32
|
}];
|
|
33
33
|
const l = e.split("/").filter(Boolean), i = [{
|
|
34
|
-
name:
|
|
34
|
+
name: s,
|
|
35
35
|
path: "/"
|
|
36
36
|
}];
|
|
37
|
-
let
|
|
38
|
-
for (const
|
|
39
|
-
|
|
40
|
-
name:
|
|
41
|
-
path:
|
|
37
|
+
let g = "";
|
|
38
|
+
for (const f of l)
|
|
39
|
+
g += "/" + f, i.push({
|
|
40
|
+
name: f,
|
|
41
|
+
path: g
|
|
42
42
|
});
|
|
43
43
|
return i;
|
|
44
|
-
}), m =
|
|
45
|
-
const e =
|
|
46
|
-
if (
|
|
44
|
+
}), m = I(() => {
|
|
45
|
+
const e = h(), s = r();
|
|
46
|
+
if (s < U || e.length <= 2)
|
|
47
47
|
return {
|
|
48
48
|
collapsed: [],
|
|
49
49
|
visible: e,
|
|
50
50
|
shouldCollapse: !1
|
|
51
51
|
};
|
|
52
|
-
const l = e.map((
|
|
53
|
-
if (
|
|
52
|
+
const l = e.map((d) => V(d.name)), i = l[0], g = l[e.length - 1], f = p, R = e.length > 1 ? p : 0, C = i + g + f + R;
|
|
53
|
+
if (C > s && e.length > 2)
|
|
54
54
|
return {
|
|
55
55
|
collapsed: e.slice(1, -1),
|
|
56
56
|
visible: [e[0], e[e.length - 1]],
|
|
57
57
|
shouldCollapse: !0
|
|
58
58
|
};
|
|
59
|
-
const
|
|
60
|
-
let
|
|
61
|
-
const
|
|
62
|
-
for (let
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
v.unshift(
|
|
59
|
+
const u = e.slice(1, -1), v = [];
|
|
60
|
+
let S = s - C;
|
|
61
|
+
const A = u.length > 0 ? J + p : 0;
|
|
62
|
+
for (let d = u.length - 1; d >= 0; d--) {
|
|
63
|
+
const _ = l[d + 1] + p, N = d > 0 ? A : 0;
|
|
64
|
+
if (S - N >= _)
|
|
65
|
+
v.unshift(u[d]), S -= _;
|
|
66
66
|
else
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const w = u.slice(0, u.length - v.length);
|
|
70
70
|
return {
|
|
71
|
-
collapsed:
|
|
71
|
+
collapsed: w,
|
|
72
72
|
visible: [e[0], ...v, e[e.length - 1]],
|
|
73
|
-
shouldCollapse:
|
|
73
|
+
shouldCollapse: w.length > 0
|
|
74
74
|
};
|
|
75
|
-
}),
|
|
76
|
-
|
|
75
|
+
}), W = (e) => {
|
|
76
|
+
t.setCurrentPath(e.path);
|
|
77
77
|
};
|
|
78
78
|
return (() => {
|
|
79
|
-
var e = X(),
|
|
80
|
-
return typeof
|
|
79
|
+
var e = X(), s = o;
|
|
80
|
+
return typeof s == "function" ? H(s, e) : o = e, E(e, a(O, {
|
|
81
81
|
get each() {
|
|
82
82
|
return m().visible;
|
|
83
83
|
},
|
|
84
|
-
children: (l, i) => [a(
|
|
84
|
+
children: (l, i) => [a(k, {
|
|
85
85
|
get when() {
|
|
86
86
|
return i() > 0;
|
|
87
87
|
},
|
|
88
88
|
get children() {
|
|
89
|
-
return a(
|
|
89
|
+
return a(M, {
|
|
90
90
|
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
}), a(
|
|
93
|
+
}), a(k, {
|
|
94
94
|
get when() {
|
|
95
|
-
return
|
|
95
|
+
return $(() => !!m().shouldCollapse)() && i() === 1;
|
|
96
96
|
},
|
|
97
97
|
get children() {
|
|
98
98
|
return [a(Y, {
|
|
99
99
|
get segments() {
|
|
100
100
|
return m().collapsed;
|
|
101
101
|
},
|
|
102
|
-
onSelect:
|
|
103
|
-
}), a(
|
|
102
|
+
onSelect: W
|
|
103
|
+
}), a(M, {
|
|
104
104
|
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
105
105
|
})];
|
|
106
106
|
}
|
|
@@ -109,43 +109,44 @@ function ce(r) {
|
|
|
109
109
|
get isLast() {
|
|
110
110
|
return i() === m().visible.length - 1;
|
|
111
111
|
},
|
|
112
|
-
onClick: () =>
|
|
112
|
+
onClick: () => W(l)
|
|
113
113
|
})]
|
|
114
|
-
})),
|
|
114
|
+
})), D(() => L(e, x("flex items-center gap-1 min-w-0 overflow-hidden", n.class))), e;
|
|
115
115
|
})();
|
|
116
116
|
}
|
|
117
|
-
function Y(
|
|
118
|
-
const
|
|
119
|
-
id:
|
|
120
|
-
label:
|
|
117
|
+
function Y(n) {
|
|
118
|
+
const t = () => n.segments.map((r) => ({
|
|
119
|
+
id: r.path,
|
|
120
|
+
label: r.name
|
|
121
121
|
}));
|
|
122
122
|
return a(z, {
|
|
123
123
|
get trigger() {
|
|
124
|
-
return (
|
|
125
|
-
var t = j();
|
|
126
|
-
return b(() => x(t, C("text-xs px-1.5 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-all duration-100", "text-muted-foreground hover:text-foreground hover:bg-muted/50", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"))), t;
|
|
127
|
-
})();
|
|
124
|
+
return j();
|
|
128
125
|
},
|
|
126
|
+
get triggerClass() {
|
|
127
|
+
return x("inline-flex items-center text-xs px-1.5 py-0.5 rounded flex-shrink-0", "transition-all duration-100", "text-muted-foreground hover:text-foreground hover:bg-muted/50");
|
|
128
|
+
},
|
|
129
|
+
triggerAriaLabel: "Show hidden path segments",
|
|
129
130
|
get items() {
|
|
130
|
-
return
|
|
131
|
+
return t();
|
|
131
132
|
},
|
|
132
|
-
onSelect: (
|
|
133
|
-
const c =
|
|
134
|
-
c &&
|
|
133
|
+
onSelect: (r) => {
|
|
134
|
+
const c = n.segments.find((h) => h.path === r);
|
|
135
|
+
c && n.onSelect(c);
|
|
135
136
|
},
|
|
136
137
|
align: "start"
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
|
-
function Z(
|
|
140
|
+
function Z(n) {
|
|
140
141
|
return (() => {
|
|
141
|
-
var
|
|
142
|
-
return
|
|
143
|
-
var c =
|
|
144
|
-
return c !==
|
|
142
|
+
var t = q(), o = t.firstChild;
|
|
143
|
+
return t.$$click = () => n.onClick(), E(o, () => n.segment.name), D((r) => {
|
|
144
|
+
var c = n.isLast, h = x("text-xs px-1.5 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-all duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", n.isLast ? "font-medium text-foreground cursor-default" : "text-muted-foreground hover:text-foreground hover:bg-muted/50");
|
|
145
|
+
return c !== r.e && (t.disabled = r.e = c), h !== r.t && L(t, r.t = h), r;
|
|
145
146
|
}, {
|
|
146
147
|
e: void 0,
|
|
147
148
|
t: void 0
|
|
148
|
-
}),
|
|
149
|
+
}), t;
|
|
149
150
|
})();
|
|
150
151
|
}
|
|
151
152
|
P(["click"]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Floating preview that follows the cursor during drag operations.
|
|
2
|
+
* Floating preview that follows the cursor during file-browser drag operations.
|
|
3
3
|
* Shows dragged items with a count badge for multiple items.
|
|
4
4
|
* Uses Motion library for smooth animations.
|
|
5
5
|
* Includes fly-to-target animation when dropping onto a valid target.
|
|
6
6
|
*/
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function FileBrowserDragPreview(): import("solid-js").JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { createComponent as o, Portal as N, insert as
|
|
2
|
-
import { createSignal as F, createEffect as
|
|
1
|
+
import { createComponent as o, Portal as N, insert as l, effect as u, className as $, memo as B, template as a, setAttribute as A } from "solid-js/web";
|
|
2
|
+
import { createSignal as F, createEffect as V, createMemo as d, Show as m, For as j } from "solid-js";
|
|
3
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
5
|
import { useFileBrowserDrag as G } from "../../context/FileBrowserDragContext.js";
|
|
6
6
|
import { FileItemIcon as W } from "./FileIcons.js";
|
|
7
|
-
var Y = /* @__PURE__ */
|
|
7
|
+
var Y = /* @__PURE__ */ a('<div class="text-[10px] text-muted-foreground pl-6">and <!> more...'), q = /* @__PURE__ */ a("<span>Drop to move"), y = /* @__PURE__ */ a("<div>"), H = /* @__PURE__ */ a('<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__ */ a("<span>Cannot drop here"), K = /* @__PURE__ */ a('<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__ */ a('<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
8
|
const x = 3, P = 4, T = 4, Q = 0.2;
|
|
9
|
-
function
|
|
9
|
+
function lt() {
|
|
10
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
|
+
V(() => {
|
|
13
13
|
const t = S(), e = C();
|
|
14
14
|
if (t && !e && !_ && (h(null), w(!1)), e && !_) {
|
|
15
15
|
const r = n();
|
|
@@ -57,7 +57,7 @@ function at() {
|
|
|
57
57
|
get children() {
|
|
58
58
|
return o(m, {
|
|
59
59
|
get when() {
|
|
60
|
-
return
|
|
60
|
+
return B(() => !!R())() && E().length > 0;
|
|
61
61
|
},
|
|
62
62
|
get children() {
|
|
63
63
|
return o(N, {
|
|
@@ -91,32 +91,32 @@ function at() {
|
|
|
91
91
|
get children() {
|
|
92
92
|
return [(() => {
|
|
93
93
|
var t = y();
|
|
94
|
-
return
|
|
94
|
+
return l(t, o(j, {
|
|
95
95
|
get each() {
|
|
96
96
|
return E();
|
|
97
97
|
},
|
|
98
98
|
children: (e) => (() => {
|
|
99
99
|
var r = H(), i = r.firstChild, D = i.nextSibling;
|
|
100
|
-
return
|
|
100
|
+
return l(i, o(W, {
|
|
101
101
|
item: e,
|
|
102
102
|
class: "w-4 h-4"
|
|
103
|
-
})),
|
|
103
|
+
})), l(D, () => e.name), r;
|
|
104
104
|
})()
|
|
105
|
-
}), null),
|
|
105
|
+
}), null), l(t, o(m, {
|
|
106
106
|
get when() {
|
|
107
107
|
return k() > 0;
|
|
108
108
|
},
|
|
109
109
|
get children() {
|
|
110
110
|
var e = Y(), r = e.firstChild, i = r.nextSibling;
|
|
111
|
-
return i.nextSibling,
|
|
111
|
+
return i.nextSibling, l(e, k, i), e;
|
|
112
112
|
}
|
|
113
|
-
}), null),
|
|
113
|
+
}), null), l(t, o(m, {
|
|
114
114
|
get when() {
|
|
115
115
|
return I();
|
|
116
116
|
},
|
|
117
117
|
get children() {
|
|
118
118
|
var e = y();
|
|
119
|
-
return
|
|
119
|
+
return l(e, o(m, {
|
|
120
120
|
get when() {
|
|
121
121
|
return p();
|
|
122
122
|
},
|
|
@@ -152,7 +152,7 @@ function at() {
|
|
|
152
152
|
},
|
|
153
153
|
get children() {
|
|
154
154
|
var t = y();
|
|
155
|
-
return
|
|
155
|
+
return l(t, v), u(() => $(t, f(
|
|
156
156
|
"absolute -top-2 -right-2",
|
|
157
157
|
"min-w-[20px] h-5 px-1.5 rounded-full",
|
|
158
158
|
"bg-foreground text-background",
|
|
@@ -186,5 +186,5 @@ function tt(g) {
|
|
|
186
186
|
})();
|
|
187
187
|
}
|
|
188
188
|
export {
|
|
189
|
-
|
|
189
|
+
lt as FileBrowserDragPreview
|
|
190
190
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent as n, insert as i, use as k, memo as E, effect as
|
|
1
|
+
import { createComponent as n, insert as i, use as k, memo as E, effect as B, className as K, template as I, delegateEvents as L } from "solid-js/web";
|
|
2
2
|
import { createSignal as O, onMount as V, onCleanup as H, createEffect as N, Show as c } from "solid-js";
|
|
3
3
|
import { cn as T } from "../../utils/cn.js";
|
|
4
4
|
import { useLayout as j } from "../../context/LayoutContext.js";
|
|
@@ -11,9 +11,9 @@ import { FileListView as Y } from "./FileListView.js";
|
|
|
11
11
|
import { FileGridView as Z } from "./FileGridView.js";
|
|
12
12
|
import { FileBrowserToolbar as p } from "./FileBrowserToolbar.js";
|
|
13
13
|
import { FileContextMenu as ee } from "./FileContextMenu.js";
|
|
14
|
-
import {
|
|
14
|
+
import { FileBrowserDragPreview as te } from "./DragPreview.js";
|
|
15
15
|
var re = /* @__PURE__ */ I('<div class="border-b border-border">'), ne = /* @__PURE__ */ I('<div><div class="flex flex-1 min-h-0 relative"><div class="flex-1 min-w-0 flex flex-col"><div class="flex-1 min-h-0"></div><div class="flex items-center justify-between px-3 py-1 border-t border-border text-[10px] text-muted-foreground"><span> items</span><span class="truncate max-w-[200px]">');
|
|
16
|
-
function
|
|
16
|
+
function Ce(e) {
|
|
17
17
|
return n(q, {
|
|
18
18
|
get files() {
|
|
19
19
|
return e.files;
|
|
@@ -101,7 +101,7 @@ function we(e) {
|
|
|
101
101
|
}
|
|
102
102
|
function ie(e) {
|
|
103
103
|
const r = J(), M = j(), o = G(), h = () => M.isMobile(), [v, b] = O(null), D = () => v() ?? r.sidebarWidth(), y = () => e.sidebarResizable ?? !0, a = () => (e.enableDragDrop ?? !0) && !!o, d = () => e.instanceId ?? `filebrowser-${Math.random().toString(36).slice(2, 9)}`;
|
|
104
|
-
let
|
|
104
|
+
let w, C = null, x = null;
|
|
105
105
|
V(() => {
|
|
106
106
|
if (!o || !a()) return;
|
|
107
107
|
const t = {
|
|
@@ -109,7 +109,7 @@ function ie(e) {
|
|
|
109
109
|
currentPath: r.currentPath,
|
|
110
110
|
files: r.files,
|
|
111
111
|
onDragMove: e.onDragMove,
|
|
112
|
-
getScrollContainer: () =>
|
|
112
|
+
getScrollContainer: () => C,
|
|
113
113
|
getSidebarScrollContainer: () => x,
|
|
114
114
|
optimisticRemove: r.optimisticRemove,
|
|
115
115
|
optimisticInsert: r.optimisticInsert
|
|
@@ -128,7 +128,7 @@ function ie(e) {
|
|
|
128
128
|
!m && t && e.hideSidebarOnMobile !== !1 && !r.sidebarCollapsed() && r.toggleSidebar(), m = t;
|
|
129
129
|
});
|
|
130
130
|
const R = (t) => {
|
|
131
|
-
(t.metaKey || t.ctrlKey) && t.key.toLowerCase() === "f" && (t.preventDefault(), r.setFilterActive(!0), Q(() =>
|
|
131
|
+
(t.metaKey || t.ctrlKey) && t.key.toLowerCase() === "f" && (t.preventDefault(), r.setFilterActive(!0), Q(() => w?.focus()));
|
|
132
132
|
}, P = () => !r.sidebarCollapsed() || !h(), $ = () => {
|
|
133
133
|
b(r.sidebarWidth());
|
|
134
134
|
}, W = (t) => {
|
|
@@ -138,7 +138,7 @@ function ie(e) {
|
|
|
138
138
|
t !== null && (r.setSidebarWidth(t), b(null));
|
|
139
139
|
};
|
|
140
140
|
return (() => {
|
|
141
|
-
var t = ne(), s = t.firstChild, f = s.firstChild, g = f.firstChild,
|
|
141
|
+
var t = ne(), s = t.firstChild, f = s.firstChild, g = f.firstChild, F = g.nextSibling, u = F.firstChild, A = u.firstChild, _ = u.nextSibling;
|
|
142
142
|
return t.$$keydown = R, i(t, n(c, {
|
|
143
143
|
get when() {
|
|
144
144
|
return e.header;
|
|
@@ -182,12 +182,12 @@ function ie(e) {
|
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
}), f), i(f, n(p, {
|
|
185
|
-
filterInputRef: (l) =>
|
|
185
|
+
filterInputRef: (l) => w = l,
|
|
186
186
|
get endActions() {
|
|
187
187
|
return e.toolbarEndActions;
|
|
188
188
|
}
|
|
189
189
|
}), g), k((l) => {
|
|
190
|
-
|
|
190
|
+
C = l;
|
|
191
191
|
}, g), i(g, n(c, {
|
|
192
192
|
get when() {
|
|
193
193
|
return r.viewMode() === "list";
|
|
@@ -212,7 +212,7 @@ function ie(e) {
|
|
|
212
212
|
}
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
|
-
})), i(u, () => r.currentFiles().length,
|
|
215
|
+
})), i(u, () => r.currentFiles().length, A), i(u, n(c, {
|
|
216
216
|
get when() {
|
|
217
217
|
return r.filterQueryApplied().trim();
|
|
218
218
|
},
|
|
@@ -246,10 +246,10 @@ function ie(e) {
|
|
|
246
246
|
get children() {
|
|
247
247
|
return n(te, {});
|
|
248
248
|
}
|
|
249
|
-
}), null),
|
|
249
|
+
}), null), B(() => K(t, T("flex flex-col h-full min-h-0 bg-background", "border border-border rounded-lg overflow-hidden", "shadow-sm", e.class))), t;
|
|
250
250
|
})();
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
L(["keydown"]);
|
|
253
253
|
export {
|
|
254
|
-
|
|
254
|
+
Ce as FileBrowser
|
|
255
255
|
};
|
|
@@ -6,5 +6,6 @@ export { FileGridView, type FileGridViewProps } from './FileGridView';
|
|
|
6
6
|
export { FileContextMenu, type FileContextMenuProps, type BuiltinContextMenuAction, type HideItemsValue } from './FileContextMenu';
|
|
7
7
|
export { Breadcrumb, type BreadcrumbProps } from './Breadcrumb';
|
|
8
8
|
export { FileBrowserToolbar, type FileBrowserToolbarProps } from './FileBrowserToolbar';
|
|
9
|
+
export { FileBrowserDragPreview } from './DragPreview';
|
|
9
10
|
export { FolderIcon, FolderOpenIcon, FileIcon, CodeFileIcon, JavaScriptFileIcon, TypeScriptFileIcon, ShellScriptFileIcon, ImageFileIcon, DocumentFileIcon, ConfigFileIcon, StyleFileIcon, FileItemIcon, getFileIcon, resolveFileItemIcon, } from './FileIcons';
|
|
10
11
|
export type { FileItem, FileItemIconOverride, ViewMode, SortField, SortDirection, SortConfig, FileListColumnRatios, FileBrowserContextValue, ContextMenuActionType, ContextMenuItem, ContextMenuEvent, ContextMenuCallbacks, OptimisticUpdateType, OptimisticRemove, OptimisticUpdate, OptimisticInsert, OptimisticOperation, ScrollPosition, } from './types';
|
|
@@ -1,104 +1,110 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createMemo as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { deferNonBlocking as
|
|
5
|
-
import { Tooltip as
|
|
1
|
+
import { insert as c, createComponent as a, effect as f, className as g, setAttribute as m, template as s, Dynamic as k, memo as w, delegateEvents as I } from "solid-js/web";
|
|
2
|
+
import { createMemo as b, For as C, Show as h } from "solid-js";
|
|
3
|
+
import { cn as y } from "../../utils/cn.js";
|
|
4
|
+
import { deferNonBlocking as $ } from "../../utils/defer.js";
|
|
5
|
+
import { Tooltip as B } from "../ui/Tooltip.js";
|
|
6
6
|
import { resolveActivityBarClick as _ } from "./activityBarBehavior.js";
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
const o =
|
|
7
|
+
var S = /* @__PURE__ */ s('<div class="flex flex-col">'), j = /* @__PURE__ */ s('<nav data-floe-shell-slot=activity-bar style=border-right-color:var(--activity-bar-border)><div class="flex flex-col">'), N = /* @__PURE__ */ s('<div class="absolute left-0 top-0 w-1 h-full bg-primary rounded-r">'), q = /* @__PURE__ */ s("<span>"), D = /* @__PURE__ */ s("<button type=button>");
|
|
8
|
+
function z(e) {
|
|
9
|
+
const o = b(() => e.activeId), n = b(() => e.collapsed ?? !1), t = b(() => e.onActiveChange), d = b(() => e.onCollapsedChange), v = (i) => {
|
|
10
10
|
if (i.onClick) {
|
|
11
|
-
|
|
11
|
+
$(() => i.onClick());
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const l = _({
|
|
15
15
|
clickedId: i.id,
|
|
16
16
|
activeId: o(),
|
|
17
|
-
collapsed:
|
|
17
|
+
collapsed: n(),
|
|
18
18
|
behavior: i.collapseBehavior
|
|
19
19
|
});
|
|
20
|
-
|
|
21
|
-
openSidebar:
|
|
22
|
-
}) : t()(
|
|
20
|
+
l.nextActiveId !== o() && (typeof l.openSidebar == "boolean" ? t()(l.nextActiveId, {
|
|
21
|
+
openSidebar: l.openSidebar
|
|
22
|
+
}) : t()(l.nextActiveId)), typeof l.nextCollapsed == "boolean" && d()?.(l.nextCollapsed);
|
|
23
23
|
};
|
|
24
24
|
return (() => {
|
|
25
|
-
var i =
|
|
26
|
-
return
|
|
25
|
+
var i = j(), l = i.firstChild;
|
|
26
|
+
return c(l, a(C, {
|
|
27
27
|
get each() {
|
|
28
28
|
return e.items;
|
|
29
29
|
},
|
|
30
|
-
children: (
|
|
31
|
-
item:
|
|
30
|
+
children: (r) => a(A, {
|
|
31
|
+
item: r,
|
|
32
32
|
get isActive() {
|
|
33
|
-
return o() ===
|
|
33
|
+
return o() === r.id;
|
|
34
34
|
},
|
|
35
|
-
onClick: () =>
|
|
35
|
+
onClick: () => v(r)
|
|
36
36
|
})
|
|
37
|
-
})),
|
|
37
|
+
})), c(i, a(h, {
|
|
38
38
|
get when() {
|
|
39
39
|
return e.bottomItems?.length;
|
|
40
40
|
},
|
|
41
41
|
get children() {
|
|
42
|
-
var
|
|
43
|
-
return
|
|
42
|
+
var r = S();
|
|
43
|
+
return c(r, a(C, {
|
|
44
44
|
get each() {
|
|
45
45
|
return e.bottomItems;
|
|
46
46
|
},
|
|
47
|
-
children: (
|
|
48
|
-
item:
|
|
47
|
+
children: (u) => a(A, {
|
|
48
|
+
item: u,
|
|
49
49
|
isActive: !1,
|
|
50
|
-
onClick: () => u
|
|
50
|
+
onClick: () => v(u)
|
|
51
51
|
})
|
|
52
|
-
})),
|
|
52
|
+
})), r;
|
|
53
53
|
}
|
|
54
|
-
}), null), f(() =>
|
|
54
|
+
}), null), f((r) => {
|
|
55
|
+
var u = y("w-10 md:w-12 flex flex-col justify-between shrink-0 min-h-0", "bg-activity-bar border-r border-border", e.class), x = e.ariaLabel;
|
|
56
|
+
return u !== r.e && g(i, r.e = u), x !== r.t && m(i, "aria-label", r.t = x), r;
|
|
57
|
+
}, {
|
|
58
|
+
e: void 0,
|
|
59
|
+
t: void 0
|
|
60
|
+
}), i;
|
|
55
61
|
})();
|
|
56
62
|
}
|
|
57
|
-
function
|
|
63
|
+
function A(e) {
|
|
58
64
|
const o = () => typeof e.item.badge == "function" ? e.item.badge() : e.item.badge;
|
|
59
|
-
return
|
|
65
|
+
return a(B, {
|
|
60
66
|
get content() {
|
|
61
67
|
return e.item.label;
|
|
62
68
|
},
|
|
63
69
|
placement: "right",
|
|
64
70
|
delay: 0,
|
|
65
71
|
get children() {
|
|
66
|
-
var
|
|
67
|
-
return
|
|
72
|
+
var n = D();
|
|
73
|
+
return n.$$click = () => e.onClick(), c(n, a(h, {
|
|
68
74
|
get when() {
|
|
69
75
|
return e.isActive;
|
|
70
76
|
},
|
|
71
77
|
get children() {
|
|
72
|
-
return
|
|
78
|
+
return N();
|
|
73
79
|
}
|
|
74
|
-
}), null),
|
|
80
|
+
}), null), c(n, a(k, {
|
|
75
81
|
get component() {
|
|
76
82
|
return e.item.icon;
|
|
77
83
|
},
|
|
78
84
|
class: "w-5 h-5"
|
|
79
|
-
}), null),
|
|
85
|
+
}), null), c(n, a(h, {
|
|
80
86
|
get when() {
|
|
81
87
|
return o();
|
|
82
88
|
},
|
|
83
89
|
get children() {
|
|
84
|
-
var t =
|
|
85
|
-
return
|
|
86
|
-
var
|
|
87
|
-
return () =>
|
|
88
|
-
})()), f(() =>
|
|
90
|
+
var t = q();
|
|
91
|
+
return c(t, (() => {
|
|
92
|
+
var d = w(() => typeof o() == "number" && o() > 99);
|
|
93
|
+
return () => d() ? "99+" : o();
|
|
94
|
+
})()), f(() => g(t, y("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
95
|
}
|
|
90
96
|
}), null), f((t) => {
|
|
91
|
-
var
|
|
92
|
-
return
|
|
97
|
+
var d = y("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"), v = e.item.label, i = e.isActive;
|
|
98
|
+
return d !== t.e && g(n, t.e = d), v !== t.t && m(n, "aria-label", t.t = v), i !== t.a && m(n, "aria-pressed", t.a = i), t;
|
|
93
99
|
}, {
|
|
94
100
|
e: void 0,
|
|
95
101
|
t: void 0,
|
|
96
102
|
a: void 0
|
|
97
|
-
}),
|
|
103
|
+
}), n;
|
|
98
104
|
}
|
|
99
105
|
});
|
|
100
106
|
}
|
|
101
|
-
|
|
107
|
+
I(["click"]);
|
|
102
108
|
export {
|
|
103
|
-
|
|
109
|
+
z as ActivityBar
|
|
104
110
|
};
|