feat: UI element creation API - #576
Merged
Merged
Conversation
…ed to match suggestions
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
YousefED
reviewed
Feb 14, 2024
YousefED
left a comment
Collaborator
There was a problem hiding this comment.
Awesome, only some small comments and these things we should discuss together:
- was thinking there's some repetitive code, maybe we can simplify this? Although then I stumbled upon the Table + Suggestion implementations which do differ, so maybe it's not that useful
- Discuss naming of
Default**** - Discuss API of
BlockNoteDefaultUI - I think I still need to review the "final state" of the mentions implementation, right? e.g.: #534 (comment)
YousefED
reviewed
Feb 14, 2024
YousefED
reviewed
Feb 14, 2024
58 tasks
58 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on the findings from implementing the custom suggestion menu API, this PR changes how UI elements and their positioners are created. There are now 2 hooks for each UI element:
useUiElementData- Provides the data associated with the UI element, e.g.block,dragStart, etc for the side menu.useUiElementPosition- Provides attributes which, when added to the UI element's parent, control and position it.This should make it easier and more intuitive to create custom menus, since menu data and position props are separated, making each of them easier to explain.