diff --git a/packages/editor/README.md b/packages/editor/README.md index 8279ec3e743605..f5a209274f3550 100644 --- a/packages/editor/README.md +++ b/packages/editor/README.md @@ -1399,11 +1399,24 @@ Undocumented declaration. ### PostTrash -Undocumented declaration. +Displays the Post Trash Button and Confirm Dialog in the Editor. + +_Returns_ + +- `JSX.Element|null`: The rendered PostTrash component. ### PostTrashCheck -Undocumented declaration. +Wrapper component that renders its children only if the post can trashed. + +_Parameters_ + +- _props_ `Object`: - The component props. +- _props.children_ `Element`: - The child components to render. + +_Returns_ + +- `Component|null`: The rendered child components or null if the post can not trashed. ### PostTypeSupportCheck @@ -1577,7 +1590,9 @@ _Returns_ ### TextEditorGlobalKeyboardShortcuts -Undocumented declaration. +Component handles the global keyboard shortcuts for the Text editor. + +It provides functionality for various keyboard shortcuts such as toggling editor mode, toggling distraction-free mode, undo/redo. ### ThemeSupportCheck @@ -1595,7 +1610,11 @@ _Returns_ ### TimeToRead -Undocumented declaration. +Component for showing Time To Read in Content. + +_Returns_ + +- `JSX.Element`: The rendered TimeToRead component. ### transformStyles diff --git a/packages/editor/src/components/index.js b/packages/editor/src/components/index.js index e84942345fb322..0e2410e7f456d0 100644 --- a/packages/editor/src/components/index.js +++ b/packages/editor/src/components/index.js @@ -106,4 +106,11 @@ export { default as EditorProvider } from './provider'; export * from './deprecated'; export const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts; + +/** + * Component handles the global keyboard shortcuts for the Text editor. + * + * It provides functionality for various keyboard shortcuts such as toggling editor mode, + * toggling distraction-free mode, undo/redo. + */ export const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts; diff --git a/packages/editor/src/components/post-trash/check.js b/packages/editor/src/components/post-trash/check.js index b86cdf2e3d4d7a..abb3b4381d95cf 100644 --- a/packages/editor/src/components/post-trash/check.js +++ b/packages/editor/src/components/post-trash/check.js @@ -9,6 +9,14 @@ import { store as coreStore } from '@wordpress/core-data'; */ import { store as editorStore } from '../../store'; +/** + * Wrapper component that renders its children only if the post can trashed. + * + * @param {Object} props - The component props. + * @param {Element} props.children - The child components to render. + * + * @return {Component|null} The rendered child components or null if the post can not trashed. + */ export default function PostTrashCheck( { children } ) { const { canTrashPost } = useSelect( ( select ) => { const { isEditedPostNew, getCurrentPostId, getCurrentPostType } = diff --git a/packages/editor/src/components/post-trash/index.js b/packages/editor/src/components/post-trash/index.js index ebb078804da6d4..92f21c9643bb12 100644 --- a/packages/editor/src/components/post-trash/index.js +++ b/packages/editor/src/components/post-trash/index.js @@ -14,6 +14,11 @@ import { useState } from '@wordpress/element'; */ import { store as editorStore } from '../../store'; +/** + * Displays the Post Trash Button and Confirm Dialog in the Editor. + * + * @return {JSX.Element|null} The rendered PostTrash component. + */ export default function PostTrash() { const { isNew, isDeleting, postId } = useSelect( ( select ) => { const store = select( editorStore ); diff --git a/packages/editor/src/components/time-to-read/index.js b/packages/editor/src/components/time-to-read/index.js index 41b458124c6f3b..a71a4b1dac8388 100644 --- a/packages/editor/src/components/time-to-read/index.js +++ b/packages/editor/src/components/time-to-read/index.js @@ -20,6 +20,11 @@ import { store as editorStore } from '../../store'; */ const AVERAGE_READING_RATE = 189; +/** + * Component for showing Time To Read in Content. + * + * @return {JSX.Element} The rendered TimeToRead component. + */ export default function TimeToRead() { const content = useSelect( ( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),