docs: document other extensions#819
Conversation
- Refactored JSDoc comments for table attributes to define tableIndent as a TableIndent type, improving clarity and organization of documentation. - Added a new typedef for TableIndent to specify indent width and type, enhancing the overall structure of the codebase.
- Updated JSDoc comments for the BulletList module to improve clarity and organization. - Added a new typedef for BulletListOptions to specify configuration options for the bullet list. - Included detailed descriptions for attributes and commands to enhance documentation consistency.
… configuration - Improved JSDoc comments for the BookmarkStart module to clarify its purpose and usage. - Added typedefs for BookmarkConfig and BookmarkOptions to specify bookmark attributes and options. - Enhanced documentation for attributes to improve clarity and organization.
- Improved JSDoc comments for the Color extension to clarify its purpose and usage. - Added typedefs for ColorValue and ColorOptions to specify color formats and configuration options. - Included detailed descriptions for commands and attributes to enhance documentation consistency and organization.
- Changed sidebar title from "Color" to "Text Color" for clarity. - Reformatted code for the setColor and unsetColor functions to enhance readability by adjusting indentation and line breaks.
…rDoc into feature/har-10409-superdoc-docs-other-extensions
…nd content block management - Implemented `insertBookmark` and `goToBookmark` commands in the bookmarks extension for easier navigation and insertion of bookmarks. - Added `insertHorizontalRule` and `insertContentBlock` commands in the content-block extension to facilitate the creation of visual separators and customizable content blocks. - Enhanced JSDoc comments and typedefs for better documentation clarity and organization.
… JSDoc and focus management - Added detailed JSDoc comments and typedefs for selection state and plugin functionality. - Improved focus management by refining event handling for clicks outside the editor and toolbar interactions. - Ensured better type checking for toolbar elements to enhance robustness.
- Introduced `getDocumentStats` command to retrieve word, character, and paragraph counts from the document. - Added `clearDocument` command to replace all content with an empty paragraph. - Enhanced JSDoc comments for the Document module, including detailed descriptions for commands and attributes to improve clarity and organization.
…and typedefs - Added JSDoc comments and typedefs for FontFamilyValue and FontFamilyOptions to clarify usage and configuration. - Improved documentation for commands setFontFamily and unsetFontFamily, including examples and notes for better understanding. - Organized the code structure to enhance readability and maintainability.
… and typedefs - Added detailed JSDoc comments and typedefs for FontSizeDefaults, FontSizeValue, and FontSizeOptions to clarify configuration and usage. - Improved documentation for commands setFontSize and unsetFontSize, including examples and notes for better understanding. - Organized code structure to enhance readability and maintainability.
…oc and typedefs - Added detailed JSDoc comments and typedefs for StoredStyle and FormatCommands to clarify usage and functionality. - Improved documentation for commands clearFormat, clearMarksFormat, clearNodesFormat, and copyFormat, including examples and notes for better understanding. - Organized code structure to enhance readability and maintainability.
… typedefs - Added detailed JSDoc comments and typedefs for HeadingAttributes and HeadingOptions to clarify usage and configuration. - Improved documentation for commands setHeading and toggleHeading, including examples and notes for better understanding. - Organized code structure to enhance readability and maintainability.
… typedefs - Added detailed JSDoc comments and typedefs for HistoryConfig and HistoryOptions to clarify configuration and usage. - Improved documentation for undo and redo commands, including examples and notes for better understanding. - Organized code structure to enhance readability and maintainability.
…oc and commands - Added detailed JSDoc comments and typedefs for LineBreak and HardBreak modules to clarify usage and configuration. - Introduced commands `insertLineBreak` and `insertPageBreak` for inserting line and page breaks, respectively, with examples and notes for better understanding. - Organized code structure to enhance readability and maintainability.
…SDoc and typedefs - Added detailed JSDoc comments and typedefs for LineHeightValue and LineHeightOptions to clarify usage and configuration. - Improved documentation for commands setLineHeight and unsetLineHeight, including examples and notes for better understanding. - Organized code structure to enhance readability and maintainability.
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive JSDoc documentation to various editor extensions to improve developer experience and API discoverability. The documentation includes type definitions, command descriptions with examples, keyboard shortcuts, and sidebar navigation metadata.
- Adds JSDoc comments with type definitions for all extension options, attributes, and commands
- Includes practical usage examples and keyboard shortcuts in the documentation
- Standardizes documentation format across all extensions with consistent categories and metadata
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/super-editor/src/extensions/table/table.js | Refactored table indent configuration into separate typedef for better type clarity |
| packages/super-editor/src/extensions/line-height/line-height.js | Added comprehensive documentation for line height extension with type definitions and command examples |
| packages/super-editor/src/extensions/line-break/line-break.js | Documented line break and hard break nodes with new command methods |
| packages/super-editor/src/extensions/history/history.js | Added documentation for undo/redo functionality with keyboard shortcuts |
| packages/super-editor/src/extensions/heading/heading.js | Documented heading extension with level configuration and toggle commands |
| packages/super-editor/src/extensions/format-commands/format-commands.js | Added documentation for formatting commands and fixed import path |
| packages/super-editor/src/extensions/font-size/font-size.js | Enhanced font size extension with improved type handling and documentation |
| packages/super-editor/src/extensions/font-family/font-family.js | Added complete documentation for font family extension |
| packages/super-editor/src/extensions/document/document.js | Documented document node with new utility commands |
| packages/super-editor/src/extensions/custom-selection/custom-selection.js | Enhanced selection handling with better type checking and documentation |
| packages/super-editor/src/extensions/content-block/content-block.js | Added documentation and new commands for content block functionality |
| packages/super-editor/src/extensions/color/color.js | Documented color extension with comprehensive type definitions |
| packages/super-editor/src/extensions/bullet-list/bullet-list.js | Added documentation for bullet list with improved input rule comments |
| packages/super-editor/src/extensions/bookmarks/bookmarks.js | Enhanced bookmark functionality with navigation commands and documentation |
| packages/super-editor/src/core/helpers/list-numbering-helpers.js | Fixed JSDoc parameter documentation for createNewList function |
Comments suppressed due to low confidence (2)
packages/super-editor/src/extensions/custom-selection/custom-selection.js:325
- [nitpick] The event listener removal uses a different function reference (clickHandler vs handleClickOutside). While this is actually correct in the updated code, the variable name should be consistent to avoid confusion.
},
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| }); | ||
|
|
||
| if (targetPos !== null) { | ||
| editor.commands.focus(targetPos); |
There was a problem hiding this comment.
The focus command is being called with a position parameter, but focus commands typically don't accept position parameters. This should likely use a selection-setting command instead.
| editor.commands.focus(targetPos); | |
| editor.commands.setTextSelection(targetPos); | |
| editor.commands.focus(); |
No description provided.