react-pure-modal 2.2.1 → 2.2.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.
@@ -4,6 +4,118 @@ object-assign
4
4
  @license MIT
5
5
  */
6
6
 
7
+ /*! !!../node_modules/css-loader/dist/cjs.js!./react-pure-modal.min.css */
8
+
9
+ /*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */
10
+
11
+ /*! ../dist/react-pure-modal.min.css */
12
+
13
+ /*! ../dist/react-pure-modal.min.js */
14
+
15
+ /*! ../node_modules/css-loader/dist/runtime/api.js */
16
+
17
+ /*! ./cjs/react-dom.development.js */
18
+
19
+ /*! ./cjs/react.development.js */
20
+
21
+ /*! ./cjs/scheduler-tracing.development.js */
22
+
23
+ /*! ./cjs/scheduler.development.js */
24
+
25
+ /*! ./content */
26
+
27
+ /*! ./lib/ReactPropTypesSecret */
28
+
29
+ /*! ./lib/has */
30
+
31
+ /*! object-assign */
32
+
33
+ /*! prop-types/checkPropTypes */
34
+
35
+ /*! react */
36
+
37
+ /*! react-dom */
38
+
39
+ /*! scheduler */
40
+
41
+ /*! scheduler/tracing */
42
+
43
+ /*!****************************!*\
44
+ !*** ./example/content.ts ***!
45
+ \****************************/
46
+
47
+ /*!*****************************!*\
48
+ !*** ./example/example.tsx ***!
49
+ \*****************************/
50
+
51
+ /*!*************************************!*\
52
+ !*** ./node_modules/react/index.js ***!
53
+ \*************************************/
54
+
55
+ /*!**************************************!*\
56
+ !*** ./dist/react-pure-modal.min.js ***!
57
+ \**************************************/
58
+
59
+ /*!***************************************!*\
60
+ !*** ./dist/react-pure-modal.min.css ***!
61
+ \***************************************/
62
+
63
+ /*!*****************************************!*\
64
+ !*** ./node_modules/react-dom/index.js ***!
65
+ \*****************************************/
66
+
67
+ /*!*****************************************!*\
68
+ !*** ./node_modules/scheduler/index.js ***!
69
+ \*****************************************/
70
+
71
+ /*!*******************************************!*\
72
+ !*** ./node_modules/scheduler/tracing.js ***!
73
+ \*******************************************/
74
+
75
+ /*!********************************************!*\
76
+ !*** ./node_modules/prop-types/lib/has.js ***!
77
+ \********************************************/
78
+
79
+ /*!*********************************************!*\
80
+ !*** ./node_modules/object-assign/index.js ***!
81
+ \*********************************************/
82
+
83
+ /*!***************************************************!*\
84
+ !*** ./node_modules/prop-types/checkPropTypes.js ***!
85
+ \***************************************************/
86
+
87
+ /*!*****************************************************!*\
88
+ !*** ./node_modules/css-loader/dist/runtime/api.js ***!
89
+ \*****************************************************/
90
+
91
+ /*!*****************************************************!*\
92
+ !*** ./node_modules/react/cjs/react.development.js ***!
93
+ \*****************************************************/
94
+
95
+ /*!*************************************************************!*\
96
+ !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
97
+ \*************************************************************/
98
+
99
+ /*!*************************************************************!*\
100
+ !*** ./node_modules/react-dom/cjs/react-dom.development.js ***!
101
+ \*************************************************************/
102
+
103
+ /*!*************************************************************!*\
104
+ !*** ./node_modules/scheduler/cjs/scheduler.development.js ***!
105
+ \*************************************************************/
106
+
107
+ /*!*********************************************************************!*\
108
+ !*** ./node_modules/scheduler/cjs/scheduler-tracing.development.js ***!
109
+ \*********************************************************************/
110
+
111
+ /*!****************************************************************************!*\
112
+ !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
113
+ \****************************************************************************/
114
+
115
+ /*!*****************************************************************************!*\
116
+ !*** ./node_modules/css-loader/dist/cjs.js!./dist/react-pure-modal.min.css ***!
117
+ \*****************************************************************************/
118
+
7
119
  /**
8
120
  * Checks if an event is supported in the current execution environment.
9
121
  *
@@ -27,15 +139,6 @@ object-assign
27
139
  * LICENSE file in the root directory of this source tree.
28
140
  */
29
141
 
30
- /** @license React v0.19.1
31
- * scheduler-tracing.production.min.js
32
- *
33
- * Copyright (c) Facebook, Inc. and its affiliates.
34
- *
35
- * This source code is licensed under the MIT license found in the
36
- * LICENSE file in the root directory of this source tree.
37
- */
38
-
39
142
  /** @license React v0.19.1
40
143
  * scheduler.development.js
41
144
  *
@@ -45,15 +148,6 @@ object-assign
45
148
  * LICENSE file in the root directory of this source tree.
46
149
  */
47
150
 
48
- /** @license React v0.19.1
49
- * scheduler.production.min.js
50
- *
51
- * Copyright (c) Facebook, Inc. and its affiliates.
52
- *
53
- * This source code is licensed under the MIT license found in the
54
- * LICENSE file in the root directory of this source tree.
55
- */
56
-
57
151
  /** @license React v16.13.1
58
152
  * react-dom.development.js
59
153
  *
@@ -63,15 +157,6 @@ object-assign
63
157
  * LICENSE file in the root directory of this source tree.
64
158
  */
65
159
 
