Repository navigation
[lexical-website] Documentation Update: fix syntax errors, outdated APIs, and broken links in Node Transforms guide - #9197
Conversation
…PIs, and broken links in Node Transforms guide
|
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Description
This PR updates the Node Transforms documentation guide (
packages/lexical-website/docs/concepts/transforms.md) to resolve syntax errors, outdated API calls, invalid type signatures, and broken links:Syntax Fixes in Code Examples:
);to theeditor.registerNodeTransform(TextNode, ...)precondition example (previously terminated with just}).paragraph.append($createTextNode('foo'));in the parent node transform example...placeholder with standard() => {}.API & Helper Modernization:
editor.addListener('update', ...)call witheditor.registerUpdateListener(({editorState}) => ...).$textContentidentifier with$getRoot().getTextContent()insideeditorState.read().TypeScript Signature Modernization:
editor.registerNodeTransformsignature from Flow syntax<T: LexicalNode>(Class<T>, T)to TypeScript<T extends LexicalNode>(klass: Klass<T>, listener: Transform<T>): () => void.registerLexicalTextEntitysignature from Flow syntax (<N: TextNode>,Class<N>) to TypeScript (<T extends TextNode>,Klass<T>).Broken Link Fixes:
EmojisPlugin/index.ts->EmojisExtension/index.tsAutoLinkPlugin/index.tsx->AutoLinkExtension/index.tsGrammar:
Test plan
Documentation-only change. Verified that:
main.packages/lexical/src/LexicalEditor.tsandpackages/lexical-text/src/registerLexicalTextEntity.ts.Before
paragraph.append($createTextNode('foo');missing closing parenthesis.registerNodeTransformexample missing closing);.editor.addListenerand$textContentare not exported or implemented in Lexical.EmojisPlugin/index.tsandAutoLinkPlugin/index.tsxresult in HTTP 404.After
EmojisExtension/index.tsandAutoLinkExtension/index.ts(HTTP 200).