87e3d60c90
This PR reworks the `canBind` callback to work with customizable bindings. It now accepts an object with a the shape, the other shape (optional - it may not exist yet), the direction, and the type of the binding. Devs can use this to create shapes that only participate in certain binding types, can have bindings from but not to them, etc. If you're implementing a binding, you can see if binding two shapes is allowed using `editor.canBindShapes(fromShape, toShape, 'my binding type')` ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `improvement` — Improving existing features ### Release Notes #### Breaking changes The `canBind` flag now accepts an options object instead of just the shape in question. If you're relying on its arguments, you need to change from `canBind(shape) {}` to `canBind({shape}) {}`. |
||
---|---|---|
.. | ||
apps-script | ||
docs | ||
dotcom | ||
dotcom-asset-upload | ||
dotcom-bookmark-extractor | ||
dotcom-worker | ||
examples | ||
health-worker | ||
huppy | ||
vscode |