@dschz/solid-flow 0.3.0-next.2 → 0.3.0-next.4
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/README.md +18 -0
- package/dist/index/index.d.ts +321 -65
- package/dist/index/index.js +204 -109
- package/dist/index/index.jsx +119 -66
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -184,8 +184,26 @@ const nodeData = useNodesData(["node-1", "node-2"]);
|
|
|
184
184
|
|
|
185
185
|
// Node connection information
|
|
186
186
|
const connections = useNodeConnections("node-1");
|
|
187
|
+
|
|
188
|
+
// Which node/edge a nested component is rendered inside (for building
|
|
189
|
+
// composable custom nodes and edge labels without prop drilling)
|
|
190
|
+
const nodeId = useNodeId();
|
|
191
|
+
const edgeId = useEdgeId();
|
|
187
192
|
```
|
|
188
193
|
|
|
194
|
+
#### Coming from React Flow?
|
|
195
|
+
|
|
196
|
+
Some React Flow hooks intentionally have no Solid Flow equivalent, because
|
|
197
|
+
Solid's fine-grained reactivity makes them unnecessary:
|
|
198
|
+
|
|
199
|
+
- `useOnSelectionChange` / `useOnViewportChange` — reading `flow.selection`
|
|
200
|
+
or `flow.viewport` (from `useSolidFlow()`) in a tracked scope IS the
|
|
201
|
+
subscription; wrap side effects in `createEffect` over those reads.
|
|
202
|
+
- `useNodesState` / `useEdgesState` — use `createNodeStore` /
|
|
203
|
+
`createEdgeStore` instead.
|
|
204
|
+
- `useStore` — the reactive `flow` struct is the supported read surface;
|
|
205
|
+
there is no public escape hatch into internals.
|
|
206
|
+
|
|
189
207
|
### Utility Functions
|
|
190
208
|
|
|
191
209
|
```tsx
|