-
-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add disableExtensions option to allow disabling built in extensions by name. #858
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@fridaystreet is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! The only thing that might be a bit finicky is that enableBlockNoteExtensions
also exists, and disableExtensions
is basically the same thing but lets you disable specific extensions instead of all of them. Basically what I'm saying is you can probably just remove the enableBlockNoteExtensions
option since your new one is the same but better:)
@matthewlipski ok great thanks. Yeah at first I actually just used enableBlockExtensions and made it string[] | boolean but after looking at it a few times it didn't feel like it made sense at it would imply you need to pass an array of all of the enabled ones just omitting the disabled ones. I wasn't sure if there was some bigger picture reason for being to just disable/enable the whole thing with enableBlockNoteExtensions so opted for the extra parameter. I agree possibly it adds confusion with 2, but then again, if someone does want to disable all of them, they'd have to maintain an array full of all the extension names so maybe it is better to leave both. I guess another option could be to just have explicit arrays for both, that way if you're looking to only enable some or only disable some it's easy, but probably overkill and confusing enableExtensions string[] | boolean | undefined Thanks for reveiwing it though. let me know if you want me to submit another PR |
All good, I think the use case of disabling all TipTap extensions is extremely rare since at that point you're probably better off just using a different editor, so I went ahead with removing |
Without completely needing to refactor the way tiptap extensions and core blocknote extensions are added, this should be fairly simple approach to just allow a list of extension names to be passed in that will then be removed from the inbuiult extensions before being passed to tiptap.
This will allow you to the override these extensions if you wish without completely disbaling blocknote via