mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
2.08k stars 160 forks source link

feat: add `hideImageToolbar` option to imagePlugin #571

Closed jgeppert closed 3 months ago

jgeppert commented 3 months ago

Make it possible to hide the image toolbar, e.g. when editor is in readOnly mode.

When using the editor to just render documents (e.g. in an application where some users only have viewing capabilities), even with hidden toolbar and read only mode, each image will still show the toolbar (settings + delete icon). Other plugins, like the table, hide their toolbar already when in read only mode. This makes it possible to get to the same state with the image plugin, alternatively, it could also make sense to always hide the toolbar when in read only mode.

petyosi commented 3 months ago

@jgeppert I think that we should just use the readOnly flag for that purpose rather than introducing a new optional one. Seems like a sensible default to me. If you're ok with that, just update the PR, I will merge.

jgeppert commented 3 months ago

Sure, makes sense to me, i will update it shortly