@atlaskit/ads-mcp 0.20.4 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/a11y-fixes/package.json +14 -0
- package/a11y-guidelines/package.json +14 -0
- package/dist/cjs/entry-points/a11y-fixes.js +12 -0
- package/dist/cjs/entry-points/a11y-guidelines.js +12 -0
- package/dist/cjs/entry-points/i18n-conversion-guide.js +12 -0
- package/dist/cjs/entry-points/migration-registry.js +12 -0
- package/dist/cjs/helpers/analytics.js +1 -0
- package/dist/cjs/index.js +23 -23
- package/dist/cjs/tools/analyze-a11y/analyze-a11y-tool.js +10 -10
- package/dist/cjs/tools/analyze-a11y/analyze-localhost-a11y-tool.js +28 -28
- package/dist/cjs/tools/get-a11y-guidelines/get-a11y-guidelines-tool.js +4 -4
- package/dist/cjs/tools/get-all-components/components.codegen.js +3 -3
- package/dist/cjs/tools/get-all-components/get-all-components-tool.js +1 -1
- package/dist/cjs/tools/get-all-icons/get-all-icons-tool.js +1 -1
- package/dist/cjs/tools/get-all-tokens/get-all-tokens-tool.js +1 -1
- package/dist/cjs/tools/get-atlaskit-components/atlaskit-components.codegen.js +633 -629
- package/dist/cjs/tools/get-atlaskit-components/get-atlaskit-components-tool.js +2 -2
- package/dist/cjs/tools/get-guidelines/get-guidelines-tool.js +4 -4
- package/dist/cjs/tools/get-lint-rules/get-lint-rules-tool.js +6 -6
- package/dist/cjs/tools/i18n-conversion/i18n-conversion-tool.js +1 -1
- package/dist/cjs/tools/migration-guides/migration-guides-tool.js +4 -4
- package/dist/cjs/tools/plan/plan-tool.js +6 -6
- package/dist/cjs/tools/search-atlaskit-components/search-atlaskit-components-tool.js +6 -6
- package/dist/cjs/tools/search-components/search-components-tool.js +6 -6
- package/dist/cjs/tools/search-icons/search-icons-tool.js +6 -6
- package/dist/cjs/tools/search-tokens/search-tokens-tool.js +6 -6
- package/dist/cjs/tools/suggest-a11y-fixes/suggest-a11y-fixes-tool.js +4 -4
- package/dist/es2019/entry-points/a11y-fixes.js +1 -0
- package/dist/es2019/entry-points/a11y-guidelines.js +1 -0
- package/dist/es2019/entry-points/i18n-conversion-guide.js +1 -0
- package/dist/es2019/entry-points/migration-registry.js +1 -0
- package/dist/es2019/helpers/analytics.js +1 -0
- package/dist/es2019/tools/get-all-components/components.codegen.js +3 -3
- package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +633 -629
- package/dist/esm/entry-points/a11y-fixes.js +1 -0
- package/dist/esm/entry-points/a11y-guidelines.js +1 -0
- package/dist/esm/entry-points/i18n-conversion-guide.js +1 -0
- package/dist/esm/entry-points/migration-registry.js +1 -0
- package/dist/esm/helpers/analytics.js +1 -0
- package/dist/esm/index.js +23 -23
- package/dist/esm/tools/analyze-a11y/analyze-a11y-tool.js +10 -10
- package/dist/esm/tools/analyze-a11y/analyze-localhost-a11y-tool.js +28 -28
- package/dist/esm/tools/get-a11y-guidelines/get-a11y-guidelines-tool.js +4 -4
- package/dist/esm/tools/get-all-components/components.codegen.js +3 -3
- package/dist/esm/tools/get-all-components/get-all-components-tool.js +1 -1
- package/dist/esm/tools/get-all-icons/get-all-icons-tool.js +1 -1
- package/dist/esm/tools/get-all-tokens/get-all-tokens-tool.js +1 -1
- package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +633 -629
- package/dist/esm/tools/get-atlaskit-components/get-atlaskit-components-tool.js +2 -2
- package/dist/esm/tools/get-guidelines/get-guidelines-tool.js +4 -4
- package/dist/esm/tools/get-lint-rules/get-lint-rules-tool.js +6 -6
- package/dist/esm/tools/i18n-conversion/i18n-conversion-tool.js +1 -1
- package/dist/esm/tools/migration-guides/migration-guides-tool.js +4 -4
- package/dist/esm/tools/plan/plan-tool.js +6 -6
- package/dist/esm/tools/search-atlaskit-components/search-atlaskit-components-tool.js +6 -6
- package/dist/esm/tools/search-components/search-components-tool.js +6 -6
- package/dist/esm/tools/search-icons/search-icons-tool.js +6 -6
- package/dist/esm/tools/search-tokens/search-tokens-tool.js +6 -6
- package/dist/esm/tools/suggest-a11y-fixes/suggest-a11y-fixes-tool.js +4 -4
- package/dist/types/entry-points/a11y-fixes.d.ts +1 -0
- package/dist/types/entry-points/a11y-guidelines.d.ts +1 -0
- package/dist/types/entry-points/i18n-conversion-guide.d.ts +1 -0
- package/dist/types/entry-points/migration-registry.d.ts +1 -0
- package/dist/types/tools/get-all-components/components.codegen.d.ts +2 -2
- package/dist/types/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +2 -2
- package/dist/types-ts4.5/entry-points/a11y-fixes.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/a11y-guidelines.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/i18n-conversion-guide.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/migration-registry.d.ts +1 -0
- package/dist/types-ts4.5/tools/get-all-components/components.codegen.d.ts +2 -2
- package/dist/types-ts4.5/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +2 -2
- package/i18n-conversion-guide/package.json +14 -0
- package/migration-registry/package.json +14 -0
- package/package.json +4 -4
- package/dist/cjs/tools/migration-guides/registry.js +0 -38
- package/dist/es2019/tools/migration-guides/registry.js +0 -25
- package/dist/esm/tools/migration-guides/registry.js +0 -27
- package/dist/types/tools/migration-guides/registry.d.ts +0 -18
- package/dist/types-ts4.5/tools/migration-guides/registry.d.ts +0 -18
|
@@ -13,7 +13,7 @@ var _atlaskitComponents = require("./atlaskit-components.codegen");
|
|
|
13
13
|
var getAtlaskitComponentsTool = exports.getAtlaskitComponentsTool = /*#__PURE__*/function () {
|
|
14
14
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
15
15
|
var components;
|
|
16
|
-
return _regenerator.default.wrap(function
|
|
16
|
+
return _regenerator.default.wrap(function (_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
19
19
|
components = _atlaskitComponents.atlaskitComponents.map(function (component) {
|
|
@@ -28,7 +28,7 @@ var getAtlaskitComponentsTool = exports.getAtlaskitComponentsTool = /*#__PURE__*
|
|
|
28
28
|
text: JSON.stringify(components, null, 2)
|
|
29
29
|
}]
|
|
30
30
|
});
|
|
31
|
-
case
|
|
31
|
+
case 1:
|
|
32
32
|
case "end":
|
|
33
33
|
return _context.stop();
|
|
34
34
|
}
|
|
@@ -15,14 +15,14 @@ var _guidelinesStructuredContent = require("./guidelines-structured-content.code
|
|
|
15
15
|
var getGuidelinesTool = exports.getGuidelinesTool = /*#__PURE__*/function () {
|
|
16
16
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
|
|
17
17
|
var _params$terms, terms, _params$limit, limit, searchTerms, guidelineDocs, allGuidelinesMarkdown, fuse, results, seen, uniqueResults, matchedGuidelines, formattedGuidelines;
|
|
18
|
-
return _regenerator.default.wrap(function
|
|
18
|
+
return _regenerator.default.wrap(function (_context) {
|
|
19
19
|
while (1) switch (_context.prev = _context.next) {
|
|
20
20
|
case 0:
|
|
21
21
|
_params$terms = params.terms, terms = _params$terms === void 0 ? [] : _params$terms, _params$limit = params.limit, limit = _params$limit === void 0 ? 1 : _params$limit;
|
|
22
22
|
searchTerms = terms.filter(Boolean).map(_cleanQuery.cleanQuery);
|
|
23
23
|
guidelineDocs = _guidelinesStructuredContent.guidelinesStructuredContent; // If no search terms provided, return all guidelines formatted as Markdown
|
|
24
24
|
if (!(searchTerms.length === 0)) {
|
|
25
|
-
_context.next =
|
|
25
|
+
_context.next = 1;
|
|
26
26
|
break;
|
|
27
27
|
}
|
|
28
28
|
allGuidelinesMarkdown = guidelineDocs.map(function (guideline) {
|
|
@@ -34,7 +34,7 @@ var getGuidelinesTool = exports.getGuidelinesTool = /*#__PURE__*/function () {
|
|
|
34
34
|
text: allGuidelinesMarkdown
|
|
35
35
|
}]
|
|
36
36
|
});
|
|
37
|
-
case
|
|
37
|
+
case 1:
|
|
38
38
|
// Use Fuse.js to fuzzy-search by keywords and content
|
|
39
39
|
fuse = new _fuse.default(guidelineDocs, {
|
|
40
40
|
keys: [{
|
|
@@ -70,7 +70,7 @@ var getGuidelinesTool = exports.getGuidelinesTool = /*#__PURE__*/function () {
|
|
|
70
70
|
text: formattedGuidelines
|
|
71
71
|
}]
|
|
72
72
|
});
|
|
73
|
-
case
|
|
73
|
+
case 2:
|
|
74
74
|
case "end":
|
|
75
75
|
return _context.stop();
|
|
76
76
|
}
|
|
@@ -15,14 +15,14 @@ var _lintRulesStructuredContent = require("./lint-rules-structured-content.codeg
|
|
|
15
15
|
var getLintRulesTool = exports.getLintRulesTool = /*#__PURE__*/function () {
|
|
16
16
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
|
|
17
17
|
var _params$terms, terms, _params$limit, limit, _params$exactName, exactName, searchTerms, ruleDocs, _payload, exactNameMatches, _payload2, fuse, results, uniqueResults, matchedRules, payload;
|
|
18
|
-
return _regenerator.default.wrap(function
|
|
18
|
+
return _regenerator.default.wrap(function (_context) {
|
|
19
19
|
while (1) switch (_context.prev = _context.next) {
|
|
20
20
|
case 0:
|
|
21
21
|
_params$terms = params.terms, terms = _params$terms === void 0 ? [] : _params$terms, _params$limit = params.limit, limit = _params$limit === void 0 ? 1 : _params$limit, _params$exactName = params.exactName, exactName = _params$exactName === void 0 ? false : _params$exactName;
|
|
22
22
|
searchTerms = terms.filter(Boolean).map(_cleanQuery.cleanQuery);
|
|
23
23
|
ruleDocs = _lintRulesStructuredContent.lintRulesMcpStructuredContent; // If no search terms provided, return all rules as JSON array
|
|
24
24
|
if (!(searchTerms.length === 0)) {
|
|
25
|
-
_context.next =
|
|
25
|
+
_context.next = 1;
|
|
26
26
|
break;
|
|
27
27
|
}
|
|
28
28
|
_payload = ruleDocs.map(function (rule) {
|
|
@@ -34,9 +34,9 @@ var getLintRulesTool = exports.getLintRulesTool = /*#__PURE__*/function () {
|
|
|
34
34
|
text: JSON.stringify(_payload)
|
|
35
35
|
}]
|
|
36
36
|
});
|
|
37
|
-
case
|
|
37
|
+
case 1:
|
|
38
38
|
if (!exactName) {
|
|
39
|
-
_context.next =
|
|
39
|
+
_context.next = 2;
|
|
40
40
|
break;
|
|
41
41
|
}
|
|
42
42
|
exactNameMatches = searchTerms.map(function (term) {
|
|
@@ -55,7 +55,7 @@ var getLintRulesTool = exports.getLintRulesTool = /*#__PURE__*/function () {
|
|
|
55
55
|
text: JSON.stringify(_payload2)
|
|
56
56
|
}]
|
|
57
57
|
});
|
|
58
|
-
case
|
|
58
|
+
case 2:
|
|
59
59
|
// use Fuse.js to fuzzy-search for the rules
|
|
60
60
|
fuse = new _fuse.default(ruleDocs, {
|
|
61
61
|
keys: [{
|
|
@@ -98,7 +98,7 @@ var getLintRulesTool = exports.getLintRulesTool = /*#__PURE__*/function () {
|
|
|
98
98
|
text: JSON.stringify(payload)
|
|
99
99
|
}]
|
|
100
100
|
});
|
|
101
|
-
case
|
|
101
|
+
case 3:
|
|
102
102
|
case "end":
|
|
103
103
|
return _context.stop();
|
|
104
104
|
}
|
|
@@ -12,7 +12,7 @@ var _guide = require("./guide");
|
|
|
12
12
|
|
|
13
13
|
var i18nConversionTool = exports.i18nConversionTool = /*#__PURE__*/function () {
|
|
14
14
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_params) {
|
|
15
|
-
return _regenerator.default.wrap(function
|
|
15
|
+
return _regenerator.default.wrap(function (_context) {
|
|
16
16
|
while (1) switch (_context.prev = _context.next) {
|
|
17
17
|
case 0:
|
|
18
18
|
return _context.abrupt("return", {
|
|
@@ -14,13 +14,13 @@ var _migrationRegistry = require("./migration-registry");
|
|
|
14
14
|
var migrationGuidesTool = exports.migrationGuidesTool = /*#__PURE__*/function () {
|
|
15
15
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
|
|
16
16
|
var migration, guide;
|
|
17
|
-
return _regenerator.default.wrap(function
|
|
17
|
+
return _regenerator.default.wrap(function (_context) {
|
|
18
18
|
while (1) switch (_context.prev = _context.next) {
|
|
19
19
|
case 0:
|
|
20
20
|
migration = params.migration;
|
|
21
21
|
guide = _migrationRegistry.migrationRegistry[migration];
|
|
22
22
|
if (guide) {
|
|
23
|
-
_context.next =
|
|
23
|
+
_context.next = 1;
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
26
|
return _context.abrupt("return", {
|
|
@@ -33,7 +33,7 @@ var migrationGuidesTool = exports.migrationGuidesTool = /*#__PURE__*/function ()
|
|
|
33
33
|
}, null, 2)
|
|
34
34
|
}]
|
|
35
35
|
});
|
|
36
|
-
case
|
|
36
|
+
case 1:
|
|
37
37
|
return _context.abrupt("return", {
|
|
38
38
|
content: [{
|
|
39
39
|
type: 'text',
|
|
@@ -50,7 +50,7 @@ var migrationGuidesTool = exports.migrationGuidesTool = /*#__PURE__*/function ()
|
|
|
50
50
|
}, null, 2)
|
|
51
51
|
}]
|
|
52
52
|
});
|
|
53
|
-
case
|
|
53
|
+
case 2:
|
|
54
54
|
case "end":
|
|
55
55
|
return _context.stop();
|
|
56
56
|
}
|
|
@@ -17,12 +17,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
17
17
|
var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
18
18
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
19
19
|
var tokens_search, icons_search, components_search, atlaskit_components_search, limit, results, searchPromises, getResultCount, consolidatedResult;
|
|
20
|
-
return _regenerator.default.wrap(function
|
|
20
|
+
return _regenerator.default.wrap(function (_context) {
|
|
21
21
|
while (1) switch (_context.prev = _context.next) {
|
|
22
22
|
case 0:
|
|
23
23
|
tokens_search = _ref.tokens, icons_search = _ref.icons, components_search = _ref.components, atlaskit_components_search = _ref.atlaskitComponents, limit = _ref.limit;
|
|
24
24
|
if (!(!(tokens_search !== null && tokens_search !== void 0 && tokens_search.length) && !(icons_search !== null && icons_search !== void 0 && icons_search.length) && !(components_search !== null && components_search !== void 0 && components_search.length) && !(atlaskit_components_search !== null && atlaskit_components_search !== void 0 && atlaskit_components_search.length))) {
|
|
25
|
-
_context.next =
|
|
25
|
+
_context.next = 1;
|
|
26
26
|
break;
|
|
27
27
|
}
|
|
28
28
|
return _context.abrupt("return", {
|
|
@@ -32,7 +32,7 @@ var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
|
32
32
|
text: 'Error: At least one search type (tokens_search, icons_search, components_search, or atlaskit_components_search) must be provided with search terms'
|
|
33
33
|
}]
|
|
34
34
|
});
|
|
35
|
-
case
|
|
35
|
+
case 1:
|
|
36
36
|
results = {}; // Execute searches in parallel
|
|
37
37
|
searchPromises = [];
|
|
38
38
|
if (tokens_search !== null && tokens_search !== void 0 && tokens_search.length) {
|
|
@@ -69,9 +69,9 @@ var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// Wait for all searches to complete
|
|
72
|
-
_context.next =
|
|
72
|
+
_context.next = 2;
|
|
73
73
|
return Promise.all(searchPromises);
|
|
74
|
-
case
|
|
74
|
+
case 2:
|
|
75
75
|
// Helper function to safely count results
|
|
76
76
|
getResultCount = function getResultCount(result) {
|
|
77
77
|
var _result$content;
|
|
@@ -112,7 +112,7 @@ var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
|
112
112
|
text: JSON.stringify(consolidatedResult, null, 2)
|
|
113
113
|
}]
|
|
114
114
|
});
|
|
115
|
-
case
|
|
115
|
+
case 3:
|
|
116
116
|
case "end":
|
|
117
117
|
return _context.stop();
|
|
118
118
|
}
|
|
@@ -24,13 +24,13 @@ var buildComponentResult = function buildComponentResult(result) {
|
|
|
24
24
|
var searchAtlaskitComponentsTool = exports.searchAtlaskitComponentsTool = /*#__PURE__*/function () {
|
|
25
25
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
26
26
|
var terms, _ref$limit, limit, searchTerms, components, fuse, matchedItems;
|
|
27
|
-
return _regenerator.default.wrap(function
|
|
27
|
+
return _regenerator.default.wrap(function (_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
30
30
|
terms = _ref.terms, _ref$limit = _ref.limit, limit = _ref$limit === void 0 ? 2 : _ref$limit;
|
|
31
31
|
searchTerms = (0, _toConsumableArray2.default)(new Set(terms.filter(Boolean).map(_helpers.cleanQuery)));
|
|
32
32
|
if (searchTerms.length) {
|
|
33
|
-
_context.next =
|
|
33
|
+
_context.next = 1;
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
36
36
|
return _context.abrupt("return", {
|
|
@@ -39,7 +39,7 @@ var searchAtlaskitComponentsTool = exports.searchAtlaskitComponentsTool = /*#__P
|
|
|
39
39
|
text: '[]'
|
|
40
40
|
}]
|
|
41
41
|
});
|
|
42
|
-
case
|
|
42
|
+
case 1:
|
|
43
43
|
components = _atlaskitComponents.atlaskitComponents;
|
|
44
44
|
fuse = new _fuse.default(components, {
|
|
45
45
|
keys: [{
|
|
@@ -86,7 +86,7 @@ var searchAtlaskitComponentsTool = exports.searchAtlaskitComponentsTool = /*#__P
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
if (matchedItems.length) {
|
|
89
|
-
_context.next =
|
|
89
|
+
_context.next = 2;
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
return _context.abrupt("return", {
|
|
@@ -95,14 +95,14 @@ var searchAtlaskitComponentsTool = exports.searchAtlaskitComponentsTool = /*#__P
|
|
|
95
95
|
text: "Error: No Atlaskit components found for '".concat(terms.join(', '), "'.")
|
|
96
96
|
}]
|
|
97
97
|
});
|
|
98
|
-
case
|
|
98
|
+
case 2:
|
|
99
99
|
return _context.abrupt("return", {
|
|
100
100
|
content: [{
|
|
101
101
|
type: 'text',
|
|
102
102
|
text: JSON.stringify(matchedItems.map(buildComponentResult))
|
|
103
103
|
}]
|
|
104
104
|
});
|
|
105
|
-
case
|
|
105
|
+
case 3:
|
|
106
106
|
case "end":
|
|
107
107
|
return _context.stop();
|
|
108
108
|
}
|
|
@@ -25,13 +25,13 @@ var buildComponentResult = function buildComponentResult(result) {
|
|
|
25
25
|
var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function () {
|
|
26
26
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
27
27
|
var terms, _ref$limit, limit, searchTerms, components, fuse, matchedItems;
|
|
28
|
-
return _regenerator.default.wrap(function
|
|
28
|
+
return _regenerator.default.wrap(function (_context) {
|
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
|
30
30
|
case 0:
|
|
31
31
|
terms = _ref.terms, _ref$limit = _ref.limit, limit = _ref$limit === void 0 ? 2 : _ref$limit;
|
|
32
32
|
searchTerms = (0, _toConsumableArray2.default)(new Set(terms.filter(Boolean).map(_cleanQuery.cleanQuery)));
|
|
33
33
|
if (searchTerms.length) {
|
|
34
|
-
_context.next =
|
|
34
|
+
_context.next = 1;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
37
|
return _context.abrupt("return", {
|
|
@@ -40,7 +40,7 @@ var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function
|
|
|
40
40
|
text: '[]'
|
|
41
41
|
}]
|
|
42
42
|
});
|
|
43
|
-
case
|
|
43
|
+
case 1:
|
|
44
44
|
components = (0, _loadAllComponents.loadAllComponents)();
|
|
45
45
|
fuse = new _fuse.default(components, {
|
|
46
46
|
keys: [{
|
|
@@ -87,7 +87,7 @@ var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function
|
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
if (matchedItems.length) {
|
|
90
|
-
_context.next =
|
|
90
|
+
_context.next = 2;
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
93
|
return _context.abrupt("return", {
|
|
@@ -98,14 +98,14 @@ var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function
|
|
|
98
98
|
}).join(', '))
|
|
99
99
|
}]
|
|
100
100
|
});
|
|
101
|
-
case
|
|
101
|
+
case 2:
|
|
102
102
|
return _context.abrupt("return", {
|
|
103
103
|
content: [{
|
|
104
104
|
type: 'text',
|
|
105
105
|
text: JSON.stringify(matchedItems.map(buildComponentResult))
|
|
106
106
|
}]
|
|
107
107
|
});
|
|
108
|
-
case
|
|
108
|
+
case 3:
|
|
109
109
|
case "end":
|
|
110
110
|
return _context.stop();
|
|
111
111
|
}
|
|
@@ -24,13 +24,13 @@ var buildIconResult = function buildIconResult(icon) {
|
|
|
24
24
|
var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
25
25
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
26
26
|
var terms, _ref$limit, limit, searchTerms, fuse, matchedItems;
|
|
27
|
-
return _regenerator.default.wrap(function
|
|
27
|
+
return _regenerator.default.wrap(function (_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
30
30
|
terms = _ref.terms, _ref$limit = _ref.limit, limit = _ref$limit === void 0 ? 2 : _ref$limit;
|
|
31
31
|
searchTerms = (0, _toConsumableArray2.default)(new Set(terms.filter(Boolean).map(_cleanQuery.cleanQuery)));
|
|
32
32
|
if (searchTerms.length) {
|
|
33
|
-
_context.next =
|
|
33
|
+
_context.next = 1;
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
36
36
|
return _context.abrupt("return", {
|
|
@@ -39,7 +39,7 @@ var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
|
39
39
|
text: '[]'
|
|
40
40
|
}]
|
|
41
41
|
});
|
|
42
|
-
case
|
|
42
|
+
case 1:
|
|
43
43
|
fuse = new _fuse.default(_icons.icons, {
|
|
44
44
|
keys: [{
|
|
45
45
|
name: 'componentName',
|
|
@@ -79,7 +79,7 @@ var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
if (matchedItems.length) {
|
|
82
|
-
_context.next =
|
|
82
|
+
_context.next = 2;
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
85
85
|
return _context.abrupt("return", {
|
|
@@ -90,14 +90,14 @@ var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
|
90
90
|
}).join(', '))
|
|
91
91
|
}]
|
|
92
92
|
});
|
|
93
|
-
case
|
|
93
|
+
case 2:
|
|
94
94
|
return _context.abrupt("return", {
|
|
95
95
|
content: [{
|
|
96
96
|
type: 'text',
|
|
97
97
|
text: JSON.stringify(matchedItems.map(buildIconResult))
|
|
98
98
|
}]
|
|
99
99
|
});
|
|
100
|
-
case
|
|
100
|
+
case 3:
|
|
101
101
|
case "end":
|
|
102
102
|
return _context.stop();
|
|
103
103
|
}
|
|
@@ -17,14 +17,14 @@ var _cleanQuery = require("../../helpers/clean-query");
|
|
|
17
17
|
var searchTokensTool = exports.searchTokensTool = /*#__PURE__*/function () {
|
|
18
18
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
19
19
|
var terms, _ref$limit, limit, searchTerms, fuse, matchedItems, matchedTokens;
|
|
20
|
-
return _regenerator.default.wrap(function
|
|
20
|
+
return _regenerator.default.wrap(function (_context) {
|
|
21
21
|
while (1) switch (_context.prev = _context.next) {
|
|
22
22
|
case 0:
|
|
23
23
|
terms = _ref.terms, _ref$limit = _ref.limit, limit = _ref$limit === void 0 ? 2 : _ref$limit;
|
|
24
24
|
// Unique cleaned terms (order preserved) so duplicates don't concatenate into a bogus query.
|
|
25
25
|
searchTerms = (0, _toConsumableArray2.default)(new Set(terms.filter(Boolean).map(_cleanQuery.cleanQuery)));
|
|
26
26
|
if (searchTerms.length) {
|
|
27
|
-
_context.next =
|
|
27
|
+
_context.next = 1;
|
|
28
28
|
break;
|
|
29
29
|
}
|
|
30
30
|
return _context.abrupt("return", {
|
|
@@ -33,7 +33,7 @@ var searchTokensTool = exports.searchTokensTool = /*#__PURE__*/function () {
|
|
|
33
33
|
text: '[]'
|
|
34
34
|
}]
|
|
35
35
|
});
|
|
36
|
-
case
|
|
36
|
+
case 1:
|
|
37
37
|
fuse = new _fuse.default(_tokenMetadata.tokens, {
|
|
38
38
|
keys: [{
|
|
39
39
|
name: 'name',
|
|
@@ -77,7 +77,7 @@ var searchTokensTool = exports.searchTokensTool = /*#__PURE__*/function () {
|
|
|
77
77
|
};
|
|
78
78
|
});
|
|
79
79
|
if (matchedTokens.length) {
|
|
80
|
-
_context.next =
|
|
80
|
+
_context.next = 2;
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
83
|
return _context.abrupt("return", {
|
|
@@ -88,14 +88,14 @@ var searchTokensTool = exports.searchTokensTool = /*#__PURE__*/function () {
|
|
|
88
88
|
}).join(', '))
|
|
89
89
|
}]
|
|
90
90
|
});
|
|
91
|
-
case
|
|
91
|
+
case 2:
|
|
92
92
|
return _context.abrupt("return", {
|
|
93
93
|
content: [{
|
|
94
94
|
type: 'text',
|
|
95
95
|
text: JSON.stringify(matchedTokens)
|
|
96
96
|
}]
|
|
97
97
|
});
|
|
98
|
-
case
|
|
98
|
+
case 3:
|
|
99
99
|
case "end":
|
|
100
100
|
return _context.stop();
|
|
101
101
|
}
|
|
@@ -97,13 +97,13 @@ function findBestMatchingFix(violation) {
|
|
|
97
97
|
var suggestA11yFixesTool = exports.suggestA11yFixesTool = /*#__PURE__*/function () {
|
|
98
98
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
|
|
99
99
|
var violation, component, context, match, _match, key, fix;
|
|
100
|
-
return _regenerator.default.wrap(function
|
|
100
|
+
return _regenerator.default.wrap(function (_context) {
|
|
101
101
|
while (1) switch (_context.prev = _context.next) {
|
|
102
102
|
case 0:
|
|
103
103
|
violation = params.violation, component = params.component, context = params.context; // Use improved matching logic
|
|
104
104
|
match = findBestMatchingFix(violation);
|
|
105
105
|
if (!match) {
|
|
106
|
-
_context.next =
|
|
106
|
+
_context.next = 1;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
_match = (0, _slicedToArray2.default)(match, 2), key = _match[0], fix = _match[1];
|
|
@@ -121,7 +121,7 @@ var suggestA11yFixesTool = exports.suggestA11yFixesTool = /*#__PURE__*/function
|
|
|
121
121
|
}), null, 2)
|
|
122
122
|
}]
|
|
123
123
|
});
|
|
124
|
-
case
|
|
124
|
+
case 1:
|
|
125
125
|
return _context.abrupt("return", {
|
|
126
126
|
content: [{
|
|
127
127
|
type: 'text',
|
|
@@ -152,7 +152,7 @@ var suggestA11yFixesTool = exports.suggestA11yFixesTool = /*#__PURE__*/function
|
|
|
152
152
|
}, null, 2)
|
|
153
153
|
}]
|
|
154
154
|
});
|
|
155
|
-
case
|
|
155
|
+
case 2:
|
|
156
156
|
case "end":
|
|
157
157
|
return _context.stop();
|
|
158
158
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { accessibilityFixes } from '../tools/suggest-a11y-fixes/fixes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { accessibilityGuidelines } from '../tools/get-a11y-guidelines/guidelines';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i18nConversionGuide } from '../tools/i18n-conversion/guide';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { migrationRegistry } from '../tools/migration-guides/migration-registry';
|
|
@@ -44,6 +44,7 @@ if (!isAnalyticsOptedOut) {
|
|
|
44
44
|
* Wraps the analytics client and handles errors gracefully
|
|
45
45
|
* If analytics client is not available, this function is a no-op
|
|
46
46
|
*/
|
|
47
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
47
48
|
export function sendOperationalEvent({
|
|
48
49
|
action,
|
|
49
50
|
actionSubject,
|