@enact/spotlight 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.
@@ -3,7 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Accelerator = exports["default"] = void 0;
6
+ exports["default"] = exports.Accelerator = void 0;
7
+
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, descriptor.key, descriptor); } }
9
+
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; }
7
11
 
8
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
13
 
@@ -18,7 +22,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
18
22
  * @class Accelerator
19
23
  * @memberof spotlight/Accelerator
20
24
  */
21
- var Accelerator =
25
+ var Accelerator = /*#__PURE__*/_createClass(
22
26
  /**
23
27
  * @constructor
24
28
  * @param {Number[]} frequency - Controls the frequency with which the acceleration will
@@ -155,7 +159,7 @@ function Accelerator() {
155
159
  * @public
156
160
  * @memberof spotlight/Accelerator.Accelerator.prototype
157
161
  */
158
- ;
162
+ );
159
163
 
160
164
  exports.Accelerator = Accelerator;
161
165
  var _default = Accelerator;
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  The following is a curated list of changes in the Enact spotlight module, newest changes on the top.
4
4
 
5
+ ## [4.5.0-beta.1] - 2022-05-31
6
+
7
+ ### Added
8
+
9
+ - `spotlight` an optional `containerOption.toOuterContainer` parameter to `focus` function to search target recursively to outer container
10
+
11
+ ## [4.5.0-alpha.2] - 2022-05-09
12
+
13
+ ### Changed
14
+
15
+ - `spotlight` to not focus on an invisible element
16
+
17
+ ## [4.5.0-alpha.1] - 2022-04-15
18
+
19
+ No significant changes.
20
+
5
21
  ## [4.1.4] - 2022-03-24
6
22
 
7
23
  No significant changes.
package/Pause/Pause.js CHANGED
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports["default"] = exports.Pause = void 0;
6
7
  exports.isPaused = isPaused;
7
8
  exports.pause = pause;
8
9
  exports.resume = _resume;
9
- exports.Pause = exports["default"] = void 0;
10
10
 
11
11
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
12
 
13
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
14
 
15
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
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
16
 
