@atlaskit/pragmatic-drag-and-drop 1.1.8 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +438 -416
  2. package/dist/cjs/adapter/element-adapter.js +1 -1
  3. package/dist/cjs/adapter/external-adapter.js +1 -1
  4. package/dist/cjs/adapter/text-selection-adapter.js +1 -1
  5. package/dist/cjs/ledger/lifecycle-manager.js +15 -3
  6. package/dist/es2019/adapter/element-adapter.js +1 -1
  7. package/dist/es2019/adapter/external-adapter.js +1 -1
  8. package/dist/es2019/adapter/text-selection-adapter.js +1 -1
  9. package/dist/es2019/ledger/lifecycle-manager.js +15 -3
  10. package/dist/esm/adapter/element-adapter.js +1 -1
  11. package/dist/esm/adapter/external-adapter.js +1 -1
  12. package/dist/esm/adapter/text-selection-adapter.js +1 -1
  13. package/dist/esm/ledger/lifecycle-manager.js +15 -3
  14. package/dist/types/adapter/element-adapter.d.ts +1 -1
  15. package/dist/types/adapter/text-selection-adapter.d.ts +1 -1
  16. package/dist/types/ledger/dispatch-consumer-event.d.ts +1 -1
  17. package/dist/types/ledger/lifecycle-manager.d.ts +1 -1
  18. package/dist/types/ledger/usage-ledger.d.ts +1 -1
  19. package/dist/types/make-adapter/make-adapter.d.ts +1 -1
  20. package/dist/types/make-adapter/make-drop-target.d.ts +1 -1
  21. package/dist/types/make-adapter/make-monitor.d.ts +1 -1
  22. package/dist/types/public-utils/combine.d.ts +1 -1
  23. package/dist/types/public-utils/element/custom-native-drag-preview/preserve-offset-on-source.d.ts +1 -1
  24. package/dist/types/public-utils/element/custom-native-drag-preview/set-custom-native-drag-preview.d.ts +1 -1
  25. package/dist/types/public-utils/external/file.d.ts +1 -1
  26. package/dist/types/public-utils/external/html.d.ts +1 -1
  27. package/dist/types/public-utils/external/some.d.ts +1 -1
  28. package/dist/types/public-utils/external/text.d.ts +1 -1
  29. package/dist/types/public-utils/external/url.d.ts +1 -1
  30. package/dist/types/util/add-attribute.d.ts +1 -1
  31. package/dist/types/util/get-input.d.ts +1 -1
  32. package/dist/types-ts4.5/adapter/element-adapter.d.ts +1 -1
  33. package/dist/types-ts4.5/adapter/text-selection-adapter.d.ts +1 -1
  34. package/dist/types-ts4.5/ledger/dispatch-consumer-event.d.ts +1 -1
  35. package/dist/types-ts4.5/ledger/lifecycle-manager.d.ts +1 -1
  36. package/dist/types-ts4.5/ledger/usage-ledger.d.ts +1 -1
  37. package/dist/types-ts4.5/make-adapter/make-adapter.d.ts +1 -1
  38. package/dist/types-ts4.5/make-adapter/make-drop-target.d.ts +1 -1
  39. package/dist/types-ts4.5/make-adapter/make-monitor.d.ts +1 -1
  40. package/dist/types-ts4.5/public-utils/combine.d.ts +1 -1
  41. package/dist/types-ts4.5/public-utils/element/custom-native-drag-preview/preserve-offset-on-source.d.ts +1 -1
  42. package/dist/types-ts4.5/public-utils/element/custom-native-drag-preview/set-custom-native-drag-preview.d.ts +1 -1
  43. package/dist/types-ts4.5/public-utils/external/file.d.ts +1 -1
  44. package/dist/types-ts4.5/public-utils/external/html.d.ts +1 -1
  45. package/dist/types-ts4.5/public-utils/external/some.d.ts +1 -1
  46. package/dist/types-ts4.5/public-utils/external/text.d.ts +1 -1
  47. package/dist/types-ts4.5/public-utils/external/url.d.ts +1 -1
  48. package/dist/types-ts4.5/util/add-attribute.d.ts +1 -1
  49. package/dist/types-ts4.5/util/get-input.d.ts +1 -1
  50. package/package.json +2 -4
package/CHANGELOG.md CHANGED
@@ -1,666 +1,688 @@
1
1
  # @atlaskit/pragmatic-drag-and-drop
2
2
 
