@pipelex/mthds-ui 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { n as GraphSpecNode, q as PipeCallNode, G as GraphSpec, D as DataflowAnalysis, C as ConceptInfo, P as PipeBlueprintUnion, r as GraphData, m as GraphSpecMode, s as PipeCardPayload, k as FoldToggleOptions, c as GraphNode, b as GraphEdge, e as GraphDirection, t as LayoutConfig, d as GraphConfig, T as ToolbarPosition, g as GraphTheme } from '../types-Cm4147S5.js';
2
- export { A as ARROW_CLOSED_MARKER, u as CONTROLLER_PADDING_BOTTOM, v as CONTROLLER_PADDING_TOP, w as CONTROLLER_PADDING_X, E as EDGE_TYPE, x as EdgeType, y as FOLD_MODE, z as FieldResolution, F as FoldMode, B as GRAPH_DIRECTION, H as GRAPH_SPEC_MODE, I as GRAPH_THEME, J as GRAPH_THEME_MODE, a as GraphNodeData, K as GraphSpecEdge, M as GraphSpecEdgeKind, N as GraphSpecMeta, O as GraphSpecNodeError, Q as GraphSpecNodeIo, o as GraphSpecNodeIoItem, R as GraphSpecNodeTiming, f as GraphThemeMode, S as KNOWN_PIPE_TYPES, L as LabelDescriptor, U as NODE_TYPE_CONTROLLER, W as NODE_TYPE_PIPE_CARD, X as NODE_TYPE_STUFF, Y as NodeKind, Z as PipeBatchBlueprint, _ as PipeBlueprintBase, $ as PipeComposeBlueprint, a0 as PipeComposeConstructBlueprint, a1 as PipeComposeConstructField, a2 as PipeConditionBlueprint, j as PipeControllerType, a3 as PipeExtractBlueprint, a4 as PipeFuncBlueprint, a5 as PipeImgGenBlueprint, a6 as PipeLLMBlueprint, p as PipeOperatorType, a7 as PipeParallelBlueprint, a8 as PipeSearchBlueprint, a9 as PipeSequenceBlueprint, aa as PipeSignatureBlueprint, h as PipeStatus, ab as PipeStructureBlueprint, l as PipeType, ac as STUFF_ID_PREFIX, ad as StuffRole, ae as StuffSpecInfo, af as SubPipeSpec, ag as TOOLBAR_POSITION, ah as TemplateBlueprint, ai as ToolbarOrientation, aj as ToolbarSide, ak as VALIDATION_STATE, V as ValidationIssue, i as ValidationState, al as graphSpecMode, am as isDryGraphSpec, an as isStaticGraphSpec, ao as isStuffNodeId, ap as nodeHeight, aq as nodeWidth, ar as stuffDigestFromId, as as stuffNodeId, at as toolbarOrientation, au as toolbarSide } from '../types-Cm4147S5.js';
1
+ import { n as GraphSpecNode, q as PipeCallNode, G as GraphSpec, D as DataflowAnalysis, C as ConceptInfo, P as PipeBlueprintUnion, r as GraphData, m as GraphSpecMode, s as PipeCardPayload, k as FoldToggleOptions, c as GraphNode, b as GraphEdge, a as GraphNodeData, N as NodeValidationSummary, V as ValidationIssue, e as GraphDirection, t as LayoutConfig, d as GraphConfig, T as ToolbarPosition, g as GraphTheme } from '../types-CIH1Ae16.js';
2
+ export { A as ARROW_CLOSED_MARKER, u as CONTROLLER_PADDING_BOTTOM, v as CONTROLLER_PADDING_TOP, w as CONTROLLER_PADDING_X, E as EDGE_TYPE, x as EdgeType, y as FOLD_MODE, z as FieldResolution, F as FoldMode, B as GRAPH_DIRECTION, H as GRAPH_SPEC_MODE, I as GRAPH_THEME, J as GRAPH_THEME_MODE, K as GraphSpecEdge, M as GraphSpecEdgeKind, O as GraphSpecMeta, Q as GraphSpecNodeError, R as GraphSpecNodeIo, o as GraphSpecNodeIoItem, S as GraphSpecNodeTiming, f as GraphThemeMode, U as KNOWN_PIPE_TYPES, L as LabelDescriptor, W as NODE_TYPE_CONTROLLER, X as NODE_TYPE_PIPE_CARD, Y as NODE_TYPE_STUFF, Z as NodeKind, _ as PipeBatchBlueprint, $ as PipeBlueprintBase, a0 as PipeComposeBlueprint, a1 as PipeComposeConstructBlueprint, a2 as PipeComposeConstructField, a3 as PipeConditionBlueprint, j as PipeControllerType, a4 as PipeExtractBlueprint, a5 as PipeFuncBlueprint, a6 as PipeImgGenBlueprint, a7 as PipeLLMBlueprint, p as PipeOperatorType, a8 as PipeParallelBlueprint, a9 as PipeSearchBlueprint, aa as PipeSequenceBlueprint, ab as PipeSignatureBlueprint, h as PipeStatus, ac as PipeStructureBlueprint, l as PipeType, ad as STUFF_ID_PREFIX, ae as StuffRole, af as StuffSpecInfo, ag as SubPipeSpec, ah as TOOLBAR_POSITION, ai as TemplateBlueprint, aj as ToolbarOrientation, ak as ToolbarSide, al as VALIDATION_STATE, i as ValidationState, am as graphSpecMode, an as isDryGraphSpec, ao as isStaticGraphSpec, ap as isStuffNodeId, aq as nodeHeight, ar as nodeWidth, as as stuffDigestFromId, at as stuffNodeId, au as toolbarOrientation, av as toolbarSide } from '../types-CIH1Ae16.js';
3
3
  import { ElkNode } from 'elkjs/lib/elk-api';