17
17
  /**
18
18
  * Provides a class which allows consumers to safely pause and resume spotlight without resuming
@@ -2,9 +2,9 @@
2
2
 
3
3
  var _Pause = _interopRequireWildcard(require("../Pause"));
4
4
 
5
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
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
  var PAUSED = 'Paused';
10
10
  var NOT_PAUSED = 'Not Paused';
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SpotlightContainer = exports["default"] = void 0;
6
+ exports["default"] = exports.SpotlightContainer = void 0;
7
7
 
8
8
  var _handle = require("@enact/core/handle");
9
9
 
@@ -13,9 +13,9 @@ var _spotlight = _interopRequireDefault(require("../src/spotlight"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
16
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
16
+ 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; }
17
17
 
18
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
18
+ 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; }
19
19
 
20
20
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
21
 
@@ -23,7 +23,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
23
23
 
24
24
  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); } }
25
25
 
26
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
26
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
27
27
 
28
28
  var isNewPointerPosition = function isNewPointerPosition(ev) {
29
29
  return (0, _pointer.hasPointerMoved)(ev.clientX, ev.clientY);
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.spotlightDefaultClass = exports["default"] = exports.SpotlightContainerDecorator = void 0;
6
7
  Object.defineProperty(exports, "useSpotlightContainer", {
7
8
  enumerable: true,
8
9
  get: function get() {
9
10
  return _useSpotlightContainer["default"];
10
11
  }
11
12
  });
12
- exports.spotlightDefaultClass = exports.SpotlightContainerDecorator = exports["default"] = void 0;
13
13
 
14
14
  var _handle = _interopRequireWildcard(require("@enact/core/handle"));
15
15
 
@@ -25,35 +25,38 @@ var _useSpotlightContainer = _interopRequireDefault(require("./useSpotlightConta
25
25
 
26
26
  var _jsxRuntime = require("react/jsx-runtime");
27
27
 
28
+ var _excluded = ["navigableFilter", "preserveId"],
29
+ _excluded2 = ["spotlightDisabled", "spotlightId", "spotlightMuted", "spotlightRestrict"];
30
+
28
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
32
 
30
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
33
+ 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); }
31
34
 
32
- 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; }
35
+ 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; }
33
36
 
34
37
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
35
38
 
36
39
  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); } }
37
40
 
38
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
41
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
39
42
 
40
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
43
+ 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); }
41
44
 
42
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
43
46
 
44
47
  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); }; }
45
48
 
46
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
49
+ 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); }
47
50
 
48
51
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
49
52
 
50
53
  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; } }
51
54
 
52
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
55
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
53
56
 
54
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
57
+ 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; }
55
58
 
56
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
59
+ 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; }
57
60
 
58
61
  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; }
59
62
 
@@ -189,7 +192,7 @@ var defaultConfig = {
189
192
  var SpotlightContainerDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
190
193
  var navigableFilter = config.navigableFilter,
191
194
  preserveId = config.preserveId,
192
- containerConfig = _objectWithoutProperties(config, ["navigableFilter", "preserveId"]); // eslint-disable-next-line no-shadow
195
+ containerConfig = _objectWithoutProperties(config, _excluded); // eslint-disable-next-line no-shadow
193
196
 
194
197
 
195
198
  function SpotlightContainerDecorator(props) {
@@ -197,7 +200,7 @@ var SpotlightContainerDecorator = (0, _hoc["default"])(defaultConfig, function (
197
200
  spotlightId = props.spotlightId,
198
201
  spotlightMuted = props.spotlightMuted,
199
202
  spotlightRestrict = props.spotlightRestrict,
200
- rest = _objectWithoutProperties(props, ["spotlightDisabled", "spotlightId", "spotlightMuted", "spotlightRestrict"]);
203
+ rest = _objectWithoutProperties(props, _excluded2);
201
204
 
202
205
  var spotlightContainer = (0, _useSpotlightContainer["default"])({
203
206
  id: spotlightId,
@@ -18,9 +18,9 @@ var _jsxRuntime = require("react/jsx-runtime");
18
18
 
19
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
20
20
 
21
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
21
+ 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; }
22
22
 
23
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23
+ 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; }
24
24
 
25
25
  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; }
26
26
 
@@ -12,11 +12,13 @@ var _spotlight = _interopRequireDefault(require("../../src/spotlight"));
12
12
 
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
14
 
15
+ var _excluded = ["containerConfig", "preserveId", "spotlightDisabled", "spotlightId", "spotlightMuted", "spotlightRestrict"];
16
+
15
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
18
 
17
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
19
+ 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
20
 
19
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
+ 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
22
 
21
23
  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
24
 
@@ -38,7 +40,7 @@ describe('useSpotlightContainer', function () {
38
40
  spotlightId = props.spotlightId,
39
41
  spotlightMuted = props.spotlightMuted,
40
42
  spotlightRestrict = props.spotlightRestrict,
41
- rest = _objectWithoutProperties(props, ["containerConfig", "preserveId", "spotlightDisabled", "spotlightId", "spotlightMuted", "spotlightRestrict"]);
43
+ rest = _objectWithoutProperties(props, _excluded);
42
44
 
43
45
  var spotlightContainer = (0, _useSpotlightContainer["default"])({
44
46
  id: spotlightId,
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useSpotlightContainer = useSpotlightContainer;
7
6
  exports["default"] = void 0;
7
+ exports.useSpotlightContainer = useSpotlightContainer;
8
8
 
9
9
  var _useClass = _interopRequireDefault(require("@enact/core/useClass"));
10
10
 
@@ -12,6 +12,8 @@ var _react = require("react");
12
12
 
13
13
  var _SpotlightContainer = _interopRequireDefault(require("./SpotlightContainer"));
14
14
 
15
+ var _excluded = ["disabled", "id", "muted", "restrict"];
16
+
15
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
18
 
17
19
  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; }
@@ -104,7 +106,7 @@ function useSpotlightContainer() {
104
106
  id = config.id,
105
107
  muted = config.muted,
106
108
  restrict = config.restrict,
107
- rest = _objectWithoutProperties(config, ["disabled", "id", "muted", "restrict"]);
109
+ rest = _objectWithoutProperties(config, _excluded);
108
110
 
109
111
  var spotlightContainer = (0, _useClass["default"])(_SpotlightContainer["default"], rest);
110
112
  spotlightContainer.setProps({
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setInputType = exports.getInputType = exports.activateInputType = exports.SpotlightRootDecorator = exports["default"] = void 0;
6
+ exports.setInputType = exports.getInputType = exports["default"] = exports.activateInputType = exports.SpotlightRootDecorator = void 0;
7
7
 
8
8
  var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
9
9
 
@@ -23,9 +23,9 @@ var _jsxRuntime = require("react/jsx-runtime");
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
25
 
26
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
26
+ 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; }
27
27
 
28
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
28
+ 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; }
29
29
 
30
30
  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; }
31
31
 
@@ -33,21 +33,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
33
33
 
34
34
  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); } }
35
35
 
36
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
36
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
37
 
38
- 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); }
38
+ 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); }
39
39
 
40
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
40
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
41
 
42
42
  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); }; }
43
43
 
44
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
44
+ 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); }
45
45
 
46
46
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
47
47
 
48
48
  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; } }
49
49
 
50
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
50
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
51
 
52
52
  var input = {
53
53
  activated: false,
@@ -122,10 +122,10 @@ var defaultConfig = {
122
122
  */
