tldraw
tldraw copied to clipboard
[Feature]: Allow overwrite default utils
What's the feature?
Error: Shape type "note" is defined more than once
I want to remove the default note, and add a more powerful one.
Contact Details
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Hey!
You can do that already. The only core shape right now is the Group shape. If you use the Tldraw component then we do use our default shapes. But if you would go with TldrawEditor component then you can avoid using those. You can take a look at our Exploded example. There we do pass in our default shapes, but you can also just filter out the note shape.
Okay, I was afraid of copy the code that define the Tldraw component, there are many other code in https://github.com/tldraw/tldraw/blob/main/packages/tldraw/src/lib/Tldraw.tsx like InsideOfEditorContext is not exported. If I have to copy that code, I will afraid of conflict in future update.
Makes sense. Will see if there's something we can do here. Either expose things that would be necessary to reproduce TldrawEditor or better extensibility of TldrawEditor. Thanks for the report!
And what about importing the default fonts and assets as well? With the exploded example the fonts are not imported.
Thanks
Also with the exploded example uploading assets does not work and options like acceptedImageMimeTypes or maxImageDimension cannot be set