Closed amitev closed 6 years ago
I like your example very much.
In fact since the beginning of the CKEditor 5 development we keep such cases in mind. For instance it would be great to change image to the "editing mode" and change the source of it in-place, without any dialog. I like to imagine even the animation that you can "flip" the image to the other side and edit properties there.
This is why the view, from the very beginning, let you add elements which have no corresponding model elements but are handled by other controllers. These might be some visual markers (for instance yellow background when you search, and in fact we already work to make such changes as simple as possible https://github.com/ckeditor/ckeditor5-engine/issues/484), but also independent parts of the document, like the form.
I think it is too early to talk about details, we do not work on widgets yet, but your cases are very useful and I will keep them in mind when we will do.
Our widgets support edit/preview modes but this is done currently in the angularjs components. It will be great if CKEditor also supports such features. When in preview mode, we currently bootstrap the editor in readonly mode in order to have the widgets initialized (and thus compiled by angular).
I'd like to add that it's very likely that there will be no need to create a widgets concept at all, because the engine has or will have most of the features of CKE4's widgets built in.
The biggest problem when we worked on widgets in CKEditor 4 was that this feature was developed so late. It requires deep integration with dozens of mechanisms all around the code. So in CKEditor 5 we're keeping these use cases in mind from the first day. Also, CKEditor 5's engine is incomparably more powerful than what was possible in CKEditor 4, which didn't have a separation of model and view.
All this means that from day one CKEditor 5 allows for things which weren't possible in CKEditor 4. You can check some of our proof of concepts on CKEditor 5 hackathon repo.
As for specific cases that you mentioned:
@Reinmar A widget concept would allow you to create elements with predefined content, editable/non-editable zones, DnD, etc. which is very useful.
I think that it's inevitable that some tools will be created – sth. like widget factory. But it will be just a util, using the features which are available in the engine. Not a whole, huge system itself (in CKE4 the widget plugin is very big).
I think we'll understand this later. There is a chance that the concept of widgets will still exist at high level (@amitev), to name document elements that have a complex view representation during editing. Still this is supposed to be merely a concept by than as the tools to create them are already present under different low level concepts (@Reinmar).
Cleaning up old discussions. See https://github.com/ckeditor/ckeditor5-design/issues/186.
Hello, we have requirements to support forms and dynamic components (yes, I know that the purpose of the editor is just to allow content editing :-)) inside the editable content (we are currently using CKEditor 4).
We have several custom widgets that are implemented as AngularJS components that get compiled when the widget is initialized by the editor. We faced the following issues on the way:
Here you can see a sample widget with an angularjs component inside.
I would be really glad to see CKEditor 5 supporting my use cases. Please let me know if you need more information.