123
123
 
124
124
  var SpotlightRootDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
125
- var _class, _temp;
125
+ var _class;
126
126
 
127
127
  var noAutoFocus = config.noAutoFocus;
128
- return _temp = _class = /*#__PURE__*/function (_Component) {
128
+ return _class = /*#__PURE__*/function (_Component) {
129
129
  _inherits(_class, _Component);
130
130
 
131
131
  var _super = _createSuper(_class);
@@ -269,7 +269,7 @@ var SpotlightRootDecorator = (0, _hoc["default"])(defaultConfig, function (confi
269
269
  }]);
270
270
 
271
271
  return _class;
272
- }(_react.Component), _class.displayName = 'SpotlightRootDecorator', _temp;
272
+ }(_react.Component), _class.displayName = 'SpotlightRootDecorator', _class;
273
273
  });
274
274
  exports.SpotlightRootDecorator = SpotlightRootDecorator;
275
275
  var _default = SpotlightRootDecorator;
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports["default"] = exports.Spottable = void 0;
6
7
  Object.defineProperty(exports, "spottableClass", {
7
8
  enumerable: true,
8
9
  get: function get() {
@@ -15,7 +16,6 @@ Object.defineProperty(exports, "useSpottable", {
15
16
  return _useSpottable.useSpottable;
16
17
  }
17
18
  });
18
- exports.Spottable = exports["default"] = void 0;
19
19
 
20
20
  var _handle = _interopRequireWildcard(require("@enact/core/handle"));
21
21
 
@@ -37,35 +37,37 @@ var _useSpottable = require("./useSpottable");
37
37
 
38
38
  var _jsxRuntime = require("react/jsx-runtime");
39
39
 
40
+ var _excluded = ["className", "disabled", "handleForceUpdate", "onSpotlightDisappear", "onSpotlightDown", "onSpotlightLeft", "onSpotlightRight", "onSpotlightUp", "selectionKeys", "spotlightDisabled", "spotlightId", "spotRef"];
41
+
40
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
41
43
 
42
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
44
+ 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); }
43
45
 
44
- 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; }
46
+ 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; }
45
47
 
46
48
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
47
49
 
48
50
  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); } }
49
51
 
