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.13 to 0.9.14

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.13",
"version": "0.9.14",
"repository": {

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

@@ -16,2 +16,11 @@ import {isCenterOfAInsideB, calcDistanceBetweenCenters, getAbsoluteRectNoTransforms, isPointInsideRect, findCenterOfElement} from "./intersection";

/**
* Resets the cache that allows for smarter "would be index" resolution for a specific dropzone, should be called after the zone was scrolled
* @param {HTMLElement} dz
*/
export function resetIndexesCacheForDz(dz) {
printDebug(() => "resetting indexes cache for dz");
dzToShadowIndexToRect.delete(dz);
}
/**
* Caches the coordinates of the shadow element when it's in a certain index in a certain dropzone.

@@ -18,0 +27,0 @@ * Helpful in order to determine "would be index" more effectively

@@ -1,2 +0,2 @@

import {findWouldBeIndex, resetIndexesCache} from "./listUtil";
import {findWouldBeIndex, resetIndexesCache, resetIndexesCacheForDz} from "./listUtil";
import {findCenterOfElement, isElementOffDocument} from "./intersection";

@@ -60,2 +60,3 @@ import {

for (const dz of dropZonesFromDeepToShallow) {
if (scrolled) resetIndexesCacheForDz(lastDropZoneFound);
const indexObj = findWouldBeIndex(draggedEl, dz);

@@ -62,0 +63,0 @@ if (indexObj === null) {

import {makeScroller} from "./scroller";
import {printDebug} from "../constants";
import {resetIndexesCache} from "./listUtil";

@@ -21,3 +22,4 @@ const INTERVAL_MS = 300;

if (mousePosition) {
scrollIfNeeded(mousePosition, document.documentElement);
const scrolled = scrollIfNeeded(mousePosition, document.documentElement);
if (scrolled) resetIndexesCache();
}

@@ -24,0 +26,0 @@ next = window.setTimeout(loop, INTERVAL_MS);

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