From b0053fb8113c5daffa8acd2de4130cc7e9853d76 Mon Sep 17 00:00:00 2001 From: Damon Cook Date: Thu, 6 Jun 2024 15:57:02 -0400 Subject: [PATCH 1/2] Add JSDoc block for TableOfContents editor component --- .../editor/src/components/table-of-contents/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/editor/src/components/table-of-contents/index.js b/packages/editor/src/components/table-of-contents/index.js index c63fdbfd83e25c..74a535240833d6 100644 --- a/packages/editor/src/components/table-of-contents/index.js +++ b/packages/editor/src/components/table-of-contents/index.js @@ -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 ); From fc07d54d001f8e756eaa4351d33fe6ed79f5de8d Mon Sep 17 00:00:00 2001 From: Damon Cook Date: Thu, 6 Jun 2024 15:57:21 -0400 Subject: [PATCH 2/2] Auto-generate editor docs for TableOfContents --- packages/editor/README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/editor/README.md b/packages/editor/README.md index d4161f9bac6266..8b9260d4b8d51c 100644 --- a/packages/editor/README.md +++ b/packages/editor/README.md @@ -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