50
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
52
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
51
53
 
52
- 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); }
54
+ 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); }
53
55
 
54
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
56
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
55
57
 
56
58
  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); }; }
57
59
 
58
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
60
+ 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); }
59
61
 
60
62
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
61
63
 
62
64
  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; } }
63
65
 
64
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
66
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
65
67
 
66
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
68
+ 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; }
67
69
 
68
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
70
+ 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; }
69
71
 
70
72
  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; }
71
73
 
@@ -159,7 +161,7 @@ var Spottable = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
159
161
  spotlightDisabled = props.spotlightDisabled,
160
162
  spotlightId = props.spotlightId,
161
163
  spotRef = props.spotRef,
162
- rest = _objectWithoutProperties(props, ["className", "disabled", "handleForceUpdate", "onSpotlightDisappear", "onSpotlightDown", "onSpotlightLeft", "onSpotlightRight", "onSpotlightUp", "selectionKeys", "spotlightDisabled", "spotlightId", "spotRef"]);
164
+ rest = _objectWithoutProperties(props, _excluded);
163
165
 
164
166
  var spot = (0, _useSpottable.useSpottable)({
165
167
  disabled: disabled,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.spottableClass = exports.SpottableCore = exports["default"] = void 0;
6
+ exports.spottableClass = exports["default"] = exports.SpottableCore = void 0;
7
7
 
8
8
  var _handle = require("@enact/core/handle");
9
9
 
@@ -17,7 +17,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
17
17
 
18
18
  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); } }
19
19
 
20
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
20
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
21
 
22
22
  var REMOTE_OK_KEY = 16777221;
