Expose simple way to trigger lineutils-based DnD
(Note: lineutils-based DnD is the mechanism used while dragging block widgets)
Use cases:
- When user starts dragging an inline image (or image2) I would like to be able to enable line-utils-based DnD. I imagine that I can listen on editor#dragstart, check what's dragged, and use some editor method, to do what I want. Of course this rises questions like - what with empty blocks left after dragging an image from them - this would be handled by the developer which implements such feature or by CKEditor. We could e.g. make it possible to alter dragRange (it may even be possible now) so a developer would be able to select whole paragraph.
- Dragging some stuff from outside of the editor. E.g. there could be a list of products and dragging it into editor should be done with line utils.
- Dragging table rows with line utils?
- Must it be drag and drop? Maybe we can expose this feature for more user actions. You click a widget, choose "move" and while your moving your cursor above the editor, then line utils appear with an icon like magicline. Clicking this icon moves the element there.
- With some more UX-related improvements we could enable magicline and lineutils-based DnD on touch devices.
Ad. 1:
I'm not sure about that. At the moment we listen on mouse event and emulate
dragstart
event from the line-utils-based drag and drop (custom D&D for block widgets), so the line utils is the alternative way and we do not use at all browsers D&D if we use lineutils and it is lineutils based mechanism who fire all D&D events on editor. If we mix this two solutions we may have some problems. I prefer lineutils as an alternative way of drag and drop so all D&D events (dragstart
,drop
,dragend
) will be fired by this alternative mechanism.But on the other hand, maybe we will be able to prevent native D&D in the
editor#dragstart
event. It is something we should check. And solution with setting lineutils oneditor#dragstart
would be very nice.Ad. 2:
Note that
editor#dragstart
will not we fired in such case (dragstart
anddragend
are fired on the dragged element). So there should be a way to run them manually in the simplest possible way.I believe we should keep in mind that it is possible to run
lineutils
for all of these cases now. The problem is that it is too generic and too complex, so this ticket is not about introducing new features, but about making feature simpler.