91903c9761
With the new work on bindings, we no longer need to keep any arrows stuff hard-coded in `editor`, so let's move it to `tldraw` with the rest of the shapes. Couple other changes as part of this: - We had two different types of `WeakMap` backed cache, but we now only have one - There's a new free-standing version of `createComputedCache` that doesn't need access to the editor/store in order to create the cache. instead, it returns a `{get(editor, id)}` object and instantiates the cache on a per-editor basis for each call. - Fixed a bug in `createSelectedComputedCache` where the selector derivation would get re-created on every call to `get` ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `improvement` — Improving existing features ### Release Notes #### Breaking changes - `editor.getArrowInfo(shape)` has been replaced with `getArrowInfo(editor, shape)` - `editor.getArrowsBoundTo(shape)` has been removed. Instead, use `editor.getBindingsToShape(shape, 'arrow')` and follow the `fromId` of each binding to the corresponding arrow shape - These types have moved from `@tldraw/editor` to `tldraw`: - `TLArcInfo` - `TLArrowInfo` - `TLArrowPoint` - `WeakMapCache` has been removed |
||
---|---|---|
.. | ||
src | ||
api-extractor.json | ||
api-report.md | ||
CHANGELOG.md | ||
LICENSE.md | ||
package.json | ||
patchedJestJsDom.js | ||
README.md | ||
tsconfig.json |
@tldraw/utils
This package contains utility functions used in various places by other tldraw packages.
Community
Have questions, comments or feedback? Join our discord or start a discussion.
Distributions
You can find tldraw on npm here.
Contribution
Please see our contributing guide. Found a bug? Please submit an issue.
License
The tldraw source code and its distributions are provided under the tldraw license. This license does not permit commercial use.
If you wish to use this project in commercial product, you need to purchase a commercial license. Please contact us at hello@tldraw.com for more inforion about obtaining a commercial license.
Trademarks
Copyright (c) 2023-present tldraw Inc. The tldraw name and logo are trademarks of tldraw. Please see our trademark guidelines for info on acceptable usage.
Contact
Find us on Twitter at @tldraw or email hello@tldraw.com. You can also join our discord for quick help and support.