Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rich Text Editor | Implementation of additional APIs (#1446)
# Pull Request ## 🤨 Rationale See the [API section of the spec](https://github.com/ni/nimble/tree/main/packages/nimble-components/src/rich-text-editor/specs#api). ## 👩💻 Implementation * Implemented the following APIs: 1. `disabled` - boolean attribute when enabled, set the Tiptap's editable state to false through [setEditable()](https://tiptap.dev/api/editor#set-editable) and set the `disabled` attribute of "nimble-toggle-button". 2. `footer-hidden` - hide the footer through styles. 3. `placeholder` - installed Tiptap's [Placeholder](https://tiptap.dev/api/extensions/placeholder) extension and configured the styles to show the placeholder text when the editor is empty. 4. `empty` - read-only property that returns "true" if the editor is empty by getting the current "textContent" of the editor. 5. `error-visible` - styled the editor with error color and added an exclamation icon to the editor same as in the "nimble-textarea". Used the "ResizeObserver" to update the scrollbar width and position of the error icon in the editor accordingly. 6. `error-text` - shows the text in the bottom left of the editor just like other nimble components. * Bumped all the `@tiptap` extensions to the latest version. ## 🧪 Testing * Added visual matrix tests to test the combinations of all the UI-related APIs. * Added unit tests for the APIs which cannot be covered in visual tests. * Manually verified the functionalities in the local storybook build. ## ✅ Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [x] I have updated the project documentation to reflect my changes or determined no changes are needed. ---------
- Loading branch information