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

svelte-movable

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-movable - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

5

lib/movable.js

@@ -161,2 +161,3 @@ import { input } from './utils';

const onMouseDown = (event) => {
var _a, _b, _c, _d;
node.dispatchEvent(new CustomEvent('movablestart', { detail: node }));

@@ -166,4 +167,4 @@ const computedStyles = getComputedStyle(node);

const regex = '^[-0-9]+';
const left = parseInt(computedStyles.getPropertyValue('left').match(regex)?.[0] ?? '0');
const top = parseInt(computedStyles.getPropertyValue('top').match(regex)?.[0] ?? '0');
const left = parseInt((_b = (_a = computedStyles.getPropertyValue('left').match(regex)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '0');
const top = parseInt((_d = (_c = computedStyles.getPropertyValue('top').match(regex)) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : '0');
updateLastNodeCoordinates({ left, top });

@@ -170,0 +171,0 @@ // init position style

11

lib/utils/input/input.js

@@ -11,10 +11,11 @@ import { normalizeDelta } from '../normalizeDelta';

export function input(node, parameters) {
var _a, _b, _c, _d, _e;
return {
enabled: parameters.enabled ?? true,
parent: parameters.limit?.parent,
normalizedDelta: normalizeDelta(parameters.limit?.delta),
cache: parameters.cache ?? 'none',
trigger: parameters.trigger ?? node,
enabled: (_a = parameters.enabled) !== null && _a !== void 0 ? _a : true,
parent: (_b = parameters.limit) === null || _b === void 0 ? void 0 : _b.parent,
normalizedDelta: normalizeDelta((_c = parameters.limit) === null || _c === void 0 ? void 0 : _c.delta),
cache: (_d = parameters.cache) !== null && _d !== void 0 ? _d : 'none',
trigger: (_e = parameters.trigger) !== null && _e !== void 0 ? _e : node,
};
}
//# sourceMappingURL=input.js.map

@@ -13,3 +13,3 @@ /**

if (unit !== '%' && unit !== 'px') {
throw new Error(`Invalid delta ${axis ?? ''} unit. Only 'px' and '%' are supported.`);
throw new Error(`Invalid delta ${axis !== null && axis !== void 0 ? axis : ''} unit. Only 'px' and '%' are supported.`);
}

@@ -16,0 +16,0 @@ return unit;

{
"name": "svelte-movable",
"version": "1.0.1",
"version": "1.0.2",
"description": "Action to move node on mousedown",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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