@peasant-labs/fairtrade 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/THIRD_PARTY_NOTICES.md +31 -0
- package/dist/lib/{InUseShell-CY5Acw6t.js → GraphLegend-BB0V2w59.js} +780 -558
- package/dist/lib/commons.js +139 -139
- package/dist/lib/components.css +1 -1
- package/dist/lib/graph.css +1 -1
- package/dist/lib/graph.js +921 -359
- package/dist/lib/types/BrandMark.d.ts +2 -2
- package/dist/lib/types/commons/providers.d.ts +1 -1
- package/dist/lib/types/graph/index.d.ts +16 -0
- package/dist/lib/types/provider-policy.d.ts +2 -2
- package/dist/lib/types/transcript/OutcomeChip.d.ts +18 -0
- package/dist/lib/types/transcript/UsageDisclosure.d.ts +8 -0
- package/dist/lib/types/transcript/analytics.d.ts +3 -6
- package/dist/lib/types/transcript/graph/engine/GraphControls.d.ts +13 -0
- package/dist/lib/types/transcript/graph/engine/TrajectoryGraph.d.ts +18 -0
- package/dist/lib/types/transcript/graph/engine/TrajectoryGraphLegend.d.ts +18 -0
- package/dist/lib/types/transcript/graph/engine/constants.d.ts +37 -0
- package/dist/lib/types/transcript/graph/engine/index.d.ts +23 -0
- package/dist/lib/types/transcript/graph/engine/nodes/SubagentBranchNode.d.ts +11 -0
- package/dist/lib/types/transcript/graph/engine/nodes/ToolPillNode.d.ts +11 -0
- package/dist/lib/types/transcript/graph/engine/nodes/TurnCardNode.d.ts +11 -0
- package/dist/lib/types/transcript/graph/engine/turnsToFlow.d.ts +47 -0
- package/dist/lib/types/transcript/graph/engine/types.d.ts +131 -0
- package/dist/lib/types/transcript/graph/engine/useCanvasSync.d.ts +17 -0
- package/dist/lib/types/transcript/index.d.ts +5 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +2 -1
- package/dist/lib/types/transcript/time.d.ts +22 -0
- package/dist/lib/types/transcript/title.d.ts +48 -0
- package/dist/lib/types/transcript/turnNav.d.ts +9 -0
- package/dist/lib/types/transcript/usage.d.ts +19 -0
- package/dist/lib/types/transcript/view-model.d.ts +61 -0
- package/dist/lib/{ui-yIg-1YXY.js → ui-DkPbLhcp.js} +2872 -2731
- package/dist/lib/ui.js +4 -4
- package/package.json +29 -8
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { Fragment as e, useCallback as t, useEffect as n, useId as r, useLayoutEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
2
2
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
3
|
-
import { Check as d, ChevronDown as f, ChevronLeft as p, ChevronRight as m, Eye as h, EyeOff as g, FileCode as
|
|
4
|
-
import { AllChangeBindings as
|
|
3
|
+
import { Check as d, ChevronDown as f, ChevronLeft as p, ChevronRight as m, Eye as h, EyeOff as g, FileCode as _, Folder as v, GitMerge as y, Maximize as b, Minus as x, Plus as S, ScrollText as C, Search as ee, Star as te, TriangleAlert as ne, Users as re, Waypoints as ie } from "lucide-react";
|
|
4
|
+
import { AllChangeBindings as ae, AllDiffLineKinds as w, AllEdgeViolationKinds as oe, AllFileChangeStatuses as se, AllInsightKinds as ce, AllInsightProvenances as le, AllMapNodeKinds as T, AllReadAttributionStates as E, AllReadStateGrades as D, Harness as O, isChangeBinding as k, isDiffLineKind as ue, isEdgeViolationKind as A, isFileChangeStatus as de, isHarness as fe, isInsightKind as pe, isInsightProvenance as me, isMapNodeKind as he, isReadAttributionState as ge, isReadStateGrade as _e } from "@peasant-labs/schema";
|
|
5
5
|
//#region src/ui/BrandMark.jsx
|
|
6
|
-
var
|
|
6
|
+
var ve = {
|
|
7
7
|
claude: "m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",
|
|
8
8
|
gemini: "M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",
|
|
9
9
|
openai: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z",
|
|
10
10
|
opencode: "M22 24H2V0h20zM17 4.8H7v14.4h10z",
|
|
11
11
|
cursor: "M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23",
|
|
12
|
-
strike: "M18.5 6L11 17.5h5.2L13.5 26 21 14.5h-5.2L18.5 6z"
|
|
13
|
-
|
|
12
|
+
strike: "M18.5 6L11 17.5h5.2L13.5 26 21 14.5h-5.2L18.5 6z",
|
|
13
|
+
pi: "M165.29 165.29 H517.36 V400 H400 V517.36 H282.65 V634.72 H165.29 Z M282.65 282.65 V400 H400 V282.65 Z M517.36 400 H634.72 V634.72 H517.36 Z"
|
|
14
|
+
}, j = {
|
|
15
|
+
strike: "6 6 20 20",
|
|
16
|
+
pi: "0 0 800 800"
|
|
17
|
+
}, ye = {
|
|
14
18
|
anthropic: "claude",
|
|
15
19
|
"claude-code": "claude",
|
|
16
20
|
google: "gemini",
|
|
@@ -20,21 +24,22 @@ var xe = {
|
|
|
20
24
|
"codex-cli": "openai",
|
|
21
25
|
chatgpt: "openai",
|
|
22
26
|
gpt: "openai"
|
|
23
|
-
},
|
|
27
|
+
}, be = {
|
|
24
28
|
claude: "Claude",
|
|
25
29
|
gemini: "Gemini",
|
|
26
30
|
openai: "OpenAI",
|
|
27
31
|
cursor: "Cursor",
|
|
28
32
|
opencode: "opencode",
|
|
29
|
-
strike: "Strike"
|
|
33
|
+
strike: "Strike",
|
|
34
|
+
pi: "Pi"
|
|
30
35
|
};
|
|
31
|
-
function
|
|
36
|
+
function xe(e) {
|
|
32
37
|
if (!e) return null;
|
|
33
|
-
let t = String(e).toLowerCase().trim(), n =
|
|
34
|
-
return
|
|
38
|
+
let t = String(e).toLowerCase().trim(), n = ye[t] || t;
|
|
39
|
+
return ve[n] ? n : null;
|
|
35
40
|
}
|
|
36
|
-
function
|
|
37
|
-
let a =
|
|
41
|
+
function Se({ name: e, size: t, label: n, className: r = "", ...i }) {
|
|
42
|
+
let a = xe(e);
|
|
38
43
|
if (!a) return null;
|
|
39
44
|
let o = ["brand", r].filter(Boolean).join(" "), s = t == null ? {} : {
|
|
40
45
|
width: t,
|
|
@@ -45,7 +50,7 @@ function Te({ name: e, size: t, label: n, className: r = "", ...i }) {
|
|
|
45
50
|
}
|
|
46
51
|
}, c = n ? {
|
|
47
52
|
role: "img",
|
|
48
|
-
"aria-label": n === !0 ?
|
|
53
|
+
"aria-label": n === !0 ? be[a] : n,
|
|
49
54
|
focusable: "false"
|
|
50
55
|
} : {
|
|
51
56
|
"aria-hidden": "true",
|
|
@@ -53,104 +58,110 @@ function Te({ name: e, size: t, label: n, className: r = "", ...i }) {
|
|
|
53
58
|
};
|
|
54
59
|
return /* @__PURE__ */ l("svg", {
|
|
55
60
|
className: o,
|
|
56
|
-
viewBox:
|
|
61
|
+
viewBox: j[a] ?? "0 0 24 24",
|
|
57
62
|
...s,
|
|
58
63
|
...c,
|
|
59
64
|
...i,
|
|
60
65
|
"data-brand": a,
|
|
61
|
-
children: /* @__PURE__ */ l("path", {
|
|
66
|
+
children: /* @__PURE__ */ l("path", {
|
|
67
|
+
d: ve[a],
|
|
68
|
+
fillRule: a === "pi" ? "evenodd" : void 0
|
|
69
|
+
})
|
|
62
70
|
});
|
|
63
71
|
}
|
|
64
72
|
//#endregion
|
|
65
73
|
//#region src/ui/provider-policy.js
|
|
66
|
-
var
|
|
74
|
+
var Ce = Object.freeze(Object.values(O)), we = Object.freeze({
|
|
67
75
|
"claude-code": "Claude Code",
|
|
68
76
|
"gemini-cli": "Gemini CLI",
|
|
69
77
|
codex: "Codex",
|
|
70
78
|
opencode: "opencode",
|
|
71
79
|
cursor: "Cursor",
|
|
72
80
|
antigravity: "Google Antigravity",
|
|
73
|
-
strike: "Strike"
|
|
74
|
-
|
|
81
|
+
strike: "Strike",
|
|
82
|
+
pi: "Pi"
|
|
83
|
+
}), Te = Object.freeze({
|
|
75
84
|
"claude-code": "claude",
|
|
76
85
|
"gemini-cli": "gemini",
|
|
77
86
|
codex: "openai",
|
|
78
87
|
opencode: "opencode",
|
|
79
88
|
cursor: "cursor",
|
|
80
89
|
antigravity: "gemini",
|
|
81
|
-
strike: "strike"
|
|
82
|
-
|
|
90
|
+
strike: "strike",
|
|
91
|
+
pi: "pi"
|
|
92
|
+
}), Ee = Object.freeze({
|
|
83
93
|
"claude-code": "amber",
|
|
84
94
|
"gemini-cli": "teal",
|
|
85
95
|
codex: "olive",
|
|
86
96
|
opencode: "mauve",
|
|
87
97
|
cursor: "clay",
|
|
88
98
|
antigravity: "teal",
|
|
89
|
-
strike: "clay"
|
|
99
|
+
strike: "clay",
|
|
100
|
+
pi: "mauve"
|
|
90
101
|
});
|
|
91
|
-
function
|
|
92
|
-
if (
|
|
102
|
+
function M(e, t) {
|
|
103
|
+
if (fe(e)) return;
|
|
93
104
|
let n;
|
|
94
105
|
try {
|
|
95
106
|
n = JSON.stringify(e);
|
|
96
107
|
} catch {
|
|
97
108
|
n = String(e);
|
|
98
109
|
}
|
|
99
|
-
throw TypeError(`Provider harness validation failed for ${n} at src/ui/provider-policy.js during ${t}: the value is outside the canonical @peasant-labs/schema Harness, so Fairtrade cannot select a trustworthy provider identity; the caller must validate its wire boundary and pass one of ${
|
|
110
|
+
throw TypeError(`Provider harness validation failed for ${n} at src/ui/provider-policy.js during ${t}: the value is outside the canonical @peasant-labs/schema Harness, so Fairtrade cannot select a trustworthy provider identity; the caller must validate its wire boundary and pass one of ${Ce.join(", ")}.`);
|
|
100
111
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
112
|
+
function N(e) {
|
|
113
|
+
return M(e, "provider display-name resolution"), we[e];
|
|
103
114
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
115
|
+
function P(e) {
|
|
116
|
+
return M(e, "provider brand resolution"), Te[e];
|
|
106
117
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
118
|
+
function F(e) {
|
|
119
|
+
return M(e, "provider accent resolution"), Ee[e];
|
|
109
120
|
}
|
|
110
121
|
//#endregion
|
|
111
122
|
//#region src/ui/Intensity.jsx
|
|
112
|
-
function
|
|
123
|
+
function De(e) {
|
|
113
124
|
let t = Math.round(Number(e) || 0);
|
|
114
125
|
return Math.max(0, Math.min(4, t));
|
|
115
126
|
}
|
|
116
|
-
function
|
|
127
|
+
function Oe(e, t) {
|
|
117
128
|
if (!t || t <= 0 || e <= 0) return 0;
|
|
118
129
|
let n = Math.min(e / t, 1);
|
|
119
130
|
return n < .25 ? 1 : n < .5 ? 2 : n < .9 ? 3 : 4;
|
|
120
131
|
}
|
|
121
|
-
function
|
|
132
|
+
function ke(e) {
|
|
122
133
|
if (!e || e <= 0) return 0;
|
|
123
134
|
let t = Math.min(e, 1);
|
|
124
135
|
return t <= .25 ? 1 : t <= .5 ? 2 : t <= .75 ? 3 : 4;
|
|
125
136
|
}
|
|
126
|
-
function
|
|
137
|
+
function Ae(e, t) {
|
|
127
138
|
if (e <= 0 || t <= 0) return 0;
|
|
128
139
|
let n = Math.min(e / t, 1);
|
|
129
140
|
return n <= .25 ? 1 : n <= .5 ? 2 : n <= .75 ? 3 : 4;
|
|
130
141
|
}
|
|
131
|
-
function
|
|
142
|
+
function je(e) {
|
|
132
143
|
let t = Number(e) || 0;
|
|
133
144
|
return t < 60 ? "xs" : t < 200 ? "sm" : t < 600 ? "md" : t < 1500 ? "lg" : "xl";
|
|
134
145
|
}
|
|
135
|
-
var
|
|
146
|
+
var Me = [
|
|
136
147
|
"none",
|
|
137
148
|
"low",
|
|
138
149
|
"some",
|
|
139
150
|
"most",
|
|
140
151
|
"full"
|
|
141
152
|
];
|
|
142
|
-
function
|
|
143
|
-
let o =
|
|
153
|
+
function Ne({ level: e = 0, accent: t, size: n, label: r, className: i = "", ...a }) {
|
|
154
|
+
let o = De(e);
|
|
144
155
|
return /* @__PURE__ */ l("span", {
|
|
145
156
|
className: `ir-swatch${n === "lg" ? " ir-swatch--lg" : ""}${i ? ` ${i}` : ""}`,
|
|
146
157
|
"data-level": o,
|
|
147
158
|
"data-accent": t || void 0,
|
|
148
159
|
role: "img",
|
|
149
|
-
"aria-label": r || `intensity ${o} of 4 (${
|
|
160
|
+
"aria-label": r || `intensity ${o} of 4 (${Me[o]})`,
|
|
150
161
|
...a
|
|
151
162
|
});
|
|
152
163
|
}
|
|
153
|
-
function
|
|
164
|
+
function Pe({ title: e = "coverage", words: t = Me, className: n = "" }) {
|
|
154
165
|
return /* @__PURE__ */ u("div", {
|
|
155
166
|
className: `ir-scope ir-legend${n ? ` ${n}` : ""}`,
|
|
156
167
|
children: [
|
|
@@ -192,8 +203,8 @@ function Ie({ title: e = "coverage", words: t = Fe, className: n = "" }) {
|
|
|
192
203
|
]
|
|
193
204
|
});
|
|
194
205
|
}
|
|
195
|
-
function
|
|
196
|
-
let o = t ? t.map(
|
|
206
|
+
function Fe({ values: e, levels: t, max: n, labels: r, ariaLabel: i = "intensity heatmap", className: a = "" }) {
|
|
207
|
+
let o = t ? t.map(De) : (e || []).map((t) => Ae(t, n ?? Math.max(1, ...e || [1])));
|
|
197
208
|
return /* @__PURE__ */ l("div", {
|
|
198
209
|
className: `ir-scope ir-heatmap${a ? ` ${a}` : ""}`,
|
|
199
210
|
role: "img",
|
|
@@ -201,25 +212,25 @@ function Le({ values: e, levels: t, max: n, labels: r, ariaLabel: i = "intensity
|
|
|
201
212
|
children: o.map((e, t) => /* @__PURE__ */ l("span", {
|
|
202
213
|
className: "ir-heatmap__cell",
|
|
203
214
|
"data-level": e,
|
|
204
|
-
title: `${r?.[t] ?? `cell ${t + 1}`}: ${
|
|
215
|
+
title: `${r?.[t] ?? `cell ${t + 1}`}: ${Me[e]} (${e}/4)`
|
|
205
216
|
}, t))
|
|
206
217
|
});
|
|
207
218
|
}
|
|
208
|
-
function
|
|
209
|
-
let g = i == null ?
|
|
219
|
+
function Ie({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected: a = !1, violation: o = 0, effortPct: s, size: c, as: f = "button", onClick: p, className: m = "", ...h }) {
|
|
220
|
+
let g = i == null ? De(n) : Oe(r ?? 0, i), _ = c || je(t), v = Math.max(0, Math.round(Number(o) || 0)), y = s != null && s > 0, b = y ? ke(s > 1 ? s / 100 : s) : 0, x = [
|
|
210
221
|
e,
|
|
211
222
|
i == null ? `coverage ${g} of 4` : `${r ?? 0} of ${i} recorded`,
|
|
212
223
|
t == null ? null : `${t} loc`,
|
|
213
|
-
|
|
224
|
+
v > 0 ? `${v} violation${v === 1 ? "" : "s"}` : null,
|
|
214
225
|
a ? "selected" : null
|
|
215
|
-
].filter(Boolean).join(" · "),
|
|
216
|
-
return /* @__PURE__ */ u(
|
|
217
|
-
className: `ir-node ir-node--${
|
|
226
|
+
].filter(Boolean).join(" · "), S = f, C = S === "button";
|
|
227
|
+
return /* @__PURE__ */ u(S, {
|
|
228
|
+
className: `ir-node ir-node--${_}${m ? ` ${m}` : ""}`,
|
|
218
229
|
"data-coverage": g,
|
|
219
230
|
"data-selected": a ? "true" : void 0,
|
|
220
|
-
type:
|
|
221
|
-
"aria-pressed":
|
|
222
|
-
"aria-label":
|
|
231
|
+
type: C ? "button" : void 0,
|
|
232
|
+
"aria-pressed": C ? a : void 0,
|
|
233
|
+
"aria-label": x,
|
|
223
234
|
onClick: p,
|
|
224
235
|
...h,
|
|
225
236
|
children: [
|
|
@@ -228,12 +239,12 @@ function Re({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected
|
|
|
228
239
|
children: [/* @__PURE__ */ l("span", {
|
|
229
240
|
className: "ir-node__label",
|
|
230
241
|
children: e
|
|
231
|
-
}),
|
|
242
|
+
}), v > 0 && /* @__PURE__ */ u("span", {
|
|
232
243
|
className: "ir-node__badge",
|
|
233
244
|
"aria-hidden": "true",
|
|
234
|
-
children: [/* @__PURE__ */ l(
|
|
245
|
+
children: [/* @__PURE__ */ l(ne, { "aria-hidden": "true" }), /* @__PURE__ */ l("span", {
|
|
235
246
|
className: "tnum",
|
|
236
|
-
children:
|
|
247
|
+
children: v
|
|
237
248
|
})]
|
|
238
249
|
})]
|
|
239
250
|
}),
|
|
@@ -246,15 +257,15 @@ function Re({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected
|
|
|
246
257
|
"aria-hidden": "true",
|
|
247
258
|
children: /* @__PURE__ */ l(d, { "aria-hidden": "true" })
|
|
248
259
|
}),
|
|
249
|
-
|
|
260
|
+
y && /* @__PURE__ */ l("span", {
|
|
250
261
|
className: "ir-node__effort",
|
|
251
|
-
"data-level":
|
|
262
|
+
"data-level": b,
|
|
252
263
|
"aria-hidden": "true"
|
|
253
264
|
})
|
|
254
265
|
]
|
|
255
266
|
});
|
|
256
267
|
}
|
|
257
|
-
function
|
|
268
|
+
function Le({ children: e, className: t = "", ...n }) {
|
|
258
269
|
return /* @__PURE__ */ l("div", {
|
|
259
270
|
className: `ir-scope${t ? ` ${t}` : ""}`,
|
|
260
271
|
...n,
|
|
@@ -263,29 +274,29 @@ function ze({ children: e, className: t = "", ...n }) {
|
|
|
263
274
|
}
|
|
264
275
|
//#endregion
|
|
265
276
|
//#region src/ui/ProviderIcon.jsx
|
|
266
|
-
var
|
|
267
|
-
function
|
|
268
|
-
return `var(--${
|
|
277
|
+
var Re = Ce, I = Ee;
|
|
278
|
+
function L(e) {
|
|
279
|
+
return `var(--${F(e)})`;
|
|
269
280
|
}
|
|
270
|
-
function
|
|
271
|
-
|
|
272
|
-
let o =
|
|
281
|
+
function R({ harness: e, size: t, accent: n = !1, label: r, className: i = "", ...a }) {
|
|
282
|
+
M(e, "ProviderIcon render in src/ui/ProviderIcon.jsx");
|
|
283
|
+
let o = P(e), s = ["pv-icon", i].filter(Boolean).join(" "), c = n ? { color: L(e) } : void 0, u = r === !0 ? N(e) : r;
|
|
273
284
|
return /* @__PURE__ */ l("span", {
|
|
274
285
|
className: s,
|
|
275
286
|
style: c,
|
|
276
287
|
...a,
|
|
277
|
-
children: /* @__PURE__ */ l(
|
|
288
|
+
children: /* @__PURE__ */ l(Se, {
|
|
278
289
|
name: o,
|
|
279
290
|
size: t,
|
|
280
291
|
label: u
|
|
281
292
|
})
|
|
282
293
|
});
|
|
283
294
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
295
|
+
function ze({ harness: e, accent: t = !1, className: n = "", ...r }) {
|
|
296
|
+
return M(e, "ProviderTag render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ u("span", {
|
|
286
297
|
className: ["pv-tag", n].filter(Boolean).join(" "),
|
|
287
298
|
...r,
|
|
288
|
-
children: [/* @__PURE__ */ l(
|
|
299
|
+
children: [/* @__PURE__ */ l(R, {
|
|
289
300
|
harness: e,
|
|
290
301
|
accent: t
|
|
291
302
|
}), /* @__PURE__ */ l("span", {
|
|
@@ -294,27 +305,27 @@ function Ve({ harness: e, accent: t = !1, className: n = "", ...r }) {
|
|
|
294
305
|
})]
|
|
295
306
|
});
|
|
296
307
|
}
|
|
297
|
-
function
|
|
298
|
-
return
|
|
308
|
+
function z({ harness: e, accent: t = !1, className: n = "", ...r }) {
|
|
309
|
+
return M(e, "ProviderName render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ u("span", {
|
|
299
310
|
className: ["pv-name", n].filter(Boolean).join(" "),
|
|
300
|
-
style: t ? { color:
|
|
311
|
+
style: t ? { color: L(e) } : void 0,
|
|
301
312
|
...r,
|
|
302
|
-
children: [/* @__PURE__ */ l(
|
|
313
|
+
children: [/* @__PURE__ */ l(R, { harness: e }), /* @__PURE__ */ l("span", {
|
|
303
314
|
className: "pv-name-label",
|
|
304
315
|
children: e
|
|
305
316
|
})]
|
|
306
317
|
});
|
|
307
318
|
}
|
|
308
|
-
function
|
|
319
|
+
function B({ className: e = "", ...t }) {
|
|
309
320
|
return /* @__PURE__ */ l("ul", {
|
|
310
321
|
className: ["pv-legend", e].filter(Boolean).join(" "),
|
|
311
322
|
...t,
|
|
312
|
-
children:
|
|
313
|
-
let t =
|
|
323
|
+
children: Re.map((e) => {
|
|
324
|
+
let t = F(e);
|
|
314
325
|
return /* @__PURE__ */ u("li", {
|
|
315
326
|
className: "pv-legend-row",
|
|
316
327
|
children: [
|
|
317
|
-
/* @__PURE__ */ l(
|
|
328
|
+
/* @__PURE__ */ l(R, {
|
|
318
329
|
harness: e,
|
|
319
330
|
accent: !0,
|
|
320
331
|
className: "pv-legend-mark"
|
|
@@ -339,7 +350,7 @@ function R({ className: e = "", ...t }) {
|
|
|
339
350
|
}
|
|
340
351
|
//#endregion
|
|
341
352
|
//#region src/ui/graph/GhostCommitNode.jsx
|
|
342
|
-
var
|
|
353
|
+
var Be = Object.freeze({
|
|
343
354
|
hash: "matched by hash",
|
|
344
355
|
patch_id: "matched by patch content",
|
|
345
356
|
author_identity: "matched by author and time",
|
|
@@ -347,8 +358,8 @@ var He = Object.freeze({
|
|
|
347
358
|
temporal: "matched by nearby time only",
|
|
348
359
|
none: "no match found"
|
|
349
360
|
});
|
|
350
|
-
function
|
|
351
|
-
let s = n === "unresolved" ? "session-era commit, no longer in history; not enough recorded metadata to map it" : `${
|
|
361
|
+
function Ve({ ghostHash: e, subject: t, resolution: n, method: r, confidence: i, className: a = "", ...o }) {
|
|
362
|
+
let s = n === "unresolved" ? "session-era commit, no longer in history; not enough recorded metadata to map it" : `${Be[r] ?? r}, ${i} confidence`;
|
|
352
363
|
return /* @__PURE__ */ l("span", {
|
|
353
364
|
className: `tlp-ghost-node tlp-terminal-${i}${a ? ` ${a}` : ""}`,
|
|
354
365
|
role: "img",
|
|
@@ -373,7 +384,7 @@ function Ue({ ghostHash: e, subject: t, resolution: n, method: r, confidence: i,
|
|
|
373
384
|
}
|
|
374
385
|
//#endregion
|
|
375
386
|
//#region src/ui/graph/SessionLane.jsx
|
|
376
|
-
function
|
|
387
|
+
function V({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i = !1, onHover: a, onSelect: o, unresolvedGhosts: s = [], className: c = "", ...d }) {
|
|
377
388
|
let f = [
|
|
378
389
|
"tlp-session-lane",
|
|
379
390
|
r && "tlp-session-lane-hover",
|
|
@@ -393,7 +404,7 @@ function z({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
|
|
|
393
404
|
onClick: () => o?.(e),
|
|
394
405
|
...d,
|
|
395
406
|
children: [
|
|
396
|
-
n && /* @__PURE__ */ l(
|
|
407
|
+
n && /* @__PURE__ */ l(R, {
|
|
397
408
|
harness: n,
|
|
398
409
|
label: !0
|
|
399
410
|
}),
|
|
@@ -412,7 +423,7 @@ function z({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
|
|
|
412
423
|
className: "tlp-session-lane-ghosts",
|
|
413
424
|
role: "group",
|
|
414
425
|
"aria-label": "session-era commits with no recorded mapping",
|
|
415
|
-
children: s.map((e) => /* @__PURE__ */ l(
|
|
426
|
+
children: s.map((e) => /* @__PURE__ */ l(Ve, {
|
|
416
427
|
ghostHash: e.ghostHash,
|
|
417
428
|
subject: e.subject,
|
|
418
429
|
resolution: e.resolution,
|
|
@@ -424,7 +435,7 @@ function z({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
|
|
|
424
435
|
}
|
|
425
436
|
//#endregion
|
|
426
437
|
//#region src/ui/graph/GhostGroup.jsx
|
|
427
|
-
function
|
|
438
|
+
function He({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className: i = "", ...a }) {
|
|
428
439
|
let o = `${t.length} session-era commit${t.length === 1 ? "" : "s"}`;
|
|
429
440
|
return /* @__PURE__ */ u("div", {
|
|
430
441
|
className: `tlp-ghost-group${i ? ` ${i}` : ""}`,
|
|
@@ -473,7 +484,7 @@ function We({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className:
|
|
|
473
484
|
]
|
|
474
485
|
}), n && /* @__PURE__ */ l("ul", {
|
|
475
486
|
className: "tlp-ghost-group-list",
|
|
476
|
-
children: t.map((e) => /* @__PURE__ */ u("li", { children: [/* @__PURE__ */ l(
|
|
487
|
+
children: t.map((e) => /* @__PURE__ */ u("li", { children: [/* @__PURE__ */ l(Ve, {
|
|
477
488
|
ghostHash: e.ghostHash,
|
|
478
489
|
subject: e.subject,
|
|
479
490
|
resolution: e.resolution,
|
|
@@ -488,7 +499,7 @@ function We({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className:
|
|
|
488
499
|
}
|
|
489
500
|
//#endregion
|
|
490
501
|
//#region src/ui/graph/SessionOverflowDisclosure.jsx
|
|
491
|
-
function
|
|
502
|
+
function H({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i, itemLabel: a = "sessions", className: o = "", ...s }) {
|
|
492
503
|
return t.length === 0 ? null : /* @__PURE__ */ u("span", {
|
|
493
504
|
className: `tlp-overflow${o ? ` ${o}` : ""}`,
|
|
494
505
|
...s,
|
|
@@ -523,7 +534,7 @@ function B({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i,
|
|
|
523
534
|
className: "tlp-overflow-item",
|
|
524
535
|
"data-session-id": e.sessionId,
|
|
525
536
|
onClick: () => i?.(e.sessionId),
|
|
526
|
-
children: [e.harness && /* @__PURE__ */ l(
|
|
537
|
+
children: [e.harness && /* @__PURE__ */ l(R, {
|
|
527
538
|
harness: e.harness,
|
|
528
539
|
label: !0
|
|
529
540
|
}), e.title || e.sessionId]
|
|
@@ -534,7 +545,7 @@ function B({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i,
|
|
|
534
545
|
}
|
|
535
546
|
//#endregion
|
|
536
547
|
//#region src/ui/graph/HighlightEdge.jsx
|
|
537
|
-
function
|
|
548
|
+
function U({ weight: e, geometry: t, className: n = "", ...r }) {
|
|
538
549
|
return /* @__PURE__ */ l("line", {
|
|
539
550
|
className: [
|
|
540
551
|
"tlp-highlight-edge",
|
|
@@ -551,9 +562,9 @@ function V({ weight: e, geometry: t, className: n = "", ...r }) {
|
|
|
551
562
|
}
|
|
552
563
|
//#endregion
|
|
553
564
|
//#region src/ui/graph/TouchedFileCluster.jsx
|
|
554
|
-
var
|
|
555
|
-
function
|
|
556
|
-
let s = t.slice(0,
|
|
565
|
+
var W = 8;
|
|
566
|
+
function G({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, className: a = "", ...o }) {
|
|
567
|
+
let s = t.slice(0, W), c = t.slice(W).map((e) => ({
|
|
557
568
|
sessionId: e,
|
|
558
569
|
title: e
|
|
559
570
|
}));
|
|
@@ -567,7 +578,7 @@ function U({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, c
|
|
|
567
578
|
className: "tlp-file-cluster-item",
|
|
568
579
|
onClick: () => i?.(e),
|
|
569
580
|
children: e
|
|
570
|
-
}, e)), /* @__PURE__ */ l(
|
|
581
|
+
}, e)), /* @__PURE__ */ l(H, {
|
|
571
582
|
commitHash: e,
|
|
572
583
|
overflow: c,
|
|
573
584
|
expanded: n,
|
|
@@ -579,9 +590,9 @@ function U({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, c
|
|
|
579
590
|
}
|
|
580
591
|
//#endregion
|
|
581
592
|
//#region src/ui/CommitGraph.jsx
|
|
582
|
-
var
|
|
583
|
-
function
|
|
584
|
-
let
|
|
593
|
+
var Ue = 14, We = 9, Ge = 7, Ke = 9, qe = "3 3", K = (e) => We + e * Ue, Je = (e) => K(Math.max(e - 1, 0)) + Ge;
|
|
594
|
+
function Ye({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpenSession: c, hasMore: d = !1, onShowOlder: p, label: m = "commit history", className: h = "", sessionLanes: g, hoveredSessionId: _ = null, selectedSessionId: v = null, onHoverSession: y, onSelectSession: b, highlightSelected: x, highlightHovered: S, ghostGroupsByCommit: C, expandedGhostGroups: ee, onToggleGhostGroup: te, expandedCommitSessions: ne, onToggleCommitSessions: re, touchedFilesByCommit: ie, onOpenTouchedFile: ae, ...w }) {
|
|
595
|
+
let oe = a(() => new Set(ee ?? []), [ee]), se = a(() => new Set(ne ?? []), [ne]), ce = a(() => /* @__PURE__ */ new Set([...x?.commitHashes ?? [], ...x?.ghostHashes ?? []]), [x]), le = a(() => /* @__PURE__ */ new Set([...S?.commitHashes ?? [], ...S?.ghostHashes ?? []]), [S]), T = a(() => e.reduce((e, t) => Math.max(e, (t.lane ?? 0) + 1), 1), [e]), E = a(() => {
|
|
585
596
|
let t = new Map(e.map((e) => [e.id, e.lane ?? 0])), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
586
597
|
return e.forEach((e, t) => {
|
|
587
598
|
let i = e.lane ?? 0;
|
|
@@ -602,11 +613,11 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
602
613
|
laneDown: i < c
|
|
603
614
|
};
|
|
604
615
|
});
|
|
605
|
-
}, [e]),
|
|
606
|
-
let e = new Set(
|
|
616
|
+
}, [e]), D = a(() => {
|
|
617
|
+
let e = new Set(E.map((e) => e.commit.id)), t = new Set((g ?? []).map((e) => e.sessionId)), n = [...(x?.edges ?? []).map((e) => ({
|
|
607
618
|
...e,
|
|
608
619
|
weight: "primary"
|
|
609
|
-
})), ...(
|
|
620
|
+
})), ...(S?.edges ?? []).map((e) => ({
|
|
610
621
|
...e,
|
|
611
622
|
weight: "secondary"
|
|
612
623
|
}))], r = /* @__PURE__ */ new Set();
|
|
@@ -620,22 +631,22 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
620
631
|
}]);
|
|
621
632
|
});
|
|
622
633
|
}, [
|
|
623
|
-
|
|
634
|
+
E,
|
|
624
635
|
g,
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
]),
|
|
636
|
+
x,
|
|
637
|
+
S
|
|
638
|
+
]), O = o(null), [k, ue] = s([]);
|
|
628
639
|
i(() => {
|
|
629
|
-
let e =
|
|
630
|
-
if (!e ||
|
|
631
|
-
|
|
640
|
+
let e = O.current;
|
|
641
|
+
if (!e || D.length === 0) {
|
|
642
|
+
ue([]);
|
|
632
643
|
return;
|
|
633
644
|
}
|
|
634
645
|
let t = () => {
|
|
635
646
|
let t = e.querySelector(".cg-history");
|
|
636
647
|
if (!t) return;
|
|
637
648
|
let n = t.getBoundingClientRect(), r = new Map([...e.querySelectorAll("[data-timeline-session-id]")].map((e) => [e.getAttribute("data-timeline-session-id"), e])), i = new Map([...e.querySelectorAll(".cg-history-row[data-commit-hash]")].map((e) => [e.getAttribute("data-commit-hash"), e]));
|
|
638
|
-
|
|
649
|
+
ue(D.flatMap((e) => {
|
|
639
650
|
let t = r.get(e.sessionId)?.getBoundingClientRect(), a = i.get(e.commitHash)?.querySelector(".cg-dot")?.getBoundingClientRect();
|
|
640
651
|
return !t || !a ? [] : [{
|
|
641
652
|
...e,
|
|
@@ -651,74 +662,74 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
651
662
|
if (t(), typeof ResizeObserver > "u") return;
|
|
652
663
|
let n = new ResizeObserver(t);
|
|
653
664
|
return n.observe(e), () => n.disconnect();
|
|
654
|
-
}, [
|
|
655
|
-
let
|
|
665
|
+
}, [D]);
|
|
666
|
+
let A = Je(T), de = ["cg", h].filter(Boolean).join(" ");
|
|
656
667
|
return e.length === 0 ? /* @__PURE__ */ l("div", {
|
|
657
|
-
className:
|
|
658
|
-
...
|
|
668
|
+
className: de,
|
|
669
|
+
...w,
|
|
659
670
|
children: /* @__PURE__ */ l("p", {
|
|
660
671
|
className: "cg-empty",
|
|
661
672
|
children: "no commits to show."
|
|
662
673
|
})
|
|
663
674
|
}) : /* @__PURE__ */ u("div", {
|
|
664
|
-
ref:
|
|
665
|
-
className:
|
|
675
|
+
ref: O,
|
|
676
|
+
className: de,
|
|
666
677
|
role: "list",
|
|
667
678
|
"aria-label": m,
|
|
668
|
-
...
|
|
679
|
+
...w,
|
|
669
680
|
children: [
|
|
670
681
|
g && g.length > 0 && /* @__PURE__ */ l("div", {
|
|
671
682
|
className: "cg-session-spine",
|
|
672
683
|
role: "group",
|
|
673
684
|
"aria-label": "recorded sessions",
|
|
674
685
|
style: { gridTemplateColumns: `repeat(${g.length}, minmax(0, 1fr))` },
|
|
675
|
-
children: g.map((e) => /* @__PURE__ */ l(
|
|
686
|
+
children: g.map((e) => /* @__PURE__ */ l(V, {
|
|
676
687
|
sessionId: e.sessionId,
|
|
677
688
|
title: e.title,
|
|
678
689
|
harness: e.harness,
|
|
679
|
-
hovered:
|
|
680
|
-
selected:
|
|
681
|
-
onHover:
|
|
682
|
-
onSelect:
|
|
690
|
+
hovered: _ === e.sessionId,
|
|
691
|
+
selected: v === e.sessionId,
|
|
692
|
+
onHover: y,
|
|
693
|
+
onSelect: b,
|
|
683
694
|
unresolvedGhosts: e.unresolvedGhosts,
|
|
684
695
|
"data-timeline-session-id": e.sessionId
|
|
685
696
|
}, e.sessionId))
|
|
686
697
|
}),
|
|
687
698
|
/* @__PURE__ */ u("div", {
|
|
688
699
|
className: "cg-history",
|
|
689
|
-
children: [
|
|
700
|
+
children: [k.length > 0 && /* @__PURE__ */ l("svg", {
|
|
690
701
|
className: "cg-highlight-layer",
|
|
691
702
|
"aria-hidden": "true",
|
|
692
|
-
children:
|
|
703
|
+
children: k.map((e) => /* @__PURE__ */ l(U, {
|
|
693
704
|
weight: e.weight,
|
|
694
705
|
geometry: e.geometry,
|
|
695
706
|
"data-session-id": e.sessionId,
|
|
696
707
|
"data-commit-hash": e.commitHash
|
|
697
708
|
}, e.key))
|
|
698
|
-
}),
|
|
709
|
+
}), E.map((e) => /* @__PURE__ */ u("div", {
|
|
699
710
|
className: "cg-history-row",
|
|
700
711
|
"data-commit-hash": e.commit.id,
|
|
701
|
-
children: [/* @__PURE__ */ l(
|
|
712
|
+
children: [/* @__PURE__ */ l(q, {
|
|
702
713
|
row: e,
|
|
703
|
-
width:
|
|
714
|
+
width: A,
|
|
704
715
|
selected: e.commit.id === t,
|
|
705
716
|
onNavigate: n,
|
|
706
717
|
onSelect: r,
|
|
707
718
|
onOpenSession: c,
|
|
708
|
-
highlightWeight:
|
|
709
|
-
expandedSessions:
|
|
710
|
-
onToggleSessions:
|
|
711
|
-
touchedFiles:
|
|
712
|
-
expandedFiles:
|
|
713
|
-
onOpenTouchedFile:
|
|
714
|
-
}),
|
|
719
|
+
highlightWeight: ce.has(e.commit.id) ? "primary" : le.has(e.commit.id) ? "secondary" : null,
|
|
720
|
+
expandedSessions: se.has(e.commit.id),
|
|
721
|
+
onToggleSessions: re,
|
|
722
|
+
touchedFiles: ie?.[e.commit.id] ?? [],
|
|
723
|
+
expandedFiles: se.has(`files:${e.commit.id}`),
|
|
724
|
+
onOpenTouchedFile: ae
|
|
725
|
+
}), C?.[e.commit.id] && /* @__PURE__ */ l("div", {
|
|
715
726
|
className: "cg-ghost-row",
|
|
716
|
-
style: { marginLeft:
|
|
717
|
-
children: /* @__PURE__ */ l(
|
|
727
|
+
style: { marginLeft: A },
|
|
728
|
+
children: /* @__PURE__ */ l(He, {
|
|
718
729
|
successorHash: e.commit.id,
|
|
719
|
-
ghosts:
|
|
720
|
-
expanded:
|
|
721
|
-
onToggle:
|
|
730
|
+
ghosts: C[e.commit.id],
|
|
731
|
+
expanded: oe.has(e.commit.id),
|
|
732
|
+
onToggle: te
|
|
722
733
|
})
|
|
723
734
|
})]
|
|
724
735
|
}, e.commit.id))]
|
|
@@ -727,20 +738,20 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
727
738
|
className: "cg-older-band",
|
|
728
739
|
children: [/* @__PURE__ */ l("span", {
|
|
729
740
|
className: "cg-gutter cg-gutter-older",
|
|
730
|
-
style: { width:
|
|
741
|
+
style: { width: A },
|
|
731
742
|
"aria-hidden": "true",
|
|
732
743
|
children: /* @__PURE__ */ l("svg", {
|
|
733
744
|
className: "cg-svg",
|
|
734
|
-
width:
|
|
745
|
+
width: A,
|
|
735
746
|
height: "100%",
|
|
736
747
|
preserveAspectRatio: "none",
|
|
737
748
|
children: /* @__PURE__ */ l("line", {
|
|
738
749
|
className: "cg-stroke-lane0",
|
|
739
|
-
x1:
|
|
750
|
+
x1: K(0),
|
|
740
751
|
y1: "0",
|
|
741
|
-
x2:
|
|
752
|
+
x2: K(0),
|
|
742
753
|
y2: "60%",
|
|
743
|
-
strokeDasharray:
|
|
754
|
+
strokeDasharray: qe
|
|
744
755
|
})
|
|
745
756
|
})
|
|
746
757
|
}), /* @__PURE__ */ u("button", {
|
|
@@ -758,13 +769,13 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
758
769
|
]
|
|
759
770
|
});
|
|
760
771
|
}
|
|
761
|
-
function
|
|
762
|
-
let { commit: m, lane: h, joins: g, passLanes:
|
|
772
|
+
function q({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSession: a, highlightWeight: o = null, expandedSessions: s = !1, onToggleSessions: c, touchedFiles: d = [], expandedFiles: f = !1, onOpenTouchedFile: p }) {
|
|
773
|
+
let { commit: m, lane: h, joins: g, passLanes: _, laneUp: v, laneDown: b } = e, x = !!m.session, S = [
|
|
763
774
|
"cg-dot",
|
|
764
|
-
|
|
775
|
+
x ? "cg-dot-filled" : "cg-dot-hollow",
|
|
765
776
|
n && "cg-dot-sel",
|
|
766
777
|
o && `cg-dot-highlight-${o}`
|
|
767
|
-
].filter(Boolean).join(" "),
|
|
778
|
+
].filter(Boolean).join(" "), C = m.sessionRefs?.slice(0, 2) ?? [], ee = m.sessionRefs?.slice(2) ?? [], ne = ["cg-row", n && "cg-row-sel"].filter(Boolean).join(" ");
|
|
768
779
|
return /* @__PURE__ */ u("div", {
|
|
769
780
|
className: "cg-band",
|
|
770
781
|
role: "listitem",
|
|
@@ -779,57 +790,57 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
779
790
|
height: "100%",
|
|
780
791
|
preserveAspectRatio: "none",
|
|
781
792
|
children: [
|
|
782
|
-
|
|
793
|
+
v && /* @__PURE__ */ l("line", {
|
|
783
794
|
className: "cg-stroke-self",
|
|
784
|
-
x1:
|
|
795
|
+
x1: K(h),
|
|
785
796
|
y1: "0",
|
|
786
|
-
x2:
|
|
797
|
+
x2: K(h),
|
|
787
798
|
y2: "50%"
|
|
788
799
|
}),
|
|
789
|
-
|
|
800
|
+
b && /* @__PURE__ */ l("line", {
|
|
790
801
|
className: "cg-stroke-self",
|
|
791
|
-
x1:
|
|
802
|
+
x1: K(h),
|
|
792
803
|
y1: "50%",
|
|
793
|
-
x2:
|
|
804
|
+
x2: K(h),
|
|
794
805
|
y2: "100%"
|
|
795
806
|
}),
|
|
796
|
-
|
|
807
|
+
_.map((e) => /* @__PURE__ */ l("line", {
|
|
797
808
|
className: e === 0 ? "cg-stroke-lane0" : "cg-stroke-branch",
|
|
798
|
-
x1:
|
|
809
|
+
x1: K(e),
|
|
799
810
|
y1: "0",
|
|
800
|
-
x2:
|
|
811
|
+
x2: K(e),
|
|
801
812
|
y2: "100%"
|
|
802
813
|
}, e)),
|
|
803
814
|
g.map((e, t) => /* @__PURE__ */ u("g", {
|
|
804
815
|
className: "cg-elbow",
|
|
805
816
|
children: [/* @__PURE__ */ l("line", {
|
|
806
817
|
className: "cg-stroke-branch",
|
|
807
|
-
x1:
|
|
818
|
+
x1: K(e.to),
|
|
808
819
|
y1: "50%",
|
|
809
|
-
x2:
|
|
820
|
+
x2: K(e.to),
|
|
810
821
|
y2: "100%"
|
|
811
822
|
}), /* @__PURE__ */ l("line", {
|
|
812
823
|
className: "cg-stroke-branch",
|
|
813
|
-
x1:
|
|
824
|
+
x1: K(e.to),
|
|
814
825
|
y1: "50%",
|
|
815
|
-
x2:
|
|
826
|
+
x2: K(e.from),
|
|
816
827
|
y2: "50%"
|
|
817
828
|
})]
|
|
818
829
|
}, t))
|
|
819
830
|
]
|
|
820
831
|
}),
|
|
821
832
|
/* @__PURE__ */ l("span", {
|
|
822
|
-
className:
|
|
833
|
+
className: S,
|
|
823
834
|
style: {
|
|
824
|
-
left:
|
|
825
|
-
width:
|
|
826
|
-
height:
|
|
835
|
+
left: K(h),
|
|
836
|
+
width: Ke,
|
|
837
|
+
height: Ke
|
|
827
838
|
},
|
|
828
|
-
"data-has-session":
|
|
839
|
+
"data-has-session": x || void 0
|
|
829
840
|
}),
|
|
830
|
-
|
|
841
|
+
x && /* @__PURE__ */ l(te, {
|
|
831
842
|
className: "cg-spark",
|
|
832
|
-
style: { left:
|
|
843
|
+
style: { left: K(h) },
|
|
833
844
|
"aria-hidden": "true"
|
|
834
845
|
})
|
|
835
846
|
]
|
|
@@ -838,7 +849,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
838
849
|
children: [
|
|
839
850
|
/* @__PURE__ */ u("button", {
|
|
840
851
|
type: "button",
|
|
841
|
-
className:
|
|
852
|
+
className: ne,
|
|
842
853
|
onClick: () => {
|
|
843
854
|
r ? r({
|
|
844
855
|
type: "open-change",
|
|
@@ -857,7 +868,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
857
868
|
children: [
|
|
858
869
|
m.merged && /* @__PURE__ */ u("span", {
|
|
859
870
|
className: "cg-merged",
|
|
860
|
-
children: [/* @__PURE__ */ l(
|
|
871
|
+
children: [/* @__PURE__ */ l(y, {
|
|
861
872
|
className: "cg-merged-ic",
|
|
862
873
|
"aria-hidden": "true"
|
|
863
874
|
}), "merged"]
|
|
@@ -870,7 +881,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
870
881
|
className: "cg-branch",
|
|
871
882
|
children: m.branch
|
|
872
883
|
}),
|
|
873
|
-
|
|
884
|
+
x && /* @__PURE__ */ l("span", {
|
|
874
885
|
className: "cg-sr",
|
|
875
886
|
children: "session"
|
|
876
887
|
}),
|
|
@@ -885,7 +896,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
885
896
|
className: "cg-sessions",
|
|
886
897
|
role: "group",
|
|
887
898
|
"aria-label": `sessions linked to ${m.message}`,
|
|
888
|
-
children: [
|
|
899
|
+
children: [C.map((e) => /* @__PURE__ */ u("button", {
|
|
889
900
|
type: "button",
|
|
890
901
|
className: "cg-session",
|
|
891
902
|
onClick: () => {
|
|
@@ -902,7 +913,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
902
913
|
}) : a?.(e.sessionId);
|
|
903
914
|
},
|
|
904
915
|
children: [
|
|
905
|
-
/* @__PURE__ */ l(
|
|
916
|
+
/* @__PURE__ */ l(z, { harness: e.harness }),
|
|
906
917
|
/* @__PURE__ */ l("span", {
|
|
907
918
|
className: "cg-session-title",
|
|
908
919
|
children: e.title || e.sessionId
|
|
@@ -916,9 +927,9 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
916
927
|
}).toLowerCase()
|
|
917
928
|
})
|
|
918
929
|
]
|
|
919
|
-
}, e.sessionId)),
|
|
930
|
+
}, e.sessionId)), ee.length > 0 && /* @__PURE__ */ l(H, {
|
|
920
931
|
commitHash: m.id,
|
|
921
|
-
overflow:
|
|
932
|
+
overflow: ee,
|
|
922
933
|
expanded: s,
|
|
923
934
|
onToggle: c ?? (() => {}),
|
|
924
935
|
onSelect: (e) => {
|
|
@@ -938,7 +949,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
938
949
|
}),
|
|
939
950
|
d.length > 0 && /* @__PURE__ */ l("div", {
|
|
940
951
|
className: "cg-touched-files",
|
|
941
|
-
children: /* @__PURE__ */ l(
|
|
952
|
+
children: /* @__PURE__ */ l(G, {
|
|
942
953
|
commitHash: `files:${m.id}`,
|
|
943
954
|
files: d,
|
|
944
955
|
expanded: f,
|
|
@@ -952,7 +963,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
952
963
|
}
|
|
953
964
|
//#endregion
|
|
954
965
|
//#region src/ui/DiffView.jsx
|
|
955
|
-
function
|
|
966
|
+
function Xe(e) {
|
|
956
967
|
let t = 0, n = 0;
|
|
957
968
|
for (let r of e) for (let e of r.lines) e.type === "add" ? t++ : e.type === "del" && n++;
|
|
958
969
|
return {
|
|
@@ -960,8 +971,8 @@ function Qe(e) {
|
|
|
960
971
|
dels: n
|
|
961
972
|
};
|
|
962
973
|
}
|
|
963
|
-
function
|
|
964
|
-
let { type: t, oldNo: n, newNo: r, text: i } = e, a = t === "add" ?
|
|
974
|
+
function Ze({ line: e }) {
|
|
975
|
+
let { type: t, oldNo: n, newNo: r, text: i } = e, a = t === "add" ? S : t === "del" ? x : null;
|
|
965
976
|
return /* @__PURE__ */ u("div", {
|
|
966
977
|
className: `dv-line dv-${t}`,
|
|
967
978
|
role: "row",
|
|
@@ -997,7 +1008,7 @@ function $e({ line: e }) {
|
|
|
997
1008
|
]
|
|
998
1009
|
});
|
|
999
1010
|
}
|
|
1000
|
-
function
|
|
1011
|
+
function Qe({ match: e }) {
|
|
1001
1012
|
let { category: t, confidence: n, original: r, replacement: i, oldNo: a, newNo: o } = e, [c, d] = s(!1), f = n < .7, p = n.toFixed(2);
|
|
1002
1013
|
return /* @__PURE__ */ u("div", {
|
|
1003
1014
|
className: `dv-match${c ? " dv-match-kept" : ""}`,
|
|
@@ -1058,7 +1069,7 @@ function et({ match: e }) {
|
|
|
1058
1069
|
className: "dv-sign",
|
|
1059
1070
|
role: "cell",
|
|
1060
1071
|
"aria-hidden": "true",
|
|
1061
|
-
children: /* @__PURE__ */ l(
|
|
1072
|
+
children: /* @__PURE__ */ l(x, { "aria-hidden": "true" })
|
|
1062
1073
|
}),
|
|
1063
1074
|
/* @__PURE__ */ u("span", {
|
|
1064
1075
|
className: "dv-text",
|
|
@@ -1093,7 +1104,7 @@ function et({ match: e }) {
|
|
|
1093
1104
|
className: "dv-sign",
|
|
1094
1105
|
role: "cell",
|
|
1095
1106
|
"aria-hidden": "true",
|
|
1096
|
-
children: /* @__PURE__ */ l(
|
|
1107
|
+
children: /* @__PURE__ */ l(S, { "aria-hidden": "true" })
|
|
1097
1108
|
}),
|
|
1098
1109
|
/* @__PURE__ */ u("span", {
|
|
1099
1110
|
className: "dv-text",
|
|
@@ -1108,8 +1119,8 @@ function et({ match: e }) {
|
|
|
1108
1119
|
})]
|
|
1109
1120
|
});
|
|
1110
1121
|
}
|
|
1111
|
-
function
|
|
1112
|
-
let o = r === "redaction", s = o ? null :
|
|
1122
|
+
function $e({ file: e, hunks: t = [], matches: n = [], variant: r = "default", className: i = "", ...a }) {
|
|
1123
|
+
let o = r === "redaction", s = o ? null : Xe(t);
|
|
1113
1124
|
return /* @__PURE__ */ u("figure", {
|
|
1114
1125
|
className: [
|
|
1115
1126
|
"dv",
|
|
@@ -1148,7 +1159,7 @@ function tt({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
|
|
|
1148
1159
|
children: n.length === 0 ? /* @__PURE__ */ l("p", {
|
|
1149
1160
|
className: "dv-empty",
|
|
1150
1161
|
children: "no sensitive content detected. safe to share as-is."
|
|
1151
|
-
}) : n.map((e, t) => /* @__PURE__ */ l(
|
|
1162
|
+
}) : n.map((e, t) => /* @__PURE__ */ l(Qe, { match: e }, e.id ?? t))
|
|
1152
1163
|
}) : /* @__PURE__ */ l("div", {
|
|
1153
1164
|
className: "dv-body",
|
|
1154
1165
|
role: "table",
|
|
@@ -1179,7 +1190,7 @@ function tt({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
|
|
|
1179
1190
|
}), /* @__PURE__ */ l("div", {
|
|
1180
1191
|
className: "dv-hunk-pair",
|
|
1181
1192
|
role: "rowgroup",
|
|
1182
|
-
children: e.lines.map((e, t) => /* @__PURE__ */ l(
|
|
1193
|
+
children: e.lines.map((e, t) => /* @__PURE__ */ l(Ze, { line: e }, t))
|
|
1183
1194
|
})]
|
|
1184
1195
|
}, t))
|
|
1185
1196
|
})]
|
|
@@ -1187,8 +1198,8 @@ function tt({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
|
|
|
1187
1198
|
}
|
|
1188
1199
|
//#endregion
|
|
1189
1200
|
//#region src/ui/graph/types.js
|
|
1190
|
-
var
|
|
1191
|
-
function
|
|
1201
|
+
var et = T, tt = ae, nt = oe, rt = se, it = w;
|
|
1202
|
+
function at(e, t, n, r, i) {
|
|
1192
1203
|
if (e(t)) return;
|
|
1193
1204
|
let a;
|
|
1194
1205
|
try {
|
|
@@ -1198,23 +1209,23 @@ function K(e, t, n, r, i) {
|
|
|
1198
1209
|
}
|
|
1199
1210
|
throw TypeError(`Graph contract validation failed for ${a} at src/ui/graph/types.js during ${r}: ${n} is outside the canonical @peasant-labs/schema value domain (${i.join(", ")}), so Fairtrade cannot safely render this graph payload; the caller must validate and normalize the local API response before passing it to the cooked graph surface.`);
|
|
1200
1211
|
}
|
|
1201
|
-
function
|
|
1202
|
-
for (let [t, n] of e.nodes.entries())
|
|
1203
|
-
for (let [t, n] of e.violations.entries())
|
|
1212
|
+
function J(e) {
|
|
1213
|
+
for (let [t, n] of e.nodes.entries()) at(he, n.kind, `nodes[${t}].kind`, "code-map payload rendering", T);
|
|
1214
|
+
for (let [t, n] of e.violations.entries()) at(A, n.kind, `violations[${t}].kind`, "code-map payload rendering", oe);
|
|
1204
1215
|
}
|
|
1205
|
-
function
|
|
1206
|
-
for (let [t, n] of e.files.entries())
|
|
1207
|
-
for (let [t, n] of e.work.entries())
|
|
1208
|
-
for (let [t, n] of e.slice.nodes.entries())
|
|
1209
|
-
for (let [t, n] of e.violations.entries())
|
|
1216
|
+
function ot(e) {
|
|
1217
|
+
for (let [t, n] of e.files.entries()) at(de, n.status, `files[${t}].status`, "change-detail payload rendering", se);
|
|
1218
|
+
for (let [t, n] of e.work.entries()) at(k, n.binding, `work[${t}].binding`, "change-detail payload rendering", ae);
|
|
1219
|
+
for (let [t, n] of e.slice.nodes.entries()) at(he, n.kind, `slice.nodes[${t}].kind`, "change-detail payload rendering", T);
|
|
1220
|
+
for (let [t, n] of e.violations.entries()) at(A, n.kind, `violations[${t}].kind`, "change-detail payload rendering", oe);
|
|
1210
1221
|
}
|
|
1211
|
-
function
|
|
1212
|
-
|
|
1213
|
-
for (let [t, n] of e.hunks.entries()) for (let [e, r] of n.lines.entries())
|
|
1222
|
+
function st(e) {
|
|
1223
|
+
at(de, e.status, "status", "change-diff payload rendering", se);
|
|
1224
|
+
for (let [t, n] of e.hunks.entries()) for (let [e, r] of n.lines.entries()) at(ue, r.kind, `hunks[${t}].lines[${e}].kind`, "change-diff payload rendering", w);
|
|
1214
1225
|
}
|
|
1215
1226
|
//#endregion
|
|
1216
1227
|
//#region src/ui/graph/graphContractPolicy.js
|
|
1217
|
-
var
|
|
1228
|
+
var ct = Object.freeze({
|
|
1218
1229
|
decision: "decisions",
|
|
1219
1230
|
friction: "friction",
|
|
1220
1231
|
unusual: "unusual signals",
|
|
@@ -1225,23 +1236,23 @@ var J = Object.freeze({
|
|
|
1225
1236
|
});
|
|
1226
1237
|
ft(), pt();
|
|
1227
1238
|
function ut(e) {
|
|
1228
|
-
let t = e.findIndex((e) => !
|
|
1229
|
-
if (t !== -1) throw mt("validate insight values", `insights[${t}]`, `the insight kind or provenance is outside the canonical @peasant-labs/schema value domain (kinds: ${
|
|
1239
|
+
let t = e.findIndex((e) => !pe(e.kind) || !me(e.provenance));
|
|
1240
|
+
if (t !== -1) throw mt("validate insight values", `insights[${t}]`, `the insight kind or provenance is outside the canonical @peasant-labs/schema value domain (kinds: ${ce.join(", ")}; provenances: ${le.join(", ")})`, "validate and normalize the local API response to the published @peasant-labs/schema contract before rendering");
|
|
1230
1241
|
}
|
|
1231
1242
|
function dt(e) {
|
|
1232
|
-
let t = e.findIndex((e) => !
|
|
1233
|
-
if (t !== -1) throw mt("validate ranking values", `nodes[${t}]`, `the read-attribution state or read-state grade is outside the canonical @peasant-labs/schema value domain (attribution states: ${
|
|
1243
|
+
let t = e.findIndex((e) => !ge(e.readAttribution) || !_e(e.readState));
|
|
1244
|
+
if (t !== -1) throw mt("validate ranking values", `nodes[${t}]`, `the read-attribution state or read-state grade is outside the canonical @peasant-labs/schema value domain (attribution states: ${E.join(", ")}; read-state grades: ${D.join(", ")})`, "validate and normalize the local API response to the published @peasant-labs/schema contract before ranking");
|
|
1234
1245
|
}
|
|
1235
1246
|
function ft() {
|
|
1236
|
-
let e = Object.keys(
|
|
1237
|
-
if (!(t.length === 0 && n.length === 0 && e.length ===
|
|
1247
|
+
let e = Object.keys(ct), t = ce.filter((e) => typeof ct[e] != "string" || ct[e].trim() === ""), n = e.filter((e) => !pe(e));
|
|
1248
|
+
if (!(t.length === 0 && n.length === 0 && e.length === ce.length)) throw mt("validate insight labels", "INSIGHT_KIND_LABELS", `the Fairtrade label map does not exactly cover the canonical @peasant-labs/schema insight kinds (missing: ${t.join(", ") || "none"}; unknown: ${n.join(", ") || "none"})`, "add one non-empty Fairtrade UI label for each published insight kind and remove labels that are no longer in the schema contract");
|
|
1238
1249
|
}
|
|
1239
1250
|
function pt() {
|
|
1240
|
-
let e = Object.keys(lt), t =
|
|
1251
|
+
let e = Object.keys(lt), t = le.filter((e) => {
|
|
1241
1252
|
let t = lt[e];
|
|
1242
1253
|
return !t || typeof t.markerClass != "string" || t.markerClass.trim() === "";
|
|
1243
|
-
}), n = e.filter((e) => !
|
|
1244
|
-
if (!(t.length === 0 && n.length === 0 && e.length ===
|
|
1254
|
+
}), n = e.filter((e) => !me(e));
|
|
1255
|
+
if (!(t.length === 0 && n.length === 0 && e.length === le.length)) throw mt("validate insight provenance presentations", "INSIGHT_PROVENANCE_PRESENTATIONS", `the Fairtrade provenance presentation map does not exactly cover the canonical @peasant-labs/schema insight provenances (missing: ${t.join(", ") || "none"}; unknown: ${n.join(", ") || "none"})`, "add one explicit Fairtrade marker class for each published insight provenance and remove presentations that are no longer in the schema contract");
|
|
1245
1256
|
}
|
|
1246
1257
|
function mt(e, t, n, r) {
|
|
1247
1258
|
return /* @__PURE__ */ Error(`Fairtrade graph contract ${e} failed: what went wrong: invalid ${t}; why: ${n}; where: src/ui/graph/graphContractPolicy.js ${t}; when: ${e}; what it means: Fairtrade cannot render the graph value without guessing; how to fix: ${r}.`);
|
|
@@ -1695,7 +1706,7 @@ function un(e) {
|
|
|
1695
1706
|
});
|
|
1696
1707
|
}
|
|
1697
1708
|
function dn(e, t) {
|
|
1698
|
-
e &&
|
|
1709
|
+
e && J(e);
|
|
1699
1710
|
let n = X(t), r = e?.nodes ?? [];
|
|
1700
1711
|
if (!Array.isArray(r)) throw Z("derive view", "payload.nodes", "nodes is not an array", "provide a CodeMapPayload with a nodes array");
|
|
1701
1712
|
let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
@@ -1738,11 +1749,11 @@ function dn(e, t) {
|
|
|
1738
1749
|
let t = e;
|
|
1739
1750
|
for (; t;) g.add(t.id), t = t.parent ? i.get(t.parent) : null;
|
|
1740
1751
|
}
|
|
1741
|
-
let
|
|
1742
|
-
function
|
|
1752
|
+
let _ = en[n.grain], v = [];
|
|
1753
|
+
function y(e, t, n = null) {
|
|
1743
1754
|
if (h && !g.has(e.id)) return;
|
|
1744
|
-
let r = o.get(e.id) ?? [], i = r.filter((e) => !h || g.has(e.id)).map((e) => e.id), a = r.length > 0, s = a && (t <
|
|
1745
|
-
if (
|
|
1755
|
+
let r = o.get(e.id) ?? [], i = r.filter((e) => !h || g.has(e.id)).map((e) => e.id), a = r.length > 0, s = a && (t < _ || m.has(e.id)), c = !!h && i.length > 0;
|
|
1756
|
+
if (v.push({
|
|
1746
1757
|
node: { ...e },
|
|
1747
1758
|
depth: t,
|
|
1748
1759
|
parentId: n,
|
|
@@ -1751,28 +1762,28 @@ function dn(e, t) {
|
|
|
1751
1762
|
canExpand: s,
|
|
1752
1763
|
forcedOpen: c,
|
|
1753
1764
|
expanded: c || s && m.has(e.id)
|
|
1754
|
-
}), h || t <
|
|
1765
|
+
}), h || t < _ || m.has(e.id)) for (let n of r) y(n, t + 1, e.id);
|
|
1755
1766
|
}
|
|
1756
|
-
for (let e of s)
|
|
1757
|
-
let
|
|
1758
|
-
function
|
|
1767
|
+
for (let e of s) y(e, 0);
|
|
1768
|
+
let b = [];
|
|
1769
|
+
function x(e, t) {
|
|
1759
1770
|
let n = o.get(e.id) ?? [];
|
|
1760
|
-
if (n.length > 0 && (t <
|
|
1761
|
-
else
|
|
1771
|
+
if (n.length > 0 && (t < _ || m.has(e.id))) for (let e of n) x(e, t + 1);
|
|
1772
|
+
else b.push({ ...e });
|
|
1762
1773
|
}
|
|
1763
|
-
for (let e of s)
|
|
1764
|
-
let
|
|
1774
|
+
for (let e of s) x(e, 0);
|
|
1775
|
+
let S = n.selectedId ? i.get(n.selectedId) ?? null : null, C = new Set(v.map((e) => e.node.id));
|
|
1765
1776
|
return {
|
|
1766
1777
|
state: n,
|
|
1767
|
-
rows:
|
|
1768
|
-
focusedId: n.navigatorFocusedId &&
|
|
1769
|
-
selected:
|
|
1770
|
-
staleSelectedId: n.selectedId && !
|
|
1778
|
+
rows: v,
|
|
1779
|
+
focusedId: n.navigatorFocusedId && C.has(n.navigatorFocusedId) ? n.navigatorFocusedId : v[0]?.node.id ?? null,
|
|
1780
|
+
selected: S ? { ...S } : null,
|
|
1781
|
+
staleSelectedId: n.selectedId && !S ? n.selectedId : null,
|
|
1771
1782
|
canvas: {
|
|
1772
1783
|
allNodes: [...i.values()].map((e) => ({ ...e })),
|
|
1773
|
-
nodes:
|
|
1774
|
-
visibleIds:
|
|
1775
|
-
selectedId:
|
|
1784
|
+
nodes: b,
|
|
1785
|
+
visibleIds: b.map((e) => e.id),
|
|
1786
|
+
selectedId: S?.id ?? null,
|
|
1776
1787
|
grain: n.grain,
|
|
1777
1788
|
expandedIds: [...m].sort(gn),
|
|
1778
1789
|
viewport: n.viewport ? { ...n.viewport } : null,
|
|
@@ -2140,196 +2151,196 @@ function ar(e, t, n) {
|
|
|
2140
2151
|
function or({ data: i = {
|
|
2141
2152
|
nodes: [],
|
|
2142
2153
|
edges: []
|
|
2143
|
-
}, grain: f = "folders", expandedIds: p, visibleIds: h, hierarchy: g, selectedId:
|
|
2144
|
-
let
|
|
2145
|
-
x: $(
|
|
2146
|
-
y: $(
|
|
2147
|
-
})), [
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
]),
|
|
2152
|
-
x:
|
|
2153
|
-
y:
|
|
2154
|
-
} :
|
|
2155
|
-
x: $(
|
|
2156
|
-
y: $(
|
|
2157
|
-
} :
|
|
2158
|
-
|
|
2159
|
-
if (
|
|
2160
|
-
if (
|
|
2161
|
-
|
|
2154
|
+
}, grain: f = "folders", expandedIds: p, visibleIds: h, hierarchy: g, selectedId: y, highlightedIds: C, nodeDeltas: te = {}, edgeDeltas: re = {}, onSelect: ie, onGrainChange: ae, onExpandedIdsChange: w, onExpand: oe, height: se = 520, ariaLabel: ce = "code map", className: le = "", viewport: T, onViewportChange: E, onStateAction: D, canonicalControlled: O = !1 }) {
|
|
2155
|
+
let k = i?.nodes ?? [], ue = i?.edges ?? [], A = r().replace(/[:]/g, ""), de = `${A}-live`, fe = `${A}-list`, [pe, me] = s(Vn[f] === void 0 ? "folders" : f), [he, ge] = s(() => cr(p)), [_e, ve] = s(y ?? null), [j, ye] = s(null), [be, xe] = s(() => lr(T?.scale) ? T.scale : 1), [Se, Ce] = s(() => ({
|
|
2156
|
+
x: $(T?.panX, 0),
|
|
2157
|
+
y: $(T?.panY, 0)
|
|
2158
|
+
})), [we, Te] = s(""), [Ee, M] = s(!1), N = o(null), P = o(null), [F, De] = s(null), Oe = o(null), ke = o(!1), Ae = o(T != null), je = T && lr(T.scale) ? `${T.scale}|${$(T.panX, 0)}|${$(T.panY, 0)}` : "", Me = o(je), Ne = o(je), Pe = o(!1), Fe = o(f), Ie = o(y), Le = ur(p), Re = ur(C), I = O ? Vn[f] === void 0 ? "folders" : f : pe, L = a(() => O ? cr(p) : he, [
|
|
2159
|
+
O,
|
|
2160
|
+
Le,
|
|
2161
|
+
he
|
|
2162
|
+
]), R = O ? y ?? null : _e, ze = O && T != null && lr(T.scale), z = F ? F.scale : ze ? T.scale : be, B = F ? {
|
|
2163
|
+
x: F.panX,
|
|
2164
|
+
y: F.panY
|
|
2165
|
+
} : ze ? {
|
|
2166
|
+
x: $(T.panX, 0),
|
|
2167
|
+
y: $(T.panY, 0)
|
|
2168
|
+
} : Se, Be = o(z), Ve = o(B);
|
|
2169
|
+
Be.current = z, Ve.current = B, n(() => {
|
|
2170
|
+
if (F && !P.current) {
|
|
2171
|
+
if (ze && T.scale === F.scale && $(T.panX, 0) === F.panX && $(T.panY, 0) === F.panY) {
|
|
2172
|
+
De(null);
|
|
2162
2173
|
return;
|
|
2163
2174
|
}
|
|
2164
|
-
return
|
|
2175
|
+
return Oe.current = setTimeout(() => De(null), Un), () => clearTimeout(Oe.current);
|
|
2165
2176
|
}
|
|
2166
2177
|
}, [
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2178
|
+
F,
|
|
2179
|
+
ze,
|
|
2180
|
+
T?.scale,
|
|
2181
|
+
T?.panX,
|
|
2182
|
+
T?.panY
|
|
2172
2183
|
]), n(() => {
|
|
2173
|
-
|
|
2174
|
-
}, [
|
|
2175
|
-
!
|
|
2176
|
-
}, [
|
|
2177
|
-
|
|
2178
|
-
}, [
|
|
2179
|
-
if (
|
|
2180
|
-
if (!
|
|
2184
|
+
O || f !== Fe.current && (Fe.current = f, Vn[f] !== void 0 && me(f));
|
|
2185
|
+
}, [O, f]), n(() => {
|
|
2186
|
+
!O && p !== void 0 && ge(cr(p));
|
|
2187
|
+
}, [O, Le]), n(() => {
|
|
2188
|
+
O || y !== Ie.current && (Ie.current = y, y !== void 0 && ve(y));
|
|
2189
|
+
}, [O, y]), n(() => {
|
|
2190
|
+
if (O) {
|
|
2191
|
+
if (!T && Ne.current !== "") Ne.current = "", Ae.current = !1, ke.current = !1, xe(1), Ce({
|
|
2181
2192
|
x: 0,
|
|
2182
2193
|
y: 0
|
|
2183
2194
|
});
|
|
2184
|
-
else if (
|
|
2185
|
-
let e = `${
|
|
2186
|
-
e !==
|
|
2195
|
+
else if (T && lr(T.scale)) {
|
|
2196
|
+
let e = `${T.scale}|${$(T.panX, 0)}|${$(T.panY, 0)}`;
|
|
2197
|
+
e !== Ne.current && (Ne.current = e, Ae.current = !0);
|
|
2187
2198
|
}
|
|
2188
2199
|
return;
|
|
2189
2200
|
}
|
|
2190
|
-
if (!
|
|
2191
|
-
if (
|
|
2192
|
-
|
|
2201
|
+
if (!T) {
|
|
2202
|
+
if (Ne.current === "") return;
|
|
2203
|
+
Ne.current = "", Me.current = "1|0|0", Ae.current = !1, xe(1), Ce({
|
|
2193
2204
|
x: 0,
|
|
2194
2205
|
y: 0
|
|
2195
2206
|
});
|
|
2196
2207
|
return;
|
|
2197
2208
|
}
|
|
2198
|
-
if (!lr(
|
|
2199
|
-
let e = `${
|
|
2200
|
-
e !==
|
|
2201
|
-
x: $(
|
|
2202
|
-
y: $(
|
|
2209
|
+
if (!lr(T.scale)) return;
|
|
2210
|
+
let e = `${T.scale}|${$(T.panX, 0)}|${$(T.panY, 0)}`;
|
|
2211
|
+
e !== Ne.current && (Ne.current = e, Ae.current = !0, Me.current = e, xe(T.scale), Ce({
|
|
2212
|
+
x: $(T.panX, 0),
|
|
2213
|
+
y: $(T.panY, 0)
|
|
2203
2214
|
}));
|
|
2204
2215
|
}, [
|
|
2216
|
+
O,
|
|
2205
2217
|
T,
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
C?.panY
|
|
2218
|
+
T?.scale,
|
|
2219
|
+
T?.panX,
|
|
2220
|
+
T?.panY
|
|
2210
2221
|
]), n(() => {
|
|
2211
|
-
if (
|
|
2212
|
-
let e = `${
|
|
2213
|
-
|
|
2214
|
-
scale:
|
|
2215
|
-
panX:
|
|
2216
|
-
panY:
|
|
2217
|
-
}),
|
|
2222
|
+
if (O || !E && !D) return;
|
|
2223
|
+
let e = `${z}|${B.x}|${B.y}`;
|
|
2224
|
+
Me.current !== e && (Me.current = e, E?.({
|
|
2225
|
+
scale: z,
|
|
2226
|
+
panX: B.x,
|
|
2227
|
+
panY: B.y
|
|
2228
|
+
}), Pe.current && (Pe.current = !1, D?.({
|
|
2218
2229
|
type: "set-viewport",
|
|
2219
2230
|
viewport: {
|
|
2220
|
-
scale:
|
|
2221
|
-
panX:
|
|
2222
|
-
panY:
|
|
2231
|
+
scale: z,
|
|
2232
|
+
panX: B.x,
|
|
2233
|
+
panY: B.y
|
|
2223
2234
|
}
|
|
2224
2235
|
})));
|
|
2225
2236
|
}, [
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2237
|
+
O,
|
|
2238
|
+
D,
|
|
2239
|
+
E,
|
|
2240
|
+
B.x,
|
|
2241
|
+
B.y,
|
|
2242
|
+
z
|
|
2232
2243
|
]);
|
|
2233
|
-
let
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2244
|
+
let V = a(() => g ? Xn(k, g) : Yn(k), [k, g]), He = a(() => h === void 0 ? Qn(V, Vn[I], L) : Array.from(h, (e) => V.byId.get(e)).filter(Boolean), [
|
|
2245
|
+
V,
|
|
2246
|
+
I,
|
|
2247
|
+
L,
|
|
2237
2248
|
ur(h)
|
|
2238
|
-
]),
|
|
2249
|
+
]), H = a(() => new Set(He.map((e) => e.id)), [He]), { positioned: U, width: W, height: G } = a(() => $n(He, V), [He, V]), Ue = a(() => {
|
|
2239
2250
|
let e = /* @__PURE__ */ new Map();
|
|
2240
|
-
for (let t of
|
|
2251
|
+
for (let t of U) e.set(t.node.id, t);
|
|
2241
2252
|
return e;
|
|
2242
|
-
}, [
|
|
2253
|
+
}, [U]), We = a(() => {
|
|
2243
2254
|
let e = /* @__PURE__ */ new Map();
|
|
2244
|
-
for (let [t, n] of
|
|
2255
|
+
for (let [t, n] of V.children) e.set(t, n.length);
|
|
2245
2256
|
return e;
|
|
2246
|
-
}, [
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
]),
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
]),
|
|
2255
|
-
let e = cr(
|
|
2257
|
+
}, [V]), Ge = a(() => tr(ue, V.parentIdByChild, H), [
|
|
2258
|
+
ue,
|
|
2259
|
+
V.parentIdByChild,
|
|
2260
|
+
H
|
|
2261
|
+
]), Ke = a(() => Ge.reduce((e, t) => Math.max(e, t.weight), 1), [Ge]), qe = a(() => nr(k, V.parentIdByChild, H), [
|
|
2262
|
+
k,
|
|
2263
|
+
V.parentIdByChild,
|
|
2264
|
+
H
|
|
2265
|
+
]), K = a(() => {
|
|
2266
|
+
let e = cr(C);
|
|
2256
2267
|
if (e.size === 0) return e;
|
|
2257
|
-
let t = er(
|
|
2268
|
+
let t = er(V.parentIdByChild, H), n = /* @__PURE__ */ new Set();
|
|
2258
2269
|
for (let r of e) {
|
|
2259
2270
|
let e = t(r);
|
|
2260
2271
|
e && n.add(e);
|
|
2261
2272
|
}
|
|
2262
2273
|
return n;
|
|
2263
2274
|
}, [
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
]),
|
|
2268
|
-
let e =
|
|
2269
|
-
return e ?
|
|
2270
|
-
}, [
|
|
2271
|
-
|
|
2275
|
+
Re,
|
|
2276
|
+
V.parentIdByChild,
|
|
2277
|
+
H
|
|
2278
|
+
]), Je = a(() => {
|
|
2279
|
+
let e = we.trim().toLowerCase();
|
|
2280
|
+
return e ? k.filter((t) => t.id.toLowerCase().includes(e) || (t.label || "").toLowerCase().includes(e)).slice(0, 8) : [];
|
|
2281
|
+
}, [k, we]), Ye = t((e) => {
|
|
2282
|
+
E?.(e), D?.({
|
|
2272
2283
|
type: "set-viewport",
|
|
2273
2284
|
viewport: e
|
|
2274
2285
|
});
|
|
2275
|
-
}, [
|
|
2276
|
-
if (
|
|
2277
|
-
|
|
2286
|
+
}, [D, E]), q = t((e, t) => {
|
|
2287
|
+
if (O && t) {
|
|
2288
|
+
Ye(e);
|
|
2278
2289
|
return;
|
|
2279
2290
|
}
|
|
2280
|
-
t && (
|
|
2291
|
+
t && (Pe.current = !0), xe(e.scale), Ce({
|
|
2281
2292
|
x: e.panX,
|
|
2282
2293
|
y: e.panY
|
|
2283
2294
|
});
|
|
2284
|
-
}, [
|
|
2285
|
-
let t =
|
|
2286
|
-
if (!t ||
|
|
2295
|
+
}, [O, Ye]), Xe = t((e = !1) => {
|
|
2296
|
+
let t = N.current;
|
|
2297
|
+
if (!t || W <= 0 || G <= 0) return;
|
|
2287
2298
|
let n = t.clientWidth, r = t.clientHeight;
|
|
2288
2299
|
if (n <= 0 || r <= 0) return;
|
|
2289
|
-
let i = Math.min(n /
|
|
2290
|
-
|
|
2300
|
+
let i = Math.min(n / W, r / G), a = Math.max(Y.min, Math.min(Y.max, i));
|
|
2301
|
+
q({
|
|
2291
2302
|
scale: a,
|
|
2292
|
-
panX: (n -
|
|
2293
|
-
panY: (r -
|
|
2303
|
+
panX: (n - W * a) / 2,
|
|
2304
|
+
panY: (r - G * a) / 2
|
|
2294
2305
|
}, e);
|
|
2295
2306
|
}, [
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
]),
|
|
2300
|
-
let n =
|
|
2307
|
+
q,
|
|
2308
|
+
W,
|
|
2309
|
+
G
|
|
2310
|
+
]), Ze = t((e, t = !1) => {
|
|
2311
|
+
let n = N.current;
|
|
2301
2312
|
if (!n) return !1;
|
|
2302
2313
|
let r = n.clientWidth, i = n.clientHeight;
|
|
2303
2314
|
if (r <= 0 || i <= 0) return !1;
|
|
2304
|
-
let a =
|
|
2315
|
+
let a = U.filter((t) => e.has(t.node.id));
|
|
2305
2316
|
if (a.length === 0) return !1;
|
|
2306
2317
|
let o = Math.min(...a.map((e) => e.x)), s = Math.min(...a.map((e) => e.y)), c = Math.max(...a.map((e) => e.x + e.w)), l = Math.max(...a.map((e) => e.y + e.h)), u = c - o, d = l - s;
|
|
2307
2318
|
if (u <= 0 || d <= 0) return !1;
|
|
2308
2319
|
let f = Math.min(r / u, i / d), p = Math.max(Y.min, Math.min(Y.max, f));
|
|
2309
|
-
return
|
|
2320
|
+
return q({
|
|
2310
2321
|
scale: p,
|
|
2311
2322
|
panX: r / 2 - (o + u / 2) * p,
|
|
2312
2323
|
panY: i / 2 - (s + d / 2) * p
|
|
2313
2324
|
}, t), !0;
|
|
2314
|
-
}, [
|
|
2325
|
+
}, [q, U]), [Qe, $e] = s(!1);
|
|
2315
2326
|
n(() => {
|
|
2316
|
-
if (!
|
|
2317
|
-
let e = window.setTimeout(() =>
|
|
2327
|
+
if (!Qe) return;
|
|
2328
|
+
let e = window.setTimeout(() => $e(!1), 200);
|
|
2318
2329
|
return () => window.clearTimeout(e);
|
|
2319
|
-
}, [
|
|
2320
|
-
let
|
|
2330
|
+
}, [Qe]);
|
|
2331
|
+
let et = a(() => U.map((e) => e.node.id).join("|"), [U]), tt = ze ? `canonical|${T.scale}|${$(T.panX, 0)}|${$(T.panY, 0)}` : O ? "canonical|auto-fit" : "legacy", nt = o(L);
|
|
2321
2332
|
n(() => {
|
|
2322
|
-
let e =
|
|
2323
|
-
if (
|
|
2324
|
-
|
|
2333
|
+
let e = nt.current;
|
|
2334
|
+
if (nt.current = L, Ae.current) {
|
|
2335
|
+
Ae.current = !1, ke.current = !0;
|
|
2325
2336
|
return;
|
|
2326
2337
|
}
|
|
2327
|
-
if (!
|
|
2328
|
-
|
|
2338
|
+
if (!ke.current) {
|
|
2339
|
+
ke.current = !0, Xe(ze);
|
|
2329
2340
|
return;
|
|
2330
2341
|
}
|
|
2331
2342
|
let t = null;
|
|
2332
|
-
for (let n of
|
|
2343
|
+
for (let n of L) if (!e.has(n)) {
|
|
2333
2344
|
t = n;
|
|
2334
2345
|
break;
|
|
2335
2346
|
}
|
|
@@ -2337,164 +2348,164 @@ function or({ data: i = {
|
|
|
2337
2348
|
let e = /* @__PURE__ */ new Set([t]), n = [t];
|
|
2338
2349
|
for (; n.length > 0;) {
|
|
2339
2350
|
let t = n.pop();
|
|
2340
|
-
for (let r of
|
|
2351
|
+
for (let r of V.children.get(t) ?? []) e.add(r.id), n.push(r.id);
|
|
2341
2352
|
}
|
|
2342
|
-
let r = [...e].filter((e) =>
|
|
2343
|
-
if (
|
|
2353
|
+
let r = [...e].filter((e) => H.has(e));
|
|
2354
|
+
if ($e(!0), r.length > 0 && Ze(new Set(r), !0)) return;
|
|
2344
2355
|
}
|
|
2345
|
-
|
|
2346
|
-
}, [
|
|
2347
|
-
let
|
|
2348
|
-
let t =
|
|
2356
|
+
Xe(ze);
|
|
2357
|
+
}, [et, tt]);
|
|
2358
|
+
let rt = t((e) => {
|
|
2359
|
+
let t = N.current, n = t ? t.clientWidth / 2 : 0, r = t ? t.clientHeight / 2 : 0, i = Be.current, a = Math.max(Y.min, Math.min(Y.max, i * e));
|
|
2349
2360
|
if (a === i) return;
|
|
2350
|
-
let o =
|
|
2351
|
-
|
|
2361
|
+
let o = Ve.current;
|
|
2362
|
+
q({
|
|
2352
2363
|
scale: a,
|
|
2353
2364
|
panX: n - (n - o.x) / i * a,
|
|
2354
2365
|
panY: r - (r - o.y) / i * a
|
|
2355
2366
|
}, !0);
|
|
2356
|
-
}, [
|
|
2367
|
+
}, [q]), it = t((e) => {
|
|
2357
2368
|
if (!(e.ctrlKey || e.metaKey)) return;
|
|
2358
2369
|
e.preventDefault();
|
|
2359
|
-
let t =
|
|
2370
|
+
let t = N.current;
|
|
2360
2371
|
if (!t) return;
|
|
2361
|
-
let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a =
|
|
2372
|
+
let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a = Be.current, o = Math.exp(-e.deltaY * .01), s = Math.max(1 / zn, Math.min(zn, o)), c = Math.max(Y.min, Math.min(Y.max, a * s));
|
|
2362
2373
|
if (c === a) return;
|
|
2363
|
-
let l =
|
|
2364
|
-
|
|
2374
|
+
let l = Ve.current;
|
|
2375
|
+
q({
|
|
2365
2376
|
scale: c,
|
|
2366
2377
|
panX: r - (r - l.x) / a * c,
|
|
2367
2378
|
panY: i - (i - l.y) / a * c
|
|
2368
2379
|
}, !0);
|
|
2369
|
-
}, [
|
|
2380
|
+
}, [q]);
|
|
2370
2381
|
n(() => {
|
|
2371
|
-
let e =
|
|
2372
|
-
if (e) return e.addEventListener("wheel",
|
|
2373
|
-
}, [
|
|
2374
|
-
let
|
|
2375
|
-
let t =
|
|
2382
|
+
let e = N.current;
|
|
2383
|
+
if (e) return e.addEventListener("wheel", it, { passive: !1 }), () => e.removeEventListener("wheel", it);
|
|
2384
|
+
}, [it]);
|
|
2385
|
+
let at = t((e) => {
|
|
2386
|
+
let t = Ue.get(e), n = N.current;
|
|
2376
2387
|
if (!t || !n) return;
|
|
2377
|
-
let r = Math.max(
|
|
2378
|
-
|
|
2388
|
+
let r = Math.max(z, 1);
|
|
2389
|
+
q({
|
|
2379
2390
|
scale: r,
|
|
2380
2391
|
panX: n.clientWidth / 2 - (t.x + t.w / 2) * r,
|
|
2381
2392
|
panY: n.clientHeight / 2 - (t.y + t.h / 2) * r
|
|
2382
2393
|
}, !0);
|
|
2383
2394
|
}, [
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
]),
|
|
2388
|
-
if (
|
|
2389
|
-
|
|
2395
|
+
q,
|
|
2396
|
+
Ue,
|
|
2397
|
+
z
|
|
2398
|
+
]), J = t((e) => {
|
|
2399
|
+
if (O && e === R) return;
|
|
2400
|
+
O || ve(e), D?.(e ? {
|
|
2390
2401
|
type: "select",
|
|
2391
2402
|
id: e
|
|
2392
2403
|
} : { type: "clear-selection" });
|
|
2393
|
-
let t = e ?
|
|
2394
|
-
|
|
2404
|
+
let t = e ? V.byId.get(e) : null;
|
|
2405
|
+
ie?.(e, t ? sr(t) : null);
|
|
2395
2406
|
}, [
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
]),
|
|
2402
|
-
|
|
2407
|
+
O,
|
|
2408
|
+
ie,
|
|
2409
|
+
D,
|
|
2410
|
+
R,
|
|
2411
|
+
V.byId
|
|
2412
|
+
]), ot = t((e) => {
|
|
2413
|
+
O || (me(e), ge(/* @__PURE__ */ new Set())), D?.({
|
|
2403
2414
|
type: "set-grain",
|
|
2404
2415
|
grain: Bn[e]
|
|
2405
|
-
}),
|
|
2416
|
+
}), ae?.(e), O || w?.([]);
|
|
2406
2417
|
}, [
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
]), [
|
|
2418
|
+
O,
|
|
2419
|
+
w,
|
|
2420
|
+
ae,
|
|
2421
|
+
D
|
|
2422
|
+
]), [st, ct] = s(null), [lt, ut] = s("");
|
|
2412
2423
|
n(() => {
|
|
2413
|
-
|
|
2414
|
-
}, [
|
|
2424
|
+
st && !L.has(st) && ct(null);
|
|
2425
|
+
}, [st, L]);
|
|
2415
2426
|
let dt = t((e) => {
|
|
2416
|
-
if ((
|
|
2417
|
-
let t =
|
|
2418
|
-
if (n.has(e)) n.delete(e),
|
|
2427
|
+
if ((We.get(e) || 0) === 0) return;
|
|
2428
|
+
let t = V.byId.get(e), n = new Set(L);
|
|
2429
|
+
if (n.has(e)) n.delete(e), ct((t) => {
|
|
2419
2430
|
if (t !== e) return t;
|
|
2420
|
-
let r =
|
|
2431
|
+
let r = V.parentIdByChild.get(e) ?? null;
|
|
2421
2432
|
return r && n.has(r) ? r : null;
|
|
2422
2433
|
}), ut(`closed ${qn(t?.label || e)}`);
|
|
2423
2434
|
else {
|
|
2424
|
-
n.add(e),
|
|
2425
|
-
let r =
|
|
2435
|
+
n.add(e), oe?.(e), ct(e);
|
|
2436
|
+
let r = We.get(e) || 0;
|
|
2426
2437
|
ut(`opened ${qn(t?.label || e)}, showing ${r} item${r === 1 ? "" : "s"}`);
|
|
2427
2438
|
}
|
|
2428
|
-
|
|
2439
|
+
O || ge(n), D?.({
|
|
2429
2440
|
type: "set-expanded",
|
|
2430
2441
|
ids: Array.from(n)
|
|
2431
|
-
}),
|
|
2442
|
+
}), w?.(Array.from(n));
|
|
2432
2443
|
}, [
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
S,
|
|
2444
|
+
O,
|
|
2445
|
+
We,
|
|
2446
|
+
L,
|
|
2447
|
+
oe,
|
|
2438
2448
|
w,
|
|
2439
|
-
|
|
2440
|
-
|
|
2449
|
+
D,
|
|
2450
|
+
V.byId,
|
|
2451
|
+
V.parentIdByChild
|
|
2441
2452
|
]), ft = a(() => {
|
|
2442
|
-
if (!
|
|
2443
|
-
let e = [], t =
|
|
2453
|
+
if (!st) return [];
|
|
2454
|
+
let e = [], t = st;
|
|
2444
2455
|
for (; t;) {
|
|
2445
|
-
let n =
|
|
2456
|
+
let n = V.byId.get(t);
|
|
2446
2457
|
if (!n) break;
|
|
2447
|
-
e.unshift(n), t =
|
|
2458
|
+
e.unshift(n), t = V.parentIdByChild.get(t) ?? null;
|
|
2448
2459
|
}
|
|
2449
2460
|
return e;
|
|
2450
|
-
}, [
|
|
2451
|
-
|
|
2461
|
+
}, [st, V]), pt = t(() => {
|
|
2462
|
+
O || ge(/* @__PURE__ */ new Set()), D?.({
|
|
2452
2463
|
type: "set-expanded",
|
|
2453
2464
|
ids: []
|
|
2454
|
-
}),
|
|
2465
|
+
}), w?.([]), ct(null), ut("back to the top level");
|
|
2455
2466
|
}, [
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2467
|
+
O,
|
|
2468
|
+
w,
|
|
2469
|
+
D
|
|
2459
2470
|
]), mt = t((e) => {
|
|
2460
2471
|
let t = ft.slice(0, e + 1), n = t.map((e) => e.id), r = new Set(n);
|
|
2461
|
-
|
|
2472
|
+
O || ge(r), D?.({
|
|
2462
2473
|
type: "set-expanded",
|
|
2463
2474
|
ids: n
|
|
2464
|
-
}),
|
|
2475
|
+
}), w?.(n);
|
|
2465
2476
|
let i = t[t.length - 1] ?? null;
|
|
2466
|
-
|
|
2477
|
+
ct(i?.id ?? null), ut(i ? `back to ${qn(i.label || i.id)}` : "back to the top level");
|
|
2467
2478
|
}, [
|
|
2468
2479
|
ft,
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2480
|
+
O,
|
|
2481
|
+
w,
|
|
2482
|
+
D
|
|
2472
2483
|
]), ht = t((e) => {
|
|
2473
2484
|
let t = e.key;
|
|
2474
2485
|
if (t === "+" || t === "=") {
|
|
2475
|
-
e.preventDefault(),
|
|
2486
|
+
e.preventDefault(), rt(zn);
|
|
2476
2487
|
return;
|
|
2477
2488
|
}
|
|
2478
2489
|
if (t === "-" || t === "_") {
|
|
2479
|
-
e.preventDefault(),
|
|
2490
|
+
e.preventDefault(), rt(1 / zn);
|
|
2480
2491
|
return;
|
|
2481
2492
|
}
|
|
2482
2493
|
if (t === "0") {
|
|
2483
|
-
e.preventDefault(),
|
|
2494
|
+
e.preventDefault(), Xe(!0);
|
|
2484
2495
|
return;
|
|
2485
2496
|
}
|
|
2486
2497
|
if (t === "ArrowLeft" || t === "ArrowRight" || t === "ArrowUp" || t === "ArrowDown") {
|
|
2487
2498
|
e.preventDefault();
|
|
2488
|
-
let n =
|
|
2499
|
+
let n = j ? Ue.get(j) : void 0;
|
|
2489
2500
|
if (!n) {
|
|
2490
|
-
let e = rr(
|
|
2491
|
-
e &&
|
|
2501
|
+
let e = rr(U);
|
|
2502
|
+
e && ye(e.node.id);
|
|
2492
2503
|
return;
|
|
2493
2504
|
}
|
|
2494
2505
|
let r;
|
|
2495
|
-
r = t === "ArrowLeft" ? ir(
|
|
2496
|
-
|
|
2497
|
-
scale:
|
|
2506
|
+
r = t === "ArrowLeft" ? ir(U, n, -1) : t === "ArrowRight" ? ir(U, n, 1) : t === "ArrowUp" ? ar(U, n, -1) : ar(U, n, 1), r && (ye(r.node.id), mr(r, N.current, z, B, (e) => {
|
|
2507
|
+
q({
|
|
2508
|
+
scale: z,
|
|
2498
2509
|
panX: e.x,
|
|
2499
2510
|
panY: e.y
|
|
2500
2511
|
}, !0);
|
|
@@ -2502,118 +2513,118 @@ function or({ data: i = {
|
|
|
2502
2513
|
return;
|
|
2503
2514
|
}
|
|
2504
2515
|
if (t === "Enter") {
|
|
2505
|
-
if (!
|
|
2506
|
-
e.preventDefault(), e.shiftKey ? dt(
|
|
2516
|
+
if (!j) return;
|
|
2517
|
+
e.preventDefault(), e.shiftKey ? dt(j) : O ? R !== j && J(j) : J(R === j ? null : j);
|
|
2507
2518
|
return;
|
|
2508
2519
|
}
|
|
2509
2520
|
if (t === "e" || t === "E") {
|
|
2510
|
-
if (!
|
|
2511
|
-
e.preventDefault(), dt(
|
|
2521
|
+
if (!j) return;
|
|
2522
|
+
e.preventDefault(), dt(j);
|
|
2512
2523
|
return;
|
|
2513
2524
|
}
|
|
2514
|
-
t === "Escape" &&
|
|
2525
|
+
t === "Escape" && R && (e.preventDefault(), J(null));
|
|
2515
2526
|
}, [
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
I,
|
|
2520
|
-
L,
|
|
2527
|
+
j,
|
|
2528
|
+
U,
|
|
2529
|
+
Ue,
|
|
2521
2530
|
R,
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2531
|
+
z,
|
|
2532
|
+
B,
|
|
2533
|
+
O,
|
|
2534
|
+
q,
|
|
2535
|
+
rt,
|
|
2536
|
+
Xe,
|
|
2526
2537
|
dt,
|
|
2527
|
-
|
|
2538
|
+
J
|
|
2528
2539
|
]), gt = t((e) => {
|
|
2529
|
-
let t =
|
|
2540
|
+
let t = P.current;
|
|
2530
2541
|
if (!t || e !== t.pointerId) return;
|
|
2531
|
-
|
|
2532
|
-
let n =
|
|
2542
|
+
P.current = null;
|
|
2543
|
+
let n = N.current;
|
|
2533
2544
|
try {
|
|
2534
2545
|
n?.releasePointerCapture?.(e);
|
|
2535
2546
|
} catch {}
|
|
2536
|
-
|
|
2537
|
-
}, [
|
|
2547
|
+
O && De(null);
|
|
2548
|
+
}, [O]), _t = t((e) => {
|
|
2538
2549
|
if (e.button !== 0 || e.target instanceof Element && e.target.closest("button, a, input, select, textarea")) return;
|
|
2539
|
-
if (
|
|
2540
|
-
if (Date.now() -
|
|
2541
|
-
gt(
|
|
2550
|
+
if (P.current) {
|
|
2551
|
+
if (Date.now() - P.current.startedAt < Wn) return;
|
|
2552
|
+
gt(P.current.pointerId);
|
|
2542
2553
|
}
|
|
2543
|
-
let t =
|
|
2544
|
-
t && t.setPointerCapture?.(e.pointerId),
|
|
2554
|
+
let t = N.current;
|
|
2555
|
+
t && t.setPointerCapture?.(e.pointerId), P.current = {
|
|
2545
2556
|
pointerId: e.pointerId,
|
|
2546
2557
|
startX: e.clientX,
|
|
2547
2558
|
startY: e.clientY,
|
|
2548
|
-
panX:
|
|
2549
|
-
panY:
|
|
2559
|
+
panX: B.x,
|
|
2560
|
+
panY: B.y,
|
|
2550
2561
|
moved: !1,
|
|
2551
2562
|
nextPan: null,
|
|
2552
2563
|
startedAt: Date.now()
|
|
2553
2564
|
};
|
|
2554
|
-
}, [
|
|
2555
|
-
let t =
|
|
2565
|
+
}, [B, gt]), vt = t((e) => {
|
|
2566
|
+
let t = P.current;
|
|
2556
2567
|
if (!t || e.pointerId !== t.pointerId) return;
|
|
2557
2568
|
let n = e.clientX - t.startX, r = e.clientY - t.startY;
|
|
2558
2569
|
!t.moved && Math.abs(n) + Math.abs(r) > 3 && (t.moved = !0), t.moved && (t.nextPan = {
|
|
2559
|
-
scale:
|
|
2570
|
+
scale: Be.current,
|
|
2560
2571
|
panX: t.panX + n,
|
|
2561
2572
|
panY: t.panY + r
|
|
2562
|
-
},
|
|
2563
|
-
}, [
|
|
2564
|
-
let t =
|
|
2573
|
+
}, O ? De(t.nextPan) : q(t.nextPan, !0));
|
|
2574
|
+
}, [q, O]), yt = t((e) => {
|
|
2575
|
+
let t = P.current;
|
|
2565
2576
|
if (!t || e.pointerId !== t.pointerId) return;
|
|
2566
|
-
|
|
2567
|
-
let n =
|
|
2577
|
+
P.current = null;
|
|
2578
|
+
let n = N.current;
|
|
2568
2579
|
try {
|
|
2569
2580
|
n?.releasePointerCapture?.(e.pointerId);
|
|
2570
2581
|
} catch {}
|
|
2571
|
-
t.moved &&
|
|
2582
|
+
t.moved && O && t.nextPan && (q(t.nextPan, !0), De({ ...t.nextPan })), !t.moved && e.target === e.currentTarget && J(null);
|
|
2572
2583
|
}, [
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2584
|
+
q,
|
|
2585
|
+
O,
|
|
2586
|
+
J
|
|
2576
2587
|
]), bt = t((e) => gt(e.pointerId), [gt]), xt = t((e) => gt(e.pointerId), [gt]), St = a(() => {
|
|
2577
|
-
if (!
|
|
2578
|
-
let e =
|
|
2588
|
+
if (!j) return "";
|
|
2589
|
+
let e = V.byId.get(j);
|
|
2579
2590
|
return e ? pr(e, {
|
|
2580
|
-
selected:
|
|
2581
|
-
expanded:
|
|
2582
|
-
violations:
|
|
2591
|
+
selected: R === j,
|
|
2592
|
+
expanded: L.has(j),
|
|
2593
|
+
violations: qe.get(j) || 0
|
|
2583
2594
|
}) : "";
|
|
2584
2595
|
}, [
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2596
|
+
j,
|
|
2597
|
+
V.byId,
|
|
2598
|
+
R,
|
|
2599
|
+
L,
|
|
2600
|
+
qe
|
|
2590
2601
|
]), Ct = a(() => {
|
|
2591
|
-
let e =
|
|
2592
|
-
if (!e ||
|
|
2602
|
+
let e = N.current;
|
|
2603
|
+
if (!e || W <= 0 || G <= 0) return null;
|
|
2593
2604
|
let t = e.clientWidth, n = e.clientHeight;
|
|
2594
2605
|
return {
|
|
2595
|
-
graphW:
|
|
2596
|
-
graphH:
|
|
2597
|
-
viewX: -
|
|
2598
|
-
viewY: -
|
|
2599
|
-
viewW: t /
|
|
2600
|
-
viewH: n /
|
|
2606
|
+
graphW: W,
|
|
2607
|
+
graphH: G,
|
|
2608
|
+
viewX: -B.x / z,
|
|
2609
|
+
viewY: -B.y / z,
|
|
2610
|
+
viewW: t / z,
|
|
2611
|
+
viewH: n / z
|
|
2601
2612
|
};
|
|
2602
2613
|
}, [
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
]), wt =
|
|
2614
|
+
B,
|
|
2615
|
+
z,
|
|
2616
|
+
W,
|
|
2617
|
+
G
|
|
2618
|
+
]), wt = U.length === 0, Tt = (e) => `${A}-grain-${e}`;
|
|
2608
2619
|
return /* @__PURE__ */ u("div", {
|
|
2609
|
-
className: ["mc",
|
|
2610
|
-
style: { height:
|
|
2620
|
+
className: ["mc", le].filter(Boolean).join(" "),
|
|
2621
|
+
style: { height: se },
|
|
2611
2622
|
role: "application",
|
|
2612
|
-
"aria-label":
|
|
2623
|
+
"aria-label": ce,
|
|
2613
2624
|
"aria-roledescription": "code structure map",
|
|
2614
2625
|
children: [
|
|
2615
2626
|
/* @__PURE__ */ l("div", {
|
|
2616
|
-
id:
|
|
2627
|
+
id: de,
|
|
2617
2628
|
className: "mc-sr",
|
|
2618
2629
|
role: "status",
|
|
2619
2630
|
"aria-live": "polite",
|
|
@@ -2629,11 +2640,11 @@ function or({ data: i = {
|
|
|
2629
2640
|
id: Tt(e.id),
|
|
2630
2641
|
type: "button",
|
|
2631
2642
|
role: "radio",
|
|
2632
|
-
"aria-checked":
|
|
2643
|
+
"aria-checked": I === e.id,
|
|
2633
2644
|
className: "mc-seg-btn mono",
|
|
2634
|
-
"data-active":
|
|
2635
|
-
onClick: () =>
|
|
2636
|
-
children: [
|
|
2645
|
+
"data-active": I === e.id ? "true" : void 0,
|
|
2646
|
+
onClick: () => ot(e.id),
|
|
2647
|
+
children: [I === e.id && /* @__PURE__ */ l(d, {
|
|
2637
2648
|
className: "lucide",
|
|
2638
2649
|
"aria-hidden": "true"
|
|
2639
2650
|
}), e.label]
|
|
@@ -2641,11 +2652,11 @@ function or({ data: i = {
|
|
|
2641
2652
|
}), /* @__PURE__ */ u("div", {
|
|
2642
2653
|
className: "mc-search",
|
|
2643
2654
|
role: "combobox",
|
|
2644
|
-
"aria-expanded":
|
|
2655
|
+
"aria-expanded": Ee && Je.length > 0,
|
|
2645
2656
|
"aria-haspopup": "listbox",
|
|
2646
|
-
"aria-owns":
|
|
2657
|
+
"aria-owns": fe,
|
|
2647
2658
|
children: [
|
|
2648
|
-
/* @__PURE__ */ l(
|
|
2659
|
+
/* @__PURE__ */ l(ee, {
|
|
2649
2660
|
className: "lucide mc-search-ico",
|
|
2650
2661
|
"aria-hidden": "true"
|
|
2651
2662
|
}),
|
|
@@ -2654,36 +2665,36 @@ function or({ data: i = {
|
|
|
2654
2665
|
type: "text",
|
|
2655
2666
|
placeholder: "find a node",
|
|
2656
2667
|
"aria-label": "find a node",
|
|
2657
|
-
"aria-controls":
|
|
2668
|
+
"aria-controls": fe,
|
|
2658
2669
|
"aria-autocomplete": "list",
|
|
2659
|
-
value:
|
|
2670
|
+
value: we,
|
|
2660
2671
|
onChange: (e) => {
|
|
2661
|
-
|
|
2672
|
+
Te(e.target.value), M(!0);
|
|
2662
2673
|
},
|
|
2663
|
-
onFocus: () =>
|
|
2674
|
+
onFocus: () => M(!0),
|
|
2664
2675
|
onBlur: () => {
|
|
2665
|
-
window.setTimeout(() =>
|
|
2676
|
+
window.setTimeout(() => M(!1), 120);
|
|
2666
2677
|
},
|
|
2667
2678
|
onKeyDown: (e) => {
|
|
2668
|
-
e.key === "Enter" &&
|
|
2679
|
+
e.key === "Enter" && Je[0] ? (e.preventDefault(), Et(Je[0])) : e.key === "Escape" && M(!1);
|
|
2669
2680
|
}
|
|
2670
2681
|
}),
|
|
2671
|
-
|
|
2682
|
+
Ee && Je.length > 0 && /* @__PURE__ */ l("ul", {
|
|
2672
2683
|
className: "mc-results",
|
|
2673
|
-
id:
|
|
2684
|
+
id: fe,
|
|
2674
2685
|
role: "listbox",
|
|
2675
2686
|
"aria-label": "search results",
|
|
2676
|
-
children:
|
|
2687
|
+
children: Je.map((e) => /* @__PURE__ */ u("li", {
|
|
2677
2688
|
role: "option",
|
|
2678
|
-
"aria-selected": e.id ===
|
|
2689
|
+
"aria-selected": e.id === R,
|
|
2679
2690
|
className: "mc-result mono",
|
|
2680
2691
|
onMouseDown: (t) => {
|
|
2681
2692
|
t.preventDefault(), Et(e);
|
|
2682
2693
|
},
|
|
2683
|
-
children: [e.kind === "folder" ? /* @__PURE__ */ l(
|
|
2694
|
+
children: [e.kind === "folder" ? /* @__PURE__ */ l(v, {
|
|
2684
2695
|
className: "lucide",
|
|
2685
2696
|
"aria-hidden": "true"
|
|
2686
|
-
}) : /* @__PURE__ */ l(
|
|
2697
|
+
}) : /* @__PURE__ */ l(_, {
|
|
2687
2698
|
className: "lucide",
|
|
2688
2699
|
"aria-hidden": "true"
|
|
2689
2700
|
}), /* @__PURE__ */ l("span", {
|
|
@@ -2725,11 +2736,11 @@ function or({ data: i = {
|
|
|
2725
2736
|
}),
|
|
2726
2737
|
/* @__PURE__ */ l("div", {
|
|
2727
2738
|
className: "mc-viewport",
|
|
2728
|
-
ref:
|
|
2739
|
+
ref: N,
|
|
2729
2740
|
tabIndex: 0,
|
|
2730
2741
|
role: "group",
|
|
2731
2742
|
"aria-label": "map canvas: arrow keys move focus, enter selects, plus and minus zoom, ctrl or cmd plus wheel to zoom",
|
|
2732
|
-
"aria-activedescendant":
|
|
2743
|
+
"aria-activedescendant": j && H.has(j) ? `${A}-node-${fr(j)}` : void 0,
|
|
2733
2744
|
onKeyDown: ht,
|
|
2734
2745
|
onPointerDown: _t,
|
|
2735
2746
|
onPointerMove: vt,
|
|
@@ -2741,45 +2752,45 @@ function or({ data: i = {
|
|
|
2741
2752
|
children: "no nodes to map"
|
|
2742
2753
|
}) : /* @__PURE__ */ u(c, { children: [
|
|
2743
2754
|
/* @__PURE__ */ u("div", {
|
|
2744
|
-
className: ["mc-stage",
|
|
2755
|
+
className: ["mc-stage", Qe ? "mc-stage--auto-fit" : ""].filter(Boolean).join(" "),
|
|
2745
2756
|
style: {
|
|
2746
|
-
transform: `translate(${
|
|
2747
|
-
width:
|
|
2748
|
-
height:
|
|
2757
|
+
transform: `translate(${B.x}px, ${B.y}px) scale(${z})`,
|
|
2758
|
+
width: W,
|
|
2759
|
+
height: G
|
|
2749
2760
|
},
|
|
2750
2761
|
children: [/* @__PURE__ */ l("svg", {
|
|
2751
2762
|
className: "mc-edges",
|
|
2752
|
-
width:
|
|
2753
|
-
height:
|
|
2754
|
-
viewBox: `0 0 ${
|
|
2763
|
+
width: W,
|
|
2764
|
+
height: G,
|
|
2765
|
+
viewBox: `0 0 ${W} ${G}`,
|
|
2755
2766
|
"aria-hidden": "true",
|
|
2756
|
-
children:
|
|
2757
|
-
let t =
|
|
2767
|
+
children: Ge.map((e) => {
|
|
2768
|
+
let t = Ue.get(e.from), n = Ue.get(e.to);
|
|
2758
2769
|
if (!t || !n) return null;
|
|
2759
|
-
let r =
|
|
2770
|
+
let r = re[dr(e.from, e.to)] ?? re[dr(e.from, e.to, "arrow")];
|
|
2760
2771
|
return /* @__PURE__ */ l(gr, {
|
|
2761
2772
|
a: t,
|
|
2762
2773
|
b: n,
|
|
2763
2774
|
kind: e.kind,
|
|
2764
2775
|
weight: e.weight,
|
|
2765
|
-
maxWeight:
|
|
2776
|
+
maxWeight: Ke,
|
|
2766
2777
|
delta: r
|
|
2767
2778
|
}, `${e.kind}:${e.from}->${e.to}`);
|
|
2768
2779
|
})
|
|
2769
|
-
}),
|
|
2770
|
-
let n = (
|
|
2780
|
+
}), U.map((t) => {
|
|
2781
|
+
let n = (We.get(t.node.id) || 0) > 0, r = L.has(t.node.id);
|
|
2771
2782
|
return /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l(hr, {
|
|
2772
|
-
domId: `${
|
|
2783
|
+
domId: `${A}-node-${fr(t.node.id)}`,
|
|
2773
2784
|
p: t,
|
|
2774
|
-
selected:
|
|
2775
|
-
focused:
|
|
2776
|
-
highlighted:
|
|
2777
|
-
delta:
|
|
2785
|
+
selected: R === t.node.id,
|
|
2786
|
+
focused: j === t.node.id,
|
|
2787
|
+
highlighted: K.has(t.node.id),
|
|
2788
|
+
delta: te[t.node.id],
|
|
2778
2789
|
expandable: n,
|
|
2779
2790
|
expanded: r,
|
|
2780
|
-
violations:
|
|
2791
|
+
violations: qe.get(t.node.id) || 0,
|
|
2781
2792
|
onClick: (e) => {
|
|
2782
|
-
e >= 2 || (
|
|
2793
|
+
e >= 2 || (ye(t.node.id), O ? R !== t.node.id && J(t.node.id) : J(R === t.node.id ? null : t.node.id));
|
|
2783
2794
|
},
|
|
2784
2795
|
onDoubleClick: () => {
|
|
2785
2796
|
n && dt(t.node.id);
|
|
@@ -2811,8 +2822,8 @@ function or({ data: i = {
|
|
|
2811
2822
|
type: "button",
|
|
2812
2823
|
className: "mc-zoom-btn",
|
|
2813
2824
|
"aria-label": "zoom in",
|
|
2814
|
-
onClick: () =>
|
|
2815
|
-
children: /* @__PURE__ */ l(
|
|
2825
|
+
onClick: () => rt(zn),
|
|
2826
|
+
children: /* @__PURE__ */ l(S, {
|
|
2816
2827
|
className: "lucide",
|
|
2817
2828
|
"aria-hidden": "true"
|
|
2818
2829
|
})
|
|
@@ -2821,8 +2832,8 @@ function or({ data: i = {
|
|
|
2821
2832
|
type: "button",
|
|
2822
2833
|
className: "mc-zoom-btn",
|
|
2823
2834
|
"aria-label": "zoom out",
|
|
2824
|
-
onClick: () =>
|
|
2825
|
-
children: /* @__PURE__ */ l(
|
|
2835
|
+
onClick: () => rt(1 / zn),
|
|
2836
|
+
children: /* @__PURE__ */ l(x, {
|
|
2826
2837
|
className: "lucide",
|
|
2827
2838
|
"aria-hidden": "true"
|
|
2828
2839
|
})
|
|
@@ -2831,8 +2842,8 @@ function or({ data: i = {
|
|
|
2831
2842
|
type: "button",
|
|
2832
2843
|
className: "mc-zoom-btn",
|
|
2833
2844
|
"aria-label": "fit map to view",
|
|
2834
|
-
onClick: () =>
|
|
2835
|
-
children: /* @__PURE__ */ l(
|
|
2845
|
+
onClick: () => Xe(!0),
|
|
2846
|
+
children: /* @__PURE__ */ l(b, {
|
|
2836
2847
|
className: "lucide",
|
|
2837
2848
|
"aria-hidden": "true"
|
|
2838
2849
|
})
|
|
@@ -2846,7 +2857,7 @@ function or({ data: i = {
|
|
|
2846
2857
|
className: "mc-minimap-svg",
|
|
2847
2858
|
viewBox: `0 0 ${Ct.graphW} ${Ct.graphH}`,
|
|
2848
2859
|
preserveAspectRatio: "xMidYMid meet",
|
|
2849
|
-
children: [
|
|
2860
|
+
children: [U.map((e) => /* @__PURE__ */ l("rect", {
|
|
2850
2861
|
className: "mc-mini-node",
|
|
2851
2862
|
"data-cov": Kn(e.node.coverage),
|
|
2852
2863
|
x: e.x,
|
|
@@ -2868,11 +2879,11 @@ function or({ data: i = {
|
|
|
2868
2879
|
children: [
|
|
2869
2880
|
/* @__PURE__ */ u("span", {
|
|
2870
2881
|
className: "mc-legend-item",
|
|
2871
|
-
children: [/* @__PURE__ */ l(
|
|
2882
|
+
children: [/* @__PURE__ */ l(v, { className: "lucide" }), " folder"]
|
|
2872
2883
|
}),
|
|
2873
2884
|
/* @__PURE__ */ u("span", {
|
|
2874
2885
|
className: "mc-legend-item",
|
|
2875
|
-
children: [/* @__PURE__ */ l(
|
|
2886
|
+
children: [/* @__PURE__ */ l(_, { className: "lucide" }), " file"]
|
|
2876
2887
|
}),
|
|
2877
2888
|
/* @__PURE__ */ u("span", {
|
|
2878
2889
|
className: "mc-legend-item mc-legend-ramp",
|
|
@@ -2902,7 +2913,7 @@ function or({ data: i = {
|
|
|
2902
2913
|
}),
|
|
2903
2914
|
/* @__PURE__ */ u("span", {
|
|
2904
2915
|
className: "mc-legend-item mc-legend-viol",
|
|
2905
|
-
children: [/* @__PURE__ */ l(
|
|
2916
|
+
children: [/* @__PURE__ */ l(ne, { className: "lucide" }), " violation"]
|
|
2906
2917
|
})
|
|
2907
2918
|
]
|
|
2908
2919
|
})
|
|
@@ -2911,16 +2922,16 @@ function or({ data: i = {
|
|
|
2911
2922
|
]
|
|
2912
2923
|
});
|
|
2913
2924
|
function Et(e) {
|
|
2914
|
-
let t = e.kind === "file" &&
|
|
2915
|
-
for (; r &&
|
|
2925
|
+
let t = e.kind === "file" && I !== "files" ? "files" : I, n = new Set(t === I ? L : []), r = V.parentIdByChild.get(e.id);
|
|
2926
|
+
for (; r && V.byId.has(r);) n.has(r) || (n.add(r), oe?.(r)), r = V.parentIdByChild.get(r);
|
|
2916
2927
|
let i = Array.from(n);
|
|
2917
|
-
|
|
2928
|
+
O || (me(t), ge(n)), D?.({
|
|
2918
2929
|
type: "reveal",
|
|
2919
2930
|
id: e.id,
|
|
2920
2931
|
grain: Bn[t],
|
|
2921
2932
|
expandedIds: i
|
|
2922
|
-
}), t !==
|
|
2923
|
-
window.requestAnimationFrame(() =>
|
|
2933
|
+
}), t !== I && ae?.(t), w?.(i), Te(""), M(!1), ye(e.id), O || ve(e.id), ie?.(e.id, sr(e)), window.requestAnimationFrame(() => {
|
|
2934
|
+
window.requestAnimationFrame(() => at(e.id));
|
|
2924
2935
|
});
|
|
2925
2936
|
}
|
|
2926
2937
|
}
|
|
@@ -2998,10 +3009,10 @@ function hr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a,
|
|
|
2998
3009
|
/* @__PURE__ */ u("span", {
|
|
2999
3010
|
className: "mc-node-head",
|
|
3000
3011
|
children: [
|
|
3001
|
-
p.kind === "folder" ? /* @__PURE__ */ l(
|
|
3012
|
+
p.kind === "folder" ? /* @__PURE__ */ l(v, {
|
|
3002
3013
|
className: "lucide mc-node-ico",
|
|
3003
3014
|
"aria-hidden": "true"
|
|
3004
|
-
}) : /* @__PURE__ */ l(
|
|
3015
|
+
}) : /* @__PURE__ */ l(_, {
|
|
3005
3016
|
className: "lucide mc-node-ico",
|
|
3006
3017
|
"aria-hidden": "true"
|
|
3007
3018
|
}),
|
|
@@ -3012,7 +3023,7 @@ function hr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a,
|
|
|
3012
3023
|
c > 0 && /* @__PURE__ */ u("span", {
|
|
3013
3024
|
className: "mc-node-viol mono tnum",
|
|
3014
3025
|
"aria-hidden": "true",
|
|
3015
|
-
children: [/* @__PURE__ */ l(
|
|
3026
|
+
children: [/* @__PURE__ */ l(ne, {
|
|
3016
3027
|
className: "lucide",
|
|
3017
3028
|
"aria-hidden": "true"
|
|
3018
3029
|
}), c]
|
|
@@ -3212,17 +3223,17 @@ var xr = Object.freeze([
|
|
|
3212
3223
|
{
|
|
3213
3224
|
id: "transcript",
|
|
3214
3225
|
mark: "transcript-browser",
|
|
3215
|
-
icon:
|
|
3226
|
+
icon: C
|
|
3216
3227
|
},
|
|
3217
3228
|
{
|
|
3218
3229
|
id: "commons",
|
|
3219
3230
|
mark: "village",
|
|
3220
|
-
icon:
|
|
3231
|
+
icon: re
|
|
3221
3232
|
},
|
|
3222
3233
|
{
|
|
3223
3234
|
id: "graph",
|
|
3224
3235
|
mark: "peasant",
|
|
3225
|
-
icon:
|
|
3236
|
+
icon: ie
|
|
3226
3237
|
}
|
|
3227
3238
|
]), Sr = Object.freeze([
|
|
3228
3239
|
{
|
|
@@ -3391,4 +3402,215 @@ function Er({ sections: e = Sr, activeId: t = void 0, hrefFor: n = void 0, LinkC
|
|
|
3391
3402
|
});
|
|
3392
3403
|
}
|
|
3393
3404
|
//#endregion
|
|
3394
|
-
|
|
3405
|
+
//#region src/ui/transcript/graph/GraphTurnNode.jsx
|
|
3406
|
+
function Dr(e) {
|
|
3407
|
+
return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
|
|
3408
|
+
}
|
|
3409
|
+
function Or(e, t) {
|
|
3410
|
+
return e === "user" ? "you" : t ? "subagent" : e === "assistant" ? "assistant" : e;
|
|
3411
|
+
}
|
|
3412
|
+
function kr({ role: e, agentName: t, provider: n, hasError: r }) {
|
|
3413
|
+
return r ? "clay" : e === "user" ? "teal" : t ? "mauve" : e === "assistant" ? n === void 0 ? "amber" : F(n) : null;
|
|
3414
|
+
}
|
|
3415
|
+
function Ar({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount: i, totalTokens: a, tokensIn: o, tokensOut: s, hasError: c = !1, hasRetry: d = !1, hasRevert: f = !1, isSearchMatch: p = !1, isFilteredOut: m = !1, isSelected: h = !1, provider: g, className: _ = "" }) {
|
|
3416
|
+
let v = kr({
|
|
3417
|
+
role: e,
|
|
3418
|
+
agentName: t,
|
|
3419
|
+
provider: g,
|
|
3420
|
+
hasError: c
|
|
3421
|
+
}), y = Or(e, t), b = c ? "error" : d ? "retry" : f ? "re-edit" : null, x = o != null || s != null ? `${o ?? 0} in · ${s ?? 0} out` : void 0;
|
|
3422
|
+
return /* @__PURE__ */ u("div", {
|
|
3423
|
+
className: [
|
|
3424
|
+
"ft-gnode",
|
|
3425
|
+
"ft-gnode-turn",
|
|
3426
|
+
v && "ft-gnode-accented",
|
|
3427
|
+
c && "ft-gnode-error",
|
|
3428
|
+
m && "ft-gnode-dimmed",
|
|
3429
|
+
p && "ft-gnode-match",
|
|
3430
|
+
h && "ft-gnode-selected",
|
|
3431
|
+
_
|
|
3432
|
+
].filter(Boolean).join(" "),
|
|
3433
|
+
style: v ? { "--ft-gnode-accent": `var(--${v})` } : void 0,
|
|
3434
|
+
"data-role": y,
|
|
3435
|
+
"data-turn": n,
|
|
3436
|
+
children: [
|
|
3437
|
+
/* @__PURE__ */ u("header", {
|
|
3438
|
+
className: "ft-gnode-head",
|
|
3439
|
+
children: [
|
|
3440
|
+
/* @__PURE__ */ l("span", {
|
|
3441
|
+
className: "ft-gnode-role",
|
|
3442
|
+
children: y
|
|
3443
|
+
}),
|
|
3444
|
+
t && /* @__PURE__ */ u("span", {
|
|
3445
|
+
className: "ft-gnode-agent",
|
|
3446
|
+
children: ["· ", t]
|
|
3447
|
+
}),
|
|
3448
|
+
/* @__PURE__ */ u("span", {
|
|
3449
|
+
className: "ft-gnode-num",
|
|
3450
|
+
children: ["#", n]
|
|
3451
|
+
}),
|
|
3452
|
+
b && /* @__PURE__ */ l("span", {
|
|
3453
|
+
className: `ft-gnode-flag ft-gnode-flag-${c ? "err" : "warn"}`,
|
|
3454
|
+
children: b
|
|
3455
|
+
})
|
|
3456
|
+
]
|
|
3457
|
+
}),
|
|
3458
|
+
r && /* @__PURE__ */ l("div", {
|
|
3459
|
+
className: `ft-gnode-prev${e === "user" ? " ft-gnode-prev-user" : ""}`,
|
|
3460
|
+
children: r
|
|
3461
|
+
}),
|
|
3462
|
+
/* @__PURE__ */ u("footer", {
|
|
3463
|
+
className: "ft-gnode-meta",
|
|
3464
|
+
children: [i > 0 && /* @__PURE__ */ u("span", {
|
|
3465
|
+
className: "ft-gnode-meta-tools",
|
|
3466
|
+
children: [
|
|
3467
|
+
i,
|
|
3468
|
+
" ",
|
|
3469
|
+
i === 1 ? "tool" : "tools"
|
|
3470
|
+
]
|
|
3471
|
+
}), a > 0 && /* @__PURE__ */ l("span", {
|
|
3472
|
+
className: "ft-gnode-meta-tokens",
|
|
3473
|
+
title: x,
|
|
3474
|
+
children: Dr(a)
|
|
3475
|
+
})]
|
|
3476
|
+
})
|
|
3477
|
+
]
|
|
3478
|
+
});
|
|
3479
|
+
}
|
|
3480
|
+
//#endregion
|
|
3481
|
+
//#region src/ui/transcript/graph/GraphToolNode.jsx
|
|
3482
|
+
function jr(e) {
|
|
3483
|
+
return e == null || e <= 0 ? "" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(1).replace(/\.0$/, "")}s`;
|
|
3484
|
+
}
|
|
3485
|
+
function Mr(e) {
|
|
3486
|
+
if (!e) return "";
|
|
3487
|
+
let t = e.split("/");
|
|
3488
|
+
return t[t.length - 1] || e;
|
|
3489
|
+
}
|
|
3490
|
+
function Nr(e) {
|
|
3491
|
+
return !!e.isError || e.exitCode != null && e.exitCode !== 0;
|
|
3492
|
+
}
|
|
3493
|
+
function Pr({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r = !1, max: i = 4, className: a = "" }) {
|
|
3494
|
+
let o = e.slice(0, i), s = e.length - o.length, c = jr(t), d = e.length;
|
|
3495
|
+
return /* @__PURE__ */ u("div", {
|
|
3496
|
+
className: [
|
|
3497
|
+
"ft-gnode",
|
|
3498
|
+
"ft-gnode-tools",
|
|
3499
|
+
n && "ft-gnode-error",
|
|
3500
|
+
r && "ft-gnode-dimmed",
|
|
3501
|
+
a
|
|
3502
|
+
].filter(Boolean).join(" "),
|
|
3503
|
+
children: [/* @__PURE__ */ u("header", {
|
|
3504
|
+
className: "ft-gnode-tools-head",
|
|
3505
|
+
children: [/* @__PURE__ */ l("span", {
|
|
3506
|
+
className: "ft-gnode-tools-count",
|
|
3507
|
+
children: d === 1 ? "tool call" : `${d} tool calls`
|
|
3508
|
+
}), c && /* @__PURE__ */ l("span", {
|
|
3509
|
+
className: "ft-gnode-tools-dur",
|
|
3510
|
+
children: c
|
|
3511
|
+
})]
|
|
3512
|
+
}), /* @__PURE__ */ u("ul", {
|
|
3513
|
+
className: "ft-gnode-tools-list",
|
|
3514
|
+
children: [o.map((e) => {
|
|
3515
|
+
let t = Nr(e), n = e.preview || Mr(e.filePath);
|
|
3516
|
+
return /* @__PURE__ */ u("li", {
|
|
3517
|
+
className: `ft-gnode-tools-row${t ? " ft-gnode-tools-row-failed" : ""}`,
|
|
3518
|
+
children: [
|
|
3519
|
+
/* @__PURE__ */ l("span", {
|
|
3520
|
+
className: "ft-gnode-tools-name",
|
|
3521
|
+
children: e.name
|
|
3522
|
+
}),
|
|
3523
|
+
n && /* @__PURE__ */ l("span", {
|
|
3524
|
+
className: "ft-gnode-tools-arg",
|
|
3525
|
+
children: n
|
|
3526
|
+
}),
|
|
3527
|
+
t && /* @__PURE__ */ l("span", {
|
|
3528
|
+
className: "ft-gnode-tools-err",
|
|
3529
|
+
children: "error"
|
|
3530
|
+
})
|
|
3531
|
+
]
|
|
3532
|
+
}, e.id);
|
|
3533
|
+
}), s > 0 && /* @__PURE__ */ u("li", {
|
|
3534
|
+
className: "ft-gnode-tools-more",
|
|
3535
|
+
children: [
|
|
3536
|
+
"+ ",
|
|
3537
|
+
s,
|
|
3538
|
+
" more"
|
|
3539
|
+
]
|
|
3540
|
+
})]
|
|
3541
|
+
})]
|
|
3542
|
+
});
|
|
3543
|
+
}
|
|
3544
|
+
//#endregion
|
|
3545
|
+
//#region src/ui/transcript/graph/GraphSubagentBranch.jsx
|
|
3546
|
+
function Fr({ agentName: e, depth: t, className: n = "" }) {
|
|
3547
|
+
return /* @__PURE__ */ u("div", {
|
|
3548
|
+
className: ["ft-gnode-lane", n].filter(Boolean).join(" "),
|
|
3549
|
+
children: [
|
|
3550
|
+
/* @__PURE__ */ l("span", {
|
|
3551
|
+
className: "ft-gnode-lane-eyebrow",
|
|
3552
|
+
children: "subagent"
|
|
3553
|
+
}),
|
|
3554
|
+
/* @__PURE__ */ l("span", {
|
|
3555
|
+
className: "ft-gnode-lane-name",
|
|
3556
|
+
children: e
|
|
3557
|
+
}),
|
|
3558
|
+
/* @__PURE__ */ u("span", {
|
|
3559
|
+
className: "ft-gnode-lane-depth",
|
|
3560
|
+
children: ["d", t]
|
|
3561
|
+
})
|
|
3562
|
+
]
|
|
3563
|
+
});
|
|
3564
|
+
}
|
|
3565
|
+
//#endregion
|
|
3566
|
+
//#region src/ui/transcript/graph/GraphLegend.jsx
|
|
3567
|
+
var Ir = Object.freeze([
|
|
3568
|
+
{
|
|
3569
|
+
kind: "user",
|
|
3570
|
+
label: "you"
|
|
3571
|
+
},
|
|
3572
|
+
{
|
|
3573
|
+
kind: "assistant",
|
|
3574
|
+
label: "agent"
|
|
3575
|
+
},
|
|
3576
|
+
{
|
|
3577
|
+
kind: "subagent",
|
|
3578
|
+
label: "subagent"
|
|
3579
|
+
},
|
|
3580
|
+
{
|
|
3581
|
+
kind: "tool",
|
|
3582
|
+
label: "tool"
|
|
3583
|
+
},
|
|
3584
|
+
{
|
|
3585
|
+
kind: "error",
|
|
3586
|
+
label: "error"
|
|
3587
|
+
}
|
|
3588
|
+
]);
|
|
3589
|
+
function Lr({ kind: e, provider: t }) {
|
|
3590
|
+
switch (e) {
|
|
3591
|
+
case "user": return "teal";
|
|
3592
|
+
case "assistant": return t === void 0 ? "amber" : F(t);
|
|
3593
|
+
case "subagent": return "mauve";
|
|
3594
|
+
case "error": return "clay";
|
|
3595
|
+
default: return null;
|
|
3596
|
+
}
|
|
3597
|
+
}
|
|
3598
|
+
function Rr({ items: e = Ir, className: t = "" }) {
|
|
3599
|
+
return /* @__PURE__ */ l("div", {
|
|
3600
|
+
className: ["ft-graph-legend", t].filter(Boolean).join(" "),
|
|
3601
|
+
children: e.map((e) => {
|
|
3602
|
+
let t = Lr(e), n = t ? { background: `var(--${t})` } : void 0;
|
|
3603
|
+
return /* @__PURE__ */ u("span", {
|
|
3604
|
+
className: "ft-graph-legend-item",
|
|
3605
|
+
children: [/* @__PURE__ */ l("span", {
|
|
3606
|
+
className: "ft-graph-legend-glyph",
|
|
3607
|
+
"data-kind": e.kind,
|
|
3608
|
+
style: n,
|
|
3609
|
+
"aria-hidden": "true"
|
|
3610
|
+
}), /* @__PURE__ */ l("span", { children: e.label })]
|
|
3611
|
+
}, e.kind + ":" + e.label);
|
|
3612
|
+
})
|
|
3613
|
+
});
|
|
3614
|
+
}
|
|
3615
|
+
//#endregion
|
|
3616
|
+
export { $e as $, xt as A, Vt as B, ln as C, xe as Ct, bt as D, ht as E, Ht as F, tt as G, ct as H, Gt as I, rt as J, it as K, At as L, Ot as M, Mt as N, yt as O, Dt as P, J as Q, jt as R, sn as S, Se as St, gt as T, lt as U, Nt as V, ut as W, ot as X, et as Y, st as Z, an as _, Oe as _t, Ar as a, V as at, cn as b, F as bt, Er as c, I as ct, vr as d, ze as dt, Ye as et, _r as f, Fe as ft, Y as g, Pe as gt, qt as h, Ie as ht, Pr as i, He as it, kt as j, vt as k, xr as l, R as lt, or as m, Ne as mt, Rr as n, U as nt, Sr as o, Ve as ot, br as p, Le as pt, nt as q, Fr as r, H as rt, Tr as s, B as st, Ir as t, G as tt, wr as u, z as ut, X as v, ke as vt, _t as w, Jt as x, N as xt, dn as y, je as yt, Wt as z };
|