-
Notifications
You must be signed in to change notification settings - Fork 35
Configurable rich text toolbars #465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ed9a0f6 to
cdb49f5
Compare
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces configurable toolbar functionality for rich text fields, allowing users to customize toolbar buttons and menus through a new toolbar configuration option. The implementation separates toolbar definitions from the component implementation, making the rich text field more flexible and maintainable.
- Extracted toolbar configuration into a separate module with reusable toolbar items
- Refactored
RichTextToolbarcomponent to render toolbar dynamically based on configuration - Added support for custom toolbar layouts through the
toolbaroption in rich text field configuration
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/field/richtext/Toolbar.tsx | New file defining reusable toolbar items (headings, formatting, tables, etc.) and the default toolbar configuration |
| src/field/richtext/RichTextToolbar.tsx | Refactored to render toolbar dynamically based on configuration instead of hardcoded UI elements |
| src/field/richtext/RichTextField.view.tsx | Updated to pass toolbar configuration to RichTextToolbar component and adjust focus detection logic |
| src/field/richtext/RichTextField.ts | Added toolbar configuration option to RichTextOptions interface |
| src/dashboard/view/IconButton.tsx | Modified to accept ReactNode in addition to ComponentType for the icon prop |
| src/core/field/RichTextField.ts | Updated to handle referencedViews from toolbar configuration |
| apps/dev/src/schema/example/RichTextFields.tsx | Added example demonstrating custom toolbar configuration with modified table insertion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This is a first step in making the rich text field fully configurable. It allows users to edit the toolbar buttons and menus. It's possible to add, remove or re-arrange the toolbar.