Socket
Socket
Sign inDemoInstall

@interactjs/snappers

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interactjs/snappers - npm Package Compare versions

Comparing version 1.10.23 to 1.10.24

21

grid.d.ts
import type { Rect, Point } from '@interactjs/core/types';
import type { SnapFunction } from '@interactjs/modifiers/snap/pointer';
export declare type GridOptions = (Partial<Rect> | Point) & {
export interface GridOptionsBase {
range?: number;
limits?: Rect;
offset?: Point;
};
}
export interface GridOptionsXY extends GridOptionsBase {
x: number;
y: number;
}
export interface GridOptionsTopLeft extends GridOptionsBase {
top?: number;
left?: number;
}
export interface GridOptionsBottomRight extends GridOptionsBase {
bottom?: number;
right?: number;
}
export interface GridOptionsWidthHeight extends GridOptionsBase {
width?: number;
height?: number;
}
export type GridOptions = GridOptionsXY | GridOptionsTopLeft | GridOptionsBottomRight | GridOptionsWidthHeight;
declare const _default: (grid: GridOptions) => SnapFunction & {

@@ -9,0 +26,0 @@ grid: GridOptions;

4

grid.js
export default (grid => {
const coordFields = [['x', 'y'], ['left', 'top'], ['right', 'bottom'], ['width', 'height']].filter(([xField, yField]) => xField in grid || yField in grid);
const gridFunc = (x, y) => {

@@ -24,3 +23,2 @@ const {

};
for (const [xField, yField] of coordFields) {

@@ -32,6 +30,4 @@ const gridx = Math.round((x - offset.x) / grid[xField]);

}
return result;
};
gridFunc.grid = grid;

@@ -38,0 +34,0 @@ gridFunc.coordFields = coordFields;

{
"name": "@interactjs/snappers",
"version": "1.10.23",
"version": "1.10.24",
"main": "index",

@@ -13,6 +13,6 @@ "module": "index",

"peerDependencies": {
"@interactjs/utils": "1.10.23"
"@interactjs/utils": "1.10.24"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.23"
"@interactjs/interact": "1.10.24"
},

@@ -27,3 +27,3 @@ "publishConfig": {

"license": "MIT",
"gitHead": "9ba48631"
"gitHead": "86c64a3f"
}

@@ -5,3 +5,2 @@ import extend from "../utils/extend.js";

id: 'snappers',
install(scope) {

@@ -14,5 +13,4 @@ const {

}
};
export default snappersPlugin;
//# sourceMappingURL=plugin.js.map

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

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

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

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