@hachej/boring-workspace 0.1.47 → 0.1.48
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-CoZWkHqn.js +315 -0
- package/dist/{MarkdownEditor-FJtYn6Xx.js → MarkdownEditor-DOZy49fg.js} +160 -160
- package/dist/{WorkspaceLoadingState-BoFzsDji.js → WorkspaceLoadingState-CjXix_Fa.js} +22 -22
- package/dist/{WorkspaceProvider-CSwoKjTp.js → WorkspaceProvider-CRd7lb76.js} +833 -826
- package/dist/app-front.js +515 -504
- package/dist/testing.js +1 -1
- package/dist/workspace.d.ts +24 -4
- package/dist/workspace.js +5 -5
- package/package.json +4 -4
- package/dist/FileTree-DKzSeYJX.js +0 -289
|
@@ -2,9 +2,9 @@ var $o = Object.defineProperty;
|
|
|
2
2
|
var Lo = (e, t, n) => t in e ? $o(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Q = (e, t, n) => Lo(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as Oo from "react/jsx-runtime";
|
|
5
|
-
import { jsx as u, jsxs as
|
|
5
|
+
import { jsx as u, jsxs as x, Fragment as Me } from "react/jsx-runtime";
|
|
6
6
|
import * as Mo from "react";
|
|
7
|
-
import { useRef as
|
|
7
|
+
import { useRef as D, useMemo as Y, useContext as pe, createContext as Ce, useSyncExternalStore as ot, useState as j, useCallback as E, Component as Wo, useEffect as M, createElement as ve, Suspense as Dt, Fragment as gr, lazy as ft, useLayoutEffect as zo } from "react";
|
|
8
8
|
import { AlertTriangleIcon as jo, ImageIcon as Ge, FileTextIcon as Re, FileJsonIcon as Cn, FileCodeIcon as de, FileIcon as _t, X as ln, RefreshCw as Bo, Download as Uo, RefreshCcw as qo, ExternalLink as vr, FolderTree as Ho, TerminalIcon as un, ClockIcon as Vo, ArrowUp as Go, ArrowDown as Ko, CornerDownLeft as Jo, GripVertical as Yo, Plus as Xo, ChevronLeft as Qo, ChevronRight as yr, Pin as Zo, Menu as Rt, Search as En } from "lucide-react";
|
|
9
9
|
import { Notice as br, IconButton as xe, LoadingState as ei, Input as wr, toast as _e, ErrorState as rt, Skeleton as ti, Spinner as Ft, Button as Oe, AlertDialog as ni, AlertDialogContent as ri, AlertDialogHeader as oi, AlertDialogTitle as ii, AlertDialogDescription as si, AlertDialogFooter as ai, AlertDialogCancel as ci, AlertDialogAction as li, EmptyState as Sr, Kbd as nt, TooltipProvider as ui, Tooltip as di, TooltipTrigger as fi, TooltipContent as pi, Dialog as hi, DialogContent as mi, DialogHeader as gi, DialogTitle as vi, DialogDescription as yi, Command as bi, CommandList as wi, CommandEmpty as Si, CommandInput as xi, CommandGroup as dn, CommandItem as $t, CommandShortcut as ki, Toaster as Pi } from "@hachej/boring-ui-kit";
|
|
10
10
|
import { useStore as Ue, create as Ci } from "zustand";
|
|
@@ -369,7 +369,7 @@ function Bi({
|
|
|
369
369
|
surfaceResolverRegistry: r,
|
|
370
370
|
children: o
|
|
371
371
|
}) {
|
|
372
|
-
const i =
|
|
372
|
+
const i = D(null), a = D(null);
|
|
373
373
|
i.current || (i.current = new Er()), a.current || (a.current = new Ir());
|
|
374
374
|
const l = n ?? i.current, s = r ?? a.current, f = Y(
|
|
375
375
|
() => ({
|
|
@@ -417,8 +417,8 @@ function Hi({ pluginId: e, message: t, kind: n }) {
|
|
|
417
417
|
tone: "error",
|
|
418
418
|
icon: /* @__PURE__ */ u(jo, { className: "size-4" }),
|
|
419
419
|
className: "py-2",
|
|
420
|
-
description: /* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
420
|
+
description: /* @__PURE__ */ x("span", { className: "block min-w-0 truncate", children: [
|
|
421
|
+
/* @__PURE__ */ x("span", { className: "font-medium", children: [
|
|
422
422
|
"[",
|
|
423
423
|
e,
|
|
424
424
|
"]"
|
|
@@ -433,7 +433,7 @@ function Hi({ pluginId: e, message: t, kind: n }) {
|
|
|
433
433
|
}
|
|
434
434
|
const pn = Ce(null);
|
|
435
435
|
function Vi({ children: e }) {
|
|
436
|
-
const [t, n] =
|
|
436
|
+
const [t, n] = j([]), r = E((i) => {
|
|
437
437
|
n((a) => [...a, i]);
|
|
438
438
|
}, []), o = Y(
|
|
439
439
|
() => ({ errors: t, reportPluginError: r }),
|
|
@@ -703,40 +703,40 @@ function cs(e) {
|
|
|
703
703
|
onVersionMismatch: s,
|
|
704
704
|
onConnectionChange: f
|
|
705
705
|
} = e;
|
|
706
|
-
let c = null, d = null, p = null, m = null, g = !1, v = !1,
|
|
707
|
-
function
|
|
708
|
-
v || g !==
|
|
706
|
+
let c = null, d = null, p = null, m = null, g = !1, v = !1, k = 0;
|
|
707
|
+
function b(O) {
|
|
708
|
+
v || g !== O && (g = O, f == null || f(O));
|
|
709
709
|
}
|
|
710
|
-
async function _(
|
|
710
|
+
async function _(O) {
|
|
711
711
|
if (v) return;
|
|
712
|
-
const
|
|
712
|
+
const $ = as(r, O);
|
|
713
713
|
try {
|
|
714
714
|
const I = await fetch(`${t}/api/v1/ui/state`, {
|
|
715
715
|
method: "PUT",
|
|
716
716
|
headers: Tn(o),
|
|
717
|
-
body: JSON.stringify(
|
|
717
|
+
body: JSON.stringify($)
|
|
718
718
|
});
|
|
719
719
|
if (v) return;
|
|
720
720
|
(I.status === 401 || I.status === 403) && (l == null || l(I.status));
|
|
721
721
|
} catch {
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function W(O) {
|
|
725
725
|
p !== null && clearTimeout(p), p = setTimeout(() => {
|
|
726
|
-
p = null, _(
|
|
726
|
+
p = null, _(O);
|
|
727
727
|
}, is);
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function B(O, $) {
|
|
730
730
|
if (!v)
|
|
731
|
-
switch (
|
|
731
|
+
switch (O) {
|
|
732
732
|
case "init": {
|
|
733
|
-
|
|
733
|
+
b(!0), _("restore");
|
|
734
734
|
break;
|
|
735
735
|
}
|
|
736
736
|
case "command": {
|
|
737
737
|
let I;
|
|
738
738
|
try {
|
|
739
|
-
I = JSON.parse(
|
|
739
|
+
I = JSON.parse($);
|
|
740
740
|
} catch {
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
@@ -744,15 +744,15 @@ function cs(e) {
|
|
|
744
744
|
s == null || s(I.v);
|
|
745
745
|
return;
|
|
746
746
|
}
|
|
747
|
-
|
|
748
|
-
|
|
747
|
+
k++, Rn(n, I.kind, I.params).finally(() => {
|
|
748
|
+
k--;
|
|
749
749
|
});
|
|
750
750
|
break;
|
|
751
751
|
}
|
|
752
752
|
case "error": {
|
|
753
753
|
let I;
|
|
754
754
|
try {
|
|
755
|
-
I = JSON.parse(
|
|
755
|
+
I = JSON.parse($);
|
|
756
756
|
} catch {
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
@@ -765,64 +765,64 @@ function cs(e) {
|
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
const
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
}),
|
|
773
|
-
|
|
774
|
-
}),
|
|
775
|
-
I.data ?
|
|
776
|
-
}),
|
|
777
|
-
|
|
778
|
-
}), c =
|
|
768
|
+
function z() {
|
|
769
|
+
const O = `${t}/api/v1/ui/commands/next`, $ = new EventSource(O, { withCredentials: !0 });
|
|
770
|
+
$.addEventListener("init", (I) => {
|
|
771
|
+
B("init", I.data);
|
|
772
|
+
}), $.addEventListener("command", (I) => {
|
|
773
|
+
B("command", I.data);
|
|
774
|
+
}), $.addEventListener("error", (I) => {
|
|
775
|
+
I.data ? B("error", I.data) : b(!1);
|
|
776
|
+
}), $.addEventListener("heartbeat", (I) => {
|
|
777
|
+
B("heartbeat", I.data);
|
|
778
|
+
}), c = $;
|
|
779
779
|
}
|
|
780
780
|
async function h() {
|
|
781
781
|
if (!v)
|
|
782
782
|
try {
|
|
783
|
-
const
|
|
783
|
+
const O = `${t}/api/v1/ui/commands/next?poll=true`, $ = await fetch(O, { headers: Tn(o) });
|
|
784
784
|
if (v) return;
|
|
785
|
-
if (
|
|
786
|
-
l == null || l(
|
|
785
|
+
if ($.status === 401 || $.status === 403) {
|
|
786
|
+
l == null || l($.status);
|
|
787
787
|
return;
|
|
788
788
|
}
|
|
789
|
-
if (
|
|
790
|
-
const I = await
|
|
789
|
+
if (!$.ok) return;
|
|
790
|
+
const I = await $.json();
|
|
791
791
|
if (!Array.isArray(I)) return;
|
|
792
|
-
for (const
|
|
792
|
+
for (const L of I) {
|
|
793
793
|
if (v) return;
|
|
794
|
-
if (
|
|
795
|
-
s == null || s(
|
|
794
|
+
if (L.v !== 1) {
|
|
795
|
+
s == null || s(L.v);
|
|
796
796
|
continue;
|
|
797
797
|
}
|
|
798
|
-
|
|
798
|
+
k++;
|
|
799
799
|
try {
|
|
800
|
-
await Rn(n,
|
|
800
|
+
await Rn(n, L.kind, L.params);
|
|
801
801
|
} finally {
|
|
802
|
-
|
|
802
|
+
k--;
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
|
|
805
|
+
b(!0);
|
|
806
806
|
} catch {
|
|
807
|
-
|
|
807
|
+
b(!1);
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
810
|
function C() {
|
|
811
811
|
m = r.subscribe(() => {
|
|
812
812
|
if (v) return;
|
|
813
|
-
const
|
|
814
|
-
|
|
813
|
+
const O = k > 0 ? "agent" : "user";
|
|
814
|
+
W(O);
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
817
|
return {
|
|
818
818
|
connect() {
|
|
819
|
-
v = !1, !i && typeof EventSource < "u" ?
|
|
819
|
+
v = !1, !i && typeof EventSource < "u" ? z() : (h(), d = setInterval(h, a)), C();
|
|
820
820
|
},
|
|
821
821
|
disconnect() {
|
|
822
|
-
c && (c.close(), c = null), d !== null && (clearInterval(d), d = null), p !== null && (clearTimeout(p), p = null), m && (m(), m = null),
|
|
822
|
+
c && (c.close(), c = null), d !== null && (clearInterval(d), d = null), p !== null && (clearTimeout(p), p = null), m && (m(), m = null), b(!1), v = !0;
|
|
823
823
|
},
|
|
824
|
-
pushState(
|
|
825
|
-
_(
|
|
824
|
+
pushState(O) {
|
|
825
|
+
_(O);
|
|
826
826
|
}
|
|
827
827
|
};
|
|
828
828
|
}
|
|
@@ -855,12 +855,19 @@ function ds(e) {
|
|
|
855
855
|
}
|
|
856
856
|
const fs = 60;
|
|
857
857
|
function Le(e, t, n = fs) {
|
|
858
|
+
var o;
|
|
858
859
|
const r = e.surface();
|
|
859
860
|
if (r) {
|
|
860
861
|
t(r);
|
|
861
862
|
return;
|
|
862
863
|
}
|
|
863
|
-
|
|
864
|
+
if (e.isWorkbenchOpen()) {
|
|
865
|
+
if (n <= 0) {
|
|
866
|
+
(o = e.enqueue) == null || o.call(e, t);
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
requestAnimationFrame(() => Le(e, t, n - 1));
|
|
870
|
+
}
|
|
864
871
|
}
|
|
865
872
|
function tn(e, t) {
|
|
866
873
|
var n, r;
|
|
@@ -999,8 +1006,8 @@ function et(e) {
|
|
|
999
1006
|
return { cause: "remote", toolCallId: e, ts: Date.now() };
|
|
1000
1007
|
}
|
|
1001
1008
|
function nn(e, t) {
|
|
1002
|
-
const n =
|
|
1003
|
-
n.current = t,
|
|
1009
|
+
const n = D(t);
|
|
1010
|
+
n.current = t, M(() => K.on(e, (r) => n.current(r)), [e]);
|
|
1004
1011
|
}
|
|
1005
1012
|
function Ss(e) {
|
|
1006
1013
|
K.emit(Ee.agentData, { ts: Date.now(), part: e });
|
|
@@ -1021,44 +1028,44 @@ function Nn(e, t) {
|
|
|
1021
1028
|
function Es(e) {
|
|
1022
1029
|
const t = e.endpoint ?? "", n = e.ctx, r = e.query, o = e.eventSourceCtor === null ? null : e.eventSourceCtor ?? (typeof EventSource < "u" ? EventSource : null), i = e.fetcher ?? (typeof fetch < "u" ? fetch : null), a = e.reconnectDelayMs ?? Ps, l = e.maxReconnects ?? Cs, s = e.pollIntervalMs ?? ks;
|
|
1023
1030
|
let f = !1, c = null, d = null, p = null, m = null, g = 0, v = !1;
|
|
1024
|
-
function
|
|
1025
|
-
|
|
1031
|
+
function k(W) {
|
|
1032
|
+
W && typeof W == "object" && typeof W.kind == "string" && tn(W, n);
|
|
1026
1033
|
}
|
|
1027
|
-
function
|
|
1034
|
+
function b() {
|
|
1028
1035
|
if (f || v || !i) return;
|
|
1029
1036
|
v = !0;
|
|
1030
|
-
const
|
|
1037
|
+
const W = async () => {
|
|
1031
1038
|
if (!f) {
|
|
1032
1039
|
p = new AbortController();
|
|
1033
1040
|
try {
|
|
1034
|
-
const
|
|
1041
|
+
const B = await i(Nn(`${t}/api/v1/ui/commands/next?poll=true`, r), {
|
|
1035
1042
|
signal: p.signal
|
|
1036
1043
|
});
|
|
1037
1044
|
if (f) return;
|
|
1038
|
-
if (
|
|
1039
|
-
const
|
|
1040
|
-
if (Array.isArray(
|
|
1045
|
+
if (B.ok) {
|
|
1046
|
+
const z = await B.json();
|
|
1047
|
+
if (Array.isArray(z)) for (const h of z) k(h);
|
|
1041
1048
|
}
|
|
1042
1049
|
} catch {
|
|
1043
1050
|
} finally {
|
|
1044
1051
|
p = null;
|
|
1045
1052
|
}
|
|
1046
|
-
f || (d = setTimeout(
|
|
1053
|
+
f || (d = setTimeout(W, s));
|
|
1047
1054
|
}
|
|
1048
1055
|
};
|
|
1049
|
-
|
|
1056
|
+
W();
|
|
1050
1057
|
}
|
|
1051
1058
|
function _() {
|
|
1052
1059
|
if (!f) {
|
|
1053
1060
|
if (!o) {
|
|
1054
|
-
|
|
1061
|
+
b();
|
|
1055
1062
|
return;
|
|
1056
1063
|
}
|
|
1057
|
-
c = new o(Nn(`${t}/api/v1/ui/commands/next`, r)), c.addEventListener("command", (
|
|
1058
|
-
const
|
|
1059
|
-
if (!(typeof
|
|
1064
|
+
c = new o(Nn(`${t}/api/v1/ui/commands/next`, r)), c.addEventListener("command", (W) => {
|
|
1065
|
+
const B = W.data;
|
|
1066
|
+
if (!(typeof B != "string" || B.length === 0))
|
|
1060
1067
|
try {
|
|
1061
|
-
|
|
1068
|
+
k(JSON.parse(B));
|
|
1062
1069
|
} catch {
|
|
1063
1070
|
}
|
|
1064
1071
|
}), c.addEventListener("init", () => {
|
|
@@ -1066,7 +1073,7 @@ function Es(e) {
|
|
|
1066
1073
|
}), c.addEventListener("error", () => {
|
|
1067
1074
|
if (!f) {
|
|
1068
1075
|
if (c == null || c.close(), c = null, g += 1, g > l) {
|
|
1069
|
-
|
|
1076
|
+
b();
|
|
1070
1077
|
return;
|
|
1071
1078
|
}
|
|
1072
1079
|
m = setTimeout(_, a * g);
|
|
@@ -1123,11 +1130,11 @@ class As {
|
|
|
1123
1130
|
continue;
|
|
1124
1131
|
}
|
|
1125
1132
|
if (!v.ok) {
|
|
1126
|
-
const
|
|
1133
|
+
const k = await Ds(v);
|
|
1127
1134
|
throw new Je(
|
|
1128
1135
|
v.status,
|
|
1129
1136
|
`HTTP ${v.status}: ${v.statusText}`,
|
|
1130
|
-
|
|
1137
|
+
k
|
|
1131
1138
|
);
|
|
1132
1139
|
}
|
|
1133
1140
|
return await v.json();
|
|
@@ -1174,14 +1181,21 @@ class As {
|
|
|
1174
1181
|
* `FileConflictError` so the editor can ask the user to reload or
|
|
1175
1182
|
* force-overwrite. The returned `mtimeMs` is the server's stat
|
|
1176
1183
|
* after the write; callers use it as the OCC baseline for the
|
|
1177
|
-
* next save.
|
|
1184
|
+
* next save. Set `returnMtimeMs: false` only for writes that do
|
|
1185
|
+
* not need a fresh OCC baseline (for example, creating an empty
|
|
1186
|
+
* file before immediately opening/refetching it). That lets remote
|
|
1187
|
+
* sandboxes skip an expensive post-write stat.
|
|
1178
1188
|
*/
|
|
1179
1189
|
async writeFile(t, n, r) {
|
|
1180
1190
|
try {
|
|
1181
|
-
|
|
1191
|
+
const o = {
|
|
1192
|
+
path: t,
|
|
1193
|
+
content: n
|
|
1194
|
+
};
|
|
1195
|
+
return (r == null ? void 0 : r.expectedMtimeMs) != null && (o.expectedMtimeMs = r.expectedMtimeMs), (r == null ? void 0 : r.returnMtimeMs) === !1 && (o.returnMtimeMs = !1), { mtimeMs: (await this.request(
|
|
1182
1196
|
"POST",
|
|
1183
1197
|
"/api/v1/files",
|
|
1184
|
-
|
|
1198
|
+
o
|
|
1185
1199
|
)).mtimeMs };
|
|
1186
1200
|
} catch (o) {
|
|
1187
1201
|
throw o instanceof Je && o.status === 409 ? ut.from(o, t) : o;
|
|
@@ -1303,7 +1317,7 @@ function Or(e, t, n) {
|
|
|
1303
1317
|
}
|
|
1304
1318
|
function Ws() {
|
|
1305
1319
|
const e = xr(), t = Xe(), n = Qe();
|
|
1306
|
-
|
|
1320
|
+
M(() => {
|
|
1307
1321
|
const r = Bs(e), o = /* @__PURE__ */ new Set(), i = (c) => {
|
|
1308
1322
|
const d = setTimeout(() => {
|
|
1309
1323
|
o.delete(d), c();
|
|
@@ -1406,7 +1420,7 @@ function $n(e, t, n) {
|
|
|
1406
1420
|
}
|
|
1407
1421
|
function Hs() {
|
|
1408
1422
|
const e = Xe(), t = Qe(), n = xr();
|
|
1409
|
-
|
|
1423
|
+
M(() => {
|
|
1410
1424
|
if (typeof window > "u" || typeof EventSource > "u") return;
|
|
1411
1425
|
const r = Js(Ks(e, "/api/v1/fs/events"), t);
|
|
1412
1426
|
let o, i = !1;
|
|
@@ -1503,7 +1517,7 @@ function Ys({
|
|
|
1503
1517
|
client: o,
|
|
1504
1518
|
children: i
|
|
1505
1519
|
}) {
|
|
1506
|
-
const a =
|
|
1520
|
+
const a = D(null);
|
|
1507
1521
|
a.current || (a.current = new Ii({
|
|
1508
1522
|
defaultOptions: {
|
|
1509
1523
|
queries: {
|
|
@@ -1516,7 +1530,7 @@ function Ys({
|
|
|
1516
1530
|
() => o ?? new As({ apiBaseUrl: e, authHeaders: t, onAuthError: n, timeout: r }),
|
|
1517
1531
|
[o, e, t, n, r]
|
|
1518
1532
|
), s = (t == null ? void 0 : t["x-boring-workspace-id"]) ?? (t == null ? void 0 : t["X-Boring-Workspace-Id"]) ?? null;
|
|
1519
|
-
return /* @__PURE__ */ u(Ti, { client: a.current, children: /* @__PURE__ */ u(Mr.Provider, { value: e, children: /* @__PURE__ */ u(Wr.Provider, { value: s, children: /* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ u(Ti, { client: a.current, children: /* @__PURE__ */ u(Mr.Provider, { value: e, children: /* @__PURE__ */ u(Wr.Provider, { value: s, children: /* @__PURE__ */ x(gn.Provider, { value: l, children: [
|
|
1520
1534
|
/* @__PURE__ */ u(Xs, {}),
|
|
1521
1535
|
i
|
|
1522
1536
|
] }) }) }) });
|
|
@@ -1578,8 +1592,8 @@ function ra(e) {
|
|
|
1578
1592
|
});
|
|
1579
1593
|
}
|
|
1580
1594
|
function oa(e, t) {
|
|
1581
|
-
const n = We(), r = Xe(), o = Qe(), [i, a] =
|
|
1582
|
-
return
|
|
1595
|
+
const n = We(), r = Xe(), o = Qe(), [i, a] = j(e), l = D(void 0);
|
|
1596
|
+
return M(() => (clearTimeout(l.current), l.current = setTimeout(() => a(e), 300), () => clearTimeout(l.current)), [e]), Lt({
|
|
1583
1597
|
queryKey: [r, o, "search", i, t],
|
|
1584
1598
|
queryFn: ({ signal: s }) => n.search(i, t, s),
|
|
1585
1599
|
enabled: i.length > 0,
|
|
@@ -1589,7 +1603,13 @@ function oa(e, t) {
|
|
|
1589
1603
|
function Ur() {
|
|
1590
1604
|
const e = We();
|
|
1591
1605
|
return Ot({
|
|
1592
|
-
mutationFn: ({ path: t, content: n, expectedMtimeMs: r
|
|
1606
|
+
mutationFn: ({ path: t, content: n, expectedMtimeMs: r, returnMtimeMs: o }) => {
|
|
1607
|
+
const i = {
|
|
1608
|
+
...r != null ? { expectedMtimeMs: r } : {},
|
|
1609
|
+
...o === !1 ? { returnMtimeMs: !1 } : {}
|
|
1610
|
+
};
|
|
1611
|
+
return e.writeFile(t, n, Object.keys(i).length > 0 ? i : void 0);
|
|
1612
|
+
},
|
|
1593
1613
|
onSuccess: (t, { path: n }) => {
|
|
1594
1614
|
K.emit(ee.changed, { ...it(), path: n });
|
|
1595
1615
|
}
|
|
@@ -1644,12 +1664,12 @@ function da(e) {
|
|
|
1644
1664
|
return ve(qr.Provider, { value: { report: t } }, e.children);
|
|
1645
1665
|
}
|
|
1646
1666
|
function fa(e) {
|
|
1647
|
-
return
|
|
1667
|
+
return M(() => {
|
|
1648
1668
|
e.onReady();
|
|
1649
1669
|
}, [e.onReady]), ve(gr, null, e.children);
|
|
1650
1670
|
}
|
|
1651
1671
|
function pa(e) {
|
|
1652
|
-
return
|
|
1672
|
+
return M(() => {
|
|
1653
1673
|
e.onLoading();
|
|
1654
1674
|
}, [e.onLoading]), ve(
|
|
1655
1675
|
"div",
|
|
@@ -1671,7 +1691,7 @@ function ha(e) {
|
|
|
1671
1691
|
...a ? { error: a } : {}
|
|
1672
1692
|
});
|
|
1673
1693
|
}, [n, e.panelId, e.pluginId, e.revision, t]);
|
|
1674
|
-
|
|
1694
|
+
M(() => () => r("missing"), [r]);
|
|
1675
1695
|
const o = E((i) => {
|
|
1676
1696
|
r("error", { code: "PLUGIN_PANEL_RENDER_ERROR", message: i.message });
|
|
1677
1697
|
}, [r]);
|
|
@@ -1987,45 +2007,45 @@ function Pa() {
|
|
|
1987
2007
|
);
|
|
1988
2008
|
}
|
|
1989
2009
|
function Ca(e) {
|
|
1990
|
-
const { api: t } = e, n = e.tabLocation === "headerOverflow", [r, o] =
|
|
1991
|
-
|
|
1992
|
-
var
|
|
2010
|
+
const { api: t } = e, n = e.tabLocation === "headerOverflow", [r, o] = j(t.title ?? t.id), [i, a] = j(null), l = D(null);
|
|
2011
|
+
M(() => {
|
|
2012
|
+
var F;
|
|
1993
2013
|
const h = () => o(t.title ?? t.id);
|
|
1994
2014
|
h();
|
|
1995
|
-
const C = (
|
|
2015
|
+
const C = (F = t.onDidTitleChange) == null ? void 0 : F.call(t, h);
|
|
1996
2016
|
return () => {
|
|
1997
|
-
var
|
|
1998
|
-
return (
|
|
2017
|
+
var O;
|
|
2018
|
+
return (O = C == null ? void 0 : C.dispose) == null ? void 0 : O.call(C);
|
|
1999
2019
|
};
|
|
2000
|
-
}, [t]),
|
|
2020
|
+
}, [t]), M(() => {
|
|
2001
2021
|
if (!i) return;
|
|
2002
2022
|
function h(C) {
|
|
2003
2023
|
l.current && !l.current.contains(C.target) && a(null);
|
|
2004
2024
|
}
|
|
2005
2025
|
return document.addEventListener("pointerdown", h), () => document.removeEventListener("pointerdown", h);
|
|
2006
2026
|
}, [i]);
|
|
2007
|
-
const s = r.endsWith(" ●"), f = s ? r.slice(0, -2) : r, c = ga(f), d = Sa(e.params, "path") ?? xa(t.id), p = wa(e).map(ba).filter((h) => h.close), m = p.filter((h) => h.id !== t.id), [g, v] =
|
|
2027
|
+
const s = r.endsWith(" ●"), f = s ? r.slice(0, -2) : r, c = ga(f), d = Sa(e.params, "path") ?? xa(t.id), p = wa(e).map(ba).filter((h) => h.close), m = p.filter((h) => h.id !== t.id), [g, v] = j(!1);
|
|
2008
2028
|
nn(Ee.editorSaveStart, (h) => {
|
|
2009
2029
|
h.panelId === t.id && v(!0);
|
|
2010
2030
|
}), nn(Ee.editorSaveEnd, (h) => {
|
|
2011
2031
|
h.panelId === t.id && v(!1);
|
|
2012
2032
|
});
|
|
2013
|
-
const
|
|
2033
|
+
const k = (h) => {
|
|
2014
2034
|
h.preventDefault(), h.stopPropagation(), n && h.nativeEvent.stopImmediatePropagation(), t.close(), n && Pa();
|
|
2015
|
-
},
|
|
2035
|
+
}, b = (h) => {
|
|
2016
2036
|
!d && m.length === 0 || (h.preventDefault(), h.stopPropagation(), a({ x: h.clientX, y: h.clientY }));
|
|
2017
2037
|
}, _ = (h) => {
|
|
2018
2038
|
a(null), ka(h);
|
|
2019
|
-
},
|
|
2039
|
+
}, W = () => {
|
|
2020
2040
|
var h, C;
|
|
2021
2041
|
a(null), (h = t.setActive) == null || h.call(t);
|
|
2022
|
-
for (const
|
|
2023
|
-
},
|
|
2042
|
+
for (const F of m) (C = F.close) == null || C.call(F);
|
|
2043
|
+
}, B = () => {
|
|
2024
2044
|
var h, C;
|
|
2025
2045
|
a(null), (h = t.setActive) == null || h.call(t);
|
|
2026
|
-
for (const
|
|
2027
|
-
},
|
|
2028
|
-
/* @__PURE__ */
|
|
2046
|
+
for (const F of p) (C = F.close) == null || C.call(F);
|
|
2047
|
+
}, z = i && typeof document < "u" ? kr(
|
|
2048
|
+
/* @__PURE__ */ x(
|
|
2029
2049
|
"div",
|
|
2030
2050
|
{
|
|
2031
2051
|
ref: l,
|
|
@@ -2053,7 +2073,7 @@ function Ca(e) {
|
|
|
2053
2073
|
type: "button",
|
|
2054
2074
|
role: "menuitem",
|
|
2055
2075
|
className: "flex w-full items-center rounded-sm px-2 py-1.5 text-left text-xs hover:bg-accent hover:text-accent-foreground",
|
|
2056
|
-
onClick:
|
|
2076
|
+
onClick: W,
|
|
2057
2077
|
children: "Close other tabs"
|
|
2058
2078
|
}
|
|
2059
2079
|
) : null,
|
|
@@ -2063,7 +2083,7 @@ function Ca(e) {
|
|
|
2063
2083
|
type: "button",
|
|
2064
2084
|
role: "menuitem",
|
|
2065
2085
|
className: "flex w-full items-center rounded-sm px-2 py-1.5 text-left text-xs hover:bg-accent hover:text-accent-foreground",
|
|
2066
|
-
onClick:
|
|
2086
|
+
onClick: B,
|
|
2067
2087
|
children: "Close all"
|
|
2068
2088
|
}
|
|
2069
2089
|
) : null
|
|
@@ -2072,8 +2092,8 @@ function Ca(e) {
|
|
|
2072
2092
|
),
|
|
2073
2093
|
document.body
|
|
2074
2094
|
) : null;
|
|
2075
|
-
return /* @__PURE__ */
|
|
2076
|
-
/* @__PURE__ */
|
|
2095
|
+
return /* @__PURE__ */ x(gr, { children: [
|
|
2096
|
+
/* @__PURE__ */ x(
|
|
2077
2097
|
"div",
|
|
2078
2098
|
{
|
|
2079
2099
|
className: oe(
|
|
@@ -2083,9 +2103,9 @@ function Ca(e) {
|
|
|
2083
2103
|
),
|
|
2084
2104
|
title: s ? `${f} (unsaved changes)` : f,
|
|
2085
2105
|
onPointerDown: (h) => {
|
|
2086
|
-
h.button === 2 &&
|
|
2106
|
+
h.button === 2 && b(h);
|
|
2087
2107
|
},
|
|
2088
|
-
onContextMenu:
|
|
2108
|
+
onContextMenu: b,
|
|
2089
2109
|
children: [
|
|
2090
2110
|
/* @__PURE__ */ u(
|
|
2091
2111
|
c,
|
|
@@ -2098,7 +2118,7 @@ function Ca(e) {
|
|
|
2098
2118
|
}
|
|
2099
2119
|
),
|
|
2100
2120
|
/* @__PURE__ */ u("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: f }),
|
|
2101
|
-
/* @__PURE__ */
|
|
2121
|
+
/* @__PURE__ */ x("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
2102
2122
|
s || g ? /* @__PURE__ */ u(
|
|
2103
2123
|
"span",
|
|
2104
2124
|
{
|
|
@@ -2125,8 +2145,8 @@ function Ca(e) {
|
|
|
2125
2145
|
...n ? (
|
|
2126
2146
|
// In the overflow popover, intercept on capture so we run before
|
|
2127
2147
|
// dockview's native row click listener (see handleClose).
|
|
2128
|
-
{ onClickCapture:
|
|
2129
|
-
) : { onClick:
|
|
2148
|
+
{ onClickCapture: k }
|
|
2149
|
+
) : { onClick: k },
|
|
2130
2150
|
"aria-label": `Close ${f}`,
|
|
2131
2151
|
children: /* @__PURE__ */ u(ln, { className: "h-3 w-3", strokeWidth: 2.25 })
|
|
2132
2152
|
}
|
|
@@ -2135,7 +2155,7 @@ function Ca(e) {
|
|
|
2135
2155
|
]
|
|
2136
2156
|
}
|
|
2137
2157
|
),
|
|
2138
|
-
|
|
2158
|
+
z
|
|
2139
2159
|
] });
|
|
2140
2160
|
}
|
|
2141
2161
|
const Ea = 300, Vr = Ce(null);
|
|
@@ -2337,72 +2357,72 @@ function Da({
|
|
|
2337
2357
|
rightHeaderActions: l,
|
|
2338
2358
|
watermarkComponent: s
|
|
2339
2359
|
}) {
|
|
2340
|
-
const f = Mt(), c = ot(f.subscribe, f.getSnapshot, f.getSnapshot), d = va(), p =
|
|
2341
|
-
const
|
|
2360
|
+
const f = Mt(), c = ot(f.subscribe, f.getSnapshot, f.getSnapshot), d = va(), p = D(null), m = D(null), g = D(void 0), v = D(null), k = Y(() => {
|
|
2361
|
+
const B = f.getComponents(), z = o ? Object.fromEntries(Object.entries(B).filter(([C]) => o.includes(C))) : B, h = v.current;
|
|
2342
2362
|
if (h) {
|
|
2343
|
-
const C = Object.keys(h),
|
|
2344
|
-
if (C.length ===
|
|
2363
|
+
const C = Object.keys(h), F = Object.keys(z);
|
|
2364
|
+
if (C.length === F.length && F.every((O) => h[O] === z[O]))
|
|
2345
2365
|
return h;
|
|
2346
2366
|
}
|
|
2347
|
-
return v.current =
|
|
2348
|
-
}, [f, c, o]),
|
|
2349
|
-
(
|
|
2350
|
-
var
|
|
2351
|
-
(
|
|
2352
|
-
|
|
2367
|
+
return v.current = z, z;
|
|
2368
|
+
}, [f, c, o]), b = Y(() => Ra(p), []), _ = E(
|
|
2369
|
+
(B) => {
|
|
2370
|
+
var z;
|
|
2371
|
+
(z = g.current) == null || z.call(g), g.current = Aa(
|
|
2372
|
+
B,
|
|
2353
2373
|
e,
|
|
2354
2374
|
t,
|
|
2355
2375
|
f,
|
|
2356
2376
|
r,
|
|
2357
2377
|
p
|
|
2358
|
-
), n == null || n(
|
|
2378
|
+
), n == null || n(B.api);
|
|
2359
2379
|
},
|
|
2360
2380
|
[e, t, f, r, n]
|
|
2361
2381
|
);
|
|
2362
|
-
|
|
2363
|
-
var
|
|
2364
|
-
return (
|
|
2365
|
-
}, []),
|
|
2366
|
-
const
|
|
2367
|
-
const
|
|
2368
|
-
if (
|
|
2369
|
-
for (const
|
|
2370
|
-
C &&
|
|
2371
|
-
|
|
2382
|
+
M(() => () => {
|
|
2383
|
+
var B;
|
|
2384
|
+
return (B = g.current) == null ? void 0 : B.call(g);
|
|
2385
|
+
}, []), M(() => {
|
|
2386
|
+
const B = K.on(Ee.panelUpdate, ({ match: h, params: C, title: F }) => {
|
|
2387
|
+
const O = p.current;
|
|
2388
|
+
if (O)
|
|
2389
|
+
for (const $ of On(O, h))
|
|
2390
|
+
C && $.api.updateParameters({
|
|
2391
|
+
...$.params ?? {},
|
|
2372
2392
|
...C
|
|
2373
|
-
}),
|
|
2374
|
-
}),
|
|
2393
|
+
}), F && $.api.setTitle(F);
|
|
2394
|
+
}), z = K.on(Ee.panelClose, ({ match: h }) => {
|
|
2375
2395
|
const C = p.current;
|
|
2376
2396
|
if (C)
|
|
2377
|
-
for (const
|
|
2378
|
-
C.removePanel(
|
|
2397
|
+
for (const F of On(C, h))
|
|
2398
|
+
C.removePanel(F);
|
|
2379
2399
|
});
|
|
2380
2400
|
return () => {
|
|
2381
|
-
|
|
2401
|
+
B(), z();
|
|
2382
2402
|
};
|
|
2383
2403
|
}, []);
|
|
2384
|
-
const
|
|
2385
|
-
(
|
|
2404
|
+
const W = E(
|
|
2405
|
+
(B) => {
|
|
2386
2406
|
if (!d) {
|
|
2387
|
-
m.current =
|
|
2407
|
+
m.current = B;
|
|
2388
2408
|
return;
|
|
2389
2409
|
}
|
|
2390
|
-
_(
|
|
2410
|
+
_(B);
|
|
2391
2411
|
},
|
|
2392
2412
|
[d, _]
|
|
2393
2413
|
);
|
|
2394
|
-
return
|
|
2414
|
+
return M(() => {
|
|
2395
2415
|
d && m.current && (_(m.current), m.current = null);
|
|
2396
|
-
}, [d, _]), d ? /* @__PURE__ */ u(Vr.Provider, { value:
|
|
2416
|
+
}, [d, _]), d ? /* @__PURE__ */ u(Vr.Provider, { value: b, children: /* @__PURE__ */ u(
|
|
2397
2417
|
Pr,
|
|
2398
2418
|
{
|
|
2399
2419
|
className: `dv-shell ${i ?? ""}`,
|
|
2400
|
-
components:
|
|
2420
|
+
components: k,
|
|
2401
2421
|
defaultTabComponent: Ca,
|
|
2402
2422
|
prefixHeaderActionsComponent: a,
|
|
2403
2423
|
rightHeaderActionsComponent: l,
|
|
2404
2424
|
watermarkComponent: s,
|
|
2405
|
-
onReady:
|
|
2425
|
+
onReady: W
|
|
2406
2426
|
}
|
|
2407
2427
|
) }) : /* @__PURE__ */ u(_a, {});
|
|
2408
2428
|
}
|
|
@@ -2442,8 +2462,8 @@ function $a({
|
|
|
2442
2462
|
return Y(
|
|
2443
2463
|
() => i ? Fa(i) : null,
|
|
2444
2464
|
[i]
|
|
2445
|
-
), /* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2465
|
+
), /* @__PURE__ */ x("div", { className: oe("flex h-full flex-col overflow-hidden", o), children: [
|
|
2466
|
+
/* @__PURE__ */ x("div", { className: "flex h-9 shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-3", children: [
|
|
2447
2467
|
t && /* @__PURE__ */ u(t, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
2448
2468
|
/* @__PURE__ */ u("span", { className: "truncate text-sm font-medium", children: e }),
|
|
2449
2469
|
/* @__PURE__ */ u("div", { className: "flex-1" }),
|
|
@@ -2548,7 +2568,7 @@ async function Wn(e) {
|
|
|
2548
2568
|
}
|
|
2549
2569
|
if (!n) throw new Error("Clipboard not available");
|
|
2550
2570
|
}
|
|
2551
|
-
const Kr = () => import("./FileTree-
|
|
2571
|
+
const Kr = () => import("./FileTree-CoZWkHqn.js").then((e) => ({ default: e.FileTree }));
|
|
2552
2572
|
function Wa() {
|
|
2553
2573
|
Kr();
|
|
2554
2574
|
}
|
|
@@ -2590,58 +2610,58 @@ function jn({
|
|
|
2590
2610
|
className: i
|
|
2591
2611
|
}) {
|
|
2592
2612
|
var Pn;
|
|
2593
|
-
const a = We(), { data: l, error: s, isLoading: f } = Br(e), [c, d] =
|
|
2613
|
+
const a = We(), { data: l, error: s, isLoading: f } = Br(e), [c, d] = j(/* @__PURE__ */ new Map()), [p, m] = j(/* @__PURE__ */ new Set()), g = qt(e), v = Y(
|
|
2594
2614
|
() => Vt(Ht(l, c.get(g)), p),
|
|
2595
2615
|
[l, c, g, p]
|
|
2596
|
-
),
|
|
2616
|
+
), k = Y(
|
|
2597
2617
|
() => Oa(v, o),
|
|
2598
2618
|
[v, o]
|
|
2599
|
-
), { mutateAsync:
|
|
2600
|
-
if (c.size === 0 && p.size === 0) return
|
|
2619
|
+
), { mutateAsync: b } = Ur(), { mutateAsync: _ } = ia(), { mutateAsync: W } = sa(), { mutateAsync: B } = aa(), [z, h] = j(/* @__PURE__ */ new Map()), C = Y(() => {
|
|
2620
|
+
if (c.size === 0 && p.size === 0) return z;
|
|
2601
2621
|
const y = /* @__PURE__ */ new Map();
|
|
2602
|
-
for (const [
|
|
2603
|
-
y.set(
|
|
2604
|
-
for (const [
|
|
2605
|
-
if (
|
|
2606
|
-
const V = Vt(Ht(y.get(
|
|
2607
|
-
V && y.set(
|
|
2622
|
+
for (const [w, P] of z)
|
|
2623
|
+
y.set(w, Vt(P, p) ?? P);
|
|
2624
|
+
for (const [w, P] of c) {
|
|
2625
|
+
if (w === g) continue;
|
|
2626
|
+
const V = Vt(Ht(y.get(w), P), p);
|
|
2627
|
+
V && y.set(w, V);
|
|
2608
2628
|
}
|
|
2609
2629
|
return y;
|
|
2610
|
-
}, [
|
|
2630
|
+
}, [z, c, g, p]), F = D(null), [O, $] = j(400), [I, L] = j(null), T = I && !I.isBackground && I.node.kind === "file" ? I.node.path : null, { data: A } = ra(T), [J, H] = j(null), te = D(null), [X, ae] = j(
|
|
2611
2631
|
((Pn = n == null ? void 0 : n.getActiveFile) == null ? void 0 : Pn.call(n)) ?? null
|
|
2612
|
-
), [ue, q] =
|
|
2632
|
+
), [ue, q] = j(null), [ce, fe] = j(null), ke = D(0), Pe = D(0), He = D(0), Ve = ((t == null ? void 0 : t.trim().length) ?? 0) > 0, { data: Ie } = oa(
|
|
2613
2633
|
Ve ? Gr(t ?? "") : "",
|
|
2614
2634
|
50
|
|
2615
2635
|
);
|
|
2616
|
-
|
|
2636
|
+
M(() => {
|
|
2617
2637
|
if (!I) return;
|
|
2618
|
-
function y(
|
|
2619
|
-
te.current && !te.current.contains(
|
|
2638
|
+
function y(w) {
|
|
2639
|
+
te.current && !te.current.contains(w.target) && L(null);
|
|
2620
2640
|
}
|
|
2621
2641
|
return document.addEventListener("pointerdown", y), () => document.removeEventListener("pointerdown", y);
|
|
2622
2642
|
}, [I]), zo(() => {
|
|
2623
2643
|
if (!I || !te.current) return;
|
|
2624
|
-
const { x: y, y:
|
|
2644
|
+
const { x: y, y: w } = Ba(
|
|
2625
2645
|
I.x,
|
|
2626
2646
|
I.y,
|
|
2627
2647
|
te.current.getBoundingClientRect(),
|
|
2628
2648
|
window.innerWidth,
|
|
2629
2649
|
window.innerHeight
|
|
2630
2650
|
);
|
|
2631
|
-
y === I.x &&
|
|
2632
|
-
}, [I]),
|
|
2633
|
-
const y =
|
|
2651
|
+
y === I.x && w === I.y || L((P) => !P || P.x === y && P.y === w ? P : { ...P, x: y, y: w });
|
|
2652
|
+
}, [I]), M(() => {
|
|
2653
|
+
const y = F.current;
|
|
2634
2654
|
if (!y) return;
|
|
2635
|
-
const
|
|
2636
|
-
|
|
2655
|
+
const w = new ResizeObserver(([P]) => {
|
|
2656
|
+
P && $(Math.floor(P.contentRect.height));
|
|
2637
2657
|
});
|
|
2638
|
-
return
|
|
2658
|
+
return w.observe(y), () => w.disconnect();
|
|
2639
2659
|
}, []);
|
|
2640
2660
|
const me = (Ve && Ie ? Ie.map((y) => ({
|
|
2641
2661
|
name: y.split("/").pop() ?? y,
|
|
2642
2662
|
kind: "file",
|
|
2643
2663
|
path: y
|
|
2644
|
-
})) : void 0) ?? Lr(
|
|
2664
|
+
})) : void 0) ?? Lr(k ?? [], C), Ne = Or(me, ue, e), Te = E(
|
|
2645
2665
|
(y) => {
|
|
2646
2666
|
ae(y), n == null || n.openFile(y, { mode: "edit" });
|
|
2647
2667
|
},
|
|
@@ -2649,20 +2669,20 @@ function jn({
|
|
|
2649
2669
|
), Ze = E(
|
|
2650
2670
|
async (y) => {
|
|
2651
2671
|
try {
|
|
2652
|
-
const
|
|
2653
|
-
h((V) => new Map(V).set(y,
|
|
2672
|
+
const w = await a.getTree(y), P = o.length === 0 ? w : w.filter((V) => !an(V.name, o));
|
|
2673
|
+
h((V) => new Map(V).set(y, P));
|
|
2654
2674
|
} catch {
|
|
2655
2675
|
}
|
|
2656
2676
|
},
|
|
2657
2677
|
[a, o]
|
|
2658
2678
|
), he = E(
|
|
2659
|
-
async (y,
|
|
2660
|
-
const
|
|
2679
|
+
async (y, w) => {
|
|
2680
|
+
const P = Array.from(new Set(y)).filter(
|
|
2661
2681
|
(U) => U && U !== e && U !== "."
|
|
2662
2682
|
);
|
|
2663
|
-
if (
|
|
2683
|
+
if (P.length === 0) return;
|
|
2664
2684
|
const V = await Promise.all(
|
|
2665
|
-
|
|
2685
|
+
P.map(async (U) => {
|
|
2666
2686
|
try {
|
|
2667
2687
|
const ne = await a.getTree(U), re = o.length === 0 ? ne : ne.filter((we) => !an(we.name, o));
|
|
2668
2688
|
return [U, re];
|
|
@@ -2676,17 +2696,17 @@ function jn({
|
|
|
2676
2696
|
for (const re of V) {
|
|
2677
2697
|
if (!re) continue;
|
|
2678
2698
|
const [we, De] = re;
|
|
2679
|
-
(
|
|
2699
|
+
(w != null && w.force || ne.has(we)) && ne.set(we, De);
|
|
2680
2700
|
}
|
|
2681
2701
|
return ne;
|
|
2682
2702
|
});
|
|
2683
2703
|
},
|
|
2684
2704
|
[a, e, o]
|
|
2685
|
-
), ze =
|
|
2686
|
-
|
|
2687
|
-
ze.current = new Set(
|
|
2688
|
-
}, [
|
|
2689
|
-
const y = /* @__PURE__ */ new Set(),
|
|
2705
|
+
), ze = D(/* @__PURE__ */ new Set());
|
|
2706
|
+
M(() => {
|
|
2707
|
+
ze.current = new Set(z.keys());
|
|
2708
|
+
}, [z]), M(() => {
|
|
2709
|
+
const y = /* @__PURE__ */ new Set(), w = (re) => Array.from(new Set(re.map(Se))).filter((we) => ze.current.has(we)), P = (re) => {
|
|
2690
2710
|
if (!re.length) return;
|
|
2691
2711
|
he(re);
|
|
2692
2712
|
const we = setTimeout(() => {
|
|
@@ -2694,11 +2714,11 @@ function jn({
|
|
|
2694
2714
|
}, ja);
|
|
2695
2715
|
y.add(we);
|
|
2696
2716
|
}, V = K.on(ee.created, (re) => {
|
|
2697
|
-
re.cause !== "user" &&
|
|
2717
|
+
re.cause !== "user" && P(w([re.path]));
|
|
2698
2718
|
}), U = K.on(ee.deleted, (re) => {
|
|
2699
|
-
re.cause !== "user" &&
|
|
2719
|
+
re.cause !== "user" && P(w([re.path]));
|
|
2700
2720
|
}), ne = K.on(ee.moved, (re) => {
|
|
2701
|
-
re.cause !== "user" &&
|
|
2721
|
+
re.cause !== "user" && P(w([re.from, re.to]));
|
|
2702
2722
|
});
|
|
2703
2723
|
return () => {
|
|
2704
2724
|
V(), U(), ne();
|
|
@@ -2707,105 +2727,105 @@ function jn({
|
|
|
2707
2727
|
};
|
|
2708
2728
|
}, [he]);
|
|
2709
2729
|
const Ae = E(
|
|
2710
|
-
async (y,
|
|
2730
|
+
async (y, w) => {
|
|
2711
2731
|
if (!y) return;
|
|
2712
|
-
const
|
|
2713
|
-
ae(
|
|
2714
|
-
const U =
|
|
2715
|
-
await he([...new Set(U)], { force: !0 }), ke.current === V && fe(
|
|
2732
|
+
const P = Jr(y), V = ++ke.current;
|
|
2733
|
+
ae(P);
|
|
2734
|
+
const U = w != null && w.refreshTargetDir ? [...zn(P), P] : zn(P);
|
|
2735
|
+
await he([...new Set(U)], { force: !0 }), ke.current === V && fe(P);
|
|
2716
2736
|
},
|
|
2717
2737
|
[he]
|
|
2718
2738
|
), st = E((y) => {
|
|
2719
|
-
fe((
|
|
2720
|
-
}, []),
|
|
2739
|
+
fe((w) => w === y ? null : w);
|
|
2740
|
+
}, []), S = E(
|
|
2721
2741
|
async (y) => {
|
|
2722
|
-
const
|
|
2742
|
+
const w = ++Pe.current;
|
|
2723
2743
|
try {
|
|
2724
2744
|
await Ae(y, { refreshTargetDir: !0 });
|
|
2725
2745
|
} finally {
|
|
2726
|
-
Pe.current ===
|
|
2746
|
+
Pe.current === w && (Pe.current = 0);
|
|
2727
2747
|
}
|
|
2728
2748
|
},
|
|
2729
2749
|
[Ae]
|
|
2730
2750
|
);
|
|
2731
|
-
|
|
2732
|
-
r &&
|
|
2733
|
-
}, [r,
|
|
2734
|
-
var
|
|
2735
|
-
const y = ((
|
|
2751
|
+
M(() => {
|
|
2752
|
+
r && S(r.path);
|
|
2753
|
+
}, [r, S]), M(() => {
|
|
2754
|
+
var P;
|
|
2755
|
+
const y = ((P = n == null ? void 0 : n.getActiveFile) == null ? void 0 : P.call(n)) ?? null;
|
|
2736
2756
|
y && Pe.current === 0 && Ae(y);
|
|
2737
|
-
const
|
|
2738
|
-
return n != null && n.select &&
|
|
2757
|
+
const w = [];
|
|
2758
|
+
return n != null && n.select && w.push(
|
|
2739
2759
|
n.select((V) => V.activeFile, (V) => {
|
|
2740
2760
|
V ? Pe.current === 0 && Ae(V) : ae(null);
|
|
2741
2761
|
})
|
|
2742
|
-
), n != null && n.subscribe &&
|
|
2762
|
+
), n != null && n.subscribe && w.push(
|
|
2743
2763
|
n.subscribe("tree:expand", ({ path: V }) => {
|
|
2744
|
-
|
|
2764
|
+
S(V);
|
|
2745
2765
|
})
|
|
2746
2766
|
), () => {
|
|
2747
|
-
for (const V of
|
|
2767
|
+
for (const V of w) V();
|
|
2748
2768
|
};
|
|
2749
|
-
}, [n,
|
|
2750
|
-
const
|
|
2751
|
-
d((
|
|
2752
|
-
const V = qt(y), U = new Map(
|
|
2769
|
+
}, [n, S, Ae]);
|
|
2770
|
+
const N = E((y, w) => {
|
|
2771
|
+
d((P) => {
|
|
2772
|
+
const V = qt(y), U = new Map(P), ne = Ht(U.get(V), [w]) ?? [w];
|
|
2753
2773
|
return U.set(V, ne), U;
|
|
2754
2774
|
});
|
|
2755
|
-
}, []), R = E((y,
|
|
2756
|
-
d((
|
|
2757
|
-
const V = qt(y), U =
|
|
2758
|
-
if (!(U != null && U.length)) return
|
|
2759
|
-
const ne = U.filter((we) => we.path !==
|
|
2775
|
+
}, []), R = E((y, w) => {
|
|
2776
|
+
d((P) => {
|
|
2777
|
+
const V = qt(y), U = P.get(V);
|
|
2778
|
+
if (!(U != null && U.length)) return P;
|
|
2779
|
+
const ne = U.filter((we) => we.path !== w), re = new Map(P);
|
|
2760
2780
|
return ne.length > 0 ? re.set(V, ne) : re.delete(V), re;
|
|
2761
2781
|
});
|
|
2762
2782
|
}, []), G = E((y) => {
|
|
2763
|
-
m((
|
|
2764
|
-
if (
|
|
2765
|
-
const
|
|
2766
|
-
return
|
|
2783
|
+
m((w) => {
|
|
2784
|
+
if (w.has(y)) return w;
|
|
2785
|
+
const P = new Set(w);
|
|
2786
|
+
return P.add(y), P;
|
|
2767
2787
|
});
|
|
2768
2788
|
}, []), ie = E((y) => {
|
|
2769
|
-
m((
|
|
2770
|
-
if (!
|
|
2771
|
-
const
|
|
2772
|
-
return
|
|
2789
|
+
m((w) => {
|
|
2790
|
+
if (!w.has(y)) return w;
|
|
2791
|
+
const P = new Set(w);
|
|
2792
|
+
return P.delete(y), P;
|
|
2773
2793
|
});
|
|
2774
2794
|
}, []);
|
|
2775
|
-
|
|
2776
|
-
const y = (U) => U === g || ze.current.has(U),
|
|
2795
|
+
M(() => {
|
|
2796
|
+
const y = (U) => U === g || ze.current.has(U), w = K.on(ee.created, (U) => {
|
|
2777
2797
|
if (ie(U.path), U.cause === "user") return;
|
|
2778
2798
|
const ne = Se(U.path);
|
|
2779
|
-
y(ne) &&
|
|
2780
|
-
}),
|
|
2799
|
+
y(ne) && N(ne, { name: Ua(U.path), kind: U.kind, path: U.path });
|
|
2800
|
+
}), P = K.on(ee.deleted, (U) => {
|
|
2781
2801
|
U.cause !== "user" && (G(U.path), R(Se(U.path), U.path));
|
|
2782
2802
|
}), V = K.on(ee.moved, (U) => {
|
|
2783
2803
|
U.cause !== "user" && (G(U.from), ie(U.to), R(Se(U.from), U.from));
|
|
2784
2804
|
});
|
|
2785
2805
|
return () => {
|
|
2786
|
-
|
|
2806
|
+
w(), P(), V();
|
|
2787
2807
|
};
|
|
2788
|
-
}, [
|
|
2789
|
-
const [ye, be] =
|
|
2790
|
-
be((
|
|
2791
|
-
const
|
|
2792
|
-
return
|
|
2808
|
+
}, [N, G, R, g, ie]);
|
|
2809
|
+
const [ye, be] = j(/* @__PURE__ */ new Set()), se = E((y) => {
|
|
2810
|
+
be((w) => {
|
|
2811
|
+
const P = new Set(w);
|
|
2812
|
+
return P.add(y), P;
|
|
2793
2813
|
});
|
|
2794
2814
|
}, []), ge = E((y) => {
|
|
2795
|
-
be((
|
|
2796
|
-
if (!
|
|
2797
|
-
const
|
|
2798
|
-
return
|
|
2815
|
+
be((w) => {
|
|
2816
|
+
if (!w.has(y)) return w;
|
|
2817
|
+
const P = new Set(w);
|
|
2818
|
+
return P.delete(y), P;
|
|
2799
2819
|
});
|
|
2800
2820
|
}, []), ht = E(
|
|
2801
|
-
(y,
|
|
2802
|
-
|
|
2821
|
+
(y, w) => {
|
|
2822
|
+
L({ node: w, x: y.clientX, y: y.clientY });
|
|
2803
2823
|
},
|
|
2804
2824
|
[]
|
|
2805
2825
|
), mt = E(
|
|
2806
2826
|
(y) => {
|
|
2807
|
-
const
|
|
2808
|
-
|
|
2827
|
+
const w = y.target;
|
|
2828
|
+
w.closest("[role=treeitem]") || w.closest("[data-path]") || (y.preventDefault(), L({
|
|
2809
2829
|
node: { name: e, kind: "dir", path: e },
|
|
2810
2830
|
x: y.clientX,
|
|
2811
2831
|
y: y.clientY,
|
|
@@ -2814,12 +2834,12 @@ function jn({
|
|
|
2814
2834
|
},
|
|
2815
2835
|
[e]
|
|
2816
2836
|
), Ut = E(
|
|
2817
|
-
async (y,
|
|
2818
|
-
const
|
|
2837
|
+
async (y, w) => {
|
|
2838
|
+
const P = y.split("/").pop() ?? y, V = w === "." ? e : w, U = V === "." ? P : `${V}/${P}`;
|
|
2819
2839
|
if (U !== y) {
|
|
2820
2840
|
se(y);
|
|
2821
2841
|
try {
|
|
2822
|
-
await
|
|
2842
|
+
await W({ from: y, to: U }), await he([Se(y), Se(U)]), _e.success({ title: "Moved", description: `${y} → ${U}` });
|
|
2823
2843
|
} catch (ne) {
|
|
2824
2844
|
_e.error({
|
|
2825
2845
|
title: "Move failed",
|
|
@@ -2830,53 +2850,53 @@ function jn({
|
|
|
2830
2850
|
}
|
|
2831
2851
|
}
|
|
2832
2852
|
},
|
|
2833
|
-
[
|
|
2853
|
+
[W, he, e, se, ge]
|
|
2834
2854
|
);
|
|
2835
2855
|
function gt(y) {
|
|
2836
2856
|
return () => {
|
|
2837
|
-
|
|
2857
|
+
L(null), (async () => {
|
|
2838
2858
|
try {
|
|
2839
2859
|
await y();
|
|
2840
|
-
} catch (
|
|
2860
|
+
} catch (w) {
|
|
2841
2861
|
_e.error({
|
|
2842
2862
|
title: "Action failed",
|
|
2843
|
-
description:
|
|
2863
|
+
description: w instanceof Error ? w.message : String(w)
|
|
2844
2864
|
});
|
|
2845
2865
|
}
|
|
2846
2866
|
})();
|
|
2847
2867
|
};
|
|
2848
2868
|
}
|
|
2849
2869
|
const kn = (y) => {
|
|
2850
|
-
const
|
|
2851
|
-
|
|
2852
|
-
const
|
|
2853
|
-
q({ kind: y, parentDir:
|
|
2870
|
+
const w = I == null ? void 0 : I.node;
|
|
2871
|
+
L(null);
|
|
2872
|
+
const P = (w == null ? void 0 : w.kind) === "dir" ? w.path : w ? Se(w.path) : e, V = `__draft__:${++He.current}`;
|
|
2873
|
+
q({ kind: y, parentDir: P, path: V });
|
|
2854
2874
|
}, Eo = () => kn("create-file"), Io = () => kn("create-folder"), To = () => {
|
|
2855
2875
|
const y = I == null ? void 0 : I.node;
|
|
2856
|
-
|
|
2876
|
+
L(null), y && q({ kind: "rename", path: y.path, initialValue: y.name });
|
|
2857
2877
|
}, Ro = E(
|
|
2858
|
-
async (y,
|
|
2859
|
-
const
|
|
2860
|
-
if (q(null), !
|
|
2861
|
-
const V =
|
|
2878
|
+
async (y, w) => {
|
|
2879
|
+
const P = ue;
|
|
2880
|
+
if (q(null), !P) return;
|
|
2881
|
+
const V = w.trim();
|
|
2862
2882
|
if (!V) return;
|
|
2863
|
-
const U =
|
|
2883
|
+
const U = P.kind === "rename" ? Se(P.path) : P.parentDir, ne = P.kind === "rename" ? P.path : U === "." || U === "" ? V : `${U}/${V}`, re = P.kind === "rename" ? P.path : ne;
|
|
2864
2884
|
se(re);
|
|
2865
2885
|
let we = null;
|
|
2866
2886
|
try {
|
|
2867
|
-
if (
|
|
2868
|
-
if (V ===
|
|
2869
|
-
const De =
|
|
2887
|
+
if (P.kind === "rename") {
|
|
2888
|
+
if (V === P.initialValue) return;
|
|
2889
|
+
const De = P.path.split("/");
|
|
2870
2890
|
De[De.length - 1] = V;
|
|
2871
2891
|
const vt = De.join("/");
|
|
2872
|
-
await
|
|
2892
|
+
await W({ from: P.path, to: vt }), await he([Se(P.path)]), _e.success({ title: "Renamed", description: `${P.path} → ${vt}` });
|
|
2873
2893
|
} else {
|
|
2874
2894
|
const De = {
|
|
2875
2895
|
name: V,
|
|
2876
|
-
kind:
|
|
2896
|
+
kind: P.kind === "create-file" ? "file" : "dir",
|
|
2877
2897
|
path: ne
|
|
2878
2898
|
};
|
|
2879
|
-
|
|
2899
|
+
N(U, De), we = ne, P.kind === "create-file" ? (await b({ path: ne, content: "", returnMtimeMs: !1 }), K.emit(ee.created, {
|
|
2880
2900
|
...it(),
|
|
2881
2901
|
path: ne,
|
|
2882
2902
|
kind: "file"
|
|
@@ -2886,7 +2906,7 @@ function jn({
|
|
|
2886
2906
|
we && R(U, we);
|
|
2887
2907
|
const vt = De instanceof Error ? De.message : String(De);
|
|
2888
2908
|
_e.error({
|
|
2889
|
-
title:
|
|
2909
|
+
title: P.kind === "rename" ? "Rename failed" : P.kind === "create-file" ? "Create file failed" : "Create folder failed",
|
|
2890
2910
|
description: vt
|
|
2891
2911
|
});
|
|
2892
2912
|
} finally {
|
|
@@ -2895,13 +2915,13 @@ function jn({
|
|
|
2895
2915
|
},
|
|
2896
2916
|
[
|
|
2897
2917
|
ue,
|
|
2898
|
-
|
|
2899
|
-
|
|
2918
|
+
W,
|
|
2919
|
+
b,
|
|
2900
2920
|
_,
|
|
2901
2921
|
he,
|
|
2902
2922
|
se,
|
|
2903
2923
|
ge,
|
|
2904
|
-
|
|
2924
|
+
N,
|
|
2905
2925
|
R,
|
|
2906
2926
|
Te
|
|
2907
2927
|
]
|
|
@@ -2910,37 +2930,37 @@ function jn({
|
|
|
2910
2930
|
}, []), Ao = gt(async () => {
|
|
2911
2931
|
I != null && I.node && (await Wn(I.node.path), _e.success({ title: "Path copied", description: I.node.path }));
|
|
2912
2932
|
}), Do = gt(async () => {
|
|
2913
|
-
if (!(
|
|
2914
|
-
throw new Error((
|
|
2915
|
-
await Wn(
|
|
2933
|
+
if (!(A != null && A.enabled) || !A.url)
|
|
2934
|
+
throw new Error((A == null ? void 0 : A.reason) ?? "Git URL unavailable");
|
|
2935
|
+
await Wn(A.url), _e.success({ title: "Git URL copied", description: A.url });
|
|
2916
2936
|
}), _o = E(async () => {
|
|
2917
2937
|
if (!J) return;
|
|
2918
2938
|
const y = J;
|
|
2919
2939
|
H(null), se(y.path);
|
|
2920
2940
|
try {
|
|
2921
|
-
await
|
|
2922
|
-
const
|
|
2923
|
-
for (const V of
|
|
2924
|
-
(V === y.path || V.startsWith(`${y.path}/`)) &&
|
|
2925
|
-
return
|
|
2941
|
+
await B({ path: y.path }), R(Se(y.path), y.path), y.kind === "dir" && h((w) => {
|
|
2942
|
+
const P = new Map(w);
|
|
2943
|
+
for (const V of P.keys())
|
|
2944
|
+
(V === y.path || V.startsWith(`${y.path}/`)) && P.delete(V);
|
|
2945
|
+
return P;
|
|
2926
2946
|
}), await he([Se(y.path)]), _e.success({ title: "Deleted", description: y.path });
|
|
2927
|
-
} catch (
|
|
2947
|
+
} catch (w) {
|
|
2928
2948
|
_e.error({
|
|
2929
2949
|
title: "Delete failed",
|
|
2930
|
-
description:
|
|
2950
|
+
description: w instanceof Error ? w.message : String(w)
|
|
2931
2951
|
});
|
|
2932
2952
|
} finally {
|
|
2933
2953
|
ge(y.path);
|
|
2934
2954
|
}
|
|
2935
2955
|
}, [
|
|
2936
2956
|
J,
|
|
2937
|
-
|
|
2957
|
+
B,
|
|
2938
2958
|
he,
|
|
2939
2959
|
se,
|
|
2940
2960
|
ge,
|
|
2941
2961
|
R
|
|
2942
2962
|
]), Fo = !Ve && ((t == null ? void 0 : t.length) ?? 0) > 0 ? t : void 0;
|
|
2943
|
-
return /* @__PURE__ */
|
|
2963
|
+
return /* @__PURE__ */ x("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
2944
2964
|
s && /* @__PURE__ */ u(
|
|
2945
2965
|
rt,
|
|
2946
2966
|
{
|
|
@@ -2952,20 +2972,20 @@ function jn({
|
|
|
2952
2972
|
/* @__PURE__ */ u(
|
|
2953
2973
|
"div",
|
|
2954
2974
|
{
|
|
2955
|
-
ref:
|
|
2975
|
+
ref: F,
|
|
2956
2976
|
className: "min-h-0 flex-1 overflow-hidden",
|
|
2957
2977
|
onContextMenu: mt,
|
|
2958
|
-
children: f ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((y,
|
|
2978
|
+
children: f ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((y, w) => /* @__PURE__ */ u(
|
|
2959
2979
|
ti,
|
|
2960
2980
|
{
|
|
2961
2981
|
className: "h-5",
|
|
2962
|
-
style: { width: `${60 +
|
|
2982
|
+
style: { width: `${60 + w * 13 % 30}%` }
|
|
2963
2983
|
},
|
|
2964
|
-
|
|
2984
|
+
w
|
|
2965
2985
|
)) }) : /* @__PURE__ */ u(
|
|
2966
2986
|
Dt,
|
|
2967
2987
|
{
|
|
2968
|
-
fallback: /* @__PURE__ */
|
|
2988
|
+
fallback: /* @__PURE__ */ x("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
|
|
2969
2989
|
/* @__PURE__ */ u(Ft, { className: "size-3.5" }),
|
|
2970
2990
|
/* @__PURE__ */ u("span", { children: "Loading..." })
|
|
2971
2991
|
] }),
|
|
@@ -2989,7 +3009,7 @@ function jn({
|
|
|
2989
3009
|
onSubmitEdit: Ro,
|
|
2990
3010
|
onCancelEdit: No,
|
|
2991
3011
|
onDragDrop: Ut,
|
|
2992
|
-
height:
|
|
3012
|
+
height: O,
|
|
2993
3013
|
className: oe(i)
|
|
2994
3014
|
}
|
|
2995
3015
|
)
|
|
@@ -2998,7 +3018,7 @@ function jn({
|
|
|
2998
3018
|
}
|
|
2999
3019
|
),
|
|
3000
3020
|
I && kr(
|
|
3001
|
-
/* @__PURE__ */
|
|
3021
|
+
/* @__PURE__ */ x(
|
|
3002
3022
|
"div",
|
|
3003
3023
|
{
|
|
3004
3024
|
ref: te,
|
|
@@ -3008,7 +3028,7 @@ function jn({
|
|
|
3008
3028
|
children: [
|
|
3009
3029
|
/* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Eo, children: "New file" }),
|
|
3010
3030
|
/* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Io, children: "New folder" }),
|
|
3011
|
-
!I.isBackground && /* @__PURE__ */
|
|
3031
|
+
!I.isBackground && /* @__PURE__ */ x(Me, { children: [
|
|
3012
3032
|
/* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: To, children: "Rename" }),
|
|
3013
3033
|
/* @__PURE__ */ u(
|
|
3014
3034
|
Oe,
|
|
@@ -3019,13 +3039,13 @@ function jn({
|
|
|
3019
3039
|
size: "sm",
|
|
3020
3040
|
className: "w-full justify-start text-destructive hover:bg-destructive/10 hover:text-destructive",
|
|
3021
3041
|
onClick: () => {
|
|
3022
|
-
H(I.node),
|
|
3042
|
+
H(I.node), L(null);
|
|
3023
3043
|
},
|
|
3024
3044
|
children: "Delete"
|
|
3025
3045
|
}
|
|
3026
3046
|
),
|
|
3027
3047
|
/* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Ao, children: "Copy path" }),
|
|
3028
|
-
|
|
3048
|
+
A != null && A.enabled ? /* @__PURE__ */ u(Oe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Do, children: "Copy Git URL" }) : A != null && A.reason ? /* @__PURE__ */ u("div", { className: "px-2 py-1 text-xs text-muted-foreground", "aria-live": "polite", children: A.reason }) : null
|
|
3029
3049
|
] })
|
|
3030
3050
|
]
|
|
3031
3051
|
}
|
|
@@ -3043,16 +3063,16 @@ function jn({
|
|
|
3043
3063
|
onOpenChange: (y) => {
|
|
3044
3064
|
y || H(null);
|
|
3045
3065
|
},
|
|
3046
|
-
children: /* @__PURE__ */
|
|
3047
|
-
/* @__PURE__ */
|
|
3048
|
-
/* @__PURE__ */
|
|
3066
|
+
children: /* @__PURE__ */ x(ri, { children: [
|
|
3067
|
+
/* @__PURE__ */ x(oi, { children: [
|
|
3068
|
+
/* @__PURE__ */ x(ii, { children: [
|
|
3049
3069
|
"Delete ",
|
|
3050
3070
|
J == null ? void 0 : J.name,
|
|
3051
3071
|
"?"
|
|
3052
3072
|
] }),
|
|
3053
3073
|
/* @__PURE__ */ u(si, { children: "This action cannot be undone." })
|
|
3054
3074
|
] }),
|
|
3055
|
-
/* @__PURE__ */
|
|
3075
|
+
/* @__PURE__ */ x(ai, { children: [
|
|
3056
3076
|
/* @__PURE__ */ u(ci, { children: "Cancel" }),
|
|
3057
3077
|
/* @__PURE__ */ u(li, { onClick: _o, children: "Delete" })
|
|
3058
3078
|
] })
|
|
@@ -3071,25 +3091,25 @@ function qa({
|
|
|
3071
3091
|
chromeless: a = !1,
|
|
3072
3092
|
className: l
|
|
3073
3093
|
}) {
|
|
3074
|
-
const s = (e == null ? void 0 : e.rootDir) ?? t, f = (e == null ? void 0 : e.bridge) ?? o, c = (e == null ? void 0 : e.chromeless) ?? a, d = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, m = r ?? i, [g, v] =
|
|
3075
|
-
|
|
3076
|
-
const
|
|
3094
|
+
const s = (e == null ? void 0 : e.rootDir) ?? t, f = (e == null ? void 0 : e.bridge) ?? o, c = (e == null ? void 0 : e.chromeless) ?? a, d = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, m = r ?? i, [g, v] = j(""), [k, b] = j(""), _ = D(void 0);
|
|
3095
|
+
M(() => (clearTimeout(_.current), _.current = setTimeout(() => b(g), 200), () => clearTimeout(_.current)), [g]);
|
|
3096
|
+
const W = p !== void 0 ? p || void 0 : k || void 0;
|
|
3077
3097
|
return c ? /* @__PURE__ */ u(
|
|
3078
3098
|
jn,
|
|
3079
3099
|
{
|
|
3080
3100
|
rootDir: s,
|
|
3081
|
-
searchQuery:
|
|
3101
|
+
searchQuery: W,
|
|
3082
3102
|
bridge: f,
|
|
3083
3103
|
revealFileTreeRequest: d,
|
|
3084
3104
|
className: oe("px-1 pt-1 [&_[role=treeitem]]:!indent-0", l)
|
|
3085
3105
|
}
|
|
3086
|
-
) : /* @__PURE__ */ u($a, { title: "Files", panelApi: m, children: /* @__PURE__ */
|
|
3106
|
+
) : /* @__PURE__ */ u($a, { title: "Files", panelApi: m, children: /* @__PURE__ */ x("div", { className: "flex h-full flex-col", children: [
|
|
3087
3107
|
/* @__PURE__ */ u("div", { className: "border-b border-border px-2 py-1.5", children: /* @__PURE__ */ u(
|
|
3088
3108
|
wr,
|
|
3089
3109
|
{
|
|
3090
3110
|
placeholder: "Search files...",
|
|
3091
3111
|
value: p ?? g,
|
|
3092
|
-
onChange: (
|
|
3112
|
+
onChange: (B) => v(B.target.value),
|
|
3093
3113
|
className: "h-7 text-xs",
|
|
3094
3114
|
"aria-label": "Search files"
|
|
3095
3115
|
}
|
|
@@ -3098,7 +3118,7 @@ function qa({
|
|
|
3098
3118
|
jn,
|
|
3099
3119
|
{
|
|
3100
3120
|
rootDir: s,
|
|
3101
|
-
searchQuery:
|
|
3121
|
+
searchQuery: W,
|
|
3102
3122
|
bridge: f,
|
|
3103
3123
|
revealFileTreeRequest: d,
|
|
3104
3124
|
className: l
|
|
@@ -3110,7 +3130,7 @@ function Ha(e) {
|
|
|
3110
3130
|
return e.split("/").pop() ?? e;
|
|
3111
3131
|
}
|
|
3112
3132
|
function Va() {
|
|
3113
|
-
return
|
|
3133
|
+
return M(() => {
|
|
3114
3134
|
const e = K.on(ee.moved, ({ from: n, to: r, ...o }) => {
|
|
3115
3135
|
K.emit(Ee.panelUpdate, {
|
|
3116
3136
|
...o,
|
|
@@ -3189,7 +3209,7 @@ function od(e) {
|
|
|
3189
3209
|
return K.on(ee.changed, e);
|
|
3190
3210
|
}
|
|
3191
3211
|
function Xa() {
|
|
3192
|
-
return
|
|
3212
|
+
return M(() => K.on(Ee.agentData, ({ part: e }) => {
|
|
3193
3213
|
Ja(e);
|
|
3194
3214
|
}), []), Ya((e) => {
|
|
3195
3215
|
Nr({ kind: "openFile", params: { path: e } });
|
|
@@ -3197,15 +3217,15 @@ function Xa() {
|
|
|
3197
3217
|
}
|
|
3198
3218
|
const Qa = 250, Za = 3e3, ec = 3e4;
|
|
3199
3219
|
function tc(e, t) {
|
|
3200
|
-
const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [a, l] =
|
|
3220
|
+
const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [a, l] = j(!1), [s, f] = j(!1), [c, d] = j(null), [p, m] = j(!1), [g, v] = j(!1), k = D(void 0), b = D(null), _ = D(0), W = D(null), B = D(0), z = D(void 0), h = D(o);
|
|
3201
3221
|
h.current = o;
|
|
3202
|
-
const C =
|
|
3222
|
+
const C = D(n);
|
|
3203
3223
|
C.current = n;
|
|
3204
|
-
const
|
|
3224
|
+
const F = E(async () => {
|
|
3205
3225
|
const H = C.current;
|
|
3206
3226
|
if (!H || !e || !H.isDirty()) return;
|
|
3207
|
-
if (
|
|
3208
|
-
const te =
|
|
3227
|
+
if (b.current) return b.current;
|
|
3228
|
+
const te = B.current;
|
|
3209
3229
|
let X = null;
|
|
3210
3230
|
return X = (async () => {
|
|
3211
3231
|
var q;
|
|
@@ -3219,62 +3239,62 @@ function tc(e, t) {
|
|
|
3219
3239
|
H.save().then(() => "saved"),
|
|
3220
3240
|
ue
|
|
3221
3241
|
]);
|
|
3222
|
-
if (
|
|
3242
|
+
if (B.current !== te) return;
|
|
3223
3243
|
ce === "saved" && (_.current = Date.now(), d(Date.now()), l(!1), (q = h.current) == null || q.call(h, e, !1));
|
|
3224
3244
|
} catch {
|
|
3225
|
-
if (
|
|
3245
|
+
if (B.current !== te) return;
|
|
3226
3246
|
} finally {
|
|
3227
|
-
if (ae && clearTimeout(ae),
|
|
3247
|
+
if (ae && clearTimeout(ae), b.current === X && (b.current = null), B.current !== te) return;
|
|
3228
3248
|
K.emit(Ee.editorSaveEnd, { panelId: r }), f(!1);
|
|
3229
3249
|
}
|
|
3230
|
-
})(),
|
|
3231
|
-
}, [e, r]),
|
|
3232
|
-
clearTimeout(
|
|
3233
|
-
}, [
|
|
3250
|
+
})(), b.current = X, X;
|
|
3251
|
+
}, [e, r]), O = E(() => {
|
|
3252
|
+
clearTimeout(k.current), k.current = setTimeout(F, Qa);
|
|
3253
|
+
}, [F]), $ = E(() => {
|
|
3234
3254
|
var H;
|
|
3235
|
-
e && (l(!0), (H = h.current) == null || H.call(h, e, !0),
|
|
3236
|
-
}, [e,
|
|
3255
|
+
e && (l(!0), (H = h.current) == null || H.call(h, e, !0), O());
|
|
3256
|
+
}, [e, O]), I = E(() => {
|
|
3237
3257
|
var H;
|
|
3238
|
-
clearTimeout(
|
|
3239
|
-
}, [e]),
|
|
3258
|
+
clearTimeout(k.current), l(!1), v(!1), e && ((H = h.current) == null || H.call(h, e, !1));
|
|
3259
|
+
}, [e]), L = E(async () => {
|
|
3240
3260
|
var H;
|
|
3241
|
-
if (clearTimeout(
|
|
3261
|
+
if (clearTimeout(k.current), b.current) return b.current;
|
|
3242
3262
|
if ((H = C.current) != null && H.isDirty())
|
|
3243
|
-
return
|
|
3244
|
-
}, [
|
|
3245
|
-
|
|
3263
|
+
return F();
|
|
3264
|
+
}, [F]), T = E(() => m(!1), []), A = E(() => v(!1), []), J = E((H) => {
|
|
3265
|
+
W.current = H, v(!1);
|
|
3246
3266
|
}, []);
|
|
3247
|
-
return
|
|
3267
|
+
return M(() => {
|
|
3248
3268
|
if (!(i == null || !e)) {
|
|
3249
|
-
if (
|
|
3250
|
-
|
|
3269
|
+
if (W.current === null) {
|
|
3270
|
+
W.current = i;
|
|
3251
3271
|
return;
|
|
3252
3272
|
}
|
|
3253
|
-
if (i !==
|
|
3273
|
+
if (i !== W.current) {
|
|
3254
3274
|
if (Date.now() - _.current < Za) {
|
|
3255
|
-
|
|
3275
|
+
W.current = i;
|
|
3256
3276
|
return;
|
|
3257
3277
|
}
|
|
3258
|
-
|
|
3278
|
+
W.current = i, a ? v(!0) : m(!0);
|
|
3259
3279
|
}
|
|
3260
3280
|
}
|
|
3261
|
-
}, [i, e, a]),
|
|
3262
|
-
if (
|
|
3263
|
-
|
|
3281
|
+
}, [i, e, a]), M(() => {
|
|
3282
|
+
if (z.current === void 0) {
|
|
3283
|
+
z.current = e;
|
|
3264
3284
|
return;
|
|
3265
3285
|
}
|
|
3266
|
-
|
|
3267
|
-
}, [e]),
|
|
3286
|
+
z.current !== e && (z.current = e, B.current += 1, clearTimeout(k.current), b.current && K.emit(Ee.editorSaveEnd, { panelId: r }), b.current = null, W.current = null, _.current = 0, l(!1), f(!1), m(!1), v(!1));
|
|
3287
|
+
}, [e]), M(() => () => clearTimeout(k.current), []), {
|
|
3268
3288
|
isDirty: a,
|
|
3269
3289
|
isSaving: s,
|
|
3270
3290
|
lastSavedAt: c,
|
|
3271
|
-
markDirty:
|
|
3291
|
+
markDirty: $,
|
|
3272
3292
|
markClean: I,
|
|
3273
|
-
flushSave:
|
|
3293
|
+
flushSave: L,
|
|
3274
3294
|
shouldSync: p,
|
|
3275
3295
|
ackSync: T,
|
|
3276
3296
|
externalChangeWhileDirty: g,
|
|
3277
|
-
ackExternalChange:
|
|
3297
|
+
ackExternalChange: A,
|
|
3278
3298
|
notifySaved: J
|
|
3279
3299
|
};
|
|
3280
3300
|
}
|
|
@@ -3288,8 +3308,8 @@ function rc(e) {
|
|
|
3288
3308
|
return e instanceof HTMLElement ? e.isContentEditable || e.closest("[contenteditable='true'], [contenteditable=''], [contenteditable='plaintext-only']") || e.closest("[role='textbox'], [role='searchbox'], [role='combobox']") ? !0 : !!e.closest("input, textarea, select") : !1;
|
|
3289
3309
|
}
|
|
3290
3310
|
function Yr({ shortcuts: e, enabled: t = !0 }) {
|
|
3291
|
-
const n =
|
|
3292
|
-
n.current = e,
|
|
3311
|
+
const n = D(e);
|
|
3312
|
+
n.current = e, M(() => {
|
|
3293
3313
|
if (!t) return;
|
|
3294
3314
|
function r(o) {
|
|
3295
3315
|
const i = rc(o.target);
|
|
@@ -3310,27 +3330,27 @@ function id(e) {
|
|
|
3310
3330
|
}
|
|
3311
3331
|
let oc = 0;
|
|
3312
3332
|
function Xr(e) {
|
|
3313
|
-
const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, i =
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
}, [t, r]),
|
|
3317
|
-
(l == null ? void 0 : l.content) != null && p === null && (m(l.content), g.current = l.content,
|
|
3333
|
+
const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, i = D(n ?? `file-pane:${oc++}`), a = n ?? i.current, { data: l, isLoading: s, error: f, refetch: c } = na(o), { mutateAsync: d } = Ur(), [p, m] = j(r), g = D(""), v = D(!1), k = D(null), b = D(null), _ = D(null), W = D(0), [B, z] = j(null);
|
|
3334
|
+
M(() => {
|
|
3335
|
+
k.current !== t && (m(r), g.current = r ?? "", v.current = !1, b.current = null, W.current += 1, z(null), k.current = t);
|
|
3336
|
+
}, [t, r]), M(() => {
|
|
3337
|
+
(l == null ? void 0 : l.content) != null && p === null && (m(l.content), g.current = l.content, b.current = l.mtimeMs ?? null);
|
|
3318
3338
|
}, [l, p]);
|
|
3319
3339
|
const h = o && p != null ? {
|
|
3320
3340
|
isDirty: () => v.current,
|
|
3321
3341
|
save: async () => {
|
|
3322
3342
|
var te;
|
|
3323
|
-
const H = ++
|
|
3343
|
+
const H = ++W.current;
|
|
3324
3344
|
try {
|
|
3325
3345
|
const X = await d({
|
|
3326
3346
|
path: o,
|
|
3327
3347
|
content: g.current,
|
|
3328
|
-
expectedMtimeMs:
|
|
3348
|
+
expectedMtimeMs: b.current ?? void 0
|
|
3329
3349
|
});
|
|
3330
|
-
if (
|
|
3331
|
-
typeof X.mtimeMs == "number" && (
|
|
3350
|
+
if (W.current !== H) return;
|
|
3351
|
+
typeof X.mtimeMs == "number" && (b.current = X.mtimeMs, (te = _.current) == null || te.call(_, X.mtimeMs)), v.current = !1, z(null);
|
|
3332
3352
|
} catch (X) {
|
|
3333
|
-
throw
|
|
3353
|
+
throw W.current !== H || X instanceof ut && (typeof X.currentMtimeMs == "number" && (b.current = X.currentMtimeMs), z(X)), X;
|
|
3334
3354
|
}
|
|
3335
3355
|
},
|
|
3336
3356
|
getContent: () => g.current
|
|
@@ -3339,42 +3359,42 @@ function Xr(e) {
|
|
|
3339
3359
|
panelId: a,
|
|
3340
3360
|
serverMtime: (l == null ? void 0 : l.mtimeMs) ?? null
|
|
3341
3361
|
});
|
|
3342
|
-
_.current = C.notifySaved,
|
|
3362
|
+
_.current = C.notifySaved, M(() => {
|
|
3343
3363
|
if (!(!C.shouldSync || (l == null ? void 0 : l.content) == null)) {
|
|
3344
3364
|
if (v.current) {
|
|
3345
3365
|
C.ackSync();
|
|
3346
3366
|
return;
|
|
3347
3367
|
}
|
|
3348
|
-
m(l.content), g.current = l.content,
|
|
3368
|
+
m(l.content), g.current = l.content, b.current = l.mtimeMs ?? null, v.current = !1, C.ackSync();
|
|
3349
3369
|
}
|
|
3350
|
-
}, [C.shouldSync, C, l, m]),
|
|
3351
|
-
!C.externalChangeWhileDirty || (l == null ? void 0 : l.mtimeMs) == null || (
|
|
3370
|
+
}, [C.shouldSync, C, l, m]), M(() => {
|
|
3371
|
+
!C.externalChangeWhileDirty || (l == null ? void 0 : l.mtimeMs) == null || (z(new ut(o ?? t, l.mtimeMs, b.current)), b.current = l.mtimeMs, C.ackExternalChange());
|
|
3352
3372
|
}, [o, C.externalChangeWhileDirty, C, l, t]);
|
|
3353
|
-
const
|
|
3354
|
-
|
|
3355
|
-
const H =
|
|
3356
|
-
|
|
3357
|
-
}, [
|
|
3373
|
+
const F = o ? o.split("/").pop() ?? o : "", [O, $] = j("");
|
|
3374
|
+
M(() => {
|
|
3375
|
+
const H = F ? C.isDirty ? `${F} ●` : F : "";
|
|
3376
|
+
$(H);
|
|
3377
|
+
}, [F, C.isDirty]);
|
|
3358
3378
|
const I = E((H) => {
|
|
3359
3379
|
m(H), g.current = H, v.current = !0, C.markDirty();
|
|
3360
|
-
}, [m, C]),
|
|
3380
|
+
}, [m, C]), L = E(async () => {
|
|
3361
3381
|
var X;
|
|
3362
3382
|
if (!o) return;
|
|
3363
3383
|
const H = await c();
|
|
3364
3384
|
if (H.status !== "success" || H.data == null) return;
|
|
3365
3385
|
const te = H.data;
|
|
3366
|
-
m(te.content), g.current = te.content,
|
|
3386
|
+
m(te.content), g.current = te.content, b.current = te.mtimeMs ?? null, v.current = !1, C.markClean(), typeof te.mtimeMs == "number" && ((X = _.current) == null || X.call(_, te.mtimeMs)), z(null);
|
|
3367
3387
|
}, [o, C, c, m]), T = E(async () => {
|
|
3368
3388
|
var te;
|
|
3369
|
-
const H = ++
|
|
3389
|
+
const H = ++W.current;
|
|
3370
3390
|
try {
|
|
3371
3391
|
if (!o) return;
|
|
3372
3392
|
const X = g.current, ae = await d({ path: o, content: X });
|
|
3373
|
-
if (
|
|
3374
|
-
typeof ae.mtimeMs == "number" && (
|
|
3393
|
+
if (W.current !== H) return;
|
|
3394
|
+
typeof ae.mtimeMs == "number" && (b.current = ae.mtimeMs, (te = _.current) == null || te.call(_, ae.mtimeMs)), v.current = !1, z(null);
|
|
3375
3395
|
} catch {
|
|
3376
3396
|
}
|
|
3377
|
-
}, [o, d]),
|
|
3397
|
+
}, [o, d]), A = E(async () => {
|
|
3378
3398
|
!h || !v.current || await h.save();
|
|
3379
3399
|
}, [h]), J = E(async () => {
|
|
3380
3400
|
await C.flushSave();
|
|
@@ -3384,14 +3404,14 @@ function Xr(e) {
|
|
|
3384
3404
|
error: f,
|
|
3385
3405
|
content: p,
|
|
3386
3406
|
isDirty: C.isDirty,
|
|
3387
|
-
conflict:
|
|
3388
|
-
onReloadFromServer:
|
|
3407
|
+
conflict: B,
|
|
3408
|
+
onReloadFromServer: L,
|
|
3389
3409
|
onOverwrite: T,
|
|
3390
3410
|
setContent: I,
|
|
3391
|
-
save:
|
|
3411
|
+
save: A,
|
|
3392
3412
|
flushSave: J,
|
|
3393
|
-
fileName:
|
|
3394
|
-
tabTitle:
|
|
3413
|
+
fileName: F,
|
|
3414
|
+
tabTitle: O
|
|
3395
3415
|
};
|
|
3396
3416
|
}
|
|
3397
3417
|
function ic({ conflict: e, onReload: t, onOverwrite: n }) {
|
|
@@ -3402,7 +3422,7 @@ function ic({ conflict: e, onReload: t, onOverwrite: n }) {
|
|
|
3402
3422
|
tone: "accent",
|
|
3403
3423
|
className: "rounded-none border-x-0 border-t-0",
|
|
3404
3424
|
description: /* @__PURE__ */ u(Me, { children: "This file has been modified outside the editor. Your unsaved changes will be lost if you reload, or will overwrite the latest version on disk if you save." }),
|
|
3405
|
-
actions: /* @__PURE__ */
|
|
3425
|
+
actions: /* @__PURE__ */ x(Me, { children: [
|
|
3406
3426
|
/* @__PURE__ */ u(Oe, { type: "button", variant: "outline", size: "xs", onClick: () => void t(), children: "Reload" }),
|
|
3407
3427
|
/* @__PURE__ */ u(
|
|
3408
3428
|
Oe,
|
|
@@ -3438,11 +3458,11 @@ function Qr({
|
|
|
3438
3458
|
return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(Sr, { className: "min-h-0 border-0", title: "No file selected", description: "Choose a file from the file tree to open an editor." }) });
|
|
3439
3459
|
if (r)
|
|
3440
3460
|
return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "Failed to load file", description: d ?? r.message }) });
|
|
3441
|
-
const m = c ?? /* @__PURE__ */
|
|
3461
|
+
const m = c ?? /* @__PURE__ */ x("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
|
|
3442
3462
|
/* @__PURE__ */ u(Ft, { className: "size-3.5" }),
|
|
3443
3463
|
/* @__PURE__ */ u("span", { children: "Loading file..." })
|
|
3444
3464
|
] });
|
|
3445
|
-
return /* @__PURE__ */
|
|
3465
|
+
return /* @__PURE__ */ x("div", { className: `flex h-full min-h-0 flex-col ${p ?? ""}`, children: [
|
|
3446
3466
|
o && /* @__PURE__ */ u(
|
|
3447
3467
|
ic,
|
|
3448
3468
|
{
|
|
@@ -3520,7 +3540,7 @@ function Bn({ params: e, api: t, className: n }) {
|
|
|
3520
3540
|
);
|
|
3521
3541
|
}
|
|
3522
3542
|
const cc = ft(
|
|
3523
|
-
() => import("./MarkdownEditor-
|
|
3543
|
+
() => import("./MarkdownEditor-DOZy49fg.js").then((e) => ({ default: e.MarkdownEditor }))
|
|
3524
3544
|
);
|
|
3525
3545
|
function lc({ params: e, api: t, className: n }) {
|
|
3526
3546
|
const r = typeof (e == null ? void 0 : e.path) == "string" ? e.path : "", {
|
|
@@ -3556,34 +3576,34 @@ function tt(e) {
|
|
|
3556
3576
|
return e.split("/").pop() ?? e;
|
|
3557
3577
|
}
|
|
3558
3578
|
function dc({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
|
|
3559
|
-
const i = Xe(), a = Qe(), [l, s] =
|
|
3579
|
+
const i = Xe(), a = Qe(), [l, s] = j(null), [f, c] = j(null), [d, p] = j(!0), m = Y(() => {
|
|
3560
3580
|
const g = new URLSearchParams({ path: e });
|
|
3561
3581
|
return n > 0 && g.set("reload", String(n)), uc(i, `/api/v1/files/raw?${g.toString()}`);
|
|
3562
3582
|
}, [i, e, n]);
|
|
3563
|
-
return
|
|
3583
|
+
return M(() => {
|
|
3564
3584
|
const g = new AbortController();
|
|
3565
3585
|
let v = null;
|
|
3566
3586
|
p(!0), c(null), s(null);
|
|
3567
|
-
const
|
|
3568
|
-
return a && (
|
|
3587
|
+
const k = {};
|
|
3588
|
+
return a && (k["x-boring-workspace-id"] = a), fetch(m, {
|
|
3569
3589
|
credentials: "include",
|
|
3570
|
-
headers:
|
|
3590
|
+
headers: k,
|
|
3571
3591
|
signal: g.signal
|
|
3572
|
-
}).then(async (
|
|
3573
|
-
if (!
|
|
3574
|
-
const _ = await
|
|
3592
|
+
}).then(async (b) => {
|
|
3593
|
+
if (!b.ok) throw new Error(`HTTP ${b.status}`);
|
|
3594
|
+
const _ = await b.blob();
|
|
3575
3595
|
v = URL.createObjectURL(_), s(v);
|
|
3576
|
-
}).catch((
|
|
3577
|
-
g.signal.aborted || c(
|
|
3596
|
+
}).catch((b) => {
|
|
3597
|
+
g.signal.aborted || c(b instanceof Error ? b.message : "Failed to load preview");
|
|
3578
3598
|
}).finally(() => {
|
|
3579
3599
|
g.signal.aborted || p(!1);
|
|
3580
3600
|
}), () => {
|
|
3581
3601
|
g.abort(), v && URL.revokeObjectURL(v);
|
|
3582
3602
|
};
|
|
3583
|
-
}, [m, a]), e ? /* @__PURE__ */
|
|
3584
|
-
/* @__PURE__ */
|
|
3603
|
+
}, [m, a]), e ? /* @__PURE__ */ x("div", { className: oe("flex h-full min-h-0 flex-col bg-background", o), children: [
|
|
3604
|
+
/* @__PURE__ */ x("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
|
|
3585
3605
|
/* @__PURE__ */ u("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: tt(e) }),
|
|
3586
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
|
|
3587
3607
|
/* @__PURE__ */ u(
|
|
3588
3608
|
"button",
|
|
3589
3609
|
{
|
|
@@ -3609,7 +3629,7 @@ function dc({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
|
|
|
3609
3629
|
) : null
|
|
3610
3630
|
] })
|
|
3611
3631
|
] }),
|
|
3612
|
-
/* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: d ? /* @__PURE__ */
|
|
3632
|
+
/* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: d ? /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [
|
|
3613
3633
|
/* @__PURE__ */ u(Ft, { className: "size-3.5" }),
|
|
3614
3634
|
/* @__PURE__ */ u("span", { children: "Loading preview..." })
|
|
3615
3635
|
] }) : f || !l ? /* @__PURE__ */ u(rt, { title: "Failed to load preview", description: f ?? "Preview unavailable." }) : t === "image" ? /* @__PURE__ */ u(
|
|
@@ -3630,10 +3650,10 @@ function dc({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
|
|
|
3630
3650
|
] }) : /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "No file selected", description: "Choose an image or PDF from the file tree." }) });
|
|
3631
3651
|
}
|
|
3632
3652
|
function fc({ path: e }) {
|
|
3633
|
-
const [t, n] =
|
|
3653
|
+
const [t, n] = j(0), r = E(() => {
|
|
3634
3654
|
n((o) => o + 1);
|
|
3635
3655
|
}, []);
|
|
3636
|
-
return
|
|
3656
|
+
return M(() => {
|
|
3637
3657
|
if (!e) return;
|
|
3638
3658
|
const o = K.on(ee.changed, (l) => {
|
|
3639
3659
|
l.path === e && r();
|
|
@@ -3775,35 +3795,35 @@ async function bc(e) {
|
|
|
3775
3795
|
${l.documentElement.outerHTML}`;
|
|
3776
3796
|
}
|
|
3777
3797
|
function wc({ path: e, className: t }) {
|
|
3778
|
-
const n = Xe(), r = Qe(), [o, i] =
|
|
3798
|
+
const n = Xe(), r = Qe(), [o, i] = j(null), [a, l] = j(null), [s, f] = j(!0), c = Y(
|
|
3779
3799
|
() => yn(n, e, r),
|
|
3780
3800
|
[n, e, r]
|
|
3781
|
-
), [d, p] =
|
|
3801
|
+
), [d, p] = j(0), m = E(() => {
|
|
3782
3802
|
p((g) => g + 1);
|
|
3783
3803
|
}, []);
|
|
3784
|
-
return
|
|
3804
|
+
return M(() => {
|
|
3785
3805
|
const g = new AbortController();
|
|
3786
3806
|
f(!0), l(null), i(null);
|
|
3787
3807
|
const v = {};
|
|
3788
|
-
return r && (v["x-boring-workspace-id"] = r), to(c, v, g.signal).then(async (
|
|
3808
|
+
return r && (v["x-boring-workspace-id"] = r), to(c, v, g.signal).then(async (k) => {
|
|
3789
3809
|
i(await bc({
|
|
3790
|
-
html:
|
|
3810
|
+
html: k,
|
|
3791
3811
|
path: e,
|
|
3792
3812
|
apiBaseUrl: n,
|
|
3793
3813
|
headers: v,
|
|
3794
3814
|
workspaceRequestId: r,
|
|
3795
3815
|
signal: g.signal
|
|
3796
3816
|
}));
|
|
3797
|
-
}).catch((
|
|
3798
|
-
g.signal.aborted || l(
|
|
3817
|
+
}).catch((k) => {
|
|
3818
|
+
g.signal.aborted || l(k instanceof Error ? k.message : "Failed to load HTML preview");
|
|
3799
3819
|
}).finally(() => {
|
|
3800
3820
|
g.signal.aborted || f(!1);
|
|
3801
3821
|
}), () => g.abort();
|
|
3802
|
-
}, [n, e, c, r, d]), e ? s ? /* @__PURE__ */
|
|
3822
|
+
}, [n, e, c, r, d]), e ? s ? /* @__PURE__ */ x("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
|
|
3803
3823
|
/* @__PURE__ */ u(Ft, { className: "size-3.5" }),
|
|
3804
3824
|
/* @__PURE__ */ u("span", { children: "Loading HTML preview..." })
|
|
3805
|
-
] }) : a || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "Failed to load HTML preview", description: a ?? "Preview unavailable." }) }) : /* @__PURE__ */
|
|
3806
|
-
/* @__PURE__ */ u("div", { className: "flex shrink-0 items-center justify-end gap-3 border-b border-border/60 px-3 py-2", children: /* @__PURE__ */
|
|
3825
|
+
] }) : a || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "Failed to load HTML preview", description: a ?? "Preview unavailable." }) }) : /* @__PURE__ */ x("div", { className: oe("flex h-full min-h-0 flex-col bg-background", t), children: [
|
|
3826
|
+
/* @__PURE__ */ u("div", { className: "flex shrink-0 items-center justify-end gap-3 border-b border-border/60 px-3 py-2", children: /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
|
|
3807
3827
|
/* @__PURE__ */ u(
|
|
3808
3828
|
xe,
|
|
3809
3829
|
{
|
|
@@ -4023,13 +4043,13 @@ function Nc({
|
|
|
4023
4043
|
);
|
|
4024
4044
|
}
|
|
4025
4045
|
function Ac() {
|
|
4026
|
-
return
|
|
4046
|
+
return M(() => {
|
|
4027
4047
|
Wa();
|
|
4028
4048
|
}, []), Br("."), null;
|
|
4029
4049
|
}
|
|
4030
4050
|
function Dc() {
|
|
4031
4051
|
const e = We(), t = Wt();
|
|
4032
|
-
return
|
|
4052
|
+
return M(() => {
|
|
4033
4053
|
const n = t.get(Ct);
|
|
4034
4054
|
if (n && n.pluginId !== Pt) return;
|
|
4035
4055
|
const r = Rc({
|
|
@@ -4197,9 +4217,9 @@ function Fe({
|
|
|
4197
4217
|
side: n = "top",
|
|
4198
4218
|
children: r
|
|
4199
4219
|
}) {
|
|
4200
|
-
return /* @__PURE__ */ u(ui, { delayDuration: 0, skipDelayDuration: 300, children: /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ u(ui, { delayDuration: 0, skipDelayDuration: 300, children: /* @__PURE__ */ x(di, { children: [
|
|
4201
4221
|
/* @__PURE__ */ u(fi, { asChild: !0, children: r }),
|
|
4202
|
-
/* @__PURE__ */
|
|
4222
|
+
/* @__PURE__ */ x(pi, { side: n, children: [
|
|
4203
4223
|
e,
|
|
4204
4224
|
t ? /* @__PURE__ */ u("span", { className: "ml-1.5 opacity-60", children: t }) : null
|
|
4205
4225
|
] })
|
|
@@ -4527,16 +4547,16 @@ function el({
|
|
|
4527
4547
|
setMode: r,
|
|
4528
4548
|
setQuery: o
|
|
4529
4549
|
}) {
|
|
4530
|
-
const i =
|
|
4531
|
-
|
|
4550
|
+
const i = D(null), a = D(null), l = D(!1);
|
|
4551
|
+
M(() => {
|
|
4532
4552
|
if (!e) return;
|
|
4533
4553
|
const p = (g) => {
|
|
4534
4554
|
g.key === "Escape" && (g.preventDefault(), g.stopPropagation(), t(!1));
|
|
4535
4555
|
}, m = (g) => {
|
|
4536
4556
|
const v = g.target;
|
|
4537
4557
|
if (!v) return;
|
|
4538
|
-
const
|
|
4539
|
-
|
|
4558
|
+
const k = document.querySelector('[data-slot="dialog-content"]');
|
|
4559
|
+
k && !k.contains(v) && (g.preventDefault(), g.stopPropagation(), t(!1));
|
|
4540
4560
|
};
|
|
4541
4561
|
return window.addEventListener("keydown", p, { capture: !0 }), window.addEventListener("pointerdown", m, { capture: !0 }), () => {
|
|
4542
4562
|
window.removeEventListener("keydown", p, { capture: !0 }), window.removeEventListener("pointerdown", m, { capture: !0 });
|
|
@@ -4553,7 +4573,7 @@ function el({
|
|
|
4553
4573
|
],
|
|
4554
4574
|
[s]
|
|
4555
4575
|
)
|
|
4556
|
-
}),
|
|
4576
|
+
}), M(() => {
|
|
4557
4577
|
if (e)
|
|
4558
4578
|
o(""), r("catalogs"), requestAnimationFrame(() => {
|
|
4559
4579
|
var p;
|
|
@@ -4586,15 +4606,15 @@ function tl({
|
|
|
4586
4606
|
isCommandMode: t,
|
|
4587
4607
|
searchQuery: n
|
|
4588
4608
|
}) {
|
|
4589
|
-
const [r, o] =
|
|
4590
|
-
return
|
|
4609
|
+
const [r, o] = j(""), [i, a] = j([]);
|
|
4610
|
+
return M(() => {
|
|
4591
4611
|
if (t) {
|
|
4592
4612
|
o("");
|
|
4593
4613
|
return;
|
|
4594
4614
|
}
|
|
4595
4615
|
const l = setTimeout(() => o(n), 180);
|
|
4596
4616
|
return () => clearTimeout(l);
|
|
4597
|
-
}, [t, n]),
|
|
4617
|
+
}, [t, n]), M(() => {
|
|
4598
4618
|
if (t || !r) {
|
|
4599
4619
|
a([]);
|
|
4600
4620
|
return;
|
|
@@ -4655,31 +4675,31 @@ function tl({
|
|
|
4655
4675
|
}, [e, r, t]), i;
|
|
4656
4676
|
}
|
|
4657
4677
|
function nl(e) {
|
|
4658
|
-
const [t, n] =
|
|
4678
|
+
const [t, n] = j(!1), [r, o] = j(""), [i, a] = j("catalogs"), l = qi(), s = Ui(), f = Eu(), c = Y(() => {
|
|
4659
4679
|
const C = {};
|
|
4660
|
-
for (const
|
|
4661
|
-
|
|
4680
|
+
for (const F of (f == null ? void 0 : f.registeredPlugins) ?? [])
|
|
4681
|
+
F.label && (C[F.id] = F.label);
|
|
4662
4682
|
return C;
|
|
4663
4683
|
}, [f == null ? void 0 : f.registeredPlugins]), d = i === "commands", p = r.trim(), m = tl({
|
|
4664
4684
|
catalogs: l,
|
|
4665
4685
|
isCommandMode: d,
|
|
4666
4686
|
searchQuery: p
|
|
4667
|
-
}), { inputRef: g, switchMode: v, handleInputKeyDown:
|
|
4687
|
+
}), { inputRef: g, switchMode: v, handleInputKeyDown: k } = el({
|
|
4668
4688
|
open: t,
|
|
4669
4689
|
setOpen: n,
|
|
4670
4690
|
mode: i,
|
|
4671
4691
|
setMode: a,
|
|
4672
4692
|
setQuery: o
|
|
4673
|
-
}),
|
|
4693
|
+
}), b = E((C) => {
|
|
4674
4694
|
if (C.startsWith(">")) {
|
|
4675
4695
|
a("commands"), o(C.slice(1));
|
|
4676
4696
|
return;
|
|
4677
4697
|
}
|
|
4678
4698
|
o(C);
|
|
4679
4699
|
}, []), _ = Y(() => d ? Yc(s, p) : [], [s, d, p]), {
|
|
4680
|
-
recentEntries:
|
|
4681
|
-
handleCatalogSelect:
|
|
4682
|
-
handleCommandSelect:
|
|
4700
|
+
recentEntries: W,
|
|
4701
|
+
handleCatalogSelect: B,
|
|
4702
|
+
handleCommandSelect: z,
|
|
4683
4703
|
handleRecentSelect: h
|
|
4684
4704
|
} = Zc({
|
|
4685
4705
|
catalogs: l,
|
|
@@ -4688,7 +4708,7 @@ function nl(e) {
|
|
|
4688
4708
|
searchQuery: p,
|
|
4689
4709
|
close: () => n(!1)
|
|
4690
4710
|
});
|
|
4691
|
-
return /* @__PURE__ */ u(hi, { open: t, onOpenChange: n, children: /* @__PURE__ */
|
|
4711
|
+
return /* @__PURE__ */ u(hi, { open: t, onOpenChange: n, children: /* @__PURE__ */ x(
|
|
4692
4712
|
mi,
|
|
4693
4713
|
{
|
|
4694
4714
|
className: "cmdk-shell flex flex-col gap-0 overflow-hidden border-border/60 p-0 shadow-2xl backdrop-blur-md [&>button.dialog-close]:hidden",
|
|
@@ -4697,24 +4717,24 @@ function nl(e) {
|
|
|
4697
4717
|
onPointerDownOutside: () => n(!1),
|
|
4698
4718
|
onEscapeKeyDown: () => n(!1),
|
|
4699
4719
|
children: [
|
|
4700
|
-
/* @__PURE__ */
|
|
4720
|
+
/* @__PURE__ */ x(gi, { className: "sr-only", children: [
|
|
4701
4721
|
/* @__PURE__ */ u(vi, { children: "Command Palette" }),
|
|
4702
4722
|
/* @__PURE__ */ u(yi, { children: "Search catalogs or switch to commands" })
|
|
4703
4723
|
] }),
|
|
4704
|
-
/* @__PURE__ */
|
|
4724
|
+
/* @__PURE__ */ x(bi, { shouldFilter: !1, className: "flex min-h-0 flex-1 flex-col bg-transparent", children: [
|
|
4705
4725
|
/* @__PURE__ */ u(
|
|
4706
4726
|
rl,
|
|
4707
4727
|
{
|
|
4708
4728
|
inputRef: g,
|
|
4709
4729
|
isCommandMode: d,
|
|
4710
4730
|
query: r,
|
|
4711
|
-
onQueryChange:
|
|
4712
|
-
onInputKeyDown:
|
|
4731
|
+
onQueryChange: b,
|
|
4732
|
+
onInputKeyDown: k,
|
|
4713
4733
|
onSwitchMode: v,
|
|
4714
4734
|
loading: !d && m.some((C) => C.loading)
|
|
4715
4735
|
}
|
|
4716
4736
|
),
|
|
4717
|
-
/* @__PURE__ */
|
|
4737
|
+
/* @__PURE__ */ x(
|
|
4718
4738
|
wi,
|
|
4719
4739
|
{
|
|
4720
4740
|
className: "min-h-0 flex-1 overflow-y-auto py-1",
|
|
@@ -4725,7 +4745,7 @@ function nl(e) {
|
|
|
4725
4745
|
ol,
|
|
4726
4746
|
{
|
|
4727
4747
|
isCommandMode: d,
|
|
4728
|
-
recentEntries:
|
|
4748
|
+
recentEntries: W,
|
|
4729
4749
|
searchQuery: p,
|
|
4730
4750
|
onRecentSelect: h
|
|
4731
4751
|
}
|
|
@@ -4735,7 +4755,7 @@ function nl(e) {
|
|
|
4735
4755
|
{
|
|
4736
4756
|
catalogGroups: m,
|
|
4737
4757
|
isCommandMode: d,
|
|
4738
|
-
onCatalogSelect:
|
|
4758
|
+
onCatalogSelect: B
|
|
4739
4759
|
}
|
|
4740
4760
|
),
|
|
4741
4761
|
/* @__PURE__ */ u(
|
|
@@ -4744,7 +4764,7 @@ function nl(e) {
|
|
|
4744
4764
|
commandResults: _,
|
|
4745
4765
|
isCommandMode: d,
|
|
4746
4766
|
pluginLabelMap: c,
|
|
4747
|
-
onCommandSelect:
|
|
4767
|
+
onCommandSelect: z
|
|
4748
4768
|
}
|
|
4749
4769
|
)
|
|
4750
4770
|
]
|
|
@@ -4765,9 +4785,9 @@ function rl({
|
|
|
4765
4785
|
onSwitchMode: i,
|
|
4766
4786
|
loading: a
|
|
4767
4787
|
}) {
|
|
4768
|
-
return /* @__PURE__ */
|
|
4769
|
-
/* @__PURE__ */
|
|
4770
|
-
/* @__PURE__ */
|
|
4788
|
+
return /* @__PURE__ */ x("div", { className: "relative shrink-0", children: [
|
|
4789
|
+
/* @__PURE__ */ x("div", { className: "relative flex items-stretch [&>[data-slot=command-input-wrapper]]:flex-1 [&>[data-slot=command-input-wrapper]]:h-auto", children: [
|
|
4790
|
+
/* @__PURE__ */ x(
|
|
4771
4791
|
"div",
|
|
4772
4792
|
{
|
|
4773
4793
|
role: "group",
|
|
@@ -4830,10 +4850,10 @@ function ol({
|
|
|
4830
4850
|
value: i,
|
|
4831
4851
|
onSelect: () => r(o),
|
|
4832
4852
|
className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
|
|
4833
|
-
children: o.type === "catalog" ? /* @__PURE__ */
|
|
4853
|
+
children: o.type === "catalog" ? /* @__PURE__ */ x(Me, { children: [
|
|
4834
4854
|
/* @__PURE__ */ u(Vo, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
|
|
4835
4855
|
/* @__PURE__ */ u(uo, { row: o.rowSnapshot })
|
|
4836
|
-
] }) : /* @__PURE__ */
|
|
4856
|
+
] }) : /* @__PURE__ */ x(Me, { children: [
|
|
4837
4857
|
/* @__PURE__ */ u(un, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
|
|
4838
4858
|
/* @__PURE__ */ u("span", { className: "flex-1 truncate", children: o.titleSnapshot }),
|
|
4839
4859
|
/* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "command" })
|
|
@@ -4848,7 +4868,7 @@ function il({
|
|
|
4848
4868
|
isCommandMode: t,
|
|
4849
4869
|
onCatalogSelect: n
|
|
4850
4870
|
}) {
|
|
4851
|
-
return t ? null : /* @__PURE__ */ u(Me, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */
|
|
4871
|
+
return t ? null : /* @__PURE__ */ u(Me, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ x(dn, { heading: r.catalog.label, children: [
|
|
4852
4872
|
r.error ? /* @__PURE__ */ u(sl, { catalogId: r.catalog.id, error: r.error }) : null,
|
|
4853
4873
|
r.rows.map((o) => /* @__PURE__ */ u(
|
|
4854
4874
|
$t,
|
|
@@ -4856,7 +4876,7 @@ function il({
|
|
|
4856
4876
|
value: `${r.catalog.id}:${o.id}`,
|
|
4857
4877
|
onSelect: () => n(r.catalog, o),
|
|
4858
4878
|
className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
|
|
4859
|
-
children: /* @__PURE__ */
|
|
4879
|
+
children: /* @__PURE__ */ x(
|
|
4860
4880
|
zt,
|
|
4861
4881
|
{
|
|
4862
4882
|
pluginId: r.catalog.pluginId ?? r.catalog.id,
|
|
@@ -4874,7 +4894,7 @@ function il({
|
|
|
4874
4894
|
] }, r.catalog.id)) });
|
|
4875
4895
|
}
|
|
4876
4896
|
function sl({ catalogId: e, error: t }) {
|
|
4877
|
-
return /* @__PURE__ */
|
|
4897
|
+
return /* @__PURE__ */ x(
|
|
4878
4898
|
$t,
|
|
4879
4899
|
{
|
|
4880
4900
|
value: `${e}:error`,
|
|
@@ -4893,7 +4913,7 @@ function al({
|
|
|
4893
4913
|
pluginLabelMap: n,
|
|
4894
4914
|
onCommandSelect: r
|
|
4895
4915
|
}) {
|
|
4896
|
-
return !t || e.length === 0 ? null : /* @__PURE__ */ u(dn, { heading: "Commands", children: e.map((o) => /* @__PURE__ */
|
|
4916
|
+
return !t || e.length === 0 ? null : /* @__PURE__ */ u(dn, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ x(
|
|
4897
4917
|
$t,
|
|
4898
4918
|
{
|
|
4899
4919
|
value: o.title,
|
|
@@ -4910,23 +4930,23 @@ function al({
|
|
|
4910
4930
|
)) });
|
|
4911
4931
|
}
|
|
4912
4932
|
function cl({ isCommandMode: e }) {
|
|
4913
|
-
return /* @__PURE__ */
|
|
4933
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center justify-between border-t border-border/50 bg-muted/30 px-3 py-2 text-[11px] text-muted-foreground", children: [
|
|
4914
4934
|
/* @__PURE__ */ u("span", { className: "font-medium tracking-wide uppercase", children: e ? "Commands" : io }),
|
|
4915
|
-
/* @__PURE__ */
|
|
4916
|
-
/* @__PURE__ */
|
|
4935
|
+
/* @__PURE__ */ x("div", { className: "flex items-center gap-3", children: [
|
|
4936
|
+
/* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
|
|
4917
4937
|
/* @__PURE__ */ u(nt, { children: "tab" }),
|
|
4918
4938
|
/* @__PURE__ */ u("span", { children: "switch" })
|
|
4919
4939
|
] }),
|
|
4920
|
-
/* @__PURE__ */
|
|
4940
|
+
/* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
|
|
4921
4941
|
/* @__PURE__ */ u(nt, { children: /* @__PURE__ */ u(Go, { className: "size-3" }) }),
|
|
4922
4942
|
/* @__PURE__ */ u(nt, { children: /* @__PURE__ */ u(Ko, { className: "size-3" }) }),
|
|
4923
4943
|
/* @__PURE__ */ u("span", { children: "navigate" })
|
|
4924
4944
|
] }),
|
|
4925
|
-
/* @__PURE__ */
|
|
4945
|
+
/* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
|
|
4926
4946
|
/* @__PURE__ */ u(nt, { children: /* @__PURE__ */ u(Jo, { className: "size-3" }) }),
|
|
4927
4947
|
/* @__PURE__ */ u("span", { children: "open" })
|
|
4928
4948
|
] }),
|
|
4929
|
-
/* @__PURE__ */
|
|
4949
|
+
/* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
|
|
4930
4950
|
/* @__PURE__ */ u(nt, { children: "esc" }),
|
|
4931
4951
|
/* @__PURE__ */ u("span", { children: "close" })
|
|
4932
4952
|
] })
|
|
@@ -4939,7 +4959,7 @@ function er({
|
|
|
4939
4959
|
label: n,
|
|
4940
4960
|
onClick: r
|
|
4941
4961
|
}) {
|
|
4942
|
-
return /* @__PURE__ */
|
|
4962
|
+
return /* @__PURE__ */ x(
|
|
4943
4963
|
Oe,
|
|
4944
4964
|
{
|
|
4945
4965
|
type: "button",
|
|
@@ -4959,7 +4979,7 @@ function er({
|
|
|
4959
4979
|
);
|
|
4960
4980
|
}
|
|
4961
4981
|
function uo({ row: e }) {
|
|
4962
|
-
return /* @__PURE__ */
|
|
4982
|
+
return /* @__PURE__ */ x("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 truncate", children: [
|
|
4963
4983
|
/* @__PURE__ */ u("span", { className: "truncate font-medium text-foreground", children: e.title }),
|
|
4964
4984
|
e.subtitle ? /* @__PURE__ */ u("span", { className: "truncate text-xs text-muted-foreground/70", children: e.subtitle }) : null,
|
|
4965
4985
|
e.meta ? /* @__PURE__ */ u("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground/70", children: e.meta }) : null
|
|
@@ -5093,68 +5113,55 @@ function ml(e) {
|
|
|
5093
5113
|
}
|
|
5094
5114
|
function gl(e) {
|
|
5095
5115
|
const t = Iu(), { blockers: n } = po(), {
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
let P = !1;
|
|
5106
|
-
const L = p ? { "x-boring-workspace-id": p } : {};
|
|
5107
|
-
return fetch(`${d}/api/v1/workspace/meta`, { headers: L }).then((A) => A.ok ? A.json() : null).then((A) => {
|
|
5108
|
-
P || A && typeof A.workspaceRoot == "string" && (c.current = A.workspaceRoot);
|
|
5116
|
+
surfaceDispatch: r,
|
|
5117
|
+
bridgeEndpoint: o,
|
|
5118
|
+
...i
|
|
5119
|
+
} = e, a = D(null), l = rr(o) ?? "", s = nr(i.requestHeaders);
|
|
5120
|
+
M(() => {
|
|
5121
|
+
let v = !1;
|
|
5122
|
+
const k = s ? { "x-boring-workspace-id": s } : {};
|
|
5123
|
+
return fetch(`${l}/api/v1/workspace/meta`, { headers: k }).then((b) => b.ok ? b.json() : null).then((b) => {
|
|
5124
|
+
v || b && typeof b.workspaceRoot == "string" && (a.current = b.workspaceRoot);
|
|
5109
5125
|
}).catch(() => {
|
|
5110
5126
|
}), () => {
|
|
5111
|
-
|
|
5127
|
+
v = !0;
|
|
5112
5128
|
};
|
|
5113
|
-
}, [
|
|
5114
|
-
const
|
|
5115
|
-
(
|
|
5116
|
-
var
|
|
5117
|
-
const
|
|
5118
|
-
r &&
|
|
5119
|
-
{ kind: "openFile", params: { path: L } },
|
|
5120
|
-
{ surface: r, isWorkbenchOpen: o, openWorkbench: i, openWorkbenchSources: a, closeWorkbench: l }
|
|
5121
|
-
), (A = e.onOpenArtifact) == null || A.call(e, L);
|
|
5129
|
+
}, [l, s]);
|
|
5130
|
+
const f = E(
|
|
5131
|
+
(v) => {
|
|
5132
|
+
var b;
|
|
5133
|
+
const k = ul(v, a.current);
|
|
5134
|
+
r && tn({ kind: "openFile", params: { path: k } }, r), (b = e.onOpenArtifact) == null || b.call(e, k);
|
|
5122
5135
|
},
|
|
5123
|
-
[r,
|
|
5124
|
-
),
|
|
5125
|
-
|
|
5126
|
-
if (!(
|
|
5136
|
+
[r, e.onOpenArtifact]
|
|
5137
|
+
), c = nr(i.requestHeaders), d = n.filter((v) => !v.sessionId || v.sessionId === i.sessionId);
|
|
5138
|
+
M(() => {
|
|
5139
|
+
if (!(o === null || !r))
|
|
5127
5140
|
return Es({
|
|
5128
|
-
endpoint: rr(
|
|
5129
|
-
query:
|
|
5130
|
-
ctx:
|
|
5131
|
-
surface: r,
|
|
5132
|
-
isWorkbenchOpen: o,
|
|
5133
|
-
openWorkbench: i,
|
|
5134
|
-
openWorkbenchSources: a,
|
|
5135
|
-
closeWorkbench: l
|
|
5136
|
-
}
|
|
5141
|
+
endpoint: rr(o),
|
|
5142
|
+
query: c ? { workspaceId: c } : void 0,
|
|
5143
|
+
ctx: r
|
|
5137
5144
|
});
|
|
5138
|
-
}, [
|
|
5139
|
-
const
|
|
5140
|
-
var
|
|
5141
|
-
window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId:
|
|
5142
|
-
}, [
|
|
5143
|
-
(
|
|
5144
|
-
if (
|
|
5145
|
-
window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId:
|
|
5145
|
+
}, [o, r, c]);
|
|
5146
|
+
const p = E(() => {
|
|
5147
|
+
var v;
|
|
5148
|
+
window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: i.sessionId } })), (v = e.onComposerStop) == null || v.call(e);
|
|
5149
|
+
}, [i.sessionId, e.onComposerStop]), m = E(
|
|
5150
|
+
(v, k) => {
|
|
5151
|
+
if (k === "cancel") {
|
|
5152
|
+
window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: i.sessionId } }));
|
|
5146
5153
|
return;
|
|
5147
5154
|
}
|
|
5148
|
-
|
|
5149
|
-
{ kind: "openSurface", params: { kind:
|
|
5150
|
-
|
|
5155
|
+
k !== "open" || !v.surfaceKind || r && tn(
|
|
5156
|
+
{ kind: "openSurface", params: { kind: v.surfaceKind, target: v.target, meta: {} } },
|
|
5157
|
+
r
|
|
5151
5158
|
);
|
|
5152
5159
|
},
|
|
5153
|
-
[
|
|
5154
|
-
),
|
|
5155
|
-
(
|
|
5156
|
-
var
|
|
5157
|
-
Ss(ml(
|
|
5160
|
+
[i.sessionId, r]
|
|
5161
|
+
), g = E(
|
|
5162
|
+
(v) => {
|
|
5163
|
+
var k;
|
|
5164
|
+
Ss(ml(v)), (k = e.onData) == null || k.call(e, v);
|
|
5158
5165
|
},
|
|
5159
5166
|
[e.onData]
|
|
5160
5167
|
);
|
|
@@ -5162,12 +5169,12 @@ function gl(e) {
|
|
|
5162
5169
|
t,
|
|
5163
5170
|
{
|
|
5164
5171
|
chrome: !1,
|
|
5165
|
-
...
|
|
5166
|
-
onOpenArtifact:
|
|
5167
|
-
onData:
|
|
5168
|
-
composerBlockers:
|
|
5169
|
-
onComposerStop:
|
|
5170
|
-
onComposerBlockerAction:
|
|
5172
|
+
...i,
|
|
5173
|
+
onOpenArtifact: f,
|
|
5174
|
+
onData: g,
|
|
5175
|
+
composerBlockers: d,
|
|
5176
|
+
onComposerStop: p,
|
|
5177
|
+
onComposerBlockerAction: m
|
|
5171
5178
|
}
|
|
5172
5179
|
);
|
|
5173
5180
|
}
|
|
@@ -5193,7 +5200,7 @@ function po() {
|
|
|
5193
5200
|
return pe(fo) ?? bl;
|
|
5194
5201
|
}
|
|
5195
5202
|
function wl({ children: e }) {
|
|
5196
|
-
const [t, n] =
|
|
5203
|
+
const [t, n] = j([]), r = E((a) => {
|
|
5197
5204
|
n((l) => [...l.filter((s) => s.id !== a.id), a]);
|
|
5198
5205
|
}, []), o = E((a) => {
|
|
5199
5206
|
n((l) => l.filter((s) => s.id !== a));
|
|
@@ -5295,73 +5302,73 @@ function El({
|
|
|
5295
5302
|
storageKey: a,
|
|
5296
5303
|
onDropSession: l
|
|
5297
5304
|
}) {
|
|
5298
|
-
var
|
|
5299
|
-
const s =
|
|
5305
|
+
var k;
|
|
5306
|
+
const s = D(null), f = D(!1), c = D(null), d = D(/* @__PURE__ */ new Map()), p = D({ panes: e, activePaneId: t ?? null, onActivePaneChange: r, onDropSession: l, storageKey: a });
|
|
5300
5307
|
p.current = { panes: e, activePaneId: t ?? null, onActivePaneChange: r, onDropSession: l, storageKey: a };
|
|
5301
|
-
const m = t ?? ((
|
|
5308
|
+
const m = t ?? ((k = e[0]) == null ? void 0 : k.id) ?? null, g = Y(() => ({
|
|
5302
5309
|
panes: e,
|
|
5303
5310
|
activePaneId: m,
|
|
5304
5311
|
flashPaneId: i ?? null,
|
|
5305
5312
|
renderPane: n,
|
|
5306
5313
|
onActivePaneChange: r,
|
|
5307
5314
|
onClosePane: e.length > 1 ? o : void 0
|
|
5308
|
-
}), [e, m, i, n, r, o]), v = E((
|
|
5309
|
-
const _ =
|
|
5315
|
+
}), [e, m, i, n, r, o]), v = E((b) => {
|
|
5316
|
+
const _ = b.api;
|
|
5310
5317
|
s.current = _;
|
|
5311
|
-
const { panes:
|
|
5318
|
+
const { panes: W, activePaneId: B, storageKey: z } = p.current;
|
|
5312
5319
|
f.current = !0;
|
|
5313
5320
|
try {
|
|
5314
|
-
const
|
|
5315
|
-
if (
|
|
5321
|
+
const L = z ? Pl(z, W.map((T) => T.id)) : null;
|
|
5322
|
+
if (L)
|
|
5316
5323
|
try {
|
|
5317
|
-
_.fromJSON(
|
|
5324
|
+
_.fromJSON(L);
|
|
5318
5325
|
} catch {
|
|
5319
5326
|
}
|
|
5320
|
-
ir(_,
|
|
5327
|
+
ir(_, W, B, d.current);
|
|
5321
5328
|
} finally {
|
|
5322
5329
|
f.current = !1;
|
|
5323
5330
|
}
|
|
5324
|
-
const h = _.onDidActivePanelChange((
|
|
5325
|
-
var
|
|
5331
|
+
const h = _.onDidActivePanelChange((L) => {
|
|
5332
|
+
var A, J;
|
|
5326
5333
|
if (f.current) return;
|
|
5327
|
-
const T =
|
|
5328
|
-
T && T !== p.current.activePaneId && ((J = (
|
|
5329
|
-
}), C = _.onWillShowOverlay((
|
|
5330
|
-
if (
|
|
5331
|
-
|
|
5334
|
+
const T = L == null ? void 0 : L.id;
|
|
5335
|
+
T && T !== p.current.activePaneId && ((J = (A = p.current).onActivePaneChange) == null || J.call(A, T));
|
|
5336
|
+
}), C = _.onWillShowOverlay((L) => {
|
|
5337
|
+
if (L.kind === "tab" || L.kind === "header_space") {
|
|
5338
|
+
L.preventDefault();
|
|
5332
5339
|
return;
|
|
5333
5340
|
}
|
|
5334
|
-
|
|
5335
|
-
}),
|
|
5336
|
-
var
|
|
5337
|
-
const T = (
|
|
5338
|
-
T && Array.from(T).includes(cn) &&
|
|
5339
|
-
}),
|
|
5340
|
-
var
|
|
5341
|
-
const T = (
|
|
5341
|
+
L.kind === "content" && L.position === "center" && L.preventDefault();
|
|
5342
|
+
}), F = _.onUnhandledDragOverEvent((L) => {
|
|
5343
|
+
var A;
|
|
5344
|
+
const T = (A = L.nativeEvent.dataTransfer) == null ? void 0 : A.types;
|
|
5345
|
+
T && Array.from(T).includes(cn) && L.accept();
|
|
5346
|
+
}), O = _.onDidDrop((L) => {
|
|
5347
|
+
var A, J, H, te, X;
|
|
5348
|
+
const T = (A = L.nativeEvent.dataTransfer) == null ? void 0 : A.getData(cn);
|
|
5342
5349
|
T && (d.current.set(T, {
|
|
5343
|
-
referencePanelId: ((H = (J =
|
|
5344
|
-
direction: kl(
|
|
5350
|
+
referencePanelId: ((H = (J = L.group) == null ? void 0 : J.activePanel) == null ? void 0 : H.id) ?? null,
|
|
5351
|
+
direction: kl(L.position)
|
|
5345
5352
|
}), (X = (te = p.current).onDropSession) == null || X.call(te, T));
|
|
5346
5353
|
});
|
|
5347
|
-
let
|
|
5354
|
+
let $ = null;
|
|
5348
5355
|
const I = _.onDidLayoutChange(() => {
|
|
5349
|
-
const
|
|
5350
|
-
|
|
5356
|
+
const L = p.current.storageKey;
|
|
5357
|
+
L && ($ && clearTimeout($), $ = setTimeout(() => Cl(L, _.toJSON()), xl));
|
|
5351
5358
|
});
|
|
5352
5359
|
c.current = () => {
|
|
5353
|
-
|
|
5360
|
+
$ && clearTimeout($), h.dispose(), C.dispose(), F.dispose(), O.dispose(), I.dispose();
|
|
5354
5361
|
};
|
|
5355
5362
|
}, []);
|
|
5356
|
-
return
|
|
5357
|
-
var
|
|
5358
|
-
return (
|
|
5359
|
-
}, []),
|
|
5360
|
-
const
|
|
5361
|
-
if (
|
|
5363
|
+
return M(() => () => {
|
|
5364
|
+
var b;
|
|
5365
|
+
return (b = c.current) == null ? void 0 : b.call(c);
|
|
5366
|
+
}, []), M(() => {
|
|
5367
|
+
const b = s.current;
|
|
5368
|
+
if (b) {
|
|
5362
5369
|
f.current = !0;
|
|
5363
5370
|
try {
|
|
5364
|
-
ir(
|
|
5371
|
+
ir(b, e, m, d.current);
|
|
5365
5372
|
} finally {
|
|
5366
5373
|
f.current = !1;
|
|
5367
5374
|
}
|
|
@@ -5396,7 +5403,7 @@ function Il(e) {
|
|
|
5396
5403
|
const t = vo(), n = typeof ((a = e.params) == null ? void 0 : a.paneId) == "string" ? e.params.paneId : e.api.id, r = t.panes.find((l) => l.id === n);
|
|
5397
5404
|
if (!r) return null;
|
|
5398
5405
|
const o = n === t.activePaneId, i = n === t.flashPaneId;
|
|
5399
|
-
return /* @__PURE__ */
|
|
5406
|
+
return /* @__PURE__ */ x(
|
|
5400
5407
|
"div",
|
|
5401
5408
|
{
|
|
5402
5409
|
"data-boring-workspace-part": "chat-pane",
|
|
@@ -5424,8 +5431,8 @@ const Tl = {
|
|
|
5424
5431
|
[ho]: Il
|
|
5425
5432
|
};
|
|
5426
5433
|
function Rl(e) {
|
|
5427
|
-
const t = vo(), { api: n } = e, [r, o] =
|
|
5428
|
-
|
|
5434
|
+
const t = vo(), { api: n } = e, [r, o] = j(n.title ?? n.id);
|
|
5435
|
+
M(() => {
|
|
5429
5436
|
var f;
|
|
5430
5437
|
const l = () => o(n.title ?? n.id);
|
|
5431
5438
|
l();
|
|
@@ -5436,7 +5443,7 @@ function Rl(e) {
|
|
|
5436
5443
|
};
|
|
5437
5444
|
}, [n]);
|
|
5438
5445
|
const i = t.panes.length > 1, a = !!t.onClosePane;
|
|
5439
|
-
return /* @__PURE__ */
|
|
5446
|
+
return /* @__PURE__ */ x(
|
|
5440
5447
|
"div",
|
|
5441
5448
|
{
|
|
5442
5449
|
className: oe(
|
|
@@ -5501,8 +5508,8 @@ function Nl({ dimmed: e, flash: t }) {
|
|
|
5501
5508
|
}
|
|
5502
5509
|
const sr = "boring:chat-session-status";
|
|
5503
5510
|
function Al() {
|
|
5504
|
-
const [e, t] =
|
|
5505
|
-
return
|
|
5511
|
+
const [e, t] = j(() => /* @__PURE__ */ new Set());
|
|
5512
|
+
return M(() => {
|
|
5506
5513
|
const n = (r) => {
|
|
5507
5514
|
const o = r.detail;
|
|
5508
5515
|
if (typeof (o == null ? void 0 : o.sessionId) != "string") return;
|
|
@@ -5538,9 +5545,9 @@ function Dl(e) {
|
|
|
5538
5545
|
g >= n ? i.push(p) : g >= r ? a.push(p) : g >= o ? l.push(p) : s.push(p);
|
|
5539
5546
|
}
|
|
5540
5547
|
const c = (p, m) => {
|
|
5541
|
-
var
|
|
5542
|
-
const g = ((
|
|
5543
|
-
return (((
|
|
5548
|
+
var k, b;
|
|
5549
|
+
const g = ((k = It(p.updatedAt)) == null ? void 0 : k.getTime()) ?? 0;
|
|
5550
|
+
return (((b = It(m.updatedAt)) == null ? void 0 : b.getTime()) ?? 0) - g;
|
|
5544
5551
|
}, d = [];
|
|
5545
5552
|
return i.length && d.push({ key: "today", label: "Today", items: i.sort(c) }), a.length && d.push({ key: "yesterday", label: "Yesterday", items: a.sort(c) }), l.length && d.push({ key: "week", label: "This week", items: l.sort(c) }), s.length && d.push({ key: "earlier", label: "Earlier", items: s.sort(c) }), f.length && d.push({ key: "undated", label: "Other", items: f }), d;
|
|
5546
5553
|
}
|
|
@@ -5576,24 +5583,24 @@ function Fl({
|
|
|
5576
5583
|
onClose: p,
|
|
5577
5584
|
className: m
|
|
5578
5585
|
}) {
|
|
5579
|
-
const g = Y(() => new Set(n ?? []), [n]), v = Y(() => new Set(r ?? []), [r]),
|
|
5580
|
-
() => (r ?? []).map((T) => e.find((
|
|
5586
|
+
const g = Y(() => new Set(n ?? []), [n]), v = Y(() => new Set(r ?? []), [r]), k = Y(
|
|
5587
|
+
() => (r ?? []).map((T) => e.find((A) => A.id === T)).filter((T) => !!T),
|
|
5581
5588
|
[r, e]
|
|
5582
|
-
),
|
|
5583
|
-
() => (n ?? []).filter((T) => !v.has(T)).map((T) => e.find((
|
|
5589
|
+
), b = Y(
|
|
5590
|
+
() => (n ?? []).filter((T) => !v.has(T)).map((T) => e.find((A) => A.id === T)).filter((T) => !!T),
|
|
5584
5591
|
[n, v, e]
|
|
5585
5592
|
), _ = Y(
|
|
5586
5593
|
() => g.size > 0 || v.size > 0 ? e.filter((T) => !g.has(T.id) && !v.has(T.id)) : e,
|
|
5587
5594
|
[g, v, e]
|
|
5588
|
-
),
|
|
5595
|
+
), W = Y(() => Dl(_), [_]), [B, z] = j(!1), [h, C] = j(!1), [F, O] = j(
|
|
5589
5596
|
() => ((n == null ? void 0 : n.length) ?? 0) > 0 || ((r == null ? void 0 : r.length) ?? 0) > 0
|
|
5590
|
-
),
|
|
5597
|
+
), $ = Al(), { blockers: I } = po(), L = Y(() => {
|
|
5591
5598
|
const T = /* @__PURE__ */ new Set();
|
|
5592
|
-
for (const
|
|
5593
|
-
|
|
5599
|
+
for (const A of I)
|
|
5600
|
+
A.reason === "waiting_for_user_input" && A.sessionId && T.add(A.sessionId);
|
|
5594
5601
|
return T;
|
|
5595
5602
|
}, [I]);
|
|
5596
|
-
return /* @__PURE__ */
|
|
5603
|
+
return /* @__PURE__ */ x(
|
|
5597
5604
|
"div",
|
|
5598
5605
|
{
|
|
5599
5606
|
"data-boring-workspace-part": "session-list",
|
|
@@ -5604,38 +5611,38 @@ function Fl({
|
|
|
5604
5611
|
role: "navigation",
|
|
5605
5612
|
"aria-label": "Session history",
|
|
5606
5613
|
children: [
|
|
5607
|
-
/* @__PURE__ */
|
|
5614
|
+
/* @__PURE__ */ x("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
|
|
5608
5615
|
/* @__PURE__ */ u("span", { className: "text-[12px] font-medium tracking-tight text-foreground/70", children: "Sessions" }),
|
|
5609
|
-
/* @__PURE__ */
|
|
5616
|
+
/* @__PURE__ */ x("div", { className: "flex items-center gap-0.5", children: [
|
|
5610
5617
|
l && /* @__PURE__ */ u(Fe, { label: "New chat", side: "bottom", children: /* @__PURE__ */ u(xe, { type: "button", variant: "ghost", size: "icon-xs", onClick: l, "aria-label": "New session", children: /* @__PURE__ */ u(Xo, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }) }),
|
|
5611
5618
|
p && /* @__PURE__ */ u(Fe, { label: "Close sessions", hint: "⌘1", side: "bottom", children: /* @__PURE__ */ u(xe, { type: "button", variant: "ghost", size: "icon-xs", onClick: p, "aria-label": "Close sessions", children: /* @__PURE__ */ u(Qo, { className: "h-4 w-4", strokeWidth: 1.75 }) }) })
|
|
5612
5619
|
] })
|
|
5613
5620
|
] }),
|
|
5614
|
-
/* @__PURE__ */
|
|
5615
|
-
e.length === 0 && /* @__PURE__ */
|
|
5621
|
+
/* @__PURE__ */ x("div", { className: "boring-scrollbar-discreet flex-1 overflow-y-auto py-2.5", children: [
|
|
5622
|
+
e.length === 0 && /* @__PURE__ */ x("div", { className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
|
|
5616
5623
|
"No sessions yet.",
|
|
5617
5624
|
/* @__PURE__ */ u("br", {}),
|
|
5618
5625
|
"Start a new chat to begin."
|
|
5619
5626
|
] }),
|
|
5620
|
-
|
|
5627
|
+
k.length > 0 && /* @__PURE__ */ x("section", { "data-boring-workspace-part": "session-pinned-section", children: [
|
|
5621
5628
|
/* @__PURE__ */ u(
|
|
5622
5629
|
Jt,
|
|
5623
5630
|
{
|
|
5624
5631
|
label: "Pinned",
|
|
5625
|
-
count:
|
|
5626
|
-
collapsed:
|
|
5627
|
-
onToggle: () =>
|
|
5632
|
+
count: k.length,
|
|
5633
|
+
collapsed: B,
|
|
5634
|
+
onToggle: () => z((T) => !T)
|
|
5628
5635
|
}
|
|
5629
5636
|
),
|
|
5630
|
-
!
|
|
5637
|
+
!B && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: k.map((T) => /* @__PURE__ */ u(
|
|
5631
5638
|
Yt,
|
|
5632
5639
|
{
|
|
5633
5640
|
session: T,
|
|
5634
5641
|
active: T.id === t,
|
|
5635
5642
|
open: g.has(T.id),
|
|
5636
5643
|
pinned: !0,
|
|
5637
|
-
working:
|
|
5638
|
-
needsInput:
|
|
5644
|
+
working: $.has(T.id),
|
|
5645
|
+
needsInput: L.has(T.id),
|
|
5639
5646
|
onSwitch: i,
|
|
5640
5647
|
onOpenAsTab: a,
|
|
5641
5648
|
onTogglePin: o,
|
|
@@ -5644,25 +5651,25 @@ function Fl({
|
|
|
5644
5651
|
T.id
|
|
5645
5652
|
)) })
|
|
5646
5653
|
] }),
|
|
5647
|
-
|
|
5654
|
+
b.length > 0 && /* @__PURE__ */ x("section", { "data-boring-workspace-part": "session-active-section", className: oe(k.length > 0 && "mt-3"), children: [
|
|
5648
5655
|
/* @__PURE__ */ u(
|
|
5649
5656
|
Jt,
|
|
5650
5657
|
{
|
|
5651
5658
|
label: "Active",
|
|
5652
|
-
count:
|
|
5659
|
+
count: b.length,
|
|
5653
5660
|
collapsed: h,
|
|
5654
5661
|
onToggle: () => C((T) => !T)
|
|
5655
5662
|
}
|
|
5656
5663
|
),
|
|
5657
|
-
!h && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children:
|
|
5664
|
+
!h && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: b.map((T) => /* @__PURE__ */ u(
|
|
5658
5665
|
Yt,
|
|
5659
5666
|
{
|
|
5660
5667
|
session: T,
|
|
5661
5668
|
active: T.id === t,
|
|
5662
5669
|
open: !0,
|
|
5663
5670
|
pinned: v.has(T.id),
|
|
5664
|
-
working:
|
|
5665
|
-
needsInput:
|
|
5671
|
+
working: $.has(T.id),
|
|
5672
|
+
needsInput: L.has(T.id),
|
|
5666
5673
|
onSwitch: i,
|
|
5667
5674
|
onOpenAsTab: a,
|
|
5668
5675
|
onTogglePin: o,
|
|
@@ -5671,24 +5678,24 @@ function Fl({
|
|
|
5671
5678
|
T.id
|
|
5672
5679
|
)) })
|
|
5673
5680
|
] }),
|
|
5674
|
-
|
|
5681
|
+
W.length > 0 && /* @__PURE__ */ x(
|
|
5675
5682
|
"section",
|
|
5676
5683
|
{
|
|
5677
5684
|
"data-boring-workspace-part": "session-history-section",
|
|
5678
|
-
className: oe(
|
|
5685
|
+
className: oe(b.length > 0 && "mt-3"),
|
|
5679
5686
|
children: [
|
|
5680
5687
|
/* @__PURE__ */ u(
|
|
5681
5688
|
Jt,
|
|
5682
5689
|
{
|
|
5683
5690
|
label: "History",
|
|
5684
5691
|
count: _.length,
|
|
5685
|
-
collapsed:
|
|
5686
|
-
onToggle: () =>
|
|
5692
|
+
collapsed: F,
|
|
5693
|
+
onToggle: () => O((T) => !T)
|
|
5687
5694
|
}
|
|
5688
5695
|
),
|
|
5689
|
-
!
|
|
5690
|
-
|
|
5691
|
-
/* @__PURE__ */
|
|
5696
|
+
!F && /* @__PURE__ */ x(Me, { children: [
|
|
5697
|
+
W.map((T, A) => /* @__PURE__ */ x("section", { className: oe(A > 0 && "mt-2"), children: [
|
|
5698
|
+
/* @__PURE__ */ x("div", { className: "flex items-baseline justify-between gap-2 px-5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/60", children: [
|
|
5692
5699
|
/* @__PURE__ */ u("span", { children: T.label }),
|
|
5693
5700
|
/* @__PURE__ */ u("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: T.items.length })
|
|
5694
5701
|
] }),
|
|
@@ -5699,8 +5706,8 @@ function Fl({
|
|
|
5699
5706
|
active: J.id === t,
|
|
5700
5707
|
open: !1,
|
|
5701
5708
|
pinned: v.has(J.id),
|
|
5702
|
-
working:
|
|
5703
|
-
needsInput:
|
|
5709
|
+
working: $.has(J.id),
|
|
5710
|
+
needsInput: L.has(J.id),
|
|
5704
5711
|
onSwitch: i,
|
|
5705
5712
|
onOpenAsTab: a,
|
|
5706
5713
|
onTogglePin: o,
|
|
@@ -5734,7 +5741,7 @@ function Jt({
|
|
|
5734
5741
|
collapsed: n,
|
|
5735
5742
|
onToggle: r
|
|
5736
5743
|
}) {
|
|
5737
|
-
return /* @__PURE__ */
|
|
5744
|
+
return /* @__PURE__ */ x(
|
|
5738
5745
|
"button",
|
|
5739
5746
|
{
|
|
5740
5747
|
type: "button",
|
|
@@ -5743,7 +5750,7 @@ function Jt({
|
|
|
5743
5750
|
"data-boring-workspace-part": "session-section-toggle",
|
|
5744
5751
|
className: "flex w-full items-baseline justify-between gap-2 px-3.5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/75 transition-colors hover:text-foreground/80",
|
|
5745
5752
|
children: [
|
|
5746
|
-
/* @__PURE__ */
|
|
5753
|
+
/* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
|
|
5747
5754
|
/* @__PURE__ */ u(
|
|
5748
5755
|
yr,
|
|
5749
5756
|
{
|
|
@@ -5772,7 +5779,7 @@ function Yt({
|
|
|
5772
5779
|
onDelete: f
|
|
5773
5780
|
}) {
|
|
5774
5781
|
const c = _l(e.updatedAt);
|
|
5775
|
-
return /* @__PURE__ */
|
|
5782
|
+
return /* @__PURE__ */ x(
|
|
5776
5783
|
"li",
|
|
5777
5784
|
{
|
|
5778
5785
|
role: "listitem",
|
|
@@ -5800,7 +5807,7 @@ function Yt({
|
|
|
5800
5807
|
)
|
|
5801
5808
|
}
|
|
5802
5809
|
),
|
|
5803
|
-
/* @__PURE__ */
|
|
5810
|
+
/* @__PURE__ */ x("span", { className: "min-w-0 flex-1 truncate leading-5", title: e.title, children: [
|
|
5804
5811
|
/* @__PURE__ */ u("span", { className: oe(t ? "font-medium text-foreground" : "text-foreground/90"), children: e.title || "Untitled" }),
|
|
5805
5812
|
c && /* @__PURE__ */ u(
|
|
5806
5813
|
"span",
|
|
@@ -5813,7 +5820,7 @@ function Yt({
|
|
|
5813
5820
|
}
|
|
5814
5821
|
)
|
|
5815
5822
|
] }),
|
|
5816
|
-
i ? /* @__PURE__ */
|
|
5823
|
+
i ? /* @__PURE__ */ x(
|
|
5817
5824
|
"span",
|
|
5818
5825
|
{
|
|
5819
5826
|
"data-boring-workspace-part": "session-badge",
|
|
@@ -5824,7 +5831,7 @@ function Yt({
|
|
|
5824
5831
|
"needs input"
|
|
5825
5832
|
]
|
|
5826
5833
|
}
|
|
5827
|
-
) : o ? /* @__PURE__ */
|
|
5834
|
+
) : o ? /* @__PURE__ */ x(
|
|
5828
5835
|
"span",
|
|
5829
5836
|
{
|
|
5830
5837
|
"data-boring-workspace-part": "session-badge",
|
|
@@ -5947,18 +5954,18 @@ function yo({
|
|
|
5947
5954
|
});
|
|
5948
5955
|
}
|
|
5949
5956
|
return q;
|
|
5950
|
-
}, [c]), [p, m] =
|
|
5957
|
+
}, [c]), [p, m] = j(n ?? ""), g = d.some((q) => q.id === p) ? p : ((ae = d[0]) == null ? void 0 : ae.id) ?? "", [v, k] = j(!1), [b, _] = j(""), [W, B] = j(""), z = D(null), [h, C] = j(null), F = E((q) => {
|
|
5951
5958
|
C(q);
|
|
5952
|
-
}, []),
|
|
5953
|
-
|
|
5959
|
+
}, []), O = D(void 0);
|
|
5960
|
+
M(() => (clearTimeout(O.current), O.current = setTimeout(() => B(b), 180), () => clearTimeout(O.current)), [b]), M(() => {
|
|
5954
5961
|
var q;
|
|
5955
|
-
v && ((q =
|
|
5956
|
-
}, [v]),
|
|
5962
|
+
v && ((q = z.current) == null || q.focus());
|
|
5963
|
+
}, [v]), M(() => {
|
|
5957
5964
|
d.length > 0 && !d.some((q) => q.id === p) && m(d[0].id);
|
|
5958
|
-
}, [p, d]),
|
|
5965
|
+
}, [p, d]), M(() => {
|
|
5959
5966
|
r && d.some((q) => q.id === lr) && m(lr);
|
|
5960
5967
|
}, [r, d]);
|
|
5961
|
-
const
|
|
5968
|
+
const $ = E((q) => {
|
|
5962
5969
|
var ke;
|
|
5963
5970
|
const ce = (ke = q.panel) == null ? void 0 : ke.defaultPanelId;
|
|
5964
5971
|
if (!ce || !o) return;
|
|
@@ -5969,23 +5976,23 @@ function yo({
|
|
|
5969
5976
|
title: fe.title
|
|
5970
5977
|
});
|
|
5971
5978
|
}, [o, f]), I = E((q) => {
|
|
5972
|
-
m(q.id),
|
|
5973
|
-
}, [
|
|
5974
|
-
|
|
5979
|
+
m(q.id), $(q);
|
|
5980
|
+
}, [$]), L = E(() => {
|
|
5981
|
+
k((q) => (q && _(""), !q));
|
|
5975
5982
|
}, []), T = E((q) => {
|
|
5976
|
-
q.key === "Escape" && (q.preventDefault(),
|
|
5977
|
-
}, []),
|
|
5983
|
+
q.key === "Escape" && (q.preventDefault(), k(!1), _(""));
|
|
5984
|
+
}, []), A = d.find((q) => q.id === g), J = !!((ue = A == null ? void 0 : A.panel) != null && ue.chromeless), H = !J, te = Y(
|
|
5978
5985
|
() => ({
|
|
5979
5986
|
rootDir: e,
|
|
5980
5987
|
bridge: t,
|
|
5981
|
-
query:
|
|
5982
|
-
searchQuery:
|
|
5988
|
+
query: W,
|
|
5989
|
+
searchQuery: W || void 0,
|
|
5983
5990
|
chromeless: !0,
|
|
5984
5991
|
chromeActionsElement: h,
|
|
5985
5992
|
revealFileTreeRequest: r
|
|
5986
5993
|
}),
|
|
5987
|
-
[t, h,
|
|
5988
|
-
), X = /* @__PURE__ */
|
|
5994
|
+
[t, h, W, r, e]
|
|
5995
|
+
), X = /* @__PURE__ */ x(
|
|
5989
5996
|
"nav",
|
|
5990
5997
|
{
|
|
5991
5998
|
className: "flex w-11 shrink-0 flex-col items-center gap-1 bg-muted/35 px-1.5 py-2",
|
|
@@ -6024,13 +6031,13 @@ function yo({
|
|
|
6024
6031
|
]
|
|
6025
6032
|
}
|
|
6026
6033
|
);
|
|
6027
|
-
return /* @__PURE__ */
|
|
6034
|
+
return /* @__PURE__ */ x("div", { "data-boring-workspace-part": "workbench-left", className: oe("workbench-left-root flex h-full min-h-0", l), children: [
|
|
6028
6035
|
X,
|
|
6029
|
-
/* @__PURE__ */
|
|
6030
|
-
!J && /* @__PURE__ */
|
|
6031
|
-
/* @__PURE__ */
|
|
6032
|
-
/* @__PURE__ */ u("span", { className: "shrink-0 text-foreground/80", children:
|
|
6033
|
-
/* @__PURE__ */ u("div", { className: "truncate text-[14px] font-medium tracking-tight text-foreground", children: (
|
|
6036
|
+
/* @__PURE__ */ x("div", { className: "flex h-full min-w-0 flex-1 flex-col bg-muted/35", children: [
|
|
6037
|
+
!J && /* @__PURE__ */ x("div", { className: "flex h-11 items-center gap-1 border-b border-border/60 bg-muted/35 px-2.5", children: [
|
|
6038
|
+
/* @__PURE__ */ x("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
6039
|
+
/* @__PURE__ */ u("span", { className: "shrink-0 text-foreground/80", children: A == null ? void 0 : A.icon }),
|
|
6040
|
+
/* @__PURE__ */ u("div", { className: "truncate text-[14px] font-medium tracking-tight text-foreground", children: (A == null ? void 0 : A.title) ?? "Sources" })
|
|
6034
6041
|
] }),
|
|
6035
6042
|
H && /* @__PURE__ */ u(Fe, { label: "Search", side: "bottom", children: /* @__PURE__ */ u(
|
|
6036
6043
|
xe,
|
|
@@ -6038,7 +6045,7 @@ function yo({
|
|
|
6038
6045
|
type: "button",
|
|
6039
6046
|
variant: "ghost",
|
|
6040
6047
|
size: "icon-xs",
|
|
6041
|
-
onClick:
|
|
6048
|
+
onClick: L,
|
|
6042
6049
|
className: oe(v && "bg-foreground/5 text-foreground"),
|
|
6043
6050
|
"aria-label": "Search",
|
|
6044
6051
|
children: /* @__PURE__ */ u(En, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
@@ -6047,27 +6054,27 @@ function yo({
|
|
|
6047
6054
|
/* @__PURE__ */ u(
|
|
6048
6055
|
"div",
|
|
6049
6056
|
{
|
|
6050
|
-
ref:
|
|
6057
|
+
ref: F,
|
|
6051
6058
|
className: "flex shrink-0 items-center gap-1",
|
|
6052
6059
|
"data-boring-workspace-part": "left-tab-chrome-actions"
|
|
6053
6060
|
}
|
|
6054
6061
|
)
|
|
6055
6062
|
] }),
|
|
6056
|
-
!J && H && v && /* @__PURE__ */
|
|
6063
|
+
!J && H && v && /* @__PURE__ */ x("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
|
|
6057
6064
|
/* @__PURE__ */ u(En, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
6058
6065
|
/* @__PURE__ */ u(
|
|
6059
6066
|
wr,
|
|
6060
6067
|
{
|
|
6061
|
-
ref:
|
|
6068
|
+
ref: z,
|
|
6062
6069
|
type: "text",
|
|
6063
|
-
value:
|
|
6070
|
+
value: b,
|
|
6064
6071
|
onChange: (q) => _(q.target.value),
|
|
6065
6072
|
onKeyDown: T,
|
|
6066
|
-
placeholder: `Search ${((
|
|
6073
|
+
placeholder: `Search ${((A == null ? void 0 : A.title) ?? "sources").toLowerCase()}...`,
|
|
6067
6074
|
className: "h-7 flex-1 border-0 bg-transparent px-0 py-0 text-xs shadow-none focus-visible:ring-0 dark:bg-transparent"
|
|
6068
6075
|
}
|
|
6069
6076
|
),
|
|
6070
|
-
|
|
6077
|
+
b && /* @__PURE__ */ u(
|
|
6071
6078
|
xe,
|
|
6072
6079
|
{
|
|
6073
6080
|
type: "button",
|
|
@@ -6079,7 +6086,7 @@ function yo({
|
|
|
6079
6086
|
}
|
|
6080
6087
|
)
|
|
6081
6088
|
] }),
|
|
6082
|
-
/* @__PURE__ */ u("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ u(jl, { panel:
|
|
6089
|
+
/* @__PURE__ */ u("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ u(jl, { panel: A == null ? void 0 : A.panel, params: te, onOpenPanel: o }) })
|
|
6083
6090
|
] })
|
|
6084
6091
|
] });
|
|
6085
6092
|
}
|
|
@@ -6291,53 +6298,53 @@ function Kl({
|
|
|
6291
6298
|
initialPanels: d,
|
|
6292
6299
|
className: p
|
|
6293
6300
|
}) {
|
|
6294
|
-
const [m, g] =
|
|
6301
|
+
const [m, g] = j(() => {
|
|
6295
6302
|
if (!o) return !1;
|
|
6296
6303
|
try {
|
|
6297
6304
|
return localStorage.getItem(`${o}:sidebarCollapsed`) === "1";
|
|
6298
6305
|
} catch {
|
|
6299
6306
|
return !1;
|
|
6300
6307
|
}
|
|
6301
|
-
}), [v,
|
|
6308
|
+
}), [v, k] = j(() => {
|
|
6302
6309
|
if (!o) return t;
|
|
6303
6310
|
try {
|
|
6304
|
-
const
|
|
6305
|
-
if (!
|
|
6306
|
-
const
|
|
6307
|
-
return Number.isFinite(
|
|
6311
|
+
const S = localStorage.getItem(`${o}:sidebarWidth`);
|
|
6312
|
+
if (!S) return t;
|
|
6313
|
+
const N = Number(S);
|
|
6314
|
+
return Number.isFinite(N) ? Math.max(n, Math.min(r, N)) : t;
|
|
6308
6315
|
} catch {
|
|
6309
6316
|
return t;
|
|
6310
6317
|
}
|
|
6311
|
-
}),
|
|
6312
|
-
|
|
6313
|
-
const
|
|
6314
|
-
|
|
6315
|
-
const
|
|
6316
|
-
|
|
6317
|
-
const I =
|
|
6318
|
+
}), b = D(null), _ = D(null), W = D(null), [B, z] = j(null), [h, C] = j(null), F = D(i);
|
|
6319
|
+
F.current = i;
|
|
6320
|
+
const O = D(a);
|
|
6321
|
+
O.current = a;
|
|
6322
|
+
const $ = D(l);
|
|
6323
|
+
$.current = l;
|
|
6324
|
+
const I = D(/* @__PURE__ */ new Set()), L = D(/* @__PURE__ */ new Set()), T = D(null), A = D(
|
|
6318
6325
|
/* @__PURE__ */ new Map()
|
|
6319
6326
|
), J = Mt(), H = ot(
|
|
6320
6327
|
J.subscribe,
|
|
6321
6328
|
J.getSnapshot,
|
|
6322
6329
|
J.getSnapshot
|
|
6323
|
-
), te = Tr(), X =
|
|
6330
|
+
), te = Tr(), X = D(J);
|
|
6324
6331
|
X.current = J;
|
|
6325
|
-
const ae =
|
|
6332
|
+
const ae = D(te);
|
|
6326
6333
|
ae.current = te;
|
|
6327
6334
|
const ue = Y(() => {
|
|
6328
|
-
const
|
|
6329
|
-
for (const
|
|
6330
|
-
|
|
6331
|
-
for (const
|
|
6332
|
-
|
|
6333
|
-
return [...
|
|
6334
|
-
}, [s, H]), q = E((
|
|
6335
|
-
const
|
|
6336
|
-
if (!
|
|
6335
|
+
const S = /* @__PURE__ */ new Set();
|
|
6336
|
+
for (const N of H)
|
|
6337
|
+
N.placement === "center" && S.add(N.id);
|
|
6338
|
+
for (const N of s ?? [])
|
|
6339
|
+
S.add(N);
|
|
6340
|
+
return [...S];
|
|
6341
|
+
}, [s, H]), q = E((S) => {
|
|
6342
|
+
const N = b.current;
|
|
6343
|
+
if (!N) {
|
|
6337
6344
|
console.warn("[SurfaceShell] openFile: surface not ready (dockview not initialized)");
|
|
6338
6345
|
return;
|
|
6339
6346
|
}
|
|
6340
|
-
const R = Tt(
|
|
6347
|
+
const R = Tt(S), G = {
|
|
6341
6348
|
kind: Ye,
|
|
6342
6349
|
target: R
|
|
6343
6350
|
}, ie = ae.current.resolve(G);
|
|
@@ -6347,13 +6354,13 @@ function Kl({
|
|
|
6347
6354
|
return;
|
|
6348
6355
|
}
|
|
6349
6356
|
const be = Xt(G, ie);
|
|
6350
|
-
|
|
6351
|
-
const se =
|
|
6357
|
+
L.current.add(be);
|
|
6358
|
+
const se = N.getPanel(be), ge = Qt(ie.params, R);
|
|
6352
6359
|
if (se) {
|
|
6353
6360
|
se.api.updateParameters(ge), se.api.setActive();
|
|
6354
6361
|
return;
|
|
6355
6362
|
}
|
|
6356
|
-
|
|
6363
|
+
N.addPanel({
|
|
6357
6364
|
id: be,
|
|
6358
6365
|
component: ie.component,
|
|
6359
6366
|
title: ie.title ?? R.split("/").pop() ?? R,
|
|
@@ -6361,27 +6368,27 @@ function Kl({
|
|
|
6361
6368
|
});
|
|
6362
6369
|
return;
|
|
6363
6370
|
}
|
|
6364
|
-
const ye = ur(
|
|
6371
|
+
const ye = ur(N, R);
|
|
6365
6372
|
if (ye) {
|
|
6366
6373
|
ye.api.setActive();
|
|
6367
6374
|
return;
|
|
6368
6375
|
}
|
|
6369
6376
|
console.warn(`[SurfaceShell] openFile: no surface resolver matched "${R}"`);
|
|
6370
|
-
}, []), ce = E((
|
|
6377
|
+
}, []), ce = E((S) => {
|
|
6371
6378
|
var mt;
|
|
6372
|
-
const
|
|
6373
|
-
if (!
|
|
6379
|
+
const N = b.current;
|
|
6380
|
+
if (!N) {
|
|
6374
6381
|
console.warn("[SurfaceShell] openSurface: surface not ready (dockview not initialized)");
|
|
6375
6382
|
return;
|
|
6376
6383
|
}
|
|
6377
|
-
const R = Gl(
|
|
6384
|
+
const R = Gl(S), G = ae.current.resolve(R);
|
|
6378
6385
|
if (!G) {
|
|
6379
6386
|
console.warn(`[SurfaceShell] openSurface: no resolver matched kind="${R.kind}" target="${R.target}"`);
|
|
6380
6387
|
return;
|
|
6381
6388
|
}
|
|
6382
6389
|
const ie = Xt(R, G);
|
|
6383
|
-
R.kind === Ye &&
|
|
6384
|
-
const ye =
|
|
6390
|
+
R.kind === Ye && L.current.add(ie);
|
|
6391
|
+
const ye = N.getPanel(ie), be = ((mt = R.meta) == null ? void 0 : mt.closeWorkbenchOnDone) === !0, se = R.kind === Ye ? Qt(G.params, R.target) : G.params, ge = be && $.current ? { ...se ?? {}, __closeWorkbenchOnDone: $.current } : se;
|
|
6385
6392
|
if (ye) {
|
|
6386
6393
|
ge && ye.api.updateParameters(ge), ye.api.setActive();
|
|
6387
6394
|
return;
|
|
@@ -6393,50 +6400,50 @@ function Kl({
|
|
|
6393
6400
|
`openSurface: unknown component "${G.component}". Registered panels: [${Ut}]. Register the component through a panel output before resolving to it.`
|
|
6394
6401
|
);
|
|
6395
6402
|
}
|
|
6396
|
-
|
|
6403
|
+
N.addPanel({
|
|
6397
6404
|
id: ie,
|
|
6398
6405
|
component: G.component,
|
|
6399
6406
|
title: G.title ?? R.target,
|
|
6400
6407
|
params: ge
|
|
6401
6408
|
});
|
|
6402
|
-
}, []), fe = E((
|
|
6403
|
-
const
|
|
6404
|
-
if (!
|
|
6405
|
-
const R =
|
|
6409
|
+
}, []), fe = E((S) => {
|
|
6410
|
+
const N = b.current;
|
|
6411
|
+
if (!N) return;
|
|
6412
|
+
const R = N.getPanel(S.id);
|
|
6406
6413
|
if (R) {
|
|
6407
|
-
|
|
6414
|
+
S.params && R.api.updateParameters(S.params), R.api.setActive();
|
|
6408
6415
|
return;
|
|
6409
6416
|
}
|
|
6410
6417
|
const G = X.current;
|
|
6411
|
-
if (!G.has(
|
|
6418
|
+
if (!G.has(S.component)) {
|
|
6412
6419
|
const ie = G.list().map((ye) => ye.id).join(", ");
|
|
6413
6420
|
throw new Error(
|
|
6414
|
-
`openPanel: unknown component "${
|
|
6421
|
+
`openPanel: unknown component "${S.component}". Registered panels: [${ie}]. Add the component to WorkspaceProvider's "panels" prop, or pick one of the registered ids.`
|
|
6415
6422
|
);
|
|
6416
6423
|
}
|
|
6417
|
-
|
|
6418
|
-
id:
|
|
6419
|
-
component:
|
|
6420
|
-
title:
|
|
6421
|
-
params:
|
|
6424
|
+
N.addPanel({
|
|
6425
|
+
id: S.id,
|
|
6426
|
+
component: S.component,
|
|
6427
|
+
title: S.title ?? S.id,
|
|
6428
|
+
params: S.params
|
|
6422
6429
|
});
|
|
6423
6430
|
}, []), ke = E(() => {
|
|
6424
6431
|
var R;
|
|
6425
|
-
const
|
|
6426
|
-
return
|
|
6432
|
+
const S = b.current;
|
|
6433
|
+
return S ? { openTabs: S.panels.map((G) => ({
|
|
6427
6434
|
id: G.id,
|
|
6428
6435
|
title: G.title ?? G.id,
|
|
6429
6436
|
params: G.params ?? void 0
|
|
6430
|
-
})), activeTab: ((R =
|
|
6431
|
-
}, []), Pe = E((
|
|
6432
|
-
const R =
|
|
6437
|
+
})), activeTab: ((R = S.activePanel) == null ? void 0 : R.id) ?? null } : { openTabs: [], activeTab: null };
|
|
6438
|
+
}, []), Pe = E((S, N) => {
|
|
6439
|
+
const R = A.current.get(S);
|
|
6433
6440
|
if (!R || R.size === 0) return !1;
|
|
6434
6441
|
for (const G of [...R])
|
|
6435
|
-
G(
|
|
6442
|
+
G(N);
|
|
6436
6443
|
return !0;
|
|
6437
|
-
}, []), He = E((
|
|
6438
|
-
const
|
|
6439
|
-
T.current =
|
|
6444
|
+
}, []), He = E((S) => {
|
|
6445
|
+
const N = Tt(S);
|
|
6446
|
+
T.current = N, C((R) => ({ path: N, seq: ((R == null ? void 0 : R.seq) ?? 0) + 1 })), g(!1), Pe("tree:expand", { path: N }) && (T.current = null);
|
|
6440
6447
|
}, [Pe]), Ve = Y(() => ({
|
|
6441
6448
|
openFile: q,
|
|
6442
6449
|
openSurface: ce,
|
|
@@ -6446,47 +6453,47 @@ function Kl({
|
|
|
6446
6453
|
getSnapshot: ke
|
|
6447
6454
|
}), [He, ke, q, fe, ce]), Ie = E(() => {
|
|
6448
6455
|
var be;
|
|
6449
|
-
const
|
|
6456
|
+
const S = b.current, N = S ? S.panels.map((se) => ({
|
|
6450
6457
|
id: se.id,
|
|
6451
6458
|
component: String(se.component ?? ""),
|
|
6452
6459
|
params: se.params ?? void 0
|
|
6453
|
-
})) : [], R = ((be =
|
|
6460
|
+
})) : [], R = ((be = S == null ? void 0 : S.activePanel) == null ? void 0 : be.id) ?? null, G = L.current, ie = N.find((se) => se.id === R), ye = dr(ie, G);
|
|
6454
6461
|
return {
|
|
6455
6462
|
hydrationComplete: !0,
|
|
6456
6463
|
layout: null,
|
|
6457
6464
|
sidebar: { collapsed: !1, width: t },
|
|
6458
6465
|
panelSizes: {},
|
|
6459
6466
|
preferences: { theme: "dark" },
|
|
6460
|
-
panels:
|
|
6467
|
+
panels: N,
|
|
6461
6468
|
activePanel: R,
|
|
6462
6469
|
activeFile: ye,
|
|
6463
|
-
visibleFiles:
|
|
6470
|
+
visibleFiles: N.map((se) => dr(se, G)).filter((se) => se !== null),
|
|
6464
6471
|
dirtyFiles: {},
|
|
6465
6472
|
notifications: []
|
|
6466
6473
|
};
|
|
6467
6474
|
}, [t]), le = E(() => {
|
|
6468
|
-
const
|
|
6469
|
-
for (const
|
|
6470
|
-
|
|
6471
|
-
}, [Ie]), me =
|
|
6475
|
+
const S = Ie();
|
|
6476
|
+
for (const N of I.current)
|
|
6477
|
+
N(S);
|
|
6478
|
+
}, [Ie]), me = D(!1), Ne = E((S) => {
|
|
6472
6479
|
var R;
|
|
6473
|
-
if (
|
|
6480
|
+
if (b.current = S, z(S), !me.current) {
|
|
6474
6481
|
me.current = !0;
|
|
6475
6482
|
for (const G of d ?? [])
|
|
6476
|
-
|
|
6483
|
+
S.getPanel(G.id) || S.addPanel({ id: G.id, component: G.component, title: G.title, params: G.params });
|
|
6477
6484
|
}
|
|
6478
|
-
(R =
|
|
6479
|
-
const
|
|
6485
|
+
(R = F.current) == null || R.call(F, Ve);
|
|
6486
|
+
const N = () => {
|
|
6480
6487
|
var G;
|
|
6481
|
-
(G =
|
|
6488
|
+
(G = O.current) == null || G.call(O, ke()), le();
|
|
6482
6489
|
};
|
|
6483
|
-
|
|
6490
|
+
S.onDidAddPanel(N), S.onDidRemovePanel(N), S.onDidActivePanelChange(N), N();
|
|
6484
6491
|
}, [Ve, ke, le]), Te = E(
|
|
6485
|
-
async (
|
|
6492
|
+
async (S) => {
|
|
6486
6493
|
try {
|
|
6487
|
-
const
|
|
6488
|
-
if (!
|
|
6489
|
-
const R = Tt(
|
|
6494
|
+
const N = b.current;
|
|
6495
|
+
if (!N) return St("not-ready", "surface not ready");
|
|
6496
|
+
const R = Tt(S), G = {
|
|
6490
6497
|
kind: Ye,
|
|
6491
6498
|
target: R
|
|
6492
6499
|
}, ie = ae.current.resolve(G);
|
|
@@ -6497,21 +6504,21 @@ function Kl({
|
|
|
6497
6504
|
`surface resolver "${G.kind}" returned unknown panel "${ie.component}"`
|
|
6498
6505
|
);
|
|
6499
6506
|
const be = Xt(G, ie);
|
|
6500
|
-
|
|
6501
|
-
const se = Qt(ie.params, R), ge =
|
|
6502
|
-
return ge ? (ge.api.updateParameters(se), ge.api.setActive(), je()) : (
|
|
6507
|
+
L.current.add(be);
|
|
6508
|
+
const se = Qt(ie.params, R), ge = N.getPanel(be);
|
|
6509
|
+
return ge ? (ge.api.updateParameters(se), ge.api.setActive(), je()) : (N.addPanel({
|
|
6503
6510
|
id: be,
|
|
6504
6511
|
component: ie.component,
|
|
6505
6512
|
title: ie.title ?? R.split("/").pop() ?? R,
|
|
6506
6513
|
params: se
|
|
6507
6514
|
}), je());
|
|
6508
6515
|
}
|
|
6509
|
-
const ye = ur(
|
|
6516
|
+
const ye = ur(N, R);
|
|
6510
6517
|
return ye ? (ye.api.setActive(), je()) : St("NO_SURFACE_RESOLVER", `no registered surface resolver handles ${R}`);
|
|
6511
|
-
} catch (
|
|
6518
|
+
} catch (N) {
|
|
6512
6519
|
return St(
|
|
6513
6520
|
"INVALID_SURFACE_PATH",
|
|
6514
|
-
|
|
6521
|
+
N instanceof Error ? N.message : "failed to open file"
|
|
6515
6522
|
);
|
|
6516
6523
|
}
|
|
6517
6524
|
},
|
|
@@ -6527,60 +6534,60 @@ function Kl({
|
|
|
6527
6534
|
closeWorkbenchLeftPane: async () => (g(!0), je()),
|
|
6528
6535
|
showNotification: async () => je(),
|
|
6529
6536
|
navigateToLine: async () => je(),
|
|
6530
|
-
expandToFile: async (
|
|
6537
|
+
expandToFile: async (S) => (He(S), je()),
|
|
6531
6538
|
markDirty: () => {
|
|
6532
6539
|
},
|
|
6533
6540
|
markClean: () => {
|
|
6534
6541
|
},
|
|
6535
|
-
subscribe: (
|
|
6536
|
-
let R =
|
|
6537
|
-
return R || (R = /* @__PURE__ */ new Set(),
|
|
6538
|
-
R == null || R.delete(
|
|
6542
|
+
subscribe: (S, N) => {
|
|
6543
|
+
let R = A.current.get(S);
|
|
6544
|
+
return R || (R = /* @__PURE__ */ new Set(), A.current.set(S, R)), R.add(N), S === "tree:expand" && T.current && (N({ path: T.current }), T.current = null), () => {
|
|
6545
|
+
R == null || R.delete(N);
|
|
6539
6546
|
};
|
|
6540
6547
|
},
|
|
6541
|
-
select: (
|
|
6542
|
-
const R = (G) =>
|
|
6548
|
+
select: (S, N) => {
|
|
6549
|
+
const R = (G) => N(S(G));
|
|
6543
6550
|
return I.current.add(R), R(Ie()), () => {
|
|
6544
6551
|
I.current.delete(R);
|
|
6545
6552
|
};
|
|
6546
6553
|
}
|
|
6547
6554
|
}), [He, Te, Ie]), he = E(
|
|
6548
|
-
(
|
|
6555
|
+
(S) => {
|
|
6549
6556
|
if (m) return;
|
|
6550
|
-
|
|
6557
|
+
S.preventDefault(), S.currentTarget.setPointerCapture(S.pointerId), W.current = { startX: S.clientX, startWidth: v };
|
|
6551
6558
|
},
|
|
6552
6559
|
[m, v]
|
|
6553
6560
|
), ze = E(
|
|
6554
|
-
(
|
|
6555
|
-
const
|
|
6556
|
-
if (!
|
|
6557
|
-
const R =
|
|
6558
|
-
|
|
6561
|
+
(S) => {
|
|
6562
|
+
const N = W.current;
|
|
6563
|
+
if (!N) return;
|
|
6564
|
+
const R = S.clientX - N.startX, G = Math.max(n, Math.min(r, N.startWidth + R));
|
|
6565
|
+
k(G);
|
|
6559
6566
|
},
|
|
6560
6567
|
[n, r]
|
|
6561
|
-
), Ae = E((
|
|
6562
|
-
|
|
6568
|
+
), Ae = E((S) => {
|
|
6569
|
+
W.current && (W.current = null, S.currentTarget.releasePointerCapture(S.pointerId));
|
|
6563
6570
|
}, []), st = E(
|
|
6564
|
-
(
|
|
6571
|
+
(S) => {
|
|
6565
6572
|
if (m) return;
|
|
6566
|
-
const
|
|
6567
|
-
|
|
6573
|
+
const N = S.shiftKey ? 32 : 16;
|
|
6574
|
+
S.key === "ArrowLeft" ? (S.preventDefault(), k((R) => Math.max(n, R - N))) : S.key === "ArrowRight" ? (S.preventDefault(), k((R) => Math.min(r, R + N))) : S.key === "Home" ? (S.preventDefault(), k(n)) : S.key === "End" && (S.preventDefault(), k(r));
|
|
6568
6575
|
},
|
|
6569
6576
|
[m, n, r]
|
|
6570
6577
|
);
|
|
6571
|
-
return
|
|
6578
|
+
return M(() => {
|
|
6572
6579
|
if (o)
|
|
6573
6580
|
try {
|
|
6574
6581
|
localStorage.setItem(`${o}:sidebarWidth`, String(v));
|
|
6575
6582
|
} catch {
|
|
6576
6583
|
}
|
|
6577
|
-
}, [o, v]),
|
|
6584
|
+
}, [o, v]), M(() => {
|
|
6578
6585
|
if (o)
|
|
6579
6586
|
try {
|
|
6580
6587
|
localStorage.setItem(`${o}:sidebarCollapsed`, m ? "1" : "0");
|
|
6581
6588
|
} catch {
|
|
6582
6589
|
}
|
|
6583
|
-
}, [o, m]), /* @__PURE__ */
|
|
6590
|
+
}, [o, m]), /* @__PURE__ */ x(
|
|
6584
6591
|
"div",
|
|
6585
6592
|
{
|
|
6586
6593
|
ref: _,
|
|
@@ -6588,7 +6595,7 @@ function Kl({
|
|
|
6588
6595
|
className: oe("flex h-full min-h-0 w-full bg-background", p),
|
|
6589
6596
|
"data-testid": "surface-shell",
|
|
6590
6597
|
children: [
|
|
6591
|
-
m ? null : /* @__PURE__ */
|
|
6598
|
+
m ? null : /* @__PURE__ */ x(Me, { children: [
|
|
6592
6599
|
/* @__PURE__ */ u(
|
|
6593
6600
|
"aside",
|
|
6594
6601
|
{
|
|
@@ -6631,7 +6638,7 @@ function Kl({
|
|
|
6631
6638
|
}
|
|
6632
6639
|
)
|
|
6633
6640
|
] }),
|
|
6634
|
-
/* @__PURE__ */
|
|
6641
|
+
/* @__PURE__ */ x("div", { className: "relative min-w-0 flex-1", children: [
|
|
6635
6642
|
/* @__PURE__ */ u(
|
|
6636
6643
|
"div",
|
|
6637
6644
|
{
|
|
@@ -6649,7 +6656,7 @@ function Kl({
|
|
|
6649
6656
|
)
|
|
6650
6657
|
}
|
|
6651
6658
|
),
|
|
6652
|
-
/* @__PURE__ */
|
|
6659
|
+
/* @__PURE__ */ x(
|
|
6653
6660
|
"div",
|
|
6654
6661
|
{
|
|
6655
6662
|
className: "pointer-events-none absolute inset-x-0 top-0 flex items-center justify-between",
|
|
@@ -6674,7 +6681,7 @@ function Kl({
|
|
|
6674
6681
|
/* @__PURE__ */ u(
|
|
6675
6682
|
Yl,
|
|
6676
6683
|
{
|
|
6677
|
-
api:
|
|
6684
|
+
api: B,
|
|
6678
6685
|
collapsed: m,
|
|
6679
6686
|
onExpandFiles: () => g(!1)
|
|
6680
6687
|
}
|
|
@@ -6704,8 +6711,8 @@ function Yl({
|
|
|
6704
6711
|
collapsed: t,
|
|
6705
6712
|
onExpandFiles: n
|
|
6706
6713
|
}) {
|
|
6707
|
-
const [r, o] =
|
|
6708
|
-
return
|
|
6714
|
+
const [r, o] = j(!0);
|
|
6715
|
+
return M(() => {
|
|
6709
6716
|
if (!e) return;
|
|
6710
6717
|
const i = () => o(e.panels.length === 0);
|
|
6711
6718
|
i();
|
|
@@ -6713,8 +6720,8 @@ function Yl({
|
|
|
6713
6720
|
return () => {
|
|
6714
6721
|
a.dispose(), l.dispose();
|
|
6715
6722
|
};
|
|
6716
|
-
}, [e]), r ? /* @__PURE__ */
|
|
6717
|
-
/* @__PURE__ */
|
|
6723
|
+
}, [e]), r ? /* @__PURE__ */ x(Me, { children: [
|
|
6724
|
+
/* @__PURE__ */ x("div", { className: "pointer-events-none absolute inset-x-0 top-0 flex items-center gap-0.5 border-b border-[color:oklch(from_var(--border)_l_c_h/0.4)] bg-background px-1", style: { height: 44 }, children: [
|
|
6718
6725
|
t && /* @__PURE__ */ u(Fe, { label: "Show workspace menu", side: "right", children: /* @__PURE__ */ u(
|
|
6719
6726
|
xe,
|
|
6720
6727
|
{
|
|
@@ -6729,14 +6736,14 @@ function Yl({
|
|
|
6729
6736
|
) }),
|
|
6730
6737
|
/* @__PURE__ */ u("div", { className: "flex-1" })
|
|
6731
6738
|
] }),
|
|
6732
|
-
/* @__PURE__ */
|
|
6733
|
-
/* @__PURE__ */
|
|
6739
|
+
/* @__PURE__ */ x("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-start justify-center gap-2 px-6 pt-12 pb-10", children: [
|
|
6740
|
+
/* @__PURE__ */ x("div", { className: "flex items-center gap-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
|
|
6734
6741
|
/* @__PURE__ */ u("span", { className: "inline-block h-px w-3 bg-[color:var(--accent)]", "aria-hidden": "true" }),
|
|
6735
6742
|
"Workbench"
|
|
6736
6743
|
] }),
|
|
6737
6744
|
/* @__PURE__ */ u("div", { className: "text-[15px] font-medium tracking-tight text-foreground", children: "Nothing open yet" }),
|
|
6738
6745
|
/* @__PURE__ */ u("p", { className: "max-w-[280px] text-[12.5px] leading-relaxed text-muted-foreground/85", children: "Open a source item, or let the agent produce an artifact here." }),
|
|
6739
|
-
t && /* @__PURE__ */
|
|
6746
|
+
t && /* @__PURE__ */ x(
|
|
6740
6747
|
Oe,
|
|
6741
6748
|
{
|
|
6742
6749
|
type: "button",
|
|
@@ -6991,15 +6998,15 @@ function bu(e) {
|
|
|
6991
6998
|
return typeof t != "string" || !t.startsWith("boring.plugin.");
|
|
6992
6999
|
}
|
|
6993
7000
|
function wu(e) {
|
|
6994
|
-
const t = Mt(), n = fn(), r = Wt(), o = Tr(), i =
|
|
6995
|
-
|
|
7001
|
+
const t = Mt(), n = fn(), r = Wt(), o = Tr(), i = D(/* @__PURE__ */ new Map()), a = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Set()), s = D(/* @__PURE__ */ new Set()), [f, c] = j(0), d = D(!1);
|
|
7002
|
+
M(() => {
|
|
6996
7003
|
if (e.enabled === !1 || typeof EventSource > "u") return;
|
|
6997
7004
|
const p = (m) => {
|
|
6998
7005
|
const g = m.detail;
|
|
6999
7006
|
bu(g) && (d.current = !0, c((v) => v + 1));
|
|
7000
7007
|
};
|
|
7001
7008
|
return window.addEventListener($e, p), () => window.removeEventListener($e, p);
|
|
7002
|
-
}, [e.enabled]),
|
|
7009
|
+
}, [e.enabled]), M(() => {
|
|
7003
7010
|
if (e.enabled === !1 || typeof EventSource > "u") return;
|
|
7004
7011
|
const p = d.current;
|
|
7005
7012
|
if (d.current = !1, su(e.authHeaders)) {
|
|
@@ -7009,15 +7016,15 @@ function wu(e) {
|
|
|
7009
7016
|
return;
|
|
7010
7017
|
}
|
|
7011
7018
|
let m = !1;
|
|
7012
|
-
const g = ou(t, n, r, o), v = ko(wn(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId),
|
|
7019
|
+
const g = ou(t, n, r, o), v = ko(wn(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), k = new EventSource(v, { withCredentials: !0 }), b = (z) => {
|
|
7013
7020
|
(async () => {
|
|
7014
|
-
var
|
|
7021
|
+
var F, O;
|
|
7015
7022
|
let h, C = !1;
|
|
7016
7023
|
try {
|
|
7017
|
-
if (h = JSON.parse(
|
|
7024
|
+
if (h = JSON.parse(z.data), m || h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
|
|
7018
7025
|
h.replay && l.current.add(h.id);
|
|
7019
|
-
const
|
|
7020
|
-
if (
|
|
7026
|
+
const $ = p && h.replay === !0, I = i.current.get(h.id) ?? 0, L = a.current.get(h.id) ?? 0;
|
|
7027
|
+
if (!$ && h.revision <= Math.max(I, L)) return;
|
|
7021
7028
|
a.current.set(h.id, h.revision);
|
|
7022
7029
|
const T = fr(h, e.apiBaseUrl);
|
|
7023
7030
|
T && (C = !0, window.dispatchEvent(new CustomEvent($e, {
|
|
@@ -7029,16 +7036,16 @@ function wu(e) {
|
|
|
7029
7036
|
replay: h.replay
|
|
7030
7037
|
}
|
|
7031
7038
|
})));
|
|
7032
|
-
let
|
|
7039
|
+
let A = null;
|
|
7033
7040
|
try {
|
|
7034
|
-
|
|
7041
|
+
A = T ? await pu({
|
|
7035
7042
|
pluginId: h.id,
|
|
7036
7043
|
frontEntryUrl: T,
|
|
7037
7044
|
revision: h.revision,
|
|
7038
7045
|
importFront: e.importFront,
|
|
7039
7046
|
isStale: () => m || a.current.get(h.id) !== h.revision,
|
|
7040
|
-
...((
|
|
7041
|
-
...((
|
|
7047
|
+
...((F = e.frontImportRetry) == null ? void 0 : F.attempts) !== void 0 ? { attempts: e.frontImportRetry.attempts } : {},
|
|
7048
|
+
...((O = e.frontImportRetry) == null ? void 0 : O.delayMs) !== void 0 ? { delayMs: e.frontImportRetry.delayMs } : {}
|
|
7042
7049
|
}) : null;
|
|
7043
7050
|
} catch (J) {
|
|
7044
7051
|
throw {
|
|
@@ -7046,13 +7053,13 @@ function wu(e) {
|
|
|
7046
7053
|
error: J
|
|
7047
7054
|
};
|
|
7048
7055
|
}
|
|
7049
|
-
if (m || a.current.get(h.id) !== h.revision ||
|
|
7050
|
-
if (!
|
|
7056
|
+
if (m || a.current.get(h.id) !== h.revision || !$ && h.revision <= (i.current.get(h.id) ?? 0)) return;
|
|
7057
|
+
if (!A) {
|
|
7051
7058
|
s.current.has(h.id) && (kt(h.id, g), s.current.delete(h.id)), i.current.set(h.id, h.revision);
|
|
7052
7059
|
return;
|
|
7053
7060
|
}
|
|
7054
7061
|
try {
|
|
7055
|
-
yu(h.id, h.revision,
|
|
7062
|
+
yu(h.id, h.revision, A, g);
|
|
7056
7063
|
} catch (J) {
|
|
7057
7064
|
throw {
|
|
7058
7065
|
stage: "register",
|
|
@@ -7060,16 +7067,16 @@ function wu(e) {
|
|
|
7060
7067
|
};
|
|
7061
7068
|
}
|
|
7062
7069
|
s.current.add(h.id), i.current.set(h.id, h.revision), window.dispatchEvent(new CustomEvent($e, { detail: h }));
|
|
7063
|
-
} catch (
|
|
7070
|
+
} catch ($) {
|
|
7064
7071
|
h && a.current.get(h.id) === h.revision && a.current.delete(h.id);
|
|
7065
|
-
const I = typeof
|
|
7072
|
+
const I = typeof $ == "object" && $ && "stage" in $ && $.stage === "register" ? "register" : "import", L = typeof $ == "object" && $ && "error" in $ ? $.error : $;
|
|
7066
7073
|
if (m) return;
|
|
7067
|
-
const T = (h == null ? void 0 : h.id) ?? "<malformed>",
|
|
7068
|
-
if (console.error(`[boring-ui] failed to load plugin ${T}; keeping previous version`,
|
|
7074
|
+
const T = (h == null ? void 0 : h.id) ?? "<malformed>", A = L instanceof Error ? L.message : String(L);
|
|
7075
|
+
if (console.error(`[boring-ui] failed to load plugin ${T}; keeping previous version`, L), h) {
|
|
7069
7076
|
const J = fr(h, e.apiBaseUrl), H = {
|
|
7070
7077
|
pluginId: h.id,
|
|
7071
7078
|
revision: h.revision,
|
|
7072
|
-
message:
|
|
7079
|
+
message: A,
|
|
7073
7080
|
...J ? { url: J } : {}
|
|
7074
7081
|
};
|
|
7075
7082
|
e.reportFrontError ? e.reportFrontError(H) : nu(e, H), window.dispatchEvent(new CustomEvent($e, {
|
|
@@ -7078,7 +7085,7 @@ function wu(e) {
|
|
|
7078
7085
|
id: h.id,
|
|
7079
7086
|
revision: h.revision,
|
|
7080
7087
|
workspaceId: h.workspaceId ?? e.workspaceId,
|
|
7081
|
-
message:
|
|
7088
|
+
message: A,
|
|
7082
7089
|
code: eu,
|
|
7083
7090
|
stage: I,
|
|
7084
7091
|
replay: h.replay
|
|
@@ -7097,21 +7104,21 @@ function wu(e) {
|
|
|
7097
7104
|
}));
|
|
7098
7105
|
}
|
|
7099
7106
|
})();
|
|
7100
|
-
}, _ = (
|
|
7107
|
+
}, _ = (z) => {
|
|
7101
7108
|
if (!m)
|
|
7102
7109
|
try {
|
|
7103
|
-
const h = JSON.parse(
|
|
7110
|
+
const h = JSON.parse(z.data);
|
|
7104
7111
|
if (h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
|
|
7105
|
-
const C = i.current.get(h.id) ?? 0,
|
|
7106
|
-
if (h.revision <= Math.max(C,
|
|
7112
|
+
const C = i.current.get(h.id) ?? 0, F = a.current.get(h.id) ?? 0;
|
|
7113
|
+
if (h.revision <= Math.max(C, F)) return;
|
|
7107
7114
|
a.current.set(h.id, h.revision), s.current.has(h.id) && (kt(h.id, g), s.current.delete(h.id)), i.current.set(h.id, h.revision), window.dispatchEvent(new CustomEvent($e, { detail: h }));
|
|
7108
7115
|
} catch (h) {
|
|
7109
7116
|
console.error("[boring-ui] failed to process plugin unload event", h);
|
|
7110
7117
|
}
|
|
7111
|
-
},
|
|
7118
|
+
}, W = (z) => {
|
|
7112
7119
|
if (!m)
|
|
7113
7120
|
try {
|
|
7114
|
-
const h = JSON.parse(
|
|
7121
|
+
const h = JSON.parse(z.data);
|
|
7115
7122
|
if (h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
|
|
7116
7123
|
console.error(`[boring-ui] plugin ${h.id} failed to reload: ${h.message}`), window.dispatchEvent(new CustomEvent($e, {
|
|
7117
7124
|
detail: {
|
|
@@ -7125,18 +7132,18 @@ function wu(e) {
|
|
|
7125
7132
|
} catch (h) {
|
|
7126
7133
|
console.error("[boring-ui] failed to process plugin error event", h);
|
|
7127
7134
|
}
|
|
7128
|
-
},
|
|
7135
|
+
}, B = (z) => {
|
|
7129
7136
|
if (!m)
|
|
7130
7137
|
try {
|
|
7131
|
-
const h = JSON.parse(
|
|
7138
|
+
const h = JSON.parse(z.data);
|
|
7132
7139
|
if (h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
|
|
7133
7140
|
const C = l.current;
|
|
7134
|
-
for (const [
|
|
7135
|
-
C.has(
|
|
7141
|
+
for (const [F, O] of i.current.entries())
|
|
7142
|
+
C.has(F) || (s.current.has(F) && (kt(F, g), s.current.delete(F)), i.current.delete(F), a.current.delete(F), window.dispatchEvent(new CustomEvent($e, {
|
|
7136
7143
|
detail: {
|
|
7137
7144
|
type: "boring.plugin.unload",
|
|
7138
|
-
id:
|
|
7139
|
-
revision:
|
|
7145
|
+
id: F,
|
|
7146
|
+
revision: O + 1,
|
|
7140
7147
|
workspaceId: h.workspaceId ?? e.workspaceId,
|
|
7141
7148
|
replay: !0
|
|
7142
7149
|
}
|
|
@@ -7146,12 +7153,12 @@ function wu(e) {
|
|
|
7146
7153
|
console.error("[boring-ui] failed to process plugin replay-complete event", h);
|
|
7147
7154
|
}
|
|
7148
7155
|
};
|
|
7149
|
-
return
|
|
7156
|
+
return k.addEventListener("boring.plugin.load", b), k.addEventListener("boring.plugin.unload", _), k.addEventListener("boring.plugin.error", W), k.addEventListener("boring.plugin.replay-complete", B), () => {
|
|
7150
7157
|
if (m = !0, !d.current) {
|
|
7151
|
-
for (const
|
|
7158
|
+
for (const z of s.current) kt(z, g);
|
|
7152
7159
|
s.current.clear(), i.current.clear(), a.current.clear(), l.current.clear();
|
|
7153
7160
|
}
|
|
7154
|
-
|
|
7161
|
+
k.close();
|
|
7155
7162
|
};
|
|
7156
7163
|
}, [e.apiBaseUrl, e.workspaceId, e.enabled, e.authHeaders, e.importFront, e.frontImportRetry, t, n, r, o, f]);
|
|
7157
7164
|
}
|
|
@@ -7187,7 +7194,7 @@ function Sd() {
|
|
|
7187
7194
|
return { theme: vn(), setTheme: e.setTheme, toggleTheme: e.toggleTheme };
|
|
7188
7195
|
}
|
|
7189
7196
|
function xd({ children: e, defaultTheme: t, onThemeChange: n }) {
|
|
7190
|
-
const r =
|
|
7197
|
+
const r = D(null);
|
|
7191
7198
|
if (!r.current) {
|
|
7192
7199
|
const f = oo({ persistenceEnabled: !1 });
|
|
7193
7200
|
Hr(f);
|
|
@@ -7203,7 +7210,7 @@ function xd({ children: e, defaultTheme: t, onThemeChange: n }) {
|
|
|
7203
7210
|
const f = o.getState().preferences.theme === "light" ? "dark" : "light";
|
|
7204
7211
|
i(f);
|
|
7205
7212
|
}, [o, i]), l = vn();
|
|
7206
|
-
|
|
7213
|
+
M(() => (document.documentElement.setAttribute("data-theme", l), () => {
|
|
7207
7214
|
document.documentElement.removeAttribute("data-theme");
|
|
7208
7215
|
}), [l]);
|
|
7209
7216
|
const s = Y(() => ({ setTheme: i, toggleTheme: a }), [i, a]);
|
|
@@ -7266,7 +7273,7 @@ function Tu({
|
|
|
7266
7273
|
}
|
|
7267
7274
|
function Ru({ commands: e }) {
|
|
7268
7275
|
const t = fn();
|
|
7269
|
-
return
|
|
7276
|
+
return M(() => {
|
|
7270
7277
|
if (!(e != null && e.length)) return;
|
|
7271
7278
|
const n = e.map((r) => r.id);
|
|
7272
7279
|
for (const r of n) t.unregisterCommand(r);
|
|
@@ -7281,7 +7288,7 @@ function Nu({
|
|
|
7281
7288
|
catalogs: e
|
|
7282
7289
|
}) {
|
|
7283
7290
|
const t = Wt();
|
|
7284
|
-
return
|
|
7291
|
+
return M(() => {
|
|
7285
7292
|
if (e != null && e.length) {
|
|
7286
7293
|
for (const n of e)
|
|
7287
7294
|
t.register(n, mr);
|
|
@@ -7325,7 +7332,7 @@ function Du({
|
|
|
7325
7332
|
}, i);
|
|
7326
7333
|
}
|
|
7327
7334
|
function _u({ onOpenFile: e }) {
|
|
7328
|
-
return
|
|
7335
|
+
return M(() => {
|
|
7329
7336
|
if (e)
|
|
7330
7337
|
return K.on(Ee.uiCommand, ({ command: t }) => {
|
|
7331
7338
|
if (t.kind !== "openFile") return;
|
|
@@ -7354,55 +7361,55 @@ function Pd({
|
|
|
7354
7361
|
workspaceId: m,
|
|
7355
7362
|
workspaceLabel: g,
|
|
7356
7363
|
storageKey: v,
|
|
7357
|
-
persistenceEnabled:
|
|
7358
|
-
manageDocumentTitle:
|
|
7364
|
+
persistenceEnabled: k = !0,
|
|
7365
|
+
manageDocumentTitle: b = !0,
|
|
7359
7366
|
bridgeEndpoint: _,
|
|
7360
|
-
onAuthError:
|
|
7361
|
-
onOpenFile:
|
|
7362
|
-
debug:
|
|
7367
|
+
onAuthError: W,
|
|
7368
|
+
onOpenFile: B,
|
|
7369
|
+
debug: z = !1,
|
|
7363
7370
|
frontPluginHotReload: h = !1,
|
|
7364
7371
|
fullPageBasePath: C
|
|
7365
7372
|
}) {
|
|
7366
|
-
const
|
|
7367
|
-
if (!
|
|
7373
|
+
const F = D(null);
|
|
7374
|
+
if (!F.current) {
|
|
7368
7375
|
const le = oo({
|
|
7369
7376
|
workspaceId: m,
|
|
7370
7377
|
storageKey: v,
|
|
7371
|
-
persistenceEnabled:
|
|
7378
|
+
persistenceEnabled: k
|
|
7372
7379
|
});
|
|
7373
7380
|
Hr(le);
|
|
7374
7381
|
const me = d ?? Po();
|
|
7375
|
-
me !== "light" && !
|
|
7382
|
+
me !== "light" && !k ? le.getState().setTheme(me) : me !== "light" && (typeof localStorage < "u" && localStorage.getItem("boring-ui-v2:preferences") !== null || le.getState().setTheme(me)), F.current = le;
|
|
7376
7383
|
}
|
|
7377
|
-
const
|
|
7384
|
+
const O = F.current, $ = D(null), I = D(f);
|
|
7378
7385
|
I.current = f;
|
|
7379
|
-
const
|
|
7380
|
-
|
|
7386
|
+
const L = D(W);
|
|
7387
|
+
L.current = W, M(() => () => {
|
|
7381
7388
|
var le;
|
|
7382
|
-
(le =
|
|
7383
|
-
}, [
|
|
7389
|
+
(le = $.current) == null || le.disconnect(), $.current = null, O.cleanup();
|
|
7390
|
+
}, [O]), M(() => {
|
|
7384
7391
|
var Te, Ze;
|
|
7385
|
-
if (
|
|
7386
|
-
const le = os(
|
|
7392
|
+
if ($.current && ($.current.disconnect(), $.current = null), !_) return;
|
|
7393
|
+
const le = os(O), me = (Ze = (Te = I.current) == null ? void 0 : Te.Authorization) == null ? void 0 : Ze.replace(/^Bearer\s+/i, ""), Ne = cs({
|
|
7387
7394
|
endpoint: _,
|
|
7388
7395
|
bridge: le,
|
|
7389
|
-
store:
|
|
7396
|
+
store: O,
|
|
7390
7397
|
authToken: me,
|
|
7391
7398
|
onAuthError: (he) => {
|
|
7392
7399
|
var ze;
|
|
7393
|
-
return (ze =
|
|
7400
|
+
return (ze = L.current) == null ? void 0 : ze.call(L, he);
|
|
7394
7401
|
},
|
|
7395
7402
|
onConnectionChange: He
|
|
7396
7403
|
});
|
|
7397
|
-
return Ne.connect(),
|
|
7398
|
-
Ne.disconnect(),
|
|
7404
|
+
return Ne.connect(), $.current = Ne, () => {
|
|
7405
|
+
Ne.disconnect(), $.current = null;
|
|
7399
7406
|
};
|
|
7400
|
-
}, [_,
|
|
7401
|
-
const { panelRegistry: T, commandRegistry:
|
|
7407
|
+
}, [_, O]);
|
|
7408
|
+
const { panelRegistry: T, commandRegistry: A, catalogRegistry: J, surfaceResolverRegistry: H, pluginMetas: te, pluginsWithBindings: X } = Y(() => {
|
|
7402
7409
|
const le = new ma(l), me = new Fc(), Ne = new Er(), Te = new Ir();
|
|
7403
|
-
for (const
|
|
7404
|
-
const { id:
|
|
7405
|
-
le.register(
|
|
7410
|
+
for (const S of Zl) {
|
|
7411
|
+
const { id: N, ...R } = S;
|
|
7412
|
+
le.register(N, R);
|
|
7406
7413
|
}
|
|
7407
7414
|
const he = new Set(r ?? []).has(Vn.pluginId) ? [] : [Vn], Ae = zi({
|
|
7408
7415
|
chatPanel: t ?? xu,
|
|
@@ -7413,15 +7420,15 @@ function Pd({
|
|
|
7413
7420
|
}), st = [
|
|
7414
7421
|
{ id: "workspace:chat-layout", label: "Layout" },
|
|
7415
7422
|
{ id: "agent:chat-layout", label: "Layout" },
|
|
7416
|
-
...Ae.plugins.map((
|
|
7417
|
-
id:
|
|
7418
|
-
label:
|
|
7423
|
+
...Ae.plugins.map((S) => ({
|
|
7424
|
+
id: S.id,
|
|
7425
|
+
label: S.label
|
|
7419
7426
|
}))
|
|
7420
7427
|
];
|
|
7421
7428
|
if (o)
|
|
7422
|
-
for (const
|
|
7423
|
-
const { id:
|
|
7424
|
-
le.register(
|
|
7429
|
+
for (const S of o) {
|
|
7430
|
+
const { id: N, ...R } = S;
|
|
7431
|
+
le.register(N, R);
|
|
7425
7432
|
}
|
|
7426
7433
|
return {
|
|
7427
7434
|
panelRegistry: le,
|
|
@@ -7431,19 +7438,19 @@ function Pd({
|
|
|
7431
7438
|
pluginMetas: st,
|
|
7432
7439
|
pluginsWithBindings: Ae.plugins
|
|
7433
7440
|
};
|
|
7434
|
-
}, [l, t, n, r, o]), ae =
|
|
7441
|
+
}, [l, t, n, r, o]), ae = D(p);
|
|
7435
7442
|
ae.current = p;
|
|
7436
7443
|
const ue = E(
|
|
7437
7444
|
(le) => {
|
|
7438
7445
|
var me;
|
|
7439
|
-
|
|
7446
|
+
O.getState().setTheme(le), (me = ae.current) == null || me.call(ae, le);
|
|
7440
7447
|
},
|
|
7441
|
-
[
|
|
7448
|
+
[O]
|
|
7442
7449
|
), q = E(() => {
|
|
7443
|
-
const le =
|
|
7450
|
+
const le = O.getState().preferences.theme === "light" ? "dark" : "light";
|
|
7444
7451
|
ue(le);
|
|
7445
|
-
}, [
|
|
7446
|
-
|
|
7452
|
+
}, [O, ue]), ce = vn();
|
|
7453
|
+
M(() => (document.documentElement.setAttribute("data-theme", ce), () => {
|
|
7447
7454
|
document.documentElement.removeAttribute("data-theme");
|
|
7448
7455
|
}), [ce]);
|
|
7449
7456
|
const fe = Y(
|
|
@@ -7453,35 +7460,35 @@ function Pd({
|
|
|
7453
7460
|
() => Fu(m, f),
|
|
7454
7461
|
[f, m]
|
|
7455
7462
|
);
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
}, [
|
|
7459
|
-
const [Pe, He] =
|
|
7463
|
+
M(() => {
|
|
7464
|
+
b && (document.title = Su({ workspaceLabel: g, workspaceId: m }));
|
|
7465
|
+
}, [b, m, g]);
|
|
7466
|
+
const [Pe, He] = j(!1), Ve = Y(
|
|
7460
7467
|
() => ({ connected: Pe }),
|
|
7461
7468
|
[Pe]
|
|
7462
7469
|
), Ie = Y(
|
|
7463
|
-
() => ({ chatPanel: t ?? null, registeredPlugins: te, debug:
|
|
7464
|
-
[t, te,
|
|
7470
|
+
() => ({ chatPanel: t ?? null, registeredPlugins: te, debug: z }),
|
|
7471
|
+
[t, te, z]
|
|
7465
7472
|
);
|
|
7466
7473
|
return /* @__PURE__ */ u(xn.Provider, { value: Ie, children: /* @__PURE__ */ u(Sn.Provider, { value: fe, children: /* @__PURE__ */ u(Co.Provider, { value: Ve, children: /* @__PURE__ */ u($c, { basePath: C, children: /* @__PURE__ */ u(wl, { children: /* @__PURE__ */ u(Vi, { children: /* @__PURE__ */ u(
|
|
7467
7474
|
Bi,
|
|
7468
7475
|
{
|
|
7469
7476
|
panelRegistry: T,
|
|
7470
|
-
commandRegistry:
|
|
7477
|
+
commandRegistry: A,
|
|
7471
7478
|
catalogRegistry: J,
|
|
7472
7479
|
surfaceResolverRegistry: H,
|
|
7473
|
-
children: /* @__PURE__ */ u(da, { apiBaseUrl: s, workspaceId: m, authHeaders: ke, children: /* @__PURE__ */
|
|
7480
|
+
children: /* @__PURE__ */ u(da, { apiBaseUrl: s, workspaceId: m, authHeaders: ke, children: /* @__PURE__ */ x(
|
|
7474
7481
|
Du,
|
|
7475
7482
|
{
|
|
7476
7483
|
plugins: X,
|
|
7477
7484
|
apiBaseUrl: s,
|
|
7478
7485
|
authHeaders: ke,
|
|
7479
|
-
onAuthError:
|
|
7486
|
+
onAuthError: W,
|
|
7480
7487
|
apiTimeout: c,
|
|
7481
7488
|
children: [
|
|
7482
7489
|
/* @__PURE__ */ u(Au, { plugins: X }),
|
|
7483
7490
|
/* @__PURE__ */ u(ku, { apiBaseUrl: s, workspaceId: m, mode: h, authHeaders: ke }),
|
|
7484
|
-
/* @__PURE__ */ u(_u, { onOpenFile:
|
|
7491
|
+
/* @__PURE__ */ u(_u, { onOpenFile: B }),
|
|
7485
7492
|
/* @__PURE__ */ u(Ru, { commands: i }),
|
|
7486
7493
|
/* @__PURE__ */ u(
|
|
7487
7494
|
Nu,
|
|
@@ -7489,7 +7496,7 @@ function Pd({
|
|
|
7489
7496
|
catalogs: a
|
|
7490
7497
|
}
|
|
7491
7498
|
),
|
|
7492
|
-
/* @__PURE__ */ u(Tu, { store:
|
|
7499
|
+
/* @__PURE__ */ u(Tu, { store: O }),
|
|
7493
7500
|
/* @__PURE__ */ u(nl, {}),
|
|
7494
7501
|
/* @__PURE__ */ u(Pi, {}),
|
|
7495
7502
|
e,
|
|
@@ -7544,9 +7551,9 @@ export {
|
|
|
7544
7551
|
fd as aB,
|
|
7545
7552
|
yd as aC,
|
|
7546
7553
|
vd as aD,
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7554
|
+
tn as aE,
|
|
7555
|
+
Fi as aF,
|
|
7556
|
+
$e as aG,
|
|
7550
7557
|
dl as aH,
|
|
7551
7558
|
sd as aI,
|
|
7552
7559
|
wd as aJ,
|