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

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