react-resizable 1.8.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.babelrc +10 -4
  2. package/.browserslistrc +3 -0
  3. package/.eslintrc +10 -6
  4. package/.flowconfig +10 -10
  5. package/CHANGELOG.md +61 -32
  6. package/README.md +14 -4
  7. package/__tests__/Resizable.test.js +245 -0
  8. package/__tests__/ResizableBox.test.js +99 -0
  9. package/__tests__/__snapshots__/Resizable.test.js.snap +29 -0
  10. package/__tests__/__snapshots__/ResizableBox.test.js.snap +23 -0
  11. package/build/Resizable.js +172 -208
  12. package/build/Resizable.js.flow +99 -178
  13. package/build/ResizableBox.js +95 -79
  14. package/build/ResizableBox.js.flow +58 -33
  15. package/build/propTypes.js +112 -0
  16. package/build/propTypes.js.flow +135 -0
  17. package/build/utils.js +27 -0
  18. package/build/{cloneElement.js.flow → utils.js.flow} +2 -2
  19. package/coverage/clover.xml +107 -0
  20. package/coverage/coverage-final.json +5 -0
  21. package/coverage/lcov-report/Resizable.js.html +665 -0
  22. package/coverage/lcov-report/ResizableBox.js.html +374 -0
  23. package/coverage/lcov-report/base.css +224 -0
  24. package/coverage/lcov-report/block-navigation.js +79 -0
  25. package/coverage/lcov-report/favicon.png +0 -0
  26. package/coverage/lcov-report/flow-typed/npm/index.html +111 -0
  27. package/coverage/lcov-report/flow-typed/npm/jest_v26.x.x.js.html +3734 -0
  28. package/coverage/lcov-report/index.html +156 -0
  29. package/coverage/lcov-report/prettify.css +1 -0
  30. package/coverage/lcov-report/prettify.js +2 -0
  31. package/coverage/lcov-report/propTypes.js.html +485 -0
  32. package/coverage/lcov-report/react-resizable/dist/bundle.js.html +95 -0
  33. package/coverage/lcov-report/react-resizable/dist/index.html +111 -0
  34. package/coverage/lcov-report/react-resizable/flow-typed/npm/index.html +111 -0
  35. package/coverage/lcov-report/react-resizable/flow-typed/npm/jest_v26.x.x.js.html +3734 -0
  36. package/coverage/lcov-report/react-resizable/index.html +111 -0
  37. package/coverage/lcov-report/react-resizable/index.js.html +101 -0
  38. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  39. package/coverage/lcov-report/sorter.js +170 -0
  40. package/coverage/lcov-report/utils.js.html +122 -0
  41. package/coverage/lcov.info +233 -0
  42. package/dist/bundle.js +6 -0
  43. package/flow-typed/npm/jest_v26.x.x.js +1218 -0
  44. package/package.json +34 -26
  45. package/setupTests/enzyme.js +4 -0
  46. package/.github/ISSUE_TEMPLATE.md +0 -23
  47. package/.github/PULL_REQUEST_TEMPLATE.md +0 -5
  48. package/build/cloneElement.js +0 -20
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "react-resizable",
3
- "version": "1.8.0",
3
+ "version": "1.11.1",
4
4
  "description": "A component that is resizable with handles.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "lint": "eslint --ext .js,.jsx lib/ test/; flow",
8
- "test": "echo \"Error: no test specified\" && exit 1",
7
+ "lint": "eslint lib/ __tests__/ setupTests/; flow",
8
+ "test": "jest --coverage",
9
+ "unit": "jest --watch --verbose",
9
10
  "build": "bash build.sh",
10
11
  "build-example": "webpack",
11
12
  "dev": "webpack-dev-server --open --open-page=examples/1.html",
12
13
  "watch": "webpack --progress --watch",
13
- "prepare": "npm run build",
14
+ "prepublishOnly": "npm run build",
14
15
  "validate": "yarn check",
15
16
  "preversion": "npm run lint",
16
17
  "version": "git add CHANGELOG.md",
@@ -33,40 +34,47 @@
33
34
  },
34
35
  "homepage": "https://github.com/STRML/react-resizable",