66
- /** @license React v16.13.1
67
- * react-dom.production.min.js
68
- *
69
- * Copyright (c) Facebook, Inc. and its affiliates.
70
- *
71
- * This source code is licensed under the MIT license found in the
72
- * LICENSE file in the root directory of this source tree.
73
- */
74
-
75
160
  /** @license React v16.13.1
76
161
  * react.development.js
77
162
  *
@@ -80,12 +165,3 @@ object-assign
80
165
  * This source code is licensed under the MIT license found in the
81
166
  * LICENSE file in the root directory of this source tree.
82
167
  */
83
-
84
- /** @license React v16.13.1
85
- * react.production.min.js
86
- *
87
- * Copyright (c) Facebook, Inc. and its affiliates.
88
- *
89
- * This source code is licensed under the MIT license found in the
90
- * LICENSE file in the root directory of this source tree.
91
- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-pure-modal",
3
- "version": "2.2.1",
3
+ "version": "2.2.4",
4
4
  "description": "React modal",
5
5
  "main": "dist/react-pure-modal.min.js",
6
6
  "types": "dist/react-pure-modal.d.ts",
@@ -29,12 +29,13 @@
29
29
  },
30
30
  "homepage": "https://github.com/max-mykhailenko/react-pure-modal#readme",
31
31
  "devDependencies": {
32
- "@babel/core": "7.11.4",
32
+ "@babel/core": "7.22.1",
33
33
  "@babel/plugin-proposal-class-properties": "7.10.4",
34
34
  "@babel/plugin-proposal-optional-chaining": "7.11.0",
35
35
  "@babel/preset-env": "7.11.0",
36
36
  "@babel/preset-react": "7.10.4",
37
37
  "@babel/preset-typescript": "7.10.4",
38
+ "@types/node": "^15.14.1",
38
39
  "@types/react": "16.9.48",
39
40
  "@types/react-dom": "16.9.9",
40
41
  "autoprefixer": "9.8.6",
@@ -45,7 +46,7 @@
45
46
  "css-minimizer-webpack-plugin": "1.1.2",
46
47
  "eslint": "7.7.0",
47
48
  "eslint-config-airbnb": "18.2.0",
48
- "eslint-plugin-import": "2.22.0",
49
+ "eslint-plugin-import": "2.22.1",
49
50
  "eslint-plugin-jsx-a11y": "6.3.1",
50
51
  "eslint-plugin-react": "7.20.6",
51
52
  "jest": "26.4.2",
@@ -54,15 +55,14 @@
54
55
  "postcss-loader": "3.0.0",
55
56
  "prettier": "2.1.1",
56
57
  "react": "16.13.1",
57
- "react-addons-test-utils": "^15.4.0",
58
58
  "react-dom": "16.13.1",
59
59
  "react-test-renderer": "16.13.1",
60
60
  "rimraf": "3.0.2",
61
61
  "style-loader": "1.2.1",
62
62
  "terser-webpack-plugin": "4.1.0",
63
- "typescript": "4.0.2",
64
- "webpack": "4.44.1",
65
- "webpack-cli": "3.3.12",
63
+ "typescript": "4.8.2",
64
+ "webpack": "5.85.0",
65
+ "webpack-cli": "5.1.3",
66
66
  "webpack-dev-server": "3.11.0",
67
67
  "yargs": "15.4.1"
68
68
  },
@@ -34,9 +34,15 @@ function PureModal(props: Props) {
34
34
 
35
35
  const { isOpen, onClose } = props;
36
36
 
37
+ const removeClassBody = useCallback(() => {
38
+ document.body.classList.remove('body-modal-fix');
39
+ }, []);
40
+
37
41
  useEffect(() => {
38
42
  if (isOpen) {
39
43
  open();
44
+ } else {
45
+ close();
40
46
  }
41
47
  }, [isOpen]);
42
48
 
@@ -64,7 +70,7 @@ function PureModal(props: Props) {
64
70
 
65
71
  function unsetModalContext() {
66
72
  document.removeEventListener('keydown', handleEsc);
67
- document.body.classList.remove('body-modal-fix');
73
+ removeClassBody();
68
74
  setX(null);
69
75
  setY(null);
70
76
  setDeltaX(0);
@@ -4,7 +4,7 @@ const path = require('path');
4
4
  const webpack = require('webpack');
5
5
 
6
6
  const config = {
7
- mode: process.env.NODE_ENV || 'production',
7
+ mode: process.env.NODE_ENV || 'development',
8
8
  optimization: {
9
9
  minimize: process.env.NODE_ENV !== 'development',
10
10
  minimizer:
@@ -23,7 +23,7 @@ const config = {
23
23
  entry: {
24
24
  example: path.join(__dirname, 'example/example.tsx'),
25
25
  },
26
- devtool: process.env.NODE_ENV !== 'development' ? '' : 'inline-source-map',
26
+ devtool: process.env.NODE_ENV !== 'development' ? false : 'inline-source-map',
27
27
  module: {
28
28
  rules: [
29
29
  {
@@ -53,7 +53,7 @@ const config = {
53
53
  },
54
54
  plugins: [
55
55
  new webpack.DefinePlugin({
56
- 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
56
+ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
57
57
  }),
58
58
  ],
59
59
  resolve: {
package/webpack.config.js CHANGED
@@ -45,7 +45,7 @@ const config = {
45
45
  },
46
46
  plugins: [
47
47
  new webpack.DefinePlugin({
48
- 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
48
+ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'),
49
49
  }),
50
50
  new MiniCssExtractPlugin({ filename: '[name].min.css' }),
51
51
  ],