@enact/spotlight 4.0.7 → 4.0.10
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/Accelerator/Accelerator.d.ts +2 -5
- package/CHANGELOG.md +12 -0
- package/Pause/Pause.d.ts +4 -6
- package/package.json +2 -2
- package/src/container.js +12 -9
|
@@ -4,14 +4,11 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
|
4
4
|
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
5
5
|
|
|
6
6
|
export declare class Accelerator {
|
|
7
|
-
constructor
|
|
8
|
-
/**
|
|
7
|
+
constructor /**
|
|
9
8
|
* Controls the frequency with which the acceleration will
|
|
10
9
|
"freeze". While frozen, the current target item cannot change, and all events are directed
|
|
11
10
|
to it.
|
|
12
|
-
*/
|
|
13
|
-
frequency: number[]
|
|
14
|
-
);
|
|
11
|
+
*/(frequency: number[]);
|
|
15
12
|
/**
|
|
16
13
|
* Called with the current keydown event and callback, which will be called when the event is
|
|
17
14
|
allowed through.
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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.10] - 2022-04-05
|
|
6
|
+
|
|
7
|
+
No significant changes.
|
|
8
|
+
|
|
9
|
+
## [4.0.9] - 2021-12-15
|
|
10
|
+
|
|
11
|
+
No significant changes.
|
|
12
|
+
|
|
13
|
+
## [4.0.8] - 2021-10-21
|
|
14
|
+
|
|
15
|
+
No significant changes.
|
|
16
|
+
|
|
5
17
|
## [4.0.7] - 2021-09-28
|
|
6
18
|
|
|
7
19
|
No significant changes.
|
package/Pause/Pause.d.ts
CHANGED
|
@@ -12,12 +12,10 @@ paused spotlight and can be used as an escape hatch to force resumption.
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
export declare class Pause {
|
|
15
|
-
constructor
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
name: string
|
|
20
|
-
);
|
|
15
|
+
constructor
|
|
16
|
+
/**
|
|
17
|
+
* The name of the pause instance
|
|
18
|
+
*/(name: string);
|
|
21
19
|
/**
|
|
22
20
|
* Returns `true` when Spotlight is paused by this instance
|
|
23
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/spotlight",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.10",
|
|
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.
|
|
21
|
+
"@enact/core": "^4.0.10",
|
|
22
22
|
"classnames": "^2.2.6",
|
|
23
23
|
"prop-types": "^15.7.2",
|
|
24
24
|
"ramda": "^0.24.1",
|
package/src/container.js
CHANGED
|
@@ -725,9 +725,8 @@ var getAllContainerIds = function getAllContainerIds() {
|
|
|
725
725
|
/**
|
|
726
726
|
* Returns the default focus element for a container
|
|
727
727
|
*
|
|
728
|
-
* @param {String}
|
|
729
|
-
* @param {('last-focused'|'default-element')} [preferredEnterTo] Prefer the given enterTo
|
|
730
|
-
* configuration
|
|
728
|
+
* @param {String} containerId Container ID
|
|
729
|
+
* @param {('last-focused'|'default-element'|'topmost')} [preferredEnterTo] Prefer the given enterTo configuration
|
|
731
730
|
*
|
|
732
731
|
* @returns {Node|null} Default focus element
|
|
733
732
|
* @memberof spotlight/container
|
|
@@ -831,9 +830,8 @@ function setContainerLastFocusedElement(node, containerIds) {
|
|
|
831
830
|
* return that element as the only element in an array. If that fails or if navigation is not
|
|
832
831
|
* restricted, it will return an array of all possible navigable nodes.
|
|
833
832
|
*
|
|
834
|
-
* @param {String}
|
|
835
|
-
* @param {('last-focused'|'default-element')} [preferredEnterTo] Prefer the given enterTo
|
|
836
|
-
* configuration
|
|
833
|
+
* @param {String} containerId Container ID
|
|
834
|
+
* @param {('last-focused'|'default-element'|'topmost')} [preferredEnterTo] Prefer the given enterTo configuration
|
|
837
835
|
*
|
|
838
836
|
* @returns {Node[]} Navigable elements within container
|
|
839
837
|
* @memberof spotlight/container
|
|
@@ -877,6 +875,12 @@ function getContainerNavigableElements(containerId, preferredEnterTo) {
|
|
|
877
875
|
|
|
878
876
|
return (0, _utils.contains)(containerRect, (0, _utils.getRect)(element));
|
|
879
877
|
});
|
|
878
|
+
|
|
879
|
+
if (next && preferredEnterTo === 'topmost') {
|
|
880
|
+
next.sort(function (a, b) {
|
|
881
|
+
return (0, _utils.getRect)(a).top - (0, _utils.getRect)(b).top;
|
|
882
|
+
});
|
|
883
|
+
}
|
|
880
884
|
} // otherwise, return all spottables within the container
|
|
881
885
|
|
|
882
886
|
|
|
@@ -891,9 +895,8 @@ function getContainerNavigableElements(containerId, preferredEnterTo) {
|
|
|
891
895
|
* Determines the preferred focus target, traversing any sub-containers as necessary, for the given
|
|
892
896
|
* container.
|
|
893
897
|
*
|
|
894
|
-
* @param {String}
|
|
895
|
-
* @param {('last-focused'|'default-element')} [preferredEnterTo] Prefer the given enterTo
|
|
896
|
-
* configuration
|
|
898
|
+
* @param {String} containerId Container ID
|
|
899
|
+
* @param {('last-focused'|'default-element'|'topmost')} [preferredEnterTo] Prefer the given enterTo configuration
|
|
897
900
|
*
|
|
898
901
|
* @returns {Node} Preferred target as either a DOM node or container-id
|
|
899
902
|
* @memberof spotlight/container
|