4
4
 
5
5
  /**
@@ -130,6 +130,40 @@ declare function applyFolds(graphData: GraphData, analysis: DataflowAnalysis, gr
130
130
  analysis: DataflowAnalysis;
131
131
  };
132
132
 
133
+ /**
134
+ * Build the per-node decoration map for the current fold state.
135
+ *
136
+ * Each issue's target ids are remapped through the fold containment
137
+ * (`outermostFoldedAncestor`): an issue on a node hidden inside a folded
138
+ * controller decorates the folded controller's card instead, so folding never
139
+ * hides an error. Targets that don't resolve to a rendered node (e.g. a
140
+ * diagnostic about a pipe that was skipped during the static walk) simply
141
+ * produce no decoration — those issues stay panel-only.
142
+ *
143
+ * Counts are per issue × target invocation: a folded controller containing two
144
+ * invocations of a broken pipe shows 2, matching the sum of the badges that
145
+ * become visible when it is expanded.
146
+ */
147
+ declare function buildValidationDecorations(issues: readonly ValidationIssue[] | undefined, graphspec: GraphSpec | null, childToCtrl: Readonly<Record<string, string>>, foldedSet: ReadonlySet<string>): Map<string, NodeValidationSummary>;
148
+ /**
149
+ * Resolve the rendered node a panel row should navigate to: the issue's first
150
+ * target, remapped through the fold containment, and only if that id is
151
+ * actually rendered. `null` for panel-only issues (no target, or the target
152
+ * never became a node).
153
+ */
154
+ declare function resolveIssueTargetNodeId(issue: ValidationIssue, graphspec: GraphSpec | null, childToCtrl: Readonly<Record<string, string>>, foldedSet: ReadonlySet<string>, renderedNodeIds: ReadonlySet<string>): string | null;
155
+ /**
156
+ * Stamp the decoration map onto rendered nodes (and their pipe-card payloads).
157
+ * Nodes whose decoration is unchanged are returned as-is; a node whose issues
158
+ * disappeared gets its stamp cleared, so verdict flips are fully reactive.
159
+ * `onBadgeClick` (when provided) rides along on decorated nodes only — the
160
+ * badge renders as a button that opens the validation panel.
161
+ */
162
+ declare function applyValidationDecorations<T extends {
163
+ id: string;
164
+ data: GraphNodeData;
165
+ }>(nodes: T[], decorations: ReadonlyMap<string, NodeValidationSummary>, onBadgeClick?: () => void): T[];
166
+
133
167
  declare function inputPortId(nodeId: string): string;
