@enact/core 3.2.3 → 3.2.7
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 +16 -0
- package/handle/handle.d.ts +6 -6
- package/handle/tests/handle-specs.js +3 -1
- package/hoc/hoc.d.ts +2 -1
- package/hoc/tests/hoc-specs.js +11 -11
- package/internal/ApiDecorator/ApiDecorator.js +12 -10
- package/internal/ApiDecorator/tests/ApiDecorator-specs.js +16 -12
- package/internal/Registry/tests/Registry-specs.js +30 -30
- package/internal/prop-types/prop-types.js +1 -1
- package/keymap/tests/keymap-specs.js +5 -1
- package/kind/kind.js +13 -7
- package/kind/tests/kind-specs.js +7 -7
- package/kind/tests/styles-specs.js +1 -1
- package/package.json +1 -1
- package/platform/platform.js +12 -6
- package/snapshot/snapshot.d.ts +4 -2
- package/util/Job.js +1 -3
- package/util/util.d.ts +5 -5
- package/util/util.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
The following is a curated list of changes in the Enact core module, newest changes on the top.
|
|
4
4
|
|
|
5
|
+
## [3.2.7] - 2022-01-17
|
|
6
|
+
|
|
7
|
+
No significant changes.
|
|
8
|
+
|
|
9
|
+
## [3.2.6] - 2020-03-26
|
|
10
|
+
|
|
11
|
+
No significant changes.
|
|
12
|
+
|
|
13
|
+
## [3.2.5] - 2019-11-14
|
|
14
|
+
|
|
15
|
+
No significant changes.
|
|
16
|
+
|
|
17
|
+
## [3.2.4] - 2019-11-07
|
|
18
|
+
|
|
19
|
+
No significant changes.
|
|
20
|
+
|
|
5
21
|
## [3.2.3] - 2019-11-01
|
|
6
22
|
|
|
7
23
|
No significant changes.
|
package/handle/handle.d.ts
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
4
4
|
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The signature for event handlers
|
|
8
|
+
*/
|
|
9
|
+
export interface EventHandler {
|
|
10
|
+
(event: any): void;
|
|
11
|
+
}
|
|
6
12
|
/**
|
|
7
13
|
* The signature for event handling functions supported by `handle` and related functions
|
|
8
14
|
*/
|
|
@@ -23,12 +29,6 @@ export interface EventAdapter {
|
|
|
23
29
|
context: { [key: string]: any }
|
|
24
30
|
): any;
|
|
25
31
|
}
|
|
26
|
-
/**
|
|
27
|
-
* The signature for event handlers
|
|
28
|
-
*/
|
|
29
|
-
export interface EventHandler {
|
|
30
|
-
(event: any): void;
|
|
31
|
-
}
|
|
32
32
|
/**
|
|
33
33
|
* Allows generating event handlers by chaining input functions to filter or short-circuit the
|
|
34
34
|
handling flow. Any input function that returns a falsy value will stop the chain.
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var _handle = require("../handle");
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
8
|
|
|
7
9
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
10
|
|
package/hoc/hoc.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ a factory method that accepts instance configuration parameters and a component
|
|
|
9
9
|
returned function can accept:
|
|
10
10
|
* * an instance config and a component constructor to wrap and return a renderable component, or
|
|
11
11
|
* * an instance config only and return a decorator function expecting a component constructor
|
|
12
|
-
|
|
12
|
+
*
|
|
13
|
+
* (like the next bullet), or
|
|
13
14
|
* * a component constructor and return a renderable component
|
|
14
15
|
*
|
|
15
16
|
* Example:
|
package/hoc/tests/hoc-specs.js
CHANGED
|
@@ -15,47 +15,47 @@ describe('hoc', function () {
|
|
|
15
15
|
};
|
|
16
16
|
var HoC = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
17
17
|
return function (props) {
|
|
18
|
-
return _react["default"].createElement(Wrapped, Object.assign({}, props, config));
|
|
18
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, Object.assign({}, props, config));
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
var NullHoC = (0, _hoc["default"])(null, function (config, Wrapped) {
|
|
22
22
|
return function () {
|
|
23
|
-
return _react["default"].createElement(Wrapped, config);
|
|
23
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, config);
|
|
24
24
|
};
|
|
25
25
|
});
|
|
26
26
|
test('should support HoC factory function as first argument to hoc()', function () {
|
|
27
27
|
var ImplicitNullHoC = (0, _hoc["default"])(function (config, Wrapped) {
|
|
28
28
|
return function () {
|
|
29
|
-
return _react["default"].createElement(Wrapped, config);
|
|
29
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, config);
|
|
30
30
|
};
|
|
31
31
|
});
|
|
32
32
|
var Component = ImplicitNullHoC('span');
|
|
33
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(Component, null));
|
|
33
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
34
34
|
var expected = 'span';
|
|
35
35
|
var actual = subject.name();
|
|
36
36
|
expect(actual).toBe(expected);
|
|
37
37
|
});
|
|
38
38
|
test('should support DOM node name as first argument to HoC', function () {
|
|
39
39
|
var Component = HoC('span');
|
|
40
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(Component, null));
|
|
40
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
41
41
|
var expected = 'span';
|
|
42
42
|
var actual = subject.name();
|
|
43
43
|
expect(actual).toBe(expected);
|
|
44
44
|
});
|
|
45
45
|
test('should support React component as first argument to HoC', function () {
|
|
46
46
|
function Thing() {
|
|
47
|
-
return _react["default"].createElement("div", null);
|
|
47
|
+
return /*#__PURE__*/_react["default"].createElement("div", null);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
var Component = HoC(Thing);
|
|
51
|
-
var subject = (0, _enzyme.shallow)(_react["default"].createElement(Component, null));
|
|
51
|
+
var subject = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
52
52
|
var expected = 'Thing';
|
|
53
53
|
var actual = subject.name();
|
|
54
54
|
expect(actual).toBe(expected);
|
|
55
55
|
});
|
|
56
56
|
test('should use default config when instance config is omitted', function () {
|
|
57
57
|
var Component = HoC('span');
|
|
58
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
58
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
59
59
|
var expected = defaultConfig.color;
|
|
60
60
|
var actual = subject.find('span').prop('color');
|
|
61
61
|
expect(actual).toBe(expected);
|
|
@@ -65,14 +65,14 @@ describe('hoc', function () {
|
|
|
65
65
|
color: 'green'
|
|
66
66
|
};
|
|
67
67
|
var Component = HoC(instanceConfig, 'div');
|
|
68
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
68
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
69
69
|
var expected = instanceConfig.color;
|
|
70
70
|
var actual = subject.find('div').prop('color');
|
|
71
71
|
expect(actual).toBe(expected);
|
|
72
72
|
});
|
|
73
73
|
test('should allow construction without default or instance configs', function () {
|
|
74
74
|
var Component = NullHoC('div');
|
|
75
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
75
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
76
76
|
var expected = 1;
|
|
77
77
|
var actual = subject.find('div').length;
|
|
78
78
|
expect(actual).toBe(expected);
|
|
@@ -82,7 +82,7 @@ describe('hoc', function () {
|
|
|
82
82
|
color: 'green'
|
|
83
83
|
};
|
|
84
84
|
var Component = NullHoC(instanceConfig, 'div');
|
|
85
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
85
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
86
86
|
var expected = instanceConfig.color;
|
|
87
87
|
var actual = subject.find('div').prop('color');
|
|
88
88
|
expect(actual).toBe(expected);
|
|
@@ -13,7 +13,7 @@ var _hoc = _interopRequireDefault(require("../../hoc"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
15
|
|
|
16
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
16
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
17
17
|
|
|
18
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
19
|
|
|
@@ -21,12 +21,16 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
21
21
|
|
|
22
22
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
27
27
|
|
|
28
28
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
29
|
|
|
30
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
+
|
|
32
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
+
|
|
30
34
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
35
|
|
|
32
36
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
@@ -94,14 +98,12 @@ var ApiDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped
|
|
|
94
98
|
|
|
95
99
|
var api = config.api;
|
|
96
100
|
!(api != null) ? process.env.NODE_ENV !== "production" ? (0, _invariant["default"])(false, 'ApiDecorator: api is a required config property') : invariant(false) : void 0;
|
|
97
|
-
return _temp = _class =
|
|
98
|
-
/*#__PURE__*/
|
|
99
|
-
function (_React$Component) {
|
|
101
|
+
return _temp = _class = /*#__PURE__*/function (_React$Component) {
|
|
100
102
|
_inherits(_class, _React$Component);
|
|
101
103
|
|
|
102
|
-
|
|
103
|
-
var _getPrototypeOf2;
|
|
104
|
+
var _super = _createSuper(_class);
|
|
104
105
|
|
|
106
|
+
function _class() {
|
|
105
107
|
var _this;
|
|
106
108
|
|
|
107
109
|
_classCallCheck(this, _class);
|
|
@@ -110,7 +112,7 @@ var ApiDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped
|
|
|
110
112
|
args[_key] = arguments[_key];
|
|
111
113
|
}
|
|
112
114
|
|
|
113
|
-
_this =
|
|
115
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
114
116
|
|
|
115
117
|
_this.setProvider = function (provider) {
|
|
116
118
|
api.forEach(function (key) {
|
|
@@ -129,7 +131,7 @@ var ApiDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped
|
|
|
129
131
|
_createClass(_class, [{
|
|
130
132
|
key: "render",
|
|
131
133
|
value: function render() {
|
|
132
|
-
return _react["default"].createElement(Wrapped, Object.assign({
|
|
134
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, Object.assign({
|
|
133
135
|
setApiProvider: this.setProvider
|
|
134
136
|
}, this.props));
|
|
135
137
|
}
|
|
@@ -8,7 +8,7 @@ var _ApiDecorator = _interopRequireDefault(require("../ApiDecorator"));
|
|
|
8
8
|
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
10
|
|
|
11
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
11
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
12
12
|
|
|
13
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
14
|
|
|
@@ -16,12 +16,16 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
16
16
|
|
|
17
17
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
18
18
|
|
|
19
|
-
function
|
|
19
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
20
|
|
|
21
|
-
function
|
|
21
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
22
22
|
|
|
23
23
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
24
|
|
|
25
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
+
|
|
27
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
28
|
+
|
|
25
29
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
26
30
|
|
|
27
31
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
@@ -29,17 +33,17 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
29
33
|
describe('ApiDecorator', function () {
|
|
30
34
|
var _class, _temp;
|
|
31
35
|
|
|
32
|
-
var ApiProvider = (_temp = _class =
|
|
33
|
-
/*#__PURE__*/
|
|
34
|
-
function (_React$Component) {
|
|
36
|
+
var ApiProvider = (_temp = _class = /*#__PURE__*/function (_React$Component) {
|
|
35
37
|
_inherits(ApiProvider, _React$Component);
|
|
36
38
|
|
|
39
|
+
var _super = _createSuper(ApiProvider);
|
|
40
|
+
|
|
37
41
|
function ApiProvider(props) {
|
|
38
42
|
var _this;
|
|
39
43
|
|
|
40
44
|
_classCallCheck(this, ApiProvider);
|
|
41
45
|
|
|
42
|
-
_this =
|
|
46
|
+
_this = _super.call(this); // eslint-disable-next-line
|
|
43
47
|
|
|
44
48
|
_this.arrowFunction = function () {
|
|
45
49
|
return 'arrow';
|
|
@@ -58,7 +62,7 @@ describe('ApiDecorator', function () {
|
|
|
58
62
|
}, {
|
|
59
63
|
key: "render",
|
|
60
64
|
value: function render() {
|
|
61
|
-
return _react["default"].createElement("div", null);
|
|
65
|
+
return /*#__PURE__*/_react["default"].createElement("div", null);
|
|
62
66
|
}
|
|
63
67
|
}]);
|
|
64
68
|
|
|
@@ -68,7 +72,7 @@ describe('ApiDecorator', function () {
|
|
|
68
72
|
var Component = (0, _ApiDecorator["default"])({
|
|
69
73
|
api: ['arrowFunction']
|
|
70
74
|
}, ApiProvider);
|
|
71
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
75
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
72
76
|
var expected = 'arrow';
|
|
73
77
|
var actual = subject.instance().arrowFunction();
|
|
74
78
|
expect(actual).toBe(expected);
|
|
@@ -77,7 +81,7 @@ describe('ApiDecorator', function () {
|
|
|
77
81
|
var Component = (0, _ApiDecorator["default"])({
|
|
78
82
|
api: ['instanceFunction']
|
|
79
83
|
}, ApiProvider);
|
|
80
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
84
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
81
85
|
var expected = 'instance';
|
|
82
86
|
var actual = subject.instance().instanceFunction();
|
|
83
87
|
expect(actual).toBe(expected);
|
|
@@ -86,7 +90,7 @@ describe('ApiDecorator', function () {
|
|
|
86
90
|
var Component = (0, _ApiDecorator["default"])({
|
|
87
91
|
api: ['instanceProperty']
|
|
88
92
|
}, ApiProvider);
|
|
89
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
93
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
90
94
|
var expected = 'property';
|
|
91
95
|
var actual = subject.instance().instanceProperty;
|
|
92
96
|
expect(actual).toBe(expected);
|
|
@@ -95,7 +99,7 @@ describe('ApiDecorator', function () {
|
|
|
95
99
|
var Component = (0, _ApiDecorator["default"])({
|
|
96
100
|
api: ['instanceProperty']
|
|
97
101
|
}, ApiProvider);
|
|
98
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
102
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
99
103
|
subject.instance().instanceProperty = 'updated';
|
|
100
104
|
var expected = 'updated';
|
|
101
105
|
var actual = subject.instance().instanceProperty;
|
|
@@ -8,7 +8,7 @@ var _Registry = _interopRequireDefault(require("../Registry"));
|
|
|
8
8
|
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
10
|
|
|
11
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
11
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
12
12
|
|
|
13
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
14
|
|
|
@@ -16,10 +16,14 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
16
16
|
|
|
17
17
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
18
18
|
|
|
19
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
|
+
|
|
19
21
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
20
22
|
|
|
21
23
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
24
|
|
|
25
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
+
|
|
23
27
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
28
|
|
|
25
29
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
@@ -29,14 +33,12 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
29
33
|
var SomeContext = _react["default"].createContext();
|
|
30
34
|
|
|
31
35
|
describe('Registry', function () {
|
|
32
|
-
var NotifiesTree =
|
|
33
|
-
/*#__PURE__*/
|
|
34
|
-
function (_React$Component) {
|
|
36
|
+
var NotifiesTree = /*#__PURE__*/function (_React$Component) {
|
|
35
37
|
_inherits(NotifiesTree, _React$Component);
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
var _getPrototypeOf2;
|
|
39
|
+
var _super = _createSuper(NotifiesTree);
|
|
39
40
|
|
|
41
|
+
function NotifiesTree() {
|
|
40
42
|
var _this;
|
|
41
43
|
|
|
42
44
|
_classCallCheck(this, NotifiesTree);
|
|
@@ -45,7 +47,7 @@ describe('Registry', function () {
|
|
|
45
47
|
args[_key] = arguments[_key];
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
_this =
|
|
50
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
49
51
|
_this.registry = _Registry["default"].create();
|
|
50
52
|
|
|
51
53
|
_this.handleClick = function () {
|
|
@@ -63,9 +65,9 @@ describe('Registry', function () {
|
|
|
63
65
|
}, {
|
|
64
66
|
key: "render",
|
|
65
67
|
value: function render() {
|
|
66
|
-
return _react["default"].createElement(SomeContext.Provider, {
|
|
68
|
+
return /*#__PURE__*/_react["default"].createElement(SomeContext.Provider, {
|
|
67
69
|
value: this.registry.register
|
|
68
|
-
}, _react["default"].createElement("button", Object.assign({}, this.props, {
|
|
70
|
+
}, /*#__PURE__*/_react["default"].createElement("button", Object.assign({}, this.props, {
|
|
69
71
|
onClick: this.handleClick
|
|
70
72
|
}), "Notify!"), this.props.children);
|
|
71
73
|
}
|
|
@@ -76,14 +78,12 @@ describe('Registry', function () {
|
|
|
76
78
|
|
|
77
79
|
NotifiesTree.contextType = SomeContext;
|
|
78
80
|
|
|
79
|
-
var HandlesNotification =
|
|
80
|
-
/*#__PURE__*/
|
|
81
|
-
function (_React$Component2) {
|
|
81
|
+
var HandlesNotification = /*#__PURE__*/function (_React$Component2) {
|
|
82
82
|
_inherits(HandlesNotification, _React$Component2);
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
var _getPrototypeOf3;
|
|
84
|
+
var _super2 = _createSuper(HandlesNotification);
|
|
86
85
|
|
|
86
|
+
function HandlesNotification() {
|
|
87
87
|
var _this2;
|
|
88
88
|
|
|
89
89
|
_classCallCheck(this, HandlesNotification);
|
|
@@ -92,7 +92,7 @@ describe('Registry', function () {
|
|
|
92
92
|
args[_key2] = arguments[_key2];
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
_this2 =
|
|
95
|
+
_this2 = _super2.call.apply(_super2, [this].concat(args));
|
|
96
96
|
_this2.state = {
|
|
97
97
|
number: 0
|
|
98
98
|
};
|
|
@@ -126,7 +126,7 @@ describe('Registry', function () {
|
|
|
126
126
|
}, {
|
|
127
127
|
key: "render",
|
|
128
128
|
value: function render() {
|
|
129
|
-
return _react["default"].createElement("div", this.props, this.state.number);
|
|
129
|
+
return /*#__PURE__*/_react["default"].createElement("div", this.props, this.state.number);
|
|
130
130
|
}
|
|
131
131
|
}]);
|
|
132
132
|
|
|
@@ -135,9 +135,9 @@ describe('Registry', function () {
|
|
|
135
135
|
|
|
136
136
|
HandlesNotification.contextType = SomeContext;
|
|
137
137
|
test('should increment child on click', function () {
|
|
138
|
-
var RegistryApp = (0, _enzyme.mount)(_react["default"].createElement(NotifiesTree, {
|
|
138
|
+
var RegistryApp = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(NotifiesTree, {
|
|
139
139
|
id: "a-btn"
|
|
140
|
-
}, _react["default"].createElement(HandlesNotification, {
|
|
140
|
+
}, /*#__PURE__*/_react["default"].createElement(HandlesNotification, {
|
|
141
141
|
id: "a"
|
|
142
142
|
})));
|
|
143
143
|
RegistryApp.find('button#a-btn').simulate('click');
|
|
@@ -146,13 +146,13 @@ describe('Registry', function () {
|
|
|
146
146
|
expect(expected).toBe(actual);
|
|
147
147
|
});
|
|
148
148
|
test('should increment both children on top click', function () {
|
|
149
|
-
var RegistryApp = (0, _enzyme.mount)(_react["default"].createElement(NotifiesTree, {
|
|
149
|
+
var RegistryApp = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(NotifiesTree, {
|
|
150
150
|
id: "a-btn"
|
|
151
|
-
}, _react["default"].createElement(HandlesNotification, {
|
|
151
|
+
}, /*#__PURE__*/_react["default"].createElement(HandlesNotification, {
|
|
152
152
|
id: "a"
|
|
153
|
-
}), _react["default"].createElement(NotifiesTree, {
|
|
153
|
+
}), /*#__PURE__*/_react["default"].createElement(NotifiesTree, {
|
|
154
154
|
id: "b-btn"
|
|
155
|
-
}, _react["default"].createElement(HandlesNotification, {
|
|
155
|
+
}, /*#__PURE__*/_react["default"].createElement(HandlesNotification, {
|
|
156
156
|
id: "b"
|
|
157
157
|
}))));
|
|
158
158
|
RegistryApp.find('button#a-btn').simulate('click');
|
|
@@ -163,13 +163,13 @@ describe('Registry', function () {
|
|
|
163
163
|
expect(expected).toBe(actualB);
|
|
164
164
|
});
|
|
165
165
|
test('should increment the deepest child when we click child button', function () {
|
|
166
|
-
var RegistryApp = (0, _enzyme.mount)(_react["default"].createElement(NotifiesTree, {
|
|
166
|
+
var RegistryApp = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(NotifiesTree, {
|
|
167
167
|
id: "a-btn"
|
|
168
|
-
}, _react["default"].createElement(HandlesNotification, {
|
|
168
|
+
}, /*#__PURE__*/_react["default"].createElement(HandlesNotification, {
|
|
169
169
|
id: "a"
|
|
170
|
-
}), _react["default"].createElement(NotifiesTree, {
|
|
170
|
+
}), /*#__PURE__*/_react["default"].createElement(NotifiesTree, {
|
|
171
171
|
id: "b-btn"
|
|
172
|
-
}, _react["default"].createElement(HandlesNotification, {
|
|
172
|
+
}, /*#__PURE__*/_react["default"].createElement(HandlesNotification, {
|
|
173
173
|
id: "b"
|
|
174
174
|
}))));
|
|
175
175
|
RegistryApp.find('button#b-btn').simulate('click');
|
|
@@ -181,17 +181,17 @@ describe('Registry', function () {
|
|
|
181
181
|
expect(expectedB).toBe(actualB);
|
|
182
182
|
});
|
|
183
183
|
test('should support removing children without error', function () {
|
|
184
|
-
var RegistryApp = (0, _enzyme.mount)(_react["default"].createElement(NotifiesTree, {
|
|
184
|
+
var RegistryApp = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(NotifiesTree, {
|
|
185
185
|
id: "a-btn"
|
|
186
|
-
}, _react["default"].createElement(HandlesNotification, {
|
|
186
|
+
}, /*#__PURE__*/_react["default"].createElement(HandlesNotification, {
|
|
187
187
|
id: "a"
|
|
188
|
-
}), _react["default"].createElement(HandlesNotification, {
|
|
188
|
+
}), /*#__PURE__*/_react["default"].createElement(HandlesNotification, {
|
|
189
189
|
id: "b"
|
|
190
190
|
})));
|
|
191
191
|
RegistryApp.find('button#a-btn').simulate('click'); // changing children should be safe and not throw errors when notifying instances
|
|
192
192
|
|
|
193
193
|
RegistryApp.setProps({
|
|
194
|
-
children: _react["default"].createElement(HandlesNotification, {
|
|
194
|
+
children: /*#__PURE__*/_react["default"].createElement(HandlesNotification, {
|
|
195
195
|
id: "c"
|
|
196
196
|
})
|
|
197
197
|
});
|
|
@@ -13,7 +13,7 @@ var _deprecate = _interopRequireDefault(require("../deprecate"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
15
|
|
|
16
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
16
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
17
17
|
|
|
18
18
|
var isRequired = function isRequired(fn) {
|
|
19
19
|
fn.isRequired = function (props, key, componentName, location, propFullName) {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
var keymap = _interopRequireWildcard(require("../"));
|
|
4
6
|
|
|
5
|
-
function
|
|
7
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
8
|
+
|
|
9
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
6
10
|
|
|
7
11
|
describe('keymap', function () {
|
|
8
12
|
test('should support adding single keyCodes for a name', function () {
|
package/kind/kind.js
CHANGED
|
@@ -13,9 +13,11 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
15
|
|
|
16
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
16
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
17
17
|
|
|
18
|
-
function
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
21
|
|
|
20
22
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
23
|
|
|
@@ -25,10 +27,14 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
25
27
|
|
|
26
28
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
27
29
|
|
|
30
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
+
|
|
28
32
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
29
33
|
|
|
30
34
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
31
35
|
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
|
|
32
38
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
39
|
|
|
34
40
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
@@ -159,17 +165,17 @@ var kind = function kind(config) {
|
|
|
159
165
|
}; // addition prop decorations would be chained here (after config.render)
|
|
160
166
|
|
|
161
167
|
|
|
162
|
-
var Component = (_temp = _class =
|
|
163
|
-
/*#__PURE__*/
|
|
164
|
-
function (_React$Component) {
|
|
168
|
+
var Component = (_temp = _class = /*#__PURE__*/function (_React$Component) {
|
|
165
169
|
_inherits(Component, _React$Component);
|
|
166
170
|
|
|
171
|
+
var _super = _createSuper(Component);
|
|
172
|
+
|
|
167
173
|
function Component() {
|
|
168
174
|
var _this;
|
|
169
175
|
|
|
170
176
|
_classCallCheck(this, Component);
|
|
171
177
|
|
|
172
|
-
_this =
|
|
178
|
+
_this = _super.call(this);
|
|
173
179
|
_this.handlers = {}; // cache bound function for each handler
|
|
174
180
|
|
|
175
181
|
if (handlers) {
|
|
@@ -202,7 +208,7 @@ var kind = function kind(config) {
|
|
|
202
208
|
}, {
|
|
203
209
|
key: "render",
|
|
204
210
|
value: function render() {
|
|
205
|
-
return renderKind(_objectSpread({}, this.props, this.handlers), this.context);
|
|
211
|
+
return renderKind(_objectSpread({}, this.props, {}, this.handlers), this.context);
|
|
206
212
|
}
|
|
207
213
|
}]);
|
|
208
214
|
|
package/kind/tests/kind-specs.js
CHANGED
|
@@ -10,7 +10,7 @@ var _kind = _interopRequireDefault(require("../kind"));
|
|
|
10
10
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
12
|
|
|
13
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
13
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
14
14
|
|
|
15
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
16
|
|
|
@@ -47,7 +47,7 @@ describe('kind', function () {
|
|
|
47
47
|
rest = _objectWithoutProperties(_ref2, ["label", "value"]);
|
|
48
48
|
|
|
49
49
|
delete rest.prop;
|
|
50
|
-
return _react["default"].createElement("div", Object.assign({}, rest, {
|
|
50
|
+
return /*#__PURE__*/_react["default"].createElement("div", Object.assign({}, rest, {
|
|
51
51
|
title: label
|
|
52
52
|
}), value);
|
|
53
53
|
}
|
|
@@ -58,7 +58,7 @@ describe('kind', function () {
|
|
|
58
58
|
expect(actual).toBe(expected);
|
|
59
59
|
});
|
|
60
60
|
test('should default {label} property', function () {
|
|
61
|
-
var subject = _react["default"].createElement(Kind, {
|
|
61
|
+
var subject = /*#__PURE__*/_react["default"].createElement(Kind, {
|
|
62
62
|
prop: 1
|
|
63
63
|
});
|
|
64
64
|
|
|
@@ -69,7 +69,7 @@ describe('kind', function () {
|
|
|
69
69
|
test('should default {label} property when explicitly undefined', function () {
|
|
70
70
|
// Explicitly testing for undefined
|
|
71
71
|
// eslint-disable-next-line no-undefined
|
|
72
|
-
var subject = _react["default"].createElement(Kind, {
|
|
72
|
+
var subject = /*#__PURE__*/_react["default"].createElement(Kind, {
|
|
73
73
|
prop: 1,
|
|
74
74
|
label: undefined
|
|
75
75
|
});
|
|
@@ -79,7 +79,7 @@ describe('kind', function () {
|
|
|
79
79
|
expect(actual).toBe(expected);
|
|
80
80
|
});
|
|
81
81
|
test('should add className defined in styles', function () {
|
|
82
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Kind, {
|
|
82
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Kind, {
|
|
83
83
|
prop: 1
|
|
84
84
|
}));
|
|
85
85
|
var expected = 'kind';
|
|
@@ -87,7 +87,7 @@ describe('kind', function () {
|
|
|
87
87
|
expect(actual).toBe(expected);
|
|
88
88
|
});
|
|
89
89
|
test('should compute {value} property', function () {
|
|
90
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Kind, {
|
|
90
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Kind, {
|
|
91
91
|
prop: 1
|
|
92
92
|
}));
|
|
93
93
|
var expected = 2;
|
|
@@ -104,7 +104,7 @@ describe('kind', function () {
|
|
|
104
104
|
var Minimal = (0, _kind["default"])({
|
|
105
105
|
name: 'Minimal',
|
|
106
106
|
render: function render() {
|
|
107
|
-
return _react["default"].createElement("div", null);
|
|
107
|
+
return /*#__PURE__*/_react["default"].createElement("div", null);
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
var component = Minimal.inline();
|
|
@@ -4,7 +4,7 @@ var _styles = _interopRequireDefault(require("../styles"));
|
|
|
4
4
|
|
|
5
5
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
6
6
|
|
|
7
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
7
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
8
8
|
|
|
9
9
|
describe('styles', function () {
|
|
10
10
|
var css = {
|
package/package.json
CHANGED
package/platform/platform.js
CHANGED
|
@@ -9,15 +9,21 @@ var _uniq = _interopRequireDefault(require("ramda/src/uniq"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|
|
12
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
12
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
13
13
|
|
|
14
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
14
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
15
|
|
|
16
|
-
function
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
17
|
|
|
18
|
-
function
|
|
18
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
19
19
|
|
|
20
|
-
function
|
|
20
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
21
|
+
|
|
22
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
23
|
+
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
27
|
|
|
22
28
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
29
|
|
|
@@ -221,7 +227,7 @@ var parseUserAgent = function parseUserAgent(userAgent) {
|
|
|
221
227
|
plat[p.platform] = v;
|
|
222
228
|
|
|
223
229
|
if (p.extra) {
|
|
224
|
-
plat = _objectSpread({}, plat, p.extra);
|
|
230
|
+
plat = _objectSpread({}, plat, {}, p.extra);
|
|
225
231
|
}
|
|
226
232
|
|
|
227
233
|
plat.platformName = p.platform;
|
package/snapshot/snapshot.d.ts
CHANGED
|
@@ -16,9 +16,11 @@ and is executed in order once the window is available.
|
|
|
16
16
|
*
|
|
17
17
|
* _Important Notes_
|
|
18
18
|
* * The callback should not alter the initial HTML state. If it does, it will invalidate the
|
|
19
|
-
|
|
19
|
+
*
|
|
20
|
+
* pre-render state and interfere with React rehydration.
|
|
20
21
|
* * The callback should be limited to module-scoped actions and not component instance actions. If
|
|
21
|
-
|
|
22
|
+
*
|
|
23
|
+
* the action is tied to a component, it should be invoked from within the component's lifecycle
|
|
22
24
|
methods.
|
|
23
25
|
*/
|
|
24
26
|
export function onWindowReady(callback: Function): void;
|
package/util/Job.js
CHANGED
|
@@ -22,9 +22,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
22
22
|
* @memberof core/util
|
|
23
23
|
* @public
|
|
24
24
|
*/
|
|
25
|
-
var Job =
|
|
26
|
-
/*#__PURE__*/
|
|
27
|
-
function () {
|
|
25
|
+
var Job = /*#__PURE__*/function () {
|
|
28
26
|
/**
|
|
29
27
|
* @constructor
|
|
30
28
|
* @param {Function} fn Function to execute as the requested job.
|
package/util/util.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
export declare class Job {
|
|
11
|
-
constructor
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
constructor
|
|
12
|
+
/**
|
|
13
|
+
* Function to execute as the requested job.
|
|
14
|
+
*/(
|
|
15
15
|
fn: Function
|
|
16
16
|
/**
|
|
17
17
|
* The number of milliseconds to wait before starting the job.
|
|
@@ -32,7 +32,7 @@ export declare class Job {
|
|
|
32
32
|
stop(): void;
|
|
33
33
|
/**
|
|
34
34
|
* Executes the job immediately, then prevents any other calls to `throttle()` from running
|
|
35
|
-
until the `timeout` configured at construction
|
|
35
|
+
until the `timeout` configured at construction passes.
|
|
36
36
|
*/
|
|
37
37
|
throttle(...args: any[]): void;
|
|
38
38
|
/**
|
package/util/util.js
CHANGED
|
@@ -21,11 +21,13 @@ var ReactIs = _interopRequireWildcard(require("react-is"));
|
|
|
21
21
|
|
|
22
22
|
var _Job = _interopRequireDefault(require("./Job"));
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
27
|
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
29
|
|
|
28
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
30
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
33
|
* Capitalizes a given string (not locale-aware).
|