You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cdk proposal: framework for rich text editors ("draftjs" for angular) #4444
P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: newIssues requesting a new component or areafeatureLabel used to distinguish feature request from other issues
I've been searching the internets and there is nothing that comes even close to draftjs, which is built on top and requires react. What does it do? It solves most of the contenteditable issues and provides api for people to build their own rich text editors on top of it.
Rich text editor doesn't necessarily mean WYSIWYG textarea, it can help with anything from mentions, hashtags to replacing text emoticons with images etc.
Some of the most popular draftjs plugins can be found here and here, it should give you an idea what can be done with it.
In the past my opinion was that this should be rather part of another repository or just a 3rd party library. Now though, I can see how the components monorepo could benefit from providing such a framework. Fair enough that these are separate issues. I didn't realize before.
I understand why you'd think so, but look into what draftjs actually does (or watch this video https://www.youtube.com/watch?v=feUYwoLhE_4), it basically doesn't care about visual representation at all, which is what that guy in #2949 is ultimately looking for - a component with buttons that do stuff..
The reason I'm really asking here is because google/angular team has enough brain power and experience to actually do something like this (it's in a way similar to angular compiler). If you search the internet you won't find anything remotely close to draftjs, everyone's creating mentions inputs, emoticon replacers, WYSIWYG textareas, only facebook took a step back and asked what's in the core of such features. I really find it similar to what other CDK services do. It could greatly empower other component creators, it's a really powerful high level service.
Reacted by Will Howell, Asaph Abraham, Tre665, Jason Yeomans, Alexander Tømmerås, Lazar Ljubenović, Ben Racicot, CDDelta, Mokeev Andrey, Murat Çorlu and 3 more
Quill looks like WYSIWYG to me. If there's anything similar, it's slate, again, just for react. Read the comparisons.
Also https://youtu.be/gxNuHZXZMgs?t=1791 this guy saying that he talked to angular people who decided to add react/draft as a dependency simply because they couldn't find anything similar in angular world.
I don't know, I think their own comparison to draft speaks for itself https://quilljs.com/guides/comparison-with-other-rich-text-editors/#draft they are out of the box usable wysiwyg, draft is just a high level service that allows you to build rich text editors (not necessarily wysiwyg editors).
Simple test is to see if quill, or any other lib, can also be used to smaller, "simple" things like facebook-like mentions. You won't really find a quill plugin for that (it was never made with that in mind, to quote their own site "Quill’s only use case is rich text content"), and if you do, you'll find that it relies on DOM data-* attributes to carry data, unlike draft which stores them in a JSON structure, which I think is a better approach in angular world.
We have chatted about this in the past (and one Angular team member actually has a decent amount of experience with this kind of thing). It's something we'd like to do, but is pretty far down on the priority list.
changed the title [-]cdk proposal: framework for rich text editors (draftjs for angular)[/-][+]cdk proposal: framework for rich text editors ("draftjs" for angular)[/+]on Dec 23, 2017
Probably not at this point; it's looking now that Q2 is mostly going to be finishing up drag/drop and virtual, addressing some tech debt and productivity issues (mainly trying to speed up the rate at which we can sync stuff into Google), and support/validation for Ivy work.
I wrote a directive. It implements MatFormFieldControl to make contenteditable compatible with MatFormField.
I'm pretty new to web development, so I basically just copy/paste stuff from matInput. The errorstate and some other stuff are a little confusing for me and I'm not sure I implemented them correctly. I hope I can get some help from material team to test/improve/fix my implementation.
@jelbourn are there any guidelines for third-party WYSIWYG editor developers who want to add support for Angular Material 2?
For example CKEditor 5 which has been completely rewritten in ES6 and provides all the necessary tools to easily integrate it with modern applications and technologies such as Angular. And they officially support Angular https://github.com/ckeditor/ckeditor5-angular. They seems to be interested in officially supporting Angular Material as well but clarity on best approach is needed.
@jelbourn To be more specific I am referring to the support of WYSIWYG editor inside MatFormFieldControl. In case of ckeditor they have a separate plugin ckeditor/ckeditor5-angular for Angular.
Now, to support ckeditor inside MatFormFieldControl, should they have a separate plugin e.g ckeditor5-angular-material? since in order to support MatFormFieldControl they have will to add @angular/material a peer or explicit dependency in package.json file. And since its not necessary that everyone using ckeditor/ckeditor5-angular would also be using Angular Material, so it would be an additional dependency for them. Or is there any other solution that can allow this without importing it to satisfy the angular DI.
All you would really need is a directive that implements MatFormFieldControl in order to work with mat-form-field (similar to MatInput). That's something that would best fit in its own package so any existing packages don't have to pull in dependencies.
Reacted by Naveed Ahmed, Maciej Bukowski and Matthew Leffler
https://github.com/facebook/lexical Facebook now created a better and improved draft.js that is dependency free, so there's higher possibility of making an angular wrapper without having to bring over the whole of react
P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: newIssues requesting a new component or areafeatureLabel used to distinguish feature request from other issues
Activity
devversion commentedon May 9, 2017
Thanks for the links. Why aren't we moving that conversation to the issue #2949?
fxck commentedon May 9, 2017
Because that guy's looking for WYSIWYG, this is something you'd build WYSIWYG on top of, two very different things I think.
It's basically the difference between
Overlayanddialog.devversion commentedon May 9, 2017
Yeah but I think this both relates together and it would be helpful to have a general discussion about it first.
fxck commentedon May 9, 2017
Nope, it's like a separate issue for Overlay and dialog/menu/select.
devversion commentedon May 9, 2017
In the past my opinion was that this should be rather part of another repository or just a 3rd party library. Now though, I can see how the components monorepo could benefit from providing such a framework. Fair enough that these are separate issues. I didn't realize before.
fxck commentedon May 9, 2017
I understand why you'd think so, but look into what draftjs actually does (or watch this video https://www.youtube.com/watch?v=feUYwoLhE_4), it basically doesn't care about visual representation at all, which is what that guy in #2949 is ultimately looking for - a component with buttons that do stuff..
The reason I'm really asking here is because google/angular team has enough brain power and experience to actually do something like this (it's in a way similar to angular compiler). If you search the internet you won't find anything remotely close to draftjs, everyone's creating mentions inputs, emoticon replacers, WYSIWYG textareas, only facebook took a step back and asked what's in the core of such features. I really find it similar to what other CDK services do. It could greatly empower other component creators, it's a really powerful high level service.
mlc-mlapis commentedon May 10, 2017
I did not go to the details but it looks that https://quilljs.com (used in PrimeNG UI components for Angular https://www.primefaces.org/primeng/#/editor) is very similar from the concept point of view?
fxck commentedon May 10, 2017
Quill looks like WYSIWYG to me. If there's anything similar, it's slate, again, just for react. Read the comparisons.
Also https://youtu.be/gxNuHZXZMgs?t=1791 this guy saying that he talked to angular people who decided to add react/draft as a dependency simply because they couldn't find anything similar in angular world.
mlc-mlapis commentedon May 10, 2017
From the first point of view sure but I meant mainly the background of it. Its internal structure, API, ...
fxck commentedon May 10, 2017
I don't know, I think their own comparison to draft speaks for itself https://quilljs.com/guides/comparison-with-other-rich-text-editors/#draft they are out of the box usable wysiwyg, draft is just a high level service that allows you to build rich text editors (not necessarily wysiwyg editors).
Simple test is to see if quill, or any other lib, can also be used to smaller, "simple" things like facebook-like mentions. You won't really find a quill plugin for that (it was never made with that in mind, to quote their own site "Quill’s only use case is rich text content"), and if you do, you'll find that it relies on DOM data-* attributes to carry data, unlike draft which stores them in a JSON structure, which I think is a better approach in angular world.
Also worth watching to understand how draftjs works internally https://www.youtube.com/watch?v=vOZAO3jFSHI
mlc-mlapis commentedon May 10, 2017
Yeah, it is certainly true. I did not go so deep, I just looked at some basic operations as
and corresponding
Deltasrepresenting the changes which use JSON format.jelbourn commentedon May 10, 2017
We have chatted about this in the past (and one Angular team member actually has a decent amount of experience with this kind of thing). It's something we'd like to do, but is pretty far down on the priority list.
mlc-mlapis commentedon May 10, 2017
Oh, really? Sounds positive. 👍 Is it possible to share some more details?
8 remaining items
[-]cdk proposal: framework for rich text editors (draftjs for angular)[/-][+]cdk proposal: framework for rich text editors ("draftjs" for angular)[/+]fxck commentedon Mar 29, 2018
@jelbourn Q2 still a go for the exploration? Will Ivy help this? Or angular/elements?
jelbourn commentedon Mar 29, 2018
Probably not at this point; it's looking now that Q2 is mostly going to be finishing up drag/drop and virtual, addressing some tech debt and productivity issues (mainly trying to speed up the rate at which we can sync stuff into Google), and support/validation for Ivy work.
wynfred commentedon Oct 4, 2018
I wrote a directive. It implements MatFormFieldControl to make
contenteditablecompatible with MatFormField.I'm pretty new to web development, so I basically just copy/paste stuff from matInput. The
errorstateand some other stuff are a little confusing for me and I'm not sure I implemented them correctly. I hope I can get some help from material team to test/improve/fix my implementation.naveedahmed1 commentedon Oct 8, 2018
@jelbourn are there any guidelines for third-party WYSIWYG editor developers who want to add support for Angular Material 2?
For example CKEditor 5 which has been completely rewritten in ES6 and provides all the necessary tools to easily integrate it with modern applications and technologies such as Angular. And they officially support Angular https://github.com/ckeditor/ckeditor5-angular. They seems to be interested in officially supporting Angular Material as well but clarity on best approach is needed.
Please take a look at:
ckeditor/ckeditor5-angular#21
and
ckeditor/ckeditor5-angular#21 (comment)
jelbourn commentedon Oct 8, 2018
It's not clear to me what "adding support for Angular Material" would mean. Could you clarify?
naveedahmed1 commentedon Oct 8, 2018
@jelbourn To be more specific I am referring to the support of WYSIWYG editor inside
MatFormFieldControl. In case of ckeditor they have a separate pluginckeditor/ckeditor5-angularfor Angular.Now, to support ckeditor inside
MatFormFieldControl, should they have a separate plugin e.gckeditor5-angular-material? since in order to supportMatFormFieldControlthey have will to add@angular/materiala peer or explicit dependency inpackage.jsonfile. And since its not necessary that everyone usingckeditor/ckeditor5-angularwould also be using Angular Material, so it would be an additional dependency for them. Or is there any other solution that can allow this without importing it to satisfy the angular DI.jelbourn commentedon Oct 8, 2018
All you would really need is a directive that implements
MatFormFieldControlin order to work withmat-form-field(similar toMatInput). That's something that would best fit in its own package so any existing packages don't have to pull in dependencies.fxck commentedon Sep 5, 2019
Any updates?
wynfred commentedon Sep 5, 2019
Not sure if the material team is interested in taking something like this into the official lib.
jelbourn commentedon Sep 5, 2019
No plans to work on this at least through 2020.
fxck commentedon Apr 14, 2022
https://github.com/facebook/lexical Facebook now created a better and improved draft.js that is dependency free, so there's higher possibility of making an angular wrapper without having to bring over the whole of react