GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.43k stars 4.07k forks source link

[Feature]: Highlight drop zones #3083

Closed Joshmamroud closed 1 year ago

Joshmamroud commented 4 years ago

Hi @artf ,

How would you recommend highlighting the components on the canvas that the selected block can be dropped into based on draggable & droppable rules? In other words, when a user starts dragging a block from the block manager I would like to highlight (add a border or inset box-shadow) the components on the canvas which it can be dropped into. This is not to replace the drop-indicator (not sure what your name for it is) which shows where the block will be placed when dragging it on the canvas but meant to complement it.

Here is an example of what I'm looking to create: Frame 3

Any help would be greatly appreciated.

Thanks!

artf commented 4 years ago

I think, currently, it's not easy to achieve it. The Sorter module is quite old and messy and I'd need to refactor it in order to allow such functionality (which, for sure, I'd be glad to have). Unfortunately, no ETA for such a thing :/

Joshmamroud commented 4 years ago

@artf ok, thank you for your response!

kerryj89 commented 3 years ago

Was just thinking of this. I think it's the natural evolution and necessary when you can set limitations of where something is droppable.

artf commented 1 year ago

With the introduction of Canvas Spots I think this feature request can be considered done. Here is a quick demo example

https://github.com/GrapesJS/grapesjs/assets/11614725/ea956282-b6bd-455e-af9b-6b5fb7707d71

khushalgupta24 commented 4 months ago

How can I disable the default green line drop highlighter from places I don't want the component to be dropped, For instance I have containers and blocks, I want to make sure the blocks are dragged into containers only, I have the correct logic implemented, now I want to disable the drop highlighter to highlight invalid drop zones, and only highlight where the block can be dropped Can someone please help me out with this. Thanks.

pcjaarvis commented 2 weeks ago

@khushalgupta24 , Hi , where u able to do this? have the same problem