You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,8 @@ The SDK is the only npm-published workspace; everything else under `apps/` and `
145
145
```
146
146
4. Open PR to `main`. The changeset file is part of the PR diff — reviewer sees the declared bump alongside the change.
147
147
148
+
**`<WorkflowBuilder.Root>` props live on three surfaces.** The type in `packages/sdk/src/workflow-builder-root/workflow-builder-root.types.ts` is the source of truth; the `/api/core/workflowbuilderrootprops/` reference is generated from its JSDoc and never drifts. Two hand-written tables mirror it: `packages/sdk/README.md` (npm landing) and `apps/docs/src/content/docs/guides/configuring-the-editor.md` (docs guide). When you add, rename, or remove a prop, update both tables in the same change. Descriptions may differ per surface (the README leans on gotchas, the guide on how / when); the set of prop names must match.
149
+
148
150
**Release moment** (maintainer, not Claude):
149
151
150
152
1. Open PR `release/vX.Y.Z` → `release`. In the branch, run `pnpm changeset version` — bumps `packages/sdk/package.json`, regenerates `packages/sdk/CHANGELOG.md`, deletes consumed `.changeset/*.md`.
-**One instance per page (required).** Multi-instance is not supported.
19
-
Plugin / JsonForms / i18n registries are module-level singletons shared
20
-
across mounts, and the imperative `useStore.{getState,setState,subscribe}`
21
-
facade resolves through a module-level "current" pointer — two
22
-
`<WorkflowBuilder.Root>` on the same page would silently fight over both.
23
-
If you need multiple "workflows" on one page, render them sequentially
24
-
(mount → save → unmount → mount next).
18
+
:::caution
19
+
Mount only one `<WorkflowBuilder.Root>` per page. Multi-instance is not supported. See [Side effects & limitations](/get-started/side-effects/) for the details and how to swap workflows on one page.
20
+
:::
25
21
26
22
## Installation
27
23
@@ -57,36 +53,14 @@ xyflow, JsonForms, i18next, immer and zustand are kept external because
57
53
they expose singletons (store identity, i18next instance, frozen-object
58
54
caches) — your app and the SDK must share a single copy of each.
59
55
60
-
### Installing from a local checkout (contributors)
61
-
62
-
If you're developing against an unpublished build of the SDK, run
63
-
`pnpm build:lib` from the monorepo root to produce
64
-
`packages/sdk/dist/`, then install the local path in your consumer:
The SDK exposes a single compound component, `WorkflowBuilder`. Mount
86
59
`<WorkflowBuilder.Root>` at the top of your editor subtree; with no
87
60
children it renders the default layout (top bar, palette, canvas,
88
-
properties panel). Compose with the named subcomponents when you need a
89
-
custom layout.
61
+
properties panel).
62
+
63
+
`<WorkflowBuilder.Root>` takes a small set of optional props. See [Configuring the editor](/guides/configuring-the-editor/) for the full props reference and for composing a custom layout, or the auto-generated [API reference](/api/core/workflowbuilderroot/).
90
64
91
65
### Hello world
92
66
@@ -117,202 +91,17 @@ function App() {
117
91
}
118
92
```
119
93
120
-
### Custom layout
121
-
122
-
Pass children to skip the default layout and compose your own:
123
-
124
-
```tsx
125
-
<WorkflowBuilder.RootnodeTypes={myNodeTypes}>
126
-
<header>
127
-
<WorkflowBuilder.TopBar />
128
-
</header>
129
-
<aside>
130
-
<WorkflowBuilder.Palette />
131
-
</aside>
132
-
<main>
133
-
<WorkflowBuilder.Canvas />
134
-
</main>
135
-
<aside>
136
-
<WorkflowBuilder.PropertiesPanel />
137
-
</aside>
138
-
</WorkflowBuilder.Root>
139
-
```
140
-
141
-
To add custom overlays alongside the default layout, mount it explicitly:
142
-
143
-
```tsx
144
-
<WorkflowBuilder.RootnodeTypes={myNodeTypes}>
145
-
<WorkflowBuilder.DefaultLayout />
146
-
<MyToastBanner />
147
-
</WorkflowBuilder.Root>
148
-
```
149
-
150
-
### Custom layout without the app bar
151
-
152
-
`<WorkflowBuilder.TopBar />` ships the save, import / export, settings, read-only, and theme controls. When you omit it from a custom layout, reach the same commands through the `useWorkflowBuilderActions()` hook. Call it from any descendant of `<WorkflowBuilder.Root>` and wire the returned callbacks to your own buttons:
The hook returns a stable object, so you can pass any callback straight to an event handler. See [`WorkflowBuilderActions`](/api/hooks/workflowbuilderactions/) for the full action list. A few notes:
174
-
175
-
- It must be called from a descendant of `<WorkflowBuilder.Root>`. `save` reads the active [integration strategy](#integration-strategies) via context, so calling the hook outside Root resolves `save()` to `'error'` and logs a warning.
176
-
- The hook also exposes layout-direction control the bar does not surface: `setLayoutDirection('RIGHT' | 'DOWN')` (idempotent) and `toggleLayoutDirection({ flipPositions?, fitView? })`. `flipPositions` mirrors each node's `x`/`y` as a naive axis swap. It is not auto-layout and ignores node sizes, so pair it with `fitView`. That is why it lives only on the toggle, not on `setLayoutDirection`.
177
-
- The top bar also shows and edits the document name. Render your own with `useStore`: read `s.documentName` and write through `s.setDocumentName`.
|`nodeTypes`|`PaletteItemOrGroup[]`| Node type definitions. Appear in the palette and drive validation. |
196
-
|`nodeTemplates`|`WorkflowBuilderNodeTemplates`| Per-node-type custom renderers. Map of `data.type` → React component, overriding the default node renderer for that type. |
197
-
|`diagramTemplates`|`TemplateModel[]`| Diagram templates available in the template selector. |
- Persistence: [localStorage](/get-started/persistence/localstorage/), [REST API](/get-started/persistence/rest-api/), [via callback](/get-started/persistence/callback/) - load and save diagram data
104
+
-[Add a custom node type](/guides/add-a-custom-node/) - register a new node with its own properties
105
+
-[Build a plugin](/guides/build-a-plugin/) - toolbar buttons, decorators, function hooks, translations
106
+
-[Custom JsonForms control](/guides/custom-jsonforms-control/) - render node properties with your own components
0 commit comments