@hachej/boring-workspace 0.1.23 → 0.1.24
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-D8Rmj8Bo.js → FileTree-DjPzfDMq.js} +114 -104
- package/dist/{MarkdownEditor-DKC4gNT4.js → MarkdownEditor-BbSy0bLV.js} +9 -9
- package/dist/{WorkspaceLoadingState-hKrnYCL3.js → WorkspaceLoadingState-fccm3AQg.js} +167 -146
- package/dist/{WorkspaceProvider-Cn0sPgaB.js → WorkspaceProvider-BW4wzbpR.js} +2673 -2385
- package/dist/app-front.d.ts +114 -2
- package/dist/app-front.js +744 -323
- package/dist/app-server.d.ts +3 -3
- package/dist/app-server.js +85 -21
- package/dist/{createInMemoryBridge-CYNW1h_o.d.ts → createInMemoryBridge-DLckqafe.d.ts} +1 -1
- package/dist/events.d.ts +3 -0
- package/dist/{manifest-CyNNdfYz.d.ts → manifest-C2vVgH_e.d.ts} +2 -0
- package/dist/plugin.d.ts +8 -3
- package/dist/plugin.js +3 -2
- package/dist/server.d.ts +11 -4
- package/dist/server.js +37 -18
- package/dist/shared.d.ts +2 -2
- package/dist/{surface-COYagY2m.d.ts → surface-CEEkd81D.d.ts} +1 -0
- package/dist/testing.d.ts +1 -0
- package/dist/testing.js +409 -404
- package/dist/{ui-bridge-CT18yqwN.d.ts → ui-bridge-Bdgl2hR8.d.ts} +2 -0
- package/dist/workspace.css +73 -0
- package/dist/workspace.d.ts +228 -6
- package/dist/workspace.js +188 -179
- package/docs/INTERFACES.md +6 -0
- package/docs/plans/FULL_PAGE_PANEL_ROUTE_SPEC.md +633 -0
- package/package.json +6 -6
package/dist/workspace.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var T = (e, r, t) =>
|
|
4
|
-
import { u as z, a as G, b as Q, D as Y } from "./WorkspaceProvider-
|
|
5
|
-
import { A as ze, C as Ke, c as je, d as $e, e as _e, F as He, f as Ue, M as Ae, g as
|
|
1
|
+
var V = Object.defineProperty;
|
|
2
|
+
var X = (e, r, t) => r in e ? V(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var T = (e, r, t) => X(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { u as z, a as G, b as Q, D as Y } from "./WorkspaceProvider-BW4wzbpR.js";
|
|
5
|
+
import { A as ze, C as Ke, c as je, d as $e, e as _e, F as He, f as Ue, M as Ae, g as qe, P as Je, h as Ve, i as Xe, j as Ge, k as Qe, R as Ye, S as Ze, l as et, m as tt, T as at, U as rt, W as nt, n as st, o as ot, p as it, q as lt, r as ct, s as dt, t as ut, v as pt, w as mt, x as ht, y as ft, z as gt, B as bt, E as yt, G as vt, H as xt, I as Pt, J as St, K as kt, L as Ct, N as wt, O as Nt, Q as Et, V as Rt, X as Tt, Y as It, Z as Ot, _ as Ft, $ as Mt, a0 as Lt, a1 as Bt, a2 as Wt, a3 as Dt, a4 as zt, a5 as Kt, a6 as jt, a7 as $t, a8 as _t, a9 as Ht, aa as Ut, ab as At, ac as qt, ad as Jt, ae as Vt, af as Xt, ag as Gt, ah as Qt, ai as Yt, aj as Zt, ak as ea, al as ta, am as aa, an as ra, ao as na, ap as sa, aq as oa, ar as ia } from "./WorkspaceProvider-BW4wzbpR.js";
|
|
6
6
|
import { c as w } from "./utils-B6yFEsav.js";
|
|
7
|
-
import { C as
|
|
8
|
-
import { jsxs as b, jsx as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { Toaster as
|
|
11
|
-
import { useSyncExternalStore as K, useState as N, useEffect as
|
|
12
|
-
import { C as
|
|
13
|
-
import { FileTree as
|
|
14
|
-
import { MarkdownEditor as
|
|
7
|
+
import { C as ca, T as da, W as ua, b as pa } from "./WorkspaceLoadingState-fccm3AQg.js";
|
|
8
|
+
import { jsxs as b, jsx as a, Fragment as Z } from "react/jsx-runtime";
|
|
9
|
+
import { Button as k, Sheet as ee, SheetContent as te, SheetHeader as ae, SheetTitle as re, SheetDescription as ne, EmptyState as se, Kbd as I, ErrorState as oe, IconButton as O } from "@hachej/boring-ui-kit";
|
|
10
|
+
import { Toaster as ha, dismissToast as fa, toast as ga } from "@hachej/boring-ui-kit";
|
|
11
|
+
import { useSyncExternalStore as K, useState as N, useEffect as P, useRef as C, useCallback as y, useMemo as S, Suspense as ie, Component as le } from "react";
|
|
12
|
+
import { C as ya, c as va } from "./CodeEditor-DQqOn4xz.js";
|
|
13
|
+
import { FileTree as Pa } from "./FileTree-DjPzfDMq.js";
|
|
14
|
+
import { MarkdownEditor as ka } from "./MarkdownEditor-BbSy0bLV.js";
|
|
15
15
|
import { MenuIcon as ce, PanelLeftOpenIcon as de, PanelLeftCloseIcon as ue, PinIcon as pe, CheckIcon as me, CopyIcon as he } from "lucide-react";
|
|
16
|
-
import { d as
|
|
16
|
+
import { d as wa } from "./panel-DnvDNQac.js";
|
|
17
17
|
function Te() {
|
|
18
18
|
const e = z();
|
|
19
19
|
return K(e.subscribe, e.getSnapshot);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function B(e) {
|
|
22
22
|
return typeof window > "u" ? !1 : window.innerWidth < e;
|
|
23
23
|
}
|
|
24
24
|
function W(e = 1024) {
|
|
25
|
-
const [r, t] = N(() =>
|
|
26
|
-
return
|
|
25
|
+
const [r, t] = N(() => B(e));
|
|
26
|
+
return P(() => {
|
|
27
27
|
const s = () => {
|
|
28
|
-
t(
|
|
28
|
+
t(B(e));
|
|
29
29
|
};
|
|
30
30
|
return s(), window.addEventListener("resize", s), () => {
|
|
31
31
|
window.removeEventListener("resize", s);
|
|
@@ -37,10 +37,10 @@ function fe({
|
|
|
37
37
|
isCollapsed: r,
|
|
38
38
|
setCollapsed: t
|
|
39
39
|
}) {
|
|
40
|
-
const s =
|
|
41
|
-
return
|
|
40
|
+
const s = C(r), l = C(!1), i = C(null);
|
|
41
|
+
return P(() => {
|
|
42
42
|
s.current = r;
|
|
43
|
-
}, [r]),
|
|
43
|
+
}, [r]), P(() => {
|
|
44
44
|
const g = i.current, d = g !== !0 && e, o = g === !0 && !e;
|
|
45
45
|
if (i.current = e, e && d && !s.current) {
|
|
46
46
|
l.current = !0, t(!0);
|
|
@@ -51,9 +51,9 @@ function fe({
|
|
|
51
51
|
l.current = !1;
|
|
52
52
|
}, []);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const [r, t] = N([]), s =
|
|
56
|
-
s.current = r,
|
|
54
|
+
function Ie(e) {
|
|
55
|
+
const [r, t] = N([]), s = C(r);
|
|
56
|
+
s.current = r, P(() => {
|
|
57
57
|
if (!e) {
|
|
58
58
|
t([]);
|
|
59
59
|
return;
|
|
@@ -71,8 +71,8 @@ function Oe(e) {
|
|
|
71
71
|
params: m.params
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
(
|
|
74
|
+
const n = s.current;
|
|
75
|
+
(n.length !== h.length || n.some((f, m) => {
|
|
76
76
|
var v;
|
|
77
77
|
return f.id !== ((v = h[m]) == null ? void 0 : v.id);
|
|
78
78
|
})) && t(h);
|
|
@@ -108,7 +108,7 @@ function Oe(e) {
|
|
|
108
108
|
);
|
|
109
109
|
return { panels: r, open: l, close: i, activate: g, isOpen: d };
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function Oe(e, r = {}) {
|
|
112
112
|
const t = r.toolPanelMap ?? {}, s = y(
|
|
113
113
|
(i) => t[i],
|
|
114
114
|
[t]
|
|
@@ -135,22 +135,22 @@ function ve({
|
|
|
135
135
|
className: r
|
|
136
136
|
}) {
|
|
137
137
|
var M;
|
|
138
|
-
const t = z(), s = G(), l = Q(), i = W(ge), g = W(be), d = g && !i, o =
|
|
138
|
+
const t = z(), s = G(), l = Q(), i = W(ge), g = W(be), d = g && !i, o = S(
|
|
139
139
|
() => e.groups.find((x) => x.id === "sidebar" && x.panel),
|
|
140
140
|
[e]
|
|
141
141
|
), c = o == null ? void 0 : o.panel, u = !!c, h = fe({
|
|
142
142
|
isNarrowViewport: u && g,
|
|
143
143
|
isCollapsed: s.collapsed,
|
|
144
144
|
setCollapsed: (x) => l({ collapsed: x })
|
|
145
|
-
}), [
|
|
146
|
-
|
|
145
|
+
}), [n, p] = N(!1);
|
|
146
|
+
P(() => {
|
|
147
147
|
(!u || !i && !d) && p(!1);
|
|
148
148
|
}, [u, i, d]);
|
|
149
|
-
const f = u && (i || d && s.collapsed), m = u && !i && (!d || !s.collapsed), v =
|
|
149
|
+
const f = u && (i || d && s.collapsed), m = u && !i && (!d || !s.collapsed), v = S(
|
|
150
150
|
() => m ? e : ye(e),
|
|
151
151
|
[m, e]
|
|
152
|
-
), j =
|
|
153
|
-
const x = m ? "inline-sidebar" : "overlay-sidebar",
|
|
152
|
+
), j = S(() => {
|
|
153
|
+
const x = m ? "inline-sidebar" : "overlay-sidebar", L = v.groups.map((E) => {
|
|
154
154
|
let R = "";
|
|
155
155
|
try {
|
|
156
156
|
R = JSON.stringify(E.params ?? null);
|
|
@@ -159,63 +159,63 @@ function ve({
|
|
|
159
159
|
}
|
|
160
160
|
return `${E.id}:${E.panel ?? ""}:${R}`;
|
|
161
161
|
}).join(",");
|
|
162
|
-
return `${v.version}:${x}:${
|
|
162
|
+
return `${v.version}:${x}:${L}`;
|
|
163
163
|
}, [v, m]), $ = K(
|
|
164
164
|
t.subscribe,
|
|
165
165
|
t.getSnapshot,
|
|
166
166
|
t.getSnapshot
|
|
167
|
-
), _ =
|
|
167
|
+
), _ = S(() => t.getComponents(), [t, $]), F = c ? _[c] : null, H = c ? ((M = t.get(c)) == null ? void 0 : M.title) ?? "Sidebar" : "Sidebar", U = y(() => {
|
|
168
168
|
p(!0);
|
|
169
169
|
}, []), A = y(() => {
|
|
170
170
|
h(), l({ collapsed: !1 }), p(!1);
|
|
171
|
-
}, [h, l]),
|
|
171
|
+
}, [h, l]), q = y(() => {
|
|
172
172
|
h(), l({ collapsed: !0 }), p(!1);
|
|
173
|
-
}, [h, l]),
|
|
173
|
+
}, [h, l]), J = y(
|
|
174
174
|
(x) => {
|
|
175
175
|
x.target.closest("[role='treeitem']") && p(!1);
|
|
176
176
|
},
|
|
177
177
|
[]
|
|
178
178
|
);
|
|
179
179
|
return /* @__PURE__ */ b("div", { className: "relative h-full w-full", children: [
|
|
180
|
-
d && u && s.collapsed && /* @__PURE__ */
|
|
180
|
+
d && u && s.collapsed && /* @__PURE__ */ a(
|
|
181
181
|
"div",
|
|
182
182
|
{
|
|
183
183
|
className: "pointer-events-none absolute inset-y-0 left-0 z-20 w-10 border-r border-border bg-background/95",
|
|
184
184
|
"aria-hidden": "true"
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
f && /* @__PURE__ */
|
|
187
|
+
f && /* @__PURE__ */ a(
|
|
188
188
|
"div",
|
|
189
189
|
{
|
|
190
190
|
className: w(
|
|
191
191
|
"absolute z-30",
|
|
192
192
|
i ? "left-2 top-2" : "left-1 top-2"
|
|
193
193
|
),
|
|
194
|
-
children: /* @__PURE__ */
|
|
195
|
-
|
|
194
|
+
children: /* @__PURE__ */ a(
|
|
195
|
+
k,
|
|
196
196
|
{
|
|
197
197
|
type: "button",
|
|
198
198
|
variant: "outline",
|
|
199
199
|
size: "icon-sm",
|
|
200
200
|
onClick: U,
|
|
201
201
|
"aria-label": i ? "Open sidebar menu" : "Open collapsed sidebar",
|
|
202
|
-
children: i ? /* @__PURE__ */
|
|
202
|
+
children: i ? /* @__PURE__ */ a(ce, { className: "h-4 w-4" }) : /* @__PURE__ */ a(de, { className: "h-4 w-4" })
|
|
203
203
|
}
|
|
204
204
|
)
|
|
205
205
|
}
|
|
206
206
|
),
|
|
207
|
-
d && u && !s.collapsed && /* @__PURE__ */
|
|
208
|
-
|
|
207
|
+
d && u && !s.collapsed && /* @__PURE__ */ a("div", { className: "absolute left-2 top-2 z-30", children: /* @__PURE__ */ a(
|
|
208
|
+
k,
|
|
209
209
|
{
|
|
210
210
|
type: "button",
|
|
211
211
|
variant: "outline",
|
|
212
212
|
size: "icon-sm",
|
|
213
|
-
onClick:
|
|
213
|
+
onClick: q,
|
|
214
214
|
"aria-label": "Collapse sidebar",
|
|
215
|
-
children: /* @__PURE__ */
|
|
215
|
+
children: /* @__PURE__ */ a(ue, { className: "h-4 w-4" })
|
|
216
216
|
}
|
|
217
217
|
) }),
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ a(
|
|
219
219
|
Y,
|
|
220
220
|
{
|
|
221
221
|
layout: v,
|
|
@@ -226,19 +226,19 @@ function ve({
|
|
|
226
226
|
},
|
|
227
227
|
j
|
|
228
228
|
),
|
|
229
|
-
f && /* @__PURE__ */
|
|
229
|
+
f && /* @__PURE__ */ a(ee, { open: n, onOpenChange: p, children: /* @__PURE__ */ b(
|
|
230
230
|
te,
|
|
231
231
|
{
|
|
232
232
|
side: "left",
|
|
233
233
|
className: "w-[85vw] max-w-sm p-0",
|
|
234
234
|
children: [
|
|
235
|
-
/* @__PURE__ */ b(
|
|
235
|
+
/* @__PURE__ */ b(ae, { className: "flex flex-row items-center justify-between border-b border-border px-4 py-3", children: [
|
|
236
236
|
/* @__PURE__ */ b("div", { children: [
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ a(re, { children: H }),
|
|
238
|
+
/* @__PURE__ */ a(ne, { className: "sr-only", children: "Responsive sidebar panel" })
|
|
239
239
|
] }),
|
|
240
240
|
d && /* @__PURE__ */ b(
|
|
241
|
-
|
|
241
|
+
k,
|
|
242
242
|
{
|
|
243
243
|
type: "button",
|
|
244
244
|
variant: "outline",
|
|
@@ -246,18 +246,18 @@ function ve({
|
|
|
246
246
|
onClick: A,
|
|
247
247
|
"aria-label": "Pin sidebar open",
|
|
248
248
|
children: [
|
|
249
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ a(pe, { className: "h-4 w-4" }),
|
|
250
250
|
"Pin"
|
|
251
251
|
]
|
|
252
252
|
}
|
|
253
253
|
)
|
|
254
254
|
] }),
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ a(
|
|
256
256
|
"div",
|
|
257
257
|
{
|
|
258
258
|
className: "h-full min-h-0 overflow-auto",
|
|
259
|
-
onClickCapture:
|
|
260
|
-
children:
|
|
259
|
+
onClickCapture: J,
|
|
260
|
+
children: F ? /* @__PURE__ */ a(ie, { fallback: /* @__PURE__ */ a(D, {}), children: /* @__PURE__ */ a(F, {}) }) : /* @__PURE__ */ a(D, {})
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
]
|
|
@@ -266,7 +266,7 @@ function ve({
|
|
|
266
266
|
] });
|
|
267
267
|
}
|
|
268
268
|
function D() {
|
|
269
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ a("div", { className: "flex h-full min-h-[240px] items-center justify-center text-sm text-muted-foreground", children: "Loading sidebar..." });
|
|
270
270
|
}
|
|
271
271
|
function xe(e = {}) {
|
|
272
272
|
const { sidebar: r = "filetree", center: t = "empty", right: s } = e, l = [
|
|
@@ -296,35 +296,35 @@ function xe(e = {}) {
|
|
|
296
296
|
constraints: { minWidth: 250 }
|
|
297
297
|
}), { version: "2.0", groups: l };
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
return /* @__PURE__ */
|
|
299
|
+
function Fe(e) {
|
|
300
|
+
return /* @__PURE__ */ a(ve, { layout: xe(e), className: e.className });
|
|
301
301
|
}
|
|
302
302
|
function Me({ className: e, onOpenFile: r }) {
|
|
303
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ a(
|
|
304
304
|
se,
|
|
305
305
|
{
|
|
306
306
|
className: w("h-full border-0 text-muted-foreground", e),
|
|
307
307
|
title: "No file open",
|
|
308
308
|
description: "Open a file to get started",
|
|
309
|
-
actions: r ? /* @__PURE__ */
|
|
309
|
+
actions: r ? /* @__PURE__ */ a(k, { type: "button", variant: "outline", onClick: r, children: "Open file" }) : null,
|
|
310
310
|
children: /* @__PURE__ */ b("div", { className: "space-y-2 text-sm", children: [
|
|
311
311
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-3", children: [
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ a(I, { children: "⌘P" }),
|
|
313
|
+
/* @__PURE__ */ a("span", { children: "Open file" })
|
|
314
314
|
] }),
|
|
315
315
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-3", children: [
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ a(I, { children: "⌘⇧P" }),
|
|
317
|
+
/* @__PURE__ */ a("span", { children: "Command palette" })
|
|
318
318
|
] }),
|
|
319
319
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-3", children: [
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ a(I, { children: "⌘B" }),
|
|
321
|
+
/* @__PURE__ */ a("span", { children: "Toggle sidebar" })
|
|
322
322
|
] })
|
|
323
323
|
] })
|
|
324
324
|
}
|
|
325
325
|
);
|
|
326
326
|
}
|
|
327
|
-
class
|
|
327
|
+
class Le extends le {
|
|
328
328
|
constructor() {
|
|
329
329
|
super(...arguments);
|
|
330
330
|
T(this, "state", { hasError: !1, error: null });
|
|
@@ -345,24 +345,24 @@ class Be extends le {
|
|
|
345
345
|
}
|
|
346
346
|
render() {
|
|
347
347
|
var t;
|
|
348
|
-
return this.state.hasError ? /* @__PURE__ */
|
|
348
|
+
return this.state.hasError ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ a(
|
|
349
349
|
oe,
|
|
350
350
|
{
|
|
351
351
|
className: "w-full max-w-md",
|
|
352
352
|
title: "Something went wrong",
|
|
353
353
|
description: /* @__PURE__ */ b(Z, { children: [
|
|
354
354
|
"Panel ",
|
|
355
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ a("code", { className: "rounded bg-muted px-1 py-0.5 text-xs", children: this.props.panelId }),
|
|
356
356
|
" ",
|
|
357
357
|
"encountered an error."
|
|
358
358
|
] }),
|
|
359
359
|
details: (t = this.state.error) == null ? void 0 : t.message,
|
|
360
|
-
actions: /* @__PURE__ */
|
|
360
|
+
actions: /* @__PURE__ */ a(k, { type: "button", variant: "outline", onClick: this.handleRetry, children: "Retry" })
|
|
361
361
|
}
|
|
362
362
|
) }) : this.props.children;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function Be({
|
|
366
366
|
sessions: e,
|
|
367
367
|
activeId: r,
|
|
368
368
|
onSwitch: t,
|
|
@@ -370,38 +370,38 @@ function Fe({
|
|
|
370
370
|
onDelete: l,
|
|
371
371
|
className: i
|
|
372
372
|
}) {
|
|
373
|
-
const [g, d] = N(null), o =
|
|
374
|
-
|
|
373
|
+
const [g, d] = N(null), o = C({}), c = S(() => e.map((n) => n.id), [e]);
|
|
374
|
+
P(() => {
|
|
375
375
|
if (c.length === 0) {
|
|
376
376
|
d(null);
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
379
|
-
d((
|
|
379
|
+
d((n) => n && c.includes(n) ? n : r && c.includes(r) ? r : c[0] ?? null);
|
|
380
380
|
}, [c, r]);
|
|
381
|
-
const u = y((
|
|
381
|
+
const u = y((n) => {
|
|
382
382
|
var p;
|
|
383
|
-
d(
|
|
383
|
+
d(n), (p = o.current[n]) == null || p.focus();
|
|
384
384
|
}, []), h = y(
|
|
385
|
-
(
|
|
386
|
-
if (
|
|
387
|
-
if (
|
|
388
|
-
|
|
385
|
+
(n, p) => {
|
|
386
|
+
if (n.target !== n.currentTarget) return;
|
|
387
|
+
if (n.key === "Enter" || n.key === " ") {
|
|
388
|
+
n.preventDefault(), t == null || t(p);
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
const f = c.indexOf(p);
|
|
392
392
|
if (f < 0) return;
|
|
393
393
|
let m = f;
|
|
394
|
-
if (
|
|
394
|
+
if (n.key === "ArrowDown")
|
|
395
395
|
m = Math.min(f + 1, c.length - 1);
|
|
396
|
-
else if (
|
|
396
|
+
else if (n.key === "ArrowUp")
|
|
397
397
|
m = Math.max(f - 1, 0);
|
|
398
|
-
else if (
|
|
398
|
+
else if (n.key === "Home")
|
|
399
399
|
m = 0;
|
|
400
|
-
else if (
|
|
400
|
+
else if (n.key === "End")
|
|
401
401
|
m = c.length - 1;
|
|
402
402
|
else
|
|
403
403
|
return;
|
|
404
|
-
|
|
404
|
+
n.preventDefault();
|
|
405
405
|
const v = c[m];
|
|
406
406
|
v && u(v);
|
|
407
407
|
},
|
|
@@ -416,8 +416,8 @@ function Fe({
|
|
|
416
416
|
"aria-label": "Sessions",
|
|
417
417
|
children: [
|
|
418
418
|
/* @__PURE__ */ b("div", { className: "flex items-center justify-between border-b border-border px-3 py-2", children: [
|
|
419
|
-
/* @__PURE__ */
|
|
420
|
-
s && /* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ a("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Sessions" }),
|
|
420
|
+
s && /* @__PURE__ */ a(O, { type: "button", variant: "ghost", size: "icon-xs", onClick: s, "aria-label": "New session", children: /* @__PURE__ */ a(
|
|
421
421
|
"svg",
|
|
422
422
|
{
|
|
423
423
|
width: "16",
|
|
@@ -427,34 +427,34 @@ function Fe({
|
|
|
427
427
|
stroke: "currentColor",
|
|
428
428
|
strokeWidth: "1.5",
|
|
429
429
|
strokeLinecap: "round",
|
|
430
|
-
children: /* @__PURE__ */
|
|
430
|
+
children: /* @__PURE__ */ a("path", { d: "M8 3v10M3 8h10" })
|
|
431
431
|
}
|
|
432
432
|
) })
|
|
433
433
|
] }),
|
|
434
434
|
/* @__PURE__ */ b("div", { className: "flex-1 overflow-y-auto", role: "list", "aria-label": "Session list", children: [
|
|
435
|
-
e.length === 0 && /* @__PURE__ */
|
|
436
|
-
e.map((
|
|
437
|
-
|
|
435
|
+
e.length === 0 && /* @__PURE__ */ a("div", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No sessions" }),
|
|
436
|
+
e.map((n) => /* @__PURE__ */ a(
|
|
437
|
+
Pe,
|
|
438
438
|
{
|
|
439
|
-
session:
|
|
440
|
-
isActive:
|
|
441
|
-
isFocused:
|
|
439
|
+
session: n,
|
|
440
|
+
isActive: n.id === r,
|
|
441
|
+
isFocused: n.id === g,
|
|
442
442
|
onSwitch: t,
|
|
443
443
|
onDelete: l,
|
|
444
|
-
onFocus: () => d(
|
|
444
|
+
onFocus: () => d(n.id),
|
|
445
445
|
onKeyDown: h,
|
|
446
446
|
rowRef: (p) => {
|
|
447
|
-
o.current[
|
|
447
|
+
o.current[n.id] = p;
|
|
448
448
|
}
|
|
449
449
|
},
|
|
450
|
-
|
|
450
|
+
n.id
|
|
451
451
|
))
|
|
452
452
|
] })
|
|
453
453
|
]
|
|
454
454
|
}
|
|
455
455
|
);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Pe({
|
|
458
458
|
session: e,
|
|
459
459
|
isActive: r,
|
|
460
460
|
isFocused: t,
|
|
@@ -467,8 +467,8 @@ function Se({
|
|
|
467
467
|
const [o, c] = N(!1), u = y((h) => {
|
|
468
468
|
var p, f;
|
|
469
469
|
h.stopPropagation();
|
|
470
|
-
const
|
|
471
|
-
|
|
470
|
+
const n = (f = (p = navigator.clipboard) == null ? void 0 : p.writeText) == null ? void 0 : f.bind(navigator.clipboard);
|
|
471
|
+
n && n(e.id).then(() => {
|
|
472
472
|
c(!0), window.setTimeout(() => c(!1), 1200);
|
|
473
473
|
});
|
|
474
474
|
}, [e.id]);
|
|
@@ -491,9 +491,9 @@ function Se({
|
|
|
491
491
|
tabIndex: t ? 0 : -1,
|
|
492
492
|
"aria-current": r ? "true" : void 0,
|
|
493
493
|
children: [
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
|
|
494
|
+
/* @__PURE__ */ a("span", { className: "flex-1 truncate", children: e.title }),
|
|
495
|
+
/* @__PURE__ */ a(
|
|
496
|
+
O,
|
|
497
497
|
{
|
|
498
498
|
type: "button",
|
|
499
499
|
variant: "ghost",
|
|
@@ -503,18 +503,18 @@ function Se({
|
|
|
503
503
|
tabIndex: t ? 0 : -1,
|
|
504
504
|
"aria-label": `Copy Pi session id for ${e.title}`,
|
|
505
505
|
title: "Copy Pi session id",
|
|
506
|
-
children: o ? /* @__PURE__ */
|
|
506
|
+
children: o ? /* @__PURE__ */ a(me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(he, { className: "h-3.5 w-3.5" })
|
|
507
507
|
}
|
|
508
508
|
),
|
|
509
|
-
r && /* @__PURE__ */
|
|
509
|
+
r && /* @__PURE__ */ a(
|
|
510
510
|
"span",
|
|
511
511
|
{
|
|
512
512
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary",
|
|
513
513
|
"aria-label": "Active"
|
|
514
514
|
}
|
|
515
515
|
),
|
|
516
|
-
l && /* @__PURE__ */
|
|
517
|
-
|
|
516
|
+
l && /* @__PURE__ */ a(
|
|
517
|
+
O,
|
|
518
518
|
{
|
|
519
519
|
type: "button",
|
|
520
520
|
variant: "ghost",
|
|
@@ -525,7 +525,7 @@ function Se({
|
|
|
525
525
|
},
|
|
526
526
|
tabIndex: t ? 0 : -1,
|
|
527
527
|
"aria-label": `Delete ${e.title}`,
|
|
528
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ a(
|
|
529
529
|
"svg",
|
|
530
530
|
{
|
|
531
531
|
width: "14",
|
|
@@ -535,7 +535,7 @@ function Se({
|
|
|
535
535
|
stroke: "currentColor",
|
|
536
536
|
strokeWidth: "1.5",
|
|
537
537
|
strokeLinecap: "round",
|
|
538
|
-
children: /* @__PURE__ */
|
|
538
|
+
children: /* @__PURE__ */ a("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" })
|
|
539
539
|
}
|
|
540
540
|
)
|
|
541
541
|
}
|
|
@@ -547,99 +547,108 @@ function Se({
|
|
|
547
547
|
export {
|
|
548
548
|
ze as ArtifactSurfacePane,
|
|
549
549
|
Ke as CatalogRegistry,
|
|
550
|
-
|
|
551
|
-
|
|
550
|
+
ca as ChatLayout,
|
|
551
|
+
ya as CodeEditor,
|
|
552
552
|
je as CodeEditorPane,
|
|
553
553
|
$e as CommandPalette,
|
|
554
554
|
_e as CommandRegistry,
|
|
555
555
|
Y as DockviewShell,
|
|
556
556
|
Me as EmptyPane,
|
|
557
|
-
|
|
557
|
+
Pa as FileTree,
|
|
558
558
|
He as FileTreePane,
|
|
559
559
|
Ue as FileTreeView,
|
|
560
|
-
|
|
560
|
+
Fe as IdeLayout,
|
|
561
561
|
Ae as MAX_PANELS,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
562
|
+
ka as MarkdownEditor,
|
|
563
|
+
qe as MarkdownEditorPane,
|
|
564
|
+
Je as PanelChrome,
|
|
565
|
+
Le as PanelErrorBoundary,
|
|
566
|
+
Ve as PanelRegistry,
|
|
567
|
+
Xe as PluginError,
|
|
568
568
|
Ge as PluginErrorBoundary,
|
|
569
569
|
Qe as PluginErrorProvider,
|
|
570
570
|
Ye as RegistryProvider,
|
|
571
571
|
ve as ResponsiveDockviewShell,
|
|
572
572
|
Ze as SessionBrowser,
|
|
573
|
-
|
|
573
|
+
Be as SessionList,
|
|
574
574
|
et as SurfaceResolverRegistry,
|
|
575
575
|
tt as SurfaceShell,
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
576
|
+
at as ThemeProvider,
|
|
577
|
+
ha as Toaster,
|
|
578
|
+
da as TopBar,
|
|
579
579
|
rt as UI_COMMAND_EVENT,
|
|
580
|
-
|
|
580
|
+
nt as WORKSPACE_OPEN_PATH_SURFACE_KIND,
|
|
581
581
|
st as WorkbenchLeftPane,
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
it as
|
|
585
|
-
lt as
|
|
586
|
-
ct as
|
|
587
|
-
|
|
582
|
+
ot as WorkspaceFilesProvider,
|
|
583
|
+
ua as WorkspaceLoadingState,
|
|
584
|
+
it as WorkspaceProvider,
|
|
585
|
+
lt as agentMeta,
|
|
586
|
+
ct as bindStore,
|
|
587
|
+
dt as bootstrap,
|
|
588
|
+
pa as buildChatLayout,
|
|
589
|
+
ut as buildFullPagePanelHref,
|
|
588
590
|
xe as buildIdeLayout,
|
|
589
|
-
|
|
591
|
+
pt as closePanelSchema,
|
|
590
592
|
w as cn,
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
593
|
+
mt as createBridge,
|
|
594
|
+
ht as createBridgeClient,
|
|
595
|
+
va as createShadcnTheme,
|
|
596
|
+
ft as createWorkspaceStore,
|
|
597
|
+
wa as definePanel,
|
|
598
|
+
fa as dismissToast,
|
|
599
|
+
gt as emitAgentData,
|
|
600
|
+
bt as emitFilesystemAgentFileChange,
|
|
601
|
+
yt as events,
|
|
602
|
+
vt as expandToFileSchema,
|
|
603
|
+
xt as filesystemEvents,
|
|
604
|
+
Pt as filesystemPlugin,
|
|
605
|
+
St as formatShortcut,
|
|
606
|
+
kt as getFileIcon,
|
|
605
607
|
Ct as navigateToLineSchema,
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
608
|
+
wt as notificationSchema,
|
|
609
|
+
Nt as onFilesystemChanged,
|
|
610
|
+
Et as openFileSchema,
|
|
611
|
+
Rt as openPanelSchema,
|
|
612
|
+
Tt as postUiCommand,
|
|
613
|
+
ga as toast,
|
|
614
|
+
It as useActiveFile,
|
|
615
|
+
Ot as useActivePanel,
|
|
614
616
|
Te as useActivePanels,
|
|
615
|
-
|
|
616
|
-
Ie as
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
Lt as
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
617
|
+
Ft as useApiBaseUrl,
|
|
618
|
+
Ie as useArtifactPanels,
|
|
619
|
+
Oe as useArtifactRouting,
|
|
620
|
+
Mt as useAutoOpenAgentFiles,
|
|
621
|
+
Lt as useCatalogRegistry,
|
|
622
|
+
Bt as useCatalogs,
|
|
623
|
+
Wt as useCommandRegistry,
|
|
624
|
+
Dt as useCommands,
|
|
625
|
+
zt as useDirtyFiles,
|
|
626
|
+
Kt as useDockviewApi,
|
|
627
|
+
jt as useEditorLifecycle,
|
|
628
|
+
$t as useEvent,
|
|
629
|
+
_t as useFilePane,
|
|
630
|
+
Ht as useFullPagePanelHref,
|
|
631
|
+
Ut as useHasWorkspaceFilesProvider,
|
|
632
|
+
At as useHydrationComplete,
|
|
633
|
+
qt as useIsFullPagePanel,
|
|
634
|
+
Jt as useKeyboardShortcuts,
|
|
635
|
+
Vt as useOpenPanels,
|
|
636
|
+
Xt as usePanelRenderMode,
|
|
637
|
+
Gt as usePluginErrors,
|
|
630
638
|
z as useRegistry,
|
|
631
|
-
|
|
639
|
+
Qt as useResetLayout,
|
|
632
640
|
fe as useResponsiveSidebarCollapse,
|
|
633
641
|
Q as useSetSidebar,
|
|
634
642
|
G as useSidebarState,
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
643
|
+
Yt as useSurfaceResolverRegistry,
|
|
644
|
+
Zt as useTheme,
|
|
645
|
+
ea as useThemePreference,
|
|
638
646
|
W as useViewportBreakpoint,
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
647
|
+
ta as useWorkspaceAttention,
|
|
648
|
+
aa as useWorkspaceBridge,
|
|
649
|
+
ra as useWorkspaceChatPanel,
|
|
650
|
+
na as useWorkspaceContext,
|
|
651
|
+
sa as useWorkspaceContextOptional,
|
|
652
|
+
oa as useWorkspaceRequestId,
|
|
653
|
+
ia as userMeta
|
|
645
654
|
};
|