-
-
Notifications
You must be signed in to change notification settings - Fork 555
feat: customize formatting toolbar and sidemenu #142
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
Conversation
I'm not sure about letting consumers just pass JSX directly into the formatting toolbar, mainly because it seems to be the opposite approach to the slash menu. I agree it makes it more extensible, but idk if extensibility is something we want to focus on for the premade menu, moreso consistency. Might need to have a longer discussion about this since it's relevant for all menus. Alternative:
And pass a |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
packages/react/src/FormattingToolbar/components/DefaultButtons/CreateLinkButton.tsx
Show resolved
Hide resolved
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.
see inline + double check useCallbacks
* simplify colorpicker * Added basic mouse cursor position * Added drag handle menu customization API * Copied changes from PR and minor improvements * Small changes * Added `DragHandleMenuItem` component * Fixed side menu unnecessary updates * Removed unnecessary state * Cleaned up code * Changed how the side menu gets the hovered block * Added side menu image * Added docs * Fixed comments in demo * Made all menus/toolbars scroll with page * Revert "Made all menus/toolbars scroll with page" This reverts commit ee61bd0. * Removed `editor` from dynamic props * Documentation changes * Small cleanup * Vanilla example fix --------- Co-authored-by: Matthew Lipski <[email protected]> Co-authored-by: Matthew Lipski <[email protected]>
* simplify formattingtoolbar * Fixed React component types and added customizable formatting toolbar factory * Finished formatting toolbar customization with old props * Changed formatting toolbar props to use BlockNoteEditor * Fixed text alignment with basic selection object * Fixed block nesting tests * Removed multiple block shorthand for updateBlock * Added comments * Removed redundant useCallback hooks * Split `getActiveLink` to get text & url separately * Removed unnecessary functions and `useCallback` hooks * removed unnecessary `focus` calls * Small fix * Inline code style fix * Added docs * Small update * Made selection undefined if nothing is selected * Added selection docs * Added styling docs * Added nesting & un-nesting docs * Small fix * Added selection demo * Minor fixes * fix: hyperlink creation menu losing focus on click (TypeCellOS#168) * Doc changes & cleanup * feat: customizable sidemenu (TypeCellOS#143) * simplify colorpicker * Added basic mouse cursor position * Added drag handle menu customization API * Copied changes from PR and minor improvements * Small changes * Added `DragHandleMenuItem` component * Fixed side menu unnecessary updates * Removed unnecessary state * Cleaned up code * Changed how the side menu gets the hovered block * Added side menu image * Added docs * Fixed comments in demo * Made all menus/toolbars scroll with page * Revert "Made all menus/toolbars scroll with page" This reverts commit ee61bd0. * Removed `editor` from dynamic props * Documentation changes * Small cleanup * Vanilla example fix --------- Co-authored-by: Matthew Lipski <[email protected]> Co-authored-by: Matthew Lipski <[email protected]> --------- Co-authored-by: Matthew Lipski <[email protected]> Co-authored-by: Matthew Lipski <[email protected]>
Work in progress: I think FormattingToolbar can be really simple. If so, we could then expose ToolbarButton to consumers, and they can just use JSX to create a custom formattingtoolbar. I think this is a more extensible approach than for example asking for a custom array defining which buttons to show in what order
FormattingToolbarProps
still make sense? or should we (partially) move this toBlockNoteEditor
?Merge update: this includes custom sidemenu #143