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

@hscmap/inertial-mouse

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hscmap/inertial-mouse - npm Package Compare versions

Comparing version 3.3.0 to 3.3.1

5

lib/inertial_mouse.d.ts

@@ -15,5 +15,6 @@ import { V2 } from "./v2";

readonly cb: Partial<Callbacks>;
readonly eventFilter: EventFitler | undefined;
readonly eventFilter?: EventFitler | undefined;
readonly physics: Physics;
constructor(target: HTMLElement, cb: Partial<Callbacks>, eventFilter?: EventFitler | undefined);
private dead;
teardown(): void;

@@ -25,3 +26,3 @@ stop(): void;

protected tick(): void;
private coord(e);
private coord;
}

@@ -28,0 +29,0 @@ export declare class DownEvent {

11

lib/inertial_mouse.js

@@ -12,2 +12,3 @@ "use strict";

this.physics = new physics_1.Physics();
this.dead = false;
this.mousedown = function (e) {

@@ -23,2 +24,4 @@ if (_this.eventFilter && _this.eventFilter(e) || _this.eventFilter == undefined) {

this.mousemove = function (e) {
if (_this.dead)
return;
_this.physics.hook(_this.coord(e));

@@ -28,2 +31,4 @@ _this.cb.setNextTick(function () { return _this.tick(); });

this.mouseup = function (e) {
if (_this.dead)
return;
_this.physics.unhook();

@@ -39,4 +44,6 @@ document.removeEventListener('mousemove', _this.mousemove);

InertialMouse.prototype.teardown = function () {
this.stop();
this.dead = true;
this.target.removeEventListener('mousedown', this.mousedown);
document.removeEventListener('mousemove', this.mousemove);
document.removeEventListener('mouseup', this.mouseup);
};

@@ -48,2 +55,4 @@ InertialMouse.prototype.stop = function () {

var _this = this;
if (this.dead)
return;
var _a = this.physics.tick(performance.now()), r = _a.r, dr = _a.dr, movestart = _a.movestart, moveend = _a.moveend;

@@ -50,0 +59,0 @@ movestart && this.cb.movestart && this.cb.movestart(new MoveStartEvent());

@@ -23,3 +23,3 @@ import { V2 } from "./v2";

};
private willMove();
private willMove;
}
{
"name": "@hscmap/inertial-mouse",
"version": "3.3.0",
"version": "3.3.1",
"main": "./lib/index.js",

@@ -13,8 +13,8 @@ "types": "./lib/index.d.ts",

"file-loader": "^1.1.11",
"gh-pages": "^1.1.0",
"ts-loader": "^4.0.0",
"typescript": "^2.7.2",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.9",
"webpack-dev-server": "^3.1.0"
"gh-pages": "^1.2.0",
"ts-loader": "^4.4.2",
"typescript": "^2.9.2",
"webpack": "^4.14.0",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4"
},

@@ -21,0 +21,0 @@ "homepage": "https://github.com/michitaro/inertial-mouse",

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