mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 21:52:19 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
40
web/node_modules/eslint-plugin-jsx-a11y/lib/util/attributesComparator.js
generated
vendored
Normal file
40
web/node_modules/eslint-plugin-jsx-a11y/lib/util/attributesComparator.js
generated
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns true if all items in baseAttributes are found in attributes. Always
|
||||
* returns true if baseAttributes is empty.
|
||||
*/
|
||||
function attributesComparator() {
|
||||
var baseAttributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
return baseAttributes.every(function (baseAttr) {
|
||||
return attributes.some(function (attribute) {
|
||||
// Guard against non-JSXAttribute nodes like JSXSpreadAttribute
|
||||
if (attribute.type !== 'JSXAttribute') {
|
||||
return false;
|
||||
} // Attribute matches.
|
||||
|
||||
|
||||
if (baseAttr.name !== (0, _jsxAstUtils.propName)(attribute)) {
|
||||
return false;
|
||||
} // Value exists and does not match.
|
||||
|
||||
|
||||
if (baseAttr.value && baseAttr.value !== (0, _jsxAstUtils.getLiteralPropValue)(attribute)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var _default = attributesComparator;
|
||||
exports["default"] = _default;
|
22
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getComputedRole.js
generated
vendored
Normal file
22
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getComputedRole.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getComputedRole;
|
||||
|
||||
var _getExplicitRole = _interopRequireDefault(require("./getExplicitRole"));
|
||||
|
||||
var _getImplicitRole = _interopRequireDefault(require("./getImplicitRole"));
|
||||
|
||||
/**
|
||||
* Returns an element's computed role, which is
|
||||
*
|
||||
* 1. The valid value of its explicit role attribute; or
|
||||
* 2. The implicit value of its tag.
|
||||
*/
|
||||
function getComputedRole(tag, attributes) {
|
||||
return (0, _getExplicitRole["default"])(tag, attributes) || (0, _getImplicitRole["default"])(tag, attributes);
|
||||
}
|
32
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getExplicitRole.js
generated
vendored
Normal file
32
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getExplicitRole.js
generated
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getExplicitRole;
|
||||
|
||||
var _ariaQuery = require("aria-query");
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns an element's computed role, which is
|
||||
*
|
||||
* 1. The valid value of its explicit role attribute; or
|
||||
* 2. The implicit value of its tag.
|
||||
*/
|
||||
function getExplicitRole(tag, attributes) {
|
||||
var explicitRole = function toLowerCase(role) {
|
||||
if (typeof role === 'string') {
|
||||
return role.toLowerCase();
|
||||
}
|
||||
|
||||
return null;
|
||||
}((0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role')));
|
||||
|
||||
if (_ariaQuery.roles.has(explicitRole)) {
|
||||
return explicitRole;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
30
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getImplicitRole.js
generated
vendored
Normal file
30
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getImplicitRole.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRole;
|
||||
|
||||
var _ariaQuery = require("aria-query");
|
||||
|
||||
var _implicitRoles = _interopRequireDefault(require("./implicitRoles"));
|
||||
|
||||
/**
|
||||
* Returns an element's implicit role given its attributes and type.
|
||||
* Some elements only have an implicit role when certain props are defined.
|
||||
*/
|
||||
function getImplicitRole(type, attributes) {
|
||||
var implicitRole;
|
||||
|
||||
if (_implicitRoles["default"][type]) {
|
||||
implicitRole = _implicitRoles["default"][type](attributes);
|
||||
}
|
||||
|
||||
if (_ariaQuery.roles.has(implicitRole)) {
|
||||
return implicitRole;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
35
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getSuggestion.js
generated
vendored
Normal file
35
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getSuggestion.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getSuggestion;
|
||||
|
||||
var _damerauLevenshtein = _interopRequireDefault(require("damerau-levenshtein"));
|
||||
|
||||
// Minimum edit distance to be considered a good suggestion.
|
||||
var THRESHOLD = 2;
|
||||
/**
|
||||
* Returns an array of suggestions given a word and a dictionary and limit of suggestions
|
||||
* to return.
|
||||
*/
|
||||
|
||||
function getSuggestion(word) {
|
||||
var dictionary = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
var limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
||||
var distances = dictionary.reduce(function (suggestions, dictionaryWord) {
|
||||
var distance = (0, _damerauLevenshtein["default"])(word.toUpperCase(), dictionaryWord.toUpperCase());
|
||||
var steps = distance.steps;
|
||||
suggestions[dictionaryWord] = steps; // eslint-disable-line
|
||||
|
||||
return suggestions;
|
||||
}, {});
|
||||
return Object.keys(distances).filter(function (suggestion) {
|
||||
return distances[suggestion] <= THRESHOLD;
|
||||
}).sort(function (a, b) {
|
||||
return distances[a] - distances[b];
|
||||
}) // Sort by distance
|
||||
.slice(0, limit);
|
||||
}
|
37
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getTabIndex.js
generated
vendored
Normal file
37
web/node_modules/eslint-plugin-jsx-a11y/lib/util/getTabIndex.js
generated
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getTabIndex;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns the tabIndex value.
|
||||
*/
|
||||
function getTabIndex(tabIndex) {
|
||||
var literalValue = (0, _jsxAstUtils.getLiteralPropValue)(tabIndex); // String and number values.
|
||||
|
||||
if (['string', 'number'].indexOf(typeof literalValue) > -1) {
|
||||
// Empty string will convert to zero, so check for it explicity.
|
||||
if (typeof literalValue === 'string' && literalValue.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
var value = Number(literalValue);
|
||||
|
||||
if (Number.isNaN(value)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return Number.isInteger(value) ? value : undefined;
|
||||
} // Booleans are not valid values, return undefined.
|
||||
|
||||
|
||||
if (literalValue === true || literalValue === false) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return (0, _jsxAstUtils.getPropValue)(tabIndex);
|
||||
}
|
35
web/node_modules/eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild.js
generated
vendored
Normal file
35
web/node_modules/eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = hasAccessibleChild;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
var _isHiddenFromScreenReader = _interopRequireDefault(require("./isHiddenFromScreenReader"));
|
||||
|
||||
function hasAccessibleChild(node) {
|
||||
return node.children.some(function (child) {
|
||||
switch (child.type) {
|
||||
case 'Literal':
|
||||
case 'JSXText':
|
||||
return Boolean(child.value);
|
||||
|
||||
case 'JSXElement':
|
||||
return !(0, _isHiddenFromScreenReader["default"])((0, _jsxAstUtils.elementType)(child.openingElement), child.openingElement.attributes);
|
||||
|
||||
case 'JSXExpressionContainer':
|
||||
if (child.expression.type === 'Identifier') {
|
||||
return child.expression.name !== 'undefined';
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}) || (0, _jsxAstUtils.hasAnyProp)(node.openingElement.attributes, ['dangerouslySetInnerHTML', 'children']);
|
||||
}
|
19
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/a.js
generated
vendored
Normal file
19
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/a.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForAnchor;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an anchor tag.
|
||||
*/
|
||||
function getImplicitRoleForAnchor(attributes) {
|
||||
if ((0, _jsxAstUtils.getProp)(attributes, 'href')) {
|
||||
return 'link';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
19
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/area.js
generated
vendored
Normal file
19
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/area.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForArea;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an area tag.
|
||||
*/
|
||||
function getImplicitRoleForArea(attributes) {
|
||||
if ((0, _jsxAstUtils.getProp)(attributes, 'href')) {
|
||||
return 'link';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/article.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/article.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForArticle;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an article tag.
|
||||
*/
|
||||
function getImplicitRoleForArticle() {
|
||||
return 'article';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForAside;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an aside tag.
|
||||
*/
|
||||
function getImplicitRoleForAside() {
|
||||
return 'complementary';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/body.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/body.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForBody;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a body tag.
|
||||
*/
|
||||
function getImplicitRoleForBody() {
|
||||
return 'document';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/button.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/button.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForButton;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a button tag.
|
||||
*/
|
||||
function getImplicitRoleForButton() {
|
||||
return 'button';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForDatalist;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a datalist tag.
|
||||
*/
|
||||
function getImplicitRoleForDatalist() {
|
||||
return 'listbox';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/details.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/details.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForDetails;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a details tag.
|
||||
*/
|
||||
function getImplicitRoleForDetails() {
|
||||
return 'group';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForDialog;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a dialog tag.
|
||||
*/
|
||||
function getImplicitRoleForDialog() {
|
||||
return 'dialog';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForDl;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a dl tag.
|
||||
*/
|
||||
function getImplicitRoleForDl() {
|
||||
return 'list';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/form.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/form.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForForm;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a form tag.
|
||||
*/
|
||||
function getImplicitRoleForForm() {
|
||||
return 'form';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH1;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an h1 tag.
|
||||
*/
|
||||
function getImplicitRoleForH1() {
|
||||
return 'heading';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH2;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an h2 tag.
|
||||
*/
|
||||
function getImplicitRoleForH2() {
|
||||
return 'heading';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH3;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an h3 tag.
|
||||
*/
|
||||
function getImplicitRoleForH3() {
|
||||
return 'heading';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH4;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an h4 tag.
|
||||
*/
|
||||
function getImplicitRoleForH4() {
|
||||
return 'heading';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH5;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an h5 tag.
|
||||
*/
|
||||
function getImplicitRoleForH5() {
|
||||
return 'heading';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForH6;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an h6tag.
|
||||
*/
|
||||
function getImplicitRoleForH6() {
|
||||
return 'heading';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForHr;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an hr tag.
|
||||
*/
|
||||
function getImplicitRoleForHr() {
|
||||
return 'separator';
|
||||
}
|
21
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/img.js
generated
vendored
Normal file
21
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/img.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForImg;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an img tag.
|
||||
*/
|
||||
function getImplicitRoleForImg(attributes) {
|
||||
var alt = (0, _jsxAstUtils.getProp)(attributes, 'alt');
|
||||
|
||||
if (alt && (0, _jsxAstUtils.getLiteralPropValue)(alt) === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
return 'img';
|
||||
}
|
123
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/index.js
generated
vendored
Normal file
123
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/index.js
generated
vendored
Normal file
|
@ -0,0 +1,123 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _a = _interopRequireDefault(require("./a"));
|
||||
|
||||
var _area = _interopRequireDefault(require("./area"));
|
||||
|
||||
var _article = _interopRequireDefault(require("./article"));
|
||||
|
||||
var _aside = _interopRequireDefault(require("./aside"));
|
||||
|
||||
var _body = _interopRequireDefault(require("./body"));
|
||||
|
||||
var _button = _interopRequireDefault(require("./button"));
|
||||
|
||||
var _datalist = _interopRequireDefault(require("./datalist"));
|
||||
|
||||
var _details = _interopRequireDefault(require("./details"));
|
||||
|
||||
var _dialog = _interopRequireDefault(require("./dialog"));
|
||||
|
||||
var _dl = _interopRequireDefault(require("./dl"));
|
||||
|
||||
var _form = _interopRequireDefault(require("./form"));
|
||||
|
||||
var _h = _interopRequireDefault(require("./h1"));
|
||||
|
||||
var _h2 = _interopRequireDefault(require("./h2"));
|
||||
|
||||
var _h3 = _interopRequireDefault(require("./h3"));
|
||||
|
||||
var _h4 = _interopRequireDefault(require("./h4"));
|
||||
|
||||
var _h5 = _interopRequireDefault(require("./h5"));
|
||||
|
||||
var _h6 = _interopRequireDefault(require("./h6"));
|
||||
|
||||
var _hr = _interopRequireDefault(require("./hr"));
|
||||
|
||||
var _img = _interopRequireDefault(require("./img"));
|
||||
|
||||
var _input = _interopRequireDefault(require("./input"));
|
||||
|
||||
var _li = _interopRequireDefault(require("./li"));
|
||||
|
||||
var _link = _interopRequireDefault(require("./link"));
|
||||
|
||||
var _menu = _interopRequireDefault(require("./menu"));
|
||||
|
||||
var _menuitem = _interopRequireDefault(require("./menuitem"));
|
||||
|
||||
var _meter = _interopRequireDefault(require("./meter"));
|
||||
|
||||
var _nav = _interopRequireDefault(require("./nav"));
|
||||
|
||||
var _ol = _interopRequireDefault(require("./ol"));
|
||||
|
||||
var _option = _interopRequireDefault(require("./option"));
|
||||
|
||||
var _output = _interopRequireDefault(require("./output"));
|
||||
|
||||
var _progress = _interopRequireDefault(require("./progress"));
|
||||
|
||||
var _section = _interopRequireDefault(require("./section"));
|
||||
|
||||
var _select = _interopRequireDefault(require("./select"));
|
||||
|
||||
var _tbody = _interopRequireDefault(require("./tbody"));
|
||||
|
||||
var _textarea = _interopRequireDefault(require("./textarea"));
|
||||
|
||||
var _tfoot = _interopRequireDefault(require("./tfoot"));
|
||||
|
||||
var _thead = _interopRequireDefault(require("./thead"));
|
||||
|
||||
var _ul = _interopRequireDefault(require("./ul"));
|
||||
|
||||
var _default = {
|
||||
a: _a["default"],
|
||||
area: _area["default"],
|
||||
article: _article["default"],
|
||||
aside: _aside["default"],
|
||||
body: _body["default"],
|
||||
button: _button["default"],
|
||||
datalist: _datalist["default"],
|
||||
details: _details["default"],
|
||||
dialog: _dialog["default"],
|
||||
dl: _dl["default"],
|
||||
form: _form["default"],
|
||||
h1: _h["default"],
|
||||
h2: _h2["default"],
|
||||
h3: _h3["default"],
|
||||
h4: _h4["default"],
|
||||
h5: _h5["default"],
|
||||
h6: _h6["default"],
|
||||
hr: _hr["default"],
|
||||
img: _img["default"],
|
||||
input: _input["default"],
|
||||
li: _li["default"],
|
||||
link: _link["default"],
|
||||
menu: _menu["default"],
|
||||
menuitem: _menuitem["default"],
|
||||
meter: _meter["default"],
|
||||
nav: _nav["default"],
|
||||
ol: _ol["default"],
|
||||
option: _option["default"],
|
||||
output: _output["default"],
|
||||
progress: _progress["default"],
|
||||
section: _section["default"],
|
||||
select: _select["default"],
|
||||
tbody: _tbody["default"],
|
||||
textarea: _textarea["default"],
|
||||
tfoot: _tfoot["default"],
|
||||
thead: _thead["default"],
|
||||
ul: _ul["default"]
|
||||
};
|
||||
exports["default"] = _default;
|
49
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/input.js
generated
vendored
Normal file
49
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/input.js
generated
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForInput;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an input tag.
|
||||
*/
|
||||
function getImplicitRoleForInput(attributes) {
|
||||
var type = (0, _jsxAstUtils.getProp)(attributes, 'type');
|
||||
|
||||
if (type) {
|
||||
var value = (0, _jsxAstUtils.getLiteralPropValue)(type) || '';
|
||||
|
||||
switch (typeof value === 'string' && value.toUpperCase()) {
|
||||
case 'BUTTON':
|
||||
case 'IMAGE':
|
||||
case 'RESET':
|
||||
case 'SUBMIT':
|
||||
return 'button';
|
||||
|
||||
case 'CHECKBOX':
|
||||
return 'checkbox';
|
||||
|
||||
case 'RADIO':
|
||||
return 'radio';
|
||||
|
||||
case 'RANGE':
|
||||
return 'slider';
|
||||
|
||||
case 'EMAIL':
|
||||
case 'PASSWORD':
|
||||
case 'SEARCH': // with [list] selector it's combobox
|
||||
|
||||
case 'TEL': // with [list] selector it's combobox
|
||||
|
||||
case 'URL': // with [list] selector it's combobox
|
||||
|
||||
default:
|
||||
return 'textbox';
|
||||
}
|
||||
}
|
||||
|
||||
return 'textbox';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/li.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/li.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForLi;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an li tag.
|
||||
*/
|
||||
function getImplicitRoleForLi() {
|
||||
return 'listitem';
|
||||
}
|
19
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/link.js
generated
vendored
Normal file
19
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/link.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForLink;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a link tag.
|
||||
*/
|
||||
function getImplicitRoleForLink(attributes) {
|
||||
if ((0, _jsxAstUtils.getProp)(attributes, 'href')) {
|
||||
return 'link';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
22
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu.js
generated
vendored
Normal file
22
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForMenu;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a menu tag.
|
||||
*/
|
||||
function getImplicitRoleForMenu(attributes) {
|
||||
var type = (0, _jsxAstUtils.getProp)(attributes, 'type');
|
||||
|
||||
if (type) {
|
||||
var value = (0, _jsxAstUtils.getLiteralPropValue)(type);
|
||||
return value && value.toUpperCase() === 'TOOLBAR' ? 'toolbar' : '';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
35
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem.js
generated
vendored
Normal file
35
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForMenuitem;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a menuitem tag.
|
||||
*/
|
||||
function getImplicitRoleForMenuitem(attributes) {
|
||||
var type = (0, _jsxAstUtils.getProp)(attributes, 'type');
|
||||
|
||||
if (type) {
|
||||
var value = (0, _jsxAstUtils.getLiteralPropValue)(type) || '';
|
||||
|
||||
switch (typeof value === 'string' && value.toUpperCase()) {
|
||||
case 'COMMAND':
|
||||
return 'menuitem';
|
||||
|
||||
case 'CHECKBOX':
|
||||
return 'menuitemcheckbox';
|
||||
|
||||
case 'RADIO':
|
||||
return 'menuitemradio';
|
||||
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForMeter;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a meter tag.
|
||||
*/
|
||||
function getImplicitRoleForMeter() {
|
||||
return 'progressbar';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForNav;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a nav tag.
|
||||
*/
|
||||
function getImplicitRoleForNav() {
|
||||
return 'navigation';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForOl;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an ol tag.
|
||||
*/
|
||||
function getImplicitRoleForOl() {
|
||||
return 'list';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/option.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/option.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForOption;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an option tag.
|
||||
*/
|
||||
function getImplicitRoleForOption() {
|
||||
return 'option';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/output.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/output.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForOutput;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for an output tag.
|
||||
*/
|
||||
function getImplicitRoleForOutput() {
|
||||
return 'status';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForProgress;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a progress tag.
|
||||
*/
|
||||
function getImplicitRoleForProgress() {
|
||||
return 'progressbar';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/section.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/section.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForSection;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a section tag.
|
||||
*/
|
||||
function getImplicitRoleForSection() {
|
||||
return 'region';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/select.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/select.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForSelect;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a select tag.
|
||||
*/
|
||||
function getImplicitRoleForSelect() {
|
||||
return 'listbox';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForTbody;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a tbody tag.
|
||||
*/
|
||||
function getImplicitRoleForTbody() {
|
||||
return 'rowgroup';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForTextarea;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a textarea tag.
|
||||
*/
|
||||
function getImplicitRoleForTextarea() {
|
||||
return 'textbox';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForTfoot;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a tfoot tag.
|
||||
*/
|
||||
function getImplicitRoleForTfoot() {
|
||||
return 'rowgroup';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForThead;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a thead tag.
|
||||
*/
|
||||
function getImplicitRoleForThead() {
|
||||
return 'rowgroup';
|
||||
}
|
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul.js
generated
vendored
Normal file
13
web/node_modules/eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = getImplicitRoleForUl;
|
||||
|
||||
/**
|
||||
* Returns the implicit role for a ul tag.
|
||||
*/
|
||||
function getImplicitRoleForUl() {
|
||||
return 'list';
|
||||
}
|
33
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isAbstractRole.js
generated
vendored
Normal file
33
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isAbstractRole.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
||||
|
||||
var _ariaQuery = require("aria-query");
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
var abstractRoles = new Set((0, _toConsumableArray2["default"])(_ariaQuery.roles.keys()).filter(function (role) {
|
||||
return _ariaQuery.roles.get(role)["abstract"];
|
||||
}));
|
||||
var DOMElements = (0, _toConsumableArray2["default"])(_ariaQuery.dom.keys());
|
||||
|
||||
var isAbstractRole = function isAbstractRole(tagName, attributes) {
|
||||
// Do not test higher level JSX components, as we do not know what
|
||||
// low-level DOM element this maps to.
|
||||
if (DOMElements.indexOf(tagName) === -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var role = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role'));
|
||||
return abstractRoles.has(role);
|
||||
};
|
||||
|
||||
var _default = isAbstractRole;
|
||||
exports["default"] = _default;
|
26
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isDOMElement.js
generated
vendored
Normal file
26
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isDOMElement.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
||||
|
||||
var _ariaQuery = require("aria-query");
|
||||
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
|
||||
var domElements = (0, _toConsumableArray2["default"])(_ariaQuery.dom.keys());
|
||||
/**
|
||||
* Returns boolean indicating whether the given element is a DOM element.
|
||||
*/
|
||||
|
||||
var isDOMElement = function isDOMElement(tagName) {
|
||||
return (0, _arrayIncludes["default"])(domElements, tagName);
|
||||
};
|
||||
|
||||
var _default = isDOMElement;
|
||||
exports["default"] = _default;
|
30
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isDisabledElement.js
generated
vendored
Normal file
30
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isDisabledElement.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
var isDisabledElement = function isDisabledElement(attributes) {
|
||||
var disabledAttr = (0, _jsxAstUtils.getProp)(attributes, 'disabled');
|
||||
var disabledAttrValue = (0, _jsxAstUtils.getPropValue)(disabledAttr);
|
||||
var isHTML5Disabled = disabledAttr && disabledAttrValue !== undefined;
|
||||
|
||||
if (isHTML5Disabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var ariaDisabledAttr = (0, _jsxAstUtils.getProp)(attributes, 'aria-disabled');
|
||||
var ariaDisabledAttrValue = (0, _jsxAstUtils.getLiteralPropValue)(ariaDisabledAttr);
|
||||
|
||||
if (ariaDisabledAttr && ariaDisabledAttrValue !== undefined && ariaDisabledAttrValue === true) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
var _default = isDisabledElement;
|
||||
exports["default"] = _default;
|
31
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js
generated
vendored
Normal file
31
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns boolean indicating that the aria-hidden prop
|
||||
* is present or the value is true. Will also return true if
|
||||
* there is an input with type='hidden'.
|
||||
*
|
||||
* <div aria-hidden /> is equivalent to the DOM as <div aria-hidden=true />.
|
||||
*/
|
||||
var isHiddenFromScreenReader = function isHiddenFromScreenReader(type, attributes) {
|
||||
if (type.toUpperCase() === 'INPUT') {
|
||||
var hidden = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'type'));
|
||||
|
||||
if (hidden && hidden.toUpperCase() === 'HIDDEN') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
var ariaHidden = (0, _jsxAstUtils.getPropValue)((0, _jsxAstUtils.getProp)(attributes, 'aria-hidden'));
|
||||
return ariaHidden === true;
|
||||
};
|
||||
|
||||
var _default = isHiddenFromScreenReader;
|
||||
exports["default"] = _default;
|
139
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js
generated
vendored
Normal file
139
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js
generated
vendored
Normal file
|
@ -0,0 +1,139 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
||||
|
||||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
||||
|
||||
var _ariaQuery = require("aria-query");
|
||||
|
||||
var _axobjectQuery = require("axobject-query");
|
||||
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
|
||||
var _attributesComparator = _interopRequireDefault(require("./attributesComparator"));
|
||||
|
||||
var domKeys = (0, _toConsumableArray2["default"])(_ariaQuery.dom.keys());
|
||||
var roleKeys = (0, _toConsumableArray2["default"])(_ariaQuery.roles.keys());
|
||||
var elementRoleEntries = (0, _toConsumableArray2["default"])(_ariaQuery.elementRoles);
|
||||
var nonInteractiveRoles = new Set(roleKeys.filter(function (name) {
|
||||
var role = _ariaQuery.roles.get(name);
|
||||
|
||||
return !role["abstract"] // 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
&& name !== 'toolbar' && !role.superClass.some(function (classes) {
|
||||
return (0, _arrayIncludes["default"])(classes, 'widget');
|
||||
});
|
||||
}).concat( // The `progressbar` is descended from `widget`, but in practice, its
|
||||
// value is always `readonly`, so we treat it as a non-interactive role.
|
||||
'progressbar'));
|
||||
var interactiveRoles = new Set(roleKeys.filter(function (name) {
|
||||
var role = _ariaQuery.roles.get(name);
|
||||
|
||||
return !role["abstract"] // The `progressbar` is descended from `widget`, but in practice, its
|
||||
// value is always `readonly`, so we treat it as a non-interactive role.
|
||||
&& name !== 'progressbar' && role.superClass.some(function (classes) {
|
||||
return (0, _arrayIncludes["default"])(classes, 'widget');
|
||||
});
|
||||
}).concat( // 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
'toolbar'));
|
||||
var nonInteractiveElementRoleSchemas = elementRoleEntries.reduce(function (accumulator, _ref) {
|
||||
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
||||
elementSchema = _ref2[0],
|
||||
roleSet = _ref2[1];
|
||||
|
||||
if ((0, _toConsumableArray2["default"])(roleSet).every(function (role) {
|
||||
return nonInteractiveRoles.has(role);
|
||||
})) {
|
||||
accumulator.push(elementSchema);
|
||||
}
|
||||
|
||||
return accumulator;
|
||||
}, []);
|
||||
var interactiveElementRoleSchemas = elementRoleEntries.reduce(function (accumulator, _ref3) {
|
||||
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
||||
elementSchema = _ref4[0],
|
||||
roleSet = _ref4[1];
|
||||
|
||||
if ((0, _toConsumableArray2["default"])(roleSet).some(function (role) {
|
||||
return interactiveRoles.has(role);
|
||||
})) {
|
||||
accumulator.push(elementSchema);
|
||||
}
|
||||
|
||||
return accumulator;
|
||||
}, []);
|
||||
var interactiveAXObjects = new Set((0, _toConsumableArray2["default"])(_axobjectQuery.AXObjects.keys()).filter(function (name) {
|
||||
return _axobjectQuery.AXObjects.get(name).type === 'widget';
|
||||
}));
|
||||
var interactiveElementAXObjectSchemas = (0, _toConsumableArray2["default"])(_axobjectQuery.elementAXObjects).reduce(function (accumulator, _ref5) {
|
||||
var _ref6 = (0, _slicedToArray2["default"])(_ref5, 2),
|
||||
elementSchema = _ref6[0],
|
||||
AXObjectSet = _ref6[1];
|
||||
|
||||
if ((0, _toConsumableArray2["default"])(AXObjectSet).every(function (role) {
|
||||
return interactiveAXObjects.has(role);
|
||||
})) {
|
||||
accumulator.push(elementSchema);
|
||||
}
|
||||
|
||||
return accumulator;
|
||||
}, []);
|
||||
|
||||
function checkIsInteractiveElement(tagName, attributes) {
|
||||
function elementSchemaMatcher(elementSchema) {
|
||||
return tagName === elementSchema.name && (0, _attributesComparator["default"])(elementSchema.attributes, attributes);
|
||||
} // Check in elementRoles for inherent interactive role associations for
|
||||
// this element.
|
||||
|
||||
|
||||
var isInherentInteractiveElement = interactiveElementRoleSchemas.some(elementSchemaMatcher);
|
||||
|
||||
if (isInherentInteractiveElement) {
|
||||
return true;
|
||||
} // Check in elementRoles for inherent non-interactive role associations for
|
||||
// this element.
|
||||
|
||||
|
||||
var isInherentNonInteractiveElement = nonInteractiveElementRoleSchemas.some(elementSchemaMatcher);
|
||||
|
||||
if (isInherentNonInteractiveElement) {
|
||||
return false;
|
||||
} // Check in elementAXObjects for AX Tree associations for this element.
|
||||
|
||||
|
||||
var isInteractiveAXElement = interactiveElementAXObjectSchemas.some(elementSchemaMatcher);
|
||||
|
||||
if (isInteractiveAXElement) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Returns boolean indicating whether the given element is
|
||||
* interactive on the DOM or not. Usually used when an element
|
||||
* has a dynamic handler on it and we need to discern whether or not
|
||||
* it's intention is to be interacted with on the DOM.
|
||||
*/
|
||||
|
||||
|
||||
var isInteractiveElement = function isInteractiveElement(tagName, attributes) {
|
||||
// Do not test higher level JSX components, as we do not know what
|
||||
// low-level DOM element this maps to.
|
||||
if (!(0, _arrayIncludes["default"])(domKeys, tagName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return checkIsInteractiveElement(tagName, attributes);
|
||||
};
|
||||
|
||||
var _default = isInteractiveElement;
|
||||
exports["default"] = _default;
|
69
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveRole.js
generated
vendored
Normal file
69
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveRole.js
generated
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
||||
|
||||
var _ariaQuery = require("aria-query");
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
|
||||
var roles = (0, _toConsumableArray2["default"])(_ariaQuery.roles.keys());
|
||||
var interactiveRoles = roles.filter(function (name) {
|
||||
return !_ariaQuery.roles.get(name)["abstract"];
|
||||
}).filter(function (name) {
|
||||
return _ariaQuery.roles.get(name).superClass.some(function (klasses) {
|
||||
return (0, _arrayIncludes["default"])(klasses, 'widget');
|
||||
});
|
||||
}); // 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
|
||||
interactiveRoles.push('toolbar');
|
||||
/**
|
||||
* Returns boolean indicating whether the given element has a role
|
||||
* that is associated with an interactive component. Used when an element
|
||||
* has a dynamic handler on it and we need to discern whether or not
|
||||
* its intention is to be interacted with in the DOM.
|
||||
*
|
||||
* isInteractiveRole is a Logical Disjunction:
|
||||
* https://en.wikipedia.org/wiki/Logical_disjunction
|
||||
* The JSX element does not have a tagName or it has a tagName and a role
|
||||
* attribute with a value in the set of non-interactive roles.
|
||||
*/
|
||||
|
||||
var isInteractiveRole = function isInteractiveRole(tagName, attributes) {
|
||||
var value = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role')); // If value is undefined, then the role attribute will be dropped in the DOM.
|
||||
// If value is null, then getLiteralAttributeValue is telling us that the
|
||||
// value isn't in the form of a literal
|
||||
|
||||
if (value === undefined || value === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var isInteractive = false;
|
||||
var normalizedValues = String(value).toLowerCase().split(' ');
|
||||
var validRoles = normalizedValues.reduce(function (accumulator, name) {
|
||||
if ((0, _arrayIncludes["default"])(roles, name)) {
|
||||
accumulator.push(name);
|
||||
}
|
||||
|
||||
return accumulator;
|
||||
}, []);
|
||||
|
||||
if (validRoles.length > 0) {
|
||||
// The first role value is a series takes precedence.
|
||||
isInteractive = (0, _arrayIncludes["default"])(interactiveRoles, validRoles[0]);
|
||||
}
|
||||
|
||||
return isInteractive;
|
||||
};
|
||||
|
||||
var _default = isInteractiveRole;
|
||||
exports["default"] = _default;
|
152
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement.js
generated
vendored
Normal file
152
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement.js
generated
vendored
Normal file
|
@ -0,0 +1,152 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
||||
|
||||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
||||
|
||||
var _ariaQuery = require("aria-query");
|
||||
|
||||
var _axobjectQuery = require("axobject-query");
|
||||
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
|
||||
var _attributesComparator = _interopRequireDefault(require("./attributesComparator"));
|
||||
|
||||
var roleKeys = (0, _toConsumableArray2["default"])(_ariaQuery.roles.keys());
|
||||
var elementRoleEntries = (0, _toConsumableArray2["default"])(_ariaQuery.elementRoles);
|
||||
var nonInteractiveRoles = new Set(roleKeys.filter(function (name) {
|
||||
var role = _ariaQuery.roles.get(name);
|
||||
|
||||
return !role["abstract"] // 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
&& name !== 'toolbar' // This role is meant to have no semantic value.
|
||||
// @see https://www.w3.org/TR/wai-aria-1.2/#generic
|
||||
&& name !== 'generic' && !role.superClass.some(function (classes) {
|
||||
return (0, _arrayIncludes["default"])(classes, 'widget');
|
||||
});
|
||||
}).concat( // The `progressbar` is descended from `widget`, but in practice, its
|
||||
// value is always `readonly`, so we treat it as a non-interactive role.
|
||||
'progressbar'));
|
||||
var interactiveRoles = new Set(roleKeys.filter(function (name) {
|
||||
var role = _ariaQuery.roles.get(name);
|
||||
|
||||
return !role["abstract"] // The `progressbar` is descended from `widget`, but in practice, its
|
||||
// value is always `readonly`, so we treat it as a non-interactive role.
|
||||
&& name !== 'progressbar' // This role is meant to have no semantic value.
|
||||
// @see https://www.w3.org/TR/wai-aria-1.2/#generic
|
||||
&& name !== 'generic' && role.superClass.some(function (classes) {
|
||||
return (0, _arrayIncludes["default"])(classes, 'widget');
|
||||
});
|
||||
}).concat( // 'toolbar' does not descend from widget, but it does support
|
||||
// aria-activedescendant, thus in practice we treat it as a widget.
|
||||
'toolbar'));
|
||||
var nonInteractiveElementRoleSchemas = elementRoleEntries.reduce(function (accumulator, _ref) {
|
||||
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
||||
elementSchema = _ref2[0],
|
||||
roleSet = _ref2[1];
|
||||
|
||||
if ((0, _toConsumableArray2["default"])(roleSet).every(function (role) {
|
||||
return nonInteractiveRoles.has(role);
|
||||
})) {
|
||||
accumulator.push(elementSchema);
|
||||
}
|
||||
|
||||
return accumulator;
|
||||
}, []);
|
||||
var interactiveElementRoleSchemas = elementRoleEntries.reduce(function (accumulator, _ref3) {
|
||||
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
||||
elementSchema = _ref4[0],
|
||||
roleSet = _ref4[1];
|
||||
|
||||
if ((0, _toConsumableArray2["default"])(roleSet).some(function (role) {
|
||||
return interactiveRoles.has(role);
|
||||
})) {
|
||||
accumulator.push(elementSchema);
|
||||
}
|
||||
|
||||
return accumulator;
|
||||
}, []);
|
||||
var nonInteractiveAXObjects = new Set((0, _toConsumableArray2["default"])(_axobjectQuery.AXObjects.keys()).filter(function (name) {
|
||||
return (0, _arrayIncludes["default"])(['window', 'structure'], _axobjectQuery.AXObjects.get(name).type);
|
||||
}));
|
||||
var nonInteractiveElementAXObjectSchemas = (0, _toConsumableArray2["default"])(_axobjectQuery.elementAXObjects).reduce(function (accumulator, _ref5) {
|
||||
var _ref6 = (0, _slicedToArray2["default"])(_ref5, 2),
|
||||
elementSchema = _ref6[0],
|
||||
AXObjectSet = _ref6[1];
|
||||
|
||||
if ((0, _toConsumableArray2["default"])(AXObjectSet).every(function (role) {
|
||||
return nonInteractiveAXObjects.has(role);
|
||||
})) {
|
||||
accumulator.push(elementSchema);
|
||||
}
|
||||
|
||||
return accumulator;
|
||||
}, []);
|
||||
|
||||
function checkIsNonInteractiveElement(tagName, attributes) {
|
||||
function elementSchemaMatcher(elementSchema) {
|
||||
return tagName === elementSchema.name && (0, _attributesComparator["default"])(elementSchema.attributes, attributes);
|
||||
} // Check in elementRoles for inherent non-interactive role associations for
|
||||
// this element.
|
||||
|
||||
|
||||
var isInherentNonInteractiveElement = nonInteractiveElementRoleSchemas.some(elementSchemaMatcher);
|
||||
|
||||
if (isInherentNonInteractiveElement) {
|
||||
return true;
|
||||
} // Check in elementRoles for inherent interactive role associations for
|
||||
// this element.
|
||||
|
||||
|
||||
var isInherentInteractiveElement = interactiveElementRoleSchemas.some(elementSchemaMatcher);
|
||||
|
||||
if (isInherentInteractiveElement) {
|
||||
return false;
|
||||
} // Check in elementAXObjects for AX Tree associations for this element.
|
||||
|
||||
|
||||
var isNonInteractiveAXElement = nonInteractiveElementAXObjectSchemas.some(elementSchemaMatcher);
|
||||
|
||||
if (isNonInteractiveAXElement) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Returns boolean indicating whether the given element is a non-interactive
|
||||
* element. If the element has either a non-interactive role assigned or it
|
||||
* is an element with an inherently non-interactive role, then this utility
|
||||
* returns true. Elements that lack either an explicitly assigned role or
|
||||
* an inherent role are not considered. For those, this utility returns false
|
||||
* because a positive determination of interactiveness cannot be determined.
|
||||
*/
|
||||
|
||||
|
||||
var isNonInteractiveElement = function isNonInteractiveElement(tagName, attributes) {
|
||||
// Do not test higher level JSX components, as we do not know what
|
||||
// low-level DOM element this maps to.
|
||||
if (!_ariaQuery.dom.has(tagName)) {
|
||||
return false;
|
||||
} // <header> elements do not technically have semantics, unless the
|
||||
// element is a direct descendant of <body>, and this plugin cannot
|
||||
// reliably test that.
|
||||
// @see https://www.w3.org/TR/wai-aria-practices/examples/landmarks/banner.html
|
||||
|
||||
|
||||
if (tagName === 'header') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return checkIsNonInteractiveElement(tagName, attributes);
|
||||
};
|
||||
|
||||
var _default = isNonInteractiveElement;
|
||||
exports["default"] = _default;
|
71
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole.js
generated
vendored
Normal file
71
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole.js
generated
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
||||
|
||||
var _ariaQuery = require("aria-query");
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
|
||||
var roles = (0, _toConsumableArray2["default"])(_ariaQuery.roles.keys());
|
||||
var nonInteractiveRoles = roles.filter(function (name) {
|
||||
return !_ariaQuery.roles.get(name)["abstract"];
|
||||
}).filter(function (name) {
|
||||
return !_ariaQuery.roles.get(name).superClass.some(function (klasses) {
|
||||
return (0, _arrayIncludes["default"])(klasses, 'widget');
|
||||
});
|
||||
});
|
||||
/**
|
||||
* Returns boolean indicating whether the given element has a role
|
||||
* that is associated with a non-interactive component. Non-interactive roles
|
||||
* include `listitem`, `article`, or `dialog`. These are roles that indicate
|
||||
* for the most part containers.
|
||||
*
|
||||
* Elements with these roles should not respond or handle user interactions.
|
||||
* For example, an `onClick` handler should not be assigned to an element with
|
||||
* the role `listitem`. An element inside the `listitem`, like a button or a
|
||||
* link, should handle the click.
|
||||
*
|
||||
* This utility returns true for elements that are assigned a non-interactive
|
||||
* role. It will return false for elements that do not have a role. So whereas
|
||||
* a `div` might be considered non-interactive, for the purpose of this utility,
|
||||
* it is considered neither interactive nor non-interactive -- a determination
|
||||
* cannot be made in this case and false is returned.
|
||||
*/
|
||||
|
||||
var isNonInteractiveRole = function isNonInteractiveRole(tagName, attributes) {
|
||||
// Do not test higher level JSX components, as we do not know what
|
||||
// low-level DOM element this maps to.
|
||||
if (!_ariaQuery.dom.has(tagName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var role = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role'));
|
||||
var isNonInteractive = false;
|
||||
var normalizedValues = String(role).toLowerCase().split(' ');
|
||||
var validRoles = normalizedValues.reduce(function (accumulator, name) {
|
||||
if ((0, _arrayIncludes["default"])(roles, name)) {
|
||||
accumulator.push(name);
|
||||
}
|
||||
|
||||
return accumulator;
|
||||
}, []);
|
||||
|
||||
if (validRoles.length > 0) {
|
||||
// The first role value is a series takes precedence.
|
||||
isNonInteractive = (0, _arrayIncludes["default"])(nonInteractiveRoles, validRoles[0]);
|
||||
}
|
||||
|
||||
return isNonInteractive;
|
||||
};
|
||||
|
||||
var _default = isNonInteractiveRole;
|
||||
exports["default"] = _default;
|
34
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty.js
generated
vendored
Normal file
34
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns boolean indicating whether the given element has been specified with
|
||||
* an AST node with a non-literal type.
|
||||
*
|
||||
* Returns true if the elements has a role and its value is not of a type Literal.
|
||||
* Otherwise returns false.
|
||||
*/
|
||||
var isNonLiteralProperty = function isNonLiteralProperty(attributes, propName) {
|
||||
var prop = (0, _jsxAstUtils.getProp)(attributes, propName);
|
||||
if (!prop) return false;
|
||||
var propValue = prop.value;
|
||||
if (!propValue) return false;
|
||||
if (propValue.type === 'Literal') return false;
|
||||
|
||||
if (propValue.type === 'JSXExpressionContainer') {
|
||||
var expression = propValue.expression;
|
||||
if (expression.type === 'Identifier' && expression.name === 'undefined') return false;
|
||||
if (expression.type === 'JSXText') return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
var _default = isNonLiteralProperty;
|
||||
exports["default"] = _default;
|
17
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isPresentationRole.js
generated
vendored
Normal file
17
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isPresentationRole.js
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
var presentationRoles = new Set(['presentation', 'none']);
|
||||
|
||||
var isPresentationRole = function isPresentationRole(tagName, attributes) {
|
||||
return presentationRoles.has((0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'role')));
|
||||
};
|
||||
|
||||
var _default = isPresentationRole;
|
||||
exports["default"] = _default;
|
68
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement.js
generated
vendored
Normal file
68
web/node_modules/eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement.js
generated
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _axobjectQuery = require("axobject-query");
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
var isSemanticRoleElement = function isSemanticRoleElement(elementType, attributes) {
|
||||
var roleAttr = (0, _jsxAstUtils.getProp)(attributes, 'role');
|
||||
var res = false;
|
||||
var roleAttrValue = (0, _jsxAstUtils.getLiteralPropValue)(roleAttr);
|
||||
|
||||
_axobjectQuery.elementAXObjects.forEach(function (axObjects, concept) {
|
||||
if (res) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (concept.name === elementType && (concept.attributes || []).every(function (cAttr) {
|
||||
return attributes.some(function (attr) {
|
||||
if (!attr.type || attr.type !== 'JSXAttribute') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var namesMatch = cAttr.name === (0, _jsxAstUtils.propName)(attr);
|
||||
var valuesMatch;
|
||||
|
||||
if (cAttr.value !== undefined) {
|
||||
valuesMatch = cAttr.value === (0, _jsxAstUtils.getLiteralPropValue)(attr);
|
||||
}
|
||||
|
||||
if (!namesMatch) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return namesMatch && valuesMatch !== undefined ? valuesMatch : true;
|
||||
});
|
||||
})) {
|
||||
axObjects.forEach(function (name) {
|
||||
if (res) {
|
||||
return;
|
||||
}
|
||||
|
||||
var roles = _axobjectQuery.AXObjectRoles.get(name);
|
||||
|
||||
if (roles) {
|
||||
roles.forEach(function (role) {
|
||||
if (res === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (role.name === roleAttrValue) {
|
||||
res = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
var _default = isSemanticRoleElement;
|
||||
exports["default"] = _default;
|
53
web/node_modules/eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent.js
generated
vendored
Normal file
53
web/node_modules/eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent.js
generated
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = mayContainChildComponent;
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns true if it can positively determine that the element lacks an
|
||||
* accessible label. If no determination is possible, it returns false. Treat
|
||||
* false as an unknown value. The element might still have an accessible label,
|
||||
* but this module cannot determine it positively.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function mayContainChildComponent(root, componentName) {
|
||||
var maxDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
||||
|
||||
function traverseChildren(node, depth) {
|
||||
// Bail when maxDepth is exceeded.
|
||||
if (depth > maxDepth) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (node.children) {
|
||||
/* $FlowFixMe */
|
||||
for (var i = 0; i < node.children.length; i += 1) {
|
||||
/* $FlowFixMe */
|
||||
var childNode = node.children[i]; // Assume an expression container renders a label. It is the best we can
|
||||
// do in this case.
|
||||
|
||||
if (childNode.type === 'JSXExpressionContainer') {
|
||||
return true;
|
||||
} // Check for comonents with the provided name.
|
||||
|
||||
|
||||
if (childNode.type === 'JSXElement' && childNode.openingElement && (0, _jsxAstUtils.elementType)(childNode.openingElement) === componentName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (traverseChildren(childNode, depth + 1)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return traverseChildren(root, 1);
|
||||
}
|
93
web/node_modules/eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel.js
generated
vendored
Normal file
93
web/node_modules/eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel.js
generated
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = mayHaveAccessibleLabel;
|
||||
|
||||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
||||
|
||||
var _arrayIncludes = _interopRequireDefault(require("array-includes"));
|
||||
|
||||
var _jsxAstUtils = require("jsx-ast-utils");
|
||||
|
||||
/**
|
||||
* Returns true if a labelling element is found or if it cannot determine if
|
||||
* a label is present because of expression containers or spread attributes.
|
||||
* A false return value means that the node definitely does not have a label,
|
||||
* but a true return return value means that the node may or may not have a
|
||||
* label.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function hasLabellingProp(openingElement) {
|
||||
var additionalLabellingProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
||||
var labellingProps = ['alt', // Assume alt is used correctly on an image
|
||||
'aria-label', 'aria-labelledby'].concat((0, _toConsumableArray2["default"])(additionalLabellingProps));
|
||||
return openingElement.attributes.some(function (attribute) {
|
||||
// We must assume that a spread value contains a labelling prop.
|
||||
if (attribute.type !== 'JSXAttribute') {
|
||||
return true;
|
||||
} // Attribute matches.
|
||||
|
||||
|
||||
if ((0, _arrayIncludes["default"])(labellingProps, (0, _jsxAstUtils.propName)(attribute)) && !!(0, _jsxAstUtils.getPropValue)(attribute)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function mayHaveAccessibleLabel(root) {
|
||||
var maxDepth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
||||
var additionalLabellingProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
||||
|
||||
function checkElement(node, depth) {
|
||||
// Bail when maxDepth is exceeded.
|
||||
if (depth > maxDepth) {
|
||||
return false;
|
||||
} // Check for literal text.
|
||||
|
||||
|
||||
if (node.type === 'Literal' && !!node.value) {
|
||||
return true;
|
||||
} // Assume an expression container renders a label. It is the best we can
|
||||
// do in this case.
|
||||
|
||||
|
||||
if (node.type === 'JSXExpressionContainer') {
|
||||
return true;
|
||||
} // Check for JSXText.
|
||||
// $FlowFixMe Remove after updating ast-types-flow
|
||||
|
||||
|
||||
if (node.type === 'JSXText' && !!node.value) {
|
||||
return true;
|
||||
} // Check for labelling props.
|
||||
|
||||
|
||||
if (node.openingElement
|
||||
/* $FlowFixMe */
|
||||
&& hasLabellingProp(node.openingElement, additionalLabellingProps)) {
|
||||
return true;
|
||||
} // Recurse into the child element nodes.
|
||||
|
||||
|
||||
if (node.children) {
|
||||
/* $FlowFixMe */
|
||||
for (var i = 0; i < node.children.length; i += 1) {
|
||||
/* $FlowFixMe */
|
||||
if (checkElement(node.children[i], depth + 1)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return checkElement(root, 0);
|
||||
}
|
62
web/node_modules/eslint-plugin-jsx-a11y/lib/util/schemas.js
generated
vendored
Normal file
62
web/node_modules/eslint-plugin-jsx-a11y/lib/util/schemas.js
generated
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.generateObjSchema = exports.enumArraySchema = exports.arraySchema = void 0;
|
||||
|
||||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
/**
|
||||
* JSON schema to accept an array of unique strings
|
||||
*/
|
||||
var arraySchema = {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string'
|
||||
},
|
||||
uniqueItems: true,
|
||||
additionalItems: false
|
||||
};
|
||||
/**
|
||||
* JSON schema to accept an array of unique strings from an enumerated list.
|
||||
*/
|
||||
|
||||
exports.arraySchema = arraySchema;
|
||||
|
||||
var enumArraySchema = function enumArraySchema() {
|
||||
var enumeratedList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
var minItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
||||
return _objectSpread(_objectSpread({}, arraySchema), {}, {
|
||||
items: {
|
||||
type: 'string',
|
||||
"enum": enumeratedList
|
||||
},
|
||||
minItems
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Factory function to generate an object schema
|
||||
* with specified properties object
|
||||
*/
|
||||
|
||||
|
||||
exports.enumArraySchema = enumArraySchema;
|
||||
|
||||
var generateObjSchema = function generateObjSchema() {
|
||||
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
var required = arguments.length > 1 ? arguments[1] : undefined;
|
||||
return {
|
||||
type: 'object',
|
||||
properties,
|
||||
required
|
||||
};
|
||||
};
|
||||
|
||||
exports.generateObjSchema = generateObjSchema;
|
Loading…
Add table
Add a link
Reference in a new issue