@enact/core 4.1.4 → 4.5.0-beta.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.
- package/CHANGELOG.md +12 -0
- package/dispatcher/listeners.js +1 -1
- package/handle/handle.js +1 -1
- package/handle/tests/handle-specs.js +2 -2
- package/hoc/tests/hoc-specs.js +2 -2
- package/internal/ApiDecorator/ApiDecorator.js +12 -12
- package/internal/ApiDecorator/tests/ApiDecorator-specs.js +8 -8
- package/internal/Registry/Registry.js +1 -1
- package/internal/Registry/tests/Registry-specs.js +7 -7
- package/keymap/tests/keymap-specs.js +2 -2
- package/kind/computed.js +1 -1
- package/kind/kind.js +10 -10
- package/kind/tests/kind-specs.js +6 -4
- package/package.json +6 -6
- package/platform/platform.js +2 -2
- package/snapshot/snapshot.js +2 -2
- package/useChainRefs/useChainRefs.js +1 -1
- package/useClass/tests/useClass-specs.js +6 -2
- package/useClass/useClass.js +3 -3
- package/useHandlers/Handlers.js +2 -2
- package/useHandlers/tests/useHandlers-specs.js +2 -2
- package/useHandlers/useHandlers.js +1 -1
- package/util/Job.js +3 -3
- package/util/tests/Job-specs.js +50 -25
- package/util/tests/util-specs.js +10 -10
- package/util/util.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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
|
+
## [4.5.0-beta.1] - 2022-05-31
|
|
6
|
+
|
|
7
|
+
No significant changes.
|
|
8
|
+
|
|
9
|
+
## [4.5.0-alpha.2] - 2022-05-09
|
|
10
|
+
|
|
11
|
+
No significant changes.
|
|
12
|
+
|
|
13
|
+
## [4.5.0-alpha.1] - 2022-04-15
|
|
14
|
+
|
|
15
|
+
No significant changes.
|
|
16
|
+
|
|
5
17
|
## [4.1.4] - 2022-03-24
|
|
6
18
|
|
|
7
19
|
No significant changes.
|
package/dispatcher/listeners.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getListeners = exports["default"] = exports.addListener = void 0;
|
|
7
7
|
// Simple Map polyfill mapping targets to a hash of names->handler[]
|
|
8
8
|
var targets = [];
|
|
9
9
|
var events = [];
|
package/handle/handle.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.stopImmediate = exports.stop = exports.returnsTrue = exports.preventDefault = exports.oneOf = exports.not = exports.log = exports.handle = exports.
|
|
6
|
+
exports.stopImmediate = exports.stop = exports.returnsTrue = exports.preventDefault = exports.oneOf = exports.not = exports.log = exports.handle = exports.forwardWithPrevent = exports.forwardCustom = exports.forward = exports.forProp = exports.forKeyCode = exports.forKey = exports.forEventProp = exports["default"] = exports.callOnEvent = exports.call = exports.adaptEvent = void 0;
|
|
7
7
|
|
|
8
8
|
var _cond = _interopRequireDefault(require("ramda/src/cond"));
|
|
9
9
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var _handle = require("../handle");
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
|
|
9
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; }
|
|
10
10
|
|
package/hoc/tests/hoc-specs.js
CHANGED
|
@@ -10,9 +10,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
10
10
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
12
|
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
14
|
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = exports.ApiDecorator = void 0;
|
|
7
7
|
|
|
8
8
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
9
9
|
|
|
@@ -15,9 +15,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
17
|
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
19
|
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
21
|
|
|
22
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; }
|
|
23
23
|
|
|
@@ -25,21 +25,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
25
25
|
|
|
26
26
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
27
27
|
|
|
28
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
28
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
29
|
|
|
30
|
-
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); }
|
|
30
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
31
|
|
|
32
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
32
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
33
|
|
|
34
34
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
35
35
|
|
|
36
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
36
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
37
37
|
|
|
38
38
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
39
|
|
|
40
40
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
41
|
|
|
42
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
42
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
43
|
|
|
44
44
|
// Gets a property from `provider`
|
|
45
45
|
var get = function get(provider, name) {
|
|
@@ -100,11 +100,11 @@ var defaultConfig = {
|
|
|
100
100
|
*/
|
|
101
101
|
|
|
102
102
|
var ApiDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
103
|
-
var _class
|
|
103
|
+
var _class;
|
|
104
104
|
|
|
105
105
|
var api = config.api;
|
|
106
|
-
!(api != null) ? process.env.NODE_ENV !== "production" ? (0, _invariant["default"])(false, 'ApiDecorator: api is a required config property') :
|
|
107
|
-
return
|
|
106
|
+
!(api != null) ? process.env.NODE_ENV !== "production" ? (0, _invariant["default"])(false, 'ApiDecorator: api is a required config property') : (0, _invariant["default"])(false) : void 0;
|
|
107
|
+
return _class = /*#__PURE__*/function (_Component) {
|
|
108
108
|
_inherits(_class, _Component);
|
|
109
109
|
|
|
110
110
|
var _super = _createSuper(_class);
|
|
@@ -144,7 +144,7 @@ var ApiDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped
|
|
|
144
144
|
}]);
|
|
145
145
|
|
|
146
146
|
return _class;
|
|
147
|
-
}(_react.Component), _class.displayName = 'ApiDecorator',
|
|
147
|
+
}(_react.Component), _class.displayName = 'ApiDecorator', _class;
|
|
148
148
|
});
|
|
149
149
|
exports.ApiDecorator = ApiDecorator;
|
|
150
150
|
var _default = ApiDecorator;
|
|
@@ -14,27 +14,27 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
14
14
|
|
|
15
15
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
16
16
|
|
|
17
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
17
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
18
|
|
|
19
|
-
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); }
|
|
19
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
20
20
|
|
|
21
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
21
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
22
|
|
|
23
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
24
24
|
|
|
25
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
25
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
26
26
|
|
|
27
27
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
28
|
|
|
29
29
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
30
|
|
|
31
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
31
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
32
32
|
|
|
33
33
|
describe('ApiDecorator', function () {
|
|
34
|
-
var _class
|
|
34
|
+
var _class;
|
|
35
35
|
|
|
36
36
|
var data = [];
|
|
37
|
-
var ApiProvider = (
|
|
37
|
+
var ApiProvider = (_class = /*#__PURE__*/function (_ReactComponent) {
|
|
38
38
|
_inherits(ApiProvider, _ReactComponent);
|
|
39
39
|
|
|
40
40
|
var _super = _createSuper(ApiProvider);
|
|
@@ -73,7 +73,7 @@ describe('ApiDecorator', function () {
|
|
|
73
73
|
}]);
|
|
74
74
|
|
|
75
75
|
return ApiProvider;
|
|
76
|
-
}(_react2.Component), _class.displayName = 'ApiProvider',
|
|
76
|
+
}(_react2.Component), _class.displayName = 'ApiProvider', _class);
|
|
77
77
|
test('should invoke arrow function on wrapped component', function () {
|
|
78
78
|
var Component = (0, _ApiDecorator["default"])({
|
|
79
79
|
api: ['arrowFunction']
|
|
@@ -14,9 +14,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
16
|
|
|
17
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
18
|
|
|
19
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
20
|
|
|
21
21
|
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; }
|
|
22
22
|
|
|
@@ -24,21 +24,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
24
24
|
|
|
25
25
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
26
26
|
|
|
27
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
27
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
28
28
|
|
|
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
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
30
30
|
|
|
31
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
31
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
32
32
|
|
|
33
33
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
34
34
|
|
|
35
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
35
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
36
36
|
|
|
37
37
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
38
38
|
|
|
39
39
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
40
40
|
|
|
41
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
42
42
|
|
|
43
43
|
var SomeContext = /*#__PURE__*/(0, _react.createContext)();
|
|
44
44
|
describe('Registry', function () {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var keymap = _interopRequireWildcard(require("../"));
|
|
4
4
|
|
|
5
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
5
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
6
6
|
|
|
7
|
-
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; }
|
|
7
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
8
8
|
|
|
9
9
|
describe('keymap', function () {
|
|
10
10
|
test('should support adding single keyCodes for a name', function () {
|
package/kind/computed.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = exports.computed = void 0;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Accepts an object of computed property configurations and a property object, passes the property
|
package/kind/kind.js
CHANGED
|
@@ -21,25 +21,25 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
21
21
|
|
|
22
22
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
23
|
|
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
25
|
|
|
26
|
-
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
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
27
|
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
29
|
|
|
30
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
31
|
|
|
32
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
32
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
33
|
|
|
34
34
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
35
|
|
|
36
36
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
37
|
|
|
38
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
39
|
|
|
40
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
40
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
41
41
|
|
|
42
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
42
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
43
43
|
|
|
44
44
|
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; }
|
|
45
45
|
|
|
@@ -188,9 +188,9 @@ var kind = function kind(config) {
|
|
|
188
188
|
return renderKind(merged, ctx);
|
|
189
189
|
};
|
|
190
190
|
} else {
|
|
191
|
-
var _class
|
|
191
|
+
var _class;
|
|
192
192
|
|
|
193
|
-
Component = (
|
|
193
|
+
Component = (_class = /*#__PURE__*/function (_ReactComponent) {
|
|
194
194
|
_inherits(Component, _ReactComponent);
|
|
195
195
|
|
|
196
196
|
var _super = _createSuper(Component);
|
|
@@ -217,7 +217,7 @@ var kind = function kind(config) {
|
|
|
217
217
|
}]);
|
|
218
218
|
|
|
219
219
|
return Component;
|
|
220
|
-
}(_react.Component), _class.contextType = contextType,
|
|
220
|
+
}(_react.Component), _class.contextType = contextType, _class);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
if (name) Component.displayName = name;
|
package/kind/tests/kind-specs.js
CHANGED
|
@@ -14,6 +14,8 @@ var _kind = _interopRequireDefault(require("../kind"));
|
|
|
14
14
|
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
|
|
17
|
+
var _excluded = ["contextValue", "label", "value"];
|
|
18
|
+
|
|
17
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
20
|
|
|
19
21
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -24,13 +26,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
24
26
|
|
|
25
27
|
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; }
|
|
26
28
|
|
|
27
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
29
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
28
30
|
|
|
29
31
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
32
|
|
|
31
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
32
34
|
|
|
33
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
35
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
34
36
|
|
|
35
37
|
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; }
|
|
36
38
|
|
|
@@ -73,7 +75,7 @@ describe('kind', function () {
|
|
|
73
75
|
var contextValue = _ref2.contextValue,
|
|
74
76
|
label = _ref2.label,
|
|
75
77
|
value = _ref2.value,
|
|
76
|
-
rest = _objectWithoutProperties(_ref2,
|
|
78
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
77
79
|
|
|
78
80
|
delete rest.prop;
|
|
79
81
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, rest), {}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/core",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.5.0-beta.1",
|
|
4
4
|
"description": "Enact is an open source JavaScript framework containing everything you need to create a fast, scalable mobile or web application.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"classnames": "^2.3.1",
|
|
29
29
|
"invariant": "^2.2.4",
|
|
30
|
-
"prop-types": "^15.8.
|
|
31
|
-
"ramda": "^0.
|
|
32
|
-
"react": "^
|
|
33
|
-
"react-dom": "^
|
|
34
|
-
"react-is": "^
|
|
30
|
+
"prop-types": "^15.8.1",
|
|
31
|
+
"ramda": "^0.28.0",
|
|
32
|
+
"react": "^18.0.0",
|
|
33
|
+
"react-dom": "^18.0.0",
|
|
34
|
+
"react-is": "^18.0.0",
|
|
35
35
|
"warning": "^4.0.3"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/platform/platform.js
CHANGED
|
@@ -21,9 +21,9 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
21
21
|
|
|
22
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
23
|
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
25
|
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
27
|
|
|
28
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; }
|
|
29
29
|
|
package/snapshot/snapshot.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports["default"] = void 0;
|
|
6
7
|
exports.isWindowReady = isWindowReady;
|
|
7
8
|
exports.onWindowReady = onWindowReady;
|
|
8
9
|
exports.windowReady = windowReady;
|
|
9
|
-
exports["default"] = void 0;
|
|
10
10
|
|
|
11
11
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
12
12
|
|
|
@@ -79,7 +79,7 @@ function onWindowReady(callback) {
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
function windowReady() {
|
|
82
|
-
!isWindowReady() ? process.env.NODE_ENV !== "production" ? (0, _invariant["default"])(false, 'windowReady cannot be run until the window is available') :
|
|
82
|
+
!isWindowReady() ? process.env.NODE_ENV !== "production" ? (0, _invariant["default"])(false, 'windowReady cannot be run until the window is available') : (0, _invariant["default"])(false) : void 0;
|
|
83
83
|
windowCallbacks.forEach(function (f) {
|
|
84
84
|
return f();
|
|
85
85
|
});
|
|
@@ -10,14 +10,18 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
10
10
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
12
|
|
|
13
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
14
|
+
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
|
|
13
17
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
18
|
|
|
15
19
|
describe('useClass', function () {
|
|
16
|
-
var Class = function Class(arg) {
|
|
20
|
+
var Class = /*#__PURE__*/_createClass(function Class(arg) {
|
|
17
21
|
_classCallCheck(this, Class);
|
|
18
22
|
|
|
19
23
|
this.arg = arg;
|
|
20
|
-
};
|
|
24
|
+
});
|
|
21
25
|
|
|
22
26
|
function Component(props) {
|
|
23
27
|
var instance = (0, _useClass["default"])(Class, props.arg);
|
package/useClass/useClass.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useClass = useClass;
|
|
7
6
|
exports["default"] = void 0;
|
|
7
|
+
exports.useClass = useClass;
|
|
8
8
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
|
|
11
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
11
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
12
12
|
|
|
13
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
14
|
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
15
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Creates one instance of the class, `Ctor` with the provided `args`, for the life of the
|
package/useHandlers/Handlers.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = exports.Handlers = void 0;
|
|
7
7
|
|
|
8
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
9
|
|
|
10
10
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
11
11
|
|
|
12
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
13
|
|
|
14
14
|
var Handlers = /*#__PURE__*/function () {
|
|
15
15
|
function Handlers(_handlers) {
|
|
@@ -10,9 +10,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
10
10
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
12
|
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
14
|
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
|
package/util/Job.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = exports.Job = void 0;
|
|
7
7
|
|
|
8
8
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
13
13
|
|
|
14
14
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
15
15
|
|
|
16
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
16
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Provides a convenient way to manage timed execution of functions.
|
|
@@ -168,7 +168,7 @@ var Job = /*#__PURE__*/function () {
|
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
this.promise = function (promise) {
|
|
171
|
-
!(promise && typeof promise.then === 'function') ? process.env.NODE_ENV !== "production" ? (0, _invariant["default"])(false, 'promise expects a thenable') :
|
|
171
|
+
!(promise && typeof promise.then === 'function') ? process.env.NODE_ENV !== "production" ? (0, _invariant["default"])(false, 'promise expects a thenable') : (0, _invariant["default"])(false) : void 0;
|
|
172
172
|
_this.type = 'promise';
|
|
173
173
|
_this.id = promise;
|
|
174
174
|
return promise.then(function (result) {
|
package/util/tests/Job-specs.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _react = require("@testing-library/react");
|
|
4
|
+
|
|
3
5
|
var _Job = _interopRequireDefault(require("../Job"));
|
|
4
6
|
|
|
5
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
6
8
|
|
|
7
9
|
describe('Job', function () {
|
|
10
|
+
beforeEach(function () {
|
|
11
|
+
jest.useFakeTimers();
|
|
12
|
+
});
|
|
13
|
+
afterEach(function () {
|
|
14
|
+
jest.useRealTimers();
|
|
15
|
+
});
|
|
8
16
|
describe('#start', function () {
|
|
9
17
|
test('should start job', function (done) {
|
|
10
18
|
var j = new _Job["default"](done, 10);
|
|
11
19
|
j.start();
|
|
20
|
+
jest.runAllTimers();
|
|
12
21
|
});
|
|
13
22
|
test('should pass args to fn', function (done) {
|
|
14
23
|
var value = 'argument';
|
|
@@ -23,6 +32,7 @@ describe('Job', function () {
|
|
|
23
32
|
|
|
24
33
|
var j = new _Job["default"](fn, 10);
|
|
25
34
|
j.start(value);
|
|
35
|
+
jest.runAllTimers();
|
|
26
36
|
});
|
|
27
37
|
});
|
|
28
38
|
describe('#stop', function () {
|
|
@@ -34,9 +44,10 @@ describe('Job', function () {
|
|
|
34
44
|
}, 10);
|
|
35
45
|
j.start();
|
|
36
46
|
j.stop();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
47
|
+
(0, _react.act)(function () {
|
|
48
|
+
return jest.advanceTimersByTime(30);
|
|
49
|
+
});
|
|
50
|
+
if (!ran) done();
|
|
40
51
|
});
|
|
41
52
|
});
|
|
42
53
|
describe('#throttle', function () {
|
|
@@ -46,22 +57,27 @@ describe('Job', function () {
|
|
|
46
57
|
number++;
|
|
47
58
|
}, 20);
|
|
48
59
|
j.throttle();
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
(0, _react.act)(function () {
|
|
61
|
+
return jest.advanceTimersByTime(5);
|
|
62
|
+
});
|
|
63
|
+
j.throttle();
|
|
64
|
+
(0, _react.act)(function () {
|
|
65
|
+
return jest.advanceTimersByTime(10);
|
|
66
|
+
});
|
|
67
|
+
j.throttle();
|
|
68
|
+
(0, _react.act)(function () {
|
|
69
|
+
return jest.advanceTimersByTime(10);
|
|
70
|
+
});
|
|
71
|
+
j.throttle();
|
|
72
|
+
(0, _react.act)(function () {
|
|
73
|
+
return jest.advanceTimersByTime(5);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
if (number === 2) {
|
|
77
|
+
done();
|
|
78
|
+
} else {
|
|
79
|
+
done(new Error('too many or too few calls' + number));
|
|
80
|
+
}
|
|
65
81
|
});
|
|
66
82
|
test('should pass args to fn', function (done) {
|
|
67
83
|
var value = 'argument';
|
|
@@ -98,6 +114,7 @@ describe('Job', function () {
|
|
|
98
114
|
test('should start job', function (done) {
|
|
99
115
|
var j = new _Job["default"](done, 10);
|
|
100
116
|
j.idle();
|
|
117
|
+
jest.runAllTimers();
|
|
101
118
|
});
|
|
102
119
|
test('should pass args to fn', function (done) {
|
|
103
120
|
var value = 'argument';
|
|
@@ -112,6 +129,7 @@ describe('Job', function () {
|
|
|
112
129
|
|
|
113
130
|
var j = new _Job["default"](fn, 10);
|
|
114
131
|
j.idle(value);
|
|
132
|
+
jest.runAllTimers();
|
|
115
133
|
});
|
|
116
134
|
test('should clear an existing job id before starting job', function (done) {
|
|
117
135
|
var fn = function fn(arg) {
|
|
@@ -125,6 +143,7 @@ describe('Job', function () {
|
|
|
125
143
|
var j = new _Job["default"](fn);
|
|
126
144
|
j.idle('first');
|
|
127
145
|
j.idle('second');
|
|
146
|
+
jest.runAllTimers();
|
|
128
147
|
});
|
|
129
148
|
});
|
|
130
149
|
describe('#promise', function () {
|
|
@@ -165,7 +184,10 @@ describe('Job', function () {
|
|
|
165
184
|
done(new Error('Job ran for rejected promise'));
|
|
166
185
|
});
|
|
167
186
|
j.promise(Promise.reject(true))["catch"](function () {});
|
|
168
|
-
|
|
187
|
+
(0, _react.act)(function () {
|
|
188
|
+
return jest.advanceTimersByTime(10);
|
|
189
|
+
});
|
|
190
|
+
done();
|
|
169
191
|
});
|
|
170
192
|
test('should not start job when stopped before promise resolves', function (done) {
|
|
171
193
|
var j = new _Job["default"](function () {
|
|
@@ -174,10 +196,14 @@ describe('Job', function () {
|
|
|
174
196
|
j.promise(new Promise(function (resolve) {
|
|
175
197
|
return setTimeout(resolve, 20);
|
|
176
198
|
}));
|
|
177
|
-
|
|
178
|
-
return
|
|
179
|
-
}
|
|
180
|
-
|
|
199
|
+
(0, _react.act)(function () {
|
|
200
|
+
return jest.advanceTimersByTime(10);
|
|
201
|
+
});
|
|
202
|
+
j.stop();
|
|
203
|
+
(0, _react.act)(function () {
|
|
204
|
+
return jest.advanceTimersByTime(20);
|
|
205
|
+
});
|
|
206
|
+
done();
|
|
181
207
|
});
|
|
182
208
|
test('should not start job when another is started', function (done) {
|
|
183
209
|
var j = new _Job["default"](function (value) {
|
|
@@ -206,7 +232,6 @@ describe('Job', function () {
|
|
|
206
232
|
});
|
|
207
233
|
j.promise(Promise.resolve(true)).then(function (value) {
|
|
208
234
|
expect(value).toBeUndefined();
|
|
209
|
-
done();
|
|
210
235
|
});
|
|
211
236
|
j.promise(Promise.resolve(true)).then(function () {
|
|
212
237
|
return done();
|
package/util/tests/util-specs.js
CHANGED
|
@@ -8,28 +8,28 @@ describe('util', function () {
|
|
|
8
8
|
describe('isRenderable', function () {
|
|
9
9
|
test('should return {true} for function', function () {
|
|
10
10
|
var expected = true;
|
|
11
|
-
var
|
|
12
|
-
expect(
|
|
11
|
+
var view = (0, _util.isRenderable)(function () {});
|
|
12
|
+
expect(view).toEqual(expected);
|
|
13
13
|
});
|
|
14
14
|
test('should return {true} for string', function () {
|
|
15
15
|
var expected = true;
|
|
16
|
-
var
|
|
17
|
-
expect(
|
|
16
|
+
var view = (0, _util.isRenderable)('div');
|
|
17
|
+
expect(view).toEqual(expected);
|
|
18
18
|
});
|
|
19
19
|
test('should return {true} for React.forwardRef', function () {
|
|
20
20
|
var expected = true;
|
|
21
|
-
var
|
|
22
|
-
expect(
|
|
21
|
+
var view = (0, _util.isRenderable)( /*#__PURE__*/(0, _react.forwardRef)(function () {}));
|
|
22
|
+
expect(view).toEqual(expected);
|
|
23
23
|
});
|
|
24
24
|
test('should return {true} for React.memo', function () {
|
|
25
25
|
var expected = true;
|
|
26
|
-
var
|
|
27
|
-
expect(
|
|
26
|
+
var view = (0, _util.isRenderable)( /*#__PURE__*/(0, _react.memo)(function () {}));
|
|
27
|
+
expect(view).toEqual(expected);
|
|
28
28
|
});
|
|
29
29
|
test('should return {true} for React.lazy', function () {
|
|
30
30
|
var expected = true;
|
|
31
|
-
var
|
|
32
|
-
expect(
|
|
31
|
+
var view = (0, _util.isRenderable)( /*#__PURE__*/(0, _react.lazy)(function () {}));
|
|
32
|
+
expect(view).toEqual(expected);
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
describe('memoize', function () {
|
package/util/util.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "Job", {
|
|
|
9
9
|
return _Job["default"];
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
exports.shallowEqual = exports.
|
|
12
|
+
exports.shallowEqual = exports.perfNow = exports.mergeClassNameMaps = exports.memoize = exports.mapAndFilterChildren = exports.isRenderable = exports.extractAriaProps = exports.coerceFunction = exports.coerceArray = exports.clamp = exports.cap = void 0;
|
|
13
13
|
|
|
14
14
|
var _always = _interopRequireDefault(require("ramda/src/always"));
|
|
15
15
|
|
|
@@ -23,9 +23,9 @@ var ReactIs = _interopRequireWildcard(require("react-is"));
|
|
|
23
23
|
|
|
24
24
|
var _Job = _interopRequireDefault(require("./Job"));
|
|
25
25
|
|
|
26
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
|
|
28
|
-
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; }
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
31
|
|