Added editor option to disable nested blocks#408
Added editor option to disable nested blocks#408abasse wants to merge 7 commits intoTypeCellOS:mainfrom
Conversation
|
Someone is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Looks good! Though these changes will still let you nest/unnest blocks programatically, e.g. using the formatting toolbar. I think we need 2 more things before we merge this:
|
Thanks for the feedback! I had a look at the code, but I'm not really sure where to start. Is that something you would be able to look at? |
|
The editor option is now called "enableNestedBlocks" to avoid conflicts with the existing function with the same name. |
Move enable nested blocks property
|
I'm looking to disable nesting as well |
This PR adds an option to the editor to disable nested blocks. (on tab command or via formatting toolbar)
example configuration "canNestBlock":
export type BlockNoteEditorOptions = Partial<{ editable: boolean; canNestBlock: boolean; initialContent: PartialBlock[]; editorDOMAttributes: Record<string, string>; onEditorReady: (editor: BlockNoteEditor) => void; onEditorContentChange: (editor: BlockNoteEditor) => void; onTextCursorPositionChange: (editor: BlockNoteEditor) => void; slashMenuItems: ReactSlashMenuItem[]; defaultStyles: boolean; uploadFile: (file: File) => Promise<string> }>;