@enact/core 4.9.0-beta.1 → 5.0.0-alpha.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 CHANGED
@@ -2,6 +2,14 @@
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
+ ## [5.0.0-alpha.1] - 2024-07-11
6
+
7
+ ### Removed
8
+
9
+ - `core/platform` member `windowsPhone`, `edge`, `androidChrome`, `android`, `ie`, `ios`, `webos`, `androidFirefox`, `firefoxOS`, `blackberry`, and `tizen`
10
+ - `core/platform` member `gesture`, `node`, `platformName`, and `unknown`
11
+ - `core/platform` member `touch` and `touchscreen`
12
+
5
13
  ## [4.9.0-beta.1] - 2024-06-17
6
14
 
7
15
  No significant changes.
@@ -19,7 +19,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
19
19
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
20
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
21
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
22
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
23
23
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
24
  describe('handle', function () {
25
25
  var makeEvent = function makeEvent(payload) {
@@ -8,7 +8,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
8
8
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
9
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
10
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
12
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable enact/display-name */
13
13
  describe('hoc', function () {
14
14
  var data;
@@ -15,7 +15,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
15
15
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
16
  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, _toPropertyKey(descriptor.key), descriptor); } }
17
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
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
19
19
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
20
  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); }
21
21
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
@@ -8,7 +8,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
8
8
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
9
  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, _toPropertyKey(descriptor.key), descriptor); } }
10
10
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
12
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
13
  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); }
14
14
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
@@ -15,7 +15,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
15
15
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
16
  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, _toPropertyKey(descriptor.key), descriptor); } }
17
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
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
19
19
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
20
  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); }
21
21
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
@@ -10,10 +10,10 @@ var _excluded = ["data-withref-id", "outermostRef", "referrerName"];
10
10
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
11
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
12
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
14
14
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
17
17
  var WithRef = exports.WithRef = function WithRef(WrappedComponent) {
18
18
  var HoC = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
19
19
  var givenId = props['data-withref-id'],
@@ -10,7 +10,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
10
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
11
  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, _toPropertyKey(descriptor.key), descriptor); } }
12
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
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
14
14
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
15
  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); }
16
16
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
@@ -9,7 +9,7 @@ function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("
9
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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, _toPropertyKey(descriptor.key), descriptor); } }
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
13
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
14
  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); }
15
15
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
@@ -2,7 +2,7 @@
2
2
 
3
3
  var keymap = _interopRequireWildcard(require("../"));
