sjdemartini / mui-tiptap

A Material UI (MUI) styled WYSIWYG rich text editor, using Tiptap
MIT License
320 stars 44 forks source link

Update types to support MUI v5.15.11+ types #241

Closed sjdemartini closed 4 months ago

sjdemartini commented 4 months ago

As of newer MUI versions, we require a couple adjustments to remain compatible. (The changes in this PR should be compatible with lower versions of MUI as well, but now ensure we don't break when users are installing newer MUI versions. Peer dependencies are still early MUI v5.)

  1. Update MenuSelect prop types to support MUI v5.15.11 types
    • As of https://github.com/mui/material-ui/pull/39137, MUI's SelectProps is now a type and not an interface, so we can no longer extend it for our own MenuSelectProps. As such, we now make MenuSelectProps a type and use & syntax to inject additional props. This should support both MUI < v5.15.11 (where SelectProps is an interface) and >= 5.15.11 (where SelectProps is a type).
  2. Appease TypeScript for heading fontSizes with makeStyles with MUI v5.15
    • Something about the fontSize definition has gotten more strict, so this works around the issue.

This also updates the dev dependencies within mui-tiptap to use the newest MUI, for easier testing of these changes.