nexus-shell 0.2.2 → 0.2.3
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/README.md +2 -2
- package/dist/components/widgets/TreeWidget.d.ts +89 -44
- package/dist/nexus-shell.es.js +581 -606
- package/dist/nexus-shell.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/nexus-shell.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var Ee = Object.defineProperty;
|
|
2
2
|
var Ie = (o, e, n) => e in o ? Ee(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
|
|
3
|
-
var
|
|
3
|
+
var J = (o, e, n) => Ie(o, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { jsxs as c, jsx as r, Fragment as he } from "react/jsx-runtime";
|
|
5
|
-
import se, { useMemo as
|
|
6
|
-
import { Model as
|
|
5
|
+
import se, { useMemo as j, useState as A, useRef as M, useEffect as O } from "react";
|
|
6
|
+
import { Model as K, Actions as G, DockLocation as Oe, Layout as Ae } from "flexlayout-react";
|
|
7
7
|
import "flexlayout-react/style/light.css";
|
|
8
|
-
import { Settings as
|
|
9
|
-
import { clsx as
|
|
10
|
-
import { twMerge as
|
|
8
|
+
import { Settings as Le, MessageCircle as be, X as B, User as xe, Terminal as ve, Send as ze, ChevronRight as ye, Sun as Me, Moon as Pe, GraduationCap as Re, ChevronUp as we, Search as X, Info as Ke, HelpCircle as $e, AlertCircle as je, Check as Fe, Camera as Ue, Edit2 as _e, Loader2 as Ne, ChevronsUpDown as Be, ChevronDown as ke, Clock as Je } from "lucide-react";
|
|
9
|
+
import { clsx as He } from "clsx";
|
|
10
|
+
import { twMerge as We } from "tailwind-merge";
|
|
11
11
|
import { create as U } from "zustand";
|
|
12
|
-
import { TableVirtuoso as
|
|
12
|
+
import { TableVirtuoso as Ge, Virtuoso as Ve } from "react-virtuoso";
|
|
13
13
|
function S(...o) {
|
|
14
|
-
return
|
|
14
|
+
return We(He(o));
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
{ id: "settings", label: "Settings", icon:
|
|
18
|
-
],
|
|
16
|
+
const Ye = [
|
|
17
|
+
{ id: "settings", label: "Settings", icon: Le }
|
|
18
|
+
], qe = ({
|
|
19
19
|
items: o = [],
|
|
20
|
-
bottomItems: e =
|
|
20
|
+
bottomItems: e = Ye,
|
|
21
21
|
activeId: n = null,
|
|
22
22
|
onSelect: t,
|
|
23
23
|
className: a,
|
|
@@ -68,13 +68,13 @@ const tt = [
|
|
|
68
68
|
}),
|
|
69
69
|
setPanels: (t) => o({ panels: t })
|
|
70
70
|
};
|
|
71
|
-
}),
|
|
72
|
-
const e = F((s) => s.panels), n = F((s) => s.activeSidebar), t = F((s) => s.toggleSidebar), a =
|
|
71
|
+
}), Qe = (o) => {
|
|
72
|
+
const e = F((s) => s.panels), n = F((s) => s.activeSidebar), t = F((s) => s.toggleSidebar), a = j(
|
|
73
73
|
() => e.map(({ id: s, label: l, icon: u }) => ({ id: s, label: l, icon: u })),
|
|
74
74
|
[e]
|
|
75
75
|
);
|
|
76
76
|
return /* @__PURE__ */ r(
|
|
77
|
-
|
|
77
|
+
qe,
|
|
78
78
|
{
|
|
79
79
|
...o,
|
|
80
80
|
items: a,
|
|
@@ -82,7 +82,7 @@ const tt = [
|
|
|
82
82
|
onSelect: t
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
|
-
},
|
|
85
|
+
}, Xe = /* @__PURE__ */ c("div", { className: "h-full flex flex-col items-center justify-center text-center px-6 text-muted-foreground", children: [
|
|
86
86
|
/* @__PURE__ */ r(be, { size: 28, className: "mb-3 opacity-40" }),
|
|
87
87
|
/* @__PURE__ */ r("p", { className: "text-xs", children: "No messages yet." }),
|
|
88
88
|
/* @__PURE__ */ c("p", { className: "text-[11px] mt-1 opacity-70", children: [
|
|
@@ -90,7 +90,7 @@ const tt = [
|
|
|
90
90
|
/* @__PURE__ */ r("span", { className: "font-mono", children: "/" }),
|
|
91
91
|
" for commands."
|
|
92
92
|
] })
|
|
93
|
-
] }),
|
|
93
|
+
] }), Ze = ({
|
|
94
94
|
messages: o = [],
|
|
95
95
|
onSend: e,
|
|
96
96
|
slashCommands: n = [],
|
|
@@ -98,39 +98,39 @@ const tt = [
|
|
|
98
98
|
onClose: a,
|
|
99
99
|
title: s = "Chat",
|
|
100
100
|
placeholder: l = "Send a message…",
|
|
101
|
-
emptyState: u =
|
|
101
|
+
emptyState: u = Xe,
|
|
102
102
|
className: i
|
|
103
103
|
}) => {
|
|
104
|
-
const [d,
|
|
105
|
-
(
|
|
106
|
-
) : [], h =
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}, [o]),
|
|
110
|
-
|
|
104
|
+
const [d, m] = A(""), [f, p] = A(0), N = M(null), k = M(null), w = d.startsWith("/") ? n.filter(
|
|
105
|
+
(g) => `/${g.command}`.startsWith(d.toLowerCase().split(" ")[0])
|
|
106
|
+
) : [], h = w.length > 0;
|
|
107
|
+
O(() => {
|
|
108
|
+
k.current && (k.current.scrollTop = k.current.scrollHeight);
|
|
109
|
+
}, [o]), O(() => {
|
|
110
|
+
p(0);
|
|
111
111
|
}, [d]);
|
|
112
|
-
const
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
var
|
|
117
|
-
t == null || t(
|
|
118
|
-
},
|
|
112
|
+
const x = () => {
|
|
113
|
+
const g = d.trim();
|
|
114
|
+
g && (e == null || e(g), m(""));
|
|
115
|
+
}, b = (g) => {
|
|
116
|
+
var C;
|
|
117
|
+
t == null || t(g), m(`/${g.command} `), (C = N.current) == null || C.focus();
|
|
118
|
+
}, y = (g) => {
|
|
119
119
|
if (h) {
|
|
120
|
-
if (
|
|
121
|
-
|
|
120
|
+
if (g.key === "ArrowDown") {
|
|
121
|
+
g.preventDefault(), p((C) => (C + 1) % w.length);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
|
|
124
|
+
if (g.key === "ArrowUp") {
|
|
125
|
+
g.preventDefault(), p((C) => (C - 1 + w.length) % w.length);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
if (
|
|
129
|
-
|
|
128
|
+
if (g.key === "Tab" || g.key === "Enter" && !g.shiftKey) {
|
|
129
|
+
g.preventDefault(), b(w[f]);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
g.key === "Enter" && !g.shiftKey && (g.preventDefault(), x());
|
|
134
134
|
};
|
|
135
135
|
return /* @__PURE__ */ c(
|
|
136
136
|
"aside",
|
|
@@ -154,41 +154,41 @@ const tt = [
|
|
|
154
154
|
onClick: a,
|
|
155
155
|
"aria-label": "Close Chat",
|
|
156
156
|
className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
157
|
-
children: /* @__PURE__ */ r(
|
|
157
|
+
children: /* @__PURE__ */ r(B, { size: 14 })
|
|
158
158
|
}
|
|
159
159
|
)
|
|
160
160
|
] }),
|
|
161
161
|
/* @__PURE__ */ r(
|
|
162
162
|
"div",
|
|
163
163
|
{
|
|
164
|
-
ref:
|
|
164
|
+
ref: k,
|
|
165
165
|
role: "log",
|
|
166
166
|
"aria-label": `${s} transcript`,
|
|
167
167
|
className: "flex-1 overflow-y-auto border-t border-border/50 bg-background/50 px-3 py-3 space-y-3",
|
|
168
|
-
children: o.length === 0 ? u : o.map((
|
|
169
|
-
const
|
|
168
|
+
children: o.length === 0 ? u : o.map((g) => {
|
|
169
|
+
const C = g.role === "user";
|
|
170
170
|
return /* @__PURE__ */ c(
|
|
171
171
|
"div",
|
|
172
172
|
{
|
|
173
|
-
className: S("flex flex-col",
|
|
173
|
+
className: S("flex flex-col", C ? "items-end" : "items-start"),
|
|
174
174
|
children: [
|
|
175
175
|
/* @__PURE__ */ c("div", { className: "flex items-center space-x-1 mb-1 text-[10px] uppercase tracking-wider text-muted-foreground font-bold", children: [
|
|
176
|
-
|
|
177
|
-
/* @__PURE__ */ r("span", { children:
|
|
176
|
+
C ? /* @__PURE__ */ r(xe, { size: 10 }) : /* @__PURE__ */ r(ve, { size: 10 }),
|
|
177
|
+
/* @__PURE__ */ r("span", { children: g.author ?? (C ? "You" : "Assistant") })
|
|
178
178
|
] }),
|
|
179
179
|
/* @__PURE__ */ r(
|
|
180
180
|
"div",
|
|
181
181
|
{
|
|
182
182
|
className: S(
|
|
183
183
|
"max-w-[85%] rounded-lg px-3 py-2 text-xs whitespace-pre-wrap break-words",
|
|
184
|
-
|
|
184
|
+
C ? "bg-primary text-primary-foreground" : "bg-card border border-border text-foreground"
|
|
185
185
|
),
|
|
186
|
-
children:
|
|
186
|
+
children: g.text
|
|
187
187
|
}
|
|
188
188
|
)
|
|
189
189
|
]
|
|
190
190
|
},
|
|
191
|
-
|
|
191
|
+
g.id
|
|
192
192
|
);
|
|
193
193
|
})
|
|
194
194
|
}
|
|
@@ -200,26 +200,26 @@ const tt = [
|
|
|
200
200
|
role: "listbox",
|
|
201
201
|
"aria-label": "Slash commands",
|
|
202
202
|
className: "absolute bottom-full left-2 right-2 mb-1 bg-popover border border-border rounded-md shadow-lg overflow-hidden z-20",
|
|
203
|
-
children:
|
|
203
|
+
children: w.map((g, C) => /* @__PURE__ */ c(
|
|
204
204
|
"div",
|
|
205
205
|
{
|
|
206
206
|
role: "option",
|
|
207
|
-
"aria-selected":
|
|
208
|
-
onMouseEnter: () =>
|
|
209
|
-
onClick: () =>
|
|
207
|
+
"aria-selected": C === f,
|
|
208
|
+
onMouseEnter: () => p(C),
|
|
209
|
+
onClick: () => b(g),
|
|
210
210
|
className: S(
|
|
211
211
|
"px-3 py-1.5 text-xs cursor-pointer flex items-baseline justify-between gap-3",
|
|
212
|
-
|
|
212
|
+
C === f ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
|
|
213
213
|
),
|
|
214
214
|
children: [
|
|
215
215
|
/* @__PURE__ */ c("span", { className: "font-mono", children: [
|
|
216
216
|
"/",
|
|
217
|
-
|
|
217
|
+
g.command
|
|
218
218
|
] }),
|
|
219
|
-
/* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground truncate", children:
|
|
219
|
+
/* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground truncate", children: g.description })
|
|
220
220
|
]
|
|
221
221
|
},
|
|
222
|
-
|
|
222
|
+
g.command
|
|
223
223
|
))
|
|
224
224
|
}
|
|
225
225
|
),
|
|
@@ -227,13 +227,13 @@ const tt = [
|
|
|
227
227
|
/* @__PURE__ */ r(
|
|
228
228
|
"textarea",
|
|
229
229
|
{
|
|
230
|
-
ref:
|
|
230
|
+
ref: N,
|
|
231
231
|
rows: 1,
|
|
232
232
|
value: d,
|
|
233
233
|
"aria-label": `${s} message`,
|
|
234
234
|
placeholder: l,
|
|
235
|
-
onChange: (
|
|
236
|
-
onKeyDown:
|
|
235
|
+
onChange: (g) => m(g.target.value),
|
|
236
|
+
onKeyDown: y,
|
|
237
237
|
className: "flex-1 resize-none bg-background border border-border rounded-md px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50 max-h-32"
|
|
238
238
|
}
|
|
239
239
|
),
|
|
@@ -241,11 +241,11 @@ const tt = [
|
|
|
241
241
|
"button",
|
|
242
242
|
{
|
|
243
243
|
type: "button",
|
|
244
|
-
onClick:
|
|
244
|
+
onClick: x,
|
|
245
245
|
disabled: !d.trim(),
|
|
246
246
|
"aria-label": "Send message",
|
|
247
247
|
className: "p-2 rounded-md bg-primary text-primary-foreground disabled:opacity-40 disabled:cursor-not-allowed hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
248
|
-
children: /* @__PURE__ */ r(
|
|
248
|
+
children: /* @__PURE__ */ r(ze, { size: 14 })
|
|
249
249
|
}
|
|
250
250
|
)
|
|
251
251
|
] })
|
|
@@ -254,13 +254,13 @@ const tt = [
|
|
|
254
254
|
}
|
|
255
255
|
);
|
|
256
256
|
};
|
|
257
|
-
let
|
|
258
|
-
const
|
|
257
|
+
let et = 0;
|
|
258
|
+
const tt = () => `msg-${Date.now()}-${et += 1}`, Q = U((o) => ({
|
|
259
259
|
messages: [],
|
|
260
260
|
slashCommands: [],
|
|
261
261
|
setMessages: (e) => o({ messages: e }),
|
|
262
262
|
addMessage: (e) => o((n) => ({
|
|
263
|
-
messages: [...n.messages, { ...e, id: e.id ??
|
|
263
|
+
messages: [...n.messages, { ...e, id: e.id ?? tt() }]
|
|
264
264
|
})),
|
|
265
265
|
clearMessages: () => o({ messages: [] }),
|
|
266
266
|
setSlashCommands: (e) => o({ slashCommands: e }),
|
|
@@ -274,19 +274,19 @@ const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
|
|
|
274
274
|
const a = !t.isChatOpen;
|
|
275
275
|
return localStorage.setItem(te, String(a)), { isChatOpen: a };
|
|
276
276
|
})
|
|
277
|
-
})),
|
|
277
|
+
})), rt = ({ onSend: o, ...e }) => {
|
|
278
278
|
const n = ae((i) => i.isChatOpen), t = ae((i) => i.setChatOpen), a = Q((i) => i.messages), s = Q((i) => i.slashCommands), l = Q((i) => i.addMessage);
|
|
279
279
|
return n ? /* @__PURE__ */ r(
|
|
280
|
-
|
|
280
|
+
Ze,
|
|
281
281
|
{
|
|
282
282
|
...e,
|
|
283
283
|
messages: a,
|
|
284
284
|
slashCommands: s,
|
|
285
285
|
onSend: (i) => {
|
|
286
286
|
if (l({ role: "user", text: i }), i.startsWith("/")) {
|
|
287
|
-
const [d, ...
|
|
288
|
-
if (
|
|
289
|
-
|
|
287
|
+
const [d, ...m] = i.slice(1).split(/\s+/), f = s.find((p) => p.command === d);
|
|
288
|
+
if (f) {
|
|
289
|
+
f.execute(m);
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
292
|
l({ role: "assistant", text: `Unknown command: /${d}` });
|
|
@@ -297,7 +297,7 @@ const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
|
|
|
297
297
|
onClose: () => t(!1)
|
|
298
298
|
}
|
|
299
299
|
) : null;
|
|
300
|
-
},
|
|
300
|
+
}, nt = ({
|
|
301
301
|
menus: o = {},
|
|
302
302
|
onSelect: e,
|
|
303
303
|
title: n,
|
|
@@ -317,8 +317,8 @@ const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
|
|
|
317
317
|
role: "menuitem",
|
|
318
318
|
tabIndex: 0,
|
|
319
319
|
onClick: () => !d.submenu && (e == null ? void 0 : e(d)),
|
|
320
|
-
onKeyDown: (
|
|
321
|
-
!d.submenu && (
|
|
320
|
+
onKeyDown: (m) => {
|
|
321
|
+
!d.submenu && (m.key === "Enter" || m.key === " ") && (m.preventDefault(), e == null || e(d));
|
|
322
322
|
},
|
|
323
323
|
className: "px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex justify-between items-center focus:outline-none focus:bg-accent",
|
|
324
324
|
children: [
|
|
@@ -335,22 +335,22 @@ const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
|
|
|
335
335
|
{
|
|
336
336
|
role: "menu",
|
|
337
337
|
className: "absolute left-full top-0 hidden group-hover/sub:block z-[60] min-w-[180px] bg-popover text-popover-foreground border shadow-md rounded-md py-1 ml-[-2px]",
|
|
338
|
-
children: d.submenu.map((
|
|
338
|
+
children: d.submenu.map((m) => /* @__PURE__ */ c(
|
|
339
339
|
"div",
|
|
340
340
|
{
|
|
341
341
|
role: "menuitem",
|
|
342
342
|
tabIndex: 0,
|
|
343
|
-
onClick: () => e == null ? void 0 : e(
|
|
344
|
-
onKeyDown: (
|
|
345
|
-
(
|
|
343
|
+
onClick: () => e == null ? void 0 : e(m),
|
|
344
|
+
onKeyDown: (f) => {
|
|
345
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), e == null || e(m));
|
|
346
346
|
},
|
|
347
347
|
className: "px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex justify-between items-center focus:outline-none focus:bg-accent",
|
|
348
348
|
children: [
|
|
349
|
-
/* @__PURE__ */ r("span", { children:
|
|
350
|
-
l(
|
|
349
|
+
/* @__PURE__ */ r("span", { children: m.label }),
|
|
350
|
+
l(m)
|
|
351
351
|
]
|
|
352
352
|
},
|
|
353
|
-
|
|
353
|
+
m.id
|
|
354
354
|
))
|
|
355
355
|
}
|
|
356
356
|
)
|
|
@@ -398,9 +398,9 @@ const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
|
|
|
398
398
|
}
|
|
399
399
|
);
|
|
400
400
|
};
|
|
401
|
-
class
|
|
401
|
+
class ot {
|
|
402
402
|
constructor() {
|
|
403
|
-
|
|
403
|
+
J(this, "menus", /* @__PURE__ */ new Map());
|
|
404
404
|
}
|
|
405
405
|
registerMenu(e, n) {
|
|
406
406
|
var t;
|
|
@@ -419,10 +419,10 @@ class ct {
|
|
|
419
419
|
}), e;
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
const le = new
|
|
423
|
-
class
|
|
422
|
+
const le = new ot();
|
|
423
|
+
class st {
|
|
424
424
|
constructor() {
|
|
425
|
-
|
|
425
|
+
J(this, "commands", /* @__PURE__ */ new Map());
|
|
426
426
|
}
|
|
427
427
|
registerCommand(e) {
|
|
428
428
|
if (this.commands.has(e.id)) {
|
|
@@ -442,11 +442,11 @@ class ut {
|
|
|
442
442
|
return Array.from(this.commands.values());
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
const
|
|
445
|
+
const W = new st(), Ce = (o) => o.map((e) => {
|
|
446
446
|
var n;
|
|
447
447
|
return {
|
|
448
448
|
...e,
|
|
449
|
-
keybinding: e.keybinding ?? (e.commandId ? (n =
|
|
449
|
+
keybinding: e.keybinding ?? (e.commandId ? (n = W.getCommand(e.commandId)) == null ? void 0 : n.keybinding : void 0),
|
|
450
450
|
submenu: e.submenu ? Ce(e.submenu) : void 0
|
|
451
451
|
};
|
|
452
452
|
}), Se = (o, e) => {
|
|
@@ -455,15 +455,15 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
455
455
|
const t = n.submenu && Se(n.submenu, e);
|
|
456
456
|
if (t) return t;
|
|
457
457
|
}
|
|
458
|
-
},
|
|
458
|
+
}, at = (o) => {
|
|
459
459
|
const e = le.getAllMenus(), n = Object.fromEntries(
|
|
460
460
|
Object.entries(e).map(([a, s]) => [a, Ce(s)])
|
|
461
461
|
);
|
|
462
|
-
return /* @__PURE__ */ r(
|
|
462
|
+
return /* @__PURE__ */ r(nt, { ...o, menus: n, onSelect: (a) => {
|
|
463
463
|
for (const s of Object.values(e)) {
|
|
464
464
|
const l = Se(s, a.id);
|
|
465
465
|
if (l != null && l.commandId) {
|
|
466
|
-
|
|
466
|
+
W.executeCommand(l.commandId);
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
469
|
}
|
|
@@ -494,21 +494,21 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
494
494
|
onClick: n,
|
|
495
495
|
"aria-label": "Close Panel",
|
|
496
496
|
className: "p-1 hover:bg-accent hover:text-foreground rounded transition-colors focus:outline-none focus:ring-2 focus:ring-ring shrink-0",
|
|
497
|
-
children: /* @__PURE__ */ r(
|
|
497
|
+
children: /* @__PURE__ */ r(B, { size: 14 })
|
|
498
498
|
}
|
|
499
499
|
)
|
|
500
500
|
] }),
|
|
501
501
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-auto border-t border-border/50 bg-background/50", children: e })
|
|
502
502
|
]
|
|
503
503
|
}
|
|
504
|
-
),
|
|
504
|
+
), lt = [
|
|
505
505
|
{ id: "light", label: "Light", icon: Me },
|
|
506
506
|
{ id: "dark", label: "Dark", icon: Pe },
|
|
507
|
-
{ id: "gt", label: "Georgia Tech", icon:
|
|
508
|
-
],
|
|
507
|
+
{ id: "gt", label: "Georgia Tech", icon: Re }
|
|
508
|
+
], it = ({
|
|
509
509
|
theme: o,
|
|
510
510
|
onThemeChange: e,
|
|
511
|
-
themes: n =
|
|
511
|
+
themes: n = lt,
|
|
512
512
|
className: t
|
|
513
513
|
}) => /* @__PURE__ */ r("div", { className: S("p-4 space-y-6", t), children: /* @__PURE__ */ c("section", { children: [
|
|
514
514
|
/* @__PURE__ */ r("h3", { className: "text-[11px] font-bold text-muted-foreground uppercase mb-3", children: "Theme" }),
|
|
@@ -549,13 +549,13 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
549
549
|
localStorage.setItem(ue, t), me(t), o({ theme: t });
|
|
550
550
|
}
|
|
551
551
|
};
|
|
552
|
-
}),
|
|
552
|
+
}), dt = (o) => {
|
|
553
553
|
const e = F((d) => d.activeSidebar), n = F((d) => d.panels), t = F((d) => d.setActiveSidebar), a = Y((d) => d.theme), s = Y((d) => d.setTheme);
|
|
554
554
|
if (!e) return null;
|
|
555
555
|
const l = () => t(null);
|
|
556
556
|
if (e === "settings")
|
|
557
557
|
return /* @__PURE__ */ r(re, { ...o, title: "Settings", onClose: l, children: /* @__PURE__ */ r(
|
|
558
|
-
|
|
558
|
+
it,
|
|
559
559
|
{
|
|
560
560
|
theme: a,
|
|
561
561
|
onThemeChange: (d) => s(d)
|
|
@@ -566,7 +566,7 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
566
566
|
return /* @__PURE__ */ r(re, { ...o, title: e, onClose: l, children: /* @__PURE__ */ r("div", { className: "p-4 text-sm italic text-muted-foreground", children: "Panel content not found." }) });
|
|
567
567
|
const i = typeof u.component == "function" ? u.component : null;
|
|
568
568
|
return /* @__PURE__ */ r(re, { ...o, title: u.label, onClose: l, children: i ? /* @__PURE__ */ r(i, {}) : u.component });
|
|
569
|
-
}, ne = (o, e) => (e.priority ?? 0) - (o.priority ?? 0),
|
|
569
|
+
}, ne = (o, e) => (e.priority ?? 0) - (o.priority ?? 0), ct = ({
|
|
570
570
|
widgets: o = [],
|
|
571
571
|
className: e,
|
|
572
572
|
"aria-label": n = "Status Bar"
|
|
@@ -630,16 +630,16 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
630
630
|
updateWidget: (e, n) => o((t) => ({
|
|
631
631
|
widgets: t.widgets.map((a) => a.id === e ? { ...a, ...n } : a)
|
|
632
632
|
}))
|
|
633
|
-
})),
|
|
634
|
-
const e = ie((t) => t.widgets), n =
|
|
633
|
+
})), ut = (o) => {
|
|
634
|
+
const e = ie((t) => t.widgets), n = j(
|
|
635
635
|
() => e.map(({ commandId: t, ...a }) => ({
|
|
636
636
|
...a,
|
|
637
|
-
onClick: a.onClick ?? (t ? () =>
|
|
637
|
+
onClick: a.onClick ?? (t ? () => W.executeCommand(t) : void 0)
|
|
638
638
|
})),
|
|
639
639
|
[e]
|
|
640
640
|
);
|
|
641
|
-
return /* @__PURE__ */ r(
|
|
642
|
-
},
|
|
641
|
+
return /* @__PURE__ */ r(ct, { ...o, widgets: n });
|
|
642
|
+
}, mt = ({
|
|
643
643
|
history: o = [],
|
|
644
644
|
onCommand: e,
|
|
645
645
|
onClose: n,
|
|
@@ -648,14 +648,14 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
648
648
|
title: s = "Terminal",
|
|
649
649
|
className: l
|
|
650
650
|
}) => {
|
|
651
|
-
const [u, i] = A(""), d =
|
|
652
|
-
|
|
651
|
+
const [u, i] = A(""), d = M(null), m = M(null);
|
|
652
|
+
O(() => {
|
|
653
653
|
d.current && (d.current.scrollTop = d.current.scrollHeight);
|
|
654
654
|
}, [o]);
|
|
655
|
-
const
|
|
656
|
-
if (
|
|
657
|
-
const
|
|
658
|
-
|
|
655
|
+
const f = (p) => {
|
|
656
|
+
if (p.key !== "Enter") return;
|
|
657
|
+
const N = u.trim();
|
|
658
|
+
N && (e == null || e(N), i(""));
|
|
659
659
|
};
|
|
660
660
|
return /* @__PURE__ */ c(
|
|
661
661
|
"div",
|
|
@@ -689,7 +689,7 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
689
689
|
onClick: n,
|
|
690
690
|
"aria-label": "Close Terminal",
|
|
691
691
|
className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
692
|
-
children: /* @__PURE__ */ r(
|
|
692
|
+
children: /* @__PURE__ */ r(B, { size: 14 })
|
|
693
693
|
}
|
|
694
694
|
)
|
|
695
695
|
] })
|
|
@@ -702,10 +702,10 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
702
702
|
"aria-label": `${s} output`,
|
|
703
703
|
className: "flex-1 overflow-y-auto px-3 py-2 space-y-0.5",
|
|
704
704
|
onClick: () => {
|
|
705
|
-
var
|
|
706
|
-
return (
|
|
705
|
+
var p;
|
|
706
|
+
return (p = m.current) == null ? void 0 : p.focus();
|
|
707
707
|
},
|
|
708
|
-
children: o.map((
|
|
708
|
+
children: o.map((p, N) => /* @__PURE__ */ r("div", { className: "whitespace-pre-wrap break-all text-foreground/90", children: p }, N))
|
|
709
709
|
}
|
|
710
710
|
),
|
|
711
711
|
/* @__PURE__ */ c("div", { className: "flex items-center px-3 py-2 border-t border-border/50 shrink-0", children: [
|
|
@@ -713,12 +713,12 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
713
713
|
/* @__PURE__ */ r(
|
|
714
714
|
"input",
|
|
715
715
|
{
|
|
716
|
-
ref:
|
|
716
|
+
ref: m,
|
|
717
717
|
type: "text",
|
|
718
718
|
"aria-label": `${s} input`,
|
|
719
719
|
value: u,
|
|
720
|
-
onChange: (
|
|
721
|
-
onKeyDown:
|
|
720
|
+
onChange: (p) => i(p.target.value),
|
|
721
|
+
onKeyDown: f,
|
|
722
722
|
spellCheck: !1,
|
|
723
723
|
autoComplete: "off",
|
|
724
724
|
className: "flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground"
|
|
@@ -735,17 +735,17 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
735
735
|
toggle: () => o((e) => ({ isOpen: !e.isOpen })),
|
|
736
736
|
addHistory: (e) => o((n) => ({ history: [...n.history, e] })),
|
|
737
737
|
clearHistory: () => o({ history: [] })
|
|
738
|
-
})),
|
|
738
|
+
})), ft = [
|
|
739
739
|
"Available commands:",
|
|
740
740
|
" help — show this message",
|
|
741
741
|
" clear — clear the terminal"
|
|
742
|
-
],
|
|
742
|
+
], pt = ({
|
|
743
743
|
onCommand: o,
|
|
744
744
|
...e
|
|
745
745
|
}) => {
|
|
746
746
|
const n = V((i) => i.isOpen), t = V((i) => i.history), a = V((i) => i.setOpen), s = V((i) => i.addHistory), l = V((i) => i.clearHistory);
|
|
747
747
|
return n ? /* @__PURE__ */ r(
|
|
748
|
-
|
|
748
|
+
mt,
|
|
749
749
|
{
|
|
750
750
|
...e,
|
|
751
751
|
history: t,
|
|
@@ -757,7 +757,7 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
759
759
|
if (d === "help") {
|
|
760
|
-
|
|
760
|
+
ft.forEach(s);
|
|
761
761
|
return;
|
|
762
762
|
}
|
|
763
763
|
(o == null ? void 0 : o(i)) !== !0 && s(`command not found: ${i.split(" ")[0]}`);
|
|
@@ -766,9 +766,9 @@ const B = new ut(), Ce = (o) => o.map((e) => {
|
|
|
766
766
|
}
|
|
767
767
|
) : null;
|
|
768
768
|
};
|
|
769
|
-
class
|
|
769
|
+
class gt {
|
|
770
770
|
constructor() {
|
|
771
|
-
|
|
771
|
+
J(this, "components", /* @__PURE__ */ new Map());
|
|
772
772
|
}
|
|
773
773
|
/**
|
|
774
774
|
* Register a component with a unique ID.
|
|
@@ -790,7 +790,7 @@ class wt {
|
|
|
790
790
|
return Array.from(this.components.keys());
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
const
|
|
793
|
+
const ht = new gt(), _ = {
|
|
794
794
|
global: { tabEnableClose: !0, tabSetEnableMaximize: !1, tabSetEnableDivide: !0 },
|
|
795
795
|
borders: [
|
|
796
796
|
{
|
|
@@ -816,14 +816,14 @@ const Nt = new wt(), _ = {
|
|
|
816
816
|
}
|
|
817
817
|
]
|
|
818
818
|
}
|
|
819
|
-
}, fe = "nexus-shell-layout",
|
|
819
|
+
}, fe = "nexus-shell-layout", bt = U((o, e) => {
|
|
820
820
|
let n;
|
|
821
821
|
if (typeof window < "u")
|
|
822
822
|
try {
|
|
823
823
|
const t = localStorage.getItem(fe);
|
|
824
824
|
if (t) {
|
|
825
825
|
const a = JSON.parse(t);
|
|
826
|
-
n =
|
|
826
|
+
n = K.fromJson(a);
|
|
827
827
|
const s = /* @__PURE__ */ new Set(["dialogue-library", "argument-inspector"]), l = [];
|
|
828
828
|
n.visitNodes((u) => {
|
|
829
829
|
if (u.getType() === "tab") {
|
|
@@ -834,12 +834,12 @@ const Nt = new wt(), _ = {
|
|
|
834
834
|
n.doAction(G.deleteTab(u));
|
|
835
835
|
});
|
|
836
836
|
} else
|
|
837
|
-
n =
|
|
837
|
+
n = K.fromJson(_);
|
|
838
838
|
} catch (t) {
|
|
839
|
-
console.warn("Failed to load layout from storage, using default", t), n =
|
|
839
|
+
console.warn("Failed to load layout from storage, using default", t), n = K.fromJson(_);
|
|
840
840
|
}
|
|
841
841
|
else
|
|
842
|
-
n =
|
|
842
|
+
n = K.fromJson(_);
|
|
843
843
|
return {
|
|
844
844
|
model: n,
|
|
845
845
|
dirtyTabs: /* @__PURE__ */ new Set(),
|
|
@@ -849,12 +849,12 @@ const Nt = new wt(), _ = {
|
|
|
849
849
|
let s;
|
|
850
850
|
if (t && Object.keys(t).length > 0)
|
|
851
851
|
try {
|
|
852
|
-
s =
|
|
852
|
+
s = K.fromJson(t);
|
|
853
853
|
} catch (l) {
|
|
854
|
-
console.warn("Failed to parse init layout json, using default", l), s =
|
|
854
|
+
console.warn("Failed to parse init layout json, using default", l), s = K.fromJson(_);
|
|
855
855
|
}
|
|
856
856
|
else
|
|
857
|
-
s =
|
|
857
|
+
s = K.fromJson(_);
|
|
858
858
|
o({ model: s, disableLocalStorage: a || !1 });
|
|
859
859
|
},
|
|
860
860
|
setModel: (t) => {
|
|
@@ -872,12 +872,12 @@ const Nt = new wt(), _ = {
|
|
|
872
872
|
if (typeof window < "u")
|
|
873
873
|
try {
|
|
874
874
|
const l = localStorage.getItem(t);
|
|
875
|
-
l ? s =
|
|
875
|
+
l ? s = K.fromJson(JSON.parse(l)) : s = K.fromJson(a || _);
|
|
876
876
|
} catch (l) {
|
|
877
|
-
console.warn("Failed to load layout from storage for key", t, l), s =
|
|
877
|
+
console.warn("Failed to load layout from storage for key", t, l), s = K.fromJson(a || _);
|
|
878
878
|
}
|
|
879
879
|
else
|
|
880
|
-
s =
|
|
880
|
+
s = K.fromJson(a || _);
|
|
881
881
|
o({ storageKey: t, model: s });
|
|
882
882
|
},
|
|
883
883
|
setTabDirty: (t, a) => {
|
|
@@ -892,53 +892,53 @@ const Nt = new wt(), _ = {
|
|
|
892
892
|
let i = u == null ? void 0 : u.getId();
|
|
893
893
|
if (!i)
|
|
894
894
|
try {
|
|
895
|
-
const
|
|
896
|
-
i =
|
|
897
|
-
} catch (
|
|
898
|
-
console.warn("Failed to get first tabset fallback",
|
|
895
|
+
const f = l.getFirstTabSet();
|
|
896
|
+
i = f == null ? void 0 : f.getId();
|
|
897
|
+
} catch (f) {
|
|
898
|
+
console.warn("Failed to get first tabset fallback", f);
|
|
899
899
|
}
|
|
900
|
-
const
|
|
900
|
+
const m = { ...{}, ...s };
|
|
901
901
|
if (["nexus-dashboard", "nexus-docs"].includes(t)) {
|
|
902
|
-
let
|
|
903
|
-
if (l.visitNodes((
|
|
904
|
-
if (
|
|
905
|
-
const
|
|
906
|
-
|
|
902
|
+
let f = null;
|
|
903
|
+
if (l.visitNodes((p) => {
|
|
904
|
+
if (p.getType() === "tab") {
|
|
905
|
+
const N = p;
|
|
906
|
+
N.getComponent() === t && (f = N.getId());
|
|
907
907
|
}
|
|
908
|
-
}),
|
|
909
|
-
l.doAction(G.selectTab(
|
|
908
|
+
}), f) {
|
|
909
|
+
l.doAction(G.selectTab(f));
|
|
910
910
|
return;
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
|
-
if (
|
|
914
|
-
let
|
|
915
|
-
if (l.visitNodes((
|
|
916
|
-
var
|
|
917
|
-
if (
|
|
918
|
-
const
|
|
919
|
-
((
|
|
913
|
+
if (m.mapId) {
|
|
914
|
+
let f = null;
|
|
915
|
+
if (l.visitNodes((p) => {
|
|
916
|
+
var N;
|
|
917
|
+
if (p.getType() === "tab") {
|
|
918
|
+
const k = p;
|
|
919
|
+
((N = k.getConfig()) == null ? void 0 : N.mapId) === m.mapId && (f = k.getId());
|
|
920
920
|
}
|
|
921
|
-
}),
|
|
922
|
-
l.doAction(G.selectTab(
|
|
921
|
+
}), f) {
|
|
922
|
+
l.doAction(G.selectTab(f));
|
|
923
923
|
return;
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
|
-
if (
|
|
927
|
-
let
|
|
928
|
-
if (l.visitNodes((
|
|
929
|
-
var
|
|
930
|
-
if (
|
|
931
|
-
const
|
|
932
|
-
((
|
|
926
|
+
if (m.projectId) {
|
|
927
|
+
let f = null;
|
|
928
|
+
if (l.visitNodes((p) => {
|
|
929
|
+
var N;
|
|
930
|
+
if (p.getType() === "tab") {
|
|
931
|
+
const k = p;
|
|
932
|
+
((N = k.getConfig()) == null ? void 0 : N.projectId) === m.projectId && (f = k.getId());
|
|
933
933
|
}
|
|
934
|
-
}),
|
|
935
|
-
l.doAction(G.selectTab(
|
|
934
|
+
}), f) {
|
|
935
|
+
l.doAction(G.selectTab(f));
|
|
936
936
|
return;
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
i && l.doAction(
|
|
940
940
|
G.addNode(
|
|
941
|
-
{ type: "tab", component: t, name: a || t, config:
|
|
941
|
+
{ type: "tab", component: t, name: a || t, config: m },
|
|
942
942
|
i,
|
|
943
943
|
Oe.CENTER,
|
|
944
944
|
-1
|
|
@@ -966,7 +966,7 @@ const Nt = new wt(), _ = {
|
|
|
966
966
|
const { resolve: t } = e();
|
|
967
967
|
t && t(n), o({ isOpen: !1, resolve: null });
|
|
968
968
|
}
|
|
969
|
-
})),
|
|
969
|
+
})), _t = ({
|
|
970
970
|
panels: o,
|
|
971
971
|
slashCommands: e,
|
|
972
972
|
menuConfig: n,
|
|
@@ -977,41 +977,41 @@ const Nt = new wt(), _ = {
|
|
|
977
977
|
layoutModel: u,
|
|
978
978
|
initialLayoutJson: i,
|
|
979
979
|
disableLocalStorage: d = !1,
|
|
980
|
-
onLayoutChange:
|
|
980
|
+
onLayoutChange: m
|
|
981
981
|
}) => {
|
|
982
|
-
const { model:
|
|
983
|
-
|
|
984
|
-
o &&
|
|
985
|
-
}, [o,
|
|
986
|
-
e &&
|
|
987
|
-
}, [e,
|
|
982
|
+
const { model: f, setModel: p, initLayout: N, isTabDirty: k, setTabDirty: w } = bt(), h = Y((E) => E.theme), x = F((E) => E.setPanels), b = Q((E) => E.setSlashCommands), y = ie((E) => E.setWidgets);
|
|
983
|
+
O(() => {
|
|
984
|
+
o && x(o);
|
|
985
|
+
}, [o, x]), O(() => {
|
|
986
|
+
e && b(e);
|
|
987
|
+
}, [e, b]), O(() => {
|
|
988
988
|
n && le.setMenus(n);
|
|
989
|
-
}, [n]),
|
|
990
|
-
t &&
|
|
991
|
-
}, [t,
|
|
992
|
-
u || !i && !d ||
|
|
989
|
+
}, [n]), O(() => {
|
|
990
|
+
t && y(t);
|
|
991
|
+
}, [t, y]), O(() => {
|
|
992
|
+
u || !i && !d || N(i, d);
|
|
993
993
|
}, []);
|
|
994
|
-
const
|
|
994
|
+
const g = (E) => {
|
|
995
995
|
try {
|
|
996
|
-
const
|
|
997
|
-
return
|
|
996
|
+
const L = E.getComponent(), T = E.getConfig() || {}, P = L ? ht.get(L) : void 0;
|
|
997
|
+
return P ? /* @__PURE__ */ r(P, { node: E, ...T }) : /* @__PURE__ */ c("div", { className: "p-4 text-sm", children: [
|
|
998
998
|
"Unknown Component: ",
|
|
999
|
-
|
|
999
|
+
L
|
|
1000
1000
|
] });
|
|
1001
|
-
} catch (
|
|
1002
|
-
return console.error("Error in component factory:",
|
|
1001
|
+
} catch (L) {
|
|
1002
|
+
return console.error("Error in component factory:", L), /* @__PURE__ */ c("div", { className: "p-8 text-destructive bg-destructive/10 border border-destructive/20 h-full flex items-center justify-center", children: [
|
|
1003
1003
|
"Error rendering component: ",
|
|
1004
|
-
|
|
1004
|
+
L instanceof Error ? L.message : "Unknown error"
|
|
1005
1005
|
] });
|
|
1006
1006
|
}
|
|
1007
|
-
},
|
|
1008
|
-
if (
|
|
1009
|
-
const
|
|
1010
|
-
if (!
|
|
1007
|
+
}, C = (E) => {
|
|
1008
|
+
if (E.type !== G.DELETE_TAB) return E;
|
|
1009
|
+
const L = f.getNodeById(E.data.node);
|
|
1010
|
+
if (!L || !k(L.getId())) return E;
|
|
1011
1011
|
Te.getState().openConfirm(
|
|
1012
|
-
`Tab "${
|
|
1013
|
-
).then((
|
|
1014
|
-
|
|
1012
|
+
`Tab "${L.getName()}" has unsaved changes. Are you sure you want to close it?`
|
|
1013
|
+
).then((T) => {
|
|
1014
|
+
T && (w(L.getId(), !1), f.doAction(E));
|
|
1015
1015
|
});
|
|
1016
1016
|
};
|
|
1017
1017
|
return /* @__PURE__ */ c(
|
|
@@ -1020,7 +1020,7 @@ const Nt = new wt(), _ = {
|
|
|
1020
1020
|
className: `flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden theme-${h}`,
|
|
1021
1021
|
children: [
|
|
1022
1022
|
/* @__PURE__ */ r(
|
|
1023
|
-
|
|
1023
|
+
at,
|
|
1024
1024
|
{
|
|
1025
1025
|
title: a,
|
|
1026
1026
|
center: l,
|
|
@@ -1028,36 +1028,36 @@ const Nt = new wt(), _ = {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
),
|
|
1030
1030
|
/* @__PURE__ */ c("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
1031
|
-
/* @__PURE__ */ r(
|
|
1032
|
-
/* @__PURE__ */ r(
|
|
1031
|
+
/* @__PURE__ */ r(Qe, {}),
|
|
1032
|
+
/* @__PURE__ */ r(dt, {}),
|
|
1033
1033
|
/* @__PURE__ */ c("div", { className: "flex-1 flex flex-col min-w-0 bg-card", children: [
|
|
1034
1034
|
/* @__PURE__ */ r("div", { className: "flex-1 relative h-full w-full", children: /* @__PURE__ */ r(
|
|
1035
|
-
|
|
1035
|
+
Ae,
|
|
1036
1036
|
{
|
|
1037
|
-
model: u ||
|
|
1038
|
-
factory:
|
|
1039
|
-
onModelChange: (
|
|
1040
|
-
u ||
|
|
1037
|
+
model: u || f,
|
|
1038
|
+
factory: g,
|
|
1039
|
+
onModelChange: (E) => {
|
|
1040
|
+
u || p(E), m == null || m(E.toJson());
|
|
1041
1041
|
},
|
|
1042
|
-
onAction:
|
|
1042
|
+
onAction: C
|
|
1043
1043
|
}
|
|
1044
1044
|
) }),
|
|
1045
|
-
/* @__PURE__ */ r(
|
|
1045
|
+
/* @__PURE__ */ r(pt, {})
|
|
1046
1046
|
] }),
|
|
1047
|
-
/* @__PURE__ */ r(
|
|
1047
|
+
/* @__PURE__ */ r(rt, {})
|
|
1048
1048
|
] }),
|
|
1049
|
-
/* @__PURE__ */ r(
|
|
1049
|
+
/* @__PURE__ */ r(ut, {})
|
|
1050
1050
|
]
|
|
1051
1051
|
}
|
|
1052
1052
|
);
|
|
1053
|
-
},
|
|
1053
|
+
}, Bt = [
|
|
1054
1054
|
"view.toggleTerminal",
|
|
1055
1055
|
"view.toggleChat",
|
|
1056
1056
|
"view.toggleSidebar",
|
|
1057
1057
|
"theme.light",
|
|
1058
1058
|
"theme.dark",
|
|
1059
1059
|
"theme.gt"
|
|
1060
|
-
], oe = (o) => () => Y.getState().setTheme(o),
|
|
1060
|
+
], oe = (o) => () => Y.getState().setTheme(o), xt = [
|
|
1061
1061
|
{
|
|
1062
1062
|
id: "view.toggleTerminal",
|
|
1063
1063
|
label: "View: Toggle Terminal",
|
|
@@ -1082,7 +1082,7 @@ const Nt = new wt(), _ = {
|
|
|
1082
1082
|
{ id: "theme.light", label: "Preferences: Light Theme", execute: oe("light") },
|
|
1083
1083
|
{ id: "theme.dark", label: "Preferences: Dark Theme", execute: oe("dark") },
|
|
1084
1084
|
{ id: "theme.gt", label: "Preferences: Georgia Tech Theme", execute: oe("gt") }
|
|
1085
|
-
],
|
|
1085
|
+
], vt = {
|
|
1086
1086
|
View: [
|
|
1087
1087
|
{ id: "view.terminal", label: "Toggle Terminal", commandId: "view.toggleTerminal" },
|
|
1088
1088
|
{ id: "view.chat", label: "Toggle Chat", commandId: "view.toggleChat" },
|
|
@@ -1097,7 +1097,7 @@ const Nt = new wt(), _ = {
|
|
|
1097
1097
|
]
|
|
1098
1098
|
}
|
|
1099
1099
|
]
|
|
1100
|
-
},
|
|
1100
|
+
}, Jt = (o = {}) => {
|
|
1101
1101
|
const {
|
|
1102
1102
|
panels: e,
|
|
1103
1103
|
menus: n,
|
|
@@ -1107,18 +1107,18 @@ const Nt = new wt(), _ = {
|
|
|
1107
1107
|
defaultCommands: l = !0,
|
|
1108
1108
|
defaultMenus: u = !0
|
|
1109
1109
|
} = o;
|
|
1110
|
-
l &&
|
|
1110
|
+
l && xt.forEach((d) => W.registerCommand(d)), t == null || t.forEach((d) => W.registerCommand(d));
|
|
1111
1111
|
const i = {
|
|
1112
|
-
...l && u ?
|
|
1112
|
+
...l && u ? vt : {},
|
|
1113
1113
|
...n ?? {}
|
|
1114
1114
|
};
|
|
1115
1115
|
Object.keys(i).length > 0 && le.setMenus(i), e && F.getState().setPanels(e), a && ie.getState().setWidgets(a), s && Q.getState().setSlashCommands(s);
|
|
1116
1116
|
};
|
|
1117
|
-
class
|
|
1117
|
+
class yt {
|
|
1118
1118
|
constructor() {
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1119
|
+
J(this, "plugins", /* @__PURE__ */ new Map());
|
|
1120
|
+
J(this, "loaders", /* @__PURE__ */ new Map());
|
|
1121
|
+
J(this, "statuses", /* @__PURE__ */ new Map());
|
|
1122
1122
|
}
|
|
1123
1123
|
registerPlugin(e) {
|
|
1124
1124
|
if (this.plugins.has(e.id)) {
|
|
@@ -1177,13 +1177,13 @@ class Tt {
|
|
|
1177
1177
|
return Array.from(this.plugins.values());
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
|
-
const
|
|
1180
|
+
const Ht = new yt(), pe = "nexus-shell-user-profile", ge = {
|
|
1181
1181
|
name: "David Tech",
|
|
1182
1182
|
role: "Shell Architect",
|
|
1183
1183
|
email: "david@techmuch.io",
|
|
1184
1184
|
avatarUrl: "",
|
|
1185
1185
|
customAvatar: ""
|
|
1186
|
-
},
|
|
1186
|
+
}, H = U((o) => {
|
|
1187
1187
|
let e = { ...ge };
|
|
1188
1188
|
if (typeof window < "u")
|
|
1189
1189
|
try {
|
|
@@ -1224,12 +1224,12 @@ const qt = new Tt(), pe = "nexus-shell-user-profile", ge = {
|
|
|
1224
1224
|
return n(a), { customAvatar: "" };
|
|
1225
1225
|
})
|
|
1226
1226
|
};
|
|
1227
|
-
}),
|
|
1228
|
-
|
|
1227
|
+
}), Wt = () => {
|
|
1228
|
+
O(() => {
|
|
1229
1229
|
const o = (e) => {
|
|
1230
|
-
const n =
|
|
1230
|
+
const n = W.getCommands();
|
|
1231
1231
|
for (const t of n)
|
|
1232
|
-
if (t.keybinding &&
|
|
1232
|
+
if (t.keybinding && wt(e, t.keybinding)) {
|
|
1233
1233
|
e.preventDefault(), t.execute();
|
|
1234
1234
|
break;
|
|
1235
1235
|
}
|
|
@@ -1237,38 +1237,38 @@ const qt = new Tt(), pe = "nexus-shell-user-profile", ge = {
|
|
|
1237
1237
|
return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
|
|
1238
1238
|
}, []);
|
|
1239
1239
|
};
|
|
1240
|
-
function
|
|
1241
|
-
var
|
|
1242
|
-
const n = e.split("+"), t = (
|
|
1243
|
-
return o.key.toLowerCase() === t && i === a && d === s &&
|
|
1240
|
+
function wt(o, e) {
|
|
1241
|
+
var p;
|
|
1242
|
+
const n = e.split("+"), t = (p = n.pop()) == null ? void 0 : p.toLowerCase(), a = n.includes("Control") || n.includes("Ctrl"), s = n.includes("Shift"), l = n.includes("Alt"), u = n.includes("Meta") || n.includes("Cmd"), i = o.ctrlKey, d = o.shiftKey, m = o.altKey, f = o.metaKey;
|
|
1243
|
+
return o.key.toLowerCase() === t && i === a && d === s && m === l && f === u;
|
|
1244
1244
|
}
|
|
1245
|
-
const
|
|
1245
|
+
const Nt = (o, e) => {
|
|
1246
1246
|
const n = e.toLowerCase();
|
|
1247
1247
|
return o.label.toLowerCase().includes(n) || o.id.toLowerCase().includes(n);
|
|
1248
|
-
},
|
|
1248
|
+
}, kt = ({
|
|
1249
1249
|
open: o,
|
|
1250
1250
|
commands: e,
|
|
1251
1251
|
onSelect: n,
|
|
1252
1252
|
onClose: t,
|
|
1253
1253
|
inline: a = !1,
|
|
1254
1254
|
placeholder: s = "Type a command to run…",
|
|
1255
|
-
filter: l =
|
|
1255
|
+
filter: l = Nt,
|
|
1256
1256
|
className: u
|
|
1257
1257
|
}) => {
|
|
1258
|
-
const [i, d] = A(""), [
|
|
1259
|
-
() => e.filter((
|
|
1258
|
+
const [i, d] = A(""), [m, f] = A(0), p = M(null), N = j(
|
|
1259
|
+
() => e.filter((w) => l(w, i)),
|
|
1260
1260
|
[e, i, l]
|
|
1261
1261
|
);
|
|
1262
|
-
if (
|
|
1263
|
-
var
|
|
1264
|
-
o && (d(""),
|
|
1265
|
-
}, [o]),
|
|
1266
|
-
|
|
1262
|
+
if (O(() => {
|
|
1263
|
+
var w;
|
|
1264
|
+
o && (d(""), f(0), (w = p.current) == null || w.focus());
|
|
1265
|
+
}, [o]), O(() => {
|
|
1266
|
+
f(0);
|
|
1267
1267
|
}, [i]), !o) return null;
|
|
1268
|
-
const
|
|
1269
|
-
|
|
1270
|
-
(h) =>
|
|
1271
|
-
)) :
|
|
1268
|
+
const k = (w) => {
|
|
1269
|
+
w.key === "ArrowDown" ? (w.preventDefault(), f((h) => N.length ? (h + 1) % N.length : 0)) : w.key === "ArrowUp" ? (w.preventDefault(), f(
|
|
1270
|
+
(h) => N.length ? (h - 1 + N.length) % N.length : 0
|
|
1271
|
+
)) : w.key === "Enter" ? (w.preventDefault(), N[m] && n(N[m])) : w.key === "Escape" && (w.preventDefault(), t == null || t());
|
|
1272
1272
|
};
|
|
1273
1273
|
return /* @__PURE__ */ r(
|
|
1274
1274
|
"div",
|
|
@@ -1284,7 +1284,7 @@ const Et = (o, e) => {
|
|
|
1284
1284
|
role: "dialog",
|
|
1285
1285
|
"aria-modal": !a,
|
|
1286
1286
|
"aria-label": "Command Palette",
|
|
1287
|
-
onClick: (
|
|
1287
|
+
onClick: (w) => w.stopPropagation(),
|
|
1288
1288
|
className: S(
|
|
1289
1289
|
"w-full max-w-xl bg-popover text-popover-foreground border shadow-2xl rounded-xl overflow-hidden animate-in fade-in zoom-in duration-200",
|
|
1290
1290
|
u
|
|
@@ -1295,7 +1295,7 @@ const Et = (o, e) => {
|
|
|
1295
1295
|
/* @__PURE__ */ r(
|
|
1296
1296
|
"input",
|
|
1297
1297
|
{
|
|
1298
|
-
ref:
|
|
1298
|
+
ref: p,
|
|
1299
1299
|
type: "text",
|
|
1300
1300
|
role: "combobox",
|
|
1301
1301
|
"aria-expanded": !0,
|
|
@@ -1303,8 +1303,8 @@ const Et = (o, e) => {
|
|
|
1303
1303
|
"aria-label": "Command",
|
|
1304
1304
|
placeholder: s,
|
|
1305
1305
|
value: i,
|
|
1306
|
-
onChange: (
|
|
1307
|
-
onKeyDown:
|
|
1306
|
+
onChange: (w) => d(w.target.value),
|
|
1307
|
+
onKeyDown: k,
|
|
1308
1308
|
className: "flex-1 h-14 bg-transparent outline-none text-base text-foreground placeholder:text-muted-foreground"
|
|
1309
1309
|
}
|
|
1310
1310
|
)
|
|
@@ -1315,23 +1315,23 @@ const Et = (o, e) => {
|
|
|
1315
1315
|
id: "command-palette-list",
|
|
1316
1316
|
role: "listbox",
|
|
1317
1317
|
className: "max-h-[300px] overflow-y-auto py-2",
|
|
1318
|
-
children:
|
|
1318
|
+
children: N.length === 0 ? /* @__PURE__ */ r("div", { className: "px-4 py-8 text-center text-sm text-muted-foreground", children: i ? `No commands found matching "${i}"` : "No commands available." }) : N.map((w, h) => /* @__PURE__ */ c(
|
|
1319
1319
|
"div",
|
|
1320
1320
|
{
|
|
1321
1321
|
role: "option",
|
|
1322
|
-
"aria-selected": h ===
|
|
1323
|
-
onClick: () => n(
|
|
1324
|
-
onMouseEnter: () =>
|
|
1322
|
+
"aria-selected": h === m,
|
|
1323
|
+
onClick: () => n(w),
|
|
1324
|
+
onMouseEnter: () => f(h),
|
|
1325
1325
|
className: S(
|
|
1326
1326
|
"px-4 py-2 cursor-pointer flex justify-between items-center text-sm",
|
|
1327
|
-
h ===
|
|
1327
|
+
h === m ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
|
|
1328
1328
|
),
|
|
1329
1329
|
children: [
|
|
1330
|
-
/* @__PURE__ */ r("span", { children:
|
|
1331
|
-
|
|
1330
|
+
/* @__PURE__ */ r("span", { children: w.label }),
|
|
1331
|
+
w.keybinding && /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border/50", children: w.keybinding })
|
|
1332
1332
|
]
|
|
1333
1333
|
},
|
|
1334
|
-
|
|
1334
|
+
w.id
|
|
1335
1335
|
))
|
|
1336
1336
|
}
|
|
1337
1337
|
),
|
|
@@ -1356,38 +1356,38 @@ const Et = (o, e) => {
|
|
|
1356
1356
|
)
|
|
1357
1357
|
}
|
|
1358
1358
|
);
|
|
1359
|
-
},
|
|
1359
|
+
}, Gt = ({
|
|
1360
1360
|
shortcutKey: o = "p",
|
|
1361
1361
|
...e
|
|
1362
1362
|
}) => {
|
|
1363
1363
|
const [n, t] = A(!1);
|
|
1364
|
-
return
|
|
1364
|
+
return O(() => {
|
|
1365
1365
|
if (o === null) return;
|
|
1366
1366
|
const a = (s) => {
|
|
1367
1367
|
(s.metaKey || s.ctrlKey) && s.shiftKey && s.key.toLowerCase() === o && (s.preventDefault(), t((l) => !l));
|
|
1368
1368
|
};
|
|
1369
1369
|
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
1370
1370
|
}, [o]), /* @__PURE__ */ r(
|
|
1371
|
-
|
|
1371
|
+
kt,
|
|
1372
1372
|
{
|
|
1373
1373
|
...e,
|
|
1374
1374
|
open: n,
|
|
1375
|
-
commands:
|
|
1375
|
+
commands: W.getCommands(),
|
|
1376
1376
|
onSelect: (a) => {
|
|
1377
1377
|
a.execute(), t(!1);
|
|
1378
1378
|
},
|
|
1379
1379
|
onClose: () => t(!1)
|
|
1380
1380
|
}
|
|
1381
1381
|
);
|
|
1382
|
-
},
|
|
1383
|
-
alert:
|
|
1384
|
-
confirm:
|
|
1385
|
-
prompt:
|
|
1386
|
-
},
|
|
1382
|
+
}, Ct = {
|
|
1383
|
+
alert: je,
|
|
1384
|
+
confirm: $e,
|
|
1385
|
+
prompt: Ke
|
|
1386
|
+
}, St = {
|
|
1387
1387
|
alert: "text-destructive",
|
|
1388
1388
|
confirm: "text-amber-500",
|
|
1389
1389
|
prompt: "text-blue-500"
|
|
1390
|
-
},
|
|
1390
|
+
}, Tt = ({
|
|
1391
1391
|
open: o,
|
|
1392
1392
|
type: e = "alert",
|
|
1393
1393
|
title: n,
|
|
@@ -1398,26 +1398,26 @@ const Et = (o, e) => {
|
|
|
1398
1398
|
confirmLabel: u,
|
|
1399
1399
|
cancelLabel: i = "Cancel",
|
|
1400
1400
|
placeholder: d = "Enter value…",
|
|
1401
|
-
className:
|
|
1401
|
+
className: m
|
|
1402
1402
|
}) => {
|
|
1403
|
-
const [
|
|
1404
|
-
if (
|
|
1405
|
-
if (!o || (
|
|
1406
|
-
const
|
|
1407
|
-
var
|
|
1408
|
-
(
|
|
1403
|
+
const [f, p] = A(a), N = M(null);
|
|
1404
|
+
if (O(() => {
|
|
1405
|
+
if (!o || (p(a), e !== "prompt")) return;
|
|
1406
|
+
const x = window.setTimeout(() => {
|
|
1407
|
+
var b, y;
|
|
1408
|
+
(b = N.current) == null || b.focus(), (y = N.current) == null || y.select();
|
|
1409
1409
|
}, 50);
|
|
1410
|
-
return () => window.clearTimeout(
|
|
1411
|
-
}, [o, e, a]),
|
|
1410
|
+
return () => window.clearTimeout(x);
|
|
1411
|
+
}, [o, e, a]), O(() => {
|
|
1412
1412
|
if (!o) return;
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1413
|
+
const x = (b) => {
|
|
1414
|
+
b.key === "Escape" && (b.preventDefault(), l == null || l());
|
|
1415
1415
|
};
|
|
1416
|
-
return document.addEventListener("keydown",
|
|
1416
|
+
return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
|
|
1417
1417
|
}, [o, l]), !o) return null;
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1420
|
-
}, h =
|
|
1418
|
+
const k = () => s == null ? void 0 : s(e === "prompt" ? f : void 0), w = (x) => {
|
|
1419
|
+
x.key === "Enter" && (x.preventDefault(), k());
|
|
1420
|
+
}, h = Ct[e];
|
|
1421
1421
|
return /* @__PURE__ */ r(
|
|
1422
1422
|
"div",
|
|
1423
1423
|
{
|
|
@@ -1429,11 +1429,11 @@ const Et = (o, e) => {
|
|
|
1429
1429
|
role: "dialog",
|
|
1430
1430
|
"aria-modal": "true",
|
|
1431
1431
|
"aria-label": n,
|
|
1432
|
-
onClick: (
|
|
1433
|
-
onKeyDown:
|
|
1432
|
+
onClick: (x) => x.stopPropagation(),
|
|
1433
|
+
onKeyDown: w,
|
|
1434
1434
|
className: S(
|
|
1435
1435
|
"relative flex flex-col w-full max-w-md p-6 bg-card border border-border shadow-2xl rounded-2xl animate-in fade-in zoom-in-95 ring-1 ring-white/10",
|
|
1436
|
-
|
|
1436
|
+
m
|
|
1437
1437
|
),
|
|
1438
1438
|
children: [
|
|
1439
1439
|
/* @__PURE__ */ r(
|
|
@@ -1443,11 +1443,11 @@ const Et = (o, e) => {
|
|
|
1443
1443
|
onClick: l,
|
|
1444
1444
|
"aria-label": "Close",
|
|
1445
1445
|
className: "absolute top-4 right-4 p-1 rounded-full text-muted-foreground hover:bg-muted hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
1446
|
-
children: /* @__PURE__ */ r(
|
|
1446
|
+
children: /* @__PURE__ */ r(B, { size: 18 })
|
|
1447
1447
|
}
|
|
1448
1448
|
),
|
|
1449
1449
|
/* @__PURE__ */ c("div", { className: "flex items-start space-x-4 mb-4", children: [
|
|
1450
|
-
/* @__PURE__ */ r("div", { className: S("p-2 bg-muted rounded-full shrink-0",
|
|
1450
|
+
/* @__PURE__ */ r("div", { className: S("p-2 bg-muted rounded-full shrink-0", St[e]), children: /* @__PURE__ */ r(h, { size: 24 }) }),
|
|
1451
1451
|
/* @__PURE__ */ c("div", { className: "flex-1 mt-1", children: [
|
|
1452
1452
|
/* @__PURE__ */ r("h2", { className: "text-lg font-semibold tracking-tight pr-6", children: n }),
|
|
1453
1453
|
t && /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground mt-1 whitespace-pre-wrap", children: t })
|
|
@@ -1456,12 +1456,12 @@ const Et = (o, e) => {
|
|
|
1456
1456
|
e === "prompt" && /* @__PURE__ */ r("div", { className: "mt-2 mb-4", children: /* @__PURE__ */ r(
|
|
1457
1457
|
"input",
|
|
1458
1458
|
{
|
|
1459
|
-
ref:
|
|
1459
|
+
ref: N,
|
|
1460
1460
|
type: "text",
|
|
1461
1461
|
"aria-label": n,
|
|
1462
|
-
value:
|
|
1462
|
+
value: f,
|
|
1463
1463
|
placeholder: d,
|
|
1464
|
-
onChange: (
|
|
1464
|
+
onChange: (x) => p(x.target.value),
|
|
1465
1465
|
className: "w-full bg-background border border-border rounded-lg px-4 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary/50 transition-all placeholder:text-muted-foreground/50"
|
|
1466
1466
|
}
|
|
1467
1467
|
) }),
|
|
@@ -1479,7 +1479,7 @@ const Et = (o, e) => {
|
|
|
1479
1479
|
"button",
|
|
1480
1480
|
{
|
|
1481
1481
|
type: "button",
|
|
1482
|
-
onClick:
|
|
1482
|
+
onClick: k,
|
|
1483
1483
|
autoFocus: e !== "prompt",
|
|
1484
1484
|
className: "px-4 py-2 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
1485
1485
|
children: u ?? (e === "alert" ? "OK" : "Confirm")
|
|
@@ -1491,10 +1491,10 @@ const Et = (o, e) => {
|
|
|
1491
1491
|
)
|
|
1492
1492
|
}
|
|
1493
1493
|
);
|
|
1494
|
-
},
|
|
1494
|
+
}, Vt = (o) => {
|
|
1495
1495
|
const { isOpen: e, type: n, title: t, message: a, defaultValue: s, close: l } = Te();
|
|
1496
1496
|
return /* @__PURE__ */ r(
|
|
1497
|
-
|
|
1497
|
+
Tt,
|
|
1498
1498
|
{
|
|
1499
1499
|
...o,
|
|
1500
1500
|
open: e,
|
|
@@ -1510,14 +1510,14 @@ const Et = (o, e) => {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
1512
|
);
|
|
1513
|
-
},
|
|
1513
|
+
}, Dt = [
|
|
1514
1514
|
{ id: "light", label: "Light" },
|
|
1515
1515
|
{ id: "dark", label: "Dark" },
|
|
1516
1516
|
{ id: "gt", label: "GT" }
|
|
1517
|
-
],
|
|
1517
|
+
], Et = ({
|
|
1518
1518
|
value: o,
|
|
1519
1519
|
onChange: e,
|
|
1520
|
-
options: n =
|
|
1520
|
+
options: n = Dt,
|
|
1521
1521
|
className: t,
|
|
1522
1522
|
"aria-label": a = "Theme"
|
|
1523
1523
|
}) => /* @__PURE__ */ r(
|
|
@@ -1544,10 +1544,10 @@ const Et = (o, e) => {
|
|
|
1544
1544
|
s.id
|
|
1545
1545
|
))
|
|
1546
1546
|
}
|
|
1547
|
-
),
|
|
1547
|
+
), Yt = (o) => {
|
|
1548
1548
|
const e = Y((t) => t.theme), n = Y((t) => t.setTheme);
|
|
1549
|
-
return /* @__PURE__ */ r(
|
|
1550
|
-
},
|
|
1549
|
+
return /* @__PURE__ */ r(Et, { ...o, value: e, onChange: n });
|
|
1550
|
+
}, It = ({
|
|
1551
1551
|
profile: o,
|
|
1552
1552
|
actions: e = [],
|
|
1553
1553
|
onProfileChange: n,
|
|
@@ -1556,36 +1556,36 @@ const Et = (o, e) => {
|
|
|
1556
1556
|
showName: s = !0,
|
|
1557
1557
|
className: l
|
|
1558
1558
|
}) => {
|
|
1559
|
-
const { name: u, role: i, email: d, avatarUrl:
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
}, [
|
|
1563
|
-
if (!
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1559
|
+
const { name: u, role: i, email: d, avatarUrl: m } = o, [f, p] = A(!1), [N, k] = A(!1), [w, h] = A(u), [x, b] = A(i ?? ""), y = M(null), g = M(null);
|
|
1560
|
+
O(() => {
|
|
1561
|
+
f && (h(u), b(i ?? ""), k(!1));
|
|
1562
|
+
}, [f, u, i]), O(() => {
|
|
1563
|
+
if (!f) return;
|
|
1564
|
+
const T = (P) => {
|
|
1565
|
+
y.current && !y.current.contains(P.target) && p(!1);
|
|
1566
1566
|
};
|
|
1567
|
-
return document.addEventListener("mousedown",
|
|
1568
|
-
}, [
|
|
1569
|
-
const
|
|
1570
|
-
|
|
1571
|
-
},
|
|
1567
|
+
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
1568
|
+
}, [f]);
|
|
1569
|
+
const C = (T) => {
|
|
1570
|
+
T.preventDefault(), n == null || n({ name: w, role: x }), k(!1);
|
|
1571
|
+
}, E = (T) => {
|
|
1572
1572
|
var v;
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1575
|
-
},
|
|
1576
|
-
return /* @__PURE__ */ c("div", { ref:
|
|
1573
|
+
const P = (v = T.target.files) == null ? void 0 : v[0];
|
|
1574
|
+
P && (t == null || t(P)), T.target.value = "";
|
|
1575
|
+
}, L = (T) => m ? /* @__PURE__ */ r("img", { src: m, alt: u, className: "w-full h-full object-cover" }) : /* @__PURE__ */ r(xe, { size: T, className: "text-muted-foreground" });
|
|
1576
|
+
return /* @__PURE__ */ c("div", { ref: y, className: "relative inline-block text-left", children: [
|
|
1577
1577
|
/* @__PURE__ */ c(
|
|
1578
1578
|
"button",
|
|
1579
1579
|
{
|
|
1580
1580
|
type: "button",
|
|
1581
|
-
onClick: () => a ? a() :
|
|
1581
|
+
onClick: () => a ? a() : p((T) => !T),
|
|
1582
1582
|
"aria-haspopup": a ? void 0 : "menu",
|
|
1583
|
-
"aria-expanded": a ? void 0 :
|
|
1583
|
+
"aria-expanded": a ? void 0 : f,
|
|
1584
1584
|
"aria-label": "User Profile Menu",
|
|
1585
1585
|
className: S(
|
|
1586
1586
|
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none transition-all duration-200 select-none",
|
|
1587
1587
|
s ? "flex items-center space-x-2 px-2 py-1 rounded-md hover:bg-accent/50 hover:text-accent-foreground text-left cursor-pointer border border-transparent hover:border-border/30" : "w-7 h-7 rounded-full bg-secondary/80 border border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-secondary cursor-pointer",
|
|
1588
|
-
|
|
1588
|
+
f && (s ? "bg-accent/60 border-border/40" : "border-primary/50 text-foreground ring-1 ring-primary/20"),
|
|
1589
1589
|
l
|
|
1590
1590
|
),
|
|
1591
1591
|
children: [
|
|
@@ -1596,7 +1596,7 @@ const Et = (o, e) => {
|
|
|
1596
1596
|
"rounded-full overflow-hidden border border-border/50 bg-muted flex items-center justify-center shrink-0 shadow-sm",
|
|
1597
1597
|
s ? "w-6 h-6" : "w-full h-full"
|
|
1598
1598
|
),
|
|
1599
|
-
children:
|
|
1599
|
+
children: L(s ? 13 : 12)
|
|
1600
1600
|
}
|
|
1601
1601
|
),
|
|
1602
1602
|
s && /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 leading-tight pr-1", children: [
|
|
@@ -1610,14 +1610,14 @@ const Et = (o, e) => {
|
|
|
1610
1610
|
"input",
|
|
1611
1611
|
{
|
|
1612
1612
|
type: "file",
|
|
1613
|
-
ref:
|
|
1614
|
-
onChange:
|
|
1613
|
+
ref: g,
|
|
1614
|
+
onChange: E,
|
|
1615
1615
|
accept: "image/*",
|
|
1616
1616
|
"aria-label": "Upload avatar",
|
|
1617
1617
|
className: "hidden"
|
|
1618
1618
|
}
|
|
1619
1619
|
),
|
|
1620
|
-
|
|
1620
|
+
f && /* @__PURE__ */ r(
|
|
1621
1621
|
"div",
|
|
1622
1622
|
{
|
|
1623
1623
|
role: "menu",
|
|
@@ -1625,7 +1625,7 @@ const Et = (o, e) => {
|
|
|
1625
1625
|
"absolute z-50 w-64 rounded-lg border border-border/50 bg-card text-card-foreground shadow-lg backdrop-blur-md p-2 flex flex-col gap-1 mt-1.5 animate-in fade-in slide-in-from-top-2 duration-150 origin-top-right",
|
|
1626
1626
|
s ? "left-0" : "right-0"
|
|
1627
1627
|
),
|
|
1628
|
-
children:
|
|
1628
|
+
children: N ? /* @__PURE__ */ c("form", { onSubmit: C, className: "p-2 flex flex-col gap-2", children: [
|
|
1629
1629
|
/* @__PURE__ */ r("span", { className: "text-[10px] font-bold uppercase tracking-wider text-muted-foreground", children: "Edit Profile" }),
|
|
1630
1630
|
/* @__PURE__ */ c("div", { className: "flex flex-col gap-1", children: [
|
|
1631
1631
|
/* @__PURE__ */ r("label", { htmlFor: "profile-name", className: "text-[9px] font-semibold text-muted-foreground", children: "Name" }),
|
|
@@ -1634,8 +1634,8 @@ const Et = (o, e) => {
|
|
|
1634
1634
|
{
|
|
1635
1635
|
id: "profile-name",
|
|
1636
1636
|
type: "text",
|
|
1637
|
-
value:
|
|
1638
|
-
onChange: (
|
|
1637
|
+
value: w,
|
|
1638
|
+
onChange: (T) => h(T.target.value),
|
|
1639
1639
|
required: !0,
|
|
1640
1640
|
className: "w-full px-2 py-1 text-xs border rounded bg-background focus:ring-1 focus:ring-primary focus:outline-none"
|
|
1641
1641
|
}
|
|
@@ -1648,8 +1648,8 @@ const Et = (o, e) => {
|
|
|
1648
1648
|
{
|
|
1649
1649
|
id: "profile-role",
|
|
1650
1650
|
type: "text",
|
|
1651
|
-
value:
|
|
1652
|
-
onChange: (
|
|
1651
|
+
value: x,
|
|
1652
|
+
onChange: (T) => b(T.target.value),
|
|
1653
1653
|
className: "w-full px-2 py-1 text-xs border rounded bg-background focus:ring-1 focus:ring-primary focus:outline-none"
|
|
1654
1654
|
}
|
|
1655
1655
|
)
|
|
@@ -1659,10 +1659,10 @@ const Et = (o, e) => {
|
|
|
1659
1659
|
"button",
|
|
1660
1660
|
{
|
|
1661
1661
|
type: "button",
|
|
1662
|
-
onClick: () =>
|
|
1662
|
+
onClick: () => k(!1),
|
|
1663
1663
|
className: "px-2 py-1 text-[10px] rounded hover:bg-accent text-muted-foreground flex items-center gap-1 border border-border/30",
|
|
1664
1664
|
children: [
|
|
1665
|
-
/* @__PURE__ */ r(
|
|
1665
|
+
/* @__PURE__ */ r(B, { size: 10 }),
|
|
1666
1666
|
" Cancel"
|
|
1667
1667
|
]
|
|
1668
1668
|
}
|
|
@@ -1685,8 +1685,8 @@ const Et = (o, e) => {
|
|
|
1685
1685
|
"div",
|
|
1686
1686
|
{
|
|
1687
1687
|
onClick: () => {
|
|
1688
|
-
var
|
|
1689
|
-
return t && ((
|
|
1688
|
+
var T;
|
|
1689
|
+
return t && ((T = g.current) == null ? void 0 : T.click());
|
|
1690
1690
|
},
|
|
1691
1691
|
title: t ? "Upload avatar image" : void 0,
|
|
1692
1692
|
className: S(
|
|
@@ -1694,7 +1694,7 @@ const Et = (o, e) => {
|
|
|
1694
1694
|
t && "cursor-pointer"
|
|
1695
1695
|
),
|
|
1696
1696
|
children: [
|
|
1697
|
-
|
|
1697
|
+
L(24),
|
|
1698
1698
|
t && /* @__PURE__ */ r("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity", children: /* @__PURE__ */ r(Ue, { size: 14, className: "text-white" }) })
|
|
1699
1699
|
]
|
|
1700
1700
|
}
|
|
@@ -1706,7 +1706,7 @@ const Et = (o, e) => {
|
|
|
1706
1706
|
"button",
|
|
1707
1707
|
{
|
|
1708
1708
|
type: "button",
|
|
1709
|
-
onClick: () =>
|
|
1709
|
+
onClick: () => k(!0),
|
|
1710
1710
|
title: "Edit Profile",
|
|
1711
1711
|
"aria-label": "Edit Profile",
|
|
1712
1712
|
className: "p-1 text-muted-foreground hover:text-foreground hover:bg-accent/40 rounded transition-colors",
|
|
@@ -1718,58 +1718,58 @@ const Et = (o, e) => {
|
|
|
1718
1718
|
d && /* @__PURE__ */ r("span", { className: "text-[9px] text-muted-foreground/60 truncate font-mono mt-0.5", children: d })
|
|
1719
1719
|
] })
|
|
1720
1720
|
] }),
|
|
1721
|
-
e.map((
|
|
1722
|
-
const
|
|
1721
|
+
e.map((T) => {
|
|
1722
|
+
const P = T.icon;
|
|
1723
1723
|
return /* @__PURE__ */ c(
|
|
1724
1724
|
"button",
|
|
1725
1725
|
{
|
|
1726
1726
|
type: "button",
|
|
1727
1727
|
role: "menuitem",
|
|
1728
1728
|
onClick: () => {
|
|
1729
|
-
|
|
1729
|
+
T.onSelect(), p(!1);
|
|
1730
1730
|
},
|
|
1731
1731
|
className: S(
|
|
1732
1732
|
"w-full px-2 py-1.5 text-left rounded-md text-[11px] font-medium flex items-center gap-2 cursor-pointer transition-colors",
|
|
1733
|
-
|
|
1734
|
-
|
|
1733
|
+
T.destructive ? "text-destructive hover:bg-destructive/10" : "hover:bg-accent/60 hover:text-accent-foreground",
|
|
1734
|
+
T.divider && "border-t border-border/20 pt-2 mt-1"
|
|
1735
1735
|
),
|
|
1736
1736
|
children: [
|
|
1737
|
-
|
|
1738
|
-
|
|
1737
|
+
P && /* @__PURE__ */ r(P, { size: 12, className: "opacity-70" }),
|
|
1738
|
+
T.label
|
|
1739
1739
|
]
|
|
1740
1740
|
},
|
|
1741
|
-
|
|
1741
|
+
T.id
|
|
1742
1742
|
);
|
|
1743
1743
|
})
|
|
1744
1744
|
] })
|
|
1745
1745
|
}
|
|
1746
1746
|
)
|
|
1747
1747
|
] });
|
|
1748
|
-
},
|
|
1749
|
-
const e =
|
|
1748
|
+
}, qt = (o) => {
|
|
1749
|
+
const e = H((d) => d.name), n = H((d) => d.role), t = H((d) => d.email), a = H((d) => d.avatarUrl), s = H((d) => d.customAvatar), l = H((d) => d.updateProfile), u = H((d) => d.setCustomAvatar);
|
|
1750
1750
|
return /* @__PURE__ */ r(
|
|
1751
|
-
|
|
1751
|
+
It,
|
|
1752
1752
|
{
|
|
1753
1753
|
...o,
|
|
1754
1754
|
profile: { name: e, role: n, email: t, avatarUrl: s || a },
|
|
1755
1755
|
onProfileChange: l,
|
|
1756
1756
|
onAvatarChange: (d) => {
|
|
1757
|
-
const
|
|
1758
|
-
|
|
1759
|
-
typeof
|
|
1760
|
-
},
|
|
1757
|
+
const m = new FileReader();
|
|
1758
|
+
m.onloadend = () => {
|
|
1759
|
+
typeof m.result == "string" && u(m.result);
|
|
1760
|
+
}, m.readAsDataURL(d);
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
1763
1763
|
);
|
|
1764
|
-
},
|
|
1764
|
+
}, Qt = ({ title: o, subtitle: e, icon: n, className: t }) => /* @__PURE__ */ c("div", { className: S("flex items-center space-x-3 select-none", t), children: [
|
|
1765
1765
|
n && /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-lg bg-primary/10 border border-primary/30 flex items-center justify-center text-primary shadow-inner shrink-0", children: n }),
|
|
1766
1766
|
/* @__PURE__ */ c("div", { className: "min-w-0", children: [
|
|
1767
1767
|
/* @__PURE__ */ r("h1", { className: "text-xs font-black uppercase tracking-wider text-foreground font-mono truncate", children: o }),
|
|
1768
1768
|
e && /* @__PURE__ */ r("p", { className: "text-[9px] text-muted-foreground font-semibold truncate", children: e })
|
|
1769
1769
|
] })
|
|
1770
|
-
] }),
|
|
1771
|
-
const s =
|
|
1772
|
-
return
|
|
1770
|
+
] }), Ot = ({ x: o, y: e, items: n, onClose: t, className: a }) => {
|
|
1771
|
+
const s = M(null);
|
|
1772
|
+
return O(() => {
|
|
1773
1773
|
const l = (i) => {
|
|
1774
1774
|
s.current && !s.current.contains(i.target) && t();
|
|
1775
1775
|
}, u = (i) => {
|
|
@@ -1815,7 +1815,7 @@ const Et = (o, e) => {
|
|
|
1815
1815
|
] }, `${l.label}-${u}`))
|
|
1816
1816
|
}
|
|
1817
1817
|
);
|
|
1818
|
-
},
|
|
1818
|
+
}, Xt = ({
|
|
1819
1819
|
columns: o,
|
|
1820
1820
|
data: e,
|
|
1821
1821
|
onRowClick: n,
|
|
@@ -1827,85 +1827,85 @@ const Et = (o, e) => {
|
|
|
1827
1827
|
placeholder: i = "No data available",
|
|
1828
1828
|
className: d
|
|
1829
1829
|
}) => {
|
|
1830
|
-
const [
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
}, [
|
|
1834
|
-
const
|
|
1835
|
-
if (!
|
|
1836
|
-
const v =
|
|
1837
|
-
return e.filter((D) => Object.values(D).some((
|
|
1838
|
-
}, [e,
|
|
1839
|
-
if (!
|
|
1840
|
-
const { key: v, direction: D } =
|
|
1841
|
-
return [...
|
|
1842
|
-
const
|
|
1843
|
-
if (
|
|
1844
|
-
if (
|
|
1845
|
-
if (
|
|
1846
|
-
const Z = Number(
|
|
1830
|
+
const [m, f] = A(""), [p, N] = A(null), [k, w] = A(-1), h = M(null);
|
|
1831
|
+
O(() => {
|
|
1832
|
+
w(-1);
|
|
1833
|
+
}, [m, p]);
|
|
1834
|
+
const x = j(() => {
|
|
1835
|
+
if (!m) return e;
|
|
1836
|
+
const v = m.toLowerCase();
|
|
1837
|
+
return e.filter((D) => Object.values(D).some((I) => I == null ? !1 : String(I).toLowerCase().includes(v)));
|
|
1838
|
+
}, [e, m]), b = j(() => {
|
|
1839
|
+
if (!p) return x;
|
|
1840
|
+
const { key: v, direction: D } = p;
|
|
1841
|
+
return [...x].sort((I, $) => {
|
|
1842
|
+
const R = I[v], z = $[v];
|
|
1843
|
+
if (R === z) return 0;
|
|
1844
|
+
if (R == null) return 1;
|
|
1845
|
+
if (z == null) return -1;
|
|
1846
|
+
const Z = Number(R), ee = Number(z);
|
|
1847
1847
|
if (!isNaN(Z) && !isNaN(ee))
|
|
1848
1848
|
return D === "asc" ? Z - ee : ee - Z;
|
|
1849
|
-
const de = String(
|
|
1849
|
+
const de = String(R).toLowerCase(), ce = String(z).toLowerCase();
|
|
1850
1850
|
return D === "asc" ? de.localeCompare(ce) : ce.localeCompare(de);
|
|
1851
1851
|
});
|
|
1852
|
-
}, [
|
|
1853
|
-
D !== !1 &&
|
|
1854
|
-
},
|
|
1855
|
-
if (!(
|
|
1852
|
+
}, [x, p]), y = (v, D) => {
|
|
1853
|
+
D !== !1 && N((I) => !I || I.key !== v ? { key: v, direction: "asc" } : I.direction === "asc" ? { key: v, direction: "desc" } : null);
|
|
1854
|
+
}, g = (v) => {
|
|
1855
|
+
if (!(b.length === 0 || u)) {
|
|
1856
1856
|
if (v.key === "ArrowDown")
|
|
1857
|
-
v.preventDefault(),
|
|
1858
|
-
const
|
|
1859
|
-
return
|
|
1857
|
+
v.preventDefault(), w((D) => {
|
|
1858
|
+
const I = D + 1;
|
|
1859
|
+
return I >= b.length ? 0 : I;
|
|
1860
1860
|
});
|
|
1861
1861
|
else if (v.key === "ArrowUp")
|
|
1862
|
-
v.preventDefault(),
|
|
1863
|
-
const
|
|
1864
|
-
return
|
|
1862
|
+
v.preventDefault(), w((D) => {
|
|
1863
|
+
const I = D - 1;
|
|
1864
|
+
return I < 0 ? b.length - 1 : I;
|
|
1865
1865
|
});
|
|
1866
|
-
else if ((v.key === "Enter" || v.key === " ") && (v.preventDefault(),
|
|
1867
|
-
const D =
|
|
1866
|
+
else if ((v.key === "Enter" || v.key === " ") && (v.preventDefault(), k >= 0 && k < b.length)) {
|
|
1867
|
+
const D = b[k];
|
|
1868
1868
|
n && n(D);
|
|
1869
1869
|
}
|
|
1870
1870
|
}
|
|
1871
|
-
},
|
|
1871
|
+
}, C = (v) => v.sortable === !1 ? null : (p == null ? void 0 : p.key) !== v.key ? /* @__PURE__ */ r(Be, { size: 14, className: "text-muted-foreground/60 ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity" }) : p.direction === "asc" ? /* @__PURE__ */ r(we, { size: 14, className: "text-primary ml-1.5" }) : /* @__PURE__ */ r(ke, { size: 14, className: "text-primary ml-1.5" }), E = () => /* @__PURE__ */ r("tr", { role: "row", className: "border-b border-border bg-muted/30 select-none", children: o.map((v) => /* @__PURE__ */ r(
|
|
1872
1872
|
"th",
|
|
1873
1873
|
{
|
|
1874
1874
|
role: "columnheader",
|
|
1875
|
-
"aria-sort": (
|
|
1875
|
+
"aria-sort": (p == null ? void 0 : p.key) === v.key ? p.direction === "asc" ? "ascending" : "descending" : "none",
|
|
1876
1876
|
className: S(
|
|
1877
1877
|
"p-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider text-left transition-colors",
|
|
1878
1878
|
v.sortable !== !1 && "cursor-pointer hover:bg-accent/30 hover:text-foreground group"
|
|
1879
1879
|
),
|
|
1880
1880
|
style: { width: v.width },
|
|
1881
|
-
onClick: () =>
|
|
1881
|
+
onClick: () => y(v.key, v.sortable),
|
|
1882
1882
|
children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
1883
1883
|
/* @__PURE__ */ r("span", { children: v.header }),
|
|
1884
|
-
|
|
1884
|
+
C(v)
|
|
1885
1885
|
] })
|
|
1886
1886
|
},
|
|
1887
1887
|
v.key
|
|
1888
|
-
)) }),
|
|
1889
|
-
const
|
|
1888
|
+
)) }), L = (v, D) => {
|
|
1889
|
+
const I = t !== void 0 && v[a] === t;
|
|
1890
1890
|
return /* @__PURE__ */ r(
|
|
1891
1891
|
"tr",
|
|
1892
1892
|
{
|
|
1893
1893
|
role: "row",
|
|
1894
|
-
"aria-selected":
|
|
1894
|
+
"aria-selected": I,
|
|
1895
1895
|
onClick: () => n && n(v),
|
|
1896
1896
|
className: S(
|
|
1897
1897
|
"border-b border-border/40 hover:bg-accent/40 transition-colors cursor-pointer text-sm outline-none",
|
|
1898
|
-
|
|
1899
|
-
|
|
1898
|
+
I && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
|
|
1899
|
+
k === D && "bg-accent/60 ring-1 ring-inset ring-ring"
|
|
1900
1900
|
),
|
|
1901
|
-
children: o.map((
|
|
1902
|
-
const
|
|
1903
|
-
return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children:
|
|
1901
|
+
children: o.map((R) => {
|
|
1902
|
+
const z = v[R.key];
|
|
1903
|
+
return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: R.render ? R.render(z, v) : z != null ? String(z) : "" }, R.key);
|
|
1904
1904
|
})
|
|
1905
1905
|
},
|
|
1906
1906
|
String(v[a] || D)
|
|
1907
1907
|
);
|
|
1908
|
-
},
|
|
1908
|
+
}, T = j(() => ({
|
|
1909
1909
|
Table: (v) => /* @__PURE__ */ r(
|
|
1910
1910
|
"table",
|
|
1911
1911
|
{
|
|
@@ -1916,51 +1916,51 @@ const Et = (o, e) => {
|
|
|
1916
1916
|
),
|
|
1917
1917
|
TableHead: se.forwardRef((v, D) => /* @__PURE__ */ r("thead", { ref: D, ...v, className: "sticky top-0 bg-background z-10 shadow-[0_1px_0_0_rgba(0,0,0,0.1)] dark:shadow-[0_1px_0_0_rgba(255,255,255,0.05)]" })),
|
|
1918
1918
|
TableBody: se.forwardRef((v, D) => /* @__PURE__ */ r("tbody", { ref: D, ...v })),
|
|
1919
|
-
TableRow: ({ item: v, context: D, ...
|
|
1920
|
-
if (!D || !v) return /* @__PURE__ */ r("tr", { ...
|
|
1921
|
-
const
|
|
1919
|
+
TableRow: ({ item: v, context: D, ...I }) => {
|
|
1920
|
+
if (!D || !v) return /* @__PURE__ */ r("tr", { ...I });
|
|
1921
|
+
const $ = D.selectedRowId !== void 0 && v[D.rowKey] === D.selectedRowId, R = D.focusedIndex === I["data-index"];
|
|
1922
1922
|
return /* @__PURE__ */ r(
|
|
1923
1923
|
"tr",
|
|
1924
1924
|
{
|
|
1925
|
-
...
|
|
1925
|
+
...I,
|
|
1926
1926
|
onClick: () => {
|
|
1927
|
-
var
|
|
1928
|
-
return (
|
|
1927
|
+
var z;
|
|
1928
|
+
return (z = D.onRowClick) == null ? void 0 : z.call(D, v);
|
|
1929
1929
|
},
|
|
1930
1930
|
className: S(
|
|
1931
1931
|
"border-b border-border/40 hover:bg-accent/40 transition-colors cursor-pointer text-sm outline-none",
|
|
1932
|
-
|
|
1933
|
-
|
|
1932
|
+
$ && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
|
|
1933
|
+
R && "bg-accent/60 ring-1 ring-inset ring-ring"
|
|
1934
1934
|
)
|
|
1935
1935
|
}
|
|
1936
1936
|
);
|
|
1937
1937
|
}
|
|
1938
|
-
}), []),
|
|
1938
|
+
}), []), P = () => u ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center h-64 space-y-3", children: [
|
|
1939
1939
|
/* @__PURE__ */ r(Ne, { className: "animate-spin text-primary", size: 24 }),
|
|
1940
1940
|
/* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground", children: "Loading dataset..." })
|
|
1941
|
-
] }) :
|
|
1941
|
+
] }) : b.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center h-48 text-center px-4", children: [
|
|
1942
1942
|
/* @__PURE__ */ r("span", { className: "text-sm font-medium text-foreground", children: i }),
|
|
1943
1943
|
/* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground mt-1", children: "No items matched your search query." })
|
|
1944
1944
|
] }) : s ? /* @__PURE__ */ r("div", { className: "flex-1 min-h-[300px] h-full relative", children: /* @__PURE__ */ r(
|
|
1945
|
-
|
|
1945
|
+
Ge,
|
|
1946
1946
|
{
|
|
1947
|
-
data:
|
|
1947
|
+
data: b,
|
|
1948
1948
|
context: {
|
|
1949
1949
|
selectedRowId: t,
|
|
1950
|
-
focusedIndex:
|
|
1950
|
+
focusedIndex: k,
|
|
1951
1951
|
rowKey: a,
|
|
1952
1952
|
onRowClick: n
|
|
1953
1953
|
},
|
|
1954
|
-
components:
|
|
1955
|
-
fixedHeaderContent:
|
|
1956
|
-
itemContent: (v, D) => /* @__PURE__ */ r(he, { children: o.map((
|
|
1957
|
-
const
|
|
1958
|
-
return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children:
|
|
1954
|
+
components: T,
|
|
1955
|
+
fixedHeaderContent: E,
|
|
1956
|
+
itemContent: (v, D) => /* @__PURE__ */ r(he, { children: o.map((I) => {
|
|
1957
|
+
const $ = D[I.key];
|
|
1958
|
+
return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: I.render ? I.render($, D) : $ != null ? String($) : "" }, I.key);
|
|
1959
1959
|
}) })
|
|
1960
1960
|
}
|
|
1961
1961
|
) }) : /* @__PURE__ */ r("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ c("table", { role: "grid", className: "w-full border-collapse text-left bg-background text-foreground", children: [
|
|
1962
|
-
/* @__PURE__ */ r("thead", { children:
|
|
1963
|
-
/* @__PURE__ */ r("tbody", { children:
|
|
1962
|
+
/* @__PURE__ */ r("thead", { children: E() }),
|
|
1963
|
+
/* @__PURE__ */ r("tbody", { children: b.map((v, D) => L(v, D)) })
|
|
1964
1964
|
] }) });
|
|
1965
1965
|
return /* @__PURE__ */ c(
|
|
1966
1966
|
"div",
|
|
@@ -1969,7 +1969,7 @@ const Et = (o, e) => {
|
|
|
1969
1969
|
role: "region",
|
|
1970
1970
|
"aria-label": "Data Grid",
|
|
1971
1971
|
tabIndex: 0,
|
|
1972
|
-
onKeyDown:
|
|
1972
|
+
onKeyDown: g,
|
|
1973
1973
|
className: S(
|
|
1974
1974
|
"flex flex-col h-full bg-background border border-border rounded-lg shadow-sm overflow-hidden focus:outline-none focus:ring-1 focus:ring-ring focus:border-transparent",
|
|
1975
1975
|
d
|
|
@@ -1984,32 +1984,32 @@ const Et = (o, e) => {
|
|
|
1984
1984
|
type: "text",
|
|
1985
1985
|
placeholder: "Filter table rows...",
|
|
1986
1986
|
className: "w-full bg-secondary/40 border border-border rounded-md pl-8 pr-7 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary focus:border-transparent transition-all",
|
|
1987
|
-
value:
|
|
1988
|
-
onChange: (v) =>
|
|
1987
|
+
value: m,
|
|
1988
|
+
onChange: (v) => f(v.target.value)
|
|
1989
1989
|
}
|
|
1990
1990
|
),
|
|
1991
|
-
|
|
1991
|
+
m && /* @__PURE__ */ r(
|
|
1992
1992
|
"button",
|
|
1993
1993
|
{
|
|
1994
|
-
onClick: () =>
|
|
1994
|
+
onClick: () => f(""),
|
|
1995
1995
|
className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
|
|
1996
1996
|
"aria-label": "Clear filter",
|
|
1997
|
-
children: /* @__PURE__ */ r(
|
|
1997
|
+
children: /* @__PURE__ */ r(B, { size: 12 })
|
|
1998
1998
|
}
|
|
1999
1999
|
)
|
|
2000
2000
|
] }),
|
|
2001
2001
|
/* @__PURE__ */ c("div", { className: "text-[11px] text-muted-foreground font-medium ml-4", children: [
|
|
2002
|
-
|
|
2002
|
+
b.length,
|
|
2003
2003
|
" of ",
|
|
2004
2004
|
e.length,
|
|
2005
2005
|
" records"
|
|
2006
2006
|
] })
|
|
2007
2007
|
] }),
|
|
2008
|
-
|
|
2008
|
+
P()
|
|
2009
2009
|
]
|
|
2010
2010
|
}
|
|
2011
2011
|
);
|
|
2012
|
-
},
|
|
2012
|
+
}, Zt = ({
|
|
2013
2013
|
results: o,
|
|
2014
2014
|
onQueryChange: e,
|
|
2015
2015
|
onSelect: n,
|
|
@@ -2018,35 +2018,35 @@ const Et = (o, e) => {
|
|
|
2018
2018
|
debounceMs: s = 200,
|
|
2019
2019
|
className: l
|
|
2020
2020
|
}) => {
|
|
2021
|
-
const [u, i] = A(""), [d,
|
|
2022
|
-
() =>
|
|
2023
|
-
[
|
|
2021
|
+
const [u, i] = A(""), [d, m] = A(!1), [f, p] = A(0), N = M(null), k = M(null), w = j(() => t || [...new Set(o.map((y) => y.category))], [t, o]), h = j(
|
|
2022
|
+
() => w.flatMap((y) => o.filter((g) => g.category === y)),
|
|
2023
|
+
[w, o]
|
|
2024
2024
|
);
|
|
2025
|
-
|
|
2026
|
-
const
|
|
2027
|
-
|
|
2025
|
+
O(() => {
|
|
2026
|
+
const y = (g) => {
|
|
2027
|
+
N.current && !N.current.contains(g.target) && m(!1);
|
|
2028
2028
|
};
|
|
2029
|
-
return document.addEventListener("mousedown",
|
|
2030
|
-
}, []),
|
|
2029
|
+
return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
2030
|
+
}, []), O(() => {
|
|
2031
2031
|
if (!e) return;
|
|
2032
|
-
const
|
|
2033
|
-
return () => window.clearTimeout(
|
|
2034
|
-
}, [u, s, e]),
|
|
2035
|
-
|
|
2032
|
+
const y = window.setTimeout(() => e(u), s);
|
|
2033
|
+
return () => window.clearTimeout(y);
|
|
2034
|
+
}, [u, s, e]), O(() => {
|
|
2035
|
+
p(0);
|
|
2036
2036
|
}, [o]);
|
|
2037
|
-
const
|
|
2038
|
-
n(
|
|
2039
|
-
},
|
|
2040
|
-
var
|
|
2037
|
+
const x = (y) => {
|
|
2038
|
+
n(y), m(!1), i("");
|
|
2039
|
+
}, b = (y) => {
|
|
2040
|
+
var g;
|
|
2041
2041
|
if (!d) {
|
|
2042
|
-
(
|
|
2042
|
+
(y.key === "ArrowDown" || y.key === "Enter") && m(!0);
|
|
2043
2043
|
return;
|
|
2044
2044
|
}
|
|
2045
|
-
|
|
2046
|
-
(
|
|
2047
|
-
)) :
|
|
2045
|
+
y.key === "ArrowDown" ? (y.preventDefault(), p((C) => h.length ? (C + 1) % h.length : 0)) : y.key === "ArrowUp" ? (y.preventDefault(), p(
|
|
2046
|
+
(C) => h.length ? (C - 1 + h.length) % h.length : 0
|
|
2047
|
+
)) : y.key === "Enter" ? (y.preventDefault(), h[f] && x(h[f])) : y.key === "Escape" && (y.preventDefault(), m(!1), (g = k.current) == null || g.blur());
|
|
2048
2048
|
};
|
|
2049
|
-
return /* @__PURE__ */ c("div", { ref:
|
|
2049
|
+
return /* @__PURE__ */ c("div", { ref: N, className: S("relative w-full", l), children: [
|
|
2050
2050
|
/* @__PURE__ */ c("div", { className: "relative flex items-center", children: [
|
|
2051
2051
|
/* @__PURE__ */ r(
|
|
2052
2052
|
X,
|
|
@@ -2058,18 +2058,18 @@ const Et = (o, e) => {
|
|
|
2058
2058
|
/* @__PURE__ */ r(
|
|
2059
2059
|
"input",
|
|
2060
2060
|
{
|
|
2061
|
-
ref:
|
|
2061
|
+
ref: k,
|
|
2062
2062
|
type: "text",
|
|
2063
2063
|
role: "combobox",
|
|
2064
2064
|
"aria-expanded": d,
|
|
2065
2065
|
"aria-label": a,
|
|
2066
2066
|
value: u,
|
|
2067
2067
|
placeholder: a,
|
|
2068
|
-
onChange: (
|
|
2069
|
-
i(
|
|
2068
|
+
onChange: (y) => {
|
|
2069
|
+
i(y.target.value), m(!0);
|
|
2070
2070
|
},
|
|
2071
|
-
onFocus: () =>
|
|
2072
|
-
onKeyDown:
|
|
2071
|
+
onFocus: () => m(!0),
|
|
2072
|
+
onKeyDown: b,
|
|
2073
2073
|
className: "w-full h-7 pl-8 pr-7 bg-secondary/35 border border-border/40 rounded-md text-xs text-foreground placeholder:text-muted-foreground/75 focus:outline-none focus:ring-1 focus:ring-primary/40 focus:bg-background/95 focus:border-primary/50 transition-all font-sans"
|
|
2074
2074
|
}
|
|
2075
2075
|
),
|
|
@@ -2078,12 +2078,12 @@ const Et = (o, e) => {
|
|
|
2078
2078
|
{
|
|
2079
2079
|
type: "button",
|
|
2080
2080
|
onClick: () => {
|
|
2081
|
-
var
|
|
2082
|
-
i(""), (
|
|
2081
|
+
var y;
|
|
2082
|
+
i(""), (y = k.current) == null || y.focus();
|
|
2083
2083
|
},
|
|
2084
2084
|
"aria-label": "Clear search",
|
|
2085
2085
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
|
|
2086
|
-
children: /* @__PURE__ */ r(
|
|
2086
|
+
children: /* @__PURE__ */ r(B, { size: 11 })
|
|
2087
2087
|
}
|
|
2088
2088
|
)
|
|
2089
2089
|
] }),
|
|
@@ -2097,44 +2097,44 @@ const Et = (o, e) => {
|
|
|
2097
2097
|
'No results found matching "',
|
|
2098
2098
|
u,
|
|
2099
2099
|
'"'
|
|
2100
|
-
] }) :
|
|
2101
|
-
const
|
|
2102
|
-
return
|
|
2103
|
-
/* @__PURE__ */ r("div", { className: "px-3 py-1 text-[9px] font-bold uppercase tracking-wider text-muted-foreground/80 bg-muted/40 border-y border-border/20 first:border-t-0", children:
|
|
2104
|
-
|
|
2105
|
-
const
|
|
2100
|
+
] }) : w.map((y) => {
|
|
2101
|
+
const g = o.filter((C) => C.category === y);
|
|
2102
|
+
return g.length === 0 ? null : /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
2103
|
+
/* @__PURE__ */ r("div", { className: "px-3 py-1 text-[9px] font-bold uppercase tracking-wider text-muted-foreground/80 bg-muted/40 border-y border-border/20 first:border-t-0", children: y }),
|
|
2104
|
+
g.map((C) => {
|
|
2105
|
+
const E = C.icon, L = h.indexOf(C), T = L === f;
|
|
2106
2106
|
return /* @__PURE__ */ c(
|
|
2107
2107
|
"div",
|
|
2108
2108
|
{
|
|
2109
2109
|
role: "option",
|
|
2110
|
-
"aria-selected":
|
|
2111
|
-
onClick: () =>
|
|
2112
|
-
onMouseEnter: () =>
|
|
2110
|
+
"aria-selected": T,
|
|
2111
|
+
onClick: () => x(C),
|
|
2112
|
+
onMouseEnter: () => p(L),
|
|
2113
2113
|
className: S(
|
|
2114
2114
|
"px-3 py-2 cursor-pointer flex items-start space-x-2.5 transition-colors border-l-2",
|
|
2115
|
-
|
|
2115
|
+
T ? "bg-accent text-accent-foreground border-primary" : "border-transparent hover:bg-accent/40"
|
|
2116
2116
|
),
|
|
2117
2117
|
children: [
|
|
2118
|
-
|
|
2118
|
+
E && /* @__PURE__ */ r(
|
|
2119
2119
|
"div",
|
|
2120
2120
|
{
|
|
2121
2121
|
className: S(
|
|
2122
2122
|
"mt-0.5 p-1 rounded bg-muted/50",
|
|
2123
|
-
|
|
2123
|
+
T && "bg-background text-primary"
|
|
2124
2124
|
),
|
|
2125
|
-
children: /* @__PURE__ */ r(
|
|
2125
|
+
children: /* @__PURE__ */ r(E, { size: 12 })
|
|
2126
2126
|
}
|
|
2127
2127
|
),
|
|
2128
2128
|
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
2129
|
-
/* @__PURE__ */ r("div", { className: "text-xs font-medium truncate", children:
|
|
2130
|
-
|
|
2129
|
+
/* @__PURE__ */ r("div", { className: "text-xs font-medium truncate", children: C.title }),
|
|
2130
|
+
C.description && /* @__PURE__ */ r("div", { className: "text-[10px] text-muted-foreground truncate mt-0.5", children: C.description })
|
|
2131
2131
|
] })
|
|
2132
2132
|
]
|
|
2133
2133
|
},
|
|
2134
|
-
`${
|
|
2134
|
+
`${C.category}-${C.id}`
|
|
2135
2135
|
);
|
|
2136
2136
|
})
|
|
2137
|
-
] },
|
|
2137
|
+
] }, y);
|
|
2138
2138
|
}) }),
|
|
2139
2139
|
h.length > 0 && /* @__PURE__ */ c("div", { className: "px-3 py-1.5 border-t border-border bg-muted/20 flex items-center justify-between text-[9px] text-muted-foreground select-none shrink-0 font-mono", children: [
|
|
2140
2140
|
/* @__PURE__ */ c("div", { className: "flex space-x-2", children: [
|
|
@@ -2155,7 +2155,7 @@ const Et = (o, e) => {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
)
|
|
2157
2157
|
] });
|
|
2158
|
-
},
|
|
2158
|
+
}, er = ({
|
|
2159
2159
|
placeholder: o = "Search...",
|
|
2160
2160
|
onSearch: e,
|
|
2161
2161
|
results: n,
|
|
@@ -2164,19 +2164,19 @@ const Et = (o, e) => {
|
|
|
2164
2164
|
loading: s = !1,
|
|
2165
2165
|
className: l
|
|
2166
2166
|
}) => {
|
|
2167
|
-
const [u, i] = A(""), [d,
|
|
2168
|
-
|
|
2167
|
+
const [u, i] = A(""), [d, m] = A(!1), [f, p] = A(-1), N = M(null);
|
|
2168
|
+
O(() => {
|
|
2169
2169
|
const h = setTimeout(() => {
|
|
2170
2170
|
e(u);
|
|
2171
2171
|
}, 300);
|
|
2172
2172
|
return () => clearTimeout(h);
|
|
2173
2173
|
}, [u, e]);
|
|
2174
|
-
const
|
|
2174
|
+
const k = a.filter(
|
|
2175
2175
|
(h) => h.toLowerCase().includes(u.toLowerCase()) && h.toLowerCase() !== u.toLowerCase()
|
|
2176
|
-
),
|
|
2177
|
-
d &&
|
|
2176
|
+
), w = (h) => {
|
|
2177
|
+
d && k.length > 0 && (h.key === "ArrowDown" ? (h.preventDefault(), p((x) => (x + 1) % k.length)) : h.key === "ArrowUp" ? (h.preventDefault(), p((x) => (x - 1 + k.length) % k.length)) : h.key === "Enter" && f >= 0 && (h.preventDefault(), i(k[f]), m(!1)));
|
|
2178
2178
|
};
|
|
2179
|
-
return /* @__PURE__ */ c("div", { ref:
|
|
2179
|
+
return /* @__PURE__ */ c("div", { ref: N, className: S("flex flex-col h-full bg-background", l), children: [
|
|
2180
2180
|
/* @__PURE__ */ c("div", { className: "p-3 border-b border-border/50", children: [
|
|
2181
2181
|
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2182
2182
|
/* @__PURE__ */ r("div", { className: "absolute left-2.5 top-2.5 text-muted-foreground", children: s ? /* @__PURE__ */ r(Ne, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ r(X, { size: 14 }) }),
|
|
@@ -2188,10 +2188,10 @@ const Et = (o, e) => {
|
|
|
2188
2188
|
placeholder: o,
|
|
2189
2189
|
value: u,
|
|
2190
2190
|
onChange: (h) => {
|
|
2191
|
-
i(h.target.value),
|
|
2191
|
+
i(h.target.value), m(!0), p(-1);
|
|
2192
2192
|
},
|
|
2193
|
-
onKeyDown:
|
|
2194
|
-
onFocus: () =>
|
|
2193
|
+
onKeyDown: w,
|
|
2194
|
+
onFocus: () => m(!0)
|
|
2195
2195
|
}
|
|
2196
2196
|
),
|
|
2197
2197
|
u && /* @__PURE__ */ r(
|
|
@@ -2201,22 +2201,22 @@ const Et = (o, e) => {
|
|
|
2201
2201
|
i(""), e("");
|
|
2202
2202
|
},
|
|
2203
2203
|
className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
|
|
2204
|
-
children: /* @__PURE__ */ r(
|
|
2204
|
+
children: /* @__PURE__ */ r(B, { size: 14 })
|
|
2205
2205
|
}
|
|
2206
2206
|
)
|
|
2207
2207
|
] }),
|
|
2208
|
-
d &&
|
|
2208
|
+
d && k.length > 0 && /* @__PURE__ */ r("div", { className: "absolute left-3 right-3 mt-1 bg-popover border shadow-lg rounded-md z-50 py-1 overflow-hidden", children: k.map((h, x) => /* @__PURE__ */ c(
|
|
2209
2209
|
"div",
|
|
2210
2210
|
{
|
|
2211
2211
|
className: S(
|
|
2212
2212
|
"px-3 py-1.5 text-xs cursor-pointer flex items-center space-x-2",
|
|
2213
|
-
|
|
2213
|
+
x === f ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
|
|
2214
2214
|
),
|
|
2215
2215
|
onClick: () => {
|
|
2216
|
-
i(h),
|
|
2216
|
+
i(h), m(!1);
|
|
2217
2217
|
},
|
|
2218
2218
|
children: [
|
|
2219
|
-
/* @__PURE__ */ r(
|
|
2219
|
+
/* @__PURE__ */ r(Je, { size: 12, className: "text-muted-foreground" }),
|
|
2220
2220
|
/* @__PURE__ */ r("span", { children: h })
|
|
2221
2221
|
]
|
|
2222
2222
|
},
|
|
@@ -2224,14 +2224,14 @@ const Et = (o, e) => {
|
|
|
2224
2224
|
)) })
|
|
2225
2225
|
] }),
|
|
2226
2226
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: n.length === 0 ? /* @__PURE__ */ r("div", { className: "p-8 text-center text-xs text-muted-foreground italic", children: u ? `No results found for "${u}"` : "Type to start searching..." }) : /* @__PURE__ */ r("div", { className: "py-2", children: n.map((h) => {
|
|
2227
|
-
const
|
|
2227
|
+
const x = h.icon;
|
|
2228
2228
|
return /* @__PURE__ */ r(
|
|
2229
2229
|
"div",
|
|
2230
2230
|
{
|
|
2231
2231
|
onClick: () => t(h),
|
|
2232
2232
|
className: "px-4 py-2 hover:bg-accent/50 cursor-pointer group transition-colors border-l-2 border-transparent hover:border-primary",
|
|
2233
2233
|
children: /* @__PURE__ */ c("div", { className: "flex items-start space-x-3", children: [
|
|
2234
|
-
|
|
2234
|
+
x && /* @__PURE__ */ r("div", { className: "mt-0.5 p-1 rounded bg-muted group-hover:bg-background transition-colors", children: /* @__PURE__ */ r(x, { size: 14, className: "text-muted-foreground group-hover:text-primary" }) }),
|
|
2235
2235
|
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
2236
2236
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
|
|
2237
2237
|
/* @__PURE__ */ r("span", { className: "text-xs font-medium truncate", children: h.title }),
|
|
@@ -2245,103 +2245,77 @@ const Et = (o, e) => {
|
|
|
2245
2245
|
);
|
|
2246
2246
|
}) }) })
|
|
2247
2247
|
] });
|
|
2248
|
-
}, De = (o, e = 0) => o.reduce((n, t) => (n.push({ ...t, level: e }), t.isOpen && t.children && n.push(...De(t.children, e + 1)), n), []),
|
|
2248
|
+
}, De = (o, e = 0) => o.reduce((n, t) => (n.push({ ...t, level: e }), t.isOpen && t.children && n.push(...De(t.children, e + 1)), n), []), At = (o) => {
|
|
2249
|
+
if (!o) return ["background"];
|
|
2250
|
+
const e = [o.isBranch ? "branch" : "leaf"];
|
|
2251
|
+
return o.kind && e.push(o.kind), e;
|
|
2252
|
+
}, tr = ({
|
|
2249
2253
|
data: o,
|
|
2250
2254
|
onToggle: e,
|
|
2251
2255
|
onActivate: n,
|
|
2252
2256
|
onMoveNode: t,
|
|
2253
|
-
actions: a,
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
indent: d = 12,
|
|
2259
|
-
virtualized: f = !0,
|
|
2260
|
-
className: p
|
|
2257
|
+
actions: a = [],
|
|
2258
|
+
indent: s = 12,
|
|
2259
|
+
virtualized: l = !0,
|
|
2260
|
+
"aria-label": u = "Tree",
|
|
2261
|
+
className: i
|
|
2261
2262
|
}) => {
|
|
2262
|
-
const [
|
|
2263
|
-
|
|
2264
|
-
|
|
2263
|
+
const [d, m] = A(null), [f, p] = A(null), N = j(() => De(o), [o]);
|
|
2264
|
+
O(() => {
|
|
2265
|
+
p(null);
|
|
2265
2266
|
}, [o]);
|
|
2266
|
-
const
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
},
|
|
2279
|
-
{
|
|
2280
|
-
id: "rename",
|
|
2281
|
-
label: "Rename",
|
|
2282
|
-
icon: /* @__PURE__ */ r(Ge, { size: 14 }),
|
|
2283
|
-
divider: !0,
|
|
2284
|
-
showFor: ["file", "folder"],
|
|
2285
|
-
onSelect: ({ nodeId: g }) => g && (u == null ? void 0 : u(g))
|
|
2286
|
-
},
|
|
2287
|
-
{
|
|
2288
|
-
id: "delete",
|
|
2289
|
-
label: "Delete",
|
|
2290
|
-
icon: /* @__PURE__ */ r(Ve, { size: 14, className: "text-destructive" }),
|
|
2291
|
-
showFor: ["file", "folder"],
|
|
2292
|
-
onSelect: ({ nodeId: g }) => g && (i == null ? void 0 : i(g))
|
|
2293
|
-
}
|
|
2294
|
-
]).filter(
|
|
2295
|
-
(g) => !g.showFor || m && g.showFor.includes(m.scope)
|
|
2296
|
-
).map((g) => ({
|
|
2297
|
-
label: g.label,
|
|
2298
|
-
icon: g.icon,
|
|
2299
|
-
divider: g.divider,
|
|
2300
|
-
onClick: () => m && g.onSelect(m.context)
|
|
2301
|
-
})), N = (g, b, E) => {
|
|
2302
|
-
g.preventDefault(), g.stopPropagation(), k({
|
|
2303
|
-
x: g.clientX,
|
|
2304
|
-
y: g.clientY,
|
|
2305
|
-
scope: E,
|
|
2267
|
+
const k = a.filter(
|
|
2268
|
+
(x) => !x.showFor || d && x.showFor.some((b) => d.scopes.includes(b))
|
|
2269
|
+
).map((x) => ({
|
|
2270
|
+
label: x.label,
|
|
2271
|
+
icon: x.icon,
|
|
2272
|
+
divider: x.divider,
|
|
2273
|
+
onClick: () => d && x.onSelect(d.context)
|
|
2274
|
+
})), w = (x, b) => {
|
|
2275
|
+
a.length !== 0 && (x.preventDefault(), x.stopPropagation(), m({
|
|
2276
|
+
x: x.clientX,
|
|
2277
|
+
y: x.clientY,
|
|
2278
|
+
scopes: At(b),
|
|
2306
2279
|
context: { nodeId: (b == null ? void 0 : b.id) ?? null, node: b }
|
|
2307
|
-
});
|
|
2308
|
-
},
|
|
2309
|
-
const b =
|
|
2280
|
+
}));
|
|
2281
|
+
}, h = (x) => {
|
|
2282
|
+
const b = N[x], y = !!b.isBranch;
|
|
2310
2283
|
return /* @__PURE__ */ c(
|
|
2311
2284
|
"div",
|
|
2312
2285
|
{
|
|
2313
2286
|
role: "treeitem",
|
|
2314
|
-
"aria-expanded":
|
|
2287
|
+
"aria-expanded": y ? !!b.isOpen : void 0,
|
|
2315
2288
|
"aria-level": b.level + 1,
|
|
2316
2289
|
tabIndex: 0,
|
|
2317
2290
|
draggable: !0,
|
|
2318
|
-
onDragStart: (
|
|
2319
|
-
|
|
2291
|
+
onDragStart: (g) => {
|
|
2292
|
+
g.dataTransfer.setData("text/plain", b.id), g.dataTransfer.effectAllowed = "move";
|
|
2320
2293
|
},
|
|
2321
|
-
onDragOver: (
|
|
2322
|
-
|
|
2294
|
+
onDragOver: (g) => {
|
|
2295
|
+
y && (g.preventDefault(), p(b.id));
|
|
2323
2296
|
},
|
|
2324
|
-
onDragLeave: () =>
|
|
2325
|
-
onDrop: (
|
|
2326
|
-
|
|
2327
|
-
const
|
|
2328
|
-
|
|
2297
|
+
onDragLeave: () => p(null),
|
|
2298
|
+
onDrop: (g) => {
|
|
2299
|
+
g.preventDefault(), p(null);
|
|
2300
|
+
const C = g.dataTransfer.getData("text/plain");
|
|
2301
|
+
C && C !== b.id && y && (t == null || t(C, b.id));
|
|
2329
2302
|
},
|
|
2330
|
-
onClick: () =>
|
|
2303
|
+
onClick: () => y && (e == null ? void 0 : e(b)),
|
|
2331
2304
|
onDoubleClick: () => n == null ? void 0 : n(b),
|
|
2332
|
-
onKeyDown: (
|
|
2333
|
-
|
|
2305
|
+
onKeyDown: (g) => {
|
|
2306
|
+
g.key === "Enter" && (g.preventDefault(), y ? e == null || e(b) : n == null || n(b));
|
|
2334
2307
|
},
|
|
2335
|
-
onContextMenu: (
|
|
2336
|
-
style: { paddingLeft: `${b.level *
|
|
2308
|
+
onContextMenu: (g) => w(g, b),
|
|
2309
|
+
style: { paddingLeft: `${b.level * s + 8}px` },
|
|
2337
2310
|
className: S(
|
|
2338
2311
|
"flex items-center py-1 px-2 cursor-pointer hover:bg-accent hover:text-accent-foreground select-none text-xs",
|
|
2339
2312
|
"transition-colors duration-150 relative focus:outline-none focus:ring-1 focus:ring-ring",
|
|
2340
|
-
|
|
2313
|
+
f === b.id && "bg-primary/20 ring-1 ring-primary/50 rounded-sm",
|
|
2314
|
+
b.className
|
|
2341
2315
|
),
|
|
2342
2316
|
children: [
|
|
2343
|
-
/* @__PURE__ */ r("div", { className: "w-4 h-4 mr-1 flex items-center justify-center", children:
|
|
2344
|
-
/* @__PURE__ */ r("div", { className: "mr-2
|
|
2317
|
+
/* @__PURE__ */ r("div", { className: "w-4 h-4 mr-1 flex items-center justify-center shrink-0", children: y && (b.isOpen ? /* @__PURE__ */ r(ke, { size: 14 }) : /* @__PURE__ */ r(ye, { size: 14 })) }),
|
|
2318
|
+
b.icon && /* @__PURE__ */ r("div", { className: "mr-2 flex items-center shrink-0", children: b.icon }),
|
|
2345
2319
|
/* @__PURE__ */ r("span", { className: "truncate", children: b.label })
|
|
2346
2320
|
]
|
|
2347
2321
|
},
|
|
@@ -2352,24 +2326,25 @@ const Et = (o, e) => {
|
|
|
2352
2326
|
"div",
|
|
2353
2327
|
{
|
|
2354
2328
|
role: "tree",
|
|
2355
|
-
|
|
2356
|
-
|
|
2329
|
+
"aria-label": u,
|
|
2330
|
+
className: S("h-full w-full bg-muted/30", i),
|
|
2331
|
+
onContextMenu: (x) => w(x, null),
|
|
2357
2332
|
children: [
|
|
2358
|
-
|
|
2359
|
-
|
|
2333
|
+
l ? /* @__PURE__ */ r(
|
|
2334
|
+
Ve,
|
|
2360
2335
|
{
|
|
2361
2336
|
style: { height: "100%" },
|
|
2362
|
-
totalCount:
|
|
2363
|
-
itemContent:
|
|
2337
|
+
totalCount: N.length,
|
|
2338
|
+
itemContent: h
|
|
2364
2339
|
}
|
|
2365
|
-
) : /* @__PURE__ */ r("div", { className: "h-full overflow-auto", children:
|
|
2366
|
-
|
|
2367
|
-
|
|
2340
|
+
) : /* @__PURE__ */ r("div", { className: "h-full overflow-auto", children: N.map((x, b) => h(b)) }),
|
|
2341
|
+
d && k.length > 0 && /* @__PURE__ */ r(
|
|
2342
|
+
Ot,
|
|
2368
2343
|
{
|
|
2369
|
-
x:
|
|
2370
|
-
y:
|
|
2371
|
-
items:
|
|
2372
|
-
onClose: () =>
|
|
2344
|
+
x: d.x,
|
|
2345
|
+
y: d.y,
|
|
2346
|
+
items: k,
|
|
2347
|
+
onClose: () => m(null)
|
|
2373
2348
|
}
|
|
2374
2349
|
)
|
|
2375
2350
|
]
|
|
@@ -2377,54 +2352,54 @@ const Et = (o, e) => {
|
|
|
2377
2352
|
);
|
|
2378
2353
|
};
|
|
2379
2354
|
export {
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2355
|
+
qe as ActivityBar,
|
|
2356
|
+
Qt as AppTitle,
|
|
2357
|
+
Ze as ChatPane,
|
|
2358
|
+
kt as CommandPalette,
|
|
2359
|
+
st as CommandRegistry,
|
|
2360
|
+
Qe as ConnectedActivityBar,
|
|
2361
|
+
rt as ConnectedChatPane,
|
|
2362
|
+
Gt as ConnectedCommandPalette,
|
|
2363
|
+
at as ConnectedMenuBar,
|
|
2364
|
+
Vt as ConnectedModal,
|
|
2365
|
+
dt as ConnectedSidebarPane,
|
|
2366
|
+
ut as ConnectedStatusBar,
|
|
2367
|
+
pt as ConnectedTerminalPane,
|
|
2368
|
+
Yt as ConnectedThemeSwitcher,
|
|
2369
|
+
qt as ConnectedUserProfile,
|
|
2370
|
+
Ot as ContextMenu,
|
|
2371
|
+
Bt as DEFAULT_COMMAND_IDS,
|
|
2372
|
+
lt as DEFAULT_SETTINGS_THEMES,
|
|
2373
|
+
Dt as DEFAULT_THEME_OPTIONS,
|
|
2374
|
+
Xt as DataGrid,
|
|
2375
|
+
nt as MenuBar,
|
|
2376
|
+
ot as MenuRegistry,
|
|
2377
|
+
Tt as Modal,
|
|
2378
|
+
_t as NexusWorkspaceShell,
|
|
2379
|
+
Zt as QuickSearch,
|
|
2380
|
+
er as SearchWidget,
|
|
2381
|
+
it as SettingsPanel,
|
|
2382
|
+
_t as ShellLayout,
|
|
2408
2383
|
re as SidebarPane,
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2384
|
+
ct as StatusBar,
|
|
2385
|
+
mt as TerminalPane,
|
|
2386
|
+
Et as ThemeSwitcher,
|
|
2387
|
+
tr as TreeWidget,
|
|
2388
|
+
It as UserProfile,
|
|
2414
2389
|
S as cn,
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2390
|
+
W as commandRegistry,
|
|
2391
|
+
ht as componentRegistry,
|
|
2392
|
+
Jt as initializeShell,
|
|
2418
2393
|
le as menuRegistry,
|
|
2419
|
-
|
|
2394
|
+
Ht as pluginRegistry,
|
|
2420
2395
|
Q as useChatStore,
|
|
2421
|
-
|
|
2422
|
-
|
|
2396
|
+
Wt as useKeyboardShortcuts,
|
|
2397
|
+
bt as useLayoutStore,
|
|
2423
2398
|
Te as useModalStore,
|
|
2424
2399
|
ae as useRightSidebarStore,
|
|
2425
2400
|
F as useSidebarStore,
|
|
2426
2401
|
ie as useStatusBarStore,
|
|
2427
2402
|
V as useTerminalStore,
|
|
2428
2403
|
Y as useThemeStore,
|
|
2429
|
-
|
|
2404
|
+
H as useUserProfileStore
|
|
2430
2405
|
};
|