-
-
Notifications
You must be signed in to change notification settings - Fork 643
feat: UI element creation API #576
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
Merged
YousefED
merged 8 commits into
mentions-suggestions
from
ui-component-creation-refactor
Feb 15, 2024
Merged
feat: UI element creation API #576
YousefED
merged 8 commits into
mentions-suggestions
from
ui-component-creation-refactor
Feb 15, 2024
Conversation
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
…ed to match suggestions
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
YousefED
reviewed
Feb 14, 2024
Collaborator
YousefED
left a comment
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.
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)
packages/react/src/components/FormattingToolbar/hooks/useFormattingToolbarPosition.ts
Outdated
Show resolved
Hide resolved
packages/react/src/components/HyperlinkToolbar/hooks/useHyperlinkToolbarData.ts
Outdated
Show resolved
Hide resolved
packages/react/src/components/TableHandles/hooks/useTableHandlesPosition.ts
Outdated
Show resolved
Hide resolved
YousefED
reviewed
Feb 14, 2024
packages/core/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts
Outdated
Show resolved
Hide resolved
YousefED
reviewed
Feb 14, 2024
packages/react/src/components-shared/DefaultPositionedUiElement.tsx
Outdated
Show resolved
Hide resolved
58 tasks
58 tasks
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.