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

[Documentation][lexical-website]: Documentation for useLexical node selection hook #6976

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

Kingscliq
Copy link
Contributor

Description

Add documentation for the useLexicalNodeSelection hook.

Closes #6975

Before

No documentation existed for the useLexicalNodeSelection hook, making it harder for developers to integrate and use.

After

Comprehensive documentation added for the useLexicalNodeSelection hook, including usage examples, parameter details, and return values for improved clarity and ease of integration.

Copy link

vercel bot commented Dec 18, 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 Dec 18, 2024 1:20pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 1:20pm

@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 Dec 18, 2024
Copy link

size-limit report 📦

Path Size
lexical - cjs 31.29 KB (0%)
lexical - esm 31.11 KB (0%)
@lexical/rich-text - cjs 40.34 KB (0%)
@lexical/rich-text - esm 33.04 KB (0%)
@lexical/plain-text - cjs 38.88 KB (0%)
@lexical/plain-text - esm 30.3 KB (0%)
@lexical/react - cjs 42.12 KB (0%)
@lexical/react - esm 34.29 KB (0%)

Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

Looks like a nice straightforward improvement and it renders well on the doc portal https://lexical-oyrm7dqtd-fbopensource.vercel.app/docs/api/modules/lexical_react_useLexicalNodeSelection

I don't see any usage examples but I don't see any reason not to approve this as-is, those could always be added separately

Comment on lines +24 to +26
* @param {LexicalEditor} editor - The LexicalEditor instance.
* @param {NodeKey} key - The key of the node to check.
* @returns {boolean} Whether the node is selected.
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: it's redundant to repeat the types in the comments, because typedoc will fill that in using the actual types. This function also isn't exported so there's not as much reason to spend the time on it, the purpose is fairly clear from the name and types alone.

@etrepum etrepum added this pull request to the merge queue Dec 18, 2024
Merged via the queue into facebook:main with commit 62b3713 Dec 18, 2024
40 of 41 checks passed
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.

[Documentation] Documentation for useLexicalNodeSelection hook lexical-react
3 participants