@signalsafe/tree-spec-editor-react 0.3.5 → 0.3.7

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/CHANGELOG.md CHANGED
@@ -1,9 +1,13 @@
1
+ # tree-spec-editor-react 0.3.7 — 2026-12-02
2
+
3
+ Render automatic Next links and host-supplied Markdown displays while retaining graph selection and history behavior.
4
+
1
5
  # Changelog
2
6
 
3
- ## 0.3.5 — 2026-11-23
7
+ ## 0.3.6 — unpublished candidate (2026-11-29)
8
+
9
+ Qualify React 18.3.1 and 19.3.1. Commit canvas snapshots after React commits their nodes/edges, mutate history outside state updater callbacks, and retain the compiled loaded tree as the saved baseline. Renderer teardown in tests uses act; all behavioral assertions remain.
4
10
 
5
- - Publish npm releases through GitHub Actions OIDC trusted publishing.
6
- - Document the designated publisher, validation and token retirement process.
7
11
 
8
12
  All notable changes to this project will be documented in this file.
9
13
 
@@ -170,3 +174,7 @@ This is an isolated local candidate; no registry release or host adoption is imp
170
174
  [0.2.0]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.1.3...v0.2.0
171
175
  [0.1.3]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/releases/tag/v0.1.3
172
176
  [0.1.2]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/releases/tag/v0.1.2
177
+
178
+ Prompt nodes use the shared outlined question-bubble icon beside their key, with a Prompt tooltip and accessible label.
179
+
180
+ `renderNodeDisplay(node)` lets a host render sanitized Markdown using its existing content renderer. Choice-free `node` continuations use a separate non-editable Next edge, never a fabricated choice transition.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @signalsafe/tree-spec-editor-react
2
2
 
3
+ Unpublished 0.3.6 candidate: Qualify React 18.3.1 and 19.3.1. Commit canvas snapshots after React commits their nodes/edges, mutate history outside state updater callbacks, and retain the compiled loaded tree as the saved baseline. Renderer teardown in tests uses act; all behavioral assertions remain. No publication or host adoption is implied; local verification uses explicit sealed upstream archives until release-order lockfiles can be regenerated normally.
4
+
3
5
  Current source and planned customer-subdomain impact: [current-state summary](docs/current-release-candidate.md).
4
6
 
5
7
  Headless **React + React Flow** layer for the SignalSafe TreeSpec graph editor: canvas component, orchestration hook, and wiring to `@signalsafe/tree-spec-editor-core`.
@@ -184,3 +186,5 @@ Save failures retain the local graph and saved baseline, clear `saving`, set exi
184
186
  Release `0.3.4` is a compatible maintenance update over published `0.3.3`. It adopts verified current dependencies and reviewed tooling without changing the public authoring model or host responsibilities. React 18 / React Flow 11 support and current read-only/save-failure contracts remain. See [release preparation](./RELEASING.md) for exact quality, artifact and publication gates.
185
187
 
186
188
  See the [current release documentation](docs/current-release-candidate.md) for release-specific compatibility and verification boundaries.
