Changed current collision prop to be compatible with new api (#27 #35 #23)
Also (since we are still pre 1.0) this PR optimizes collision handling by merging the compress and collision props into a single collision prop.
The refactored collision prop provides three behaviors:
none (default): Grid items collisions are ignored. Current collision={false} compress={false}
push: On collision, items move to the first available space. Current collision={true} compress={false}
compress: On collision, items compress vertically towards available space. Current collision={true} compress={true}
This enhancement simplifies the API, improves intuitiveness, and also makes the API more extensible, allowing for future collision behaviors to be added without major structural changes.
Changed current collision prop to be compatible with new api (#27 #35 #23)
Also (since we are still pre 1.0) this PR optimizes collision handling by merging the
compress
andcollision
props into a singlecollision
prop.The refactored
collision
prop provides three behaviors:none
(default): Grid items collisions are ignored. Currentcollision={false} compress={false}
push
: On collision, items move to the first available space. Currentcollision={true} compress={false}
compress
: On collision, items compress vertically towards available space. Currentcollision={true} compress={true}
This enhancement simplifies the API, improves intuitiveness, and also makes the API more extensible, allowing for future collision behaviors to be added without major structural changes.