@atlaskit/pragmatic-drag-and-drop 1.1.0 → 1.1.2
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 +17 -13
- package/README.md +3 -39
- package/dist/cjs/ledger/dispatch-consumer-event.js +0 -2
- package/dist/cjs/ledger/lifecycle-manager.js +4 -26
- package/dist/es2019/ledger/dispatch-consumer-event.js +0 -2
- package/dist/es2019/ledger/lifecycle-manager.js +4 -24
- package/dist/esm/ledger/dispatch-consumer-event.js +0 -2
- package/dist/esm/ledger/lifecycle-manager.js +4 -26
- package/dist/types/entry-point/types.d.ts +1 -1
- package/dist/types/internal-types.d.ts +1 -6
- package/dist/types/ledger/dispatch-consumer-event.d.ts +2 -3
- package/dist/types-ts4.5/entry-point/types.d.ts +1 -1
- package/dist/types-ts4.5/internal-types.d.ts +1 -6
- package/dist/types-ts4.5/ledger/dispatch-consumer-event.d.ts +2 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
# @atlaskit/pragmatic-drag-and-drop
|
|
2
2
|
|
|
3
|
-
## 1.1.
|
|
3
|
+
## 1.1.2
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
7
|
+
- [#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.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
type DropData = {
|
|
11
|
-
dropEffect: DataTransfer['dropEffect'];
|
|
12
|
-
};
|
|
9
|
+
## 1.1.1
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#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.
|
|
14
|
+
|
|
15
|
+
- `package.json` `description`
|
|
16
|
+
- `README.md`
|
|
17
|
+
- Website documentation
|
|
18
|
+
|
|
19
|
+
## 1.1.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- [#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_)
|
|
20
24
|
|
|
21
25
|
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.
|
|
22
26
|
|
package/README.md
CHANGED
|
@@ -1,43 +1,7 @@
|
|
|
1
1
|
# Pragmatic drag and drop
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Fast drag and drop for any experience on any tech stack
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The core package for Pragmatic drag and drop.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
There are a wealth of existing drag and drop libraries for the web. Some drag and drop libraries are general purpose (e.g. `@shopify/draggable`, `react-dnd`), and some are for specific experiences (e.g. `react-beautiful-dnd` is for lists and connected lists). Some libraries leverage the platform's built in drag and drop capabilities, and some rebuild the drag and drop operation from scratch.
|
|
10
|
-
|
|
11
|
-
Every drag and drop solution will make tradeoffs regarding feature sets, user experience, startup performance and runtime performance.
|
|
12
|
-
|
|
13
|
-
The goals of `@atlaskit/pragmatic-drag-and-drop` are:
|
|
14
|
-
|
|
15
|
-
- 🚀 Speed: Best of class startup and runtime performance
|
|
16
|
-
- 🤸 Flexibility: Can be used to power any interaction
|
|
17
|
-
- 🧑🦽 Accessibility\*: Ensuring that all users have a good experience
|
|
18
|
-
|
|
19
|
-
> \*Accessible experiences are achieved through alternative keyboard and screen reader flows. Unfortunately, the browsers drag and drop behaviour is not accessible (yet). But don't worry, we have a comprehensive guide and toolchain to help you be successful here
|
|
20
|
-
|
|
21
|
-
## Core characteristics
|
|
22
|
-
|
|
23
|
-
- 🌎 Platform powered: leverages the browsers drag and drop capabilities
|
|
24
|
-
- 🐁 Tiny: ~`4.5kB` base
|
|
25
|
-
- 🪡 Incremental: only pay for what you use
|
|
26
|
-
- ⏳ Deferred compatible: consumers can delay the loading of `@atlaskit/pragmatic-drag-and-drop` (and related packages) in order to improve page load speeds
|
|
27
|
-
- 🎨 Headless: full rendering and style control
|
|
28
|
-
- 🦊 Cross browser support: full feature support in Firefox, Safari and Chrome
|
|
29
|
-
- 📱 Touch device compatible
|
|
30
|
-
- 🎁 Addons: patterns that allow sharing small pieces of functionality that can be added together
|
|
31
|
-
- 🎄 Framework agnostic: works with any frontend framework
|
|
32
|
-
- 👾 Virtualization support
|
|
33
|
-
- 🧑🦽 Accessible: comprehensive toolchain and patterns for creating highly accessible experiences
|
|
34
|
-
|
|
35
|
-
## Installation
|
|
36
|
-
|
|
37
|
-
```sh
|
|
38
|
-
yarn add @atlaskit/pragmatic-drag-and-drop
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Usage
|
|
42
|
-
|
|
43
|
-
Detailed docs and example usage can be found on [atlassian.design](https://atlassian.design/components/pragmatic-drag-and-drop/).
|
|
7
|
+
[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)
|
|
@@ -112,14 +112,12 @@ function makeDispatch(_ref) {
|
|
|
112
112
|
},
|
|
113
113
|
drop: function drop(_ref5) {
|
|
114
114
|
var current = _ref5.current,
|
|
115
|
-
drop = _ref5.drop,
|
|
116
115
|
updatedSourcePayload = _ref5.updatedSourcePayload;
|
|
117
116
|
dragStart.flush();
|
|
118
117
|
scheduleOnDrag.cancel();
|
|
119
118
|
safeDispatch({
|
|
120
119
|
eventName: 'onDrop',
|
|
121
120
|
payload: {
|
|
122
|
-
drop: drop,
|
|
123
121
|
source: updatedSourcePayload !== null && updatedSourcePayload !== void 0 ? updatedSourcePayload : source,
|
|
124
122
|
location: {
|
|
125
123
|
current: current,
|
|
@@ -107,7 +107,7 @@ function start(_ref2) {
|
|
|
107
107
|
input: input
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
function cancel(
|
|
110
|
+
function cancel() {
|
|
111
111
|
// The spec behaviour is that when a drag is cancelled, or when dropping on no drop targets,
|
|
112
112
|
// a "dragleave" event is fired on the active drop target before a "dragend" event.
|
|
113
113
|
// We are replicating that behaviour in `cancel` if there are any active drop targets to
|
|
@@ -124,7 +124,6 @@ function start(_ref2) {
|
|
|
124
124
|
}
|
|
125
125
|
dispatch.drop({
|
|
126
126
|
current: state.current,
|
|
127
|
-
drop: drop,
|
|
128
127
|
updatedSourcePayload: null
|
|
129
128
|
});
|
|
130
129
|
finish();
|
|
@@ -216,15 +215,12 @@ function start(_ref2) {
|
|
|
216
215
|
dropTargets: []
|
|
217
216
|
});
|
|
218
217
|
if (dragType.startedFrom === 'external') {
|
|
219
|
-
cancel(
|
|
220
|
-
dropEffect: 'none'
|
|
221
|
-
});
|
|
218
|
+
cancel();
|
|
222
219
|
}
|
|
223
220
|
}
|
|
224
221
|
}, {
|
|
225
222
|
type: 'drop',
|
|
226
223
|
listener: function listener(event) {
|
|
227
|
-
var _event$dataTransfer$d, _event$dataTransfer;
|
|
228
224
|
// A "drop" can only happen if the browser allowed the drop
|
|
229
225
|
|
|
230
226
|
// Accepting drop operation.
|
|
@@ -238,11 +234,6 @@ function start(_ref2) {
|
|
|
238
234
|
});
|
|
239
235
|
dispatch.drop({
|
|
240
236
|
current: state.current,
|
|
241
|
-
drop: {
|
|
242
|
-
// At this point the dropEffect has been set on the event
|
|
243
|
-
// (if we have set it), so we can read it from there
|
|
244
|
-
dropEffect: (_event$dataTransfer$d = (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.dropEffect) !== null && _event$dataTransfer$d !== void 0 ? _event$dataTransfer$d : 'none'
|
|
245
|
-
},
|
|
246
237
|
// When dropping something native, we need to extract the latest
|
|
247
238
|
// `.items` from the "drop" event as it is now accessible
|
|
248
239
|
updatedSourcePayload: dragType.type === 'external' ? dragType.getDropPayload(event) : null
|
|
@@ -268,16 +259,7 @@ function start(_ref2) {
|
|
|
268
259
|
// as we will have already removed the event listener
|
|
269
260
|
type: 'dragend',
|
|
270
261
|
listener: function listener(event) {
|
|
271
|
-
|
|
272
|
-
// The `dropEffect` will be:
|
|
273
|
-
// - "none" if dropped on no drop targets
|
|
274
|
-
// - "none" if cancelled locally
|
|
275
|
-
// - "none" if cancelled externally
|
|
276
|
-
// - "none" if `preventUnhandled` is used (and there is no drop target)
|
|
277
|
-
// - [not "none"] if accepted externally
|
|
278
|
-
cancel({
|
|
279
|
-
dropEffect: (_event$dataTransfer$d2 = (_event$dataTransfer2 = event.dataTransfer) === null || _event$dataTransfer2 === void 0 ? void 0 : _event$dataTransfer2.dropEffect) !== null && _event$dataTransfer$d2 !== void 0 ? _event$dataTransfer$d2 : 'none'
|
|
280
|
-
});
|
|
262
|
+
cancel();
|
|
281
263
|
|
|
282
264
|
// Applying this fix after `dispatch.drop` so that frameworks have the opportunity
|
|
283
265
|
// to update UI in response to a "onDrop".
|
|
@@ -288,11 +270,7 @@ function start(_ref2) {
|
|
|
288
270
|
}
|
|
289
271
|
}
|
|
290
272
|
}].concat((0, _toConsumableArray2.default)((0, _detectBrokenDrag.getBindingsForBrokenDrags)({
|
|
291
|
-
onDragEnd:
|
|
292
|
-
return cancel({
|
|
293
|
-
dropEffect: 'none'
|
|
294
|
-
});
|
|
295
|
-
}
|
|
273
|
+
onDragEnd: cancel
|
|
296
274
|
}))),
|
|
297
275
|
// Once we have started a managed drag operation it is important that we see / own all drag events
|
|
298
276
|
// We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
|
|
@@ -107,7 +107,6 @@ export function makeDispatch({
|
|
|
107
107
|
},
|
|
108
108
|
drop({
|
|
109
109
|
current,
|
|
110
|
-
drop,
|
|
111
110
|
updatedSourcePayload
|
|
112
111
|
}) {
|
|
113
112
|
dragStart.flush();
|
|
@@ -115,7 +114,6 @@ export function makeDispatch({
|
|
|
115
114
|
safeDispatch({
|
|
116
115
|
eventName: 'onDrop',
|
|
117
116
|
payload: {
|
|
118
|
-
drop,
|
|
119
117
|
source: updatedSourcePayload !== null && updatedSourcePayload !== void 0 ? updatedSourcePayload : source,
|
|
120
118
|
location: {
|
|
121
119
|
current,
|
|
@@ -101,7 +101,7 @@ function start({
|
|
|
101
101
|
input
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
function cancel(
|
|
104
|
+
function cancel() {
|
|
105
105
|
// The spec behaviour is that when a drag is cancelled, or when dropping on no drop targets,
|
|
106
106
|
// a "dragleave" event is fired on the active drop target before a "dragend" event.
|
|
107
107
|
// We are replicating that behaviour in `cancel` if there are any active drop targets to
|
|
@@ -118,7 +118,6 @@ function start({
|
|
|
118
118
|
}
|
|
119
119
|
dispatch.drop({
|
|
120
120
|
current: state.current,
|
|
121
|
-
drop,
|
|
122
121
|
updatedSourcePayload: null
|
|
123
122
|
});
|
|
124
123
|
finish();
|
|
@@ -210,15 +209,12 @@ function start({
|
|
|
210
209
|
dropTargets: []
|
|
211
210
|
});
|
|
212
211
|
if (dragType.startedFrom === 'external') {
|
|
213
|
-
cancel(
|
|
214
|
-
dropEffect: 'none'
|
|
215
|
-
});
|
|
212
|
+
cancel();
|
|
216
213
|
}
|
|
217
214
|
}
|
|
218
215
|
}, {
|
|
219
216
|
type: 'drop',
|
|
220
217
|
listener(event) {
|
|
221
|
-
var _event$dataTransfer$d, _event$dataTransfer;
|
|
222
218
|
// A "drop" can only happen if the browser allowed the drop
|
|
223
219
|
|
|
224
220
|
// Accepting drop operation.
|
|
@@ -232,11 +228,6 @@ function start({
|
|
|
232
228
|
});
|
|
233
229
|
dispatch.drop({
|
|
234
230
|
current: state.current,
|
|
235
|
-
drop: {
|
|
236
|
-
// At this point the dropEffect has been set on the event
|
|
237
|
-
// (if we have set it), so we can read it from there
|
|
238
|
-
dropEffect: (_event$dataTransfer$d = (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.dropEffect) !== null && _event$dataTransfer$d !== void 0 ? _event$dataTransfer$d : 'none'
|
|
239
|
-
},
|
|
240
231
|
// When dropping something native, we need to extract the latest
|
|
241
232
|
// `.items` from the "drop" event as it is now accessible
|
|
242
233
|
updatedSourcePayload: dragType.type === 'external' ? dragType.getDropPayload(event) : null
|
|
@@ -262,16 +253,7 @@ function start({
|
|
|
262
253
|
// as we will have already removed the event listener
|
|
263
254
|
type: 'dragend',
|
|
264
255
|
listener(event) {
|
|
265
|
-
|
|
266
|
-
// The `dropEffect` will be:
|
|
267
|
-
// - "none" if dropped on no drop targets
|
|
268
|
-
// - "none" if cancelled locally
|
|
269
|
-
// - "none" if cancelled externally
|
|
270
|
-
// - "none" if `preventUnhandled` is used (and there is no drop target)
|
|
271
|
-
// - [not "none"] if accepted externally
|
|
272
|
-
cancel({
|
|
273
|
-
dropEffect: (_event$dataTransfer$d2 = (_event$dataTransfer2 = event.dataTransfer) === null || _event$dataTransfer2 === void 0 ? void 0 : _event$dataTransfer2.dropEffect) !== null && _event$dataTransfer$d2 !== void 0 ? _event$dataTransfer$d2 : 'none'
|
|
274
|
-
});
|
|
256
|
+
cancel();
|
|
275
257
|
|
|
276
258
|
// Applying this fix after `dispatch.drop` so that frameworks have the opportunity
|
|
277
259
|
// to update UI in response to a "onDrop".
|
|
@@ -282,9 +264,7 @@ function start({
|
|
|
282
264
|
}
|
|
283
265
|
}
|
|
284
266
|
}, ...getBindingsForBrokenDrags({
|
|
285
|
-
onDragEnd:
|
|
286
|
-
dropEffect: 'none'
|
|
287
|
-
})
|
|
267
|
+
onDragEnd: cancel
|
|
288
268
|
})],
|
|
289
269
|
// Once we have started a managed drag operation it is important that we see / own all drag events
|
|
290
270
|
// We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
|
|
@@ -105,14 +105,12 @@ export function makeDispatch(_ref) {
|
|
|
105
105
|
},
|
|
106
106
|
drop: function drop(_ref5) {
|
|
107
107
|
var current = _ref5.current,
|
|
108
|
-
drop = _ref5.drop,
|
|
109
108
|
updatedSourcePayload = _ref5.updatedSourcePayload;
|
|
110
109
|
dragStart.flush();
|
|
111
110
|
scheduleOnDrag.cancel();
|
|
112
111
|
safeDispatch({
|
|
113
112
|
eventName: 'onDrop',
|
|
114
113
|
payload: {
|
|
115
|
-
drop: drop,
|
|
116
114
|
source: updatedSourcePayload !== null && updatedSourcePayload !== void 0 ? updatedSourcePayload : source,
|
|
117
115
|
location: {
|
|
118
116
|
current: current,
|
|
@@ -100,7 +100,7 @@ function start(_ref2) {
|
|
|
100
100
|
input: input
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
function cancel(
|
|
103
|
+
function cancel() {
|
|
104
104
|
// The spec behaviour is that when a drag is cancelled, or when dropping on no drop targets,
|
|
105
105
|
// a "dragleave" event is fired on the active drop target before a "dragend" event.
|
|
106
106
|
// We are replicating that behaviour in `cancel` if there are any active drop targets to
|
|
@@ -117,7 +117,6 @@ function start(_ref2) {
|
|
|
117
117
|
}
|
|
118
118
|
dispatch.drop({
|
|
119
119
|
current: state.current,
|
|
120
|
-
drop: drop,
|
|
121
120
|
updatedSourcePayload: null
|
|
122
121
|
});
|
|
123
122
|
finish();
|
|
@@ -209,15 +208,12 @@ function start(_ref2) {
|
|
|
209
208
|
dropTargets: []
|
|
210
209
|
});
|
|
211
210
|
if (dragType.startedFrom === 'external') {
|
|
212
|
-
cancel(
|
|
213
|
-
dropEffect: 'none'
|
|
214
|
-
});
|
|
211
|
+
cancel();
|
|
215
212
|
}
|
|
216
213
|
}
|
|
217
214
|
}, {
|
|
218
215
|
type: 'drop',
|
|
219
216
|
listener: function listener(event) {
|
|
220
|
-
var _event$dataTransfer$d, _event$dataTransfer;
|
|
221
217
|
// A "drop" can only happen if the browser allowed the drop
|
|
222
218
|
|
|
223
219
|
// Accepting drop operation.
|
|
@@ -231,11 +227,6 @@ function start(_ref2) {
|
|
|
231
227
|
});
|
|
232
228
|
dispatch.drop({
|
|
233
229
|
current: state.current,
|
|
234
|
-
drop: {
|
|
235
|
-
// At this point the dropEffect has been set on the event
|
|
236
|
-
// (if we have set it), so we can read it from there
|
|
237
|
-
dropEffect: (_event$dataTransfer$d = (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.dropEffect) !== null && _event$dataTransfer$d !== void 0 ? _event$dataTransfer$d : 'none'
|
|
238
|
-
},
|
|
239
230
|
// When dropping something native, we need to extract the latest
|
|
240
231
|
// `.items` from the "drop" event as it is now accessible
|
|
241
232
|
updatedSourcePayload: dragType.type === 'external' ? dragType.getDropPayload(event) : null
|
|
@@ -261,16 +252,7 @@ function start(_ref2) {
|
|
|
261
252
|
// as we will have already removed the event listener
|
|
262
253
|
type: 'dragend',
|
|
263
254
|
listener: function listener(event) {
|
|
264
|
-
|
|
265
|
-
// The `dropEffect` will be:
|
|
266
|
-
// - "none" if dropped on no drop targets
|
|
267
|
-
// - "none" if cancelled locally
|
|
268
|
-
// - "none" if cancelled externally
|
|
269
|
-
// - "none" if `preventUnhandled` is used (and there is no drop target)
|
|
270
|
-
// - [not "none"] if accepted externally
|
|
271
|
-
cancel({
|
|
272
|
-
dropEffect: (_event$dataTransfer$d2 = (_event$dataTransfer2 = event.dataTransfer) === null || _event$dataTransfer2 === void 0 ? void 0 : _event$dataTransfer2.dropEffect) !== null && _event$dataTransfer$d2 !== void 0 ? _event$dataTransfer$d2 : 'none'
|
|
273
|
-
});
|
|
255
|
+
cancel();
|
|
274
256
|
|
|
275
257
|
// Applying this fix after `dispatch.drop` so that frameworks have the opportunity
|
|
276
258
|
// to update UI in response to a "onDrop".
|
|
@@ -281,11 +263,7 @@ function start(_ref2) {
|
|
|
281
263
|
}
|
|
282
264
|
}
|
|
283
265
|
}].concat(_toConsumableArray(getBindingsForBrokenDrags({
|
|
284
|
-
onDragEnd:
|
|
285
|
-
return cancel({
|
|
286
|
-
dropEffect: 'none'
|
|
287
|
-
});
|
|
288
|
-
}
|
|
266
|
+
onDragEnd: cancel
|
|
289
267
|
}))),
|
|
290
268
|
// Once we have started a managed drag operation it is important that we see / own all drag events
|
|
291
269
|
// We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { DropTargetAllowedDropEffect, DropTargetRecord, Position, Input, DragLocation, DragLocationHistory,
|
|
1
|
+
export type { DropTargetAllowedDropEffect, DropTargetRecord, Position, Input, DragLocation, DragLocationHistory, CleanupFn, AllDragTypes, MonitorArgs, BaseEventPayload, ElementDragType, TextSelectionDragType, ExternalDragType, } from '../internal-types';
|
|
@@ -193,9 +193,6 @@ export type BaseEventPayload<DragType extends AllDragTypes> = {
|
|
|
193
193
|
*/
|
|
194
194
|
source: DragType['payload'];
|
|
195
195
|
};
|
|
196
|
-
export type DropData = {
|
|
197
|
-
dropEffect: DataTransfer['dropEffect'];
|
|
198
|
-
};
|
|
199
196
|
export type EventPayloadMap<DragType extends AllDragTypes> = {
|
|
200
197
|
/**
|
|
201
198
|
* Drag is about to start.
|
|
@@ -231,9 +228,7 @@ export type EventPayloadMap<DragType extends AllDragTypes> = {
|
|
|
231
228
|
*
|
|
232
229
|
* The `location.current` property will accurately contain the final drop targets.
|
|
233
230
|
*/
|
|
234
|
-
onDrop: BaseEventPayload<DragType
|
|
235
|
-
drop: DropData;
|
|
236
|
-
};
|
|
231
|
+
onDrop: BaseEventPayload<DragType>;
|
|
237
232
|
};
|
|
238
233
|
export type AllEvents<DragType extends AllDragTypes> = {
|
|
239
234
|
[EventName in keyof EventPayloadMap<DragType>]: (args: EventPayloadMap<DragType>[EventName]) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllDragTypes, DragLocation,
|
|
1
|
+
import { AllDragTypes, DragLocation, EventPayloadMap } from '../internal-types';
|
|
2
2
|
export declare function makeDispatch<DragType extends AllDragTypes>({ source, initial, dispatchEvent, }: {
|
|
3
3
|
source: DragType['payload'];
|
|
4
4
|
initial: DragLocation;
|
|
@@ -16,9 +16,8 @@ export declare function makeDispatch<DragType extends AllDragTypes>({ source, in
|
|
|
16
16
|
drag({ current }: {
|
|
17
17
|
current: DragLocation;
|
|
18
18
|
}): void;
|
|
19
|
-
drop({ current,
|
|
19
|
+
drop({ current, updatedSourcePayload, }: {
|
|
20
20
|
current: DragLocation;
|
|
21
|
-
drop: DropData;
|
|
22
21
|
/** When dragging from an external source, we need to collect the
|
|
23
22
|
drag source information again as it is often only available during
|
|
24
23
|
the "drop" event */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { DropTargetAllowedDropEffect, DropTargetRecord, Position, Input, DragLocation, DragLocationHistory,
|
|
1
|
+
export type { DropTargetAllowedDropEffect, DropTargetRecord, Position, Input, DragLocation, DragLocationHistory, CleanupFn, AllDragTypes, MonitorArgs, BaseEventPayload, ElementDragType, TextSelectionDragType, ExternalDragType, } from '../internal-types';
|
|
@@ -193,9 +193,6 @@ export type BaseEventPayload<DragType extends AllDragTypes> = {
|
|
|
193
193
|
*/
|
|
194
194
|
source: DragType['payload'];
|
|
195
195
|
};
|
|
196
|
-
export type DropData = {
|
|
197
|
-
dropEffect: DataTransfer['dropEffect'];
|
|
198
|
-
};
|
|
199
196
|
export type EventPayloadMap<DragType extends AllDragTypes> = {
|
|
200
197
|
/**
|
|
201
198
|
* Drag is about to start.
|
|
@@ -231,9 +228,7 @@ export type EventPayloadMap<DragType extends AllDragTypes> = {
|
|
|
231
228
|
*
|
|
232
229
|
* The `location.current` property will accurately contain the final drop targets.
|
|
233
230
|
*/
|
|
234
|
-
onDrop: BaseEventPayload<DragType
|
|
235
|
-
drop: DropData;
|
|
236
|
-
};
|
|
231
|
+
onDrop: BaseEventPayload<DragType>;
|
|
237
232
|
};
|
|
238
233
|
export type AllEvents<DragType extends AllDragTypes> = {
|
|
239
234
|
[EventName in keyof EventPayloadMap<DragType>]: (args: EventPayloadMap<DragType>[EventName]) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllDragTypes, DragLocation,
|
|
1
|
+
import { AllDragTypes, DragLocation, EventPayloadMap } from '../internal-types';
|
|
2
2
|
export declare function makeDispatch<DragType extends AllDragTypes>({ source, initial, dispatchEvent, }: {
|
|
3
3
|
source: DragType['payload'];
|
|
4
4
|
initial: DragLocation;
|
|
@@ -16,9 +16,8 @@ export declare function makeDispatch<DragType extends AllDragTypes>({ source, in
|
|
|
16
16
|
drag({ current }: {
|
|
17
17
|
current: DragLocation;
|
|
18
18
|
}): void;
|
|
19
|
-
drop({ current,
|
|
19
|
+
drop({ current, updatedSourcePayload, }: {
|
|
20
20
|
current: DragLocation;
|
|
21
|
-
drop: DropData;
|
|
22
21
|
/** When dragging from an external source, we need to collect the
|
|
23
22
|
drag source information again as it is often only available during
|
|
24
23
|
the "drop" event */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/pragmatic-drag-and-drop",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "The core package for Pragmatic drag and drop - enabling fast drag and drop for any experience on any tech stack",
|
|
5
5
|
"repository": "https://github.com/atlassian/pragmatic-drag-and-drop",
|
|
6
6
|
"author": "Atlassian Pty Ltd",
|
|
7
7
|
"license": "Apache-2.0",
|