35
36
  "devDependencies": {
36
- "babel-cli": "^6.26.0",
37
- "babel-core": "^6.26.0",
38
- "babel-eslint": "^10.0.1",
37
+ "@babel/cli": "^7.11.6",
38
+ "@babel/core": "^7.11.6",
39
+ "@babel/plugin-proposal-class-properties": "^7.10.4",
40
+ "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
41
+ "@babel/preset-env": "^7.11.5",
42
+ "@babel/preset-flow": "^7.10.4",
43
+ "@babel/preset-react": "^7.10.4",
44
+ "babel-eslint": "^10.0.3",
39
45
  "babel-loader": "^8.0.6",
40
- "babel-plugin-transform-class-properties": "^6.24.1",
41
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
42
- "babel-preset-es2015": "^6.24.1",
43
- "babel-preset-react": "^6.24.1",
44
- "cross-env": "^5.0.5",
45
- "css-loader": "^2.1.1",
46
- "eslint": "^5.16.0",
47
- "eslint-plugin-react": "^7.4.0",
48
- "flow-bin": "^0.98.1",
49
- "lodash": "^4.3.0",
46
+ "cross-env": "^7.0.2",
47
+ "css-loader": "^4.2.2",
48
+ "enzyme": "^3.11.0",
49
+ "enzyme-adapter-react-16": "^1.15.4",
50
+ "eslint": "^7.8.1",
51
+ "eslint-plugin-react": "^7.20.6",
52
+ "flow-bin": "^0.133.0",
53
+ "jest": "^26.4.2",
54
+ "lodash": "^4.17.20",
50
55
  "pre-commit": "^1.1.2",
51
- "react": "^16.0.0",
52
- "react-dom": "^16.0.0",
53
- "style-loader": "^0.23.1",
54
- "webpack": "^4.31.0",
55
- "webpack-dev-server": "^3.3.1"
56
+ "react": "^16.10.2",
57
+ "react-dom": "^16.10.2",
58
+ "react-test-renderer": "^16.11.0",
59
+ "style-loader": "^1.0.0",
60
+ "webpack": "^4.44.1",
61
+ "webpack-cli": "^3.3.12",
62
+ "webpack-dev-server": "^3.8.2"
56
63
  },
57
64
  "dependencies": {
58
65
  "prop-types": "15.x",
59
- "react-draggable": "^3.0.3"
66
+ "react-draggable": "^4.0.3"
60
67
  },
61
68
  "peerDependencies": {
62
- "react": "0.14.x || 15.x || 16.x",
63
- "react-dom": "0.14.x || 15.x || 16.x"
69
+ "react": "0.14.x || 15.x || 16.x || 17.x",
70
+ "react-dom": "0.14.x || 15.x || 16.x || 17.x"
64
71
  },
65
72
  "publishConfig": {
66
73
  "registry": "https://registry.npmjs.org"
67
74
  },
68
75
  "pre-commit": [
69
76
  "lint",
70
- "validate"
77
+ "validate",
78
+ "test"
71
79
  ]
72
80
  }
@@ -0,0 +1,4 @@
1
+ const Adapter = require('enzyme-adapter-react-16');
2
+ const enzyme = require('enzyme');
3
+
4
+ enzyme.configure({ adapter: new Adapter() });
@@ -1,23 +0,0 @@
1
- ### Thanks for opening an issue!
2
-
3
- Please select the type of issue you're reporting. For questions.
4
-
5
- - [ ] Bug
6
- - [ ] Feature Request
7
- - [ ] Question
8
-
9
- ### Problem Report
10
-
11
- > Please describe the problem here.
12
-
13
- #### System Info
14
-
15
- Node Version:
16
- Browser:
17
- OS:
18
-
19
- #### Reproduction
20
-
21
- If this is a bug report, please provide a reproduction of the issue by going to
22
- https://codesandbox.io/s/9229wz40yo?fontsize=14.
23
- Paste a link here to your working reproduction.
@@ -1,5 +0,0 @@
1
- Thanks for submitting a pull request to React-Resizable!
2
-
3
- Please reference an open issue. If one has not been created, please create one along with a failing example or test case.
4
-
5
- Please do not commit built files (`/dist`) to pull requests. They are built only at release.
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
4
-
5
- var _react = require('react');
6
-
7
- var _react2 = _interopRequireDefault(_react);
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- // React.addons.cloneWithProps look-alike that merges style & className.
12
- module.exports = function cloneElement(element, props) {
13
- if (props.style && element.props.style) {
14
- props.style = _extends({}, element.props.style, props.style);
15
- }
16
- if (props.className && element.props.className) {
17
- props.className = element.props.className + ' ' + props.className;
18
- }
19
- return _react2.default.cloneElement(element, props);
20
- };