@instructure/ui-a11y-utils 8.18.0 → 8.18.1-snapshot.2
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/LICENSE.md +27 -0
- package/es/FocusRegion.js +3 -1
- package/es/KeyboardFocusRegion.js +6 -2
- package/es/ScreenReaderFocusRegion.js +3 -1
- package/lib/FocusRegion.js +3 -1
- package/lib/KeyboardFocusRegion.js +6 -2
- package/lib/ScreenReaderFocusRegion.js +3 -1
- package/package.json +12 -11
package/LICENSE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: The MIT License (MIT)
|
|
3
|
+
category: Getting Started
|
|
4
|
+
order: 9
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# The MIT License (MIT)
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
+
|
|
11
|
+
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions.**
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
package/es/FocusRegion.js
CHANGED
|
@@ -40,7 +40,9 @@ class FocusRegion {
|
|
|
40
40
|
this._active = false;
|
|
41
41
|
|
|
42
42
|
this.handleDismiss = (event, documentClick) => {
|
|
43
|
-
|
|
43
|
+
var _this$_options$onDism, _this$_options;
|
|
44
|
+
|
|
45
|
+
(_this$_options$onDism = (_this$_options = this._options).onDismiss) === null || _this$_options$onDism === void 0 ? void 0 : _this$_options$onDism.call(_this$_options, event, documentClick);
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
this.captureDocumentClick = event => {
|
|
@@ -81,13 +81,17 @@ class KeyboardFocusRegion {
|
|
|
81
81
|
|
|
82
82
|
this.handleFirstTabbableKeyDown = event => {
|
|
83
83
|
if (event.keyCode === keycode.codes.tab && event.shiftKey) {
|
|
84
|
-
|
|
84
|
+
var _this$_options$onBlur, _this$_options;
|
|
85
|
+
|
|
86
|
+
(_this$_options$onBlur = (_this$_options = this._options).onBlur) === null || _this$_options$onBlur === void 0 ? void 0 : _this$_options$onBlur.call(_this$_options, event);
|
|
85
87
|
}
|
|
86
88
|
};
|
|
87
89
|
|
|
88
90
|
this.handleLastTabbableKeyDown = event => {
|
|
89
91
|
if (event.keyCode === keycode.codes.tab && !event.shiftKey) {
|
|
90
|
-
|
|
92
|
+
var _this$_options$onBlur2, _this$_options2;
|
|
93
|
+
|
|
94
|
+
(_this$_options$onBlur2 = (_this$_options2 = this._options).onBlur) === null || _this$_options$onBlur2 === void 0 ? void 0 : _this$_options$onBlur2.call(_this$_options2, event);
|
|
91
95
|
}
|
|
92
96
|
};
|
|
93
97
|
|
|
@@ -95,7 +95,9 @@ class ScreenReaderFocusRegion {
|
|
|
95
95
|
|
|
96
96
|
hideNodes(nodes) {
|
|
97
97
|
nodes.forEach(node => {
|
|
98
|
-
|
|
98
|
+
var _node$getAttribute;
|
|
99
|
+
|
|
100
|
+
const ariaLive = typeof node.getAttribute === 'function' && ((_node$getAttribute = node.getAttribute('aria-live')) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.toLowerCase());
|
|
99
101
|
|
|
100
102
|
if (node && node.nodeType === 1 && node.tagName.toLowerCase() !== 'script' && ariaLive !== 'assertive' && ariaLive !== 'polite' && this._parents.indexOf(node) === -1 && this._nodes.indexOf(node) === -1 && this._liveRegion.indexOf(node) === -1 && !this._contextElement.contains(node)) {
|
|
101
103
|
if (node.tagName.toLowerCase() !== 'iframe') {
|
package/lib/FocusRegion.js
CHANGED
|
@@ -60,7 +60,9 @@ class FocusRegion {
|
|
|
60
60
|
this._active = false;
|
|
61
61
|
|
|
62
62
|
this.handleDismiss = (event, documentClick) => {
|
|
63
|
-
|
|
63
|
+
var _this$_options$onDism, _this$_options;
|
|
64
|
+
|
|
65
|
+
(_this$_options$onDism = (_this$_options = this._options).onDismiss) === null || _this$_options$onDism === void 0 ? void 0 : _this$_options$onDism.call(_this$_options, event, documentClick);
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
this.captureDocumentClick = event => {
|
|
@@ -109,13 +109,17 @@ class KeyboardFocusRegion {
|
|
|
109
109
|
|
|
110
110
|
this.handleFirstTabbableKeyDown = event => {
|
|
111
111
|
if (event.keyCode === _keycode.default.codes.tab && event.shiftKey) {
|
|
112
|
-
|
|
112
|
+
var _this$_options$onBlur, _this$_options;
|
|
113
|
+
|
|
114
|
+
(_this$_options$onBlur = (_this$_options = this._options).onBlur) === null || _this$_options$onBlur === void 0 ? void 0 : _this$_options$onBlur.call(_this$_options, event);
|
|
113
115
|
}
|
|
114
116
|
};
|
|
115
117
|
|
|
116
118
|
this.handleLastTabbableKeyDown = event => {
|
|
117
119
|
if (event.keyCode === _keycode.default.codes.tab && !event.shiftKey) {
|
|
118
|
-
|
|
120
|
+
var _this$_options$onBlur2, _this$_options2;
|
|
121
|
+
|
|
122
|
+
(_this$_options$onBlur2 = (_this$_options2 = this._options).onBlur) === null || _this$_options$onBlur2 === void 0 ? void 0 : _this$_options$onBlur2.call(_this$_options2, event);
|
|
119
123
|
}
|
|
120
124
|
};
|
|
121
125
|
|
|
@@ -102,7 +102,9 @@ class ScreenReaderFocusRegion {
|
|
|
102
102
|
|
|
103
103
|
hideNodes(nodes) {
|
|
104
104
|
nodes.forEach(node => {
|
|
105
|
-
|
|
105
|
+
var _node$getAttribute;
|
|
106
|
+
|
|
107
|
+
const ariaLive = typeof node.getAttribute === 'function' && ((_node$getAttribute = node.getAttribute('aria-live')) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.toLowerCase());
|
|
106
108
|
|
|
107
109
|
if (node && node.nodeType === 1 && node.tagName.toLowerCase() !== 'script' && ariaLive !== 'assertive' && ariaLive !== 'polite' && this._parents.indexOf(node) === -1 && this._nodes.indexOf(node) === -1 && this._liveRegion.indexOf(node) === -1 && !this._contextElement.contains(node)) {
|
|
108
110
|
if (node.tagName.toLowerCase() !== 'iframe') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-a11y-utils",
|
|
3
|
-
"version": "8.18.
|
|
3
|
+
"version": "8.18.1-snapshot.2+ca4c1ff9d",
|
|
4
4
|
"description": "A collection of utilities for managing focus and screen reader behavior",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/runtime": "^7.13.10",
|
|
26
|
-
"@instructure/console": "8.18.
|
|
27
|
-
"@instructure/ui-a11y-content": "8.18.
|
|
28
|
-
"@instructure/ui-dom-utils": "8.18.
|
|
29
|
-
"@instructure/ui-react-utils": "8.18.
|
|
30
|
-
"@instructure/ui-testable": "8.18.
|
|
31
|
-
"@instructure/uid": "8.18.
|
|
26
|
+
"@instructure/console": "8.18.1-snapshot.2+ca4c1ff9d",
|
|
27
|
+
"@instructure/ui-a11y-content": "8.18.1-snapshot.2+ca4c1ff9d",
|
|
28
|
+
"@instructure/ui-dom-utils": "8.18.1-snapshot.2+ca4c1ff9d",
|
|
29
|
+
"@instructure/ui-react-utils": "8.18.1-snapshot.2+ca4c1ff9d",
|
|
30
|
+
"@instructure/ui-testable": "8.18.1-snapshot.2+ca4c1ff9d",
|
|
31
|
+
"@instructure/uid": "8.18.1-snapshot.2+ca4c1ff9d",
|
|
32
32
|
"keycode": "^2",
|
|
33
33
|
"prop-types": "^15"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@instructure/ui-babel-preset": "8.18.
|
|
37
|
-
"@instructure/ui-color-utils": "8.18.
|
|
38
|
-
"@instructure/ui-test-utils": "8.18.
|
|
36
|
+
"@instructure/ui-babel-preset": "8.18.1-snapshot.2+ca4c1ff9d",
|
|
37
|
+
"@instructure/ui-color-utils": "8.18.1-snapshot.2+ca4c1ff9d",
|
|
38
|
+
"@instructure/ui-test-utils": "8.18.1-snapshot.2+ca4c1ff9d"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": ">=16.8 <=17"
|
|
@@ -43,5 +43,6 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"sideEffects": false
|
|
46
|
+
"sideEffects": false,
|
|
47
|
+
"gitHead": "ca4c1ff9d3985151ae0758fb596de41652dbb58b"
|
|
47
48
|
}
|