react-dnd-touch-backend
Advanced tools
Comparing version 0.8.2 to 0.8.3
@@ -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 @@ } |
{ | ||
"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"] | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
63146
11
1277
0