@particle-academy/fancy-flow 0.36.0 → 0.37.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.
@@ -0,0 +1,62 @@
1
+ import * as react from 'react';
2
+ import { CSSProperties, ReactNode } from 'react';
3
+ import { F as FlowGraph, b as FlowNode } from './types-sOmpCitB.js';
4
+
5
+ /** Outcome of one node in a run, for annotating the graph after the fact. */
6
+ type FlowNodeStatus = "ok" | "running" | "failed" | "skipped" | "pending";
7
+ interface FlowViewerClassNames {
8
+ root?: string;
9
+ list?: string;
10
+ row?: string;
11
+ rowIndex?: string;
12
+ rowTitle?: string;
13
+ rowDescription?: string;
14
+ rowStatus?: string;
15
+ }
16
+ interface FlowViewerProps {
17
+ /** The graph to show. */
18
+ graph: FlowGraph;
19
+ /**
20
+ * `canvas` draws the graph. `list` renders the nodes as rows — for a docs
21
+ * page, a narrow column, print, or an audit view, where a pan-zoom surface is
22
+ * the wrong shape and often not usable at all.
23
+ */
24
+ variant?: "canvas" | "list";
25
+ /** Canvas height. Ignored by `list`. Default 480. */
26
+ height?: number | string;
27
+ /** Canvas minimap. Default false. */
28
+ showMinimap?: boolean;
29
+ /** Canvas pan/zoom/fit controls. Default true. */
30
+ showControls?: boolean;
31
+ /**
32
+ * Per-node run outcome, keyed by node id. Lets the same component serve
33
+ * "here is the workflow" and "here is what happened on Tuesday".
34
+ */
35
+ statuses?: Record<string, FlowNodeStatus>;
36
+ /** Controlled selection. */
37
+ selectedNodeId?: string | null;
38
+ /** Omit and nothing is clickable — a viewer with no handler is inert. */
39
+ onSelectNode?: (node: FlowNode) => void;
40
+ className?: string;
41
+ classNames?: FlowViewerClassNames;
42
+ style?: CSSProperties;
43
+ /** Rendered when the graph has no nodes. */
44
+ empty?: ReactNode;
45
+ }
46
+ /**
47
+ * FlowViewer — a workflow, read-only.
48
+ *
49
+ * **Read-only by construction, not by configuration.** There is no prop that
50
+ * makes this editable, because a viewer that can be switched into an editor is
51
+ * a viewer somebody eventually switches into an editor by accident. Before this
52
+ * existed the only way to show a flow was `FlowEditor` (the whole editor) or
53
+ * `FlowCanvas` plus four React Flow flags a consumer had to know to pass —
54
+ * assembly, not an affordance, and nothing stopped the next person shipping a
55
+ * fully editable canvas where they wanted a picture.
56
+ *
57
+ * Node titles come from the registry, so `overrideNodeKind()` renames apply
58
+ * here too.
59
+ */
60
+ declare function FlowViewer({ graph, variant, height, showMinimap, showControls, statuses, selectedNodeId, onSelectNode, className, classNames, style, empty, }: FlowViewerProps): react.JSX.Element;
61
+
62
+ export { type FlowNodeStatus as F, FlowViewer as a, type FlowViewerClassNames as b, type FlowViewerProps as c };
@@ -0,0 +1,62 @@
1
+ import * as react from 'react';
2
+ import { CSSProperties, ReactNode } from 'react';
3
+ import { F as FlowGraph, b as FlowNode } from './types-sOmpCitB.cjs';
4
+
5
+ /** Outcome of one node in a run, for annotating the graph after the fact. */
6
+ type FlowNodeStatus = "ok" | "running" | "failed" | "skipped" | "pending";
7
+ interface FlowViewerClassNames {
8
+ root?: string;
9
+ list?: string;
10
+ row?: string;
11
+ rowIndex?: string;
12
+ rowTitle?: string;
13
+ rowDescription?: string;
14
+ rowStatus?: string;
15
+ }
16
+ interface FlowViewerProps {
17
+ /** The graph to show. */
18
+ graph: FlowGraph;
19
+ /**
20
+ * `canvas` draws the graph. `list` renders the nodes as rows — for a docs
21
+ * page, a narrow column, print, or an audit view, where a pan-zoom surface is
22
+ * the wrong shape and often not usable at all.
23
+ */
24
+ variant?: "canvas" | "list";
25
+ /** Canvas height. Ignored by `list`. Default 480. */
26
+ height?: number | string;
27
+ /** Canvas minimap. Default false. */
28
+ showMinimap?: boolean;
29
+ /** Canvas pan/zoom/fit controls. Default true. */
30
+ showControls?: boolean;
31
+ /**
32
+ * Per-node run outcome, keyed by node id. Lets the same component serve
33
+ * "here is the workflow" and "here is what happened on Tuesday".
34
+ */
35
+ statuses?: Record<string, FlowNodeStatus>;
36
+ /** Controlled selection. */
37
+ selectedNodeId?: string | null;
38
+ /** Omit and nothing is clickable — a viewer with no handler is inert. */
39
+ onSelectNode?: (node: FlowNode) => void;
40
+ className?: string;
41
+ classNames?: FlowViewerClassNames;
42
+ style?: CSSProperties;
43
+ /** Rendered when the graph has no nodes. */
44
+ empty?: ReactNode;
45
+ }
46
+ /**
47
+ * FlowViewer — a workflow, read-only.
48
+ *
49
+ * **Read-only by construction, not by configuration.** There is no prop that
50
+ * makes this editable, because a viewer that can be switched into an editor is
51
+ * a viewer somebody eventually switches into an editor by accident. Before this
52
+ * existed the only way to show a flow was `FlowEditor` (the whole editor) or
53
+ * `FlowCanvas` plus four React Flow flags a consumer had to know to pass —
54
+ * assembly, not an affordance, and nothing stopped the next person shipping a
55
+ * fully editable canvas where they wanted a picture.
56
+ *
57
+ * Node titles come from the registry, so `overrideNodeKind()` renames apply
58
+ * here too.
59
+ */
60
+ declare function FlowViewer({ graph, variant, height, showMinimap, showControls, statuses, selectedNodeId, onSelectNode, className, classNames, style, empty, }: FlowViewerProps): react.JSX.Element;
61
+
62
+ export { type FlowNodeStatus as F, FlowViewer as a, type FlowViewerClassNames as b, type FlowViewerProps as c };