craft.js
craft.js copied to clipboard
Added events.draggedOver part 2.5
Kodak bot went crazy with #184 and automatically merged the PR. Hopefully this won't be auto merged.
This PR adds draggedOver to the events. It's almost the same as #37 but targets the next branch and the new EventHandlers, which also gives us a cleaner API. (#37 will be obsolete).
Since the new EventHandlers introduced a Set as the store for the EventHandlers, we can now store not only the id of the node we are dragging over, but all of its ancestors, too.
I also updated the Basic example with two different examples on how to make use of the new API.
Closes #28 Closes #37 Closes #183
The only complaint we have with the new API is the name draggedOver. @prevwong suggested to re-use the hovered event. If an element is being hovered, and the dragged event stores at least one nodeId, we are dragging over an element. I prefer a more explicit API over an implicit one. As a counter argument Prev suggested to make use of the EventHelpers.
I, too am not a fan of the name draggedOver but lack the creativity to come up with a better name, but I prefer the DX of having an explicit event for dragging over elements. My argument is, that the developer could discover the API with just using code completion and without having to have a look at the documentation of hovered or looking at a guide / example.
Maybe @matdru, @mresposito or @timc1 can chime in and discus the API. Not only these guys, but everyone is welcome to leave a comment. 👍
Deploy preview for craftjs ready!
Built with commit 5f29f19a3abef03c759febeb50f6146cd36aa6ce
https://deploy-preview-186--craftjs.netlify.app
The example
@DavraYoung as promised. Thanks again for reminding me, that this still open
Is there any progress?I need it.
We haven't decided on a name, since both @prevwong and I don't really like the name draggedOver
Hey @ankri, when might this be included in a release?
Closing in favor of #374
Closing due to no time available