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

Replace Quill RichTextInput With TipTap RichTextInput #7153

Merged
merged 21 commits into from
Jan 28, 2022
Merged

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Jan 28, 2022

The problem

Our old RichTextInput was based on Quill but:

  • it wasn't accessible (button without labels, etc.)
  • it wasn't translatable (labels in Quill are in the CSS)
  • it wasn't using MUI components for its UI so it looks off

The solution

The new RichTextInput uses TipTap, a UI less library to build rich text editors. It gives us the freedom to implement the UI how we want with MUI components. That solves all the above issues

Tasks

  • Implementation
  • Tests
  • Upgrade guide
  • Documentation

@djhi djhi changed the title Richtext tiptap Replace Quill RichTextInput With TipTap RichTextInput Jan 28, 2022
@djhi djhi added the WIP Work In Progress label Jan 28, 2022
@djhi djhi added this to the 4.0.0-alpha.2 milestone Jan 28, 2022
@fzaninotto
Copy link
Member

needs rebase

@@ -22,7 +22,7 @@
"run-graphql-demo-watch": "concurrently \"yarn run watch\" \"yarn run run-graphql-demo\"",
"run-crm": "cd examples/crm && yarn start",
"build-crm": "cd examples/crm && yarn build",
"storybook": "start-storybook -p 9009",
"storybook": "start-storybook -p 9010",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a known issue with storybook only returning 404. Changing the port solved it

@@ -1,79 +1,141 @@
# `<RichTextInput>` for react-admin
# ra-richtext-tiptap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not the name of the package


## Installation

```sh
npm install ra-input-rich-text --save-dev
npm install ra-richtext-tiptap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad package name

return <span>Post {record ? `"${record.title}"` : ''}</span>;
};
import { Edit, SimpleForm, TextInput } from 'react-admin';
import { RichTextInput } from 'ra-richtext-tiptap';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad import

HorizontalRule,
],
};
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing license section

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added. We have several packages without this section btw

packages/ra-input-rich-text/package.json Outdated Show resolved Hide resolved
@@ -45,6 +45,22 @@ export const defaultTheme = {
opacity: 0.3,
borderRadius: 'inherit',
},
'&:focus::after': {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate why you need that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added more comments

Copy link
Contributor

@WiXSL WiXSL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a library dependency related to Quill in test-setup.js

/**
 * As jsDom do not support mutationobserver and
 * quill requires mutationobserver, thus a shim is needed
 */
require('mutationobserver-shim');

cypress/integration/edit.js Outdated Show resolved Hide resolved
Co-authored-by: Aníbal Svarcas <[email protected]>
cypress/integration/create.js Outdated Show resolved Hide resolved
@fzaninotto fzaninotto merged commit 6e5d84c into next Jan 28, 2022
@fzaninotto fzaninotto deleted the richtext-tiptap branch January 28, 2022 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants