tldraw icon indicating copy to clipboard operation
tldraw copied to clipboard

[Feature]: Allow overwrite default utils

Open linonetwo opened this issue 2 years ago • 6 comments

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

linonetwo avatar Sep 23 '23 13:09 linonetwo

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.

MitjaBezensek avatar Nov 10 '23 11:11 MitjaBezensek

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.

linonetwo avatar Nov 10 '23 12:11 linonetwo

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!

MitjaBezensek avatar Nov 10 '23 13:11 MitjaBezensek

And what about importing the default fonts and assets as well? With the exploded example the fonts are not imported.

Thanks

irg1008 avatar Nov 23 '23 09:11 irg1008

Also with the exploded example uploading assets does not work and options like acceptedImageMimeTypes or maxImageDimension cannot be set

irg1008 avatar Nov 23 '23 09:11 irg1008