3
+ ## 1.1.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#105574](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105574)
8
+ [`2f5d213b2613`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f5d213b2613) -
9
+ These fixes only impact situations were you have native drag and drop code in addition to
10
+ Pragmatic drag and drop running on your page.
11
+
12
+ - Fix: if a `"drop"` is caused by non Pragmatic drag and drop code on the page, then we will no
13
+ longer cancel the `"drop"` event.
14
+ - Fix: No longer exposing external adapter data (`source.items`) in `onDrop` if not dropping on a
15
+ Pragmatic drag and drop drop target. Previously, if some non Pragmatic drag and drop code
16
+ accepted a drop then `source.items` would be populated. Now all unsuccessful (or un managed)
17
+ drops are handled consistently.
18
+
19
+ ## 1.1.9
20
+
21
+ ### Patch Changes
22
+
23
+ - [#100243](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100243)
24
+ [`1ba7a4e942d4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1ba7a4e942d4) -
25
+ Fixing typos in dev time warnings
26
+
3
27
  ## 1.1.8
4
28
 
5
29
  ### Patch Changes
6
30
 
7
- - [#100196](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100196)
8
- [`da322bbbe7f5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da322bbbe7f5) -
9
- Setting `sideEffects: true` in `package.json` as a few essential files in `core` have side
10
- effects. Unfortunately we require side effects to work around browser bugs and strangeness 😅.
31
+ - [#100196](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100196)
32
+ [`da322bbbe7f5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da322bbbe7f5) -
33
+ Setting `sideEffects: true` in `package.json` as a few essential files in `core` have side
34
+ effects. Unfortunately we require side effects to work around browser bugs and strangeness 😅.
11
35
 
12
36
  ## 1.1.7
13
37
 
14
38
  ### Patch Changes
15
39
 
16
- - [#95385](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95385)
17
- [`c8d2e32f5071`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c8d2e32f5071) -
18
- Minor internal refactor of code concerning entering / leaving a window
40
+ - [#95385](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95385)
41
+ [`c8d2e32f5071`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c8d2e32f5071) -
42
+ Minor internal refactor of code concerning entering / leaving a window
19
43
 
20
44
  ## 1.1.6
21
45
 
22
46
  ### Patch Changes
23
47
 
24
- - [#94759](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94759)
25
- [`140fc0d20c02`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/140fc0d20c02) -
26
- Fixing our Safari workaround in `setCustomNativeDragPreview()` for a
27
- [Safari drag preview bug](https://bugs.webkit.org/show_bug.cgi?id=266025) so that it works
28
- correctly for `react@18+` usage.
48
+ - [#94759](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94759)
49
+ [`140fc0d20c02`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/140fc0d20c02) -
50
+ Fixing our Safari workaround in `setCustomNativeDragPreview()` for a
51
+ [Safari drag preview bug](https://bugs.webkit.org/show_bug.cgi?id=266025) so that it works
52
+ correctly for `react@18+` usage.
29
53
 
30
54
  ## 1.1.5
31
55
 
32
56
  ### Patch Changes
33
57
 
34
- - [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316)
35
- [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) -
36
- Upgrading internal dependency `bind-event-listener` to `@^3.0.0`
58
+ - [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316)
59
+ [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) -
60
+ Upgrading internal dependency `bind-event-listener` to `@^3.0.0`
37
61
 
38
62
  ## 1.1.4
39
63
 
40
64
  ### Patch Changes
41
65
 
42
- - [#94302](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94302)
43
- [`66ca9d1d1602`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/66ca9d1d1602) -
44
- Improving jsdoc for the drop target `canDrop` function
66
+ - [#94302](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94302)
67
+ [`66ca9d1d1602`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/66ca9d1d1602) -
68
+ Improving jsdoc for the drop target `canDrop` function
45
69
 
46
70
  ## 1.1.3
47
71
 
48
72
  ### Patch Changes
49
73
 
50
- - [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)
51
- [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -
52
- Public release of Pragmatic drag and drop documentation
74
+ - [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)
75
+ [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -
76
+ Public release of Pragmatic drag and drop documentation
53
77
 
54
78
  ## 1.1.2
55
79
 
56
80
  ### Patch Changes
57
81
 
58
- - [#84047](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84047)
59
- [`72a86ac4a940`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/72a86ac4a940) -
60
- Removing experimental `DropData` from `onDrop()`. Exposing the native `dropEffect` turned out to
61
- problematic, as you will always get a `"none"` drop effect if dropping externally if the
62
- original `draggable` was removed (a native `"dragend"` event is targetted at the original
63
- draggable). This made the weak signal of `dropEffect` for even weaker and more problematic. In
64
- order to not create footguns for folks, we have decided to remove this experimental API for now.
65
- We can explore adding the API back in the future if folks think it would be valuable.
82
+ - [#84047](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84047)
83
+ [`72a86ac4a940`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/72a86ac4a940) -
84
+ Removing experimental `DropData` from `onDrop()`. Exposing the native `dropEffect` turned out to
85
+ problematic, as you will always get a `"none"` drop effect if dropping externally if the original
86
+ `draggable` was removed (a native `"dragend"` event is targetted at the original draggable). This
87
+ made the weak signal of `dropEffect` for even weaker and more problematic. In order to not create
88
+ footguns for folks, we have decided to remove this experimental API for now. We can explore adding
89
+ the API back in the future if folks think it would be valuable.
66
90
 
67
91
  ## 1.1.1
68
92
 
69
93
  ### Patch Changes
70
94
 
71
- - [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)
72
- [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -
73
- Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent
74
- description to various consumers, and so they are consistently formed amongst each other.
95
+ - [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)
96
+ [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -
97
+ Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent
98
+ description to various consumers, and so they are consistently formed amongst each other.
75
99
 
76
- - `package.json` `description`
77
- - `README.md`
78
- - Website documentation
100
+ - `package.json` `description`
101
+ - `README.md`
102
+ - Website documentation
79
103
 
80
104
  ## 1.1.0
81
105
 
82
106
  ### Minor Changes
83
107
 
84
- - [#82653](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/82653)
85
- [`136d8da5542d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/136d8da5542d) -
86
- _Experimental_: Adding additional information to `onDrop()` events to expose what the final
87
- `dropEffect` was for a drag operation (_now removed_)
108
+ - [#82653](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/82653)
109
+ [`136d8da5542d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/136d8da5542d) -
110
+ _Experimental_: Adding additional information to `onDrop()` events to expose what the final
111
+ `dropEffect` was for a drag operation (_now removed_)
88
112
 
89
- Fixing a bug where `preventUnhandled.start()` would prevent unhandled drag operations forever.
90
- It now only prevents unhandled drag operations for the current drag operation.
91
- `preventUnhandled.stop()` is now optional, as `preventUnhandled.start()` now tidies up itself.
92
- You can still leverage `preventUnhandled.stop()` to stop preventing unhandled drag operations
93
- during a drag.
113
+ Fixing a bug where `preventUnhandled.start()` would prevent unhandled drag operations forever. It
114
+ now only prevents unhandled drag operations for the current drag operation.
115
+ `preventUnhandled.stop()` is now optional, as `preventUnhandled.start()` now tidies up itself. You
116
+ can still leverage `preventUnhandled.stop()` to stop preventing unhandled drag operations during a
117
+ drag.
94
118
 
95
- Tightening the `getDropEffect()` function on drop targets slightly so that `"none"` cannot be
96
- provided. Using `"none"` as the drop effect would break the expected behaviour for nested drop
97
- targets.
119
+ Tightening the `getDropEffect()` function on drop targets slightly so that `"none"` cannot be
120
+ provided. Using `"none"` as the drop effect would break the expected behaviour for nested drop
121
+ targets.
98
122
 
99
123
  ## 1.0.2
100
124
 
101
125
  ### Patch Changes
102
126
 
103
- - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
104
- [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
105
- Upgrade Typescript from `4.9.5` to `5.4.2`
127
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
128
+ [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
129
+ Upgrade Typescript from `4.9.5` to `5.4.2`
106
130
 
107
131
  ## 1.0.1
108
132
 
109
133
  ### Patch Changes
110
134
 
111
- - [#76476](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/76476)
112
- [`35148e092790`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35148e092790) -
113
- Adding warning for test environments to let people know if DragEvents have not been setup
114
- correctly.
135
+ - [#76476](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/76476)
136
+ [`35148e092790`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35148e092790) -
137
+ Adding warning for test environments to let people know if DragEvents have not been setup
138
+ correctly.
115
139
 
116
140
  ## 1.0.0
117
141
 
118
142
  ### Major Changes
119
143
 
120
- - [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)
121
- [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -
122
- This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.
144
+ - [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)
145
+ [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -
146
+ This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.
123
147
 
124
- For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please
125
- see our
126
- [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)
148
+ For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please
149
+ see our
150
+ [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)
127
151
 
128
152
  ## 0.25.0
129
153
 
130
154
  ### Minor Changes
131
155
 
132
- - [#59458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59458)
133
- [`7d6a69cfa61c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7d6a69cfa61c) -
134
- Adding workaround for Safari bug.
156
+ - [#59458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59458)
157
+ [`7d6a69cfa61c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7d6a69cfa61c) -
158
+ Adding workaround for Safari bug.
135
159
 
136
- In Safari (and iOS) if the element used for generating a native drag preview has opacity
137
- applied, then the native drag preview can include elements underneath the drag preview element.
160
+ In Safari (and iOS) if the element used for generating a native drag preview has opacity applied,
161
+ then the native drag preview can include elements underneath the drag preview element.
138
162
 
139
- Pragmatic drag and drop now includes a workaround for this Safari bug.
163
+ Pragmatic drag and drop now includes a workaround for this Safari bug.
140
164
 
141
165
  ## 0.24.0
142
166
 
143
167
  ### Minor Changes
144
168
 
145
- - [#39935](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39935)
146
- [`03b91562fec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/03b91562fec) -
147
- Exposing `AllDragTypes` type. This was previously an internal type, but it provided helpful to
148
- expose for our new auto scroller. `AllDragTypes` is helpful if you need a function to work with
149
- either `element` or `file` drag operations.
169
+ - [#39935](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39935)
170
+ [`03b91562fec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/03b91562fec) - Exposing
171
+ `AllDragTypes` type. This was previously an internal type, but it provided helpful to expose for
172
+ our new auto scroller. `AllDragTypes` is helpful if you need a function to work with either
173
+ `element` or `file` drag operations.
150
174
 
151
175
  ## 0.23.0
152
176
 
153
177
  ### Minor Changes
154
178
 
155
- - [#38713](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38713)
156
- [`3da89e29dfc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3da89e29dfc) - We
157
- have renamed and tweaked the recently added `setCustomNativeDragPreview` `getOffset` utility
158
- `preserveOffsetFromPointer` to be a bit easier to understand what it is doing.
159
-
160
- ```diff
161
- - import { preserveOffsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/preserve-offset-from-pointer';
162
- + import { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/util/preserve-offset-on-source';
163
-
164
- draggable({
165
- element: myElement,
166
- onGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {
167
- setCustomNativeDragPreview({
168
- - getOffset: preserveOffsetFromPointer({
169
- + 'preserveOffsetOnSource' is a more accurate description of what is being achieved
170
- + getOffset: preserveOffsetOnSource({
171
- - sourceElement: source.element,
172
- + // no longer including 'source' in argument name
173
- + // as it is implied by the function name
174
- + element: source.element,
175
- input: location.current.input,
176
- }),
177
- render: function render({ container }) {
178
- /* ... */
179
- },
180
- nativeSetDragImage,
181
- });
182
- },
183
- });
184
- ```
179
+ - [#38713](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38713)
180
+ [`3da89e29dfc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3da89e29dfc) - We have
181
+ renamed and tweaked the recently added `setCustomNativeDragPreview` `getOffset` utility
182
+ `preserveOffsetFromPointer` to be a bit easier to understand what it is doing.
183
+
184
+ ```diff
185
+ - import { preserveOffsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/preserve-offset-from-pointer';
186
+ + import { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/util/preserve-offset-on-source';
187
+
188
+ draggable({
189
+ element: myElement,
190
+ onGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {
191
+ setCustomNativeDragPreview({
192
+ - getOffset: preserveOffsetFromPointer({
193
+ + 'preserveOffsetOnSource' is a more accurate description of what is being achieved
194
+ + getOffset: preserveOffsetOnSource({
195
+ - sourceElement: source.element,
196
+ + // no longer including 'source' in argument name
197
+ + // as it is implied by the function name
198
+ + element: source.element,
199
+ input: location.current.input,
200
+ }),
201
+ render: function render({ container }) {
202
+ /* ... */
203
+ },
204
+ nativeSetDragImage,
205
+ });
206
+ },
207
+ });
208
+ ```
185
209
 
186
210
  ## 0.22.0
187
211
 
188
212
  ### Minor Changes
189
213
 
190
- - [#38397](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38397)
191
- [`d644a68ddf6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d644a68ddf6) - Added
192
- a new `setCustomNativeDragPreview` `getOffset` utility: `preserveOffsetFromPointer`.
193
- `preserveOffsetFromPointer` mimics the default behaviour for non custom drag previews when
194
- starting a drag: the initial cursor position offset is preserved for a seamless drag and drop
195
- experience.
196
-
197
- ```ts
198
- import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';
199
- import { preserveOffsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/preserve-offset-from-pointer';
200
-
201
- draggable({
202
- element: myElement,
203
- onGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {
204
- setCustomNativeDragPreview({
205
- getOffset: preserveOffsetFromPointer({
206
- sourceElement: source.element,
207
- input: location.current.input,
208
- }),
209
- render: function render({ container }) {
210
- /* ... */
211
- },
212
- nativeSetDragImage,
213
- });
214
- },
215
- });
216
- ```
214
+ - [#38397](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38397)
215
+ [`d644a68ddf6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d644a68ddf6) - Added a
216
+ new `setCustomNativeDragPreview` `getOffset` utility: `preserveOffsetFromPointer`.
217
+ `preserveOffsetFromPointer` mimics the default behaviour for non custom drag previews when
218
+ starting a drag: the initial cursor position offset is preserved for a seamless drag and drop
219
+ experience.
220
+
221
+ ```ts
222
+ import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';
223
+ import { preserveOffsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/preserve-offset-from-pointer';
224
+
225
+ draggable({
226
+ element: myElement,
227
+ onGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {
228
+ setCustomNativeDragPreview({
229
+ getOffset: preserveOffsetFromPointer({
230
+ sourceElement: source.element,
231
+ input: location.current.input,
232
+ }),
233
+ render: function render({ container }) {
234
+ /* ... */
235
+ },
236
+ nativeSetDragImage,
237
+ });
238
+ },
239
+ });
240
+ ```
217
241
 
218
242
  ## 0.21.0
219
243
 
220
244
  ### Minor Changes
221
245
 
222
- - [#38525](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38525)
223
- [`de7463c7096`](https://bitbucket.org/atlassian/atlassian-frontend/commits/de7463c7096) -
224
- Exposing some additional TypeScript types. These can be helpful when creating helper packages.
246
+ - [#38525](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38525)
247
+ [`de7463c7096`](https://bitbucket.org/atlassian/atlassian-frontend/commits/de7463c7096) - Exposing
248
+ some additional TypeScript types. These can be helpful when creating helper packages.
225
249
 
226
- ```ts
227
- import type {
228
- // These types are not needed for consumers
229
- // They are mostly helpful for other packages
230
- AllDragTypes,
231
- MonitorArgs,
232
- BaseEventPayload,
233
- } from '@atlaskit/pragmatic-drag-and-drop/types';
234
- ```
250
+ ```ts
251
+ import type {
252
+ // These types are not needed for consumers
253
+ // They are mostly helpful for other packages
254
+ AllDragTypes,
255
+ MonitorArgs,
256
+ BaseEventPayload,
257
+ } from '@atlaskit/pragmatic-drag-and-drop/types';
258
+ ```
235
259
 
236
- - `AllDragTypes`: representation of all entities types in the system (eg element and file)
237
- - `MonitorArgs<DragType extends AllDragTypes>`: the arguments that can be passed to a monitor
238
- - `BaseEventPayload<DragType extends AllDragTypes>`: the shared properties in all events
260
+ - `AllDragTypes`: representation of all entities types in the system (eg element and file)
261
+ - `MonitorArgs<DragType extends AllDragTypes>`: the arguments that can be passed to a monitor
262
+ - `BaseEventPayload<DragType extends AllDragTypes>`: the shared properties in all events
239
263
 
240
264
  ## 0.20.0
241
265
 
242
266
  ### Minor Changes
243
267
 
244
- - [#38453](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38453)
245
- [`554a6d8cc34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/554a6d8cc34) - ###
246
- Stickiness algorithm improvement
268
+ - [#38453](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38453)
269
+ [`554a6d8cc34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/554a6d8cc34) - ###
270
+ Stickiness algorithm improvement
247
271
 
248
- We have made some improvements to the drop target stickiness algorithm to allow sticky drop
249
- targets that are no longer dragged over to cancel their stickiness.
272
+ We have made some improvements to the drop target stickiness algorithm to allow sticky drop
273
+ targets that are no longer dragged over to cancel their stickiness.
250
274
 
251
- Stickiness is no longer maintained when a sticky drop target states it cannot be dropped on
275
+ Stickiness is no longer maintained when a sticky drop target states it cannot be dropped on
252
276
 
253
- > Scenario: `[A(sticky)]` → `[]` + `A:canDrop()` returns `false` Result: `[]`
277
+ > Scenario: `[A(sticky)]` → `[]` + `A:canDrop()` returns `false` Result: `[]`
254
278
 
255
- Stickiness is no longer maintained when a sticky drop start states it is no longer sticky
279
+ Stickiness is no longer maintained when a sticky drop start states it is no longer sticky
256
280
 
257
- > Scenario: `[A(sticky)]` → `[]` + `A:getIsSticky()` returns `false` Result: `[]`
281
+ > Scenario: `[A(sticky)]` → `[]` + `A:getIsSticky()` returns `false` Result: `[]`
258
282
 
259
- Stickiness is no longer maintained when a sticky drop start is unmounted
283
+ Stickiness is no longer maintained when a sticky drop start is unmounted
260
284
 
261
- > Scenario: `[A(sticky)]` → `[]` + `A` is unmounted Result: `[]`
285
+ > Scenario: `[A(sticky)]` → `[]` + `A` is unmounted Result: `[]`
262
286
 
263
- To help facilitate this change:
287
+ To help facilitate this change:
264
288
 
265
- - `getIsSticky()` is now only called when an _drop target_ is a potential candidate for
266
- stickiness (previously it was called repeatedly)
267
- - `getIsSticky()` and `canDrop()` are called on _drop targets_ that are no longer being
268
- dragged over, but are candidates for stickiness
289
+ - `getIsSticky()` is now only called when an _drop target_ is a potential candidate for stickiness
290
+ (previously it was called repeatedly)
291
+ - `getIsSticky()` and `canDrop()` are called on _drop targets_ that are no longer being dragged
292
+ over, but are candidates for stickiness
269
293
 
270
- ### Change to `DropTargetRecord` `type`
294
+ ### Change to `DropTargetRecord` `type`
271
295
 
272
- Previously, the `DropTargetRecord` type had a property called `sticky` which would represent
273
- whether the _drop target_ was registering itself as sticky via `getIsSticky()`. Knowing `sticky`
274
- is not overly helpful given that we now regularly recompute stickiness and a _drop target_ can
275
- change disable stickiness after it is applied.
296
+ Previously, the `DropTargetRecord` type had a property called `sticky` which would represent
297
+ whether the _drop target_ was registering itself as sticky via `getIsSticky()`. Knowing `sticky`
298
+ is not overly helpful given that we now regularly recompute stickiness and a _drop target_ can
299
+ change disable stickiness after it is applied.
276
300
 
277
- What is helpful, is knowing whether a _drop target_ is active _because_ of stickiness. So we
278
- have removed `sticky` and added `isActiveDueToStickiness` to the `DropTargetRecord` type.
301
+ What is helpful, is knowing whether a _drop target_ is active _because_ of stickiness. So we have
302
+ removed `sticky` and added `isActiveDueToStickiness` to the `DropTargetRecord` type.
279
303
 
280
- ```diff
281
- type DropTargetRecord = {
282
- element: Element;
283
- data: Record<string | symbol, unknown>;
284
- dropEffect: DataTransfer['dropEffect'];
285
- - sticky: boolean;
286
- + isActiveDueToStickiness: boolean;
287
- };
288
- ```
304
+ ```diff
305
+ type DropTargetRecord = {
306
+ element: Element;
307
+ data: Record<string | symbol, unknown>;
308
+ dropEffect: DataTransfer['dropEffect'];
309
+ - sticky: boolean;
310
+ + isActiveDueToStickiness: boolean;
311
+ };
312
+ ```
289
313
 
290
314
  ## 0.19.0
291
315
 
292
316
  ### Minor Changes
293
317
 
294
- - [#35574](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35574)
295
- [`8c301a251e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8c301a251e4) - We
296
- have changed the API of `setCustomNativeDragPreview()` to allow increased control and slightly
297
- lower bundles as well.
298
-
299
- We have removed the `placement` argument, and replaced it with `getOffset()`.
300
-
301
- ```diff
302
- - placement: { type: 'center' } | { type: 'offset-from-pointer'; x: CSSValue; y: CSSValue };
303
- + getOffset: (args: { container: HTMLElement }) => {x: number, y: number}
304
- ```
305
-
306
- `getOffset()` allows unlimited control over how to place the custom native drag preview relative
307
- to the users pointer. Please see our updated documentation for detailed information about the
308
- new `getOffset()` API. Our new `getOffset()` approach means that we also no longer need to bake
309
- in all `placement` options into the bundle - consumers now only pay for what they use!
310
-
311
- `placement: { type: 'offset-from-pointer' }` has been replaced by `offsetFromPointer()`
312
-
313
- ```diff
314
- import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';
315
- + import { offsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/offset-from-pointer;
316
-
317
- draggable({
318
- element: myElement,
319
- onGenerateDragPreview: ({ nativeSetDragImage }) => {
320
- setCustomNativeDragPreview({
321
- - placement: { type: 'offset-from-pointer', x: '16px', y: '8px' }
322
- + getOffset: offsetFromPointer({x: '16px', y: '8px'}),
323
- render: function render({ container }) {
324
- ReactDOM.render(<Preview item={item} />, container);
325
- return function cleanup() {
326
- ReactDOM.unmountComponentAtNode(container);
327
- };
328
- },
329
- nativeSetDragImage,
330
- });
331
- },
332
- });
333
- ```
334
-
335
- `placement: { type: 'center' }` has been replaced by `centerUnderPointer()`
336
-
337
- ```diff
338
- import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';
339
- + import { centerUnderPointer } from '@atlaskit/pragmatic-drag-and-drop/util/center-under-pointer-pointer;
340
-
341
- draggable({
342
- element: myElement,
343
- onGenerateDragPreview: ({ nativeSetDragImage }) => {
344
- setCustomNativeDragPreview({
345
- - placement: { type: 'center' }
346
- + getOffset: centerUnderPointer,
347
- render: function render({ container }) {
348
- ReactDOM.render(<Preview item={item} />, container);
349
- return function cleanup() {
350
- ReactDOM.unmountComponentAtNode(container);
351
- };
352
- },
353
- nativeSetDragImage,
354
- });
355
- },
356
- });
357
- ```
318
+ - [#35574](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35574)
319
+ [`8c301a251e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8c301a251e4) - We have
320
+ changed the API of `setCustomNativeDragPreview()` to allow increased control and slightly lower
321
+ bundles as well.
322
+
323
+ We have removed the `placement` argument, and replaced it with `getOffset()`.
324
+
325
+ ```diff
326
+ - placement: { type: 'center' } | { type: 'offset-from-pointer'; x: CSSValue; y: CSSValue };
327
+ + getOffset: (args: { container: HTMLElement }) => {x: number, y: number}
328
+ ```
329
+
330
+ `getOffset()` allows unlimited control over how to place the custom native drag preview relative
331
+ to the users pointer. Please see our updated documentation for detailed information about the new
332
+ `getOffset()` API. Our new `getOffset()` approach means that we also no longer need to bake in all
333
+ `placement` options into the bundle - consumers now only pay for what they use!
334
+
335
+ `placement: { type: 'offset-from-pointer' }` has been replaced by `offsetFromPointer()`
336
+
337
+ ```diff
338
+ import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';
339
+ + import { offsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/offset-from-pointer;
340
+
341
+ draggable({
342
+ element: myElement,
343
+ onGenerateDragPreview: ({ nativeSetDragImage }) => {
344
+ setCustomNativeDragPreview({
345
+ - placement: { type: 'offset-from-pointer', x: '16px', y: '8px' }
346
+ + getOffset: offsetFromPointer({x: '16px', y: '8px'}),
347
+ render: function render({ container }) {
348
+ ReactDOM.render(<Preview item={item} />, container);
349
+ return function cleanup() {
350
+ ReactDOM.unmountComponentAtNode(container);
351
+ };
352
+ },
353
+ nativeSetDragImage,
354
+ });
355
+ },
356
+ });
357
+ ```
358
+
359
+ `placement: { type: 'center' }` has been replaced by `centerUnderPointer()`
360
+
361
+ ```diff
362
+ import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';
363
+ + import { centerUnderPointer } from '@atlaskit/pragmatic-drag-and-drop/util/center-under-pointer-pointer;
364
+
365
+ draggable({
366
+ element: myElement,
367
+ onGenerateDragPreview: ({ nativeSetDragImage }) => {
368
+ setCustomNativeDragPreview({
369
+ - placement: { type: 'center' }
370
+ + getOffset: centerUnderPointer,
371
+ render: function render({ container }) {
372
+ ReactDOM.render(<Preview item={item} />, container);
373
+ return function cleanup() {
374
+ ReactDOM.unmountComponentAtNode(container);
375
+ };
376
+ },
377
+ nativeSetDragImage,
378
+ });
379
+ },
380
+ });
381
+ ```
358
382
 
359
383
  ## 0.18.2
360
384
 
361
385
  ### Patch Changes
362
386
 
363
- - [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)
364
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure
365
- legacy types are published for TS 4.5-4.8
387
+ - [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)
388
+ [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure
389
+ legacy types are published for TS 4.5-4.8
366
390
 
367
391
  ## 0.18.1
368
392
 
369
393
  ### Patch Changes
370
394
 
371
- - [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)
372
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) -
373
- Upgrade Typescript from `4.5.5` to `4.9.5`
395
+ - [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)
396
+ [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade
397
+ Typescript from `4.5.5` to `4.9.5`
374
398
 
375
399
  ## 0.18.0
376
400
 
377
401
  ### Minor Changes
378
402
 
379
- - [#33344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33344)
380
- [`9fd8556db17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd8556db17) -
381
- Internal folder name structure change
403
+ - [#33344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33344)
404
+ [`9fd8556db17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd8556db17) - Internal
405
+ folder name structure change
382
406
 
383
407
  ## 0.17.0
384
408
 
385
409
  ### Minor Changes
386
410
 
387
- - [#33262](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33262)
388
- [`34ed7b2ec63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ed7b2ec63) - We
389
- have changed the name of our drag and drop packages to align on the single name of "Pragmatic
390
- drag and drop"
411
+ - [#33262](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33262)
412
+ [`34ed7b2ec63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ed7b2ec63) - We have
413
+ changed the name of our drag and drop packages to align on the single name of "Pragmatic drag and
414
+ drop"
391
415
 
392
- ```diff
393
- - @atlaskit/drag-and-drop
394
- + @atlaskit/pragmatic-drag-and-drop
416
+ ```diff
417
+ - @atlaskit/drag-and-drop
418
+ + @atlaskit/pragmatic-drag-and-drop
395
419
 
396
- - @atlaskit/drag-and-drop-autoscroll
397
- + @atlaskit/pragmatic-drag-and-drop-autoscroll
420
+ - @atlaskit/drag-and-drop-autoscroll
421
+ + @atlaskit/pragmatic-drag-and-drop-autoscroll
398
422
 
399
- - @atlaskit/drag-and-drop-hitbox
400
- + @atlaskit/pragmatic-drag-and-drop-hitbox
423
+ - @atlaskit/drag-and-drop-hitbox
424
+ + @atlaskit/pragmatic-drag-and-drop-hitbox
401
425
 
402
- - @atlaskit/drag-and-drop-indicator
403
- + @atlaskit/pragmatic-drag-and-drop-react-indicator
404
- # Note: `react` was added to this package name as our indicator package is designed for usage with `react`.
426
+ - @atlaskit/drag-and-drop-indicator
427
+ + @atlaskit/pragmatic-drag-and-drop-react-indicator
428
+ # Note: `react` was added to this package name as our indicator package is designed for usage with `react`.
405
429
 
406
- - @atlaskit/drag-and-drop-live-region
407
- + @atlaskit/pragmatic-drag-and-drop-live-region
430
+ - @atlaskit/drag-and-drop-live-region
431
+ + @atlaskit/pragmatic-drag-and-drop-live-region
408
432
 
409
- - @atlaskit/drag-and-drop-react-beautiful-dnd-migration
410
- + @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration
433
+ - @atlaskit/drag-and-drop-react-beautiful-dnd-migration
434
+ + @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration
411
435
 
412
- - @atlaskit/drag-and-drop-docs
413
- + @atlaskit/pragmatic-drag-and-drop-docs
414
- ```
436
+ - @atlaskit/drag-and-drop-docs
437
+ + @atlaskit/pragmatic-drag-and-drop-docs
438
+ ```
415
439
 
416
- The new `@atlaskit/pragmatic-drag-and-drop*` packages will start their initial versions from
417
- where the ``@atlaskit/drag-and-drop*` packages left off. Doing this will make it easier to look
418
- back on changelogs and see how the packages have progressed.
440
+ The new `@atlaskit/pragmatic-drag-and-drop*` packages will start their initial versions from where
441
+ the ``@atlaskit/drag-and-drop*` packages left off. Doing this will make it easier to look back on
442
+ changelogs and see how the packages have progressed.
419
443
 
420
444
  ## 0.16.0
421
445
 
422
446
  ### Minor Changes
423
447
 
424
- - [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)
425
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip
426
- minor dependency bump
448
+ - [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)
449
+ [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip
450
+ minor dependency bump
427
451
 
428
452
  ## 0.15.1
429
453
 
430
454
  ### Patch Changes
431
455
 
432
- - [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)
433
- [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY
434
- remove before merging to master; dupe adf-schema via adf-utils
456
+ - [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)
457
+ [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY
458
+ remove before merging to master; dupe adf-schema via adf-utils
435
459
 
436
460
  ## 0.15.0
437
461
 
438
462
  ### Minor Changes
439
463
 
440
- - [#31909](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31909)
441
- [`ed028658f13`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ed028658f13) - Minor
442
- internal refactor and adding additional tests
464
+ - [#31909](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31909)
465
+ [`ed028658f13`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ed028658f13) - Minor
466
+ internal refactor and adding additional tests
443
467
 
444
468
  ## 0.14.0
445
469
 
446
470
  ### Minor Changes
447
471
 
448
- - [#31794](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31794)
449
- [`eab6d26451d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eab6d26451d) -
450
- Improving the resilience of our workaround for a
451
- [Browser bug](https://bugs.chromium.org/p/chromium/issues/detail?id=410328) where after a drag
452
- finishes, an unrelated element can be entered into.
453
- - [`ba7ea570aee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ba7ea570aee) - > Both
454
- of these changes should not impact most consumers as they are targeted at edge cases.
455
-
456
- - **Fix**: We no longer extract user input (eg `clientX`) from native `"dragleave"` events due
457
- to a
458
- [Bug with Chrome we discovered](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937).
459
- Due to this bug, it was possible for `location.current.input` to be incorrectly set in
460
- `onDropTargetChange` and `onDrop` when a user was cancelling a drag or dropping or no drop
461
- targets.
462
-
463
- - **Fix**: `location.previous.dropTargets` _should_ always point to the
464
- `location.current.dropTargets` value from the previous event (exception:
465
- `onGenerateDragPreview` and `onDragStart` have the same `location.previous` and
466
- `location.current` values). Previously, the `location.previous.dropTargets` value did not
467
- match the last events `location.current.dropTargets` value in `onDrop`. `onDrop()` would
468
- incorrectly use the `location.current` and `location.previous` values from the last event
469
- rather than creating a new `location.current` entry. Now, `onDrop()`,
470
- `location.previous.dropTargets` points to the `location.current.dropTargets` from the last
471
- event (same as all other events) and `location.current.dropTargets` points to what the
472
- previous drop target was as well (no change)
472
+ - [#31794](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31794)
473
+ [`eab6d26451d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eab6d26451d) -
474
+ Improving the resilience of our workaround for a
475
+ [Browser bug](https://bugs.chromium.org/p/chromium/issues/detail?id=410328) where after a drag
476
+ finishes, an unrelated element can be entered into.
477
+ - [`ba7ea570aee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ba7ea570aee) - > Both
478
+ of these changes should not impact most consumers as they are targeted at edge cases.
479
+
480
+ - **Fix**: We no longer extract user input (eg `clientX`) from native `"dragleave"` events due to
481
+ a
482
+ [Bug with Chrome we discovered](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937).
483
+ Due to this bug, it was possible for `location.current.input` to be incorrectly set in
484
+ `onDropTargetChange` and `onDrop` when a user was cancelling a drag or dropping or no drop
485
+ targets.
486
+
487
+ - **Fix**: `location.previous.dropTargets` _should_ always point to the
488
+ `location.current.dropTargets` value from the previous event (exception: `onGenerateDragPreview`
489
+ and `onDragStart` have the same `location.previous` and `location.current` values). Previously,
490
+ the `location.previous.dropTargets` value did not match the last events
491
+ `location.current.dropTargets` value in `onDrop`. `onDrop()` would incorrectly use the
492
+ `location.current` and `location.previous` values from the last event rather than creating a new
493
+ `location.current` entry. Now, `onDrop()`, `location.previous.dropTargets` points to the
494
+ `location.current.dropTargets` from the last event (same as all other events) and
495
+ `location.current.dropTargets` points to what the previous drop target was as well (no change)
473
496
 
474
497
  ## 0.13.0
475
498
 
476
499
  ### Minor Changes
477
500
 
478
- - [#30879](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30879)
479
- [`2582df26509`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2582df26509) - Fixing
480
- a browser bug where after a drag finishes, a unrelated element can be entered into by the
481
- browser
501
+ - [#30879](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30879)
502
+ [`2582df26509`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2582df26509) - Fixing a
503
+ browser bug where after a drag finishes, a unrelated element can be entered into by the browser
482
504
 
483
- - [Visual explanation of bug](https://twitter.com/alexandereardon/status/1633614212873465856)
484
- - [Chrome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=410328)
505
+ - [Visual explanation of bug](https://twitter.com/alexandereardon/status/1633614212873465856)
506
+ - [Chrome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=410328)
485
507
 
486
508
  ## 0.12.0
487
509
 
488
510
  ### Minor Changes
489
511
 
490
- - [#30953](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30953)
491
- [`90901f5bbe0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/90901f5bbe0) -
492
- Replace default entry point of `undefined` with `{}`.
512
+ - [#30953](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30953)
513
+ [`90901f5bbe0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/90901f5bbe0) - Replace
514
+ default entry point of `undefined` with `{}`.
493
515
 
494
- > **NOTE:** Importing from the default entry point isn't supported. _Please use individual entry
495
- > points in order to always obtain minimum kbs._
516
+ > **NOTE:** Importing from the default entry point isn't supported. _Please use individual entry
517
+ > points in order to always obtain minimum kbs._
496
518
 
497
519
  ## 0.11.0
498
520
 
499
521
  ### Minor Changes
500
522
 
501
- - [#30668](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30668)
502
- [`1ecbb19d450`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1ecbb19d450) - Adding
503
- a new function to make creating _custom_ native drag previews safe and easy:
504
- `setCustomNativeDragPreview`
505
-
506
- ```tsx
507
- import { setCustomNativeDragPreview } from '@atlaskit/drag-and-drop/util/set-custom-native-drag-preview';
508
-
509
- draggable({
510
- element: myElement,
511
- onGenerateDragPreview: ({ nativeSetDragImage }) => {
512
- setCustomNativeDragPreview({
513
- render: function render({ container }) {
514
- ReactDOM.render(<Preview item={item} />, container);
515
- return function cleanup() {
516
- ReactDOM.unmountComponentAtNode(container);
517
- };
518
- },
519
- nativeSetDragImage,
520
- });
521
- },
522
- });
523
- ```
524
-
525
- Please see our element adapter documentation for more detailed usage information
523
+ - [#30668](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30668)
524
+ [`1ecbb19d450`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1ecbb19d450) - Adding a
525
+ new function to make creating _custom_ native drag previews safe and easy:
526
+ `setCustomNativeDragPreview`
527
+
528
+ ```tsx
529
+ import { setCustomNativeDragPreview } from '@atlaskit/drag-and-drop/util/set-custom-native-drag-preview';
530
+
531
+ draggable({
532
+ element: myElement,
533
+ onGenerateDragPreview: ({ nativeSetDragImage }) => {
534
+ setCustomNativeDragPreview({
535
+ render: function render({ container }) {
536
+ ReactDOM.render(<Preview item={item} />, container);
537
+ return function cleanup() {
538
+ ReactDOM.unmountComponentAtNode(container);
539
+ };
540
+ },
541
+ nativeSetDragImage,
542
+ });
543
+ },
544
+ });
545
+ ```
546
+
547
+ Please see our element adapter documentation for more detailed usage information
526
548
 
527
549
  ## 0.10.0
528
550
 
529
551
  ### Minor Changes
530
552
 
531
- - [#29951](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29951)
532
- [`9c0975e2fab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9c0975e2fab) - Bug
533
- fix: A _monitor_ should not be called after it is removed. Previously, if a _monitor_
534
- (monitor 1) removed another _monitor_ (monitor 2) for the same event, then the second monitor
535
- (monitor 2) would still be called. This has been fixed
536
-
537
- ```ts
538
- const cleanupMonitor1 = monitorForElements({
539
- onDragStart: () => {
540
- cleanupMonitor2();
541
- },
542
- });
543
- const cleanupMonitor2 = monitorForElements({
544
- // Previously this `onDragStart` would have been called during `onDragStart` even though it was unbound by the first monitor
545
- onDragStart: () => {},
546
- });
547
- ```
553
+ - [#29951](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29951)
554
+ [`9c0975e2fab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9c0975e2fab) - Bug fix:
555
+ A _monitor_ should not be called after it is removed. Previously, if a _monitor_ (monitor 1)
556
+ removed another _monitor_ (monitor 2) for the same event, then the second monitor (monitor 2)
557
+ would still be called. This has been fixed
558
+
559
+ ```ts
560
+ const cleanupMonitor1 = monitorForElements({
561
+ onDragStart: () => {
562
+ cleanupMonitor2();
563
+ },
564
+ });
565
+ const cleanupMonitor2 = monitorForElements({
566
+ // Previously this `onDragStart` would have been called during `onDragStart` even though it was unbound by the first monitor
567
+ onDragStart: () => {},
568
+ });
569
+ ```
548
570
 
549
571
  ## 0.9.0
550
572
 
551
573
  ### Minor Changes
552
574
 
553
- - [#29651](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29651)
554
- [`03e0aa5ae85`](https://bitbucket.org/atlassian/atlassian-frontend/commits/03e0aa5ae85) -
555
- `@atlaskit/drag-and-drop` adds event listeners to the `window` during a drag operation. These
556
- drag operation event listeners were [`bubble` phase event listeners](https://domevents.dev/),
557
- but they are now `capture` phase event listeners to be more resliant against external code
558
- (incorrectly) stopping events.
575
+ - [#29651](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29651)
576
+ [`03e0aa5ae85`](https://bitbucket.org/atlassian/atlassian-frontend/commits/03e0aa5ae85) -
577
+ `@atlaskit/drag-and-drop` adds event listeners to the `window` during a drag operation. These drag
578
+ operation event listeners were [`bubble` phase event listeners](https://domevents.dev/), but they
579
+ are now `capture` phase event listeners to be more resliant against external code (incorrectly)
580
+ stopping events.
559
581
 
560
- This does not impact the ability of a consumer to have their own `draggable`s on a page not
561
- controlled by `@atlaskit/drag-and-drop`
582
+ This does not impact the ability of a consumer to have their own `draggable`s on a page not
583
+ controlled by `@atlaskit/drag-and-drop`
562
584
 
563
585
  ## 0.8.1
564
586
 
565
587
  ### Patch Changes
566
588
 
567
- - [#28324](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28324)
568
- [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds
569
- for this package now pass through a tokens babel plugin, removing runtime invocations of the
570
- tokens() function and improving performance.
589
+ - [#28324](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28324)
590
+ [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds
591
+ for this package now pass through a tokens babel plugin, removing runtime invocations of the
592
+ tokens() function and improving performance.
571
593
 
572
594
  ## 0.8.0
573
595
 
574
596
  ### Minor Changes
575
597
 
576
- - [#26317](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26317)
577
- [`1e3f9743e57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1e3f9743e57) - A
578
- _monitor_ that is added during an event (eg `onDragStart`) will no longer be called for the
579
- current event. This is to prevent the accidental creation of infinite loops. This behaviour
580
- matches native [`EventTargets`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)
581
- where an event listener cannot add another event listener during an active event to the same
582
- event target in the same event phase.
598
+ - [#26317](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26317)
599
+ [`1e3f9743e57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1e3f9743e57) - A
600
+ _monitor_ that is added during an event (eg `onDragStart`) will no longer be called for the
601
+ current event. This is to prevent the accidental creation of infinite loops. This behaviour
602
+ matches native [`EventTargets`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)
603
+ where an event listener cannot add another event listener during an active event to the same event
604
+ target in the same event phase.
583
605
 
584
606
  ## 0.7.1
585
607
 
586
608
  ### Patch Changes
587
609
 
588
- - [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)
589
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) -
590
- Upgrade Typescript from `4.3.5` to `4.5.5`
610
+ - [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)
611
+ [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade
612
+ Typescript from `4.3.5` to `4.5.5`
591
613
 
592
614
  ## 0.7.0
593
615
 
594
616
  ### Minor Changes
595
617
 
596
- - [#25428](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25428)
597
- [`f2a7931d609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f2a7931d609) - Adding
598
- jsdoc to DragLocation type for better autocomplete
618
+ - [#25428](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25428)
619
+ [`f2a7931d609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f2a7931d609) - Adding
620
+ jsdoc to DragLocation type for better autocomplete
599
621
 
600
622
  ## 0.6.0
601
623
 
602
624
  ### Minor Changes
603
625
 
604
- - [#25002](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25002)
605
- [`0f755214ee7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0f755214ee7) -
606
- Internal folder renaming. No API impact
626
+ - [#25002](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25002)
627
+ [`0f755214ee7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0f755214ee7) - Internal
628
+ folder renaming. No API impact
607
629
 
608
630
  ## 0.5.0
609
631
 
610
632
  ### Minor Changes
611
633
 
612
- - [#25007](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25007)
613
- [`17950433a70`](https://bitbucket.org/atlassian/atlassian-frontend/commits/17950433a70) -
614
- Touching package to release re-release previous version. The previous (now deprecated) version
615
- did not have it's entry points built correctly
634
+ - [#25007](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25007)
635
+ [`17950433a70`](https://bitbucket.org/atlassian/atlassian-frontend/commits/17950433a70) - Touching
636
+ package to release re-release previous version. The previous (now deprecated) version did not have
637
+ it's entry points built correctly
616
638
 
617
639
  ## 0.4.0
618
640
 
619
641
  ### Minor Changes
620
642
 
621
- - [#24861](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24861)
622
- [`4d739042b04`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4d739042b04) -
623
- Improving jsdoc auto complete information for `GetFeedbackArgs`
643
+ - [#24861](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24861)
644
+ [`4d739042b04`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4d739042b04) -
645
+ Improving jsdoc auto complete information for `GetFeedbackArgs`
624
646
 
625
647
  ## 0.3.0
626
648
 
627
649
  ### Minor Changes
628
650
 
629
- - [#24810](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24810)
630
- [`52403a2c11f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/52403a2c11f) - Adding
631
- a `canMonitor()` function to _monitors_ to allow a _monitor_ to conditionally apply to a drag
632
- operation.
651
+ - [#24810](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24810)
652
+ [`52403a2c11f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/52403a2c11f) - Adding a
653
+ `canMonitor()` function to _monitors_ to allow a _monitor_ to conditionally apply to a drag
654
+ operation.
633
655
 
634
- ```ts
635
- monitorForElements({
636
- canMonitor: ({ source }) => source.data.type === 'card',
637
- onDragStart: () => console.log('I will only be activated when dragging a card!'),
638
- });
639
- ```
656
+ ```ts
657
+ monitorForElements({
658
+ canMonitor: ({ source }) => source.data.type === 'card',
659
+ onDragStart: () => console.log('I will only be activated when dragging a card!'),
660
+ });
661
+ ```
640
662
 
641
663
  ## 0.2.0
642
664
 
643
665
  ### Minor Changes
644
666
 
645
- - [#24613](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24613)
646
- [`1cf9e484b4b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1cf9e484b4b) - We
647
- have improved our naming consistency across our drag and drop packages.
667
+ - [#24613](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24613)
668
+ [`1cf9e484b4b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1cf9e484b4b) - We have
669
+ improved our naming consistency across our drag and drop packages.
648
670
 
649
- - `@atlaskit/drag-and-drop/util/cancel-unhandled` has been renamed to
650
- `@atlaskit/drag-and-drop/addon/cancel-unhandled`
671
+ - `@atlaskit/drag-and-drop/util/cancel-unhandled` has been renamed to
672
+ `@atlaskit/drag-and-drop/addon/cancel-unhandled`
651
673
 
652
674
  ## 0.1.0
653
675
 
654
676
  ### Minor Changes
655
677
 
656
- - [#24532](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24532)
657
- [`73427c38077`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73427c38077) -
658
- Initial release of `@atlaskit/drag-and-drop` packages 🎉
678
+ - [#24532](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24532)
679
+ [`73427c38077`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73427c38077) - Initial
680
+ release of `@atlaskit/drag-and-drop` packages 🎉
659
681
 
660
682
  ## 0.0.1
661
683
 
662
684
  ### Patch Changes
663
685
 
664
- - [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)
665
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) -
666
- Upgrade Typescript from `4.2.4` to `4.3.5`.
686
+ - [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)
687
+ [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade
688
+ Typescript from `4.2.4` to `4.3.5`.