23
23
  /**
@@ -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); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
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] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
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
 
@@ -20,35 +20,37 @@ var _useSpottable = _interopRequireDefault(require("../useSpottable"));
20
20
 
21
21
  var _jsxRuntime = require("react/jsx-runtime");
22
22
 
23
+ var _excluded = ["className", "component", "componentRef", "disabled", "emulateMouse", "onSelectionCancel", "onSpotlightDisappear", "onSpotlightDown", "onSpotlightLeft", "onSpotlightRight", "onSpotlightUp", "selectionKeys", "spotlightDisabled", "spotlightId"];
24
+
23
25
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
24
26
 
25
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
27
+ 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); }
26
28
 
27
- 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; }
29
+ 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; }
28
30
 
29
31
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30
32
 
31
33
  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); } }
32
34
 
33
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
35
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
34
36
 
35
- 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); }
37
+ 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); }
36
38
 
37
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
38
40
 
39
41
  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); }; }
40
42
 
41
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
43
+ 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); }
42
44
 
43
45
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
44
46
 
45
47
  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; } }
46
48
 
47
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
49
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
48
50
 
49
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
51
+ 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; }
50
52
 
51
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
53
+ 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; }
52
54
 
53
55
  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; }
54
56
 
@@ -103,7 +105,7 @@ describe('useSpottable', function () {
103
105
  selectionKeys = props.selectionKeys,
104
106
  spotlightDisabled = props.spotlightDisabled,
105
107
  spotlightId = props.spotlightId,
106
- rest = _objectWithoutProperties(props, ["className", "component", "componentRef", "disabled", "emulateMouse", "onSelectionCancel", "onSpotlightDisappear", "onSpotlightDown", "onSpotlightLeft", "onSpotlightRight", "onSpotlightUp", "selectionKeys", "spotlightDisabled", "spotlightId"]);
108
+ rest = _objectWithoutProperties(props, _excluded);
107
109
 
108
110
  var spot = (0, _useSpottable["default"])({
109
111
  disabled: disabled,
@@ -3,13 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports["default"] = void 0;
6
7
  Object.defineProperty(exports, "spottableClass", {
7
8
  enumerable: true,
8
9
  get: function get() {
9
10
  return _SpottableCore.spottableClass;
10
11
  }
11
12
  });
12
- exports.useSpottable = exports["default"] = void 0;
13
+ exports.useSpottable = void 0;
13
14
 
14
15
  var _useClass = _interopRequireDefault(require("@enact/core/useClass"));
15
16
 
@@ -19,11 +20,13 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
19
20
 
20
21
  var _SpottableCore = require("./SpottableCore");
21
22
 
23
+ var _excluded = ["spotRef", "emulateMouse", "selectionKeys", "spotlightDisabled"];
24
+
22
25
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
26
 
24
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
27
+ 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
28
 
26
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
29
+ 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
30
 
28
31
  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
32
 
@@ -88,7 +91,7 @@ var useSpottable = function useSpottable() {
88
91
  _ref$selectionKeys = _ref.selectionKeys,
89
92
  selectionKeys = _ref$selectionKeys === void 0 ? [ENTER_KEY, REMOTE_OK_KEY] : _ref$selectionKeys,
90
93
  spotlightDisabled = _ref.spotlightDisabled,
91
- props = _objectWithoutProperties(_ref, ["spotRef", "emulateMouse", "selectionKeys", "spotlightDisabled"]);
94
+ props = _objectWithoutProperties(_ref, _excluded);
92
95
 
93
96
  var hook = (0, _useClass["default"])(_SpottableCore.SpottableCore, {
94
97
  emulateMouse: emulateMouse
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enact/spotlight",
3
- "version": "4.1.4",
3
+ "version": "4.5.0-beta.1",
4
4
  "description": "A focus management library",
5
5
  "main": "src/spotlight.js",
6
6
  "scripts": {
@@ -18,12 +18,12 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@enact/core": "^4.1.4",
21
+ "@enact/core": "^4.5.0-beta.1",
22
22
  "classnames": "^2.3.1",
23
- "prop-types": "^15.8.0",
24
- "ramda": "^0.27.1",
25
- "react": "^17.0.2",
26
- "react-dom": "^17.0.2",
23
+ "prop-types": "^15.8.1",
24
+ "ramda": "^0.28.0",
25
+ "react": "^18.0.0",
26
+ "react-dom": "^18.0.0",
27
27
  "warning": "^4.0.3"
28
28
  }
29
29
  }
package/src/container.js CHANGED
@@ -3,32 +3,39 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.getContainerConfig = exports.getAllContainerIds = exports.containerAttribute = exports.configureDefaults = exports.configureContainer = exports.addContainer = void 0;
6
7
  exports.getContainerDefaultElement = getContainerDefaultElement;
8
+ exports.getContainerFocusTarget = getContainerFocusTarget;
9
+ exports.getContainerId = void 0;
7
10
  exports.getContainerLastFocusedElement = getContainerLastFocusedElement;
8
11
  exports.getContainerNavigableElements = getContainerNavigableElements;
9
- exports.getContainersForNode = getContainersForNode;
10
- exports.setContainerLastFocusedElement = setContainerLastFocusedElement;
11
- exports.getContainerFocusTarget = getContainerFocusTarget;
12
+ exports.getContainerNode = void 0;
12
13
  exports.getContainerPreviousTarget = getContainerPreviousTarget;
14
+ exports.getContainersForNode = getContainersForNode;
15
+ exports.getDeepSpottableDescendants = void 0;
13
16
  exports.getDefaultContainer = getDefaultContainer;
14
17
  exports.getLastContainer = getLastContainer;
15
18
  exports.getNavigableContainersForNode = getNavigableContainersForNode;
19
+ exports.isNavigable = exports.isContainer5WayHoldable = exports.isContainer = exports.getSpottableDescendants = void 0;
16
20
  exports.isWithinOverflowContainer = isWithinOverflowContainer;
17
21
  exports.mayActivateContainer = mayActivateContainer;
22
+ exports.notifyEnterContainer = notifyEnterContainer;
18
23
  exports.notifyLeaveContainer = notifyLeaveContainer;
19
24
  exports.notifyLeaveContainerFail = notifyLeaveContainerFail;
20
- exports.notifyEnterContainer = notifyEnterContainer;
25
+ exports.rootContainerId = exports.removeContainer = exports.removeAllContainers = void 0;
26
+ exports.setContainerLastFocusedElement = setContainerLastFocusedElement;
21
27
  exports.setContainerPreviousTarget = setContainerPreviousTarget;
22
28
  exports.setDefaultContainer = setDefaultContainer;
23
29
  exports.setLastContainer = setLastContainer;
24
30
  exports.setLastContainerFromTarget = setLastContainerFromTarget;
25
31
  exports.unmountContainer = unmountContainer;
26
- exports.rootContainerId = exports.removeContainer = exports.removeAllContainers = exports.isNavigable = exports.isContainer = exports.getSpottableDescendants = exports.getDeepSpottableDescendants = exports.getContainerId = exports.configureContainer = exports.configureDefaults = exports.containerAttribute = exports.addContainer = exports.isContainer5WayHoldable = exports.getContainerConfig = exports.getContainerNode = exports.getAllContainerIds = void 0;
27
32
 
28
33
  var _and = _interopRequireDefault(require("ramda/src/and"));
29
34
 
30
35
  var _concat = _interopRequireDefault(require("ramda/src/concat"));
31
36
 
37
+ var _snapshot = require("@enact/core/snapshot");
38
+
32
39
  var _util = require("@enact/core/util");
33
40
 
34
41
  var _intersection = _interopRequireDefault(require("ramda/src/intersection"));
@@ -39,9 +46,9 @@ var _utils = require("./utils");
39
46
 
40
47
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
41
48
 
42
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
49
+ 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; }
43
50
 
44
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
51
+ 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; }
45
52
 
46
53
  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; }
47
54
 
@@ -142,18 +149,14 @@ var GlobalConfig = {
142
149
  */
