@peasant-labs/fairtrade 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{InUseShell-CY5Acw6t.js → GraphLegend-D9bZVLfT.js} +764 -553
- package/dist/lib/commons.js +139 -139
- package/dist/lib/graph.css +1 -1
- package/dist/lib/graph.js +921 -359
- package/dist/lib/types/graph/index.d.ts +16 -0
- package/dist/lib/types/transcript/CheckRow.d.ts +3 -1
- package/dist/lib/types/transcript/OutcomeChip.d.ts +18 -0
- package/dist/lib/types/transcript/filters.d.ts +127 -0
- 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/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/view-model.d.ts +22 -0
- package/dist/lib/{ui-CLo_683m.js → ui-BtpmsgDx.js} +2564 -2533
- package/dist/lib/ui.js +4 -4
- package/package.json +20 -5
|
@@ -1,16 +1,16 @@
|
|
|
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
12
|
strike: "M18.5 6L11 17.5h5.2L13.5 26 21 14.5h-5.2L18.5 6z"
|
|
13
|
-
},
|
|
13
|
+
}, j = { strike: "6 6 20 20" }, ye = {
|
|
14
14
|
anthropic: "claude",
|
|
15
15
|
"claude-code": "claude",
|
|
16
16
|
google: "gemini",
|
|
@@ -20,7 +20,7 @@ var xe = {
|
|
|
20
20
|
"codex-cli": "openai",
|
|
21
21
|
chatgpt: "openai",
|
|
22
22
|
gpt: "openai"
|
|
23
|
-
},
|
|
23
|
+
}, be = {
|
|
24
24
|
claude: "Claude",
|
|
25
25
|
gemini: "Gemini",
|
|
26
26
|
openai: "OpenAI",
|
|
@@ -28,13 +28,13 @@ var xe = {
|
|
|
28
28
|
opencode: "opencode",
|
|
29
29
|
strike: "Strike"
|
|
30
30
|
};
|
|
31
|
-
function
|
|
31
|
+
function xe(e) {
|
|
32
32
|
if (!e) return null;
|
|
33
|
-
let t = String(e).toLowerCase().trim(), n =
|
|
34
|
-
return
|
|
33
|
+
let t = String(e).toLowerCase().trim(), n = ye[t] || t;
|
|
34
|
+
return ve[n] ? n : null;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
let a =
|
|
36
|
+
function Se({ name: e, size: t, label: n, className: r = "", ...i }) {
|
|
37
|
+
let a = xe(e);
|
|
38
38
|
if (!a) return null;
|
|
39
39
|
let o = ["brand", r].filter(Boolean).join(" "), s = t == null ? {} : {
|
|
40
40
|
width: t,
|
|
@@ -45,7 +45,7 @@ function Te({ name: e, size: t, label: n, className: r = "", ...i }) {
|
|
|
45
45
|
}
|
|
46
46
|
}, c = n ? {
|
|
47
47
|
role: "img",
|
|
48
|
-
"aria-label": n === !0 ?
|
|
48
|
+
"aria-label": n === !0 ? be[a] : n,
|
|
49
49
|
focusable: "false"
|
|
50
50
|
} : {
|
|
51
51
|
"aria-hidden": "true",
|
|
@@ -53,17 +53,17 @@ function Te({ name: e, size: t, label: n, className: r = "", ...i }) {
|
|
|
53
53
|
};
|
|
54
54
|
return /* @__PURE__ */ l("svg", {
|
|
55
55
|
className: o,
|
|
56
|
-
viewBox:
|
|
56
|
+
viewBox: j[a] ?? "0 0 24 24",
|
|
57
57
|
...s,
|
|
58
58
|
...c,
|
|
59
59
|
...i,
|
|
60
60
|
"data-brand": a,
|
|
61
|
-
children: /* @__PURE__ */ l("path", { d:
|
|
61
|
+
children: /* @__PURE__ */ l("path", { d: ve[a] })
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/ui/provider-policy.js
|
|
66
|
-
var
|
|
66
|
+
var Ce = Object.freeze(Object.values(O)), we = Object.freeze({
|
|
67
67
|
"claude-code": "Claude Code",
|
|
68
68
|
"gemini-cli": "Gemini CLI",
|
|
69
69
|
codex: "Codex",
|
|
@@ -71,7 +71,7 @@ var Ee = Object.freeze(Object.values(T)), De = Object.freeze({
|
|
|
71
71
|
cursor: "Cursor",
|
|
72
72
|
antigravity: "Google Antigravity",
|
|
73
73
|
strike: "Strike"
|
|
74
|
-
}),
|
|
74
|
+
}), Te = Object.freeze({
|
|
75
75
|
"claude-code": "claude",
|
|
76
76
|
"gemini-cli": "gemini",
|
|
77
77
|
codex: "openai",
|
|
@@ -79,7 +79,7 @@ var Ee = Object.freeze(Object.values(T)), De = Object.freeze({
|
|
|
79
79
|
cursor: "cursor",
|
|
80
80
|
antigravity: "gemini",
|
|
81
81
|
strike: "strike"
|
|
82
|
-
}),
|
|
82
|
+
}), Ee = Object.freeze({
|
|
83
83
|
"claude-code": "amber",
|
|
84
84
|
"gemini-cli": "teal",
|
|
85
85
|
codex: "olive",
|
|
@@ -88,69 +88,69 @@ var Ee = Object.freeze(Object.values(T)), De = Object.freeze({
|
|
|
88
88
|
antigravity: "teal",
|
|
89
89
|
strike: "clay"
|
|
90
90
|
});
|
|
91
|
-
function
|
|
92
|
-
if (
|
|
91
|
+
function M(e, t) {
|
|
92
|
+
if (fe(e)) return;
|
|
93
93
|
let n;
|
|
94
94
|
try {
|
|
95
95
|
n = JSON.stringify(e);
|
|
96
96
|
} catch {
|
|
97
97
|
n = String(e);
|
|
98
98
|
}
|
|
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 ${
|
|
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 ${Ce.join(", ")}.`);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
101
|
+
function N(e) {
|
|
102
|
+
return M(e, "provider display-name resolution"), we[e];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
104
|
+
function P(e) {
|
|
105
|
+
return M(e, "provider brand resolution"), Te[e];
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
107
|
+
function F(e) {
|
|
108
|
+
return M(e, "provider accent resolution"), Ee[e];
|
|
109
109
|
}
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/ui/Intensity.jsx
|
|
112
|
-
function
|
|
112
|
+
function De(e) {
|
|
113
113
|
let t = Math.round(Number(e) || 0);
|
|
114
114
|
return Math.max(0, Math.min(4, t));
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Oe(e, t) {
|
|
117
117
|
if (!t || t <= 0 || e <= 0) return 0;
|
|
118
118
|
let n = Math.min(e / t, 1);
|
|
119
119
|
return n < .25 ? 1 : n < .5 ? 2 : n < .9 ? 3 : 4;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function ke(e) {
|
|
122
122
|
if (!e || e <= 0) return 0;
|
|
123
123
|
let t = Math.min(e, 1);
|
|
124
124
|
return t <= .25 ? 1 : t <= .5 ? 2 : t <= .75 ? 3 : 4;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Ae(e, t) {
|
|
127
127
|
if (e <= 0 || t <= 0) return 0;
|
|
128
128
|
let n = Math.min(e / t, 1);
|
|
129
129
|
return n <= .25 ? 1 : n <= .5 ? 2 : n <= .75 ? 3 : 4;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function je(e) {
|
|
132
132
|
let t = Number(e) || 0;
|
|
133
133
|
return t < 60 ? "xs" : t < 200 ? "sm" : t < 600 ? "md" : t < 1500 ? "lg" : "xl";
|
|
134
134
|
}
|
|
135
|
-
var
|
|
135
|
+
var Me = [
|
|
136
136
|
"none",
|
|
137
137
|
"low",
|
|
138
138
|
"some",
|
|
139
139
|
"most",
|
|
140
140
|
"full"
|
|
141
141
|
];
|
|
142
|
-
function
|
|
143
|
-
let o =
|
|
142
|
+
function Ne({ level: e = 0, accent: t, size: n, label: r, className: i = "", ...a }) {
|
|
143
|
+
let o = De(e);
|
|
144
144
|
return /* @__PURE__ */ l("span", {
|
|
145
145
|
className: `ir-swatch${n === "lg" ? " ir-swatch--lg" : ""}${i ? ` ${i}` : ""}`,
|
|
146
146
|
"data-level": o,
|
|
147
147
|
"data-accent": t || void 0,
|
|
148
148
|
role: "img",
|
|
149
|
-
"aria-label": r || `intensity ${o} of 4 (${
|
|
149
|
+
"aria-label": r || `intensity ${o} of 4 (${Me[o]})`,
|
|
150
150
|
...a
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Pe({ title: e = "coverage", words: t = Me, className: n = "" }) {
|
|
154
154
|
return /* @__PURE__ */ u("div", {
|
|
155
155
|
className: `ir-scope ir-legend${n ? ` ${n}` : ""}`,
|
|
156
156
|
children: [
|
|
@@ -192,8 +192,8 @@ function Ie({ title: e = "coverage", words: t = Fe, className: n = "" }) {
|
|
|
192
192
|
]
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
function
|
|
196
|
-
let o = t ? t.map(
|
|
195
|
+
function Fe({ values: e, levels: t, max: n, labels: r, ariaLabel: i = "intensity heatmap", className: a = "" }) {
|
|
196
|
+
let o = t ? t.map(De) : (e || []).map((t) => Ae(t, n ?? Math.max(1, ...e || [1])));
|
|
197
197
|
return /* @__PURE__ */ l("div", {
|
|
198
198
|
className: `ir-scope ir-heatmap${a ? ` ${a}` : ""}`,
|
|
199
199
|
role: "img",
|
|
@@ -201,25 +201,25 @@ function Le({ values: e, levels: t, max: n, labels: r, ariaLabel: i = "intensity
|
|
|
201
201
|
children: o.map((e, t) => /* @__PURE__ */ l("span", {
|
|
202
202
|
className: "ir-heatmap__cell",
|
|
203
203
|
"data-level": e,
|
|
204
|
-
title: `${r?.[t] ?? `cell ${t + 1}`}: ${
|
|
204
|
+
title: `${r?.[t] ?? `cell ${t + 1}`}: ${Me[e]} (${e}/4)`
|
|
205
205
|
}, t))
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
let g = i == null ?
|
|
208
|
+
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 }) {
|
|
209
|
+
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
210
|
e,
|
|
211
211
|
i == null ? `coverage ${g} of 4` : `${r ?? 0} of ${i} recorded`,
|
|
212
212
|
t == null ? null : `${t} loc`,
|
|
213
|
-
|
|
213
|
+
v > 0 ? `${v} violation${v === 1 ? "" : "s"}` : null,
|
|
214
214
|
a ? "selected" : null
|
|
215
|
-
].filter(Boolean).join(" · "),
|
|
216
|
-
return /* @__PURE__ */ u(
|
|
217
|
-
className: `ir-node ir-node--${
|
|
215
|
+
].filter(Boolean).join(" · "), S = f, C = S === "button";
|
|
216
|
+
return /* @__PURE__ */ u(S, {
|
|
217
|
+
className: `ir-node ir-node--${_}${m ? ` ${m}` : ""}`,
|
|
218
218
|
"data-coverage": g,
|
|
219
219
|
"data-selected": a ? "true" : void 0,
|
|
220
|
-
type:
|
|
221
|
-
"aria-pressed":
|
|
222
|
-
"aria-label":
|
|
220
|
+
type: C ? "button" : void 0,
|
|
221
|
+
"aria-pressed": C ? a : void 0,
|
|
222
|
+
"aria-label": x,
|
|
223
223
|
onClick: p,
|
|
224
224
|
...h,
|
|
225
225
|
children: [
|
|
@@ -228,12 +228,12 @@ function Re({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected
|
|
|
228
228
|
children: [/* @__PURE__ */ l("span", {
|
|
229
229
|
className: "ir-node__label",
|
|
230
230
|
children: e
|
|
231
|
-
}),
|
|
231
|
+
}), v > 0 && /* @__PURE__ */ u("span", {
|
|
232
232
|
className: "ir-node__badge",
|
|
233
233
|
"aria-hidden": "true",
|
|
234
|
-
children: [/* @__PURE__ */ l(
|
|
234
|
+
children: [/* @__PURE__ */ l(ne, { "aria-hidden": "true" }), /* @__PURE__ */ l("span", {
|
|
235
235
|
className: "tnum",
|
|
236
|
-
children:
|
|
236
|
+
children: v
|
|
237
237
|
})]
|
|
238
238
|
})]
|
|
239
239
|
}),
|
|
@@ -246,15 +246,15 @@ function Re({ label: e, loc: t, coverage: n = 0, recorded: r, total: i, selected
|
|
|
246
246
|
"aria-hidden": "true",
|
|
247
247
|
children: /* @__PURE__ */ l(d, { "aria-hidden": "true" })
|
|
248
248
|
}),
|
|
249
|
-
|
|
249
|
+
y && /* @__PURE__ */ l("span", {
|
|
250
250
|
className: "ir-node__effort",
|
|
251
|
-
"data-level":
|
|
251
|
+
"data-level": b,
|
|
252
252
|
"aria-hidden": "true"
|
|
253
253
|
})
|
|
254
254
|
]
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Le({ children: e, className: t = "", ...n }) {
|
|
258
258
|
return /* @__PURE__ */ l("div", {
|
|
259
259
|
className: `ir-scope${t ? ` ${t}` : ""}`,
|
|
260
260
|
...n,
|
|
@@ -263,29 +263,29 @@ function ze({ children: e, className: t = "", ...n }) {
|
|
|
263
263
|
}
|
|
264
264
|
//#endregion
|
|
265
265
|
//#region src/ui/ProviderIcon.jsx
|
|
266
|
-
var
|
|
267
|
-
function
|
|
268
|
-
return `var(--${
|
|
266
|
+
var Re = Ce, I = Ee;
|
|
267
|
+
function L(e) {
|
|
268
|
+
return `var(--${F(e)})`;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
|
|
272
|
-
let o =
|
|
270
|
+
function R({ harness: e, size: t, accent: n = !1, label: r, className: i = "", ...a }) {
|
|
271
|
+
M(e, "ProviderIcon render in src/ui/ProviderIcon.jsx");
|
|
272
|
+
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
273
|
return /* @__PURE__ */ l("span", {
|
|
274
274
|
className: s,
|
|
275
275
|
style: c,
|
|
276
276
|
...a,
|
|
277
|
-
children: /* @__PURE__ */ l(
|
|
277
|
+
children: /* @__PURE__ */ l(Se, {
|
|
278
278
|
name: o,
|
|
279
279
|
size: t,
|
|
280
280
|
label: u
|
|
281
281
|
})
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
284
|
+
function ze({ harness: e, accent: t = !1, className: n = "", ...r }) {
|
|
285
|
+
return M(e, "ProviderTag render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ u("span", {
|
|
286
286
|
className: ["pv-tag", n].filter(Boolean).join(" "),
|
|
287
287
|
...r,
|
|
288
|
-
children: [/* @__PURE__ */ l(
|
|
288
|
+
children: [/* @__PURE__ */ l(R, {
|
|
289
289
|
harness: e,
|
|
290
290
|
accent: t
|
|
291
291
|
}), /* @__PURE__ */ l("span", {
|
|
@@ -294,27 +294,27 @@ function Ve({ harness: e, accent: t = !1, className: n = "", ...r }) {
|
|
|
294
294
|
})]
|
|
295
295
|
});
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
return
|
|
297
|
+
function z({ harness: e, accent: t = !1, className: n = "", ...r }) {
|
|
298
|
+
return M(e, "ProviderName render in src/ui/ProviderIcon.jsx"), /* @__PURE__ */ u("span", {
|
|
299
299
|
className: ["pv-name", n].filter(Boolean).join(" "),
|
|
300
|
-
style: t ? { color:
|
|
300
|
+
style: t ? { color: L(e) } : void 0,
|
|
301
301
|
...r,
|
|
302
|
-
children: [/* @__PURE__ */ l(
|
|
302
|
+
children: [/* @__PURE__ */ l(R, { harness: e }), /* @__PURE__ */ l("span", {
|
|
303
303
|
className: "pv-name-label",
|
|
304
304
|
children: e
|
|
305
305
|
})]
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function B({ className: e = "", ...t }) {
|
|
309
309
|
return /* @__PURE__ */ l("ul", {
|
|
310
310
|
className: ["pv-legend", e].filter(Boolean).join(" "),
|
|
311
311
|
...t,
|
|
312
|
-
children:
|
|
313
|
-
let t =
|
|
312
|
+
children: Re.map((e) => {
|
|
313
|
+
let t = F(e);
|
|
314
314
|
return /* @__PURE__ */ u("li", {
|
|
315
315
|
className: "pv-legend-row",
|
|
316
316
|
children: [
|
|
317
|
-
/* @__PURE__ */ l(
|
|
317
|
+
/* @__PURE__ */ l(R, {
|
|
318
318
|
harness: e,
|
|
319
319
|
accent: !0,
|
|
320
320
|
className: "pv-legend-mark"
|
|
@@ -339,7 +339,7 @@ function R({ className: e = "", ...t }) {
|
|
|
339
339
|
}
|
|
340
340
|
//#endregion
|
|
341
341
|
//#region src/ui/graph/GhostCommitNode.jsx
|
|
342
|
-
var
|
|
342
|
+
var Be = Object.freeze({
|
|
343
343
|
hash: "matched by hash",
|
|
344
344
|
patch_id: "matched by patch content",
|
|
345
345
|
author_identity: "matched by author and time",
|
|
@@ -347,8 +347,8 @@ var He = Object.freeze({
|
|
|
347
347
|
temporal: "matched by nearby time only",
|
|
348
348
|
none: "no match found"
|
|
349
349
|
});
|
|
350
|
-
function
|
|
351
|
-
let s = n === "unresolved" ? "session-era commit, no longer in history; not enough recorded metadata to map it" : `${
|
|
350
|
+
function Ve({ ghostHash: e, subject: t, resolution: n, method: r, confidence: i, className: a = "", ...o }) {
|
|
351
|
+
let s = n === "unresolved" ? "session-era commit, no longer in history; not enough recorded metadata to map it" : `${Be[r] ?? r}, ${i} confidence`;
|
|
352
352
|
return /* @__PURE__ */ l("span", {
|
|
353
353
|
className: `tlp-ghost-node tlp-terminal-${i}${a ? ` ${a}` : ""}`,
|
|
354
354
|
role: "img",
|
|
@@ -373,7 +373,7 @@ function Ue({ ghostHash: e, subject: t, resolution: n, method: r, confidence: i,
|
|
|
373
373
|
}
|
|
374
374
|
//#endregion
|
|
375
375
|
//#region src/ui/graph/SessionLane.jsx
|
|
376
|
-
function
|
|
376
|
+
function V({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i = !1, onHover: a, onSelect: o, unresolvedGhosts: s = [], className: c = "", ...d }) {
|
|
377
377
|
let f = [
|
|
378
378
|
"tlp-session-lane",
|
|
379
379
|
r && "tlp-session-lane-hover",
|
|
@@ -393,7 +393,7 @@ function z({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
|
|
|
393
393
|
onClick: () => o?.(e),
|
|
394
394
|
...d,
|
|
395
395
|
children: [
|
|
396
|
-
n && /* @__PURE__ */ l(
|
|
396
|
+
n && /* @__PURE__ */ l(R, {
|
|
397
397
|
harness: n,
|
|
398
398
|
label: !0
|
|
399
399
|
}),
|
|
@@ -412,7 +412,7 @@ function z({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
|
|
|
412
412
|
className: "tlp-session-lane-ghosts",
|
|
413
413
|
role: "group",
|
|
414
414
|
"aria-label": "session-era commits with no recorded mapping",
|
|
415
|
-
children: s.map((e) => /* @__PURE__ */ l(
|
|
415
|
+
children: s.map((e) => /* @__PURE__ */ l(Ve, {
|
|
416
416
|
ghostHash: e.ghostHash,
|
|
417
417
|
subject: e.subject,
|
|
418
418
|
resolution: e.resolution,
|
|
@@ -424,7 +424,7 @@ function z({ sessionId: e, title: t, harness: n, hovered: r = !1, selected: i =
|
|
|
424
424
|
}
|
|
425
425
|
//#endregion
|
|
426
426
|
//#region src/ui/graph/GhostGroup.jsx
|
|
427
|
-
function
|
|
427
|
+
function He({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className: i = "", ...a }) {
|
|
428
428
|
let o = `${t.length} session-era commit${t.length === 1 ? "" : "s"}`;
|
|
429
429
|
return /* @__PURE__ */ u("div", {
|
|
430
430
|
className: `tlp-ghost-group${i ? ` ${i}` : ""}`,
|
|
@@ -473,7 +473,7 @@ function We({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className:
|
|
|
473
473
|
]
|
|
474
474
|
}), n && /* @__PURE__ */ l("ul", {
|
|
475
475
|
className: "tlp-ghost-group-list",
|
|
476
|
-
children: t.map((e) => /* @__PURE__ */ u("li", { children: [/* @__PURE__ */ l(
|
|
476
|
+
children: t.map((e) => /* @__PURE__ */ u("li", { children: [/* @__PURE__ */ l(Ve, {
|
|
477
477
|
ghostHash: e.ghostHash,
|
|
478
478
|
subject: e.subject,
|
|
479
479
|
resolution: e.resolution,
|
|
@@ -488,7 +488,7 @@ function We({ successorHash: e, ghosts: t, expanded: n, onToggle: r, className:
|
|
|
488
488
|
}
|
|
489
489
|
//#endregion
|
|
490
490
|
//#region src/ui/graph/SessionOverflowDisclosure.jsx
|
|
491
|
-
function
|
|
491
|
+
function H({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i, itemLabel: a = "sessions", className: o = "", ...s }) {
|
|
492
492
|
return t.length === 0 ? null : /* @__PURE__ */ u("span", {
|
|
493
493
|
className: `tlp-overflow${o ? ` ${o}` : ""}`,
|
|
494
494
|
...s,
|
|
@@ -523,7 +523,7 @@ function B({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i,
|
|
|
523
523
|
className: "tlp-overflow-item",
|
|
524
524
|
"data-session-id": e.sessionId,
|
|
525
525
|
onClick: () => i?.(e.sessionId),
|
|
526
|
-
children: [e.harness && /* @__PURE__ */ l(
|
|
526
|
+
children: [e.harness && /* @__PURE__ */ l(R, {
|
|
527
527
|
harness: e.harness,
|
|
528
528
|
label: !0
|
|
529
529
|
}), e.title || e.sessionId]
|
|
@@ -534,7 +534,7 @@ function B({ commitHash: e, overflow: t, expanded: n, onToggle: r, onSelect: i,
|
|
|
534
534
|
}
|
|
535
535
|
//#endregion
|
|
536
536
|
//#region src/ui/graph/HighlightEdge.jsx
|
|
537
|
-
function
|
|
537
|
+
function U({ weight: e, geometry: t, className: n = "", ...r }) {
|
|
538
538
|
return /* @__PURE__ */ l("line", {
|
|
539
539
|
className: [
|
|
540
540
|
"tlp-highlight-edge",
|
|
@@ -551,9 +551,9 @@ function V({ weight: e, geometry: t, className: n = "", ...r }) {
|
|
|
551
551
|
}
|
|
552
552
|
//#endregion
|
|
553
553
|
//#region src/ui/graph/TouchedFileCluster.jsx
|
|
554
|
-
var
|
|
555
|
-
function
|
|
556
|
-
let s = t.slice(0,
|
|
554
|
+
var W = 8;
|
|
555
|
+
function G({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, className: a = "", ...o }) {
|
|
556
|
+
let s = t.slice(0, W), c = t.slice(W).map((e) => ({
|
|
557
557
|
sessionId: e,
|
|
558
558
|
title: e
|
|
559
559
|
}));
|
|
@@ -567,7 +567,7 @@ function U({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, c
|
|
|
567
567
|
className: "tlp-file-cluster-item",
|
|
568
568
|
onClick: () => i?.(e),
|
|
569
569
|
children: e
|
|
570
|
-
}, e)), /* @__PURE__ */ l(
|
|
570
|
+
}, e)), /* @__PURE__ */ l(H, {
|
|
571
571
|
commitHash: e,
|
|
572
572
|
overflow: c,
|
|
573
573
|
expanded: n,
|
|
@@ -579,9 +579,9 @@ function U({ commitHash: e, files: t, expanded: n, onToggle: r, onOpenDiff: i, c
|
|
|
579
579
|
}
|
|
580
580
|
//#endregion
|
|
581
581
|
//#region src/ui/CommitGraph.jsx
|
|
582
|
-
var
|
|
583
|
-
function
|
|
584
|
-
let
|
|
582
|
+
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;
|
|
583
|
+
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 }) {
|
|
584
|
+
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
585
|
let t = new Map(e.map((e) => [e.id, e.lane ?? 0])), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
586
586
|
return e.forEach((e, t) => {
|
|
587
587
|
let i = e.lane ?? 0;
|
|
@@ -602,11 +602,11 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
602
602
|
laneDown: i < c
|
|
603
603
|
};
|
|
604
604
|
});
|
|
605
|
-
}, [e]),
|
|
606
|
-
let e = new Set(
|
|
605
|
+
}, [e]), D = a(() => {
|
|
606
|
+
let e = new Set(E.map((e) => e.commit.id)), t = new Set((g ?? []).map((e) => e.sessionId)), n = [...(x?.edges ?? []).map((e) => ({
|
|
607
607
|
...e,
|
|
608
608
|
weight: "primary"
|
|
609
|
-
})), ...(
|
|
609
|
+
})), ...(S?.edges ?? []).map((e) => ({
|
|
610
610
|
...e,
|
|
611
611
|
weight: "secondary"
|
|
612
612
|
}))], r = /* @__PURE__ */ new Set();
|
|
@@ -620,22 +620,22 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
620
620
|
}]);
|
|
621
621
|
});
|
|
622
622
|
}, [
|
|
623
|
-
|
|
623
|
+
E,
|
|
624
624
|
g,
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
]),
|
|
625
|
+
x,
|
|
626
|
+
S
|
|
627
|
+
]), O = o(null), [k, ue] = s([]);
|
|
628
628
|
i(() => {
|
|
629
|
-
let e =
|
|
630
|
-
if (!e ||
|
|
631
|
-
|
|
629
|
+
let e = O.current;
|
|
630
|
+
if (!e || D.length === 0) {
|
|
631
|
+
ue([]);
|
|
632
632
|
return;
|
|
633
633
|
}
|
|
634
634
|
let t = () => {
|
|
635
635
|
let t = e.querySelector(".cg-history");
|
|
636
636
|
if (!t) return;
|
|
637
637
|
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
|
-
|
|
638
|
+
ue(D.flatMap((e) => {
|
|
639
639
|
let t = r.get(e.sessionId)?.getBoundingClientRect(), a = i.get(e.commitHash)?.querySelector(".cg-dot")?.getBoundingClientRect();
|
|
640
640
|
return !t || !a ? [] : [{
|
|
641
641
|
...e,
|
|
@@ -651,74 +651,74 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
651
651
|
if (t(), typeof ResizeObserver > "u") return;
|
|
652
652
|
let n = new ResizeObserver(t);
|
|
653
653
|
return n.observe(e), () => n.disconnect();
|
|
654
|
-
}, [
|
|
655
|
-
let
|
|
654
|
+
}, [D]);
|
|
655
|
+
let A = Je(T), de = ["cg", h].filter(Boolean).join(" ");
|
|
656
656
|
return e.length === 0 ? /* @__PURE__ */ l("div", {
|
|
657
|
-
className:
|
|
658
|
-
...
|
|
657
|
+
className: de,
|
|
658
|
+
...w,
|
|
659
659
|
children: /* @__PURE__ */ l("p", {
|
|
660
660
|
className: "cg-empty",
|
|
661
661
|
children: "no commits to show."
|
|
662
662
|
})
|
|
663
663
|
}) : /* @__PURE__ */ u("div", {
|
|
664
|
-
ref:
|
|
665
|
-
className:
|
|
664
|
+
ref: O,
|
|
665
|
+
className: de,
|
|
666
666
|
role: "list",
|
|
667
667
|
"aria-label": m,
|
|
668
|
-
...
|
|
668
|
+
...w,
|
|
669
669
|
children: [
|
|
670
670
|
g && g.length > 0 && /* @__PURE__ */ l("div", {
|
|
671
671
|
className: "cg-session-spine",
|
|
672
672
|
role: "group",
|
|
673
673
|
"aria-label": "recorded sessions",
|
|
674
674
|
style: { gridTemplateColumns: `repeat(${g.length}, minmax(0, 1fr))` },
|
|
675
|
-
children: g.map((e) => /* @__PURE__ */ l(
|
|
675
|
+
children: g.map((e) => /* @__PURE__ */ l(V, {
|
|
676
676
|
sessionId: e.sessionId,
|
|
677
677
|
title: e.title,
|
|
678
678
|
harness: e.harness,
|
|
679
|
-
hovered:
|
|
680
|
-
selected:
|
|
681
|
-
onHover:
|
|
682
|
-
onSelect:
|
|
679
|
+
hovered: _ === e.sessionId,
|
|
680
|
+
selected: v === e.sessionId,
|
|
681
|
+
onHover: y,
|
|
682
|
+
onSelect: b,
|
|
683
683
|
unresolvedGhosts: e.unresolvedGhosts,
|
|
684
684
|
"data-timeline-session-id": e.sessionId
|
|
685
685
|
}, e.sessionId))
|
|
686
686
|
}),
|
|
687
687
|
/* @__PURE__ */ u("div", {
|
|
688
688
|
className: "cg-history",
|
|
689
|
-
children: [
|
|
689
|
+
children: [k.length > 0 && /* @__PURE__ */ l("svg", {
|
|
690
690
|
className: "cg-highlight-layer",
|
|
691
691
|
"aria-hidden": "true",
|
|
692
|
-
children:
|
|
692
|
+
children: k.map((e) => /* @__PURE__ */ l(U, {
|
|
693
693
|
weight: e.weight,
|
|
694
694
|
geometry: e.geometry,
|
|
695
695
|
"data-session-id": e.sessionId,
|
|
696
696
|
"data-commit-hash": e.commitHash
|
|
697
697
|
}, e.key))
|
|
698
|
-
}),
|
|
698
|
+
}), E.map((e) => /* @__PURE__ */ u("div", {
|
|
699
699
|
className: "cg-history-row",
|
|
700
700
|
"data-commit-hash": e.commit.id,
|
|
701
|
-
children: [/* @__PURE__ */ l(
|
|
701
|
+
children: [/* @__PURE__ */ l(q, {
|
|
702
702
|
row: e,
|
|
703
|
-
width:
|
|
703
|
+
width: A,
|
|
704
704
|
selected: e.commit.id === t,
|
|
705
705
|
onNavigate: n,
|
|
706
706
|
onSelect: r,
|
|
707
707
|
onOpenSession: c,
|
|
708
|
-
highlightWeight:
|
|
709
|
-
expandedSessions:
|
|
710
|
-
onToggleSessions:
|
|
711
|
-
touchedFiles:
|
|
712
|
-
expandedFiles:
|
|
713
|
-
onOpenTouchedFile:
|
|
714
|
-
}),
|
|
708
|
+
highlightWeight: ce.has(e.commit.id) ? "primary" : le.has(e.commit.id) ? "secondary" : null,
|
|
709
|
+
expandedSessions: se.has(e.commit.id),
|
|
710
|
+
onToggleSessions: re,
|
|
711
|
+
touchedFiles: ie?.[e.commit.id] ?? [],
|
|
712
|
+
expandedFiles: se.has(`files:${e.commit.id}`),
|
|
713
|
+
onOpenTouchedFile: ae
|
|
714
|
+
}), C?.[e.commit.id] && /* @__PURE__ */ l("div", {
|
|
715
715
|
className: "cg-ghost-row",
|
|
716
|
-
style: { marginLeft:
|
|
717
|
-
children: /* @__PURE__ */ l(
|
|
716
|
+
style: { marginLeft: A },
|
|
717
|
+
children: /* @__PURE__ */ l(He, {
|
|
718
718
|
successorHash: e.commit.id,
|
|
719
|
-
ghosts:
|
|
720
|
-
expanded:
|
|
721
|
-
onToggle:
|
|
719
|
+
ghosts: C[e.commit.id],
|
|
720
|
+
expanded: oe.has(e.commit.id),
|
|
721
|
+
onToggle: te
|
|
722
722
|
})
|
|
723
723
|
})]
|
|
724
724
|
}, e.commit.id))]
|
|
@@ -727,20 +727,20 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
727
727
|
className: "cg-older-band",
|
|
728
728
|
children: [/* @__PURE__ */ l("span", {
|
|
729
729
|
className: "cg-gutter cg-gutter-older",
|
|
730
|
-
style: { width:
|
|
730
|
+
style: { width: A },
|
|
731
731
|
"aria-hidden": "true",
|
|
732
732
|
children: /* @__PURE__ */ l("svg", {
|
|
733
733
|
className: "cg-svg",
|
|
734
|
-
width:
|
|
734
|
+
width: A,
|
|
735
735
|
height: "100%",
|
|
736
736
|
preserveAspectRatio: "none",
|
|
737
737
|
children: /* @__PURE__ */ l("line", {
|
|
738
738
|
className: "cg-stroke-lane0",
|
|
739
|
-
x1:
|
|
739
|
+
x1: K(0),
|
|
740
740
|
y1: "0",
|
|
741
|
-
x2:
|
|
741
|
+
x2: K(0),
|
|
742
742
|
y2: "60%",
|
|
743
|
-
strokeDasharray:
|
|
743
|
+
strokeDasharray: qe
|
|
744
744
|
})
|
|
745
745
|
})
|
|
746
746
|
}), /* @__PURE__ */ u("button", {
|
|
@@ -758,13 +758,13 @@ function Ze({ commits: e = [], selectedId: t, onNavigate: n, onSelect: r, onOpen
|
|
|
758
758
|
]
|
|
759
759
|
});
|
|
760
760
|
}
|
|
761
|
-
function
|
|
762
|
-
let { commit: m, lane: h, joins: g, passLanes:
|
|
761
|
+
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 }) {
|
|
762
|
+
let { commit: m, lane: h, joins: g, passLanes: _, laneUp: v, laneDown: b } = e, x = !!m.session, S = [
|
|
763
763
|
"cg-dot",
|
|
764
|
-
|
|
764
|
+
x ? "cg-dot-filled" : "cg-dot-hollow",
|
|
765
765
|
n && "cg-dot-sel",
|
|
766
766
|
o && `cg-dot-highlight-${o}`
|
|
767
|
-
].filter(Boolean).join(" "),
|
|
767
|
+
].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
768
|
return /* @__PURE__ */ u("div", {
|
|
769
769
|
className: "cg-band",
|
|
770
770
|
role: "listitem",
|
|
@@ -779,57 +779,57 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
779
779
|
height: "100%",
|
|
780
780
|
preserveAspectRatio: "none",
|
|
781
781
|
children: [
|
|
782
|
-
|
|
782
|
+
v && /* @__PURE__ */ l("line", {
|
|
783
783
|
className: "cg-stroke-self",
|
|
784
|
-
x1:
|
|
784
|
+
x1: K(h),
|
|
785
785
|
y1: "0",
|
|
786
|
-
x2:
|
|
786
|
+
x2: K(h),
|
|
787
787
|
y2: "50%"
|
|
788
788
|
}),
|
|
789
|
-
|
|
789
|
+
b && /* @__PURE__ */ l("line", {
|
|
790
790
|
className: "cg-stroke-self",
|
|
791
|
-
x1:
|
|
791
|
+
x1: K(h),
|
|
792
792
|
y1: "50%",
|
|
793
|
-
x2:
|
|
793
|
+
x2: K(h),
|
|
794
794
|
y2: "100%"
|
|
795
795
|
}),
|
|
796
|
-
|
|
796
|
+
_.map((e) => /* @__PURE__ */ l("line", {
|
|
797
797
|
className: e === 0 ? "cg-stroke-lane0" : "cg-stroke-branch",
|
|
798
|
-
x1:
|
|
798
|
+
x1: K(e),
|
|
799
799
|
y1: "0",
|
|
800
|
-
x2:
|
|
800
|
+
x2: K(e),
|
|
801
801
|
y2: "100%"
|
|
802
802
|
}, e)),
|
|
803
803
|
g.map((e, t) => /* @__PURE__ */ u("g", {
|
|
804
804
|
className: "cg-elbow",
|
|
805
805
|
children: [/* @__PURE__ */ l("line", {
|
|
806
806
|
className: "cg-stroke-branch",
|
|
807
|
-
x1:
|
|
807
|
+
x1: K(e.to),
|
|
808
808
|
y1: "50%",
|
|
809
|
-
x2:
|
|
809
|
+
x2: K(e.to),
|
|
810
810
|
y2: "100%"
|
|
811
811
|
}), /* @__PURE__ */ l("line", {
|
|
812
812
|
className: "cg-stroke-branch",
|
|
813
|
-
x1:
|
|
813
|
+
x1: K(e.to),
|
|
814
814
|
y1: "50%",
|
|
815
|
-
x2:
|
|
815
|
+
x2: K(e.from),
|
|
816
816
|
y2: "50%"
|
|
817
817
|
})]
|
|
818
818
|
}, t))
|
|
819
819
|
]
|
|
820
820
|
}),
|
|
821
821
|
/* @__PURE__ */ l("span", {
|
|
822
|
-
className:
|
|
822
|
+
className: S,
|
|
823
823
|
style: {
|
|
824
|
-
left:
|
|
825
|
-
width:
|
|
826
|
-
height:
|
|
824
|
+
left: K(h),
|
|
825
|
+
width: Ke,
|
|
826
|
+
height: Ke
|
|
827
827
|
},
|
|
828
|
-
"data-has-session":
|
|
828
|
+
"data-has-session": x || void 0
|
|
829
829
|
}),
|
|
830
|
-
|
|
830
|
+
x && /* @__PURE__ */ l(te, {
|
|
831
831
|
className: "cg-spark",
|
|
832
|
-
style: { left:
|
|
832
|
+
style: { left: K(h) },
|
|
833
833
|
"aria-hidden": "true"
|
|
834
834
|
})
|
|
835
835
|
]
|
|
@@ -838,7 +838,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
838
838
|
children: [
|
|
839
839
|
/* @__PURE__ */ u("button", {
|
|
840
840
|
type: "button",
|
|
841
|
-
className:
|
|
841
|
+
className: ne,
|
|
842
842
|
onClick: () => {
|
|
843
843
|
r ? r({
|
|
844
844
|
type: "open-change",
|
|
@@ -857,7 +857,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
857
857
|
children: [
|
|
858
858
|
m.merged && /* @__PURE__ */ u("span", {
|
|
859
859
|
className: "cg-merged",
|
|
860
|
-
children: [/* @__PURE__ */ l(
|
|
860
|
+
children: [/* @__PURE__ */ l(y, {
|
|
861
861
|
className: "cg-merged-ic",
|
|
862
862
|
"aria-hidden": "true"
|
|
863
863
|
}), "merged"]
|
|
@@ -870,7 +870,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
870
870
|
className: "cg-branch",
|
|
871
871
|
children: m.branch
|
|
872
872
|
}),
|
|
873
|
-
|
|
873
|
+
x && /* @__PURE__ */ l("span", {
|
|
874
874
|
className: "cg-sr",
|
|
875
875
|
children: "session"
|
|
876
876
|
}),
|
|
@@ -885,7 +885,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
885
885
|
className: "cg-sessions",
|
|
886
886
|
role: "group",
|
|
887
887
|
"aria-label": `sessions linked to ${m.message}`,
|
|
888
|
-
children: [
|
|
888
|
+
children: [C.map((e) => /* @__PURE__ */ u("button", {
|
|
889
889
|
type: "button",
|
|
890
890
|
className: "cg-session",
|
|
891
891
|
onClick: () => {
|
|
@@ -902,7 +902,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
902
902
|
}) : a?.(e.sessionId);
|
|
903
903
|
},
|
|
904
904
|
children: [
|
|
905
|
-
/* @__PURE__ */ l(
|
|
905
|
+
/* @__PURE__ */ l(z, { harness: e.harness }),
|
|
906
906
|
/* @__PURE__ */ l("span", {
|
|
907
907
|
className: "cg-session-title",
|
|
908
908
|
children: e.title || e.sessionId
|
|
@@ -916,9 +916,9 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
916
916
|
}).toLowerCase()
|
|
917
917
|
})
|
|
918
918
|
]
|
|
919
|
-
}, e.sessionId)),
|
|
919
|
+
}, e.sessionId)), ee.length > 0 && /* @__PURE__ */ l(H, {
|
|
920
920
|
commitHash: m.id,
|
|
921
|
-
overflow:
|
|
921
|
+
overflow: ee,
|
|
922
922
|
expanded: s,
|
|
923
923
|
onToggle: c ?? (() => {}),
|
|
924
924
|
onSelect: (e) => {
|
|
@@ -938,7 +938,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
938
938
|
}),
|
|
939
939
|
d.length > 0 && /* @__PURE__ */ l("div", {
|
|
940
940
|
className: "cg-touched-files",
|
|
941
|
-
children: /* @__PURE__ */ l(
|
|
941
|
+
children: /* @__PURE__ */ l(G, {
|
|
942
942
|
commitHash: `files:${m.id}`,
|
|
943
943
|
files: d,
|
|
944
944
|
expanded: f,
|
|
@@ -952,7 +952,7 @@ function G({ row: e, width: t, selected: n, onNavigate: r, onSelect: i, onOpenSe
|
|
|
952
952
|
}
|
|
953
953
|
//#endregion
|
|
954
954
|
//#region src/ui/DiffView.jsx
|
|
955
|
-
function
|
|
955
|
+
function Xe(e) {
|
|
956
956
|
let t = 0, n = 0;
|
|
957
957
|
for (let r of e) for (let e of r.lines) e.type === "add" ? t++ : e.type === "del" && n++;
|
|
958
958
|
return {
|
|
@@ -960,8 +960,8 @@ function Qe(e) {
|
|
|
960
960
|
dels: n
|
|
961
961
|
};
|
|
962
962
|
}
|
|
963
|
-
function
|
|
964
|
-
let { type: t, oldNo: n, newNo: r, text: i } = e, a = t === "add" ?
|
|
963
|
+
function Ze({ line: e }) {
|
|
964
|
+
let { type: t, oldNo: n, newNo: r, text: i } = e, a = t === "add" ? S : t === "del" ? x : null;
|
|
965
965
|
return /* @__PURE__ */ u("div", {
|
|
966
966
|
className: `dv-line dv-${t}`,
|
|
967
967
|
role: "row",
|
|
@@ -997,7 +997,7 @@ function $e({ line: e }) {
|
|
|
997
997
|
]
|
|
998
998
|
});
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function Qe({ match: e }) {
|
|
1001
1001
|
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
1002
|
return /* @__PURE__ */ u("div", {
|
|
1003
1003
|
className: `dv-match${c ? " dv-match-kept" : ""}`,
|
|
@@ -1058,7 +1058,7 @@ function et({ match: e }) {
|
|
|
1058
1058
|
className: "dv-sign",
|
|
1059
1059
|
role: "cell",
|
|
1060
1060
|
"aria-hidden": "true",
|
|
1061
|
-
children: /* @__PURE__ */ l(
|
|
1061
|
+
children: /* @__PURE__ */ l(x, { "aria-hidden": "true" })
|
|
1062
1062
|
}),
|
|
1063
1063
|
/* @__PURE__ */ u("span", {
|
|
1064
1064
|
className: "dv-text",
|
|
@@ -1093,7 +1093,7 @@ function et({ match: e }) {
|
|
|
1093
1093
|
className: "dv-sign",
|
|
1094
1094
|
role: "cell",
|
|
1095
1095
|
"aria-hidden": "true",
|
|
1096
|
-
children: /* @__PURE__ */ l(
|
|
1096
|
+
children: /* @__PURE__ */ l(S, { "aria-hidden": "true" })
|
|
1097
1097
|
}),
|
|
1098
1098
|
/* @__PURE__ */ u("span", {
|
|
1099
1099
|
className: "dv-text",
|
|
@@ -1108,8 +1108,8 @@ function et({ match: e }) {
|
|
|
1108
1108
|
})]
|
|
1109
1109
|
});
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1112
|
-
let o = r === "redaction", s = o ? null :
|
|
1111
|
+
function $e({ file: e, hunks: t = [], matches: n = [], variant: r = "default", className: i = "", ...a }) {
|
|
1112
|
+
let o = r === "redaction", s = o ? null : Xe(t);
|
|
1113
1113
|
return /* @__PURE__ */ u("figure", {
|
|
1114
1114
|
className: [
|
|
1115
1115
|
"dv",
|
|
@@ -1148,7 +1148,7 @@ function tt({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
|
|
|
1148
1148
|
children: n.length === 0 ? /* @__PURE__ */ l("p", {
|
|
1149
1149
|
className: "dv-empty",
|
|
1150
1150
|
children: "no sensitive content detected. safe to share as-is."
|
|
1151
|
-
}) : n.map((e, t) => /* @__PURE__ */ l(
|
|
1151
|
+
}) : n.map((e, t) => /* @__PURE__ */ l(Qe, { match: e }, e.id ?? t))
|
|
1152
1152
|
}) : /* @__PURE__ */ l("div", {
|
|
1153
1153
|
className: "dv-body",
|
|
1154
1154
|
role: "table",
|
|
@@ -1179,7 +1179,7 @@ function tt({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
|
|
|
1179
1179
|
}), /* @__PURE__ */ l("div", {
|
|
1180
1180
|
className: "dv-hunk-pair",
|
|
1181
1181
|
role: "rowgroup",
|
|
1182
|
-
children: e.lines.map((e, t) => /* @__PURE__ */ l(
|
|
1182
|
+
children: e.lines.map((e, t) => /* @__PURE__ */ l(Ze, { line: e }, t))
|
|
1183
1183
|
})]
|
|
1184
1184
|
}, t))
|
|
1185
1185
|
})]
|
|
@@ -1187,8 +1187,8 @@ function tt({ file: e, hunks: t = [], matches: n = [], variant: r = "default", c
|
|
|
1187
1187
|
}
|
|
1188
1188
|
//#endregion
|
|
1189
1189
|
//#region src/ui/graph/types.js
|
|
1190
|
-
var
|
|
1191
|
-
function
|
|
1190
|
+
var et = T, tt = ae, nt = oe, rt = se, it = w;
|
|
1191
|
+
function at(e, t, n, r, i) {
|
|
1192
1192
|
if (e(t)) return;
|
|
1193
1193
|
let a;
|
|
1194
1194
|
try {
|
|
@@ -1198,23 +1198,23 @@ function K(e, t, n, r, i) {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
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
1200
|
}
|
|
1201
|
-
function
|
|
1202
|
-
for (let [t, n] of e.nodes.entries())
|
|
1203
|
-
for (let [t, n] of e.violations.entries())
|
|
1201
|
+
function J(e) {
|
|
1202
|
+
for (let [t, n] of e.nodes.entries()) at(he, n.kind, `nodes[${t}].kind`, "code-map payload rendering", T);
|
|
1203
|
+
for (let [t, n] of e.violations.entries()) at(A, n.kind, `violations[${t}].kind`, "code-map payload rendering", oe);
|
|
1204
1204
|
}
|
|
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())
|
|
1205
|
+
function ot(e) {
|
|
1206
|
+
for (let [t, n] of e.files.entries()) at(de, n.status, `files[${t}].status`, "change-detail payload rendering", se);
|
|
1207
|
+
for (let [t, n] of e.work.entries()) at(k, n.binding, `work[${t}].binding`, "change-detail payload rendering", ae);
|
|
1208
|
+
for (let [t, n] of e.slice.nodes.entries()) at(he, n.kind, `slice.nodes[${t}].kind`, "change-detail payload rendering", T);
|
|
1209
|
+
for (let [t, n] of e.violations.entries()) at(A, n.kind, `violations[${t}].kind`, "change-detail payload rendering", oe);
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1212
|
-
|
|
1213
|
-
for (let [t, n] of e.hunks.entries()) for (let [e, r] of n.lines.entries())
|
|
1211
|
+
function st(e) {
|
|
1212
|
+
at(de, e.status, "status", "change-diff payload rendering", se);
|
|
1213
|
+
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
1214
|
}
|
|
1215
1215
|
//#endregion
|
|
1216
1216
|
//#region src/ui/graph/graphContractPolicy.js
|
|
1217
|
-
var
|
|
1217
|
+
var ct = Object.freeze({
|
|
1218
1218
|
decision: "decisions",
|
|
1219
1219
|
friction: "friction",
|
|
1220
1220
|
unusual: "unusual signals",
|
|
@@ -1225,23 +1225,23 @@ var J = Object.freeze({
|
|
|
1225
1225
|
});
|
|
1226
1226
|
ft(), pt();
|
|
1227
1227
|
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: ${
|
|
1228
|
+
let t = e.findIndex((e) => !pe(e.kind) || !me(e.provenance));
|
|
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: ${ce.join(", ")}; provenances: ${le.join(", ")})`, "validate and normalize the local API response to the published @peasant-labs/schema contract before rendering");
|
|
1230
1230
|
}
|
|
1231
1231
|
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: ${
|
|
1232
|
+
let t = e.findIndex((e) => !ge(e.readAttribution) || !_e(e.readState));
|
|
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: ${E.join(", ")}; read-state grades: ${D.join(", ")})`, "validate and normalize the local API response to the published @peasant-labs/schema contract before ranking");
|
|
1234
1234
|
}
|
|
1235
1235
|
function ft() {
|
|
1236
|
-
let e = Object.keys(
|
|
1237
|
-
if (!(t.length === 0 && n.length === 0 && e.length ===
|
|
1236
|
+
let e = Object.keys(ct), t = ce.filter((e) => typeof ct[e] != "string" || ct[e].trim() === ""), n = e.filter((e) => !pe(e));
|
|
1237
|
+
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
1238
|
}
|
|
1239
1239
|
function pt() {
|
|
1240
|
-
let e = Object.keys(lt), t =
|
|
1240
|
+
let e = Object.keys(lt), t = le.filter((e) => {
|
|
1241
1241
|
let t = lt[e];
|
|
1242
1242
|
return !t || typeof t.markerClass != "string" || t.markerClass.trim() === "";
|
|
1243
|
-
}), n = e.filter((e) => !
|
|
1244
|
-
if (!(t.length === 0 && n.length === 0 && e.length ===
|
|
1243
|
+
}), n = e.filter((e) => !me(e));
|
|
1244
|
+
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
1245
|
}
|
|
1246
1246
|
function mt(e, t, n, r) {
|
|
1247
1247
|
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 +1695,7 @@ function un(e) {
|
|
|
1695
1695
|
});
|
|
1696
1696
|
}
|
|
1697
1697
|
function dn(e, t) {
|
|
1698
|
-
e &&
|
|
1698
|
+
e && J(e);
|
|
1699
1699
|
let n = X(t), r = e?.nodes ?? [];
|
|
1700
1700
|
if (!Array.isArray(r)) throw Z("derive view", "payload.nodes", "nodes is not an array", "provide a CodeMapPayload with a nodes array");
|
|
1701
1701
|
let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
@@ -1738,11 +1738,11 @@ function dn(e, t) {
|
|
|
1738
1738
|
let t = e;
|
|
1739
1739
|
for (; t;) g.add(t.id), t = t.parent ? i.get(t.parent) : null;
|
|
1740
1740
|
}
|
|
1741
|
-
let
|
|
1742
|
-
function
|
|
1741
|
+
let _ = en[n.grain], v = [];
|
|
1742
|
+
function y(e, t, n = null) {
|
|
1743
1743
|
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 (
|
|
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 < _ || m.has(e.id)), c = !!h && i.length > 0;
|
|
1745
|
+
if (v.push({
|
|
1746
1746
|
node: { ...e },
|
|
1747
1747
|
depth: t,
|
|
1748
1748
|
parentId: n,
|
|
@@ -1751,28 +1751,28 @@ function dn(e, t) {
|
|
|
1751
1751
|
canExpand: s,
|
|
1752
1752
|
forcedOpen: c,
|
|
1753
1753
|
expanded: c || s && m.has(e.id)
|
|
1754
|
-
}), h || t <
|
|
1754
|
+
}), h || t < _ || m.has(e.id)) for (let n of r) y(n, t + 1, e.id);
|
|
1755
1755
|
}
|
|
1756
|
-
for (let e of s)
|
|
1757
|
-
let
|
|
1758
|
-
function
|
|
1756
|
+
for (let e of s) y(e, 0);
|
|
1757
|
+
let b = [];
|
|
1758
|
+
function x(e, t) {
|
|
1759
1759
|
let n = o.get(e.id) ?? [];
|
|
1760
|
-
if (n.length > 0 && (t <
|
|
1761
|
-
else
|
|
1760
|
+
if (n.length > 0 && (t < _ || m.has(e.id))) for (let e of n) x(e, t + 1);
|
|
1761
|
+
else b.push({ ...e });
|
|
1762
1762
|
}
|
|
1763
|
-
for (let e of s)
|
|
1764
|
-
let
|
|
1763
|
+
for (let e of s) x(e, 0);
|
|
1764
|
+
let S = n.selectedId ? i.get(n.selectedId) ?? null : null, C = new Set(v.map((e) => e.node.id));
|
|
1765
1765
|
return {
|
|
1766
1766
|
state: n,
|
|
1767
|
-
rows:
|
|
1768
|
-
focusedId: n.navigatorFocusedId &&
|
|
1769
|
-
selected:
|
|
1770
|
-
staleSelectedId: n.selectedId && !
|
|
1767
|
+
rows: v,
|
|
1768
|
+
focusedId: n.navigatorFocusedId && C.has(n.navigatorFocusedId) ? n.navigatorFocusedId : v[0]?.node.id ?? null,
|
|
1769
|
+
selected: S ? { ...S } : null,
|
|
1770
|
+
staleSelectedId: n.selectedId && !S ? n.selectedId : null,
|
|
1771
1771
|
canvas: {
|
|
1772
1772
|
allNodes: [...i.values()].map((e) => ({ ...e })),
|
|
1773
|
-
nodes:
|
|
1774
|
-
visibleIds:
|
|
1775
|
-
selectedId:
|
|
1773
|
+
nodes: b,
|
|
1774
|
+
visibleIds: b.map((e) => e.id),
|
|
1775
|
+
selectedId: S?.id ?? null,
|
|
1776
1776
|
grain: n.grain,
|
|
1777
1777
|
expandedIds: [...m].sort(gn),
|
|
1778
1778
|
viewport: n.viewport ? { ...n.viewport } : null,
|
|
@@ -2140,196 +2140,196 @@ function ar(e, t, n) {
|
|
|
2140
2140
|
function or({ data: i = {
|
|
2141
2141
|
nodes: [],
|
|
2142
2142
|
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
|
-
|
|
2143
|
+
}, 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 }) {
|
|
2144
|
+
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(() => ({
|
|
2145
|
+
x: $(T?.panX, 0),
|
|
2146
|
+
y: $(T?.panY, 0)
|
|
2147
|
+
})), [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, [
|
|
2148
|
+
O,
|
|
2149
|
+
Le,
|
|
2150
|
+
he
|
|
2151
|
+
]), R = O ? y ?? null : _e, ze = O && T != null && lr(T.scale), z = F ? F.scale : ze ? T.scale : be, B = F ? {
|
|
2152
|
+
x: F.panX,
|
|
2153
|
+
y: F.panY
|
|
2154
|
+
} : ze ? {
|
|
2155
|
+
x: $(T.panX, 0),
|
|
2156
|
+
y: $(T.panY, 0)
|
|
2157
|
+
} : Se, Be = o(z), Ve = o(B);
|
|
2158
|
+
Be.current = z, Ve.current = B, n(() => {
|
|
2159
|
+
if (F && !P.current) {
|
|
2160
|
+
if (ze && T.scale === F.scale && $(T.panX, 0) === F.panX && $(T.panY, 0) === F.panY) {
|
|
2161
|
+
De(null);
|
|
2162
2162
|
return;
|
|
2163
2163
|
}
|
|
2164
|
-
return
|
|
2164
|
+
return Oe.current = setTimeout(() => De(null), Un), () => clearTimeout(Oe.current);
|
|
2165
2165
|
}
|
|
2166
2166
|
}, [
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2167
|
+
F,
|
|
2168
|
+
ze,
|
|
2169
|
+
T?.scale,
|
|
2170
|
+
T?.panX,
|
|
2171
|
+
T?.panY
|
|
2172
2172
|
]), n(() => {
|
|
2173
|
-
|
|
2174
|
-
}, [
|
|
2175
|
-
!
|
|
2176
|
-
}, [
|
|
2177
|
-
|
|
2178
|
-
}, [
|
|
2179
|
-
if (
|
|
2180
|
-
if (!
|
|
2173
|
+
O || f !== Fe.current && (Fe.current = f, Vn[f] !== void 0 && me(f));
|
|
2174
|
+
}, [O, f]), n(() => {
|
|
2175
|
+
!O && p !== void 0 && ge(cr(p));
|
|
2176
|
+
}, [O, Le]), n(() => {
|
|
2177
|
+
O || y !== Ie.current && (Ie.current = y, y !== void 0 && ve(y));
|
|
2178
|
+
}, [O, y]), n(() => {
|
|
2179
|
+
if (O) {
|
|
2180
|
+
if (!T && Ne.current !== "") Ne.current = "", Ae.current = !1, ke.current = !1, xe(1), Ce({
|
|
2181
2181
|
x: 0,
|
|
2182
2182
|
y: 0
|
|
2183
2183
|
});
|
|
2184
|
-
else if (
|
|
2185
|
-
let e = `${
|
|
2186
|
-
e !==
|
|
2184
|
+
else if (T && lr(T.scale)) {
|
|
2185
|
+
let e = `${T.scale}|${$(T.panX, 0)}|${$(T.panY, 0)}`;
|
|
2186
|
+
e !== Ne.current && (Ne.current = e, Ae.current = !0);
|
|
2187
2187
|
}
|
|
2188
2188
|
return;
|
|
2189
2189
|
}
|
|
2190
|
-
if (!
|
|
2191
|
-
if (
|
|
2192
|
-
|
|
2190
|
+
if (!T) {
|
|
2191
|
+
if (Ne.current === "") return;
|
|
2192
|
+
Ne.current = "", Me.current = "1|0|0", Ae.current = !1, xe(1), Ce({
|
|
2193
2193
|
x: 0,
|
|
2194
2194
|
y: 0
|
|
2195
2195
|
});
|
|
2196
2196
|
return;
|
|
2197
2197
|
}
|
|
2198
|
-
if (!lr(
|
|
2199
|
-
let e = `${
|
|
2200
|
-
e !==
|
|
2201
|
-
x: $(
|
|
2202
|
-
y: $(
|
|
2198
|
+
if (!lr(T.scale)) return;
|
|
2199
|
+
let e = `${T.scale}|${$(T.panX, 0)}|${$(T.panY, 0)}`;
|
|
2200
|
+
e !== Ne.current && (Ne.current = e, Ae.current = !0, Me.current = e, xe(T.scale), Ce({
|
|
2201
|
+
x: $(T.panX, 0),
|
|
2202
|
+
y: $(T.panY, 0)
|
|
2203
2203
|
}));
|
|
2204
2204
|
}, [
|
|
2205
|
+
O,
|
|
2205
2206
|
T,
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
C?.panY
|
|
2207
|
+
T?.scale,
|
|
2208
|
+
T?.panX,
|
|
2209
|
+
T?.panY
|
|
2210
2210
|
]), n(() => {
|
|
2211
|
-
if (
|
|
2212
|
-
let e = `${
|
|
2213
|
-
|
|
2214
|
-
scale:
|
|
2215
|
-
panX:
|
|
2216
|
-
panY:
|
|
2217
|
-
}),
|
|
2211
|
+
if (O || !E && !D) return;
|
|
2212
|
+
let e = `${z}|${B.x}|${B.y}`;
|
|
2213
|
+
Me.current !== e && (Me.current = e, E?.({
|
|
2214
|
+
scale: z,
|
|
2215
|
+
panX: B.x,
|
|
2216
|
+
panY: B.y
|
|
2217
|
+
}), Pe.current && (Pe.current = !1, D?.({
|
|
2218
2218
|
type: "set-viewport",
|
|
2219
2219
|
viewport: {
|
|
2220
|
-
scale:
|
|
2221
|
-
panX:
|
|
2222
|
-
panY:
|
|
2220
|
+
scale: z,
|
|
2221
|
+
panX: B.x,
|
|
2222
|
+
panY: B.y
|
|
2223
2223
|
}
|
|
2224
2224
|
})));
|
|
2225
2225
|
}, [
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2226
|
+
O,
|
|
2227
|
+
D,
|
|
2228
|
+
E,
|
|
2229
|
+
B.x,
|
|
2230
|
+
B.y,
|
|
2231
|
+
z
|
|
2232
2232
|
]);
|
|
2233
|
-
let
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2233
|
+
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), [
|
|
2234
|
+
V,
|
|
2235
|
+
I,
|
|
2236
|
+
L,
|
|
2237
2237
|
ur(h)
|
|
2238
|
-
]),
|
|
2238
|
+
]), 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
2239
|
let e = /* @__PURE__ */ new Map();
|
|
2240
|
-
for (let t of
|
|
2240
|
+
for (let t of U) e.set(t.node.id, t);
|
|
2241
2241
|
return e;
|
|
2242
|
-
}, [
|
|
2242
|
+
}, [U]), We = a(() => {
|
|
2243
2243
|
let e = /* @__PURE__ */ new Map();
|
|
2244
|
-
for (let [t, n] of
|
|
2244
|
+
for (let [t, n] of V.children) e.set(t, n.length);
|
|
2245
2245
|
return e;
|
|
2246
|
-
}, [
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
]),
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
]),
|
|
2255
|
-
let e = cr(
|
|
2246
|
+
}, [V]), Ge = a(() => tr(ue, V.parentIdByChild, H), [
|
|
2247
|
+
ue,
|
|
2248
|
+
V.parentIdByChild,
|
|
2249
|
+
H
|
|
2250
|
+
]), Ke = a(() => Ge.reduce((e, t) => Math.max(e, t.weight), 1), [Ge]), qe = a(() => nr(k, V.parentIdByChild, H), [
|
|
2251
|
+
k,
|
|
2252
|
+
V.parentIdByChild,
|
|
2253
|
+
H
|
|
2254
|
+
]), K = a(() => {
|
|
2255
|
+
let e = cr(C);
|
|
2256
2256
|
if (e.size === 0) return e;
|
|
2257
|
-
let t = er(
|
|
2257
|
+
let t = er(V.parentIdByChild, H), n = /* @__PURE__ */ new Set();
|
|
2258
2258
|
for (let r of e) {
|
|
2259
2259
|
let e = t(r);
|
|
2260
2260
|
e && n.add(e);
|
|
2261
2261
|
}
|
|
2262
2262
|
return n;
|
|
2263
2263
|
}, [
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
]),
|
|
2268
|
-
let e =
|
|
2269
|
-
return e ?
|
|
2270
|
-
}, [
|
|
2271
|
-
|
|
2264
|
+
Re,
|
|
2265
|
+
V.parentIdByChild,
|
|
2266
|
+
H
|
|
2267
|
+
]), Je = a(() => {
|
|
2268
|
+
let e = we.trim().toLowerCase();
|
|
2269
|
+
return e ? k.filter((t) => t.id.toLowerCase().includes(e) || (t.label || "").toLowerCase().includes(e)).slice(0, 8) : [];
|
|
2270
|
+
}, [k, we]), Ye = t((e) => {
|
|
2271
|
+
E?.(e), D?.({
|
|
2272
2272
|
type: "set-viewport",
|
|
2273
2273
|
viewport: e
|
|
2274
2274
|
});
|
|
2275
|
-
}, [
|
|
2276
|
-
if (
|
|
2277
|
-
|
|
2275
|
+
}, [D, E]), q = t((e, t) => {
|
|
2276
|
+
if (O && t) {
|
|
2277
|
+
Ye(e);
|
|
2278
2278
|
return;
|
|
2279
2279
|
}
|
|
2280
|
-
t && (
|
|
2280
|
+
t && (Pe.current = !0), xe(e.scale), Ce({
|
|
2281
2281
|
x: e.panX,
|
|
2282
2282
|
y: e.panY
|
|
2283
2283
|
});
|
|
2284
|
-
}, [
|
|
2285
|
-
let t =
|
|
2286
|
-
if (!t ||
|
|
2284
|
+
}, [O, Ye]), Xe = t((e = !1) => {
|
|
2285
|
+
let t = N.current;
|
|
2286
|
+
if (!t || W <= 0 || G <= 0) return;
|
|
2287
2287
|
let n = t.clientWidth, r = t.clientHeight;
|
|
2288
2288
|
if (n <= 0 || r <= 0) return;
|
|
2289
|
-
let i = Math.min(n /
|
|
2290
|
-
|
|
2289
|
+
let i = Math.min(n / W, r / G), a = Math.max(Y.min, Math.min(Y.max, i));
|
|
2290
|
+
q({
|
|
2291
2291
|
scale: a,
|
|
2292
|
-
panX: (n -
|
|
2293
|
-
panY: (r -
|
|
2292
|
+
panX: (n - W * a) / 2,
|
|
2293
|
+
panY: (r - G * a) / 2
|
|
2294
2294
|
}, e);
|
|
2295
2295
|
}, [
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
]),
|
|
2300
|
-
let n =
|
|
2296
|
+
q,
|
|
2297
|
+
W,
|
|
2298
|
+
G
|
|
2299
|
+
]), Ze = t((e, t = !1) => {
|
|
2300
|
+
let n = N.current;
|
|
2301
2301
|
if (!n) return !1;
|
|
2302
2302
|
let r = n.clientWidth, i = n.clientHeight;
|
|
2303
2303
|
if (r <= 0 || i <= 0) return !1;
|
|
2304
|
-
let a =
|
|
2304
|
+
let a = U.filter((t) => e.has(t.node.id));
|
|
2305
2305
|
if (a.length === 0) return !1;
|
|
2306
2306
|
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
2307
|
if (u <= 0 || d <= 0) return !1;
|
|
2308
2308
|
let f = Math.min(r / u, i / d), p = Math.max(Y.min, Math.min(Y.max, f));
|
|
2309
|
-
return
|
|
2309
|
+
return q({
|
|
2310
2310
|
scale: p,
|
|
2311
2311
|
panX: r / 2 - (o + u / 2) * p,
|
|
2312
2312
|
panY: i / 2 - (s + d / 2) * p
|
|
2313
2313
|
}, t), !0;
|
|
2314
|
-
}, [
|
|
2314
|
+
}, [q, U]), [Qe, $e] = s(!1);
|
|
2315
2315
|
n(() => {
|
|
2316
|
-
if (!
|
|
2317
|
-
let e = window.setTimeout(() =>
|
|
2316
|
+
if (!Qe) return;
|
|
2317
|
+
let e = window.setTimeout(() => $e(!1), 200);
|
|
2318
2318
|
return () => window.clearTimeout(e);
|
|
2319
|
-
}, [
|
|
2320
|
-
let
|
|
2319
|
+
}, [Qe]);
|
|
2320
|
+
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
2321
|
n(() => {
|
|
2322
|
-
let e =
|
|
2323
|
-
if (
|
|
2324
|
-
|
|
2322
|
+
let e = nt.current;
|
|
2323
|
+
if (nt.current = L, Ae.current) {
|
|
2324
|
+
Ae.current = !1, ke.current = !0;
|
|
2325
2325
|
return;
|
|
2326
2326
|
}
|
|
2327
|
-
if (!
|
|
2328
|
-
|
|
2327
|
+
if (!ke.current) {
|
|
2328
|
+
ke.current = !0, Xe(ze);
|
|
2329
2329
|
return;
|
|
2330
2330
|
}
|
|
2331
2331
|
let t = null;
|
|
2332
|
-
for (let n of
|
|
2332
|
+
for (let n of L) if (!e.has(n)) {
|
|
2333
2333
|
t = n;
|
|
2334
2334
|
break;
|
|
2335
2335
|
}
|
|
@@ -2337,164 +2337,164 @@ function or({ data: i = {
|
|
|
2337
2337
|
let e = /* @__PURE__ */ new Set([t]), n = [t];
|
|
2338
2338
|
for (; n.length > 0;) {
|
|
2339
2339
|
let t = n.pop();
|
|
2340
|
-
for (let r of
|
|
2340
|
+
for (let r of V.children.get(t) ?? []) e.add(r.id), n.push(r.id);
|
|
2341
2341
|
}
|
|
2342
|
-
let r = [...e].filter((e) =>
|
|
2343
|
-
if (
|
|
2342
|
+
let r = [...e].filter((e) => H.has(e));
|
|
2343
|
+
if ($e(!0), r.length > 0 && Ze(new Set(r), !0)) return;
|
|
2344
2344
|
}
|
|
2345
|
-
|
|
2346
|
-
}, [
|
|
2347
|
-
let
|
|
2348
|
-
let t =
|
|
2345
|
+
Xe(ze);
|
|
2346
|
+
}, [et, tt]);
|
|
2347
|
+
let rt = t((e) => {
|
|
2348
|
+
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
2349
|
if (a === i) return;
|
|
2350
|
-
let o =
|
|
2351
|
-
|
|
2350
|
+
let o = Ve.current;
|
|
2351
|
+
q({
|
|
2352
2352
|
scale: a,
|
|
2353
2353
|
panX: n - (n - o.x) / i * a,
|
|
2354
2354
|
panY: r - (r - o.y) / i * a
|
|
2355
2355
|
}, !0);
|
|
2356
|
-
}, [
|
|
2356
|
+
}, [q]), it = t((e) => {
|
|
2357
2357
|
if (!(e.ctrlKey || e.metaKey)) return;
|
|
2358
2358
|
e.preventDefault();
|
|
2359
|
-
let t =
|
|
2359
|
+
let t = N.current;
|
|
2360
2360
|
if (!t) return;
|
|
2361
|
-
let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a =
|
|
2361
|
+
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
2362
|
if (c === a) return;
|
|
2363
|
-
let l =
|
|
2364
|
-
|
|
2363
|
+
let l = Ve.current;
|
|
2364
|
+
q({
|
|
2365
2365
|
scale: c,
|
|
2366
2366
|
panX: r - (r - l.x) / a * c,
|
|
2367
2367
|
panY: i - (i - l.y) / a * c
|
|
2368
2368
|
}, !0);
|
|
2369
|
-
}, [
|
|
2369
|
+
}, [q]);
|
|
2370
2370
|
n(() => {
|
|
2371
|
-
let e =
|
|
2372
|
-
if (e) return e.addEventListener("wheel",
|
|
2373
|
-
}, [
|
|
2374
|
-
let
|
|
2375
|
-
let t =
|
|
2371
|
+
let e = N.current;
|
|
2372
|
+
if (e) return e.addEventListener("wheel", it, { passive: !1 }), () => e.removeEventListener("wheel", it);
|
|
2373
|
+
}, [it]);
|
|
2374
|
+
let at = t((e) => {
|
|
2375
|
+
let t = Ue.get(e), n = N.current;
|
|
2376
2376
|
if (!t || !n) return;
|
|
2377
|
-
let r = Math.max(
|
|
2378
|
-
|
|
2377
|
+
let r = Math.max(z, 1);
|
|
2378
|
+
q({
|
|
2379
2379
|
scale: r,
|
|
2380
2380
|
panX: n.clientWidth / 2 - (t.x + t.w / 2) * r,
|
|
2381
2381
|
panY: n.clientHeight / 2 - (t.y + t.h / 2) * r
|
|
2382
2382
|
}, !0);
|
|
2383
2383
|
}, [
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
]),
|
|
2388
|
-
if (
|
|
2389
|
-
|
|
2384
|
+
q,
|
|
2385
|
+
Ue,
|
|
2386
|
+
z
|
|
2387
|
+
]), J = t((e) => {
|
|
2388
|
+
if (O && e === R) return;
|
|
2389
|
+
O || ve(e), D?.(e ? {
|
|
2390
2390
|
type: "select",
|
|
2391
2391
|
id: e
|
|
2392
2392
|
} : { type: "clear-selection" });
|
|
2393
|
-
let t = e ?
|
|
2394
|
-
|
|
2393
|
+
let t = e ? V.byId.get(e) : null;
|
|
2394
|
+
ie?.(e, t ? sr(t) : null);
|
|
2395
2395
|
}, [
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
]),
|
|
2402
|
-
|
|
2396
|
+
O,
|
|
2397
|
+
ie,
|
|
2398
|
+
D,
|
|
2399
|
+
R,
|
|
2400
|
+
V.byId
|
|
2401
|
+
]), ot = t((e) => {
|
|
2402
|
+
O || (me(e), ge(/* @__PURE__ */ new Set())), D?.({
|
|
2403
2403
|
type: "set-grain",
|
|
2404
2404
|
grain: Bn[e]
|
|
2405
|
-
}),
|
|
2405
|
+
}), ae?.(e), O || w?.([]);
|
|
2406
2406
|
}, [
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
]), [
|
|
2407
|
+
O,
|
|
2408
|
+
w,
|
|
2409
|
+
ae,
|
|
2410
|
+
D
|
|
2411
|
+
]), [st, ct] = s(null), [lt, ut] = s("");
|
|
2412
2412
|
n(() => {
|
|
2413
|
-
|
|
2414
|
-
}, [
|
|
2413
|
+
st && !L.has(st) && ct(null);
|
|
2414
|
+
}, [st, L]);
|
|
2415
2415
|
let dt = t((e) => {
|
|
2416
|
-
if ((
|
|
2417
|
-
let t =
|
|
2418
|
-
if (n.has(e)) n.delete(e),
|
|
2416
|
+
if ((We.get(e) || 0) === 0) return;
|
|
2417
|
+
let t = V.byId.get(e), n = new Set(L);
|
|
2418
|
+
if (n.has(e)) n.delete(e), ct((t) => {
|
|
2419
2419
|
if (t !== e) return t;
|
|
2420
|
-
let r =
|
|
2420
|
+
let r = V.parentIdByChild.get(e) ?? null;
|
|
2421
2421
|
return r && n.has(r) ? r : null;
|
|
2422
2422
|
}), ut(`closed ${qn(t?.label || e)}`);
|
|
2423
2423
|
else {
|
|
2424
|
-
n.add(e),
|
|
2425
|
-
let r =
|
|
2424
|
+
n.add(e), oe?.(e), ct(e);
|
|
2425
|
+
let r = We.get(e) || 0;
|
|
2426
2426
|
ut(`opened ${qn(t?.label || e)}, showing ${r} item${r === 1 ? "" : "s"}`);
|
|
2427
2427
|
}
|
|
2428
|
-
|
|
2428
|
+
O || ge(n), D?.({
|
|
2429
2429
|
type: "set-expanded",
|
|
2430
2430
|
ids: Array.from(n)
|
|
2431
|
-
}),
|
|
2431
|
+
}), w?.(Array.from(n));
|
|
2432
2432
|
}, [
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
S,
|
|
2433
|
+
O,
|
|
2434
|
+
We,
|
|
2435
|
+
L,
|
|
2436
|
+
oe,
|
|
2438
2437
|
w,
|
|
2439
|
-
|
|
2440
|
-
|
|
2438
|
+
D,
|
|
2439
|
+
V.byId,
|
|
2440
|
+
V.parentIdByChild
|
|
2441
2441
|
]), ft = a(() => {
|
|
2442
|
-
if (!
|
|
2443
|
-
let e = [], t =
|
|
2442
|
+
if (!st) return [];
|
|
2443
|
+
let e = [], t = st;
|
|
2444
2444
|
for (; t;) {
|
|
2445
|
-
let n =
|
|
2445
|
+
let n = V.byId.get(t);
|
|
2446
2446
|
if (!n) break;
|
|
2447
|
-
e.unshift(n), t =
|
|
2447
|
+
e.unshift(n), t = V.parentIdByChild.get(t) ?? null;
|
|
2448
2448
|
}
|
|
2449
2449
|
return e;
|
|
2450
|
-
}, [
|
|
2451
|
-
|
|
2450
|
+
}, [st, V]), pt = t(() => {
|
|
2451
|
+
O || ge(/* @__PURE__ */ new Set()), D?.({
|
|
2452
2452
|
type: "set-expanded",
|
|
2453
2453
|
ids: []
|
|
2454
|
-
}),
|
|
2454
|
+
}), w?.([]), ct(null), ut("back to the top level");
|
|
2455
2455
|
}, [
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2456
|
+
O,
|
|
2457
|
+
w,
|
|
2458
|
+
D
|
|
2459
2459
|
]), mt = t((e) => {
|
|
2460
2460
|
let t = ft.slice(0, e + 1), n = t.map((e) => e.id), r = new Set(n);
|
|
2461
|
-
|
|
2461
|
+
O || ge(r), D?.({
|
|
2462
2462
|
type: "set-expanded",
|
|
2463
2463
|
ids: n
|
|
2464
|
-
}),
|
|
2464
|
+
}), w?.(n);
|
|
2465
2465
|
let i = t[t.length - 1] ?? null;
|
|
2466
|
-
|
|
2466
|
+
ct(i?.id ?? null), ut(i ? `back to ${qn(i.label || i.id)}` : "back to the top level");
|
|
2467
2467
|
}, [
|
|
2468
2468
|
ft,
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2469
|
+
O,
|
|
2470
|
+
w,
|
|
2471
|
+
D
|
|
2472
2472
|
]), ht = t((e) => {
|
|
2473
2473
|
let t = e.key;
|
|
2474
2474
|
if (t === "+" || t === "=") {
|
|
2475
|
-
e.preventDefault(),
|
|
2475
|
+
e.preventDefault(), rt(zn);
|
|
2476
2476
|
return;
|
|
2477
2477
|
}
|
|
2478
2478
|
if (t === "-" || t === "_") {
|
|
2479
|
-
e.preventDefault(),
|
|
2479
|
+
e.preventDefault(), rt(1 / zn);
|
|
2480
2480
|
return;
|
|
2481
2481
|
}
|
|
2482
2482
|
if (t === "0") {
|
|
2483
|
-
e.preventDefault(),
|
|
2483
|
+
e.preventDefault(), Xe(!0);
|
|
2484
2484
|
return;
|
|
2485
2485
|
}
|
|
2486
2486
|
if (t === "ArrowLeft" || t === "ArrowRight" || t === "ArrowUp" || t === "ArrowDown") {
|
|
2487
2487
|
e.preventDefault();
|
|
2488
|
-
let n =
|
|
2488
|
+
let n = j ? Ue.get(j) : void 0;
|
|
2489
2489
|
if (!n) {
|
|
2490
|
-
let e = rr(
|
|
2491
|
-
e &&
|
|
2490
|
+
let e = rr(U);
|
|
2491
|
+
e && ye(e.node.id);
|
|
2492
2492
|
return;
|
|
2493
2493
|
}
|
|
2494
2494
|
let r;
|
|
2495
|
-
r = t === "ArrowLeft" ? ir(
|
|
2496
|
-
|
|
2497
|
-
scale:
|
|
2495
|
+
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) => {
|
|
2496
|
+
q({
|
|
2497
|
+
scale: z,
|
|
2498
2498
|
panX: e.x,
|
|
2499
2499
|
panY: e.y
|
|
2500
2500
|
}, !0);
|
|
@@ -2502,118 +2502,118 @@ function or({ data: i = {
|
|
|
2502
2502
|
return;
|
|
2503
2503
|
}
|
|
2504
2504
|
if (t === "Enter") {
|
|
2505
|
-
if (!
|
|
2506
|
-
e.preventDefault(), e.shiftKey ? dt(
|
|
2505
|
+
if (!j) return;
|
|
2506
|
+
e.preventDefault(), e.shiftKey ? dt(j) : O ? R !== j && J(j) : J(R === j ? null : j);
|
|
2507
2507
|
return;
|
|
2508
2508
|
}
|
|
2509
2509
|
if (t === "e" || t === "E") {
|
|
2510
|
-
if (!
|
|
2511
|
-
e.preventDefault(), dt(
|
|
2510
|
+
if (!j) return;
|
|
2511
|
+
e.preventDefault(), dt(j);
|
|
2512
2512
|
return;
|
|
2513
2513
|
}
|
|
2514
|
-
t === "Escape" &&
|
|
2514
|
+
t === "Escape" && R && (e.preventDefault(), J(null));
|
|
2515
2515
|
}, [
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
I,
|
|
2520
|
-
L,
|
|
2516
|
+
j,
|
|
2517
|
+
U,
|
|
2518
|
+
Ue,
|
|
2521
2519
|
R,
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2520
|
+
z,
|
|
2521
|
+
B,
|
|
2522
|
+
O,
|
|
2523
|
+
q,
|
|
2524
|
+
rt,
|
|
2525
|
+
Xe,
|
|
2526
2526
|
dt,
|
|
2527
|
-
|
|
2527
|
+
J
|
|
2528
2528
|
]), gt = t((e) => {
|
|
2529
|
-
let t =
|
|
2529
|
+
let t = P.current;
|
|
2530
2530
|
if (!t || e !== t.pointerId) return;
|
|
2531
|
-
|
|
2532
|
-
let n =
|
|
2531
|
+
P.current = null;
|
|
2532
|
+
let n = N.current;
|
|
2533
2533
|
try {
|
|
2534
2534
|
n?.releasePointerCapture?.(e);
|
|
2535
2535
|
} catch {}
|
|
2536
|
-
|
|
2537
|
-
}, [
|
|
2536
|
+
O && De(null);
|
|
2537
|
+
}, [O]), _t = t((e) => {
|
|
2538
2538
|
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(
|
|
2539
|
+
if (P.current) {
|
|
2540
|
+
if (Date.now() - P.current.startedAt < Wn) return;
|
|
2541
|
+
gt(P.current.pointerId);
|
|
2542
2542
|
}
|
|
2543
|
-
let t =
|
|
2544
|
-
t && t.setPointerCapture?.(e.pointerId),
|
|
2543
|
+
let t = N.current;
|
|
2544
|
+
t && t.setPointerCapture?.(e.pointerId), P.current = {
|
|
2545
2545
|
pointerId: e.pointerId,
|
|
2546
2546
|
startX: e.clientX,
|
|
2547
2547
|
startY: e.clientY,
|
|
2548
|
-
panX:
|
|
2549
|
-
panY:
|
|
2548
|
+
panX: B.x,
|
|
2549
|
+
panY: B.y,
|
|
2550
2550
|
moved: !1,
|
|
2551
2551
|
nextPan: null,
|
|
2552
2552
|
startedAt: Date.now()
|
|
2553
2553
|
};
|
|
2554
|
-
}, [
|
|
2555
|
-
let t =
|
|
2554
|
+
}, [B, gt]), vt = t((e) => {
|
|
2555
|
+
let t = P.current;
|
|
2556
2556
|
if (!t || e.pointerId !== t.pointerId) return;
|
|
2557
2557
|
let n = e.clientX - t.startX, r = e.clientY - t.startY;
|
|
2558
2558
|
!t.moved && Math.abs(n) + Math.abs(r) > 3 && (t.moved = !0), t.moved && (t.nextPan = {
|
|
2559
|
-
scale:
|
|
2559
|
+
scale: Be.current,
|
|
2560
2560
|
panX: t.panX + n,
|
|
2561
2561
|
panY: t.panY + r
|
|
2562
|
-
},
|
|
2563
|
-
}, [
|
|
2564
|
-
let t =
|
|
2562
|
+
}, O ? De(t.nextPan) : q(t.nextPan, !0));
|
|
2563
|
+
}, [q, O]), yt = t((e) => {
|
|
2564
|
+
let t = P.current;
|
|
2565
2565
|
if (!t || e.pointerId !== t.pointerId) return;
|
|
2566
|
-
|
|
2567
|
-
let n =
|
|
2566
|
+
P.current = null;
|
|
2567
|
+
let n = N.current;
|
|
2568
2568
|
try {
|
|
2569
2569
|
n?.releasePointerCapture?.(e.pointerId);
|
|
2570
2570
|
} catch {}
|
|
2571
|
-
t.moved &&
|
|
2571
|
+
t.moved && O && t.nextPan && (q(t.nextPan, !0), De({ ...t.nextPan })), !t.moved && e.target === e.currentTarget && J(null);
|
|
2572
2572
|
}, [
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2573
|
+
q,
|
|
2574
|
+
O,
|
|
2575
|
+
J
|
|
2576
2576
|
]), bt = t((e) => gt(e.pointerId), [gt]), xt = t((e) => gt(e.pointerId), [gt]), St = a(() => {
|
|
2577
|
-
if (!
|
|
2578
|
-
let e =
|
|
2577
|
+
if (!j) return "";
|
|
2578
|
+
let e = V.byId.get(j);
|
|
2579
2579
|
return e ? pr(e, {
|
|
2580
|
-
selected:
|
|
2581
|
-
expanded:
|
|
2582
|
-
violations:
|
|
2580
|
+
selected: R === j,
|
|
2581
|
+
expanded: L.has(j),
|
|
2582
|
+
violations: qe.get(j) || 0
|
|
2583
2583
|
}) : "";
|
|
2584
2584
|
}, [
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2585
|
+
j,
|
|
2586
|
+
V.byId,
|
|
2587
|
+
R,
|
|
2588
|
+
L,
|
|
2589
|
+
qe
|
|
2590
2590
|
]), Ct = a(() => {
|
|
2591
|
-
let e =
|
|
2592
|
-
if (!e ||
|
|
2591
|
+
let e = N.current;
|
|
2592
|
+
if (!e || W <= 0 || G <= 0) return null;
|
|
2593
2593
|
let t = e.clientWidth, n = e.clientHeight;
|
|
2594
2594
|
return {
|
|
2595
|
-
graphW:
|
|
2596
|
-
graphH:
|
|
2597
|
-
viewX: -
|
|
2598
|
-
viewY: -
|
|
2599
|
-
viewW: t /
|
|
2600
|
-
viewH: n /
|
|
2595
|
+
graphW: W,
|
|
2596
|
+
graphH: G,
|
|
2597
|
+
viewX: -B.x / z,
|
|
2598
|
+
viewY: -B.y / z,
|
|
2599
|
+
viewW: t / z,
|
|
2600
|
+
viewH: n / z
|
|
2601
2601
|
};
|
|
2602
2602
|
}, [
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
]), wt =
|
|
2603
|
+
B,
|
|
2604
|
+
z,
|
|
2605
|
+
W,
|
|
2606
|
+
G
|
|
2607
|
+
]), wt = U.length === 0, Tt = (e) => `${A}-grain-${e}`;
|
|
2608
2608
|
return /* @__PURE__ */ u("div", {
|
|
2609
|
-
className: ["mc",
|
|
2610
|
-
style: { height:
|
|
2609
|
+
className: ["mc", le].filter(Boolean).join(" "),
|
|
2610
|
+
style: { height: se },
|
|
2611
2611
|
role: "application",
|
|
2612
|
-
"aria-label":
|
|
2612
|
+
"aria-label": ce,
|
|
2613
2613
|
"aria-roledescription": "code structure map",
|
|
2614
2614
|
children: [
|
|
2615
2615
|
/* @__PURE__ */ l("div", {
|
|
2616
|
-
id:
|
|
2616
|
+
id: de,
|
|
2617
2617
|
className: "mc-sr",
|
|
2618
2618
|
role: "status",
|
|
2619
2619
|
"aria-live": "polite",
|
|
@@ -2629,11 +2629,11 @@ function or({ data: i = {
|
|
|
2629
2629
|
id: Tt(e.id),
|
|
2630
2630
|
type: "button",
|
|
2631
2631
|
role: "radio",
|
|
2632
|
-
"aria-checked":
|
|
2632
|
+
"aria-checked": I === e.id,
|
|
2633
2633
|
className: "mc-seg-btn mono",
|
|
2634
|
-
"data-active":
|
|
2635
|
-
onClick: () =>
|
|
2636
|
-
children: [
|
|
2634
|
+
"data-active": I === e.id ? "true" : void 0,
|
|
2635
|
+
onClick: () => ot(e.id),
|
|
2636
|
+
children: [I === e.id && /* @__PURE__ */ l(d, {
|
|
2637
2637
|
className: "lucide",
|
|
2638
2638
|
"aria-hidden": "true"
|
|
2639
2639
|
}), e.label]
|
|
@@ -2641,11 +2641,11 @@ function or({ data: i = {
|
|
|
2641
2641
|
}), /* @__PURE__ */ u("div", {
|
|
2642
2642
|
className: "mc-search",
|
|
2643
2643
|
role: "combobox",
|
|
2644
|
-
"aria-expanded":
|
|
2644
|
+
"aria-expanded": Ee && Je.length > 0,
|
|
2645
2645
|
"aria-haspopup": "listbox",
|
|
2646
|
-
"aria-owns":
|
|
2646
|
+
"aria-owns": fe,
|
|
2647
2647
|
children: [
|
|
2648
|
-
/* @__PURE__ */ l(
|
|
2648
|
+
/* @__PURE__ */ l(ee, {
|
|
2649
2649
|
className: "lucide mc-search-ico",
|
|
2650
2650
|
"aria-hidden": "true"
|
|
2651
2651
|
}),
|
|
@@ -2654,36 +2654,36 @@ function or({ data: i = {
|
|
|
2654
2654
|
type: "text",
|
|
2655
2655
|
placeholder: "find a node",
|
|
2656
2656
|
"aria-label": "find a node",
|
|
2657
|
-
"aria-controls":
|
|
2657
|
+
"aria-controls": fe,
|
|
2658
2658
|
"aria-autocomplete": "list",
|
|
2659
|
-
value:
|
|
2659
|
+
value: we,
|
|
2660
2660
|
onChange: (e) => {
|
|
2661
|
-
|
|
2661
|
+
Te(e.target.value), M(!0);
|
|
2662
2662
|
},
|
|
2663
|
-
onFocus: () =>
|
|
2663
|
+
onFocus: () => M(!0),
|
|
2664
2664
|
onBlur: () => {
|
|
2665
|
-
window.setTimeout(() =>
|
|
2665
|
+
window.setTimeout(() => M(!1), 120);
|
|
2666
2666
|
},
|
|
2667
2667
|
onKeyDown: (e) => {
|
|
2668
|
-
e.key === "Enter" &&
|
|
2668
|
+
e.key === "Enter" && Je[0] ? (e.preventDefault(), Et(Je[0])) : e.key === "Escape" && M(!1);
|
|
2669
2669
|
}
|
|
2670
2670
|
}),
|
|
2671
|
-
|
|
2671
|
+
Ee && Je.length > 0 && /* @__PURE__ */ l("ul", {
|
|
2672
2672
|
className: "mc-results",
|
|
2673
|
-
id:
|
|
2673
|
+
id: fe,
|
|
2674
2674
|
role: "listbox",
|
|
2675
2675
|
"aria-label": "search results",
|
|
2676
|
-
children:
|
|
2676
|
+
children: Je.map((e) => /* @__PURE__ */ u("li", {
|
|
2677
2677
|
role: "option",
|
|
2678
|
-
"aria-selected": e.id ===
|
|
2678
|
+
"aria-selected": e.id === R,
|
|
2679
2679
|
className: "mc-result mono",
|
|
2680
2680
|
onMouseDown: (t) => {
|
|
2681
2681
|
t.preventDefault(), Et(e);
|
|
2682
2682
|
},
|
|
2683
|
-
children: [e.kind === "folder" ? /* @__PURE__ */ l(
|
|
2683
|
+
children: [e.kind === "folder" ? /* @__PURE__ */ l(v, {
|
|
2684
2684
|
className: "lucide",
|
|
2685
2685
|
"aria-hidden": "true"
|
|
2686
|
-
}) : /* @__PURE__ */ l(
|
|
2686
|
+
}) : /* @__PURE__ */ l(_, {
|
|
2687
2687
|
className: "lucide",
|
|
2688
2688
|
"aria-hidden": "true"
|
|
2689
2689
|
}), /* @__PURE__ */ l("span", {
|
|
@@ -2725,11 +2725,11 @@ function or({ data: i = {
|
|
|
2725
2725
|
}),
|
|
2726
2726
|
/* @__PURE__ */ l("div", {
|
|
2727
2727
|
className: "mc-viewport",
|
|
2728
|
-
ref:
|
|
2728
|
+
ref: N,
|
|
2729
2729
|
tabIndex: 0,
|
|
2730
2730
|
role: "group",
|
|
2731
2731
|
"aria-label": "map canvas: arrow keys move focus, enter selects, plus and minus zoom, ctrl or cmd plus wheel to zoom",
|
|
2732
|
-
"aria-activedescendant":
|
|
2732
|
+
"aria-activedescendant": j && H.has(j) ? `${A}-node-${fr(j)}` : void 0,
|
|
2733
2733
|
onKeyDown: ht,
|
|
2734
2734
|
onPointerDown: _t,
|
|
2735
2735
|
onPointerMove: vt,
|
|
@@ -2741,45 +2741,45 @@ function or({ data: i = {
|
|
|
2741
2741
|
children: "no nodes to map"
|
|
2742
2742
|
}) : /* @__PURE__ */ u(c, { children: [
|
|
2743
2743
|
/* @__PURE__ */ u("div", {
|
|
2744
|
-
className: ["mc-stage",
|
|
2744
|
+
className: ["mc-stage", Qe ? "mc-stage--auto-fit" : ""].filter(Boolean).join(" "),
|
|
2745
2745
|
style: {
|
|
2746
|
-
transform: `translate(${
|
|
2747
|
-
width:
|
|
2748
|
-
height:
|
|
2746
|
+
transform: `translate(${B.x}px, ${B.y}px) scale(${z})`,
|
|
2747
|
+
width: W,
|
|
2748
|
+
height: G
|
|
2749
2749
|
},
|
|
2750
2750
|
children: [/* @__PURE__ */ l("svg", {
|
|
2751
2751
|
className: "mc-edges",
|
|
2752
|
-
width:
|
|
2753
|
-
height:
|
|
2754
|
-
viewBox: `0 0 ${
|
|
2752
|
+
width: W,
|
|
2753
|
+
height: G,
|
|
2754
|
+
viewBox: `0 0 ${W} ${G}`,
|
|
2755
2755
|
"aria-hidden": "true",
|
|
2756
|
-
children:
|
|
2757
|
-
let t =
|
|
2756
|
+
children: Ge.map((e) => {
|
|
2757
|
+
let t = Ue.get(e.from), n = Ue.get(e.to);
|
|
2758
2758
|
if (!t || !n) return null;
|
|
2759
|
-
let r =
|
|
2759
|
+
let r = re[dr(e.from, e.to)] ?? re[dr(e.from, e.to, "arrow")];
|
|
2760
2760
|
return /* @__PURE__ */ l(gr, {
|
|
2761
2761
|
a: t,
|
|
2762
2762
|
b: n,
|
|
2763
2763
|
kind: e.kind,
|
|
2764
2764
|
weight: e.weight,
|
|
2765
|
-
maxWeight:
|
|
2765
|
+
maxWeight: Ke,
|
|
2766
2766
|
delta: r
|
|
2767
2767
|
}, `${e.kind}:${e.from}->${e.to}`);
|
|
2768
2768
|
})
|
|
2769
|
-
}),
|
|
2770
|
-
let n = (
|
|
2769
|
+
}), U.map((t) => {
|
|
2770
|
+
let n = (We.get(t.node.id) || 0) > 0, r = L.has(t.node.id);
|
|
2771
2771
|
return /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l(hr, {
|
|
2772
|
-
domId: `${
|
|
2772
|
+
domId: `${A}-node-${fr(t.node.id)}`,
|
|
2773
2773
|
p: t,
|
|
2774
|
-
selected:
|
|
2775
|
-
focused:
|
|
2776
|
-
highlighted:
|
|
2777
|
-
delta:
|
|
2774
|
+
selected: R === t.node.id,
|
|
2775
|
+
focused: j === t.node.id,
|
|
2776
|
+
highlighted: K.has(t.node.id),
|
|
2777
|
+
delta: te[t.node.id],
|
|
2778
2778
|
expandable: n,
|
|
2779
2779
|
expanded: r,
|
|
2780
|
-
violations:
|
|
2780
|
+
violations: qe.get(t.node.id) || 0,
|
|
2781
2781
|
onClick: (e) => {
|
|
2782
|
-
e >= 2 || (
|
|
2782
|
+
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
2783
|
},
|
|
2784
2784
|
onDoubleClick: () => {
|
|
2785
2785
|
n && dt(t.node.id);
|
|
@@ -2811,8 +2811,8 @@ function or({ data: i = {
|
|
|
2811
2811
|
type: "button",
|
|
2812
2812
|
className: "mc-zoom-btn",
|
|
2813
2813
|
"aria-label": "zoom in",
|
|
2814
|
-
onClick: () =>
|
|
2815
|
-
children: /* @__PURE__ */ l(
|
|
2814
|
+
onClick: () => rt(zn),
|
|
2815
|
+
children: /* @__PURE__ */ l(S, {
|
|
2816
2816
|
className: "lucide",
|
|
2817
2817
|
"aria-hidden": "true"
|
|
2818
2818
|
})
|
|
@@ -2821,8 +2821,8 @@ function or({ data: i = {
|
|
|
2821
2821
|
type: "button",
|
|
2822
2822
|
className: "mc-zoom-btn",
|
|
2823
2823
|
"aria-label": "zoom out",
|
|
2824
|
-
onClick: () =>
|
|
2825
|
-
children: /* @__PURE__ */ l(
|
|
2824
|
+
onClick: () => rt(1 / zn),
|
|
2825
|
+
children: /* @__PURE__ */ l(x, {
|
|
2826
2826
|
className: "lucide",
|
|
2827
2827
|
"aria-hidden": "true"
|
|
2828
2828
|
})
|
|
@@ -2831,8 +2831,8 @@ function or({ data: i = {
|
|
|
2831
2831
|
type: "button",
|
|
2832
2832
|
className: "mc-zoom-btn",
|
|
2833
2833
|
"aria-label": "fit map to view",
|
|
2834
|
-
onClick: () =>
|
|
2835
|
-
children: /* @__PURE__ */ l(
|
|
2834
|
+
onClick: () => Xe(!0),
|
|
2835
|
+
children: /* @__PURE__ */ l(b, {
|
|
2836
2836
|
className: "lucide",
|
|
2837
2837
|
"aria-hidden": "true"
|
|
2838
2838
|
})
|
|
@@ -2846,7 +2846,7 @@ function or({ data: i = {
|
|
|
2846
2846
|
className: "mc-minimap-svg",
|
|
2847
2847
|
viewBox: `0 0 ${Ct.graphW} ${Ct.graphH}`,
|
|
2848
2848
|
preserveAspectRatio: "xMidYMid meet",
|
|
2849
|
-
children: [
|
|
2849
|
+
children: [U.map((e) => /* @__PURE__ */ l("rect", {
|
|
2850
2850
|
className: "mc-mini-node",
|
|
2851
2851
|
"data-cov": Kn(e.node.coverage),
|
|
2852
2852
|
x: e.x,
|
|
@@ -2868,11 +2868,11 @@ function or({ data: i = {
|
|
|
2868
2868
|
children: [
|
|
2869
2869
|
/* @__PURE__ */ u("span", {
|
|
2870
2870
|
className: "mc-legend-item",
|
|
2871
|
-
children: [/* @__PURE__ */ l(
|
|
2871
|
+
children: [/* @__PURE__ */ l(v, { className: "lucide" }), " folder"]
|
|
2872
2872
|
}),
|
|
2873
2873
|
/* @__PURE__ */ u("span", {
|
|
2874
2874
|
className: "mc-legend-item",
|
|
2875
|
-
children: [/* @__PURE__ */ l(
|
|
2875
|
+
children: [/* @__PURE__ */ l(_, { className: "lucide" }), " file"]
|
|
2876
2876
|
}),
|
|
2877
2877
|
/* @__PURE__ */ u("span", {
|
|
2878
2878
|
className: "mc-legend-item mc-legend-ramp",
|
|
@@ -2902,7 +2902,7 @@ function or({ data: i = {
|
|
|
2902
2902
|
}),
|
|
2903
2903
|
/* @__PURE__ */ u("span", {
|
|
2904
2904
|
className: "mc-legend-item mc-legend-viol",
|
|
2905
|
-
children: [/* @__PURE__ */ l(
|
|
2905
|
+
children: [/* @__PURE__ */ l(ne, { className: "lucide" }), " violation"]
|
|
2906
2906
|
})
|
|
2907
2907
|
]
|
|
2908
2908
|
})
|
|
@@ -2911,16 +2911,16 @@ function or({ data: i = {
|
|
|
2911
2911
|
]
|
|
2912
2912
|
});
|
|
2913
2913
|
function Et(e) {
|
|
2914
|
-
let t = e.kind === "file" &&
|
|
2915
|
-
for (; r &&
|
|
2914
|
+
let t = e.kind === "file" && I !== "files" ? "files" : I, n = new Set(t === I ? L : []), r = V.parentIdByChild.get(e.id);
|
|
2915
|
+
for (; r && V.byId.has(r);) n.has(r) || (n.add(r), oe?.(r)), r = V.parentIdByChild.get(r);
|
|
2916
2916
|
let i = Array.from(n);
|
|
2917
|
-
|
|
2917
|
+
O || (me(t), ge(n)), D?.({
|
|
2918
2918
|
type: "reveal",
|
|
2919
2919
|
id: e.id,
|
|
2920
2920
|
grain: Bn[t],
|
|
2921
2921
|
expandedIds: i
|
|
2922
|
-
}), t !==
|
|
2923
|
-
window.requestAnimationFrame(() =>
|
|
2922
|
+
}), t !== I && ae?.(t), w?.(i), Te(""), M(!1), ye(e.id), O || ve(e.id), ie?.(e.id, sr(e)), window.requestAnimationFrame(() => {
|
|
2923
|
+
window.requestAnimationFrame(() => at(e.id));
|
|
2924
2924
|
});
|
|
2925
2925
|
}
|
|
2926
2926
|
}
|
|
@@ -2998,10 +2998,10 @@ function hr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a,
|
|
|
2998
2998
|
/* @__PURE__ */ u("span", {
|
|
2999
2999
|
className: "mc-node-head",
|
|
3000
3000
|
children: [
|
|
3001
|
-
p.kind === "folder" ? /* @__PURE__ */ l(
|
|
3001
|
+
p.kind === "folder" ? /* @__PURE__ */ l(v, {
|
|
3002
3002
|
className: "lucide mc-node-ico",
|
|
3003
3003
|
"aria-hidden": "true"
|
|
3004
|
-
}) : /* @__PURE__ */ l(
|
|
3004
|
+
}) : /* @__PURE__ */ l(_, {
|
|
3005
3005
|
className: "lucide mc-node-ico",
|
|
3006
3006
|
"aria-hidden": "true"
|
|
3007
3007
|
}),
|
|
@@ -3012,7 +3012,7 @@ function hr({ domId: e, p: t, selected: n, focused: r, highlighted: i, delta: a,
|
|
|
3012
3012
|
c > 0 && /* @__PURE__ */ u("span", {
|
|
3013
3013
|
className: "mc-node-viol mono tnum",
|
|
3014
3014
|
"aria-hidden": "true",
|
|
3015
|
-
children: [/* @__PURE__ */ l(
|
|
3015
|
+
children: [/* @__PURE__ */ l(ne, {
|
|
3016
3016
|
className: "lucide",
|
|
3017
3017
|
"aria-hidden": "true"
|
|
3018
3018
|
}), c]
|
|
@@ -3212,17 +3212,17 @@ var xr = Object.freeze([
|
|
|
3212
3212
|
{
|
|
3213
3213
|
id: "transcript",
|
|
3214
3214
|
mark: "transcript-browser",
|
|
3215
|
-
icon:
|
|
3215
|
+
icon: C
|
|
3216
3216
|
},
|
|
3217
3217
|
{
|
|
3218
3218
|
id: "commons",
|
|
3219
3219
|
mark: "village",
|
|
3220
|
-
icon:
|
|
3220
|
+
icon: re
|
|
3221
3221
|
},
|
|
3222
3222
|
{
|
|
3223
3223
|
id: "graph",
|
|
3224
3224
|
mark: "peasant",
|
|
3225
|
-
icon:
|
|
3225
|
+
icon: ie
|
|
3226
3226
|
}
|
|
3227
3227
|
]), Sr = Object.freeze([
|
|
3228
3228
|
{
|
|
@@ -3391,4 +3391,215 @@ function Er({ sections: e = Sr, activeId: t = void 0, hrefFor: n = void 0, LinkC
|
|
|
3391
3391
|
});
|
|
3392
3392
|
}
|
|
3393
3393
|
//#endregion
|
|
3394
|
-
|
|
3394
|
+
//#region src/ui/transcript/graph/GraphTurnNode.jsx
|
|
3395
|
+
function Dr(e) {
|
|
3396
|
+
return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
|
|
3397
|
+
}
|
|
3398
|
+
function Or(e, t) {
|
|
3399
|
+
return e === "user" ? "you" : t ? "subagent" : e === "assistant" ? "assistant" : e;
|
|
3400
|
+
}
|
|
3401
|
+
function kr({ role: e, agentName: t, provider: n, hasError: r }) {
|
|
3402
|
+
return r ? "clay" : e === "user" ? "teal" : t ? "mauve" : e === "assistant" ? n === void 0 ? "amber" : F(n) : null;
|
|
3403
|
+
}
|
|
3404
|
+
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: _ = "" }) {
|
|
3405
|
+
let v = kr({
|
|
3406
|
+
role: e,
|
|
3407
|
+
agentName: t,
|
|
3408
|
+
provider: g,
|
|
3409
|
+
hasError: c
|
|
3410
|
+
}), 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;
|
|
3411
|
+
return /* @__PURE__ */ u("div", {
|
|
3412
|
+
className: [
|
|
3413
|
+
"ft-gnode",
|
|
3414
|
+
"ft-gnode-turn",
|
|
3415
|
+
v && "ft-gnode-accented",
|
|
3416
|
+
c && "ft-gnode-error",
|
|
3417
|
+
m && "ft-gnode-dimmed",
|
|
3418
|
+
p && "ft-gnode-match",
|
|
3419
|
+
h && "ft-gnode-selected",
|
|
3420
|
+
_
|
|
3421
|
+
].filter(Boolean).join(" "),
|
|
3422
|
+
style: v ? { "--ft-gnode-accent": `var(--${v})` } : void 0,
|
|
3423
|
+
"data-role": y,
|
|
3424
|
+
"data-turn": n,
|
|
3425
|
+
children: [
|
|
3426
|
+
/* @__PURE__ */ u("header", {
|
|
3427
|
+
className: "ft-gnode-head",
|
|
3428
|
+
children: [
|
|
3429
|
+
/* @__PURE__ */ l("span", {
|
|
3430
|
+
className: "ft-gnode-role",
|
|
3431
|
+
children: y
|
|
3432
|
+
}),
|
|
3433
|
+
t && /* @__PURE__ */ u("span", {
|
|
3434
|
+
className: "ft-gnode-agent",
|
|
3435
|
+
children: ["· ", t]
|
|
3436
|
+
}),
|
|
3437
|
+
/* @__PURE__ */ u("span", {
|
|
3438
|
+
className: "ft-gnode-num",
|
|
3439
|
+
children: ["#", n]
|
|
3440
|
+
}),
|
|
3441
|
+
b && /* @__PURE__ */ l("span", {
|
|
3442
|
+
className: `ft-gnode-flag ft-gnode-flag-${c ? "err" : "warn"}`,
|
|
3443
|
+
children: b
|
|
3444
|
+
})
|
|
3445
|
+
]
|
|
3446
|
+
}),
|
|
3447
|
+
r && /* @__PURE__ */ l("div", {
|
|
3448
|
+
className: `ft-gnode-prev${e === "user" ? " ft-gnode-prev-user" : ""}`,
|
|
3449
|
+
children: r
|
|
3450
|
+
}),
|
|
3451
|
+
/* @__PURE__ */ u("footer", {
|
|
3452
|
+
className: "ft-gnode-meta",
|
|
3453
|
+
children: [i > 0 && /* @__PURE__ */ u("span", {
|
|
3454
|
+
className: "ft-gnode-meta-tools",
|
|
3455
|
+
children: [
|
|
3456
|
+
i,
|
|
3457
|
+
" ",
|
|
3458
|
+
i === 1 ? "tool" : "tools"
|
|
3459
|
+
]
|
|
3460
|
+
}), a > 0 && /* @__PURE__ */ l("span", {
|
|
3461
|
+
className: "ft-gnode-meta-tokens",
|
|
3462
|
+
title: x,
|
|
3463
|
+
children: Dr(a)
|
|
3464
|
+
})]
|
|
3465
|
+
})
|
|
3466
|
+
]
|
|
3467
|
+
});
|
|
3468
|
+
}
|
|
3469
|
+
//#endregion
|
|
3470
|
+
//#region src/ui/transcript/graph/GraphToolNode.jsx
|
|
3471
|
+
function jr(e) {
|
|
3472
|
+
return e == null || e <= 0 ? "" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(1).replace(/\.0$/, "")}s`;
|
|
3473
|
+
}
|
|
3474
|
+
function Mr(e) {
|
|
3475
|
+
if (!e) return "";
|
|
3476
|
+
let t = e.split("/");
|
|
3477
|
+
return t[t.length - 1] || e;
|
|
3478
|
+
}
|
|
3479
|
+
function Nr(e) {
|
|
3480
|
+
return !!e.isError || e.exitCode != null && e.exitCode !== 0;
|
|
3481
|
+
}
|
|
3482
|
+
function Pr({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r = !1, max: i = 4, className: a = "" }) {
|
|
3483
|
+
let o = e.slice(0, i), s = e.length - o.length, c = jr(t), d = e.length;
|
|
3484
|
+
return /* @__PURE__ */ u("div", {
|
|
3485
|
+
className: [
|
|
3486
|
+
"ft-gnode",
|
|
3487
|
+
"ft-gnode-tools",
|
|
3488
|
+
n && "ft-gnode-error",
|
|
3489
|
+
r && "ft-gnode-dimmed",
|
|
3490
|
+
a
|
|
3491
|
+
].filter(Boolean).join(" "),
|
|
3492
|
+
children: [/* @__PURE__ */ u("header", {
|
|
3493
|
+
className: "ft-gnode-tools-head",
|
|
3494
|
+
children: [/* @__PURE__ */ l("span", {
|
|
3495
|
+
className: "ft-gnode-tools-count",
|
|
3496
|
+
children: d === 1 ? "tool call" : `${d} tool calls`
|
|
3497
|
+
}), c && /* @__PURE__ */ l("span", {
|
|
3498
|
+
className: "ft-gnode-tools-dur",
|
|
3499
|
+
children: c
|
|
3500
|
+
})]
|
|
3501
|
+
}), /* @__PURE__ */ u("ul", {
|
|
3502
|
+
className: "ft-gnode-tools-list",
|
|
3503
|
+
children: [o.map((e) => {
|
|
3504
|
+
let t = Nr(e), n = e.preview || Mr(e.filePath);
|
|
3505
|
+
return /* @__PURE__ */ u("li", {
|
|
3506
|
+
className: `ft-gnode-tools-row${t ? " ft-gnode-tools-row-failed" : ""}`,
|
|
3507
|
+
children: [
|
|
3508
|
+
/* @__PURE__ */ l("span", {
|
|
3509
|
+
className: "ft-gnode-tools-name",
|
|
3510
|
+
children: e.name
|
|
3511
|
+
}),
|
|
3512
|
+
n && /* @__PURE__ */ l("span", {
|
|
3513
|
+
className: "ft-gnode-tools-arg",
|
|
3514
|
+
children: n
|
|
3515
|
+
}),
|
|
3516
|
+
t && /* @__PURE__ */ l("span", {
|
|
3517
|
+
className: "ft-gnode-tools-err",
|
|
3518
|
+
children: "error"
|
|
3519
|
+
})
|
|
3520
|
+
]
|
|
3521
|
+
}, e.id);
|
|
3522
|
+
}), s > 0 && /* @__PURE__ */ u("li", {
|
|
3523
|
+
className: "ft-gnode-tools-more",
|
|
3524
|
+
children: [
|
|
3525
|
+
"+ ",
|
|
3526
|
+
s,
|
|
3527
|
+
" more"
|
|
3528
|
+
]
|
|
3529
|
+
})]
|
|
3530
|
+
})]
|
|
3531
|
+
});
|
|
3532
|
+
}
|
|
3533
|
+
//#endregion
|
|
3534
|
+
//#region src/ui/transcript/graph/GraphSubagentBranch.jsx
|
|
3535
|
+
function Fr({ agentName: e, depth: t, className: n = "" }) {
|
|
3536
|
+
return /* @__PURE__ */ u("div", {
|
|
3537
|
+
className: ["ft-gnode-lane", n].filter(Boolean).join(" "),
|
|
3538
|
+
children: [
|
|
3539
|
+
/* @__PURE__ */ l("span", {
|
|
3540
|
+
className: "ft-gnode-lane-eyebrow",
|
|
3541
|
+
children: "subagent"
|
|
3542
|
+
}),
|
|
3543
|
+
/* @__PURE__ */ l("span", {
|
|
3544
|
+
className: "ft-gnode-lane-name",
|
|
3545
|
+
children: e
|
|
3546
|
+
}),
|
|
3547
|
+
/* @__PURE__ */ u("span", {
|
|
3548
|
+
className: "ft-gnode-lane-depth",
|
|
3549
|
+
children: ["d", t]
|
|
3550
|
+
})
|
|
3551
|
+
]
|
|
3552
|
+
});
|
|
3553
|
+
}
|
|
3554
|
+
//#endregion
|
|
3555
|
+
//#region src/ui/transcript/graph/GraphLegend.jsx
|
|
3556
|
+
var Ir = Object.freeze([
|
|
3557
|
+
{
|
|
3558
|
+
kind: "user",
|
|
3559
|
+
label: "you"
|
|
3560
|
+
},
|
|
3561
|
+
{
|
|
3562
|
+
kind: "assistant",
|
|
3563
|
+
label: "agent"
|
|
3564
|
+
},
|
|
3565
|
+
{
|
|
3566
|
+
kind: "subagent",
|
|
3567
|
+
label: "subagent"
|
|
3568
|
+
},
|
|
3569
|
+
{
|
|
3570
|
+
kind: "tool",
|
|
3571
|
+
label: "tool"
|
|
3572
|
+
},
|
|
3573
|
+
{
|
|
3574
|
+
kind: "error",
|
|
3575
|
+
label: "error"
|
|
3576
|
+
}
|
|
3577
|
+
]);
|
|
3578
|
+
function Lr({ kind: e, provider: t }) {
|
|
3579
|
+
switch (e) {
|
|
3580
|
+
case "user": return "teal";
|
|
3581
|
+
case "assistant": return t === void 0 ? "amber" : F(t);
|
|
3582
|
+
case "subagent": return "mauve";
|
|
3583
|
+
case "error": return "clay";
|
|
3584
|
+
default: return null;
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
function Rr({ items: e = Ir, className: t = "" }) {
|
|
3588
|
+
return /* @__PURE__ */ l("div", {
|
|
3589
|
+
className: ["ft-graph-legend", t].filter(Boolean).join(" "),
|
|
3590
|
+
children: e.map((e) => {
|
|
3591
|
+
let t = Lr(e), n = t ? { background: `var(--${t})` } : void 0;
|
|
3592
|
+
return /* @__PURE__ */ u("span", {
|
|
3593
|
+
className: "ft-graph-legend-item",
|
|
3594
|
+
children: [/* @__PURE__ */ l("span", {
|
|
3595
|
+
className: "ft-graph-legend-glyph",
|
|
3596
|
+
"data-kind": e.kind,
|
|
3597
|
+
style: n,
|
|
3598
|
+
"aria-hidden": "true"
|
|
3599
|
+
}), /* @__PURE__ */ l("span", { children: e.label })]
|
|
3600
|
+
}, e.kind + ":" + e.label);
|
|
3601
|
+
})
|
|
3602
|
+
});
|
|
3603
|
+
}
|
|
3604
|
+
//#endregion
|
|
3605
|
+
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 };
|