facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
20.04k stars 1.71k forks source link

Supporting Grammarly and Google Translate #53

Closed trueadm closed 3 years ago

trueadm commented 3 years ago

DraftJS doesn't work with either because of many reasons that either: conflict with React's rendering, or just don't support Draft's internal model. I feel that we should do better here.

These browser plugins are not only heavily used by a large majority of the Internet, they also provide a much better experience for users that depend on these for accessibility reasons (which includes plugins other than these two).

I feel like we should spent some effort on investigating and possibly implementing support for these browser plugins. We can obviously disable them (you can use DOM attributes and classes to do so) but I feel like we should at least explore this space.

trueadm commented 3 years ago

Ref links:

https://github.com/ianstormtaylor/slate/issues/449 https://github.com/facebook/draft-js/issues/616

trueadm commented 3 years ago

Grammarly support added in https://github.com/facebookexternal/Outline/pull/54.

li-yechao commented 1 year ago

Grammarly support added in #54.

How about google translate? Is there any idea to get google translate available in readOnly mode?

trueadm commented 1 year ago

@li-yechao Does Google Translate not work at all with your Lexical content? Last time I checked, it worked fine for me.

li-yechao commented 1 year ago

@li-yechao Does Google Translate not work at all with your Lexical content? Last time I checked, it worked fine for me.

It not worked for me, example page: https://www.robertmao.com/blog/post/yvstwPLWHCsNz-XN

What am I doing wrong here?

trueadm commented 1 year ago

Ah, it's because of Lexical's DOM mutation observers reverting the content back. I wonder if we should relax the DOM mutation listeners in non-editable mode.

trueadm commented 1 year ago

@li-yechao Can you open a separate issue for this please? We can track it and maybe come up with a solution.

li-yechao commented 1 year ago

@li-yechao Can you open a separate issue for this please? We can track it and maybe come up with a solution.

3496