Skip to content

Tweak CodeNode to allow for overrides - #3731

Merged
thegreatercurve merged 4 commits into
meta:mainfrom
abelsj60:tweakCodeNodeTypesForNodeOverrides
Jan 17, 2023
Merged

thegreatercurve merged 4 commits into
meta:mainfrom
abelsj60:tweakCodeNodeTypesForNodeOverrides

Conversation

@abelsj60

@abelsj60 abelsj60 commented Jan 16, 2023 •

Copy link
Copy Markdown
Contributor

This pull request is the first of at least two that are also needed to implement my LinedCodeNode without patches.

I've extended my work on this node to allow it to override the official CodeNode via the override API so it can work with — I hope — Lexical's existing core library packages, notably @lexical/markdown.

In this pull request:

  • Reduced priority level for several importDOM converters so an overriding CodeNode can take over
    • Without this, the official CodeNode will win the race to control how importDOM elements are handled
  • Exposed the editor config in the CodeNode's updateDOM method
  • Added a more generic return type to the CodeNode's collapseAtStart method so CodeNode overrides can apply more nuanced logic

Coming soon-ish:

A pull request to make the new setBlocksType_experimental function more flexible.

Recent related pull requests:

#3693
#3695

@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 Jan 16, 2023
@vercel

vercel Bot commented Jan 16, 2023 •

Copy link
Copy Markdown

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

Name Status Preview Comments Updated
lexical ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 16, 2023 at 7:10PM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 16, 2023 at 7:10PM (UTC)

@fantactuka

Copy link
Copy Markdown
Contributor

Loos good!

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — c02956fd Deployed Jan 16, 2023 by vercel[bot]
Preview – lexical — c02956fd Deployed Jan 16, 2023 by vercel[bot]
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants