@nosferatu500/react-dnd-scrollzone
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import hoist from 'hoist-non-react-statics'; | ||
@@ -13,8 +12,8 @@ export declare type Point = { | ||
}; | ||
export declare const createHorizontalStrength: (_buffer: number) => ({ x, w, y, h, }: Size, point: Point) => number; | ||
export declare const createVerticalStrength: (_buffer: number) => ({ y, h, x, w, }: Size, point: Point) => number; | ||
export declare const defaultHorizontalStrength: ({ x, w, y, h, }: Size, point: Point) => number; | ||
export declare const defaultVerticalStrength: ({ y, h, x, w, }: Size, point: Point) => number; | ||
export declare const createHorizontalStrength: (_buffer: number) => ({ x, w, y, h }: Size, point: Point) => number; | ||
export declare const createVerticalStrength: (_buffer: number) => ({ y, h, x, w }: Size, point: Point) => number; | ||
export declare const defaultHorizontalStrength: ({ x, w, y, h }: Size, point: Point) => number; | ||
export declare const defaultVerticalStrength: ({ y, h, x, w }: Size, point: Point) => number; | ||
export declare const createScrollingComponent: (WrappedComponent: any) => ((props: any) => JSX.Element) & hoist.NonReactStatics<any, {}>; | ||
declare const createScrollingComponentWithConsumer: (WrappedComponent: any) => (props: any) => JSX.Element; | ||
export default createScrollingComponentWithConsumer; |
@@ -42,3 +42,6 @@ import React, { createRef, useEffect } from 'react'; | ||
if (evt.type === "touchmove") { | ||
return { x: evt.changedTouches[0].clientX, y: evt.changedTouches[0].clientY }; | ||
return { | ||
x: evt.changedTouches[0].clientX, | ||
y: evt.changedTouches[0].clientY | ||
}; | ||
} | ||
@@ -48,8 +51,3 @@ return { x: evt.clientX, y: evt.clientY }; | ||
const DEFAULT_BUFFER = 150; | ||
const createHorizontalStrength = (_buffer) => ({ | ||
x, | ||
w, | ||
y, | ||
h | ||
}, point) => { | ||
const createHorizontalStrength = (_buffer) => ({ x, w, y, h }, point) => { | ||
const buffer = Math.min(w / 2, _buffer); | ||
@@ -68,8 +66,3 @@ const inRange = point.x >= x && point.x <= x + w; | ||
}; | ||
const createVerticalStrength = (_buffer) => ({ | ||
y, | ||
h, | ||
x, | ||
w | ||
}, point) => { | ||
const createVerticalStrength = (_buffer) => ({ y, h, x, w }, point) => { | ||
const buffer = Math.min(h / 2, _buffer); | ||
@@ -76,0 +69,0 @@ const inRange = point.y >= y && point.y <= y + h; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import hoist from 'hoist-non-react-statics'; | ||
@@ -13,8 +12,8 @@ export declare type Point = { | ||
}; | ||
export declare const createHorizontalStrength: (_buffer: number) => ({ x, w, y, h, }: Size, point: Point) => number; | ||
export declare const createVerticalStrength: (_buffer: number) => ({ y, h, x, w, }: Size, point: Point) => number; | ||
export declare const defaultHorizontalStrength: ({ x, w, y, h, }: Size, point: Point) => number; | ||
export declare const defaultVerticalStrength: ({ y, h, x, w, }: Size, point: Point) => number; | ||
export declare const createHorizontalStrength: (_buffer: number) => ({ x, w, y, h }: Size, point: Point) => number; | ||
export declare const createVerticalStrength: (_buffer: number) => ({ y, h, x, w }: Size, point: Point) => number; | ||
export declare const defaultHorizontalStrength: ({ x, w, y, h }: Size, point: Point) => number; | ||
export declare const defaultVerticalStrength: ({ y, h, x, w }: Size, point: Point) => number; | ||
export declare const createScrollingComponent: (WrappedComponent: any) => ((props: any) => JSX.Element) & hoist.NonReactStatics<any, {}>; | ||
declare const createScrollingComponentWithConsumer: (WrappedComponent: any) => (props: any) => JSX.Element; | ||
export default createScrollingComponentWithConsumer; |
{ | ||
"name": "@nosferatu500/react-dnd-scrollzone", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A cross browser solution to scrolling during drag and drop.", | ||
"main": "./index.js", | ||
"module": "./esm/index.js", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
"./": "./", | ||
".": { | ||
"types": "./index.d.ts", | ||
"module": "./esm/index.js", | ||
"import": "./esm/index.js", | ||
"import": "./esm/index.mjs", | ||
"default": "./index.js" | ||
@@ -16,0 +14,0 @@ } |
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
26268
7
486