nexus-shell 0.2.15 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/services/LayoutService.d.ts +11 -0
- package/dist/nexus-shell.es.js +319 -319
- 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
|
@@ -2,18 +2,18 @@ var xt = Object.defineProperty;
|
|
|
2
2
|
var bt = (e, t, r) => t in e ? xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var re = (e, t, r) => bt(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import { jsxs as w, jsx as o, Fragment as He } from "react/jsx-runtime";
|
|
5
|
-
import he, { useMemo as j, useState as $, useRef as K, useId as je, useCallback as
|
|
6
|
-
import {
|
|
5
|
+
import he, { useMemo as j, useState as $, useRef as K, useId as je, useCallback as q, useEffect as F, useContext as yt, createContext as vt, forwardRef as wt, useImperativeHandle as Nt } from "react";
|
|
6
|
+
import { Actions as le, DockLocation as kt, Model as Et, Layout as Tt } from "flexlayout-react";
|
|
7
7
|
import "flexlayout-react/style/light.css";
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { twMerge as
|
|
8
|
+
import { clsx as Dt } from "clsx";
|
|
9
|
+
import { twMerge as St } from "tailwind-merge";
|
|
10
10
|
import { create as ee } from "zustand";
|
|
11
|
-
import { ChevronRight as We, X as
|
|
12
|
-
import { TableVirtuoso as
|
|
11
|
+
import { ChevronRight as We, X as J, MessageCircle as Te, User as Ge, Terminal as De, Send as It, GraduationCap as Pe, Moon as Lt, Sun as Pt, Palette as At, ChevronUp as Ye, Settings as Mt, Search as xe, Info as Ct, HelpCircle as $t, AlertCircle as Rt, Check as Ft, Camera as Ot, Edit2 as zt, Loader2 as Xe, ChevronsUpDown as _t, ChevronDown as qe, Clock as Kt, Plus as Ut } from "lucide-react";
|
|
12
|
+
import { TableVirtuoso as Bt, Virtuoso as Ht } from "react-virtuoso";
|
|
13
13
|
function A(...e) {
|
|
14
|
-
return Dt(
|
|
14
|
+
return St(Dt(e));
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const jt = ({
|
|
17
17
|
items: e = [],
|
|
18
18
|
bottomItems: t = [],
|
|
19
19
|
activeId: r = null,
|
|
@@ -59,22 +59,22 @@ const Ht = ({
|
|
|
59
59
|
]
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
|
-
},
|
|
62
|
+
}, Ve = "chat", Je = "terminal", Wt = "settings", Gt = (e) => {
|
|
63
63
|
try {
|
|
64
64
|
return typeof window > "u" || !window.localStorage ? null : window.localStorage.getItem(e);
|
|
65
65
|
} catch {
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, Yt = (e, t) => {
|
|
69
69
|
try {
|
|
70
70
|
if (typeof window > "u" || !window.localStorage) return;
|
|
71
71
|
t === null ? window.localStorage.removeItem(e) : window.localStorage.setItem(e, t);
|
|
72
72
|
} catch {
|
|
73
73
|
}
|
|
74
74
|
}, Se = (e) => ee((t) => {
|
|
75
|
-
const r = (n) => (
|
|
75
|
+
const r = (n) => (Yt(e, n), n);
|
|
76
76
|
return {
|
|
77
|
-
activePanel:
|
|
77
|
+
activePanel: Gt(e),
|
|
78
78
|
panels: [],
|
|
79
79
|
setActivePanel: (n) => t({ activePanel: r(n) }),
|
|
80
80
|
togglePanel: (n) => t((s) => ({
|
|
@@ -82,11 +82,11 @@ const Ht = ({
|
|
|
82
82
|
})),
|
|
83
83
|
setPanels: (n) => t((s) => n.length > 0 && s.activePanel !== null && !n.some((a) => a.id === s.activePanel) ? { panels: n, activePanel: r(null) } : { panels: n })
|
|
84
84
|
};
|
|
85
|
-
}),
|
|
86
|
-
left:
|
|
87
|
-
right:
|
|
88
|
-
bottom:
|
|
89
|
-
}, fe = (e) =>
|
|
85
|
+
}), Xt = Se("nexus-shell-pane-left"), qt = Se("nexus-shell-pane-right"), Vt = Se("nexus-shell-pane-bottom"), Jt = {
|
|
86
|
+
left: Xt,
|
|
87
|
+
right: qt,
|
|
88
|
+
bottom: Vt
|
|
89
|
+
}, fe = (e) => Jt[e], Qe = ["left", "right", "bottom"], Ze = (e) => {
|
|
90
90
|
Qe.forEach((t) => {
|
|
91
91
|
fe(t).getState().setPanels(e.filter((r) => (r.side ?? "left") === t));
|
|
92
92
|
});
|
|
@@ -99,7 +99,7 @@ const Ht = ({
|
|
|
99
99
|
];
|
|
100
100
|
}, [n]);
|
|
101
101
|
return n.length === 0 ? null : /* @__PURE__ */ o(
|
|
102
|
-
|
|
102
|
+
jt,
|
|
103
103
|
{
|
|
104
104
|
...t,
|
|
105
105
|
side: e,
|
|
@@ -110,7 +110,7 @@ const Ht = ({
|
|
|
110
110
|
"aria-label": t["aria-label"] ?? (e === "right" ? "Inspector Bar" : "Activity Bar")
|
|
111
111
|
}
|
|
112
112
|
);
|
|
113
|
-
},
|
|
113
|
+
}, Qt = ({
|
|
114
114
|
menus: e = {},
|
|
115
115
|
onSelect: t,
|
|
116
116
|
title: r,
|
|
@@ -118,7 +118,7 @@ const Ht = ({
|
|
|
118
118
|
right: s,
|
|
119
119
|
className: i
|
|
120
120
|
}) => {
|
|
121
|
-
const a = Object.keys(e), [u, d] = $(null), [l, h] = $(null), f = K(null), m = K({}), N = je(), v = (y) => `${N}-menu-${a.indexOf(y)}`, p =
|
|
121
|
+
const a = Object.keys(e), [u, d] = $(null), [l, h] = $(null), f = K(null), m = K({}), N = je(), v = (y) => `${N}-menu-${a.indexOf(y)}`, p = q((y) => {
|
|
122
122
|
var c;
|
|
123
123
|
d(null), h(null), y && ((c = m.current[y]) == null || c.focus());
|
|
124
124
|
}, []);
|
|
@@ -308,7 +308,7 @@ const Ht = ({
|
|
|
308
308
|
}
|
|
309
309
|
);
|
|
310
310
|
};
|
|
311
|
-
class
|
|
311
|
+
class Zt {
|
|
312
312
|
constructor() {
|
|
313
313
|
re(this, "menus", /* @__PURE__ */ new Map());
|
|
314
314
|
}
|
|
@@ -329,8 +329,8 @@ class Qt {
|
|
|
329
329
|
}), t;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
const Ie = new
|
|
333
|
-
class
|
|
332
|
+
const Ie = new Zt();
|
|
333
|
+
class er {
|
|
334
334
|
constructor() {
|
|
335
335
|
re(this, "commands", /* @__PURE__ */ new Map());
|
|
336
336
|
}
|
|
@@ -352,7 +352,7 @@ class Zt {
|
|
|
352
352
|
return Array.from(this.commands.values());
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
const oe = new
|
|
355
|
+
const oe = new er(), et = (e) => e.map((t) => {
|
|
356
356
|
var r;
|
|
357
357
|
return {
|
|
358
358
|
...t,
|
|
@@ -365,11 +365,11 @@ const oe = new Zt(), et = (e) => e.map((t) => {
|
|
|
365
365
|
const n = r.submenu && tt(r.submenu, t);
|
|
366
366
|
if (n) return n;
|
|
367
367
|
}
|
|
368
|
-
},
|
|
368
|
+
}, tr = (e) => {
|
|
369
369
|
const t = Ie.getAllMenus(), r = Object.fromEntries(
|
|
370
370
|
Object.entries(t).map(([s, i]) => [s, et(i)])
|
|
371
371
|
);
|
|
372
|
-
return /* @__PURE__ */ o(
|
|
372
|
+
return /* @__PURE__ */ o(Qt, { ...e, menus: r, onSelect: (s) => {
|
|
373
373
|
for (const i of Object.values(t)) {
|
|
374
374
|
const a = tt(i, s.id);
|
|
375
375
|
if (a != null && a.commandId) {
|
|
@@ -416,7 +416,7 @@ const oe = new Zt(), et = (e) => e.map((t) => {
|
|
|
416
416
|
onClick: r,
|
|
417
417
|
"aria-label": "Close Panel",
|
|
418
418
|
className: "p-1 hover:bg-accent hover:text-foreground rounded transition-colors focus:outline-none focus:ring-2 focus:ring-ring shrink-0",
|
|
419
|
-
children: /* @__PURE__ */ o(
|
|
419
|
+
children: /* @__PURE__ */ o(J, { size: 14 })
|
|
420
420
|
}
|
|
421
421
|
)
|
|
422
422
|
] }),
|
|
@@ -431,7 +431,7 @@ const oe = new Zt(), et = (e) => e.map((t) => {
|
|
|
431
431
|
return /* @__PURE__ */ o(Me, { ...t, side: e, title: n, onClose: a, children: /* @__PURE__ */ o("div", { className: "p-4 text-sm italic text-muted-foreground", children: "Panel content not found." }) });
|
|
432
432
|
const d = typeof u.component == "function" ? u.component : null;
|
|
433
433
|
return /* @__PURE__ */ o(Me, { ...t, side: e, title: u.label, onClose: a, children: d ? /* @__PURE__ */ o(d, {}) : u.component });
|
|
434
|
-
}, ye = (e, t) => (t.priority ?? 0) - (e.priority ?? 0),
|
|
434
|
+
}, ye = (e, t) => (t.priority ?? 0) - (e.priority ?? 0), rr = ({
|
|
435
435
|
widgets: e = [],
|
|
436
436
|
className: t,
|
|
437
437
|
"aria-label": r = "Status Bar"
|
|
@@ -501,7 +501,7 @@ const oe = new Zt(), et = (e) => e.map((t) => {
|
|
|
501
501
|
updateWidget: (t, r) => e((n) => ({
|
|
502
502
|
widgets: n.widgets.map((s) => s.id === t ? { ...s, ...r } : s)
|
|
503
503
|
}))
|
|
504
|
-
})),
|
|
504
|
+
})), nr = (e) => {
|
|
505
505
|
const t = Le((n) => n.widgets), r = j(
|
|
506
506
|
() => t.map(({ commandId: n, ...s }) => ({
|
|
507
507
|
...s,
|
|
@@ -509,9 +509,9 @@ const oe = new Zt(), et = (e) => e.map((t) => {
|
|
|
509
509
|
})),
|
|
510
510
|
[t]
|
|
511
511
|
);
|
|
512
|
-
return /* @__PURE__ */ o(
|
|
512
|
+
return /* @__PURE__ */ o(rr, { ...e, widgets: r });
|
|
513
513
|
};
|
|
514
|
-
class
|
|
514
|
+
class or {
|
|
515
515
|
constructor() {
|
|
516
516
|
re(this, "components", /* @__PURE__ */ new Map());
|
|
517
517
|
}
|
|
@@ -535,14 +535,14 @@ class nr {
|
|
|
535
535
|
return Array.from(this.components.keys());
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
const at = new
|
|
539
|
-
let
|
|
540
|
-
const
|
|
538
|
+
const at = new or();
|
|
539
|
+
let sr = 0;
|
|
540
|
+
const ar = () => `msg-${Date.now()}-${sr += 1}`, ue = ee((e) => ({
|
|
541
541
|
messages: [],
|
|
542
542
|
slashCommands: [],
|
|
543
543
|
setMessages: (t) => e({ messages: t }),
|
|
544
544
|
addMessage: (t) => e((r) => ({
|
|
545
|
-
messages: [...r.messages, { ...t, id: t.id ??
|
|
545
|
+
messages: [...r.messages, { ...t, id: t.id ?? ar() }]
|
|
546
546
|
})),
|
|
547
547
|
clearMessages: () => e({ messages: [] }),
|
|
548
548
|
setSlashCommands: (t) => e({ slashCommands: t }),
|
|
@@ -584,14 +584,14 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
584
584
|
}
|
|
585
585
|
]
|
|
586
586
|
}
|
|
587
|
-
}, Ce = "nexus-shell-layout", it = ee((e, t) => {
|
|
587
|
+
}, Ce = "nexus-shell-layout", X = (e) => Et.fromJson({ ...e, global: { borderEnableAutoHide: !0, ...e.global ?? {} } }), it = ee((e, t) => {
|
|
588
588
|
let r;
|
|
589
589
|
if (typeof window < "u")
|
|
590
590
|
try {
|
|
591
591
|
const n = localStorage.getItem(Ce);
|
|
592
592
|
if (n) {
|
|
593
593
|
const s = JSON.parse(n);
|
|
594
|
-
r =
|
|
594
|
+
r = X(s);
|
|
595
595
|
const i = /* @__PURE__ */ new Set(["dialogue-library", "argument-inspector"]), a = [];
|
|
596
596
|
r.visitNodes((u) => {
|
|
597
597
|
if (u.getType() === "tab") {
|
|
@@ -602,12 +602,12 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
602
602
|
r.doAction(le.deleteTab(u));
|
|
603
603
|
});
|
|
604
604
|
} else
|
|
605
|
-
r =
|
|
605
|
+
r = X(Z);
|
|
606
606
|
} catch (n) {
|
|
607
|
-
console.warn("Failed to load layout from storage, using default", n), r =
|
|
607
|
+
console.warn("Failed to load layout from storage, using default", n), r = X(Z);
|
|
608
608
|
}
|
|
609
609
|
else
|
|
610
|
-
r =
|
|
610
|
+
r = X(Z);
|
|
611
611
|
return {
|
|
612
612
|
model: r,
|
|
613
613
|
dirtyTabs: /* @__PURE__ */ new Set(),
|
|
@@ -617,12 +617,12 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
617
617
|
let i;
|
|
618
618
|
if (n && Object.keys(n).length > 0)
|
|
619
619
|
try {
|
|
620
|
-
i =
|
|
620
|
+
i = X(n);
|
|
621
621
|
} catch (a) {
|
|
622
|
-
console.warn("Failed to parse init layout json, using default", a), i =
|
|
622
|
+
console.warn("Failed to parse init layout json, using default", a), i = X(Z);
|
|
623
623
|
}
|
|
624
624
|
else
|
|
625
|
-
i =
|
|
625
|
+
i = X(Z);
|
|
626
626
|
e({ model: i, disableLocalStorage: s || !1 });
|
|
627
627
|
},
|
|
628
628
|
setModel: (n) => {
|
|
@@ -640,12 +640,12 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
640
640
|
if (typeof window < "u")
|
|
641
641
|
try {
|
|
642
642
|
const a = localStorage.getItem(n);
|
|
643
|
-
a ? i =
|
|
643
|
+
a ? i = X(JSON.parse(a)) : i = X(s || Z);
|
|
644
644
|
} catch (a) {
|
|
645
|
-
console.warn("Failed to load layout from storage for key", n, a), i =
|
|
645
|
+
console.warn("Failed to load layout from storage for key", n, a), i = X(s || Z);
|
|
646
646
|
}
|
|
647
647
|
else
|
|
648
|
-
i =
|
|
648
|
+
i = X(s || Z);
|
|
649
649
|
e({ storageKey: n, model: i });
|
|
650
650
|
},
|
|
651
651
|
setTabDirty: (n, s) => {
|
|
@@ -759,12 +759,12 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
759
759
|
shortLabel: "TAMU",
|
|
760
760
|
description: "Aggie Maroon (#500000) on white."
|
|
761
761
|
}
|
|
762
|
-
],
|
|
762
|
+
], ir = me.map((e) => `theme-${e.id}`), lr = (e) => `theme-${e}`, $e = "nexus-shell-theme", Re = (e) => {
|
|
763
763
|
const t = window.document.documentElement, r = [
|
|
764
|
-
...
|
|
764
|
+
...ir,
|
|
765
765
|
...Array.from(t.classList).filter((n) => n.startsWith("theme-"))
|
|
766
766
|
];
|
|
767
|
-
t.classList.remove(...r), t.classList.add(
|
|
767
|
+
t.classList.remove(...r), t.classList.add(lr(e));
|
|
768
768
|
}, ce = ee((e) => {
|
|
769
769
|
const r = localStorage.getItem($e) || "light";
|
|
770
770
|
return Re(r), {
|
|
@@ -773,7 +773,7 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
773
773
|
localStorage.setItem($e, n), Re(n), e({ theme: n });
|
|
774
774
|
}
|
|
775
775
|
};
|
|
776
|
-
}),
|
|
776
|
+
}), wn = ({
|
|
777
777
|
panels: e,
|
|
778
778
|
slashCommands: t,
|
|
779
779
|
menuConfig: r,
|
|
@@ -831,7 +831,7 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
831
831
|
className: `flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden theme-${x}`,
|
|
832
832
|
children: [
|
|
833
833
|
/* @__PURE__ */ o(
|
|
834
|
-
|
|
834
|
+
tr,
|
|
835
835
|
{
|
|
836
836
|
title: s,
|
|
837
837
|
center: a,
|
|
@@ -843,7 +843,7 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
843
843
|
/* @__PURE__ */ o(be, { side: "left" }),
|
|
844
844
|
/* @__PURE__ */ w("main", { className: "flex-1 flex flex-col min-w-0 bg-card", children: [
|
|
845
845
|
/* @__PURE__ */ o("div", { className: "flex-1 relative h-full w-full", children: /* @__PURE__ */ o(
|
|
846
|
-
|
|
846
|
+
Tt,
|
|
847
847
|
{
|
|
848
848
|
model: u || f,
|
|
849
849
|
factory: L,
|
|
@@ -858,7 +858,7 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
858
858
|
/* @__PURE__ */ o(be, { side: "right" }),
|
|
859
859
|
/* @__PURE__ */ o(Ae, { side: "right" })
|
|
860
860
|
] }),
|
|
861
|
-
/* @__PURE__ */ o(
|
|
861
|
+
/* @__PURE__ */ o(nr, {})
|
|
862
862
|
]
|
|
863
863
|
}
|
|
864
864
|
);
|
|
@@ -866,7 +866,7 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
866
866
|
id: `theme.${e.id}`,
|
|
867
867
|
label: `Preferences: ${e.label} Theme`,
|
|
868
868
|
execute: () => ce.getState().setTheme(e.id)
|
|
869
|
-
})),
|
|
869
|
+
})), Nn = [
|
|
870
870
|
"view.toggleTerminal",
|
|
871
871
|
"view.toggleChat",
|
|
872
872
|
"view.toggleSidebar",
|
|
@@ -878,17 +878,17 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
878
878
|
return r.getState().togglePanel(e), !0;
|
|
879
879
|
}
|
|
880
880
|
return at.get(e) ? (it.getState().addTab(e), !0) : !1;
|
|
881
|
-
},
|
|
881
|
+
}, cr = [
|
|
882
882
|
{
|
|
883
883
|
id: "view.toggleTerminal",
|
|
884
884
|
label: "View: Toggle Terminal",
|
|
885
885
|
keybinding: "Control+`",
|
|
886
|
-
execute: () => Fe(
|
|
886
|
+
execute: () => Fe(Je)
|
|
887
887
|
},
|
|
888
888
|
{
|
|
889
889
|
id: "view.toggleChat",
|
|
890
890
|
label: "View: Toggle Chat",
|
|
891
|
-
execute: () => Fe(
|
|
891
|
+
execute: () => Fe(Ve)
|
|
892
892
|
},
|
|
893
893
|
{
|
|
894
894
|
id: "view.toggleSidebar",
|
|
@@ -901,7 +901,7 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
901
901
|
}
|
|
902
902
|
},
|
|
903
903
|
...ct
|
|
904
|
-
],
|
|
904
|
+
], dr = {
|
|
905
905
|
View: [
|
|
906
906
|
{ id: "view.terminal", label: "Toggle Terminal", commandId: "view.toggleTerminal" },
|
|
907
907
|
{ id: "view.chat", label: "Toggle Chat", commandId: "view.toggleChat" },
|
|
@@ -916,7 +916,7 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
916
916
|
}))
|
|
917
917
|
}
|
|
918
918
|
]
|
|
919
|
-
},
|
|
919
|
+
}, kn = (e = {}) => {
|
|
920
920
|
const {
|
|
921
921
|
panels: t,
|
|
922
922
|
menus: r,
|
|
@@ -926,14 +926,14 @@ const sr = () => `msg-${Date.now()}-${or += 1}`, ue = ee((e) => ({
|
|
|
926
926
|
defaultCommands: a = !0,
|
|
927
927
|
defaultMenus: u = !0
|
|
928
928
|
} = e;
|
|
929
|
-
a &&
|
|
929
|
+
a && cr.forEach((l) => oe.registerCommand(l)), n == null || n.forEach((l) => oe.registerCommand(l));
|
|
930
930
|
const d = {
|
|
931
|
-
...a && u ?
|
|
931
|
+
...a && u ? dr : {},
|
|
932
932
|
...r ?? {}
|
|
933
933
|
};
|
|
934
934
|
Object.keys(d).length > 0 && Ie.setMenus(d), t && Ze(t), s && Le.getState().setWidgets(s), i && ue.getState().setSlashCommands(i);
|
|
935
935
|
};
|
|
936
|
-
class
|
|
936
|
+
class ur {
|
|
937
937
|
constructor() {
|
|
938
938
|
re(this, "plugins", /* @__PURE__ */ new Map());
|
|
939
939
|
re(this, "loaders", /* @__PURE__ */ new Map());
|
|
@@ -996,7 +996,7 @@ class dr {
|
|
|
996
996
|
return Array.from(this.plugins.values());
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
|
-
const
|
|
999
|
+
const En = new ur(), ve = ee((e) => ({
|
|
1000
1000
|
history: [
|
|
1001
1001
|
"Welcome to Nexus Shell Terminal v0.1.0",
|
|
1002
1002
|
'Type "help" for a list of commands.'
|
|
@@ -1050,12 +1050,12 @@ const kn = new dr(), ve = ee((e) => ({
|
|
|
1050
1050
|
return r(s), { customAvatar: "" };
|
|
1051
1051
|
})
|
|
1052
1052
|
};
|
|
1053
|
-
}),
|
|
1053
|
+
}), Tn = () => {
|
|
1054
1054
|
F(() => {
|
|
1055
1055
|
const e = (t) => {
|
|
1056
1056
|
const r = oe.getCommands();
|
|
1057
1057
|
for (const n of r)
|
|
1058
|
-
if (n.keybinding &&
|
|
1058
|
+
if (n.keybinding && fr(t, n.keybinding)) {
|
|
1059
1059
|
t.preventDefault(), n.execute();
|
|
1060
1060
|
break;
|
|
1061
1061
|
}
|
|
@@ -1063,12 +1063,12 @@ const kn = new dr(), ve = ee((e) => ({
|
|
|
1063
1063
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1064
1064
|
}, []);
|
|
1065
1065
|
};
|
|
1066
|
-
function
|
|
1066
|
+
function fr(e, t) {
|
|
1067
1067
|
var m;
|
|
1068
1068
|
const r = t.split("+"), n = (m = r.pop()) == null ? void 0 : m.toLowerCase(), s = r.includes("Control") || r.includes("Ctrl"), i = r.includes("Shift"), a = r.includes("Alt"), u = r.includes("Meta") || r.includes("Cmd"), d = e.ctrlKey, l = e.shiftKey, h = e.altKey, f = e.metaKey;
|
|
1069
1069
|
return e.key.toLowerCase() === n && d === s && l === i && h === a && f === u;
|
|
1070
1070
|
}
|
|
1071
|
-
const
|
|
1071
|
+
const mr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-center justify-center text-center px-6 text-muted-foreground", children: [
|
|
1072
1072
|
/* @__PURE__ */ o(Te, { size: 28, className: "mb-3 opacity-40" }),
|
|
1073
1073
|
/* @__PURE__ */ o("p", { className: "text-xs", children: "No messages yet." }),
|
|
1074
1074
|
/* @__PURE__ */ w("p", { className: "text-[11px] mt-1 opacity-70", children: [
|
|
@@ -1076,7 +1076,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1076
1076
|
/* @__PURE__ */ o("span", { className: "font-mono", children: "/" }),
|
|
1077
1077
|
" for commands."
|
|
1078
1078
|
] })
|
|
1079
|
-
] }),
|
|
1079
|
+
] }), pr = ({
|
|
1080
1080
|
messages: e = [],
|
|
1081
1081
|
onSend: t,
|
|
1082
1082
|
slashCommands: r = [],
|
|
@@ -1084,7 +1084,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1084
1084
|
onClose: s,
|
|
1085
1085
|
title: i = "Chat",
|
|
1086
1086
|
placeholder: a = "Send a message…",
|
|
1087
|
-
emptyState: u =
|
|
1087
|
+
emptyState: u = mr,
|
|
1088
1088
|
chrome: d,
|
|
1089
1089
|
className: l
|
|
1090
1090
|
}) => {
|
|
@@ -1144,7 +1144,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1144
1144
|
onClick: s,
|
|
1145
1145
|
"aria-label": "Close Chat",
|
|
1146
1146
|
className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
1147
|
-
children: /* @__PURE__ */ o(
|
|
1147
|
+
children: /* @__PURE__ */ o(J, { size: 14 })
|
|
1148
1148
|
}
|
|
1149
1149
|
)
|
|
1150
1150
|
] }),
|
|
@@ -1235,7 +1235,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1235
1235
|
disabled: !f.trim(),
|
|
1236
1236
|
"aria-label": "Send message",
|
|
1237
1237
|
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",
|
|
1238
|
-
children: /* @__PURE__ */ o(
|
|
1238
|
+
children: /* @__PURE__ */ o(It, { size: 14 })
|
|
1239
1239
|
}
|
|
1240
1240
|
)
|
|
1241
1241
|
] })
|
|
@@ -1243,10 +1243,10 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1243
1243
|
]
|
|
1244
1244
|
}
|
|
1245
1245
|
);
|
|
1246
|
-
},
|
|
1246
|
+
}, hr = ({ onSend: e, ...t }) => {
|
|
1247
1247
|
const r = ue((a) => a.messages), n = ue((a) => a.slashCommands), s = ue((a) => a.addMessage);
|
|
1248
1248
|
return /* @__PURE__ */ o(
|
|
1249
|
-
|
|
1249
|
+
pr,
|
|
1250
1250
|
{
|
|
1251
1251
|
...t,
|
|
1252
1252
|
messages: r,
|
|
@@ -1265,19 +1265,19 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
1267
|
);
|
|
1268
|
-
},
|
|
1269
|
-
light:
|
|
1270
|
-
dark:
|
|
1268
|
+
}, gr = {
|
|
1269
|
+
light: Pt,
|
|
1270
|
+
dark: Lt,
|
|
1271
1271
|
gt: Pe,
|
|
1272
1272
|
tamu: Pe
|
|
1273
|
-
},
|
|
1273
|
+
}, xr = me.map((e) => ({
|
|
1274
1274
|
id: e.id,
|
|
1275
1275
|
label: e.label,
|
|
1276
|
-
icon:
|
|
1277
|
-
})),
|
|
1276
|
+
icon: gr[e.id] ?? At
|
|
1277
|
+
})), br = ({
|
|
1278
1278
|
theme: e,
|
|
1279
1279
|
onThemeChange: t,
|
|
1280
|
-
themes: r =
|
|
1280
|
+
themes: r = xr,
|
|
1281
1281
|
className: n
|
|
1282
1282
|
}) => /* @__PURE__ */ o("div", { className: A("p-4 space-y-6", n), children: /* @__PURE__ */ w("section", { children: [
|
|
1283
1283
|
/* @__PURE__ */ o("h3", { className: "text-[11px] font-bold text-muted-foreground uppercase mb-3", children: "Theme" }),
|
|
@@ -1307,17 +1307,17 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1307
1307
|
))
|
|
1308
1308
|
}
|
|
1309
1309
|
)
|
|
1310
|
-
] }) }),
|
|
1310
|
+
] }) }), yr = (e) => {
|
|
1311
1311
|
const t = ce((n) => n.theme), r = ce((n) => n.setTheme);
|
|
1312
1312
|
return /* @__PURE__ */ o(
|
|
1313
|
-
|
|
1313
|
+
br,
|
|
1314
1314
|
{
|
|
1315
1315
|
...e,
|
|
1316
1316
|
theme: t,
|
|
1317
1317
|
onThemeChange: (n) => r(n)
|
|
1318
1318
|
}
|
|
1319
1319
|
);
|
|
1320
|
-
},
|
|
1320
|
+
}, vr = ({
|
|
1321
1321
|
history: e = [],
|
|
1322
1322
|
onCommand: t,
|
|
1323
1323
|
onClose: r,
|
|
@@ -1371,7 +1371,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1371
1371
|
onClick: r,
|
|
1372
1372
|
"aria-label": "Close Terminal",
|
|
1373
1373
|
className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
1374
|
-
children: /* @__PURE__ */ o(
|
|
1374
|
+
children: /* @__PURE__ */ o(J, { size: 14 })
|
|
1375
1375
|
}
|
|
1376
1376
|
)
|
|
1377
1377
|
] })
|
|
@@ -1410,17 +1410,17 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1410
1410
|
]
|
|
1411
1411
|
}
|
|
1412
1412
|
);
|
|
1413
|
-
},
|
|
1413
|
+
}, wr = [
|
|
1414
1414
|
"Available commands:",
|
|
1415
1415
|
" help — show this message",
|
|
1416
1416
|
" clear — clear the terminal"
|
|
1417
|
-
],
|
|
1417
|
+
], Nr = ({
|
|
1418
1418
|
onCommand: e,
|
|
1419
1419
|
...t
|
|
1420
1420
|
}) => {
|
|
1421
1421
|
const r = ve((a) => a.history), n = ve((a) => a.addHistory), s = ve((a) => a.clearHistory);
|
|
1422
1422
|
return /* @__PURE__ */ o(
|
|
1423
|
-
|
|
1423
|
+
vr,
|
|
1424
1424
|
{
|
|
1425
1425
|
...t,
|
|
1426
1426
|
history: r,
|
|
@@ -1432,43 +1432,43 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1432
1432
|
return;
|
|
1433
1433
|
}
|
|
1434
1434
|
if (u === "help") {
|
|
1435
|
-
|
|
1435
|
+
wr.forEach(n);
|
|
1436
1436
|
return;
|
|
1437
1437
|
}
|
|
1438
1438
|
(e == null ? void 0 : e(a)) !== !0 && n(`command not found: ${a.split(" ")[0]}`);
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
1441
|
);
|
|
1442
|
-
},
|
|
1443
|
-
id:
|
|
1442
|
+
}, Dn = (e = {}) => ({
|
|
1443
|
+
id: Ve,
|
|
1444
1444
|
label: "Chat",
|
|
1445
1445
|
icon: Te,
|
|
1446
|
-
component:
|
|
1446
|
+
component: hr,
|
|
1447
1447
|
...e
|
|
1448
|
-
}),
|
|
1449
|
-
id:
|
|
1448
|
+
}), Sn = (e = {}) => ({
|
|
1449
|
+
id: Je,
|
|
1450
1450
|
label: "Terminal",
|
|
1451
1451
|
icon: De,
|
|
1452
|
-
component:
|
|
1452
|
+
component: Nr,
|
|
1453
1453
|
...e
|
|
1454
|
-
}),
|
|
1455
|
-
id:
|
|
1454
|
+
}), In = (e = {}) => ({
|
|
1455
|
+
id: Wt,
|
|
1456
1456
|
label: "Settings",
|
|
1457
|
-
icon:
|
|
1458
|
-
component:
|
|
1457
|
+
icon: Mt,
|
|
1458
|
+
component: yr,
|
|
1459
1459
|
align: "end",
|
|
1460
1460
|
...e
|
|
1461
|
-
}),
|
|
1461
|
+
}), kr = (e, t) => {
|
|
1462
1462
|
const r = t.toLowerCase();
|
|
1463
1463
|
return e.label.toLowerCase().includes(r) || e.id.toLowerCase().includes(r);
|
|
1464
|
-
},
|
|
1464
|
+
}, Er = ({
|
|
1465
1465
|
open: e,
|
|
1466
1466
|
commands: t,
|
|
1467
1467
|
onSelect: r,
|
|
1468
1468
|
onClose: n,
|
|
1469
1469
|
inline: s = !1,
|
|
1470
1470
|
placeholder: i = "Type a command to run…",
|
|
1471
|
-
filter: a =
|
|
1471
|
+
filter: a = kr,
|
|
1472
1472
|
className: u
|
|
1473
1473
|
}) => {
|
|
1474
1474
|
const [d, l] = $(""), [h, f] = $(0), m = K(null), N = j(
|
|
@@ -1572,7 +1572,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1572
1572
|
)
|
|
1573
1573
|
}
|
|
1574
1574
|
);
|
|
1575
|
-
},
|
|
1575
|
+
}, Ln = ({
|
|
1576
1576
|
shortcutKey: e = "p",
|
|
1577
1577
|
...t
|
|
1578
1578
|
}) => {
|
|
@@ -1584,7 +1584,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1584
1584
|
};
|
|
1585
1585
|
return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
|
|
1586
1586
|
}, [e]), /* @__PURE__ */ o(
|
|
1587
|
-
|
|
1587
|
+
Er,
|
|
1588
1588
|
{
|
|
1589
1589
|
...t,
|
|
1590
1590
|
open: r,
|
|
@@ -1595,15 +1595,15 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1595
1595
|
onClose: () => n(!1)
|
|
1596
1596
|
}
|
|
1597
1597
|
);
|
|
1598
|
-
}, Er = {
|
|
1599
|
-
alert: $t,
|
|
1600
|
-
confirm: Ct,
|
|
1601
|
-
prompt: Mt
|
|
1602
1598
|
}, Tr = {
|
|
1599
|
+
alert: Rt,
|
|
1600
|
+
confirm: $t,
|
|
1601
|
+
prompt: Ct
|
|
1602
|
+
}, Dr = {
|
|
1603
1603
|
alert: "text-destructive",
|
|
1604
1604
|
confirm: "text-amber-500",
|
|
1605
1605
|
prompt: "text-blue-500"
|
|
1606
|
-
},
|
|
1606
|
+
}, Sr = ({
|
|
1607
1607
|
open: e,
|
|
1608
1608
|
type: t = "alert",
|
|
1609
1609
|
title: r,
|
|
@@ -1633,7 +1633,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1633
1633
|
}, [e, a]), !e) return null;
|
|
1634
1634
|
const v = () => i == null ? void 0 : i(t === "prompt" ? f : void 0), p = (b) => {
|
|
1635
1635
|
b.key === "Enter" && (b.preventDefault(), v());
|
|
1636
|
-
}, x =
|
|
1636
|
+
}, x = Tr[t];
|
|
1637
1637
|
return /* @__PURE__ */ o(
|
|
1638
1638
|
"div",
|
|
1639
1639
|
{
|
|
@@ -1659,11 +1659,11 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1659
1659
|
onClick: a,
|
|
1660
1660
|
"aria-label": "Close",
|
|
1661
1661
|
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",
|
|
1662
|
-
children: /* @__PURE__ */ o(
|
|
1662
|
+
children: /* @__PURE__ */ o(J, { size: 18 })
|
|
1663
1663
|
}
|
|
1664
1664
|
),
|
|
1665
1665
|
/* @__PURE__ */ w("div", { className: "flex items-start space-x-4 mb-4", children: [
|
|
1666
|
-
/* @__PURE__ */ o("div", { className: A("p-2 bg-muted rounded-full shrink-0",
|
|
1666
|
+
/* @__PURE__ */ o("div", { className: A("p-2 bg-muted rounded-full shrink-0", Dr[t]), children: /* @__PURE__ */ o(x, { size: 24 }) }),
|
|
1667
1667
|
/* @__PURE__ */ w("div", { className: "flex-1 mt-1", children: [
|
|
1668
1668
|
/* @__PURE__ */ o("h2", { className: "text-lg font-semibold tracking-tight pr-6", children: r }),
|
|
1669
1669
|
n && /* @__PURE__ */ o("p", { className: "text-sm text-muted-foreground mt-1 whitespace-pre-wrap", children: n })
|
|
@@ -1707,10 +1707,10 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1707
1707
|
)
|
|
1708
1708
|
}
|
|
1709
1709
|
);
|
|
1710
|
-
},
|
|
1710
|
+
}, Pn = (e) => {
|
|
1711
1711
|
const { isOpen: t, type: r, title: n, message: s, defaultValue: i, close: a } = lt();
|
|
1712
1712
|
return /* @__PURE__ */ o(
|
|
1713
|
-
|
|
1713
|
+
Sr,
|
|
1714
1714
|
{
|
|
1715
1715
|
...e,
|
|
1716
1716
|
open: t,
|
|
@@ -1726,13 +1726,13 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1726
1726
|
}
|
|
1727
1727
|
}
|
|
1728
1728
|
);
|
|
1729
|
-
},
|
|
1729
|
+
}, Ir = me.map((e) => ({
|
|
1730
1730
|
id: e.id,
|
|
1731
1731
|
label: e.shortLabel
|
|
1732
|
-
})),
|
|
1732
|
+
})), Lr = ({
|
|
1733
1733
|
value: e,
|
|
1734
1734
|
onChange: t,
|
|
1735
|
-
options: r =
|
|
1735
|
+
options: r = Ir,
|
|
1736
1736
|
className: n,
|
|
1737
1737
|
"aria-label": s = "Theme"
|
|
1738
1738
|
}) => /* @__PURE__ */ o(
|
|
@@ -1759,10 +1759,10 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1759
1759
|
i.id
|
|
1760
1760
|
))
|
|
1761
1761
|
}
|
|
1762
|
-
),
|
|
1762
|
+
), An = (e) => {
|
|
1763
1763
|
const t = ce((n) => n.theme), r = ce((n) => n.setTheme);
|
|
1764
|
-
return /* @__PURE__ */ o(
|
|
1765
|
-
},
|
|
1764
|
+
return /* @__PURE__ */ o(Lr, { ...e, value: t, onChange: r });
|
|
1765
|
+
}, Pr = ({
|
|
1766
1766
|
profile: e,
|
|
1767
1767
|
actions: t = [],
|
|
1768
1768
|
onProfileChange: r,
|
|
@@ -1881,7 +1881,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1881
1881
|
onClick: () => v(!1),
|
|
1882
1882
|
className: "px-2 py-1 text-[10px] rounded hover:bg-accent text-muted-foreground flex items-center gap-1 border border-border/30",
|
|
1883
1883
|
children: [
|
|
1884
|
-
/* @__PURE__ */ o(
|
|
1884
|
+
/* @__PURE__ */ o(J, { size: 10 }),
|
|
1885
1885
|
" Cancel"
|
|
1886
1886
|
]
|
|
1887
1887
|
}
|
|
@@ -1892,7 +1892,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1892
1892
|
type: "submit",
|
|
1893
1893
|
className: "px-2 py-1 text-[10px] rounded bg-primary text-primary-foreground hover:bg-primary/95 flex items-center gap-1 font-semibold",
|
|
1894
1894
|
children: [
|
|
1895
|
-
/* @__PURE__ */ o(
|
|
1895
|
+
/* @__PURE__ */ o(Ft, { size: 10 }),
|
|
1896
1896
|
" Save"
|
|
1897
1897
|
]
|
|
1898
1898
|
}
|
|
@@ -1914,7 +1914,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1914
1914
|
),
|
|
1915
1915
|
children: [
|
|
1916
1916
|
M(24),
|
|
1917
|
-
n && /* @__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(
|
|
1917
|
+
n && /* @__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(Ot, { size: 14, className: "text-white" }) })
|
|
1918
1918
|
]
|
|
1919
1919
|
}
|
|
1920
1920
|
),
|
|
@@ -1929,7 +1929,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1929
1929
|
title: "Edit Profile",
|
|
1930
1930
|
"aria-label": "Edit Profile",
|
|
1931
1931
|
className: "p-1 text-muted-foreground hover:text-foreground hover:bg-accent/40 rounded transition-colors",
|
|
1932
|
-
children: /* @__PURE__ */ o(
|
|
1932
|
+
children: /* @__PURE__ */ o(zt, { size: 10 })
|
|
1933
1933
|
}
|
|
1934
1934
|
)
|
|
1935
1935
|
] }),
|
|
@@ -1964,10 +1964,10 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1964
1964
|
}
|
|
1965
1965
|
)
|
|
1966
1966
|
] });
|
|
1967
|
-
},
|
|
1967
|
+
}, Mn = (e) => {
|
|
1968
1968
|
const t = ne((l) => l.name), r = ne((l) => l.role), n = ne((l) => l.email), s = ne((l) => l.avatarUrl), i = ne((l) => l.customAvatar), a = ne((l) => l.updateProfile), u = ne((l) => l.setCustomAvatar);
|
|
1969
1969
|
return /* @__PURE__ */ o(
|
|
1970
|
-
|
|
1970
|
+
Pr,
|
|
1971
1971
|
{
|
|
1972
1972
|
...e,
|
|
1973
1973
|
profile: { name: t, role: r, email: n, avatarUrl: i || s },
|
|
@@ -1980,13 +1980,13 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
1980
1980
|
}
|
|
1981
1981
|
}
|
|
1982
1982
|
);
|
|
1983
|
-
},
|
|
1983
|
+
}, Cn = ({ title: e, subtitle: t, icon: r, className: n }) => /* @__PURE__ */ w("div", { className: A("flex items-center space-x-3 select-none", n), children: [
|
|
1984
1984
|
r && /* @__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: r }),
|
|
1985
1985
|
/* @__PURE__ */ w("div", { className: "min-w-0", children: [
|
|
1986
1986
|
/* @__PURE__ */ o("h1", { className: "text-xs font-black uppercase tracking-wider text-foreground font-mono truncate", children: e }),
|
|
1987
1987
|
t && /* @__PURE__ */ o("p", { className: "text-[9px] text-muted-foreground font-semibold truncate", children: t })
|
|
1988
1988
|
] })
|
|
1989
|
-
] }),
|
|
1989
|
+
] }), Ar = ({ x: e, y: t, items: r, onClose: n, className: s }) => {
|
|
1990
1990
|
const i = K(null);
|
|
1991
1991
|
return F(() => {
|
|
1992
1992
|
const a = (d) => {
|
|
@@ -2034,7 +2034,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2034
2034
|
] }, `${a.label}-${u}`))
|
|
2035
2035
|
}
|
|
2036
2036
|
);
|
|
2037
|
-
},
|
|
2037
|
+
}, $n = ({
|
|
2038
2038
|
columns: e,
|
|
2039
2039
|
data: t,
|
|
2040
2040
|
onRowClick: r,
|
|
@@ -2087,7 +2087,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2087
2087
|
r && r(g);
|
|
2088
2088
|
}
|
|
2089
2089
|
}
|
|
2090
|
-
}, P = (c) => c.sortable === !1 ? null : (m == null ? void 0 : m.key) !== c.key ? /* @__PURE__ */ o(
|
|
2090
|
+
}, P = (c) => c.sortable === !1 ? null : (m == null ? void 0 : m.key) !== c.key ? /* @__PURE__ */ o(_t, { size: 14, className: "text-muted-foreground/60 ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity" }) : m.direction === "asc" ? /* @__PURE__ */ o(Ye, { size: 14, className: "text-primary ml-1.5" }) : /* @__PURE__ */ o(qe, { size: 14, className: "text-primary ml-1.5" }), I = () => /* @__PURE__ */ o("tr", { role: "row", className: "border-b border-border bg-muted/30 select-none", children: e.map((c) => /* @__PURE__ */ o(
|
|
2091
2091
|
"th",
|
|
2092
2092
|
{
|
|
2093
2093
|
role: "columnheader",
|
|
@@ -2155,13 +2155,13 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2155
2155
|
);
|
|
2156
2156
|
}
|
|
2157
2157
|
}), []), y = () => u ? /* @__PURE__ */ w("div", { className: "flex flex-col items-center justify-center h-64 space-y-3", children: [
|
|
2158
|
-
/* @__PURE__ */ o(
|
|
2158
|
+
/* @__PURE__ */ o(Xe, { className: "animate-spin text-primary", size: 24 }),
|
|
2159
2159
|
/* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground", children: "Loading dataset..." })
|
|
2160
2160
|
] }) : k.length === 0 ? /* @__PURE__ */ w("div", { className: "flex flex-col items-center justify-center h-48 text-center px-4", children: [
|
|
2161
2161
|
/* @__PURE__ */ o("span", { className: "text-sm font-medium text-foreground", children: d }),
|
|
2162
2162
|
/* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground mt-1", children: "No items matched your search query." })
|
|
2163
2163
|
] }) : i ? /* @__PURE__ */ o("div", { className: "flex-1 min-h-[300px] h-full relative", children: /* @__PURE__ */ o(
|
|
2164
|
-
|
|
2164
|
+
Bt,
|
|
2165
2165
|
{
|
|
2166
2166
|
data: k,
|
|
2167
2167
|
context: {
|
|
@@ -2213,7 +2213,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2213
2213
|
onClick: () => f(""),
|
|
2214
2214
|
className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
|
|
2215
2215
|
"aria-label": "Clear filter",
|
|
2216
|
-
children: /* @__PURE__ */ o(
|
|
2216
|
+
children: /* @__PURE__ */ o(J, { size: 12 })
|
|
2217
2217
|
}
|
|
2218
2218
|
)
|
|
2219
2219
|
] }),
|
|
@@ -2228,7 +2228,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2228
2228
|
]
|
|
2229
2229
|
}
|
|
2230
2230
|
);
|
|
2231
|
-
},
|
|
2231
|
+
}, Rn = ({
|
|
2232
2232
|
results: e,
|
|
2233
2233
|
onQueryChange: t,
|
|
2234
2234
|
onSelect: r,
|
|
@@ -2305,7 +2305,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2305
2305
|
},
|
|
2306
2306
|
"aria-label": "Clear search",
|
|
2307
2307
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
|
|
2308
|
-
children: /* @__PURE__ */ o(
|
|
2308
|
+
children: /* @__PURE__ */ o(J, { size: 11 })
|
|
2309
2309
|
}
|
|
2310
2310
|
)
|
|
2311
2311
|
] }),
|
|
@@ -2380,7 +2380,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2380
2380
|
}
|
|
2381
2381
|
)
|
|
2382
2382
|
] });
|
|
2383
|
-
},
|
|
2383
|
+
}, Fn = ({
|
|
2384
2384
|
placeholder: e = "Search...",
|
|
2385
2385
|
onSearch: t,
|
|
2386
2386
|
results: r,
|
|
@@ -2404,7 +2404,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2404
2404
|
return /* @__PURE__ */ w("div", { ref: N, className: A("flex flex-col h-full bg-background", a), children: [
|
|
2405
2405
|
/* @__PURE__ */ w("div", { className: "p-3 border-b border-border/50", children: [
|
|
2406
2406
|
/* @__PURE__ */ w("div", { className: "relative", children: [
|
|
2407
|
-
/* @__PURE__ */ o("div", { className: "absolute left-2.5 top-2.5 text-muted-foreground", children: i ? /* @__PURE__ */ o(
|
|
2407
|
+
/* @__PURE__ */ o("div", { className: "absolute left-2.5 top-2.5 text-muted-foreground", children: i ? /* @__PURE__ */ o(Xe, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ o(xe, { size: 14 }) }),
|
|
2408
2408
|
/* @__PURE__ */ o(
|
|
2409
2409
|
"input",
|
|
2410
2410
|
{
|
|
@@ -2426,7 +2426,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2426
2426
|
d(""), t("");
|
|
2427
2427
|
},
|
|
2428
2428
|
className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
|
|
2429
|
-
children: /* @__PURE__ */ o(
|
|
2429
|
+
children: /* @__PURE__ */ o(J, { size: 14 })
|
|
2430
2430
|
}
|
|
2431
2431
|
)
|
|
2432
2432
|
] }),
|
|
@@ -2441,7 +2441,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2441
2441
|
d(x), h(!1);
|
|
2442
2442
|
},
|
|
2443
2443
|
children: [
|
|
2444
|
-
/* @__PURE__ */ o(
|
|
2444
|
+
/* @__PURE__ */ o(Kt, { size: 12, className: "text-muted-foreground" }),
|
|
2445
2445
|
/* @__PURE__ */ o("span", { children: x })
|
|
2446
2446
|
]
|
|
2447
2447
|
},
|
|
@@ -2470,11 +2470,11 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2470
2470
|
);
|
|
2471
2471
|
}) }) })
|
|
2472
2472
|
] });
|
|
2473
|
-
}, dt = (e, t = 0) => e.reduce((r, n) => (r.push({ ...n, level: t }), n.isOpen && n.children && r.push(...dt(n.children, t + 1)), r), []),
|
|
2473
|
+
}, dt = (e, t = 0) => e.reduce((r, n) => (r.push({ ...n, level: t }), n.isOpen && n.children && r.push(...dt(n.children, t + 1)), r), []), Mr = (e) => {
|
|
2474
2474
|
if (!e) return ["background"];
|
|
2475
2475
|
const t = [e.isBranch ? "branch" : "leaf"];
|
|
2476
2476
|
return e.kind && t.push(e.kind), t;
|
|
2477
|
-
},
|
|
2477
|
+
}, On = ({
|
|
2478
2478
|
data: e,
|
|
2479
2479
|
onToggle: t,
|
|
2480
2480
|
onActivate: r,
|
|
@@ -2500,7 +2500,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2500
2500
|
s.length !== 0 && (b.preventDefault(), b.stopPropagation(), h({
|
|
2501
2501
|
x: b.clientX,
|
|
2502
2502
|
y: b.clientY,
|
|
2503
|
-
scopes:
|
|
2503
|
+
scopes: Mr(k),
|
|
2504
2504
|
context: { nodeId: (k == null ? void 0 : k.id) ?? null, node: k }
|
|
2505
2505
|
}));
|
|
2506
2506
|
}, x = (b) => {
|
|
@@ -2539,7 +2539,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2539
2539
|
k.className
|
|
2540
2540
|
),
|
|
2541
2541
|
children: [
|
|
2542
|
-
/* @__PURE__ */ o("div", { className: "w-4 h-4 mr-1 flex items-center justify-center shrink-0", children: L && (k.isOpen ? /* @__PURE__ */ o(
|
|
2542
|
+
/* @__PURE__ */ o("div", { className: "w-4 h-4 mr-1 flex items-center justify-center shrink-0", children: L && (k.isOpen ? /* @__PURE__ */ o(qe, { size: 14 }) : /* @__PURE__ */ o(We, { size: 14 })) }),
|
|
2543
2543
|
k.icon && /* @__PURE__ */ o("div", { className: "mr-2 flex items-center shrink-0", children: k.icon }),
|
|
2544
2544
|
/* @__PURE__ */ o("span", { className: "truncate", children: k.label })
|
|
2545
2545
|
]
|
|
@@ -2556,7 +2556,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2556
2556
|
onContextMenu: (b) => p(b, null),
|
|
2557
2557
|
children: [
|
|
2558
2558
|
a ? /* @__PURE__ */ o(
|
|
2559
|
-
|
|
2559
|
+
Ht,
|
|
2560
2560
|
{
|
|
2561
2561
|
style: { height: "100%" },
|
|
2562
2562
|
totalCount: N.length,
|
|
@@ -2564,7 +2564,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2564
2564
|
}
|
|
2565
2565
|
) : /* @__PURE__ */ o("div", { className: "h-full overflow-auto", children: N.map((b, k) => x(k)) }),
|
|
2566
2566
|
l && v.length > 0 && /* @__PURE__ */ o(
|
|
2567
|
-
|
|
2567
|
+
Ar,
|
|
2568
2568
|
{
|
|
2569
2569
|
x: l.x,
|
|
2570
2570
|
y: l.y,
|
|
@@ -2583,13 +2583,13 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2583
2583
|
width: ((t = e.size) == null ? void 0 : t.width) ?? ge.width,
|
|
2584
2584
|
height: ((r = e.size) == null ? void 0 : r.height) ?? ge.height
|
|
2585
2585
|
};
|
|
2586
|
-
},
|
|
2586
|
+
}, V = (e) => ({
|
|
2587
2587
|
x: e.x + e.width / 2,
|
|
2588
2588
|
y: e.y + e.height / 2
|
|
2589
2589
|
}), Ne = (e, t) => ({
|
|
2590
2590
|
x: (e.x - t.x) / t.scale,
|
|
2591
2591
|
y: (e.y - t.y) / t.scale
|
|
2592
|
-
}),
|
|
2592
|
+
}), zn = (e, t) => ({
|
|
2593
2593
|
x: e.x * t.scale + t.x,
|
|
2594
2594
|
y: e.y * t.scale + t.y
|
|
2595
2595
|
}), _e = (e, t, r) => {
|
|
@@ -2600,7 +2600,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2600
2600
|
y: t.y - n.y * r
|
|
2601
2601
|
};
|
|
2602
2602
|
}, ke = (e, t = 0.1, r = 4) => Math.min(r, Math.max(t, e)), Ke = (e, t) => {
|
|
2603
|
-
const r =
|
|
2603
|
+
const r = V(e);
|
|
2604
2604
|
switch (t) {
|
|
2605
2605
|
case "top":
|
|
2606
2606
|
return { x: r.x, y: e.y };
|
|
@@ -2611,14 +2611,14 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2611
2611
|
case "right":
|
|
2612
2612
|
return { x: e.x + e.width, y: r.y };
|
|
2613
2613
|
}
|
|
2614
|
-
},
|
|
2615
|
-
const r =
|
|
2614
|
+
}, Cr = (e, t) => {
|
|
2615
|
+
const r = V(e), n = V(t), s = n.x - r.x, i = n.y - r.y;
|
|
2616
2616
|
return Math.abs(s) >= Math.abs(i) ? s >= 0 ? { source: "right", target: "left" } : { source: "left", target: "right" } : i >= 0 ? { source: "bottom", target: "top" } : { source: "top", target: "bottom" };
|
|
2617
2617
|
}, ft = (e) => {
|
|
2618
2618
|
if (e.length === 0) return null;
|
|
2619
2619
|
const t = e.map(Y), r = Math.min(...t.map((a) => a.x)), n = Math.min(...t.map((a) => a.y)), s = Math.max(...t.map((a) => a.x + a.width)), i = Math.max(...t.map((a) => a.y + a.height));
|
|
2620
2620
|
return { x: r, y: n, width: s - r, height: i - n };
|
|
2621
|
-
},
|
|
2621
|
+
}, $r = (e, t) => ({
|
|
2622
2622
|
// Written as a subtraction rather than `-viewport.x / scale` so a pan of zero
|
|
2623
2623
|
// yields +0 rather than -0, which otherwise leaks into equality checks.
|
|
2624
2624
|
x: (0 - e.x) / e.scale,
|
|
@@ -2629,7 +2629,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2629
2629
|
scale: r,
|
|
2630
2630
|
x: t.width / 2 - e.x * r,
|
|
2631
2631
|
y: t.height / 2 - e.y * r
|
|
2632
|
-
}),
|
|
2632
|
+
}), Rr = (e, t) => {
|
|
2633
2633
|
const r = Math.min(e.x, t.x), n = Math.min(e.y, t.y);
|
|
2634
2634
|
return {
|
|
2635
2635
|
x: r,
|
|
@@ -2637,7 +2637,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2637
2637
|
width: Math.max(e.x + e.width, t.x + t.width) - r,
|
|
2638
2638
|
height: Math.max(e.y + e.height, t.y + t.height) - n
|
|
2639
2639
|
};
|
|
2640
|
-
},
|
|
2640
|
+
}, Fr = (e, t, r = 48) => {
|
|
2641
2641
|
const n = ft(e);
|
|
2642
2642
|
if (!n || t.width === 0 || t.height === 0) return ut;
|
|
2643
2643
|
const s = ke(
|
|
@@ -2645,7 +2645,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2645
2645
|
(t.width - r * 2) / Math.max(n.width, 1),
|
|
2646
2646
|
(t.height - r * 2) / Math.max(n.height, 1)
|
|
2647
2647
|
)
|
|
2648
|
-
), i =
|
|
2648
|
+
), i = V(n);
|
|
2649
2649
|
return {
|
|
2650
2650
|
scale: s,
|
|
2651
2651
|
x: t.width / 2 - i.x * s,
|
|
@@ -2659,11 +2659,11 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2659
2659
|
}, we = (e, t, r) => {
|
|
2660
2660
|
const n = e.find((u) => u.id === t);
|
|
2661
2661
|
if (!n) return null;
|
|
2662
|
-
const s =
|
|
2662
|
+
const s = V(Y(n)), i = mt[r];
|
|
2663
2663
|
let a = null;
|
|
2664
2664
|
for (const u of e) {
|
|
2665
2665
|
if (u.id === t) continue;
|
|
2666
|
-
const d =
|
|
2666
|
+
const d = V(Y(u)), l = d.x - s.x, h = d.y - s.y, f = l * i.x + h * i.y;
|
|
2667
2667
|
if (f <= 0) continue;
|
|
2668
2668
|
const m = Math.abs(l * i.y - h * i.x);
|
|
2669
2669
|
if (m > f * 2) continue;
|
|
@@ -2671,7 +2671,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2671
2671
|
(!a || N < a.score) && (a = { node: u, score: N });
|
|
2672
2672
|
}
|
|
2673
2673
|
return (a == null ? void 0 : a.node) ?? null;
|
|
2674
|
-
},
|
|
2674
|
+
}, Or = (e, t, r, n = 64) => {
|
|
2675
2675
|
const s = e.find((l) => l.id === t);
|
|
2676
2676
|
if (!s) return { x: 0, y: 0 };
|
|
2677
2677
|
const i = Y(s), a = mt[r], u = {
|
|
@@ -2681,21 +2681,21 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2681
2681
|
let d = { x: i.x + u.x, y: i.y + u.y };
|
|
2682
2682
|
for (let l = 0; l < 24; l += 1) {
|
|
2683
2683
|
const h = { ...d, width: i.width, height: i.height };
|
|
2684
|
-
if (!e.some((m) =>
|
|
2684
|
+
if (!e.some((m) => zr(Y(m), h))) break;
|
|
2685
2685
|
d = a.x !== 0 ? { x: d.x, y: d.y + i.height + n } : { x: d.x + i.width + n, y: d.y };
|
|
2686
2686
|
}
|
|
2687
2687
|
return d;
|
|
2688
|
-
},
|
|
2688
|
+
}, zr = (e, t) => e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y, _n = (e, t) => e.filter((r) => r.source === t || r.target === t), Kn = (e, t, r) => e.some(
|
|
2689
2689
|
(n) => n.source === t && n.target === r || n.source === r && n.target === t
|
|
2690
|
-
),
|
|
2690
|
+
), Un = (e, t, r) => ({
|
|
2691
2691
|
nodes: e.filter((n) => n.id !== r),
|
|
2692
2692
|
edges: t.filter((n) => n.source !== r && n.target !== r)
|
|
2693
|
-
}),
|
|
2693
|
+
}), Bn = (e, t) => {
|
|
2694
2694
|
let r = t.length + 1;
|
|
2695
2695
|
const n = new Set(t.map((s) => s.id));
|
|
2696
2696
|
for (; n.has(`${e}-${r}`); ) r += 1;
|
|
2697
2697
|
return `${e}-${r}`;
|
|
2698
|
-
},
|
|
2698
|
+
}, _r = wt(
|
|
2699
2699
|
({
|
|
2700
2700
|
children: e,
|
|
2701
2701
|
overlay: t,
|
|
@@ -2718,12 +2718,12 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2718
2718
|
}, k) => {
|
|
2719
2719
|
const L = K(null), [D, P] = $(n), [I, M] = $(!1), [E, y] = $(!1), c = r ?? D, g = K(c);
|
|
2720
2720
|
g.current = c;
|
|
2721
|
-
const S =
|
|
2721
|
+
const S = q(
|
|
2722
2722
|
(T) => {
|
|
2723
2723
|
r || P(T), s == null || s(T);
|
|
2724
2724
|
},
|
|
2725
2725
|
[r, s]
|
|
2726
|
-
), C =
|
|
2726
|
+
), C = q((T) => {
|
|
2727
2727
|
var R;
|
|
2728
2728
|
const O = (R = L.current) == null ? void 0 : R.getBoundingClientRect();
|
|
2729
2729
|
return O ? { x: T.x - O.left, y: T.y - O.top } : T;
|
|
@@ -2789,7 +2789,7 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2789
2789
|
fitTo: (T, O) => {
|
|
2790
2790
|
var U;
|
|
2791
2791
|
const R = (U = L.current) == null ? void 0 : U.getBoundingClientRect();
|
|
2792
|
-
R && S(
|
|
2792
|
+
R && S(Fr(T, { width: R.width, height: R.height }, O));
|
|
2793
2793
|
},
|
|
2794
2794
|
zoomBy: (T) => {
|
|
2795
2795
|
var W;
|
|
@@ -2868,13 +2868,13 @@ const fr = /* @__PURE__ */ w("div", { className: "h-full flex flex-col items-cen
|
|
|
2868
2868
|
);
|
|
2869
2869
|
}
|
|
2870
2870
|
);
|
|
2871
|
-
|
|
2872
|
-
const
|
|
2871
|
+
_r.displayName = "GraphCanvas";
|
|
2872
|
+
const Kr = ["top", "right", "bottom", "left"], Ur = {
|
|
2873
2873
|
top: "left-1/2 -translate-x-1/2 -top-1.5",
|
|
2874
2874
|
bottom: "left-1/2 -translate-x-1/2 -bottom-1.5",
|
|
2875
2875
|
left: "top-1/2 -translate-y-1/2 -left-1.5",
|
|
2876
2876
|
right: "top-1/2 -translate-y-1/2 -right-1.5"
|
|
2877
|
-
},
|
|
2877
|
+
}, Hn = ({
|
|
2878
2878
|
node: e,
|
|
2879
2879
|
children: t,
|
|
2880
2880
|
onMove: r,
|
|
@@ -2894,7 +2894,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
2894
2894
|
const v = K(!1), p = ((k = e.size) == null ? void 0 : k.width) ?? ge.width, x = ((L = e.size) == null ? void 0 : L.height) ?? ge.height, b = (D) => {
|
|
2895
2895
|
if (!m || !r || D.button !== 0 || D.nativeEvent.shiftKey) return;
|
|
2896
2896
|
D.stopPropagation(), v.current = !1;
|
|
2897
|
-
const P = { x: D.clientX, y: D.clientY }, I = { ...e.position }, M =
|
|
2897
|
+
const P = { x: D.clientX, y: D.clientY }, I = { ...e.position }, M = Br(D.currentTarget);
|
|
2898
2898
|
let E = I;
|
|
2899
2899
|
const y = (g) => {
|
|
2900
2900
|
const S = (g.clientX - P.x) / M, C = (g.clientY - P.y) / M;
|
|
@@ -2941,7 +2941,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
2941
2941
|
),
|
|
2942
2942
|
children: [
|
|
2943
2943
|
t,
|
|
2944
|
-
f && u &&
|
|
2944
|
+
f && u && Kr.map((D) => /* @__PURE__ */ o(
|
|
2945
2945
|
"button",
|
|
2946
2946
|
{
|
|
2947
2947
|
type: "button",
|
|
@@ -2954,7 +2954,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
2954
2954
|
"absolute w-3 h-3 rounded-full border-2 border-background bg-primary",
|
|
2955
2955
|
"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-opacity",
|
|
2956
2956
|
h && "opacity-100",
|
|
2957
|
-
|
|
2957
|
+
Ur[D]
|
|
2958
2958
|
)
|
|
2959
2959
|
},
|
|
2960
2960
|
D
|
|
@@ -2962,7 +2962,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
2962
2962
|
]
|
|
2963
2963
|
}
|
|
2964
2964
|
);
|
|
2965
|
-
},
|
|
2965
|
+
}, Br = (e) => {
|
|
2966
2966
|
let t = e.parentElement;
|
|
2967
2967
|
for (; t; ) {
|
|
2968
2968
|
const r = window.getComputedStyle(t).transform;
|
|
@@ -2973,7 +2973,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
2973
2973
|
t = t.parentElement;
|
|
2974
2974
|
}
|
|
2975
2975
|
return 1;
|
|
2976
|
-
},
|
|
2976
|
+
}, Hr = (e, t, r, n) => {
|
|
2977
2977
|
if (n === "straight")
|
|
2978
2978
|
return `M ${e.x} ${e.y} L ${t.x} ${t.y}`;
|
|
2979
2979
|
const s = r === "left" || r === "right";
|
|
@@ -2983,7 +2983,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
2983
2983
|
}
|
|
2984
2984
|
const i = Math.hypot(t.x - e.x, t.y - e.y), a = Math.min(Math.max(i / 2, 24), 160), u = s ? { x: e.x + (r === "right" ? a : -a), y: e.y } : { x: e.x, y: e.y + (r === "bottom" ? a : -a) }, d = s ? { x: t.x - (r === "right" ? a : -a), y: t.y } : { x: t.x, y: t.y - (r === "bottom" ? a : -a) };
|
|
2985
2985
|
return `M ${e.x} ${e.y} C ${u.x} ${u.y}, ${d.x} ${d.y}, ${t.x} ${t.y}`;
|
|
2986
|
-
},
|
|
2986
|
+
}, jn = ({
|
|
2987
2987
|
edge: e,
|
|
2988
2988
|
source: t,
|
|
2989
2989
|
target: r,
|
|
@@ -2994,7 +2994,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
2994
2994
|
onContextMenu: u,
|
|
2995
2995
|
className: d
|
|
2996
2996
|
}) => {
|
|
2997
|
-
const l = Y(t), h = Y(r), f =
|
|
2997
|
+
const l = Y(t), h = Y(r), f = Cr(l, h), m = Ke(l, f.source), N = Ke(h, f.target), v = Hr(m, N, f.source, n), p = { x: (m.x + N.x) / 2, y: (m.y + N.y) / 2 }, x = !!(a || u);
|
|
2998
2998
|
return /* @__PURE__ */ w(
|
|
2999
2999
|
"g",
|
|
3000
3000
|
{
|
|
@@ -3037,7 +3037,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3037
3037
|
]
|
|
3038
3038
|
}
|
|
3039
3039
|
);
|
|
3040
|
-
},
|
|
3040
|
+
}, Wn = ({ children: e, className: t }) => /* @__PURE__ */ w(
|
|
3041
3041
|
"svg",
|
|
3042
3042
|
{
|
|
3043
3043
|
style: { position: "absolute", left: -5e4, top: -5e4, overflow: "visible" },
|
|
@@ -3062,7 +3062,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3062
3062
|
e
|
|
3063
3063
|
]
|
|
3064
3064
|
}
|
|
3065
|
-
),
|
|
3065
|
+
), Gn = {
|
|
3066
3066
|
/** Move focus to the nearest node in a direction. */
|
|
3067
3067
|
moveFocus: ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"],
|
|
3068
3068
|
/** Create a connected node in a direction. */
|
|
@@ -3077,12 +3077,12 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3077
3077
|
connect: "c",
|
|
3078
3078
|
/** Nudge the focused node. Held with the arrow keys. */
|
|
3079
3079
|
nudgeModifier: "shiftKey"
|
|
3080
|
-
},
|
|
3080
|
+
}, jr = {
|
|
3081
3081
|
ArrowUp: "up",
|
|
3082
3082
|
ArrowDown: "down",
|
|
3083
3083
|
ArrowLeft: "left",
|
|
3084
3084
|
ArrowRight: "right"
|
|
3085
|
-
},
|
|
3085
|
+
}, Yn = ({
|
|
3086
3086
|
nodes: e,
|
|
3087
3087
|
edges: t,
|
|
3088
3088
|
focusedId: r,
|
|
@@ -3099,7 +3099,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3099
3099
|
}) => {
|
|
3100
3100
|
const [N, v] = $(
|
|
3101
3101
|
n
|
|
3102
|
-
), [p, x] = $(null), [b, k] = $(null), L = r !== void 0 ? r : N, D =
|
|
3102
|
+
), [p, x] = $(null), [b, k] = $(null), L = r !== void 0 ? r : N, D = q(
|
|
3103
3103
|
(E) => {
|
|
3104
3104
|
r === void 0 && v(E), s == null || s(E);
|
|
3105
3105
|
},
|
|
@@ -3112,7 +3112,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3112
3112
|
connectingFrom: b
|
|
3113
3113
|
});
|
|
3114
3114
|
P.current = { nodes: e, edges: t, focusedId: L, editingId: p, connectingFrom: b };
|
|
3115
|
-
const I =
|
|
3115
|
+
const I = q(
|
|
3116
3116
|
(E) => {
|
|
3117
3117
|
const { nodes: y, focusedId: c } = P.current;
|
|
3118
3118
|
if (y.length === 0) return;
|
|
@@ -3124,11 +3124,11 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3124
3124
|
g && D(g.id);
|
|
3125
3125
|
},
|
|
3126
3126
|
[D]
|
|
3127
|
-
), M =
|
|
3127
|
+
), M = q(
|
|
3128
3128
|
(E = "right") => {
|
|
3129
3129
|
const { nodes: y, focusedId: c } = P.current;
|
|
3130
3130
|
if (!d) return;
|
|
3131
|
-
const g = c ?
|
|
3131
|
+
const g = c ? Or(y, c, E) : { x: 0, y: 0 }, S = d(g, { from: c ?? void 0, direction: E });
|
|
3132
3132
|
S && (c && (l == null || l(c, S)), D(S), x(S));
|
|
3133
3133
|
},
|
|
3134
3134
|
[d, l, D]
|
|
@@ -3145,7 +3145,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3145
3145
|
}
|
|
3146
3146
|
const _ = c.target;
|
|
3147
3147
|
if (_ != null && _.closest('input, textarea, select, [contenteditable="true"]')) return;
|
|
3148
|
-
const z =
|
|
3148
|
+
const z = jr[c.key];
|
|
3149
3149
|
if (z) {
|
|
3150
3150
|
c.preventDefault();
|
|
3151
3151
|
const H = P.current.nodes.find((T) => T.id === g);
|
|
@@ -3228,7 +3228,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3228
3228
|
}),
|
|
3229
3229
|
[L, D, p, b, I, M]
|
|
3230
3230
|
);
|
|
3231
|
-
},
|
|
3231
|
+
}, Xn = ({
|
|
3232
3232
|
nodes: e,
|
|
3233
3233
|
viewport: t,
|
|
3234
3234
|
canvasSize: r,
|
|
@@ -3242,9 +3242,9 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3242
3242
|
"aria-label": h = "Graph minimap",
|
|
3243
3243
|
className: f
|
|
3244
3244
|
}) => {
|
|
3245
|
-
const m = K(null), N = j(() => new Set(u ?? []), [u]), v =
|
|
3245
|
+
const m = K(null), N = j(() => new Set(u ?? []), [u]), v = $r(t, r), p = j(() => {
|
|
3246
3246
|
const y = ft(e);
|
|
3247
|
-
return y ?
|
|
3247
|
+
return y ? Rr(y, v) : v;
|
|
3248
3248
|
}, [e, v.x, v.y, v.width, v.height]), x = Math.min(
|
|
3249
3249
|
(s - d * 2) / Math.max(p.width, 1),
|
|
3250
3250
|
(i - d * 2) / Math.max(p.height, 1)
|
|
@@ -3257,7 +3257,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3257
3257
|
}), L = (y) => ({
|
|
3258
3258
|
x: (y.x - b.x) / x,
|
|
3259
3259
|
y: (y.y - b.y) / x
|
|
3260
|
-
}), D =
|
|
3260
|
+
}), D = q(
|
|
3261
3261
|
(y) => {
|
|
3262
3262
|
var S;
|
|
3263
3263
|
if (!n) return;
|
|
@@ -3285,7 +3285,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3285
3285
|
}[y.key];
|
|
3286
3286
|
if (!c) return;
|
|
3287
3287
|
y.preventDefault();
|
|
3288
|
-
const g =
|
|
3288
|
+
const g = V(v);
|
|
3289
3289
|
n(
|
|
3290
3290
|
Ue({ x: g.x + c.x, y: g.y + c.y }, r, t.scale)
|
|
3291
3291
|
);
|
|
@@ -3301,7 +3301,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3301
3301
|
ref: m,
|
|
3302
3302
|
role: E ? "slider" : "img",
|
|
3303
3303
|
"aria-label": h,
|
|
3304
|
-
"aria-valuetext": e.length === 0 ? "Empty graph" : `${e.length} nodes, viewing around ${Math.round(
|
|
3304
|
+
"aria-valuetext": e.length === 0 ? "Empty graph" : `${e.length} nodes, viewing around ${Math.round(V(v).x)}, ${Math.round(V(v).y)}`,
|
|
3305
3305
|
tabIndex: E ? 0 : void 0,
|
|
3306
3306
|
onPointerDown: P,
|
|
3307
3307
|
onKeyDown: I,
|
|
@@ -3347,7 +3347,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3347
3347
|
] })
|
|
3348
3348
|
}
|
|
3349
3349
|
);
|
|
3350
|
-
},
|
|
3350
|
+
}, Wr = (e, t) => {
|
|
3351
3351
|
const r = new Set(e.map((l) => l.id)), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
3352
3352
|
e.forEach((l) => {
|
|
3353
3353
|
n.set(l.id, []), s.set(l.id, 0);
|
|
@@ -3380,7 +3380,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3380
3380
|
align: s = "center"
|
|
3381
3381
|
} = {}) => (i, a) => {
|
|
3382
3382
|
if (i.length === 0) return i;
|
|
3383
|
-
const u =
|
|
3383
|
+
const u = Wr(i, a), d = e === "down" || e === "up", l = /* @__PURE__ */ new Map();
|
|
3384
3384
|
i.forEach((L) => {
|
|
3385
3385
|
const D = u.get(L.id) ?? 0, P = l.get(D) ?? [];
|
|
3386
3386
|
P.push(L), l.set(D, P);
|
|
@@ -3422,7 +3422,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3422
3422
|
const D = k.get(L.id);
|
|
3423
3423
|
return D ? { ...L, position: D } : L;
|
|
3424
3424
|
});
|
|
3425
|
-
},
|
|
3425
|
+
}, Gr = ({
|
|
3426
3426
|
columns: e,
|
|
3427
3427
|
spacingX: t = 48,
|
|
3428
3428
|
spacingY: r = 48,
|
|
@@ -3449,21 +3449,21 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3449
3449
|
y: n.y + h[Math.floor(m / i)]
|
|
3450
3450
|
}
|
|
3451
3451
|
}));
|
|
3452
|
-
},
|
|
3452
|
+
}, Yr = {
|
|
3453
3453
|
vertical: Be({ direction: "down" }),
|
|
3454
3454
|
horizontal: Be({ direction: "right" }),
|
|
3455
|
-
grid:
|
|
3456
|
-
}, pe = "freeform",
|
|
3455
|
+
grid: Gr()
|
|
3456
|
+
}, pe = "freeform", qn = ({
|
|
3457
3457
|
nodes: e,
|
|
3458
3458
|
edges: t,
|
|
3459
|
-
layouts: r =
|
|
3459
|
+
layouts: r = Yr,
|
|
3460
3460
|
mode: n,
|
|
3461
3461
|
defaultMode: s = pe,
|
|
3462
3462
|
onModeChange: i,
|
|
3463
3463
|
onNodeMove: a,
|
|
3464
3464
|
escapeOnDrag: u = !0
|
|
3465
3465
|
}) => {
|
|
3466
|
-
const [d, l] = $(s), h = n ?? d, f =
|
|
3466
|
+
const [d, l] = $(s), h = n ?? d, f = q(
|
|
3467
3467
|
(k) => {
|
|
3468
3468
|
n === void 0 && l(k), i == null || i(k);
|
|
3469
3469
|
},
|
|
@@ -3471,12 +3471,12 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3471
3471
|
), m = h === pe ? void 0 : r[h], N = !!m, v = j(
|
|
3472
3472
|
() => m ? m(e, t) : e,
|
|
3473
3473
|
[m, e, t]
|
|
3474
|
-
), p =
|
|
3474
|
+
), p = q(
|
|
3475
3475
|
(k, L) => {
|
|
3476
3476
|
N && u && f(pe), a == null || a(k, L);
|
|
3477
3477
|
},
|
|
3478
3478
|
[N, u, f, a]
|
|
3479
|
-
), x =
|
|
3479
|
+
), x = q(() => v, [v]), b = j(
|
|
3480
3480
|
// `freeform` is a mode, not a layout; registering one under that name would
|
|
3481
3481
|
// shadow the escape hatch, so it never appears here.
|
|
3482
3482
|
() => Object.keys(r).filter((k) => k !== pe),
|
|
@@ -3486,7 +3486,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3486
3486
|
() => ({ nodes: v, mode: h, setMode: f, available: b, isAuto: N, onMove: p, bake: x }),
|
|
3487
3487
|
[v, h, f, b, N, p, x]
|
|
3488
3488
|
);
|
|
3489
|
-
}, pt = "application/x-nexus-graph-node",
|
|
3489
|
+
}, pt = "application/x-nexus-graph-node", Vn = ({
|
|
3490
3490
|
items: e,
|
|
3491
3491
|
onSelect: t,
|
|
3492
3492
|
onDragStart: r,
|
|
@@ -3498,12 +3498,12 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3498
3498
|
}) => {
|
|
3499
3499
|
const d = K(null), [l, h] = $("horizontal"), f = n === "auto" ? l : n, m = K(s);
|
|
3500
3500
|
m.current = s;
|
|
3501
|
-
const N =
|
|
3501
|
+
const N = q(() => {
|
|
3502
3502
|
const p = d.current;
|
|
3503
3503
|
if (!p) return;
|
|
3504
3504
|
const x = [...p.querySelectorAll("[data-palette-item]")];
|
|
3505
3505
|
if (x.length === 0) return;
|
|
3506
|
-
const b = window.getComputedStyle(p), k = parseFloat(b.gap) || 0, L = (parseFloat(b.paddingLeft) || 0) + (parseFloat(b.paddingRight) || 0), D = x.reduce((y, c) => y + c.offsetWidth, 0) + k * (x.length - 1) + L, P = x.reduce((y, c) => y + c.offsetHeight, 0) + k * (x.length - 1) + L, I =
|
|
3506
|
+
const b = window.getComputedStyle(p), k = parseFloat(b.gap) || 0, L = (parseFloat(b.paddingLeft) || 0) + (parseFloat(b.paddingRight) || 0), D = x.reduce((y, c) => y + c.offsetWidth, 0) + k * (x.length - 1) + L, P = x.reduce((y, c) => y + c.offsetHeight, 0) + k * (x.length - 1) + L, I = Xr(p);
|
|
3507
3507
|
if (!I) return;
|
|
3508
3508
|
const M = 4, E = D <= I.width + M ? "horizontal" : P <= I.height + M ? "vertical" : "horizontal";
|
|
3509
3509
|
h((y) => {
|
|
@@ -3574,7 +3574,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3574
3574
|
t = t.parentElement;
|
|
3575
3575
|
}
|
|
3576
3576
|
return null;
|
|
3577
|
-
},
|
|
3577
|
+
}, Xr = (e) => {
|
|
3578
3578
|
const t = ht(e);
|
|
3579
3579
|
if (!t) return null;
|
|
3580
3580
|
const r = window.getComputedStyle(t), n = t.getBoundingClientRect();
|
|
@@ -3582,7 +3582,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3582
3582
|
width: n.width - (parseFloat(r.paddingLeft) || 0) - (parseFloat(r.paddingRight) || 0),
|
|
3583
3583
|
height: n.height - (parseFloat(r.paddingTop) || 0) - (parseFloat(r.paddingBottom) || 0)
|
|
3584
3584
|
};
|
|
3585
|
-
},
|
|
3585
|
+
}, Jn = (e) => e.dataTransfer.getData(pt) || null, Q = ({
|
|
3586
3586
|
label: e,
|
|
3587
3587
|
htmlFor: t,
|
|
3588
3588
|
description: r,
|
|
@@ -3610,7 +3610,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3610
3610
|
] }) : i,
|
|
3611
3611
|
r && !n && /* @__PURE__ */ o("p", { className: "text-[11px] text-muted-foreground/80 leading-snug", children: r }),
|
|
3612
3612
|
n && /* @__PURE__ */ o("p", { className: "text-[11px] text-destructive leading-snug", children: n })
|
|
3613
|
-
] }), se = "w-full rounded-md border bg-background px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/60 transition-colors focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/50 disabled:opacity-50 disabled:cursor-not-allowed", ae = (e) => e ? "border-destructive" : "border-border", te = (e, t = "") => `property-${e.toLowerCase().replace(/[^a-z0-9]+/g, "-")}${t}`, ie = "Mixed values",
|
|
3613
|
+
] }), se = "w-full rounded-md border bg-background px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground/60 transition-colors focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/50 disabled:opacity-50 disabled:cursor-not-allowed", ae = (e) => e ? "border-destructive" : "border-border", te = (e, t = "") => `property-${e.toLowerCase().replace(/[^a-z0-9]+/g, "-")}${t}`, ie = "Mixed values", qr = ({
|
|
3614
3614
|
label: e,
|
|
3615
3615
|
value: t,
|
|
3616
3616
|
onChange: r,
|
|
@@ -3646,7 +3646,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3646
3646
|
)
|
|
3647
3647
|
}
|
|
3648
3648
|
);
|
|
3649
|
-
},
|
|
3649
|
+
}, Vr = ({
|
|
3650
3650
|
label: e,
|
|
3651
3651
|
value: t,
|
|
3652
3652
|
onChange: r,
|
|
@@ -3682,7 +3682,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3682
3682
|
)
|
|
3683
3683
|
}
|
|
3684
3684
|
);
|
|
3685
|
-
},
|
|
3685
|
+
}, Jr = ({
|
|
3686
3686
|
label: e,
|
|
3687
3687
|
value: t,
|
|
3688
3688
|
onChange: r,
|
|
@@ -3720,7 +3720,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3720
3720
|
)
|
|
3721
3721
|
}
|
|
3722
3722
|
);
|
|
3723
|
-
},
|
|
3723
|
+
}, Qr = ({
|
|
3724
3724
|
label: e,
|
|
3725
3725
|
value: t,
|
|
3726
3726
|
onChange: r,
|
|
@@ -3757,7 +3757,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3757
3757
|
)
|
|
3758
3758
|
}
|
|
3759
3759
|
);
|
|
3760
|
-
},
|
|
3760
|
+
}, Zr = ({
|
|
3761
3761
|
label: e,
|
|
3762
3762
|
value: t,
|
|
3763
3763
|
onChange: r,
|
|
@@ -3806,7 +3806,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3806
3806
|
] })
|
|
3807
3807
|
}
|
|
3808
3808
|
);
|
|
3809
|
-
},
|
|
3809
|
+
}, en = ({
|
|
3810
3810
|
label: e,
|
|
3811
3811
|
value: t,
|
|
3812
3812
|
onChange: r,
|
|
@@ -3854,7 +3854,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3854
3854
|
] })
|
|
3855
3855
|
}
|
|
3856
3856
|
);
|
|
3857
|
-
},
|
|
3857
|
+
}, tn = ({
|
|
3858
3858
|
label: e,
|
|
3859
3859
|
value: t,
|
|
3860
3860
|
onChange: r,
|
|
@@ -3892,7 +3892,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3892
3892
|
)
|
|
3893
3893
|
}
|
|
3894
3894
|
);
|
|
3895
|
-
},
|
|
3895
|
+
}, rn = ({
|
|
3896
3896
|
label: e,
|
|
3897
3897
|
value: t,
|
|
3898
3898
|
onChange: r,
|
|
@@ -3935,7 +3935,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3935
3935
|
"aria-label": `Remove ${p}`,
|
|
3936
3936
|
onClick: () => r == null ? void 0 : r(N.filter((x) => x !== p)),
|
|
3937
3937
|
className: "text-muted-foreground hover:text-destructive",
|
|
3938
|
-
children: /* @__PURE__ */ o(
|
|
3938
|
+
children: /* @__PURE__ */ o(J, { size: 10 })
|
|
3939
3939
|
}
|
|
3940
3940
|
)
|
|
3941
3941
|
]
|
|
@@ -3967,7 +3967,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3967
3967
|
disabled: i || !h.trim(),
|
|
3968
3968
|
onClick: v,
|
|
3969
3969
|
className: "shrink-0 rounded-md border border-border px-2 text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40",
|
|
3970
|
-
children: /* @__PURE__ */ o(
|
|
3970
|
+
children: /* @__PURE__ */ o(Ut, { size: 13 })
|
|
3971
3971
|
}
|
|
3972
3972
|
)
|
|
3973
3973
|
] }),
|
|
@@ -3975,7 +3975,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3975
3975
|
]
|
|
3976
3976
|
}
|
|
3977
3977
|
);
|
|
3978
|
-
},
|
|
3978
|
+
}, nn = ({
|
|
3979
3979
|
label: e,
|
|
3980
3980
|
value: t,
|
|
3981
3981
|
description: r,
|
|
@@ -3992,7 +3992,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
3992
3992
|
),
|
|
3993
3993
|
children: n ? ie : t ?? "—"
|
|
3994
3994
|
}
|
|
3995
|
-
) }),
|
|
3995
|
+
) }), on = (e, t) => {
|
|
3996
3996
|
if (e != null)
|
|
3997
3997
|
return t.split(".").reduce(
|
|
3998
3998
|
(r, n) => r == null ? void 0 : r[n],
|
|
@@ -4009,15 +4009,15 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4009
4009
|
...i,
|
|
4010
4010
|
[n]: gt(u, s.join("."), r)
|
|
4011
4011
|
};
|
|
4012
|
-
}, Ee = (e, t) => t.get ? t.get(e) :
|
|
4012
|
+
}, Ee = (e, t) => t.get ? t.get(e) : on(e, t.key), sn = (e, t, r) => t.set ? t.set(e, r) : gt(e, t.key, r), an = (e, t) => {
|
|
4013
4013
|
if (e.length === 0) return { value: void 0, mixed: !1 };
|
|
4014
4014
|
const r = Ee(e[0], t);
|
|
4015
4015
|
return e.every((s) => Object.is(Ee(s, t), r)) ? { value: r, mixed: !1 } : { value: void 0, mixed: !0 };
|
|
4016
|
-
},
|
|
4017
|
-
(n) => Object.is(Ee(n, t), r) ? n :
|
|
4018
|
-
),
|
|
4016
|
+
}, ln = (e, t, r) => e.map(
|
|
4017
|
+
(n) => Object.is(Ee(n, t), r) ? n : sn(n, t, r)
|
|
4018
|
+
), cn = {
|
|
4019
4019
|
text: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
|
|
4020
|
-
|
|
4020
|
+
qr,
|
|
4021
4021
|
{
|
|
4022
4022
|
label: e.label,
|
|
4023
4023
|
description: e.description,
|
|
@@ -4030,7 +4030,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4030
4030
|
}
|
|
4031
4031
|
),
|
|
4032
4032
|
textarea: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
|
|
4033
|
-
|
|
4033
|
+
Vr,
|
|
4034
4034
|
{
|
|
4035
4035
|
label: e.label,
|
|
4036
4036
|
description: e.description,
|
|
@@ -4045,7 +4045,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4045
4045
|
select: ({ field: e, state: t, onChange: r, error: n }) => {
|
|
4046
4046
|
var s;
|
|
4047
4047
|
return /* @__PURE__ */ o(
|
|
4048
|
-
|
|
4048
|
+
Jr,
|
|
4049
4049
|
{
|
|
4050
4050
|
label: e.label,
|
|
4051
4051
|
description: e.description,
|
|
@@ -4060,7 +4060,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4060
4060
|
);
|
|
4061
4061
|
},
|
|
4062
4062
|
checkbox: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
|
|
4063
|
-
|
|
4063
|
+
Qr,
|
|
4064
4064
|
{
|
|
4065
4065
|
label: e.label,
|
|
4066
4066
|
description: e.description,
|
|
@@ -4073,7 +4073,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4073
4073
|
}
|
|
4074
4074
|
),
|
|
4075
4075
|
number: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
|
|
4076
|
-
|
|
4076
|
+
Zr,
|
|
4077
4077
|
{
|
|
4078
4078
|
label: e.label,
|
|
4079
4079
|
description: e.description,
|
|
@@ -4086,7 +4086,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4086
4086
|
}
|
|
4087
4087
|
),
|
|
4088
4088
|
color: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
|
|
4089
|
-
|
|
4089
|
+
en,
|
|
4090
4090
|
{
|
|
4091
4091
|
label: e.label,
|
|
4092
4092
|
description: e.description,
|
|
@@ -4099,7 +4099,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4099
4099
|
}
|
|
4100
4100
|
),
|
|
4101
4101
|
date: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
|
|
4102
|
-
|
|
4102
|
+
tn,
|
|
4103
4103
|
{
|
|
4104
4104
|
label: e.label,
|
|
4105
4105
|
description: e.description,
|
|
@@ -4112,7 +4112,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4112
4112
|
}
|
|
4113
4113
|
),
|
|
4114
4114
|
tags: ({ field: e, state: t, onChange: r, error: n }) => /* @__PURE__ */ o(
|
|
4115
|
-
|
|
4115
|
+
rn,
|
|
4116
4116
|
{
|
|
4117
4117
|
label: e.label,
|
|
4118
4118
|
description: e.description,
|
|
@@ -4125,7 +4125,7 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4125
4125
|
}
|
|
4126
4126
|
),
|
|
4127
4127
|
static: ({ field: e, state: t }) => /* @__PURE__ */ o(
|
|
4128
|
-
|
|
4128
|
+
nn,
|
|
4129
4129
|
{
|
|
4130
4130
|
label: e.label,
|
|
4131
4131
|
description: e.description,
|
|
@@ -4134,12 +4134,12 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4134
4134
|
...e.props
|
|
4135
4135
|
}
|
|
4136
4136
|
)
|
|
4137
|
-
},
|
|
4137
|
+
}, dn = /* @__PURE__ */ o("div", { className: "grid h-full place-items-center px-6 py-10 text-center", children: /* @__PURE__ */ o("p", { className: "text-xs text-muted-foreground", children: "Nothing selected. Choose an item to see its properties." }) }), Qn = ({
|
|
4138
4138
|
subjects: e,
|
|
4139
4139
|
fields: t,
|
|
4140
4140
|
onChange: r,
|
|
4141
|
-
fieldTypes: n =
|
|
4142
|
-
emptyState: s =
|
|
4141
|
+
fieldTypes: n = cn,
|
|
4142
|
+
emptyState: s = dn,
|
|
4143
4143
|
title: i,
|
|
4144
4144
|
groupOrder: a,
|
|
4145
4145
|
className: u,
|
|
@@ -4176,13 +4176,13 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4176
4176
|
m && /* @__PURE__ */ o("h3", { className: "border-b border-border/40 pb-1 text-[10px] font-bold uppercase tracking-widest text-muted-foreground/70", children: m }),
|
|
4177
4177
|
N.map((v) => {
|
|
4178
4178
|
var b;
|
|
4179
|
-
const p =
|
|
4179
|
+
const p = an(e, v), x = n[v.type ?? "text"];
|
|
4180
4180
|
return x ? /* @__PURE__ */ o(he.Fragment, { children: x({
|
|
4181
4181
|
field: v,
|
|
4182
4182
|
state: p,
|
|
4183
4183
|
subjects: e,
|
|
4184
4184
|
error: (b = v.validate) == null ? void 0 : b.call(v, p.value, e),
|
|
4185
|
-
onChange: (k) => r == null ? void 0 : r(
|
|
4185
|
+
onChange: (k) => r == null ? void 0 : r(ln(e, v, k), v, k)
|
|
4186
4186
|
}) }, v.key) : /* @__PURE__ */ w("p", { className: "text-[11px] text-destructive", children: [
|
|
4187
4187
|
"No renderer registered for field type “",
|
|
4188
4188
|
v.type,
|
|
@@ -4195,131 +4195,131 @@ const _r = ["top", "right", "bottom", "left"], Kr = {
|
|
|
4195
4195
|
);
|
|
4196
4196
|
};
|
|
4197
4197
|
export {
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4198
|
+
jt as ActivityBar,
|
|
4199
|
+
Cn as AppTitle,
|
|
4200
|
+
cn as BUILT_IN_FIELD_TYPES,
|
|
4201
|
+
Yr as BUILT_IN_LAYOUTS,
|
|
4202
4202
|
me as BUNDLED_THEMES,
|
|
4203
|
-
|
|
4204
|
-
|
|
4203
|
+
ir as BUNDLED_THEME_CLASSES,
|
|
4204
|
+
Ve as CHAT_PANEL_ID,
|
|
4205
4205
|
se as CONTROL_CLASS,
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4206
|
+
pr as ChatPane,
|
|
4207
|
+
Qr as CheckboxField,
|
|
4208
|
+
en as ColorField,
|
|
4209
|
+
Er as CommandPalette,
|
|
4210
|
+
er as CommandRegistry,
|
|
4211
|
+
hr as ConnectedChatPane,
|
|
4212
|
+
Ln as ConnectedCommandPalette,
|
|
4213
|
+
tr as ConnectedMenuBar,
|
|
4214
|
+
Pn as ConnectedModal,
|
|
4215
4215
|
be as ConnectedPane,
|
|
4216
4216
|
Ae as ConnectedPaneRail,
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4217
|
+
yr as ConnectedSettingsPanel,
|
|
4218
|
+
nr as ConnectedStatusBar,
|
|
4219
|
+
Nr as ConnectedTerminalPane,
|
|
4220
|
+
An as ConnectedThemeSwitcher,
|
|
4221
|
+
Mn as ConnectedUserProfile,
|
|
4222
|
+
Ar as ContextMenu,
|
|
4223
|
+
Nn as DEFAULT_COMMAND_IDS,
|
|
4224
|
+
Gn as DEFAULT_GRAPH_KEYS,
|
|
4225
4225
|
ge as DEFAULT_NODE_SIZE,
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4226
|
+
xr as DEFAULT_SETTINGS_THEMES,
|
|
4227
|
+
Ir as DEFAULT_THEME_OPTIONS,
|
|
4228
|
+
$n as DataGrid,
|
|
4229
|
+
tn as DateField,
|
|
4230
4230
|
pe as FREEFORM,
|
|
4231
4231
|
Q as FieldShell,
|
|
4232
4232
|
pt as GRAPH_NODE_MIME,
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4233
|
+
_r as GraphCanvas,
|
|
4234
|
+
jn as GraphEdge,
|
|
4235
|
+
Wn as GraphEdgeLayer,
|
|
4236
|
+
Xn as GraphMiniMap,
|
|
4237
|
+
Hn as GraphNode,
|
|
4238
4238
|
ut as IDENTITY_VIEWPORT,
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4239
|
+
Qt as MenuBar,
|
|
4240
|
+
Zt as MenuRegistry,
|
|
4241
|
+
Sr as Modal,
|
|
4242
|
+
wn as NexusWorkspaceShell,
|
|
4243
|
+
Vn as NodePalette,
|
|
4244
|
+
Zr as NumberField,
|
|
4245
4245
|
Qe as PANE_SIDES,
|
|
4246
4246
|
st as PaneHostProvider,
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4247
|
+
Qn as PropertyPanel,
|
|
4248
|
+
Rn as QuickSearch,
|
|
4249
|
+
Wt as SETTINGS_PANEL_ID,
|
|
4250
|
+
Fn as SearchWidget,
|
|
4251
|
+
Jr as SelectField,
|
|
4252
|
+
br as SettingsPanel,
|
|
4253
|
+
wn as ShellLayout,
|
|
4254
4254
|
Me as SidebarPane,
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4255
|
+
nn as StaticField,
|
|
4256
|
+
rr as StatusBar,
|
|
4257
|
+
Je as TERMINAL_PANEL_ID,
|
|
4258
|
+
rn as TagField,
|
|
4259
|
+
vr as TerminalPane,
|
|
4260
|
+
Vr as TextAreaField,
|
|
4261
|
+
qr as TextField,
|
|
4262
|
+
Lr as ThemeSwitcher,
|
|
4263
|
+
On as TreeWidget,
|
|
4264
|
+
Pr as UserProfile,
|
|
4265
4265
|
ae as borderClass,
|
|
4266
4266
|
Ue as centerOn,
|
|
4267
|
-
|
|
4267
|
+
Dn as chatPanel,
|
|
4268
4268
|
ke as clampScale,
|
|
4269
4269
|
A as cn,
|
|
4270
4270
|
oe as commandRegistry,
|
|
4271
4271
|
at as componentRegistry,
|
|
4272
4272
|
Se as createPaneStore,
|
|
4273
|
-
|
|
4274
|
-
|
|
4273
|
+
Hr as edgePath,
|
|
4274
|
+
_n as edgesOf,
|
|
4275
4275
|
te as fieldId,
|
|
4276
4276
|
we as findNeighbour,
|
|
4277
|
-
|
|
4278
|
-
|
|
4277
|
+
Fr as fitViewport,
|
|
4278
|
+
on as getPath,
|
|
4279
4279
|
ft as graphBounds,
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4280
|
+
Gr as gridLayout,
|
|
4281
|
+
kn as initializeShell,
|
|
4282
|
+
Kn as isConnected,
|
|
4283
4283
|
Be as layeredLayout,
|
|
4284
4284
|
Ie as menuRegistry,
|
|
4285
|
-
|
|
4285
|
+
Bn as nextId,
|
|
4286
4286
|
Y as nodeRect,
|
|
4287
4287
|
fe as paneStore,
|
|
4288
|
-
|
|
4289
|
-
|
|
4288
|
+
Or as placeRelativeTo,
|
|
4289
|
+
En as pluginRegistry,
|
|
4290
4290
|
Ke as portPoint,
|
|
4291
|
-
|
|
4291
|
+
Jn as readPaletteDrag,
|
|
4292
4292
|
Ee as readValue,
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4293
|
+
an as readValues,
|
|
4294
|
+
V as rectCenter,
|
|
4295
|
+
Un as removeNode,
|
|
4296
|
+
Cr as resolvePorts,
|
|
4297
4297
|
Ze as setPanels,
|
|
4298
4298
|
gt as setPath,
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4299
|
+
In as settingsPanel,
|
|
4300
|
+
Sn as terminalPanel,
|
|
4301
|
+
lr as themeClass,
|
|
4302
4302
|
Ne as toGraphSpace,
|
|
4303
|
-
|
|
4303
|
+
zn as toScreenSpace,
|
|
4304
4304
|
Fe as togglePanel,
|
|
4305
|
-
|
|
4306
|
-
|
|
4305
|
+
Rr as unionRect,
|
|
4306
|
+
Vt as useBottomPaneStore,
|
|
4307
4307
|
ue as useChatStore,
|
|
4308
|
-
|
|
4309
|
-
|
|
4308
|
+
Yn as useGraphKeyboard,
|
|
4309
|
+
qn as useGraphLayout,
|
|
4310
4310
|
ot as useHostChrome,
|
|
4311
|
-
|
|
4311
|
+
Tn as useKeyboardShortcuts,
|
|
4312
4312
|
it as useLayoutStore,
|
|
4313
|
-
|
|
4313
|
+
Xt as useLeftPaneStore,
|
|
4314
4314
|
lt as useModalStore,
|
|
4315
4315
|
nt as usePaneHost,
|
|
4316
|
-
|
|
4316
|
+
qt as useRightPaneStore,
|
|
4317
4317
|
Le as useStatusBarStore,
|
|
4318
4318
|
ve as useTerminalStore,
|
|
4319
4319
|
ce as useThemeStore,
|
|
4320
4320
|
ne as useUserProfileStore,
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4321
|
+
$r as viewportRect,
|
|
4322
|
+
sn as writeValue,
|
|
4323
|
+
ln as writeValues,
|
|
4324
4324
|
_e as zoomAt
|
|
4325
4325
|
};
|