189
+
190
+ `renderNodeDisplay(node)` lets a host render sanitized Markdown using its existing content renderer. Choice-free `node` continuations use a separate non-editable Next edge, never a fabricated choice transition.
@@ -1,3 +1,5 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { EditorNode } from '@signalsafe/tree-spec-editor-core';
1
3
  export type ChoiceDropTarget = {
2
4
  nodeId: string;
3
5
  index: number;
@@ -8,6 +10,7 @@ export type ChoiceDragState = {
8
10
  };
9
11
  export type GraphEditorCanvasContextValue = {
10
12
  readOnly: boolean;
13
+ renderNodeDisplay?: ((node: EditorNode) => ReactNode) | undefined;
11
14
  onDuplicateNode: (nodeId: string) => void;
12
15
  onDeleteNode: (nodeId: string) => void;
13
16
  onResizeNode: (nodeId: string, width: number, height: number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"GraphEditorCanvasContext.d.ts","sourceRoot":"","sources":["../src/GraphEditorCanvasContext.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC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BAAgB,oBAAoB,IAAI,6BAA6B,CAEpE"}
@@ -1,6 +1,8 @@
1
- import { type EditorTree, type GraphSelection, type GraphEditorIssue } from '@signalsafe/tree-spec-editor-core';
1
+ import { type ReactNode } from 'react';
2
+ import { type EditorTree, type EditorNode, type GraphSelection, type GraphEditorIssue } from '@signalsafe/tree-spec-editor-core';
2
3
  export type TreeSpecGraphEditorProps = {
3
4
  tree: EditorTree;
5
+ renderNodeDisplay?: (node: EditorNode) => ReactNode;
4
6
  onChange: (next: EditorTree) => void;
5
7
  issues?: GraphEditorIssue[];
6
8
  showMiniMap?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"TreeSpecGraphEditor.d.ts","sourceRoot":"","sources":["../src/TreeSpecGraphEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAKH,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACxB,MAAM,mCAAmC,CAAC;AAuB3C,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,gGAAgG;IAChG,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,oFAAoF;IACpF,kBAAkB,CAAC,EAAE,CACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,KACd,IAAI,CAAC;IACV,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,+EAA+E;IAC/E,aAAa,CAA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AAc,KAAK,IAAI,CAAC;IACzC,gGAAgG;IAChG,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,oFAAoF;IACpF,kBAAkB,CAAC,EAAE,CACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,KACd,IAAI,CAAC;IACV,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,oEAAoE;IACpE,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC,CAAC;AA+PF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,wBAAwB,CAAC,+BAMpF"}
@@ -19,7 +19,7 @@ import { useCanvasNodeResize } from './hooks/useCanvasNodeResize.js';
19
19
  import { useCanvasViewport } from './hooks/useCanvasViewport.js';
20
20
  import { useChoiceDragDrop } from './hooks/useChoiceDragDrop.js';
21
21
  import { useGraphConnect } from './hooks/useGraphConnect.js';
22
- function TreeSpecGraphInner({ tree, onChange, issues = [], selected, onSelect, onChoiceSelect, onRepositionChoice, focusNodeId, focusChoiceId = null, showMiniMap = true, fitViewNonce, className = EDITOR_CANVAS_ROOT, readOnly = false, onDuplicateNode, onDeleteNode, onAutoLayout, contextualZoom = true, colorMode = 'light', }) {
22
+ function TreeSpecGraphInner({ tree, renderNodeDisplay, onChange, issues = [], selected, onSelect, onChoiceSelect, onRepositionChoice, focusNodeId, focusChoiceId = null, showMiniMap = true, fitViewNonce, className = EDITOR_CANVAS_ROOT, readOnly = false, onDuplicateNode, onDeleteNode, onAutoLayout, contextualZoom = true, colorMode = 'light', }) {
23
23
  const rf = useReactFlow();
24
24
  const treeRef = useRef(tree);
25
25
  treeRef.current = tree;
@@ -89,6 +89,7 @@ function TreeSpecGraphInner({ tree, onChange, issues = [], selected, onSelect, o
89
89
  }, [onSelect]);
90
90
  const canvasContextValue = useMemo(() => ({
91
91
  readOnly,
92
+ renderNodeDisplay,
92
93
  onDuplicateNode: (nodeId) => onDuplicateNode?.(nodeId),
93
94
  onDeleteNode: (nodeId) => onDeleteNode?.(nodeId),
94
95
  onResizeNode: resizeHandlers.handleResizeNode,
@@ -108,6 +109,7 @@ function TreeSpecGraphInner({ tree, onChange, issues = [], selected, onSelect, o
108
109
  onChoiceDrop: handleChoiceDrop,
109
110
  }), [
110
111
  readOnly,
112
+ renderNodeDisplay,
111
113
  onDuplicateNode,
112
114
  onDeleteNode,
113
115
  resizeHandlers.handleResizeNode,
@@ -1 +1 @@
1
- {"version":3,"file":"edgeBuilders.d.ts","sourceRoot":"","sources":["../../src/canvas/edgeBuilders.ts"],"names":[],"mappings":"AACA,OAAO,EAOH,KAAK,UAAU,EACf,KAAK,gBAAgB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAQtC,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,gBAAgB,GAAG,MAAM,CASpF;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,CA0BlE;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAgBzG"}
1
+ {"version":3,"file":"edgeBuilders.d.ts","sourceRoot":"","sources":["../../src/canvas/edgeBuilders.ts"],"names":[],"mappings":"AACA,OAAO,EAOH,KAAK,UAAU,EACf,KAAK,gBAAgB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAQtC,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,gBAAgB,GAAG,MAAM,CASpF;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,CAgClE;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAgBzG"}
@@ -13,7 +13,7 @@ export function edgeLabelForTransition(tree, t) {
13
13
  return base;
14
14
  }
15
15
  export function buildEdgesFromTransitions(tree) {
16
- return tree.transitions.map((t) => {
16
+ const edges = tree.transitions.map((t) => {
17
17
  const node = tree.nodes[t.fromNodeId];
18
18
  const choice = node?.choices?.find((c) => c.id === t.fromChoiceId);
19
19
  const showLabel = choice ? shouldShowEdgeLabel(choice) : true;
@@ -37,11 +37,18 @@ export function buildEdgesFromTransitions(tree) {
37
37
  style,
38
38
  };
39
39
  });
40
+ for (const node of Object.values(tree.nodes)) {
41
+ if (node.type !== 'node' || !node.next || !Object.prototype.hasOwnProperty.call(tree.nodes, node.next))
42
+ continue;
43
+ const style = buildEdgeStyle(undefined);
44
+ edges.push({ id: `automatic:${node.id}`, source: node.id, target: node.next, sourceHandle: 'automatic', targetHandle: TARGET_HANDLE_ID, label: 'Next', focusable: false, deletable: false, reconnectable: false, type: resolveDefaultEdgeType(tree._meta), style: { ...style, pointerEvents: 'none' }, markerEnd: buildEdgeMarker(resolveEdgePathStroke(style)) });
45
+ }
46
+ return edges;
40
47
  }
41
48
  export function buildTransitionsFromEdges(edges, existing) {
42
49
  const existingById = new Map(existing.map((t) => [t.id, t]));
43
50
  return edges
44
- .filter((e) => e.source && e.target && e.source !== END_NODE_ID)
51
+ .filter((e) => e.source && e.target && e.source !== END_NODE_ID && e.sourceHandle !== 'automatic')
45
52
  .map((e) => {
46
53
  const fromChoiceId = choiceIdFromHandle(e.sourceHandle);
47
54
  const prior = existingById.get(String(e.id));
@@ -1 +1 @@
1
- {"version":3,"file":"useCanvasGraphState.d.ts","sourceRoot":"","sources":["../../src/hooks/useCanvasGraphState.ts"],"names":[],"mappings":"AACA,OAAO,EAGH,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,QAAQ,EAChB,MAAM,WAAW,CAAC;AAEnB,OAAO,EASH,KAAK,UAAU,EACf,KAAK,gBAAgB,EAGxB,MAAM,mCAAmC,CAAC;AAM3C,MAAM,MAAM,0BAA0B,GAAG;IACrC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7F,QAAQ,EAAE,OAAO,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/C,uBAAuB,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAC5D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CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/C,uBAAuB,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,oBAAoB,EAAE,aAAa,CAAC;IACpC,oBAAoB,EAAE,aAAa,CAAC;IACpC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IACxE,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,yBAAyB,CA8KlG"}
@@ -6,6 +6,7 @@ import { NODE_DRAG_HANDLE_SELECTOR } from '../canvas/constants.js';
6
6
  export function useCanvasGraphState(options) {
7
7
  const { tree, onChange, issues, issuesByNode, readOnly, resizeHeightByNodeId, isResizingRef, suppressViewportSaveRef, } = options;
8
8
  const isDraggingRef = useRef(false);
9
+ const pendingCommitRef = useRef(false);
9
10
  const nodesRef = useRef([]);
10
11
  const edgesRef = useRef([]);
11
12
  const treeRef = useRef(tree);
@@ -59,12 +60,6 @@ export function useCanvasGraphState(options) {
59
60
  const initialEdges = useMemo(() => buildEdgesFromTransitions(tree), [tree]);
60
61
  const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
61
62
  const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
62
- useEffect(() => {
63
- nodesRef.current = nodes;
64
- }, [nodes]);
65
- useEffect(() => {
66
- edgesRef.current = edges;
67
- }, [edges]);
68
63
  const lastTreeRef = useRef('');
69
64
  useEffect(() => {
70
65
  const nextKey = JSON.stringify({ tree, issues: issues.length });
@@ -107,13 +102,20 @@ export function useCanvasGraphState(options) {
107
102
  }
108
103
  onChange(nextTree);
109
104
  }, [tree, onChange]);
105
+ useEffect(() => {
106
+ nodesRef.current = nodes;
107
+ edgesRef.current = edges;
108
+ if (!pendingCommitRef.current)
109
+ return;
110
+ pendingCommitRef.current = false;
111
+ commit(nodes, edges);
112
+ }, [nodes, edges, commit]);
110
113
  const onMoveEnd = useCallback((_event, viewport) => {
111
114
  if (suppressViewportSaveRef.current)
112
115
  return;
113
116
  onChange(patchGraphEditorMeta(tree, { viewport }));
114
117
  }, [tree, onChange, suppressViewportSaveRef]);
115
118
  const onNodesChangeWrapped = useCallback((changes) => {
116
- onNodesChange(changes);
117
119
  const shouldCommit = changes.some((c) => {
118
120
  if (c?.type === 'select' || c?.type === 'dimensions')
119
121
  return false;
@@ -122,14 +124,15 @@ export function useCanvasGraphState(options) {
122
124
  return true;
123
125
  });
124
126
  if (shouldCommit)
125
- queueMicrotask(() => commit(nodesRef.current, edgesRef.current));
126
- }, [onNodesChange, commit]);
127
+ pendingCommitRef.current = true;
128
+ onNodesChange(changes);
129
+ }, [onNodesChange]);
127
130
  const onEdgesChangeWrapped = useCallback((changes) => {
128
- onEdgesChange(changes);
129
131
  const shouldCommit = changes.some((c) => c?.type !== 'select');
130
132
  if (shouldCommit)
131
- queueMicrotask(() => commit(nodesRef.current, edgesRef.current));
132
- }, [onEdgesChange, commit]);
133
+ pendingCommitRef.current = true;
134
+ onEdgesChange(changes);
135
+ }, [onEdgesChange]);
133
136
  const onNodeDragStart = useCallback(() => {
134
137
  isDraggingRef.current = true;
135
138
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"useEditorAdapter.d.ts","sourceRoot":"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EAAE,CAAC;IAC7B,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,SAAS,EAAE,oBAAoB,EAAE,CAAC;IAClC,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACtC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,wBAAwB,CAAC,UAAU,CAAC,CAAC;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,wBAAwB,CAAC,WAAW,CAAC,CAAC;IACjD,cAAc,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;IAC3D,eAAe,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;IAC7D,YAAY,EAAE,wBAAwB,CAAC,cAAc,CAAC,CAAC;IACvD,WAAW,EAAE,SAAS,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7D,YAAY,EAAE,SAAS,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC,CAAC;CAClE,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,uBAAuB,GAAG,sBAAsB,CA2UhG"}
@@ -59,7 +59,7 @@ export function useEditorAdapter(adapterOptions) {
59
59
  void validateRef.current(spec);
60
60
  });
61
61
  }
62
- lastSavedKeyRef.current = JSON.stringify(spec);
62
+ lastSavedKeyRef.current = JSON.stringify(compileTreeSpec(nextTree));
63
63
  setAutosaveStatus(AUTOSAVE_STATUS.IDLE);
64
64
  }
65
65
  }
@@ -239,8 +239,9 @@ export function useEditorAdapter(adapterOptions) {
239
239
  const spec = coerceRawSpec(rawSpec);
240
240
  if (spec != null) {
241
241
  setRawTreeSpec(spec);
242
- replaceTreeWithoutHistory(decompileTreeSpec(spec));
243
- lastSavedKeyRef.current = JSON.stringify(spec);
242
+ const nextTree = decompileTreeSpec(spec);
243
+ replaceTreeWithoutHistory(nextTree);
244
+ lastSavedKeyRef.current = JSON.stringify(compileTreeSpec(nextTree));
244
245
  setAutosaveStatus(AUTOSAVE_STATUS.IDLE);
245
246
  }
246
247
  setShowDraftHistory(false);
@@ -1 +1 @@
1
- {"version":3,"file":"useEditorHistory.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorHistory.ts"],"names":[],"mappings":"AAEA,OAAO,EAaH,KAAK,UAAU,EACf,KAAK,cAAc,EACtB,MAAM,mCAAmC,CAAC;AAE3C,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,yBAAyB,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,gBAAgB,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,OAAO,CAAC;IACrD,eAAe,EAAE,CACjB,YAAY,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,EAC5C,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,KAC1C,OAAO,CAAC;IACb,iBAAiB,EAAE,CACf,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,CAA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B,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,UAAQ,GAAG,sBAAsB,CA6H/F"}
@@ -2,6 +2,7 @@ import { useCallback, useRef, useState } from 'react';
2
2
  import { canRedoEditorHistory, canUndoEditorHistory, clearEditorHistory, createEditorHistoryStack, duplicateNode, editorTreesEqual, END_NODE_ID, GRAPH_SELECTION_KIND, popEditorRedo, popEditorUndo, pushEditorHistory, } from '@signalsafe/tree-spec-editor-core';
3
3
  export function useEditorHistory(isPublished, readOnly = false) {
4
4
  const [tree, setTree] = useState(null);
5
+ const treeRef = useRef(null);
5
6
  const historyRef = useRef(createEditorHistoryStack());
6
7
  const copiedNodeIdRef = useRef(null);
7
8
  const [canUndo, setCanUndo] = useState(false);
@@ -21,40 +22,45 @@ export function useEditorHistory(isPublished, readOnly = false) {
21
22
  const commitTree = useCallback((next) => {
22
23
  if (readOnly)
23
24
  return;
24
- setTree((prev) => {
25
- if (prev && next && !editorTreesEqual(prev, next)) {
26
- pushEditorHistory(historyRef.current, prev);
27
- }
28
- return next;
29
- });
30
- queueMicrotask(syncHistoryMeta);
25
+ const previous = treeRef.current;
26
+ if (previous && next && !editorTreesEqual(previous, next)) {
27
+ pushEditorHistory(historyRef.current, previous);
28
+ }
29
+ treeRef.current = next;
30
+ setTree(next);
31
+ syncHistoryMeta();
31
32
  }, [syncHistoryMeta, readOnly]);
32
33
  const replaceTreeWithoutHistory = useCallback((next) => {
33
34
  resetEditorHistory();
35
+ treeRef.current = next;
34
36
  setTree(next);
35
37
  }, [resetEditorHistory]);
36
38
  const undo = useCallback(() => {
37
- if (!tree || isPublished || readOnly)
39
+ const current = treeRef.current;
40
+ if (!current || isPublished || readOnly)
38
41
  return false;
39
- const result = popEditorUndo(historyRef.current, tree);
42
+ const result = popEditorUndo(historyRef.current, current);
40
43
  if (!result)
41
44
  return false;
42
45
  historyRef.current.future.unshift(result.currentSnapshot);
46
+ treeRef.current = result.nextTree;
43
47
  setTree(result.nextTree);
44
- queueMicrotask(syncHistoryMeta);
48
+ syncHistoryMeta();
45
49
  return true;
46
- }, [tree, isPublished, readOnly, syncHistoryMeta]);
50
+ }, [isPublished, readOnly, syncHistoryMeta]);
47
51
  const redo = useCallback(() => {
48
- if (!tree || isPublished || readOnly)
52
+ const current = treeRef.current;
53
+ if (!current || isPublished || readOnly)
49
54
  return false;
50
- const result = popEditorRedo(historyRef.current, tree);
55
+ const result = popEditorRedo(historyRef.current, current);
51
56
  if (!result)
52
57
  return false;
53
58
  historyRef.current.past.push(result.currentSnapshot);
59
+ treeRef.current = result.nextTree;
54
60
  setTree(result.nextTree);
55
- queueMicrotask(syncHistoryMeta);
61
+ syncHistoryMeta();
56
62
  return true;
57
- }, [tree, isPublished, readOnly, syncHistoryMeta]);
63
+ }, [isPublished, readOnly, syncHistoryMeta]);
58
64
  const copySelectedNode = useCallback((selection) => {
59
65
  if (selection.kind !== GRAPH_SELECTION_KIND.NODE || !selection.id)
60
66
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"PromptNode.d.ts","sourceRoot":"","sources":["../../src/nodes/PromptNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyD,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAoClG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,KAAK,eAAe,GAAG,QAAQ,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;AAE3D,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,eAAe,+BA6GjE"}
1
+ {"version":3,"file":"PromptNode.d.ts","sourceRoot":"","sources":["../../src/nodes/PromptNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyD,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAoClG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,KAAK,eAAe,GAAG,QAAQ,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;AAE3D,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,eAAe,+BA8GjE"}
@@ -13,7 +13,7 @@ export function PromptNode({ data, selected, id }) {
13
13
  const n = data.node;
14
14
  const choices = n.choices ?? [];
15
15
  const updateNodeInternals = useUpdateNodeInternals();
16
- const { readOnly, onDuplicateNode, onDeleteNode, onResizeNode, onResizeNodeStart, choiceDrag, choiceDropTarget, onChoiceDragOver, onChoiceDrop } = useGraphEditorCanvas();
16
+ const { readOnly, renderNodeDisplay, onDuplicateNode, onDeleteNode, onResizeNode, onResizeNodeStart, choiceDrag, choiceDropTarget, onChoiceDragOver, onChoiceDrop } = useGraphEditorCanvas();
17
17
  const hasErrors = data.issuesErrors > 0;
18
18
  const borderClass = getPromptNodeBorderClass(hasErrors, data.issuesWarnings);
19
19
  const focusChoiceId = data.focusChoiceId ?? null;
@@ -39,7 +39,7 @@ export function PromptNode({ data, selected, id }) {
39
39
  : undefined;
40
40
  useEffect(() => {
41
41
  updateNodeInternals(id);
42
- }, [id, choices.length, editor.height, editor.width, updateNodeInternals]);
42
+ }, [id, n.type, n.prompt, choices.length, editor.height, editor.width, updateNodeInternals]);
43
43
  const handleResize = useCallback(() => {
44
44
  updateNodeInternals(id);
45
45
  }, [id, updateNodeInternals]);
@@ -47,5 +47,5 @@ export function PromptNode({ data, selected, id }) {
47
47
  onResizeNodeStart(id, params.width, params.height);
48
48
  }, onResize: handleResize, onResizeEnd: (_event, params) => {
49
49
  onResizeNode(id, params.width, params.height);
50
- } })) : null, _jsxs("div", { className: joinClasses(CANVAS_NODE_CARD_CLASS, borderClass, showNodeHighlight && CANVAS_NODE_SELECTED_CLASS, showNodeHighlight && CANVAS_NODE_SELECTED_TEXT_CLASS), style: cardStyle, children: [_jsx(Handle, { type: "target", position: Position.Left, id: TARGET_HANDLE_ID, className: TARGET_HANDLE_CLASS_DEFAULT }), _jsx(PromptNodeHeader, { node: n, data: data, editor: editor, locked: locked, readOnly: readOnly }), _jsxs("div", { className: joinClasses(CANVAS_NODE_BODY_CLASS, EDITOR_MIN_W_0), style: scrollBodyStyle, children: [_jsx("div", { className: joinClasses(EDITOR_CARD_BODY, EDITOR_SPACING_PY_2, EDITOR_SPACING_PX_2, EDITOR_MIN_W_0, 'nodrag'), children: _jsx("div", { className: joinClasses(EDITOR_TEXT_SM, EDITOR_SPACING_MB_0, promptTextClass), title: n.prompt || undefined, children: n.prompt || _jsx("em", { className: EDITOR_MUTED, children: "(empty prompt)" }) }) }), _jsx(PromptNodeChoicesList, { nodeId: id, choices: choices, focusChoiceId: focusChoiceId, choiceTextClass: choiceTextClass, readOnly: readOnly, choiceDrag: choiceDrag, choiceDropTarget: choiceDropTarget, onChoiceDragOver: onChoiceDragOver, onChoiceDrop: onChoiceDrop })] })] })] }));
50
+ } })) : null, _jsxs("div", { className: joinClasses(CANVAS_NODE_CARD_CLASS, borderClass, showNodeHighlight && CANVAS_NODE_SELECTED_CLASS, showNodeHighlight && CANVAS_NODE_SELECTED_TEXT_CLASS), style: cardStyle, children: [_jsx(Handle, { type: "target", position: Position.Left, id: TARGET_HANDLE_ID, className: TARGET_HANDLE_CLASS_DEFAULT }), n.type === 'node' ? _jsx(Handle, { type: "source", position: Position.Right, id: "automatic", isConnectable: false }) : null, _jsx(PromptNodeHeader, { node: n, data: data, editor: editor, locked: locked, readOnly: readOnly }), _jsxs("div", { className: joinClasses(CANVAS_NODE_BODY_CLASS, EDITOR_MIN_W_0), style: scrollBodyStyle, children: [_jsx("div", { className: joinClasses(EDITOR_CARD_BODY, EDITOR_SPACING_PY_2, EDITOR_SPACING_PX_2, EDITOR_MIN_W_0, 'nodrag'), children: _jsx("div", { className: joinClasses(EDITOR_TEXT_SM, EDITOR_SPACING_MB_0, promptTextClass), title: n.prompt || undefined, children: renderNodeDisplay ? renderNodeDisplay(n) : n.prompt || _jsx("em", { className: EDITOR_MUTED, children: "(empty prompt)" }) }) }), n.type !== 'node' ? _jsx(PromptNodeChoicesList, { nodeId: id, choices: choices, focusChoiceId: focusChoiceId, choiceTextClass: choiceTextClass, readOnly: readOnly, choiceDrag: choiceDrag, choiceDropTarget: choiceDropTarget, onChoiceDragOver: onChoiceDragOver, onChoiceDrop: onChoiceDrop }) : null] })] })] }));
51
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PromptNodeHeader.d.ts","sourceRoot":"","sources":["../../src/nodes/PromptNodeHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAyBpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,wBAAgB,gBAAgB,CAAC,EAC7B,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,EACN,QAAQ,GACX,EAAE,QAAQ,CAAC;IACR,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC1C,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC,+BA2DD"}
1
+ {"version":3,"file":"PromptNodeHeader.d.ts","sourceRoot":"","sources":["../../src/nodes/PromptNodeHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AA0BpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,wBAAgB,gBAAgB,CAAC,EAC7B,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,EACN,QAAQ,GACX,EAAE,QAAQ,CAAC;IACR,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC1C,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC,+BA4DD"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { NODE_DRAG_HANDLE_CLASS } from '../canvas/constants.js';
3
- import { EDITOR_CARD_HEADER_MUTED, EDITOR_FLEX_ALIGN_START, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_GROW_1, EDITOR_FLEX_ROW, EDITOR_FLEX_SHRINK_0, EDITOR_ICON, EDITOR_MIN_W_0, EDITOR_MUTED, EDITOR_OVERFLOW_HIDDEN, EDITOR_SPACING_GAP_1, EDITOR_SPACING_GAP_2, EDITOR_SPACING_MS_1, EDITOR_SPACING_PX_2, EDITOR_SPACING_PY_2, EDITOR_TEXT_BOLD, EDITOR_TEXT_MD, EDITOR_TEXT_XS, joinClasses, } from '../ui/editorClasses.js';
3
+ import { EDITOR_CARD_HEADER_MUTED, EDITOR_FLEX_ALIGN_START, EDITOR_FLEX_BETWEEN, EDITOR_FLEX_GROW_1, EDITOR_FLEX_ROW, EDITOR_FLEX_SHRINK_0, EDITOR_ICON, EDITOR_PROMPT_ICON, EDITOR_MIN_W_0, EDITOR_MUTED, EDITOR_OVERFLOW_HIDDEN, EDITOR_SPACING_GAP_1, EDITOR_SPACING_GAP_2, EDITOR_SPACING_MS_1, EDITOR_SPACING_PX_2, EDITOR_SPACING_PY_2, EDITOR_TEXT_BOLD, EDITOR_TEXT_MD, EDITOR_TEXT_XS, joinClasses, } from '../ui/editorClasses.js';
4
4
  import { PromptNodeIssueBadges } from './PromptNodeIssueBadges.js';
5
5
  export function PromptNodeHeader({ node, data, editor, locked, readOnly, }) {
6
- return (_jsx("div", { className: joinClasses(EDITOR_CARD_HEADER_MUTED, EDITOR_SPACING_PY_2, EDITOR_SPACING_PX_2, EDITOR_MIN_W_0, EDITOR_FLEX_SHRINK_0), children: _jsxs("div", { className: joinClasses(EDITOR_FLEX_BETWEEN, EDITOR_FLEX_ALIGN_START, EDITOR_SPACING_GAP_2, EDITOR_MIN_W_0), children: [_jsxs("div", { className: joinClasses(EDITOR_FLEX_ROW, EDITOR_FLEX_ALIGN_START, EDITOR_SPACING_GAP_1, EDITOR_MIN_W_0, EDITOR_FLEX_GROW_1, EDITOR_OVERFLOW_HIDDEN), children: [locked || readOnly ? null : (_jsx("span", { className: joinClasses(NODE_DRAG_HANDLE_CLASS, EDITOR_FLEX_SHRINK_0), title: "Drag node", "aria-label": "Drag node", children: _jsx("span", { className: joinClasses(EDITOR_ICON, 'graph-editor-icon--grip'), "aria-hidden": true, children: "\u22EE\u22EE" }) })), _jsx("div", { className: joinClasses(EDITOR_MIN_W_0, EDITOR_FLEX_GROW_1, EDITOR_OVERFLOW_HIDDEN), children: _jsxs("div", { className: joinClasses(EDITOR_TEXT_BOLD, EDITOR_TEXT_MD), children: [data.isStart ? '▶ ' : '', node.type, editor.locked ? (_jsx("span", { className: joinClasses(EDITOR_ICON, 'graph-editor-icon--lock', EDITOR_SPACING_MS_1), title: "Locked", "aria-hidden": true, children: "\uD83D\uDD12" })) : null, _jsx(PromptNodeIssueBadges, { issuesTotal: data.issuesTotal, issuesErrors: data.issuesErrors, issuesWarnings: data.issuesWarnings, issuesInfo: data.issuesInfo })] }) })] }), _jsx("div", { className: joinClasses(EDITOR_MUTED, EDITOR_TEXT_XS, EDITOR_FLEX_SHRINK_0), children: node.id.slice(0, 8) })] }) }));
6
+ return (_jsx("div", { className: joinClasses(EDITOR_CARD_HEADER_MUTED, EDITOR_SPACING_PY_2, EDITOR_SPACING_PX_2, EDITOR_MIN_W_0, EDITOR_FLEX_SHRINK_0), children: _jsxs("div", { className: joinClasses(EDITOR_FLEX_BETWEEN, EDITOR_FLEX_ALIGN_START, EDITOR_SPACING_GAP_2, EDITOR_MIN_W_0), children: [_jsxs("div", { className: joinClasses(EDITOR_FLEX_ROW, EDITOR_FLEX_ALIGN_START, EDITOR_SPACING_GAP_1, EDITOR_MIN_W_0, EDITOR_FLEX_GROW_1, EDITOR_OVERFLOW_HIDDEN), children: [locked || readOnly ? null : (_jsx("span", { className: joinClasses(NODE_DRAG_HANDLE_CLASS, EDITOR_FLEX_SHRINK_0), title: "Drag node", "aria-label": "Drag node", children: _jsx("span", { className: joinClasses(EDITOR_ICON, 'graph-editor-icon--grip'), "aria-hidden": true, children: "\u22EE\u22EE" }) })), _jsx("div", { className: joinClasses(EDITOR_MIN_W_0, EDITOR_FLEX_GROW_1, EDITOR_OVERFLOW_HIDDEN), children: _jsxs("div", { className: joinClasses(EDITOR_TEXT_BOLD, EDITOR_TEXT_MD), children: [data.isStart ? _jsx("span", { role: "img", "aria-label": "Start node", title: "Start node", children: "\u2605 " }) : null, node.type === 'prompt' ? _jsx("span", { className: EDITOR_PROMPT_ICON, role: "img", "aria-label": "Prompt", title: "Prompt" }) : null, node.id, editor.locked ? (_jsx("span", { className: joinClasses(EDITOR_ICON, 'graph-editor-icon--lock', EDITOR_SPACING_MS_1), title: "Locked", "aria-hidden": true, children: "\uD83D\uDD12" })) : null, _jsx(PromptNodeIssueBadges, { issuesTotal: data.issuesTotal, issuesErrors: data.issuesErrors, issuesWarnings: data.issuesWarnings, issuesInfo: data.issuesInfo })] }) })] }), node.type !== 'prompt' ? _jsx("div", { className: joinClasses(EDITOR_MUTED, EDITOR_TEXT_XS, EDITOR_FLEX_SHRINK_0), children: node.type }) : null] }) }));
7
7
  }
@@ -50,4 +50,5 @@ export declare const EDITOR_CANVAS_ROOT = "graph-editor-canvas-root";
50
50
  export declare function editorBtnToneClass(variant?: string): string;
51
51
  export declare function editorBadgeToneClass(variant: 'danger' | 'warning' | 'info' | 'neutral'): string;
52
52
  export declare function editorDropdownItemClass(danger?: boolean): string;
53
+ export declare const EDITOR_PROMPT_ICON = "graph-editor-icon--prompt";
53
54
  //# sourceMappingURL=editorClasses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editorClasses.d.ts","sourceRoot":"","sources":["../../src/ui/editorClasses.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EA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BAAmB,+BAA+B,CAAC;AAChE,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAC9D,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAChE,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAChE,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAChE,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAChE,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,eAAO,MAAM,cAAc,yBAAyB,CAAC;AACrD,eAAO,MAAM,cAAc,yBAAyB,CAAC;AACrD,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAE/C,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAE/F;AAED,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAEhE;AAYD,eAAO,MAAM,kBAAkB,8BAA8B,CAAC"}
@@ -67,3 +67,4 @@ function normalizeBtnTone(variant) {
67
67
  };
68
68
  return map[variant] ?? variant.replace(/^outline-/, '');
69
69
  }
70
+ export const EDITOR_PROMPT_ICON = 'graph-editor-icon--prompt';
@@ -1,4 +1,18 @@
1
- # Release candidate: @signalsafe/tree-spec-editor-react 0.3.4
1
+ # Release candidate: @signalsafe/tree-spec-editor-react 0.3.6
2
+
3
+ The qualified React 18/19 hooks preserve synchronous history authority, batched undo/redo order and autosave identity boundaries. The coordinated dependency minimums match the reviewed learning-package integration.
4
+
5
+ Normal published registry dependencies and genuine frozen locks are required before this candidate is tagged. Hosted CI, Sonar, packed-consumer checks and the exact archive gate remain enforced. The existing OIDC publisher is preserved; this release does not deploy a website or gallery.
6
+
7
+ See [RELEASING.md](../RELEASING.md) for publisher and protected-branch requirements. Registry availability is established only by successful publication and downloaded-archive verification.
8
+
9
+ ## Historical release and state record
10
+
11
+
12
+ The previous snapshot below is retained for context; its version and publication
13
+ status statements apply to that earlier snapshot.
14
+
15
+ ### Release candidate: @signalsafe/tree-spec-editor-react 0.3.4
2
16
 
3
17
  The published baseline is 0.3.3. Reconcile reviewed Vite and Playwright updates, regenerate the exact graph example SVG, and adopt verified current TreeSpec/editor-core maintenance dependencies. Existing public exports and runtime behavior remain compatible. The source was reconciled with current remote refactors and additional regression tests while preserving original uncommitted work separately.
4
18
 
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <!-- Generated by docs/demo/generate-doc-images.mjs. Do not edit by hand. -->
3
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1400" height="840" viewBox="0 0 1400 840" data-tree-spec-demo-source-hash="0d085cd14190dff70461f45f1cdf06e7bef210b1ffe08ae9d1da5687ec9054fc">
3
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1400" height="840" viewBox="0 0 1400 840" data-tree-spec-demo-source-hash="53066346676033a18fc14f65b72762ffba876af286ed917664661395ca0f49c5">
4
4
  <title>TreeSpec editor incident response example</title>
5
5
  <foreignObject x="0" y="0" width="1400" height="840">
6
6
  <div xmlns="http://www.w3.org/1999/xhtml">
@@ -708,7 +708,7 @@ body {
708
708
  .docs-preview .react-flow__controls {
709
709
  display: none;
710
710
  }</style>
711
- <main class="docs-preview" id="editor-preview"><header class="docs-preview__header"><div><div class="docs-preview__eyebrow">TreeSpec editor</div><h1>Incident response decision tree</h1></div><div class="docs-preview__status">Read-only example</div></header><p class="docs-preview__description">Generated from the exported <code>TreeSpecGraphEditor</code> with the editor model and live example data.</p><section class="docs-preview__canvas" aria-label="TreeSpec editor graph"><div class="graph-editor-canvas-root graph-editor-canvas" data-color-mode="light"><div class="react-flow" data-testid="rf__wrapper" style="width: 100%; height: 100%; overflow: hidden; position: relative; z-index: 0;"><div class="react-flow__renderer" style="position: absolute; width: 100%; height: 100%; top: 0px; left: 0px;"><div class="react-flow__pane" style="position: absolute; width: 100%; height: 100%; top: 0px; left: 0px;"><div class="react-flow__viewport react-flow__container" style="transform: translate(36px, 72px) scale(0.82);"><svg xmlns="http://www.w3.org/2000/svg" width="1322" height="668" class="react-flow__edges react-flow__container" style="z-index: 0;"><defs><marker class="react-flow__arrowhead" id="1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16" markerWidth="16" markerHeight="16" viewBox="-10 -10 20 20" markerUnits="strokeWidth" orient="auto-start-reverse" refX="0" refY="0"><polyline stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4" style="stroke: rgb(177, 177, 183); fill: rgb(177, 177, 183); stroke-width: 1;"></polyline></marker></defs><g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-triage-investigate" aria-label="Edge from triage to investigate" aria-describedby="react-flow__edge-desc-1"><path d="M324.00000818764295 172.49998436904536L344.00000818764295 172.49998436904536L 385.0000048381527,172.49998436904536Q 390.0000048381527,172.49998436904536 390.0000048381527,177.49998436904536L 390.0000048381527,227.5000029773247Q 390.0000048381527,232.5000029773247 395.0000048381527,232.5000029773247L436.00000148866235 232.5000029773247L456.00000148866235 232.5000029773247" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M324.00000818764295 172.49998436904536L344.00000818764295 172.49998436904536L 385.0000048381527,172.49998436904536Q 390.0000048381527,172.49998436904536 390.0000048381527,177.49998436904536L 390.0000048381527,227.5000029773247Q 390.0000048381527,232.5000029773247 395.0000048381527,232.5000029773247L436.00000148866235 232.5000029773247L456.00000148866235 232.5000029773247" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(265.0468798381527 196.49999367318503)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="253.90625" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Investigate the email headers and isolate the device</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="446.00000148866235" cy="232.5000029773247" r="10" stroke="transparent" fill="transparent"></circle></g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-triage-dismiss" aria-label="Edge from triage to END" aria-describedby="react-flow__edge-desc-1"><path d="M324.00000818764295 172.49998436904536L344.00000818764295 172.49998436904536L 804.9999862298732,172.49998436904536Q 809.9999862298732,172.49998436904536 809.9999862298732,167.49998436904536L 809.9999862298732,119.49998362471418Q 809.9999862298732,114.49998362471418 814.9999862298732,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M324.00000818764295 172.49998436904536L344.00000818764295 172.49998436904536L 804.9999862298732,172.49998436904536Q 809.9999862298732,172.49998436904536 809.9999862298732,167.49998436904536L 809.9999862298732,119.49998362471418Q 809.9999862298732,114.49998362471418 814.9999862298732,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(646.1249862298732 137.49998399687976)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="331.75" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Assume it is harmless and dismiss the report → END (compromised)</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="1285.9999642721036" cy="114.49998362471418" r="10" stroke="transparent" fill="transparent"></circle></g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-investigate-escalate" aria-label="Edge from investigate to recovery" aria-describedby="react-flow__edge-desc-1"><path d="M743.9999895793635 232.5000029773247L763.9999895793635 232.5000029773247L 805.0000141422922,232.5000029773247Q 810.0000141422922,232.5000029773247 810.0000141422922,237.5000029773247L 810.0000141422922,242.49997320407775Q 810.0000141422922,247.49997320407775 815.0000141422922,247.49997320407775L856.0000387052211 247.49997320407775L876.0000387052211 247.49997320407775" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M743.9999895793635 232.5000029773247L763.9999895793635 232.5000029773247L 805.0000141422922,232.5000029773247Q 810.0000141422922,232.5000029773247 810.0000141422922,237.5000029773247L 810.0000141422922,242.49997320407775Q 810.0000141422922,247.49997320407775 815.0000141422922,247.49997320407775L856.0000387052211 247.49997320407775L876.0000387052211 247.49997320407775" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(682.8672016422922 233.9999880907012)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="258.265625" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Escalate to incident response and preserve evidence</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="866.0000387052211" cy="247.49997320407775" r="10" stroke="transparent" fill="transparent"></circle></g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-investigate-reimage" aria-label="Edge from investigate to END" aria-describedby="react-flow__edge-desc-1"><path d="M743.9999895793635 232.5000029773247L763.9999895793635 232.5000029773247L 1014.9999769257336,232.5000029773247Q 1019.9999769257336,232.5000029773247 1019.9999769257336,227.5000029773247L 1019.9999769257336,119.49998362471418Q 1019.9999769257336,114.49998362471418 1024.9999769257336,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M743.9999895793635 232.5000029773247L763.9999895793635 232.5000029773247L 1014.9999769257336,232.5000029773247Q 1019.9999769257336,232.5000029773247 1019.9999769257336,227.5000029773247L 1019.9999769257336,119.49998362471418Q 1019.9999769257336,114.49998362471418 1024.9999769257336,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(861.2499769257336 167.49999330101943)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="321.5" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Reimage immediately without collecting evidence → END (at_risk)</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="1285.9999642721036" cy="114.49998362471418" r="10" stroke="transparent" fill="transparent"></circle></g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-recovery-close" aria-label="Edge from recovery to END" aria-describedby="react-flow__edge-desc-1"><path d="M1164.0001012290397 247.49997320407775L1184.0001012290397 247.49997320407775L 1225.0000327505718,247.49997320407775Q 1230.0000327505718,247.49997320407775 1230.0000327505718,242.49997320407775L 1230.0000327505718,119.49998362471418Q 1230.0000327505718,114.49998362471418 1235.0000327505718,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M1164.0001012290397 247.49997320407775L1184.0001012290397 247.49997320407775L 1225.0000327505718,247.49997320407775Q 1230.0000327505718,247.49997320407775 1230.0000327505718,242.49997320407775L 1230.0000327505718,119.49998362471418Q 1230.0000327505718,114.49998362471418 1235.0000327505718,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(1162.0703452505718 174.99997841439597)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="139.859375" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Close incident → END (safe)</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="1285.9999642721036" cy="114.49998362471418" r="10" stroke="transparent" fill="transparent"></circle></g></g></svg><div class="react-flow__edgelabel-renderer"></div><div class="react-flow__nodes" style="position: absolute; width: 100%; height: 100%; top: 0px; left: 0px;"><div class="react-flow__node react-flow__node-promptNode nopan" data-id="triage" data-testid="rf__node-triage" tabindex="0" role="button" aria-describedby="react-flow__node-desc-1" style="z-index: 0; transform: translate(40px, 40px); pointer-events: all; visibility: visible; width: 280px;"><div class="graph-editor-card graph-editor-rounded graph-editor-canvas-node" style="width: 100%; height: 100%; min-width: 0px; box-sizing: border-box; display: flex; flex-direction: column;"><div data-handleid="in" data-nodeid="triage" data-handlepos="left" data-id="triage-in-target" class="react-flow__handle react-flow__handle-left nodrag nopan graph-editor-target-handle graph-editor-target-handle--default target connectable connectablestart connectableend connectionindicator"></div><div class="graph-editor-card__header graph-editor-surface--muted graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 graph-editor-flex-shrink-0"><div class="graph-editor-flex graph-editor-flex--between graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-2 graph-editor-min-w-0"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-text--bold graph-editor-text--md">▶ prompt</div></div></div><div class="graph-editor-muted graph-editor-text--xs graph-editor-flex-shrink-0">triage</div></div></div><div class="graph-editor-canvas-node-body graph-editor-min-w-0"><div class="graph-editor-card__body graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 nodrag"><div class="graph-editor-text--sm graph-editor-spacing--mb-0 graph-editor-node-text-wrap min-w-0" title="An employee reports a suspicious attachment. What is the first response?">An employee reports a suspicious attachment. What is the first response?</div></div><ul class="graph-editor-list graph-editor-list--flush graph-editor-text--sm graph-editor-min-w-0 nodrag" aria-label="Node choices"><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Investigate the email headers and isolate the device">Investigate the email headers and isolate the device</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">investigate</span></button><div data-handleid="choice:investigate" data-nodeid="triage" data-handlepos="right" data-id="triage-choice:investigate-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Assume it is harmless and dismiss the report">Assume it is harmless and dismiss the report</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">dismiss</span></button><div data-handleid="choice:dismiss" data-nodeid="triage" data-handlepos="right" data-id="triage-choice:dismiss-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li></ul></div></div></div><div class="react-flow__node react-flow__node-promptNode nopan" data-id="investigate" data-testid="rf__node-investigate" tabindex="0" role="button" aria-describedby="react-flow__node-desc-1" style="z-index: 0; transform: translate(460px, 100px); pointer-events: all; visibility: visible; width: 280px;"><div class="graph-editor-card graph-editor-rounded graph-editor-canvas-node" style="width: 100%; height: 100%; min-width: 0px; box-sizing: border-box; display: flex; flex-direction: column;"><div data-handleid="in" data-nodeid="investigate" data-handlepos="left" data-id="investigate-in-target" class="react-flow__handle react-flow__handle-left nodrag nopan graph-editor-target-handle graph-editor-target-handle--default target connectable connectablestart connectableend connectionindicator"></div><div class="graph-editor-card__header graph-editor-surface--muted graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 graph-editor-flex-shrink-0"><div class="graph-editor-flex graph-editor-flex--between graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-2 graph-editor-min-w-0"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-text--bold graph-editor-text--md">prompt</div></div></div><div class="graph-editor-muted graph-editor-text--xs graph-editor-flex-shrink-0">investig</div></div></div><div class="graph-editor-canvas-node-body graph-editor-min-w-0"><div class="graph-editor-card__body graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 nodrag"><div class="graph-editor-text--sm graph-editor-spacing--mb-0 graph-editor-node-text-wrap min-w-0" title="The attachment contacted an unknown host. What do you do next?">The attachment contacted an unknown host. What do you do next?</div></div><ul class="graph-editor-list graph-editor-list--flush graph-editor-text--sm graph-editor-min-w-0 nodrag" aria-label="Node choices"><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Escalate to incident response and preserve evidence">Escalate to incident response and preserve evidence</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">escalate</span></button><div data-handleid="choice:escalate" data-nodeid="investigate" data-handlepos="right" data-id="investigate-choice:escalate-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Reimage immediately without collecting evidence">Reimage immediately without collecting evidence</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">reimage</span></button><div data-handleid="choice:reimage" data-nodeid="investigate" data-handlepos="right" data-id="investigate-choice:reimage-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li></ul></div></div></div><div class="react-flow__node react-flow__node-promptNode nopan" data-id="recovery" data-testid="rf__node-recovery" tabindex="0" role="button" aria-describedby="react-flow__node-desc-1" style="z-index: 0; transform: translate(880px, 160px); pointer-events: all; visibility: visible; width: 280px;"><div class="graph-editor-card graph-editor-rounded graph-editor-canvas-node" style="width: 100%; height: 100%; min-width: 0px; box-sizing: border-box; display: flex; flex-direction: column;"><div data-handleid="in" data-nodeid="recovery" data-handlepos="left" data-id="recovery-in-target" class="react-flow__handle react-flow__handle-left nodrag nopan graph-editor-target-handle graph-editor-target-handle--default target connectable connectablestart connectableend connectionindicator"></div><div class="graph-editor-card__header graph-editor-surface--muted graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 graph-editor-flex-shrink-0"><div class="graph-editor-flex graph-editor-flex--between graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-2 graph-editor-min-w-0"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-text--bold graph-editor-text--md">info</div></div></div><div class="graph-editor-muted graph-editor-text--xs graph-editor-flex-shrink-0">recovery</div></div></div><div class="graph-editor-canvas-node-body graph-editor-min-w-0"><div class="graph-editor-card__body graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 nodrag"><div class="graph-editor-text--sm graph-editor-spacing--mb-0 graph-editor-node-text-wrap min-w-0" title="Notify stakeholders, document the timeline, and restore the endpoint safely.">Notify stakeholders, document the timeline, and restore the endpoint safely.</div></div><ul class="graph-editor-list graph-editor-list--flush graph-editor-text--sm graph-editor-min-w-0 nodrag" aria-label="Node choices"><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Close incident">Close incident</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">close</span></button><div data-handleid="choice:close" data-nodeid="recovery" data-handlepos="right" data-id="recovery-choice:close-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li></ul></div></div></div><div class="react-flow__node react-flow__node-endNode nopan selectable" data-id="END" data-testid="rf__node-END" tabindex="0" role="button" aria-describedby="react-flow__node-desc-1" style="z-index: 0; transform: translate(1300px, 80px); pointer-events: all; visibility: visible;"><div class="graph-editor-card graph-editor-rounded graph-editor-canvas-node graph-editor-canvas-node--border-danger graph-editor-canvas-node--end-width"><div data-handleid="in" data-nodeid="END" data-handlepos="left" data-id="END-in-target" class="react-flow__handle react-flow__handle-left nodrag nopan graph-editor-target-handle graph-editor-target-handle--danger target connectable connectablestart connectableend connectionindicator"></div><div class="graph-editor-card__body graph-editor-spacing--p-2 graph-editor-text--center"><div class="graph-editor-text--bold graph-editor-text--danger">END</div><div class="graph-editor-muted graph-editor-text--sm">Outcome required</div></div></div></div></div></div></div></div><div class="react-flow__panel react-flow__controls bottom left" data-testid="rf__controls" style="pointer-events: all;"><button type="button" class="react-flow__controls-button react-flow__controls-zoomin" title="zoom in" aria-label="zoom in"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg></button><button type="button" class="react-flow__controls-button react-flow__controls-zoomout" title="zoom out" aria-label="zoom out"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg></button><button type="button" class="react-flow__controls-button react-flow__controls-fitview" title="fit view" aria-label="fit view"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><path d="M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"></path></svg></button><button type="button" class="react-flow__controls-button react-flow__controls-interactive" title="toggle interactivity" aria-label="toggle interactivity"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"></path></svg></button></div><svg xmlns="http://www.w3.org/2000/svg" class="react-flow__background" data-testid="rf__background" style="position: absolute; width: 100%; height: 100%; top: 0px; left: 0px;"><pattern id="pattern-1undefined" x="3.200000000000003" y="6.400000000000006" width="16.4" height="16.4" patternUnits="userSpaceOnUse" patternTransform="translate(-0.41,-0.41)"><circle cx="0.41" cy="0.41" r="0.41" fill="#91919a"></circle></pattern><rect x="0" y="0" width="100%" height="100%" fill="url(#pattern-1undefined)"></rect></svg><div class="react-flow__panel react-flow__attribution bottom right" data-message="Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro" style="pointer-events: all;"><a href="https://reactflow.dev" target="_blank" rel="noopener noreferrer" aria-label="React Flow attribution">React Flow</a></div><div id="react-flow__node-desc-1" style="display: none;">Press enter or space to select a node.You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel. </div><div id="react-flow__edge-desc-1" style="display: none;">Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.</div><div id="react-flow__aria-live-1" aria-live="assertive" aria-atomic="true" style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); clip-path: inset(100%);"></div></div></div></section></main>
711
+ <main class="docs-preview" id="editor-preview"><header class="docs-preview__header"><div><div class="docs-preview__eyebrow">TreeSpec editor</div><h1>Incident response decision tree</h1></div><div class="docs-preview__status">Read-only example</div></header><p class="docs-preview__description">Generated from the exported <code>TreeSpecGraphEditor</code> with the editor model and live example data.</p><section class="docs-preview__canvas" aria-label="TreeSpec editor graph"><div class="graph-editor-canvas-root graph-editor-canvas" data-color-mode="light"><div class="react-flow" data-testid="rf__wrapper" style="width: 100%; height: 100%; overflow: hidden; position: relative; z-index: 0;"><div class="react-flow__renderer" style="position: absolute; width: 100%; height: 100%; top: 0px; left: 0px;"><div class="react-flow__pane" style="position: absolute; width: 100%; height: 100%; top: 0px; left: 0px;"><div class="react-flow__viewport react-flow__container" style="transform: translate(36px, 72px) scale(0.82);"><svg xmlns="http://www.w3.org/2000/svg" width="1322" height="668" class="react-flow__edges react-flow__container" style="z-index: 0;"><defs><marker class="react-flow__arrowhead" id="1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16" markerWidth="16" markerHeight="16" viewBox="-10 -10 20 20" markerUnits="strokeWidth" orient="auto-start-reverse" refX="0" refY="0"><polyline stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4" style="stroke: rgb(177, 177, 183); fill: rgb(177, 177, 183); stroke-width: 1;"></polyline></marker></defs><g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-triage-investigate" aria-label="Edge from triage to investigate" aria-describedby="react-flow__edge-desc-1"><path d="M324.00000818764295 172.49998436904536L344.00000818764295 172.49998436904536L 385.0000048381527,172.49998436904536Q 390.0000048381527,172.49998436904536 390.0000048381527,177.49998436904536L 390.0000048381527,227.5000029773247Q 390.0000048381527,232.5000029773247 395.0000048381527,232.5000029773247L436.00000148866235 232.5000029773247L456.00000148866235 232.5000029773247" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M324.00000818764295 172.49998436904536L344.00000818764295 172.49998436904536L 385.0000048381527,172.49998436904536Q 390.0000048381527,172.49998436904536 390.0000048381527,177.49998436904536L 390.0000048381527,227.5000029773247Q 390.0000048381527,232.5000029773247 395.0000048381527,232.5000029773247L436.00000148866235 232.5000029773247L456.00000148866235 232.5000029773247" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(265.0468798381527 196.49999367318503)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="253.90625" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Investigate the email headers and isolate the device</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="446.00000148866235" cy="232.5000029773247" r="10" stroke="transparent" fill="transparent"></circle></g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-triage-dismiss" aria-label="Edge from triage to END" aria-describedby="react-flow__edge-desc-1"><path d="M324.00000818764295 172.49998436904536L344.00000818764295 172.49998436904536L 804.9999862298732,172.49998436904536Q 809.9999862298732,172.49998436904536 809.9999862298732,167.49998436904536L 809.9999862298732,119.49998362471418Q 809.9999862298732,114.49998362471418 814.9999862298732,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M324.00000818764295 172.49998436904536L344.00000818764295 172.49998436904536L 804.9999862298732,172.49998436904536Q 809.9999862298732,172.49998436904536 809.9999862298732,167.49998436904536L 809.9999862298732,119.49998362471418Q 809.9999862298732,114.49998362471418 814.9999862298732,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(646.1249862298732 137.49998399687976)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="331.75" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Assume it is harmless and dismiss the report → END (compromised)</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="1285.9999642721036" cy="114.49998362471418" r="10" stroke="transparent" fill="transparent"></circle></g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-investigate-escalate" aria-label="Edge from investigate to recovery" aria-describedby="react-flow__edge-desc-1"><path d="M743.9999895793635 232.5000029773247L763.9999895793635 232.5000029773247L 805.0000141422922,232.5000029773247Q 810.0000141422922,232.5000029773247 810.0000141422922,237.5000029773247L 810.0000141422922,242.49997320407775Q 810.0000141422922,247.49997320407775 815.0000141422922,247.49997320407775L856.0000387052211 247.49997320407775L876.0000387052211 247.49997320407775" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M743.9999895793635 232.5000029773247L763.9999895793635 232.5000029773247L 805.0000141422922,232.5000029773247Q 810.0000141422922,232.5000029773247 810.0000141422922,237.5000029773247L 810.0000141422922,242.49997320407775Q 810.0000141422922,247.49997320407775 815.0000141422922,247.49997320407775L856.0000387052211 247.49997320407775L876.0000387052211 247.49997320407775" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(682.8672016422922 233.9999880907012)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="258.265625" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Escalate to incident response and preserve evidence</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="866.0000387052211" cy="247.49997320407775" r="10" stroke="transparent" fill="transparent"></circle></g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-investigate-reimage" aria-label="Edge from investigate to END" aria-describedby="react-flow__edge-desc-1"><path d="M743.9999895793635 232.5000029773247L763.9999895793635 232.5000029773247L 1014.9999769257336,232.5000029773247Q 1019.9999769257336,232.5000029773247 1019.9999769257336,227.5000029773247L 1019.9999769257336,119.49998362471418Q 1019.9999769257336,114.49998362471418 1024.9999769257336,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M743.9999895793635 232.5000029773247L763.9999895793635 232.5000029773247L 1014.9999769257336,232.5000029773247Q 1019.9999769257336,232.5000029773247 1019.9999769257336,227.5000029773247L 1019.9999769257336,119.49998362471418Q 1019.9999769257336,114.49998362471418 1024.9999769257336,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(861.2499769257336 167.49999330101943)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="321.5" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Reimage immediately without collecting evidence → END (at_risk)</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="1285.9999642721036" cy="114.49998362471418" r="10" stroke="transparent" fill="transparent"></circle></g><g class="react-flow__edge react-flow__edge-smoothstep nopan" tabindex="0" role="button" data-testid="rf__edge-recovery-close" aria-label="Edge from recovery to END" aria-describedby="react-flow__edge-desc-1"><path d="M1164.0001012290397 247.49997320407775L1184.0001012290397 247.49997320407775L 1225.0000327505718,247.49997320407775Q 1230.0000327505718,247.49997320407775 1230.0000327505718,242.49997320407775L 1230.0000327505718,119.49998362471418Q 1230.0000327505718,114.49998362471418 1235.0000327505718,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" class="react-flow__edge-path" marker-end="url('#1__color=#b1b1b7&amp;height=16&amp;type=arrowclosed&amp;width=16')" marker-start="url('#')" style="stroke-width: 2;"></path><path d="M1164.0001012290397 247.49997320407775L1184.0001012290397 247.49997320407775L 1225.0000327505718,247.49997320407775Q 1230.0000327505718,247.49997320407775 1230.0000327505718,242.49997320407775L 1230.0000327505718,119.49998362471418Q 1230.0000327505718,114.49998362471418 1235.0000327505718,114.49998362471418L1275.9999642721036 114.49998362471418L1295.9999642721036 114.49998362471418" fill="none" stroke-opacity="0" stroke-width="20" class="react-flow__edge-interaction"></path><g transform="translate(1162.0703452505718 174.99997841439597)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="139.859375" x="-2" y="-4" height="20" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6" dy="0.3em">Close incident → END (safe)</text></g><circle class="react-flow__edgeupdater react-flow__edgeupdater-target" cx="1285.9999642721036" cy="114.49998362471418" r="10" stroke="transparent" fill="transparent"></circle></g></g></svg><div class="react-flow__edgelabel-renderer"></div><div class="react-flow__nodes" style="position: absolute; width: 100%; height: 100%; top: 0px; left: 0px;"><div class="react-flow__node react-flow__node-promptNode nopan" data-id="triage" data-testid="rf__node-triage" tabindex="0" role="button" aria-describedby="react-flow__node-desc-1" style="z-index: 0; transform: translate(40px, 40px); pointer-events: all; visibility: visible; width: 280px;"><div class="graph-editor-card graph-editor-rounded graph-editor-canvas-node" style="width: 100%; height: 100%; min-width: 0px; box-sizing: border-box; display: flex; flex-direction: column;"><div data-handleid="in" data-nodeid="triage" data-handlepos="left" data-id="triage-in-target" class="react-flow__handle react-flow__handle-left nodrag nopan graph-editor-target-handle graph-editor-target-handle--default target connectable connectablestart connectableend connectionindicator"></div><div class="graph-editor-card__header graph-editor-surface--muted graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 graph-editor-flex-shrink-0"><div class="graph-editor-flex graph-editor-flex--between graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-2 graph-editor-min-w-0"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-text--bold graph-editor-text--md"><span role="img" aria-label="Start node" title="Start node">★ </span><span class="graph-editor-icon--prompt" role="img" aria-label="Prompt" title="Prompt"></span>triage</div></div></div></div></div><div class="graph-editor-canvas-node-body graph-editor-min-w-0"><div class="graph-editor-card__body graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 nodrag"><div class="graph-editor-text--sm graph-editor-spacing--mb-0 graph-editor-node-text-wrap min-w-0" title="An employee reports a suspicious attachment. What is the first response?">An employee reports a suspicious attachment. What is the first response?</div></div><ul class="graph-editor-list graph-editor-list--flush graph-editor-text--sm graph-editor-min-w-0 nodrag" aria-label="Node choices"><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Investigate the email headers and isolate the device">Investigate the email headers and isolate the device</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">investigate</span></button><div data-handleid="choice:investigate" data-nodeid="triage" data-handlepos="right" data-id="triage-choice:investigate-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Assume it is harmless and dismiss the report">Assume it is harmless and dismiss the report</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">dismiss</span></button><div data-handleid="choice:dismiss" data-nodeid="triage" data-handlepos="right" data-id="triage-choice:dismiss-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li></ul></div></div></div><div class="react-flow__node react-flow__node-promptNode nopan" data-id="investigate" data-testid="rf__node-investigate" tabindex="0" role="button" aria-describedby="react-flow__node-desc-1" style="z-index: 0; transform: translate(460px, 100px); pointer-events: all; visibility: visible; width: 280px;"><div class="graph-editor-card graph-editor-rounded graph-editor-canvas-node" style="width: 100%; height: 100%; min-width: 0px; box-sizing: border-box; display: flex; flex-direction: column;"><div data-handleid="in" data-nodeid="investigate" data-handlepos="left" data-id="investigate-in-target" class="react-flow__handle react-flow__handle-left nodrag nopan graph-editor-target-handle graph-editor-target-handle--default target connectable connectablestart connectableend connectionindicator"></div><div class="graph-editor-card__header graph-editor-surface--muted graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 graph-editor-flex-shrink-0"><div class="graph-editor-flex graph-editor-flex--between graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-2 graph-editor-min-w-0"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-text--bold graph-editor-text--md"><span class="graph-editor-icon--prompt" role="img" aria-label="Prompt" title="Prompt"></span>investigate</div></div></div></div></div><div class="graph-editor-canvas-node-body graph-editor-min-w-0"><div class="graph-editor-card__body graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 nodrag"><div class="graph-editor-text--sm graph-editor-spacing--mb-0 graph-editor-node-text-wrap min-w-0" title="The attachment contacted an unknown host. What do you do next?">The attachment contacted an unknown host. What do you do next?</div></div><ul class="graph-editor-list graph-editor-list--flush graph-editor-text--sm graph-editor-min-w-0 nodrag" aria-label="Node choices"><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Escalate to incident response and preserve evidence">Escalate to incident response and preserve evidence</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">escalate</span></button><div data-handleid="choice:escalate" data-nodeid="investigate" data-handlepos="right" data-id="investigate-choice:escalate-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Reimage immediately without collecting evidence">Reimage immediately without collecting evidence</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">reimage</span></button><div data-handleid="choice:reimage" data-nodeid="investigate" data-handlepos="right" data-id="investigate-choice:reimage-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li></ul></div></div></div><div class="react-flow__node react-flow__node-promptNode nopan" data-id="recovery" data-testid="rf__node-recovery" tabindex="0" role="button" aria-describedby="react-flow__node-desc-1" style="z-index: 0; transform: translate(880px, 160px); pointer-events: all; visibility: visible; width: 280px;"><div class="graph-editor-card graph-editor-rounded graph-editor-canvas-node" style="width: 100%; height: 100%; min-width: 0px; box-sizing: border-box; display: flex; flex-direction: column;"><div data-handleid="in" data-nodeid="recovery" data-handlepos="left" data-id="recovery-in-target" class="react-flow__handle react-flow__handle-left nodrag nopan graph-editor-target-handle graph-editor-target-handle--default target connectable connectablestart connectableend connectionindicator"></div><div class="graph-editor-card__header graph-editor-surface--muted graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 graph-editor-flex-shrink-0"><div class="graph-editor-flex graph-editor-flex--between graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-2 graph-editor-min-w-0"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-start graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-min-w-0 graph-editor-flex-grow-1 graph-editor-overflow-hidden"><div class="graph-editor-text--bold graph-editor-text--md">recovery</div></div></div><div class="graph-editor-muted graph-editor-text--xs graph-editor-flex-shrink-0">info</div></div></div><div class="graph-editor-canvas-node-body graph-editor-min-w-0"><div class="graph-editor-card__body graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-min-w-0 nodrag"><div class="graph-editor-text--sm graph-editor-spacing--mb-0 graph-editor-node-text-wrap min-w-0" title="Notify stakeholders, document the timeline, and restore the endpoint safely.">Notify stakeholders, document the timeline, and restore the endpoint safely.</div></div><ul class="graph-editor-list graph-editor-list--flush graph-editor-text--sm graph-editor-min-w-0 nodrag" aria-label="Node choices"><li class="graph-editor-list__item graph-editor-spacing--p-0 graph-editor-list__item--plain"><div class="graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1 graph-editor-min-w-0 graph-editor-spacing--py-2 graph-editor-spacing--px-2 graph-editor-w-full graph-editor-choice-row"><button type="button" class="graph-editor-choice-row-select graph-editor-text--start graph-editor-flex-grow-1 graph-editor-min-w-0 graph-editor-flex graph-editor-flex--row graph-editor-flex graph-editor-flex--align-center graph-editor-spacing--gap-1" disabled=""><span class="graph-editor-node-text-wrap min-w-0 graph-editor-flex-grow-1 graph-editor-min-w-0" title="Close incident">Close incident</span><span class="graph-editor-badge graph-editor-badge--neutral graph-editor-flex-shrink-0">close</span></button><div data-handleid="choice:close" data-nodeid="recovery" data-handlepos="right" data-id="recovery-choice:close-source" class="react-flow__handle react-flow__handle-right nodrag nopan graph-editor-handle graph-editor-choice-handle source connectable connectablestart connectableend connectionindicator"></div></div></li></ul></div></div></div><div class="react-flow__node react-flow__node-endNode nopan selectable" data-id="END" data-testid="rf__node-END" tabindex="0" role="button" aria-describedby="react-flow__node-desc-1" style="z-index: 0; transform: translate(1300px, 80px); pointer-events: all; visibility: visible;"><div class="graph-editor-card graph-editor-rounded graph-editor-canvas-node graph-editor-canvas-node--border-danger graph-editor-canvas-node--end-width"><div data-handleid="in" data-nodeid="END" data-handlepos="left" data-id="END-in-target" class="react-flow__handle react-flow__handle-left nodrag nopan graph-editor-target-handle graph-editor-target-handle--danger target connectable connectablestart connectableend connectionindicator"></div><div class="graph-editor-card__body graph-editor-spacing--p-2 graph-editor-text--center"><div class="graph-editor-text--bold graph-editor-text--danger">END</div><div class="graph-editor-muted graph-editor-text--sm">Outcome required</div></div></div></div></div></div></div></div><div class="react-flow__panel react-flow__controls bottom left" data-testid="rf__controls" style="pointer-events: all;"><button type="button" class="react-flow__controls-button react-flow__controls-zoomin" title="zoom in" aria-label="zoom in"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg></button><button type="button" class="react-flow__controls-button react-flow__controls-zoomout" title="zoom out" aria-label="zoom out"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg></button><button type="button" class="react-flow__controls-button react-flow__controls-fitview" title="fit view" aria-label="fit view"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><path d="M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"></path></svg></button><button type="button" class="react-flow__controls-button react-flow__controls-interactive" title="toggle interactivity" aria-label="toggle interactivity"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"></path></svg></button></div><svg xmlns="http://www.w3.org/2000/svg" class="react-flow__background" data-testid="rf__background" style="position: absolute; width: 100%; height: 100%; top: 0px; left: 0px;"><pattern id="pattern-1undefined" x="3.200000000000003" y="6.400000000000006" width="16.4" height="16.4" patternUnits="userSpaceOnUse" patternTransform="translate(-0.41,-0.41)"><circle cx="0.41" cy="0.41" r="0.41" fill="#91919a"></circle></pattern><rect x="0" y="0" width="100%" height="100%" fill="url(#pattern-1undefined)"></rect></svg><div class="react-flow__panel react-flow__attribution bottom right" data-message="Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro" style="pointer-events: all;"><a href="https://reactflow.dev" target="_blank" rel="noopener noreferrer" aria-label="React Flow attribution">React Flow</a></div><div id="react-flow__node-desc-1" style="display: none;">Press enter or space to select a node.You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel. </div><div id="react-flow__edge-desc-1" style="display: none;">Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.</div><div id="react-flow__aria-live-1" aria-live="assertive" aria-atomic="true" style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); clip-path: inset(100%);"></div></div></div></section></main>
712
712
  </div>
713
713
  </foreignObject>
714
714
  </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalsafe/tree-spec-editor-react",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "type": "module",
5
5
  "description": "UI-kit agnostic React Flow canvas for the SignalSafe TreeSpec graph editor (no UI library).",
6
6
  "license": "MIT",
@@ -64,12 +64,12 @@
64
64
  "test:monorepo": "cd ../../frontend && yarn vitest run --config vitest.tree-spec-editor-react.config.ts"
65
65
  },
66
66
  "dependencies": {
67
- "@signalsafe/tree-spec": "^0.4.5",
68
- "@signalsafe/tree-spec-editor-core": "^0.2.4"
67
+ "@signalsafe/tree-spec": "^0.4.7",
68
+ "@signalsafe/tree-spec-editor-core": "^0.2.7"
69
69
  },
70
70
  "peerDependencies": {
71
- "react": "^18.0.0",
72
- "react-dom": "^18.0.0",
71
+ "react": "^18.0.0 || ^19.3.1",
72
+ "react-dom": "^18.0.0 || ^19.3.1",
73
73
  "reactflow": "^11.0.0"
74
74
  },
75
75
  "devDependencies": {