@principal-ai/subsystems-react 0.56.35 → 0.56.37

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.
Files changed (48) hide show
  1. package/dist/index.d.ts +3 -3
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/subsystem/SubsystemComponentGraph.d.ts +50 -8
  6. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  7. package/dist/subsystem/SubsystemComponentGraph.js +291 -50
  8. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  9. package/dist/subsystem/TrailStepsNav.d.ts +1 -1
  10. package/dist/subsystem/TrailStepsNav.d.ts.map +1 -1
  11. package/dist/subsystem/TrailStepsNav.js +2 -1
  12. package/dist/subsystem/TrailStepsNav.js.map +1 -1
  13. package/dist/subsystem/TrailsPanel.d.ts +5 -5
  14. package/dist/subsystem/TrailsPanel.d.ts.map +1 -1
  15. package/dist/subsystem/TrailsPanel.js +23 -43
  16. package/dist/subsystem/TrailsPanel.js.map +1 -1
  17. package/dist/subsystem/model.d.ts +21 -6
  18. package/dist/subsystem/model.d.ts.map +1 -1
  19. package/dist/subsystem/model.js +48 -45
  20. package/dist/subsystem/model.js.map +1 -1
  21. package/dist/subsystem/nodeIconography.d.ts +25 -0
  22. package/dist/subsystem/nodeIconography.d.ts.map +1 -0
  23. package/dist/subsystem/nodeIconography.js +55 -0
  24. package/dist/subsystem/nodeIconography.js.map +1 -0
  25. package/dist/subsystem/nodes.d.ts +9 -8
  26. package/dist/subsystem/nodes.d.ts.map +1 -1
  27. package/dist/subsystem/nodes.js +271 -338
  28. package/dist/subsystem/nodes.js.map +1 -1
  29. package/dist/subsystem/stepEmphasis.d.ts +5 -0
  30. package/dist/subsystem/stepEmphasis.d.ts.map +1 -1
  31. package/dist/subsystem/stepEmphasis.js +7 -0
  32. package/dist/subsystem/stepEmphasis.js.map +1 -1
  33. package/package.json +1 -1
  34. package/src/index.ts +3 -1
  35. package/src/stories/Canvases/Subsystem/AgentDrivenWalkthrough.stories.tsx +1842 -279
  36. package/src/stories/Canvases/Subsystem/Deprecated.stories.tsx +1 -1
  37. package/src/stories/Canvases/Subsystem/NodeAnatomy.stories.tsx +17 -21
  38. package/src/stories/Canvases/Subsystem/NodeIconography.stories.tsx +791 -21
  39. package/src/stories/Canvases/Subsystem/Spotlights.stories.tsx +1 -1
  40. package/src/subsystem/SubsystemComponentGraph.tsx +359 -62
  41. package/src/subsystem/TrailStepsNav.tsx +2 -2
  42. package/src/subsystem/TrailsPanel.tsx +35 -89
  43. package/src/subsystem/model.test.ts +17 -13
  44. package/src/subsystem/model.ts +60 -48
  45. package/src/subsystem/nodeIconography.ts +88 -0
  46. package/src/subsystem/nodes.component.test.tsx +177 -0
  47. package/src/subsystem/nodes.tsx +463 -435
  48. package/src/subsystem/stepEmphasis.ts +8 -0
@@ -3,44 +3,46 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  * Subsystem component/group node + edge renderers.
4
4
  *
5
5
  * Lightweight, purpose-built for the subsystem component graph: a component
6
- * renders its name (kind-tagged, colored by package) plus its symbol/purpose.
7
- * Groups render as package containers. Clicking
8
- * a component calls `onSelect` (to open the entry point / file).
6
+ * renders a primary construct icon + label above its name, with secondary
7
+ * role/storage/deprecation badges below and host-local state markers at the
8
+ * corners. Groups render as package containers. Clicking a component calls
9
+ * `onSelect` (to open the entry point / file).
9
10
  */
10
- import { createContext, useContext, useState } from 'react';
11
- import { Handle, Position, } from '@xyflow/react';
12
- import { useTheme } from '@principal-ade/industry-theme';
13
- import { edgeColor, edgeStrokeStyle, DEPRECATED_COLOR, deprecatedBadgeColor, deprecatedBadgeLabel, constructBadgeColor, constructBadgeLabel, rightBadgeLabel, rightBadgeColor, storageBadgeLabel, storageBadgeColor, deriveNameFromSymbol, nodeMinWidthForBadges, MODULE_BADGE_INSET, moduleBadgeLabel, moduleBadgeHoverLabel, moduleBadgeWidth, packageColor, FOLDER_FRAME_COLOR, isFolderFrame, isCardFrame, } from './model';
14
- import { componentColor } from '../pierre/constructColors';
15
- import { resolvePierreSyntaxThemeName } from '../pierre/pierreSyntaxTheme';
16
- import { ISSUE_KIND_ICON, ISSUE_RUNG_ICON } from './IssueList';
17
- import { CARD_GAP, CARD_PAD_X, CARD_PAD_Y, ContainerCardHeader, NODE_H, NODE_W, TOGGLE_INSET, TOGGLE_SIZE, } from './containerCard';
18
- import { MORPH_MS } from './graphMorph';
19
- import { technologyBrand } from './techIcons';
20
- import { AppWindow, Component, Database, Maximize2, Minimize2, Package, Search, WandSparkles } from 'lucide-react';
11
+ import { createContext, useContext, useState, } from "react";
12
+ import { Handle, Position, } from "@xyflow/react";
13
+ import { useTheme } from "@principal-ade/industry-theme";
14
+ import { edgeColor, edgeStrokeStyle, DEPRECATED_COLOR, deprecatedBadgeColor, deprecatedBadgeLabel, constructBadgeColor, constructBadgeLabel, rightBadgeLabel, rightBadgeColor, storageBadgeLabel, storageBadgeColor, deriveNameFromSymbol, nodeMinWidthForBadges, MODULE_BADGE_INSET, moduleBadgeLabel, moduleBadgeHoverLabel, moduleBadgeWidth, packageColor, HOST_PROPOSAL_COLOR, FOLDER_FRAME_COLOR, isFolderFrame, isCardFrame, } from "./model";
15
+ import { componentColor } from "../pierre/constructColors";
16
+ import { resolvePierreSyntaxThemeName } from "../pierre/pierreSyntaxTheme";
17
+ import { ISSUE_KIND_ICON } from "./IssueList";
18
+ import { CARD_GAP, CARD_PAD_X, CARD_PAD_Y, ContainerCardHeader, NODE_H, NODE_W, TOGGLE_INSET, TOGGLE_SIZE, } from "./containerCard";
19
+ import { MORPH_MS } from "./graphMorph";
20
+ import { TechMark, technologyBrand } from "./techIcons";
21
+ import { DEPRECATED_ICON, ROLE_ICON, STORAGE_ICON, iconForComponent, } from "./nodeIconography";
22
+ import { AppWindow, CirclePlus, CircleX, Component, Database, Maximize2, Minimize2, Package, TriangleAlert, WandSparkles, } from "lucide-react";
21
23
  export const CONSTRUCT_LABEL = {
22
- class: 'class',
23
- function: 'function',
24
- method: 'method',
25
- interface: 'interface',
26
- type_alias: 'type alias',
27
- enum: 'enum',
28
- store: 'store',
29
- external: 'external',
30
- custom_entity: 'entity',
24
+ class: "class",
25
+ function: "function",
26
+ method: "method",
27
+ interface: "interface",
28
+ type_alias: "type alias",
29
+ enum: "enum",
30
+ store: "store",
31
+ external: "external",
32
+ custom_entity: "entity",
31
33
  };