143
150
 
144
151
  var querySelector = function querySelector(node, includeSelector, excludeSelector) {
145
- var include = Array.prototype.slice.call(node.querySelectorAll(includeSelector));
152
+ var include = new Set(node.querySelectorAll(includeSelector));
146
153
  var exclude = node.querySelectorAll(excludeSelector);
147
154
 
148
155
  for (var i = 0; i < exclude.length; i++) {
149
- var index = include.indexOf(exclude.item(i));
150
-
151
- if (index >= 0) {
152
- include.splice(index, 1);
153
- }
156
+ include["delete"](exclude[i]);
154
157
  }
155
158
 
156
- return include;
159
+ return Array.from(include);
157
160
  };
158
161
  /**
159
162
  * Determines if `node` is a spotlight container
@@ -337,8 +340,13 @@ var getContainerNode = function getContainerNode(containerId) {
337
340
  exports.getContainerNode = getContainerNode;
338
341
 
339
342
  var navigableFilter = function navigableFilter(node, containerId) {
343
+ var nodeStyle = node && (0, _snapshot.isWindowReady)() && window.getComputedStyle(node);
340
344
  var config = getContainerConfig(containerId);
341
345
 
346
+ if (!nodeStyle || nodeStyle.display === 'none' || nodeStyle.visibility === 'hidden') {
347
+ return false;
348
+ }
349
+
342
350
  if (config && typeof config.navigableFilter === 'function') {
343
351
  if (config.navigableFilter(node, containerId) === false) {
344
352
  return false;
@@ -725,9 +733,8 @@ var getAllContainerIds = function getAllContainerIds() {
725
733
  /**
726
734
  * Returns the default focus element for a container
727
735
  *
728
- * @param {String} containerId ID of container
729
- * @param {('last-focused'|'default-element')} [preferredEnterTo] Prefer the given enterTo
730
- * configuration
736
+ * @param {String} containerId Container ID
737
+ * @param {('last-focused'|'default-element'|'topmost')} [preferredEnterTo] Prefer the given enterTo configuration
731
738
  *
732
739
  * @returns {Node|null} Default focus element
733
740
  * @memberof spotlight/container
@@ -831,9 +838,8 @@ function setContainerLastFocusedElement(node, containerIds) {
831
838
  * return that element as the only element in an array. If that fails or if navigation is not
832
839
  * restricted, it will return an array of all possible navigable nodes.
833
840
  *
834
- * @param {String} containerId Container ID
835
- * @param {('last-focused'|'default-element')} [preferredEnterTo] Prefer the given enterTo
836
- * configuration
841
+ * @param {String} containerId Container ID
842
+ * @param {('last-focused'|'default-element'|'topmost')} [preferredEnterTo] Prefer the given enterTo configuration
837
843
  *
838
844
  * @returns {Node[]} Navigable elements within container
839
845
  * @memberof spotlight/container
@@ -877,6 +883,12 @@ function getContainerNavigableElements(containerId, preferredEnterTo) {
877
883
 
878
884
  return (0, _utils.contains)(containerRect, (0, _utils.getRect)(element));
879
885
  });
886
+
887
+ if (next && preferredEnterTo === 'topmost') {
888
+ next.sort(function (a, b) {
889
+ return (0, _utils.getRect)(a).top - (0, _utils.getRect)(b).top;
890
+ });
891
+ }
880
892
  } // otherwise, return all spottables within the container
881
893
 
882
894
 
@@ -891,9 +903,8 @@ function getContainerNavigableElements(containerId, preferredEnterTo) {
891
903
  * Determines the preferred focus target, traversing any sub-containers as necessary, for the given
892
904
  * container.
893
905
  *
894
- * @param {String} containerId ID of container
895
- * @param {('last-focused'|'default-element')} [preferredEnterTo] Prefer the given enterTo
896
- * configuration
906
+ * @param {String} containerId Container ID
907
+ * @param {('last-focused'|'default-element'|'topmost')} [preferredEnterTo] Prefer the given enterTo configuration
897
908
  *
898
909
  * @returns {Node} Preferred target as either a DOM node or container-id
899
910
  * @memberof spotlight/container
package/src/navigate.js CHANGED
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.navigate = navigate;
7
6
  exports["default"] = void 0;
7
+ exports.navigate = navigate;
8
8
  var obliqueMinDistance = 1;
9
9
  var straightMinDistance = 0;
10
10
 
package/src/spotlight.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Spotlight = exports.getDirection = exports["default"] = void 0;
6
+ exports.getDirection = exports["default"] = exports.Spotlight = void 0;
7
7
 
8
8
  var _keymap = require("@enact/core/keymap");
9
9
 
@@ -691,8 +691,12 @@ var Spotlight = function () {
691
691
  * @param {String|Node} [elem] The spotlight ID or selector for either a spottable
692
692
  * component or a spotlight container, or spottable node. If not supplied, the default
693
693
  * container will be focused.
694
- * @param {Object} [containerOption] An optional object containing preferred `enterTo`.
695
- * It will be passed to the `getTargetByContainer` when `elem` is a container.
694
+ * @param {Object} [containerOption] The object including `enterTo` and `toOuterContainer`.
695
+ * It works when the first parameter `elem` is either a spotlight container ID or a spotlight container node.
696
+ * @param {('last-focused'|'default-element'|'topmost')} [containerOption.enterTo] Specifies preferred
697
+ * `enterTo` configuration.
698
+ * @param {Boolean} [containerOption.toOuterContainer] If the proper target is not found, search one
699
+ * recursively to outer container.
696
700
  * @returns {Boolean} `true` if focus successful, `false` if not.
697
701
  * @public
698
702
  */
