react-with-gesture
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -62,3 +62,4 @@ import React from 'react'; | ||
down: false, | ||
first: true | ||
first: true, | ||
shiftKey: false | ||
}; | ||
@@ -82,2 +83,3 @@ | ||
event: event, | ||
shiftKey: event.shiftKey, | ||
lastLocal: state.local, | ||
@@ -103,2 +105,3 @@ temp: temp || newProps.temp | ||
lastLocal: lastLocal, | ||
shiftKey: event.shiftKey, | ||
local: lastLocal, | ||
@@ -143,2 +146,3 @@ xy: [pageX, pageY], | ||
time: time, | ||
shiftKey: event.shiftKey, | ||
xy: [pageX, pageY], | ||
@@ -145,0 +149,0 @@ delta: [delta_x, delta_y], |
@@ -68,3 +68,4 @@ 'use strict'; | ||
down: false, | ||
first: true | ||
first: true, | ||
shiftKey: false | ||
}; | ||
@@ -88,2 +89,3 @@ | ||
event: event, | ||
shiftKey: event.shiftKey, | ||
lastLocal: state.local, | ||
@@ -109,2 +111,3 @@ temp: temp || newProps.temp | ||
lastLocal: lastLocal, | ||
shiftKey: event.shiftKey, | ||
local: lastLocal, | ||
@@ -149,2 +152,3 @@ xy: [pageX, pageY], | ||
time: time, | ||
shiftKey: event.shiftKey, | ||
xy: [pageX, pageY], | ||
@@ -151,0 +155,0 @@ delta: [delta_x, delta_y], |
import * as React from 'react'; | ||
// Helper type, taken from: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html | ||
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; | ||
export type vector2 = [number, number]; | ||
@@ -41,7 +44,5 @@ | ||
type GestureChildComponent<T> = React.ComponentType<T & Partial<GestureState>>; | ||
export function withGesture(config: GestureOptions) | ||
: <T>(WrappedComponent: GestureChildComponent<T>) | ||
=> React.ComponentType<T> | ||
: <P extends GestureState>(WrappedComponent: React.ComponentType<P>) | ||
=> React.ComponentType<Omit<P, keyof GestureState>> | ||
@@ -48,0 +49,0 @@ type GestureEvents = { |
@@ -26,2 +26,3 @@ import React from 'react' | ||
first: true, | ||
shiftKey: false, | ||
} | ||
@@ -38,2 +39,3 @@ | ||
event, | ||
shiftKey: event.shiftKey, | ||
lastLocal: state.local, | ||
@@ -53,2 +55,3 @@ temp: temp || newProps.temp, | ||
lastLocal, | ||
shiftKey: event.shiftKey, | ||
local: lastLocal, | ||
@@ -84,2 +87,3 @@ xy: [pageX, pageY], | ||
time, | ||
shiftKey: event.shiftKey, | ||
xy: [pageX, pageY], | ||
@@ -86,0 +90,0 @@ delta: [delta_x, delta_y], |
{ | ||
"name": "react-with-gesture", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "hoc for receiving gestures", | ||
@@ -27,3 +27,3 @@ "main": "dist/react-with-gesture", | ||
"author": "Paul Henschel", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -30,0 +30,0 @@ "url": "https://github.com/drcmda/react-with-gesture/issues" |
@@ -95,6 +95,8 @@ <p align="middle"> | ||
<p align="middle"> | ||
<img src="https://i.imgur.com/ooNu3jz.gif" width="200"/> | ||
</p> | ||
#### React hooks (basic drag/n/drop) | ||
<img src="https://i.imgur.com/ooNu3jz.gif" width="195"/> | ||
Demo: https://codesandbox.io/embed/l2wy87l28l | ||
@@ -109,6 +111,8 @@ | ||
<p align="middle"> | ||
<img src="https://i.imgur.com/KDeJBqp.gif" width="200"/> | ||
</p> | ||
#### React hooks with onAction (and react-spring) (basic pull & release) | ||
<img src="https://i.imgur.com/KDeJBqp.gif" width="195"/> | ||
Demo: https://codesandbox.io/embed/r24mzvo3q | ||
@@ -129,6 +133,8 @@ | ||
<p align="middle"> | ||
<img src="https://i.imgur.com/JyeQsEI.gif" width="200"/> | ||
</p> | ||
#### React hooks with onAction (and react-spring) (decay) | ||
<img src="https://i.imgur.com/JyeQsEI.gif" width="195"/> | ||
Demo: https://codesandbox.io/embed/zq19y1xr9m | ||
@@ -135,0 +141,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
100137
0
836
158