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

react-with-gesture

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-with-gesture - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

6

dist/react-with-gesture.es.js

@@ -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],

9

index.d.ts
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

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