react-split-pane 0.1.89 → 0.1.91

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.91](https://github.com/tomkp/react-split-pane/compare/v0.1.89...v0.1.91) (2020-03-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * typescript typings ([ae3e41f](https://github.com/tomkp/react-split-pane/commit/ae3e41f0076903e02cc4c5011b31ea7eeadf2ac9))
11
+ * Update site title ([f61efff](https://github.com/tomkp/react-split-pane/commit/f61efff1f7676059d6b049774f004c4e49cb1e1f))
12
+
13
+ ### [0.1.90](https://github.com/tomkp/react-split-pane/compare/v0.1.89...v0.1.90) (2020-03-23)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * typescript typings ([ae3e41f](https://github.com/tomkp/react-split-pane/commit/ae3e41f0076903e02cc4c5011b31ea7eeadf2ac9))
19
+ * Update site title ([f61efff](https://github.com/tomkp/react-split-pane/commit/f61efff1f7676059d6b049774f004c4e49cb1e1f))
20
+
5
21
  ### [0.1.89](https://github.com/tomkp/react-split-pane/compare/v0.1.88...v0.1.89) (2019-11-12)
6
22
 
7
23
 
package/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
  ![NPM license](https://img.shields.io/npm/l/react-split-pane.svg?style=flat)
5
5
  [![NPM total downloads](https://img.shields.io/npm/dt/react-split-pane.svg?style=flat)](https://npmcharts.com/compare/react-split-pane?minimal=true)
6
6
  [![NPM monthly downloads](https://img.shields.io/npm/dm/react-split-pane.svg?style=flat)](https://npmcharts.com/compare/react-split-pane?minimal=true)
7
- [![Build Status](https://img.shields.io/travis/tomkp/react-split-pane/master.svg?style=flat-square)](https://travis-ci.org/tomkp/react-split-pane)
8
- [![Coverage Status](https://img.shields.io/coveralls/tomkp/react-split-pane/master.svg?style=flat-square)](https://coveralls.io/r/tomkp/react-split-pane)
7
+ [![Build Status](https://img.shields.io/travis/tomkp/react-split-pane/master.svg?style=flat)](https://travis-ci.org/tomkp/react-split-pane)
8
+ [![Coverage Status](https://img.shields.io/coveralls/tomkp/react-split-pane/master.svg?style=flat)](https://coveralls.io/r/tomkp/react-split-pane)
9
9
 
10
10
  Split-Pane React component, can be nested or split vertically or horizontally!
11
11
 
package/dist/index.cjs.js CHANGED
@@ -46,20 +46,35 @@ function _defineProperty(obj, key, value) {
46
46
  return obj;
47
47
  }
48
48
 
49
- function _objectSpread(target) {
49
+ function ownKeys(object, enumerableOnly) {
50
+ var keys = Object.keys(object);
51
+
52
+ if (Object.getOwnPropertySymbols) {
53
+ var symbols = Object.getOwnPropertySymbols(object);
54
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
55
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
56
+ });
57
+ keys.push.apply(keys, symbols);
58
+ }
59
+
60
+ return keys;
61
+ }
62
+
63
+ function _objectSpread2(target) {
50
64
  for (var i = 1; i < arguments.length; i++) {
51
65
  var source = arguments[i] != null ? arguments[i] : {};
52
- var ownKeys = Object.keys(source);
53
66
 
54
- if (typeof Object.getOwnPropertySymbols === 'function') {
55
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
56
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
57
- }));
67
+ if (i % 2) {
68
+ ownKeys(Object(source), true).forEach(function (key) {
69
+ _defineProperty(target, key, source[key]);
70
+ });
71
+ } else if (Object.getOwnPropertyDescriptors) {
72
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
73
+ } else {
74
+ ownKeys(Object(source)).forEach(function (key) {
75
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
76
+ });
58
77
  }
59
-
60
- ownKeys.forEach(function (key) {
61
- _defineProperty(target, key, source[key]);
62
- });
63
78
  }
64
79
 
65
80
  return target;
@@ -112,9 +127,7 @@ function _possibleConstructorReturn(self, call) {
112
127
  return _assertThisInitialized(self);
113
128
  }
114
129
 
115
- var Pane =
116
- /*#__PURE__*/
117
- function (_React$PureComponent) {
130
+ var Pane = /*#__PURE__*/function (_React$PureComponent) {
118
131
  _inherits(Pane, _React$PureComponent);
119
132
 
120
133
  function Pane() {
@@ -175,9 +188,7 @@ Pane.defaultProps = {};
175
188
 
176
189
  var RESIZER_DEFAULT_CLASSNAME = 'Resizer';
177
190
 
178
- var Resizer =
179
- /*#__PURE__*/
180
- function (_React$Component) {
191
+ var Resizer = /*#__PURE__*/function (_React$Component) {
181
192
  _inherits(Resizer, _React$Component);
182
193
 
183
194
  function Resizer() {
@@ -283,9 +294,7 @@ function removeNullChildren(children) {
283
294
  });
284
295
  }
285
296
 
286
- var SplitPane =
287
- /*#__PURE__*/
288
- function (_React$Component) {
297
+ var SplitPane = /*#__PURE__*/function (_React$Component) {
289
298
  _inherits(SplitPane, _React$Component);
290
299
 
291
300
  function SplitPane(props) {
@@ -294,11 +303,11 @@ function (_React$Component) {
294
303
  _classCallCheck(this, SplitPane);
295
304
 
296
305
  _this = _possibleConstructorReturn(this, _getPrototypeOf(SplitPane).call(this, props));
297
- _this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
298
- _this.onTouchStart = _this.onTouchStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));
299
- _this.onMouseMove = _this.onMouseMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));
300
- _this.onTouchMove = _this.onTouchMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));
301
- _this.onMouseUp = _this.onMouseUp.bind(_assertThisInitialized(_assertThisInitialized(_this))); // order of setting panel sizes.
306
+ _this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_this));
307
+ _this.onTouchStart = _this.onTouchStart.bind(_assertThisInitialized(_this));
308
+ _this.onMouseMove = _this.onMouseMove.bind(_assertThisInitialized(_this));
309
+ _this.onTouchMove = _this.onTouchMove.bind(_assertThisInitialized(_this));
310
+ _this.onMouseUp = _this.onMouseUp.bind(_assertThisInitialized(_this)); // order of setting panel sizes.
302
311
  // 1. size
303
312
  // 2. getDefaultSize(defaultSize, minsize, maxSize)
304
313
 
@@ -512,7 +521,7 @@ function (_React$Component) {
512
521
  var resizerClassNamesIncludingDefault = resizerClassName ? "".concat(resizerClassName, " ").concat(RESIZER_DEFAULT_CLASSNAME) : resizerClassName;
513
522
  var notNullChildren = removeNullChildren(children);
514
523
 
515
- var style = _objectSpread({
524
+ var style = _objectSpread2({
516
525
  display: 'flex',
517
526
  flex: 1,
518
527
  height: '100%',
@@ -543,9 +552,9 @@ function (_React$Component) {
543
552
 
544
553
  var classes = ['SplitPane', className, split, disabledClass];
545
554
 
546
- var pane1Style = _objectSpread({}, paneStyle, pane1StyleProps);
555
+ var pane1Style = _objectSpread2({}, paneStyle, {}, pane1StyleProps);
547
556
 
548
- var pane2Style = _objectSpread({}, paneStyle, pane2StyleProps);
557
+ var pane2Style = _objectSpread2({}, paneStyle, {}, pane2StyleProps);
549
558
 
550
559
  var pane1Classes = ['Pane1', paneClassName, pane1ClassName].join(' ');
551
560
  var pane2Classes = ['Pane2', paneClassName, pane2ClassName].join(' ');
@@ -658,5 +667,5 @@ SplitPane.defaultProps = {
658
667
  };
659
668
  reactLifecyclesCompat.polyfill(SplitPane);
660
669
 
661
- exports.default = SplitPane;
662
670
  exports.Pane = Pane;
671
+ exports.default = SplitPane;
package/dist/index.esm.js CHANGED
@@ -40,20 +40,35 @@ function _defineProperty(obj, key, value) {
40
40
  return obj;
41
41
  }
42
42
 
43
- function _objectSpread(target) {
43
+ function ownKeys(object, enumerableOnly) {
44
+ var keys = Object.keys(object);
45
+
46
+ if (Object.getOwnPropertySymbols) {
47
+ var symbols = Object.getOwnPropertySymbols(object);
48
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
49
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
50
+ });
51
+ keys.push.apply(keys, symbols);
52
+ }
53
+
54
+ return keys;
55
+ }
56
+
57
+ function _objectSpread2(target) {
44
58
  for (var i = 1; i < arguments.length; i++) {
45
59
  var source = arguments[i] != null ? arguments[i] : {};
46
- var ownKeys = Object.keys(source);
47
60
 
48
- if (typeof Object.getOwnPropertySymbols === 'function') {
49
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
50
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
51
- }));
61
+ if (i % 2) {
62
+ ownKeys(Object(source), true).forEach(function (key) {
63
+ _defineProperty(target, key, source[key]);
64
+ });
65
+ } else if (Object.getOwnPropertyDescriptors) {
66
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
67
+ } else {
68
+ ownKeys(Object(source)).forEach(function (key) {
69
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
70
+ });
52
71
  }
53
-
54
- ownKeys.forEach(function (key) {
55
- _defineProperty(target, key, source[key]);
56
- });
57
72
  }
58
73
 
59
74
  return target;
@@ -106,9 +121,7 @@ function _possibleConstructorReturn(self, call) {
106
121
  return _assertThisInitialized(self);
107
122
  }
108
123
 
109
- var Pane =
110
- /*#__PURE__*/
111
- function (_React$PureComponent) {
124
+ var Pane = /*#__PURE__*/function (_React$PureComponent) {
112
125
  _inherits(Pane, _React$PureComponent);
113
126
 
114
127
  function Pane() {
@@ -169,9 +182,7 @@ Pane.defaultProps = {};
169
182
 
170
183
  var RESIZER_DEFAULT_CLASSNAME = 'Resizer';
171
184
 
172
- var Resizer =
173
- /*#__PURE__*/
174
- function (_React$Component) {
185
+ var Resizer = /*#__PURE__*/function (_React$Component) {
175
186
  _inherits(Resizer, _React$Component);
176
187
 
177
188
  function Resizer() {
@@ -277,9 +288,7 @@ function removeNullChildren(children) {
277
288
  });
278
289
  }
279
290
 
280
- var SplitPane =
281
- /*#__PURE__*/
282
- function (_React$Component) {
291
+ var SplitPane = /*#__PURE__*/function (_React$Component) {
283
292
  _inherits(SplitPane, _React$Component);
284
293
 
285
294
  function SplitPane(props) {
@@ -288,11 +297,11 @@ function (_React$Component) {
288
297
  _classCallCheck(this, SplitPane);
289
298
 
290
299
  _this = _possibleConstructorReturn(this, _getPrototypeOf(SplitPane).call(this, props));
291
- _this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
292
- _this.onTouchStart = _this.onTouchStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));
293
- _this.onMouseMove = _this.onMouseMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));
294
- _this.onTouchMove = _this.onTouchMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));
295
- _this.onMouseUp = _this.onMouseUp.bind(_assertThisInitialized(_assertThisInitialized(_this))); // order of setting panel sizes.
300
+ _this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_this));
301
+ _this.onTouchStart = _this.onTouchStart.bind(_assertThisInitialized(_this));
302
+ _this.onMouseMove = _this.onMouseMove.bind(_assertThisInitialized(_this));
303
+ _this.onTouchMove = _this.onTouchMove.bind(_assertThisInitialized(_this));
304
+ _this.onMouseUp = _this.onMouseUp.bind(_assertThisInitialized(_this)); // order of setting panel sizes.
296
305
  // 1. size
297
306
  // 2. getDefaultSize(defaultSize, minsize, maxSize)
298
307
 
@@ -506,7 +515,7 @@ function (_React$Component) {
506
515
  var resizerClassNamesIncludingDefault = resizerClassName ? "".concat(resizerClassName, " ").concat(RESIZER_DEFAULT_CLASSNAME) : resizerClassName;
507
516
  var notNullChildren = removeNullChildren(children);
508
517
 
509
- var style = _objectSpread({
518
+ var style = _objectSpread2({
510
519
  display: 'flex',
511
520
  flex: 1,
512
521
  height: '100%',
@@ -537,9 +546,9 @@ function (_React$Component) {
537
546
 
538
547
  var classes = ['SplitPane', className, split, disabledClass];
539
548
 
540
- var pane1Style = _objectSpread({}, paneStyle, pane1StyleProps);
549
+ var pane1Style = _objectSpread2({}, paneStyle, {}, pane1StyleProps);
541
550
 
542
- var pane2Style = _objectSpread({}, paneStyle, pane2StyleProps);
551
+ var pane2Style = _objectSpread2({}, paneStyle, {}, pane2StyleProps);
543
552
 
544
553
  var pane1Classes = ['Pane1', paneClassName, pane1ClassName].join(' ');
545
554
  var pane2Classes = ['Pane2', paneClassName, pane2ClassName].join(' ');
package/index.d.ts CHANGED
@@ -2,9 +2,9 @@ import * as React from 'react';
2
2
 
3
3
  export type Size = string | number;
4
4
 
5
- type Partial<T> = { [P in keyof T]?: T[P] };
5
+ export type Split = 'vertical' | 'horizontal';
6
6
 
7
- export interface Props {
7
+ export type SplitPaneProps = {
8
8
  allowResize?: boolean;
9
9
  className?: string;
10
10
  primary?: 'first' | 'second';
@@ -25,14 +25,17 @@ export interface Props {
25
25
  pane2Style?: React.CSSProperties;
26
26
  resizerClassName?: string;
27
27
  step?: number;
28
- }
28
+ };
29
29
 
30
- export interface State {
30
+ export type SplitPaneState = {
31
31
  active: boolean;
32
32
  resized: boolean;
33
- }
33
+ };
34
34
 
35
- declare class SplitPane extends React.Component<Props, State> {
35
+ declare class SplitPane extends React.Component<
36
+ SplitPaneProps,
37
+ SplitPaneState
38
+ > {
36
39
  constructor();
37
40
 
38
41
  onMouseDown(event: MouseEvent): void;
@@ -45,9 +48,24 @@ declare class SplitPane extends React.Component<Props, State> {
45
48
 
46
49
  onMouseUp(): void;
47
50
 
48
- static getSizeUpdate(props: Props, state: State): Partial<State>;
51
+ static getSizeUpdate(
52
+ props: SplitPaneProps,
53
+ state: SplitPaneState
54
+ ): Partial<SplitPaneState>;
49
55
 
50
- static defaultProps: Props;
56
+ static defaultProps: SplitPaneProps;
51
57
  }
52
58
 
53
59
  export default SplitPane;
60
+
61
+ export type PaneProps = {
62
+ className?: string;
63
+ size?: Size;
64
+ split?: Split;
65
+ style?: React.CSSProperties;
66
+ eleRef?: (el: HTMLDivElement) => void;
67
+ };
68
+
69
+ declare class Pane extends React.PureComponent<PaneProps> {}
70
+
71
+ export { Pane };
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "dist",
10
10
  "index.d.ts"
11
11
  ],
12
- "version": "0.1.89",
12
+ "version": "0.1.91",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "https://github.com/tomkp/react-split-pane"
@@ -36,13 +36,12 @@
36
36
  "clean:website": "rimraf build",
37
37
  "prebuild:website": "yarn run clean:website",
38
38
  "build:website": "parcel build website/index.html -d build --public-url /react-split-pane/",
39
- "test": "mochify -R spec --transform babelify",
40
- "test:watch": "mochify -R spec --watch --transform babelify",
41
- "test:coverage": "mochify --plugin [ mochify-istanbul --exclude '**/test/**' --report lcovonly ] --transform babelify && cat lcov.info | coveralls && rm lcov.info",
39
+ "test": "BABEL_ENV=test mochify -R spec --transform babelify",
40
+ "test:watch": "BABEL_ENV=test mochify -R spec --watch --transform babelify",
41
+ "test:coverage": "BABEL_ENV=test mochify --plugin [ mochify-istanbul --exclude '**/test/**' --report lcovonly ] --transform babelify && cat lcov.info | coveralls && rm lcov.info",
42
42
  "prettier": "prettier --write '{src,test}/**/*.js'",
43
43
  "lint": "eslint src test",
44
44
  "release": "standard-version",
45
- "precommit": "lint-staged",
46
45
  "deploy": "gh-pages -d build",
47
46
  "prepublishOnly": "yarn run test && yarn run build"
48
47
  },
@@ -52,48 +51,49 @@
52
51
  }
53
52
  },
54
53
  "dependencies": {
55
- "prop-types": "^15.5.10",
54
+ "prop-types": "^15.7.2",
56
55
  "react-lifecycles-compat": "^3.0.4",
57
- "react-style-proptype": "^3.0.0"
56
+ "react-style-proptype": "^3.2.2"
58
57
  },
59
58
  "devDependencies": {
60
- "@babel/core": "^7.2.0",
61
- "@babel/preset-env": "^7.2.0",
62
- "@babel/preset-react": "^7.0.0",
59
+ "@babel/core": "^7.7.2",
60
+ "@babel/plugin-transform-modules-commonjs": "^7.7.0",
61
+ "@babel/preset-env": "^7.7.1",
62
+ "@babel/preset-react": "^7.7.0",
63
63
  "@emotion/core": "^10.0.22",
64
64
  "@emotion/styled": "^10.0.23",
65
- "@types/react": "^16.0.36",
66
- "babel-eslint": "^10.0.1",
65
+ "@types/react": "^16.9.11",
66
+ "babel-eslint": "^10.0.3",
67
67
  "babelify": "^10.0.0",
68
- "chai": "^4.0.2",
69
- "chai-spies": "^0.7.1",
70
- "coveralls": "^2.13.1",
71
- "cross-env": "^5.2.0",
72
- "eslint": "^4.19.1",
73
- "eslint-config-fbjs": "^2.1.0",
68
+ "chai": "^4.2.0",
69
+ "chai-spies": "^1.0.0",
70
+ "coveralls": "^3.0.7",
71
+ "cross-env": "^7.0.0",
72
+ "eslint": "^6.6.0",
73
+ "eslint-config-fbjs": "^3.1.1",
74
74
  "eslint-config-prettier": "^6.5.0",
75
75
  "eslint-config-react": "^1.1.7",
76
76
  "eslint-plugin-babel": "^5.1.0",
77
- "eslint-plugin-flowtype": "^2.49.3",
78
- "eslint-plugin-jsx-a11y": "^6.0.3",
79
- "eslint-plugin-prettier": "^2.6.0",
80
- "eslint-plugin-react": "^7.9.1",
81
- "eslint-plugin-relay": "^0.0.28",
77
+ "eslint-plugin-flowtype": "^4.3.0",
78
+ "eslint-plugin-jsx-a11y": "^6.2.3",
79
+ "eslint-plugin-prettier": "^3.1.1",
80
+ "eslint-plugin-react": "^7.16.0",
81
+ "eslint-plugin-relay": "^1.3.12",
82
82
  "gh-pages": "^2.1.1",
83
- "husky": "^1.2.0",
84
- "mochify": "^5.8.0",
83
+ "husky": "^4.2.3",
84
+ "mochify": "^6.6.0",
85
85
  "mochify-istanbul": "^2.4.2",
86
86
  "parcel-bundler": "^1.12.4",
87
- "prettier": "1.15.3",
88
- "pretty-quick": "^1.8.0",
87
+ "prettier": "1.19.1",
88
+ "pretty-quick": "^2.0.1",
89
89
  "react": ">=15",
90
90
  "react-dom": "^16.0.0-0",
91
91
  "react-router-dom": "^5.1.2",
92
- "rimraf": "^2.6.2",
93
- "rollup": "^0.68.2",
94
- "rollup-plugin-babel": "^4.0.3",
95
- "rollup-plugin-commonjs": "^9.1.3",
96
- "rollup-plugin-node-resolve": "^4.2.4",
92
+ "rimraf": "^3.0.0",
93
+ "rollup": "^1.26.5",
94
+ "rollup-plugin-babel": "^4.3.3",
95
+ "rollup-plugin-commonjs": "^10.1.0",
96
+ "rollup-plugin-node-resolve": "^5.2.0",
97
97
  "standard-version": "^7.0.0"
98
98
  },
99
99
  "peerDependencies": {