@atlaskit/pragmatic-drag-and-drop 1.0.1 → 1.1.0

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 (55) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/combine/package.json +1 -1
  3. package/dist/cjs/adapter/external-adapter.js +1 -0
  4. package/dist/cjs/adapter/text-selection-adapter.js +1 -0
  5. package/dist/cjs/entry-point/types.js +1 -5
  6. package/dist/cjs/internal-types.js +1 -5
  7. package/dist/cjs/ledger/dispatch-consumer-event.js +2 -0
  8. package/dist/cjs/ledger/lifecycle-manager.js +106 -68
  9. package/dist/cjs/public-utils/prevent-unhandled.js +56 -23
  10. package/dist/es2019/adapter/external-adapter.js +1 -0
  11. package/dist/es2019/adapter/text-selection-adapter.js +1 -0
  12. package/dist/es2019/entry-point/types.js +0 -1
  13. package/dist/es2019/internal-types.js +0 -1
  14. package/dist/es2019/ledger/dispatch-consumer-event.js +2 -0
  15. package/dist/es2019/ledger/lifecycle-manager.js +104 -68
  16. package/dist/es2019/public-utils/prevent-unhandled.js +54 -23
  17. package/dist/esm/adapter/external-adapter.js +1 -0
  18. package/dist/esm/adapter/text-selection-adapter.js +1 -0
  19. package/dist/esm/entry-point/types.js +0 -1
  20. package/dist/esm/internal-types.js +0 -1
  21. package/dist/esm/ledger/dispatch-consumer-event.js +2 -0
  22. package/dist/esm/ledger/lifecycle-manager.js +106 -68
  23. package/dist/esm/public-utils/prevent-unhandled.js +55 -23
  24. package/dist/types/entry-point/types.d.ts +1 -1
  25. package/dist/types/internal-types.d.ts +17 -5
  26. package/dist/types/ledger/dispatch-consumer-event.d.ts +3 -2
  27. package/dist/types/make-adapter/make-adapter.d.ts +2 -2
  28. package/dist/types/make-adapter/make-drop-target.d.ts +2 -2
  29. package/dist/types/public-utils/prevent-unhandled.d.ts +14 -2
  30. package/dist/types-ts4.5/entry-point/types.d.ts +1 -1
  31. package/dist/types-ts4.5/internal-types.d.ts +17 -5
  32. package/dist/types-ts4.5/ledger/dispatch-consumer-event.d.ts +3 -2
  33. package/dist/types-ts4.5/make-adapter/make-adapter.d.ts +2 -2
  34. package/dist/types-ts4.5/make-adapter/make-drop-target.d.ts +2 -2
  35. package/dist/types-ts4.5/public-utils/prevent-unhandled.d.ts +14 -2
  36. package/element/adapter/package.json +1 -1
  37. package/element/center-under-pointer/package.json +1 -1
  38. package/element/disable-native-drag-preview/package.json +1 -1
  39. package/element/format-urls-for-external/package.json +1 -1
  40. package/element/pointer-outside-of-preview/package.json +1 -1
  41. package/element/preserve-offset-on-source/package.json +1 -1
  42. package/element/scroll-just-enough-into-view/package.json +1 -1
  43. package/element/set-custom-native-drag-preview/package.json +1 -1
  44. package/external/adapter/package.json +1 -1
  45. package/external/file/package.json +1 -1
  46. package/external/html/package.json +1 -1
  47. package/external/some/package.json +1 -1
  48. package/external/text/package.json +1 -1
  49. package/external/url/package.json +1 -1
  50. package/once/package.json +1 -1
  51. package/package.json +3 -3
  52. package/prevent-unhandled/package.json +1 -1
  53. package/reorder/package.json +1 -1
  54. package/text-selection/adapter/package.json +1 -1
  55. package/types/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @atlaskit/pragmatic-drag-and-drop
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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) - Adding additional information to `onDrop()` events to expose what the final `dropEffect` was for a drag operation.
8
+
9
+ ```ts
10
+ type DropData = {
11
+ dropEffect: DataTransfer['dropEffect'];
12
+ };
13
+
14
+ monitorForElements({
15
+ onDrop(payload) {
16
+ const drop: DropData = payload.drop;
17
+ },
18
+ });
19
+ ```
20
+
21
+ 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
+
23
+ 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.
24
+
25
+ ## 1.0.2
26
+
27
+ ### Patch Changes
28
+
29
+ - [#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`
30
+
3
31
  ## 1.0.1
4
32
 
5
33
  ### Patch Changes
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/entry-point/combine.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <4.9": {
9
+ ">=4.5 <5.4": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/entry-point/combine.d.ts"
12
12
  ]
