@enact/spotlight 4.0.4 → 4.0.8

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,7 +2,25 @@
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.0.3] - 2021-07-02
5
+ ## [4.0.8] - 2021-10-21
6
+
7
+ No significant changes.
8
+
9
+ ## [4.0.7] - 2021-09-28
10
+
11
+ No significant changes.
12
+
13
+ ## [4.0.6] - 2021-09-28
14
+
15
+ No significant changes.
16
+
17
+ ## [4.0.5] - 2021-08-02
18
+
19
+ ### Fixed
20
+
21
+ - `spotlight/SpotlightRootDecorator` not to add locale specific classes in the wrong DOM after isomorphic build with multi locales
22
+
23
+ ## [4.0.4] - 2021-07-02
6
24
 
7
25
  No significant changes.
8
26
 
@@ -138,9 +138,9 @@ var SpotlightRootDecorator = (0, _hoc["default"])(defaultConfig, function (confi
138
138
  _this = _super.call(this, props);
139
139
 
140
140
  _this.applyInputType = function () {
141
- if (_assertThisInitialized(_this) && _this.containerRef && _this.containerRef.current) {
141
+ if (_assertThisInitialized(_this) && _this.containerNode) {
142
142
  Object.keys(input.types).map(function (type) {
143
- _this.containerRef.current.classList.toggle('spotlight-input-' + type, input.types[type]);
143
+ _this.containerNode.classList.toggle('spotlight-input-' + type, input.types[type]);
144
144
  });
145
145
  input.applied = true;
146
146
  }
@@ -155,7 +155,7 @@ var SpotlightRootDecorator = (0, _hoc["default"])(defaultConfig, function (confi
155
155
  _this.handleKeyDown = function (ev) {
156
156
  var keyCode = ev.keyCode;
157
157
 
158
- if ((0, _keymap.is)('enter', keyCode) && _this.containerRef.current.classList.contains('spotlight-input-touch')) {
158
+ if ((0, _keymap.is)('enter', keyCode) && _this.containerNode.classList.contains('spotlight-input-touch')) {
159
159
  // Prevent onclick event trigger by enter key
160
160
  ev.preventDefault();
161
161
  }
@@ -192,7 +192,7 @@ var SpotlightRootDecorator = (0, _hoc["default"])(defaultConfig, function (confi
192
192
  }
193
193
  };
194
194
 
195
- _this.containerRef = /*#__PURE__*/(0, _react.createRef)();
195
+ _this.containerNode = null;
196
196
 
197
197
  if (typeof window === 'object') {
198
198
  _spotlight["default"].initialize({
@@ -216,6 +216,7 @@ var SpotlightRootDecorator = (0, _hoc["default"])(defaultConfig, function (confi
216
216
  }
217
217
 
218
218
  if (typeof document === 'object') {
219
+ this.containerNode = document.querySelector('#root');
219
220
  document.addEventListener('focusin', this.handleFocusIn, {
220
221
  capture: true
221
222
  });
@@ -253,10 +254,7 @@ var SpotlightRootDecorator = (0, _hoc["default"])(defaultConfig, function (confi
253
254
  }, {
254
255
  key: "render",
255
256
  value: function render() {
256
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
257
- ref: this.containerRef,
258
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, this.props))
259
- });
257
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, this.props));
260
258
  }
261
259
  }]);
262
260
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enact/spotlight",
3
- "version": "4.0.4",
3
+ "version": "4.0.8",
4
4
  "description": "A focus management library",
5
5
  "main": "src/spotlight.js",
6
6
  "scripts": {
@@ -18,7 +18,7 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@enact/core": "^4.0.4",
21
+ "@enact/core": "^4.0.8",
22
22
  "classnames": "^2.2.6",
23
23
  "prop-types": "^15.7.2",
24
24
  "ramda": "^0.24.1",