@enact/spotlight 4.6.2 → 4.7.0

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.
@@ -142,6 +142,33 @@ function Accelerator() {
142
142
  * @returns {Boolean} `true` if the event was consumed by processKey and callback was not called
143
143
  * @public
144
144
  * @memberof spotlight/Accelerator.Accelerator.prototype
145
+ */
146
+
147
+ /**
148
+ * Resets the Accelerator instance to the default values.
149
+ *
150
+ * @function
151
+ * @returns {undefined}
152
+ * @public
153
+ * @memberof spotlight/Accelerator.Accelerator.prototype
154
+ */
155
+
156
+ /**
157
+ * Cancels the Accelerator.
158
+ *
159
+ * @function
160
+ * @returns {undefined}
161
+ * @public
162
+ * @memberof spotlight/Accelerator.Accelerator.prototype
163
+ */
164
+
165
+ /**
166
+ * Verifies that the Accelerator is active.
167
+ *
168
+ * @function
169
+ * @returns {Boolean} `true` if the Accelerator is active; otherwise, `false`.
170
+ * @public
171
+ * @memberof spotlight/Accelerator.Accelerator.prototype
145
172
  */);
146
173
  exports.Accelerator = Accelerator;
147
174
  var _default = Accelerator;
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
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.7.0] - 2023-04-25
6
+
7
+ ### Fixed
8
+
9
+ - `spotlight` to show the focus effect when pointer mode is changed to `false` while an app is loading
10
+
5
11
  ## [4.6.2] - 2023-03-09
6
12
 
7
13
  No significant changes.
@@ -19,6 +19,12 @@ var _useSpotlightContainer = _interopRequireDefault(require("./useSpotlightConta
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
20
  var _excluded = ["navigableFilter", "preserveId"],
21
21
  _excluded2 = ["spotlightDisabled", "spotlightId", "spotlightMuted", "spotlightRestrict"];
22
+ /**
23
+ * A component for managing groups of spottable components.
24
+ *
25
+ * @module spotlight/SpotlightContainerDecorator
26
+ * @exports SpotlightContainerDecorator
27
+ */
22
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
29
  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); }
24
30
  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; }
@@ -83,7 +83,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
83
83
  * event flow.
84
84
  * @private
85
85
  */
86
-
87
86
  /**
88
87
  * Support Spotlight container
89
88
  *
@@ -27,7 +27,13 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
27
27
  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); }
28
28
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
29
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
30
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
30
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /**
31
+ * Exports the {@link spotlight/SpotlightRootDecorator.SpotlightRootDecorator}
32
+ * higher-order component.
33
+ *
34
+ * @module spotlight/SpotlightRootDecorator
35
+ * @exports SpotlightRootDecorator
36
+ */
31
37
  var input = {
32
38
  activated: false,
33
39
  applied: false,
@@ -210,6 +216,12 @@ var SpotlightRootDecorator = (0, _hoc["default"])(defaultConfig, function (confi
210
216
  });
211
217
  }
212
218
  }
219
+
220
+ // For key input
221
+
222
+ // For mouse input
223
+
224
+ // For touch input
213
225
  }, {
214
226
  key: "render",
215
227
  value: function render() {
@@ -27,6 +27,13 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
27
27
  var _useSpottable = require("./useSpottable");
28
28
  var _jsxRuntime = require("react/jsx-runtime");
29
29
  var _excluded = ["className", "disabled", "handleForceUpdate", "onSpotlightDisappear", "onSpotlightDown", "onSpotlightLeft", "onSpotlightRight", "onSpotlightUp", "selectionKeys", "spotlightDisabled", "spotlightId", "spotRef"];
30
+ /**
31
+ * Adds spottability to components.
32
+ *
33
+ * @module spotlight/Spottable
34
+ * @exports Spottable
35
+ * @exports spottableClass
36
+ */
30
37
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
31
38
  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); }
32
39
  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; }
@@ -240,7 +247,7 @@ var Spottable = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
240
247
  */
241
248
  spotlightId: _propTypes2["default"].string,
242
249
  /*
243
- * Called with a reference to {@link spotlight/Spottable.Spottable#component|component}
250
+ * Called with a reference to spottable component
244
251
  *
245
252
  * @type {Object|Function}
246
253
  * @private
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enact/spotlight",
3
- "version": "4.6.2",
3
+ "version": "4.7.0",
4
4
  "description": "A focus management library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@enact/core": "^4.6.2",
27
+ "@enact/core": "^4.7.0",
28
28
  "classnames": "^2.3.2",
29
29
  "prop-types": "^15.8.1",
30
30
  "ramda": "^0.28.0",
package/src/container.js CHANGED
@@ -47,7 +47,12 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
47
47
  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); }
48
48
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
49
49
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
50
- 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; }
50
+ 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; } /**
51
+ * Exports methods and members for creating and maintaining spotlight containers.
52
+ *
53
+ * @module spotlight/container
54
+ * @private
55
+ */
51
56
  var containerAttribute = 'data-spotlight-id';
52
57
  exports.containerAttribute = containerAttribute;
53
58
  var containerConfigs = new Map();
package/src/spotlight.js CHANGED
@@ -141,10 +141,11 @@ var Spotlight = function () {
141
141
  }
142
142
  }
143
143
  function focusElement(elem, containerIds, fromPointer) {
144
+ var _window$PalmSystem$cu;
144
145
  if (!elem) {
145
146
  return false;
146
147
  }
147
- if ((0, _pointer.getPointerMode)() && !fromPointer) {
148
+ if ((0, _pointer.getPointerMode)() && !fromPointer && typeof window !== 'undefined' && (!window.PalmSystem || (_window$PalmSystem$cu = window.PalmSystem.cursor) !== null && _window$PalmSystem$cu !== void 0 && _window$PalmSystem$cu.visibility)) {
148
149
  (0, _container.setContainerLastFocusedElement)(elem, containerIds);
149
150
  return false;
150
151
  }