Skip to content

Conversation

@matthewlipski
Copy link
Collaborator

@matthewlipski matthewlipski commented Feb 13, 2024

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.

@vercel
Copy link

vercel bot commented Feb 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Feb 15, 2024 1:30pm
blocknote-website ✅ Ready (Inspect) Visit Preview Feb 15, 2024 1:30pm

Copy link
Collaborator

@YousefED YousefED left a 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants