nexus-shell 0.2.5 → 0.2.6
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 +1 -0
- package/dist/components/graph/GraphCanvas.d.ts +15 -0
- package/dist/components/graph/GraphMiniMap.d.ts +83 -0
- package/dist/components/graph/NodePalette.d.ts +44 -3
- package/dist/components/graph/index.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/graph.d.ts +21 -0
- package/dist/nexus-shell.es.js +1474 -1263
- 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,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsxs as
|
|
5
|
-
import ge, { useMemo as
|
|
6
|
-
import { Model as
|
|
1
|
+
var qe = Object.defineProperty;
|
|
2
|
+
var Ve = (t, e, n) => e in t ? qe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var Q = (t, e, n) => Ve(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { jsxs as p, jsx as o, Fragment as Ae } from "react/jsx-runtime";
|
|
5
|
+
import ge, { useMemo as B, useState as R, useRef as F, useEffect as O, forwardRef as Qe, useCallback as ee, useImperativeHandle as Ze } from "react";
|
|
6
|
+
import { Model as W, Actions as re, DockLocation as et, Layout as tt } from "flexlayout-react";
|
|
7
7
|
import "flexlayout-react/style/light.css";
|
|
8
|
-
import { Settings as
|
|
9
|
-
import { clsx as
|
|
10
|
-
import { twMerge as
|
|
11
|
-
import { create as
|
|
12
|
-
import { TableVirtuoso as
|
|
13
|
-
function
|
|
14
|
-
return
|
|
8
|
+
import { Settings as rt, MessageCircle as $e, X as V, User as Oe, Terminal as Re, Send as nt, ChevronRight as Pe, GraduationCap as ke, Moon as ot, Sun as st, Palette as at, ChevronUp as ze, Search as ue, Info as it, HelpCircle as lt, AlertCircle as ct, Check as dt, Camera as ut, Edit2 as ft, Loader2 as Ke, ChevronsUpDown as mt, ChevronDown as Fe, Clock as pt } from "lucide-react";
|
|
9
|
+
import { clsx as ht } from "clsx";
|
|
10
|
+
import { twMerge as gt } from "tailwind-merge";
|
|
11
|
+
import { create as J } from "zustand";
|
|
12
|
+
import { TableVirtuoso as xt, Virtuoso as bt } from "react-virtuoso";
|
|
13
|
+
function L(...t) {
|
|
14
|
+
return gt(ht(t));
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
{ id: "settings", label: "Settings", icon:
|
|
18
|
-
],
|
|
16
|
+
const yt = [
|
|
17
|
+
{ id: "settings", label: "Settings", icon: rt }
|
|
18
|
+
], vt = ({
|
|
19
19
|
items: t = [],
|
|
20
|
-
bottomItems: e =
|
|
20
|
+
bottomItems: e = yt,
|
|
21
21
|
activeId: n = null,
|
|
22
22
|
onSelect: r,
|
|
23
|
-
className:
|
|
23
|
+
className: a,
|
|
24
24
|
"aria-label": s = "Activity Bar"
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
26
|
+
const i = ({ id: d, label: l, icon: c }) => /* @__PURE__ */ o(
|
|
27
27
|
"button",
|
|
28
28
|
{
|
|
29
29
|
type: "button",
|
|
@@ -31,7 +31,7 @@ const gt = [
|
|
|
31
31
|
"aria-label": l,
|
|
32
32
|
title: l,
|
|
33
33
|
"aria-pressed": n === d,
|
|
34
|
-
className:
|
|
34
|
+
className: L(
|
|
35
35
|
"p-2 cursor-pointer rounded text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
36
36
|
n === d && "text-foreground border-l-2 border-primary rounded-none"
|
|
37
37
|
),
|
|
@@ -39,122 +39,122 @@ const gt = [
|
|
|
39
39
|
},
|
|
40
40
|
d
|
|
41
41
|
);
|
|
42
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ p(
|
|
43
43
|
"aside",
|
|
44
44
|
{
|
|
45
45
|
role: "navigation",
|
|
46
46
|
"aria-label": s,
|
|
47
|
-
className:
|
|
47
|
+
className: L(
|
|
48
48
|
"w-12 h-full bg-muted border-r flex flex-col items-center py-2 select-none",
|
|
49
|
-
|
|
49
|
+
a
|
|
50
50
|
),
|
|
51
51
|
children: [
|
|
52
|
-
/* @__PURE__ */ o("div", { className: "flex-1 flex flex-col space-y-4", children: t.map(
|
|
53
|
-
e.length > 0 && /* @__PURE__ */ o("div", { className: "flex flex-col space-y-4", children: e.map(
|
|
52
|
+
/* @__PURE__ */ o("div", { className: "flex-1 flex flex-col space-y-4", children: t.map(i) }),
|
|
53
|
+
e.length > 0 && /* @__PURE__ */ o("div", { className: "flex flex-col space-y-4", children: e.map(i) })
|
|
54
54
|
]
|
|
55
55
|
}
|
|
56
56
|
);
|
|
57
|
-
},
|
|
58
|
-
const e = localStorage.getItem(
|
|
57
|
+
}, se = "nexus-shell-sidebar", G = J((t) => {
|
|
58
|
+
const e = localStorage.getItem(se);
|
|
59
59
|
return {
|
|
60
60
|
activeSidebar: e !== null ? e : null,
|
|
61
61
|
panels: [],
|
|
62
62
|
setActiveSidebar: (r) => {
|
|
63
|
-
r === null ? localStorage.removeItem(
|
|
63
|
+
r === null ? localStorage.removeItem(se) : localStorage.setItem(se, r), t({ activeSidebar: r });
|
|
64
64
|
},
|
|
65
|
-
toggleSidebar: (r) => t((
|
|
66
|
-
const s =
|
|
67
|
-
return s === null ? localStorage.removeItem(
|
|
65
|
+
toggleSidebar: (r) => t((a) => {
|
|
66
|
+
const s = a.activeSidebar === r ? null : r;
|
|
67
|
+
return s === null ? localStorage.removeItem(se) : localStorage.setItem(se, s), { activeSidebar: s };
|
|
68
68
|
}),
|
|
69
69
|
setPanels: (r) => t({ panels: r })
|
|
70
70
|
};
|
|
71
|
-
}),
|
|
72
|
-
const e =
|
|
73
|
-
() => e.map(({ id: s, label:
|
|
71
|
+
}), wt = (t) => {
|
|
72
|
+
const e = G((s) => s.panels), n = G((s) => s.activeSidebar), r = G((s) => s.toggleSidebar), a = B(
|
|
73
|
+
() => e.map(({ id: s, label: i, icon: d }) => ({ id: s, label: i, icon: d })),
|
|
74
74
|
[e]
|
|
75
75
|
);
|
|
76
76
|
return /* @__PURE__ */ o(
|
|
77
|
-
|
|
77
|
+
vt,
|
|
78
78
|
{
|
|
79
79
|
...t,
|
|
80
|
-
items:
|
|
80
|
+
items: a,
|
|
81
81
|
activeId: n,
|
|
82
82
|
onSelect: r
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
|
-
},
|
|
86
|
-
/* @__PURE__ */ o(
|
|
85
|
+
}, Nt = /* @__PURE__ */ p("div", { className: "h-full flex flex-col items-center justify-center text-center px-6 text-muted-foreground", children: [
|
|
86
|
+
/* @__PURE__ */ o($e, { size: 28, className: "mb-3 opacity-40" }),
|
|
87
87
|
/* @__PURE__ */ o("p", { className: "text-xs", children: "No messages yet." }),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ p("p", { className: "text-[11px] mt-1 opacity-70", children: [
|
|
89
89
|
"Type a message, or ",
|
|
90
90
|
/* @__PURE__ */ o("span", { className: "font-mono", children: "/" }),
|
|
91
91
|
" for commands."
|
|
92
92
|
] })
|
|
93
|
-
] }),
|
|
93
|
+
] }), kt = ({
|
|
94
94
|
messages: t = [],
|
|
95
95
|
onSend: e,
|
|
96
96
|
slashCommands: n = [],
|
|
97
97
|
onSlashCommand: r,
|
|
98
|
-
onClose:
|
|
98
|
+
onClose: a,
|
|
99
99
|
title: s = "Chat",
|
|
100
|
-
placeholder:
|
|
101
|
-
emptyState: d =
|
|
100
|
+
placeholder: i = "Send a message…",
|
|
101
|
+
emptyState: d = Nt,
|
|
102
102
|
className: l
|
|
103
103
|
}) => {
|
|
104
|
-
const [c,
|
|
105
|
-
(
|
|
106
|
-
) : [],
|
|
107
|
-
|
|
104
|
+
const [c, y] = R(""), [x, h] = R(0), T = F(null), E = F(null), g = c.startsWith("/") ? n.filter(
|
|
105
|
+
(f) => `/${f.command}`.startsWith(c.toLowerCase().split(" ")[0])
|
|
106
|
+
) : [], m = g.length > 0;
|
|
107
|
+
O(() => {
|
|
108
108
|
E.current && (E.current.scrollTop = E.current.scrollHeight);
|
|
109
|
-
}, [t]),
|
|
110
|
-
|
|
109
|
+
}, [t]), O(() => {
|
|
110
|
+
h(0);
|
|
111
111
|
}, [c]);
|
|
112
112
|
const b = () => {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
var
|
|
117
|
-
r == null || r(
|
|
118
|
-
},
|
|
119
|
-
if (
|
|
120
|
-
if (
|
|
121
|
-
|
|
113
|
+
const f = c.trim();
|
|
114
|
+
f && (e == null || e(f), y(""));
|
|
115
|
+
}, N = (f) => {
|
|
116
|
+
var D;
|
|
117
|
+
r == null || r(f), y(`/${f.command} `), (D = T.current) == null || D.focus();
|
|
118
|
+
}, w = (f) => {
|
|
119
|
+
if (m) {
|
|
120
|
+
if (f.key === "ArrowDown") {
|
|
121
|
+
f.preventDefault(), h((D) => (D + 1) % g.length);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
|
|
124
|
+
if (f.key === "ArrowUp") {
|
|
125
|
+
f.preventDefault(), h((D) => (D - 1 + g.length) % g.length);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
if (
|
|
129
|
-
|
|
128
|
+
if (f.key === "Tab" || f.key === "Enter" && !f.shiftKey) {
|
|
129
|
+
f.preventDefault(), N(g[x]);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
f.key === "Enter" && !f.shiftKey && (f.preventDefault(), b());
|
|
134
134
|
};
|
|
135
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ p(
|
|
136
136
|
"aside",
|
|
137
137
|
{
|
|
138
138
|
role: "complementary",
|
|
139
139
|
"aria-label": s,
|
|
140
|
-
className:
|
|
140
|
+
className: L(
|
|
141
141
|
"w-[320px] h-full bg-muted border-l border-border flex flex-col select-none shrink-0",
|
|
142
142
|
l
|
|
143
143
|
),
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */ o(
|
|
145
|
+
/* @__PURE__ */ p("div", { className: "h-10 flex items-center justify-between px-4 shrink-0", children: [
|
|
146
|
+
/* @__PURE__ */ p("div", { className: "flex items-center space-x-2 text-muted-foreground", children: [
|
|
147
|
+
/* @__PURE__ */ o($e, { size: 13 }),
|
|
148
148
|
/* @__PURE__ */ o("span", { className: "text-[11px] font-bold uppercase tracking-widest", children: s })
|
|
149
149
|
] }),
|
|
150
|
-
|
|
150
|
+
a && /* @__PURE__ */ o(
|
|
151
151
|
"button",
|
|
152
152
|
{
|
|
153
153
|
type: "button",
|
|
154
|
-
onClick:
|
|
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__ */ o(
|
|
157
|
+
children: /* @__PURE__ */ o(V, { size: 14 })
|
|
158
158
|
}
|
|
159
159
|
)
|
|
160
160
|
] }),
|
|
@@ -165,75 +165,75 @@ const gt = [
|
|
|
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: t.length === 0 ? d : t.map((
|
|
169
|
-
const
|
|
170
|
-
return /* @__PURE__ */
|
|
168
|
+
children: t.length === 0 ? d : t.map((f) => {
|
|
169
|
+
const D = f.role === "user";
|
|
170
|
+
return /* @__PURE__ */ p(
|
|
171
171
|
"div",
|
|
172
172
|
{
|
|
173
|
-
className:
|
|
173
|
+
className: L("flex flex-col", D ? "items-end" : "items-start"),
|
|
174
174
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
|
|
177
|
-
/* @__PURE__ */ o("span", { children:
|
|
175
|
+
/* @__PURE__ */ p("div", { className: "flex items-center space-x-1 mb-1 text-[10px] uppercase tracking-wider text-muted-foreground font-bold", children: [
|
|
176
|
+
D ? /* @__PURE__ */ o(Oe, { size: 10 }) : /* @__PURE__ */ o(Re, { size: 10 }),
|
|
177
|
+
/* @__PURE__ */ o("span", { children: f.author ?? (D ? "You" : "Assistant") })
|
|
178
178
|
] }),
|
|
179
179
|
/* @__PURE__ */ o(
|
|
180
180
|
"div",
|
|
181
181
|
{
|
|
182
|
-
className:
|
|
182
|
+
className: L(
|
|
183
183
|
"max-w-[85%] rounded-lg px-3 py-2 text-xs whitespace-pre-wrap break-words",
|
|
184
|
-
|
|
184
|
+
D ? "bg-primary text-primary-foreground" : "bg-card border border-border text-foreground"
|
|
185
185
|
),
|
|
186
|
-
children:
|
|
186
|
+
children: f.text
|
|
187
187
|
}
|
|
188
188
|
)
|
|
189
189
|
]
|
|
190
190
|
},
|
|
191
|
-
|
|
191
|
+
f.id
|
|
192
192
|
);
|
|
193
193
|
})
|
|
194
194
|
}
|
|
195
195
|
),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
|
|
196
|
+
/* @__PURE__ */ p("div", { className: "relative border-t border-border/50 p-2 shrink-0", children: [
|
|
197
|
+
m && /* @__PURE__ */ o(
|
|
198
198
|
"div",
|
|
199
199
|
{
|
|
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: g.map((f, D) => /* @__PURE__ */ p(
|
|
204
204
|
"div",
|
|
205
205
|
{
|
|
206
206
|
role: "option",
|
|
207
|
-
"aria-selected":
|
|
208
|
-
onMouseEnter: () =>
|
|
209
|
-
onClick: () =>
|
|
210
|
-
className:
|
|
207
|
+
"aria-selected": D === x,
|
|
208
|
+
onMouseEnter: () => h(D),
|
|
209
|
+
onClick: () => N(f),
|
|
210
|
+
className: L(
|
|
211
211
|
"px-3 py-1.5 text-xs cursor-pointer flex items-baseline justify-between gap-3",
|
|
212
|
-
|
|
212
|
+
D === x ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
|
|
213
213
|
),
|
|
214
214
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ p("span", { className: "font-mono", children: [
|
|
216
216
|
"/",
|
|
217
|
-
|
|
217
|
+
f.command
|
|
218
218
|
] }),
|
|
219
|
-
/* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground truncate", children:
|
|
219
|
+
/* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground truncate", children: f.description })
|
|
220
220
|
]
|
|
221
221
|
},
|
|
222
|
-
|
|
222
|
+
f.command
|
|
223
223
|
))
|
|
224
224
|
}
|
|
225
225
|
),
|
|
226
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ p("div", { className: "flex items-end space-x-2", children: [
|
|
227
227
|
/* @__PURE__ */ o(
|
|
228
228
|
"textarea",
|
|
229
229
|
{
|
|
230
|
-
ref:
|
|
230
|
+
ref: T,
|
|
231
231
|
rows: 1,
|
|
232
232
|
value: c,
|
|
233
233
|
"aria-label": `${s} message`,
|
|
234
|
-
placeholder:
|
|
235
|
-
onChange: (
|
|
236
|
-
onKeyDown:
|
|
234
|
+
placeholder: i,
|
|
235
|
+
onChange: (f) => y(f.target.value),
|
|
236
|
+
onKeyDown: w,
|
|
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
|
),
|
|
@@ -245,7 +245,7 @@ const gt = [
|
|
|
245
245
|
disabled: !c.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__ */ o(
|
|
248
|
+
children: /* @__PURE__ */ o(nt, { size: 14 })
|
|
249
249
|
}
|
|
250
250
|
)
|
|
251
251
|
] })
|
|
@@ -254,42 +254,42 @@ const gt = [
|
|
|
254
254
|
}
|
|
255
255
|
);
|
|
256
256
|
};
|
|
257
|
-
let
|
|
258
|
-
const
|
|
257
|
+
let Et = 0;
|
|
258
|
+
const Tt = () => `msg-${Date.now()}-${Et += 1}`, ae = J((t) => ({
|
|
259
259
|
messages: [],
|
|
260
260
|
slashCommands: [],
|
|
261
261
|
setMessages: (e) => t({ messages: e }),
|
|
262
262
|
addMessage: (e) => t((n) => ({
|
|
263
|
-
messages: [...n.messages, { ...e, id: e.id ??
|
|
263
|
+
messages: [...n.messages, { ...e, id: e.id ?? Tt() }]
|
|
264
264
|
})),
|
|
265
265
|
clearMessages: () => t({ messages: [] }),
|
|
266
266
|
setSlashCommands: (e) => t({ slashCommands: e }),
|
|
267
267
|
registerSlashCommand: (e) => t((n) => ({ slashCommands: [...n.slashCommands, e] }))
|
|
268
|
-
})),
|
|
269
|
-
isChatOpen: localStorage.getItem(
|
|
268
|
+
})), fe = "nexus-shell-right-sidebar", xe = J((t) => ({
|
|
269
|
+
isChatOpen: localStorage.getItem(fe) === "true",
|
|
270
270
|
setChatOpen: (r) => {
|
|
271
|
-
localStorage.setItem(
|
|
271
|
+
localStorage.setItem(fe, String(r)), t({ isChatOpen: r });
|
|
272
272
|
},
|
|
273
273
|
toggleChat: () => t((r) => {
|
|
274
|
-
const
|
|
275
|
-
return localStorage.setItem(
|
|
274
|
+
const a = !r.isChatOpen;
|
|
275
|
+
return localStorage.setItem(fe, String(a)), { isChatOpen: a };
|
|
276
276
|
})
|
|
277
|
-
})),
|
|
278
|
-
const n =
|
|
277
|
+
})), Ct = ({ onSend: t, ...e }) => {
|
|
278
|
+
const n = xe((l) => l.isChatOpen), r = xe((l) => l.setChatOpen), a = ae((l) => l.messages), s = ae((l) => l.slashCommands), i = ae((l) => l.addMessage);
|
|
279
279
|
return n ? /* @__PURE__ */ o(
|
|
280
|
-
|
|
280
|
+
kt,
|
|
281
281
|
{
|
|
282
282
|
...e,
|
|
283
|
-
messages:
|
|
283
|
+
messages: a,
|
|
284
284
|
slashCommands: s,
|
|
285
285
|
onSend: (l) => {
|
|
286
|
-
if (
|
|
287
|
-
const [c, ...
|
|
288
|
-
if (
|
|
289
|
-
|
|
286
|
+
if (i({ role: "user", text: l }), l.startsWith("/")) {
|
|
287
|
+
const [c, ...y] = l.slice(1).split(/\s+/), x = s.find((h) => h.command === c);
|
|
288
|
+
if (x) {
|
|
289
|
+
x.execute(y);
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
i({ role: "assistant", text: `Unknown command: /${c}` });
|
|
293
293
|
return;
|
|
294
294
|
}
|
|
295
295
|
t == null || t(l);
|
|
@@ -297,35 +297,35 @@ const wt = () => `msg-${Date.now()}-${vt += 1}`, se = G((t) => ({
|
|
|
297
297
|
onClose: () => r(!1)
|
|
298
298
|
}
|
|
299
299
|
) : null;
|
|
300
|
-
},
|
|
300
|
+
}, Dt = ({
|
|
301
301
|
menus: t = {},
|
|
302
302
|
onSelect: e,
|
|
303
303
|
title: n,
|
|
304
304
|
center: r,
|
|
305
|
-
right:
|
|
305
|
+
right: a,
|
|
306
306
|
className: s
|
|
307
307
|
}) => {
|
|
308
|
-
const
|
|
308
|
+
const i = (l) => l.keybinding ? /* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground opacity-60 ml-4", children: l.keybinding }) : null, d = (l) => /* @__PURE__ */ o(
|
|
309
309
|
"div",
|
|
310
310
|
{
|
|
311
311
|
role: "menu",
|
|
312
312
|
className: "absolute left-0 top-full hidden group-hover:block z-50 min-w-[180px] bg-popover text-popover-foreground border shadow-md rounded-md py-1",
|
|
313
|
-
children: l.map((c) => /* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
313
|
+
children: l.map((c) => /* @__PURE__ */ p("div", { className: "relative group/sub", children: [
|
|
314
|
+
/* @__PURE__ */ p(
|
|
315
315
|
"div",
|
|
316
316
|
{
|
|
317
317
|
role: "menuitem",
|
|
318
318
|
tabIndex: 0,
|
|
319
319
|
onClick: () => !c.submenu && (e == null ? void 0 : e(c)),
|
|
320
|
-
onKeyDown: (
|
|
321
|
-
!c.submenu && (
|
|
320
|
+
onKeyDown: (y) => {
|
|
321
|
+
!c.submenu && (y.key === "Enter" || y.key === " ") && (y.preventDefault(), e == null || e(c));
|
|
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: [
|
|
325
325
|
/* @__PURE__ */ o("span", { children: c.label }),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
|
|
328
|
-
c.submenu && /* @__PURE__ */ o(
|
|
326
|
+
/* @__PURE__ */ p("div", { className: "flex items-center space-x-2", children: [
|
|
327
|
+
i(c),
|
|
328
|
+
c.submenu && /* @__PURE__ */ o(Pe, { size: 10 })
|
|
329
329
|
] })
|
|
330
330
|
]
|
|
331
331
|
}
|
|
@@ -335,40 +335,40 @@ const wt = () => `msg-${Date.now()}-${vt += 1}`, se = G((t) => ({
|
|
|
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: c.submenu.map((
|
|
338
|
+
children: c.submenu.map((y) => /* @__PURE__ */ p(
|
|
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(y),
|
|
344
|
+
onKeyDown: (x) => {
|
|
345
|
+
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), e == null || e(y));
|
|
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__ */ o("span", { children:
|
|
350
|
-
|
|
349
|
+
/* @__PURE__ */ o("span", { children: y.label }),
|
|
350
|
+
i(y)
|
|
351
351
|
]
|
|
352
352
|
},
|
|
353
|
-
|
|
353
|
+
y.id
|
|
354
354
|
))
|
|
355
355
|
}
|
|
356
356
|
)
|
|
357
357
|
] }, c.id))
|
|
358
358
|
}
|
|
359
359
|
);
|
|
360
|
-
return /* @__PURE__ */
|
|
360
|
+
return /* @__PURE__ */ p(
|
|
361
361
|
"header",
|
|
362
362
|
{
|
|
363
363
|
role: "banner",
|
|
364
364
|
"aria-label": "Application Header",
|
|
365
|
-
className:
|
|
365
|
+
className: L(
|
|
366
366
|
"bg-muted border-b flex items-center justify-between px-4 select-none shrink-0 transition-all z-50 relative",
|
|
367
367
|
n !== void 0 ? "h-12 bg-card/65 backdrop-blur-sm" : "h-8",
|
|
368
368
|
s
|
|
369
369
|
),
|
|
370
370
|
children: [
|
|
371
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ p("div", { className: "flex items-center flex-1 min-w-0", children: [
|
|
372
372
|
n !== void 0 ? /* @__PURE__ */ o("div", { className: "mr-12 flex items-center shrink-0", children: n }) : /* @__PURE__ */ o("div", { className: "font-semibold mr-6 text-sm shrink-0", children: "Nexus Shell" }),
|
|
373
373
|
/* @__PURE__ */ o(
|
|
374
374
|
"nav",
|
|
@@ -376,7 +376,7 @@ const wt = () => `msg-${Date.now()}-${vt += 1}`, se = G((t) => ({
|
|
|
376
376
|
role: "navigation",
|
|
377
377
|
"aria-label": "Main Menu",
|
|
378
378
|
className: "flex space-x-1 text-sm shrink-0",
|
|
379
|
-
children: Object.entries(t).map(([l, c]) => /* @__PURE__ */
|
|
379
|
+
children: Object.entries(t).map(([l, c]) => /* @__PURE__ */ p("div", { className: "relative group", children: [
|
|
380
380
|
/* @__PURE__ */ o(
|
|
381
381
|
"div",
|
|
382
382
|
{
|
|
@@ -393,14 +393,14 @@ const wt = () => `msg-${Date.now()}-${vt += 1}`, se = G((t) => ({
|
|
|
393
393
|
),
|
|
394
394
|
r && /* @__PURE__ */ o("div", { className: "ml-8 w-60 md:w-72 relative hidden sm:block", children: r })
|
|
395
395
|
] }),
|
|
396
|
-
|
|
396
|
+
a && /* @__PURE__ */ o("div", { className: "flex items-center ml-4 shrink-0", children: a })
|
|
397
397
|
]
|
|
398
398
|
}
|
|
399
399
|
);
|
|
400
400
|
};
|
|
401
|
-
class
|
|
401
|
+
class St {
|
|
402
402
|
constructor() {
|
|
403
|
-
|
|
403
|
+
Q(this, "menus", /* @__PURE__ */ new Map());
|
|
404
404
|
}
|
|
405
405
|
registerMenu(e, n) {
|
|
406
406
|
var r;
|
|
@@ -419,10 +419,10 @@ class Ct {
|
|
|
419
419
|
}), e;
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
const
|
|
423
|
-
class
|
|
422
|
+
const ve = new St();
|
|
423
|
+
class It {
|
|
424
424
|
constructor() {
|
|
425
|
-
|
|
425
|
+
Q(this, "commands", /* @__PURE__ */ new Map());
|
|
426
426
|
}
|
|
427
427
|
registerCommand(e) {
|
|
428
428
|
if (this.commands.has(e.id)) {
|
|
@@ -442,50 +442,50 @@ class Tt {
|
|
|
442
442
|
return Array.from(this.commands.values());
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
const
|
|
445
|
+
const te = new It(), _e = (t) => t.map((e) => {
|
|
446
446
|
var n;
|
|
447
447
|
return {
|
|
448
448
|
...e,
|
|
449
|
-
keybinding: e.keybinding ?? (e.commandId ? (n =
|
|
450
|
-
submenu: e.submenu ?
|
|
449
|
+
keybinding: e.keybinding ?? (e.commandId ? (n = te.getCommand(e.commandId)) == null ? void 0 : n.keybinding : void 0),
|
|
450
|
+
submenu: e.submenu ? _e(e.submenu) : void 0
|
|
451
451
|
};
|
|
452
|
-
}),
|
|
452
|
+
}), Ue = (t, e) => {
|
|
453
453
|
for (const n of t) {
|
|
454
454
|
if (n.id === e) return n;
|
|
455
|
-
const r = n.submenu &&
|
|
455
|
+
const r = n.submenu && Ue(n.submenu, e);
|
|
456
456
|
if (r) return r;
|
|
457
457
|
}
|
|
458
|
-
},
|
|
459
|
-
const e =
|
|
460
|
-
Object.entries(e).map(([
|
|
458
|
+
}, Lt = (t) => {
|
|
459
|
+
const e = ve.getAllMenus(), n = Object.fromEntries(
|
|
460
|
+
Object.entries(e).map(([a, s]) => [a, _e(s)])
|
|
461
461
|
);
|
|
462
|
-
return /* @__PURE__ */ o(
|
|
462
|
+
return /* @__PURE__ */ o(Dt, { ...t, menus: n, onSelect: (a) => {
|
|
463
463
|
for (const s of Object.values(e)) {
|
|
464
|
-
const
|
|
465
|
-
if (
|
|
466
|
-
|
|
464
|
+
const i = Ue(s, a.id);
|
|
465
|
+
if (i != null && i.commandId) {
|
|
466
|
+
te.executeCommand(i.commandId);
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
} });
|
|
471
|
-
},
|
|
471
|
+
}, me = ({
|
|
472
472
|
title: t,
|
|
473
473
|
children: e,
|
|
474
474
|
onClose: n,
|
|
475
475
|
width: r = "300px",
|
|
476
|
-
className:
|
|
477
|
-
}) => /* @__PURE__ */
|
|
476
|
+
className: a
|
|
477
|
+
}) => /* @__PURE__ */ p(
|
|
478
478
|
"aside",
|
|
479
479
|
{
|
|
480
480
|
role: "tabpanel",
|
|
481
481
|
"aria-label": `${t} Panel`,
|
|
482
482
|
style: { width: r },
|
|
483
|
-
className:
|
|
483
|
+
className: L(
|
|
484
484
|
"h-full bg-muted border-r flex flex-col select-none shrink-0",
|
|
485
|
-
|
|
485
|
+
a
|
|
486
486
|
),
|
|
487
487
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ p("div", { className: "h-10 flex items-center justify-between px-4 text-[11px] font-bold text-muted-foreground uppercase tracking-widest", children: [
|
|
489
489
|
/* @__PURE__ */ o("span", { className: "truncate", children: t }),
|
|
490
490
|
n && /* @__PURE__ */ o(
|
|
491
491
|
"button",
|
|
@@ -494,14 +494,14 @@ const q = new Tt(), Ke = (t) => t.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__ */ o(
|
|
497
|
+
children: /* @__PURE__ */ o(V, { size: 14 })
|
|
498
498
|
}
|
|
499
499
|
)
|
|
500
500
|
] }),
|
|
501
501
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-auto border-t border-border/50 bg-background/50", children: e })
|
|
502
502
|
]
|
|
503
503
|
}
|
|
504
|
-
),
|
|
504
|
+
), ie = [
|
|
505
505
|
{
|
|
506
506
|
id: "light",
|
|
507
507
|
label: "Light",
|
|
@@ -526,21 +526,21 @@ const q = new Tt(), Ke = (t) => t.map((e) => {
|
|
|
526
526
|
shortLabel: "TAMU",
|
|
527
527
|
description: "Aggie Maroon (#500000) on white."
|
|
528
528
|
}
|
|
529
|
-
],
|
|
530
|
-
light:
|
|
531
|
-
dark:
|
|
532
|
-
gt:
|
|
533
|
-
tamu:
|
|
534
|
-
},
|
|
529
|
+
], Mt = ie.map((t) => `theme-${t.id}`), At = (t) => `theme-${t}`, $t = {
|
|
530
|
+
light: st,
|
|
531
|
+
dark: ot,
|
|
532
|
+
gt: ke,
|
|
533
|
+
tamu: ke
|
|
534
|
+
}, Ot = ie.map((t) => ({
|
|
535
535
|
id: t.id,
|
|
536
536
|
label: t.label,
|
|
537
|
-
icon:
|
|
538
|
-
})),
|
|
537
|
+
icon: $t[t.id] ?? at
|
|
538
|
+
})), Rt = ({
|
|
539
539
|
theme: t,
|
|
540
540
|
onThemeChange: e,
|
|
541
|
-
themes: n =
|
|
541
|
+
themes: n = Ot,
|
|
542
542
|
className: r
|
|
543
|
-
}) => /* @__PURE__ */ o("div", { className:
|
|
543
|
+
}) => /* @__PURE__ */ o("div", { className: L("p-4 space-y-6", r), children: /* @__PURE__ */ p("section", { children: [
|
|
544
544
|
/* @__PURE__ */ o("h3", { className: "text-[11px] font-bold text-muted-foreground uppercase mb-3", children: "Theme" }),
|
|
545
545
|
/* @__PURE__ */ o(
|
|
546
546
|
"div",
|
|
@@ -548,69 +548,69 @@ const q = new Tt(), Ke = (t) => t.map((e) => {
|
|
|
548
548
|
role: "radiogroup",
|
|
549
549
|
"aria-label": "Theme",
|
|
550
550
|
className: "grid grid-cols-1 gap-2",
|
|
551
|
-
children: n.map(({ id:
|
|
551
|
+
children: n.map(({ id: a, label: s, icon: i }) => /* @__PURE__ */ p(
|
|
552
552
|
"button",
|
|
553
553
|
{
|
|
554
554
|
type: "button",
|
|
555
555
|
role: "radio",
|
|
556
|
-
"aria-checked": t ===
|
|
557
|
-
onClick: () => e(
|
|
558
|
-
className:
|
|
556
|
+
"aria-checked": t === a,
|
|
557
|
+
onClick: () => e(a),
|
|
558
|
+
className: L(
|
|
559
559
|
"flex items-center space-x-3 px-3 py-2 rounded-md border text-sm transition-all focus:outline-none focus:ring-2 focus:ring-ring",
|
|
560
|
-
t ===
|
|
560
|
+
t === a ? "bg-primary text-primary-foreground border-primary" : "bg-background hover:bg-accent border-border"
|
|
561
561
|
),
|
|
562
562
|
children: [
|
|
563
|
-
/* @__PURE__ */ o(
|
|
563
|
+
/* @__PURE__ */ o(i, { size: 16 }),
|
|
564
564
|
/* @__PURE__ */ o("span", { children: s })
|
|
565
565
|
]
|
|
566
566
|
},
|
|
567
|
-
|
|
567
|
+
a
|
|
568
568
|
))
|
|
569
569
|
}
|
|
570
570
|
)
|
|
571
|
-
] }) }),
|
|
571
|
+
] }) }), Ee = "nexus-shell-theme", Te = (t) => {
|
|
572
572
|
const e = window.document.documentElement, n = [
|
|
573
|
-
...
|
|
573
|
+
...Mt,
|
|
574
574
|
...Array.from(e.classList).filter((r) => r.startsWith("theme-"))
|
|
575
575
|
];
|
|
576
|
-
e.classList.remove(...n), e.classList.add(
|
|
577
|
-
},
|
|
578
|
-
const n = localStorage.getItem(
|
|
579
|
-
return
|
|
576
|
+
e.classList.remove(...n), e.classList.add(At(t));
|
|
577
|
+
}, oe = J((t) => {
|
|
578
|
+
const n = localStorage.getItem(Ee) || "light";
|
|
579
|
+
return Te(n), {
|
|
580
580
|
theme: n,
|
|
581
581
|
setTheme: (r) => {
|
|
582
|
-
localStorage.setItem(
|
|
582
|
+
localStorage.setItem(Ee, r), Te(r), t({ theme: r });
|
|
583
583
|
}
|
|
584
584
|
};
|
|
585
|
-
}),
|
|
586
|
-
const e =
|
|
585
|
+
}), Pt = (t) => {
|
|
586
|
+
const e = G((c) => c.activeSidebar), n = G((c) => c.panels), r = G((c) => c.setActiveSidebar), a = oe((c) => c.theme), s = oe((c) => c.setTheme);
|
|
587
587
|
if (!e) return null;
|
|
588
|
-
const
|
|
588
|
+
const i = () => r(null);
|
|
589
589
|
if (e === "settings")
|
|
590
|
-
return /* @__PURE__ */ o(
|
|
591
|
-
|
|
590
|
+
return /* @__PURE__ */ o(me, { ...t, title: "Settings", onClose: i, children: /* @__PURE__ */ o(
|
|
591
|
+
Rt,
|
|
592
592
|
{
|
|
593
|
-
theme:
|
|
593
|
+
theme: a,
|
|
594
594
|
onThemeChange: (c) => s(c)
|
|
595
595
|
}
|
|
596
596
|
) });
|
|
597
597
|
const d = n.find((c) => c.id === e);
|
|
598
598
|
if (!d)
|
|
599
|
-
return /* @__PURE__ */ o(
|
|
599
|
+
return /* @__PURE__ */ o(me, { ...t, title: e, onClose: i, children: /* @__PURE__ */ o("div", { className: "p-4 text-sm italic text-muted-foreground", children: "Panel content not found." }) });
|
|
600
600
|
const l = typeof d.component == "function" ? d.component : null;
|
|
601
|
-
return /* @__PURE__ */ o(
|
|
602
|
-
},
|
|
601
|
+
return /* @__PURE__ */ o(me, { ...t, title: d.label, onClose: i, children: l ? /* @__PURE__ */ o(l, {}) : d.component });
|
|
602
|
+
}, pe = (t, e) => (e.priority ?? 0) - (t.priority ?? 0), zt = ({
|
|
603
603
|
widgets: t = [],
|
|
604
604
|
className: e,
|
|
605
605
|
"aria-label": n = "Status Bar"
|
|
606
606
|
}) => {
|
|
607
607
|
const r = {
|
|
608
|
-
left: t.filter((s) => s.alignment === "left").sort(
|
|
609
|
-
center: t.filter((s) => s.alignment === "center").sort(
|
|
610
|
-
right: t.filter((s) => s.alignment === "right").sort(
|
|
611
|
-
},
|
|
612
|
-
const
|
|
613
|
-
return /* @__PURE__ */
|
|
608
|
+
left: t.filter((s) => s.alignment === "left").sort(pe),
|
|
609
|
+
center: t.filter((s) => s.alignment === "center").sort(pe),
|
|
610
|
+
right: t.filter((s) => s.alignment === "right").sort(pe)
|
|
611
|
+
}, a = (s) => {
|
|
612
|
+
const i = s.icon, d = !!s.onClick;
|
|
613
|
+
return /* @__PURE__ */ p(
|
|
614
614
|
"div",
|
|
615
615
|
{
|
|
616
616
|
onClick: s.onClick,
|
|
@@ -620,91 +620,91 @@ const q = new Tt(), Ke = (t) => t.map((e) => {
|
|
|
620
620
|
} : void 0,
|
|
621
621
|
role: d ? "button" : void 0,
|
|
622
622
|
tabIndex: d ? 0 : void 0,
|
|
623
|
-
className:
|
|
623
|
+
className: L(
|
|
624
624
|
"flex items-center space-x-1.5 px-2 py-0.5 rounded transition-colors h-full focus:outline-none",
|
|
625
625
|
d ? "cursor-pointer hover:bg-white/10 focus:ring-1 focus:ring-white" : "cursor-default",
|
|
626
626
|
s.className
|
|
627
627
|
),
|
|
628
628
|
children: [
|
|
629
|
-
|
|
629
|
+
i && /* @__PURE__ */ o(i, { size: 12 }),
|
|
630
630
|
s.label && /* @__PURE__ */ o("span", { children: s.label })
|
|
631
631
|
]
|
|
632
632
|
},
|
|
633
633
|
s.id
|
|
634
634
|
);
|
|
635
635
|
};
|
|
636
|
-
return /* @__PURE__ */
|
|
636
|
+
return /* @__PURE__ */ p(
|
|
637
637
|
"footer",
|
|
638
638
|
{
|
|
639
639
|
role: "status",
|
|
640
640
|
"aria-label": n,
|
|
641
|
-
className:
|
|
641
|
+
className: L(
|
|
642
642
|
"h-6 bg-primary text-primary-foreground text-[11px] flex items-center justify-between px-1 select-none shrink-0 border-t border-white/5",
|
|
643
643
|
e
|
|
644
644
|
),
|
|
645
645
|
children: [
|
|
646
|
-
/* @__PURE__ */ o("div", { className: "flex items-center space-x-1 h-full", children: r.left.map(
|
|
647
|
-
/* @__PURE__ */ o("div", { className: "flex items-center space-x-1 h-full", children: r.center.map(
|
|
648
|
-
/* @__PURE__ */ o("div", { className: "flex items-center space-x-1 h-full", children: r.right.map(
|
|
646
|
+
/* @__PURE__ */ o("div", { className: "flex items-center space-x-1 h-full", children: r.left.map(a) }),
|
|
647
|
+
/* @__PURE__ */ o("div", { className: "flex items-center space-x-1 h-full", children: r.center.map(a) }),
|
|
648
|
+
/* @__PURE__ */ o("div", { className: "flex items-center space-x-1 h-full", children: r.right.map(a) })
|
|
649
649
|
]
|
|
650
650
|
}
|
|
651
651
|
);
|
|
652
|
-
},
|
|
652
|
+
}, we = J((t) => ({
|
|
653
653
|
widgets: [],
|
|
654
654
|
setWidgets: (e) => t({ widgets: e }),
|
|
655
655
|
addWidget: (e) => t((n) => ({
|
|
656
656
|
widgets: [...n.widgets, e].sort(
|
|
657
|
-
(r,
|
|
657
|
+
(r, a) => (a.priority || 0) - (r.priority || 0)
|
|
658
658
|
)
|
|
659
659
|
})),
|
|
660
660
|
removeWidget: (e) => t((n) => ({
|
|
661
661
|
widgets: n.widgets.filter((r) => r.id !== e)
|
|
662
662
|
})),
|
|
663
663
|
updateWidget: (e, n) => t((r) => ({
|
|
664
|
-
widgets: r.widgets.map((
|
|
664
|
+
widgets: r.widgets.map((a) => a.id === e ? { ...a, ...n } : a)
|
|
665
665
|
}))
|
|
666
|
-
})),
|
|
667
|
-
const e =
|
|
668
|
-
() => e.map(({ commandId: r, ...
|
|
669
|
-
...
|
|
670
|
-
onClick:
|
|
666
|
+
})), Kt = (t) => {
|
|
667
|
+
const e = we((r) => r.widgets), n = B(
|
|
668
|
+
() => e.map(({ commandId: r, ...a }) => ({
|
|
669
|
+
...a,
|
|
670
|
+
onClick: a.onClick ?? (r ? () => te.executeCommand(r) : void 0)
|
|
671
671
|
})),
|
|
672
672
|
[e]
|
|
673
673
|
);
|
|
674
|
-
return /* @__PURE__ */ o(
|
|
675
|
-
},
|
|
674
|
+
return /* @__PURE__ */ o(zt, { ...t, widgets: n });
|
|
675
|
+
}, Ft = ({
|
|
676
676
|
history: t = [],
|
|
677
677
|
onCommand: e,
|
|
678
678
|
onClose: n,
|
|
679
679
|
height: r = "250px",
|
|
680
|
-
prompt:
|
|
680
|
+
prompt: a = "$",
|
|
681
681
|
title: s = "Terminal",
|
|
682
|
-
className:
|
|
682
|
+
className: i
|
|
683
683
|
}) => {
|
|
684
|
-
const [d, l] =
|
|
685
|
-
|
|
684
|
+
const [d, l] = R(""), c = F(null), y = F(null);
|
|
685
|
+
O(() => {
|
|
686
686
|
c.current && (c.current.scrollTop = c.current.scrollHeight);
|
|
687
687
|
}, [t]);
|
|
688
|
-
const
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
|
|
688
|
+
const x = (h) => {
|
|
689
|
+
if (h.key !== "Enter") return;
|
|
690
|
+
const T = d.trim();
|
|
691
|
+
T && (e == null || e(T), l(""));
|
|
692
692
|
};
|
|
693
|
-
return /* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ p(
|
|
694
694
|
"div",
|
|
695
695
|
{
|
|
696
696
|
style: { height: r },
|
|
697
|
-
className:
|
|
697
|
+
className: L(
|
|
698
698
|
"bg-card border-t border-border flex flex-col shrink-0 font-mono text-xs",
|
|
699
|
-
|
|
699
|
+
i
|
|
700
700
|
),
|
|
701
701
|
children: [
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
/* @__PURE__ */ o(
|
|
702
|
+
/* @__PURE__ */ p("div", { className: "h-8 flex items-center justify-between px-3 border-b border-border/50 shrink-0", children: [
|
|
703
|
+
/* @__PURE__ */ p("div", { className: "flex items-center space-x-2 text-muted-foreground", children: [
|
|
704
|
+
/* @__PURE__ */ o(Re, { size: 13 }),
|
|
705
705
|
/* @__PURE__ */ o("span", { className: "text-[11px] font-bold uppercase tracking-widest", children: s })
|
|
706
706
|
] }),
|
|
707
|
-
n && /* @__PURE__ */
|
|
707
|
+
n && /* @__PURE__ */ p("div", { className: "flex items-center space-x-1", children: [
|
|
708
708
|
/* @__PURE__ */ o(
|
|
709
709
|
"button",
|
|
710
710
|
{
|
|
@@ -712,7 +712,7 @@ const q = new Tt(), Ke = (t) => t.map((e) => {
|
|
|
712
712
|
onClick: n,
|
|
713
713
|
"aria-label": "Collapse Terminal",
|
|
714
714
|
className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
715
|
-
children: /* @__PURE__ */ o(
|
|
715
|
+
children: /* @__PURE__ */ o(ze, { size: 14 })
|
|
716
716
|
}
|
|
717
717
|
),
|
|
718
718
|
/* @__PURE__ */ o(
|
|
@@ -722,7 +722,7 @@ const q = new Tt(), Ke = (t) => t.map((e) => {
|
|
|
722
722
|
onClick: n,
|
|
723
723
|
"aria-label": "Close Terminal",
|
|
724
724
|
className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
725
|
-
children: /* @__PURE__ */ o(
|
|
725
|
+
children: /* @__PURE__ */ o(V, { size: 14 })
|
|
726
726
|
}
|
|
727
727
|
)
|
|
728
728
|
] })
|
|
@@ -735,23 +735,23 @@ const q = new Tt(), Ke = (t) => t.map((e) => {
|
|
|
735
735
|
"aria-label": `${s} output`,
|
|
736
736
|
className: "flex-1 overflow-y-auto px-3 py-2 space-y-0.5",
|
|
737
737
|
onClick: () => {
|
|
738
|
-
var
|
|
739
|
-
return (
|
|
738
|
+
var h;
|
|
739
|
+
return (h = y.current) == null ? void 0 : h.focus();
|
|
740
740
|
},
|
|
741
|
-
children: t.map((
|
|
741
|
+
children: t.map((h, T) => /* @__PURE__ */ o("div", { className: "whitespace-pre-wrap break-all text-foreground/90", children: h }, T))
|
|
742
742
|
}
|
|
743
743
|
),
|
|
744
|
-
/* @__PURE__ */
|
|
745
|
-
/* @__PURE__ */ o("span", { className: "text-primary mr-2 select-none", children:
|
|
744
|
+
/* @__PURE__ */ p("div", { className: "flex items-center px-3 py-2 border-t border-border/50 shrink-0", children: [
|
|
745
|
+
/* @__PURE__ */ o("span", { className: "text-primary mr-2 select-none", children: a }),
|
|
746
746
|
/* @__PURE__ */ o(
|
|
747
747
|
"input",
|
|
748
748
|
{
|
|
749
|
-
ref:
|
|
749
|
+
ref: y,
|
|
750
750
|
type: "text",
|
|
751
751
|
"aria-label": `${s} input`,
|
|
752
752
|
value: d,
|
|
753
|
-
onChange: (
|
|
754
|
-
onKeyDown:
|
|
753
|
+
onChange: (h) => l(h.target.value),
|
|
754
|
+
onKeyDown: x,
|
|
755
755
|
spellCheck: !1,
|
|
756
756
|
autoComplete: "off",
|
|
757
757
|
className: "flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground"
|
|
@@ -761,24 +761,24 @@ const q = new Tt(), Ke = (t) => t.map((e) => {
|
|
|
761
761
|
]
|
|
762
762
|
}
|
|
763
763
|
);
|
|
764
|
-
},
|
|
764
|
+
}, ne = J((t) => ({
|
|
765
765
|
isOpen: !1,
|
|
766
766
|
history: ["Welcome to Nexus Shell Terminal v0.1.0", 'Type "help" for a list of commands.'],
|
|
767
767
|
setOpen: (e) => t({ isOpen: e }),
|
|
768
768
|
toggle: () => t((e) => ({ isOpen: !e.isOpen })),
|
|
769
769
|
addHistory: (e) => t((n) => ({ history: [...n.history, e] })),
|
|
770
770
|
clearHistory: () => t({ history: [] })
|
|
771
|
-
})),
|
|
771
|
+
})), _t = [
|
|
772
772
|
"Available commands:",
|
|
773
773
|
" help — show this message",
|
|
774
774
|
" clear — clear the terminal"
|
|
775
|
-
],
|
|
775
|
+
], Ut = ({
|
|
776
776
|
onCommand: t,
|
|
777
777
|
...e
|
|
778
778
|
}) => {
|
|
779
|
-
const n =
|
|
779
|
+
const n = ne((l) => l.isOpen), r = ne((l) => l.history), a = ne((l) => l.setOpen), s = ne((l) => l.addHistory), i = ne((l) => l.clearHistory);
|
|
780
780
|
return n ? /* @__PURE__ */ o(
|
|
781
|
-
|
|
781
|
+
Ft,
|
|
782
782
|
{
|
|
783
783
|
...e,
|
|
784
784
|
history: r,
|
|
@@ -786,22 +786,22 @@ const q = new Tt(), Ke = (t) => t.map((e) => {
|
|
|
786
786
|
s(`$ ${l}`);
|
|
787
787
|
const c = l.toLowerCase();
|
|
788
788
|
if (c === "clear") {
|
|
789
|
-
|
|
789
|
+
i();
|
|
790
790
|
return;
|
|
791
791
|
}
|
|
792
792
|
if (c === "help") {
|
|
793
|
-
|
|
793
|
+
_t.forEach(s);
|
|
794
794
|
return;
|
|
795
795
|
}
|
|
796
796
|
(t == null ? void 0 : t(l)) !== !0 && s(`command not found: ${l.split(" ")[0]}`);
|
|
797
797
|
},
|
|
798
|
-
onClose: () =>
|
|
798
|
+
onClose: () => a(!1)
|
|
799
799
|
}
|
|
800
800
|
) : null;
|
|
801
801
|
};
|
|
802
|
-
class
|
|
802
|
+
class jt {
|
|
803
803
|
constructor() {
|
|
804
|
-
|
|
804
|
+
Q(this, "components", /* @__PURE__ */ new Map());
|
|
805
805
|
}
|
|
806
806
|
/**
|
|
807
807
|
* Register a component with a unique ID.
|
|
@@ -823,7 +823,7 @@ class Kt {
|
|
|
823
823
|
return Array.from(this.components.keys());
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
const
|
|
826
|
+
const Bt = new jt(), X = {
|
|
827
827
|
global: { tabEnableClose: !0, tabSetEnableMaximize: !1, tabSetEnableDivide: !0 },
|
|
828
828
|
borders: [
|
|
829
829
|
{
|
|
@@ -849,260 +849,260 @@ const _t = new Kt(), Y = {
|
|
|
849
849
|
}
|
|
850
850
|
]
|
|
851
851
|
}
|
|
852
|
-
},
|
|
852
|
+
}, Ce = "nexus-shell-layout", Ht = J((t, e) => {
|
|
853
853
|
let n;
|
|
854
854
|
if (typeof window < "u")
|
|
855
855
|
try {
|
|
856
|
-
const r = localStorage.getItem(
|
|
856
|
+
const r = localStorage.getItem(Ce);
|
|
857
857
|
if (r) {
|
|
858
|
-
const
|
|
859
|
-
n =
|
|
860
|
-
const s = /* @__PURE__ */ new Set(["dialogue-library", "argument-inspector"]),
|
|
858
|
+
const a = JSON.parse(r);
|
|
859
|
+
n = W.fromJson(a);
|
|
860
|
+
const s = /* @__PURE__ */ new Set(["dialogue-library", "argument-inspector"]), i = [];
|
|
861
861
|
n.visitNodes((d) => {
|
|
862
862
|
if (d.getType() === "tab") {
|
|
863
863
|
const l = d;
|
|
864
|
-
s.has(l.getComponent()) &&
|
|
864
|
+
s.has(l.getComponent()) && i.push(l.getId());
|
|
865
865
|
}
|
|
866
|
-
}),
|
|
867
|
-
n.doAction(
|
|
866
|
+
}), i.forEach((d) => {
|
|
867
|
+
n.doAction(re.deleteTab(d));
|
|
868
868
|
});
|
|
869
869
|
} else
|
|
870
|
-
n =
|
|
870
|
+
n = W.fromJson(X);
|
|
871
871
|
} catch (r) {
|
|
872
|
-
console.warn("Failed to load layout from storage, using default", r), n =
|
|
872
|
+
console.warn("Failed to load layout from storage, using default", r), n = W.fromJson(X);
|
|
873
873
|
}
|
|
874
874
|
else
|
|
875
|
-
n =
|
|
875
|
+
n = W.fromJson(X);
|
|
876
876
|
return {
|
|
877
877
|
model: n,
|
|
878
878
|
dirtyTabs: /* @__PURE__ */ new Set(),
|
|
879
|
-
storageKey:
|
|
879
|
+
storageKey: Ce,
|
|
880
880
|
disableLocalStorage: !1,
|
|
881
|
-
initLayout: (r,
|
|
881
|
+
initLayout: (r, a) => {
|
|
882
882
|
let s;
|
|
883
883
|
if (r && Object.keys(r).length > 0)
|
|
884
884
|
try {
|
|
885
|
-
s =
|
|
886
|
-
} catch (
|
|
887
|
-
console.warn("Failed to parse init layout json, using default",
|
|
885
|
+
s = W.fromJson(r);
|
|
886
|
+
} catch (i) {
|
|
887
|
+
console.warn("Failed to parse init layout json, using default", i), s = W.fromJson(X);
|
|
888
888
|
}
|
|
889
889
|
else
|
|
890
|
-
s =
|
|
891
|
-
t({ model: s, disableLocalStorage:
|
|
890
|
+
s = W.fromJson(X);
|
|
891
|
+
t({ model: s, disableLocalStorage: a || !1 });
|
|
892
892
|
},
|
|
893
893
|
setModel: (r) => {
|
|
894
894
|
t({ model: r });
|
|
895
|
-
const
|
|
895
|
+
const a = e().storageKey;
|
|
896
896
|
if (typeof window < "u" && !e().disableLocalStorage)
|
|
897
897
|
try {
|
|
898
|
-
localStorage.setItem(
|
|
898
|
+
localStorage.setItem(a, JSON.stringify(r.toJson()));
|
|
899
899
|
} catch (s) {
|
|
900
900
|
console.error("Failed to save layout to storage", s);
|
|
901
901
|
}
|
|
902
902
|
},
|
|
903
|
-
setStorageKey: (r,
|
|
903
|
+
setStorageKey: (r, a) => {
|
|
904
904
|
let s;
|
|
905
905
|
if (typeof window < "u")
|
|
906
906
|
try {
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
} catch (
|
|
910
|
-
console.warn("Failed to load layout from storage for key", r,
|
|
907
|
+
const i = localStorage.getItem(r);
|
|
908
|
+
i ? s = W.fromJson(JSON.parse(i)) : s = W.fromJson(a || X);
|
|
909
|
+
} catch (i) {
|
|
910
|
+
console.warn("Failed to load layout from storage for key", r, i), s = W.fromJson(a || X);
|
|
911
911
|
}
|
|
912
912
|
else
|
|
913
|
-
s =
|
|
913
|
+
s = W.fromJson(a || X);
|
|
914
914
|
t({ storageKey: r, model: s });
|
|
915
915
|
},
|
|
916
|
-
setTabDirty: (r,
|
|
916
|
+
setTabDirty: (r, a) => {
|
|
917
917
|
t((s) => {
|
|
918
|
-
const
|
|
919
|
-
return
|
|
918
|
+
const i = new Set(s.dirtyTabs);
|
|
919
|
+
return a ? i.add(r) : i.delete(r), { dirtyTabs: i };
|
|
920
920
|
});
|
|
921
921
|
},
|
|
922
922
|
isTabDirty: (r) => e().dirtyTabs.has(r),
|
|
923
|
-
addTab: (r,
|
|
924
|
-
const
|
|
923
|
+
addTab: (r, a, s) => {
|
|
924
|
+
const i = e().model, d = i.getActiveTabset();
|
|
925
925
|
let l = d == null ? void 0 : d.getId();
|
|
926
926
|
if (!l)
|
|
927
927
|
try {
|
|
928
|
-
const
|
|
929
|
-
l =
|
|
930
|
-
} catch (
|
|
931
|
-
console.warn("Failed to get first tabset fallback",
|
|
928
|
+
const x = i.getFirstTabSet();
|
|
929
|
+
l = x == null ? void 0 : x.getId();
|
|
930
|
+
} catch (x) {
|
|
931
|
+
console.warn("Failed to get first tabset fallback", x);
|
|
932
932
|
}
|
|
933
|
-
const
|
|
933
|
+
const y = { ...{}, ...s };
|
|
934
934
|
if (["nexus-dashboard", "nexus-docs"].includes(r)) {
|
|
935
|
-
let
|
|
936
|
-
if (
|
|
937
|
-
if (
|
|
938
|
-
const
|
|
939
|
-
|
|
935
|
+
let x = null;
|
|
936
|
+
if (i.visitNodes((h) => {
|
|
937
|
+
if (h.getType() === "tab") {
|
|
938
|
+
const T = h;
|
|
939
|
+
T.getComponent() === r && (x = T.getId());
|
|
940
940
|
}
|
|
941
|
-
}),
|
|
942
|
-
|
|
941
|
+
}), x) {
|
|
942
|
+
i.doAction(re.selectTab(x));
|
|
943
943
|
return;
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
|
-
if (
|
|
947
|
-
let
|
|
948
|
-
if (
|
|
949
|
-
var
|
|
950
|
-
if (
|
|
951
|
-
const E =
|
|
952
|
-
((
|
|
946
|
+
if (y.mapId) {
|
|
947
|
+
let x = null;
|
|
948
|
+
if (i.visitNodes((h) => {
|
|
949
|
+
var T;
|
|
950
|
+
if (h.getType() === "tab") {
|
|
951
|
+
const E = h;
|
|
952
|
+
((T = E.getConfig()) == null ? void 0 : T.mapId) === y.mapId && (x = E.getId());
|
|
953
953
|
}
|
|
954
|
-
}),
|
|
955
|
-
|
|
954
|
+
}), x) {
|
|
955
|
+
i.doAction(re.selectTab(x));
|
|
956
956
|
return;
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
|
-
if (
|
|
960
|
-
let
|
|
961
|
-
if (
|
|
962
|
-
var
|
|
963
|
-
if (
|
|
964
|
-
const E =
|
|
965
|
-
((
|
|
959
|
+
if (y.projectId) {
|
|
960
|
+
let x = null;
|
|
961
|
+
if (i.visitNodes((h) => {
|
|
962
|
+
var T;
|
|
963
|
+
if (h.getType() === "tab") {
|
|
964
|
+
const E = h;
|
|
965
|
+
((T = E.getConfig()) == null ? void 0 : T.projectId) === y.projectId && (x = E.getId());
|
|
966
966
|
}
|
|
967
|
-
}),
|
|
968
|
-
|
|
967
|
+
}), x) {
|
|
968
|
+
i.doAction(re.selectTab(x));
|
|
969
969
|
return;
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
|
-
l &&
|
|
973
|
-
|
|
974
|
-
{ type: "tab", component: r, name:
|
|
972
|
+
l && i.doAction(
|
|
973
|
+
re.addNode(
|
|
974
|
+
{ type: "tab", component: r, name: a || r, config: y },
|
|
975
975
|
l,
|
|
976
|
-
|
|
976
|
+
et.CENTER,
|
|
977
977
|
-1
|
|
978
978
|
)
|
|
979
979
|
);
|
|
980
980
|
}
|
|
981
981
|
};
|
|
982
|
-
}),
|
|
982
|
+
}), je = J((t, e) => ({
|
|
983
983
|
isOpen: !1,
|
|
984
984
|
type: "alert",
|
|
985
985
|
title: "",
|
|
986
986
|
message: "",
|
|
987
987
|
defaultValue: "",
|
|
988
988
|
resolve: null,
|
|
989
|
-
openAlert: (n, r = "Alert") => new Promise((
|
|
990
|
-
t({ isOpen: !0, type: "alert", title: r, message: n, defaultValue: "", resolve:
|
|
989
|
+
openAlert: (n, r = "Alert") => new Promise((a) => {
|
|
990
|
+
t({ isOpen: !0, type: "alert", title: r, message: n, defaultValue: "", resolve: a });
|
|
991
991
|
}),
|
|
992
|
-
openConfirm: (n, r = "Confirm") => new Promise((
|
|
993
|
-
t({ isOpen: !0, type: "confirm", title: r, message: n, defaultValue: "", resolve:
|
|
992
|
+
openConfirm: (n, r = "Confirm") => new Promise((a) => {
|
|
993
|
+
t({ isOpen: !0, type: "confirm", title: r, message: n, defaultValue: "", resolve: a });
|
|
994
994
|
}),
|
|
995
|
-
openPrompt: (n, r = "",
|
|
996
|
-
t({ isOpen: !0, type: "prompt", title:
|
|
995
|
+
openPrompt: (n, r = "", a = "Prompt") => new Promise((s) => {
|
|
996
|
+
t({ isOpen: !0, type: "prompt", title: a, message: n, defaultValue: r, resolve: s });
|
|
997
997
|
}),
|
|
998
998
|
close: (n = null) => {
|
|
999
999
|
const { resolve: r } = e();
|
|
1000
1000
|
r && r(n), t({ isOpen: !1, resolve: null });
|
|
1001
1001
|
}
|
|
1002
|
-
})),
|
|
1002
|
+
})), Sr = ({
|
|
1003
1003
|
panels: t,
|
|
1004
1004
|
slashCommands: e,
|
|
1005
1005
|
menuConfig: n,
|
|
1006
1006
|
statusBarConfig: r,
|
|
1007
|
-
title:
|
|
1007
|
+
title: a,
|
|
1008
1008
|
rightMenuBarContent: s,
|
|
1009
|
-
centerMenuBarContent:
|
|
1009
|
+
centerMenuBarContent: i,
|
|
1010
1010
|
layoutModel: d,
|
|
1011
1011
|
initialLayoutJson: l,
|
|
1012
1012
|
disableLocalStorage: c = !1,
|
|
1013
|
-
onLayoutChange:
|
|
1013
|
+
onLayoutChange: y
|
|
1014
1014
|
}) => {
|
|
1015
|
-
const { model:
|
|
1016
|
-
|
|
1015
|
+
const { model: x, setModel: h, initLayout: T, isTabDirty: E, setTabDirty: g } = Ht(), m = oe((M) => M.theme), b = G((M) => M.setPanels), N = ae((M) => M.setSlashCommands), w = we((M) => M.setWidgets);
|
|
1016
|
+
O(() => {
|
|
1017
1017
|
t && b(t);
|
|
1018
|
-
}, [t, b]),
|
|
1019
|
-
e &&
|
|
1020
|
-
}, [e,
|
|
1021
|
-
n &&
|
|
1022
|
-
}, [n]),
|
|
1023
|
-
r &&
|
|
1024
|
-
}, [r,
|
|
1025
|
-
d || !l && !c ||
|
|
1018
|
+
}, [t, b]), O(() => {
|
|
1019
|
+
e && N(e);
|
|
1020
|
+
}, [e, N]), O(() => {
|
|
1021
|
+
n && ve.setMenus(n);
|
|
1022
|
+
}, [n]), O(() => {
|
|
1023
|
+
r && w(r);
|
|
1024
|
+
}, [r, w]), O(() => {
|
|
1025
|
+
d || !l && !c || T(l, c);
|
|
1026
1026
|
}, []);
|
|
1027
|
-
const
|
|
1027
|
+
const f = (M) => {
|
|
1028
1028
|
try {
|
|
1029
|
-
const
|
|
1030
|
-
return
|
|
1029
|
+
const A = M.getComponent(), C = M.getConfig() || {}, S = A ? Bt.get(A) : void 0;
|
|
1030
|
+
return S ? /* @__PURE__ */ o(S, { node: M, ...C }) : /* @__PURE__ */ p("div", { className: "p-4 text-sm", children: [
|
|
1031
1031
|
"Unknown Component: ",
|
|
1032
|
-
|
|
1032
|
+
A
|
|
1033
1033
|
] });
|
|
1034
|
-
} catch (
|
|
1035
|
-
return console.error("Error in component factory:",
|
|
1034
|
+
} catch (A) {
|
|
1035
|
+
return console.error("Error in component factory:", A), /* @__PURE__ */ p("div", { className: "p-8 text-destructive bg-destructive/10 border border-destructive/20 h-full flex items-center justify-center", children: [
|
|
1036
1036
|
"Error rendering component: ",
|
|
1037
|
-
|
|
1037
|
+
A instanceof Error ? A.message : "Unknown error"
|
|
1038
1038
|
] });
|
|
1039
1039
|
}
|
|
1040
|
-
},
|
|
1041
|
-
if (
|
|
1042
|
-
const
|
|
1043
|
-
if (
|
|
1044
|
-
|
|
1045
|
-
`Tab "${
|
|
1046
|
-
).then((
|
|
1047
|
-
|
|
1040
|
+
}, D = (M) => {
|
|
1041
|
+
if (M.type !== re.DELETE_TAB) return M;
|
|
1042
|
+
const A = x.getNodeById(M.data.node);
|
|
1043
|
+
if (!A || !E(A.getId())) return M;
|
|
1044
|
+
je.getState().openConfirm(
|
|
1045
|
+
`Tab "${A.getName()}" has unsaved changes. Are you sure you want to close it?`
|
|
1046
|
+
).then((C) => {
|
|
1047
|
+
C && (g(A.getId(), !1), x.doAction(M));
|
|
1048
1048
|
});
|
|
1049
1049
|
};
|
|
1050
|
-
return /* @__PURE__ */
|
|
1050
|
+
return /* @__PURE__ */ p(
|
|
1051
1051
|
"div",
|
|
1052
1052
|
{
|
|
1053
|
-
className: `flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden theme-${
|
|
1053
|
+
className: `flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden theme-${m}`,
|
|
1054
1054
|
children: [
|
|
1055
1055
|
/* @__PURE__ */ o(
|
|
1056
|
-
|
|
1056
|
+
Lt,
|
|
1057
1057
|
{
|
|
1058
|
-
title:
|
|
1059
|
-
center:
|
|
1058
|
+
title: a,
|
|
1059
|
+
center: i,
|
|
1060
1060
|
right: s
|
|
1061
1061
|
}
|
|
1062
1062
|
),
|
|
1063
|
-
/* @__PURE__ */
|
|
1064
|
-
/* @__PURE__ */ o(
|
|
1065
|
-
/* @__PURE__ */ o(
|
|
1066
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ p("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
1064
|
+
/* @__PURE__ */ o(wt, {}),
|
|
1065
|
+
/* @__PURE__ */ o(Pt, {}),
|
|
1066
|
+
/* @__PURE__ */ p("div", { className: "flex-1 flex flex-col min-w-0 bg-card", children: [
|
|
1067
1067
|
/* @__PURE__ */ o("div", { className: "flex-1 relative h-full w-full", children: /* @__PURE__ */ o(
|
|
1068
|
-
|
|
1068
|
+
tt,
|
|
1069
1069
|
{
|
|
1070
|
-
model: d ||
|
|
1071
|
-
factory:
|
|
1072
|
-
onModelChange: (
|
|
1073
|
-
d ||
|
|
1070
|
+
model: d || x,
|
|
1071
|
+
factory: f,
|
|
1072
|
+
onModelChange: (M) => {
|
|
1073
|
+
d || h(M), y == null || y(M.toJson());
|
|
1074
1074
|
},
|
|
1075
|
-
onAction:
|
|
1075
|
+
onAction: D
|
|
1076
1076
|
}
|
|
1077
1077
|
) }),
|
|
1078
|
-
/* @__PURE__ */ o(
|
|
1078
|
+
/* @__PURE__ */ o(Ut, {})
|
|
1079
1079
|
] }),
|
|
1080
|
-
/* @__PURE__ */ o(
|
|
1080
|
+
/* @__PURE__ */ o(Ct, {})
|
|
1081
1081
|
] }),
|
|
1082
|
-
/* @__PURE__ */ o(
|
|
1082
|
+
/* @__PURE__ */ o(Kt, {})
|
|
1083
1083
|
]
|
|
1084
1084
|
}
|
|
1085
1085
|
);
|
|
1086
|
-
},
|
|
1086
|
+
}, Be = ie.map((t) => ({
|
|
1087
1087
|
id: `theme.${t.id}`,
|
|
1088
1088
|
label: `Preferences: ${t.label} Theme`,
|
|
1089
|
-
execute: () =>
|
|
1090
|
-
})),
|
|
1089
|
+
execute: () => oe.getState().setTheme(t.id)
|
|
1090
|
+
})), Ir = [
|
|
1091
1091
|
"view.toggleTerminal",
|
|
1092
1092
|
"view.toggleChat",
|
|
1093
1093
|
"view.toggleSidebar",
|
|
1094
|
-
...
|
|
1095
|
-
],
|
|
1094
|
+
...Be.map((t) => t.id)
|
|
1095
|
+
], Wt = [
|
|
1096
1096
|
{
|
|
1097
1097
|
id: "view.toggleTerminal",
|
|
1098
1098
|
label: "View: Toggle Terminal",
|
|
1099
1099
|
keybinding: "Control+`",
|
|
1100
|
-
execute: () =>
|
|
1100
|
+
execute: () => ne.getState().toggle()
|
|
1101
1101
|
},
|
|
1102
1102
|
{
|
|
1103
1103
|
id: "view.toggleChat",
|
|
1104
1104
|
label: "View: Toggle Chat",
|
|
1105
|
-
execute: () =>
|
|
1105
|
+
execute: () => xe.getState().toggleChat()
|
|
1106
1106
|
},
|
|
1107
1107
|
{
|
|
1108
1108
|
id: "view.toggleSidebar",
|
|
@@ -1110,12 +1110,12 @@ const _t = new Kt(), Y = {
|
|
|
1110
1110
|
keybinding: "Control+b",
|
|
1111
1111
|
execute: () => {
|
|
1112
1112
|
var r;
|
|
1113
|
-
const { activeSidebar: t, panels: e, setActiveSidebar: n } =
|
|
1113
|
+
const { activeSidebar: t, panels: e, setActiveSidebar: n } = G.getState();
|
|
1114
1114
|
n(t ? null : ((r = e[0]) == null ? void 0 : r.id) ?? null);
|
|
1115
1115
|
}
|
|
1116
1116
|
},
|
|
1117
|
-
...
|
|
1118
|
-
],
|
|
1117
|
+
...Be
|
|
1118
|
+
], Gt = {
|
|
1119
1119
|
View: [
|
|
1120
1120
|
{ id: "view.terminal", label: "Toggle Terminal", commandId: "view.toggleTerminal" },
|
|
1121
1121
|
{ id: "view.chat", label: "Toggle Chat", commandId: "view.toggleChat" },
|
|
@@ -1123,35 +1123,35 @@ const _t = new Kt(), Y = {
|
|
|
1123
1123
|
{
|
|
1124
1124
|
id: "view.theme",
|
|
1125
1125
|
label: "Theme",
|
|
1126
|
-
submenu:
|
|
1126
|
+
submenu: ie.map((t) => ({
|
|
1127
1127
|
id: `view.theme.${t.id}`,
|
|
1128
1128
|
label: t.label,
|
|
1129
1129
|
commandId: `theme.${t.id}`
|
|
1130
1130
|
}))
|
|
1131
1131
|
}
|
|
1132
1132
|
]
|
|
1133
|
-
},
|
|
1133
|
+
}, Lr = (t = {}) => {
|
|
1134
1134
|
const {
|
|
1135
1135
|
panels: e,
|
|
1136
1136
|
menus: n,
|
|
1137
1137
|
commands: r,
|
|
1138
|
-
statusBar:
|
|
1138
|
+
statusBar: a,
|
|
1139
1139
|
slashCommands: s,
|
|
1140
|
-
defaultCommands:
|
|
1140
|
+
defaultCommands: i = !0,
|
|
1141
1141
|
defaultMenus: d = !0
|
|
1142
1142
|
} = t;
|
|
1143
|
-
|
|
1143
|
+
i && Wt.forEach((c) => te.registerCommand(c)), r == null || r.forEach((c) => te.registerCommand(c));
|
|
1144
1144
|
const l = {
|
|
1145
|
-
...
|
|
1145
|
+
...i && d ? Gt : {},
|
|
1146
1146
|
...n ?? {}
|
|
1147
1147
|
};
|
|
1148
|
-
Object.keys(l).length > 0 &&
|
|
1148
|
+
Object.keys(l).length > 0 && ve.setMenus(l), e && G.getState().setPanels(e), a && we.getState().setWidgets(a), s && ae.getState().setSlashCommands(s);
|
|
1149
1149
|
};
|
|
1150
|
-
class
|
|
1150
|
+
class Yt {
|
|
1151
1151
|
constructor() {
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1152
|
+
Q(this, "plugins", /* @__PURE__ */ new Map());
|
|
1153
|
+
Q(this, "loaders", /* @__PURE__ */ new Map());
|
|
1154
|
+
Q(this, "statuses", /* @__PURE__ */ new Map());
|
|
1155
1155
|
}
|
|
1156
1156
|
registerPlugin(e) {
|
|
1157
1157
|
if (this.plugins.has(e.id)) {
|
|
@@ -1210,17 +1210,17 @@ class Bt {
|
|
|
1210
1210
|
return Array.from(this.plugins.values());
|
|
1211
1211
|
}
|
|
1212
1212
|
}
|
|
1213
|
-
const
|
|
1213
|
+
const Mr = new Yt(), De = "nexus-shell-user-profile", Se = {
|
|
1214
1214
|
name: "David Tech",
|
|
1215
1215
|
role: "Shell Architect",
|
|
1216
1216
|
email: "david@techmuch.io",
|
|
1217
1217
|
avatarUrl: "",
|
|
1218
1218
|
customAvatar: ""
|
|
1219
|
-
},
|
|
1219
|
+
}, Z = J((t) => {
|
|
1220
1220
|
let e = { ...Se };
|
|
1221
1221
|
if (typeof window < "u")
|
|
1222
1222
|
try {
|
|
1223
|
-
const r = localStorage.getItem(
|
|
1223
|
+
const r = localStorage.getItem(De);
|
|
1224
1224
|
r && (e = { ...Se, ...JSON.parse(r) });
|
|
1225
1225
|
} catch (r) {
|
|
1226
1226
|
console.error("Failed to parse saved user profile:", r);
|
|
@@ -1229,7 +1229,7 @@ const Tr = new Bt(), Ee = "nexus-shell-user-profile", Se = {
|
|
|
1229
1229
|
if (typeof window < "u")
|
|
1230
1230
|
try {
|
|
1231
1231
|
localStorage.setItem(
|
|
1232
|
-
|
|
1232
|
+
De,
|
|
1233
1233
|
JSON.stringify({
|
|
1234
1234
|
name: r.name,
|
|
1235
1235
|
role: r.role,
|
|
@@ -1238,31 +1238,31 @@ const Tr = new Bt(), Ee = "nexus-shell-user-profile", Se = {
|
|
|
1238
1238
|
customAvatar: r.customAvatar
|
|
1239
1239
|
})
|
|
1240
1240
|
);
|
|
1241
|
-
} catch (
|
|
1242
|
-
console.error("Failed to save user profile:",
|
|
1241
|
+
} catch (a) {
|
|
1242
|
+
console.error("Failed to save user profile:", a);
|
|
1243
1243
|
}
|
|
1244
1244
|
};
|
|
1245
1245
|
return {
|
|
1246
1246
|
...e,
|
|
1247
|
-
updateProfile: (r) => t((
|
|
1248
|
-
const s = { ...
|
|
1247
|
+
updateProfile: (r) => t((a) => {
|
|
1248
|
+
const s = { ...a, ...r };
|
|
1249
1249
|
return n(s), r;
|
|
1250
1250
|
}),
|
|
1251
|
-
setCustomAvatar: (r) => t((
|
|
1252
|
-
const s = { ...
|
|
1251
|
+
setCustomAvatar: (r) => t((a) => {
|
|
1252
|
+
const s = { ...a, customAvatar: r };
|
|
1253
1253
|
return n(s), { customAvatar: r };
|
|
1254
1254
|
}),
|
|
1255
1255
|
clearCustomAvatar: () => t((r) => {
|
|
1256
|
-
const
|
|
1257
|
-
return n(
|
|
1256
|
+
const a = { ...r, customAvatar: "" };
|
|
1257
|
+
return n(a), { customAvatar: "" };
|
|
1258
1258
|
})
|
|
1259
1259
|
};
|
|
1260
|
-
}),
|
|
1261
|
-
|
|
1260
|
+
}), Ar = () => {
|
|
1261
|
+
O(() => {
|
|
1262
1262
|
const t = (e) => {
|
|
1263
|
-
const n =
|
|
1263
|
+
const n = te.getCommands();
|
|
1264
1264
|
for (const r of n)
|
|
1265
|
-
if (r.keybinding &&
|
|
1265
|
+
if (r.keybinding && Jt(e, r.keybinding)) {
|
|
1266
1266
|
e.preventDefault(), r.execute();
|
|
1267
1267
|
break;
|
|
1268
1268
|
}
|
|
@@ -1270,65 +1270,65 @@ const Tr = new Bt(), Ee = "nexus-shell-user-profile", Se = {
|
|
|
1270
1270
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
1271
1271
|
}, []);
|
|
1272
1272
|
};
|
|
1273
|
-
function
|
|
1274
|
-
var
|
|
1275
|
-
const n = e.split("+"), r = (
|
|
1276
|
-
return t.key.toLowerCase() === r && l ===
|
|
1273
|
+
function Jt(t, e) {
|
|
1274
|
+
var h;
|
|
1275
|
+
const n = e.split("+"), r = (h = n.pop()) == null ? void 0 : h.toLowerCase(), a = n.includes("Control") || n.includes("Ctrl"), s = n.includes("Shift"), i = n.includes("Alt"), d = n.includes("Meta") || n.includes("Cmd"), l = t.ctrlKey, c = t.shiftKey, y = t.altKey, x = t.metaKey;
|
|
1276
|
+
return t.key.toLowerCase() === r && l === a && c === s && y === i && x === d;
|
|
1277
1277
|
}
|
|
1278
|
-
const
|
|
1278
|
+
const Xt = (t, e) => {
|
|
1279
1279
|
const n = e.toLowerCase();
|
|
1280
1280
|
return t.label.toLowerCase().includes(n) || t.id.toLowerCase().includes(n);
|
|
1281
|
-
},
|
|
1281
|
+
}, qt = ({
|
|
1282
1282
|
open: t,
|
|
1283
1283
|
commands: e,
|
|
1284
1284
|
onSelect: n,
|
|
1285
1285
|
onClose: r,
|
|
1286
|
-
inline:
|
|
1286
|
+
inline: a = !1,
|
|
1287
1287
|
placeholder: s = "Type a command to run…",
|
|
1288
|
-
filter:
|
|
1288
|
+
filter: i = Xt,
|
|
1289
1289
|
className: d
|
|
1290
1290
|
}) => {
|
|
1291
|
-
const [l, c] =
|
|
1292
|
-
() => e.filter((
|
|
1293
|
-
[e, l,
|
|
1291
|
+
const [l, c] = R(""), [y, x] = R(0), h = F(null), T = B(
|
|
1292
|
+
() => e.filter((g) => i(g, l)),
|
|
1293
|
+
[e, l, i]
|
|
1294
1294
|
);
|
|
1295
|
-
if (
|
|
1296
|
-
var
|
|
1297
|
-
t && (c(""),
|
|
1298
|
-
}, [t]),
|
|
1299
|
-
|
|
1295
|
+
if (O(() => {
|
|
1296
|
+
var g;
|
|
1297
|
+
t && (c(""), x(0), (g = h.current) == null || g.focus());
|
|
1298
|
+
}, [t]), O(() => {
|
|
1299
|
+
x(0);
|
|
1300
1300
|
}, [l]), !t) return null;
|
|
1301
|
-
const E = (
|
|
1302
|
-
|
|
1303
|
-
(
|
|
1304
|
-
)) :
|
|
1301
|
+
const E = (g) => {
|
|
1302
|
+
g.key === "ArrowDown" ? (g.preventDefault(), x((m) => T.length ? (m + 1) % T.length : 0)) : g.key === "ArrowUp" ? (g.preventDefault(), x(
|
|
1303
|
+
(m) => T.length ? (m - 1 + T.length) % T.length : 0
|
|
1304
|
+
)) : g.key === "Enter" ? (g.preventDefault(), T[y] && n(T[y])) : g.key === "Escape" && (g.preventDefault(), r == null || r());
|
|
1305
1305
|
};
|
|
1306
1306
|
return /* @__PURE__ */ o(
|
|
1307
1307
|
"div",
|
|
1308
1308
|
{
|
|
1309
|
-
onClick:
|
|
1310
|
-
className:
|
|
1309
|
+
onClick: a ? void 0 : r,
|
|
1310
|
+
className: L(
|
|
1311
1311
|
"z-[100] flex items-start justify-center",
|
|
1312
|
-
|
|
1312
|
+
a ? "relative w-full max-w-xl" : "fixed inset-0 pt-[10vh] bg-black/50 backdrop-blur-sm"
|
|
1313
1313
|
),
|
|
1314
|
-
children: /* @__PURE__ */
|
|
1314
|
+
children: /* @__PURE__ */ p(
|
|
1315
1315
|
"div",
|
|
1316
1316
|
{
|
|
1317
1317
|
role: "dialog",
|
|
1318
|
-
"aria-modal": !
|
|
1318
|
+
"aria-modal": !a,
|
|
1319
1319
|
"aria-label": "Command Palette",
|
|
1320
|
-
onClick: (
|
|
1321
|
-
className:
|
|
1320
|
+
onClick: (g) => g.stopPropagation(),
|
|
1321
|
+
className: L(
|
|
1322
1322
|
"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",
|
|
1323
1323
|
d
|
|
1324
1324
|
),
|
|
1325
1325
|
children: [
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */ o(
|
|
1326
|
+
/* @__PURE__ */ p("div", { className: "flex items-center px-4 border-b", children: [
|
|
1327
|
+
/* @__PURE__ */ o(ue, { size: 18, className: "text-muted-foreground mr-3" }),
|
|
1328
1328
|
/* @__PURE__ */ o(
|
|
1329
1329
|
"input",
|
|
1330
1330
|
{
|
|
1331
|
-
ref:
|
|
1331
|
+
ref: h,
|
|
1332
1332
|
type: "text",
|
|
1333
1333
|
role: "combobox",
|
|
1334
1334
|
"aria-expanded": !0,
|
|
@@ -1336,7 +1336,7 @@ const Wt = (t, e) => {
|
|
|
1336
1336
|
"aria-label": "Command",
|
|
1337
1337
|
placeholder: s,
|
|
1338
1338
|
value: l,
|
|
1339
|
-
onChange: (
|
|
1339
|
+
onChange: (g) => c(g.target.value),
|
|
1340
1340
|
onKeyDown: E,
|
|
1341
1341
|
className: "flex-1 h-14 bg-transparent outline-none text-base text-foreground placeholder:text-muted-foreground"
|
|
1342
1342
|
}
|
|
@@ -1348,38 +1348,38 @@ const Wt = (t, e) => {
|
|
|
1348
1348
|
id: "command-palette-list",
|
|
1349
1349
|
role: "listbox",
|
|
1350
1350
|
className: "max-h-[300px] overflow-y-auto py-2",
|
|
1351
|
-
children:
|
|
1351
|
+
children: T.length === 0 ? /* @__PURE__ */ o("div", { className: "px-4 py-8 text-center text-sm text-muted-foreground", children: l ? `No commands found matching "${l}"` : "No commands available." }) : T.map((g, m) => /* @__PURE__ */ p(
|
|
1352
1352
|
"div",
|
|
1353
1353
|
{
|
|
1354
1354
|
role: "option",
|
|
1355
|
-
"aria-selected":
|
|
1356
|
-
onClick: () => n(
|
|
1357
|
-
onMouseEnter: () =>
|
|
1358
|
-
className:
|
|
1355
|
+
"aria-selected": m === y,
|
|
1356
|
+
onClick: () => n(g),
|
|
1357
|
+
onMouseEnter: () => x(m),
|
|
1358
|
+
className: L(
|
|
1359
1359
|
"px-4 py-2 cursor-pointer flex justify-between items-center text-sm",
|
|
1360
|
-
|
|
1360
|
+
m === y ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
|
|
1361
1361
|
),
|
|
1362
1362
|
children: [
|
|
1363
|
-
/* @__PURE__ */ o("span", { children:
|
|
1364
|
-
|
|
1363
|
+
/* @__PURE__ */ o("span", { children: g.label }),
|
|
1364
|
+
g.keybinding && /* @__PURE__ */ o("span", { className: "text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border/50", children: g.keybinding })
|
|
1365
1365
|
]
|
|
1366
1366
|
},
|
|
1367
|
-
|
|
1367
|
+
g.id
|
|
1368
1368
|
))
|
|
1369
1369
|
}
|
|
1370
1370
|
),
|
|
1371
|
-
/* @__PURE__ */
|
|
1372
|
-
/* @__PURE__ */
|
|
1373
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ p("div", { className: "px-4 py-2 border-t bg-muted/30 flex justify-between items-center text-[10px] text-muted-foreground", children: [
|
|
1372
|
+
/* @__PURE__ */ p("div", { className: "flex gap-3", children: [
|
|
1373
|
+
/* @__PURE__ */ p("span", { children: [
|
|
1374
1374
|
/* @__PURE__ */ o("kbd", { className: "bg-muted px-1 rounded border", children: "↑↓" }),
|
|
1375
1375
|
" to navigate"
|
|
1376
1376
|
] }),
|
|
1377
|
-
/* @__PURE__ */
|
|
1377
|
+
/* @__PURE__ */ p("span", { children: [
|
|
1378
1378
|
/* @__PURE__ */ o("kbd", { className: "bg-muted px-1 rounded border", children: "Enter" }),
|
|
1379
1379
|
" to select"
|
|
1380
1380
|
] })
|
|
1381
1381
|
] }),
|
|
1382
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ p("span", { children: [
|
|
1383
1383
|
/* @__PURE__ */ o("kbd", { className: "bg-muted px-1 rounded border", children: "Esc" }),
|
|
1384
1384
|
" to close"
|
|
1385
1385
|
] })
|
|
@@ -1389,99 +1389,99 @@ const Wt = (t, e) => {
|
|
|
1389
1389
|
)
|
|
1390
1390
|
}
|
|
1391
1391
|
);
|
|
1392
|
-
},
|
|
1392
|
+
}, $r = ({
|
|
1393
1393
|
shortcutKey: t = "p",
|
|
1394
1394
|
...e
|
|
1395
1395
|
}) => {
|
|
1396
|
-
const [n, r] =
|
|
1397
|
-
return
|
|
1396
|
+
const [n, r] = R(!1);
|
|
1397
|
+
return O(() => {
|
|
1398
1398
|
if (t === null) return;
|
|
1399
|
-
const
|
|
1400
|
-
(s.metaKey || s.ctrlKey) && s.shiftKey && s.key.toLowerCase() === t && (s.preventDefault(), r((
|
|
1399
|
+
const a = (s) => {
|
|
1400
|
+
(s.metaKey || s.ctrlKey) && s.shiftKey && s.key.toLowerCase() === t && (s.preventDefault(), r((i) => !i));
|
|
1401
1401
|
};
|
|
1402
|
-
return window.addEventListener("keydown",
|
|
1402
|
+
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
1403
1403
|
}, [t]), /* @__PURE__ */ o(
|
|
1404
|
-
|
|
1404
|
+
qt,
|
|
1405
1405
|
{
|
|
1406
1406
|
...e,
|
|
1407
1407
|
open: n,
|
|
1408
|
-
commands:
|
|
1409
|
-
onSelect: (
|
|
1410
|
-
|
|
1408
|
+
commands: te.getCommands(),
|
|
1409
|
+
onSelect: (a) => {
|
|
1410
|
+
a.execute(), r(!1);
|
|
1411
1411
|
},
|
|
1412
1412
|
onClose: () => r(!1)
|
|
1413
1413
|
}
|
|
1414
1414
|
);
|
|
1415
|
-
},
|
|
1416
|
-
alert:
|
|
1417
|
-
confirm:
|
|
1418
|
-
prompt:
|
|
1419
|
-
},
|
|
1415
|
+
}, Vt = {
|
|
1416
|
+
alert: ct,
|
|
1417
|
+
confirm: lt,
|
|
1418
|
+
prompt: it
|
|
1419
|
+
}, Qt = {
|
|
1420
1420
|
alert: "text-destructive",
|
|
1421
1421
|
confirm: "text-amber-500",
|
|
1422
1422
|
prompt: "text-blue-500"
|
|
1423
|
-
},
|
|
1423
|
+
}, Zt = ({
|
|
1424
1424
|
open: t,
|
|
1425
1425
|
type: e = "alert",
|
|
1426
1426
|
title: n,
|
|
1427
1427
|
message: r,
|
|
1428
|
-
defaultValue:
|
|
1428
|
+
defaultValue: a = "",
|
|
1429
1429
|
onConfirm: s,
|
|
1430
|
-
onCancel:
|
|
1430
|
+
onCancel: i,
|
|
1431
1431
|
confirmLabel: d,
|
|
1432
1432
|
cancelLabel: l = "Cancel",
|
|
1433
1433
|
placeholder: c = "Enter value…",
|
|
1434
|
-
className:
|
|
1434
|
+
className: y
|
|
1435
1435
|
}) => {
|
|
1436
|
-
const [
|
|
1437
|
-
if (
|
|
1438
|
-
if (!t || (
|
|
1436
|
+
const [x, h] = R(a), T = F(null);
|
|
1437
|
+
if (O(() => {
|
|
1438
|
+
if (!t || (h(a), e !== "prompt")) return;
|
|
1439
1439
|
const b = window.setTimeout(() => {
|
|
1440
|
-
var
|
|
1441
|
-
(
|
|
1440
|
+
var N, w;
|
|
1441
|
+
(N = T.current) == null || N.focus(), (w = T.current) == null || w.select();
|
|
1442
1442
|
}, 50);
|
|
1443
1443
|
return () => window.clearTimeout(b);
|
|
1444
|
-
}, [t, e,
|
|
1444
|
+
}, [t, e, a]), O(() => {
|
|
1445
1445
|
if (!t) return;
|
|
1446
|
-
const b = (
|
|
1447
|
-
|
|
1446
|
+
const b = (N) => {
|
|
1447
|
+
N.key === "Escape" && (N.preventDefault(), i == null || i());
|
|
1448
1448
|
};
|
|
1449
1449
|
return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
|
|
1450
|
-
}, [t,
|
|
1451
|
-
const E = () => s == null ? void 0 : s(e === "prompt" ?
|
|
1450
|
+
}, [t, i]), !t) return null;
|
|
1451
|
+
const E = () => s == null ? void 0 : s(e === "prompt" ? x : void 0), g = (b) => {
|
|
1452
1452
|
b.key === "Enter" && (b.preventDefault(), E());
|
|
1453
|
-
},
|
|
1453
|
+
}, m = Vt[e];
|
|
1454
1454
|
return /* @__PURE__ */ o(
|
|
1455
1455
|
"div",
|
|
1456
1456
|
{
|
|
1457
1457
|
className: "fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-background/80 backdrop-blur-sm transition-all duration-300",
|
|
1458
|
-
onClick:
|
|
1459
|
-
children: /* @__PURE__ */
|
|
1458
|
+
onClick: i,
|
|
1459
|
+
children: /* @__PURE__ */ p(
|
|
1460
1460
|
"div",
|
|
1461
1461
|
{
|
|
1462
1462
|
role: "dialog",
|
|
1463
1463
|
"aria-modal": "true",
|
|
1464
1464
|
"aria-label": n,
|
|
1465
1465
|
onClick: (b) => b.stopPropagation(),
|
|
1466
|
-
onKeyDown:
|
|
1467
|
-
className:
|
|
1466
|
+
onKeyDown: g,
|
|
1467
|
+
className: L(
|
|
1468
1468
|
"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",
|
|
1469
|
-
|
|
1469
|
+
y
|
|
1470
1470
|
),
|
|
1471
1471
|
children: [
|
|
1472
1472
|
/* @__PURE__ */ o(
|
|
1473
1473
|
"button",
|
|
1474
1474
|
{
|
|
1475
1475
|
type: "button",
|
|
1476
|
-
onClick:
|
|
1476
|
+
onClick: i,
|
|
1477
1477
|
"aria-label": "Close",
|
|
1478
1478
|
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",
|
|
1479
|
-
children: /* @__PURE__ */ o(
|
|
1479
|
+
children: /* @__PURE__ */ o(V, { size: 18 })
|
|
1480
1480
|
}
|
|
1481
1481
|
),
|
|
1482
|
-
/* @__PURE__ */
|
|
1483
|
-
/* @__PURE__ */ o("div", { className:
|
|
1484
|
-
/* @__PURE__ */
|
|
1482
|
+
/* @__PURE__ */ p("div", { className: "flex items-start space-x-4 mb-4", children: [
|
|
1483
|
+
/* @__PURE__ */ o("div", { className: L("p-2 bg-muted rounded-full shrink-0", Qt[e]), children: /* @__PURE__ */ o(m, { size: 24 }) }),
|
|
1484
|
+
/* @__PURE__ */ p("div", { className: "flex-1 mt-1", children: [
|
|
1485
1485
|
/* @__PURE__ */ o("h2", { className: "text-lg font-semibold tracking-tight pr-6", children: n }),
|
|
1486
1486
|
r && /* @__PURE__ */ o("p", { className: "text-sm text-muted-foreground mt-1 whitespace-pre-wrap", children: r })
|
|
1487
1487
|
] })
|
|
@@ -1489,21 +1489,21 @@ const Wt = (t, e) => {
|
|
|
1489
1489
|
e === "prompt" && /* @__PURE__ */ o("div", { className: "mt-2 mb-4", children: /* @__PURE__ */ o(
|
|
1490
1490
|
"input",
|
|
1491
1491
|
{
|
|
1492
|
-
ref:
|
|
1492
|
+
ref: T,
|
|
1493
1493
|
type: "text",
|
|
1494
1494
|
"aria-label": n,
|
|
1495
|
-
value:
|
|
1495
|
+
value: x,
|
|
1496
1496
|
placeholder: c,
|
|
1497
|
-
onChange: (b) =>
|
|
1497
|
+
onChange: (b) => h(b.target.value),
|
|
1498
1498
|
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"
|
|
1499
1499
|
}
|
|
1500
1500
|
) }),
|
|
1501
|
-
/* @__PURE__ */
|
|
1501
|
+
/* @__PURE__ */ p("div", { className: "flex items-center justify-end space-x-3 mt-4", children: [
|
|
1502
1502
|
e !== "alert" && /* @__PURE__ */ o(
|
|
1503
1503
|
"button",
|
|
1504
1504
|
{
|
|
1505
1505
|
type: "button",
|
|
1506
|
-
onClick:
|
|
1506
|
+
onClick: i,
|
|
1507
1507
|
className: "px-4 py-2 text-sm font-medium rounded-lg border border-border hover:bg-muted transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
1508
1508
|
children: l
|
|
1509
1509
|
}
|
|
@@ -1524,40 +1524,40 @@ const Wt = (t, e) => {
|
|
|
1524
1524
|
)
|
|
1525
1525
|
}
|
|
1526
1526
|
);
|
|
1527
|
-
},
|
|
1528
|
-
const { isOpen: e, type: n, title: r, message:
|
|
1527
|
+
}, Or = (t) => {
|
|
1528
|
+
const { isOpen: e, type: n, title: r, message: a, defaultValue: s, close: i } = je();
|
|
1529
1529
|
return /* @__PURE__ */ o(
|
|
1530
|
-
|
|
1530
|
+
Zt,
|
|
1531
1531
|
{
|
|
1532
1532
|
...t,
|
|
1533
1533
|
open: e,
|
|
1534
1534
|
type: n,
|
|
1535
1535
|
title: r,
|
|
1536
|
-
message:
|
|
1536
|
+
message: a,
|
|
1537
1537
|
defaultValue: s,
|
|
1538
1538
|
onConfirm: (c) => {
|
|
1539
|
-
n === "prompt" ?
|
|
1539
|
+
n === "prompt" ? i(c ?? "") : n === "confirm" ? i(!0) : i();
|
|
1540
1540
|
},
|
|
1541
1541
|
onCancel: () => {
|
|
1542
|
-
n === "prompt" ?
|
|
1542
|
+
n === "prompt" ? i(null) : n === "confirm" ? i(!1) : i();
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
1545
|
);
|
|
1546
|
-
},
|
|
1546
|
+
}, er = ie.map((t) => ({
|
|
1547
1547
|
id: t.id,
|
|
1548
1548
|
label: t.shortLabel
|
|
1549
|
-
})),
|
|
1549
|
+
})), tr = ({
|
|
1550
1550
|
value: t,
|
|
1551
1551
|
onChange: e,
|
|
1552
|
-
options: n =
|
|
1552
|
+
options: n = er,
|
|
1553
1553
|
className: r,
|
|
1554
|
-
"aria-label":
|
|
1554
|
+
"aria-label": a = "Theme"
|
|
1555
1555
|
}) => /* @__PURE__ */ o(
|
|
1556
1556
|
"div",
|
|
1557
1557
|
{
|
|
1558
1558
|
role: "radiogroup",
|
|
1559
|
-
"aria-label":
|
|
1560
|
-
className:
|
|
1559
|
+
"aria-label": a,
|
|
1560
|
+
className: L(
|
|
1561
1561
|
"flex items-center border border-border rounded-lg p-0.5 bg-secondary/80 select-none",
|
|
1562
1562
|
r
|
|
1563
1563
|
),
|
|
@@ -1567,7 +1567,7 @@ const Wt = (t, e) => {
|
|
|
1567
1567
|
role: "radio",
|
|
1568
1568
|
"aria-checked": t === s.id,
|
|
1569
1569
|
onClick: () => e(s.id),
|
|
1570
|
-
className:
|
|
1570
|
+
className: L(
|
|
1571
1571
|
"px-2.5 py-1 text-[9px] font-extrabold uppercase rounded-md transition-all font-mono cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1572
1572
|
t === s.id ? "bg-primary text-primary-foreground shadow" : "text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
1573
1573
|
),
|
|
@@ -1576,62 +1576,62 @@ const Wt = (t, e) => {
|
|
|
1576
1576
|
s.id
|
|
1577
1577
|
))
|
|
1578
1578
|
}
|
|
1579
|
-
),
|
|
1580
|
-
const e =
|
|
1581
|
-
return /* @__PURE__ */ o(
|
|
1582
|
-
},
|
|
1579
|
+
), Rr = (t) => {
|
|
1580
|
+
const e = oe((r) => r.theme), n = oe((r) => r.setTheme);
|
|
1581
|
+
return /* @__PURE__ */ o(tr, { ...t, value: e, onChange: n });
|
|
1582
|
+
}, rr = ({
|
|
1583
1583
|
profile: t,
|
|
1584
1584
|
actions: e = [],
|
|
1585
1585
|
onProfileChange: n,
|
|
1586
1586
|
onAvatarChange: r,
|
|
1587
|
-
onClick:
|
|
1587
|
+
onClick: a,
|
|
1588
1588
|
showName: s = !0,
|
|
1589
|
-
className:
|
|
1589
|
+
className: i
|
|
1590
1590
|
}) => {
|
|
1591
|
-
const { name: d, role: l, email: c, avatarUrl:
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
}, [
|
|
1595
|
-
if (!
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1591
|
+
const { name: d, role: l, email: c, avatarUrl: y } = t, [x, h] = R(!1), [T, E] = R(!1), [g, m] = R(d), [b, N] = R(l ?? ""), w = F(null), f = F(null);
|
|
1592
|
+
O(() => {
|
|
1593
|
+
x && (m(d), N(l ?? ""), E(!1));
|
|
1594
|
+
}, [x, d, l]), O(() => {
|
|
1595
|
+
if (!x) return;
|
|
1596
|
+
const C = (S) => {
|
|
1597
|
+
w.current && !w.current.contains(S.target) && h(!1);
|
|
1598
1598
|
};
|
|
1599
|
-
return document.addEventListener("mousedown",
|
|
1600
|
-
}, [
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1603
|
-
},
|
|
1604
|
-
var
|
|
1605
|
-
const
|
|
1606
|
-
|
|
1607
|
-
},
|
|
1608
|
-
return /* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1599
|
+
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
1600
|
+
}, [x]);
|
|
1601
|
+
const D = (C) => {
|
|
1602
|
+
C.preventDefault(), n == null || n({ name: g, role: b }), E(!1);
|
|
1603
|
+
}, M = (C) => {
|
|
1604
|
+
var u;
|
|
1605
|
+
const S = (u = C.target.files) == null ? void 0 : u[0];
|
|
1606
|
+
S && (r == null || r(S)), C.target.value = "";
|
|
1607
|
+
}, A = (C) => y ? /* @__PURE__ */ o("img", { src: y, alt: d, className: "w-full h-full object-cover" }) : /* @__PURE__ */ o(Oe, { size: C, className: "text-muted-foreground" });
|
|
1608
|
+
return /* @__PURE__ */ p("div", { ref: w, className: "relative inline-block text-left", children: [
|
|
1609
|
+
/* @__PURE__ */ p(
|
|
1610
1610
|
"button",
|
|
1611
1611
|
{
|
|
1612
1612
|
type: "button",
|
|
1613
|
-
onClick: () =>
|
|
1614
|
-
"aria-haspopup":
|
|
1615
|
-
"aria-expanded":
|
|
1613
|
+
onClick: () => a ? a() : h((C) => !C),
|
|
1614
|
+
"aria-haspopup": a ? void 0 : "menu",
|
|
1615
|
+
"aria-expanded": a ? void 0 : x,
|
|
1616
1616
|
"aria-label": "User Profile Menu",
|
|
1617
|
-
className:
|
|
1617
|
+
className: L(
|
|
1618
1618
|
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none transition-all duration-200 select-none",
|
|
1619
1619
|
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",
|
|
1620
|
-
|
|
1621
|
-
|
|
1620
|
+
x && (s ? "bg-accent/60 border-border/40" : "border-primary/50 text-foreground ring-1 ring-primary/20"),
|
|
1621
|
+
i
|
|
1622
1622
|
),
|
|
1623
1623
|
children: [
|
|
1624
1624
|
/* @__PURE__ */ o(
|
|
1625
1625
|
"div",
|
|
1626
1626
|
{
|
|
1627
|
-
className:
|
|
1627
|
+
className: L(
|
|
1628
1628
|
"rounded-full overflow-hidden border border-border/50 bg-muted flex items-center justify-center shrink-0 shadow-sm",
|
|
1629
1629
|
s ? "w-6 h-6" : "w-full h-full"
|
|
1630
1630
|
),
|
|
1631
|
-
children:
|
|
1631
|
+
children: A(s ? 13 : 12)
|
|
1632
1632
|
}
|
|
1633
1633
|
),
|
|
1634
|
-
s && /* @__PURE__ */
|
|
1634
|
+
s && /* @__PURE__ */ p("div", { className: "flex flex-col min-w-0 leading-tight pr-1", children: [
|
|
1635
1635
|
/* @__PURE__ */ o("span", { className: "text-[11px] font-semibold truncate text-foreground", children: d }),
|
|
1636
1636
|
l && /* @__PURE__ */ o("span", { className: "text-[9px] text-muted-foreground/80 truncate font-medium", children: l })
|
|
1637
1637
|
] })
|
|
@@ -1642,38 +1642,38 @@ const Wt = (t, e) => {
|
|
|
1642
1642
|
"input",
|
|
1643
1643
|
{
|
|
1644
1644
|
type: "file",
|
|
1645
|
-
ref:
|
|
1646
|
-
onChange:
|
|
1645
|
+
ref: f,
|
|
1646
|
+
onChange: M,
|
|
1647
1647
|
accept: "image/*",
|
|
1648
1648
|
"aria-label": "Upload avatar",
|
|
1649
1649
|
className: "hidden"
|
|
1650
1650
|
}
|
|
1651
1651
|
),
|
|
1652
|
-
|
|
1652
|
+
x && /* @__PURE__ */ o(
|
|
1653
1653
|
"div",
|
|
1654
1654
|
{
|
|
1655
1655
|
role: "menu",
|
|
1656
|
-
className:
|
|
1656
|
+
className: L(
|
|
1657
1657
|
"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",
|
|
1658
1658
|
s ? "left-0" : "right-0"
|
|
1659
1659
|
),
|
|
1660
|
-
children:
|
|
1660
|
+
children: T ? /* @__PURE__ */ p("form", { onSubmit: D, className: "p-2 flex flex-col gap-2", children: [
|
|
1661
1661
|
/* @__PURE__ */ o("span", { className: "text-[10px] font-bold uppercase tracking-wider text-muted-foreground", children: "Edit Profile" }),
|
|
1662
|
-
/* @__PURE__ */
|
|
1662
|
+
/* @__PURE__ */ p("div", { className: "flex flex-col gap-1", children: [
|
|
1663
1663
|
/* @__PURE__ */ o("label", { htmlFor: "profile-name", className: "text-[9px] font-semibold text-muted-foreground", children: "Name" }),
|
|
1664
1664
|
/* @__PURE__ */ o(
|
|
1665
1665
|
"input",
|
|
1666
1666
|
{
|
|
1667
1667
|
id: "profile-name",
|
|
1668
1668
|
type: "text",
|
|
1669
|
-
value:
|
|
1670
|
-
onChange: (
|
|
1669
|
+
value: g,
|
|
1670
|
+
onChange: (C) => m(C.target.value),
|
|
1671
1671
|
required: !0,
|
|
1672
1672
|
className: "w-full px-2 py-1 text-xs border rounded bg-background focus:ring-1 focus:ring-primary focus:outline-none"
|
|
1673
1673
|
}
|
|
1674
1674
|
)
|
|
1675
1675
|
] }),
|
|
1676
|
-
/* @__PURE__ */
|
|
1676
|
+
/* @__PURE__ */ p("div", { className: "flex flex-col gap-1", children: [
|
|
1677
1677
|
/* @__PURE__ */ o("label", { htmlFor: "profile-role", className: "text-[9px] font-semibold text-muted-foreground", children: "Role" }),
|
|
1678
1678
|
/* @__PURE__ */ o(
|
|
1679
1679
|
"input",
|
|
@@ -1681,58 +1681,58 @@ const Wt = (t, e) => {
|
|
|
1681
1681
|
id: "profile-role",
|
|
1682
1682
|
type: "text",
|
|
1683
1683
|
value: b,
|
|
1684
|
-
onChange: (
|
|
1684
|
+
onChange: (C) => N(C.target.value),
|
|
1685
1685
|
className: "w-full px-2 py-1 text-xs border rounded bg-background focus:ring-1 focus:ring-primary focus:outline-none"
|
|
1686
1686
|
}
|
|
1687
1687
|
)
|
|
1688
1688
|
] }),
|
|
1689
|
-
/* @__PURE__ */
|
|
1690
|
-
/* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ p("div", { className: "flex gap-1.5 mt-1 justify-end", children: [
|
|
1690
|
+
/* @__PURE__ */ p(
|
|
1691
1691
|
"button",
|
|
1692
1692
|
{
|
|
1693
1693
|
type: "button",
|
|
1694
1694
|
onClick: () => E(!1),
|
|
1695
1695
|
className: "px-2 py-1 text-[10px] rounded hover:bg-accent text-muted-foreground flex items-center gap-1 border border-border/30",
|
|
1696
1696
|
children: [
|
|
1697
|
-
/* @__PURE__ */ o(
|
|
1697
|
+
/* @__PURE__ */ o(V, { size: 10 }),
|
|
1698
1698
|
" Cancel"
|
|
1699
1699
|
]
|
|
1700
1700
|
}
|
|
1701
1701
|
),
|
|
1702
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ p(
|
|
1703
1703
|
"button",
|
|
1704
1704
|
{
|
|
1705
1705
|
type: "submit",
|
|
1706
1706
|
className: "px-2 py-1 text-[10px] rounded bg-primary text-primary-foreground hover:bg-primary/95 flex items-center gap-1 font-semibold",
|
|
1707
1707
|
children: [
|
|
1708
|
-
/* @__PURE__ */ o(
|
|
1708
|
+
/* @__PURE__ */ o(dt, { size: 10 }),
|
|
1709
1709
|
" Save"
|
|
1710
1710
|
]
|
|
1711
1711
|
}
|
|
1712
1712
|
)
|
|
1713
1713
|
] })
|
|
1714
|
-
] }) : /* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1716
|
-
/* @__PURE__ */
|
|
1714
|
+
] }) : /* @__PURE__ */ p(Ae, { children: [
|
|
1715
|
+
/* @__PURE__ */ p("div", { className: "p-2 flex items-center gap-3 border-b border-border/40 pb-2.5 mb-1", children: [
|
|
1716
|
+
/* @__PURE__ */ p(
|
|
1717
1717
|
"div",
|
|
1718
1718
|
{
|
|
1719
1719
|
onClick: () => {
|
|
1720
|
-
var
|
|
1721
|
-
return r && ((
|
|
1720
|
+
var C;
|
|
1721
|
+
return r && ((C = f.current) == null ? void 0 : C.click());
|
|
1722
1722
|
},
|
|
1723
1723
|
title: r ? "Upload avatar image" : void 0,
|
|
1724
|
-
className:
|
|
1724
|
+
className: L(
|
|
1725
1725
|
"group relative w-12 h-12 rounded-full overflow-hidden border border-border/80 bg-muted flex items-center justify-center shrink-0 shadow-inner",
|
|
1726
1726
|
r && "cursor-pointer"
|
|
1727
1727
|
),
|
|
1728
1728
|
children: [
|
|
1729
|
-
|
|
1730
|
-
r && /* @__PURE__ */ o("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity", children: /* @__PURE__ */ o(
|
|
1729
|
+
A(24),
|
|
1730
|
+
r && /* @__PURE__ */ o("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity", children: /* @__PURE__ */ o(ut, { size: 14, className: "text-white" }) })
|
|
1731
1731
|
]
|
|
1732
1732
|
}
|
|
1733
1733
|
),
|
|
1734
|
-
/* @__PURE__ */
|
|
1735
|
-
/* @__PURE__ */
|
|
1734
|
+
/* @__PURE__ */ p("div", { className: "flex flex-col min-w-0 leading-normal flex-1", children: [
|
|
1735
|
+
/* @__PURE__ */ p("div", { className: "flex items-center gap-1", children: [
|
|
1736
1736
|
/* @__PURE__ */ o("span", { className: "text-xs font-bold truncate text-foreground", children: d }),
|
|
1737
1737
|
n && /* @__PURE__ */ o(
|
|
1738
1738
|
"button",
|
|
@@ -1742,7 +1742,7 @@ const Wt = (t, e) => {
|
|
|
1742
1742
|
title: "Edit Profile",
|
|
1743
1743
|
"aria-label": "Edit Profile",
|
|
1744
1744
|
className: "p-1 text-muted-foreground hover:text-foreground hover:bg-accent/40 rounded transition-colors",
|
|
1745
|
-
children: /* @__PURE__ */ o(
|
|
1745
|
+
children: /* @__PURE__ */ o(ft, { size: 10 })
|
|
1746
1746
|
}
|
|
1747
1747
|
)
|
|
1748
1748
|
] }),
|
|
@@ -1750,65 +1750,65 @@ const Wt = (t, e) => {
|
|
|
1750
1750
|
c && /* @__PURE__ */ o("span", { className: "text-[9px] text-muted-foreground/60 truncate font-mono mt-0.5", children: c })
|
|
1751
1751
|
] })
|
|
1752
1752
|
] }),
|
|
1753
|
-
e.map((
|
|
1754
|
-
const
|
|
1755
|
-
return /* @__PURE__ */
|
|
1753
|
+
e.map((C) => {
|
|
1754
|
+
const S = C.icon;
|
|
1755
|
+
return /* @__PURE__ */ p(
|
|
1756
1756
|
"button",
|
|
1757
1757
|
{
|
|
1758
1758
|
type: "button",
|
|
1759
1759
|
role: "menuitem",
|
|
1760
1760
|
onClick: () => {
|
|
1761
|
-
|
|
1761
|
+
C.onSelect(), h(!1);
|
|
1762
1762
|
},
|
|
1763
|
-
className:
|
|
1763
|
+
className: L(
|
|
1764
1764
|
"w-full px-2 py-1.5 text-left rounded-md text-[11px] font-medium flex items-center gap-2 cursor-pointer transition-colors",
|
|
1765
|
-
|
|
1766
|
-
|
|
1765
|
+
C.destructive ? "text-destructive hover:bg-destructive/10" : "hover:bg-accent/60 hover:text-accent-foreground",
|
|
1766
|
+
C.divider && "border-t border-border/20 pt-2 mt-1"
|
|
1767
1767
|
),
|
|
1768
1768
|
children: [
|
|
1769
|
-
|
|
1770
|
-
|
|
1769
|
+
S && /* @__PURE__ */ o(S, { size: 12, className: "opacity-70" }),
|
|
1770
|
+
C.label
|
|
1771
1771
|
]
|
|
1772
1772
|
},
|
|
1773
|
-
|
|
1773
|
+
C.id
|
|
1774
1774
|
);
|
|
1775
1775
|
})
|
|
1776
1776
|
] })
|
|
1777
1777
|
}
|
|
1778
1778
|
)
|
|
1779
1779
|
] });
|
|
1780
|
-
},
|
|
1781
|
-
const e =
|
|
1780
|
+
}, Pr = (t) => {
|
|
1781
|
+
const e = Z((c) => c.name), n = Z((c) => c.role), r = Z((c) => c.email), a = Z((c) => c.avatarUrl), s = Z((c) => c.customAvatar), i = Z((c) => c.updateProfile), d = Z((c) => c.setCustomAvatar);
|
|
1782
1782
|
return /* @__PURE__ */ o(
|
|
1783
|
-
|
|
1783
|
+
rr,
|
|
1784
1784
|
{
|
|
1785
1785
|
...t,
|
|
1786
|
-
profile: { name: e, role: n, email: r, avatarUrl: s ||
|
|
1787
|
-
onProfileChange:
|
|
1786
|
+
profile: { name: e, role: n, email: r, avatarUrl: s || a },
|
|
1787
|
+
onProfileChange: i,
|
|
1788
1788
|
onAvatarChange: (c) => {
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1791
|
-
typeof
|
|
1792
|
-
},
|
|
1789
|
+
const y = new FileReader();
|
|
1790
|
+
y.onloadend = () => {
|
|
1791
|
+
typeof y.result == "string" && d(y.result);
|
|
1792
|
+
}, y.readAsDataURL(c);
|
|
1793
1793
|
}
|
|
1794
1794
|
}
|
|
1795
1795
|
);
|
|
1796
|
-
},
|
|
1796
|
+
}, zr = ({ title: t, subtitle: e, icon: n, className: r }) => /* @__PURE__ */ p("div", { className: L("flex items-center space-x-3 select-none", r), children: [
|
|
1797
1797
|
n && /* @__PURE__ */ o("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 }),
|
|
1798
|
-
/* @__PURE__ */
|
|
1798
|
+
/* @__PURE__ */ p("div", { className: "min-w-0", children: [
|
|
1799
1799
|
/* @__PURE__ */ o("h1", { className: "text-xs font-black uppercase tracking-wider text-foreground font-mono truncate", children: t }),
|
|
1800
1800
|
e && /* @__PURE__ */ o("p", { className: "text-[9px] text-muted-foreground font-semibold truncate", children: e })
|
|
1801
1801
|
] })
|
|
1802
|
-
] }),
|
|
1802
|
+
] }), nr = ({ x: t, y: e, items: n, onClose: r, className: a }) => {
|
|
1803
1803
|
const s = F(null);
|
|
1804
|
-
return
|
|
1805
|
-
const
|
|
1804
|
+
return O(() => {
|
|
1805
|
+
const i = (l) => {
|
|
1806
1806
|
s.current && !s.current.contains(l.target) && r();
|
|
1807
1807
|
}, d = (l) => {
|
|
1808
1808
|
l.key === "Escape" && r();
|
|
1809
1809
|
};
|
|
1810
|
-
return document.addEventListener("mousedown",
|
|
1811
|
-
document.removeEventListener("mousedown",
|
|
1810
|
+
return document.addEventListener("mousedown", i), document.addEventListener("keydown", d), () => {
|
|
1811
|
+
document.removeEventListener("mousedown", i), document.removeEventListener("keydown", d);
|
|
1812
1812
|
};
|
|
1813
1813
|
}, [r]), /* @__PURE__ */ o(
|
|
1814
1814
|
"div",
|
|
@@ -1816,272 +1816,272 @@ const Wt = (t, e) => {
|
|
|
1816
1816
|
ref: s,
|
|
1817
1817
|
role: "menu",
|
|
1818
1818
|
style: { top: e, left: t },
|
|
1819
|
-
className:
|
|
1819
|
+
className: L(
|
|
1820
1820
|
"fixed z-[1000] min-w-[160px] bg-popover text-popover-foreground border shadow-md rounded-md py-1 animate-in fade-in zoom-in-95 duration-100",
|
|
1821
|
-
|
|
1821
|
+
a
|
|
1822
1822
|
),
|
|
1823
|
-
children: n.map((
|
|
1824
|
-
|
|
1825
|
-
/* @__PURE__ */
|
|
1823
|
+
children: n.map((i, d) => /* @__PURE__ */ p(ge.Fragment, { children: [
|
|
1824
|
+
i.divider && /* @__PURE__ */ o("div", { className: "h-[1px] bg-border my-1" }),
|
|
1825
|
+
/* @__PURE__ */ p(
|
|
1826
1826
|
"div",
|
|
1827
1827
|
{
|
|
1828
1828
|
role: "menuitem",
|
|
1829
|
-
tabIndex:
|
|
1830
|
-
"aria-disabled":
|
|
1829
|
+
tabIndex: i.disabled ? void 0 : 0,
|
|
1830
|
+
"aria-disabled": i.disabled,
|
|
1831
1831
|
onClick: () => {
|
|
1832
|
-
|
|
1832
|
+
i.disabled || (i.onClick(), r());
|
|
1833
1833
|
},
|
|
1834
1834
|
onKeyDown: (l) => {
|
|
1835
|
-
|
|
1835
|
+
i.disabled || l.key !== "Enter" && l.key !== " " || (l.preventDefault(), i.onClick(), r());
|
|
1836
1836
|
},
|
|
1837
|
-
className:
|
|
1837
|
+
className: L(
|
|
1838
1838
|
"px-3 py-1.5 text-xs flex items-center focus:outline-none",
|
|
1839
|
-
|
|
1839
|
+
i.disabled ? "opacity-40 cursor-default" : "cursor-pointer hover:bg-accent hover:text-accent-foreground focus:bg-accent"
|
|
1840
1840
|
),
|
|
1841
1841
|
children: [
|
|
1842
|
-
|
|
1843
|
-
/* @__PURE__ */ o("span", { children:
|
|
1842
|
+
i.icon && /* @__PURE__ */ o("span", { className: "mr-2 opacity-70", children: i.icon }),
|
|
1843
|
+
/* @__PURE__ */ o("span", { children: i.label })
|
|
1844
1844
|
]
|
|
1845
1845
|
}
|
|
1846
1846
|
)
|
|
1847
|
-
] }, `${
|
|
1847
|
+
] }, `${i.label}-${d}`))
|
|
1848
1848
|
}
|
|
1849
1849
|
);
|
|
1850
|
-
},
|
|
1850
|
+
}, Kr = ({
|
|
1851
1851
|
columns: t,
|
|
1852
1852
|
data: e,
|
|
1853
1853
|
onRowClick: n,
|
|
1854
1854
|
selectedRowId: r,
|
|
1855
|
-
rowKey:
|
|
1855
|
+
rowKey: a = "id",
|
|
1856
1856
|
virtualized: s = !0,
|
|
1857
|
-
showFilter:
|
|
1857
|
+
showFilter: i = !0,
|
|
1858
1858
|
loading: d = !1,
|
|
1859
1859
|
placeholder: l = "No data available",
|
|
1860
1860
|
className: c
|
|
1861
1861
|
}) => {
|
|
1862
|
-
const [
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
}, [
|
|
1866
|
-
const b =
|
|
1867
|
-
if (!
|
|
1868
|
-
const
|
|
1869
|
-
return e.filter((k) => Object.values(k).some((I) => I == null ? !1 : String(I).toLowerCase().includes(
|
|
1870
|
-
}, [e,
|
|
1871
|
-
if (!
|
|
1872
|
-
const { key:
|
|
1873
|
-
return [...b].sort((I,
|
|
1874
|
-
const
|
|
1875
|
-
if (
|
|
1876
|
-
if (
|
|
1862
|
+
const [y, x] = R(""), [h, T] = R(null), [E, g] = R(-1), m = F(null);
|
|
1863
|
+
O(() => {
|
|
1864
|
+
g(-1);
|
|
1865
|
+
}, [y, h]);
|
|
1866
|
+
const b = B(() => {
|
|
1867
|
+
if (!y) return e;
|
|
1868
|
+
const u = y.toLowerCase();
|
|
1869
|
+
return e.filter((k) => Object.values(k).some((I) => I == null ? !1 : String(I).toLowerCase().includes(u)));
|
|
1870
|
+
}, [e, y]), N = B(() => {
|
|
1871
|
+
if (!h) return b;
|
|
1872
|
+
const { key: u, direction: k } = h;
|
|
1873
|
+
return [...b].sort((I, z) => {
|
|
1874
|
+
const _ = I[u], K = z[u];
|
|
1875
|
+
if (_ === K) return 0;
|
|
1876
|
+
if (_ == null) return 1;
|
|
1877
1877
|
if (K == null) return -1;
|
|
1878
|
-
const
|
|
1879
|
-
if (!isNaN(
|
|
1880
|
-
return k === "asc" ?
|
|
1881
|
-
const
|
|
1882
|
-
return k === "asc" ?
|
|
1878
|
+
const j = Number(_), v = Number(K);
|
|
1879
|
+
if (!isNaN(j) && !isNaN(v))
|
|
1880
|
+
return k === "asc" ? j - v : v - j;
|
|
1881
|
+
const P = String(_).toLowerCase(), $ = String(K).toLowerCase();
|
|
1882
|
+
return k === "asc" ? P.localeCompare($) : $.localeCompare(P);
|
|
1883
1883
|
});
|
|
1884
|
-
}, [b,
|
|
1885
|
-
k !== !1 &&
|
|
1886
|
-
},
|
|
1887
|
-
if (!(
|
|
1888
|
-
if (
|
|
1889
|
-
|
|
1884
|
+
}, [b, h]), w = (u, k) => {
|
|
1885
|
+
k !== !1 && T((I) => !I || I.key !== u ? { key: u, direction: "asc" } : I.direction === "asc" ? { key: u, direction: "desc" } : null);
|
|
1886
|
+
}, f = (u) => {
|
|
1887
|
+
if (!(N.length === 0 || d)) {
|
|
1888
|
+
if (u.key === "ArrowDown")
|
|
1889
|
+
u.preventDefault(), g((k) => {
|
|
1890
1890
|
const I = k + 1;
|
|
1891
|
-
return I >=
|
|
1891
|
+
return I >= N.length ? 0 : I;
|
|
1892
1892
|
});
|
|
1893
|
-
else if (
|
|
1894
|
-
|
|
1893
|
+
else if (u.key === "ArrowUp")
|
|
1894
|
+
u.preventDefault(), g((k) => {
|
|
1895
1895
|
const I = k - 1;
|
|
1896
|
-
return I < 0 ?
|
|
1896
|
+
return I < 0 ? N.length - 1 : I;
|
|
1897
1897
|
});
|
|
1898
|
-
else if ((
|
|
1899
|
-
const k =
|
|
1898
|
+
else if ((u.key === "Enter" || u.key === " ") && (u.preventDefault(), E >= 0 && E < N.length)) {
|
|
1899
|
+
const k = N[E];
|
|
1900
1900
|
n && n(k);
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
|
-
},
|
|
1903
|
+
}, D = (u) => u.sortable === !1 ? null : (h == null ? void 0 : h.key) !== u.key ? /* @__PURE__ */ o(mt, { size: 14, className: "text-muted-foreground/60 ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity" }) : h.direction === "asc" ? /* @__PURE__ */ o(ze, { size: 14, className: "text-primary ml-1.5" }) : /* @__PURE__ */ o(Fe, { size: 14, className: "text-primary ml-1.5" }), M = () => /* @__PURE__ */ o("tr", { role: "row", className: "border-b border-border bg-muted/30 select-none", children: t.map((u) => /* @__PURE__ */ o(
|
|
1904
1904
|
"th",
|
|
1905
1905
|
{
|
|
1906
1906
|
role: "columnheader",
|
|
1907
|
-
"aria-sort": (
|
|
1908
|
-
className:
|
|
1907
|
+
"aria-sort": (h == null ? void 0 : h.key) === u.key ? h.direction === "asc" ? "ascending" : "descending" : "none",
|
|
1908
|
+
className: L(
|
|
1909
1909
|
"p-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider text-left transition-colors",
|
|
1910
|
-
|
|
1910
|
+
u.sortable !== !1 && "cursor-pointer hover:bg-accent/30 hover:text-foreground group"
|
|
1911
1911
|
),
|
|
1912
|
-
style: { width:
|
|
1913
|
-
onClick: () =>
|
|
1914
|
-
children: /* @__PURE__ */
|
|
1915
|
-
/* @__PURE__ */ o("span", { children:
|
|
1916
|
-
|
|
1912
|
+
style: { width: u.width },
|
|
1913
|
+
onClick: () => w(u.key, u.sortable),
|
|
1914
|
+
children: /* @__PURE__ */ p("div", { className: "flex items-center", children: [
|
|
1915
|
+
/* @__PURE__ */ o("span", { children: u.header }),
|
|
1916
|
+
D(u)
|
|
1917
1917
|
] })
|
|
1918
1918
|
},
|
|
1919
|
-
|
|
1920
|
-
)) }),
|
|
1921
|
-
const I = r !== void 0 &&
|
|
1919
|
+
u.key
|
|
1920
|
+
)) }), A = (u, k) => {
|
|
1921
|
+
const I = r !== void 0 && u[a] === r;
|
|
1922
1922
|
return /* @__PURE__ */ o(
|
|
1923
1923
|
"tr",
|
|
1924
1924
|
{
|
|
1925
1925
|
role: "row",
|
|
1926
1926
|
"aria-selected": I,
|
|
1927
|
-
onClick: () => n && n(
|
|
1928
|
-
className:
|
|
1927
|
+
onClick: () => n && n(u),
|
|
1928
|
+
className: L(
|
|
1929
1929
|
"border-b border-border/40 hover:bg-accent/40 transition-colors cursor-pointer text-sm outline-none",
|
|
1930
1930
|
I && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
|
|
1931
1931
|
E === k && "bg-accent/60 ring-1 ring-inset ring-ring"
|
|
1932
1932
|
),
|
|
1933
|
-
children: t.map((
|
|
1934
|
-
const K =
|
|
1935
|
-
return /* @__PURE__ */ o("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children:
|
|
1933
|
+
children: t.map((_) => {
|
|
1934
|
+
const K = u[_.key];
|
|
1935
|
+
return /* @__PURE__ */ o("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: _.render ? _.render(K, u) : K != null ? String(K) : "" }, _.key);
|
|
1936
1936
|
})
|
|
1937
1937
|
},
|
|
1938
|
-
String(
|
|
1938
|
+
String(u[a] || k)
|
|
1939
1939
|
);
|
|
1940
|
-
},
|
|
1941
|
-
Table: (
|
|
1940
|
+
}, C = B(() => ({
|
|
1941
|
+
Table: (u) => /* @__PURE__ */ o(
|
|
1942
1942
|
"table",
|
|
1943
1943
|
{
|
|
1944
|
-
...
|
|
1944
|
+
...u,
|
|
1945
1945
|
role: "grid",
|
|
1946
1946
|
className: "w-full border-collapse text-left bg-background text-foreground"
|
|
1947
1947
|
}
|
|
1948
1948
|
),
|
|
1949
|
-
TableHead: ge.forwardRef((
|
|
1950
|
-
TableBody: ge.forwardRef((
|
|
1951
|
-
TableRow: ({ item:
|
|
1952
|
-
if (!k || !
|
|
1953
|
-
const
|
|
1949
|
+
TableHead: ge.forwardRef((u, k) => /* @__PURE__ */ o("thead", { ref: k, ...u, 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)]" })),
|
|
1950
|
+
TableBody: ge.forwardRef((u, k) => /* @__PURE__ */ o("tbody", { ref: k, ...u })),
|
|
1951
|
+
TableRow: ({ item: u, context: k, ...I }) => {
|
|
1952
|
+
if (!k || !u) return /* @__PURE__ */ o("tr", { ...I });
|
|
1953
|
+
const z = k.selectedRowId !== void 0 && u[k.rowKey] === k.selectedRowId, _ = k.focusedIndex === I["data-index"];
|
|
1954
1954
|
return /* @__PURE__ */ o(
|
|
1955
1955
|
"tr",
|
|
1956
1956
|
{
|
|
1957
1957
|
...I,
|
|
1958
1958
|
onClick: () => {
|
|
1959
1959
|
var K;
|
|
1960
|
-
return (K = k.onRowClick) == null ? void 0 : K.call(k,
|
|
1960
|
+
return (K = k.onRowClick) == null ? void 0 : K.call(k, u);
|
|
1961
1961
|
},
|
|
1962
|
-
className:
|
|
1962
|
+
className: L(
|
|
1963
1963
|
"border-b border-border/40 hover:bg-accent/40 transition-colors cursor-pointer text-sm outline-none",
|
|
1964
|
-
|
|
1965
|
-
|
|
1964
|
+
z && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
|
|
1965
|
+
_ && "bg-accent/60 ring-1 ring-inset ring-ring"
|
|
1966
1966
|
)
|
|
1967
1967
|
}
|
|
1968
1968
|
);
|
|
1969
1969
|
}
|
|
1970
|
-
}), []),
|
|
1971
|
-
/* @__PURE__ */ o(
|
|
1970
|
+
}), []), S = () => d ? /* @__PURE__ */ p("div", { className: "flex flex-col items-center justify-center h-64 space-y-3", children: [
|
|
1971
|
+
/* @__PURE__ */ o(Ke, { className: "animate-spin text-primary", size: 24 }),
|
|
1972
1972
|
/* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground", children: "Loading dataset..." })
|
|
1973
|
-
] }) :
|
|
1973
|
+
] }) : N.length === 0 ? /* @__PURE__ */ p("div", { className: "flex flex-col items-center justify-center h-48 text-center px-4", children: [
|
|
1974
1974
|
/* @__PURE__ */ o("span", { className: "text-sm font-medium text-foreground", children: l }),
|
|
1975
1975
|
/* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground mt-1", children: "No items matched your search query." })
|
|
1976
1976
|
] }) : s ? /* @__PURE__ */ o("div", { className: "flex-1 min-h-[300px] h-full relative", children: /* @__PURE__ */ o(
|
|
1977
|
-
|
|
1977
|
+
xt,
|
|
1978
1978
|
{
|
|
1979
|
-
data:
|
|
1979
|
+
data: N,
|
|
1980
1980
|
context: {
|
|
1981
1981
|
selectedRowId: r,
|
|
1982
1982
|
focusedIndex: E,
|
|
1983
|
-
rowKey:
|
|
1983
|
+
rowKey: a,
|
|
1984
1984
|
onRowClick: n
|
|
1985
1985
|
},
|
|
1986
|
-
components:
|
|
1987
|
-
fixedHeaderContent:
|
|
1988
|
-
itemContent: (
|
|
1989
|
-
const
|
|
1990
|
-
return /* @__PURE__ */ o("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: I.render ? I.render(
|
|
1986
|
+
components: C,
|
|
1987
|
+
fixedHeaderContent: M,
|
|
1988
|
+
itemContent: (u, k) => /* @__PURE__ */ o(Ae, { children: t.map((I) => {
|
|
1989
|
+
const z = k[I.key];
|
|
1990
|
+
return /* @__PURE__ */ o("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: I.render ? I.render(z, k) : z != null ? String(z) : "" }, I.key);
|
|
1991
1991
|
}) })
|
|
1992
1992
|
}
|
|
1993
|
-
) }) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */
|
|
1994
|
-
/* @__PURE__ */ o("thead", { children:
|
|
1995
|
-
/* @__PURE__ */ o("tbody", { children:
|
|
1993
|
+
) }) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ p("table", { role: "grid", className: "w-full border-collapse text-left bg-background text-foreground", children: [
|
|
1994
|
+
/* @__PURE__ */ o("thead", { children: M() }),
|
|
1995
|
+
/* @__PURE__ */ o("tbody", { children: N.map((u, k) => A(u, k)) })
|
|
1996
1996
|
] }) });
|
|
1997
|
-
return /* @__PURE__ */
|
|
1997
|
+
return /* @__PURE__ */ p(
|
|
1998
1998
|
"div",
|
|
1999
1999
|
{
|
|
2000
|
-
ref:
|
|
2000
|
+
ref: m,
|
|
2001
2001
|
role: "region",
|
|
2002
2002
|
"aria-label": "Data Grid",
|
|
2003
2003
|
tabIndex: 0,
|
|
2004
|
-
onKeyDown:
|
|
2005
|
-
className:
|
|
2004
|
+
onKeyDown: f,
|
|
2005
|
+
className: L(
|
|
2006
2006
|
"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",
|
|
2007
2007
|
c
|
|
2008
2008
|
),
|
|
2009
2009
|
children: [
|
|
2010
|
-
|
|
2011
|
-
/* @__PURE__ */
|
|
2012
|
-
/* @__PURE__ */ o(
|
|
2010
|
+
i && /* @__PURE__ */ p("div", { className: "flex items-center justify-between p-3 border-b border-border bg-muted/20", children: [
|
|
2011
|
+
/* @__PURE__ */ p("div", { className: "relative flex-1 max-w-sm", children: [
|
|
2012
|
+
/* @__PURE__ */ o(ue, { size: 14, className: "absolute left-2.5 top-2.5 text-muted-foreground" }),
|
|
2013
2013
|
/* @__PURE__ */ o(
|
|
2014
2014
|
"input",
|
|
2015
2015
|
{
|
|
2016
2016
|
type: "text",
|
|
2017
2017
|
placeholder: "Filter table rows...",
|
|
2018
2018
|
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",
|
|
2019
|
-
value:
|
|
2020
|
-
onChange: (
|
|
2019
|
+
value: y,
|
|
2020
|
+
onChange: (u) => x(u.target.value)
|
|
2021
2021
|
}
|
|
2022
2022
|
),
|
|
2023
|
-
|
|
2023
|
+
y && /* @__PURE__ */ o(
|
|
2024
2024
|
"button",
|
|
2025
2025
|
{
|
|
2026
|
-
onClick: () =>
|
|
2026
|
+
onClick: () => x(""),
|
|
2027
2027
|
className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
|
|
2028
2028
|
"aria-label": "Clear filter",
|
|
2029
|
-
children: /* @__PURE__ */ o(
|
|
2029
|
+
children: /* @__PURE__ */ o(V, { size: 12 })
|
|
2030
2030
|
}
|
|
2031
2031
|
)
|
|
2032
2032
|
] }),
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
|
|
2033
|
+
/* @__PURE__ */ p("div", { className: "text-[11px] text-muted-foreground font-medium ml-4", children: [
|
|
2034
|
+
N.length,
|
|
2035
2035
|
" of ",
|
|
2036
2036
|
e.length,
|
|
2037
2037
|
" records"
|
|
2038
2038
|
] })
|
|
2039
2039
|
] }),
|
|
2040
|
-
|
|
2040
|
+
S()
|
|
2041
2041
|
]
|
|
2042
2042
|
}
|
|
2043
2043
|
);
|
|
2044
|
-
},
|
|
2044
|
+
}, Fr = ({
|
|
2045
2045
|
results: t,
|
|
2046
2046
|
onQueryChange: e,
|
|
2047
2047
|
onSelect: n,
|
|
2048
2048
|
categories: r,
|
|
2049
|
-
placeholder:
|
|
2049
|
+
placeholder: a = "Search…",
|
|
2050
2050
|
debounceMs: s = 200,
|
|
2051
|
-
className:
|
|
2051
|
+
className: i
|
|
2052
2052
|
}) => {
|
|
2053
|
-
const [d, l] =
|
|
2054
|
-
() =>
|
|
2055
|
-
[
|
|
2053
|
+
const [d, l] = R(""), [c, y] = R(!1), [x, h] = R(0), T = F(null), E = F(null), g = B(() => r || [...new Set(t.map((w) => w.category))], [r, t]), m = B(
|
|
2054
|
+
() => g.flatMap((w) => t.filter((f) => f.category === w)),
|
|
2055
|
+
[g, t]
|
|
2056
2056
|
);
|
|
2057
|
-
|
|
2058
|
-
const
|
|
2059
|
-
|
|
2057
|
+
O(() => {
|
|
2058
|
+
const w = (f) => {
|
|
2059
|
+
T.current && !T.current.contains(f.target) && y(!1);
|
|
2060
2060
|
};
|
|
2061
|
-
return document.addEventListener("mousedown",
|
|
2062
|
-
}, []),
|
|
2061
|
+
return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
|
|
2062
|
+
}, []), O(() => {
|
|
2063
2063
|
if (!e) return;
|
|
2064
|
-
const
|
|
2065
|
-
return () => window.clearTimeout(
|
|
2066
|
-
}, [d, s, e]),
|
|
2067
|
-
|
|
2064
|
+
const w = window.setTimeout(() => e(d), s);
|
|
2065
|
+
return () => window.clearTimeout(w);
|
|
2066
|
+
}, [d, s, e]), O(() => {
|
|
2067
|
+
h(0);
|
|
2068
2068
|
}, [t]);
|
|
2069
|
-
const b = (
|
|
2070
|
-
n(
|
|
2071
|
-
},
|
|
2072
|
-
var
|
|
2069
|
+
const b = (w) => {
|
|
2070
|
+
n(w), y(!1), l("");
|
|
2071
|
+
}, N = (w) => {
|
|
2072
|
+
var f;
|
|
2073
2073
|
if (!c) {
|
|
2074
|
-
(
|
|
2074
|
+
(w.key === "ArrowDown" || w.key === "Enter") && y(!0);
|
|
2075
2075
|
return;
|
|
2076
2076
|
}
|
|
2077
|
-
|
|
2078
|
-
(
|
|
2079
|
-
)) :
|
|
2077
|
+
w.key === "ArrowDown" ? (w.preventDefault(), h((D) => m.length ? (D + 1) % m.length : 0)) : w.key === "ArrowUp" ? (w.preventDefault(), h(
|
|
2078
|
+
(D) => m.length ? (D - 1 + m.length) % m.length : 0
|
|
2079
|
+
)) : w.key === "Enter" ? (w.preventDefault(), m[x] && b(m[x])) : w.key === "Escape" && (w.preventDefault(), y(!1), (f = E.current) == null || f.blur());
|
|
2080
2080
|
};
|
|
2081
|
-
return /* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2081
|
+
return /* @__PURE__ */ p("div", { ref: T, className: L("relative w-full", i), children: [
|
|
2082
|
+
/* @__PURE__ */ p("div", { className: "relative flex items-center", children: [
|
|
2083
2083
|
/* @__PURE__ */ o(
|
|
2084
|
-
|
|
2084
|
+
ue,
|
|
2085
2085
|
{
|
|
2086
2086
|
size: 13,
|
|
2087
2087
|
className: "absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
@@ -2094,14 +2094,14 @@ const Wt = (t, e) => {
|
|
|
2094
2094
|
type: "text",
|
|
2095
2095
|
role: "combobox",
|
|
2096
2096
|
"aria-expanded": c,
|
|
2097
|
-
"aria-label":
|
|
2097
|
+
"aria-label": a,
|
|
2098
2098
|
value: d,
|
|
2099
|
-
placeholder:
|
|
2100
|
-
onChange: (
|
|
2101
|
-
l(
|
|
2099
|
+
placeholder: a,
|
|
2100
|
+
onChange: (w) => {
|
|
2101
|
+
l(w.target.value), y(!0);
|
|
2102
2102
|
},
|
|
2103
|
-
onFocus: () =>
|
|
2104
|
-
onKeyDown:
|
|
2103
|
+
onFocus: () => y(!0),
|
|
2104
|
+
onKeyDown: N,
|
|
2105
2105
|
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"
|
|
2106
2106
|
}
|
|
2107
2107
|
),
|
|
@@ -2110,72 +2110,72 @@ const Wt = (t, e) => {
|
|
|
2110
2110
|
{
|
|
2111
2111
|
type: "button",
|
|
2112
2112
|
onClick: () => {
|
|
2113
|
-
var
|
|
2114
|
-
l(""), (
|
|
2113
|
+
var w;
|
|
2114
|
+
l(""), (w = E.current) == null || w.focus();
|
|
2115
2115
|
},
|
|
2116
2116
|
"aria-label": "Clear search",
|
|
2117
2117
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
|
|
2118
|
-
children: /* @__PURE__ */ o(
|
|
2118
|
+
children: /* @__PURE__ */ o(V, { size: 11 })
|
|
2119
2119
|
}
|
|
2120
2120
|
)
|
|
2121
2121
|
] }),
|
|
2122
|
-
c && d.trim() && /* @__PURE__ */
|
|
2122
|
+
c && d.trim() && /* @__PURE__ */ p(
|
|
2123
2123
|
"div",
|
|
2124
2124
|
{
|
|
2125
2125
|
role: "listbox",
|
|
2126
2126
|
className: "absolute right-0 md:left-0 mt-1.5 w-80 max-h-[380px] bg-popover text-popover-foreground border border-border shadow-lg rounded-lg overflow-hidden flex flex-col z-[100] animate-in fade-in-50 slide-in-from-top-1 duration-100",
|
|
2127
2127
|
children: [
|
|
2128
|
-
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto py-1", children:
|
|
2128
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto py-1", children: m.length === 0 ? /* @__PURE__ */ p("div", { className: "px-4 py-6 text-center text-xs text-muted-foreground italic", children: [
|
|
2129
2129
|
'No results found matching "',
|
|
2130
2130
|
d,
|
|
2131
2131
|
'"'
|
|
2132
|
-
] }) :
|
|
2133
|
-
const
|
|
2134
|
-
return
|
|
2135
|
-
/* @__PURE__ */ o("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:
|
|
2136
|
-
|
|
2137
|
-
const
|
|
2138
|
-
return /* @__PURE__ */
|
|
2132
|
+
] }) : g.map((w) => {
|
|
2133
|
+
const f = t.filter((D) => D.category === w);
|
|
2134
|
+
return f.length === 0 ? null : /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
|
|
2135
|
+
/* @__PURE__ */ o("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: w }),
|
|
2136
|
+
f.map((D) => {
|
|
2137
|
+
const M = D.icon, A = m.indexOf(D), C = A === x;
|
|
2138
|
+
return /* @__PURE__ */ p(
|
|
2139
2139
|
"div",
|
|
2140
2140
|
{
|
|
2141
2141
|
role: "option",
|
|
2142
|
-
"aria-selected":
|
|
2143
|
-
onClick: () => b(
|
|
2144
|
-
onMouseEnter: () =>
|
|
2145
|
-
className:
|
|
2142
|
+
"aria-selected": C,
|
|
2143
|
+
onClick: () => b(D),
|
|
2144
|
+
onMouseEnter: () => h(A),
|
|
2145
|
+
className: L(
|
|
2146
2146
|
"px-3 py-2 cursor-pointer flex items-start space-x-2.5 transition-colors border-l-2",
|
|
2147
|
-
|
|
2147
|
+
C ? "bg-accent text-accent-foreground border-primary" : "border-transparent hover:bg-accent/40"
|
|
2148
2148
|
),
|
|
2149
2149
|
children: [
|
|
2150
|
-
|
|
2150
|
+
M && /* @__PURE__ */ o(
|
|
2151
2151
|
"div",
|
|
2152
2152
|
{
|
|
2153
|
-
className:
|
|
2153
|
+
className: L(
|
|
2154
2154
|
"mt-0.5 p-1 rounded bg-muted/50",
|
|
2155
|
-
|
|
2155
|
+
C && "bg-background text-primary"
|
|
2156
2156
|
),
|
|
2157
|
-
children: /* @__PURE__ */ o(
|
|
2157
|
+
children: /* @__PURE__ */ o(M, { size: 12 })
|
|
2158
2158
|
}
|
|
2159
2159
|
),
|
|
2160
|
-
/* @__PURE__ */
|
|
2161
|
-
/* @__PURE__ */ o("div", { className: "text-xs font-medium truncate", children:
|
|
2162
|
-
|
|
2160
|
+
/* @__PURE__ */ p("div", { className: "flex-1 min-w-0", children: [
|
|
2161
|
+
/* @__PURE__ */ o("div", { className: "text-xs font-medium truncate", children: D.title }),
|
|
2162
|
+
D.description && /* @__PURE__ */ o("div", { className: "text-[10px] text-muted-foreground truncate mt-0.5", children: D.description })
|
|
2163
2163
|
] })
|
|
2164
2164
|
]
|
|
2165
2165
|
},
|
|
2166
|
-
`${
|
|
2166
|
+
`${D.category}-${D.id}`
|
|
2167
2167
|
);
|
|
2168
2168
|
})
|
|
2169
|
-
] },
|
|
2169
|
+
] }, w);
|
|
2170
2170
|
}) }),
|
|
2171
|
-
|
|
2172
|
-
/* @__PURE__ */
|
|
2173
|
-
/* @__PURE__ */
|
|
2171
|
+
m.length > 0 && /* @__PURE__ */ p("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: [
|
|
2172
|
+
/* @__PURE__ */ p("div", { className: "flex space-x-2", children: [
|
|
2173
|
+
/* @__PURE__ */ p("span", { children: [
|
|
2174
2174
|
/* @__PURE__ */ o("kbd", { className: "bg-muted px-1 rounded border border-border/60", children: "↑↓" }),
|
|
2175
2175
|
" ",
|
|
2176
2176
|
"navigate"
|
|
2177
2177
|
] }),
|
|
2178
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ p("span", { children: [
|
|
2179
2179
|
/* @__PURE__ */ o("kbd", { className: "bg-muted px-1 rounded border border-border/60", children: "↵" }),
|
|
2180
2180
|
" ",
|
|
2181
2181
|
"select"
|
|
@@ -2187,31 +2187,31 @@ const Wt = (t, e) => {
|
|
|
2187
2187
|
}
|
|
2188
2188
|
)
|
|
2189
2189
|
] });
|
|
2190
|
-
},
|
|
2190
|
+
}, _r = ({
|
|
2191
2191
|
placeholder: t = "Search...",
|
|
2192
2192
|
onSearch: e,
|
|
2193
2193
|
results: n,
|
|
2194
2194
|
onSelect: r,
|
|
2195
|
-
suggestions:
|
|
2195
|
+
suggestions: a = [],
|
|
2196
2196
|
loading: s = !1,
|
|
2197
|
-
className:
|
|
2197
|
+
className: i
|
|
2198
2198
|
}) => {
|
|
2199
|
-
const [d, l] =
|
|
2200
|
-
|
|
2201
|
-
const
|
|
2199
|
+
const [d, l] = R(""), [c, y] = R(!1), [x, h] = R(-1), T = F(null);
|
|
2200
|
+
O(() => {
|
|
2201
|
+
const m = setTimeout(() => {
|
|
2202
2202
|
e(d);
|
|
2203
2203
|
}, 300);
|
|
2204
|
-
return () => clearTimeout(
|
|
2204
|
+
return () => clearTimeout(m);
|
|
2205
2205
|
}, [d, e]);
|
|
2206
|
-
const E =
|
|
2207
|
-
(
|
|
2208
|
-
),
|
|
2209
|
-
c && E.length > 0 && (
|
|
2206
|
+
const E = a.filter(
|
|
2207
|
+
(m) => m.toLowerCase().includes(d.toLowerCase()) && m.toLowerCase() !== d.toLowerCase()
|
|
2208
|
+
), g = (m) => {
|
|
2209
|
+
c && E.length > 0 && (m.key === "ArrowDown" ? (m.preventDefault(), h((b) => (b + 1) % E.length)) : m.key === "ArrowUp" ? (m.preventDefault(), h((b) => (b - 1 + E.length) % E.length)) : m.key === "Enter" && x >= 0 && (m.preventDefault(), l(E[x]), y(!1)));
|
|
2210
2210
|
};
|
|
2211
|
-
return /* @__PURE__ */
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */ o("div", { className: "absolute left-2.5 top-2.5 text-muted-foreground", children: s ? /* @__PURE__ */ o(
|
|
2211
|
+
return /* @__PURE__ */ p("div", { ref: T, className: L("flex flex-col h-full bg-background", i), children: [
|
|
2212
|
+
/* @__PURE__ */ p("div", { className: "p-3 border-b border-border/50", children: [
|
|
2213
|
+
/* @__PURE__ */ p("div", { className: "relative", children: [
|
|
2214
|
+
/* @__PURE__ */ o("div", { className: "absolute left-2.5 top-2.5 text-muted-foreground", children: s ? /* @__PURE__ */ o(Ke, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ o(ue, { size: 14 }) }),
|
|
2215
2215
|
/* @__PURE__ */ o(
|
|
2216
2216
|
"input",
|
|
2217
2217
|
{
|
|
@@ -2219,11 +2219,11 @@ const Wt = (t, e) => {
|
|
|
2219
2219
|
className: "w-full bg-secondary/50 border border-border rounded-md pl-9 pr-8 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all",
|
|
2220
2220
|
placeholder: t,
|
|
2221
2221
|
value: d,
|
|
2222
|
-
onChange: (
|
|
2223
|
-
l(
|
|
2222
|
+
onChange: (m) => {
|
|
2223
|
+
l(m.target.value), y(!0), h(-1);
|
|
2224
2224
|
},
|
|
2225
|
-
onKeyDown:
|
|
2226
|
-
onFocus: () =>
|
|
2225
|
+
onKeyDown: g,
|
|
2226
|
+
onFocus: () => y(!0)
|
|
2227
2227
|
}
|
|
2228
2228
|
),
|
|
2229
2229
|
d && /* @__PURE__ */ o(
|
|
@@ -2233,181 +2233,181 @@ const Wt = (t, e) => {
|
|
|
2233
2233
|
l(""), e("");
|
|
2234
2234
|
},
|
|
2235
2235
|
className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
|
|
2236
|
-
children: /* @__PURE__ */ o(
|
|
2236
|
+
children: /* @__PURE__ */ o(V, { size: 14 })
|
|
2237
2237
|
}
|
|
2238
2238
|
)
|
|
2239
2239
|
] }),
|
|
2240
|
-
c && E.length > 0 && /* @__PURE__ */ o("div", { className: "absolute left-3 right-3 mt-1 bg-popover border shadow-lg rounded-md z-50 py-1 overflow-hidden", children: E.map((
|
|
2240
|
+
c && E.length > 0 && /* @__PURE__ */ o("div", { className: "absolute left-3 right-3 mt-1 bg-popover border shadow-lg rounded-md z-50 py-1 overflow-hidden", children: E.map((m, b) => /* @__PURE__ */ p(
|
|
2241
2241
|
"div",
|
|
2242
2242
|
{
|
|
2243
|
-
className:
|
|
2243
|
+
className: L(
|
|
2244
2244
|
"px-3 py-1.5 text-xs cursor-pointer flex items-center space-x-2",
|
|
2245
|
-
b ===
|
|
2245
|
+
b === x ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
|
|
2246
2246
|
),
|
|
2247
2247
|
onClick: () => {
|
|
2248
|
-
l(
|
|
2248
|
+
l(m), y(!1);
|
|
2249
2249
|
},
|
|
2250
2250
|
children: [
|
|
2251
|
-
/* @__PURE__ */ o(
|
|
2252
|
-
/* @__PURE__ */ o("span", { children:
|
|
2251
|
+
/* @__PURE__ */ o(pt, { size: 12, className: "text-muted-foreground" }),
|
|
2252
|
+
/* @__PURE__ */ o("span", { children: m })
|
|
2253
2253
|
]
|
|
2254
2254
|
},
|
|
2255
|
-
|
|
2255
|
+
m
|
|
2256
2256
|
)) })
|
|
2257
2257
|
] }),
|
|
2258
|
-
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto", children: n.length === 0 ? /* @__PURE__ */ o("div", { className: "p-8 text-center text-xs text-muted-foreground italic", children: d ? `No results found for "${d}"` : "Type to start searching..." }) : /* @__PURE__ */ o("div", { className: "py-2", children: n.map((
|
|
2259
|
-
const b =
|
|
2258
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto", children: n.length === 0 ? /* @__PURE__ */ o("div", { className: "p-8 text-center text-xs text-muted-foreground italic", children: d ? `No results found for "${d}"` : "Type to start searching..." }) : /* @__PURE__ */ o("div", { className: "py-2", children: n.map((m) => {
|
|
2259
|
+
const b = m.icon;
|
|
2260
2260
|
return /* @__PURE__ */ o(
|
|
2261
2261
|
"div",
|
|
2262
2262
|
{
|
|
2263
|
-
onClick: () => r(
|
|
2263
|
+
onClick: () => r(m),
|
|
2264
2264
|
className: "px-4 py-2 hover:bg-accent/50 cursor-pointer group transition-colors border-l-2 border-transparent hover:border-primary",
|
|
2265
|
-
children: /* @__PURE__ */
|
|
2265
|
+
children: /* @__PURE__ */ p("div", { className: "flex items-start space-x-3", children: [
|
|
2266
2266
|
b && /* @__PURE__ */ o("div", { className: "mt-0.5 p-1 rounded bg-muted group-hover:bg-background transition-colors", children: /* @__PURE__ */ o(b, { size: 14, className: "text-muted-foreground group-hover:text-primary" }) }),
|
|
2267
|
-
/* @__PURE__ */
|
|
2268
|
-
/* @__PURE__ */
|
|
2269
|
-
/* @__PURE__ */ o("span", { className: "text-xs font-medium truncate", children:
|
|
2270
|
-
|
|
2267
|
+
/* @__PURE__ */ p("div", { className: "flex-1 min-w-0", children: [
|
|
2268
|
+
/* @__PURE__ */ p("div", { className: "flex items-center justify-between", children: [
|
|
2269
|
+
/* @__PURE__ */ o("span", { className: "text-xs font-medium truncate", children: m.title }),
|
|
2270
|
+
m.category && /* @__PURE__ */ o("span", { className: "text-[10px] uppercase tracking-wider text-muted-foreground font-bold px-1.5 py-0.5 bg-muted rounded", children: m.category })
|
|
2271
2271
|
] }),
|
|
2272
|
-
|
|
2272
|
+
m.description && /* @__PURE__ */ o("p", { className: "text-[11px] text-muted-foreground truncate mt-0.5", children: m.description })
|
|
2273
2273
|
] })
|
|
2274
2274
|
] })
|
|
2275
2275
|
},
|
|
2276
|
-
|
|
2276
|
+
m.id
|
|
2277
2277
|
);
|
|
2278
2278
|
}) }) })
|
|
2279
2279
|
] });
|
|
2280
|
-
},
|
|
2280
|
+
}, He = (t, e = 0) => t.reduce((n, r) => (n.push({ ...r, level: e }), r.isOpen && r.children && n.push(...He(r.children, e + 1)), n), []), or = (t) => {
|
|
2281
2281
|
if (!t) return ["background"];
|
|
2282
2282
|
const e = [t.isBranch ? "branch" : "leaf"];
|
|
2283
2283
|
return t.kind && e.push(t.kind), e;
|
|
2284
|
-
},
|
|
2284
|
+
}, Ur = ({
|
|
2285
2285
|
data: t,
|
|
2286
2286
|
onToggle: e,
|
|
2287
2287
|
onActivate: n,
|
|
2288
2288
|
onMoveNode: r,
|
|
2289
|
-
actions:
|
|
2289
|
+
actions: a = [],
|
|
2290
2290
|
indent: s = 12,
|
|
2291
|
-
virtualized:
|
|
2291
|
+
virtualized: i = !0,
|
|
2292
2292
|
"aria-label": d = "Tree",
|
|
2293
2293
|
className: l
|
|
2294
2294
|
}) => {
|
|
2295
|
-
const [c,
|
|
2296
|
-
|
|
2297
|
-
|
|
2295
|
+
const [c, y] = R(null), [x, h] = R(null), T = B(() => He(t), [t]);
|
|
2296
|
+
O(() => {
|
|
2297
|
+
h(null);
|
|
2298
2298
|
}, [t]);
|
|
2299
|
-
const E =
|
|
2300
|
-
(b) => !b.showFor || c && b.showFor.some((
|
|
2299
|
+
const E = a.filter(
|
|
2300
|
+
(b) => !b.showFor || c && b.showFor.some((N) => c.scopes.includes(N))
|
|
2301
2301
|
).map((b) => ({
|
|
2302
2302
|
label: b.label,
|
|
2303
2303
|
icon: b.icon,
|
|
2304
2304
|
divider: b.divider,
|
|
2305
2305
|
onClick: () => c && b.onSelect(c.context)
|
|
2306
|
-
})),
|
|
2307
|
-
|
|
2306
|
+
})), g = (b, N) => {
|
|
2307
|
+
a.length !== 0 && (b.preventDefault(), b.stopPropagation(), y({
|
|
2308
2308
|
x: b.clientX,
|
|
2309
2309
|
y: b.clientY,
|
|
2310
|
-
scopes:
|
|
2311
|
-
context: { nodeId: (
|
|
2310
|
+
scopes: or(N),
|
|
2311
|
+
context: { nodeId: (N == null ? void 0 : N.id) ?? null, node: N }
|
|
2312
2312
|
}));
|
|
2313
|
-
},
|
|
2314
|
-
const
|
|
2315
|
-
return /* @__PURE__ */
|
|
2313
|
+
}, m = (b) => {
|
|
2314
|
+
const N = T[b], w = !!N.isBranch;
|
|
2315
|
+
return /* @__PURE__ */ p(
|
|
2316
2316
|
"div",
|
|
2317
2317
|
{
|
|
2318
2318
|
role: "treeitem",
|
|
2319
|
-
"aria-expanded":
|
|
2320
|
-
"aria-level":
|
|
2319
|
+
"aria-expanded": w ? !!N.isOpen : void 0,
|
|
2320
|
+
"aria-level": N.level + 1,
|
|
2321
2321
|
tabIndex: 0,
|
|
2322
2322
|
draggable: !0,
|
|
2323
|
-
onDragStart: (
|
|
2324
|
-
|
|
2323
|
+
onDragStart: (f) => {
|
|
2324
|
+
f.dataTransfer.setData("text/plain", N.id), f.dataTransfer.effectAllowed = "move";
|
|
2325
2325
|
},
|
|
2326
|
-
onDragOver: (
|
|
2327
|
-
|
|
2326
|
+
onDragOver: (f) => {
|
|
2327
|
+
w && (f.preventDefault(), h(N.id));
|
|
2328
2328
|
},
|
|
2329
|
-
onDragLeave: () =>
|
|
2330
|
-
onDrop: (
|
|
2331
|
-
|
|
2332
|
-
const
|
|
2333
|
-
|
|
2329
|
+
onDragLeave: () => h(null),
|
|
2330
|
+
onDrop: (f) => {
|
|
2331
|
+
f.preventDefault(), h(null);
|
|
2332
|
+
const D = f.dataTransfer.getData("text/plain");
|
|
2333
|
+
D && D !== N.id && w && (r == null || r(D, N.id));
|
|
2334
2334
|
},
|
|
2335
|
-
onClick: () =>
|
|
2336
|
-
onDoubleClick: () => n == null ? void 0 : n(
|
|
2337
|
-
onKeyDown: (
|
|
2338
|
-
|
|
2335
|
+
onClick: () => w && (e == null ? void 0 : e(N)),
|
|
2336
|
+
onDoubleClick: () => n == null ? void 0 : n(N),
|
|
2337
|
+
onKeyDown: (f) => {
|
|
2338
|
+
f.key === "Enter" && (f.preventDefault(), w ? e == null || e(N) : n == null || n(N));
|
|
2339
2339
|
},
|
|
2340
|
-
onContextMenu: (
|
|
2341
|
-
style: { paddingLeft: `${
|
|
2342
|
-
className:
|
|
2340
|
+
onContextMenu: (f) => g(f, N),
|
|
2341
|
+
style: { paddingLeft: `${N.level * s + 8}px` },
|
|
2342
|
+
className: L(
|
|
2343
2343
|
"flex items-center py-1 px-2 cursor-pointer hover:bg-accent hover:text-accent-foreground select-none text-xs",
|
|
2344
2344
|
"transition-colors duration-150 relative focus:outline-none focus:ring-1 focus:ring-ring",
|
|
2345
|
-
|
|
2346
|
-
|
|
2345
|
+
x === N.id && "bg-primary/20 ring-1 ring-primary/50 rounded-sm",
|
|
2346
|
+
N.className
|
|
2347
2347
|
),
|
|
2348
2348
|
children: [
|
|
2349
|
-
/* @__PURE__ */ o("div", { className: "w-4 h-4 mr-1 flex items-center justify-center shrink-0", children:
|
|
2350
|
-
|
|
2351
|
-
/* @__PURE__ */ o("span", { className: "truncate", children:
|
|
2349
|
+
/* @__PURE__ */ o("div", { className: "w-4 h-4 mr-1 flex items-center justify-center shrink-0", children: w && (N.isOpen ? /* @__PURE__ */ o(Fe, { size: 14 }) : /* @__PURE__ */ o(Pe, { size: 14 })) }),
|
|
2350
|
+
N.icon && /* @__PURE__ */ o("div", { className: "mr-2 flex items-center shrink-0", children: N.icon }),
|
|
2351
|
+
/* @__PURE__ */ o("span", { className: "truncate", children: N.label })
|
|
2352
2352
|
]
|
|
2353
2353
|
},
|
|
2354
|
-
|
|
2354
|
+
N.id
|
|
2355
2355
|
);
|
|
2356
2356
|
};
|
|
2357
|
-
return /* @__PURE__ */
|
|
2357
|
+
return /* @__PURE__ */ p(
|
|
2358
2358
|
"div",
|
|
2359
2359
|
{
|
|
2360
2360
|
role: "tree",
|
|
2361
2361
|
"aria-label": d,
|
|
2362
|
-
className:
|
|
2363
|
-
onContextMenu: (b) =>
|
|
2362
|
+
className: L("h-full w-full bg-muted/30", l),
|
|
2363
|
+
onContextMenu: (b) => g(b, null),
|
|
2364
2364
|
children: [
|
|
2365
|
-
|
|
2366
|
-
|
|
2365
|
+
i ? /* @__PURE__ */ o(
|
|
2366
|
+
bt,
|
|
2367
2367
|
{
|
|
2368
2368
|
style: { height: "100%" },
|
|
2369
|
-
totalCount:
|
|
2370
|
-
itemContent:
|
|
2369
|
+
totalCount: T.length,
|
|
2370
|
+
itemContent: m
|
|
2371
2371
|
}
|
|
2372
|
-
) : /* @__PURE__ */ o("div", { className: "h-full overflow-auto", children:
|
|
2372
|
+
) : /* @__PURE__ */ o("div", { className: "h-full overflow-auto", children: T.map((b, N) => m(N)) }),
|
|
2373
2373
|
c && E.length > 0 && /* @__PURE__ */ o(
|
|
2374
|
-
|
|
2374
|
+
nr,
|
|
2375
2375
|
{
|
|
2376
2376
|
x: c.x,
|
|
2377
2377
|
y: c.y,
|
|
2378
2378
|
items: E,
|
|
2379
|
-
onClose: () =>
|
|
2379
|
+
onClose: () => y(null)
|
|
2380
2380
|
}
|
|
2381
2381
|
)
|
|
2382
2382
|
]
|
|
2383
2383
|
}
|
|
2384
2384
|
);
|
|
2385
|
-
},
|
|
2385
|
+
}, de = { width: 180, height: 72 }, We = { x: 0, y: 0, scale: 1 }, q = (t) => {
|
|
2386
2386
|
var e, n;
|
|
2387
2387
|
return {
|
|
2388
2388
|
x: t.position.x,
|
|
2389
2389
|
y: t.position.y,
|
|
2390
|
-
width: ((e = t.size) == null ? void 0 : e.width) ??
|
|
2391
|
-
height: ((n = t.size) == null ? void 0 : n.height) ??
|
|
2390
|
+
width: ((e = t.size) == null ? void 0 : e.width) ?? de.width,
|
|
2391
|
+
height: ((n = t.size) == null ? void 0 : n.height) ?? de.height
|
|
2392
2392
|
};
|
|
2393
|
-
},
|
|
2393
|
+
}, Y = (t) => ({
|
|
2394
2394
|
x: t.x + t.width / 2,
|
|
2395
2395
|
y: t.y + t.height / 2
|
|
2396
2396
|
}), be = (t, e) => ({
|
|
2397
2397
|
x: (t.x - e.x) / e.scale,
|
|
2398
2398
|
y: (t.y - e.y) / e.scale
|
|
2399
|
-
}),
|
|
2399
|
+
}), jr = (t, e) => ({
|
|
2400
2400
|
x: t.x * e.scale + e.x,
|
|
2401
2401
|
y: t.y * e.scale + e.y
|
|
2402
|
-
}),
|
|
2402
|
+
}), Ie = (t, e, n) => {
|
|
2403
2403
|
const r = be(e, t);
|
|
2404
2404
|
return {
|
|
2405
2405
|
scale: n,
|
|
2406
2406
|
x: e.x - r.x * n,
|
|
2407
2407
|
y: e.y - r.y * n
|
|
2408
2408
|
};
|
|
2409
|
-
},
|
|
2410
|
-
const n =
|
|
2409
|
+
}, ye = (t, e = 0.1, n = 4) => Math.min(n, Math.max(e, t)), Le = (t, e) => {
|
|
2410
|
+
const n = Y(t);
|
|
2411
2411
|
switch (e) {
|
|
2412
2412
|
case "top":
|
|
2413
2413
|
return { x: n.x, y: t.y };
|
|
@@ -2418,215 +2418,250 @@ const Wt = (t, e) => {
|
|
|
2418
2418
|
case "right":
|
|
2419
2419
|
return { x: t.x + t.width, y: n.y };
|
|
2420
2420
|
}
|
|
2421
|
-
},
|
|
2422
|
-
const n =
|
|
2423
|
-
return Math.abs(
|
|
2424
|
-
},
|
|
2421
|
+
}, sr = (t, e) => {
|
|
2422
|
+
const n = Y(t), r = Y(e), a = r.x - n.x, s = r.y - n.y;
|
|
2423
|
+
return Math.abs(a) >= Math.abs(s) ? a >= 0 ? { source: "right", target: "left" } : { source: "left", target: "right" } : s >= 0 ? { source: "bottom", target: "top" } : { source: "top", target: "bottom" };
|
|
2424
|
+
}, Ge = (t) => {
|
|
2425
2425
|
if (t.length === 0) return null;
|
|
2426
|
-
const e = t.map(
|
|
2427
|
-
return { x: n, y: r, width:
|
|
2428
|
-
},
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2426
|
+
const e = t.map(q), n = Math.min(...e.map((i) => i.x)), r = Math.min(...e.map((i) => i.y)), a = Math.max(...e.map((i) => i.x + i.width)), s = Math.max(...e.map((i) => i.y + i.height));
|
|
2427
|
+
return { x: n, y: r, width: a - n, height: s - r };
|
|
2428
|
+
}, ar = (t, e) => ({
|
|
2429
|
+
// Written as a subtraction rather than `-viewport.x / scale` so a pan of zero
|
|
2430
|
+
// yields +0 rather than -0, which otherwise leaks into equality checks.
|
|
2431
|
+
x: (0 - t.x) / t.scale,
|
|
2432
|
+
y: (0 - t.y) / t.scale,
|
|
2433
|
+
width: e.width / t.scale,
|
|
2434
|
+
height: e.height / t.scale
|
|
2435
|
+
}), Me = (t, e, n) => ({
|
|
2436
|
+
scale: n,
|
|
2437
|
+
x: e.width / 2 - t.x * n,
|
|
2438
|
+
y: e.height / 2 - t.y * n
|
|
2439
|
+
}), ir = (t, e) => {
|
|
2440
|
+
const n = Math.min(t.x, e.x), r = Math.min(t.y, e.y);
|
|
2441
|
+
return {
|
|
2442
|
+
x: n,
|
|
2443
|
+
y: r,
|
|
2444
|
+
width: Math.max(t.x + t.width, e.x + e.width) - n,
|
|
2445
|
+
height: Math.max(t.y + t.height, e.y + e.height) - r
|
|
2446
|
+
};
|
|
2447
|
+
}, lr = (t, e, n = 48) => {
|
|
2448
|
+
const r = Ge(t);
|
|
2449
|
+
if (!r || e.width === 0 || e.height === 0) return We;
|
|
2450
|
+
const a = ye(
|
|
2432
2451
|
Math.min(
|
|
2433
2452
|
(e.width - n * 2) / Math.max(r.width, 1),
|
|
2434
2453
|
(e.height - n * 2) / Math.max(r.height, 1)
|
|
2435
2454
|
)
|
|
2436
|
-
), s =
|
|
2455
|
+
), s = Y(r);
|
|
2437
2456
|
return {
|
|
2438
|
-
scale:
|
|
2439
|
-
x: e.width / 2 - s.x *
|
|
2440
|
-
y: e.height / 2 - s.y *
|
|
2457
|
+
scale: a,
|
|
2458
|
+
x: e.width / 2 - s.x * a,
|
|
2459
|
+
y: e.height / 2 - s.y * a
|
|
2441
2460
|
};
|
|
2442
|
-
},
|
|
2461
|
+
}, Ye = {
|
|
2443
2462
|
up: { x: 0, y: -1 },
|
|
2444
2463
|
down: { x: 0, y: 1 },
|
|
2445
2464
|
left: { x: -1, y: 0 },
|
|
2446
2465
|
right: { x: 1, y: 0 }
|
|
2447
|
-
},
|
|
2466
|
+
}, he = (t, e, n) => {
|
|
2448
2467
|
const r = t.find((d) => d.id === e);
|
|
2449
2468
|
if (!r) return null;
|
|
2450
|
-
const
|
|
2451
|
-
let
|
|
2469
|
+
const a = Y(q(r)), s = Ye[n];
|
|
2470
|
+
let i = null;
|
|
2452
2471
|
for (const d of t) {
|
|
2453
2472
|
if (d.id === e) continue;
|
|
2454
|
-
const l =
|
|
2455
|
-
if (
|
|
2456
|
-
const
|
|
2457
|
-
if (
|
|
2458
|
-
const
|
|
2459
|
-
(!
|
|
2473
|
+
const l = Y(q(d)), c = l.x - a.x, y = l.y - a.y, x = c * s.x + y * s.y;
|
|
2474
|
+
if (x <= 0) continue;
|
|
2475
|
+
const h = Math.abs(c * s.y - y * s.x);
|
|
2476
|
+
if (h > x * 2) continue;
|
|
2477
|
+
const T = x + h * 2;
|
|
2478
|
+
(!i || T < i.score) && (i = { node: d, score: T });
|
|
2460
2479
|
}
|
|
2461
|
-
return (
|
|
2462
|
-
},
|
|
2463
|
-
const
|
|
2464
|
-
if (!
|
|
2465
|
-
const s =
|
|
2466
|
-
x:
|
|
2467
|
-
y:
|
|
2480
|
+
return (i == null ? void 0 : i.node) ?? null;
|
|
2481
|
+
}, cr = (t, e, n, r = 64) => {
|
|
2482
|
+
const a = t.find((c) => c.id === e);
|
|
2483
|
+
if (!a) return { x: 0, y: 0 };
|
|
2484
|
+
const s = q(a), i = Ye[n], d = {
|
|
2485
|
+
x: i.x * (s.width + r),
|
|
2486
|
+
y: i.y * (s.height + r)
|
|
2468
2487
|
};
|
|
2469
2488
|
let l = { x: s.x + d.x, y: s.y + d.y };
|
|
2470
2489
|
for (let c = 0; c < 24; c += 1) {
|
|
2471
|
-
const
|
|
2472
|
-
if (!t.some((
|
|
2473
|
-
l =
|
|
2490
|
+
const y = { ...l, width: s.width, height: s.height };
|
|
2491
|
+
if (!t.some((h) => dr(q(h), y))) break;
|
|
2492
|
+
l = i.x !== 0 ? { x: l.x, y: l.y + s.height + r } : { x: l.x + s.width + r, y: l.y };
|
|
2474
2493
|
}
|
|
2475
2494
|
return l;
|
|
2476
|
-
},
|
|
2495
|
+
}, dr = (t, e) => t.x < e.x + e.width && t.x + t.width > e.x && t.y < e.y + e.height && t.y + t.height > e.y, Br = (t, e) => t.filter((n) => n.source === e || n.target === e), Hr = (t, e, n) => t.some(
|
|
2477
2496
|
(r) => r.source === e && r.target === n || r.source === n && r.target === e
|
|
2478
|
-
),
|
|
2497
|
+
), Wr = (t, e, n) => ({
|
|
2479
2498
|
nodes: t.filter((r) => r.id !== n),
|
|
2480
2499
|
edges: e.filter((r) => r.source !== n && r.target !== n)
|
|
2481
|
-
}),
|
|
2500
|
+
}), Gr = (t, e) => {
|
|
2482
2501
|
let n = e.length + 1;
|
|
2483
|
-
const r = new Set(e.map((
|
|
2502
|
+
const r = new Set(e.map((a) => a.id));
|
|
2484
2503
|
for (; r.has(`${t}-${n}`); ) n += 1;
|
|
2485
2504
|
return `${t}-${n}`;
|
|
2486
|
-
},
|
|
2505
|
+
}, ur = Qe(
|
|
2487
2506
|
({
|
|
2488
2507
|
children: t,
|
|
2489
2508
|
overlay: e,
|
|
2490
2509
|
viewport: n,
|
|
2491
|
-
defaultViewport: r =
|
|
2492
|
-
onViewportChange:
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2510
|
+
defaultViewport: r = We,
|
|
2511
|
+
onViewportChange: a,
|
|
2512
|
+
onSizeChange: s,
|
|
2513
|
+
onCanvasClick: i,
|
|
2514
|
+
onCanvasDoubleClick: d,
|
|
2515
|
+
onCanvasContextMenu: l,
|
|
2516
|
+
onDrop: c,
|
|
2517
|
+
grid: y = !0,
|
|
2518
|
+
gridSize: x = 24,
|
|
2519
|
+
minScale: h = 0.1,
|
|
2520
|
+
maxScale: T = 4,
|
|
2521
|
+
pannable: E = !0,
|
|
2522
|
+
zoomable: g = !0,
|
|
2523
|
+
"aria-label": m = "Graph canvas",
|
|
2524
|
+
className: b
|
|
2525
|
+
}, N) => {
|
|
2526
|
+
const w = F(null), [f, D] = R(r), [M, A] = R(!1), [C, S] = R(!1), u = n ?? f, k = F(u);
|
|
2527
|
+
k.current = u;
|
|
2528
|
+
const I = ee(
|
|
2509
2529
|
(v) => {
|
|
2510
|
-
n ||
|
|
2530
|
+
n || D(v), a == null || a(v);
|
|
2511
2531
|
},
|
|
2512
|
-
[n,
|
|
2513
|
-
),
|
|
2514
|
-
var
|
|
2515
|
-
const
|
|
2516
|
-
return
|
|
2532
|
+
[n, a]
|
|
2533
|
+
), z = ee((v) => {
|
|
2534
|
+
var $;
|
|
2535
|
+
const P = ($ = w.current) == null ? void 0 : $.getBoundingClientRect();
|
|
2536
|
+
return P ? { x: v.x - P.left, y: v.y - P.top } : v;
|
|
2517
2537
|
}, []);
|
|
2518
|
-
|
|
2519
|
-
const v =
|
|
2520
|
-
if (!v || !
|
|
2521
|
-
const
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2538
|
+
O(() => {
|
|
2539
|
+
const v = w.current;
|
|
2540
|
+
if (!v || !s) return;
|
|
2541
|
+
const P = () => {
|
|
2542
|
+
const U = v.getBoundingClientRect();
|
|
2543
|
+
s({ width: U.width, height: U.height });
|
|
2544
|
+
};
|
|
2545
|
+
P();
|
|
2546
|
+
const $ = new ResizeObserver(P);
|
|
2547
|
+
return $.observe(v), () => $.disconnect();
|
|
2548
|
+
}, [s]), O(() => {
|
|
2549
|
+
const v = w.current;
|
|
2550
|
+
if (!v || !g) return;
|
|
2551
|
+
const P = ($) => {
|
|
2552
|
+
$.preventDefault();
|
|
2553
|
+
const U = k.current, H = z({ x: $.clientX, y: $.clientY }), le = $.ctrlKey ? 0.01 : 2e-3, ce = ye(
|
|
2554
|
+
U.scale * Math.exp(-$.deltaY * le),
|
|
2555
|
+
h,
|
|
2556
|
+
T
|
|
2527
2557
|
);
|
|
2528
|
-
|
|
2558
|
+
I(Ie(U, H, ce));
|
|
2529
2559
|
};
|
|
2530
|
-
return v.addEventListener("wheel",
|
|
2531
|
-
}, [
|
|
2532
|
-
if (!
|
|
2533
|
-
const v = (
|
|
2534
|
-
var
|
|
2535
|
-
if (
|
|
2536
|
-
const U =
|
|
2537
|
-
U != null && U.closest('input, textarea, [contenteditable="true"]') || (
|
|
2538
|
-
},
|
|
2539
|
-
|
|
2560
|
+
return v.addEventListener("wheel", P, { passive: !1 }), () => v.removeEventListener("wheel", P);
|
|
2561
|
+
}, [g, h, T, I, z]), O(() => {
|
|
2562
|
+
if (!E) return;
|
|
2563
|
+
const v = ($) => {
|
|
2564
|
+
var H;
|
|
2565
|
+
if ($.code !== "Space") return;
|
|
2566
|
+
const U = $.target;
|
|
2567
|
+
U != null && U.closest('input, textarea, [contenteditable="true"]') || (H = w.current) != null && H.contains(document.activeElement) && ($.preventDefault(), S(!0));
|
|
2568
|
+
}, P = ($) => {
|
|
2569
|
+
$.code === "Space" && S(!1);
|
|
2540
2570
|
};
|
|
2541
|
-
return window.addEventListener("keydown", v), window.addEventListener("keyup",
|
|
2542
|
-
window.removeEventListener("keydown", v), window.removeEventListener("keyup",
|
|
2571
|
+
return window.addEventListener("keydown", v), window.addEventListener("keyup", P), () => {
|
|
2572
|
+
window.removeEventListener("keydown", v), window.removeEventListener("keyup", P);
|
|
2543
2573
|
};
|
|
2544
|
-
}, [
|
|
2574
|
+
}, [E]);
|
|
2545
2575
|
const _ = (v) => {
|
|
2546
|
-
if (!
|
|
2547
|
-
const
|
|
2548
|
-
if (!
|
|
2549
|
-
v.preventDefault(),
|
|
2550
|
-
const U = { x: v.clientX, y: v.clientY },
|
|
2551
|
-
|
|
2552
|
-
...
|
|
2553
|
-
x:
|
|
2554
|
-
y:
|
|
2576
|
+
if (!E) return;
|
|
2577
|
+
const P = v.target === v.currentTarget, $ = v.button === 1;
|
|
2578
|
+
if (!P && !$ && !C || v.button !== 0 && !$) return;
|
|
2579
|
+
v.preventDefault(), A(!0);
|
|
2580
|
+
const U = { x: v.clientX, y: v.clientY }, H = { ...k.current }, le = (Ne) => {
|
|
2581
|
+
I({
|
|
2582
|
+
...H,
|
|
2583
|
+
x: H.x + (Ne.clientX - U.x),
|
|
2584
|
+
y: H.y + (Ne.clientY - U.y)
|
|
2555
2585
|
});
|
|
2556
|
-
},
|
|
2557
|
-
|
|
2586
|
+
}, ce = () => {
|
|
2587
|
+
A(!1), window.removeEventListener("pointermove", le), window.removeEventListener("pointerup", ce);
|
|
2558
2588
|
};
|
|
2559
|
-
window.addEventListener("pointermove",
|
|
2589
|
+
window.addEventListener("pointermove", le), window.addEventListener("pointerup", ce);
|
|
2560
2590
|
};
|
|
2561
|
-
|
|
2562
|
-
|
|
2591
|
+
Ze(
|
|
2592
|
+
N,
|
|
2563
2593
|
() => ({
|
|
2564
|
-
getViewport: () =>
|
|
2565
|
-
setViewport:
|
|
2566
|
-
fitTo: (v,
|
|
2594
|
+
getViewport: () => k.current,
|
|
2595
|
+
setViewport: I,
|
|
2596
|
+
fitTo: (v, P) => {
|
|
2567
2597
|
var U;
|
|
2568
|
-
const
|
|
2569
|
-
|
|
2598
|
+
const $ = (U = w.current) == null ? void 0 : U.getBoundingClientRect();
|
|
2599
|
+
$ && I(lr(v, { width: $.width, height: $.height }, P));
|
|
2570
2600
|
},
|
|
2571
2601
|
zoomBy: (v) => {
|
|
2572
|
-
var
|
|
2573
|
-
const
|
|
2574
|
-
if (!
|
|
2575
|
-
const
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2602
|
+
var H;
|
|
2603
|
+
const P = (H = w.current) == null ? void 0 : H.getBoundingClientRect();
|
|
2604
|
+
if (!P) return;
|
|
2605
|
+
const $ = { x: P.width / 2, y: P.height / 2 }, U = ye(
|
|
2606
|
+
k.current.scale * v,
|
|
2607
|
+
h,
|
|
2608
|
+
T
|
|
2579
2609
|
);
|
|
2580
|
-
|
|
2610
|
+
I(Ie(k.current, $, U));
|
|
2611
|
+
},
|
|
2612
|
+
clientToGraph: (v) => be(z(v), k.current),
|
|
2613
|
+
getSize: () => {
|
|
2614
|
+
var P;
|
|
2615
|
+
const v = (P = w.current) == null ? void 0 : P.getBoundingClientRect();
|
|
2616
|
+
return { width: (v == null ? void 0 : v.width) ?? 0, height: (v == null ? void 0 : v.height) ?? 0 };
|
|
2581
2617
|
},
|
|
2582
|
-
clientToGraph: (v) => be(I(v), p.current),
|
|
2583
2618
|
focus: () => {
|
|
2584
2619
|
var v;
|
|
2585
|
-
return (v =
|
|
2620
|
+
return (v = w.current) == null ? void 0 : v.focus();
|
|
2586
2621
|
}
|
|
2587
2622
|
}),
|
|
2588
|
-
[
|
|
2623
|
+
[I, h, T, z]
|
|
2589
2624
|
);
|
|
2590
|
-
const
|
|
2591
|
-
return /* @__PURE__ */
|
|
2625
|
+
const K = (v) => be(z({ x: v.clientX, y: v.clientY }), u), j = (v) => v.target === v.currentTarget;
|
|
2626
|
+
return /* @__PURE__ */ p(
|
|
2592
2627
|
"div",
|
|
2593
2628
|
{
|
|
2594
|
-
ref:
|
|
2629
|
+
ref: w,
|
|
2595
2630
|
role: "application",
|
|
2596
|
-
"aria-label":
|
|
2631
|
+
"aria-label": m,
|
|
2597
2632
|
tabIndex: 0,
|
|
2598
2633
|
onPointerDown: _,
|
|
2599
|
-
onClick: (v) =>
|
|
2600
|
-
onDoubleClick: (v) =>
|
|
2634
|
+
onClick: (v) => j(v) && (i == null ? void 0 : i(K(v), v)),
|
|
2635
|
+
onDoubleClick: (v) => j(v) && (d == null ? void 0 : d(K(v), v)),
|
|
2601
2636
|
onContextMenu: (v) => {
|
|
2602
|
-
!
|
|
2637
|
+
!l || !j(v) || (v.preventDefault(), l(K(v), v));
|
|
2603
2638
|
},
|
|
2604
2639
|
onDragOver: (v) => {
|
|
2605
|
-
|
|
2640
|
+
c && (v.preventDefault(), v.dataTransfer.dropEffect = "copy");
|
|
2606
2641
|
},
|
|
2607
2642
|
onDrop: (v) => {
|
|
2608
|
-
|
|
2643
|
+
c && (v.preventDefault(), c(K(v), v));
|
|
2609
2644
|
},
|
|
2610
|
-
style:
|
|
2645
|
+
style: y ? {
|
|
2611
2646
|
// The grid is painted on the element rather than inside the
|
|
2612
2647
|
// transformed layer, so it can be infinite without needing a
|
|
2613
2648
|
// giant element behind it.
|
|
2614
2649
|
backgroundImage: "radial-gradient(circle, hsl(var(--border)) 1px, transparent 1px)",
|
|
2615
|
-
backgroundSize: `${
|
|
2616
|
-
backgroundPosition: `${
|
|
2650
|
+
backgroundSize: `${x * u.scale}px ${x * u.scale}px`,
|
|
2651
|
+
backgroundPosition: `${u.x}px ${u.y}px`
|
|
2617
2652
|
} : void 0,
|
|
2618
|
-
className:
|
|
2653
|
+
className: L(
|
|
2619
2654
|
"relative w-full h-full overflow-hidden bg-background outline-none",
|
|
2620
2655
|
"focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset",
|
|
2621
|
-
|
|
2622
|
-
|
|
2656
|
+
C || M ? "cursor-grabbing" : "cursor-grab",
|
|
2657
|
+
b
|
|
2623
2658
|
),
|
|
2624
2659
|
children: [
|
|
2625
2660
|
/* @__PURE__ */ o(
|
|
2626
2661
|
"div",
|
|
2627
2662
|
{
|
|
2628
2663
|
style: {
|
|
2629
|
-
transform: `translate(${
|
|
2664
|
+
transform: `translate(${u.x}px, ${u.y}px) scale(${u.scale})`,
|
|
2630
2665
|
transformOrigin: "0 0",
|
|
2631
2666
|
willChange: "transform"
|
|
2632
2667
|
},
|
|
@@ -2640,43 +2675,43 @@ const Wt = (t, e) => {
|
|
|
2640
2675
|
);
|
|
2641
2676
|
}
|
|
2642
2677
|
);
|
|
2643
|
-
|
|
2644
|
-
const
|
|
2678
|
+
ur.displayName = "GraphCanvas";
|
|
2679
|
+
const fr = ["top", "right", "bottom", "left"], mr = {
|
|
2645
2680
|
top: "left-1/2 -translate-x-1/2 -top-1.5",
|
|
2646
2681
|
bottom: "left-1/2 -translate-x-1/2 -bottom-1.5",
|
|
2647
2682
|
left: "top-1/2 -translate-y-1/2 -left-1.5",
|
|
2648
2683
|
right: "top-1/2 -translate-y-1/2 -right-1.5"
|
|
2649
|
-
},
|
|
2684
|
+
}, Yr = ({
|
|
2650
2685
|
node: t,
|
|
2651
2686
|
children: e,
|
|
2652
2687
|
onMove: n,
|
|
2653
2688
|
onMoveEnd: r,
|
|
2654
|
-
onSelect:
|
|
2689
|
+
onSelect: a,
|
|
2655
2690
|
onActivate: s,
|
|
2656
|
-
onContextMenu:
|
|
2691
|
+
onContextMenu: i,
|
|
2657
2692
|
onConnectStart: d,
|
|
2658
2693
|
onConnectEnd: l,
|
|
2659
2694
|
selected: c = !1,
|
|
2660
|
-
focused:
|
|
2661
|
-
ports:
|
|
2662
|
-
draggable:
|
|
2663
|
-
className:
|
|
2695
|
+
focused: y = !1,
|
|
2696
|
+
ports: x = !0,
|
|
2697
|
+
draggable: h = !0,
|
|
2698
|
+
className: T
|
|
2664
2699
|
}) => {
|
|
2665
|
-
var
|
|
2666
|
-
const E = F(!1),
|
|
2667
|
-
if (!
|
|
2668
|
-
|
|
2669
|
-
const
|
|
2670
|
-
let
|
|
2671
|
-
const
|
|
2672
|
-
const I = (k.clientX -
|
|
2673
|
-
(Math.abs(I) > 1 || Math.abs(
|
|
2674
|
-
},
|
|
2675
|
-
E.current && (r == null || r(t.id,
|
|
2700
|
+
var N, w;
|
|
2701
|
+
const E = F(!1), g = ((N = t.size) == null ? void 0 : N.width) ?? de.width, m = ((w = t.size) == null ? void 0 : w.height) ?? de.height, b = (f) => {
|
|
2702
|
+
if (!h || !n || f.button !== 0 || f.nativeEvent.shiftKey) return;
|
|
2703
|
+
f.stopPropagation(), E.current = !1;
|
|
2704
|
+
const D = { x: f.clientX, y: f.clientY }, M = { ...t.position }, A = pr(f.currentTarget);
|
|
2705
|
+
let C = M;
|
|
2706
|
+
const S = (k) => {
|
|
2707
|
+
const I = (k.clientX - D.x) / A, z = (k.clientY - D.y) / A;
|
|
2708
|
+
(Math.abs(I) > 1 || Math.abs(z) > 1) && (E.current = !0), C = { x: M.x + I, y: M.y + z }, n(t.id, C);
|
|
2709
|
+
}, u = () => {
|
|
2710
|
+
E.current && (r == null || r(t.id, C)), window.removeEventListener("pointermove", S), window.removeEventListener("pointerup", u);
|
|
2676
2711
|
};
|
|
2677
|
-
window.addEventListener("pointermove",
|
|
2712
|
+
window.addEventListener("pointermove", S), window.addEventListener("pointerup", u);
|
|
2678
2713
|
};
|
|
2679
|
-
return /* @__PURE__ */
|
|
2714
|
+
return /* @__PURE__ */ p(
|
|
2680
2715
|
"div",
|
|
2681
2716
|
{
|
|
2682
2717
|
"data-graph-node": t.id,
|
|
@@ -2687,109 +2722,109 @@ const ir = ["top", "right", "bottom", "left"], lr = {
|
|
|
2687
2722
|
position: "absolute",
|
|
2688
2723
|
left: t.position.x,
|
|
2689
2724
|
top: t.position.y,
|
|
2690
|
-
width:
|
|
2691
|
-
height:
|
|
2725
|
+
width: g,
|
|
2726
|
+
height: m
|
|
2692
2727
|
},
|
|
2693
2728
|
onPointerDown: b,
|
|
2694
|
-
onClick: (
|
|
2695
|
-
|
|
2729
|
+
onClick: (f) => {
|
|
2730
|
+
f.stopPropagation(), E.current || a == null || a(t.id, f);
|
|
2696
2731
|
},
|
|
2697
|
-
onDoubleClick: (
|
|
2698
|
-
|
|
2732
|
+
onDoubleClick: (f) => {
|
|
2733
|
+
f.stopPropagation(), s == null || s(t.id);
|
|
2699
2734
|
},
|
|
2700
|
-
onContextMenu: (
|
|
2701
|
-
|
|
2735
|
+
onContextMenu: (f) => {
|
|
2736
|
+
i && (f.preventDefault(), f.stopPropagation(), i(t.id, { x: f.clientX, y: f.clientY }, f));
|
|
2702
2737
|
},
|
|
2703
2738
|
onPointerUp: () => l == null ? void 0 : l(t.id),
|
|
2704
|
-
className:
|
|
2739
|
+
className: L(
|
|
2705
2740
|
"group rounded-lg border bg-card text-card-foreground shadow-sm select-none",
|
|
2706
2741
|
"flex flex-col overflow-hidden transition-shadow",
|
|
2707
|
-
|
|
2742
|
+
h && n && "cursor-grab active:cursor-grabbing",
|
|
2708
2743
|
c ? "border-primary shadow-md" : "border-border",
|
|
2709
2744
|
// Focus is the keyboard cursor: it must be visible even when the node
|
|
2710
2745
|
// is also selected, so it gets a ring rather than a border change.
|
|
2711
|
-
|
|
2712
|
-
|
|
2746
|
+
y && "ring-2 ring-ring ring-offset-1 ring-offset-background",
|
|
2747
|
+
T
|
|
2713
2748
|
),
|
|
2714
2749
|
children: [
|
|
2715
2750
|
e,
|
|
2716
|
-
|
|
2751
|
+
x && d && fr.map((f) => /* @__PURE__ */ o(
|
|
2717
2752
|
"button",
|
|
2718
2753
|
{
|
|
2719
2754
|
type: "button",
|
|
2720
2755
|
tabIndex: -1,
|
|
2721
|
-
"aria-label": `Connect from ${
|
|
2722
|
-
onPointerDown: (
|
|
2723
|
-
|
|
2756
|
+
"aria-label": `Connect from ${f}`,
|
|
2757
|
+
onPointerDown: (D) => {
|
|
2758
|
+
D.stopPropagation(), d(t.id, f);
|
|
2724
2759
|
},
|
|
2725
|
-
className:
|
|
2760
|
+
className: L(
|
|
2726
2761
|
"absolute w-3 h-3 rounded-full border-2 border-background bg-primary",
|
|
2727
2762
|
"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-opacity",
|
|
2728
|
-
|
|
2729
|
-
|
|
2763
|
+
y && "opacity-100",
|
|
2764
|
+
mr[f]
|
|
2730
2765
|
)
|
|
2731
2766
|
},
|
|
2732
|
-
|
|
2767
|
+
f
|
|
2733
2768
|
))
|
|
2734
2769
|
]
|
|
2735
2770
|
}
|
|
2736
2771
|
);
|
|
2737
|
-
},
|
|
2772
|
+
}, pr = (t) => {
|
|
2738
2773
|
let e = t.parentElement;
|
|
2739
2774
|
for (; e; ) {
|
|
2740
2775
|
const n = window.getComputedStyle(e).transform;
|
|
2741
2776
|
if (n && n !== "none") {
|
|
2742
|
-
const r = /matrix\(([^,]+),/.exec(n),
|
|
2743
|
-
if (Number.isFinite(
|
|
2777
|
+
const r = /matrix\(([^,]+),/.exec(n), a = r ? parseFloat(r[1]) : NaN;
|
|
2778
|
+
if (Number.isFinite(a) && a !== 0) return a;
|
|
2744
2779
|
}
|
|
2745
2780
|
e = e.parentElement;
|
|
2746
2781
|
}
|
|
2747
2782
|
return 1;
|
|
2748
|
-
},
|
|
2783
|
+
}, hr = (t, e, n, r) => {
|
|
2749
2784
|
if (r === "straight")
|
|
2750
2785
|
return `M ${t.x} ${t.y} L ${e.x} ${e.y}`;
|
|
2751
|
-
const
|
|
2786
|
+
const a = n === "left" || n === "right";
|
|
2752
2787
|
if (r === "smoothstep") {
|
|
2753
|
-
const c =
|
|
2754
|
-
return
|
|
2788
|
+
const c = a ? (t.x + e.x) / 2 : (t.y + e.y) / 2;
|
|
2789
|
+
return a ? `M ${t.x} ${t.y} L ${c} ${t.y} L ${c} ${e.y} L ${e.x} ${e.y}` : `M ${t.x} ${t.y} L ${t.x} ${c} L ${e.x} ${c} L ${e.x} ${e.y}`;
|
|
2755
2790
|
}
|
|
2756
|
-
const s = Math.hypot(e.x - t.x, e.y - t.y),
|
|
2791
|
+
const s = Math.hypot(e.x - t.x, e.y - t.y), i = Math.min(Math.max(s / 2, 24), 160), d = a ? { x: t.x + (n === "right" ? i : -i), y: t.y } : { x: t.x, y: t.y + (n === "bottom" ? i : -i) }, l = a ? { x: e.x - (n === "right" ? i : -i), y: e.y } : { x: e.x, y: e.y - (n === "bottom" ? i : -i) };
|
|
2757
2792
|
return `M ${t.x} ${t.y} C ${d.x} ${d.y}, ${l.x} ${l.y}, ${e.x} ${e.y}`;
|
|
2758
|
-
},
|
|
2793
|
+
}, Jr = ({
|
|
2759
2794
|
edge: t,
|
|
2760
2795
|
source: e,
|
|
2761
2796
|
target: n,
|
|
2762
2797
|
routing: r = "bezier",
|
|
2763
|
-
selected:
|
|
2798
|
+
selected: a = !1,
|
|
2764
2799
|
arrow: s = !0,
|
|
2765
|
-
onSelect:
|
|
2800
|
+
onSelect: i,
|
|
2766
2801
|
onContextMenu: d,
|
|
2767
2802
|
className: l
|
|
2768
2803
|
}) => {
|
|
2769
|
-
const c =
|
|
2770
|
-
return /* @__PURE__ */
|
|
2804
|
+
const c = q(e), y = q(n), x = sr(c, y), h = Le(c, x.source), T = Le(y, x.target), E = hr(h, T, x.source, r), g = { x: (h.x + T.x) / 2, y: (h.y + T.y) / 2 }, m = !!(i || d);
|
|
2805
|
+
return /* @__PURE__ */ p(
|
|
2771
2806
|
"g",
|
|
2772
2807
|
{
|
|
2773
2808
|
"data-graph-edge": t.id,
|
|
2774
|
-
className:
|
|
2809
|
+
className: L(m && "cursor-pointer"),
|
|
2775
2810
|
onClick: (b) => {
|
|
2776
|
-
|
|
2811
|
+
i && (b.stopPropagation(), i(t.id, b));
|
|
2777
2812
|
},
|
|
2778
2813
|
onContextMenu: (b) => {
|
|
2779
2814
|
d && (b.preventDefault(), b.stopPropagation(), d(t.id, { x: b.clientX, y: b.clientY }, b));
|
|
2780
2815
|
},
|
|
2781
2816
|
children: [
|
|
2782
|
-
|
|
2817
|
+
m && /* @__PURE__ */ o("path", { d: E, fill: "none", stroke: "transparent", strokeWidth: 16 }),
|
|
2783
2818
|
/* @__PURE__ */ o(
|
|
2784
2819
|
"path",
|
|
2785
2820
|
{
|
|
2786
2821
|
d: E,
|
|
2787
2822
|
fill: "none",
|
|
2788
|
-
strokeWidth:
|
|
2823
|
+
strokeWidth: a ? 2.5 : 1.5,
|
|
2789
2824
|
markerEnd: s ? "url(#nexus-graph-arrow)" : void 0,
|
|
2790
|
-
className:
|
|
2825
|
+
className: L(
|
|
2791
2826
|
"transition-[stroke]",
|
|
2792
|
-
|
|
2827
|
+
a ? "stroke-primary" : "stroke-border",
|
|
2793
2828
|
l
|
|
2794
2829
|
)
|
|
2795
2830
|
}
|
|
@@ -2797,8 +2832,8 @@ const ir = ["top", "right", "bottom", "left"], lr = {
|
|
|
2797
2832
|
t.label && /* @__PURE__ */ o(
|
|
2798
2833
|
"text",
|
|
2799
2834
|
{
|
|
2800
|
-
x:
|
|
2801
|
-
y:
|
|
2835
|
+
x: g.x,
|
|
2836
|
+
y: g.y,
|
|
2802
2837
|
textAnchor: "middle",
|
|
2803
2838
|
dominantBaseline: "middle",
|
|
2804
2839
|
className: "fill-muted-foreground text-[10px] font-medium select-none",
|
|
@@ -2809,14 +2844,14 @@ const ir = ["top", "right", "bottom", "left"], lr = {
|
|
|
2809
2844
|
]
|
|
2810
2845
|
}
|
|
2811
2846
|
);
|
|
2812
|
-
},
|
|
2847
|
+
}, Xr = ({ children: t, className: e }) => /* @__PURE__ */ p(
|
|
2813
2848
|
"svg",
|
|
2814
2849
|
{
|
|
2815
2850
|
style: { position: "absolute", left: -5e4, top: -5e4, overflow: "visible" },
|
|
2816
2851
|
width: 1e5,
|
|
2817
2852
|
height: 1e5,
|
|
2818
2853
|
viewBox: "-50000 -50000 100000 100000",
|
|
2819
|
-
className:
|
|
2854
|
+
className: L("pointer-events-none [&_g]:pointer-events-auto", e),
|
|
2820
2855
|
children: [
|
|
2821
2856
|
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o(
|
|
2822
2857
|
"marker",
|
|
@@ -2834,7 +2869,7 @@ const ir = ["top", "right", "bottom", "left"], lr = {
|
|
|
2834
2869
|
t
|
|
2835
2870
|
]
|
|
2836
2871
|
}
|
|
2837
|
-
),
|
|
2872
|
+
), qr = {
|
|
2838
2873
|
/** Move focus to the nearest node in a direction. */
|
|
2839
2874
|
moveFocus: ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"],
|
|
2840
2875
|
/** Create a connected node in a direction. */
|
|
@@ -2849,281 +2884,457 @@ const ir = ["top", "right", "bottom", "left"], lr = {
|
|
|
2849
2884
|
connect: "c",
|
|
2850
2885
|
/** Nudge the focused node. Held with the arrow keys. */
|
|
2851
2886
|
nudgeModifier: "shiftKey"
|
|
2852
|
-
},
|
|
2887
|
+
}, gr = {
|
|
2853
2888
|
ArrowUp: "up",
|
|
2854
2889
|
ArrowDown: "down",
|
|
2855
2890
|
ArrowLeft: "left",
|
|
2856
2891
|
ArrowRight: "right"
|
|
2857
|
-
},
|
|
2892
|
+
}, Vr = ({
|
|
2858
2893
|
nodes: t,
|
|
2859
2894
|
edges: e,
|
|
2860
2895
|
focusedId: n,
|
|
2861
2896
|
defaultFocusedId: r = null,
|
|
2862
|
-
onFocusChange:
|
|
2897
|
+
onFocusChange: a,
|
|
2863
2898
|
targetRef: s,
|
|
2864
|
-
nudgeDistance:
|
|
2899
|
+
nudgeDistance: i = 16,
|
|
2865
2900
|
disabled: d = !1,
|
|
2866
2901
|
onCreateNode: l,
|
|
2867
2902
|
onConnect: c,
|
|
2868
|
-
onDeleteNode:
|
|
2869
|
-
onMoveNode:
|
|
2870
|
-
onEditNode:
|
|
2903
|
+
onDeleteNode: y,
|
|
2904
|
+
onMoveNode: x,
|
|
2905
|
+
onEditNode: h
|
|
2871
2906
|
}) => {
|
|
2872
|
-
const [
|
|
2907
|
+
const [T, E] = R(
|
|
2873
2908
|
r
|
|
2874
|
-
), [
|
|
2875
|
-
(
|
|
2876
|
-
n === void 0 && E(
|
|
2909
|
+
), [g, m] = R(null), [b, N] = R(null), w = n !== void 0 ? n : T, f = ee(
|
|
2910
|
+
(C) => {
|
|
2911
|
+
n === void 0 && E(C), a == null || a(C);
|
|
2877
2912
|
},
|
|
2878
|
-
[n,
|
|
2879
|
-
),
|
|
2913
|
+
[n, a]
|
|
2914
|
+
), D = F({
|
|
2880
2915
|
nodes: t,
|
|
2881
2916
|
edges: e,
|
|
2882
|
-
focusedId:
|
|
2883
|
-
editingId:
|
|
2917
|
+
focusedId: w,
|
|
2918
|
+
editingId: g,
|
|
2884
2919
|
connectingFrom: b
|
|
2885
2920
|
});
|
|
2886
|
-
|
|
2887
|
-
const
|
|
2888
|
-
(
|
|
2889
|
-
const { nodes:
|
|
2890
|
-
if (
|
|
2891
|
-
if (!
|
|
2892
|
-
|
|
2921
|
+
D.current = { nodes: t, edges: e, focusedId: w, editingId: g, connectingFrom: b };
|
|
2922
|
+
const M = ee(
|
|
2923
|
+
(C) => {
|
|
2924
|
+
const { nodes: S, focusedId: u } = D.current;
|
|
2925
|
+
if (S.length === 0) return;
|
|
2926
|
+
if (!u) {
|
|
2927
|
+
f(S[0].id);
|
|
2893
2928
|
return;
|
|
2894
2929
|
}
|
|
2895
|
-
const k =
|
|
2896
|
-
k &&
|
|
2930
|
+
const k = he(S, u, C);
|
|
2931
|
+
k && f(k.id);
|
|
2897
2932
|
},
|
|
2898
|
-
[
|
|
2899
|
-
),
|
|
2900
|
-
(
|
|
2901
|
-
const { nodes:
|
|
2933
|
+
[f]
|
|
2934
|
+
), A = ee(
|
|
2935
|
+
(C = "right") => {
|
|
2936
|
+
const { nodes: S, focusedId: u } = D.current;
|
|
2902
2937
|
if (!l) return;
|
|
2903
|
-
const k =
|
|
2904
|
-
I && (
|
|
2938
|
+
const k = u ? cr(S, u, C) : { x: 0, y: 0 }, I = l(k, { from: u ?? void 0, direction: C });
|
|
2939
|
+
I && (u && (c == null || c(u, I)), f(I), m(I));
|
|
2905
2940
|
},
|
|
2906
|
-
[l, c,
|
|
2941
|
+
[l, c, f]
|
|
2907
2942
|
);
|
|
2908
|
-
return
|
|
2943
|
+
return O(() => {
|
|
2909
2944
|
if (d) return;
|
|
2910
|
-
const
|
|
2911
|
-
if (!
|
|
2912
|
-
const
|
|
2913
|
-
const { focusedId: k, editingId: I, connectingFrom:
|
|
2945
|
+
const C = s.current;
|
|
2946
|
+
if (!C) return;
|
|
2947
|
+
const S = (u) => {
|
|
2948
|
+
const { focusedId: k, editingId: I, connectingFrom: z } = D.current;
|
|
2914
2949
|
if (I) {
|
|
2915
|
-
|
|
2950
|
+
u.key === "Escape" && (u.preventDefault(), m(null));
|
|
2916
2951
|
return;
|
|
2917
2952
|
}
|
|
2918
|
-
const
|
|
2919
|
-
if (
|
|
2920
|
-
const K =
|
|
2953
|
+
const _ = u.target;
|
|
2954
|
+
if (_ != null && _.closest('input, textarea, select, [contenteditable="true"]')) return;
|
|
2955
|
+
const K = gr[u.key];
|
|
2921
2956
|
if (K) {
|
|
2922
|
-
|
|
2923
|
-
const
|
|
2924
|
-
if (
|
|
2925
|
-
const
|
|
2926
|
-
up: { x: 0, y: -
|
|
2927
|
-
down: { x: 0, y:
|
|
2928
|
-
left: { x: -
|
|
2929
|
-
right: { x:
|
|
2957
|
+
u.preventDefault();
|
|
2958
|
+
const j = D.current.nodes.find((v) => v.id === k);
|
|
2959
|
+
if (u.shiftKey && j && x) {
|
|
2960
|
+
const v = {
|
|
2961
|
+
up: { x: 0, y: -i },
|
|
2962
|
+
down: { x: 0, y: i },
|
|
2963
|
+
left: { x: -i, y: 0 },
|
|
2964
|
+
right: { x: i, y: 0 }
|
|
2930
2965
|
}[K];
|
|
2931
|
-
|
|
2932
|
-
x:
|
|
2933
|
-
y:
|
|
2966
|
+
x(j.id, {
|
|
2967
|
+
x: j.position.x + v.x,
|
|
2968
|
+
y: j.position.y + v.y
|
|
2934
2969
|
});
|
|
2935
2970
|
return;
|
|
2936
2971
|
}
|
|
2937
|
-
|
|
2972
|
+
M(K);
|
|
2938
2973
|
return;
|
|
2939
2974
|
}
|
|
2940
|
-
switch (
|
|
2975
|
+
switch (u.key) {
|
|
2941
2976
|
case "Tab": {
|
|
2942
2977
|
if (!l) return;
|
|
2943
|
-
|
|
2978
|
+
u.preventDefault(), A(u.shiftKey ? "left" : "right");
|
|
2944
2979
|
return;
|
|
2945
2980
|
}
|
|
2946
2981
|
case "Enter": {
|
|
2947
2982
|
if (!k) return;
|
|
2948
|
-
if (
|
|
2949
|
-
c == null || c(
|
|
2983
|
+
if (u.preventDefault(), z && z !== k) {
|
|
2984
|
+
c == null || c(z, k), N(null);
|
|
2950
2985
|
return;
|
|
2951
2986
|
}
|
|
2952
|
-
|
|
2987
|
+
h == null || h(k), m(k);
|
|
2953
2988
|
return;
|
|
2954
2989
|
}
|
|
2955
2990
|
case "Escape": {
|
|
2956
|
-
|
|
2991
|
+
u.preventDefault(), z ? N(null) : f(null);
|
|
2957
2992
|
return;
|
|
2958
2993
|
}
|
|
2959
2994
|
case "Delete":
|
|
2960
2995
|
case "Backspace": {
|
|
2961
|
-
if (!k || !
|
|
2962
|
-
|
|
2963
|
-
const
|
|
2964
|
-
|
|
2996
|
+
if (!k || !y) return;
|
|
2997
|
+
u.preventDefault();
|
|
2998
|
+
const j = D.current.nodes.filter((P) => P.id !== k), v = he(D.current.nodes, k, "left") ?? he(D.current.nodes, k, "right") ?? j[0] ?? null;
|
|
2999
|
+
y(k), f((v == null ? void 0 : v.id) ?? null);
|
|
2965
3000
|
return;
|
|
2966
3001
|
}
|
|
2967
3002
|
case "c":
|
|
2968
3003
|
case "C": {
|
|
2969
|
-
if (!k || !c ||
|
|
2970
|
-
|
|
3004
|
+
if (!k || !c || u.metaKey || u.ctrlKey) return;
|
|
3005
|
+
u.preventDefault(), N(z === k ? null : k);
|
|
2971
3006
|
return;
|
|
2972
3007
|
}
|
|
2973
3008
|
}
|
|
2974
3009
|
};
|
|
2975
|
-
return
|
|
3010
|
+
return C.addEventListener("keydown", S), () => C.removeEventListener("keydown", S);
|
|
2976
3011
|
}, [
|
|
2977
3012
|
d,
|
|
2978
3013
|
s,
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
3014
|
+
M,
|
|
3015
|
+
A,
|
|
3016
|
+
i,
|
|
2982
3017
|
c,
|
|
2983
3018
|
l,
|
|
3019
|
+
y,
|
|
2984
3020
|
h,
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
}, [t, N, w, b, u]), H(
|
|
3021
|
+
x,
|
|
3022
|
+
f
|
|
3023
|
+
]), O(() => {
|
|
3024
|
+
w && !t.some((C) => C.id === w) && f(null), g && !t.some((C) => C.id === g) && m(null), b && !t.some((C) => C.id === b) && N(null);
|
|
3025
|
+
}, [t, w, g, b, f]), B(
|
|
2991
3026
|
() => ({
|
|
2992
|
-
focusedId:
|
|
2993
|
-
setFocusedId:
|
|
2994
|
-
editingId:
|
|
2995
|
-
setEditingId:
|
|
3027
|
+
focusedId: w,
|
|
3028
|
+
setFocusedId: f,
|
|
3029
|
+
editingId: g,
|
|
3030
|
+
setEditingId: m,
|
|
2996
3031
|
connectingFrom: b,
|
|
2997
|
-
setConnectingFrom:
|
|
2998
|
-
moveFocus:
|
|
2999
|
-
createConnected:
|
|
3032
|
+
setConnectingFrom: N,
|
|
3033
|
+
moveFocus: M,
|
|
3034
|
+
createConnected: A
|
|
3000
3035
|
}),
|
|
3001
|
-
[
|
|
3036
|
+
[w, f, g, b, M, A]
|
|
3037
|
+
);
|
|
3038
|
+
}, Qr = ({
|
|
3039
|
+
nodes: t,
|
|
3040
|
+
viewport: e,
|
|
3041
|
+
canvasSize: n,
|
|
3042
|
+
onViewportChange: r,
|
|
3043
|
+
width: a = 180,
|
|
3044
|
+
height: s = 120,
|
|
3045
|
+
nodeColor: i,
|
|
3046
|
+
highlightIds: d,
|
|
3047
|
+
padding: l = 8,
|
|
3048
|
+
panDistance: c = 80,
|
|
3049
|
+
"aria-label": y = "Graph minimap",
|
|
3050
|
+
className: x
|
|
3051
|
+
}) => {
|
|
3052
|
+
const h = F(null), T = B(() => new Set(d ?? []), [d]), E = ar(e, n), g = B(() => {
|
|
3053
|
+
const S = Ge(t);
|
|
3054
|
+
return S ? ir(S, E) : E;
|
|
3055
|
+
}, [t, E.x, E.y, E.width, E.height]), m = Math.min(
|
|
3056
|
+
(a - l * 2) / Math.max(g.width, 1),
|
|
3057
|
+
(s - l * 2) / Math.max(g.height, 1)
|
|
3058
|
+
), b = {
|
|
3059
|
+
x: (a - g.width * m) / 2 - g.x * m,
|
|
3060
|
+
y: (s - g.height * m) / 2 - g.y * m
|
|
3061
|
+
}, N = (S) => ({
|
|
3062
|
+
x: S.x * m + b.x,
|
|
3063
|
+
y: S.y * m + b.y
|
|
3064
|
+
}), w = (S) => ({
|
|
3065
|
+
x: (S.x - b.x) / m,
|
|
3066
|
+
y: (S.y - b.y) / m
|
|
3067
|
+
}), f = ee(
|
|
3068
|
+
(S) => {
|
|
3069
|
+
var I;
|
|
3070
|
+
if (!r) return;
|
|
3071
|
+
const u = (I = h.current) == null ? void 0 : I.getBoundingClientRect();
|
|
3072
|
+
if (!u) return;
|
|
3073
|
+
const k = w({ x: S.x - u.left, y: S.y - u.top });
|
|
3074
|
+
r(Me(k, n, e.scale));
|
|
3075
|
+
},
|
|
3076
|
+
[r, n, e.scale, m, b.x, b.y]
|
|
3077
|
+
), D = (S) => {
|
|
3078
|
+
var I;
|
|
3079
|
+
if (!r || S.button !== 0) return;
|
|
3080
|
+
S.preventDefault(), (I = h.current) == null || I.focus(), f({ x: S.clientX, y: S.clientY });
|
|
3081
|
+
const u = (z) => f({ x: z.clientX, y: z.clientY }), k = () => {
|
|
3082
|
+
window.removeEventListener("pointermove", u), window.removeEventListener("pointerup", k);
|
|
3083
|
+
};
|
|
3084
|
+
window.addEventListener("pointermove", u), window.addEventListener("pointerup", k);
|
|
3085
|
+
}, M = (S) => {
|
|
3086
|
+
if (!r) return;
|
|
3087
|
+
const u = {
|
|
3088
|
+
ArrowUp: { x: 0, y: -c },
|
|
3089
|
+
ArrowDown: { x: 0, y: c },
|
|
3090
|
+
ArrowLeft: { x: -c, y: 0 },
|
|
3091
|
+
ArrowRight: { x: c, y: 0 }
|
|
3092
|
+
}[S.key];
|
|
3093
|
+
if (!u) return;
|
|
3094
|
+
S.preventDefault();
|
|
3095
|
+
const k = Y(E);
|
|
3096
|
+
r(
|
|
3097
|
+
Me({ x: k.x + u.x, y: k.y + u.y }, n, e.scale)
|
|
3098
|
+
);
|
|
3099
|
+
}, A = {
|
|
3100
|
+
x: N(E).x,
|
|
3101
|
+
y: N(E).y,
|
|
3102
|
+
width: E.width * m,
|
|
3103
|
+
height: E.height * m
|
|
3104
|
+
}, C = !!r;
|
|
3105
|
+
return /* @__PURE__ */ o(
|
|
3106
|
+
"div",
|
|
3107
|
+
{
|
|
3108
|
+
ref: h,
|
|
3109
|
+
role: C ? "slider" : "img",
|
|
3110
|
+
"aria-label": y,
|
|
3111
|
+
"aria-valuetext": t.length === 0 ? "Empty graph" : `${t.length} nodes, viewing around ${Math.round(Y(E).x)}, ${Math.round(Y(E).y)}`,
|
|
3112
|
+
tabIndex: C ? 0 : void 0,
|
|
3113
|
+
onPointerDown: D,
|
|
3114
|
+
onKeyDown: M,
|
|
3115
|
+
style: { width: a, height: s },
|
|
3116
|
+
className: L(
|
|
3117
|
+
"rounded-lg border border-border bg-card/90 backdrop-blur-sm shadow-sm overflow-hidden",
|
|
3118
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3119
|
+
C && "cursor-pointer",
|
|
3120
|
+
x
|
|
3121
|
+
),
|
|
3122
|
+
children: /* @__PURE__ */ p("svg", { width: a, height: s, className: "block", children: [
|
|
3123
|
+
t.map((S) => {
|
|
3124
|
+
const u = q(S), k = N(u), I = T.has(S.id);
|
|
3125
|
+
return /* @__PURE__ */ o(
|
|
3126
|
+
"rect",
|
|
3127
|
+
{
|
|
3128
|
+
x: k.x,
|
|
3129
|
+
y: k.y,
|
|
3130
|
+
width: Math.max(u.width * m, 2),
|
|
3131
|
+
height: Math.max(u.height * m, 2),
|
|
3132
|
+
rx: 1,
|
|
3133
|
+
fill: I || i == null ? void 0 : i(S),
|
|
3134
|
+
className: L(
|
|
3135
|
+
!i && !I && "fill-muted-foreground/50",
|
|
3136
|
+
I && "fill-primary"
|
|
3137
|
+
)
|
|
3138
|
+
},
|
|
3139
|
+
S.id
|
|
3140
|
+
);
|
|
3141
|
+
}),
|
|
3142
|
+
n.width > 0 && /* @__PURE__ */ o(
|
|
3143
|
+
"rect",
|
|
3144
|
+
{
|
|
3145
|
+
x: A.x,
|
|
3146
|
+
y: A.y,
|
|
3147
|
+
width: Math.max(A.width, 4),
|
|
3148
|
+
height: Math.max(A.height, 4),
|
|
3149
|
+
rx: 2,
|
|
3150
|
+
className: "fill-primary/10 stroke-primary",
|
|
3151
|
+
strokeWidth: 1.5
|
|
3152
|
+
}
|
|
3153
|
+
)
|
|
3154
|
+
] })
|
|
3155
|
+
}
|
|
3002
3156
|
);
|
|
3003
|
-
},
|
|
3157
|
+
}, Je = "application/x-nexus-graph-node", Zr = ({
|
|
3004
3158
|
items: t,
|
|
3005
3159
|
onSelect: e,
|
|
3006
3160
|
onDragStart: n,
|
|
3007
|
-
|
|
3161
|
+
orientation: r = "auto",
|
|
3162
|
+
onOrientationChange: a,
|
|
3163
|
+
iconOnly: s = !1,
|
|
3008
3164
|
className: i,
|
|
3009
|
-
"aria-label":
|
|
3010
|
-
}) =>
|
|
3011
|
-
"
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3165
|
+
"aria-label": d = "Node palette"
|
|
3166
|
+
}) => {
|
|
3167
|
+
const l = F(null), [c, y] = R("horizontal"), x = r === "auto" ? c : r, h = F(a);
|
|
3168
|
+
h.current = a;
|
|
3169
|
+
const T = ee(() => {
|
|
3170
|
+
const g = l.current;
|
|
3171
|
+
if (!g) return;
|
|
3172
|
+
const m = [...g.querySelectorAll("[data-palette-item]")];
|
|
3173
|
+
if (m.length === 0) return;
|
|
3174
|
+
const b = window.getComputedStyle(g), N = parseFloat(b.gap) || 0, w = (parseFloat(b.paddingLeft) || 0) + (parseFloat(b.paddingRight) || 0), f = m.reduce((S, u) => S + u.offsetWidth, 0) + N * (m.length - 1) + w, D = m.reduce((S, u) => S + u.offsetHeight, 0) + N * (m.length - 1) + w, M = xr(g);
|
|
3175
|
+
if (!M) return;
|
|
3176
|
+
const A = 4, C = f <= M.width + A ? "horizontal" : D <= M.height + A ? "vertical" : "horizontal";
|
|
3177
|
+
y((S) => {
|
|
3178
|
+
var u;
|
|
3179
|
+
return S === C ? S : ((u = h.current) == null || u.call(h, C), C);
|
|
3180
|
+
});
|
|
3181
|
+
}, []);
|
|
3182
|
+
O(() => {
|
|
3183
|
+
if (r !== "auto") return;
|
|
3184
|
+
const g = l.current;
|
|
3185
|
+
if (!g) return;
|
|
3186
|
+
T();
|
|
3187
|
+
const m = new ResizeObserver(T);
|
|
3188
|
+
m.observe(g);
|
|
3189
|
+
const b = Xe(g);
|
|
3190
|
+
return b && b !== g && m.observe(b), () => m.disconnect();
|
|
3191
|
+
}, [r, T, t.length]);
|
|
3192
|
+
const E = x === "vertical";
|
|
3193
|
+
return /* @__PURE__ */ o(
|
|
3194
|
+
"div",
|
|
3195
|
+
{
|
|
3196
|
+
ref: l,
|
|
3197
|
+
role: "toolbar",
|
|
3198
|
+
"aria-label": d,
|
|
3199
|
+
"aria-orientation": x,
|
|
3200
|
+
"data-orientation": x,
|
|
3201
|
+
className: L(
|
|
3202
|
+
"flex gap-1.5 p-1.5 rounded-lg border border-border bg-card/90 backdrop-blur-sm shadow-sm",
|
|
3203
|
+
E ? "flex-col items-stretch" : "flex-wrap items-center",
|
|
3204
|
+
i
|
|
3205
|
+
),
|
|
3206
|
+
children: t.map((g) => /* @__PURE__ */ p(
|
|
3207
|
+
"button",
|
|
3208
|
+
{
|
|
3209
|
+
type: "button",
|
|
3210
|
+
"data-palette-item": !0,
|
|
3211
|
+
draggable: !0,
|
|
3212
|
+
title: g.description ?? (s ? g.label : void 0),
|
|
3213
|
+
"aria-label": s ? g.label : void 0,
|
|
3214
|
+
onDragStart: (m) => {
|
|
3215
|
+
m.dataTransfer.setData(Je, g.kind), m.dataTransfer.setData("text/plain", g.label), m.dataTransfer.effectAllowed = "copy", n == null || n(g);
|
|
3216
|
+
},
|
|
3217
|
+
onClick: () => e == null ? void 0 : e(g),
|
|
3218
|
+
className: L(
|
|
3219
|
+
"flex items-center gap-1.5 rounded-md text-xs font-medium",
|
|
3220
|
+
"border border-border bg-background text-foreground",
|
|
3221
|
+
"hover:bg-accent hover:text-accent-foreground transition-colors",
|
|
3222
|
+
"cursor-grab active:cursor-grabbing",
|
|
3223
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3224
|
+
s ? "p-2 justify-center" : "px-2.5 py-1.5",
|
|
3225
|
+
// A column reads better left-aligned; a row centres naturally.
|
|
3226
|
+
E && !s && "justify-start"
|
|
3227
|
+
),
|
|
3228
|
+
children: [
|
|
3229
|
+
g.icon,
|
|
3230
|
+
!s && g.label
|
|
3231
|
+
]
|
|
3029
3232
|
},
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
a.label
|
|
3041
|
-
]
|
|
3042
|
-
},
|
|
3043
|
-
a.kind
|
|
3044
|
-
))
|
|
3233
|
+
g.kind
|
|
3234
|
+
))
|
|
3235
|
+
}
|
|
3236
|
+
);
|
|
3237
|
+
}, Xe = (t) => {
|
|
3238
|
+
let e = t.parentElement;
|
|
3239
|
+
for (let n = 0; e && n < 6; n += 1) {
|
|
3240
|
+
const r = e.getBoundingClientRect(), a = t.getBoundingClientRect();
|
|
3241
|
+
if (r.width > a.width + 8) return e;
|
|
3242
|
+
e = e.parentElement;
|
|
3045
3243
|
}
|
|
3046
|
-
|
|
3244
|
+
return null;
|
|
3245
|
+
}, xr = (t) => {
|
|
3246
|
+
const e = Xe(t);
|
|
3247
|
+
if (!e) return null;
|
|
3248
|
+
const n = window.getComputedStyle(e), r = e.getBoundingClientRect();
|
|
3249
|
+
return {
|
|
3250
|
+
width: r.width - (parseFloat(n.paddingLeft) || 0) - (parseFloat(n.paddingRight) || 0),
|
|
3251
|
+
height: r.height - (parseFloat(n.paddingTop) || 0) - (parseFloat(n.paddingBottom) || 0)
|
|
3252
|
+
};
|
|
3253
|
+
}, en = (t) => t.dataTransfer.getData(Je) || null;
|
|
3047
3254
|
export {
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3255
|
+
vt as ActivityBar,
|
|
3256
|
+
zr as AppTitle,
|
|
3257
|
+
ie as BUNDLED_THEMES,
|
|
3258
|
+
Mt as BUNDLED_THEME_CLASSES,
|
|
3259
|
+
kt as ChatPane,
|
|
3260
|
+
qt as CommandPalette,
|
|
3261
|
+
It as CommandRegistry,
|
|
3262
|
+
wt as ConnectedActivityBar,
|
|
3263
|
+
Ct as ConnectedChatPane,
|
|
3264
|
+
$r as ConnectedCommandPalette,
|
|
3265
|
+
Lt as ConnectedMenuBar,
|
|
3266
|
+
Or as ConnectedModal,
|
|
3267
|
+
Pt as ConnectedSidebarPane,
|
|
3268
|
+
Kt as ConnectedStatusBar,
|
|
3269
|
+
Ut as ConnectedTerminalPane,
|
|
3270
|
+
Rr as ConnectedThemeSwitcher,
|
|
3271
|
+
Pr as ConnectedUserProfile,
|
|
3272
|
+
nr as ContextMenu,
|
|
3273
|
+
Ir as DEFAULT_COMMAND_IDS,
|
|
3274
|
+
qr as DEFAULT_GRAPH_KEYS,
|
|
3275
|
+
de as DEFAULT_NODE_SIZE,
|
|
3276
|
+
Ot as DEFAULT_SETTINGS_THEMES,
|
|
3277
|
+
er as DEFAULT_THEME_OPTIONS,
|
|
3278
|
+
Kr as DataGrid,
|
|
3279
|
+
Je as GRAPH_NODE_MIME,
|
|
3280
|
+
ur as GraphCanvas,
|
|
3281
|
+
Jr as GraphEdge,
|
|
3282
|
+
Xr as GraphEdgeLayer,
|
|
3283
|
+
Qr as GraphMiniMap,
|
|
3284
|
+
Yr as GraphNode,
|
|
3285
|
+
We as IDENTITY_VIEWPORT,
|
|
3286
|
+
Dt as MenuBar,
|
|
3287
|
+
St as MenuRegistry,
|
|
3288
|
+
Zt as Modal,
|
|
3289
|
+
Sr as NexusWorkspaceShell,
|
|
3290
|
+
Zr as NodePalette,
|
|
3291
|
+
Fr as QuickSearch,
|
|
3292
|
+
_r as SearchWidget,
|
|
3293
|
+
Rt as SettingsPanel,
|
|
3294
|
+
Sr as ShellLayout,
|
|
3295
|
+
me as SidebarPane,
|
|
3296
|
+
zt as StatusBar,
|
|
3297
|
+
Ft as TerminalPane,
|
|
3298
|
+
tr as ThemeSwitcher,
|
|
3299
|
+
Ur as TreeWidget,
|
|
3300
|
+
rr as UserProfile,
|
|
3301
|
+
Me as centerOn,
|
|
3302
|
+
ye as clampScale,
|
|
3303
|
+
L as cn,
|
|
3304
|
+
te as commandRegistry,
|
|
3305
|
+
Bt as componentRegistry,
|
|
3306
|
+
hr as edgePath,
|
|
3307
|
+
Br as edgesOf,
|
|
3308
|
+
he as findNeighbour,
|
|
3309
|
+
lr as fitViewport,
|
|
3310
|
+
Ge as graphBounds,
|
|
3311
|
+
Lr as initializeShell,
|
|
3312
|
+
Hr as isConnected,
|
|
3313
|
+
ve as menuRegistry,
|
|
3314
|
+
Gr as nextId,
|
|
3315
|
+
q as nodeRect,
|
|
3316
|
+
cr as placeRelativeTo,
|
|
3317
|
+
Mr as pluginRegistry,
|
|
3318
|
+
Le as portPoint,
|
|
3319
|
+
en as readPaletteDrag,
|
|
3320
|
+
Y as rectCenter,
|
|
3321
|
+
Wr as removeNode,
|
|
3322
|
+
sr as resolvePorts,
|
|
3323
|
+
At as themeClass,
|
|
3115
3324
|
be as toGraphSpace,
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3325
|
+
jr as toScreenSpace,
|
|
3326
|
+
ir as unionRect,
|
|
3327
|
+
ae as useChatStore,
|
|
3328
|
+
Vr as useGraphKeyboard,
|
|
3329
|
+
Ar as useKeyboardShortcuts,
|
|
3330
|
+
Ht as useLayoutStore,
|
|
3331
|
+
je as useModalStore,
|
|
3332
|
+
xe as useRightSidebarStore,
|
|
3333
|
+
G as useSidebarStore,
|
|
3334
|
+
we as useStatusBarStore,
|
|
3335
|
+
ne as useTerminalStore,
|
|
3336
|
+
oe as useThemeStore,
|
|
3337
|
+
Z as useUserProfileStore,
|
|
3338
|
+
ar as viewportRect,
|
|
3339
|
+
Ie as zoomAt
|
|
3129
3340
|
};
|