32
34
  /** Insert zero-width spaces at identifier word boundaries so long names wrap
33
35
  * on naming conventions (snake_case `foo_`|`bar`, camelCase `foo`|`Bar`,
34
36
  * PascalCase `Foo`|`Bar`, acronym `ABC`|`Def`) instead of mid-character. */
35
37
  function breakWords(s) {
36
- const zwsp = '\u200b';
37
- return s
38
+ const zwsp = "\u200b";
39
+ return (s
38
40
  // camelCase: lower/digit → Upper (and the boundary before it holds)
39
41
  .replace(/([a-z0-9])([A-Z])/g, `$1${zwsp}$2`)
40
42
  // acronym → word: `ABC`|`Def` (two Uppercase then a lowercase)
41
43
  .replace(/([A-Z])([A-Z][a-z])/g, `$1${zwsp}$2`)
42
44
  // separators: break after `_`, `-`, `.`
43
- .replace(/([_\-.])([^_\-.\u200b])/g, `$1${zwsp}$2`);
45
+ .replace(/([_\-.])([^_\-.\u200b])/g, `$1${zwsp}$2`));
44
46
  }
45
47
  /**
46
48
  * Root callbacks carried through node data (injected by the graph component).
@@ -61,28 +63,38 @@ export function SubsystemCallbacksProvider({ value, children, }) {
61
63
  function useSubsystemCallbacks() {
62
64
  return useContext(SubsystemCallbacksContext) ?? SUBSYSTEM_CALLBACKS;
63
65
  }
64
- /**
65
- * The diagnostics overlay for a component node: the node's own border turns
66
- * dotted (see the node's `borderStyle`) and a severity-colored corner chip
67
- * carries the count. The chip's icon is the earliest-failing construct rung
68
- * (file → symbol → declaration → type → signature); a finding with no rung
69
- * (e.g. a C4 process gap) wears its kind icon instead — see
70
- * `SubsystemNodeIssue.kind`. The chip is purely additive and non-interactive;
71
- * the border stays construct-colored, so severity never has to compete with
72
- * the construct palette.
73
- */
74
- function NodeIssueOverlay({ issue }) {
66
+ /** A compact host-local state marker, anchored over a node corner. */
67
+ function NodeStateMarker({ label, color, Icon, anchor, count, }) {
75
68
  const { theme } = useTheme();
76
- const isError = issue.severity === 'error';
77
- const color = isError
78
- ? (theme.colors.error ?? '#e5534b')
79
- : (theme.colors.warning ?? '#d4a017');
80
- const Icon = issue.rung
81
- ? ISSUE_RUNG_ICON[issue.rung]
82
- : issue.kind
83
- ? (ISSUE_KIND_ICON[issue.kind] ?? Search)
84
- : Search;
85
- return (_jsx(IssueChip, { color: color, Icon: Icon, count: issue.count, anchor: { right: -9, bottom: -8 } }));
69
+ const nodeBg = theme.colors.backgroundSecondary ?? theme.colors.background;
70
+ const showCount = (count ?? 0) > 1;
71
+ return (_jsxs("div", { title: label, "aria-label": showCount ? `${label}: ${count}` : label, style: {
72
+ position: "absolute",
73
+ zIndex: 2,
74
+ display: "inline-flex",
75
+ alignItems: "center",
76
+ justifyContent: "center",
77
+ gap: showCount ? 4 : 0,
78
+ width: showCount ? undefined : 26,
79
+ minWidth: 26,
80
+ height: 26,
81
+ boxSizing: "border-box",
82
+ padding: showCount ? "0 5px" : 0,
83
+ border: `2px solid ${color}`,
84
+ borderRadius: 5,
85
+ background: nodeBg,
86
+ color,
87
+ fontFamily: theme.fonts.monospace,
88
+ fontSize: theme.fontSizes[1],
89
+ fontWeight: 700,
90
+ lineHeight: 1.1,
91
+ pointerEvents: "none",
92
+ ...(anchor === "top-right"
93
+ ? { top: -10, right: -8 }
94
+ : anchor === "top-left"
95
+ ? { top: -10, left: -8 }
96
+ : { bottom: -8, right: -8 }),
97
+ }, children: [_jsx(Icon, { className: label === "working" ? "agent-working-icon" : undefined, size: 14, strokeWidth: 2, "aria-hidden": "true" }), showCount ? _jsx("span", { children: count }) : null] }));
86
98
  }
87
99
  /**
88
100
  * The shared severity chip: a severity-colored ring around the finding's icon,
@@ -95,14 +107,14 @@ function IssueChip({ color, Icon, count, anchor, }) {
95
107
  const { theme } = useTheme();
96
108
  const badgeBg = theme.colors.backgroundSecondary ?? theme.colors.background;
97
109
  return (_jsxs("div", { "aria-hidden": true, style: {
98
- position: 'absolute',
110
+ position: "absolute",
99
111
  zIndex: 2,
100
- display: 'inline-flex',
101
- alignItems: 'center',
102
- justifyContent: 'center',
112
+ display: "inline-flex",
113
+ alignItems: "center",
114
+ justifyContent: "center",
103
115
  gap: 4,
104
116
  minWidth: 22,
105
- padding: '3px 5px',
117
+ padding: "3px 5px",
106
118
  borderRadius: 5,
107
119
  border: `2px solid ${color}`,
108
120
  background: badgeBg,
@@ -111,7 +123,7 @@ function IssueChip({ color, Icon, count, anchor, }) {
111
123
  fontSize: theme.fontSizes[1],
112
124
  fontWeight: 700,
113
125
  lineHeight: 1.1,
114
- pointerEvents: 'none',
126
+ pointerEvents: "none",
115
127
  ...anchor,
116
128
  }, children: [_jsx(Icon, { size: 14, color: color }), count > 1 ? _jsx("span", { children: count }) : null] }));
117
129
  }
@@ -122,100 +134,77 @@ export function SubsystemComponentNode(props) {
122
134
  const c = data.component;
123
135
  const [hover, setHover] = useState(false);
124
136
  // Construct owns node color, derived from the active Pierre syntax theme —
125
- // the same palette the declaration panel and file drawer render with. Role
126
- // shows as the hover badge, not as color — for now; a role glyph/accent may
127
- // come later. A component-authored `color` override wins over the construct.
137
+ // the same palette the declaration panel and file drawer render with. A
138
+ // component-authored `color` override wins over the construct.
128
139
  const color = componentColor(c, resolvePierreSyntaxThemeName(mode));
129
- // Host-local proposals use the same warning color as the Trails panel. The
130
- // box keeps its construct badge, but its border/name/badge mark it as not yet
131
- // part of the portable model.
132
140
  const proposed = data.proposed === true;
133
- const proposalColor = theme.colors.warning ?? '#d4a017';
134
- // Host-local working indicator: a static ring plus a compact icon on the
135
- // component the agent is currently working on.
141
+ const proposalColor = HOST_PROPOSAL_COLOR;
136
142
  const working = data.working === true;
137
- const workingColor = theme.colors.accent ?? theme.colors.primary ?? '#a78bfa';
138
- // Host-local removal ghost: the box stays in its slot, dimmed and badged,
139
- // so the user can see what disappeared instead of only the surviving graph.
143
+ const workingColor = theme.colors.accent ?? theme.colors.primary ?? "#a78bfa";
140
144
  const removed = data.removed === true;
141
145
  const removedColor = DEPRECATED_COLOR;
142
- // Left badge: framework brand (e.g. React cyan) when the label is a
143
- // framework stereotype; otherwise the same construct color as the border.
144
- const badgeColor = constructBadgeColor(c) ?? color;
146
+ const issue = data.issue;
147
+ const issueColor = issue?.severity === "error"
148
+ ? (theme.colors.error ?? "#e5534b")
149
+ : (theme.colors.warning ?? "#d4a017");
150
+ // Primary identity: framework stereotypes may override the construct glyph
151
+ // with an official technology mark; custom entities use their authored kind.
152
+ const PrimaryIcon = iconForComponent(c);
153
+ const primaryBrand = c.framework && c.stereotype ? technologyBrand(c.framework) : undefined;
154
+ const primaryLabel = constructBadgeLabel(c);
155
+ const primaryColor = constructBadgeColor(c) ?? color;
145
156
  const configuredMax = callbacks.maxNodeWidth;
146
157
  const maxWidth = configuredMax ?? 300;
147
- // `symbol` is the source of truth; `name` is derived from it consistently.
148
158
  const displayName = deriveNameFromSymbol(c.symbol, c.construct, c.name, c.file, c.stereotype);
149
- // Top badges are absolutely positioned — widen the node so they nowrap
150
- // instead of wrapping, including when construct + role share the top.
151
- // Host-local badges must not feed back into geometry: proposal/working flags
152
- // are stamped after ELK has sized the frames and after the camera has fit
153
- // those rects. Growing the box here would overflow the container and leave
154
- // the newly proposed node clipped. They use stacked vertical slots instead.
155
159
  const badgeMinWidth = nodeMinWidthForBadges(c);
156
- const topRightLabel = rightBadgeLabel(c);
157
- const topRightColor = rightBadgeColor(c);
158
- // Store retention backing badge — memory/disk/db, beside role (orthogonal).
160
+ const roleLabel = rightBadgeLabel(c);
161
+ const roleColor = rightBadgeColor(c);
162
+ const RoleIcon = roleLabel === "entry" || roleLabel === "service"
163
+ ? ROLE_ICON[roleLabel]
164
+ : undefined;
159
165
  const storageLabel = storageBadgeLabel(c);
160
166
  const storageColor = storageBadgeColor(c);
161
- // Deprecated badge — clickable, unlike every other badge here (they opt out
162
- // of pointer events so clicks fall through to the node). Clicking opens the
163
- // removal provenance, which is the whole reason the badge exists.
167
+ const storageIconKey = storageLabel === "db" ? "external" : storageLabel?.toLowerCase();
168
+ const StorageIcon = storageIconKey ? STORAGE_ICON[storageIconKey] : undefined;
164
169
  const deprecatedLabel = deprecatedBadgeLabel(c);
165
170
  const deprecatedColor = deprecatedBadgeColor(c);
166
171
  const removal = c.removedIn;
167
172
  const [showRemoval, setShowRemoval] = useState(false);
168
- // Set while a file is open in the drawer: true → spotlight, false → dim,
169
- // absent (no file open) → neutral.
170
173
  const fileMatch = data.fileMatch;
171
- // Node fill lifts on hover as the clickability affordance; badges share it
172
- // so they read as tabs on the same surface rather than floating patches.
173
174
  const nodeBg = theme.colors.backgroundSecondary ?? theme.colors.background;
174
175
  const hoverBg = theme.colors.backgroundHover ?? theme.colors.backgroundTertiary ?? nodeBg;
175
- // Border: deprecated uses the slate accent (dotted, same family as issue)
176
- // since it means "not a live claim"; construct color stays on the left
177
- // badge. File-open spotlight still wins with primary.
176
+ // State rides on markers and the name, not on a different border hue.
178
177
  const borderColor = removed
179
178
  ? removedColor
180
- : proposed
181
- ? proposalColor
182
- : fileMatch
183
- ? theme.colors.primary
184
- : c.deprecated
185
- ? DEPRECATED_COLOR
186
- : color;
187
- // Selection is stamped into data by the graph component — React Flow's own
188
- // `selected` never updates because the node stops click propagation.
179
+ : fileMatch
180
+ ? theme.colors.primary
181
+ : color;
189
182
  const isSelected = selected || data.isSelected === true;
190
- // Externals are "outside" the system — square corners on the node + badges.
191
- const isExternal = c.construct === 'external';
183
+ const isExternal = c.construct === "external";
192
184
  const nodeRadius = isExternal ? 0 : 8;
193
185
  const badgeRadius = isExternal ? 0 : 4;
194
- // The border thickens on selection / file-match. Absolutely-positioned
195
- // badges are laid out from the padding box (inside the border), so a raw
196
- // `top` / `left` would slide with the border. Anchor them to the border box
197
- // instead, offsetting by the border width. Side badges sit flush with the
198
- // node's left / right edge (`-borderW`); the top reference stays at -9.
199
186
  const borderW = proposed ? 3 : isSelected || fileMatch ? 4 : 2;
200
- const badgeTop = -9 - borderW;
201
- const badgeEdge = -borderW;
202
- // A node with diagnostics turns its border dotted — an "something's off"
203
- // signal. The border keeps its construct color; the severity rides on the
204
- // chip. Deprecated is also dotted, but slate rather than construct-colored:
205
- // "this claim was retired" is closer to a diagnostic than to a placeholder.
206
- const hasIssue = data.issue != null;
207
- // Deprecated is dotted like issue but slate rather than construct-colored:
208
- // "this claim was retired" is closer to a diagnostic than to a placeholder,
209
- // and verification skips deprecated nodes so the two never stack in practice.
210
- const borderStyle = removed
211
- ? 'dashed'
212
- : proposed
213
- ? 'dashed'
214
- : hasIssue
215
- ? 'dotted'
216
- : c.deprecated
217
- ? 'dotted'
218
- : 'solid';
187
+ const badgeBottom = -9 - borderW;
188
+ const borderStyle = removed || proposed ? "dashed" : "solid";
189
+ const secondaryBadgeStyle = {
190
+ display: "inline-flex",
191
+ alignItems: "center",
192
+ justifyContent: "center",
193
+ boxSizing: "border-box",
194
+ gap: 5,
195
+ height: 26,
196
+ padding: "2px 8px",
197
+ fontFamily: theme.fonts.monospace,
198
+ fontSize: theme.fontSizes[1],
199
+ fontWeight: 700,
200
+ letterSpacing: 0.5,
201
+ lineHeight: "17px",
202
+ textTransform: "uppercase",
203
+ whiteSpace: "nowrap",
204
+ background: nodeBg,
205
+ border: `2px solid currentColor`,
206
+ borderRadius: badgeRadius,
207
+ };
219
208
  return (_jsxs("div", { onMouseEnter: () => {
220
209
  setHover(true);
221
210
  callbacks.onHover?.(c.alias);
@@ -226,179 +215,103 @@ export function SubsystemComponentNode(props) {
226
215
  e.stopPropagation();
227
216
  callbacks.onSelect?.(c.alias);
228
217
  }, style: {
229
- position: 'relative',
230
- display: 'flex',
231
- flexDirection: 'column',
232
- justifyContent: 'center',
233
- alignItems: 'center',
234
- boxSizing: 'border-box',
218
+ position: "relative",
219
+ display: "flex",
220
+ flexDirection: "column",
221
+ justifyContent: "flex-start",
222
+ alignItems: "center",
223
+ boxSizing: "border-box",
235
224
  width: nodeWidth,
236
225
  height: nodeHeight,
237
226
  minWidth: badgeMinWidth,
238
227
  maxWidth,
239
- padding: '6px 10px',
228
+ gap: 8,
229
+ padding: "14px 16px 0",
230
+ overflow: "visible",
240
231
  borderRadius: nodeRadius,
241
232
  background: hover ? hoverBg : nodeBg,
242
- // Selected / file-matched nodes get a thicker border. Proposed nodes
243
- // use a dashed goldenrod border, issue nodes a dotted construct-colored
244
- // one; the left construct badge keeps construct color either way.
233
+ // Selection / file-match thickens the border. Proposed and removed
234
+ // ghosts are dashed; all other states keep the construct-colored border.
245
235
  border: `${borderW}px ${borderStyle} ${borderColor}`,
246
236
  boxShadow: working
247
237
  ? `0 0 0 3px ${workingColor}55, 0 0 18px ${workingColor}44`
248
238
  : fileMatch
249
239
  ? `0 1px 4px rgba(0,0,0,0.25), 0 0 12px ${theme.colors.primary}55`
250
- : '0 1px 4px rgba(0,0,0,0.25)',
240
+ : "0 1px 4px rgba(0,0,0,0.25)",
251
241
  opacity: removed
252
242
  ? 0.45
253
243
  : working || (fileMatch !== false && data.dimmed !== true)
254
244
  ? 1
255
245
  : 0.18,
256
- transition: 'opacity 150ms ease, background-color 120ms ease',
257
- cursor: 'pointer',
246
+ transition: "opacity 150ms ease, background-color 120ms ease",
247
+ cursor: "pointer",
258
248
  fontFamily: theme.fonts.body,
259
- }, children: [_jsx("div", { style: {
260
- position: 'absolute',
261
- top: badgeTop,
262
- left: badgeEdge,
263
- zIndex: 1,
264
- fontFamily: theme.fonts.monospace,
265
- fontSize: theme.fontSizes[1],
266
- letterSpacing: 0.5,
267
- textTransform: 'uppercase',
268
- lineHeight: '17px',
269
- whiteSpace: 'nowrap',
270
- color: badgeColor,
271
- background: nodeBg,
272
- border: `2px solid ${badgeColor}`,
273
- borderRadius: badgeRadius,
274
- padding: '2px 8px',
275
- }, children: constructBadgeLabel(c) }), removed && (_jsx("div", { "aria-label": "removed", style: {
276
- position: 'absolute',
277
- top: 18,
278
- right: badgeEdge,
279
- zIndex: 1,
280
- fontFamily: theme.fonts.monospace,
281
- fontSize: theme.fontSizes[1],
282
- letterSpacing: 0.5,
283
- textTransform: 'uppercase',
284
- lineHeight: '17px',
285
- whiteSpace: 'nowrap',
286
- color: removedColor,
287
- background: nodeBg,
288
- border: `2px solid ${removedColor}`,
289
- borderRadius: badgeRadius,
290
- padding: '2px 8px',
291
- pointerEvents: 'none',
292
- }, children: "removed" })), proposed && (_jsx("div", { style: {
293
- position: 'absolute',
294
- top: 18,
295
- right: badgeEdge,
296
- zIndex: 1,
297
- fontFamily: theme.fonts.monospace,
298
- fontSize: theme.fontSizes[1],
299
- letterSpacing: 0.5,
300
- textTransform: 'uppercase',
301
- lineHeight: '17px',
302
- whiteSpace: 'nowrap',
303
- color: proposalColor,
304
- background: nodeBg,
305
- border: `2px solid ${proposalColor}`,
306
- borderRadius: badgeRadius,
307
- padding: '2px 8px',
308
- pointerEvents: 'none',
309
- }, children: "proposed" })), working && (_jsx("div", { "aria-label": "working", title: "working", style: {
310
- position: 'absolute',
311
- top: badgeTop,
312
- right: badgeEdge,
313
- zIndex: 1,
314
- display: 'flex',
315
- alignItems: 'center',
316
- justifyContent: 'center',
317
- width: 24,
318
- height: 24,
319
- color: workingColor,
320
- background: nodeBg,
321
- border: `1px solid ${workingColor}66`,
322
- borderRadius: badgeRadius,
323
- pointerEvents: 'none',
324
- }, children: _jsx(WandSparkles, { className: "agent-working-icon", size: 14, strokeWidth: 2, "aria-hidden": "true" }) })), (topRightLabel != null || storageLabel != null || deprecatedLabel != null) && (_jsxs("div", { style: {
325
- position: 'absolute',
326
- bottom: badgeTop,
327
- left: '50%',
328
- transform: 'translateX(-50%)',
329
- zIndex: 1,
330
- display: 'flex',
249
+ }, children: [_jsxs("div", { title: primaryLabel, "aria-label": primaryLabel, style: {
250
+ display: "inline-flex",
251
+ alignItems: "center",
252
+ justifyContent: "center",
331
253
  gap: 6,
332
- whiteSpace: 'nowrap',
333
- }, children: [storageLabel != null && storageColor != null && (_jsx("span", { style: {
334
- fontFamily: theme.fonts.monospace,
335
- fontSize: theme.fontSizes[1],
336
- letterSpacing: 0.5,
337
- textTransform: 'uppercase',
338
- lineHeight: '17px',
339
- color: storageColor,
340
- background: nodeBg,
341
- border: `2px solid ${storageColor}`,
342
- borderRadius: badgeRadius,
343
- padding: '2px 8px',
344
- }, children: storageLabel })), topRightLabel != null && topRightColor != null && (_jsx("span", { style: {
254
+ maxWidth: "100%",
255
+ height: 24,
256
+ flex: "0 0 auto",
257
+ color: primaryColor,
258
+ lineHeight: 1,
259
+ }, children: [primaryBrand ? (_jsx(TechMark, { brand: primaryBrand, size: 24, showTitle: false })) : (_jsx(PrimaryIcon, { size: c.construct === "function" ? 34 : 24, strokeWidth: 2, "aria-hidden": "true" })), _jsx("span", { style: {
260
+ minWidth: 0,
261
+ overflow: "hidden",
262
+ textOverflow: "ellipsis",
345
263
  fontFamily: theme.fonts.monospace,
346
264
  fontSize: theme.fontSizes[1],
347
- letterSpacing: 0.5,
348
- textTransform: 'uppercase',
349
- lineHeight: '17px',
350
- color: topRightColor,
351
- background: nodeBg,
352
- border: `2px solid ${topRightColor}`,
353
- borderRadius: badgeRadius,
354
- padding: '2px 8px',
355
- }, children: topRightLabel })), deprecatedLabel != null && deprecatedColor != null && (
356
- // Its own click target: stops propagation so opening the provenance
357
- // doesn't also select the node, and toggles a popover rather than
358
- // leaning on a title tooltip (which truncates the commit subject).
359
- _jsx("span", { role: "button", tabIndex: 0, "aria-expanded": showRemoval, "aria-label": removal
265
+ fontWeight: 600,
266
+ letterSpacing: 0.25,
267
+ lineHeight: "16px",
268
+ textTransform: "uppercase",
269
+ whiteSpace: "nowrap",
270
+ }, children: primaryLabel.toUpperCase() })] }), working && (_jsx(NodeStateMarker, { label: "working", color: workingColor, Icon: WandSparkles, anchor: "top-right" })), issue && (_jsx(NodeStateMarker, { label: "issue", color: issueColor, Icon: TriangleAlert, anchor: "bottom-right", count: issue.count })), proposed && (_jsx(NodeStateMarker, { label: "proposed", color: proposalColor, Icon: CirclePlus, anchor: working ? "top-left" : "top-right" })), removed && (_jsx(NodeStateMarker, { label: "removed", color: removedColor, Icon: CircleX, anchor: working ? "top-left" : "top-right" })), (roleLabel != null ||
271
+ storageLabel != null ||
272
+ deprecatedLabel != null) && (_jsxs("div", { style: {
273
+ position: "absolute",
274
+ bottom: badgeBottom,
275
+ left: "50%",
276
+ transform: "translateX(-50%)",
277
+ zIndex: 1,
278
+ display: "flex",
279
+ gap: 6,
280
+ whiteSpace: "nowrap",
281
+ }, children: [storageLabel != null && storageColor != null && StorageIcon && (_jsxs("span", { title: storageLabel, "aria-label": storageLabel, style: { ...secondaryBadgeStyle, color: storageColor }, children: [_jsx(StorageIcon, { size: 14, strokeWidth: 2, "aria-hidden": "true" }), _jsx("span", { children: storageLabel })] })), roleLabel != null && roleColor != null && RoleIcon && (_jsxs("span", { title: roleLabel, "aria-label": roleLabel, style: { ...secondaryBadgeStyle, color: roleColor }, children: [_jsx(RoleIcon, { size: 14, strokeWidth: 2, "aria-hidden": "true" }), _jsx("span", { children: roleLabel })] })), deprecatedLabel != null && deprecatedColor != null && (_jsxs("span", { role: "button", tabIndex: 0, "aria-expanded": showRemoval, "aria-label": removal
360
282
  ? `Deprecated — removed in ${removal.commit}. Show removal details.`
361
- : 'Deprecated — show removal details.', onClick: (e) => {
283
+ : "Deprecated — show removal details.", onClick: (e) => {
362
284
  e.stopPropagation();
363
285
  setShowRemoval((v) => !v);
364
286
  }, onKeyDown: (e) => {
365
- if (e.key === 'Enter' || e.key === ' ') {
287
+ if (e.key === "Enter" || e.key === " ") {
366
288
  e.stopPropagation();
367
289
  e.preventDefault();
368
290
  setShowRemoval((v) => !v);
369
291
  }
370
292
  }, style: {
371
- position: 'relative',
372
- fontFamily: theme.fonts.monospace,
373
- fontSize: theme.fontSizes[1],
374
- letterSpacing: 0.5,
375
- textTransform: 'uppercase',
376
- lineHeight: '17px',
293
+ ...secondaryBadgeStyle,
377
294
  color: deprecatedColor,
378
- background: nodeBg,
379
- border: `2px solid ${deprecatedColor}`,
380
- borderRadius: badgeRadius,
381
- padding: '2px 8px',
382
- cursor: 'pointer',
383
- }, children: deprecatedLabel }))] })), showRemoval && deprecatedLabel != null && (_jsxs("div", { role: "dialog", "aria-label": "Removal provenance", onClick: (e) => e.stopPropagation(), style: {
384
- position: 'absolute',
385
- bottom: '100%',
386
- left: '50%',
387
- transform: 'translateX(-50%)',
295
+ cursor: "pointer",
296
+ }, children: [_jsx(DEPRECATED_ICON, { size: 14, strokeWidth: 2, "aria-hidden": "true" }), _jsx("span", { children: deprecatedLabel })] }))] })), showRemoval && deprecatedLabel != null && (_jsxs("div", { role: "dialog", "aria-label": "Removal provenance", onClick: (e) => e.stopPropagation(), style: {
297
+ position: "absolute",
298
+ bottom: "100%",
299
+ left: "50%",
300
+ transform: "translateX(-50%)",
388
301
  marginBottom: 6,
389
302
  zIndex: 20,
390
303
  width: 260,
391
- padding: '8px 10px',
304
+ padding: "8px 10px",
392
305
  borderRadius: 6,
393
306
  background: nodeBg,
394
307
  border: `1px solid ${DEPRECATED_COLOR}`,
395
- boxShadow: '0 6px 20px rgba(0,0,0,0.35)',
308
+ boxShadow: "0 6px 20px rgba(0,0,0,0.35)",
396
309
  fontFamily: theme.fonts.body,
397
310
  fontSize: theme.fontSizes[1],
398
311
  color: theme.colors.text,
399
- textAlign: 'left',
400
- whiteSpace: 'normal',
401
- cursor: 'default',
312
+ textAlign: "left",
313
+ whiteSpace: "normal",
314
+ cursor: "default",
402
315
  }, children: [_jsx("div", { style: {
403
316
  fontWeight: 600,
404
317
  marginBottom: 4,
@@ -407,31 +320,29 @@ export function SubsystemComponentNode(props) {
407
320
  fontSize: theme.fontSizes[2],
408
321
  fontWeight: 600,
409
322
  color: proposed ? proposalColor : theme.colors.text,
410
- textDecoration: removed ? 'line-through' : undefined,
323
+ textDecoration: removed ? "line-through" : undefined,
411
324
  lineHeight: 1.2,
412
- textAlign: 'center',
325
+ textAlign: "center",
413
326
  // Let long names wrap within the node's capped width (instead of
414
327
  // truncating), but cap each line so the node doesn't grow unbounded.
415
- whiteSpace: 'normal',
416
- overflowWrap: 'anywhere',
417
- maxWidth: '100%',
328
+ whiteSpace: "normal",
329
+ overflowWrap: "anywhere",
330
+ maxWidth: "100%",
418
331
  fontFamily: theme.fonts.body,
419
332
  }, children: breakWords(displayName) }), c.symbol &&
420
333
  c.symbol !==
421
- displayName
422
- .replace(/ ?\{\}$/, '')
423
- .replace(/\(\)$/, '') && (_jsx("div", { style: {
334
+ displayName.replace(/ ?\{\}$/, "").replace(/\(\)$/, "") && (_jsx("div", { style: {
424
335
  fontSize: theme.fontSizes[0],
425
336
  fontFamily: theme.fonts.monospace,
426
337
  color: proposed ? proposalColor : color,
427
- textDecoration: removed ? 'line-through' : undefined,
338
+ textDecoration: removed ? "line-through" : undefined,
428
339
  marginTop: 1,
429
- textAlign: 'center',
430
- whiteSpace: 'nowrap',
431
- overflow: 'hidden',
432
- textOverflow: 'ellipsis',
433
- maxWidth: '100%',
434
- }, title: c.symbol, children: c.symbol })), data.issue && _jsx(NodeIssueOverlay, { issue: data.issue }), _jsx(Handle, { type: "target", position: Position.Left, style: { opacity: 0 } }), _jsx(Handle, { type: "source", position: Position.Right, style: { opacity: 0 } })] }));
340
+ textAlign: "center",
341
+ whiteSpace: "nowrap",
342
+ overflow: "hidden",
343
+ textOverflow: "ellipsis",
344
+ maxWidth: "100%",
345
+ }, title: c.symbol, children: c.symbol })), _jsx(Handle, { type: "target", position: Position.Left, style: { opacity: 0 } }), _jsx(Handle, { type: "source", position: Position.Right, style: { opacity: 0 } })] }));
435
346
  }
436
347
  /**
437
348
  * Boundary frame — a React Flow parent node for a process, package or module
@@ -448,7 +359,7 @@ export function SubsystemGroupNode(props) {
448
359
  const region = props.data.region;
449
360
  if (!region)
450
361
  return null;
451
- return isCardFrame(region) ? _jsx(CardFrame, { ...props }) : _jsx(BadgeFrame, { ...props });
362
+ return isCardFrame(region) ? (_jsx(CardFrame, { ...props })) : (_jsx(BadgeFrame, { ...props }));
452
363
  }
453
364
  /**
454
365
  * The container-card chrome for a process / package frame.
@@ -470,51 +381,55 @@ function CardFrame(props) {
470
381
  const dimmed = data.dimmed === true;
471
382
  const hidden = data.hidden === true;
472
383
  const collapsed = data.collapsed === true;
473
- const isPackage = region.kind === 'package' || region.chrome === 'package';
474
- const frameStyle = !isPackage || selected ? 'solid' : 'dashed';
384
+ const isPackage = region.kind === "package" || region.chrome === "package";
385
+ const frameStyle = !isPackage || selected ? "solid" : "dashed";
475
386
  const frameRadius = isPackage ? 12 : 4;
476
- const containerKind = region.containerKind ?? 'application';
477
- const Icon = isPackage ? Package : containerKind === 'data-store' ? Database : AppWindow;
387
+ const containerKind = region.containerKind ?? "application";
388
+ const Icon = isPackage
389
+ ? Package
390
+ : containerKind === "data-store"
391
+ ? Database
392
+ : AppWindow;
478
393
  // The technology row falls back to the kind so it is never blank — the same
479
394
  // fallback the C4 card uses.
480
- const topLabel = region.technology ?? (isPackage ? 'package' : containerKind);
395
+ const topLabel = region.technology ?? (isPackage ? "package" : containerKind);
481
396
  const ToggleIcon = collapsed ? Maximize2 : Minimize2;
482
397
  return (_jsxs("div", { title: region.description, style: {
483
- position: 'relative',
398
+ position: "relative",
484
399
  width: width ?? (collapsed ? NODE_W : 400),
485
400
  height: height ?? (collapsed ? NODE_H : 300),
486
- boxSizing: 'border-box',
401
+ boxSizing: "border-box",
487
402
  borderRadius: frameRadius,
488
403
  border: `2px ${frameStyle} ${color}`,
489
404
  background: theme.colors.backgroundSecondary ?? theme.colors.background,
490
- boxShadow: '0 1px 4px rgba(0,0,0,0.25)',
405
+ boxShadow: "0 1px 4px rgba(0,0,0,0.25)",
491
406
  opacity: hidden ? 0 : dimmed ? 0.35 : 1,
492
407
  // React Flow snaps the wrapper to the new size; this box eases between
493
408
  // the open frame and the closed card so the toggle reads as a grow /
494
409
  // shrink rather than a swap.
495
410
  transition: `opacity 150ms ease, width ${MORPH_MS}ms ease, height ${MORPH_MS}ms ease`,
496
- pointerEvents: 'none',
411
+ pointerEvents: "none",
497
412
  fontFamily: theme.fonts.body,
498
413
  }, children: [_jsx("div", { style: {
499
- position: 'absolute',
414
+ position: "absolute",
500
415
  top: 0,
501
416
  left: 0,
502
417
  right: 0,
503
- display: 'flex',
504
- flexDirection: 'column',
418
+ display: "flex",
419
+ flexDirection: "column",
505
420
  gap: CARD_GAP,
506
421
  padding: `${CARD_PAD_Y}px ${CARD_PAD_X}px`,
507
- boxSizing: 'border-box',
508
- }, children: _jsx(ContainerCardHeader, { label: region.label, Icon: Icon, iconLabel: isPackage ? 'package' : containerKind, color: color, topLabel: topLabel, brand: brand, hasTechRow: true, count: { value: region.memberAliases.length, Icon: Component } }) }), data.onToggleCollapse && (_jsx("button", { type: "button", className: "nodrag nopan", onClick: (e) => {
422
+ boxSizing: "border-box",
423
+ }, children: _jsx(ContainerCardHeader, { label: region.label, Icon: Icon, iconLabel: isPackage ? "package" : containerKind, color: color, topLabel: topLabel, brand: brand, hasTechRow: true, count: { value: region.memberAliases.length, Icon: Component } }) }), data.onToggleCollapse && (_jsx("button", { type: "button", className: "nodrag nopan", onClick: (e) => {
509
424
  e.stopPropagation();
510
425
  data.onToggleCollapse?.();
511
- }, onDoubleClick: (e) => e.stopPropagation(), "aria-label": collapsed ? 'Show members' : 'Hide members', "aria-pressed": collapsed, style: {
512
- position: 'absolute',
426
+ }, onDoubleClick: (e) => e.stopPropagation(), "aria-label": collapsed ? "Show members" : "Hide members", "aria-pressed": collapsed, style: {
427
+ position: "absolute",
513
428
  right: TOGGLE_INSET,
514
429
  bottom: TOGGLE_INSET,
515
- display: 'inline-flex',
516
- alignItems: 'center',
517
- justifyContent: 'center',
430
+ display: "inline-flex",
431
+ alignItems: "center",
432
+ justifyContent: "center",
518
433
  width: TOGGLE_SIZE,
519
434
  height: TOGGLE_SIZE,
520
435
  padding: 0,
@@ -522,12 +437,12 @@ function CardFrame(props) {
522
437
  border: `1px solid ${color}`,
523
438
  background: theme.colors.backgroundSecondary ?? theme.colors.background,
524
439
  color,
525
- cursor: 'pointer',
440
+ cursor: "pointer",
526
441
  lineHeight: 1,
527
- pointerEvents: 'auto',
528
- }, children: _jsx(ToggleIcon, { size: 13, strokeWidth: 2.25 }) })), data.issue && ISSUE_KIND_ICON[data.issue.kind] && (_jsx(IssueChip, { color: data.issue.severity === 'error'
529
- ? (theme.colors.error ?? '#e5534b')
530
- : (theme.colors.warning ?? '#d4a017'), Icon: ISSUE_KIND_ICON[data.issue.kind], count: data.issue.count, anchor: { right: -9, bottom: -8 } })), collapsed && (_jsxs(_Fragment, { children: [_jsx(Handle, { type: "target", position: Position.Left, style: { opacity: 0 } }), _jsx(Handle, { type: "source", position: Position.Right, style: { opacity: 0 } })] }))] }));
442
+ pointerEvents: "auto",
443
+ }, children: _jsx(ToggleIcon, { size: 13, strokeWidth: 2.25 }) })), data.issue && ISSUE_KIND_ICON[data.issue.kind] && (_jsx(IssueChip, { color: data.issue.severity === "error"
444
+ ? (theme.colors.error ?? "#e5534b")
445
+ : (theme.colors.warning ?? "#d4a017"), Icon: ISSUE_KIND_ICON[data.issue.kind], count: data.issue.count, anchor: { right: -9, bottom: -8 } })), collapsed && (_jsxs(_Fragment, { children: [_jsx(Handle, { type: "target", position: Position.Left, style: { opacity: 0 } }), _jsx(Handle, { type: "source", position: Position.Right, style: { opacity: 0 } })] }))] }));
531
446
  }
532
447
  /**
533
448
  * The bare-frame chrome for a module / directory region: dashed border,
@@ -541,7 +456,8 @@ function BadgeFrame(props) {
541
456
  // Explicit host override wins over the derived frame color. Folder frames
542
457
  // (directory, or a module whose key names a folder) share one neutral hue;
543
458
  // everything else hashes per key.
544
- const color = data.color ?? (isFolderFrame(region) ? FOLDER_FRAME_COLOR : packageColor(region.key));
459
+ const color = data.color ??
460
+ (isFolderFrame(region) ? FOLDER_FRAME_COLOR : packageColor(region.key));
545
461
  const dimmed = data.dimmed === true;
546
462
  const hidden = data.hidden === true;
547
463
  // Label is the region identity alone (the path). Kind is carried by the
@@ -557,43 +473,51 @@ function BadgeFrame(props) {
557
473
  // Hover affords clickability by revealing more of the path — the badge
558
474
  // widens to fit real text (never stretched), hinting before the click.
559
475
  const [hover, setHover] = useState(false);
560
- const hoveredLabel = canToggle ? moduleBadgeHoverLabel(label, availableBadgeWidth) : label;
476
+ const hoveredLabel = canToggle
477
+ ? moduleBadgeHoverLabel(label, availableBadgeWidth)
478
+ : label;
561
479
  const badgeBg = theme.colors.backgroundSecondary ?? theme.colors.background;
562
480
  // Code folders stay dashed until selected; the body is transparent so nested
563
481
  // frames don't stack washes.
564
- const frameStyle = selected ? 'solid' : 'dashed';
482
+ const frameStyle = selected ? "solid" : "dashed";
565
483
  return (_jsxs("div", { style: {
566
- position: 'relative',
484
+ position: "relative",
567
485
  width: width ?? 400,
568
486
  height: height ?? 300,
569
- boxSizing: 'border-box',
487
+ boxSizing: "border-box",
570
488
  borderRadius: 12,
571
489
  border: `2px ${frameStyle} ${color}`,
572
- background: 'transparent',
490
+ background: "transparent",
573
491
  opacity: hidden ? 0 : dimmed ? 0.35 : 1,
574
- transition: 'opacity 150ms ease',
575
- pointerEvents: 'none',
576
- }, children: [_jsx("div", { className: "nodrag nopan", role: canToggle ? 'button' : undefined, tabIndex: canToggle && !hidden ? 0 : undefined, "aria-expanded": canToggle ? expanded : undefined, "aria-label": canToggle ? `${expanded ? 'Collapse' : 'Expand'} module path: ${label}` : undefined, onMouseEnter: canToggle ? () => setHover(true) : undefined, onMouseLeave: canToggle ? () => setHover(false) : undefined, onClick: canToggle ? (event) => {
577
- event.stopPropagation();
578
- setExpandedLabel(expanded ? null : label);
579
- } : undefined, onKeyDown: canToggle ? (event) => {
580
- if (event.key === 'Enter' || event.key === ' ') {
581
- event.preventDefault();
492
+ transition: "opacity 150ms ease",
493
+ pointerEvents: "none",
494
+ }, children: [_jsx("div", { className: "nodrag nopan", role: canToggle ? "button" : undefined, tabIndex: canToggle && !hidden ? 0 : undefined, "aria-expanded": canToggle ? expanded : undefined, "aria-label": canToggle
495
+ ? `${expanded ? "Collapse" : "Expand"} module path: ${label}`
496
+ : undefined, onMouseEnter: canToggle ? () => setHover(true) : undefined, onMouseLeave: canToggle ? () => setHover(false) : undefined, onClick: canToggle
497
+ ? (event) => {
582
498
  event.stopPropagation();
583
499
  setExpandedLabel(expanded ? null : label);
584
500
  }
585
- else if (event.key === 'Escape' && expanded) {
586
- event.stopPropagation();
587
- setExpandedLabel(null);
501
+ : undefined, onKeyDown: canToggle
502
+ ? (event) => {
503
+ if (event.key === "Enter" || event.key === " ") {
504
+ event.preventDefault();
505
+ event.stopPropagation();
506
+ setExpandedLabel(expanded ? null : label);
507
+ }
508
+ else if (event.key === "Escape" && expanded) {
509
+ event.stopPropagation();
510
+ setExpandedLabel(null);
511
+ }
588
512
  }
589
- } : undefined, style: {
590
- position: 'absolute',
513
+ : undefined, style: {
514
+ position: "absolute",
591
515
  // Centred astride the top edge like component badges. Always set
592
516
  // left/transform explicitly — React Flow reuses group DOM nodes and
593
517
  // `undefined` does not clear a prior value.
594
518
  top: 0,
595
519
  left: 12,
596
- transform: 'translateY(-50%)',
520
+ transform: "translateY(-50%)",
597
521
  zIndex: canToggle ? 10 : undefined,
598
522
  // Width is explicit while collapsible so hover-reveal of more path
599
523
  // text animates; the cap keeps both states inside the frame.
@@ -602,11 +526,11 @@ function BadgeFrame(props) {
602
526
  ? Math.min(availableBadgeWidth, moduleBadgeWidth(hoveredLabel))
603
527
  : Math.min(availableBadgeWidth, moduleBadgeWidth(collapsedLabel))
604
528
  : undefined,
605
- transition: 'width 140ms ease, box-shadow 120ms ease',
606
- cursor: canToggle ? 'pointer' : undefined,
529
+ transition: "width 140ms ease, box-shadow 120ms ease",
530
+ cursor: canToggle ? "pointer" : undefined,
607
531
  // The trailing halo squares the rounded corners back off in the fill
608
532
  // colour, so an edge crossing a corner can't show through the notch.
609
- boxShadow: `${canToggle && hover ? `0 2px 10px ${color}55, ` : ''}0 0 0 1.5px ${badgeBg}`,
533
+ boxShadow: `${canToggle && hover ? `0 2px 10px ${color}55, ` : ""}0 0 0 1.5px ${badgeBg}`,
610
534
  fontFamily: theme.fonts.monospace,
611
535
  fontSize: theme.fontSizes[3],
612
536
  fontWeight: 700,
@@ -615,32 +539,32 @@ function BadgeFrame(props) {
615
539
  background: badgeBg,
616
540
  border: `2px solid ${color}`,
617
541
  borderRadius: 4,
618
- padding: '3px 9px',
619
- whiteSpace: 'nowrap',
620
- overflow: 'hidden',
621
- textOverflow: 'ellipsis',
622
- boxSizing: 'border-box',
623
- pointerEvents: hidden ? 'none' : 'auto',
542
+ padding: "3px 9px",
543
+ whiteSpace: "nowrap",
544
+ overflow: "hidden",
545
+ textOverflow: "ellipsis",
546
+ boxSizing: "border-box",
547
+ pointerEvents: hidden ? "none" : "auto",
624
548
  // Cap the collapsed badge at the frame's inner width so it never
625
549
  // spills past the module — it gets the `…`/click-to-expand treatment
626
550
  // instead. Expanding lifts the cap so the full path grows the badge
627
551
  // past the frame's edge.
628
552
  maxWidth: expanded ? undefined : availableBadgeWidth,
629
- }, children: canToggle ? (_jsx("span", { style: { whiteSpace: 'nowrap' }, children: expanded ? label : hover ? hoveredLabel : collapsedLabel })) : (label) }), data.issue && ISSUE_KIND_ICON[data.issue.kind] && (_jsx(IssueChip, { color: data.issue.severity === 'error'
630
- ? (theme.colors.error ?? '#e5534b')
631
- : (theme.colors.warning ?? '#d4a017'), Icon: ISSUE_KIND_ICON[data.issue.kind], count: data.issue.count, anchor: { right: -9, bottom: -8 } }))] }));
553
+ }, children: canToggle ? (_jsx("span", { style: { whiteSpace: "nowrap" }, children: expanded ? label : hover ? hoveredLabel : collapsedLabel })) : (label) }), data.issue && ISSUE_KIND_ICON[data.issue.kind] && (_jsx(IssueChip, { color: data.issue.severity === "error"
554
+ ? (theme.colors.error ?? "#e5534b")
555
+ : (theme.colors.warning ?? "#d4a017"), Icon: ISSUE_KIND_ICON[data.issue.kind], count: data.issue.count, anchor: { right: -9, bottom: -8 } }))] }));
632
556
  }
633
557
  /** `#rrggbb` + alpha → `#rrggbbaa`. Used to dim a stroke/marker by color so
634
558
  * each opacity gets its own SVG marker id — path `opacity` leaks across every
635
559
  * edge that shares a `url(#marker)` (the focused edge's arrowhead dims). */
636
560
  export function hexWithAlpha(hex, alpha) {
637
- const raw = hex.replace('#', '');
638
- const full = raw.length === 3 ? [...raw].map((c) => c + c).join('') : raw;
561
+ const raw = hex.replace("#", "");
562
+ const full = raw.length === 3 ? [...raw].map((c) => c + c).join("") : raw;
639
563
  if (!/^[0-9a-fA-F]{6}$/.test(full))
640
564
  return hex;
641
565
  const a = Math.round(Math.min(1, Math.max(0, alpha)) * 255)
642
566
  .toString(16)
643
- .padStart(2, '0');
567
+ .padStart(2, "0");
644
568
  return `#${full}${a}`;
645
569
  }
646
570
  /**
@@ -710,21 +634,30 @@ export const EDGE_DIM_ALPHA = 0.15;
710
634
  * parent Inner component) so it sits above the pane and receives pointer
711
635
  * events. */
712
636
  export function SubsystemEdge({ data, markerEnd, }) {
713
- const path = data?.elkPath ?? '';
714
- const mechanism = data?.mechanism ?? 'uses';
637
+ const path = data?.elkPath ?? "";
638
+ const mechanism = data?.mechanism ?? "uses";
715
639
  // Color + dash resolve from provenance: subsystem mechanisms use the
716
640
  // MECHANISM_* tables, graphify-native relations use the separate
717
641
  // GRAPHIFY_RELATION_* palette (see edgeColor / edgeStrokeStyle).
718
642
  const edgeRef = { mechanism, provenance: data?.provenance };
719
- const color = edgeColor(edgeRef);
643
+ const ghost = data?.ghost === true;
644
+ const proposed = data?.proposed === true;
645
+ const color = proposed ? HOST_PROPOSAL_COLOR : edgeColor(edgeRef);
720
646
  // Dash style encodes provenance (graphify) and relationship kind (dashed =
721
647
  // inverted-control or observational: hierarchy, registration, watches).
722
- const isDashed = edgeStrokeStyle(edgeRef) === 'dashed';
648
+ // Host-local proposal/previous-state edges are dashed too.
649
+ const isDashed = proposed || ghost || edgeStrokeStyle(edgeRef) === "dashed";
723
650
  const dimmed = data?.dimmed === true;
724
651
  // Dim the stroke by color, never via path `opacity`. SVG markers are shared
725
652
  // by id; opacity on the referencing path paints every arrowhead that uses
726
653
  // the same marker — including the focused edge's target.
727
- const stroke = dimmed ? hexWithAlpha(color, EDGE_DIM_ALPHA) : color;
728
- return (_jsxs(_Fragment, { children: [_jsx("path", { d: path, fill: "none", stroke: "transparent", strokeWidth: 20, className: "react-flow__edge-interaction" }), _jsx("path", { d: path, fill: "none", stroke: stroke, strokeWidth: 1.5, strokeDasharray: isDashed ? '6 4' : undefined, markerEnd: markerEnd, style: { pointerEvents: 'none' } })] }));
654
+ const stroke = proposed
655
+ ? color
656
+ : ghost
657
+ ? hexWithAlpha(color, 0.45)
658
+ : dimmed
659
+ ? hexWithAlpha(color, EDGE_DIM_ALPHA)
660
+ : color;
661
+ return (_jsxs(_Fragment, { children: [_jsx("path", { d: path, fill: "none", stroke: "transparent", strokeWidth: 20, className: "react-flow__edge-interaction" }), _jsx("path", { d: path, fill: "none", stroke: stroke, strokeWidth: ghost || proposed ? 1 : 1.5, strokeDasharray: isDashed ? "6 4" : undefined, markerEnd: markerEnd, style: { pointerEvents: "none" } })] }));
729
662
  }
730
663
  //# sourceMappingURL=nodes.js.map