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
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,29 @@ Undocumented declaration.

### EditorHistoryRedo

Undocumented declaration.
Component to Renders the redo button for the editor history.

_Parameters_

- _props_ `Object`: - Props.
- _ref_ `Ref`: - Reference with the element.

_Returns_

- `Component`: The component to be rendered.

### EditorHistoryUndo

Undocumented declaration.
Component to Renders the undo button for the editor history.

_Parameters_

- _props_ `Object`: - Props.
- _ref_ `Ref`: - Reference with the element.

_Returns_

- `Component`: The component to be rendered.

### EditorKeyboardShortcuts

Expand Down
10 changes: 10 additions & 0 deletions packages/editor/src/components/editor-history/redo.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ import { forwardRef } from '@wordpress/element';
*/
import { store as editorStore } from '../../store';

/** @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.

*
* @param {Object} props - Props.
* @param {Ref} ref - Reference with the element.
*
* @return {Component} The component to be rendered.
*/
function EditorHistoryRedo( props, ref ) {
const shortcut = isAppleOS()
? displayShortcut.primaryShift( 'z' )
Expand Down
10 changes: 10 additions & 0 deletions packages/editor/src/components/editor-history/undo.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ import { forwardRef } from '@wordpress/element';
*/
import { store as editorStore } from '../../store';

/** @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.

*
* @param {Object} props - Props.
* @param {Ref} ref - Reference with the element.
*
* @return {Component} The component to be rendered.
*/
function EditorHistoryUndo( props, ref ) {
const hasUndo = useSelect(
( select ) => select( editorStore ).hasEditorUndo(),
Expand Down
Loading