@hachej/boring-workspace 0.1.64 → 0.1.65
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/FileTree-B_fRS4Om.js +230 -0
- package/dist/MarkdownEditor-C55gVDyW.js +743 -0
- package/dist/WorkspaceLoadingState-D3i4X-eH.js +847 -0
- package/dist/WorkspaceProvider-Ddx7GByq.js +8770 -0
- package/dist/app-front.d.ts +79 -2
- package/dist/app-front.js +3110 -2467
- package/dist/app-server.d.ts +2 -2
- package/dist/app-server.js +6 -4
- package/dist/boring-workspace.css +2 -1
- package/dist/charts.d.ts +6 -1
- package/dist/charts.js +131 -138
- package/dist/plugin.d.ts +64 -1
- package/dist/plugin.js +32 -0
- package/dist/rolldown-runtime-Dqa2HsxW.js +20 -0
- package/dist/{runtimeEnv-HolIkcoB.d.ts → runtimeEnv-CU-c4kaV.d.ts} +7 -0
- package/dist/server.d.ts +2 -2
- package/dist/server.js +4 -3
- package/dist/testing-e2e.d.ts +5 -0
- package/dist/testing-e2e.js +33 -42
- package/dist/testing.d.ts +6 -1
- package/dist/testing.js +9474 -10814
- package/dist/utils-BRcxFdrz.js +8 -0
- package/dist/workspace.css +2756 -290
- package/dist/workspace.d.ts +132 -15
- package/dist/workspace.js +568 -734
- package/docs/plans/archive/CODE_OWNERSHIP_CLEANUP_PLAN.md +1 -1
- package/docs/plans/archive/DECLARATIVE_LAYOUT_MIGRATION.md +4 -4
- package/docs/plans/archive/GENERIC_EXPLORER_PLUGIN_PLAN.md +10 -10
- package/docs/plans/archive/PLUGIN_MODEL.md +37 -37
- package/docs/plans/archive/WORKSPACE_V2_PLAN.md +2 -2
- package/package.json +50 -50
- package/dist/FileTree-DjhAzlg3.js +0 -315
- package/dist/MarkdownEditor-CeN7n6mw.js +0 -610
- package/dist/WorkspaceLoadingState-D4SB2awA.js +0 -867
- package/dist/WorkspaceProvider-CEZUOy1M.js +0 -8725
- package/dist/utils-B6yFEsav.js +0 -8
package/dist/workspace.js
CHANGED
|
@@ -1,756 +1,590 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Button as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import { MenuIcon as pe, PanelLeftIcon as M, PinIcon as me, CheckIcon as fe, CopyIcon as he } from "lucide-react";
|
|
15
|
-
function Me() {
|
|
16
|
-
const e = D();
|
|
17
|
-
return A(e.subscribe, e.getSnapshot);
|
|
1
|
+
import { $ as e, $t as t, At as n, Bt as r, C as i, Ct as a, D as o, Dt as s, E as c, Et as l, Ft as u, G as d, H as f, Ht as p, It as m, J as h, Jt as g, K as _, Kt as v, Lt as y, Mt as b, Nt as x, O as S, Pt as C, Q as ee, Qt as te, Rt as ne, St as re, T as ie, Tt as w, U as ae, Ut as oe, Vt as se, Wt as ce, X as le, Xt as ue, Yt as de, Z as fe, Zt as pe, _n as me, _t as he, a as ge, an as _e, at as ve, b as ye, bt as be, cn as xe, ct as Se, d as Ce, dn as we, dt as Te, en as T, et as E, f as D, fn as O, ft as Ee, gn as De, gt as Oe, h as ke, hn as Ae, ht as k, i as je, in as Me, it as Ne, jt as Pe, k as Fe, kt as Ie, l as Le, ln as Re, lt as ze, mn as Be, mt as Ve, n as He, nn as Ue, nt as We, o as Ge, on as Ke, ot as qe, p as Je, pn as A, pt as Ye, q as Xe, qt as Ze, r as Qe, rn as $e, rt as et, s as tt, sn as nt, st as rt, t as it, tt as at, u as ot, un as st, ut as ct, v as lt, vn as ut, vt as dt, w as ft, wt as j, x as pt, xn as mt, xt as ht, y as gt, yn as _t, yt as vt, zt as yt } from "./WorkspaceProvider-Ddx7GByq.js";
|
|
2
|
+
import { t as bt } from "./MarkdownEditor-C55gVDyW.js";
|
|
3
|
+
import { t as M } from "./utils-BRcxFdrz.js";
|
|
4
|
+
import { f as xt, i as St, n as Ct, r as wt, t as Tt, u as Et } from "./WorkspaceLoadingState-D3i4X-eH.js";
|
|
5
|
+
import { t as Dt } from "./FileTree-B_fRS4Om.js";
|
|
6
|
+
import { Component as Ot, Suspense as kt, useCallback as N, useEffect as P, useMemo as F, useRef as I, useState as L, useSyncExternalStore as R } from "react";
|
|
7
|
+
import { Fragment as At, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
8
|
+
import { CheckIcon as jt, CopyIcon as Mt, MenuIcon as Nt, PanelLeftIcon as V, PinIcon as Pt } from "lucide-react";
|
|
9
|
+
import { Button as H, EmptyState as Ft, ErrorState as It, IconButton as U, Kbd as W, Sheet as Lt, SheetContent as Rt, SheetDescription as zt, SheetHeader as Bt, SheetTitle as Vt } from "@hachej/boring-ui-kit";
|
|
10
|
+
//#region src/front/plugin/useActivePanels.ts
|
|
11
|
+
function Ht() {
|
|
12
|
+
let e = A();
|
|
13
|
+
return R(e.subscribe, e.getSnapshot);
|
|
18
14
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/front/bridge/WorkspaceLink.tsx
|
|
17
|
+
function G(e) {
|
|
18
|
+
switch (e.kind) {
|
|
19
|
+
case "openFile": return {
|
|
20
|
+
kind: "openFile",
|
|
21
|
+
params: {
|
|
22
|
+
path: e.path,
|
|
23
|
+
...e.mode ? { mode: e.mode } : {},
|
|
24
|
+
...e.filesystem ? { filesystem: e.filesystem } : {}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
case "openSurface": return {
|
|
28
|
+
kind: "openSurface",
|
|
29
|
+
params: {
|
|
30
|
+
kind: e.surfaceKind,
|
|
31
|
+
target: e.target,
|
|
32
|
+
...e.filesystem ? { filesystem: e.filesystem } : {},
|
|
33
|
+
...e.meta ? { meta: e.meta } : {}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
case "openPanel": return {
|
|
37
|
+
kind: "openPanel",
|
|
38
|
+
params: {
|
|
39
|
+
id: e.id,
|
|
40
|
+
component: e.component,
|
|
41
|
+
...e.title ? { title: e.title } : {},
|
|
42
|
+
...e.params ? { params: e.params } : {}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
case "expandToFile": return {
|
|
46
|
+
kind: "expandToFile",
|
|
47
|
+
params: { path: e.path }
|
|
48
|
+
};
|
|
49
|
+
}
|
|
38
50
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
51
|
+
function K(e) {
|
|
52
|
+
return `boring-workspace-command:${encodeURIComponent(JSON.stringify(G(e)))}`;
|
|
41
53
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
54
|
+
function Ut(e) {
|
|
55
|
+
return e.button === 0 && !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey;
|
|
44
56
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
children: t
|
|
56
|
-
}
|
|
57
|
-
);
|
|
57
|
+
function Wt({ to: e, children: t, className: n, title: r, href: i, onClick: a }) {
|
|
58
|
+
return /* @__PURE__ */ z("a", {
|
|
59
|
+
href: i ?? K(e),
|
|
60
|
+
className: n,
|
|
61
|
+
title: r,
|
|
62
|
+
onClick: (t) => {
|
|
63
|
+
a?.(t), !(t.defaultPrevented || !Ut(t)) && (t.preventDefault(), y(G(e)));
|
|
64
|
+
},
|
|
65
|
+
children: t
|
|
66
|
+
});
|
|
58
67
|
}
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/plugins/filesystemPlugin/front/data/fileRecords.ts
|
|
70
|
+
function Gt(e, t) {
|
|
71
|
+
return e ? `${e.replace(/\/$/, "")}${t}` : t;
|
|
61
72
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
73
|
+
function Kt() {
|
|
74
|
+
if (typeof window > "u") return;
|
|
75
|
+
let e = window.location.pathname.match(/^\/workspace\/([^/?#]+)/);
|
|
76
|
+
if (e?.[1]) try {
|
|
77
|
+
return decodeURIComponent(e[1]);
|
|
78
|
+
} catch {
|
|
79
|
+
return e[1];
|
|
80
|
+
}
|
|
71
81
|
}
|
|
72
|
-
async function
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return await o.json();
|
|
82
|
+
async function q(e) {
|
|
83
|
+
let t = new URLSearchParams({ path: e.path });
|
|
84
|
+
e.recordSet && t.set("recordSet", e.recordSet), e.offset !== void 0 && t.set("offset", String(e.offset)), e.limit !== void 0 && t.set("limit", String(e.limit)), e.q && t.set("q", e.q);
|
|
85
|
+
let n = { ...e.headers ?? {} }, r = e.workspaceId ?? Kt();
|
|
86
|
+
r && !Object.keys(n).some((e) => e.toLowerCase() === "x-boring-workspace-id") && (n["x-boring-workspace-id"] = r);
|
|
87
|
+
let i = await fetch(Gt(e.apiBaseUrl, `/api/v1/files/records?${t}`), {
|
|
88
|
+
method: "GET",
|
|
89
|
+
headers: n,
|
|
90
|
+
signal: e.signal
|
|
91
|
+
});
|
|
92
|
+
if (!i.ok) throw Error(`readFileRecords failed: HTTP ${i.status}`);
|
|
93
|
+
return await i.json();
|
|
85
94
|
}
|
|
86
|
-
|
|
87
|
-
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/front/hooks/useViewportBreakpoint.ts
|
|
97
|
+
function J(e) {
|
|
98
|
+
return typeof window > "u" ? !1 : window.innerWidth < e;
|
|
88
99
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
function Y(e = 1024) {
|
|
101
|
+
let [t, n] = L(() => J(e));
|
|
102
|
+
return P(() => {
|
|
103
|
+
let t = () => {
|
|
104
|
+
n(J(e));
|
|
105
|
+
};
|
|
106
|
+
return t(), window.addEventListener("resize", t), () => {
|
|
107
|
+
window.removeEventListener("resize", t);
|
|
108
|
+
};
|
|
109
|
+
}, [e]), t;
|
|
99
110
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
o.current = !1;
|
|
117
|
-
}, []);
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/front/hooks/useResponsiveSidebarCollapse.ts
|
|
113
|
+
function X({ isNarrowViewport: e, isCollapsed: t, setCollapsed: n }) {
|
|
114
|
+
let r = I(t), i = I(!1), a = I(null);
|
|
115
|
+
return P(() => {
|
|
116
|
+
r.current = t;
|
|
117
|
+
}, [t]), P(() => {
|
|
118
|
+
let t = a.current, o = t !== !0 && e, s = t === !0 && !e;
|
|
119
|
+
if (a.current = e, e && o && !r.current) {
|
|
120
|
+
i.current = !0, n(!0);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
s && i.current && (i.current = !1, n(!1));
|
|
124
|
+
}, [e, n]), N(() => {
|
|
125
|
+
i.current = !1;
|
|
126
|
+
}, []);
|
|
118
127
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
[e]
|
|
165
|
-
), u = y(
|
|
166
|
-
(l) => {
|
|
167
|
-
e == null || e.activatePanel(l);
|
|
168
|
-
},
|
|
169
|
-
[e]
|
|
170
|
-
), d = y(
|
|
171
|
-
(l) => n.current.some((c) => c.id === l),
|
|
172
|
-
[]
|
|
173
|
-
);
|
|
174
|
-
return { panels: t, open: o, close: i, activate: u, isOpen: d };
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/front/hooks/useArtifactPanels.ts
|
|
130
|
+
function qt(e) {
|
|
131
|
+
let [t, n] = L([]), r = I(t);
|
|
132
|
+
return r.current = t, P(() => {
|
|
133
|
+
if (!e) {
|
|
134
|
+
n([]);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
function t() {
|
|
138
|
+
try {
|
|
139
|
+
let t = e.toJSON(), i = [];
|
|
140
|
+
if (t && typeof t == "object" && "panels" in t) {
|
|
141
|
+
let e = t;
|
|
142
|
+
if (e.panels) for (let [, t] of Object.entries(e.panels)) t.id && i.push({
|
|
143
|
+
id: t.id,
|
|
144
|
+
component: t.contentComponent ?? t.id,
|
|
145
|
+
params: t.params
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
let a = r.current;
|
|
149
|
+
(a.length !== i.length || a.some((e, t) => e.id !== i[t]?.id)) && n(i);
|
|
150
|
+
} catch {}
|
|
151
|
+
}
|
|
152
|
+
t();
|
|
153
|
+
let i = setInterval(t, 500);
|
|
154
|
+
return () => clearInterval(i);
|
|
155
|
+
}, [e]), {
|
|
156
|
+
panels: t,
|
|
157
|
+
open: N((t) => {
|
|
158
|
+
e?.addPanel("artifacts", {
|
|
159
|
+
id: t.id,
|
|
160
|
+
component: t.component,
|
|
161
|
+
params: t.params
|
|
162
|
+
});
|
|
163
|
+
}, [e]),
|
|
164
|
+
close: N((t) => {
|
|
165
|
+
e?.removePanel(t);
|
|
166
|
+
}, [e]),
|
|
167
|
+
activate: N((t) => {
|
|
168
|
+
e?.activatePanel(t);
|
|
169
|
+
}, [e]),
|
|
170
|
+
isOpen: N((e) => r.current.some((t) => t.id === e), [])
|
|
171
|
+
};
|
|
175
172
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/front/hooks/useArtifactRouting.ts
|
|
175
|
+
function Jt(e, t = {}) {
|
|
176
|
+
let n = t.toolPanelMap ?? {}, r = N((e) => n[e], [n]);
|
|
177
|
+
return {
|
|
178
|
+
openForTool: N((t, r) => {
|
|
179
|
+
let i = n[t];
|
|
180
|
+
if (!i) return;
|
|
181
|
+
let a = `artifact-${r.path}`;
|
|
182
|
+
e.isOpen(a) ? e.activate(a) : e.open({
|
|
183
|
+
id: a,
|
|
184
|
+
component: i,
|
|
185
|
+
params: r
|
|
186
|
+
});
|
|
187
|
+
}, [n, e]),
|
|
188
|
+
resolvePanel: r
|
|
189
|
+
};
|
|
190
190
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/front/layout/ResponsiveDockviewShell.tsx
|
|
193
|
+
var Yt = 768, Xt = 1024;
|
|
194
|
+
function Zt(e) {
|
|
195
|
+
return {
|
|
196
|
+
...e,
|
|
197
|
+
groups: e.groups.filter((e) => e.id !== "sidebar")
|
|
198
|
+
};
|
|
197
199
|
}
|
|
198
|
-
function
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
ne,
|
|
296
|
-
{
|
|
297
|
-
side: "left",
|
|
298
|
-
className: "w-[85vw] max-w-sm p-0",
|
|
299
|
-
children: [
|
|
300
|
-
/* @__PURE__ */ g(se, { className: "flex flex-row items-center justify-between border-b border-border px-4 py-3", children: [
|
|
301
|
-
/* @__PURE__ */ g("div", { children: [
|
|
302
|
-
/* @__PURE__ */ r(oe, { children: U }),
|
|
303
|
-
/* @__PURE__ */ r(ie, { className: "sr-only", children: "Responsive sidebar panel" })
|
|
304
|
-
] }),
|
|
305
|
-
d && /* @__PURE__ */ g(
|
|
306
|
-
x,
|
|
307
|
-
{
|
|
308
|
-
type: "button",
|
|
309
|
-
variant: "outline",
|
|
310
|
-
size: "sm",
|
|
311
|
-
onClick: J,
|
|
312
|
-
"aria-label": "Pin sidebar open",
|
|
313
|
-
children: [
|
|
314
|
-
/* @__PURE__ */ r(me, { className: "h-4 w-4" }),
|
|
315
|
-
"Pin"
|
|
316
|
-
]
|
|
317
|
-
}
|
|
318
|
-
)
|
|
319
|
-
] }),
|
|
320
|
-
/* @__PURE__ */ r(
|
|
321
|
-
"div",
|
|
322
|
-
{
|
|
323
|
-
className: "h-full min-h-0 overflow-auto",
|
|
324
|
-
onClickCapture: G,
|
|
325
|
-
children: W ? /* @__PURE__ */ r(de, { fallback: /* @__PURE__ */ r(_, {}), children: /* @__PURE__ */ r(W, {}) }) : /* @__PURE__ */ r(_, {})
|
|
326
|
-
}
|
|
327
|
-
)
|
|
328
|
-
]
|
|
329
|
-
}
|
|
330
|
-
) })
|
|
331
|
-
] });
|
|
200
|
+
function Z({ layout: e, className: t }) {
|
|
201
|
+
let n = A(), r = w(), i = j(), a = Y(Yt), o = Y(Xt), s = o && !a, c = F(() => e.groups.find((e) => e.id === "sidebar" && e.panel), [e])?.panel, l = !!c, u = X({
|
|
202
|
+
isNarrowViewport: l && o,
|
|
203
|
+
isCollapsed: r.collapsed,
|
|
204
|
+
setCollapsed: (e) => i({ collapsed: e })
|
|
205
|
+
}), [d, f] = L(!1);
|
|
206
|
+
P(() => {
|
|
207
|
+
(!l || !a && !s) && f(!1);
|
|
208
|
+
}, [
|
|
209
|
+
l,
|
|
210
|
+
a,
|
|
211
|
+
s
|
|
212
|
+
]);
|
|
213
|
+
let p = l && (a || s && r.collapsed), m = l && !a && (!s || !r.collapsed), h = F(() => m ? e : Zt(e), [m, e]), g = F(() => {
|
|
214
|
+
let e = m ? "inline-sidebar" : "overlay-sidebar", t = h.groups.map((e) => {
|
|
215
|
+
let t = "";
|
|
216
|
+
try {
|
|
217
|
+
t = JSON.stringify(e.params ?? null);
|
|
218
|
+
} catch {
|
|
219
|
+
t = "unserializable";
|
|
220
|
+
}
|
|
221
|
+
return `${e.id}:${e.panel ?? ""}:${t}`;
|
|
222
|
+
}).join(",");
|
|
223
|
+
return `${h.version}:${e}:${t}`;
|
|
224
|
+
}, [h, m]), _ = F(() => n.getComponents(), [n, R(n.subscribe, n.getSnapshot, n.getSnapshot)]), v = c ? _[c] : null, y = c ? n.get(c)?.title ?? "Sidebar" : "Sidebar", b = N(() => {
|
|
225
|
+
f(!0);
|
|
226
|
+
}, []), x = N(() => {
|
|
227
|
+
u(), i({ collapsed: !1 }), f(!1);
|
|
228
|
+
}, [u, i]), S = N(() => {
|
|
229
|
+
u(), i({ collapsed: !0 }), f(!1);
|
|
230
|
+
}, [u, i]), C = N((e) => {
|
|
231
|
+
e.target.closest("[role='treeitem']") && f(!1);
|
|
232
|
+
}, []);
|
|
233
|
+
return /* @__PURE__ */ B("div", {
|
|
234
|
+
className: "relative h-full w-full",
|
|
235
|
+
children: [
|
|
236
|
+
s && l && r.collapsed && /* @__PURE__ */ z("div", {
|
|
237
|
+
className: "pointer-events-none absolute inset-y-0 left-0 z-20 w-10 border-r border-border bg-background/95",
|
|
238
|
+
"aria-hidden": "true"
|
|
239
|
+
}),
|
|
240
|
+
p && /* @__PURE__ */ z("div", {
|
|
241
|
+
className: M("absolute z-30", "left-2 top-2"),
|
|
242
|
+
children: /* @__PURE__ */ z(H, {
|
|
243
|
+
type: "button",
|
|
244
|
+
variant: "outline",
|
|
245
|
+
size: "icon-sm",
|
|
246
|
+
onClick: b,
|
|
247
|
+
"aria-label": a ? "Open sidebar menu" : "Open collapsed sidebar",
|
|
248
|
+
children: z(a ? Nt : V, { className: "h-4 w-4" })
|
|
249
|
+
})
|
|
250
|
+
}),
|
|
251
|
+
s && l && !r.collapsed && /* @__PURE__ */ z("div", {
|
|
252
|
+
className: "absolute left-2 top-2 z-30",
|
|
253
|
+
children: /* @__PURE__ */ z(H, {
|
|
254
|
+
type: "button",
|
|
255
|
+
variant: "outline",
|
|
256
|
+
size: "icon-sm",
|
|
257
|
+
onClick: S,
|
|
258
|
+
"aria-label": "Collapse sidebar",
|
|
259
|
+
children: /* @__PURE__ */ z(V, { className: "h-4 w-4" })
|
|
260
|
+
})
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ z(k, {
|
|
263
|
+
layout: h,
|
|
264
|
+
className: M(t, s && l && r.collapsed && "pl-10")
|
|
265
|
+
}, g),
|
|
266
|
+
p && /* @__PURE__ */ z(Lt, {
|
|
267
|
+
open: d,
|
|
268
|
+
onOpenChange: f,
|
|
269
|
+
children: /* @__PURE__ */ B(Rt, {
|
|
270
|
+
side: "left",
|
|
271
|
+
className: "w-[85vw] max-w-sm p-0",
|
|
272
|
+
children: [/* @__PURE__ */ B(Bt, {
|
|
273
|
+
className: "flex flex-row items-center justify-between border-b border-border px-4 py-3",
|
|
274
|
+
children: [/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z(Vt, { children: y }), /* @__PURE__ */ z(zt, {
|
|
275
|
+
className: "sr-only",
|
|
276
|
+
children: "Responsive sidebar panel"
|
|
277
|
+
})] }), s && /* @__PURE__ */ B(H, {
|
|
278
|
+
type: "button",
|
|
279
|
+
variant: "outline",
|
|
280
|
+
size: "sm",
|
|
281
|
+
onClick: x,
|
|
282
|
+
"aria-label": "Pin sidebar open",
|
|
283
|
+
children: [/* @__PURE__ */ z(Pt, { className: "h-4 w-4" }), "Pin"]
|
|
284
|
+
})]
|
|
285
|
+
}), /* @__PURE__ */ z("div", {
|
|
286
|
+
className: "h-full min-h-0 overflow-auto",
|
|
287
|
+
onClickCapture: C,
|
|
288
|
+
children: v ? /* @__PURE__ */ z(kt, {
|
|
289
|
+
fallback: /* @__PURE__ */ z(Q, {}),
|
|
290
|
+
children: /* @__PURE__ */ z(v, {})
|
|
291
|
+
}) : /* @__PURE__ */ z(Q, {})
|
|
292
|
+
})]
|
|
293
|
+
})
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
});
|
|
332
297
|
}
|
|
333
|
-
function
|
|
334
|
-
|
|
298
|
+
function Q() {
|
|
299
|
+
return /* @__PURE__ */ z("div", {
|
|
300
|
+
className: "flex h-full min-h-[240px] items-center justify-center text-sm text-muted-foreground",
|
|
301
|
+
children: "Loading sidebar..."
|
|
302
|
+
});
|
|
335
303
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/front/layout/IdeLayout.tsx
|
|
306
|
+
function $(e = {}) {
|
|
307
|
+
let { sidebar: t = "filetree", center: n = "empty", right: r } = e, i = [{
|
|
308
|
+
id: "sidebar",
|
|
309
|
+
position: "left",
|
|
310
|
+
panel: t,
|
|
311
|
+
locked: !0,
|
|
312
|
+
collapsible: !0,
|
|
313
|
+
collapsedWidth: 40,
|
|
314
|
+
constraints: {
|
|
315
|
+
minWidth: 200,
|
|
316
|
+
maxWidthViewportRatio: .5
|
|
317
|
+
}
|
|
318
|
+
}, {
|
|
319
|
+
id: "center",
|
|
320
|
+
position: "center",
|
|
321
|
+
panel: n,
|
|
322
|
+
dynamic: !0,
|
|
323
|
+
placeholder: "empty",
|
|
324
|
+
constraints: { minWidth: 300 }
|
|
325
|
+
}];
|
|
326
|
+
return r && i.push({
|
|
327
|
+
id: "right",
|
|
328
|
+
position: "right",
|
|
329
|
+
panel: r,
|
|
330
|
+
hideHeader: !0,
|
|
331
|
+
constraints: { minWidth: 250 }
|
|
332
|
+
}), {
|
|
333
|
+
version: "2.0",
|
|
334
|
+
groups: i
|
|
335
|
+
};
|
|
363
336
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
337
|
+
function Qt(e) {
|
|
338
|
+
return /* @__PURE__ */ z(Z, {
|
|
339
|
+
layout: $(e),
|
|
340
|
+
className: e.className
|
|
341
|
+
});
|
|
366
342
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/front/chrome/empty-pane/EmptyPane.tsx
|
|
345
|
+
function $t({ className: e, onOpenFile: t }) {
|
|
346
|
+
return /* @__PURE__ */ z(Ft, {
|
|
347
|
+
className: M("h-full border-0 text-muted-foreground", e),
|
|
348
|
+
title: "No file open",
|
|
349
|
+
description: "Open a file to get started",
|
|
350
|
+
actions: t ? /* @__PURE__ */ z(H, {
|
|
351
|
+
type: "button",
|
|
352
|
+
variant: "outline",
|
|
353
|
+
onClick: t,
|
|
354
|
+
children: "Open file"
|
|
355
|
+
}) : null,
|
|
356
|
+
children: /* @__PURE__ */ B("div", {
|
|
357
|
+
className: "space-y-2 text-sm",
|
|
358
|
+
children: [
|
|
359
|
+
/* @__PURE__ */ B("div", {
|
|
360
|
+
className: "flex items-center gap-3",
|
|
361
|
+
children: [/* @__PURE__ */ z(W, { children: "⌘P" }), /* @__PURE__ */ z("span", { children: "Open file" })]
|
|
362
|
+
}),
|
|
363
|
+
/* @__PURE__ */ B("div", {
|
|
364
|
+
className: "flex items-center gap-3",
|
|
365
|
+
children: [/* @__PURE__ */ z(W, { children: "⌘⇧P" }), /* @__PURE__ */ z("span", { children: "Command palette" })]
|
|
366
|
+
}),
|
|
367
|
+
/* @__PURE__ */ B("div", {
|
|
368
|
+
className: "flex items-center gap-3",
|
|
369
|
+
children: [/* @__PURE__ */ z(W, { children: "⌘B" }), /* @__PURE__ */ z("span", { children: "Toggle sidebar" })]
|
|
370
|
+
})
|
|
371
|
+
]
|
|
372
|
+
})
|
|
373
|
+
});
|
|
391
374
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region src/front/components/PanelErrorBoundary.tsx
|
|
377
|
+
var en = class extends Ot {
|
|
378
|
+
state = {
|
|
379
|
+
hasError: !1,
|
|
380
|
+
error: null
|
|
381
|
+
};
|
|
382
|
+
static getDerivedStateFromError(e) {
|
|
383
|
+
return {
|
|
384
|
+
hasError: !0,
|
|
385
|
+
error: e
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
componentDidCatch(e, t) {
|
|
389
|
+
let { panelId: n, onError: r } = this.props;
|
|
390
|
+
console.error(`[PanelErrorBoundary] Panel "${n}" crashed:`, e, t.componentStack), r?.({
|
|
391
|
+
panelId: n,
|
|
392
|
+
error: e.message,
|
|
393
|
+
stack: t.componentStack ?? void 0
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
handleRetry = () => {
|
|
397
|
+
this.setState({
|
|
398
|
+
hasError: !1,
|
|
399
|
+
error: null
|
|
400
|
+
});
|
|
401
|
+
};
|
|
402
|
+
render() {
|
|
403
|
+
return this.state.hasError ? /* @__PURE__ */ z("div", {
|
|
404
|
+
className: "flex h-full items-center justify-center p-6",
|
|
405
|
+
children: /* @__PURE__ */ z(It, {
|
|
406
|
+
className: "w-full max-w-md",
|
|
407
|
+
title: "Something went wrong",
|
|
408
|
+
description: /* @__PURE__ */ B(At, { children: [
|
|
409
|
+
"Panel ",
|
|
410
|
+
/* @__PURE__ */ z("code", {
|
|
411
|
+
className: "rounded bg-muted px-1 py-0.5 text-xs",
|
|
412
|
+
children: this.props.panelId
|
|
413
|
+
}),
|
|
414
|
+
" ",
|
|
415
|
+
"encountered an error."
|
|
416
|
+
] }),
|
|
417
|
+
details: this.state.error?.message,
|
|
418
|
+
actions: /* @__PURE__ */ z(H, {
|
|
419
|
+
type: "button",
|
|
420
|
+
variant: "outline",
|
|
421
|
+
onClick: this.handleRetry,
|
|
422
|
+
children: "Retry"
|
|
423
|
+
})
|
|
424
|
+
})
|
|
425
|
+
}) : this.props.children;
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/front/components/SessionList.tsx
|
|
430
|
+
function tn({ sessions: e, activeId: t, onSwitch: n, onCreate: r, onDelete: i, className: a }) {
|
|
431
|
+
let [o, s] = L(null), c = I({}), l = F(() => e.map((e) => e.id), [e]);
|
|
432
|
+
P(() => {
|
|
433
|
+
if (l.length === 0) {
|
|
434
|
+
s(null);
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
s((e) => e && l.includes(e) ? e : t && l.includes(t) ? t : l[0] ?? null);
|
|
438
|
+
}, [l, t]);
|
|
439
|
+
let u = N((e) => {
|
|
440
|
+
s(e), c.current[e]?.focus();
|
|
441
|
+
}, []), d = N((e, t) => {
|
|
442
|
+
if (e.target !== e.currentTarget) return;
|
|
443
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
444
|
+
e.preventDefault(), n?.(t);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
let r = l.indexOf(t);
|
|
448
|
+
if (r < 0) return;
|
|
449
|
+
let i = r;
|
|
450
|
+
if (e.key === "ArrowDown") i = Math.min(r + 1, l.length - 1);
|
|
451
|
+
else if (e.key === "ArrowUp") i = Math.max(r - 1, 0);
|
|
452
|
+
else if (e.key === "Home") i = 0;
|
|
453
|
+
else if (e.key === "End") i = l.length - 1;
|
|
454
|
+
else return;
|
|
455
|
+
e.preventDefault();
|
|
456
|
+
let a = l[i];
|
|
457
|
+
a && u(a);
|
|
458
|
+
}, [
|
|
459
|
+
u,
|
|
460
|
+
n,
|
|
461
|
+
l
|
|
462
|
+
]);
|
|
463
|
+
return /* @__PURE__ */ B("div", {
|
|
464
|
+
"data-boring-workspace-part": "session-list",
|
|
465
|
+
className: M("flex h-full flex-col", a),
|
|
466
|
+
role: "navigation",
|
|
467
|
+
"aria-label": "Sessions",
|
|
468
|
+
children: [/* @__PURE__ */ B("div", {
|
|
469
|
+
className: "flex items-center justify-between border-b border-border px-3 py-2",
|
|
470
|
+
children: [/* @__PURE__ */ z("span", {
|
|
471
|
+
className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
472
|
+
children: "Sessions"
|
|
473
|
+
}), r && /* @__PURE__ */ z(U, {
|
|
474
|
+
type: "button",
|
|
475
|
+
variant: "ghost",
|
|
476
|
+
size: "icon-xs",
|
|
477
|
+
onClick: r,
|
|
478
|
+
"aria-label": "New session",
|
|
479
|
+
children: /* @__PURE__ */ z("svg", {
|
|
480
|
+
width: "16",
|
|
481
|
+
height: "16",
|
|
482
|
+
viewBox: "0 0 16 16",
|
|
483
|
+
fill: "none",
|
|
484
|
+
stroke: "currentColor",
|
|
485
|
+
strokeWidth: "1.5",
|
|
486
|
+
strokeLinecap: "round",
|
|
487
|
+
children: /* @__PURE__ */ z("path", { d: "M8 3v10M3 8h10" })
|
|
488
|
+
})
|
|
489
|
+
})]
|
|
490
|
+
}), /* @__PURE__ */ B("div", {
|
|
491
|
+
className: "flex-1 overflow-y-auto",
|
|
492
|
+
role: "list",
|
|
493
|
+
"aria-label": "Session list",
|
|
494
|
+
children: [e.length === 0 && /* @__PURE__ */ z("div", {
|
|
495
|
+
className: "px-3 py-6 text-center text-sm text-muted-foreground",
|
|
496
|
+
children: "No sessions"
|
|
497
|
+
}), e.map((e) => /* @__PURE__ */ z(rn, {
|
|
498
|
+
session: e,
|
|
499
|
+
isActive: e.id === t,
|
|
500
|
+
isFocused: e.id === o,
|
|
501
|
+
onSwitch: n,
|
|
502
|
+
onDelete: i,
|
|
503
|
+
onFocus: () => s(e.id),
|
|
504
|
+
onKeyDown: d,
|
|
505
|
+
rowRef: (t) => {
|
|
506
|
+
c.current[e.id] = t;
|
|
507
|
+
}
|
|
508
|
+
}, e.id))]
|
|
509
|
+
})]
|
|
510
|
+
});
|
|
521
511
|
}
|
|
522
|
-
async function
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
} finally {
|
|
537
|
-
document.body.removeChild(t);
|
|
538
|
-
}
|
|
512
|
+
async function nn(e) {
|
|
513
|
+
if (typeof navigator < "u" && navigator.clipboard?.writeText) try {
|
|
514
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
515
|
+
} catch {}
|
|
516
|
+
if (typeof document > "u") return !1;
|
|
517
|
+
let t = document.createElement("textarea");
|
|
518
|
+
t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.top = "-9999px", t.style.left = "-9999px", t.style.opacity = "0", t.style.pointerEvents = "none", document.body.appendChild(t);
|
|
519
|
+
try {
|
|
520
|
+
return t.focus(), t.select(), document.execCommand?.("copy") ?? !1;
|
|
521
|
+
} catch {
|
|
522
|
+
return !1;
|
|
523
|
+
} finally {
|
|
524
|
+
document.body.removeChild(t);
|
|
525
|
+
}
|
|
539
526
|
}
|
|
540
|
-
function
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
size: "icon-xs",
|
|
602
|
-
className: "hidden shrink-0 text-muted-foreground hover:text-destructive group-hover:inline-flex group-data-[focused=true]:inline-flex",
|
|
603
|
-
onClick: (f) => {
|
|
604
|
-
f.stopPropagation(), o(e.id);
|
|
605
|
-
},
|
|
606
|
-
tabIndex: a ? 0 : -1,
|
|
607
|
-
"aria-label": `Delete ${e.title}`,
|
|
608
|
-
children: /* @__PURE__ */ r(
|
|
609
|
-
"svg",
|
|
610
|
-
{
|
|
611
|
-
width: "14",
|
|
612
|
-
height: "14",
|
|
613
|
-
viewBox: "0 0 14 14",
|
|
614
|
-
fill: "none",
|
|
615
|
-
stroke: "currentColor",
|
|
616
|
-
strokeWidth: "1.5",
|
|
617
|
-
strokeLinecap: "round",
|
|
618
|
-
children: /* @__PURE__ */ r("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" })
|
|
619
|
-
}
|
|
620
|
-
)
|
|
621
|
-
}
|
|
622
|
-
)
|
|
623
|
-
]
|
|
624
|
-
}
|
|
625
|
-
);
|
|
527
|
+
function rn({ session: e, isActive: t, isFocused: n, onSwitch: r, onDelete: i, onFocus: a, onKeyDown: o, rowRef: s }) {
|
|
528
|
+
let [c, l] = L(!1), u = N((t) => {
|
|
529
|
+
t.stopPropagation(), nn(e.id).then((e) => {
|
|
530
|
+
e && (l(!0), window.setTimeout(() => l(!1), 1200));
|
|
531
|
+
});
|
|
532
|
+
}, [e.id]);
|
|
533
|
+
return /* @__PURE__ */ B("div", {
|
|
534
|
+
ref: s,
|
|
535
|
+
role: "listitem",
|
|
536
|
+
"data-boring-workspace-part": "session-row",
|
|
537
|
+
"data-boring-state": t ? "selected" : void 0,
|
|
538
|
+
"data-focused": n ? "true" : "false",
|
|
539
|
+
className: M("group flex items-center gap-2 border-b border-border px-3 py-2 text-sm cursor-pointer transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1", t ? "bg-accent text-accent-foreground" : "text-foreground hover:bg-accent/50"),
|
|
540
|
+
onClick: () => r?.(e.id),
|
|
541
|
+
onFocus: a,
|
|
542
|
+
onKeyDown: (t) => o(t, e.id),
|
|
543
|
+
tabIndex: n ? 0 : -1,
|
|
544
|
+
"aria-current": t ? "true" : void 0,
|
|
545
|
+
children: [
|
|
546
|
+
/* @__PURE__ */ z("span", {
|
|
547
|
+
className: "flex-1 truncate",
|
|
548
|
+
children: e.title
|
|
549
|
+
}),
|
|
550
|
+
/* @__PURE__ */ z(U, {
|
|
551
|
+
type: "button",
|
|
552
|
+
variant: "ghost",
|
|
553
|
+
size: "icon-xs",
|
|
554
|
+
className: "hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:inline-flex group-data-[focused=true]:inline-flex",
|
|
555
|
+
onClick: u,
|
|
556
|
+
tabIndex: n ? 0 : -1,
|
|
557
|
+
"aria-label": `Copy Pi session id for ${e.title}`,
|
|
558
|
+
title: "Copy Pi session id",
|
|
559
|
+
children: z(c ? jt : Mt, { className: "h-3.5 w-3.5" })
|
|
560
|
+
}),
|
|
561
|
+
t && /* @__PURE__ */ z("span", {
|
|
562
|
+
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary",
|
|
563
|
+
"aria-label": "Active"
|
|
564
|
+
}),
|
|
565
|
+
i && /* @__PURE__ */ z(U, {
|
|
566
|
+
type: "button",
|
|
567
|
+
variant: "ghost",
|
|
568
|
+
size: "icon-xs",
|
|
569
|
+
className: "hidden shrink-0 text-muted-foreground hover:text-destructive group-hover:inline-flex group-data-[focused=true]:inline-flex",
|
|
570
|
+
onClick: (t) => {
|
|
571
|
+
t.stopPropagation(), i(e.id);
|
|
572
|
+
},
|
|
573
|
+
tabIndex: n ? 0 : -1,
|
|
574
|
+
"aria-label": `Delete ${e.title}`,
|
|
575
|
+
children: /* @__PURE__ */ z("svg", {
|
|
576
|
+
width: "14",
|
|
577
|
+
height: "14",
|
|
578
|
+
viewBox: "0 0 14 14",
|
|
579
|
+
fill: "none",
|
|
580
|
+
stroke: "currentColor",
|
|
581
|
+
strokeWidth: "1.5",
|
|
582
|
+
strokeLinecap: "round",
|
|
583
|
+
children: /* @__PURE__ */ z("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" })
|
|
584
|
+
})
|
|
585
|
+
})
|
|
586
|
+
]
|
|
587
|
+
});
|
|
626
588
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
Je as CatalogRegistry,
|
|
630
|
-
Ka as ChatLayout,
|
|
631
|
-
Ve as CodeEditor,
|
|
632
|
-
Ge as CodeEditorPane,
|
|
633
|
-
Xe as CommandPalette,
|
|
634
|
-
Qe as CommandRegistry,
|
|
635
|
-
te as DockviewShell,
|
|
636
|
-
$e as EmptyPane,
|
|
637
|
-
qa as FileTree,
|
|
638
|
-
Ye as FileTreePane,
|
|
639
|
-
Ze as FileTreeView,
|
|
640
|
-
Ae as IdeLayout,
|
|
641
|
-
et as MAX_PANELS,
|
|
642
|
-
Va as MarkdownEditor,
|
|
643
|
-
tt as MarkdownEditorPane,
|
|
644
|
-
at as PanelChrome,
|
|
645
|
-
je as PanelErrorBoundary,
|
|
646
|
-
rt as PanelRegistry,
|
|
647
|
-
nt as PluginError,
|
|
648
|
-
st as PluginErrorBoundary,
|
|
649
|
-
ot as PluginErrorProvider,
|
|
650
|
-
it as RegistryProvider,
|
|
651
|
-
we as ResponsiveDockviewShell,
|
|
652
|
-
lt as SessionBrowser,
|
|
653
|
-
ze as SessionList,
|
|
654
|
-
ct as SurfaceResolverRegistry,
|
|
655
|
-
dt as SurfaceShell,
|
|
656
|
-
ut as ThemeProvider,
|
|
657
|
-
ja as Toaster,
|
|
658
|
-
_a as TopBar,
|
|
659
|
-
pt as UI_COMMAND_EVENT,
|
|
660
|
-
mt as WORKSPACE_ATTENTION_ACTION_EVENT,
|
|
661
|
-
ft as WORKSPACE_COMPOSER_STOP_EVENT,
|
|
662
|
-
ht as WORKSPACE_COMPOSER_STOP_REASONS,
|
|
663
|
-
gt as WORKSPACE_OPEN_PATH_SURFACE_KIND,
|
|
664
|
-
yt as WORKSPACE_SURFACE_OPEN_SKIPPED_EVENT,
|
|
665
|
-
bt as WorkbenchLeftPane,
|
|
666
|
-
kt as WorkspaceFilesProvider,
|
|
667
|
-
Be as WorkspaceLink,
|
|
668
|
-
Da as WorkspaceLoadingState,
|
|
669
|
-
St as WorkspacePluginClientProvider,
|
|
670
|
-
vt as WorkspaceProvider,
|
|
671
|
-
Pt as WorkspaceSourceRegistry,
|
|
672
|
-
xt as agentMeta,
|
|
673
|
-
wt as bindStore,
|
|
674
|
-
Ct as bootstrap,
|
|
675
|
-
Aa as buildChatLayout,
|
|
676
|
-
Et as buildFullPagePanelHref,
|
|
677
|
-
Ce as buildIdeLayout,
|
|
678
|
-
Nt as closePanelSchema,
|
|
679
|
-
C as cn,
|
|
680
|
-
Rt as createBridge,
|
|
681
|
-
Tt as createBridgeClient,
|
|
682
|
-
Ot as createShadcnTheme,
|
|
683
|
-
It as createWorkspacePluginClient,
|
|
684
|
-
Wt as createWorkspaceStore,
|
|
685
|
-
Ft as definePanel,
|
|
686
|
-
za as dismissToast,
|
|
687
|
-
Lt as emitAgentData,
|
|
688
|
-
Mt as emitFilesystemAgentFileChange,
|
|
689
|
-
Bt as emitWorkspaceAttentionAction,
|
|
690
|
-
Kt as emitWorkspaceComposerStop,
|
|
691
|
-
_t as events,
|
|
692
|
-
Dt as expandToFileSchema,
|
|
693
|
-
At as filesystemEvents,
|
|
694
|
-
$t as filesystemPlugin,
|
|
695
|
-
jt as formatShortcut,
|
|
696
|
-
zt as getFileIcon,
|
|
697
|
-
Ht as isWorkspaceComposerStopDetail,
|
|
698
|
-
Ut as isWorkspaceComposerStopReason,
|
|
699
|
-
qt as navigateToLineSchema,
|
|
700
|
-
Jt as notificationSchema,
|
|
701
|
-
Vt as onFilesystemChanged,
|
|
702
|
-
Gt as openFileSchema,
|
|
703
|
-
Xt as openPanelSchema,
|
|
704
|
-
Y as postUiCommand,
|
|
705
|
-
Ke as readFileRecords,
|
|
706
|
-
Ha as toast,
|
|
707
|
-
Qt as useActiveFile,
|
|
708
|
-
Yt as useActivePanel,
|
|
709
|
-
Me as useActivePanels,
|
|
710
|
-
Zt as useApiBaseUrl,
|
|
711
|
-
_e as useArtifactPanels,
|
|
712
|
-
De as useArtifactRouting,
|
|
713
|
-
ea as useAutoOpenAgentFiles,
|
|
714
|
-
ta as useCatalogRegistry,
|
|
715
|
-
aa as useCatalogs,
|
|
716
|
-
ra as useCommandRegistry,
|
|
717
|
-
na as useCommands,
|
|
718
|
-
sa as useDirtyFiles,
|
|
719
|
-
oa as useDockviewApi,
|
|
720
|
-
ia as useEditorLifecycle,
|
|
721
|
-
la as useEvent,
|
|
722
|
-
ca as useFilePane,
|
|
723
|
-
da as useFullPagePanelHref,
|
|
724
|
-
ua as useHasWorkspaceFilesProvider,
|
|
725
|
-
pa as useHydrationComplete,
|
|
726
|
-
ma as useIsFullPagePanel,
|
|
727
|
-
fa as useKeyboardShortcuts,
|
|
728
|
-
ha as useOpenPanels,
|
|
729
|
-
ga as usePanelRenderMode,
|
|
730
|
-
ya as usePluginErrors,
|
|
731
|
-
D as useRegistry,
|
|
732
|
-
ba as useResetLayout,
|
|
733
|
-
Se as useResponsiveSidebarCollapse,
|
|
734
|
-
ee as useSetSidebar,
|
|
735
|
-
Z as useSidebarState,
|
|
736
|
-
ka as useSurfaceResolverRegistry,
|
|
737
|
-
Sa as useTheme,
|
|
738
|
-
va as useThemePreference,
|
|
739
|
-
K as useViewportBreakpoint,
|
|
740
|
-
Pa as useWorkspaceAttention,
|
|
741
|
-
xa as useWorkspaceBridge,
|
|
742
|
-
wa as useWorkspaceChatPanel,
|
|
743
|
-
Ca as useWorkspaceContext,
|
|
744
|
-
Ea as useWorkspaceContextOptional,
|
|
745
|
-
Na as useWorkspaceLeftPaneActions,
|
|
746
|
-
Ra as useWorkspacePluginClient,
|
|
747
|
-
Ta as useWorkspaceRequestId,
|
|
748
|
-
Oa as useWorkspaceSourceRegistry,
|
|
749
|
-
Ia as userMeta,
|
|
750
|
-
Wa as workspaceAttentionSessionBadgeForBlocker,
|
|
751
|
-
Fa as workspaceComposerStopAppliesToSession,
|
|
752
|
-
La as workspaceComposerStopTargetSessionId,
|
|
753
|
-
Ma as workspaceEvents,
|
|
754
|
-
$ as workspaceLinkCommand,
|
|
755
|
-
ge as workspaceLinkHref
|
|
756
|
-
};
|
|
589
|
+
//#endregion
|
|
590
|
+
export { ot as ArtifactSurfacePane, ut as CatalogRegistry, wt as ChatLayout, E as CodeEditor, e as CodeEditorPane, f as CommandPalette, le as CommandRegistry, k as DockviewShell, $t as EmptyPane, Dt as FileTree, ze as FileTreePane, ct as FileTreeView, Qt as IdeLayout, g as MAX_PANELS, bt as MarkdownEditor, ee as MarkdownEditorPane, Ve as PanelChrome, en as PanelErrorBoundary, n as PanelRegistry, mt as PluginError, _e as PluginErrorBoundary, Ke as PluginErrorProvider, st as RegistryProvider, Z as ResponsiveDockviewShell, ke as SessionBrowser, tn as SessionList, De as SurfaceResolverRegistry, Le as SurfaceShell, it as ThemeProvider, Te as Toaster, Ct as TopBar, m as UI_COMMAND_EVENT, lt as WORKSPACE_ATTENTION_ACTION_EVENT, i as WORKSPACE_COMPOSER_STOP_EVENT, ft as WORKSPACE_COMPOSER_STOP_REASONS, s as WORKSPACE_OPEN_PATH_SURFACE_KIND, ce as WORKSPACE_SURFACE_OPEN_SKIPPED_EVENT, Ce as WorkbenchLeftPane, Pe as WorkspaceFilesProvider, Wt as WorkspaceLink, Tt as WorkspaceLoadingState, Ue as WorkspacePluginClientProvider, He as WorkspaceProvider, me as WorkspaceSourceRegistry, se as agentMeta, he as bindStore, _t as bootstrap, St as buildChatLayout, d as buildFullPagePanelHref, $ as buildIdeLayout, de as closePanelSchema, M as cn, Ze as createBridge, v as createBridgeClient, at as createShadcnTheme, $e as createWorkspacePluginClient, ae as createWorkspaceStore, Je as definePanel, Ee as dismissToast, yt as emitAgentData, qe as emitFilesystemAgentFileChange, gt as emitWorkspaceAttentionAction, ie as emitWorkspaceComposerStop, ne as events, ue as expandToFileSchema, u as filesystemEvents, fe as filesystemPlugin, et as formatShortcut, Ie as getFileIcon, c as isWorkspaceComposerStopDetail, o as isWorkspaceComposerStopReason, pe as navigateToLineSchema, te as notificationSchema, rt as onFilesystemChanged, t as openFileSchema, T as openPanelSchema, y as postUiCommand, q as readFileRecords, Ye as toast, dt as useActiveFile, vt as useActivePanel, Ht as useActivePanels, b as useApiBaseUrl, xt as useAppLeftOverlayChrome, qt as useArtifactPanels, Jt as useArtifactRouting, Se as useAutoOpenAgentFiles, we as useCatalogRegistry, xe as useCatalogs, O as useCommandRegistry, Re as useCommands, be as useDirtyFiles, Oe as useDockviewApi, ve as useEditorLifecycle, r as useEvent, We as useFilePane, _ as useFullPagePanelHref, x as useHasWorkspaceFilesProvider, ht as useHydrationComplete, Xe as useIsFullPagePanel, Ne as useKeyboardShortcuts, re as useOpenPanels, h as usePanelRenderMode, nt as usePluginErrors, A as useRegistry, a as useResetLayout, X as useResponsiveSidebarCollapse, j as useSetSidebar, w as useSidebarState, Be as useSurfaceResolverRegistry, Qe as useTheme, l as useThemePreference, Y as useViewportBreakpoint, ye as useWorkspaceAttention, je as useWorkspaceBridge, ge as useWorkspaceChatPanel, Ge as useWorkspaceContext, tt as useWorkspaceContextOptional, D as useWorkspaceLeftPaneActions, Me as useWorkspacePluginClient, C as useWorkspaceRequestId, Et as useWorkspaceShellCapabilities, Ae as useWorkspaceSourceRegistry, p as userMeta, pt as workspaceAttentionSessionBadgeForBlocker, S as workspaceComposerStopAppliesToSession, Fe as workspaceComposerStopTargetSessionId, oe as workspaceEvents, G as workspaceLinkCommand, K as workspaceLinkHref };
|