Skip to content

Commit 32b6907

Browse files
Update changelog.
1 parent 5b217c3 commit 32b6907

1 file changed

Lines changed: 35 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## [Unreleased]
44

5-
Refactor core to lean more into reactivity.
5+
Refactor core to lean more into reactivity. Note there are multiple breaking
6+
changes in this release - see below for details.
67

78
### Added
89

@@ -14,6 +15,26 @@ Refactor core to lean more into reactivity.
1415
- Add `rect` getter on `Layout` for ease of use. When duplicating a `Layout`,
1516
can now do `new Layout(existingLayout.rect)`.
1617

18+
- Support for custom transformers to refine `Draggable` and `Droppable`
19+
transform behaviour. Transformers are specified against an individual item and
20+
can be used for things like limiting drag movement to a particular axis:
21+
22+
```jsx
23+
const transformer = {
24+
id: "constrain-x-axis",
25+
order: 100,
26+
callback: (transform) => ({ ...transform, x: 0 }),
27+
};
28+
29+
onDragStart(({ draggable }) => {
30+
addTransformer("draggables", draggable.id, transformer);
31+
});
32+
33+
onDragEnd(({ draggable }) => {
34+
removeTransformer("draggables", draggable.id, transformer.id);
35+
});
36+
```
37+
1738
### Changed
1839

1940
- **Breaking Change** Refactor core to lean more into reactivity.
@@ -32,26 +53,6 @@ Refactor core to lean more into reactivity.
3253
and can be accessed via the `transfomers` property on draggables or
3354
droppables.
3455

35-
Transformers also open up opportunity for custom constraints on transforms,
36-
such as limiting drag movement to a particular axis by adding an appropriate
37-
trasnformer in `onDragStart`:
38-
39-
```jsx
40-
const transformer = {
41-
id: "constrain-x-axis",
42-
order: 100,
43-
callback: (transform) => ({ ...transform, x: 0 }),
44-
};
45-
46-
onDragStart(({ draggable }) => {
47-
addTransformer("draggables", draggable.id, transformer);
48-
});
49-
50-
onDragEnd(({ draggable }) => {
51-
removeTransformer("draggables", draggable.id, transformer.id);
52-
});
53-
```
54-
5556
- **Breaking Change** Sensors should now pass their initial coordinates to
5657
`sensorStart` and updated coordinates to the new `sensorMove` function (which
5758
replaces the removed `dragMove` function). The included pointer sensor has
@@ -80,12 +81,25 @@ Refactor core to lean more into reactivity.
8081
* `anyDroppableActive()` -> `state.active.droppable`
8182
* `activeSensor()` -> `state.active.sensor`
8283

84+
- **Breaking Change** Remove filter argument from `recomputeLayouts`. Instead,
85+
the core will determine which nodes to re-evaluate when called (and will also
86+
cache nodes to avoid redundant evaluation of layout when appropriate).
87+
8388
### Fixed
8489

8590
- **Breaking change** Make Solid JS 1.5 the minimum compatible version of Solid
8691
and update to support its breaking changes to typings, and the new `batch`
8792
behaviour.
8893

94+
- **Breaking Change** Use `DragOverlay` layout in collision detection.
95+
Previously the `Draggable` layout was used leading to unexpected behaviour
96+
collision behaviour (such as a larger overlay not triggering a `Droppable`
97+
even when over it). As part of this the `usingDragOverlay` property of dnd
98+
state is removed in faviour of tracking `state.active.overlay` data.
99+
100+
- Auto-center `DragOverlay` over its related `Draggable` on drag start for a
101+
better experience when the overlay is of differing size to the draggable.
102+
89103
- Avoid reacting to irrelevant droppable changes in `onDragEnd`.
90104

91105
- Minimise differences in layout calculations. Due to the way transforms are

0 commit comments

Comments
 (0)