@@ -700,6 +704,7 @@ var Spotlight = function () {
700
704
  var containerOption = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
701
705
  var target = elem;
702
706
  var wasContainerId = false;
707
+ var currentContainerNode = null;
703
708
 
704
709
  if (!elem) {
705
710
  target = (0, _target.getTargetByContainer)();
@@ -707,6 +712,7 @@ var Spotlight = function () {
707
712
  if ((0, _container.getContainerConfig)(elem)) {
708
713
  target = (0, _target.getTargetByContainer)(elem, containerOption.enterTo);
709
714
  wasContainerId = true;
715
+ currentContainerNode = (0, _container.getContainerNode)(elem);
710
716
  } else if (/^[\w\d-]+$/.test(elem)) {
711
717
  // support component IDs consisting of alphanumeric, dash, or underscore
712
718
  target = (0, _target.getTargetBySelector)("[data-spotlight-id=".concat(elem, "]"));
@@ -715,6 +721,7 @@ var Spotlight = function () {
715
721
  }
716
722
  } else if ((0, _container.isContainer)(elem)) {
717
723
  target = (0, _target.getTargetByContainer)((0, _container.getContainerId)(elem), containerOption.enterTo);
724
+ currentContainerNode = elem;
718
725
  }
719
726
 
720
727
  var nextContainerIds = (0, _container.getContainersForNode)(target);
@@ -734,6 +741,14 @@ var Spotlight = function () {
734
741
  (0, _container.setLastContainer)(elem);
735
742
  }
736
743
 
744
+ if (containerOption.toOuterContainer && currentContainerNode) {
745
+ var outerContainer = (0, _container.getContainersForNode)(currentContainerNode.parentElement).pop();
746
+
747
+ if (outerContainer) {
748
+ return this.focus(outerContainer, containerOption);
749
+ }
750
+ }
751
+
737
752
  return false;
738
753
  },
739
754
  // move(<direction>)
package/src/target.js CHANGED
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getNavigableTarget = getNavigableTarget;
7
+ exports.getNearestTargetFromPosition = void 0;
7
8
  exports.getTargetByContainer = getTargetByContainer;
8
9
  exports.getTargetByDirectionFromElement = getTargetByDirectionFromElement;
9
10
  exports.getTargetByDirectionFromPosition = getTargetByDirectionFromPosition;
10
11
  exports.getTargetBySelector = getTargetBySelector;
11
12
  exports.isFocusable = isFocusable;
12
- exports.getNearestTargetFromPosition = void 0;
13
13
 
14
14
  var _clamp = _interopRequireDefault(require("ramda/src/clamp"));
15
15
 
@@ -23,9 +23,9 @@ var _utils = require("./utils");
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
25
 
26
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
26
+ 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; }
27
27
 
28
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
28
+ 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; }
29
29
 
