footprint-explainable-ui 0.19.0 → 0.20.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,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import * as _xyflow_react from '@xyflow/react';
3
- import { Node, Edge } from '@xyflow/react';
3
+ import { Node, Edge, NodeTypes, EdgeTypes } from '@xyflow/react';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
 
6
6
  interface StageNodeData {
@@ -294,8 +294,16 @@ interface MinimalStructureRecorder {
294
294
  onSubflowMounted?(event: SubflowMountedEvent): void;
295
295
  }
296
296
  /**
297
- * Per-node data attached to the xyflow `Node`. Consumed by the
298
- * `StageNode` renderer (shape mirrors what the renderer expects).
297
+ * Per-node data attached to the xyflow `Node`. The built-in `StageNode`
298
+ * renderer reads the named fields below.
299
+ *
300
+ * Consumer extension: this type EXTENDS `Record<string, unknown>` so
301
+ * you can attach custom fields without TypeScript fighting you. Pair
302
+ * this with `<TraceFlow nodeTypes={{ stageNode: MyNode }} />` (or push
303
+ * nodes with `type: 'myCustomKind'`) to render those custom fields
304
+ * however you want. The built-in `StageNode` ignores fields it doesn't
305
+ * recognize, so adding consumer fields is non-breaking even if you
306
+ * keep the default renderer.
299
307
  */
300
308
  interface TraceNodeData extends Record<string, unknown> {
301
309
  label: string;
@@ -355,7 +363,14 @@ interface TraceNodeData extends Record<string, unknown> {
355
363
  prevIds: StageId[];
356
364
  nextIds: StageId[];
357
365
  }
358
- /** Per-edge data attached to the xyflow `Edge`. */
366
+ /**
367
+ * Per-edge data attached to the xyflow `Edge`. The default edge
368
+ * renderer reads `kind` (and `label`).
369
+ *
370
+ * Consumer extension: same pattern as `TraceNodeData` — extra fields
371
+ * pass through unchanged. Pair with `<TraceFlow edgeTypes={...} />`
372
+ * to render custom edges (e.g., a "retried" edge with a count badge).
373
+ */
359
374
  interface TraceEdgeData extends Record<string, unknown> {
360
375
  kind: EdgeKind | "loop";
361
376
  label?: string;
@@ -739,6 +754,37 @@ type TraceFlowProps = BaseComponentProps & TraceFlowSource & {
739
754
  edgeColors?: Partial<TraceFlowEdgeColors>;
740
755
  /** Node click handler — receives the node id. */
741
756
  onNodeClick?: (id: string) => void;
757
+ /**
758
+ * Consumer-supplied xyflow node types. Merged with the built-in
759
+ * `{ stageNode: StageNode }` registry — keys you supply OVERRIDE
760
+ * the default for that node type. Pass `{ stageNode: MyNode }` to
761
+ * replace the default stage renderer entirely, or add new keys
762
+ * for nodes you build yourself (any nodes you push into the
763
+ * graph with `type: 'customKey'` will use your component).
764
+ */
765
+ nodeTypes?: NodeTypes;
766
+ /**
767
+ * Consumer-supplied xyflow edge types. Merged with no built-in
768
+ * defaults — pass `{ myEdge: MyEdge }` to register custom edge
769
+ * components for nodes/edges you build with `type: 'myEdge'`.
770
+ */
771
+ edgeTypes?: EdgeTypes;
772
+ /**
773
+ * Children rendered INSIDE the `<ReactFlow>` element, after the
774
+ * built-in `<Background>`. Use this slot to mount xyflow
775
+ * accessory components like `<Controls />`, `<MiniMap />`, or a
776
+ * custom legend. If unset, only the default Background is rendered.
777
+ *
778
+ * @example
779
+ * ```tsx
780
+ * import { Controls, MiniMap } from '@xyflow/react';
781
+ * <TraceFlow recorder={r}>
782
+ * <Controls />
783
+ * <MiniMap />
784
+ * </TraceFlow>
785
+ * ```
786
+ */
787
+ children?: react.ReactNode;
742
788
  };
743
789
  declare function TraceFlow(props: TraceFlowProps): react_jsx_runtime.JSX.Element;
744
790
 
@@ -774,8 +820,29 @@ interface TracedFlowProps extends BaseComponentProps {
774
820
  * their data panels in lock-step with the chart's drill state.
775
821
  */
776
822
  onSubflowChange?: (mountStageId: string | null) => void;
823
+ /**
824
+ * Consumer-supplied xyflow node types. Merged with the built-in
825
+ * `{ stageNode: StageNode }` registry — keys you supply OVERRIDE
826
+ * the default for that node type. Pass `{ stageNode: MyNode }` to
827
+ * replace the default stage renderer entirely, or add new keys
828
+ * for custom node components you push into the graph.
829
+ */
830
+ nodeTypes?: NodeTypes;
831
+ /**
832
+ * Consumer-supplied xyflow edge types. Merged with no built-in
833
+ * defaults — pass `{ myEdge: MyEdge }` to register custom edge
834
+ * components for edges you push into the graph with `type: 'myEdge'`.
835
+ */
836
+ edgeTypes?: EdgeTypes;
837
+ /**
838
+ * Children rendered INSIDE the `<ReactFlow>` element, after the
839
+ * built-in `<Background>`. Use this slot to mount xyflow
840
+ * accessory components like `<Controls />`, `<MiniMap />`, or a
841
+ * custom legend. If unset, only the default Background is rendered.
842
+ */
843
+ children?: react.ReactNode;
777
844
  }
778
- declare function TracedFlow({ graph, overlay, scrubIndex, layout: layoutProp, colors: colorOverrides, onNodeClick, onSubflowChange, className, style, }: TracedFlowProps): react_jsx_runtime.JSX.Element;
845
+ declare function TracedFlow({ graph, overlay, scrubIndex, layout: layoutProp, colors: colorOverrides, onNodeClick, onSubflowChange, nodeTypes: userNodeTypes, edgeTypes: userEdgeTypes, children, className, style, }: TracedFlowProps): react_jsx_runtime.JSX.Element;
779
846
 
780
847
  /**
781
848
  * createNodeViewRecorder — per-stage summary translator.
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import * as _xyflow_react from '@xyflow/react';
3
- import { Node, Edge } from '@xyflow/react';
3
+ import { Node, Edge, NodeTypes, EdgeTypes } from '@xyflow/react';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
 
6
6
  interface StageNodeData {
@@ -294,8 +294,16 @@ interface MinimalStructureRecorder {
294
294
  onSubflowMounted?(event: SubflowMountedEvent): void;
295
295
  }
296
296
  /**
297
- * Per-node data attached to the xyflow `Node`. Consumed by the
298
- * `StageNode` renderer (shape mirrors what the renderer expects).
297
+ * Per-node data attached to the xyflow `Node`. The built-in `StageNode`
298
+ * renderer reads the named fields below.
299
+ *
300
+ * Consumer extension: this type EXTENDS `Record<string, unknown>` so
301
+ * you can attach custom fields without TypeScript fighting you. Pair
302
+ * this with `<TraceFlow nodeTypes={{ stageNode: MyNode }} />` (or push
303
+ * nodes with `type: 'myCustomKind'`) to render those custom fields
304
+ * however you want. The built-in `StageNode` ignores fields it doesn't
305
+ * recognize, so adding consumer fields is non-breaking even if you
306
+ * keep the default renderer.
299
307
  */
300
308
  interface TraceNodeData extends Record<string, unknown> {
301
309
  label: string;
@@ -355,7 +363,14 @@ interface TraceNodeData extends Record<string, unknown> {
355
363
  prevIds: StageId[];
356
364
  nextIds: StageId[];
357
365
  }
358
- /** Per-edge data attached to the xyflow `Edge`. */
366
+ /**
367
+ * Per-edge data attached to the xyflow `Edge`. The default edge
368
+ * renderer reads `kind` (and `label`).
369
+ *
370
+ * Consumer extension: same pattern as `TraceNodeData` — extra fields
371
+ * pass through unchanged. Pair with `<TraceFlow edgeTypes={...} />`
372
+ * to render custom edges (e.g., a "retried" edge with a count badge).
373
+ */
359
374
  interface TraceEdgeData extends Record<string, unknown> {
360
375
  kind: EdgeKind | "loop";
361
376
  label?: string;
@@ -739,6 +754,37 @@ type TraceFlowProps = BaseComponentProps & TraceFlowSource & {
739
754
  edgeColors?: Partial<TraceFlowEdgeColors>;
740
755
  /** Node click handler — receives the node id. */
741
756
  onNodeClick?: (id: string) => void;
757
+ /**
758
+ * Consumer-supplied xyflow node types. Merged with the built-in
759
+ * `{ stageNode: StageNode }` registry — keys you supply OVERRIDE
760
+ * the default for that node type. Pass `{ stageNode: MyNode }` to
761
+ * replace the default stage renderer entirely, or add new keys
762
+ * for nodes you build yourself (any nodes you push into the
763
+ * graph with `type: 'customKey'` will use your component).
764
+ */
765
+ nodeTypes?: NodeTypes;
766
+ /**
767
+ * Consumer-supplied xyflow edge types. Merged with no built-in
768
+ * defaults — pass `{ myEdge: MyEdge }` to register custom edge
769
+ * components for nodes/edges you build with `type: 'myEdge'`.
770
+ */
771
+ edgeTypes?: EdgeTypes;
772
+ /**
773
+ * Children rendered INSIDE the `<ReactFlow>` element, after the
774
+ * built-in `<Background>`. Use this slot to mount xyflow
775
+ * accessory components like `<Controls />`, `<MiniMap />`, or a
776
+ * custom legend. If unset, only the default Background is rendered.
777
+ *
778
+ * @example
779
+ * ```tsx
780
+ * import { Controls, MiniMap } from '@xyflow/react';
781
+ * <TraceFlow recorder={r}>
782
+ * <Controls />
783
+ * <MiniMap />
784
+ * </TraceFlow>
785
+ * ```
786
+ */
787
+ children?: react.ReactNode;
742
788
  };
743
789
  declare function TraceFlow(props: TraceFlowProps): react_jsx_runtime.JSX.Element;
744
790
 
@@ -774,8 +820,29 @@ interface TracedFlowProps extends BaseComponentProps {
774
820
  * their data panels in lock-step with the chart's drill state.
775
821
  */
776
822
  onSubflowChange?: (mountStageId: string | null) => void;
823
+ /**
824
+ * Consumer-supplied xyflow node types. Merged with the built-in
825
+ * `{ stageNode: StageNode }` registry — keys you supply OVERRIDE
826
+ * the default for that node type. Pass `{ stageNode: MyNode }` to
827
+ * replace the default stage renderer entirely, or add new keys
828
+ * for custom node components you push into the graph.
829
+ */
830
+ nodeTypes?: NodeTypes;
831
+ /**
832
+ * Consumer-supplied xyflow edge types. Merged with no built-in
833
+ * defaults — pass `{ myEdge: MyEdge }` to register custom edge
834
+ * components for edges you push into the graph with `type: 'myEdge'`.
835
+ */
836
+ edgeTypes?: EdgeTypes;
837
+ /**
838
+ * Children rendered INSIDE the `<ReactFlow>` element, after the
839
+ * built-in `<Background>`. Use this slot to mount xyflow
840
+ * accessory components like `<Controls />`, `<MiniMap />`, or a
841
+ * custom legend. If unset, only the default Background is rendered.
842
+ */
843
+ children?: react.ReactNode;
777
844
  }
778
- declare function TracedFlow({ graph, overlay, scrubIndex, layout: layoutProp, colors: colorOverrides, onNodeClick, onSubflowChange, className, style, }: TracedFlowProps): react_jsx_runtime.JSX.Element;
845
+ declare function TracedFlow({ graph, overlay, scrubIndex, layout: layoutProp, colors: colorOverrides, onNodeClick, onSubflowChange, nodeTypes: userNodeTypes, edgeTypes: userEdgeTypes, children, className, style, }: TracedFlowProps): react_jsx_runtime.JSX.Element;
779
846
 
780
847
  /**
781
848
  * createNodeViewRecorder — per-stage summary translator.