Skip to content

Latest commit

 

History

History

react-basic

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

React annotation layer

All examples · Live demo · Source

A React-rendered workflow with a separate annotation SVG layer.

Run

From the repository root, after npm ci:

npm run example -- examples/react-basic

Open the local URL printed by Vite. See the catalog for setup, rebuilding library code, and running the complete published site locally.

What to try

Inspect the workflow and notes, then drag a note handle into clear space and observe the committed update. A drop that obscures a protected workflow region is rejected without crashing the host; the live status message explains the rejection.

Host and package boundary

React state, the underlying workflow SVG, and overlay mounting belong to this host.

The host uses the most recent DOM-measured resolved note boxes when assessing an edit. Its shared validateHostAnnotationEdit recipe checks proposed source changes before accepting an edit patch, and only commits if evaluateAnnotationLayout considers the new layout acceptable. The annotation library emits suggestions; it does not persist them or implement host undo/validation.

This example uses input mode: annotations and bounds let the layer solve locally. In input mode, debug requests eight candidate diagnostics unless diagnostics supplies a different count. For a host-resolved result, pass only layout plus presentation props; alternatives come from its existing diagnostics.

The source lives in main.tsx, with its host styles in styles.css. Read the integration guide before copying an advanced pattern into an application.

Version note

This fixture follows the checked-out repository revision. The public demo tracks main and can be ahead of the npm release. Match installed package versions to release notes.