Skip to content

Commit

Permalink
Documentation: TableOfContents editor component (WordPress#62385)
Browse files Browse the repository at this point in the history
* Add JSDoc block for TableOfContents editor component

* Auto-generate editor docs for TableOfContents
  • Loading branch information
colorful-tones authored and patil-vipul committed Jun 17, 2024
1 parent 05a6a9b commit aa48ac7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,18 @@ _Type_

### TableOfContents

Undocumented declaration.
Renders a table of contents component.

_Parameters_

- _props_ `Object`: The component props.
- _props.hasOutlineItemsDisabled_ `boolean`: Whether outline items are disabled.
- _props.repositionDropdown_ `boolean`: Whether to reposition the dropdown.
- _ref_ `Element.ref`: The component's ref.

_Returns_

- `JSX.Element`: The rendered table of contents component.

### TextEditorGlobalKeyboardShortcuts

Expand Down
10 changes: 10 additions & 0 deletions packages/editor/src/components/table-of-contents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,14 @@ function TableOfContents(
);
}

/**
* Renders a table of contents component.
*
* @param {Object} props The component props.
* @param {boolean} props.hasOutlineItemsDisabled Whether outline items are disabled.
* @param {boolean} props.repositionDropdown Whether to reposition the dropdown.
* @param {Element.ref} ref The component's ref.
*
* @return {JSX.Element} The rendered table of contents component.
*/
export default forwardRef( TableOfContents );

0 comments on commit aa48ac7

Please sign in to comment.