Implement DataController.insertContent() #3861
Labels
package:engine
status:discussion
type:feature
This issue reports a feature request (an idea for a new functionality or a missing option).
Milestone
Needed for ckeditor/ckeditor5-clipboard#1.
It seems that it must accept view document fragment, because it will need to convert it to the model using the context of insertion. And this becomes part of the "insert content" logic, so should most likely be done inside this method.
BTW, it made me think that this method would make sense on the
DataController
. And I kinda like this idea. We've been thinking where to move the composer and I can see thatmodifySelection()
makes for theEditingController
anddeleteContent()
together withinsertContent()
could perhaps end in the theDataController
. Note also that we'll need something likegetSelectedContent()
for the copy and cut operations (sodeleteContent()
would becomedeleteSelectedContent()
).OTOH, I know what you're going to say – those methods look weird on the
DataController
. I agree... I'd have to get used to them. But consider this – let's say we'd like to moveinsertContent()
to theDocument
. ButinsertContent()
requires (as explained above) a knowledge aboutDataController
. So how could it be implemented on theDocument
?tl;dr:
DataController#insertContent()
– paste and I'm sure it'll be used in many ways in many cases by developers,DataController#deleteSelectedContent()
– delete feature,DataController#getSelectedContent()
– copy, cut and this has been also requested many times in the past for various integration scenariosmEditingController#modifySelection()
Does it make any sense or no sense at all?
The text was updated successfully, but these errors were encountered: