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

Add documentation for EditorHistoryRedo and EditorHistoryUndo #60932

Merged

Conversation

akasunil
Copy link
Member

@akasunil akasunil commented Apr 21, 2024

What?

Part of: #60358

Added documentation in the readme for EditorHistoryRedo and EditorHistoryUndo components and also on components itself.

/** @typedef {import('react').Ref<HTMLElement>} Ref */

/**
* Component to Renders the redo button for the editor history.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Component to Renders the redo button for the editor history.
* Renders the redo button for the editor history.

/** @typedef {import('react').Ref<HTMLElement>} Ref */

/**
* Component to Renders the undo button for the editor history.
Copy link
Contributor

@ntsekouras ntsekouras Apr 25, 2024

Choose a reason for hiding this comment

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

Suggested change
* Component to Renders the undo button for the editor history.
* Renders the undo button for the editor history.

You'll need to build the docs after the change.

@ntsekouras ntsekouras added [Type] Developer Documentation Documentation for developers [Package] Editor /packages/editor labels Apr 25, 2024
@ntsekouras ntsekouras marked this pull request as ready for review April 25, 2024 07:27
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sunil25393 <[email protected]>
Co-authored-by: ntsekouras <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I've left two small comments about the description, but the most important part is that we have to move the comments above the exported module, in order for the docs generation script to pick them up.

So move what you wrote above: export default forwardRef( EditorHistoryUndo ); and for redo respectively.

After you do that, you just have to npm run docs:build and not manually update the README file. I'll update the main issue with these info.

@akasunil
Copy link
Member Author

most important part is that we have to move the comments above the exported module, in order for the docs generation script to pick them up.

That worked like charm. Thanks for the help.

* Renders the redo button for the editor history.
*
* @param {Object} props - Props.
* @param {Ref} ref - Reference with the element.
Copy link
Contributor

@ntsekouras ntsekouras Apr 25, 2024

Choose a reason for hiding this comment

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

Last comment, sorry about not doing it before. Let's update both Ref descriptions to Forwarded ref

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Thank you!

@ntsekouras ntsekouras enabled auto-merge (squash) April 25, 2024 10:31
@ntsekouras ntsekouras merged commit 64f9d9d into WordPress:trunk Apr 25, 2024
60 checks passed
@github-actions github-actions bot added this to the Gutenberg 18.3 milestone Apr 25, 2024
@akasunil akasunil deleted the update/documentation-editorundo-redo branch April 25, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Editor /packages/editor [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants