Skip to content

clean getitems - #579

Merged
YousefED merged 10 commits into
mentions-suggestionsfrom
mentions-suggestions-getitems
Feb 15, 2024
Merged

clean getitems#579
YousefED merged 10 commits into
mentions-suggestionsfrom
mentions-suggestions-getitems

Conversation

@YousefED

@YousefED YousefED commented Feb 14, 2024

Copy link
Copy Markdown
Collaborator

With this PR, any type T can be returned from getItems, as long as it's also expected by the element passed as suggestionMenuComponent. When using the default component MantineSuggestionMenu, we expect DefaultSuggestionItem as items.

Also:

  • the click handling is now separated from the items
  • separated / cleaned the default items a bit

TODO:

  • testing
  • determine highest level API. e.g.: do we want to keep the current slashMenuItems API working? (not too much effort I think)
  • discuss overall API / mentions API

@vercel

vercel Bot commented Feb 14, 2024

Copy link
Copy Markdown

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 2:31pm
blocknote-website ✅ Ready (Inspect) Visit Preview Feb 15, 2024 2:31pm

@matthewlipski matthewlipski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Minor comments

Comment thread packages/react/src/components/SuggestionMenu/DefaultPositionedSuggestionMenu.tsx Outdated
Comment thread packages/react/src/components/SuggestionMenu/DefaultPositionedSuggestionMenu.tsx Outdated
…ns-getitems

# Conflicts:
#	packages/react/src/components/SuggestionMenu/DefaultPositionedSuggestionMenu.tsx
#	packages/react/src/index.ts
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.

2 participants