@signalsafe/tree-spec-editor-react 0.3.2 → 0.3.3
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 +162 -0
- package/README.md +15 -0
- package/RELEASING.md +94 -0
- package/SECURITY.md +22 -0
- package/dist/hooks/types.d.ts +8 -0
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/hooks/useEditorAdapter.d.ts +2 -0
- package/dist/hooks/useEditorAdapter.d.ts.map +1 -1
- package/dist/hooks/useEditorAdapter.js +33 -10
- package/dist/hooks/useEditorAutosave.d.ts +1 -0
- package/dist/hooks/useEditorAutosave.d.ts.map +1 -1
- package/dist/hooks/useEditorAutosave.js +5 -2
- package/dist/hooks/useEditorHistory.d.ts +1 -1
- package/dist/hooks/useEditorHistory.d.ts.map +1 -1
- package/dist/hooks/useEditorHistory.js +12 -10
- package/dist/hooks/useTreeSpecEditor.d.ts.map +1 -1
- package/dist/hooks/useTreeSpecEditor.js +42 -37
- package/docs/README.md +5 -0
- package/docs/current-release-candidate.md +11 -0
- package/docs/tree-spec-example-flow.svg +2 -2
- package/package.json +10 -7
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
No unreleased changes recorded.
|
|
11
|
+
|
|
12
|
+
## [0.3.3] - 2026-10-21
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Add optional read-only editing gates and observable save failures while retaining unsaved changes and avoiding automatic retries of the same failed payload. Preserve the audited hook/type boundaries and require TreeSpec `^0.4.4` and editor-core `^0.2.3`.
|
|
17
|
+
- Refresh current README, release preparation and package compatibility documentation.
|
|
18
|
+
|
|
19
|
+
## [0.3.3-r42.1] - 2026-10-18
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- Explicit hook `readOnly` capability and effective `state.readOnly`, independent of actual publication metadata. Blocks graph edits, history mutations, persistence actions and autosave; selection, preview and validation remain available.
|
|
24
|
+
- Optional `onSaveError(error: unknown)` observer and nullable `state.saveError`. Failed saves resolve safely for void toolbar/shortcut callers, preserve unsaved graph and saved baseline, and report existing dirty status. Observer failures are contained.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Keep the failed payload unsaved without silently retrying it on an autosave state rerender. Explicit Save can retry; a new edit may schedule a new autosave.
|
|
29
|
+
|
|
30
|
+
This is an isolated local candidate; no registry release or host adoption is implied.
|
|
31
|
+
|
|
32
|
+
## [0.3.2] - 2026-10-09
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- Depend on `@signalsafe/tree-spec` `^0.4.1` and `@signalsafe/tree-spec-editor-core` `^0.2.2` so consumers resolve a single copy of each.
|
|
37
|
+
|
|
38
|
+
## [0.3.1] - 2026-09-08
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- Adopt `@signalsafe/tree-spec-editor-core` **^0.2.1** so consumers receive the
|
|
43
|
+
corrected cycle-with-an-exit terminal-path behavior.
|
|
44
|
+
|
|
45
|
+
## [0.3.0] - 2026-09-08
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- Optional revision-aware save results with typed conflict state while keeping
|
|
50
|
+
transport, merging, and persistence in the host adapter.
|
|
51
|
+
|
|
52
|
+
## [0.2.5] - 2026-08-28
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
|
|
56
|
+
- A package-boundary test that verifies every external runtime import is declared and Bootstrap remains excluded.
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
|
|
60
|
+
- Require `@signalsafe/tree-spec` **^0.3.4** and `@signalsafe/tree-spec-editor-core` **^0.1.6**.
|
|
61
|
+
- Raise the minimum supported Node.js to **>=22.12.0** and run the CI matrix on Node **22** and **24** only; Node 20 is dropped because of GitHub Actions deprecation.
|
|
62
|
+
|
|
63
|
+
## [0.2.4] - 2026-08-28
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- Verify generated documentation images with a stable fingerprint of the live demo, compiled editor modules, and stylesheet inputs while still rendering the real component tree in CI.
|
|
68
|
+
|
|
69
|
+
## [0.2.3] - 2026-08-28
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
|
|
73
|
+
- Generate the live-canvas documentation SVG from versioned CSS source files instead of browser-normalized CSS so the checked-in image is reproducible on macOS and Linux CI.
|
|
74
|
+
|
|
75
|
+
## [0.2.2] - 2026-08-28
|
|
76
|
+
|
|
77
|
+
### Added
|
|
78
|
+
|
|
79
|
+
- A live-canvas documentation demo and generated TreeSpec example-flow SVG.
|
|
80
|
+
|
|
81
|
+
### Changed
|
|
82
|
+
|
|
83
|
+
- Updated the TypeScript 7-compatible build configuration and current CI action dependencies.
|
|
84
|
+
|
|
85
|
+
## [0.2.1] - 2026-06-28
|
|
86
|
+
|
|
87
|
+
### Fixed
|
|
88
|
+
|
|
89
|
+
- Removed the React Flow CSS side-effect import from the built library entrypoint so native Node ESM package imports do not fail on `.css` files.
|
|
90
|
+
|
|
91
|
+
### Notes
|
|
92
|
+
|
|
93
|
+
- Host applications that want React Flow default styling should import `reactflow/dist/style.css` from their own app entrypoint.
|
|
94
|
+
- No React component API changes.
|
|
95
|
+
- No Bootstrap or UI framework dependencies were added.
|
|
96
|
+
|
|
97
|
+
## [0.2.0] - 2026-06-28
|
|
98
|
+
|
|
99
|
+
### Changed
|
|
100
|
+
|
|
101
|
+
- Removed Bootstrap-specific runtime styling assumptions from the React tree-spec editor components.
|
|
102
|
+
- Replaced Bootstrap class coupling with UI-kit-agnostic `graph-editor-*` class hooks.
|
|
103
|
+
- Updated internal SignalSafe dependency ranges for the current package release line:
|
|
104
|
+
- `@signalsafe/tree-spec@^0.3.3`
|
|
105
|
+
- `@signalsafe/tree-spec-editor-core@^0.1.4`
|
|
106
|
+
- Raised the supported Node.js baseline to Node 22.12+.
|
|
107
|
+
|
|
108
|
+
### Added
|
|
109
|
+
|
|
110
|
+
- Added tests to guard against reintroducing Bootstrap-specific class names or dependencies.
|
|
111
|
+
- Added package smoke checks for the built and packed artifact.
|
|
112
|
+
|
|
113
|
+
### Fixed
|
|
114
|
+
|
|
115
|
+
- Addressed SonarCloud maintainability findings by marking graph editor canvas component props as read-only across prompt/end node renderers, choice rows, the canvas context menu, and the main editor shell.
|
|
116
|
+
- Addressed SonarCloud consistency findings by using `export…from` for public barrel re-exports.
|
|
117
|
+
|
|
118
|
+
### Notes
|
|
119
|
+
|
|
120
|
+
- This release does not include `react-bootstrap` or `bootstrap`.
|
|
121
|
+
- Host applications are responsible for providing their own styling for the emitted `graph-editor-*` hooks.
|
|
122
|
+
- This package should be published before `@signalsafe/tree-spec-editor@0.3.0`.
|
|
123
|
+
|
|
124
|
+
## [0.1.3] - 2026-06-26
|
|
125
|
+
|
|
126
|
+
### Fixed
|
|
127
|
+
|
|
128
|
+
- Clear monorepo `paths` from standalone `tsconfig.build.json` so local `yarn build` works outside the monorepo.
|
|
129
|
+
|
|
130
|
+
### Changed
|
|
131
|
+
|
|
132
|
+
- Standardize development on Yarn 1.22.22 (`packageManager`, README dev commands).
|
|
133
|
+
- Bump `@signalsafe/tree-spec` to `^0.3.2` and `@signalsafe/tree-spec-editor-core` to `^0.1.3`.
|
|
134
|
+
|
|
135
|
+
## [0.1.2] - 2026-06-26
|
|
136
|
+
|
|
137
|
+
### Added
|
|
138
|
+
|
|
139
|
+
- `SECURITY.md`, Dependabot, `CHANGELOG.md`, updated [RELEASING.md](./RELEASING.md).
|
|
140
|
+
- Expanded React package test coverage.
|
|
141
|
+
- Package artifact smoke test (`yarn smoke:package`).
|
|
142
|
+
|
|
143
|
+
### Changed
|
|
144
|
+
|
|
145
|
+
- `sideEffects` for React Flow CSS; README/CSS docs (Batch 4).
|
|
146
|
+
|
|
147
|
+
### CI
|
|
148
|
+
|
|
149
|
+
- Checks and tests on every PR; Sonar **`scan`** is label-gated on PRs and runs on tag push and manual dispatch (Batch 1).
|
|
150
|
+
- Publish only from manual **`main`** dispatch or **`v*`** tags (not PR labels); publish requires **`checks`**, **`tests`**, and **`scan`**.
|
|
151
|
+
|
|
152
|
+
[Unreleased]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.3.2...HEAD
|
|
153
|
+
[0.3.1]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.3.0...v0.3.1
|
|
154
|
+
[0.3.0]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.2.5...v0.3.0
|
|
155
|
+
[0.2.5]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.2.4...v0.2.5
|
|
156
|
+
[0.2.4]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.2.3...v0.2.4
|
|
157
|
+
[0.2.3]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.2.2...v0.2.3
|
|
158
|
+
[0.2.2]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.2.1...v0.2.2
|
|
159
|
+
[0.2.1]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.2.0...v0.2.1
|
|
160
|
+
[0.2.0]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/compare/v0.1.3...v0.2.0
|
|
161
|
+
[0.1.3]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/releases/tag/v0.1.3
|
|
162
|
+
[0.1.2]: https://github.com/SignalSafeSoftware/tree-spec-editor-react/releases/tag/v0.1.2
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @signalsafe/tree-spec-editor-react
|
|
2
2
|
|
|
3
|
+
Current source and planned customer-subdomain impact: [current-state summary](docs/current-release-candidate.md).
|
|
4
|
+
|
|
3
5
|
Headless **React + React Flow** layer for the SignalSafe TreeSpec graph editor: canvas component, orchestration hook, and wiring to `@signalsafe/tree-spec-editor-core`.
|
|
4
6
|
|
|
5
7
|
| | |
|
|
@@ -169,3 +171,16 @@ See [SECURITY.md](./SECURITY.md). Host applications must authenticate users, aut
|
|
|
169
171
|
|
|
170
172
|
- [`@signalsafe/tree-spec-editor-core`](https://github.com/SignalSafeSoftware/tree-spec-editor-core) — framework-agnostic editor helpers.
|
|
171
173
|
- [`@signalsafe/tree-spec-editor`](https://github.com/SignalSafeSoftware/tree-spec-editor) — UI-kit agnostic authoring shell (panels, modals, toolbar).
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
### Explicit read-only and failed saves (local 0.3.3-r42.1 candidate)
|
|
177
|
+
|
|
178
|
+
`useTreeSpecEditor` accepts optional `readOnly?: boolean` and `onSaveError?: (error: unknown) => void`. Default editing behavior is unchanged. Pass explicit readOnly for retained definitions that cannot be edited even when `is_published` is false. Bind canvas/inspector editing controls to returned `readOnly`; display publication metadata from returned `isPublished`. Explicit readOnly blocks graph/history changes and save/publish/snapshot/restore/clone writes, including keyboard and autosave paths. Selection, preview, validation and read-only inspection remain available. Already dispatched network writes cannot be cancelled by changing this option.
|
|
179
|
+
|
|
180
|
+
Save failures retain the local graph and saved baseline, clear `saving`, set existing autosave status `dirty`, expose nullable `saveError`, and invoke the optional error observer with the original rejection. A null/undefined rejection becomes a generic Error in state. Save resolves after failure so void toolbar/keyboard callers do not produce an unhandled rejection; observer rejection is contained too. Retry explicitly with Save; success clears saveError and marks saved. The same failed payload is not silently autosaved again; a new edit may debounce normally. The host owns failure wording, command recovery and authorization.
|
|
181
|
+
|
|
182
|
+
## Release and compatibility
|
|
183
|
+
|
|
184
|
+
Release `0.3.3` preserves the installed Step 5 editor capabilities and the verified audit fixes. The coordinated dependency floor is TreeSpec `^0.4.4`, editor-core `^0.2.3`, and editor-react `^0.3.3` where declared. React integrations retain React 18 / React Flow 11. See [release preparation](./RELEASING.md) for verification and publication order. The coordinated release was approved on 2026-10-21; registry availability is recorded in release verification receipts.
|
|
185
|
+
|
|
186
|
+
See the [current release documentation](docs/current-release-candidate.md) for release-specific compatibility and verification boundaries.
|
package/RELEASING.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Releasing @signalsafe/tree-spec-editor-react
|
|
2
|
+
|
|
3
|
+
## Release 0.3.3
|
|
4
|
+
|
|
5
|
+
The coordinated release was approved on 2026-10-21. Publish only the reviewed source revision and verified archive after the required checks; this document does not assert registry availability.
|
|
6
|
+
|
|
7
|
+
The supported editor chain is TreeSpec `^0.4.4` → editor-core `^0.2.3` → editor-react `^0.3.3` → editor `0.4.1`, with the CSS-only theme `0.3.7`. Publish and verify each upstream registry archive before releasing its dependent. React packages retain React/React DOM 18 and React Flow 11; the theme has no runtime JavaScript dependencies.
|
|
8
|
+
|
|
9
|
+
## Verification
|
|
10
|
+
|
|
11
|
+
Use the committed lockfile and Node 22.12+; CI checks Node 22 and 24. Before release, run the package scripts declared in `package.json`, inspect `npm pack --dry-run`, and test downstream packages using the exact packed candidate. Record local candidate proof separately from a smoke test that installs published dependencies. A registry smoke test remains pending until its required upstream version is available.
|
|
12
|
+
|
|
13
|
+
After successful hosted checks at the approved revision, the existing `.github/workflows/ci.yml` publishes on an approved `v*` tag. Manual dispatch runs verification without publishing. Preserve the workflow's checks, tests, scan, smoke, and publish conditions as applicable; inspect their actual results before a release. Verify registry metadata and downloaded archive contents after publication, then update host declarations and locks together and run host integration checks.
|
|
14
|
+
|
|
15
|
+
## Historical release notes
|
|
16
|
+
|
|
17
|
+
The following records describe earlier release preparation; their version pins and sequencing are historical.
|
|
18
|
+
|
|
19
|
+
## Releasing `@signalsafe/tree-spec-editor-react`
|
|
20
|
+
|
|
21
|
+
Standalone repository: [SignalSafeSoftware/tree-spec-editor-react](https://github.com/SignalSafeSoftware/tree-spec-editor-react).
|
|
22
|
+
|
|
23
|
+
**Depends on:** `@signalsafe/tree-spec`, `@signalsafe/tree-spec-editor-core`. **Peer deps:** `react`, `react-dom`, `reactflow`.
|
|
24
|
+
|
|
25
|
+
**Release note (0.2.0):** Publish this package **before** `@signalsafe/tree-spec-editor@0.3.0`, which depends on `^0.2.0` of this canvas package. See [docs/UI_KIT_AGNOSTIC_CANVAS.md](./docs/UI_KIT_AGNOSTIC_CANVAS.md).
|
|
26
|
+
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
- Node.js **>=22.12.0** for local development, CI, and publish smoke (see `package.json` `engines`). CI matrix tests Node **22** and **24**; publish uses Node **24**. Node 20 is no longer supported because of GitHub Actions deprecation.
|
|
30
|
+
|
|
31
|
+
## CI publish policy
|
|
32
|
+
|
|
33
|
+
- **Checks and tests** run on every pull request.
|
|
34
|
+
- **`scan` (Sonar)** on pull requests is **optional** — it runs only when the PR has the **`scan`** label. On **`push`** (including **`v*`** tag pushes) and **`workflow_dispatch`**, **`scan`** runs automatically.
|
|
35
|
+
- **Publish does not run** from PR labels.
|
|
36
|
+
- **Publish runs** when:
|
|
37
|
+
- **Manual:** GitHub Actions → **CI** → **Run workflow** on branch **`main`**, or
|
|
38
|
+
- **Tag:** push a semver tag matching `v*` (for example `vX.Y.Z`).
|
|
39
|
+
- **Publish requires** successful **`checks`**, **`tests`**, and **`scan`** jobs in the same workflow run (see [`.github/workflows/ci.yml`](https://github.com/SignalSafeSoftware/tree-spec-editor-react/blob/main/.github/workflows/ci.yml)).
|
|
40
|
+
- Pushing a **`v*`** tag starts a workflow run where **`checks`**, **`tests`**, and **`scan`** run before **Publish** can proceed.
|
|
41
|
+
- **GitHub Releases do not trigger publish** in the current workflow.
|
|
42
|
+
- **No npm Environment approval or provenance** in CI today.
|
|
43
|
+
|
|
44
|
+
## CI tooling and npm auth
|
|
45
|
+
|
|
46
|
+
- Local development and CI use **Yarn** for `install`, `test`, `build`, and `smoke:package`.
|
|
47
|
+
- CI **publish** uses **`npm publish`** (non-interactive; compatible with 2FA-enabled npm accounts when auth is configured correctly).
|
|
48
|
+
- Set the GitHub Actions secret **`NPM_TOKEN`** to a publish-capable npm token unless **npm trusted publishing/OIDC** is configured for the repository.
|
|
49
|
+
- If the npm account or package requires **2FA for publish**, the token must support non-interactive publishing — for example a granular access token with read/write package access and **2FA bypass enabled for write actions**, or npm trusted publishing/OIDC.
|
|
50
|
+
- CI writes auth to `~/.npmrc` only; no `.npmrc` is committed to the repository.
|
|
51
|
+
- CI does not run `npm version` or bump versions during publish; the committed `package.json` version is published as-is.
|
|
52
|
+
|
|
53
|
+
## Before you release
|
|
54
|
+
|
|
55
|
+
1. Bump `version` in `package.json` (and `@signalsafe/*` dependency versions if needed).
|
|
56
|
+
2. Update [CHANGELOG.md](./CHANGELOG.md) (`[Unreleased]` → new version section when tagging).
|
|
57
|
+
3. Run locally:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
yarn install --frozen-lockfile
|
|
61
|
+
yarn typecheck
|
|
62
|
+
yarn test
|
|
63
|
+
yarn build
|
|
64
|
+
npm publish --dry-run
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
4. Run artifact smoke test: `yarn smoke:package` (pack, temp consumer install, export/type checks — enforced in CI before publish).
|
|
68
|
+
|
|
69
|
+
## Publish
|
|
70
|
+
|
|
71
|
+
1. Commit the version and changelog updates on **`main`**:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git add package.json CHANGELOG.md
|
|
75
|
+
git commit -m "Release vX.Y.Z"
|
|
76
|
+
git push origin main
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
2. Tag and push (recommended — triggers **Publish** when required jobs succeed):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git tag vX.Y.Z
|
|
83
|
+
git push origin vX.Y.Z
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Option B — Manual dispatch:** merge release commits to **`main`**, then GitHub → **Actions** → **CI** → **Run workflow** (branch **`main`**). Ensure `package.json` `version` matches the release you intend to ship.
|
|
87
|
+
|
|
88
|
+
## After publish
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm view @signalsafe/tree-spec-editor-react version
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
CI runs `yarn smoke:package`, logs the package version, then publishes with `npm publish` using `NPM_TOKEN` auth.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
Node.js 22.12 or newer (see `package.json` `engines`). Only the latest published release line receives security fixes.
|
|
6
|
+
|
|
7
|
+
## Reporting a vulnerability
|
|
8
|
+
|
|
9
|
+
Please report suspected security vulnerabilities **privately**. Do **not** open a public GitHub issue for security reports.
|
|
10
|
+
|
|
11
|
+
Email: security@signalsafe.software
|
|
12
|
+
|
|
13
|
+
Include a description, reproduction steps, affected versions, and impact if known. We aim to acknowledge reports within five business days.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Security boundaries
|
|
17
|
+
|
|
18
|
+
This package provides a **headless React Flow canvas shell** for TreeSpec editing. It does not include Bootstrap, routing, or API clients.
|
|
19
|
+
|
|
20
|
+
- It renders and edits authoring data supplied by the host application via props and callbacks.
|
|
21
|
+
- The host application is responsible for authentication, authorization, persistence, server-side validation, and sanitizing any user-generated labels or hints before display.
|
|
22
|
+
- React Flow node/edge content should be treated as trusted authoring data unless the host validates it.
|
package/dist/hooks/types.d.ts
CHANGED
|
@@ -117,6 +117,10 @@ export interface UseTreeSpecEditorOptions {
|
|
|
117
117
|
autosaveDebounceMs?: number;
|
|
118
118
|
/** Enable/disable autosave entirely. Default `true`. */
|
|
119
119
|
enableAutosave?: boolean;
|
|
120
|
+
/** Prevent all graph changes and persistence writes without changing publication metadata. */
|
|
121
|
+
readOnly?: boolean;
|
|
122
|
+
/** Save failures resolve safely, retain unsaved state and notify this optional observer. */
|
|
123
|
+
onSaveError?: (error: unknown) => void;
|
|
120
124
|
/** Enable/disable the global keyboard shortcut listener. Default `true`. */
|
|
121
125
|
enableKeyboardShortcuts?: boolean;
|
|
122
126
|
/**
|
|
@@ -168,12 +172,16 @@ export interface UseTreeSpecEditorOptions {
|
|
|
168
172
|
}
|
|
169
173
|
/** Mutable editor state surfaced by {@link useTreeSpecEditor}. */
|
|
170
174
|
export interface UseTreeSpecEditorState {
|
|
175
|
+
/** Effective editing gate: explicit readOnly or actual publication. */
|
|
176
|
+
readOnly: boolean;
|
|
171
177
|
/** Loading the entity from the adapter. `true` until first load resolves or rejects. */
|
|
172
178
|
loading: boolean;
|
|
173
179
|
/** A `Save Draft` round-trip is in flight. */
|
|
174
180
|
saving: boolean;
|
|
175
181
|
/** Typed revision conflict from an opt-in adapter save contract, if any. */
|
|
176
182
|
saveConflict: TreeSpecSaveConflict | null;
|
|
183
|
+
/** Last save failure; null before a save attempt or after success/conflict. */
|
|
184
|
+
saveError: unknown | null;
|
|
177
185
|
/** A `Publish` round-trip is in flight. */
|
|
178
186
|
publishing: boolean;
|
|
179
187
|
/** A `Snapshot` round-trip is in flight. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/hooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,cAAc,EACd,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EACnB,MAAM,mCAAmC,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CA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,KAAK,IAAI,CAAC;IAE5D;;;OAGG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE,+EAA+E;IAC/E,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,mFAAmF;IACnF,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,+EAA+E;IAC/E,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,iFAAiF;IACjF,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B,sFAAsF;IACtF,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC7D;AAED,iDAAiD;AACjD,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB;IACnE,OAAO,EAAE,wBAAwB,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,sBAAsB,GAAG,IAAI,CAAC;AAErE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -36,6 +36,8 @@ export type UseEditorAdapterResult = {
|
|
|
36
36
|
showPublishModal: boolean;
|
|
37
37
|
setShowPublishModal: (next: boolean) => void;
|
|
38
38
|
validate: UseTreeSpecEditorActions['validate'];
|
|
39
|
+
saveError: unknown | null;
|
|
40
|
+
failedSaveKey: string | null;
|
|
39
41
|
saveDraft: UseTreeSpecEditorActions['saveDraft'];
|
|
40
42
|
createSnapshot: UseTreeSpecEditorActions['createSnapshot'];
|
|
41
43
|
restoreSnapshot: UseTreeSpecEditorActions['restoreSnapshot'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditorAdapter.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,gBAAgB,EAAE,K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AC1B,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,GAAG,IAAI,CAAC;IAC1B,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,CA4UhG"}
|
|
@@ -6,6 +6,8 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
6
6
|
const { adapter, entityId, coerceRawSpec = defaultCoerceRawSpec, onCloneNavigate, parseServerErrorMessage = defaultParseServerErrorMessage, shouldQueueInitialValidation = defaultShouldQueueInitialValidation, } = options;
|
|
7
7
|
const [loading, setLoading] = useState(true);
|
|
8
8
|
const [saving, setSaving] = useState(false);
|
|
9
|
+
const [saveError, setSaveError] = useState(null);
|
|
10
|
+
const [failedSaveKey, setFailedSaveKey] = useState(null);
|
|
9
11
|
const [saveConflict, setSaveConflict] = useState(null);
|
|
10
12
|
const [publishing, setPublishing] = useState(false);
|
|
11
13
|
const [rawTreeSpec, setRawTreeSpec] = useState(null);
|
|
@@ -23,8 +25,8 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
23
25
|
const [restoringSnapshotId, setRestoringSnapshotId] = useState(null);
|
|
24
26
|
const [creatingSnapshot, setCreatingSnapshot] = useState(false);
|
|
25
27
|
const [cloning, setCloning] = useState(false);
|
|
26
|
-
const validateRef = useRef(
|
|
27
|
-
const saveDraftRef = useRef(
|
|
28
|
+
const validateRef = useRef(() => Promise.resolve(undefined));
|
|
29
|
+
const saveDraftRef = useRef(() => Promise.resolve());
|
|
28
30
|
const compiledTreeSpec = useMemo(() => (tree ? compileTreeSpec(tree) : null), [tree]);
|
|
29
31
|
useEffect(() => {
|
|
30
32
|
let cancelled = false;
|
|
@@ -32,6 +34,8 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
32
34
|
if (!entityId)
|
|
33
35
|
return;
|
|
34
36
|
setLoading(true);
|
|
37
|
+
setSaveError(null);
|
|
38
|
+
setFailedSaveKey(null);
|
|
35
39
|
setVersionInfo(null);
|
|
36
40
|
try {
|
|
37
41
|
const raw = await adapter.getVersion(entityId);
|
|
@@ -142,12 +146,16 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
142
146
|
const saveDraft = useCallback(async () => {
|
|
143
147
|
if (!entityId || !tree)
|
|
144
148
|
return;
|
|
145
|
-
if (isPublished)
|
|
149
|
+
if (isPublished || options.readOnly)
|
|
146
150
|
return;
|
|
151
|
+
setSaveError(null);
|
|
152
|
+
setFailedSaveKey(null);
|
|
153
|
+
let attemptedKey = null;
|
|
147
154
|
setSaving(true);
|
|
148
155
|
setAutosaveStatus(AUTOSAVE_STATUS.SAVING);
|
|
149
156
|
try {
|
|
150
157
|
const compiled = compileTreeSpec(tree);
|
|
158
|
+
attemptedKey = JSON.stringify(compiled);
|
|
151
159
|
const payload = { tree_spec: compiled };
|
|
152
160
|
const result = adapter.saveVersion
|
|
153
161
|
? await adapter.saveVersion(entityId, payload, {
|
|
@@ -169,10 +177,23 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
169
177
|
lastSavedKeyRef.current = JSON.stringify(compiled);
|
|
170
178
|
setAutosaveStatus(AUTOSAVE_STATUS.SAVED);
|
|
171
179
|
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
setSaveConflict(null);
|
|
182
|
+
setSaveError(error ?? new Error('Save failed'));
|
|
183
|
+
setFailedSaveKey(attemptedKey);
|
|
184
|
+
setAutosaveStatus(AUTOSAVE_STATUS.DIRTY);
|
|
185
|
+
// Error observers must not reintroduce rejection into void UI callers.
|
|
186
|
+
try {
|
|
187
|
+
void Promise.resolve(options.onSaveError?.(error)).catch(() => undefined);
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
// The original save remains failed even if its observer fails too.
|
|
191
|
+
}
|
|
192
|
+
}
|
|
172
193
|
finally {
|
|
173
194
|
setSaving(false);
|
|
174
195
|
}
|
|
175
|
-
}, [adapter, entityId, isPublished, rawTreeSpec, tree, lastSavedKeyRef, setAutosaveStatus]);
|
|
196
|
+
}, [adapter, entityId, isPublished, rawTreeSpec, tree, lastSavedKeyRef, setAutosaveStatus, options.readOnly, options.onSaveError]);
|
|
176
197
|
useEffect(() => {
|
|
177
198
|
saveDraftRef.current = saveDraft;
|
|
178
199
|
}, [saveDraft]);
|
|
@@ -198,7 +219,7 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
198
219
|
};
|
|
199
220
|
}, [adapter, showDraftHistory, entityId]);
|
|
200
221
|
const createSnapshot = useCallback(async () => {
|
|
201
|
-
if (!entityId || !tree || !adapter.createSnapshot || !adapter.listSnapshots)
|
|
222
|
+
if (options.readOnly || !entityId || !tree || !adapter.createSnapshot || !adapter.listSnapshots)
|
|
202
223
|
return;
|
|
203
224
|
setCreatingSnapshot(true);
|
|
204
225
|
try {
|
|
@@ -210,9 +231,9 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
210
231
|
finally {
|
|
211
232
|
setCreatingSnapshot(false);
|
|
212
233
|
}
|
|
213
|
-
}, [adapter, entityId, tree]);
|
|
234
|
+
}, [adapter, entityId, tree, options.readOnly]);
|
|
214
235
|
const restoreSnapshot = useCallback(async (snapshotId) => {
|
|
215
|
-
if (!entityId || !adapter.restoreSnapshot)
|
|
236
|
+
if (options.readOnly || !entityId || !adapter.restoreSnapshot)
|
|
216
237
|
return;
|
|
217
238
|
setRestoringSnapshotId(snapshotId);
|
|
218
239
|
try {
|
|
@@ -229,7 +250,7 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
229
250
|
finally {
|
|
230
251
|
setRestoringSnapshotId(null);
|
|
231
252
|
}
|
|
232
|
-
}, [adapter, coerceRawSpec, entityId, replaceTreeWithoutHistory, lastSavedKeyRef, setAutosaveStatus]);
|
|
253
|
+
}, [adapter, coerceRawSpec, entityId, replaceTreeWithoutHistory, lastSavedKeyRef, setAutosaveStatus, options.readOnly]);
|
|
233
254
|
useEffect(() => {
|
|
234
255
|
const listAudit = adapter.listAudit;
|
|
235
256
|
if (!listAudit || !showAudit || !entityId)
|
|
@@ -252,7 +273,7 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
252
273
|
};
|
|
253
274
|
}, [adapter, showAudit, entityId]);
|
|
254
275
|
const cloneToDraft = useCallback(async () => {
|
|
255
|
-
if (!entityId || !adapter.cloneToDraft)
|
|
276
|
+
if (options.readOnly || !entityId || !adapter.cloneToDraft)
|
|
256
277
|
return;
|
|
257
278
|
setCloning(true);
|
|
258
279
|
try {
|
|
@@ -263,11 +284,13 @@ export function useEditorAdapter(adapterOptions) {
|
|
|
263
284
|
finally {
|
|
264
285
|
setCloning(false);
|
|
265
286
|
}
|
|
266
|
-
}, [adapter, entityId, onCloneNavigate]);
|
|
287
|
+
}, [adapter, entityId, onCloneNavigate, options.readOnly]);
|
|
267
288
|
return {
|
|
268
289
|
loading,
|
|
269
290
|
saving,
|
|
270
291
|
saveConflict,
|
|
292
|
+
saveError,
|
|
293
|
+
failedSaveKey,
|
|
271
294
|
publishing,
|
|
272
295
|
setPublishing,
|
|
273
296
|
creatingSnapshot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditorAutosave.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorAutosave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjF,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE1G,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,MAAM,wBAAwB,GAAG;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,eAAe,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C,YAAY,EAAE,SAAS,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC,CAAC;CAClE,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"useEditorAutosave.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorAutosave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjF,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE1G,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,MAAM,wBAAwB,GAAG;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,eAAe,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C,YAAY,EAAE,SAAS,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC,CAAC;CAClE,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CA8CzE"}
|
|
@@ -2,7 +2,7 @@ import { useEffect, useRef } from 'react';
|
|
|
2
2
|
import { compileTreeSpec } from '@signalsafe/tree-spec';
|
|
3
3
|
import { AUTOSAVE_STATUS } from '@signalsafe/tree-spec-editor-core';
|
|
4
4
|
export function useEditorAutosave(options) {
|
|
5
|
-
const { enableAutosave, autosaveDebounceMs, entityId, tree, isPublished, saving, publishing, autosaveStatus, setAutosaveStatus, lastSavedKeyRef, saveDraftRef, } = options;
|
|
5
|
+
const { enableAutosave, autosaveDebounceMs, entityId, tree, isPublished, saving, failedSaveKey = null, publishing, autosaveStatus, setAutosaveStatus, lastSavedKeyRef, saveDraftRef, } = options;
|
|
6
6
|
const autosaveTimerRef = useRef(null);
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
if (!enableAutosave)
|
|
@@ -15,6 +15,9 @@ export function useEditorAutosave(options) {
|
|
|
15
15
|
return;
|
|
16
16
|
const compiled = compileTreeSpec(tree);
|
|
17
17
|
const key = JSON.stringify(compiled);
|
|
18
|
+
// Preserve failure state; retry this payload explicitly, or autosave a new edit.
|
|
19
|
+
if (key === failedSaveKey)
|
|
20
|
+
return;
|
|
18
21
|
if (key === lastSavedKeyRef.current) {
|
|
19
22
|
if (autosaveStatus !== AUTOSAVE_STATUS.SAVED)
|
|
20
23
|
setAutosaveStatus(AUTOSAVE_STATUS.IDLE);
|
|
@@ -33,5 +36,5 @@ export function useEditorAutosave(options) {
|
|
|
33
36
|
// NOTE: autosaveStatus is intentionally NOT in deps. The dirty/idle
|
|
34
37
|
// bookkeeping above flips status, and re-running the effect on every
|
|
35
38
|
// status change would reset the debounce timer.
|
|
36
|
-
}, [tree, entityId, isPublished, saving, publishing, autosaveDebounceMs, enableAutosave]);
|
|
39
|
+
}, [tree, entityId, isPublished, saving, failedSaveKey, publishing, autosaveDebounceMs, enableAutosave]);
|
|
37
40
|
}
|
|
@@ -12,5 +12,5 @@ export type UseEditorHistoryResult = {
|
|
|
12
12
|
pasteCopiedNode: (setSelection: (next: GraphSelection) => void, setFocusNodeId: (id: string | null) => void) => boolean;
|
|
13
13
|
duplicateNodeById: (nodeId: string, setSelection: (next: GraphSelection) => void, setFocusNodeId: (id: string | null) => void) => string | undefined;
|
|
14
14
|
};
|
|
15
|
-
export declare function useEditorHistory(isPublished: boolean): UseEditorHistoryResult;
|
|
15
|
+
export declare function useEditorHistory(isPublished: boolean, readOnly?: boolean): UseEditorHistoryResult;
|
|
16
16
|
//# sourceMappingURL=useEditorHistory.d.ts.map
|
|
@@ -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,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AAC;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,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,EAC5C,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,KAC1C,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,UAAQ,GAAG,sBAAsB,CAuH/F"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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
|
-
export function useEditorHistory(isPublished) {
|
|
3
|
+
export function useEditorHistory(isPublished, readOnly = false) {
|
|
4
4
|
const [tree, setTree] = useState(null);
|
|
5
5
|
const historyRef = useRef(createEditorHistoryStack());
|
|
6
6
|
const copiedNodeIdRef = useRef(null);
|
|
@@ -19,6 +19,8 @@ export function useEditorHistory(isPublished) {
|
|
|
19
19
|
syncHistoryMeta();
|
|
20
20
|
}, [syncHistoryMeta]);
|
|
21
21
|
const commitTree = useCallback((next) => {
|
|
22
|
+
if (readOnly)
|
|
23
|
+
return;
|
|
22
24
|
setTree((prev) => {
|
|
23
25
|
if (prev && next && !editorTreesEqual(prev, next)) {
|
|
24
26
|
pushEditorHistory(historyRef.current, prev);
|
|
@@ -26,13 +28,13 @@ export function useEditorHistory(isPublished) {
|
|
|
26
28
|
return next;
|
|
27
29
|
});
|
|
28
30
|
queueMicrotask(syncHistoryMeta);
|
|
29
|
-
}, [syncHistoryMeta]);
|
|
31
|
+
}, [syncHistoryMeta, readOnly]);
|
|
30
32
|
const replaceTreeWithoutHistory = useCallback((next) => {
|
|
31
33
|
resetEditorHistory();
|
|
32
34
|
setTree(next);
|
|
33
35
|
}, [resetEditorHistory]);
|
|
34
36
|
const undo = useCallback(() => {
|
|
35
|
-
if (!tree || isPublished)
|
|
37
|
+
if (!tree || isPublished || readOnly)
|
|
36
38
|
return false;
|
|
37
39
|
const result = popEditorUndo(historyRef.current, tree);
|
|
38
40
|
if (!result)
|
|
@@ -41,9 +43,9 @@ export function useEditorHistory(isPublished) {
|
|
|
41
43
|
setTree(result.nextTree);
|
|
42
44
|
queueMicrotask(syncHistoryMeta);
|
|
43
45
|
return true;
|
|
44
|
-
}, [tree, isPublished, syncHistoryMeta]);
|
|
46
|
+
}, [tree, isPublished, readOnly, syncHistoryMeta]);
|
|
45
47
|
const redo = useCallback(() => {
|
|
46
|
-
if (!tree || isPublished)
|
|
48
|
+
if (!tree || isPublished || readOnly)
|
|
47
49
|
return false;
|
|
48
50
|
const result = popEditorRedo(historyRef.current, tree);
|
|
49
51
|
if (!result)
|
|
@@ -52,7 +54,7 @@ export function useEditorHistory(isPublished) {
|
|
|
52
54
|
setTree(result.nextTree);
|
|
53
55
|
queueMicrotask(syncHistoryMeta);
|
|
54
56
|
return true;
|
|
55
|
-
}, [tree, isPublished, syncHistoryMeta]);
|
|
57
|
+
}, [tree, isPublished, readOnly, syncHistoryMeta]);
|
|
56
58
|
const copySelectedNode = useCallback((selection) => {
|
|
57
59
|
if (selection.kind !== GRAPH_SELECTION_KIND.NODE || !selection.id)
|
|
58
60
|
return false;
|
|
@@ -63,7 +65,7 @@ export function useEditorHistory(isPublished) {
|
|
|
63
65
|
return true;
|
|
64
66
|
}, []);
|
|
65
67
|
const pasteCopiedNode = useCallback((setSelection, setFocusNodeId) => {
|
|
66
|
-
if (!tree || isPublished)
|
|
68
|
+
if (!tree || isPublished || readOnly)
|
|
67
69
|
return false;
|
|
68
70
|
const sourceId = copiedNodeIdRef.current;
|
|
69
71
|
if (!sourceId)
|
|
@@ -75,9 +77,9 @@ export function useEditorHistory(isPublished) {
|
|
|
75
77
|
setSelection({ kind: GRAPH_SELECTION_KIND.NODE, id: duplicated.nextNodeId });
|
|
76
78
|
setFocusNodeId(duplicated.nextNodeId);
|
|
77
79
|
return true;
|
|
78
|
-
}, [tree, isPublished, commitTree]);
|
|
80
|
+
}, [tree, isPublished, readOnly, commitTree]);
|
|
79
81
|
const duplicateNodeById = useCallback((nodeId, setSelection, setFocusNodeId) => {
|
|
80
|
-
if (!tree || isPublished)
|
|
82
|
+
if (!tree || isPublished || readOnly)
|
|
81
83
|
return undefined;
|
|
82
84
|
const duplicated = duplicateNode(tree, nodeId);
|
|
83
85
|
if (!duplicated)
|
|
@@ -86,7 +88,7 @@ export function useEditorHistory(isPublished) {
|
|
|
86
88
|
setSelection({ kind: GRAPH_SELECTION_KIND.NODE, id: duplicated.nextNodeId });
|
|
87
89
|
setFocusNodeId(duplicated.nextNodeId);
|
|
88
90
|
return duplicated.nextNodeId;
|
|
89
|
-
}, [tree, isPublished, commitTree]);
|
|
91
|
+
}, [tree, isPublished, readOnly, commitTree]);
|
|
90
92
|
return {
|
|
91
93
|
tree,
|
|
92
94
|
canUndo,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTreeSpecEditor.d.ts","sourceRoot":"","sources":["../../src/hooks/useTreeSpecEditor.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAER,wBAAwB,EACxB,uBAAuB,EAE1B,MAAM,YAAY,CAAC;AAcpB;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,uBAAuB,
|
|
1
|
+
{"version":3,"file":"useTreeSpecEditor.d.ts","sourceRoot":"","sources":["../../src/hooks/useTreeSpecEditor.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAER,wBAAwB,EACxB,uBAAuB,EAE1B,MAAM,YAAY,CAAC;AAcpB;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,uBAAuB,CAogB5F"}
|
|
@@ -21,11 +21,11 @@ function isTextFieldTarget(target) {
|
|
|
21
21
|
* modals, layout) on top of the returned state + actions.
|
|
22
22
|
*/
|
|
23
23
|
export function useTreeSpecEditor(options) {
|
|
24
|
-
const { adapter, entityId, autosaveDebounceMs = DEFAULT_AUTOSAVE_DEBOUNCE_MS, enableAutosave = true, enableKeyboardShortcuts = true, computeRuntimeIssues, debugMode = false, onPreview, } = options;
|
|
24
|
+
const { adapter, entityId, autosaveDebounceMs = DEFAULT_AUTOSAVE_DEBOUNCE_MS, enableAutosave = true, readOnly = false, enableKeyboardShortcuts = true, computeRuntimeIssues, debugMode = false, onPreview, } = options;
|
|
25
25
|
const lastSavedKeyRef = useRef('');
|
|
26
26
|
const [autosaveStatus, setAutosaveStatus] = useState(AUTOSAVE_STATUS.IDLE);
|
|
27
27
|
const [isPublished, setIsPublished] = useState(false);
|
|
28
|
-
const history = useEditorHistory(isPublished);
|
|
28
|
+
const history = useEditorHistory(isPublished, readOnly);
|
|
29
29
|
const { tree, canUndo, canRedo, hasCopiedNode, commitTree, replaceTreeWithoutHistory, undo, redo, copySelectedNode: copySelectedNodeInternal, pasteCopiedNode: pasteCopiedNodeInternal, duplicateNodeById: duplicateNodeByIdInternal, } = history;
|
|
30
30
|
const adapterState = useEditorAdapter({
|
|
31
31
|
options,
|
|
@@ -39,12 +39,13 @@ export function useTreeSpecEditor(options) {
|
|
|
39
39
|
const selectionState = useEditorSelection(tree);
|
|
40
40
|
const { selection, focusNodeId, focusChoiceId, fitViewNonce, selectedNode, selectedEdge, inspectorNode, selectChoice, applySelection, setFocusNodeId, setFocusChoiceId, triggerResetView, selectIssue, setSelection, } = selectionState;
|
|
41
41
|
useEditorAutosave({
|
|
42
|
-
enableAutosave,
|
|
42
|
+
enableAutosave: enableAutosave && !readOnly,
|
|
43
43
|
autosaveDebounceMs,
|
|
44
44
|
entityId,
|
|
45
45
|
tree,
|
|
46
46
|
isPublished,
|
|
47
47
|
saving: adapterState.saving,
|
|
48
|
+
failedSaveKey: adapterState.failedSaveKey,
|
|
48
49
|
publishing: adapterState.publishing,
|
|
49
50
|
autosaveStatus,
|
|
50
51
|
setAutosaveStatus,
|
|
@@ -80,9 +81,9 @@ export function useTreeSpecEditor(options) {
|
|
|
80
81
|
}
|
|
81
82
|
return out;
|
|
82
83
|
}, [adapterState.localIssues, adapterState.serverIssues, runtimeIssues, debugMode]);
|
|
83
|
-
const canPublish = useMemo(() => !issues.some((i) => i.severity === TREE_SPEC_ISSUE_SEVERITY.ERROR), [issues]);
|
|
84
|
+
const canPublish = useMemo(() => !readOnly && !issues.some((i) => i.severity === TREE_SPEC_ISSUE_SEVERITY.ERROR), [issues, readOnly]);
|
|
84
85
|
const publish = useCallback(async () => {
|
|
85
|
-
if (!entityId || !tree || !adapter.publish)
|
|
86
|
+
if (readOnly || !entityId || !tree || !adapter.publish)
|
|
86
87
|
return;
|
|
87
88
|
adapterState.setPublishing(true);
|
|
88
89
|
try {
|
|
@@ -98,12 +99,12 @@ export function useTreeSpecEditor(options) {
|
|
|
98
99
|
finally {
|
|
99
100
|
adapterState.setPublishing(false);
|
|
100
101
|
}
|
|
101
|
-
}, [adapter, adapterState, canPublish, entityId, tree]);
|
|
102
|
+
}, [adapter, adapterState, canPublish, entityId, tree, readOnly]);
|
|
102
103
|
const [nodeSearch, setNodeSearch] = useState('');
|
|
103
104
|
const [issueSearch, setIssueSearch] = useState('');
|
|
104
105
|
const [showMiniMap, setShowMiniMap] = useState(true);
|
|
105
106
|
const addNodeOfType = useCallback((type, patch) => {
|
|
106
|
-
if (!tree)
|
|
107
|
+
if (readOnly || !tree)
|
|
107
108
|
return undefined;
|
|
108
109
|
const id = `n_${safeUUID().slice(0, 8)}`;
|
|
109
110
|
const p = getNextSpawnPosition(tree);
|
|
@@ -118,39 +119,39 @@ export function useTreeSpecEditor(options) {
|
|
|
118
119
|
setSelection({ kind: GRAPH_SELECTION_KIND.NODE, id });
|
|
119
120
|
setFocusNodeId(id);
|
|
120
121
|
return id;
|
|
121
|
-
}, [tree, commitTree, setSelection, setFocusNodeId]);
|
|
122
|
+
}, [tree, readOnly, commitTree, setSelection, setFocusNodeId]);
|
|
122
123
|
const autoLayout = useCallback(() => {
|
|
123
|
-
if (!tree)
|
|
124
|
+
if (readOnly || !tree)
|
|
124
125
|
return;
|
|
125
126
|
commitTree(autoLayoutTree(tree));
|
|
126
127
|
triggerResetView();
|
|
127
|
-
}, [tree, commitTree, triggerResetView]);
|
|
128
|
+
}, [tree, readOnly, commitTree, triggerResetView]);
|
|
128
129
|
const insertTemplate = useCallback((spec) => {
|
|
129
|
-
if (!tree)
|
|
130
|
+
if (readOnly || !tree)
|
|
130
131
|
return;
|
|
131
132
|
const { nextTree, focusNodeId: spawnedFocusNodeId } = applyTreeTemplate(tree, spec);
|
|
132
133
|
commitTree(nextTree);
|
|
133
134
|
setSelection({ kind: GRAPH_SELECTION_KIND.NODE, id: spawnedFocusNodeId });
|
|
134
135
|
setFocusNodeId(spawnedFocusNodeId);
|
|
135
|
-
}, [tree, commitTree, setSelection, setFocusNodeId]);
|
|
136
|
+
}, [tree, readOnly, commitTree, setSelection, setFocusNodeId]);
|
|
136
137
|
const copySelectedNode = useCallback(() => copySelectedNodeInternal(selection), [copySelectedNodeInternal, selection]);
|
|
137
138
|
const pasteCopiedNode = useCallback(() => pasteCopiedNodeInternal(setSelection, setFocusNodeId), [pasteCopiedNodeInternal, setSelection, setFocusNodeId]);
|
|
138
139
|
const duplicateNodeById = useCallback((nodeId) => duplicateNodeByIdInternal(nodeId, setSelection, setFocusNodeId), [duplicateNodeByIdInternal, setSelection, setFocusNodeId]);
|
|
139
140
|
const updateSelectedNode = useCallback((patch) => {
|
|
140
|
-
if (!tree || !selectedNode)
|
|
141
|
+
if (readOnly || !tree || !selectedNode)
|
|
141
142
|
return;
|
|
142
143
|
const next = { ...selectedNode, ...patch };
|
|
143
144
|
commitTree({ ...tree, nodes: { ...tree.nodes, [selectedNode.id]: next } });
|
|
144
|
-
}, [tree, selectedNode, commitTree]);
|
|
145
|
+
}, [tree, readOnly, selectedNode, commitTree]);
|
|
145
146
|
const addChoice = useCallback(() => {
|
|
146
|
-
if (!tree || !selectedNode)
|
|
147
|
+
if (readOnly || !tree || !selectedNode)
|
|
147
148
|
return;
|
|
148
149
|
const choiceId = `c_${safeUUID().slice(0, 6)}`;
|
|
149
150
|
const nextChoice = { id: choiceId, label: 'New choice' };
|
|
150
151
|
updateSelectedNode({ choices: [...(selectedNode.choices ?? []), nextChoice] });
|
|
151
|
-
}, [tree, selectedNode, updateSelectedNode]);
|
|
152
|
+
}, [tree, readOnly, selectedNode, updateSelectedNode]);
|
|
152
153
|
const setChoiceType = useCallback((choiceId, typeId, defaultLabel) => {
|
|
153
|
-
if (!tree || !selectedNode)
|
|
154
|
+
if (readOnly || !tree || !selectedNode)
|
|
154
155
|
return;
|
|
155
156
|
const next = renameNodeChoiceId(tree, selectedNode.id, choiceId, typeId);
|
|
156
157
|
if (!next)
|
|
@@ -173,9 +174,9 @@ export function useTreeSpecEditor(options) {
|
|
|
173
174
|
if (focusChoiceId === choiceId) {
|
|
174
175
|
selectChoice(selectedNode.id, typeId);
|
|
175
176
|
}
|
|
176
|
-
}, [tree, selectedNode, commitTree, focusChoiceId, selectChoice]);
|
|
177
|
+
}, [tree, readOnly, selectedNode, commitTree, focusChoiceId, selectChoice]);
|
|
177
178
|
const deleteChoice = useCallback((choiceId) => {
|
|
178
|
-
if (!tree || !selectedNode)
|
|
179
|
+
if (readOnly || !tree || !selectedNode)
|
|
179
180
|
return;
|
|
180
181
|
const nextChoices = (selectedNode.choices ?? []).filter((c) => c.id !== choiceId);
|
|
181
182
|
const nextTree = deleteTransitionsForChoice(tree, selectedNode.id, choiceId);
|
|
@@ -186,9 +187,9 @@ export function useTreeSpecEditor(options) {
|
|
|
186
187
|
[selectedNode.id]: { ...selectedNode, choices: nextChoices },
|
|
187
188
|
},
|
|
188
189
|
});
|
|
189
|
-
}, [tree, selectedNode, commitTree]);
|
|
190
|
+
}, [tree, readOnly, selectedNode, commitTree]);
|
|
190
191
|
const moveChoice = useCallback((choiceId, direction) => {
|
|
191
|
-
if (!tree || !selectedNode)
|
|
192
|
+
if (readOnly || !tree || !selectedNode)
|
|
192
193
|
return;
|
|
193
194
|
const nextChoices = moveNodeChoice(selectedNode.choices ?? [], choiceId, direction);
|
|
194
195
|
if (!nextChoices)
|
|
@@ -200,18 +201,18 @@ export function useTreeSpecEditor(options) {
|
|
|
200
201
|
[selectedNode.id]: { ...selectedNode, choices: nextChoices },
|
|
201
202
|
},
|
|
202
203
|
});
|
|
203
|
-
}, [tree, selectedNode, commitTree]);
|
|
204
|
+
}, [tree, readOnly, selectedNode, commitTree]);
|
|
204
205
|
const repositionChoice = useCallback((fromNodeId, choiceId, toNodeId, toIndex) => {
|
|
205
|
-
if (!tree)
|
|
206
|
+
if (readOnly || !tree)
|
|
206
207
|
return;
|
|
207
208
|
const next = moveChoiceInTree(tree, fromNodeId, choiceId, toNodeId, toIndex);
|
|
208
209
|
if (!next)
|
|
209
210
|
return;
|
|
210
211
|
commitTree(next);
|
|
211
212
|
selectChoice(toNodeId, choiceId);
|
|
212
|
-
}, [tree, commitTree, selectChoice]);
|
|
213
|
+
}, [tree, readOnly, commitTree, selectChoice]);
|
|
213
214
|
const setChoiceTarget = useCallback((choiceId, targetNodeId) => {
|
|
214
|
-
if (!tree || !selectedNode)
|
|
215
|
+
if (readOnly || !tree || !selectedNode)
|
|
215
216
|
return;
|
|
216
217
|
const existing = getTransition(tree, selectedNode.id, choiceId);
|
|
217
218
|
const next = {
|
|
@@ -224,9 +225,9 @@ export function useTreeSpecEditor(options) {
|
|
|
224
225
|
: undefined,
|
|
225
226
|
};
|
|
226
227
|
commitTree(upsertTransition(tree, next));
|
|
227
|
-
}, [tree, selectedNode, commitTree]);
|
|
228
|
+
}, [tree, readOnly, selectedNode, commitTree]);
|
|
228
229
|
const setChoiceOutcome = useCallback((choiceId, outcome) => {
|
|
229
|
-
if (!tree || !selectedNode)
|
|
230
|
+
if (readOnly || !tree || !selectedNode)
|
|
230
231
|
return;
|
|
231
232
|
const existing = getTransition(tree, selectedNode.id, choiceId);
|
|
232
233
|
if (!existing)
|
|
@@ -238,9 +239,9 @@ export function useTreeSpecEditor(options) {
|
|
|
238
239
|
outcome !== TERMINAL_OUTCOME.COMPROMISED)
|
|
239
240
|
return;
|
|
240
241
|
commitTree(upsertTransition(tree, { ...existing, outcome }));
|
|
241
|
-
}, [tree, selectedNode, commitTree]);
|
|
242
|
+
}, [tree, readOnly, selectedNode, commitTree]);
|
|
242
243
|
const updateChoiceEdgeHints = useCallback((nodeId, choiceId, patch) => {
|
|
243
|
-
if (!tree)
|
|
244
|
+
if (readOnly || !tree)
|
|
244
245
|
return;
|
|
245
246
|
const node = tree.nodes[nodeId];
|
|
246
247
|
if (!node)
|
|
@@ -253,14 +254,14 @@ export function useTreeSpecEditor(options) {
|
|
|
253
254
|
[nodeId]: { ...node, choices },
|
|
254
255
|
},
|
|
255
256
|
});
|
|
256
|
-
}, [tree, commitTree]);
|
|
257
|
+
}, [tree, readOnly, commitTree]);
|
|
257
258
|
const setDefaultEdgeType = useCallback((edgeType) => {
|
|
258
|
-
if (!tree)
|
|
259
|
+
if (readOnly || !tree)
|
|
259
260
|
return;
|
|
260
261
|
commitTree(patchGraphEditorMeta(tree, { default_edge_type: edgeType }));
|
|
261
|
-
}, [tree, commitTree]);
|
|
262
|
+
}, [tree, readOnly, commitTree]);
|
|
262
263
|
const deleteNodeById = useCallback((nodeId) => {
|
|
263
|
-
if (!tree || isPublished)
|
|
264
|
+
if (readOnly || !tree || isPublished)
|
|
264
265
|
return false;
|
|
265
266
|
const nextTree = deleteNode(tree, nodeId);
|
|
266
267
|
if (!nextTree)
|
|
@@ -277,6 +278,7 @@ export function useTreeSpecEditor(options) {
|
|
|
277
278
|
return true;
|
|
278
279
|
}, [
|
|
279
280
|
tree,
|
|
281
|
+
readOnly,
|
|
280
282
|
isPublished,
|
|
281
283
|
selection,
|
|
282
284
|
focusNodeId,
|
|
@@ -304,12 +306,12 @@ export function useTreeSpecEditor(options) {
|
|
|
304
306
|
canUndo,
|
|
305
307
|
canRedo,
|
|
306
308
|
hasCopiedNode,
|
|
307
|
-
isPublished,
|
|
309
|
+
isPublished: isPublished || readOnly,
|
|
308
310
|
});
|
|
309
311
|
dispatchEditorKeyboardShortcut(shortcutAction, e, {
|
|
310
312
|
tree,
|
|
311
313
|
selection,
|
|
312
|
-
isPublished,
|
|
314
|
+
isPublished: isPublished || readOnly,
|
|
313
315
|
onPreview,
|
|
314
316
|
undo,
|
|
315
317
|
redo,
|
|
@@ -335,6 +337,7 @@ export function useTreeSpecEditor(options) {
|
|
|
335
337
|
canRedo,
|
|
336
338
|
hasCopiedNode,
|
|
337
339
|
isPublished,
|
|
340
|
+
readOnly,
|
|
338
341
|
undo,
|
|
339
342
|
redo,
|
|
340
343
|
copySelectedNode,
|
|
@@ -346,9 +349,11 @@ export function useTreeSpecEditor(options) {
|
|
|
346
349
|
adapterState.validateRef,
|
|
347
350
|
]);
|
|
348
351
|
const state = {
|
|
352
|
+
readOnly: readOnly || isPublished,
|
|
349
353
|
loading: adapterState.loading,
|
|
350
354
|
saving: adapterState.saving,
|
|
351
355
|
saveConflict: adapterState.saveConflict,
|
|
356
|
+
saveError: adapterState.saveError,
|
|
352
357
|
publishing: adapterState.publishing,
|
|
353
358
|
creatingSnapshot: adapterState.creatingSnapshot,
|
|
354
359
|
cloning: adapterState.cloning,
|
|
@@ -384,8 +389,8 @@ export function useTreeSpecEditor(options) {
|
|
|
384
389
|
showDraftHistory: adapterState.showDraftHistory,
|
|
385
390
|
showAudit: adapterState.showAudit,
|
|
386
391
|
showPublishModal: adapterState.showPublishModal,
|
|
387
|
-
canUndo,
|
|
388
|
-
canRedo,
|
|
392
|
+
canUndo: canUndo && !readOnly,
|
|
393
|
+
canRedo: canRedo && !readOnly,
|
|
389
394
|
hasCopiedNode,
|
|
390
395
|
};
|
|
391
396
|
const actions = {
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Current release: @signalsafe/tree-spec-editor-react 0.3.3
|
|
2
|
+
|
|
3
|
+
Status: coordinated release approved on 2026-10-21; registry availability is established by release verification receipts. Existing canonical source and host installations remain unchanged. The candidate combines the installed Step 5 capabilities with the verified package audit fixes; earlier dated state summaries and verification records remain historical evidence.
|
|
4
|
+
|
|
5
|
+
The package README describes supported entry points and behavior; `../RELEASING.md` describes the publication gate and order. Use the committed declaration in `../package.json` as the dependency authority. Candidate source, built files, packed archive, and isolated installed consumer must agree. Check actual gate receipts rather than inferring completion from this document.
|
|
6
|
+
|
|
7
|
+
TreeSpec `0.4.4` precedes editor-core `0.2.3`, editor-react `0.3.3`, editor `0.4.1` and theme `0.3.7`. Before publication, local archive proof verifies this chain without pretending unpublished versions can pass a frozen registry install. Registry lock refresh and published-dependency smoke verification remain staged until the upstream versions exist. React 18 / React Flow 11 support is retained.
|
|
8
|
+
|
|
9
|
+
## Review record
|
|
10
|
+
|
|
11
|
+
The canonical repository is preserved. Candidate changes are reviewed as a source delta over the verified remote baseline; frozen registry lock regeneration and final hosted checks remain separately recorded gates. Local passing tests do not establish production cutover or provider readiness.
|
|
@@ -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="
|
|
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="d4ec651e8472cdfb1155ba1c9a5ecaa9b787f82a8fa92503e4a1f9b3a6e19bf1">
|
|
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&height=16&type=arrowclosed&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&height=16&type=arrowclosed&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.0476427776058 196.40243279061667)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="253.90472412109375" x="-2" y="-4" height="20.19512176513672" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6.097560882568359" 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&height=16&type=arrowclosed&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.1280379876857 137.4024231143114)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="331.743896484375" x="-2" y="-4" height="20.19512176513672" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6.097560882568359" 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&height=16&type=arrowclosed&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.8658664982493 233.90242720813285)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="258.26829528808594" x="-2" y="-4" height="20.19512176513672" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6.097560882568359" 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&height=16&type=arrowclosed&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.2442548798351 167.40243241845107)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="321.5114440917969" x="-2" y="-4" height="20.19512176513672" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6.097560882568359" 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&height=16&type=arrowclosed&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.0693915762554 174.9024175318276)" class="react-flow__edge-textwrapper" visibility="visible"><rect width="139.8612823486328" x="-2" y="-4" height="20.19512176513672" class="react-flow__edge-textbg" rx="2" ry="2"></rect><text class="react-flow__edge-text" y="6.097560882568359" 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&height=16&type=arrowclosed&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&height=16&type=arrowclosed&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&height=16&type=arrowclosed&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&height=16&type=arrowclosed&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&height=16&type=arrowclosed&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&height=16&type=arrowclosed&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>
|
|
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.
|
|
3
|
+
"version": "0.3.3",
|
|
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",
|
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
"dist",
|
|
38
38
|
"README.md",
|
|
39
39
|
"LICENSE",
|
|
40
|
-
"docs"
|
|
40
|
+
"docs",
|
|
41
|
+
"CHANGELOG.md",
|
|
42
|
+
"RELEASING.md",
|
|
43
|
+
"SECURITY.md"
|
|
41
44
|
],
|
|
42
45
|
"engines": {
|
|
43
46
|
"node": ">=22.12.0"
|
|
@@ -61,8 +64,8 @@
|
|
|
61
64
|
"test:monorepo": "cd ../../frontend && yarn vitest run --config vitest.tree-spec-editor-react.config.ts"
|
|
62
65
|
},
|
|
63
66
|
"dependencies": {
|
|
64
|
-
"@signalsafe/tree-spec": "^0.4.
|
|
65
|
-
"@signalsafe/tree-spec-editor-core": "^0.2.
|
|
67
|
+
"@signalsafe/tree-spec": "^0.4.4",
|
|
68
|
+
"@signalsafe/tree-spec-editor-core": "^0.2.3"
|
|
66
69
|
},
|
|
67
70
|
"peerDependencies": {
|
|
68
71
|
"react": "^18.0.0",
|
|
@@ -73,14 +76,14 @@
|
|
|
73
76
|
"@types/react": "^18.2.66",
|
|
74
77
|
"@types/react-dom": "^18.2.22",
|
|
75
78
|
"@types/react-test-renderer": "^18.3.0",
|
|
76
|
-
"@vitest/coverage-v8": "
|
|
79
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
77
80
|
"playwright": "^1.62.1",
|
|
78
81
|
"react": "^18.3.1",
|
|
79
82
|
"react-dom": "^18.3.1",
|
|
80
83
|
"react-test-renderer": "^18.3.1",
|
|
81
84
|
"reactflow": "^11.11.4",
|
|
82
85
|
"typescript": "^7.0.2",
|
|
83
|
-
"vite": "
|
|
84
|
-
"vitest": "
|
|
86
|
+
"vite": "8.3.4",
|
|
87
|
+
"vitest": "5.0.5"
|
|
85
88
|
}
|
|
86
89
|
}
|