Skip to content
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

[lexical-playground] Improve Excalidraw Integration By Only Creating Node After Saving Drawing #6677

Closed
wants to merge 14 commits into from

Conversation

neysanfoo
Copy link
Contributor

Description

This PR refactors the Excalidraw integration in the Lexical playground. These changes aim to make the Excalidraw integration more maintainable and consistent with the practices used in the other plugins, such as the image/equation plugin. The main changes include:

The improved functionalities include:

Code Changes

Before

The Excalidraw node was created immediately upon invoking the INSERT_EXCALIDRAW_COMMAND from the toolbar.

After

  • The INSERT_EXCALIDRAW_COMMAND now opens the ExcalidrawModal without immediately creating a node
  • The Excalidraw node is only created after the user saves content in the modal
  • The ExcalidrawModal is now a UI component.
  • All existing functionality (editing, resizing, etc.) is preserved. I have checked all permutations of creating/editing and discarding/saving images and it works as expected.

Collab Mode

Before

collab_mode_before.mov

After

collab_mode_after.mov

Single User Mode

Refer to #6666 under the UX improvements section. The UX is the same, but instead of using "history-merge" to achieve it, I have now decoupled the modal and node creation.

Copy link

vercel bot commented Sep 27, 2024

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

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 8:41am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 8:41am

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 27, 2024
Copy link

github-actions bot commented Sep 27, 2024

size-limit report 📦

Path Size
lexical - cjs 29.82 KB (0%)
lexical - esm 29.67 KB (0%)
@lexical/rich-text - cjs 38.42 KB (0%)
@lexical/rich-text - esm 31.51 KB (0%)
@lexical/plain-text - cjs 37.01 KB (0%)
@lexical/plain-text - esm 28.9 KB (0%)
@lexical/react - cjs 40.17 KB (0%)
@lexical/react - esm 32.97 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants