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.2.7 to 0.2.8

21

dist/index.js

@@ -555,2 +555,3 @@ (function (global, factory) {

const ITEM_ID_KEY = "id";
const DEFAULT_DROP_ZONE_TYPE = '--any--';

@@ -611,3 +612,3 @@ const MIN_OBSERVATION_INTERVAL_MS = 100;

const observationIntervalMs = Math.max(MIN_OBSERVATION_INTERVAL_MS, ...Array.from(dropZones.keys()).map(dz => dzToConfig.get(dz).dropAnimationDurationMs));
observe(draggedEl, dropZones, observationIntervalMs);
observe(draggedEl, dropZones, observationIntervalMs * 1.07);
}

@@ -835,8 +836,14 @@ function unWatchDraggedElement() {

// We will keep the original dom node in the dom because touch events keep firing on it, we want to re-add it after Svelte removes it
window.setTimeout(() => {
document.body.appendChild(draggedEl);
watchDraggedElement();
hideOriginalDragTarget(originalDragTarget);
document.body.appendChild(originalDragTarget);
}, 20);
function keepOriginalElementInDom() {
const {items: itemsNow} = config;
if (!draggedEl.parentElement && (!itemsNow[originIndex] || draggedElData[ITEM_ID_KEY] !== itemsNow[originIndex][ITEM_ID_KEY])) {
document.body.appendChild(draggedEl);
watchDraggedElement();
hideOriginalDragTarget(originalDragTarget);
document.body.appendChild(originalDragTarget);
} else {
window.requestAnimationFrame(keepOriginalElementInDom);
}
}
window.requestAnimationFrame(keepOriginalElementInDom);

@@ -843,0 +850,0 @@ styleActiveDropZones(

@@ -33,3 +33,3 @@ {

"description": "*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.2.7",
"version": "0.2.8",
"dependencies": {

@@ -36,0 +36,0 @@ "acorn": "^7.1.1",

@@ -14,2 +14,3 @@ import { observe, unobserve } from './helpers/observer';

import { DRAGGED_ENTERED_EVENT_NAME, DRAGGED_LEFT_EVENT_NAME, DRAGGED_LEFT_DOCUMENT_EVENT_NAME, DRAGGED_OVER_INDEX_EVENT_NAME, dispatchConsiderEvent, dispatchFinalizeEvent } from './helpers/dispatcher';
const ITEM_ID_KEY = "id";
const DEFAULT_DROP_ZONE_TYPE = '--any--';

@@ -70,3 +71,3 @@ const MIN_OBSERVATION_INTERVAL_MS = 100;

const observationIntervalMs = Math.max(MIN_OBSERVATION_INTERVAL_MS, ...Array.from(dropZones.keys()).map(dz => dzToConfig.get(dz).dropAnimationDurationMs));
observe(draggedEl, dropZones, observationIntervalMs);
observe(draggedEl, dropZones, observationIntervalMs * 1.07);
}

@@ -294,8 +295,14 @@ function unWatchDraggedElement() {

// We will keep the original dom node in the dom because touch events keep firing on it, we want to re-add it after Svelte removes it
window.setTimeout(() => {
document.body.appendChild(draggedEl);
watchDraggedElement();
hideOriginalDragTarget(originalDragTarget);
document.body.appendChild(originalDragTarget);
}, 20);
function keepOriginalElementInDom() {
const {items: itemsNow} = config;
if (!draggedEl.parentElement && (!itemsNow[originIndex] || draggedElData[ITEM_ID_KEY] !== itemsNow[originIndex][ITEM_ID_KEY])) {
document.body.appendChild(draggedEl);
watchDraggedElement();
hideOriginalDragTarget(originalDragTarget);
document.body.appendChild(originalDragTarget);
} else {
window.requestAnimationFrame(keepOriginalElementInDom);
}
}
window.requestAnimationFrame(keepOriginalElementInDom);

@@ -302,0 +309,0 @@ styleActiveDropZones(

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