@lincyaw/aegis-ui 0.11.0 → 0.12.0
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/agent/ask/AskPanel.cjs +1 -1
- package/dist/agent/ask/AskPanel.cjs.map +1 -1
- package/dist/agent/ask/AskPanel.js +25 -25
- package/dist/agent/ask/AskPanel.js.map +1 -1
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.ts +4 -2
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/CheckGrid.cjs +1 -1
- package/dist/components/ui/CheckGrid.cjs.map +1 -1
- package/dist/components/ui/CheckGrid.js +18 -17
- package/dist/components/ui/CheckGrid.js.map +1 -1
- package/dist/components/ui/CodeEditor.cjs +1 -1
- package/dist/components/ui/CodeEditor.cjs.map +1 -1
- package/dist/components/ui/CodeEditor.js +95 -87
- package/dist/components/ui/CodeEditor.js.map +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs.map +1 -1
- package/dist/components/ui/CommandInvocationCard.js +10 -10
- package/dist/components/ui/CommandInvocationCard.js.map +1 -1
- package/dist/components/ui/DangerZone.cjs +1 -1
- package/dist/components/ui/DangerZone.cjs.map +1 -1
- package/dist/components/ui/DangerZone.js +12 -12
- package/dist/components/ui/DangerZone.js.map +1 -1
- package/dist/components/ui/DataList.cjs +1 -1
- package/dist/components/ui/DataList.cjs.map +1 -1
- package/dist/components/ui/DataList.js +4 -3
- package/dist/components/ui/DataList.js.map +1 -1
- package/dist/components/ui/DataTable.cjs +1 -1
- package/dist/components/ui/DataTable.cjs.map +1 -1
- package/dist/components/ui/DataTable.d.ts +2 -1
- package/dist/components/ui/DataTable.js +125 -108
- package/dist/components/ui/DataTable.js.map +1 -1
- package/dist/components/ui/DiffViewer.cjs +1 -1
- package/dist/components/ui/DiffViewer.cjs.map +1 -1
- package/dist/components/ui/DiffViewer.js +29 -25
- package/dist/components/ui/DiffViewer.js.map +1 -1
- package/dist/components/ui/DropdownMenu.cjs.map +1 -1
- package/dist/components/ui/DropdownMenu.d.ts +1 -0
- package/dist/components/ui/DropdownMenu.js.map +1 -1
- package/dist/components/ui/FileDropzone.cjs +1 -1
- package/dist/components/ui/FileDropzone.cjs.map +1 -1
- package/dist/components/ui/FileDropzone.js +12 -12
- package/dist/components/ui/FileDropzone.js.map +1 -1
- package/dist/components/ui/FilePreview.cjs +1 -1
- package/dist/components/ui/FilePreview.cjs.map +1 -1
- package/dist/components/ui/FilePreview.js +16 -13
- package/dist/components/ui/FilePreview.js.map +1 -1
- package/dist/components/ui/ParetoChart.cjs +1 -1
- package/dist/components/ui/ParetoChart.cjs.map +1 -1
- package/dist/components/ui/ParetoChart.js +247 -212
- package/dist/components/ui/ParetoChart.js.map +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs.map +1 -1
- package/dist/components/ui/QueryAutocomplete.d.ts +4 -1
- package/dist/components/ui/QueryAutocomplete.js +136 -123
- package/dist/components/ui/QueryAutocomplete.js.map +1 -1
- package/dist/components/ui/RankBar.cjs +1 -1
- package/dist/components/ui/RankBar.cjs.map +1 -1
- package/dist/components/ui/RankBar.js +9 -9
- package/dist/components/ui/RankBar.js.map +1 -1
- package/dist/components/ui/ReplayStepStrip.cjs +1 -1
- package/dist/components/ui/ReplayStepStrip.cjs.map +1 -1
- package/dist/components/ui/ReplayStepStrip.d.ts +6 -3
- package/dist/components/ui/ReplayStepStrip.js +71 -61
- package/dist/components/ui/ReplayStepStrip.js.map +1 -1
- package/dist/components/ui/ServiceMap.cjs +1 -1
- package/dist/components/ui/ServiceMap.cjs.map +1 -1
- package/dist/components/ui/ServiceMap.d.ts +9 -1
- package/dist/components/ui/ServiceMap.js +333 -268
- package/dist/components/ui/ServiceMap.js.map +1 -1
- package/dist/components/ui/SparkLine.cjs +1 -1
- package/dist/components/ui/SparkLine.cjs.map +1 -1
- package/dist/components/ui/SparkLine.d.ts +5 -2
- package/dist/components/ui/SparkLine.js +33 -29
- package/dist/components/ui/SparkLine.js.map +1 -1
- package/dist/components/ui/TableOfContents.cjs +1 -1
- package/dist/components/ui/TableOfContents.cjs.map +1 -1
- package/dist/components/ui/TableOfContents.js +16 -19
- package/dist/components/ui/TableOfContents.js.map +1 -1
- package/dist/components/ui/Tabs.cjs +2 -2
- package/dist/components/ui/Tabs.cjs.map +1 -1
- package/dist/components/ui/Tabs.js +107 -87
- package/dist/components/ui/Tabs.js.map +1 -1
- package/dist/components/ui/TimeRangePicker.cjs +1 -1
- package/dist/components/ui/TimeRangePicker.cjs.map +1 -1
- package/dist/components/ui/TimeRangePicker.d.ts +12 -1
- package/dist/components/ui/TimeRangePicker.js +69 -63
- package/dist/components/ui/TimeRangePicker.js.map +1 -1
- package/dist/components/ui/Timeline.cjs.map +1 -1
- package/dist/components/ui/Timeline.d.ts +4 -4
- package/dist/components/ui/Timeline.js.map +1 -1
- package/dist/components/ui/TimelineChart.cjs +2 -2
- package/dist/components/ui/TimelineChart.cjs.map +1 -1
- package/dist/components/ui/TimelineChart.d.ts +1 -0
- package/dist/components/ui/TimelineChart.js +131 -137
- package/dist/components/ui/TimelineChart.js.map +1 -1
- package/dist/components/ui/TraceTree.cjs +1 -1
- package/dist/components/ui/TraceTree.cjs.map +1 -1
- package/dist/components/ui/TraceTree.d.ts +4 -0
- package/dist/components/ui/TraceTree.js +88 -87
- package/dist/components/ui/TraceTree.js.map +1 -1
- package/dist/components/ui/TrajectoryStep.cjs +2 -1
- package/dist/components/ui/TrajectoryStep.cjs.map +1 -1
- package/dist/components/ui/TrajectoryStep.js +64 -43
- package/dist/components/ui/TrajectoryStep.js.map +1 -1
- package/dist/components/ui/useColumnWidths.cjs +1 -1
- package/dist/components/ui/useColumnWidths.cjs.map +1 -1
- package/dist/components/ui/useColumnWidths.d.ts +6 -1
- package/dist/components/ui/useColumnWidths.js +139 -123
- package/dist/components/ui/useColumnWidths.js.map +1 -1
- package/dist/layouts/shell/AegisShell.cjs +1 -1
- package/dist/layouts/shell/AegisShell.cjs.map +1 -1
- package/dist/layouts/shell/AegisShell.js +33 -34
- package/dist/layouts/shell/AegisShell.js.map +1 -1
- package/dist/lib/breakAtSeparators.cjs +2 -0
- package/dist/lib/breakAtSeparators.cjs.map +1 -0
- package/dist/lib/breakAtSeparators.d.ts +6 -0
- package/dist/lib/breakAtSeparators.js +10 -0
- package/dist/lib/breakAtSeparators.js.map +1 -0
- package/dist/locale/strings.cjs +1 -1
- package/dist/locale/strings.cjs.map +1 -1
- package/dist/locale/strings.d.ts +6 -0
- package/dist/locale/strings.js +27 -19
- package/dist/locale/strings.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/antdTheme.cjs +1 -1
- package/dist/theme/antdTheme.cjs.map +1 -1
- package/dist/theme/antdTheme.js +50 -29
- package/dist/theme/antdTheme.js.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.js +66 -61
- package/dist/transports/agentm/AgentmChannelProvider.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { graphlib as
|
|
4
|
-
import { ReactFlowProvider as
|
|
5
|
-
import { useMediaQuery as
|
|
1
|
+
import { jsx as u, jsxs as P, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { useId as K, useState as re, useMemo as $, useCallback as I, useEffect as ce } from "react";
|
|
3
|
+
import { graphlib as le, layout as de } from "@dagrejs/dagre";
|
|
4
|
+
import { ReactFlowProvider as ge, Position as D, useReactFlow as Z, ReactFlow as pe, Background as ue, BackgroundVariant as me, Controls as fe, MiniMap as he, useStoreApi as ve, useStore as be, getViewportForBounds as W, Handle as Y } from "@xyflow/react";
|
|
5
|
+
import { useMediaQuery as _e } from "../../hooks/useMediaQuery.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { StatusDot as
|
|
8
|
-
import { useStrings as
|
|
9
|
-
const
|
|
10
|
-
"--aegis-service-map-node-w": `${String(
|
|
11
|
-
"--aegis-service-map-node-h": `${String(
|
|
12
|
-
"--aegis-service-map-node-max-w": `${String(
|
|
13
|
-
"--aegis-service-map-group-label-h": `${String(
|
|
14
|
-
},
|
|
15
|
-
function
|
|
16
|
-
const
|
|
7
|
+
import { StatusDot as we } from "./StatusDot.js";
|
|
8
|
+
import { useStrings as ye } from "../../locale/useStrings.js";
|
|
9
|
+
const C = 180, V = 64, xe = 320, Q = 28, Se = 64, Ne = {
|
|
10
|
+
"--aegis-service-map-node-w": `${String(C)}px`,
|
|
11
|
+
"--aegis-service-map-node-h": `${String(V)}px`,
|
|
12
|
+
"--aegis-service-map-node-max-w": `${String(xe)}px`,
|
|
13
|
+
"--aegis-service-map-group-label-h": `${String(Q)}px`
|
|
14
|
+
}, Me = { width: C, height: V };
|
|
15
|
+
function Ee(e, i, r, s) {
|
|
16
|
+
const n = e.map((o) => o.id), p = new Set(n);
|
|
17
17
|
return {
|
|
18
|
-
direction:
|
|
19
|
-
ids:
|
|
20
|
-
links:
|
|
21
|
-
groups:
|
|
18
|
+
direction: s,
|
|
19
|
+
ids: n,
|
|
20
|
+
links: i.filter((o) => p.has(o.source) && p.has(o.target)).map((o) => [o.source, o.target]),
|
|
21
|
+
groups: r
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
(
|
|
24
|
+
function Oe(e, i) {
|
|
25
|
+
const r = new Set(e), s = /* @__PURE__ */ new Set(), n = i.map((o) => {
|
|
26
|
+
const l = [...new Set(o.nodeIds)].filter(
|
|
27
|
+
(a) => r.has(a) && !s.has(a)
|
|
28
28
|
);
|
|
29
|
-
return
|
|
30
|
-
}),
|
|
31
|
-
return [...
|
|
29
|
+
return l.forEach((a) => s.add(a)), { group: o, ids: l };
|
|
30
|
+
}), p = e.filter((o) => !s.has(o));
|
|
31
|
+
return [...n, { ids: p }].filter((o) => o.ids.length > 0);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
rankdir:
|
|
33
|
+
function Le(e, i, r, s) {
|
|
34
|
+
const n = new le.Graph();
|
|
35
|
+
n.setDefaultEdgeLabel(() => ({})), n.setGraph({
|
|
36
|
+
rankdir: r,
|
|
37
37
|
nodesep: 40,
|
|
38
38
|
ranksep: 80,
|
|
39
39
|
marginx: 16,
|
|
40
40
|
marginy: 16
|
|
41
41
|
});
|
|
42
|
-
for (const
|
|
43
|
-
|
|
44
|
-
for (const [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
const { x:
|
|
50
|
-
return [
|
|
42
|
+
for (const a of e)
|
|
43
|
+
n.setNode(a, { ...s(a) });
|
|
44
|
+
for (const [a, t] of i)
|
|
45
|
+
n.hasNode(a) && n.hasNode(t) && n.setEdge(a, t);
|
|
46
|
+
de(n);
|
|
47
|
+
const p = new Map(
|
|
48
|
+
e.map((a) => {
|
|
49
|
+
const { x: t = 0, y: g = 0 } = n.node(a), m = s(a);
|
|
50
|
+
return [a, { x: t - m.width / 2, y: g - m.height / 2 }];
|
|
51
51
|
})
|
|
52
|
-
), { width:
|
|
53
|
-
return { positions:
|
|
52
|
+
), { width: o = 0, height: l = 0 } = n.graph();
|
|
53
|
+
return { positions: p, width: o, height: l };
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
const
|
|
55
|
+
function Re(e, i, r) {
|
|
56
|
+
const s = (t) => `${r}-group-${String(e.groups.indexOf(t))}`, n = e.direction === "LR", p = Oe(e.ids, e.groups).map((t) => {
|
|
57
|
+
const g = Le(t.ids, e.links, e.direction, (v) => i.get(v) ?? Me), m = t.group === void 0 ? 0 : Q;
|
|
58
58
|
return {
|
|
59
|
-
...
|
|
60
|
-
...
|
|
61
|
-
labelHeight:
|
|
62
|
-
boxHeight:
|
|
59
|
+
...t,
|
|
60
|
+
...g,
|
|
61
|
+
labelHeight: m,
|
|
62
|
+
boxHeight: g.height + m
|
|
63
63
|
};
|
|
64
|
-
}),
|
|
64
|
+
}), o = Math.max(
|
|
65
65
|
0,
|
|
66
|
-
...
|
|
66
|
+
...p.map((t) => n ? t.boxHeight : t.width)
|
|
67
67
|
);
|
|
68
|
-
let
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
return
|
|
68
|
+
let l = 0;
|
|
69
|
+
const a = p.map((t) => {
|
|
70
|
+
const g = n ? { x: l, y: (o - t.boxHeight) / 2 } : { x: (o - t.width) / 2, y: l };
|
|
71
|
+
return l += (n ? t.width : t.boxHeight) + Se, { ...t, origin: g };
|
|
72
72
|
});
|
|
73
73
|
return {
|
|
74
|
-
groups:
|
|
75
|
-
(
|
|
74
|
+
groups: a.flatMap(
|
|
75
|
+
(t) => t.group === void 0 ? [] : [
|
|
76
76
|
{
|
|
77
77
|
// Prefixed, so a group may share an id with a node.
|
|
78
|
-
id: `group:${
|
|
78
|
+
id: `group:${t.group.id}`,
|
|
79
79
|
type: "serviceGroup",
|
|
80
|
-
position:
|
|
81
|
-
width:
|
|
82
|
-
height:
|
|
80
|
+
position: t.origin,
|
|
81
|
+
width: t.width,
|
|
82
|
+
height: t.boxHeight,
|
|
83
83
|
data: {
|
|
84
|
-
label:
|
|
85
|
-
labelId:
|
|
84
|
+
label: t.group.label,
|
|
85
|
+
labelId: s(t.group)
|
|
86
86
|
},
|
|
87
87
|
// Not a group for assistive technology: the box contains no
|
|
88
88
|
// nodes in the DOM, so its label is plain text, which its
|
|
@@ -105,70 +105,82 @@ function Ee(t, s, n) {
|
|
|
105
105
|
]
|
|
106
106
|
),
|
|
107
107
|
positions: new Map(
|
|
108
|
-
|
|
109
|
-
(
|
|
110
|
-
|
|
108
|
+
a.flatMap(
|
|
109
|
+
(t) => [...t.positions].map(([g, m]) => [
|
|
110
|
+
g,
|
|
111
111
|
{
|
|
112
|
-
x:
|
|
113
|
-
y:
|
|
112
|
+
x: t.origin.x + m.x,
|
|
113
|
+
y: t.origin.y + t.labelHeight + m.y
|
|
114
114
|
}
|
|
115
115
|
])
|
|
116
116
|
)
|
|
117
117
|
),
|
|
118
118
|
groupLabels: new Map(
|
|
119
|
-
|
|
120
|
-
const { group:
|
|
121
|
-
return
|
|
119
|
+
a.flatMap((t) => {
|
|
120
|
+
const { group: g } = t;
|
|
121
|
+
return g === void 0 ? [] : t.ids.map((m) => [m, s(g)]);
|
|
122
122
|
})
|
|
123
123
|
)
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
data:
|
|
126
|
+
function $e({
|
|
127
|
+
data: e
|
|
128
128
|
}) {
|
|
129
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ u("div", { className: "aegis-service-map__group", children: /* @__PURE__ */ u("span", { id: e.labelId, className: "aegis-service-map__group-label", children: e.label }) });
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
const De = {
|
|
132
|
+
ok: "ink",
|
|
133
|
+
active: "ink",
|
|
134
|
+
warn: "caution",
|
|
135
|
+
error: "warning",
|
|
136
|
+
muted: "muted"
|
|
137
|
+
};
|
|
138
|
+
function Te({
|
|
139
|
+
data: e
|
|
133
140
|
}) {
|
|
134
|
-
const { node:
|
|
135
|
-
return /* @__PURE__ */
|
|
141
|
+
const { node: i, selected: r } = e, s = i.status ?? "ok", n = De[s];
|
|
142
|
+
return /* @__PURE__ */ P(
|
|
136
143
|
"div",
|
|
137
144
|
{
|
|
138
145
|
className: [
|
|
139
146
|
"aegis-service-map__node",
|
|
140
|
-
`aegis-service-map__node--${
|
|
141
|
-
|
|
147
|
+
`aegis-service-map__node--${s}`,
|
|
148
|
+
r ? "aegis-service-map__node--selected" : ""
|
|
142
149
|
].filter(Boolean).join(" "),
|
|
143
150
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
|
|
151
|
+
/* @__PURE__ */ u(
|
|
152
|
+
Y,
|
|
146
153
|
{
|
|
147
154
|
type: "target",
|
|
148
|
-
position:
|
|
155
|
+
position: D.Left,
|
|
149
156
|
className: "aegis-service-map__handle"
|
|
150
157
|
}
|
|
151
158
|
),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
159
|
+
/* @__PURE__ */ P("div", { className: "aegis-service-map__node-body", children: [
|
|
160
|
+
/* @__PURE__ */ P("div", { className: "aegis-service-map__node-label", children: [
|
|
161
|
+
/* @__PURE__ */ u(
|
|
162
|
+
we,
|
|
163
|
+
{
|
|
164
|
+
pulse: s === "active",
|
|
165
|
+
tone: r && n === "ink" ? "inverted" : n
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ u("span", { className: "aegis-service-map__node-label-text", children: i.label })
|
|
157
169
|
] }),
|
|
158
|
-
|
|
170
|
+
i.sublabel !== void 0 && /* @__PURE__ */ u("div", { className: "aegis-service-map__node-sublabel", children: i.sublabel })
|
|
159
171
|
] }),
|
|
160
|
-
|
|
172
|
+
i.badge !== void 0 && i.badge !== "" && /* @__PURE__ */ u(
|
|
161
173
|
"span",
|
|
162
174
|
{
|
|
163
|
-
className: `aegis-service-map__node-badge aegis-service-map__node-badge--${
|
|
164
|
-
children:
|
|
175
|
+
className: `aegis-service-map__node-badge aegis-service-map__node-badge--${s}`,
|
|
176
|
+
children: i.badge
|
|
165
177
|
}
|
|
166
178
|
),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
|
|
179
|
+
/* @__PURE__ */ u(
|
|
180
|
+
Y,
|
|
169
181
|
{
|
|
170
182
|
type: "source",
|
|
171
|
-
position:
|
|
183
|
+
position: D.Right,
|
|
172
184
|
className: "aegis-service-map__handle"
|
|
173
185
|
}
|
|
174
186
|
)
|
|
@@ -176,257 +188,310 @@ function $e({
|
|
|
176
188
|
}
|
|
177
189
|
);
|
|
178
190
|
}
|
|
179
|
-
function
|
|
180
|
-
const { sourceX:
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */ g
|
|
191
|
+
function Ae(e) {
|
|
192
|
+
const { sourceX: i, sourceY: r, targetX: s, targetY: n, label: p, markerEnd: o, style: l } = e, a = K(), t = (i + s) / 2, g = `M${i},${r} C${t},${r} ${t},${n} ${s},${n}`;
|
|
193
|
+
return /* @__PURE__ */ P(ne, { children: [
|
|
194
|
+
/* @__PURE__ */ u("path", { d: g, className: "aegis-service-map__edge-focus", fill: "none" }),
|
|
195
|
+
/* @__PURE__ */ u(
|
|
183
196
|
"path",
|
|
184
197
|
{
|
|
185
|
-
id:
|
|
186
|
-
d:
|
|
198
|
+
id: a,
|
|
199
|
+
d: g,
|
|
187
200
|
className: "aegis-service-map__edge-path",
|
|
188
|
-
markerEnd:
|
|
189
|
-
style:
|
|
201
|
+
markerEnd: o,
|
|
202
|
+
style: l,
|
|
190
203
|
fill: "none"
|
|
191
204
|
}
|
|
192
205
|
),
|
|
193
|
-
|
|
206
|
+
p !== void 0 && p !== "" && /* @__PURE__ */ u("text", { className: "aegis-service-map__edge-label", children: /* @__PURE__ */ u("textPath", { href: `#${a}`, startOffset: "50%", textAnchor: "middle", children: p }) })
|
|
194
207
|
] });
|
|
195
208
|
}
|
|
196
|
-
const
|
|
197
|
-
function
|
|
209
|
+
const He = { service: Te, serviceGroup: $e }, Ie = { service: Ae }, Pe = "(max-width: 768px)", O = 24, k = 0.1, F = 1, X = 11 / 13, z = 15, J = 28, q = 200, B = (e) => `${e}px`;
|
|
210
|
+
function Fe(e, i) {
|
|
198
211
|
return [
|
|
199
212
|
.../* @__PURE__ */ new Set([
|
|
200
|
-
|
|
201
|
-
...
|
|
202
|
-
...
|
|
213
|
+
e,
|
|
214
|
+
...i.filter(([r]) => r === e).map(([, r]) => r),
|
|
215
|
+
...i.filter(([, r]) => r === e).map(([r]) => r)
|
|
203
216
|
])
|
|
204
217
|
];
|
|
205
218
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
219
|
+
function Be(e) {
|
|
220
|
+
return e.type === "serviceGroup" ? "aegis-service-map__minimap-group" : "";
|
|
208
221
|
}
|
|
209
|
-
function
|
|
210
|
-
const { fitView:
|
|
211
|
-
() =>
|
|
212
|
-
[
|
|
222
|
+
function Ge(e, i, r, s, n, p) {
|
|
223
|
+
const { fitView: o, getNodes: l, getNodesBounds: a, setViewport: t } = Z(), g = ve(), m = be((f) => f.width > 0 && f.height > 0), v = $(
|
|
224
|
+
() => s !== void 0 && e.ids.includes(s) ? { id: s, near: Fe(s, e.links) } : void 0,
|
|
225
|
+
[s, e]
|
|
213
226
|
);
|
|
214
|
-
|
|
215
|
-
if (
|
|
216
|
-
const
|
|
217
|
-
top:
|
|
218
|
-
bottom:
|
|
219
|
-
left:
|
|
220
|
-
right:
|
|
221
|
-
|
|
227
|
+
ce(() => {
|
|
228
|
+
if (m && r) {
|
|
229
|
+
const f = {
|
|
230
|
+
top: B(O),
|
|
231
|
+
bottom: B(O),
|
|
232
|
+
left: B(z + J + O),
|
|
233
|
+
right: B(
|
|
234
|
+
n ? z + q + O : O
|
|
222
235
|
)
|
|
223
|
-
};
|
|
224
|
-
if (
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
}, { width: N, height: M } = g.getState();
|
|
237
|
+
if (v === void 0) {
|
|
238
|
+
const b = l(), _ = a(b), E = W(
|
|
239
|
+
_,
|
|
240
|
+
N,
|
|
241
|
+
M,
|
|
242
|
+
k,
|
|
243
|
+
1,
|
|
244
|
+
f
|
|
245
|
+
);
|
|
246
|
+
if (p && E.zoom < X) {
|
|
247
|
+
const x = X, T = e.direction === "LR", L = (y) => T ? y.position.x : y.position.y, w = b.filter((y) => y.type === "service").reduce((y, H) => L(H) < L(y) ? H : y), { width: A = C, height: G = V } = w.measured ?? {};
|
|
248
|
+
t(
|
|
249
|
+
T ? {
|
|
250
|
+
x: z + J + O - _.x * x,
|
|
251
|
+
y: M / 2 - (w.position.y + G / 2) * x,
|
|
252
|
+
zoom: x
|
|
253
|
+
} : {
|
|
254
|
+
x: N / 2 - (w.position.x + A / 2) * x,
|
|
255
|
+
y: O - _.y * x,
|
|
256
|
+
zoom: x
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
} else
|
|
260
|
+
o({ maxZoom: 1, padding: f });
|
|
261
|
+
} else {
|
|
262
|
+
const b = W(
|
|
263
|
+
a(v.near),
|
|
264
|
+
N,
|
|
265
|
+
M,
|
|
266
|
+
k,
|
|
267
|
+
F,
|
|
268
|
+
f
|
|
269
|
+
).zoom >= F;
|
|
270
|
+
o({
|
|
271
|
+
nodes: (b ? v.near : [v.id]).map((_) => ({ id: _ })),
|
|
272
|
+
minZoom: F,
|
|
273
|
+
maxZoom: F,
|
|
274
|
+
padding: f
|
|
240
275
|
});
|
|
241
276
|
}
|
|
242
277
|
}
|
|
243
278
|
}, [
|
|
244
|
-
|
|
245
|
-
n,
|
|
246
|
-
s,
|
|
247
|
-
e,
|
|
279
|
+
m,
|
|
248
280
|
r,
|
|
281
|
+
i,
|
|
282
|
+
v,
|
|
283
|
+
n,
|
|
249
284
|
p,
|
|
250
|
-
|
|
251
|
-
|
|
285
|
+
e.direction,
|
|
286
|
+
g,
|
|
287
|
+
o,
|
|
288
|
+
l,
|
|
289
|
+
a,
|
|
290
|
+
t
|
|
252
291
|
]);
|
|
253
292
|
}
|
|
254
|
-
function
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
293
|
+
function ze() {
|
|
294
|
+
const { getViewport: e, setViewport: i } = Z();
|
|
295
|
+
return I(
|
|
296
|
+
(r) => {
|
|
297
|
+
const s = r.target;
|
|
298
|
+
if (!(s instanceof Element) || !s.matches(
|
|
299
|
+
".react-flow__node:focus-visible, .react-flow__edge:focus-visible"
|
|
300
|
+
))
|
|
301
|
+
return;
|
|
302
|
+
const { scrollLeft: n, scrollTop: p } = r.currentTarget, o = r.currentTarget.getBoundingClientRect(), l = s.getBoundingClientRect(), a = l.left - o.left + n, t = l.top - o.top + p;
|
|
303
|
+
if (a >= 0 && t >= 0 && a + l.width <= o.width && t + l.height <= o.height)
|
|
304
|
+
return;
|
|
305
|
+
const { x: g, y: m, zoom: v } = e();
|
|
306
|
+
i({
|
|
307
|
+
x: g + o.width / 2 - (a + l.width / 2),
|
|
308
|
+
y: m + o.height / 2 - (t + l.height / 2),
|
|
309
|
+
zoom: v
|
|
310
|
+
});
|
|
311
|
+
},
|
|
312
|
+
[e, i]
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
function ke({
|
|
316
|
+
nodes: e,
|
|
317
|
+
edges: i,
|
|
318
|
+
groups: r = [],
|
|
319
|
+
direction: s = "LR",
|
|
320
|
+
height: n,
|
|
321
|
+
fillViewport: p = !1,
|
|
322
|
+
onNodeClick: o,
|
|
323
|
+
onEdgeClick: l,
|
|
324
|
+
selectedNodeId: a,
|
|
325
|
+
focusNodeId: t,
|
|
326
|
+
minimap: g = t === void 0,
|
|
327
|
+
ariaLabel: m,
|
|
328
|
+
className: v
|
|
268
329
|
}) {
|
|
269
|
-
const
|
|
330
|
+
const f = ye(), N = K(), M = `aegis-service-map${N.replace(/:/g, "-")}`, b = o !== void 0, _ = l !== void 0, [E, x] = re(
|
|
270
331
|
() => /* @__PURE__ */ new Map()
|
|
271
|
-
), T =
|
|
272
|
-
() => JSON.stringify(
|
|
273
|
-
[
|
|
274
|
-
),
|
|
275
|
-
() =>
|
|
276
|
-
[
|
|
277
|
-
),
|
|
332
|
+
), T = $(
|
|
333
|
+
() => JSON.stringify(Ee(e, i, r, s)),
|
|
334
|
+
[e, i, r, s]
|
|
335
|
+
), L = $(() => JSON.parse(T), [T]), w = $(
|
|
336
|
+
() => Re(L, E, N),
|
|
337
|
+
[L, E, N]
|
|
338
|
+
), A = s === "LR", G = $(
|
|
278
339
|
() => [
|
|
279
|
-
...
|
|
280
|
-
...
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
340
|
+
...w.groups,
|
|
341
|
+
...e.map((d) => {
|
|
342
|
+
const c = [
|
|
343
|
+
w.groupLabels.get(d.id),
|
|
344
|
+
b ? `react-flow__node-desc-${M}` : void 0
|
|
284
345
|
].filter(Boolean).join(" ");
|
|
285
346
|
return {
|
|
286
347
|
id: d.id,
|
|
287
348
|
type: "service",
|
|
288
|
-
position:
|
|
349
|
+
position: w.positions.get(d.id) ?? { x: 0, y: 0 },
|
|
289
350
|
// Handed back as applyNodeChanges would, so React Flow keeps the
|
|
290
351
|
// size it measured instead of measuring the node again.
|
|
291
|
-
measured:
|
|
352
|
+
measured: E.get(d.id),
|
|
292
353
|
ariaLabel: d.label,
|
|
293
354
|
// React Flow gives only a focusable node a role, and the role
|
|
294
355
|
// description below needs one.
|
|
295
356
|
ariaRole: "group",
|
|
296
357
|
domAttributes: {
|
|
297
|
-
"aria-roledescription":
|
|
358
|
+
"aria-roledescription": f.serviceMapNodeRole,
|
|
298
359
|
// A group takes no aria-selected.
|
|
299
|
-
"aria-current":
|
|
300
|
-
"aria-describedby":
|
|
360
|
+
"aria-current": a === d.id ? !0 : void 0,
|
|
361
|
+
"aria-describedby": c === "" ? void 0 : c
|
|
301
362
|
},
|
|
302
|
-
data: { node: d, selected:
|
|
303
|
-
sourcePosition:
|
|
304
|
-
targetPosition:
|
|
363
|
+
data: { node: d, selected: a === d.id },
|
|
364
|
+
sourcePosition: A ? D.Right : D.Bottom,
|
|
365
|
+
targetPosition: A ? D.Left : D.Top,
|
|
305
366
|
draggable: !1,
|
|
306
367
|
connectable: !1,
|
|
307
|
-
selectable:
|
|
308
|
-
focusable:
|
|
368
|
+
selectable: b,
|
|
369
|
+
focusable: b
|
|
309
370
|
};
|
|
310
371
|
})
|
|
311
372
|
],
|
|
312
373
|
[
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
374
|
+
w,
|
|
375
|
+
e,
|
|
376
|
+
E,
|
|
377
|
+
a,
|
|
378
|
+
A,
|
|
379
|
+
b,
|
|
380
|
+
M,
|
|
381
|
+
f
|
|
321
382
|
]
|
|
322
|
-
),
|
|
323
|
-
const d = new Map(
|
|
324
|
-
return
|
|
325
|
-
id:
|
|
326
|
-
source:
|
|
327
|
-
target:
|
|
328
|
-
ariaLabel:
|
|
329
|
-
d.get(
|
|
330
|
-
d.get(
|
|
383
|
+
), y = $(() => {
|
|
384
|
+
const d = new Map(e.map((c) => [c.id, c.label]));
|
|
385
|
+
return i.map((c) => ({
|
|
386
|
+
id: c.id,
|
|
387
|
+
source: c.source,
|
|
388
|
+
target: c.target,
|
|
389
|
+
ariaLabel: f.serviceMapEdgeName(
|
|
390
|
+
d.get(c.source) ?? c.source,
|
|
391
|
+
d.get(c.target) ?? c.target
|
|
331
392
|
),
|
|
332
|
-
domAttributes: { "aria-roledescription":
|
|
393
|
+
domAttributes: { "aria-roledescription": f.serviceMapEdgeRole },
|
|
333
394
|
type: "service",
|
|
334
|
-
data: { edge:
|
|
335
|
-
label:
|
|
336
|
-
selectable:
|
|
337
|
-
focusable:
|
|
338
|
-
className: `aegis-service-map__edge aegis-service-map__edge--${
|
|
395
|
+
data: { edge: c },
|
|
396
|
+
label: c.label,
|
|
397
|
+
selectable: _,
|
|
398
|
+
focusable: _,
|
|
399
|
+
className: `aegis-service-map__edge aegis-service-map__edge--${c.status ?? "ok"}`
|
|
339
400
|
}));
|
|
340
|
-
}, [
|
|
401
|
+
}, [e, i, _, f]), { getNode: H } = Z(), ee = I(
|
|
341
402
|
(d) => {
|
|
342
|
-
const
|
|
343
|
-
(
|
|
403
|
+
const c = d.flatMap(
|
|
404
|
+
(h) => h.type === "dimensions" && h.dimensions !== void 0 && H(h.id)?.type === "service" ? [[h.id, h.dimensions]] : []
|
|
344
405
|
);
|
|
345
|
-
|
|
346
|
-
(
|
|
347
|
-
([
|
|
348
|
-
) ?
|
|
406
|
+
x(
|
|
407
|
+
(h) => c.every(
|
|
408
|
+
([S, R]) => h.get(S)?.width === R.width && h.get(S)?.height === R.height
|
|
409
|
+
) ? h : new Map([...h, ...c])
|
|
349
410
|
);
|
|
350
411
|
},
|
|
351
|
-
[
|
|
352
|
-
),
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
412
|
+
[H]
|
|
413
|
+
), j = _e(Pe), U = g && !j;
|
|
414
|
+
Ge(
|
|
415
|
+
L,
|
|
416
|
+
w,
|
|
417
|
+
e.every((d) => E.has(d.id)),
|
|
418
|
+
t,
|
|
419
|
+
U,
|
|
420
|
+
j
|
|
359
421
|
);
|
|
360
|
-
const
|
|
361
|
-
(d,
|
|
362
|
-
|
|
422
|
+
const te = ze(), oe = I(
|
|
423
|
+
(d, c) => {
|
|
424
|
+
c.type === "service" && o?.(c.data.node);
|
|
363
425
|
},
|
|
364
|
-
[
|
|
365
|
-
),
|
|
366
|
-
(d,
|
|
367
|
-
|
|
426
|
+
[o]
|
|
427
|
+
), ie = I(
|
|
428
|
+
(d, c) => {
|
|
429
|
+
c.data && l?.(c.data.edge);
|
|
368
430
|
},
|
|
369
|
-
[
|
|
370
|
-
),
|
|
431
|
+
[l]
|
|
432
|
+
), se = I(
|
|
371
433
|
(d) => {
|
|
372
434
|
if (d.key !== "Enter" && d.key !== " " || d.repeat)
|
|
373
435
|
return;
|
|
374
|
-
const
|
|
375
|
-
if (!(
|
|
436
|
+
const c = d.target;
|
|
437
|
+
if (!(c instanceof Element))
|
|
376
438
|
return;
|
|
377
|
-
const
|
|
378
|
-
if (
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
} else if (
|
|
382
|
-
const
|
|
383
|
-
|
|
439
|
+
const h = c.getAttribute("data-id");
|
|
440
|
+
if (c.classList.contains("react-flow__node")) {
|
|
441
|
+
const S = e.find((R) => R.id === h);
|
|
442
|
+
S && o && (d.preventDefault(), o(S));
|
|
443
|
+
} else if (c.classList.contains("react-flow__edge")) {
|
|
444
|
+
const S = i.find((R) => R.id === h);
|
|
445
|
+
S && l && (d.preventDefault(), l(S));
|
|
384
446
|
}
|
|
385
447
|
},
|
|
386
|
-
[
|
|
387
|
-
),
|
|
388
|
-
...
|
|
389
|
-
height:
|
|
448
|
+
[e, i, o, l]
|
|
449
|
+
), ae = {
|
|
450
|
+
...Ne,
|
|
451
|
+
height: n === void 0 ? void 0 : `${String(n)}px`
|
|
390
452
|
};
|
|
391
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ u(
|
|
392
454
|
"div",
|
|
393
455
|
{
|
|
394
456
|
className: [
|
|
395
457
|
"aegis-service-map",
|
|
396
|
-
|
|
397
|
-
|
|
458
|
+
p ? "aegis-service-map--fill-viewport" : "",
|
|
459
|
+
v
|
|
398
460
|
].filter(Boolean).join(" "),
|
|
399
|
-
style:
|
|
400
|
-
children: /* @__PURE__ */
|
|
401
|
-
|
|
461
|
+
style: ae,
|
|
462
|
+
children: /* @__PURE__ */ u("div", { className: "aegis-service-map__pane", children: /* @__PURE__ */ P(
|
|
463
|
+
pe,
|
|
402
464
|
{
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
465
|
+
id: M,
|
|
466
|
+
"aria-label": m,
|
|
467
|
+
nodes: G,
|
|
468
|
+
edges: y,
|
|
469
|
+
nodeTypes: He,
|
|
470
|
+
edgeTypes: Ie,
|
|
471
|
+
minZoom: k,
|
|
409
472
|
nodesDraggable: !1,
|
|
410
473
|
nodesConnectable: !1,
|
|
474
|
+
autoPanOnNodeFocus: !1,
|
|
411
475
|
panOnDrag: !0,
|
|
412
476
|
zoomOnScroll: !0,
|
|
413
477
|
proOptions: { hideAttribution: !0 },
|
|
414
|
-
ariaLabelConfig:
|
|
415
|
-
onNodesChange:
|
|
416
|
-
onNodeClick:
|
|
417
|
-
onEdgeClick:
|
|
418
|
-
onKeyDown:
|
|
478
|
+
ariaLabelConfig: f.serviceMapAriaLabels,
|
|
479
|
+
onNodesChange: ee,
|
|
480
|
+
onNodeClick: b ? oe : void 0,
|
|
481
|
+
onEdgeClick: _ ? ie : void 0,
|
|
482
|
+
onKeyDown: se,
|
|
483
|
+
onFocus: te,
|
|
419
484
|
children: [
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
|
|
423
|
-
|
|
485
|
+
/* @__PURE__ */ u(ue, { variant: me.Dots, gap: 16, size: 1 }),
|
|
486
|
+
/* @__PURE__ */ u(fe, { showInteractive: !1, position: "top-left" }),
|
|
487
|
+
U && /* @__PURE__ */ u(
|
|
488
|
+
he,
|
|
424
489
|
{
|
|
425
490
|
pannable: !0,
|
|
426
491
|
zoomable: !0,
|
|
427
492
|
position: "bottom-right",
|
|
428
|
-
style: { width:
|
|
429
|
-
nodeClassName:
|
|
493
|
+
style: { width: q },
|
|
494
|
+
nodeClassName: Be
|
|
430
495
|
}
|
|
431
496
|
)
|
|
432
497
|
]
|
|
@@ -435,10 +500,10 @@ function Ge({
|
|
|
435
500
|
}
|
|
436
501
|
);
|
|
437
502
|
}
|
|
438
|
-
function
|
|
439
|
-
return /* @__PURE__ */
|
|
503
|
+
function Je(e) {
|
|
504
|
+
return /* @__PURE__ */ u(ge, { children: /* @__PURE__ */ u(ke, { ...e }) });
|
|
440
505
|
}
|
|
441
506
|
export {
|
|
442
|
-
|
|
507
|
+
Je as ServiceMap
|
|
443
508
|
};
|
|
444
509
|
//# sourceMappingURL=ServiceMap.js.map
|