Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-dnd-action

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-dnd-action - npm Package Compare versions

Comparing version 0.9.17 to 0.9.18

2

package.json

@@ -43,3 +43,3 @@ {

"description": "*An awesome drag and drop library for Svelte 3 (not using the browser's built-in dnd, thanks god): Rich animations, nested containers, touch support and more *",
"version": "0.9.17",
"version": "0.9.18",
"repository": {

@@ -46,0 +46,0 @@ "type": "git",

@@ -139,3 +139,3 @@ import {SHADOW_ELEMENT_ATTRIBUTE_NAME, DRAGGED_ELEMENT_ID} from "../constants";

*/
export function hideOriginalDragTarget(dragTarget) {
export function hideElement(dragTarget) {
dragTarget.style.display = "none";

@@ -142,0 +142,0 @@ dragTarget.style.position = "fixed";

@@ -16,3 +16,3 @@ import {

decorateShadowEl,
hideOriginalDragTarget,
hideElement,
morphDraggedElementToBeLike,

@@ -59,2 +59,3 @@ moveDraggedElementToWasDroppedState,

let isDraggedOutsideOfAnyDz = false;
let scheduledForRemovalAfterDrop = [];

@@ -285,2 +286,9 @@ // a map from type to a set of drop-zones

function scheduleDZForRemovalAfterDrop(dz, destroy) {
scheduledForRemovalAfterDrop.push({dz, destroy});
window.requestAnimationFrame(() => {
hideElement(dz);
document.body.appendChild(dz);
});
}
/* cleanup */

@@ -290,2 +298,10 @@ function cleanupPostDrop() {

originalDragTarget.remove();
if (scheduledForRemovalAfterDrop.length) {
printDebug(() => ["will destroy zones that were removed during drag", scheduledForRemovalAfterDrop]);
scheduledForRemovalAfterDrop.forEach(({dz, destroy}) => {
destroy();
dz.remove();
})
scheduledForRemovalAfterDrop = [];
}
draggedEl = undefined;

@@ -405,3 +421,3 @@ originalDragTarget = undefined;

watchDraggedElement();
hideOriginalDragTarget(originalDragTarget);
hideElement(originalDragTarget);
originDropZoneRoot.appendChild(originalDragTarget);

@@ -537,7 +553,15 @@ } else {

destroy: () => {
printDebug(() => "pointer dndzone will destroy");
unregisterDropZone(node, config.type);
dzToConfig.delete(node);
function destroyDz() {
printDebug(() => "pointer dndzone will destroy");
unregisterDropZone(node, dzToConfig.get(node).type);
dzToConfig.delete(node);
}
if (isWorkingOnPreviousDrag) {
printDebug(() => "pointer dndzone will be scheduled for destruction");
scheduleDZForRemovalAfterDrop(node, destroyDz);
} else {
destroyDz();
}
}
};
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc