react-dnd-scrolling
Advanced tools
Comparing version 1.0.0-rc.1 to 1.0.0
@@ -27,3 +27,3 @@ # Changelog | ||
```js | ||
import Scrollzone from 'react-dnd-scrollzone'; | ||
import Scrollzone from 'react-dnd-scrolling'; | ||
const zone = <Scrollzone />; | ||
@@ -34,3 +34,3 @@ ``` | ||
```js | ||
import withScrolling from 'react-dnd-scrollzone'; | ||
import withScrolling from 'react-dnd-scrolling'; | ||
const Scrollzone = withScrolling('div'); | ||
@@ -49,3 +49,3 @@ const zone = <Scrollzone />; | ||
```js | ||
import Scrollzone from 'react-dnd-scrollzone'; | ||
import Scrollzone from 'react-dnd-scrolling'; | ||
const zone = <Scrollzone buffer={300} />; | ||
@@ -56,3 +56,3 @@ ``` | ||
```js | ||
import Scrollzone, { createVerticalStrength, createHorizontalStrength } from 'react-dnd-scrollzone'; | ||
import Scrollzone, { createVerticalStrength, createHorizontalStrength } from 'react-dnd-scrolling'; | ||
const vStrength = createVerticalStrength(300); | ||
@@ -59,0 +59,0 @@ const hStrength = createHorizontalStrength(300); |
@@ -24,2 +24,4 @@ 'use strict'; | ||
var _reactDnd = require('react-dnd'); | ||
var _reactDom = require('react-dom'); | ||
@@ -299,5 +301,3 @@ | ||
}; | ||
ScrollingComponent.contextTypes = { | ||
dragDropManager: _propTypes2.default.object | ||
}; | ||
ScrollingComponent.contextType = _reactDnd.DndContext; | ||
@@ -304,0 +304,0 @@ |
{ | ||
"name": "react-dnd-scrolling", | ||
"version": "1.0.0-rc.1", | ||
"version": "1.0.0", | ||
"description": "A cross browser solution to scrolling during drag and drop.", | ||
@@ -14,4 +14,3 @@ "main": "lib/index.js", | ||
"publish:minor": "npm version minor && npm publish", | ||
"publish:patch": "npm version patch && npm publish", | ||
"postpublish": "git push origin master --tags" | ||
"publish:patch": "npm version patch && npm publish" | ||
}, | ||
@@ -31,5 +30,3 @@ "repository": { | ||
"dnd", | ||
"drag and drop", | ||
"polyfill", | ||
"auto" | ||
"drag and drop" | ||
], | ||
@@ -44,27 +41,36 @@ "author": { | ||
"hoist-non-react-statics": "3.x", | ||
"lodash.throttle": "^4.0.1", | ||
"prop-types": "^15.5.9", | ||
"raf": "^3.2.0", | ||
"react-display-name": "^0.2.0" | ||
"lodash.throttle": "^4.1.1", | ||
"prop-types": "15.x", | ||
"raf": "^3.4.1", | ||
"react-display-name": "^0.2.5" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.4.5", | ||
"babel-eslint": "^6.0.4", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-preset-react": "^6.5.0", | ||
"babel-preset-stage-1": "^6.3.13", | ||
"babel-register": "^6.4.3", | ||
"chai": "^3.4.1", | ||
"eslint": "^2.12.0", | ||
"eslint-config-airbnb": "^9.0.1", | ||
"eslint-plugin-import": "^1.8.1", | ||
"eslint-plugin-jsx-a11y": "^1.4.2", | ||
"eslint-plugin-react": "^5.1.1", | ||
"in-publish": "^2.0.0", | ||
"mocha": "^2.3.4", | ||
"babel-cli": "^6.26.0", | ||
"babel-eslint": "^10.1.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-1": "^6.24.1", | ||
"babel-register": "^6.26.0", | ||
"chai": "^4.2.0", | ||
"eslint": "^6.6.0", | ||
"eslint-config-airbnb": "^18.1.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-import": "^2.20.2", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-react": "^7.19.0", | ||
"in-publish": "^2.0.1", | ||
"mocha": "^7.1.2", | ||
"prettier": "^2.0.5", | ||
"react": "^16.13.1", | ||
"react-dnd": "^10.0.2", | ||
"react-dom": "^16.13.1", | ||
"sinon": "^9.0.2", | ||
"sinon-chai": "^3.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "16.x", | ||
"react-dom": "16.x", | ||
"sinon": "^1.17.2", | ||
"sinon-chai": "^2.8.0" | ||
"react-dnd": "10.x", | ||
"react-dom": "16.x" | ||
} | ||
} |
@@ -5,2 +5,4 @@ # react-dnd-scrolling | ||
Works with `react-dnd@10.x`. | ||
### Build Status | ||
@@ -14,5 +16,5 @@ | ||
import React, { Component } from 'react'; | ||
import { DragDropContextProvider } from 'react-dnd'; | ||
import { DndProvider } from 'react-dnd'; | ||
import HTML5Backend from 'react-dnd-html5-backend'; | ||
import withScrolling from 'react-dnd-scrollzone'; | ||
import withScrolling from 'react-dnd-scrolling'; | ||
import DragItem from './DragItem'; | ||
@@ -28,3 +30,3 @@ import './App.css'; | ||
return ( | ||
<DragDropContextProvider backend={HTML5Backend}> | ||
<DndProvider backend={HTML5Backend}> | ||
<ScrollingComponent className="App"> | ||
@@ -35,3 +37,3 @@ {ITEMS.map(n => ( | ||
</ScrollingComponent> | ||
</DragDropContextProvider> | ||
</DndProvider> | ||
); | ||
@@ -48,5 +50,5 @@ } | ||
import React, { Component } from 'react'; | ||
import { DragDropContextProvider } from 'react-dnd'; | ||
import { DndProvider } from 'react-dnd'; | ||
import HTML5Backend from 'react-dnd-html5-backend'; | ||
import withScrolling, { createHorizontalStrength, createVerticalStrength } from 'react-dnd-scrollzone'; | ||
import withScrolling, { createHorizontalStrength, createVerticalStrength } from 'react-dnd-scrolling'; | ||
import DragItem from './DragItem'; | ||
@@ -80,3 +82,3 @@ import './App.css'; | ||
return ( | ||
<DragDropContextProvider backend={HTML5Backend}> | ||
<DndProvider backend={HTML5Backend}> | ||
<ScrollingComponent | ||
@@ -91,3 +93,3 @@ className="App" | ||
</ScrollingComponent> | ||
</DragDropContextProvider> | ||
</DndProvider> | ||
); | ||
@@ -100,9 +102,9 @@ } | ||
Since react-dnd-scrollzone utilizes the Higher Order Components (HOC) pattern, drag and drop scrolling behaviour can easily be added to existing components. For example to speedup huge lists by using [react-virtualized](https://github.com/bvaughn/react-virtualized) for a windowed view where only the visible rows are rendered: | ||
Since react-dnd-scrolling utilizes the Higher Order Components (HOC) pattern, drag and drop scrolling behaviour can easily be added to existing components. For example to speedup huge lists by using [react-virtualized](https://github.com/bvaughn/react-virtualized) for a windowed view where only the visible rows are rendered: | ||
```js | ||
import React from 'react'; | ||
import { DragDropContextProvider } from 'react-dnd'; | ||
import { DndProvider } from 'react-dnd'; | ||
import HTML5Backend from 'react-dnd-html5-backend'; | ||
import withScrolling from 'react-dnd-scrollzone'; | ||
import withScrolling from 'react-dnd-scrolling'; | ||
import { List } from 'react-virtualized'; | ||
@@ -120,3 +122,3 @@ import DragItem from './DragItem'; | ||
return ( | ||
<DragDropContextProvider backend={HTML5Backend}> | ||
<DndProvider backend={HTML5Backend}> | ||
<ScrollingVirtualList | ||
@@ -138,3 +140,3 @@ className="App" | ||
/> | ||
</DragDropContextProvider> | ||
</DndProvider> | ||
); | ||
@@ -184,3 +186,3 @@ } | ||
```js | ||
import withScrolling, { createVerticalStrength, createHorizontalStrength } from 'react-dnd-scrollzone'; | ||
import withScrolling, { createVerticalStrength, createHorizontalStrength } from 'react-dnd-scrolling'; | ||
@@ -187,0 +189,0 @@ const Scrollzone = withScrolling('ul'); |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
24804
11
259
1
190
8
22
+ Added@babel/runtime@7.26.0(transitive)
+ Added@react-dnd/asap@4.0.1(transitive)
+ Added@react-dnd/invariant@2.0.0(transitive)
+ Added@react-dnd/shallowequal@2.0.0(transitive)
+ Added@types/hoist-non-react-statics@3.3.5(transitive)
+ Added@types/prop-types@15.7.13(transitive)
+ Added@types/react@18.3.12(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addeddnd-core@10.0.2(transitive)
+ Addedreact@16.14.0(transitive)
+ Addedreact-dnd@10.0.2(transitive)
+ Addedreact-dom@16.14.0(transitive)
+ Addedredux@4.2.1(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedscheduler@0.19.1(transitive)
Updatedlodash.throttle@^4.1.1
Updatedprop-types@15.x
Updatedraf@^3.4.1
Updatedreact-display-name@^0.2.5