@hachej/boring-workspace 0.1.59 → 0.1.60
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-ChkSU4gL.js → FileTree-BMXXbAgy.js} +11 -11
- package/dist/{MarkdownEditor-BlYGosmH.js → MarkdownEditor-P47F3En6.js} +222 -206
- package/dist/{WorkspaceLoadingState-BYTO4wdt.js → WorkspaceLoadingState-D9v0oLDq.js} +423 -333
- package/dist/WorkspaceProvider-Dxvh_Faj.js +8501 -0
- package/dist/app-front.d.ts +141 -37
- package/dist/app-front.js +2014 -918
- package/dist/boring-workspace.css +1 -1
- package/dist/events.d.ts +2 -2
- package/dist/plugin.d.ts +27 -33
- package/dist/plugin.js +15 -13
- package/dist/shared.d.ts +1 -1
- package/dist/{surface-DmIalUmP.d.ts → surface-CDklwi48.d.ts} +34 -6
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +20 -21
- package/dist/workspace.css +386 -140
- package/dist/workspace.d.ts +207 -33
- package/dist/workspace.js +259 -255
- package/docs/INTERFACES.md +2 -2
- package/docs/README.md +3 -3
- package/package.json +4 -4
- package/dist/WorkspaceProvider-Bp1Sm40K.js +0 -8004
- package/dist/panel-DnvDNQac.js +0 -6
package/dist/workspace.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var T = (e, t, a) =>
|
|
4
|
-
import { u as
|
|
5
|
-
import { A as
|
|
1
|
+
var X = Object.defineProperty;
|
|
2
|
+
var Q = (e, t, a) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var T = (e, t, a) => Q(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { u as D, p as Y, a as Z, b as ee, D as te } from "./WorkspaceProvider-Dxvh_Faj.js";
|
|
5
|
+
import { A as qe, C as Je, c as Ve, d as Ge, e as Xe, f as Qe, F as Ye, g as Ze, M as et, h as tt, P as at, i as rt, j as nt, k as st, l as ot, R as it, S as lt, m as ct, n as dt, T as ut, U as pt, W as mt, o as ft, q as ht, r as gt, s as bt, t as yt, v as kt, w as St, x as vt, y as Pt, z as xt, B as wt, E as Ct, G as Et, H as Nt, I as Rt, J as Tt, K as Ot, L as It, N as Wt, O as Ft, Q as Lt, V as Bt, X as Mt, Y as Kt, Z as _t, _ as Dt, $ as At, a0 as $t, a1 as jt, a2 as zt, a3 as Ht, a4 as Ut, a5 as qt, a6 as Jt, a7 as Vt, a8 as Gt, a9 as Xt, aa as Qt, ab as Yt, ac as Zt, ad as ea, ae as ta, af as aa, ag as ra, ah as na, ai as sa, aj as oa, ak as ia, al as la, am as ca, an as da, ao as ua, ap as pa, aq as ma, ar as fa, as as ha, at as ga, au as ba, av as ya, aw as ka, ax as Sa, ay as va, az as Pa, aA as xa, aB as wa, aC as Ca, aD as Ea, aE as Na, aF as Ra, aG as Ta, aH as Oa, aI as Ia, aJ as Wa, aK as Fa, aL as La } from "./WorkspaceProvider-Dxvh_Faj.js";
|
|
6
6
|
import { c as C } from "./utils-B6yFEsav.js";
|
|
7
|
-
import { C as
|
|
8
|
-
import { jsx as r, jsxs as g, Fragment as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { Toaster as
|
|
11
|
-
import { useSyncExternalStore as
|
|
12
|
-
import { FileTree as
|
|
13
|
-
import { MarkdownEditor as
|
|
14
|
-
import { MenuIcon as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return D(e.subscribe, e.getSnapshot);
|
|
7
|
+
import { C as Ma, T as Ka, W as _a, b as Da } from "./WorkspaceLoadingState-D9v0oLDq.js";
|
|
8
|
+
import { jsx as r, jsxs as g, Fragment as ae } from "react/jsx-runtime";
|
|
9
|
+
import { Button as x, Sheet as re, SheetContent as ne, SheetHeader as se, SheetTitle as oe, SheetDescription as ie, EmptyState as le, Kbd as O, ErrorState as ce, IconButton as I } from "@hachej/boring-ui-kit";
|
|
10
|
+
import { Toaster as $a, dismissToast as ja, toast as za } from "@hachej/boring-ui-kit";
|
|
11
|
+
import { useSyncExternalStore as A, useState as E, useEffect as v, useRef as w, useCallback as b, useMemo as P, Suspense as de, Component as ue } from "react";
|
|
12
|
+
import { FileTree as Ua } from "./FileTree-BMXXbAgy.js";
|
|
13
|
+
import { MarkdownEditor as Ja } from "./MarkdownEditor-P47F3En6.js";
|
|
14
|
+
import { MenuIcon as pe, PanelLeftIcon as B, PinIcon as me, CheckIcon as fe, CopyIcon as he } from "lucide-react";
|
|
15
|
+
function Be() {
|
|
16
|
+
const e = D();
|
|
17
|
+
return A(e.subscribe, e.getSnapshot);
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function $(e) {
|
|
21
20
|
switch (e.kind) {
|
|
22
21
|
case "openFile":
|
|
23
22
|
return { kind: "openFile", params: { path: e.path, ...e.mode ? { mode: e.mode } : {} } };
|
|
@@ -37,30 +36,30 @@ function A(e) {
|
|
|
37
36
|
return { kind: "expandToFile", params: { path: e.path } };
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
|
-
function
|
|
41
|
-
return `boring-workspace-command:${encodeURIComponent(JSON.stringify(
|
|
39
|
+
function ge(e) {
|
|
40
|
+
return `boring-workspace-command:${encodeURIComponent(JSON.stringify($(e)))}`;
|
|
42
41
|
}
|
|
43
|
-
function
|
|
42
|
+
function be(e) {
|
|
44
43
|
return e.button === 0 && !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey;
|
|
45
44
|
}
|
|
46
|
-
function
|
|
45
|
+
function Me({ to: e, children: t, className: a, title: n, href: o, onClick: i }) {
|
|
47
46
|
return /* @__PURE__ */ r(
|
|
48
47
|
"a",
|
|
49
48
|
{
|
|
50
|
-
href:
|
|
49
|
+
href: o ?? ge(e),
|
|
51
50
|
className: a,
|
|
52
51
|
title: n,
|
|
53
52
|
onClick: (u) => {
|
|
54
|
-
|
|
53
|
+
i == null || i(u), !(u.defaultPrevented || !be(u)) && (u.preventDefault(), Y($(e)));
|
|
55
54
|
},
|
|
56
55
|
children: t
|
|
57
56
|
}
|
|
58
57
|
);
|
|
59
58
|
}
|
|
60
|
-
function
|
|
59
|
+
function ye(e, t) {
|
|
61
60
|
return e ? `${e.replace(/\/$/, "")}${t}` : t;
|
|
62
61
|
}
|
|
63
|
-
function
|
|
62
|
+
function ke() {
|
|
64
63
|
if (typeof window > "u") return;
|
|
65
64
|
const e = window.location.pathname.match(/^\/workspace\/([^/?#]+)/);
|
|
66
65
|
if (e != null && e[1])
|
|
@@ -70,56 +69,56 @@ function Se() {
|
|
|
70
69
|
return e[1];
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
|
-
async function
|
|
72
|
+
async function Ke(e) {
|
|
74
73
|
const t = new URLSearchParams({ path: e.path });
|
|
75
74
|
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);
|
|
76
|
-
const a = { ...e.headers ?? {} }, n = e.workspaceId ??
|
|
77
|
-
n && !Object.keys(a).some((
|
|
78
|
-
const
|
|
75
|
+
const a = { ...e.headers ?? {} }, n = e.workspaceId ?? ke();
|
|
76
|
+
n && !Object.keys(a).some((i) => i.toLowerCase() === "x-boring-workspace-id") && (a["x-boring-workspace-id"] = n);
|
|
77
|
+
const o = await fetch(ye(e.apiBaseUrl, `/api/v1/files/records?${t}`), {
|
|
79
78
|
method: "GET",
|
|
80
79
|
headers: a,
|
|
81
80
|
signal: e.signal
|
|
82
81
|
});
|
|
83
|
-
if (!
|
|
84
|
-
throw new Error(`readFileRecords failed: HTTP ${
|
|
85
|
-
return await
|
|
82
|
+
if (!o.ok)
|
|
83
|
+
throw new Error(`readFileRecords failed: HTTP ${o.status}`);
|
|
84
|
+
return await o.json();
|
|
86
85
|
}
|
|
87
|
-
function
|
|
86
|
+
function M(e) {
|
|
88
87
|
return typeof window > "u" ? !1 : window.innerWidth < e;
|
|
89
88
|
}
|
|
90
|
-
function
|
|
91
|
-
const [t, a] = E(() =>
|
|
92
|
-
return
|
|
89
|
+
function K(e = 1024) {
|
|
90
|
+
const [t, a] = E(() => M(e));
|
|
91
|
+
return v(() => {
|
|
93
92
|
const n = () => {
|
|
94
|
-
a(
|
|
93
|
+
a(M(e));
|
|
95
94
|
};
|
|
96
95
|
return n(), window.addEventListener("resize", n), () => {
|
|
97
96
|
window.removeEventListener("resize", n);
|
|
98
97
|
};
|
|
99
98
|
}, [e]), t;
|
|
100
99
|
}
|
|
101
|
-
function
|
|
100
|
+
function Se({
|
|
102
101
|
isNarrowViewport: e,
|
|
103
102
|
isCollapsed: t,
|
|
104
103
|
setCollapsed: a
|
|
105
104
|
}) {
|
|
106
|
-
const n = w(t),
|
|
107
|
-
return
|
|
105
|
+
const n = w(t), o = w(!1), i = w(null);
|
|
106
|
+
return v(() => {
|
|
108
107
|
n.current = t;
|
|
109
|
-
}, [t]),
|
|
110
|
-
const u =
|
|
111
|
-
if (
|
|
112
|
-
|
|
108
|
+
}, [t]), v(() => {
|
|
109
|
+
const u = i.current, d = u !== !0 && e, l = u === !0 && !e;
|
|
110
|
+
if (i.current = e, e && d && !n.current) {
|
|
111
|
+
o.current = !0, a(!0);
|
|
113
112
|
return;
|
|
114
113
|
}
|
|
115
|
-
l &&
|
|
114
|
+
l && o.current && (o.current = !1, a(!1));
|
|
116
115
|
}, [e, a]), b(() => {
|
|
117
|
-
|
|
116
|
+
o.current = !1;
|
|
118
117
|
}, []);
|
|
119
118
|
}
|
|
120
|
-
function
|
|
119
|
+
function _e(e) {
|
|
121
120
|
const [t, a] = E([]), n = w(t);
|
|
122
|
-
n.current = t,
|
|
121
|
+
n.current = t, v(() => {
|
|
123
122
|
if (!e) {
|
|
124
123
|
a([]);
|
|
125
124
|
return;
|
|
@@ -139,8 +138,8 @@ function De(e) {
|
|
|
139
138
|
}
|
|
140
139
|
const s = n.current;
|
|
141
140
|
(s.length !== f.length || s.some((y, m) => {
|
|
142
|
-
var
|
|
143
|
-
return y.id !== ((
|
|
141
|
+
var k;
|
|
142
|
+
return y.id !== ((k = f[m]) == null ? void 0 : k.id);
|
|
144
143
|
})) && a(f);
|
|
145
144
|
} catch {
|
|
146
145
|
}
|
|
@@ -149,7 +148,7 @@ function De(e) {
|
|
|
149
148
|
const c = setInterval(l, 500);
|
|
150
149
|
return () => clearInterval(c);
|
|
151
150
|
}, [e]);
|
|
152
|
-
const
|
|
151
|
+
const o = b(
|
|
153
152
|
(l) => {
|
|
154
153
|
e == null || e.addPanel("artifacts", {
|
|
155
154
|
id: l.id,
|
|
@@ -158,7 +157,7 @@ function De(e) {
|
|
|
158
157
|
});
|
|
159
158
|
},
|
|
160
159
|
[e]
|
|
161
|
-
),
|
|
160
|
+
), i = b(
|
|
162
161
|
(l) => {
|
|
163
162
|
e == null || e.removePanel(l);
|
|
164
163
|
},
|
|
@@ -172,16 +171,16 @@ function De(e) {
|
|
|
172
171
|
(l) => n.current.some((c) => c.id === l),
|
|
173
172
|
[]
|
|
174
173
|
);
|
|
175
|
-
return { panels: t, open:
|
|
174
|
+
return { panels: t, open: o, close: i, activate: u, isOpen: d };
|
|
176
175
|
}
|
|
177
|
-
function
|
|
176
|
+
function De(e, t = {}) {
|
|
178
177
|
const a = t.toolPanelMap ?? {}, n = b(
|
|
179
|
-
(
|
|
178
|
+
(i) => a[i],
|
|
180
179
|
[a]
|
|
181
180
|
);
|
|
182
181
|
return { openForTool: b(
|
|
183
|
-
(
|
|
184
|
-
const d = a[
|
|
182
|
+
(i, u) => {
|
|
183
|
+
const d = a[i];
|
|
185
184
|
if (!d) return;
|
|
186
185
|
const l = `artifact-${u.path}`;
|
|
187
186
|
e.isOpen(l) ? e.activate(l) : e.open({ id: l, component: d, params: u });
|
|
@@ -189,34 +188,34 @@ function Ae(e, t = {}) {
|
|
|
189
188
|
[a, e]
|
|
190
189
|
), resolvePanel: n };
|
|
191
190
|
}
|
|
192
|
-
const
|
|
193
|
-
function
|
|
191
|
+
const ve = 768, Pe = 1024;
|
|
192
|
+
function xe(e) {
|
|
194
193
|
return {
|
|
195
194
|
...e,
|
|
196
195
|
groups: e.groups.filter((t) => t.id !== "sidebar")
|
|
197
196
|
};
|
|
198
197
|
}
|
|
199
|
-
function
|
|
198
|
+
function we({
|
|
200
199
|
layout: e,
|
|
201
200
|
className: t
|
|
202
201
|
}) {
|
|
203
|
-
var
|
|
204
|
-
const a =
|
|
202
|
+
var F;
|
|
203
|
+
const a = D(), n = Z(), o = ee(), i = K(ve), u = K(Pe), d = u && !i, l = P(
|
|
205
204
|
() => e.groups.find((S) => S.id === "sidebar" && S.panel),
|
|
206
205
|
[e]
|
|
207
|
-
), c = l == null ? void 0 : l.panel, p = !!c, f =
|
|
206
|
+
), c = l == null ? void 0 : l.panel, p = !!c, f = Se({
|
|
208
207
|
isNarrowViewport: p && u,
|
|
209
208
|
isCollapsed: n.collapsed,
|
|
210
|
-
setCollapsed: (S) =>
|
|
209
|
+
setCollapsed: (S) => o({ collapsed: S })
|
|
211
210
|
}), [s, h] = E(!1);
|
|
212
|
-
|
|
213
|
-
(!p || !
|
|
214
|
-
}, [p,
|
|
215
|
-
const y = p && (
|
|
216
|
-
() => m ? e :
|
|
211
|
+
v(() => {
|
|
212
|
+
(!p || !i && !d) && h(!1);
|
|
213
|
+
}, [p, i, d]);
|
|
214
|
+
const y = p && (i || d && n.collapsed), m = p && !i && (!d || !n.collapsed), k = P(
|
|
215
|
+
() => m ? e : xe(e),
|
|
217
216
|
[m, e]
|
|
218
|
-
),
|
|
219
|
-
const S = m ? "inline-sidebar" : "overlay-sidebar", L =
|
|
217
|
+
), j = P(() => {
|
|
218
|
+
const S = m ? "inline-sidebar" : "overlay-sidebar", L = k.groups.map((N) => {
|
|
220
219
|
let R = "";
|
|
221
220
|
try {
|
|
222
221
|
R = JSON.stringify(N.params ?? null);
|
|
@@ -225,18 +224,18 @@ function Ce({
|
|
|
225
224
|
}
|
|
226
225
|
return `${N.id}:${N.panel ?? ""}:${R}`;
|
|
227
226
|
}).join(",");
|
|
228
|
-
return `${
|
|
229
|
-
}, [
|
|
227
|
+
return `${k.version}:${S}:${L}`;
|
|
228
|
+
}, [k, m]), z = A(
|
|
230
229
|
a.subscribe,
|
|
231
230
|
a.getSnapshot,
|
|
232
231
|
a.getSnapshot
|
|
233
|
-
),
|
|
232
|
+
), H = P(() => a.getComponents(), [a, z]), W = c ? H[c] : null, U = c ? ((F = a.get(c)) == null ? void 0 : F.title) ?? "Sidebar" : "Sidebar", q = b(() => {
|
|
234
233
|
h(!0);
|
|
235
|
-
}, []),
|
|
236
|
-
f(),
|
|
237
|
-
}, [f,
|
|
238
|
-
f(),
|
|
239
|
-
}, [f,
|
|
234
|
+
}, []), J = b(() => {
|
|
235
|
+
f(), o({ collapsed: !1 }), h(!1);
|
|
236
|
+
}, [f, o]), V = b(() => {
|
|
237
|
+
f(), o({ collapsed: !0 }), h(!1);
|
|
238
|
+
}, [f, o]), G = b(
|
|
240
239
|
(S) => {
|
|
241
240
|
S.target.closest("[role='treeitem']") && h(!1);
|
|
242
241
|
},
|
|
@@ -255,64 +254,64 @@ function Ce({
|
|
|
255
254
|
{
|
|
256
255
|
className: C(
|
|
257
256
|
"absolute z-30",
|
|
258
|
-
|
|
257
|
+
"left-2 top-2"
|
|
259
258
|
),
|
|
260
259
|
children: /* @__PURE__ */ r(
|
|
261
|
-
|
|
260
|
+
x,
|
|
262
261
|
{
|
|
263
262
|
type: "button",
|
|
264
263
|
variant: "outline",
|
|
265
264
|
size: "icon-sm",
|
|
266
|
-
onClick:
|
|
267
|
-
"aria-label":
|
|
268
|
-
children:
|
|
265
|
+
onClick: q,
|
|
266
|
+
"aria-label": i ? "Open sidebar menu" : "Open collapsed sidebar",
|
|
267
|
+
children: i ? /* @__PURE__ */ r(pe, { className: "h-4 w-4" }) : /* @__PURE__ */ r(B, { className: "h-4 w-4" })
|
|
269
268
|
}
|
|
270
269
|
)
|
|
271
270
|
}
|
|
272
271
|
),
|
|
273
272
|
d && p && !n.collapsed && /* @__PURE__ */ r("div", { className: "absolute left-2 top-2 z-30", children: /* @__PURE__ */ r(
|
|
274
|
-
|
|
273
|
+
x,
|
|
275
274
|
{
|
|
276
275
|
type: "button",
|
|
277
276
|
variant: "outline",
|
|
278
277
|
size: "icon-sm",
|
|
279
278
|
onClick: V,
|
|
280
279
|
"aria-label": "Collapse sidebar",
|
|
281
|
-
children: /* @__PURE__ */ r(
|
|
280
|
+
children: /* @__PURE__ */ r(B, { className: "h-4 w-4" })
|
|
282
281
|
}
|
|
283
282
|
) }),
|
|
284
283
|
/* @__PURE__ */ r(
|
|
285
|
-
|
|
284
|
+
te,
|
|
286
285
|
{
|
|
287
|
-
layout:
|
|
286
|
+
layout: k,
|
|
288
287
|
className: C(
|
|
289
288
|
t,
|
|
290
289
|
d && p && n.collapsed && "pl-10"
|
|
291
290
|
)
|
|
292
291
|
},
|
|
293
|
-
|
|
292
|
+
j
|
|
294
293
|
),
|
|
295
|
-
y && /* @__PURE__ */ r(
|
|
296
|
-
|
|
294
|
+
y && /* @__PURE__ */ r(re, { open: s, onOpenChange: h, children: /* @__PURE__ */ g(
|
|
295
|
+
ne,
|
|
297
296
|
{
|
|
298
297
|
side: "left",
|
|
299
298
|
className: "w-[85vw] max-w-sm p-0",
|
|
300
299
|
children: [
|
|
301
|
-
/* @__PURE__ */ g(
|
|
300
|
+
/* @__PURE__ */ g(se, { className: "flex flex-row items-center justify-between border-b border-border px-4 py-3", children: [
|
|
302
301
|
/* @__PURE__ */ g("div", { children: [
|
|
303
|
-
/* @__PURE__ */ r(
|
|
304
|
-
/* @__PURE__ */ r(
|
|
302
|
+
/* @__PURE__ */ r(oe, { children: U }),
|
|
303
|
+
/* @__PURE__ */ r(ie, { className: "sr-only", children: "Responsive sidebar panel" })
|
|
305
304
|
] }),
|
|
306
305
|
d && /* @__PURE__ */ g(
|
|
307
|
-
|
|
306
|
+
x,
|
|
308
307
|
{
|
|
309
308
|
type: "button",
|
|
310
309
|
variant: "outline",
|
|
311
310
|
size: "sm",
|
|
312
|
-
onClick:
|
|
311
|
+
onClick: J,
|
|
313
312
|
"aria-label": "Pin sidebar open",
|
|
314
313
|
children: [
|
|
315
|
-
/* @__PURE__ */ r(
|
|
314
|
+
/* @__PURE__ */ r(me, { className: "h-4 w-4" }),
|
|
316
315
|
"Pin"
|
|
317
316
|
]
|
|
318
317
|
}
|
|
@@ -322,8 +321,8 @@ function Ce({
|
|
|
322
321
|
"div",
|
|
323
322
|
{
|
|
324
323
|
className: "h-full min-h-0 overflow-auto",
|
|
325
|
-
onClickCapture:
|
|
326
|
-
children:
|
|
324
|
+
onClickCapture: G,
|
|
325
|
+
children: W ? /* @__PURE__ */ r(de, { fallback: /* @__PURE__ */ r(_, {}), children: /* @__PURE__ */ r(W, {}) }) : /* @__PURE__ */ r(_, {})
|
|
327
326
|
}
|
|
328
327
|
)
|
|
329
328
|
]
|
|
@@ -331,11 +330,11 @@ function Ce({
|
|
|
331
330
|
) })
|
|
332
331
|
] });
|
|
333
332
|
}
|
|
334
|
-
function
|
|
333
|
+
function _() {
|
|
335
334
|
return /* @__PURE__ */ r("div", { className: "flex h-full min-h-[240px] items-center justify-center text-sm text-muted-foreground", children: "Loading sidebar..." });
|
|
336
335
|
}
|
|
337
|
-
function
|
|
338
|
-
const { sidebar: t = "filetree", center: a = "empty", right: n } = e,
|
|
336
|
+
function Ce(e = {}) {
|
|
337
|
+
const { sidebar: t = "filetree", center: a = "empty", right: n } = e, o = [
|
|
339
338
|
{
|
|
340
339
|
id: "sidebar",
|
|
341
340
|
position: "left",
|
|
@@ -354,25 +353,25 @@ function Ee(e = {}) {
|
|
|
354
353
|
constraints: { minWidth: 300 }
|
|
355
354
|
}
|
|
356
355
|
];
|
|
357
|
-
return n &&
|
|
356
|
+
return n && o.push({
|
|
358
357
|
id: "right",
|
|
359
358
|
position: "right",
|
|
360
359
|
panel: n,
|
|
361
360
|
hideHeader: !0,
|
|
362
361
|
constraints: { minWidth: 250 }
|
|
363
|
-
}), { version: "2.0", groups:
|
|
362
|
+
}), { version: "2.0", groups: o };
|
|
364
363
|
}
|
|
365
|
-
function
|
|
366
|
-
return /* @__PURE__ */ r(
|
|
364
|
+
function Ae(e) {
|
|
365
|
+
return /* @__PURE__ */ r(we, { layout: Ce(e), className: e.className });
|
|
367
366
|
}
|
|
368
|
-
function
|
|
367
|
+
function $e({ className: e, onOpenFile: t }) {
|
|
369
368
|
return /* @__PURE__ */ r(
|
|
370
|
-
|
|
369
|
+
le,
|
|
371
370
|
{
|
|
372
371
|
className: C("h-full border-0 text-muted-foreground", e),
|
|
373
372
|
title: "No file open",
|
|
374
373
|
description: "Open a file to get started",
|
|
375
|
-
actions: t ? /* @__PURE__ */ r(
|
|
374
|
+
actions: t ? /* @__PURE__ */ r(x, { type: "button", variant: "outline", onClick: t, children: "Open file" }) : null,
|
|
376
375
|
children: /* @__PURE__ */ g("div", { className: "space-y-2 text-sm", children: [
|
|
377
376
|
/* @__PURE__ */ g("div", { className: "flex items-center gap-3", children: [
|
|
378
377
|
/* @__PURE__ */ r(O, { children: "⌘P" }),
|
|
@@ -390,7 +389,7 @@ function je({ className: e, onOpenFile: t }) {
|
|
|
390
389
|
}
|
|
391
390
|
);
|
|
392
391
|
}
|
|
393
|
-
class
|
|
392
|
+
class je extends ue {
|
|
394
393
|
constructor() {
|
|
395
394
|
super(...arguments);
|
|
396
395
|
T(this, "state", { hasError: !1, error: null });
|
|
@@ -402,9 +401,9 @@ class ze extends de {
|
|
|
402
401
|
return { hasError: !0, error: a };
|
|
403
402
|
}
|
|
404
403
|
componentDidCatch(a, n) {
|
|
405
|
-
const { panelId:
|
|
406
|
-
console.error(`[PanelErrorBoundary] Panel "${
|
|
407
|
-
panelId:
|
|
404
|
+
const { panelId: o, onError: i } = this.props;
|
|
405
|
+
console.error(`[PanelErrorBoundary] Panel "${o}" crashed:`, a, n.componentStack), i == null || i({
|
|
406
|
+
panelId: o,
|
|
408
407
|
error: a.message,
|
|
409
408
|
stack: n.componentStack ?? void 0
|
|
410
409
|
});
|
|
@@ -412,32 +411,32 @@ class ze extends de {
|
|
|
412
411
|
render() {
|
|
413
412
|
var a;
|
|
414
413
|
return this.state.hasError ? /* @__PURE__ */ r("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ r(
|
|
415
|
-
|
|
414
|
+
ce,
|
|
416
415
|
{
|
|
417
416
|
className: "w-full max-w-md",
|
|
418
417
|
title: "Something went wrong",
|
|
419
|
-
description: /* @__PURE__ */ g(
|
|
418
|
+
description: /* @__PURE__ */ g(ae, { children: [
|
|
420
419
|
"Panel ",
|
|
421
420
|
/* @__PURE__ */ r("code", { className: "rounded bg-muted px-1 py-0.5 text-xs", children: this.props.panelId }),
|
|
422
421
|
" ",
|
|
423
422
|
"encountered an error."
|
|
424
423
|
] }),
|
|
425
424
|
details: (a = this.state.error) == null ? void 0 : a.message,
|
|
426
|
-
actions: /* @__PURE__ */ r(
|
|
425
|
+
actions: /* @__PURE__ */ r(x, { type: "button", variant: "outline", onClick: this.handleRetry, children: "Retry" })
|
|
427
426
|
}
|
|
428
427
|
) }) : this.props.children;
|
|
429
428
|
}
|
|
430
429
|
}
|
|
431
|
-
function
|
|
430
|
+
function ze({
|
|
432
431
|
sessions: e,
|
|
433
432
|
activeId: t,
|
|
434
433
|
onSwitch: a,
|
|
435
434
|
onCreate: n,
|
|
436
|
-
onDelete:
|
|
437
|
-
className:
|
|
435
|
+
onDelete: o,
|
|
436
|
+
className: i
|
|
438
437
|
}) {
|
|
439
|
-
const [u, d] = E(null), l = w({}), c =
|
|
440
|
-
|
|
438
|
+
const [u, d] = E(null), l = w({}), c = P(() => e.map((s) => s.id), [e]);
|
|
439
|
+
v(() => {
|
|
441
440
|
if (c.length === 0) {
|
|
442
441
|
d(null);
|
|
443
442
|
return;
|
|
@@ -468,8 +467,8 @@ function He({
|
|
|
468
467
|
else
|
|
469
468
|
return;
|
|
470
469
|
s.preventDefault();
|
|
471
|
-
const
|
|
472
|
-
|
|
470
|
+
const k = c[m];
|
|
471
|
+
k && p(k);
|
|
473
472
|
},
|
|
474
473
|
[p, a, c]
|
|
475
474
|
);
|
|
@@ -477,7 +476,7 @@ function He({
|
|
|
477
476
|
"div",
|
|
478
477
|
{
|
|
479
478
|
"data-boring-workspace-part": "session-list",
|
|
480
|
-
className: C("flex h-full flex-col",
|
|
479
|
+
className: C("flex h-full flex-col", i),
|
|
481
480
|
role: "navigation",
|
|
482
481
|
"aria-label": "Sessions",
|
|
483
482
|
children: [
|
|
@@ -500,13 +499,13 @@ function He({
|
|
|
500
499
|
/* @__PURE__ */ g("div", { className: "flex-1 overflow-y-auto", role: "list", "aria-label": "Session list", children: [
|
|
501
500
|
e.length === 0 && /* @__PURE__ */ r("div", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No sessions" }),
|
|
502
501
|
e.map((s) => /* @__PURE__ */ r(
|
|
503
|
-
|
|
502
|
+
Ne,
|
|
504
503
|
{
|
|
505
504
|
session: s,
|
|
506
505
|
isActive: s.id === t,
|
|
507
506
|
isFocused: s.id === u,
|
|
508
507
|
onSwitch: a,
|
|
509
|
-
onDelete:
|
|
508
|
+
onDelete: o,
|
|
510
509
|
onFocus: () => d(s.id),
|
|
511
510
|
onKeyDown: f,
|
|
512
511
|
rowRef: (h) => {
|
|
@@ -520,7 +519,7 @@ function He({
|
|
|
520
519
|
}
|
|
521
520
|
);
|
|
522
521
|
}
|
|
523
|
-
async function
|
|
522
|
+
async function Ee(e) {
|
|
524
523
|
var a, n;
|
|
525
524
|
if (typeof navigator < "u" && ((a = navigator.clipboard) != null && a.writeText))
|
|
526
525
|
try {
|
|
@@ -538,18 +537,18 @@ async function Ne(e) {
|
|
|
538
537
|
document.body.removeChild(t);
|
|
539
538
|
}
|
|
540
539
|
}
|
|
541
|
-
function
|
|
540
|
+
function Ne({
|
|
542
541
|
session: e,
|
|
543
542
|
isActive: t,
|
|
544
543
|
isFocused: a,
|
|
545
544
|
onSwitch: n,
|
|
546
|
-
onDelete:
|
|
547
|
-
onFocus:
|
|
545
|
+
onDelete: o,
|
|
546
|
+
onFocus: i,
|
|
548
547
|
onKeyDown: u,
|
|
549
548
|
rowRef: d
|
|
550
549
|
}) {
|
|
551
550
|
const [l, c] = E(!1), p = b((f) => {
|
|
552
|
-
f.stopPropagation(),
|
|
551
|
+
f.stopPropagation(), Ee(e.id).then((s) => {
|
|
553
552
|
s && (c(!0), window.setTimeout(() => c(!1), 1200));
|
|
554
553
|
});
|
|
555
554
|
}, [e.id]);
|
|
@@ -567,7 +566,7 @@ function Re({
|
|
|
567
566
|
t ? "bg-accent text-accent-foreground" : "text-foreground hover:bg-accent/50"
|
|
568
567
|
),
|
|
569
568
|
onClick: () => n == null ? void 0 : n(e.id),
|
|
570
|
-
onFocus:
|
|
569
|
+
onFocus: i,
|
|
571
570
|
onKeyDown: (f) => u(f, e.id),
|
|
572
571
|
tabIndex: a ? 0 : -1,
|
|
573
572
|
"aria-current": t ? "true" : void 0,
|
|
@@ -584,7 +583,7 @@ function Re({
|
|
|
584
583
|
tabIndex: a ? 0 : -1,
|
|
585
584
|
"aria-label": `Copy Pi session id for ${e.title}`,
|
|
586
585
|
title: "Copy Pi session id",
|
|
587
|
-
children: l ? /* @__PURE__ */ r(
|
|
586
|
+
children: l ? /* @__PURE__ */ r(fe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(he, { className: "h-3.5 w-3.5" })
|
|
588
587
|
}
|
|
589
588
|
),
|
|
590
589
|
t && /* @__PURE__ */ r(
|
|
@@ -594,7 +593,7 @@ function Re({
|
|
|
594
593
|
"aria-label": "Active"
|
|
595
594
|
}
|
|
596
595
|
),
|
|
597
|
-
|
|
596
|
+
o && /* @__PURE__ */ r(
|
|
598
597
|
I,
|
|
599
598
|
{
|
|
600
599
|
type: "button",
|
|
@@ -602,7 +601,7 @@ function Re({
|
|
|
602
601
|
size: "icon-xs",
|
|
603
602
|
className: "hidden shrink-0 text-muted-foreground hover:text-destructive group-hover:inline-flex group-data-[focused=true]:inline-flex",
|
|
604
603
|
onClick: (f) => {
|
|
605
|
-
f.stopPropagation(),
|
|
604
|
+
f.stopPropagation(), o(e.id);
|
|
606
605
|
},
|
|
607
606
|
tabIndex: a ? 0 : -1,
|
|
608
607
|
"aria-label": `Delete ${e.title}`,
|
|
@@ -626,126 +625,131 @@ function Re({
|
|
|
626
625
|
);
|
|
627
626
|
}
|
|
628
627
|
export {
|
|
629
|
-
|
|
628
|
+
qe as ArtifactSurfacePane,
|
|
630
629
|
Je as CatalogRegistry,
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
630
|
+
Ma 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
|
+
Ua as FileTree,
|
|
638
|
+
Ye as FileTreePane,
|
|
639
|
+
Ze as FileTreeView,
|
|
640
|
+
Ae as IdeLayout,
|
|
641
|
+
et as MAX_PANELS,
|
|
642
|
+
Ja 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
|
+
$a as Toaster,
|
|
658
|
+
Ka 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
|
+
bt as WORKSPACE_SURFACE_OPEN_SKIPPED_EVENT,
|
|
665
|
+
yt as WorkbenchLeftPane,
|
|
666
|
+
kt as WorkspaceFilesProvider,
|
|
667
|
+
Me as WorkspaceLink,
|
|
668
|
+
_a as WorkspaceLoadingState,
|
|
669
|
+
St as WorkspacePluginClientProvider,
|
|
670
|
+
vt as WorkspaceProvider,
|
|
671
|
+
Pt as WorkspaceSourceRegistry,
|
|
671
672
|
xt as agentMeta,
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
673
|
+
wt as bindStore,
|
|
674
|
+
Ct as bootstrap,
|
|
675
|
+
Da as buildChatLayout,
|
|
676
|
+
Et as buildFullPagePanelHref,
|
|
677
|
+
Ce as buildIdeLayout,
|
|
678
|
+
Nt as closePanelSchema,
|
|
678
679
|
C as cn,
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
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
|
+
ja as dismissToast,
|
|
687
|
+
Lt as emitAgentData,
|
|
688
|
+
Bt as emitFilesystemAgentFileChange,
|
|
689
|
+
Mt 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
|
+
za as toast,
|
|
707
|
+
Qt as useActiveFile,
|
|
708
|
+
Yt as useActivePanel,
|
|
709
|
+
Be 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
|
+
ba as usePluginErrors,
|
|
731
|
+
D as useRegistry,
|
|
732
|
+
ya 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 useWorkspacePluginClient,
|
|
746
|
+
Ra as useWorkspaceRequestId,
|
|
747
|
+
Ta as useWorkspaceSourceRegistry,
|
|
748
|
+
Oa as userMeta,
|
|
749
|
+
Ia as workspaceAttentionSessionBadgeForBlocker,
|
|
750
|
+
Wa as workspaceComposerStopAppliesToSession,
|
|
751
|
+
Fa as workspaceComposerStopTargetSessionId,
|
|
752
|
+
La as workspaceEvents,
|
|
753
|
+
$ as workspaceLinkCommand,
|
|
754
|
+
ge as workspaceLinkHref
|
|
751
755
|
};
|