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

react-dnd-touch-backend

Package Overview
Dependencies
Maintainers
2
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dnd-touch-backend - npm Package Compare versions

Comparing version 0.8.2 to 0.8.3

dist/Touch.d.ts

10

dist/Touch.js

@@ -420,6 +420,12 @@ /**

case eventNames.mouse.move:
coords = { x: e.clientX, y: e.clientY };
coords = {
x: e.clientX,
y: e.clientY
};
break;
case eventNames.touch.move:
coords = { x: e.touches[0].clientX, y: e.touches[0].clientY };
coords = {
x: e.touches[0].clientX,
y: e.touches[0].clientY
};
break;

@@ -426,0 +432,0 @@ }

3

package.json
{
"name": "react-dnd-touch-backend",
"version": "0.8.2",
"version": "0.8.3",
"description": "Touch backend for react-dnd",
"main": "dist/Touch.js",
"typings": "dist/Touch.d.ts",
"scripts": {

@@ -7,0 +8,0 @@ "clean": "rimraf dist/**/* examples/*.browserified.js",

@@ -157,7 +157,7 @@ /**

interface EventName {
start?: 'mousedown' | 'touchstart'
move?: 'mousemove' | 'touchmove'
end?: 'mouseup' | 'touchend'
contextmenu?: 'contextmenu'
keydown?: 'keydown'
start?: 'mousedown' | 'touchstart'
move?: 'mousemove' | 'touchmove'
end?: 'mouseup' | 'touchend'
contextmenu?: 'contextmenu'
keydown?: 'keydown'
}

@@ -197,4 +197,4 @@

interface AngleRange {
start: number
end: number
start: number
end: number
}

@@ -358,3 +358,8 @@

addEventListener<K extends keyof EventName>(subject: HTMLElement | Window, event: K, handler: (e: WindowEventMap[EventName[K]]) => void, capture?: boolean) {
addEventListener<K extends keyof EventName>(
subject: HTMLElement | Window,
event: K,
handler: (e: WindowEventMap[EventName[K]]) => void,
capture?: boolean
) {
const options = supportsPassive ? { capture, passive: false } : capture

@@ -371,3 +376,8 @@

removeEventListener<K extends keyof EventName>(subject: HTMLElement| Window, event: K, handler: (e: WindowEventMap[EventName[K]]) => void, capture?: boolean) {
removeEventListener<K extends keyof EventName>(
subject: HTMLElement | Window,
event: K,
handler: (e: WindowEventMap[EventName[K]]) => void,
capture?: boolean
) {
const options = supportsPassive ? { capture, passive: false } : capture

@@ -419,7 +429,13 @@

case eventNames.mouse.move:
coords = { x: (e as MouseEvent).clientX, y: (e as MouseEvent).clientY }
coords = {
x: (e as MouseEvent).clientX,
y: (e as MouseEvent).clientY
}
break
case eventNames.touch.move:
coords = { x: (e as TouchEvent).touches[0].clientX, y: (e as TouchEvent).touches[0].clientY }
coords = {
x: (e as TouchEvent).touches[0].clientX,
y: (e as TouchEvent).touches[0].clientY
}
break

@@ -448,7 +464,3 @@ }

delete this.targetNodes[targetId]
this.removeEventListener(
document.body,
'move',
handleMove
)
this.removeEventListener(document.body, 'move', handleMove)
}

@@ -718,7 +730,11 @@ }

function isDragDropManager (optionsOrManager: DragDropManager<any> | Opts): optionsOrManager is DragDropManager<any> {
return !!(optionsOrManager as DragDropManager<any>).getMonitor
function isDragDropManager(
optionsOrManager: DragDropManager<any> | Opts
): optionsOrManager is DragDropManager<any> {
return !!(optionsOrManager as DragDropManager<any>).getMonitor
}
export default function createTouchBackend(optionsOrManager: DragDropManager<any> | Opts) {
export default function createTouchBackend(
optionsOrManager: DragDropManager<any> | Opts
) {
const touchBackendFactory = function(manager: DragDropManager<any>) {

@@ -741,3 +757,9 @@ return new TouchBackend(manager, optionsOrManager as Opts)

function inAngleRanges(x1: number, y1: number, x2: number, y2: number, angleRanges?: AngleRange[]) {
function inAngleRanges(
x1: number,
y1: number,
x2: number,
y2: number,
angleRanges?: AngleRange[]
) {
if (!angleRanges) {

@@ -744,0 +766,0 @@ return false

@@ -5,5 +5,6 @@ {

"module": "commonjs",
"target": "es5"
"target": "es5",
"declaration": true
},
"include": ["src/*.ts"]
}
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