@atlaskit/drag-and-drop
Advanced tools
Comparing version 0.9.0 to 0.10.0
# @atlaskit/drag-and-drop | ||
## 0.10.0 | ||
### Minor Changes | ||
- [`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 | ||
```ts | ||
const cleanupMonitor1 = monitorForElements({ | ||
onDragStart: () => { | ||
cleanupMonitor2(); | ||
}, | ||
}); | ||
const cleanupMonitor2 = monitorForElements({ | ||
// Previously this `onDragStart` would have been called during `onDragStart` even though it was unbound by the first monitor | ||
onDragStart: () => {}, | ||
}); | ||
``` | ||
## 0.9.0 | ||
@@ -4,0 +22,0 @@ |
@@ -82,6 +82,10 @@ "use strict"; | ||
for (var _i = 0, _active = active; _i < _active.length; _i++) { | ||
var _monitor$eventName; | ||
var _monitor = _active[_i]; | ||
// @ts-expect-error: I cannot get this type working! | ||
(_monitor$eventName = _monitor[eventName]) === null || _monitor$eventName === void 0 ? void 0 : _monitor$eventName.call(_monitor, payload); | ||
// A monitor can be removed by another monitor during an event. | ||
// We need to check that the monitor is still registered before calling it | ||
if (dragging.active.has(_monitor)) { | ||
var _monitor$eventName; | ||
// @ts-expect-error: I cannot get this type working! | ||
(_monitor$eventName = _monitor[eventName]) === null || _monitor$eventName === void 0 ? void 0 : _monitor$eventName.call(_monitor, payload); | ||
} | ||
} | ||
@@ -88,0 +92,0 @@ if (eventName === 'onDrop') { |
{ | ||
"name": "@atlaskit/drag-and-drop", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"sideEffects": false | ||
} |
@@ -63,5 +63,9 @@ export function makeMonitor() { | ||
for (const monitor of active) { | ||
var _monitor$eventName; | ||
// @ts-expect-error: I cannot get this type working! | ||
(_monitor$eventName = monitor[eventName]) === null || _monitor$eventName === void 0 ? void 0 : _monitor$eventName.call(monitor, payload); | ||
// A monitor can be removed by another monitor during an event. | ||
// We need to check that the monitor is still registered before calling it | ||
if (dragging.active.has(monitor)) { | ||
var _monitor$eventName; | ||
// @ts-expect-error: I cannot get this type working! | ||
(_monitor$eventName = monitor[eventName]) === null || _monitor$eventName === void 0 ? void 0 : _monitor$eventName.call(monitor, payload); | ||
} | ||
} | ||
@@ -68,0 +72,0 @@ if (eventName === 'onDrop') { |
{ | ||
"name": "@atlaskit/drag-and-drop", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"sideEffects": false | ||
} |
@@ -75,6 +75,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
for (var _i = 0, _active = active; _i < _active.length; _i++) { | ||
var _monitor$eventName; | ||
var _monitor = _active[_i]; | ||
// @ts-expect-error: I cannot get this type working! | ||
(_monitor$eventName = _monitor[eventName]) === null || _monitor$eventName === void 0 ? void 0 : _monitor$eventName.call(_monitor, payload); | ||
// A monitor can be removed by another monitor during an event. | ||
// We need to check that the monitor is still registered before calling it | ||
if (dragging.active.has(_monitor)) { | ||
var _monitor$eventName; | ||
// @ts-expect-error: I cannot get this type working! | ||
(_monitor$eventName = _monitor[eventName]) === null || _monitor$eventName === void 0 ? void 0 : _monitor$eventName.call(_monitor, payload); | ||
} | ||
} | ||
@@ -81,0 +85,0 @@ if (eventName === 'onDrop') { |
{ | ||
"name": "@atlaskit/drag-and-drop", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"sideEffects": false | ||
} |
{ | ||
"name": "@atlaskit/drag-and-drop", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "The core Atlassian drag and drop framework, optimized for performance.", | ||
@@ -74,3 +74,5 @@ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror", | ||
"analytics": "analytics-next", | ||
"theming": "tokens", | ||
"design-tokens": [ | ||
"color" | ||
], | ||
"deprecation": "no-deprecated-imports", | ||
@@ -77,0 +79,0 @@ "styling": [ |
205311
5045