134
168
  declare function outputPortId(nodeId: string): string;
135
169
  interface NodeDimensions {
@@ -197,4 +231,4 @@ declare const DEFAULT_GRAPH_CONFIG: GraphConfig & {
197
231
  };
198
232
  declare function getPaletteColors(): Record<string, string>;
199
233
 
200
- export { ConceptInfo, type ControllerRect, DARK_PALETTE_COLORS, DEFAULT_GRAPH_CONFIG, DataflowAnalysis, type ElkPositionResult, FoldToggleOptions, GraphConfig, GraphData, GraphDirection, GraphEdge, GraphNode, GraphSpec, GraphSpecMode, GraphSpecNode, GraphSpecValidationError, GraphTheme, LIGHT_PALETTE_COLORS, LayoutConfig, type LayoutResult, MAX_VISIBLE_CONTROLLER_CHILDREN, PipeBlueprintUnion, PipeCallNode, PipeCardPayload, ToolbarPosition, applyControllers, applyFolds, asPipeCallNode, buildChildToControllerMap, buildContainmentChain, buildControllerNodes, buildDataflowAnalysis, buildDataflowGraph, buildElkGraph, buildGraph, buildPipeCardPayload, estimateNodeDimensions, extractAbsolutePositions, findCousinControllers, getConceptInfo, getLayoutedElements, getPaletteColors, getPaletteForTheme, getPipeBlueprint, inputPortId, outermostFoldedAncestor, outputPortId, resolveConceptRef, validateGraphSpec };
234
+ export { ConceptInfo, type ControllerRect, DARK_PALETTE_COLORS, DEFAULT_GRAPH_CONFIG, DataflowAnalysis, type ElkPositionResult, FoldToggleOptions, GraphConfig, GraphData, GraphDirection, GraphEdge, GraphNode, GraphNodeData, GraphSpec, GraphSpecMode, GraphSpecNode, GraphSpecValidationError, GraphTheme, LIGHT_PALETTE_COLORS, LayoutConfig, type LayoutResult, MAX_VISIBLE_CONTROLLER_CHILDREN, NodeValidationSummary, PipeBlueprintUnion, PipeCallNode, PipeCardPayload, ToolbarPosition, ValidationIssue, applyControllers, applyFolds, applyValidationDecorations, asPipeCallNode, buildChildToControllerMap, buildContainmentChain, buildControllerNodes, buildDataflowAnalysis, buildDataflowGraph, buildElkGraph, buildGraph, buildPipeCardPayload, buildValidationDecorations, estimateNodeDimensions, extractAbsolutePositions, findCousinControllers, getConceptInfo, getLayoutedElements, getPaletteColors, getPaletteForTheme, getPipeBlueprint, inputPortId, outermostFoldedAncestor, outputPortId, resolveConceptRef, resolveIssueTargetNodeId, validateGraphSpec };
@@ -1,4 +1,4 @@
1
- import "../chunk-L24K3TZU.js";
1
+ import "../chunk-LJQS5ZNA.js";
2
2
  import {
3
3
  DARK_PALETTE_COLORS,
4
4
  DEFAULT_GRAPH_CONFIG,
@@ -7,6 +7,7 @@ import {
7
7
  MAX_VISIBLE_CONTROLLER_CHILDREN,
8
8
  applyControllers,
9
9
  applyFolds,
10
+ applyValidationDecorations,
10
11
  asPipeCallNode,
11
12
  buildChildToControllerMap,
12
13
  buildContainmentChain,
@@ -16,6 +17,7 @@ import {
16
17
  buildElkGraph,
17
18
  buildGraph,
18
19
  buildPipeCardPayload,
20
+ buildValidationDecorations,
19
21
  estimateNodeDimensions,
20
22
  extractAbsolutePositions,
21
23
  findCousinControllers,
@@ -28,8 +30,9 @@ import {
28
30
  outermostFoldedAncestor,
29
31
  outputPortId,
30
32
  resolveConceptRef,
33
+ resolveIssueTargetNodeId,
31
34
  validateGraphSpec
32
- } from "../chunk-XCZLRCEJ.js";
35
+ } from "../chunk-V4FKGLKA.js";
33
36
  import {
34
37
  ARROW_CLOSED_MARKER,
35
38
  CONTROLLER_PADDING_BOTTOM,
@@ -58,7 +61,7 @@ import {
58
61
  stuffNodeId,
59
62
  toolbarOrientation,
60
63
  toolbarSide
61
- } from "../chunk-IMQ7MVYL.js";
64
+ } from "../chunk-GS2KODND.js";
62
65
  import "../chunk-2NMEKWO5.js";
63
66
  export {
64
67
  ARROW_CLOSED_MARKER,
@@ -85,6 +88,7 @@ export {
85
88
  VALIDATION_STATE,
86
89
  applyControllers,
87
90
  applyFolds,
91
+ applyValidationDecorations,
88
92
  asPipeCallNode,
89
93
  buildChildToControllerMap,
90
94
  buildContainmentChain,
@@ -94,6 +98,7 @@ export {
94
98
  buildElkGraph,
95
99
  buildGraph,
96
100
  buildPipeCardPayload,
101
+ buildValidationDecorations,
97
102
  estimateNodeDimensions,
98
103
  extractAbsolutePositions,
99
104
  findCousinControllers,
@@ -112,6 +117,7 @@ export {
112
117
  outermostFoldedAncestor,
113
118
  outputPortId,
114
119
  resolveConceptRef,
120
+ resolveIssueTargetNodeId,
115
121
  stuffDigestFromId,
116
122
  stuffNodeId,
117
123
  toolbarOrientation,
@@ -126,16 +126,22 @@
126
126
  var(--shadow-lg) !important;
127
127
  z-index: 1000 !important;
128
128
  }
129
- /* Pipe cards handle their own selection styling — suppress the wrapper outline */
129
+ /* Pipe cards handle their own selection styling — suppress the wrapper outline.
130
+ The outline reset excludes .node-validation-flash: the flash animates the
131
+ wrapper outline, and an !important reset would override the animation. */
130
132
  .react-flow__node-pipeCard {
131
133
  background: transparent !important;
132
134
  border: none !important;
133
135
  box-shadow: none !important;
134
- outline: none !important;
135
136
  padding: 0 !important;
136
137
  }
138
+ .react-flow__node-pipeCard:not(.node-validation-flash) {
139
+ outline: none !important;
140
+ }
137
141
  .react-flow__node-pipeCard.selected {
138
142
  box-shadow: none !important;
143
+ }
144
+ .react-flow__node-pipeCard.selected:not(.node-validation-flash) {
139
145
  outline: none !important;
140
146
  }
141
147
  .react-flow__node-pipeCard.selected .pipe-card {
@@ -586,3 +592,66 @@
586
592
  .pipe-card--tb .pipe-card-io-pill-concept {
587
593
  max-width: 100px;
588
594
  }
595
+
596
+ /* ─── Validation decorations (severity ring + count badge) ─────────────────
597
+ Stamped by GraphViewer from targeted ValidationIssues. The ring is an
598
+ outline so node geometry (and therefore layout) never changes; the badge
599
+ lives in the header flow, which is size-locked by the ELK dimensions. */
600
+
601
+ .node-validation-ring--error {
602
+ outline: 2px solid var(--color-error);
603
+ outline-offset: 1px;
604
+ }
605
+ .node-validation-ring--warning {
606
+ outline: 1.5px solid var(--color-warning);
607
+ outline-offset: 1px;
608
+ }
609
+
610
+ .node-validation-badge {
611
+ flex-shrink: 0;
612
+ min-width: 16px;
613
+ height: 16px;
614
+ padding: 0 4px;
615
+ border: none;
616
+ border-radius: 999px;
617
+ font-family: var(--font-sans);
618
+ font-size: 10px;
619
+ font-weight: 700;
620
+ line-height: 16px;
621
+ text-align: center;
622
+ box-sizing: border-box;
623
+ }
624
+ .node-validation-badge--error {
625
+ background: var(--color-error);
626
+ color: #fff;
627
+ }
628
+ .node-validation-badge--warning {
629
+ background: var(--color-warning);
630
+ color: rgba(0, 0, 0, 0.85);
631
+ }
632
+ button.node-validation-badge {
633
+ cursor: pointer;
634
+ }
635
+ /* The controller header disables pointer events (it overlays children); the
636
+ badge re-enables them for its tooltip and click-through to the panel. */
637
+ .controller-group-header .node-validation-badge {
638
+ pointer-events: auto;
639
+ }
640
+
641
+ /* Transient highlight when a validation-panel row navigates to its node.
642
+ Applied to the ReactFlow node wrapper; the animation fades the halo out and
643
+ the class is cleared (or dropped by the next rebuild) once it has played. */
644
+ .react-flow__node.node-validation-flash {
645
+ animation: node-validation-flash 1.6s ease-out;
646
+ }
647
+ @keyframes node-validation-flash {
648
+ 0%,
649
+ 50% {
650
+ outline: 3px solid var(--color-accent-strong);
651
+ outline-offset: 5px;
652
+ }
653
+ 100% {
654
+ outline: 3px solid transparent;
655
+ outline-offset: 5px;
656
+ }
657
+ }
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { a as GraphNodeData, b as GraphEdge, c as GraphNode, G as GraphSpec, d as GraphConfig, e as GraphDirection, F as FoldMode, f as GraphThemeMode, T as ToolbarPosition, g as GraphTheme, h as PipeStatus, i as ValidationState, V as ValidationIssue, L as LabelDescriptor, j as PipeControllerType, k as FoldToggleOptions, l as PipeType, m as GraphSpecMode, n as GraphSpecNode, C as ConceptInfo, o as GraphSpecNodeIoItem } from '../../types-Cm4147S5.js';
4
- export { p as PipeOperatorType } from '../../types-Cm4147S5.js';
3
+ import { a as GraphNodeData, b as GraphEdge, c as GraphNode, G as GraphSpec, d as GraphConfig, e as GraphDirection, F as FoldMode, f as GraphThemeMode, T as ToolbarPosition, g as GraphTheme, h as PipeStatus, i as ValidationState, V as ValidationIssue, L as LabelDescriptor, j as PipeControllerType, k as FoldToggleOptions, N as NodeValidationSummary, l as PipeType, m as GraphSpecMode, n as GraphSpecNode, C as ConceptInfo, o as GraphSpecNodeIoItem } from '../../types-CIH1Ae16.js';
4
+ export { p as PipeOperatorType } from '../../types-CIH1Ae16.js';
5
5
  import { Edge, Node, ReactFlowInstance } from '@xyflow/react';
6
6
 
7
7
  /** Data for rendering a stuff (data item) in the StuffViewer component. */
@@ -237,6 +237,8 @@ interface ControllerGroupData {
237
237
  isCollapsed?: boolean;
238
238
  onToggleCollapse?: () => void;
239
239
  onToggleFold?: (options?: FoldToggleOptions) => void;
240
+ validation?: NodeValidationSummary;
241
+ onValidationBadgeClick?: () => void;
240
242
  }
241
243
  declare function ControllerGroupNode({ data }: {
242
244
  data: ControllerGroupData;
@@ -266,6 +268,10 @@ interface PipeCardData {
266
268
  direction?: PipeCardDirection;
267
269
  /** When set, the card renders an unfold button that invokes this callback. */
268
270
  onExpand?: (options?: FoldToggleOptions) => void;
271
+ /** Validation decoration (severity ring + count badge), stamped by GraphViewer. */
272
+ validation?: NodeValidationSummary;
273
+ /** Badge click handler (opens the validation panel), stamped alongside `validation`. */
274
+ onValidationBadgeClick?: () => void;
269
275
  }
270
276
 
271
277
  interface PipeCardNodeProps {