30
30
  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; }
31
31
 
@@ -99,7 +99,7 @@ describe('Spotlight', function () {
99
99
 
100
100
  expect(fn).toBeCalled();
101
101
  }));
102
- test('should focus container by node', (0, _utils.testScenario)(scenarios.complexTree, function (root) {
102
+ test('should focus container by selector', (0, _utils.testScenario)(scenarios.complexTree, function (root) {
103
103
  (0, _container4.configureContainer)('first-container');
104
104
  var n = root.querySelector('[data-spotlight-id="first-container"]');
105
105
  var fn = mockFocus(n.querySelector('.spottable'));
@@ -11,9 +11,9 @@ var _container = require("../container");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
13
 
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
14
+ 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; }
15
15
 
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
+ 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; }
17
17
 
18
18
  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; }
19
19
 
package/src/utils.js CHANGED
@@ -3,12 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.contains = void 0;
6
7
  exports.getContainerRect = getContainerRect;
7
8
  exports.getPointRect = getPointRect;
8
9
  exports.getRect = getRect;
9
10
  exports.getRects = getRects;
11
+ exports.matchSelector = exports.intersects = void 0;
10
12
  exports.parseSelector = parseSelector;
11
- exports.matchSelector = exports.intersects = exports.contains = void 0;
12
13
 
13
14
  var _curry = _interopRequireDefault(require("ramda/src/curry"));
14
15