diff --git a/.changeset/board-downscale-clamped-anchors.md b/.changeset/board-downscale-clamped-anchors.md deleted file mode 100644 index 0a25adf0b..000000000 --- a/.changeset/board-downscale-clamped-anchors.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@cube-dev/ui-kit': patch ---- - -`` (and the cross-board half of `"swap"`) now shrinks a widget into free room on **either** side of a blocker, not just the left. - -`gridBounds` clamps a drag anchor to `cols - w`, which assumes the widget keeps the width it started with. So when the blocker sat to the left and the room to its right was narrower than the widget, every anchor a pointer could produce landed inside the blocker — the mode whose whole job is to shrink the widget into that room never got offered it, and the drop just reverted. Dropping into room on the _left_ always worked, because column 0 is reachable whatever the widget's width. - -A blocked drop whose anchor is **pinned against the grid edge** now also considers the cells beyond it that the clamp hid, taking the largest fit among them. An anchor short of the limit is the pointer's own choice — every cell between it and the limit was available to aim at — so a blocked drop there still reverts, and every drop that resolved before resolves to exactly the same cell. The row axis clamps the same way, so boards with a finite `maxRows` get the same fix below a blocker. diff --git a/.changeset/board-swap-places-arrivals.md b/.changeset/board-swap-places-arrivals.md deleted file mode 100644 index 70754704b..000000000 --- a/.changeset/board-swap-places-arrivals.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@cube-dev/ui-kit': minor ---- - -`` now **places** a widget arriving from another board instead of cancelling the transfer. - -`swap` used to treat a cross-board arrival as strict insertion: the anchor cell had to be empty, and releasing over an occupied one cancelled the whole transfer — both boards snapped back and `onWidgetTransfer` never fired. That made the mode's two halves unusable together, since a board that wanted in-board swapping had to give up cross-board drops (or pick `downscale` and give up the swap). - -A cross-board arrival now resolves the same way `downscale` does: it keeps its size where the drop cell allows, downscales into the room to its right and below where it does not, and holds the last cell it fitted in as the pointer sweeps across a destination widget — so releasing over an occupied cell commits what the preview was showing. Entering a board directly over an occupied cell places the widget in the nearest cell that fits. Destination widgets are still never exchanged, pushed, or reflowed to make space — only the arrival moves. In-board drops are unchanged and still swap. - -Also fixes a cross-board landing under any `collisionMode` where a refused placement committed the widget one row above the board (`y: -1`) instead of on it. diff --git a/CHANGELOG.md b/CHANGELOG.md index eaa395787..632931ec3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # @cube-dev/ui-kit +## 0.171.0 + +### Minor Changes + +- [#1370](https://github.com/cube-js/cube-ui-kit/pull/1370) [`154a701f`](https://github.com/cube-js/cube-ui-kit/commit/154a701fab94eb02b343dbd766ef91071dd38724) Thanks [@tenphi](https://github.com/tenphi)! - `` now **places** a widget arriving from another board instead of cancelling the transfer. + + `swap` used to treat a cross-board arrival as strict insertion: the anchor cell had to be empty, and releasing over an occupied one cancelled the whole transfer — both boards snapped back and `onWidgetTransfer` never fired. That made the mode's two halves unusable together, since a board that wanted in-board swapping had to give up cross-board drops (or pick `downscale` and give up the swap). + + A cross-board arrival now resolves the same way `downscale` does: it keeps its size where the drop cell allows, downscales into the room to its right and below where it does not, and holds the last cell it fitted in as the pointer sweeps across a destination widget — so releasing over an occupied cell commits what the preview was showing. Entering a board directly over an occupied cell places the widget in the nearest cell that fits. Destination widgets are still never exchanged, pushed, or reflowed to make space — only the arrival moves. In-board drops are unchanged and still swap. + + Also fixes a cross-board landing under any `collisionMode` where a refused placement committed the widget one row above the board (`y: -1`) instead of on it. + +### Patch Changes + +- [#1370](https://github.com/cube-js/cube-ui-kit/pull/1370) [`154a701f`](https://github.com/cube-js/cube-ui-kit/commit/154a701fab94eb02b343dbd766ef91071dd38724) Thanks [@tenphi](https://github.com/tenphi)! - `` (and the cross-board half of `"swap"`) now shrinks a widget into free room on **either** side of a blocker, not just the left. + + `gridBounds` clamps a drag anchor to `cols - w`, which assumes the widget keeps the width it started with. So when the blocker sat to the left and the room to its right was narrower than the widget, every anchor a pointer could produce landed inside the blocker — the mode whose whole job is to shrink the widget into that room never got offered it, and the drop just reverted. Dropping into room on the _left_ always worked, because column 0 is reachable whatever the widget's width. + + A blocked drop whose anchor is **pinned against the grid edge** now also considers the cells beyond it that the clamp hid, taking the largest fit among them. An anchor short of the limit is the pointer's own choice — every cell between it and the limit was available to aim at — so a blocked drop there still reverts, and every drop that resolved before resolves to exactly the same cell. The row axis clamps the same way, so boards with a finite `maxRows` get the same fix below a blocker. + ## 0.170.0 ### Minor Changes diff --git a/package.json b/package.json index 1c86b9648..34a67b451 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cube-dev/ui-kit", - "version": "0.170.0", + "version": "0.171.0", "type": "module", "description": "UIKit for Cube Projects", "repository": {