Skip to content
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

Add new menu buttons #52

Closed
14 tasks done
bryanjtc opened this issue Jun 17, 2023 · 14 comments
Closed
14 tasks done

Add new menu buttons #52

bryanjtc opened this issue Jun 17, 2023 · 14 comments

Comments

@bryanjtc
Copy link

bryanjtc commented Jun 17, 2023

Is your feature request related to a problem? Please describe.

To make this package a true replacement for react-mui-draft-wysiwyg there are a few menu buttons that you can add.

Describe the solution you'd like

Implement the following suggestions:

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

@sjdemartini
Copy link
Owner

I am intending to add more explicit support and built-in buttons for all of these, so thank you for filing and detailing this in such an organized way @bryanjtc!

A couple of those are in fact already supported:

  • MenuHeadingSelect handles all heading levels (h1-h6)—see here. The default demo for local development in mui-tiptap happens to only configure the heading extension for levels h1-h3 (see here) but I can change the demo as well so it's more clear. As long as you configure your heading extension for all levels, MenuHeadingSelect will do the trick. When I add documentation to the repo and more polish to the app, this will be clearer. (Side note: that useRecommendedExtensions hook will be going away soon anyway as a part of cleaning up peer deps, since I don't think it's the right approach and everyone should simply choose their own extensions.)
  • There's a general-purpose "insert image" button via MenuButtonAddImage. You provide your own onClick (where you could use your own interface to type in a URL, or you could trigger a file upload). It's not part of the demo within the app, but I can add that. And perhaps I can provide a more explicit variant for an "insert image using URL" version. I think file-upload itself is best left to the application using mui-tiptap, since needs will inevitably vary, so I hope the simple onClick will do the trick. I use MenuButtonAddImage in an external app, and I find it works cleanly to have all file-upload logic handled external to mui-tiptap via the click.

@bryanjtc
Copy link
Author

bryanjtc commented Jun 18, 2023

Removing useRecommendedExtensions is a good idea. The demo should use the setup of the useRecommendedExtensions hook and all the other possible extensions and controls.
Can I add my own custom control using the MenuButton component?
Edit: Answering my own question, yes I can.

@bryanjtc
Copy link
Author

The tooltip label should be a prop in all menu buttons to customize the label content.

@sjdemartini
Copy link
Owner

@bryanjtc Yes, that's the intention for MenuButton—to be a reusable base component so anyone can add their own menu buttons fairly easily. And agreed, I intend to have all props be overridable for all MenuButtons!

@sjdemartini
Copy link
Owner

FYI you can now override tooltipLabels (and any other props) for all of the MenuButton* components, in v1.0.0-beta.3

@sjdemartini
Copy link
Owner

The latest release v1.0.0-beta.5 includes several more controls components (undo, redo, horizontal rule, underline, and multiple options for text-align)

@sjdemartini
Copy link
Owner

The latest release v1.0.0-beta.10 features a new FontSize extension and MenuSelectFontSize controls component (see #94 and #95 for some screenshots and examples).

@bryanjtc
Copy link
Author

bryanjtc commented Jul 16, 2023

Ideas to improve the menu image button

Original react-mui-draft-wysiwyg image button:
image
Upload:
image
Url:
image

Original mui-rte image button:
image
Allow modifying height and width:
image
Allow choosing between image or video
image

@bryanjtc
Copy link
Author

Font color/highlight customization ideas

Original react-mui-draft-wysiwyg image button:
image
Tiptap example
image

@sjdemartini
Copy link
Owner

MenuSelectFontFamily has been added as of the v1.2.0 version just published:
Screenshot 2023-07-23 at 4 21 15 PM

@devth
Copy link

devth commented Jul 27, 2023

This project is amazing! Love the high velocity and quality ya'll are shipping. Thanks so much for building it. 🙏🏻

@cgil
Copy link

cgil commented Jul 28, 2023

Second on the impressive speed! And also the text and highlight color input components

@sjdemartini
Copy link
Owner

Just commenting to say I haven't forgotten about this and aim to tackle the text and highlight color menu components soon. I have a WIP version but have a bit more work to do to polish it.

@sjdemartini
Copy link
Owner

sjdemartini commented Aug 23, 2023

I've released mui-tiptap v1.5.0 which includes the first version of the text-color and highlight-color menu controls (along with some building-block components you can use to build a more custom version). Implemented in #135. Thanks for all the comments and suggestions in this thread!

I'm going to close out this issue, since those were the last outstanding extensions here which were missing support in mui-tiptap. I've added a separate issue #136 to track future improvement ideas for the "Insert image" menu button, based on the above discussion.

Let me know if you have any feedback, and as usual feel free to file an issue if you come across bugs or have feature-request ideas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants