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