react-resizable 3.0.3 → 3.0.4

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.
package/.flowconfig CHANGED
@@ -1,5 +1,5 @@
1
1
  [version]
2
- ^0.150.1
2
+ ^0.153.0
3
3
 
4
4
  [ignore]
5
5
  .*/node_modules/@babel.*
package/CHANGELOG.md CHANGED
@@ -1,30 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ### 3.0.4 (Jun 15, 2021)
4
+
5
+ - 🐛 Bugfix: Fix incorrect fix for `handleAxis` on DOM elements. [#175](https://github.com/react-grid-layout/react-resizable/issues/175)
6
+ - ✏ Chore:Upgrade dependencies.
7
+
3
8
  ### 3.0.3 (Jun 14, 2021)
4
9
 
5
- - Fix unknown prop `handleAxis` making it to DOM elements, causing a warning in dev.
6
- - Rewrote `lockAspectRatio` logic to be more accurate and shorter.
10
+ - 🐛 Bugfix: Remove unknown prop `handleAxis` making it to DOM elements, causing a warning in dev.
11
+ - ✏ Chore:Rewrote `lockAspectRatio` logic to be more accurate and shorter.
7
12
 
8
13
  ### 3.0.2 (Jun 8, 2021)
9
14
 
10
- - Add documentation for resize handles and fix a mistake where the `handleAxis` prop was not being passed to custom components.
15
+ - ✏ Chore:Add documentation for resize handles and fix a mistake where the `handleAxis` prop was not being passed to custom components.
11
16
  - See [Resize Handles](README.md#resize-handle)
12
17
 
13
18
  ### 3.0.1 (May 10, 2021)
14
19
 
15
- - Reduce package size through `.npmignore`.
20
+ - ✏ Chore:Reduce package size through `.npmignore`.
16
21
 
17
22
  ### 3.0.0 (May 10, 2021)
18
23
 
19
24
  #### Breaking
20
- - Fixed handling of the `nodeRef` that needs to be passed to `<DraggableCore>` to avoid use of ReactDOM. This means that vanilla usage of `react-resizable` no longer requires ReactDOM. No code changes are needed in the usual case, except:
25
+
26
+ - 🐛 Bugfix: Fixed handling of the `nodeRef` that needs to be passed to `<DraggableCore>` to avoid use of ReactDOM. This means that vanilla usage of `react-resizable` no longer requires ReactDOM. No code changes are needed in the usual case, except:
21
27
  * React `>= 16.3` is required due to use of `React.createRef()`, and
22
28
  * The `handle` prop now sends a `ReactRef<HTMLElement>` as its second argument and expects it to be used on your returned component.
23
29
  * If you do not attach the `ref`, you will receive the following error: `"<DraggableCore> not mounted on DragStart!"` This is due to the ref being present but not attached to any node.
24
30
 
25
31
  ### 1.11.1 (Mar 5, 2021)
26
32
 
27
- - Added React 17 to peerDependencies.
33
+ - ✏ Chore: Added React 17 to peerDependencies.
28
34
 
29
35
  ### 1.11.0 (Sep 3, 2020)
30
36
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ### React-Resizable
2
2
 
3
- [View the Demo](https://react-grid-layout.github.io/react-resizable/examples/1.html)
3
+ [View the Demo](https://react-grid-layout.github.io/react-resizable/index.html)
4
4
 
5
5
  A simple widget that can be resized via one or more handles.
6
6
 
@@ -176,7 +176,7 @@ var Resizable = /*#__PURE__*/function (_React$Component) {
176
176
  var shouldSkipCb = handlerName === 'onResize' && !dimensionsChanged;
177
177
 
178
178
  if (cb && !shouldSkipCb) {
179
- if (typeof e.persist === 'function') e.persist();
179
+ e.persist == null ? void 0 : e.persist();
180
180
  cb(e, {
181
181
  node: node,
182
182
  size: {
@@ -211,7 +211,7 @@ var Resizable = /*#__PURE__*/function (_React$Component) {
211
211
  } // Handle is a React component (composite or DOM).
212
212
 
213
213
 
214
- var isDOMElement = handle.type === 'string';
214
+ var isDOMElement = typeof handle.type === 'string';
215
215
 
216
216
  var props = _objectSpread({
217
217
  ref: ref
@@ -139,7 +139,7 @@ export default class Resizable extends React.Component<Props, void> {
139
139
  // Don't call 'onResize' if dimensions haven't changed.
140
140
  const shouldSkipCb = handlerName === 'onResize' && !dimensionsChanged;
141
141
  if (cb && !shouldSkipCb) {
142
- if (typeof e.persist === 'function') e.persist();
142
+ e.persist?.();
143
143
  cb(e, {node, size: {width, height}, handle: axis});
144
144
  }
145
145
 
@@ -162,7 +162,7 @@ export default class Resizable extends React.Component<Props, void> {
162
162
  return handle(handleAxis, ref);
163
163
  }
164
164
  // Handle is a React component (composite or DOM).
165
- const isDOMElement = handle.type === 'string';
165
+ const isDOMElement = typeof handle.type === 'string';
166
166
  const props = {
167
167
  ref,
168
168
  // Add `handleAxis` prop iff this is not a DOM element,
@@ -55,7 +55,7 @@ var ResizableBox = /*#__PURE__*/function (_React$Component) {
55
55
  var size = data.size;
56
56
 
57
57
  if (_this.props.onResize) {
58
- e.persist && e.persist();
58
+ e.persist == null ? void 0 : e.persist();
59
59
 
60
60
  _this.setState(size, function () {
61
61
  return _this.props.onResize && _this.props.onResize(e, data);
@@ -44,7 +44,7 @@ export default class ResizableBox extends React.Component<ResizableBoxProps, Res
44
44
  onResize: (e: SyntheticEvent<>, data: ResizeCallbackData) => void = (e, data) => {
45
45
  const {size} = data;
46
46
  if (this.props.onResize) {
47
- e.persist && e.persist();
47
+ e.persist?.();
48
48
  this.setState(size, () => this.props.onResize && this.props.onResize(e, data));
49
49
  } else {
50
50
  this.setState(size);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-resizable",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "A component that is resizable with handles.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,8 +9,7 @@
9
9
  "unit": "jest --watch --verbose",
10
10
  "build": "bash build.sh",
11
11
  "build-example": "webpack",
12
- "dev": "webpack-dev-server --open --open-page=examples/1.html",
13
- "watch": "webpack --progress --watch",
12
+ "dev": "webpack serve --open",
14
13
  "prepublishOnly": "npm run build",
15
14
  "validate": "yarn check",
16
15
  "preversion": "npm run lint",
@@ -34,32 +33,32 @@
34
33
  },
35
34
  "homepage": "https://github.com/react-grid-layout/react-resizable",
36
35
  "devDependencies": {
37
- "@babel/cli": "^7.14.3",
38
- "@babel/core": "^7.14.3",
39
- "@babel/eslint-parser": "^7.14.4",
40
- "@babel/plugin-proposal-class-properties": "^7.10.4",
41
- "@babel/plugin-proposal-object-rest-spread": "^7.14.4",
42
- "@babel/preset-env": "^7.14.4",
43
- "@babel/preset-flow": "^7.10.4",
44
- "@babel/preset-react": "^7.10.4",
36
+ "@babel/cli": "^7.14.5",
37
+ "@babel/core": "^7.14.6",
38
+ "@babel/eslint-parser": "^7.14.5",
39
+ "@babel/plugin-proposal-class-properties": "^7.14.5",
40
+ "@babel/plugin-proposal-object-rest-spread": "^7.14.5",
41
+ "@babel/preset-env": "^7.14.5",
42
+ "@babel/preset-flow": "^7.14.5",
43
+ "@babel/preset-react": "^7.14.5",
45
44
  "babel-loader": "^8.0.6",
46
45
  "cross-env": "^7.0.2",
47
- "css-loader": "^4.2.2",
46
+ "css-loader": "^5.2.6",
48
47
  "enzyme": "^3.11.0",
49
48
  "enzyme-adapter-react-16": "^1.15.4",
50
49
  "eslint": "^7.28.0",
51
50
  "eslint-plugin-jest": "^24.3.6",
52
51
  "eslint-plugin-react": "^7.24.0",
53
- "flow-bin": "^0.150.1",
52
+ "flow-bin": "^0.153.0",
54
53
  "jest": "^27.0.4",
55
54
  "lodash": "^4.17.20",
56
55
  "pre-commit": "^1.1.2",
57
56
  "react": "^16.10.2",
58
57
  "react-dom": "^16.10.2",
59
58
  "react-test-renderer": "^16.11.0",
60
- "style-loader": "^1.0.0",
61
- "webpack": "^4.44.1",
62
- "webpack-cli": "^3.3.12",
59
+ "style-loader": "^2.0.0",
60
+ "webpack": "^5.39.0",
61
+ "webpack-cli": "^4.7.2",
63
62
  "webpack-dev-server": "^3.8.2"
64
63
  },
65
64
  "dependencies": {