@enact/spotlight 4.7.2 → 4.7.4
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,12 +2,26 @@
|
|
|
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.4] - 2023-08-31
|
|
6
|
+
|
|
7
|
+
No significant changes.
|
|
8
|
+
|
|
9
|
+
## [4.7.3] - 2023-08-10
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `spotlight/SpotlightContainerDecorator` config option `leaveFor` to direct which element receives focus when the focus is leaving
|
|
14
|
+
|
|
5
15
|
## [4.7.2] - 2023-07-14
|
|
6
16
|
|
|
7
17
|
### Fixed
|
|
8
18
|
|
|
9
19
|
- `spotlight` to not show the focus effect when pointer mode is changed to `false` by touch while an app is loading
|
|
10
20
|
|
|
21
|
+
## [4.5.4] - 2023-06-07
|
|
22
|
+
|
|
23
|
+
No significant changes.
|
|
24
|
+
|
|
11
25
|
## [4.7.1] - 2023-06-02
|
|
12
26
|
|
|
13
27
|
No significant changes.
|
|
@@ -26,6 +26,13 @@ container will focus the last focused item; if the container has never had focus
|
|
|
26
26
|
element will receive focus. If `null` , the default 5-way behavior will be applied.
|
|
27
27
|
*/
|
|
28
28
|
enterTo?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Directs which element receives focus when the focus is leaving from the current container using 5-way direction keys.
|
|
31
|
+
If `{down: '#left'}` , the focus moves to the DOM element whose id value is `left` when pressing the 5-way down.
|
|
32
|
+
If `{left: '', right: ''}` , the focus cannot leave the current container with 5-way left and right.
|
|
33
|
+
If `null` , the default 5-way behavior will be applied.
|
|
34
|
+
*/
|
|
35
|
+
leaveFor?: object;
|
|
29
36
|
/**
|
|
30
37
|
* Filter the navigable elements.
|
|
31
38
|
*/
|
|
@@ -106,6 +106,18 @@ var defaultConfig = {
|
|
|
106
106
|
* @public
|
|
107
107
|
*/
|
|
108
108
|
enterTo: null,
|
|
109
|
+
/**
|
|
110
|
+
* Directs which element receives focus when the focus is leaving from the current container using 5-way direction keys.
|
|
111
|
+
* If `{down: '#left'}`, the focus moves to the DOM element whose id value is `left` when pressing the 5-way down.
|
|
112
|
+
* If `{left: '', right: ''}`, the focus cannot leave the current container with 5-way left and right.
|
|
113
|
+
* If `null`, the default 5-way behavior will be applied.
|
|
114
|
+
*
|
|
115
|
+
* @type {Object}
|
|
116
|
+
* @default null
|
|
117
|
+
* @memberof spotlight/SpotlightContainerDecorator.SpotlightContainerDecorator.defaultConfig
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
leaveFor: null,
|
|
109
121
|
/**
|
|
110
122
|
* Filter the navigable elements.
|
|
111
123
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/spotlight",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.4",
|
|
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.7.
|
|
27
|
+
"@enact/core": "^4.7.4",
|
|
28
28
|
"classnames": "^2.3.2",
|
|
29
29
|
"prop-types": "^15.8.1",
|
|
30
30
|
"ramda": "^0.29.0",
|
package/src/pointer.js
CHANGED
|
@@ -151,7 +151,8 @@ var notifyPointerMove = function notifyPointerMove(current, target, x, y) {
|
|
|
151
151
|
*/
|
|
152
152
|
exports.notifyPointerMove = notifyPointerMove;
|
|
153
153
|
var notifyKeyDown = function notifyKeyDown(keyCode, callback) {
|
|
154
|
-
var
|
|
154
|
+
var _window$webOSSystem;
|
|
155
|
+
var webOSSystem = (_window$webOSSystem = window.webOSSystem) !== null && _window$webOSSystem !== void 0 ? _window$webOSSystem : window.PalmSystem;
|
|
155
156
|
|
|
156
157
|
// for hide/show pointer events, handle them and return true
|
|
157
158
|
if ((0, _keymap.is)('pointerHide', keyCode)) {
|
|
@@ -160,7 +161,7 @@ var notifyKeyDown = function notifyKeyDown(keyCode, callback) {
|
|
|
160
161
|
} else if ((0, _keymap.is)('pointerShow', keyCode)) {
|
|
161
162
|
setPointerMode(true);
|
|
162
163
|
return true;
|
|
163
|
-
} else if (!(0, _keymap.is)('nonModal', keyCode) && !(0, _keymap.is)('cancel', keyCode) && !((0, _keymap.is)('enter', keyCode) &&
|
|
164
|
+
} else if (!(0, _keymap.is)('nonModal', keyCode) && !(0, _keymap.is)('cancel', keyCode) && !((0, _keymap.is)('enter', keyCode) && webOSSystem && webOSSystem.cursor && webOSSystem.cursor.visibility)) {
|
|
164
165
|
setPointerMode(false);
|
|
165
166
|
}
|
|
166
167
|
return false;
|
package/src/spotlight.js
CHANGED
|
@@ -136,17 +136,19 @@ var Spotlight = function () {
|
|
|
136
136
|
// An extension point for updating pointer mode based on the current platform.
|
|
137
137
|
// Currently only webOS
|
|
138
138
|
function setPlatformPointerMode() {
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
var _window$webOSSystem;
|
|
140
|
+
var webOSSystem = (_window$webOSSystem = window.webOSSystem) !== null && _window$webOSSystem !== void 0 ? _window$webOSSystem : window.PalmSystem;
|
|
141
|
+
if (webOSSystem && webOSSystem.cursor) {
|
|
142
|
+
(0, _pointer.setPointerMode)(webOSSystem.cursor.visibility);
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
function focusElement(elem, containerIds, fromPointer) {
|
|
145
|
-
var _window$
|
|
146
|
+
var _window$webOSSystem2, _webOSSystem$cursor;
|
|
146
147
|
if (!elem) {
|
|
147
148
|
return false;
|
|
148
149
|
}
|
|
149
|
-
|
|
150
|
+
var webOSSystem = (_window$webOSSystem2 = window.webOSSystem) !== null && _window$webOSSystem2 !== void 0 ? _window$webOSSystem2 : window.PalmSystem;
|
|
151
|
+
if ((0, _pointer.getPointerMode)() && !fromPointer && ((0, _inputType.getInputType)() === 'touch' || typeof window !== 'undefined' && (!webOSSystem || (_webOSSystem$cursor = webOSSystem.cursor) !== null && _webOSSystem$cursor !== void 0 && _webOSSystem$cursor.visibility))) {
|
|
150
152
|
(0, _container.setContainerLastFocusedElement)(elem, containerIds);
|
|
151
153
|
return false;
|
|
152
154
|
}
|