4
4
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
5
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
5
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
6
6
  describe('keymap', function () {
7
7
  test('should support adding single keyCodes for a name', function () {
8
8
  keymap.add('testEnter', 13);
package/kind/kind.js CHANGED
@@ -23,7 +23,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
23
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25
25
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
26
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
26
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
27
27
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
28
28
  * Provides the {@link core/kind.kind} method to create components
29
29
  *
@@ -20,10 +20,10 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
20
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
22
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
23
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
24
24
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
25
25
  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; }
26
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
26
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
27
27
  describe('kind', function () {
28
28
  var TestContext = /*#__PURE__*/(0, _react2.createContext)({
29
29
  value: 'initial'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enact/core",
3
- "version": "4.9.0-beta.1",
3
+ "version": "5.0.0-alpha.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
  "repository": {
6
6
  "type": "git",
@@ -14,42 +14,21 @@ export interface PlatformDescription {
14
14
  * The version of the detected browser, if chrome browser is detected
15
15
  */;
16
16
  chrome: number /**
17
- * Additional information about the detected platform. Deprecated: will be removed in 5.0.0.
18
- */;
19
- extra?: object /**
20
17
  * The version of the detected browser, if firefox browser is detected
21
18
  */;
22
19
  firefox: number /**
23
- * `true` if the platform has native double-finger events. Deprecated: will be removed in 5.0.0.
24
- */;
25
- gesture: boolean /**
26
- * `true` only if `window` is `undefined` . Deprecated: will be removed in 5.0.0. Use `type` instead.
27
- */;
28
- node: boolean /**
29
- * The name of the platform, if detected. Deprecated: will be removed in 5.0.0. Use `browserName` instead for browser names.
30
- */;
31
- platformName?: string /**
32
20
  * The version of the detected browser, if safari browser is detected
33
21
  */;
34
22
  safari: number /**
35
- * `true` if the platform has native single-finger events. Deprecated: will be removed in 5.0.0. Use `touchEvent` instead.
36
- */;
37
- touch: boolean /**
38
23
  * `true` if the browser has native touch events
39
24
  */;
40
25
  touchEvent: boolean /**
41
- * `true` if the platform has a touch screen. Deprecated: will be removed in 5.0.0. Use `touchScreen` instead.
42
- */;
43
- touchscreen: boolean /**
44
26
  * `true` if the platform has a touch screen
45
27
  */;
46
28
  touchScreen: boolean /**
47
29
  * The type of the detected platform. One of 'desktop', 'mobile', 'webos', 'node', or 'unknown'
48
30
  */;
49
- type: string /**
50
- * `true` for any unknown system. Deprecated: will be removed in 5.0.0. Use `type` instead.
51
- */;
52
- unknown: boolean;
31
+ type: string;
53
32
  }
54
33
  /**
55
34
  * Returns the object.
@@ -6,17 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.platform = exports.parseUserAgent = exports.detect = exports["default"] = void 0;
7
7
  var _deprecate = _interopRequireDefault(require("../internal/deprecate"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
10
- 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."); }
11
- 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(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
13
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
14
- 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; }
15
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
19
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* global globalThis */ /**
9
+ /* global globalThis */
10
+ /**
20
11
  * Utilities for detecting basic platform capabilities.
21
12
  *
22
13
  * @module core/platform
@@ -24,6 +15,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
24
15
  * @exports platform
25
16
  * @public
26
17
  */
18
+
27
19
  // Refer the following for more details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
28
20
  var browserEnvironment = function browserEnvironment() {
29
21
  return !!globalThis.window;
@@ -43,250 +35,6 @@ var deviceTouchScreen = function deviceTouchScreen() {
43
35
  (_globalThis$matchMedi = globalThis.matchMedia) === null || _globalThis$matchMedi === void 0 || (_globalThis$matchMedi = _globalThis$matchMedi.call(globalThis, "(any-pointer: coarse)")) === null || _globalThis$matchMedi === void 0 ? void 0 : _globalThis$matchMedi.matches));
44
36
  };
45
37
 
46
- /*
47
- * Legacy Code to be removed in the next major release
48
- */
49
- var hasGesture = function hasGesture() {
50
- return Boolean('ongesturestart' in window ||
51
- // non-standard and no major browser supports gesture events
52
- 'onmsgesturestart' in window && (
53
- // Internet Explorer 10 only
54
- window.navigator.msMaxTouchPoints > 1 ||
55
- // Internet Explorer 10 only
56
- window.navigator.maxTouchPoints > 1));
57
- };
58
- var hasTouch = function hasTouch() {
59
- return Boolean(featureTouchEvent() || 'ontouchstart' in window ||
60
- // featureTouchEvent covers recent Firefox and Safari also, so no need when we deprecate old browsers
61
- window.navigator.msMaxTouchPoints ||
62
- // Internet Explorer 10 only
63
- window.navigator.msManipulationViewsEnabled && window.navigator.maxTouchPoints // Internet Explorer only
64
- );
65
- };
66
- var webOSVersion = {
67
- 38: 3,
68
- 53: 4,
69
- 68: 5,
70
- 79: 6
71
- };
72
- var platforms = [
73
- // Windows Phone 7 - 10
74
- {
75
- platform: 'windowsPhone',
76
- regex: /Windows Phone (?:OS )?(\d+)[.\d]+/
77
- },
78
- // Edge
79
- {
80
- platform: 'edge',
81
- regex: /Chrome\/(\d+)[.\d]+.*Edg(?:e|A|iOS)?\/(\d+)[.\d]+/
82
- }, {
83
- platform: 'edge',
84
- regex: /Edg(?:e|A|iOS)?\/(\d+)[.\d]+/
85
- },
86
- // Android 4+ using Chrome
87
- {
88
- platform: 'androidChrome',
89
- regex: /Android .* Chrome\/(\d+)[.\d]+/
90
- },
91
- // Android 2 - 4
92
- {
93
- platform: 'android',
94
- regex: /Android(?:\s|\/)(\d+)/
95
- },
96
- // Kindle Fire
97
- // Force version to 2, (desktop mode does not list android version)
98
- {
99
- platform: 'android',
100
- regex: /Silk\/1./,
101
- forceVersion: 2,
102
- extra: {
103
- silk: 1
104
- }
105
- },
106
- // Kindle Fire HD (Silk versions 2 or 3)
107
- // Force version to 4
108
- {
109
- platform: 'android',
110
- regex: /Silk\/2./,
111
- forceVersion: 4,
112
- extra: {
113
- silk: 2
114
- }
115
- }, {
116
- platform: 'android',
117
- regex: /Silk\/3./,
118
- forceVersion: 4,
119
- extra: {
120
- silk: 3
121
- }
122
- },
123
- // IE 8 - 10
124
- {
125
- platform: 'ie',
126
- regex: /MSIE (\d+)/
127
- },
128
- // IE 11
129
- {
130
- platform: 'ie',
131
- regex: /Trident\/.*; rv:(\d+)/
132
- },
133
- // iOS 3 - 5
134
- // Apple likes to make this complicated
135
- {
136
- platform: 'ios',
137
- regex: /iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/
138
- },
139
- // LG webOS
140
- {
141
- platform: 'webos',
142
- regex: /Web0S;.*Safari\/537.41/,
143
- forceVersion: 1
144
- }, {
145
- platform: 'webos',
146
- regex: /Web0S;.*Safari\/538.2/,
147
- forceVersion: 2
148
- }, {
149
- platform: 'webos',
150
- regex: /Web0S;.*Chrome\/(\d+)/
151
- },
152
- // LG webOS indeterminate versions
153
- {
154
- platform: 'webos',
155
- regex: /Web0S;/,
156
- forceVersion: -1
157
- },
158
- // LuneOS
159
- {
160
- platform: 'webos',
161
- regex: /LuneOS/,
162
- forceVersion: -1,
163
- extra: {
164
- luneos: 1
165
- }
166
- },
167
- // Palm/HP/Open webOS
168
- {
169
- platform: 'webos',
170
- regex: /WebAppManager|Isis|webOS\./,
171
- forceVersion: -1,
172
- extra: {
173
- legacy: 4
174
- }
175
- }, {
176
- platform: 'webos',
177
- regex: /(?:web|hpw)OS\/1/,
178
- forceVersion: -1,
179
- extra: {
180
- legacy: 1
181
- }
182
- }, {
183
- platform: 'webos',
184
- regex: /(?:web|hpw)OS\/2/,
185
- forceVersion: -1,
186
- extra: {
187
- legacy: 2
188
- }
189
- }, {
190
- platform: 'webos',
191
- regex: /(?:web|hpw)OS\/3/,
192
- forceVersion: -1,
193
- extra: {
194
- legacy: 3
195
- }
196
- },
197
- // desktop Safari
198
- {
199
- platform: 'safari',
200
- regex: /Version\/(\d+)[.\d]+\s+Safari/
201
- },
202
- // desktop Chrome
203
- {
204
- platform: 'chrome',
205
- regex: /Chrome\/(\d+)[.\d]+/
206
- },
207
- // Firefox on Android
208
- {
209
- platform: 'androidFirefox',
210
- regex: /Android;.*Firefox\/(\d+)/
211
- },
212
- // FirefoxOS
213
- {
214
- platform: 'firefoxOS',
215
- regex: /Mobile;.*Firefox\/(\d+)/
216
- },
217
- // desktop Firefox
218
- {
219
- platform: 'firefox',
220
- regex: /Firefox\/(\d+)/
221
- },
222
- // Blackberry Playbook
223
- {
224
- platform: 'blackberry',
225
- regex: /PlayBook/i,
226
- forceVersion: 2
227
- },
228
- // Blackberry 10+
229
- {
230
- platform: 'blackberry',
231
- regex: /BB1\d;.*Version\/(\d+\.\d+)/
232
- },
233
- // Tizen
234
- {
235
- platform: 'tizen',
236
- regex: /Tizen (\d+)/
237
- }];
238
- var parseUserAgentLegacy = function parseUserAgentLegacy(userAgent) {
239
- var plat = {
240
- gesture: hasGesture(),
241
- node: false,
242
- touch: hasTouch(),
243
- touchscreen: deviceTouchScreen(),
244
- unknown: true
245
- };
246
- for (var i = 0, p, m, v; p = platforms[i]; i++) {
247
- m = p.regex.exec(userAgent);
248
- if (m) {
249
- plat.unknown = false;
250
- if ('forceVersion' in p) {
251
- v = p.forceVersion;
252
- } else if (p.platform === 'webos') {
253
- v = webOSVersion[m[1]] || -1;
254
- if (v >= 7 || v === -1) {
255
- plat.chrome = Number(m[1]);
256
- }
257
- } else if (p.platform === 'edge' && m[2]) {
258
- plat.chrome = Number(m[1]);
259
- v = Number(m[2]);
260
- } else {
261
- v = Number(m[1]);
262
- }
263
- plat[p.platform] = v;
264
- if (p.extra) {
265
- plat = _objectSpread(_objectSpread({}, plat), p.extra);
266
- }
267
- plat.platformName = p.platform;
268
- break;
269
- }
270
- }
271
- if ('webos' === plat.platformName) {
272
- (0, _deprecate["default"])({
273
- name: plat.platformName,
274
- message: 'Refer `@enact/webos`\'s `platform` for webOS specific information.',
275
- until: '5.0.0'
276
- });
277
- } else if (!['chrome', 'safari', 'firefox'].includes(plat.platformName)) {
278
- (0, _deprecate["default"])({
279
- name: plat.platformName,
280
- until: '5.0.0'
281
- });
282
- }
283
- return plat;
284
- };
285
-
286
- /*
287
- * The end of Legacy Code to be removed in the next major release
288
- */
289
-
290
38
  // Refer https://www.whatismybrowser.com/guides/the-latest-user-agent/ for latest user agents of major browsers
291
39
  var userAgentPatterns = [
292
40
  // Normal cases except iOS
@@ -343,13 +91,11 @@ var parseUserAgent = exports.parseUserAgent = function parseUserAgent(userAgent)
343
91
  // deprecation warning for browser versions older than our support policy
344
92
  if (supportedVersions[detectedInfo.browserName] > detectedInfo.browserVersion) {
345
93
  (0, _deprecate["default"])({
346
- name: "supporting ".concat(detectedInfo.browserName, " version before ").concat(supportedVersions[detectedInfo.browserName]),
94
+ name: "supporting ".concat(detectedInfo.browserName, " version older than ").concat(supportedVersions[detectedInfo.browserName]),
347
95
  until: '5.0.0'
348
96
  });
349
97
  }
350
-
351
- // Merge legacy platform info
352
- return _objectSpread(_objectSpread({}, parseUserAgentLegacy(userAgent)), detectedInfo);
98
+ return detectedInfo;
353
99
  };
354
100
 
355
101
  /**
@@ -357,18 +103,11 @@ var parseUserAgent = exports.parseUserAgent = function parseUserAgent(userAgent)
357
103
  * @property {String} browserName - The name of the detected browser
358
104
  * @property {Number} browserVersion - The version of the detected browser
359
105
  * @property {Number} chrome - The version of the detected browser, if chrome browser is detected
360
- * @property {Object} [extra] - Additional information about the detected platform. Deprecated: will be removed in 5.0.0.
361
106
  * @property {Number} firefox - The version of the detected browser, if firefox browser is detected
362
- * @property {Boolean} gesture - `true` if the platform has native double-finger events. Deprecated: will be removed in 5.0.0.
363
- * @property {Boolean} node - `true` only if `window` is `undefined`. Deprecated: will be removed in 5.0.0. Use `type` instead.
364
- * @property {String} [platformName] - The name of the platform, if detected. Deprecated: will be removed in 5.0.0. Use `browserName` instead for browser names.
365
107
  * @property {Number} safari - The version of the detected browser, if safari browser is detected
366
- * @property {Boolean} touch - `true` if the platform has native single-finger events. Deprecated: will be removed in 5.0.0. Use `touchEvent` instead.
367
108
  * @property {Boolean} touchEvent - `true` if the browser has native touch events
368
- * @property {Boolean} touchscreen - `true` if the platform has a touch screen. Deprecated: will be removed in 5.0.0. Use `touchScreen` instead.
369
109
  * @property {Boolean} touchScreen - `true` if the platform has a touch screen
370
110
  * @property {String} type - The type of the detected platform. One of 'desktop', 'mobile', 'webos', 'node', or 'unknown'
371
- * @property {Boolean} unknown - `true` for any unknown system. Deprecated: will be removed in 5.0.0. Use `type` instead.
372
111
  *
373
112
  * @memberof core/platform
374
113
  * @public
@@ -396,12 +135,6 @@ var detect = exports.detect = function detect() {
396
135
  } else {
397
136
  // node or compatible environment (e.g. prerendering or snapshot runs)
398
137
  detectedPlatform = {
399
- // the following properties are deprecated and will be removed in the next major release
400
- gesture: false,
401
- node: true,
402
- touch: false,
403
- unknown: true,
404
- // the following properties are new and will be available in the next major release
405
138
  type: 'node',
406
139
  browserName: 'unknown',
407
140
  browserVersion: 0 /* magic number for unknown */
@@ -424,50 +157,10 @@ var detect = exports.detect = function detect() {
424
157
  * @public
425
158
  */
426
159
  var platform = exports.platform = {};
427
- [
428
- // the following properties are deprecated and will be removed in the next major release
429
- 'gesture', 'node', 'platformName', 'touch', 'touchscreen', 'unknown',
430
- // the following properties are new and will be available in the next major release
431
- 'browserName', 'browserVersion', 'touchEvent', 'touchScreen', 'type'].concat(_toConsumableArray(new Set(platforms.map(function (p) {
432
- return p.platform;
433
- })))).forEach(function (name) {
160
+ ['browserName', 'browserVersion', 'chrome', 'firefox', 'safari', 'touchEvent', 'touchScreen', 'type'].forEach(function (name) {
434
161
  Object.defineProperty(platform, name, {
435
162
  enumerable: true,
436
163
  get: function get() {
437
- if (name === 'gesture' || name === 'unknown') {
438
- (0, _deprecate["default"])({
439
- name: name,
440
- until: '5.0.0'
441
- });
442
- }
443
- if (name === 'node') {
444
- (0, _deprecate["default"])({
445
- name: name,
446
- until: '5.0.0',
447
- replacedBy: 'type'
448
- });
449
- }
450
- if (name === 'platformName') {
451
- (0, _deprecate["default"])({
452
- name: name,
453
- until: '5.0.0',
454
- replacedBy: 'browserName'
455
- });
456
- }
457
- if (name === 'touch') {
458
- (0, _deprecate["default"])({
459
- name: name,
460
- until: '5.0.0',
461
- replacedBy: 'touchEvent'
462
- });
463
- }
464
- if (name === 'touchscreen') {
465
- (0, _deprecate["default"])({
466
- name: name,
467
- until: '5.0.0',
468
- replacedBy: 'touchScreen'
469
- });
470
- }
471
164
  var p = detect();
472
165
  return p[name];
473
166
  }
@@ -2,186 +2,6 @@
2
2
 
3
3
  var _platform = require("../platform");
4
4
  describe('platform', function () {
5
- describe('parseUserAgent for webOS', function () {
6
- // From http://webostv.developer.lge.com/discover/specifications/web-engine/
7
- var webOSTVNext = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 WebAppManager';
8
- var webOSTV6 = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3440.106 Safari/537.36 WebAppManager';
9
- var webOSTV5 = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager';
10
- var webOSTV4 = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.1785.34 Safari/537.36 WebAppManager';
11
- var webOSTV3 = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.1.1 Chrome/38.0.2125.122 Safari/537.36 WebAppManager';
12
- var webOSTV2 = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/538.2 (KHTML, like Gecko) Large Screen WebAppManager Safari/538.2';
13
- var webOSTV1 = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.41 (KHTML, like Gecko) Large Screen WebAppManager Safari/537.41';
14
-
15
- // From https://developers.whatismybrowser.com/useragents/explore/operating_system_name/webos/
16
- var LuneOS2 = 'Mozilla/5.0 (LuneOS, like webOS/3.0.5; Tablet) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.9.2 Chrome/56.0.2924.103 Safari/537.36';
17
- var LuneOS1 = 'Mozilla/5.0 (LuneOS, like webOS/3.0.5; Tablet) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.6.2 Chrome/45.0.2454.103 Safari/537.36';
18
- var webOS10 = 'Mozilla/5.0 (webOS/1.0; U; en-US) AppleWebKit/525.27.1 (KHTML, like Geko) Version/1.0 Safari/525.27.1 Pre/1.0';
19
- var webOS11 = 'Mozilla/5.0 (webOS/1.1; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0';
20
- var webOS12 = 'Mozilla/5.0 (webOS/1.2; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0';
21
- var webOS13 = 'Mozilla/5.0 (webOS/1.3.1; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0';
22
- var webOS1351 = 'Mozilla/5.0 (webOS/1.3.5.1; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.1';
23
- var webOS2 = 'Mozilla/5.0 (webOS/2.0.1; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.2';
24
- var webOSOther = 'Mozilla/5.0 (Web0S; Linux) AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36 WebAppManager';
25
- test('should return webOS 1', function () {
26
- var expected = {
27
- webos: 1
28
- };
29
- var actual = (0, _platform.parseUserAgent)(webOSTV1);
30
- expect(actual).toMatchObject(expected);
31
- });
32
- test('should return webOS 2', function () {
33
- var expected = {
34
- webos: 2
35
- };
36
- var actual = (0, _platform.parseUserAgent)(webOSTV2);
37
- expect(actual).toMatchObject(expected);
38
- });
39
- test('should return webOS 3', function () {
40
- var expected = {
41
- webos: 3
42
- };
43
- var actual = (0, _platform.parseUserAgent)(webOSTV3);
44
- expect(actual).toMatchObject(expected);
45
- });
46
- test('should return webOS 4', function () {
47
- var expected = {
48
- webos: 4
49
- };
50
- var actual = (0, _platform.parseUserAgent)(webOSTV4);
51
- expect(actual).toMatchObject(expected);
52
- });
53
- test('should return webOS 5', function () {
54
- var expected = {
55
- webos: 5
56
- };
57
- var actual = (0, _platform.parseUserAgent)(webOSTV5);
58
- expect(actual).toMatchObject(expected);
59
- });
60
- test('should return webOS 6', function () {
61
- var expected = {
62
- webos: 6
63
- };
64
- var actual = (0, _platform.parseUserAgent)(webOSTV6);
65
- expect(actual).toMatchObject(expected);
66
- });
67
- test('should return webOS Next and chrome 87', function () {
68
- var expected = {
69
- webos: -1,
70
- chrome: 87
71
- };
72
- var actual = (0, _platform.parseUserAgent)(webOSTVNext);
73
- expect(actual).toMatchObject(expected);
74
- });
75
- test('should return webOS -1', function () {
76
- var expected = {
77
- webos: -1
78
- };
79
- var actual = (0, _platform.parseUserAgent)(webOSOther);
80
- expect(actual).toMatchObject(expected);
81
- });
82
- test('should return webOS -1 + LuneOS 1', function () {
83
- var expected = {
84
- webos: -1,
85
- luneos: 1
86
- };
87
- expect((0, _platform.parseUserAgent)(LuneOS1)).toMatchObject(expected);
88
- expect((0, _platform.parseUserAgent)(LuneOS2)).toMatchObject(expected);
89
- });
90
- test('should return webOS -1 + legacy 1', function () {
91
- var expected = {
92
- webos: -1,
93
- legacy: 1
94
- };
95
- expect((0, _platform.parseUserAgent)(webOS10)).toMatchObject(expected);
96
- expect((0, _platform.parseUserAgent)(webOS11)).toMatchObject(expected);
97
- expect((0, _platform.parseUserAgent)(webOS12)).toMatchObject(expected);
98
- expect((0, _platform.parseUserAgent)(webOS13)).toMatchObject(expected);
99
- expect((0, _platform.parseUserAgent)(webOS1351)).toMatchObject(expected);
100
- });
101
- test('should return webOS -1 + legacy 2', function () {
102
- var expected = {
103
- webos: -1,
104
- legacy: 2
105
- };
106
- expect((0, _platform.parseUserAgent)(webOS2)).toMatchObject(expected);
107
- });
108
- });
109
- describe('parseUserAgent for Windows Phone', function () {
110
- var windowsPhone = 'Mozilla/5.0 (Windows Phone 8.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4103.84 Mobile Safari/537.36';
111
- test('should return platformName `windowsPhone`', function () {
112
- var expected = {
113
- platformName: 'windowsPhone'
114
- };
115
- var actual = (0, _platform.parseUserAgent)(windowsPhone);
116
- expect(actual).toMatchObject(expected);
117
- });
118
- });
119
- describe('parseUserAgent for Edge', function () {
120
- var edge1 = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42';
121
- var edge2 = 'Mozilla/5.0 (Linux; Android 10; HD1913) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.76 Mobile Safari/537.36 EdgA/113.0.1774.38';
122
- var edge3 = 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 EdgiOS/113.1774.42 Mobile/15E148 Safari/605.1.15';
123
- var edge4 = 'Mozilla/5.0 (Windows Mobile 10; Android 10.0; Microsoft; Lumia 950XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Mobile Safari/537.36 Edge/40.15254.603';
124
- test('should return edge for Edg', function () {
125
- var expected = {
126
- platformName: 'edge'
127
- };
128
- var actual = (0, _platform.parseUserAgent)(edge1);
129
- expect(actual).toMatchObject(expected);
130
- expected = {
131
- chrome: 113
132
- };
133
- expect(actual).toMatchObject(expected);
134
- expected = {
135
- edge: 113
136
- };
137
- expect(actual).toMatchObject(expected);
138
- });
139
- test('should return edge for EdgA', function () {
140
- var expected = {
141
- platformName: 'edge'
142
- };
143
- var actual = (0, _platform.parseUserAgent)(edge2);
144
- expect(actual).toMatchObject(expected);
145
- expected = {
146
- chrome: 113
147
- };
148
- expect(actual).toMatchObject(expected);
149
- expected = {
150
- edge: 113
151
- };
152
- expect(actual).toMatchObject(expected);
153
- });
154
- test('should return edge for EdgiOS', function () {
155
- var expected = {
156
- platformName: 'edge'
157
- };
158
- var actual = (0, _platform.parseUserAgent)(edge3);
159
- expect(actual).toMatchObject(expected);
160
- expected = {
161
- chrome: 113
162
- };
163
- expect(actual).not.toMatchObject(expected);
164
- expected = {
165
- edge: 113
166
- };
167
- expect(actual).toMatchObject(expected);
168
- });
169
- test('should return edge for Edge', function () {
170
- var expected = {
171
- platformName: 'edge'
172
- };
173
- var actual = (0, _platform.parseUserAgent)(edge4);
174
- expect(actual).toMatchObject(expected);
175
- expected = {
176
- chrome: 113
177
- };
178
- expect(actual).toMatchObject(expected);
179
- expected = {
180
- edge: 40
181
- };
182
- expect(actual).toMatchObject(expected);
183
- });
184
- });
185
5
  describe('parseUserAgent for User-Agent Reduction', function () {
186
6
  var testVersion = '113';
187
7
  var uaGenerator = function uaGenerator(unifiedPlatform) {
@@ -189,7 +9,7 @@ describe('platform', function () {
189
9
  var majorVersion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : testVersion;
190
10
  return "Mozilla/5.0 (".concat(unifiedPlatform, ") AppleWebKit/537.36 (KHTML, like Gecko) Chrome/").concat(majorVersion, ".0.0.0 ").concat(deviceCompatibility, " Safari/537.36");
191
11
  };
192
- var testCases = [[uaGenerator('Macintosh; Intel Mac OS X 10_15_7'), 'chrome'], [uaGenerator('Windows NT 10.0; Win64; x64'), 'chrome'], [uaGenerator('X11; Linux x86_64'), 'chrome'], [uaGenerator('X11; CrOS x86_64 14541.0.0'), 'chrome'], [uaGenerator('Fuchsia'), 'chrome'], [uaGenerator('Linux; Android 10; K', 'Mobile'), 'androidChrome']];
12
+ var testCases = [[uaGenerator('Macintosh; Intel Mac OS X 10_15_7'), 'chrome'], [uaGenerator('Windows NT 10.0; Win64; x64'), 'chrome'], [uaGenerator('X11; Linux x86_64'), 'chrome'], [uaGenerator('X11; CrOS x86_64 14541.0.0'), 'chrome'], [uaGenerator('Fuchsia'), 'chrome'], [uaGenerator('Linux; Android 10; K', 'Mobile'), 'chrome']];
193
13
  test("should return object including chrome ".concat(testVersion), function () {
194
14
  for (var i = 0; i < testCases.length; i++) {
195
15
  var _parseUserAgent;
@@ -334,8 +154,6 @@ describe('platform', function () {
334
154
  test('should detect node environment if \'window\' does not exist', function () {
335
155
  var windowSpy = jest.spyOn(window, 'window', 'get').mockImplementation(function () {});
336
156
  var expected = {
337
- node: true,
338
- // Deprecated: will be removed in 5.0.0.
339
157
  type: 'node',
340
158
  browserName: 'unknown',
341
159
  browserVersion: 0
@@ -343,12 +161,5 @@ describe('platform', function () {
343
161
  expect(_platform.platform).toMatchObject(expected);
344
162
  windowSpy.mockRestore();
345
163
  });
346
- test('should return `true` for `unknown` in the testing environment', function () {
347
- // Deprecated: will be removed in 5.0.0
348
- // The first access invokes detecting based on user agent value
349
- expect(_platform.platform['unknown']).toBe(true);
350
- // The second access makes the module to return already detected platform information
351
- expect(_platform.platform['unknown']).toBe(true);
352
- });
353
164
  });
354
165
  });
@@ -7,7 +7,7 @@ var _jsxRuntime = require("react/jsx-runtime");
7
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
8
  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, _toPropertyKey(descriptor.key), descriptor); } }
9
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
11
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
13
  describe('useClass', function () {
@@ -7,7 +7,7 @@ exports["default"] = exports.Handlers = void 0;
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
  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, _toPropertyKey(descriptor.key), descriptor); } }
9
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
11
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  var Handlers = exports.Handlers = /*#__PURE__*/function () {
13
13
  function Handlers(_handlers) {
@@ -8,7 +8,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
8
8
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
9
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
10
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
12
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
13
  describe('useHandlers', function () {
14
14
  var data = {};
package/util/Job.js CHANGED
@@ -9,7 +9,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
9
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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, _toPropertyKey(descriptor.key), descriptor); } }
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
13
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
14
  /**
15
15
  * Provides a convenient way to manage timed execution of functions.
package/util/util.js CHANGED
@@ -17,7 +17,7 @@ var _react = require("react");
17
17
  var ReactIs = _interopRequireWildcard(require("react-is"));
18
18
  var _Job = _interopRequireDefault(require("./Job"));
19
19
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
21
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
22
22
  /**
23
23
  * A collection of utility methods.