[lexical-react][lexical-playground] FloatingUI Context Menu#7509
[lexical-react][lexical-playground] FloatingUI Context Menu#7509ivailop7 merged 22 commits intofacebook:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@etrepum This is ready to skim over. Playground is produced fine. I'll fix the types tomorrow. Most of the code is canonical as per the FloatingUI example for a context menu. I had to make some creative choices for the conditional rendering and the editor.read for the underlying node, since the examples use pre-defined children to the main component and wanted to keep the main render components exposed to be overridden. Welcoming interface comments. |
|
The things I'd do differently in the interface:
As far as the implementation goes, just some things I'd simplify:
|
Great! Thanks! I'll fix those up. The reason I split the conditional and default options was, that conditional options was intended as on object offering multiple items per 1 rule eval, vs 1 rule for 1 option, but forgot to do it. One last question I have is, should I add a new plugin in the react package and export ContextMenu2 and make this opt-in and make the breaking change later when we have all menus migrated vs now. |
|
Maybe call it NodeContextMenu and deprecate the other one? |
|
It seems that there's something in here that causes the collab tests to fail a lot more frequently, I restarted the tests and there are still a bunch of failures |
Yeah, consistently pass locally, but not in CI, will play with a diff playwright syntax, maybe that's the key. Will redo the tests tonight. |
etrepum
left a comment
There was a problem hiding this comment.
I think this looks good but we should add some API docs to LexicalNodeContextMenuPlugin.
Maybe the ContextMenu export should be renamed to NodeContextMenuPlugin? It doesn't really follow the naming convention of the other plugin modules where something with the same name as the module (sans the Lexical prefix) is exported
Happy to rename it, I want to complete the LexicalMenu migration for all menus and then I'll do API docs in a separate PR. |
Co-authored-by: Bob Ippolito <bob@redivi.com>
Fixes #13386 Below I write a clarification to copy and paste into the release note, based on our latest upgrade of Lexical [in v3.29.0](https://github.com/payloadcms/payload/releases/tag/v3.29.0). ## Important This release upgrades the lexical dependency from 0.28.0 to 0.34.0. If you installed lexical manually, update it to 0.34.0. Installing lexical manually is not recommended, as it may break between updates, and our re-exported versions should be used. See the [yellow banner box](https://payloadcms.com/docs/rich-text/custom-features) for details. If you still encounter richtext-lexical errors, do the following, in this order: - Delete node_modules - Delete your lockfile (e.g. pnpm-lock.json) - Reinstall your dependencies (e.g. pnpm install) ### Lexical Breaking Changes The following Lexical releases describe breaking changes. We recommend reading them if you're using Lexical APIs directly (`@payloadcms/richtext-lexical/lexical/*`). - [v.0.33.0](https://github.com/facebook/lexical/releases/tag/v0.33.0) - [v.0.30.0](https://github.com/facebook/lexical/releases/tag/v0.30.0) - [v.0.29.0](https://github.com/facebook/lexical/releases/tag/v0.29.0) ___ TODO: - [x] facebook/lexical#7719 - [x] facebook/lexical#7362 - [x] facebook/lexical#7707 - [x] facebook/lexical#7388 - [x] facebook/lexical#7357 - [x] facebook/lexical#7352 - [x] facebook/lexical#7472 - [x] facebook/lexical#7556 - [x] facebook/lexical#7417 - [x] facebook/lexical#1036 - [x] facebook/lexical#7509 - [x] facebook/lexical#7693 - [x] facebook/lexical#7408 - [x] facebook/lexical#7450 - [x] facebook/lexical#7415 - [x] facebook/lexical#7368 - [x] facebook/lexical#7372 - [x] facebook/lexical#7572 - [x] facebook/lexical#7558 - [x] facebook/lexical#7613 - [x] facebook/lexical#7405 - [x] facebook/lexical#7420 - [x] facebook/lexical#7662 --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1211202581885926
A complete rewrite of the ContextMenu using FloatingUI without using the current LexicalMenu component. This makes the migration of the other typeahead menus to FloatingUI easier.
This PR introduces the following improvements: