@enact/spotlight
Advanced tools
Comparing version 2.0.0-rc.3 to 2.0.0
@@ -5,2 +5,13 @@ # Change Log | ||
## [2.0.0] - 2018-07-30 | ||
### Changed | ||
- `spotlight` to default to 5-way mode on initialization | ||
### Fixed | ||
- `spotlight` to blur when pointer leaves floating webOS app | ||
- `spotlight` to prevent changing the active container when the currently active container is restricted is "self-only" | ||
## [2.0.0-rc.3] - 2018-07-23 | ||
@@ -133,2 +144,6 @@ | ||
## [1.13.4] - 2018-07-30 | ||
No significant changes. | ||
## [1.13.3] - 2018-01-16 | ||
@@ -135,0 +150,0 @@ |
@@ -39,2 +39,4 @@ --- | ||
Spotlight initializes in 5-way mode. On webOS, the platform's current pointer mode is used instead. | ||
## Navigation | ||
@@ -41,0 +43,0 @@ |
{ | ||
"name": "@enact/spotlight", | ||
"version": "2.0.0-rc.3", | ||
"version": "2.0.0", | ||
"description": "A focus management library", | ||
@@ -24,3 +24,3 @@ "main": "src/spotlight.js", | ||
"dependencies": { | ||
"@enact/core": "^2.0.0-rc.3", | ||
"@enact/core": "^2.0.0", | ||
"prop-types": "^15.6.0", | ||
@@ -27,0 +27,0 @@ "ramda": "^0.24.1", |
@@ -106,4 +106,2 @@ "use strict"; | ||
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object') { | ||
var palmSystem = window.PalmSystem; | ||
_spotlight.default.initialize({ | ||
@@ -117,6 +115,2 @@ selector: '.' + _Spottable.spottableClass, | ||
}); | ||
if (palmSystem && palmSystem.cursor) { | ||
_spotlight.default.setPointerMode(palmSystem.cursor.visibility); | ||
} | ||
} | ||
@@ -123,0 +117,0 @@ } |
@@ -933,2 +933,20 @@ "use strict"; | ||
function setLastContainer(containerId) { | ||
// If the current container is restricted to 'self-only' and if the next container to be | ||
// activated is not inside the currently activated container, the next container should not be | ||
// activated. | ||
var currentContainerId = getLastContainer(); | ||
if (currentContainerId) { | ||
var config = getContainerConfig(currentContainerId); | ||
if (config && config.restrict === 'self-only') { | ||
var currentContainer = getContainerNode(currentContainerId); | ||
var nextContainer = getContainerNode(containerId); | ||
if (currentContainer && nextContainer && !currentContainer.contains(nextContainer)) { | ||
return; | ||
} | ||
} | ||
} | ||
_lastContainerId = containerId || ''; | ||
@@ -935,0 +953,0 @@ } |
@@ -12,2 +12,4 @@ "use strict"; | ||
var _platform = _interopRequireDefault(require("@enact/core/platform")); | ||
var _last = _interopRequireDefault(require("ramda/src/last")); | ||
@@ -144,2 +146,12 @@ | ||
} | ||
} // An extension point for updating pointer mode based on the current platform. | ||
// Currently only webOS | ||
function setPlatformPointerMode() { | ||
var palmSystem = window.PalmSystem; | ||
if (palmSystem && palmSystem.cursor) { | ||
(0, _pointer.setPointerMode)(palmSystem.cursor.visibility); | ||
} | ||
} | ||
@@ -312,2 +324,8 @@ | ||
function handleWebOSMouseEvent(ev) { | ||
if (ev && ev.detail && ev.detail.type === 'Leave') { | ||
onBlur(); | ||
} | ||
} | ||
function onFocus() { | ||
@@ -318,11 +336,6 @@ // Normally, there isn't focus here unless the window has been blurred above. On webOS, the | ||
if (_spotOnWindowFocus) { | ||
var palmSystem = window.PalmSystem; | ||
if (palmSystem && palmSystem.cursor) { | ||
Spotlight.setPointerMode(palmSystem.cursor.visibility); | ||
} // If the window was previously blurred while in pointer mode, the last active containerId may | ||
setPlatformPointerMode(); // If the window was previously blurred while in pointer mode, the last active containerId may | ||
// not have yet set focus to its spottable elements. For this reason we can't rely on setting focus | ||
// to the last focused element of the last active containerId, so we use rootContainerId instead | ||
if (!Spotlight.focus((0, _container.getContainerLastFocusedElement)(_container.rootContainerId))) { | ||
@@ -455,5 +468,9 @@ // If the last focused element was previously also disabled (or no longer exists), we | ||
window.addEventListener('mousemove', onMouseMove); | ||
if (_platform.default.webos) document.addEventListener('webOSMouse', handleWebOSMouseEvent); | ||
(0, _container.setLastContainer)(_container.rootContainerId); | ||
(0, _container.configureDefaults)(containerDefaults); | ||
(0, _container.configureContainer)(_container.rootContainerId); | ||
(0, _container.configureContainer)(_container.rootContainerId); // by default, pointer mode is off but the platform's current state will override that | ||
(0, _pointer.setPointerMode)(false); | ||
setPlatformPointerMode(); | ||
_initialized = true; | ||
@@ -475,2 +492,3 @@ } | ||
window.removeEventListener('mousemove', onMouseMove); | ||
if (_platform.default.webos) document.removeEventListener('webOSMouse', handleWebOSMouseEvent); | ||
Spotlight.clear(); | ||
@@ -477,0 +495,0 @@ _initialized = false; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
258063
5231
1
Updated@enact/core@^2.0.0