@@ -189,6 +189,7 @@ function monitorForExternal(args) {
189
189
  // independent of pdnd, we need to keep track of
190
190
  // all drag operations so that we can know if a drag operation
191
191
  // has started locally
192
+
192
193
  var idle = {
193
194
  type: 'idle'
194
195
  };
@@ -122,6 +122,7 @@ var adapter = (0, _makeAdapter.makeAdapter)({
122
122
 
123
123
  // The `onGenerateDragPreview` does not make sense to publish for text selection
124
124
  // as the browser is completely in control of the drag preview
125
+
125
126
  function dropTargetForTextSelection(args) {
126
127
  // note: not removing `onGenerateDragPreview`; just leaning on the type system
127
128
  return adapter.dropTarget(args);
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ "use strict";
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ "use strict";
@@ -112,12 +112,14 @@ function makeDispatch(_ref) {
112
112
  },
113
113
  drop: function drop(_ref5) {
114
114
  var current = _ref5.current,
115
+ drop = _ref5.drop,
115
116
  updatedSourcePayload = _ref5.updatedSourcePayload;
116
117
  dragStart.flush();
117
118
  scheduleOnDrag.cancel();
118
119
  safeDispatch({
119
120
  eventName: 'onDrop',
120
121
  payload: {
122
+ drop: drop,
121
123
  source: updatedSourcePayload !== null && updatedSourcePayload !== void 0 ? updatedSourcePayload : source,
122
124
  location: {
123
125
  current: current,
@@ -12,9 +12,11 @@ var _detectBrokenDrag = require("../util/detect-broken-drag");
12
12
  var _fixPostDragPointerBug = require("../util/fix-post-drag-pointer-bug");
13
13
  var _getInput = require("../util/get-input");
14
14
  var _dispatchConsumerEvent = require("./dispatch-consumer-event");
15
- var isActive = false;
15
+ var globalState = {
16
+ isActive: false
17
+ };
16
18
  function canStart() {
17
- return !isActive;
19
+ return !globalState.isActive;
18
20
  }
19
21
  function getNativeSetDragImage(event) {
20
22
  if (event.dataTransfer) {
@@ -47,15 +49,18 @@ function start(_ref2) {
47
49
  if (!canStart()) {
48
50
  return;
49
51
  }
50
- isActive = true;
51
52
  var initial = getStartLocation({
52
53
  event: event,
53
54
  dragType: dragType,
54
55
  getDropTargetsOver: getDropTargetsOver
55
56
  });
56
- var current = initial;
57
+ globalState.isActive = true;
58
+ var state = {
59
+ current: initial
60
+ };
61
+
57
62
  // Setting initial drop effect for the drag
58
- setDropEffect({
63
+ setDropEffectOnEvent({
59
64
  event: event,
60
65
  current: initial.dropTargets
61
66
  });
@@ -67,17 +72,17 @@ function start(_ref2) {
67
72
  function updateDropTargets(next) {
68
73
  // only looking at whether hierarchy has changed to determine whether something as 'changed'
69
74
  var hasChanged = hasHierarchyChanged({
70
- current: current.dropTargets,
75
+ current: state.current.dropTargets,
71
76
  next: next.dropTargets
72
77
  });
73
78
 
74
79
  // Always updating the state to include latest data, dropEffect and stickiness
75
80
  // Only updating consumers if the hierarchy has changed in some way
76
81
  // Consumers can get the latest data by using `onDrag`
77
- current = next;
82
+ state.current = next;
78
83
  if (hasChanged) {
79
84
  dispatch.dragUpdate({
80
- current: current
85
+ current: state.current
81
86
  });
82
87
  }
83
88
  }
@@ -87,12 +92,12 @@ function start(_ref2) {
87
92
  target: event.target,
88
93
  input: input,
89
94
  source: dragType.payload,
90
- current: current.dropTargets
95
+ current: state.current.dropTargets
91
96
  });
92
97
  if (nextDropTargets.length) {
93
98
  // 🩸 must call `event.preventDefault()` to allow a browser drop to occur
94
99
  event.preventDefault();
95
- setDropEffect({
100
+ setDropEffectOnEvent({
96
101
  event: event,
97
102
  current: nextDropTargets
98
103
  });
@@ -102,22 +107,7 @@ function start(_ref2) {
102
107
  input: input
103
108
  });
104
109
  }
105
- function onDrop(args) {
106
- // When dropping something native, we need to extract the latest
107
- // `.items` from the "drop" event as it is now accessible
108
- if (args.type === 'success' && dragType.type === 'external') {
109
- dispatch.drop({
110
- current: current,
111
- updatedSourcePayload: dragType.getDropPayload(args.event)
112
- });
113
- return;
114
- }
115
- dispatch.drop({
116
- current: current,
117
- updatedSourcePayload: null
118
- });
119
- }
120
- function cancel() {
110
+ function cancel(drop) {
121
111
  // The spec behaviour is that when a drag is cancelled, or when dropping on no drop targets,
122
112
  // a "dragleave" event is fired on the active drop target before a "dragend" event.
123
113
  // We are replicating that behaviour in `cancel` if there are any active drop targets to
@@ -126,19 +116,21 @@ function start(_ref2) {
126
116
  // Note: When cancelling, or dropping on no drop targets, a "dragleave" event
127
117
  // will have already cleared the dropTargets to `[]` (as that particular "dragleave" has a `relatedTarget` of `null`)
128
118
 
129
- if (current.dropTargets.length) {
119
+ if (state.current.dropTargets.length) {
130
120
  updateDropTargets({
131
121
  dropTargets: [],
132
- input: current.input
122
+ input: state.current.input
133
123
  });
134
124
  }
135
- onDrop({
136
- type: 'cancel'
125
+ dispatch.drop({
126
+ current: state.current,
127
+ drop: drop,
128
+ updatedSourcePayload: null
137
129
  });
138
130
  finish();
139
131
  }
140
132
  function finish() {
141
- isActive = false;
133
+ globalState.isActive = false;
142
134
  unbindEvents();
143
135
  }
144
136
  var unbindEvents = (0, _bindEventListener.bindAll)(window, [{
@@ -163,20 +155,13 @@ function start(_ref2) {
163
155
  // 2. let consumers know a move has occurred
164
156
  // This will include the latest 'input' values
165
157
  dispatch.drag({
166
- current: current
158
+ current: state.current
167
159
  });
168
160
  }
169
161
  }, {
170
162
  type: 'dragenter',
171
163
  listener: onUpdateEvent
172
164
  }, {
173
- // This was the only reliable cross browser way I found to detect
174
- // when the user is leaving the `window`.
175
- // Internal drags: when we leave the `window` we want to clear any active drop targets,
176
- // but the drag is not yet over. The user could drag back into the window.
177
- // We only need to do this because of stickiness
178
- // External drags: when we leave the `window` the drag operation is over,
179
- // we will start another drag operation
180
165
  type: 'dragleave',
181
166
  listener: function listener(event) {
182
167
  if (!(0, _isLeavingWindow.isLeavingWindow)({
@@ -185,45 +170,82 @@ function start(_ref2) {
185
170
  return;
186
171
  }
187
172
 
188
- // When a drag is ending without a drop target (or when the drag is cancelled),
189
- // All browsers fire:
190
- // 1. "drag"
191
- // 2. "dragleave"
192
- // These events have `event.relatedTarget == null` so this code path is also hit in those cases.
193
- // This is all good! We would be clearing the dropTargets in `cancel()` after the "dragend"
173
+ /**
174
+ * At this point we don't know if a drag is being cancelled,
175
+ * or if a drag is leaving the `window`.
176
+ *
177
+ * Both have:
178
+ * 1. "dragleave" (with `relatedTarget: null`)
179
+ * 2. "dragend" (a "dragend" can occur when outside the `window`)
180
+ *
181
+ * **Clearing drop targets**
182
+ *
183
+ * For either case we are clearing the the drop targets
184
+ *
185
+ * - cancelling: we clear drop targets in `"dragend"` anyway
186
+ * - leaving the `window`: we clear the drop targets (to clear stickiness)
187
+ *
188
+ * **Leaving the window and finishing the drag**
189
+ *
190
+ * _internal drags_
191
+ *
192
+ * - The drag continues when the user is outside the `window`
193
+ * and can resume if the user drags back over the `window`,
194
+ * or end when the user drops in an external `window`.
195
+ * - We will get a `"dragend"`, or we can listen for other
196
+ * events to determine the drag is finished when the user re-enters the `window`).
197
+ *
198
+ * _external drags_
199
+ *
200
+ * - We conclude the drag operation.
201
+ * - We have no idea if the user will drag back over the `window`,
202
+ * or if the drag ends elsewhere.
203
+ * - We will create a new drag if the user re-enters the `window`.
204
+ *
205
+ * **Not updating `input`**
206
+ *
207
+ * 🐛 Bug[Chrome] the final `"dragleave"` has default input values (eg `clientX == 0`)
208
+ * Workaround: intentionally not updating `input` in "dragleave"
209
+ * rather than the users current input values
210
+ * - [Conversation](https://twitter.com/alexandereardon/status/1642697633864241152)
211
+ * - [Bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937)
212
+ **/
194
213
 
195
- // 🐛 Bug workaround: intentionally not updating `input` in "dragleave"
196
- // In Chrome, this final "dragleave" has default input values (eg clientX == 0)
197
- // rather than the users current input values
198
- //
199
- // - [Conversation](https://twitter.com/alexandereardon/status/1642697633864241152)
200
- // - [Bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937)
201
214
  updateDropTargets({
202
- input: current.input,
215
+ input: state.current.input,
203
216
  dropTargets: []
204
217
  });
205
-
206
- // End the drag operation if a native drag is leaving the window
207
218
  if (dragType.startedFrom === 'external') {
208
- cancel();
219
+ cancel({
220
+ dropEffect: 'none'
221
+ });
209
222
  }
210
223
  }
211
224
  }, {
212
225
  type: 'drop',
213
226
  listener: function listener(event) {
227
+ var _event$dataTransfer$d, _event$dataTransfer;
214
228
  // A "drop" can only happen if the browser allowed the drop
215
229
 
216
- // Opting out of standard browser drop behaviour for the drag
230
+ // Accepting drop operation.
231
+ // Also: opting out of standard browser drop behaviour for the drag
217
232
  event.preventDefault();
218
233
 
219
234
  // applying the latest drop effect to the event
220
- setDropEffect({
235
+ setDropEffectOnEvent({
221
236
  event: event,
222
- current: current.dropTargets
237
+ current: state.current.dropTargets
223
238
  });
224
- onDrop({
225
- type: 'success',
226
- event: event
239
+ dispatch.drop({
240
+ 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
+ // When dropping something native, we need to extract the latest
247
+ // `.items` from the "drop" event as it is now accessible
248
+ updatedSourcePayload: dragType.type === 'external' ? dragType.getDropPayload(event) : null
227
249
  });
228
250
  finish();
229
251
 
@@ -231,30 +253,46 @@ function start(_ref2) {
231
253
  // to update UI in response to a "onDrop".
232
254
  if (dragType.startedFrom === 'internal') {
233
255
  (0, _fixPostDragPointerBug.fixPostDragPointerBug)({
234
- current: current
256
+ current: state.current
235
257
  });
236
258
  }
237
259
  }
238
260
  }, {
239
261
  // "dragend" fires when on the drag source (eg a draggable element)
240
262
  // when the drag is finished.
241
- // "dragend" will fire after "drop"(if there was a successful drop)
263
+ // "dragend" will fire after "drop" (if there was a successful drop)
242
264
  // "dragend" does not fire if the draggable source has been removed during the drag
243
265
  // or for external drag sources (eg files)
266
+
267
+ // This "dragend" listener will not fire if there was a successful drop
268
+ // as we will have already removed the event listener
244
269
  type: 'dragend',
245
- listener: function listener() {
246
- cancel();
270
+ listener: function listener(event) {
271
+ var _event$dataTransfer$d2, _event$dataTransfer2;
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
+ });
247
281
 
248
282
  // Applying this fix after `dispatch.drop` so that frameworks have the opportunity
249
283
  // to update UI in response to a "onDrop".
250
284
  if (dragType.startedFrom === 'internal') {
251
285
  (0, _fixPostDragPointerBug.fixPostDragPointerBug)({
252
- current: current
286
+ current: state.current
253
287
  });
254
288
  }
255
289
  }
256
290
  }].concat((0, _toConsumableArray2.default)((0, _detectBrokenDrag.getBindingsForBrokenDrags)({
257
- onDragEnd: cancel
291
+ onDragEnd: function onDragEnd() {
292
+ return cancel({
293
+ dropEffect: 'none'
294
+ });
295
+ }
258
296
  }))),
259
297
  // Once we have started a managed drag operation it is important that we see / own all drag events
260
298
  // We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
@@ -267,7 +305,7 @@ function start(_ref2) {
267
305
  nativeSetDragImage: getNativeSetDragImage(event)
268
306
  });
269
307
  }
270
- function setDropEffect(_ref3) {
308
+ function setDropEffectOnEvent(_ref3) {
271
309
  var _current$;
272
310
  var event = _ref3.event,
273
311
  current = _ref3.current;
@@ -1,20 +1,22 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.preventUnhandled = void 0;
8
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
7
9
  var _bindEventListener = require("bind-event-listener");
8
- function cancel(event) {
9
- // if `@atlaskit/pragmatic-drag-and-drop` has already prevented the event
10
- // we don't need to do anything
10
+ var _detectBrokenDrag = require("../util/detect-broken-drag");
11
+ function acceptDrop(event) {
12
+ // if the event is already prevented the event we don't need to do anything
11
13
  if (event.defaultPrevented) {
12
14
  return;
13
15
  }
14
16
  // Using "move" as the drop effect as that uses the standard
15
17
  // cursor. Doing this so the user doesn't think they are dropping
16
18
  // on the page
17
- // Note: using "none" will not allow a drop to occur, so we are using "move"
19
+ // Note: using "none" will not allow a "drop" to occur, so we are using "move"
18
20
  if (event.dataTransfer) {
19
21
  event.dataTransfer.dropEffect = 'move';
20
22
  }
@@ -26,24 +28,55 @@ var unbindEvents = null;
26
28
  /**
27
29
  * Block drag operations outside of `@atlaskit/pragmatic-drag-and-drop`
28
30
  */
31
+ function start() {
32
+ cleanup();
33
+ unbindEvents = (0, _bindEventListener.bindAll)(window, [{
34
+ type: 'dragover',
35
+ listener: acceptDrop
36
+ }, {
37
+ type: 'dragenter',
38
+ listener: acceptDrop
39
+ }, {
40
+ type: 'drop',
41
+ listener: function listener(event) {
42
+ // our lifecycle manager already prevents events, but just being super safe
43
+ event.preventDefault();
44
+
45
+ // not setting dropEffect, as `drop.dropEffect` has already been published to the user
46
+ // (lifecycle-manager binds events in the capture phase)
47
+
48
+ // we don't need to wait for "dragend", and "dragend" might not even happen,
49
+ // such as when the draggable has been removed during a drag.
50
+ cleanup();
51
+ }
52
+ }, {
53
+ type: 'dragend',
54
+ listener: cleanup
55
+ }].concat((0, _toConsumableArray2.default)((0, _detectBrokenDrag.getBindingsForBrokenDrags)({
56
+ onDragEnd: cleanup
57
+ }))),
58
+ // being clear that these are added in the bubble phase
59
+ {
60
+ capture: false
61
+ });
62
+ }
63
+ function cleanup() {
64
+ var _unbindEvents;
65
+ (_unbindEvents = unbindEvents) === null || _unbindEvents === void 0 || _unbindEvents();
66
+ unbindEvents = null;
67
+ }
68
+
69
+ /**
70
+ * TODO: for next major, we could look at do the following:
71
+ *
72
+ * ```diff
73
+ * - preventUnhandled.start();
74
+ * - preventUnhandled.stop();
75
+ * + const stop = preventUnhandled();
76
+ * ```
77
+ */
78
+
29
79
  var preventUnhandled = exports.preventUnhandled = {
30
- start: function start() {
31
- var _unbindEvents;
32
- (_unbindEvents = unbindEvents) === null || _unbindEvents === void 0 || _unbindEvents();
33
- unbindEvents = (0, _bindEventListener.bindAll)(window, [{
34
- type: 'dragover',
35
- listener: cancel
36
- }, {
37
- type: 'dragenter',
38
- listener: cancel
39
- }, {
40
- type: 'drop',
41
- listener: cancel
42
- }]);
43
- },
44
- stop: function stop() {
45
- var _unbindEvents2;
46
- (_unbindEvents2 = unbindEvents) === null || _unbindEvents2 === void 0 || _unbindEvents2();
47
- unbindEvents = null;
48
- }
80
+ start: start,
81
+ stop: cleanup
49
82
  };
@@ -180,6 +180,7 @@ export function monitorForExternal(args) {
180
180
  // independent of pdnd, we need to keep track of
181
181
  // all drag operations so that we can know if a drag operation
182
182
  // has started locally
183
+
183
184
  const idle = {
184
185
  type: 'idle'
185
186
  };
@@ -121,6 +121,7 @@ const adapter = makeAdapter({
121
121
 
122
122
  // The `onGenerateDragPreview` does not make sense to publish for text selection
123
123
  // as the browser is completely in control of the drag preview
124
+
124
125
  export function dropTargetForTextSelection(args) {
125
126
  // note: not removing `onGenerateDragPreview`; just leaning on the type system
126
127
  return adapter.dropTarget(args);
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -107,6 +107,7 @@ export function makeDispatch({
107
107
  },
108
108
  drop({
109
109
  current,
110
+ drop,
110
111
  updatedSourcePayload
111
112
  }) {
112
113
  dragStart.flush();
@@ -114,6 +115,7 @@ export function makeDispatch({
114
115
  safeDispatch({
115
116
  eventName: 'onDrop',
116
117
  payload: {
118
+ drop,
117
119
  source: updatedSourcePayload !== null && updatedSourcePayload !== void 0 ? updatedSourcePayload : source,
118
120
  location: {
119
121
  current,