@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/ads-mcp
|
|
2
2
|
|
|
3
|
+
## 0.21.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0467affd8dd16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0467affd8dd16) -
|
|
8
|
+
Minor component prop updates from DateTimePicker and DropdownMenu
|
|
9
|
+
|
|
10
|
+
## 0.21.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`25f67befcc5c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/25f67befcc5c6) - -
|
|
15
|
+
Improved ADS MCP component metadata accuracy using the latest design-system documentation.
|
|
16
|
+
- Expanded Atlaskit component coverage in MCP outputs (including Link Datasource and Smart Card
|
|
17
|
+
entries).
|
|
18
|
+
- Updated surfaced prop typing for key APIs (including semantic `IconTile` sizes and
|
|
19
|
+
`SectionMessage` heading levels).
|
|
20
|
+
- Added migration-friendly `Tag` `text` typing support (`string | string[]`) in generated
|
|
21
|
+
metadata.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 0.20.4
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/ads-mcp/a11y-fixes",
|
|
3
|
+
"main": "../dist/cjs/entry-points/a11y-fixes.js",
|
|
4
|
+
"module": "../dist/esm/entry-points/a11y-fixes.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/entry-points/a11y-fixes.js",
|
|
6
|
+
"types": "../dist/types/entry-points/a11y-fixes.d.ts",
|
|
7
|
+
"typesVersions": {
|
|
8
|
+
">=4.5 <5.9": {
|
|
9
|
+
"*": [
|
|
10
|
+
"../dist/types-ts4.5/entry-points/a11y-fixes.d.ts"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/ads-mcp/a11y-guidelines",
|
|
3
|
+
"main": "../dist/cjs/entry-points/a11y-guidelines.js",
|
|
4
|
+
"module": "../dist/esm/entry-points/a11y-guidelines.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/entry-points/a11y-guidelines.js",
|
|
6
|
+
"types": "../dist/types/entry-points/a11y-guidelines.d.ts",
|
|
7
|
+
"typesVersions": {
|
|
8
|
+
">=4.5 <5.9": {
|
|
9
|
+
"*": [
|
|
10
|
+
"../dist/types-ts4.5/entry-points/a11y-guidelines.d.ts"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "accessibilityFixes", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _fixes.accessibilityFixes;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _fixes = require("../tools/suggest-a11y-fixes/fixes");
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "accessibilityGuidelines", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _guidelines.accessibilityGuidelines;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _guidelines = require("../tools/get-a11y-guidelines/guidelines");
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "i18nConversionGuide", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _guide.i18nConversionGuide;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _guide = require("../tools/i18n-conversion/guide");
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "migrationRegistry", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _migrationRegistry.migrationRegistry;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _migrationRegistry = require("../tools/migration-guides/migration-registry");
|
|
@@ -63,6 +63,7 @@ if (!isAnalyticsOptedOut) {
|
|
|
63
63
|
* Wraps the analytics client and handles errors gracefully
|
|
64
64
|
* If analytics client is not available, this function is a no-op
|
|
65
65
|
*/
|
|
66
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
66
67
|
function sendOperationalEvent(_ref) {
|
|
67
68
|
var action = _ref.action,
|
|
68
69
|
actionSubject = _ref.actionSubject,
|
package/dist/cjs/index.js
CHANGED
|
@@ -173,7 +173,7 @@ var getToolRegistry = exports.getToolRegistry = function getToolRegistry() {
|
|
|
173
173
|
server.setRequestHandler(_types.ListToolsRequestSchema, /*#__PURE__*/function () {
|
|
174
174
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(request, extra) {
|
|
175
175
|
var toolRegistry, tools;
|
|
176
|
-
return _regenerator.default.wrap(function
|
|
176
|
+
return _regenerator.default.wrap(function (_context) {
|
|
177
177
|
while (1) switch (_context.prev = _context.next) {
|
|
178
178
|
case 0:
|
|
179
179
|
toolRegistry = getToolRegistry();
|
|
@@ -193,7 +193,7 @@ server.setRequestHandler(_types.ListToolsRequestSchema, /*#__PURE__*/function ()
|
|
|
193
193
|
return _context.abrupt("return", {
|
|
194
194
|
tools: tools
|
|
195
195
|
});
|
|
196
|
-
case
|
|
196
|
+
case 1:
|
|
197
197
|
case "end":
|
|
198
198
|
return _context.stop();
|
|
199
199
|
}
|
|
@@ -207,8 +207,8 @@ server.setRequestHandler(_types.ListToolsRequestSchema, /*#__PURE__*/function ()
|
|
|
207
207
|
// Handle tool execution
|
|
208
208
|
server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function () {
|
|
209
209
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(request, extra) {
|
|
210
|
-
var toolRegistry, toolName, toolConfig, actionSubject, toolArguments, inputValidation, result, toolRegistryForError;
|
|
211
|
-
return _regenerator.default.wrap(function
|
|
210
|
+
var toolRegistry, toolName, toolConfig, actionSubject, toolArguments, inputValidation, result, toolRegistryForError, _t;
|
|
211
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
212
212
|
while (1) switch (_context2.prev = _context2.next) {
|
|
213
213
|
case 0:
|
|
214
214
|
toolRegistry = getToolRegistry();
|
|
@@ -226,17 +226,17 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
|
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
if (!toolConfig) {
|
|
229
|
-
_context2.next =
|
|
229
|
+
_context2.next = 6;
|
|
230
230
|
break;
|
|
231
231
|
}
|
|
232
|
-
_context2.prev =
|
|
232
|
+
_context2.prev = 1;
|
|
233
233
|
if (!toolConfig.inputSchema) {
|
|
234
|
-
_context2.next =
|
|
234
|
+
_context2.next = 3;
|
|
235
235
|
break;
|
|
236
236
|
}
|
|
237
237
|
inputValidation = (0, _validation.validateToolArguments)(toolConfig.inputSchema, request.params.arguments);
|
|
238
238
|
if (inputValidation.success) {
|
|
239
|
-
_context2.next =
|
|
239
|
+
_context2.next = 2;
|
|
240
240
|
break;
|
|
241
241
|
}
|
|
242
242
|
(0, _sendOperationalEvent.sendOperationalEvent)({
|
|
@@ -252,12 +252,12 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
|
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
return _context2.abrupt("return", inputValidation.error);
|
|
255
|
-
case
|
|
255
|
+
case 2:
|
|
256
256
|
toolArguments = inputValidation.data;
|
|
257
|
-
case
|
|
258
|
-
_context2.next =
|
|
257
|
+
case 3:
|
|
258
|
+
_context2.next = 4;
|
|
259
259
|
return toolConfig.handler(toolArguments);
|
|
260
|
-
case
|
|
260
|
+
case 4:
|
|
261
261
|
result = _context2.sent;
|
|
262
262
|
// Track successful tool execution
|
|
263
263
|
(0, _sendOperationalEvent.sendOperationalEvent)({
|
|
@@ -271,9 +271,9 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
|
|
|
271
271
|
}
|
|
272
272
|
});
|
|
273
273
|
return _context2.abrupt("return", result);
|
|
274
|
-
case
|
|
275
|
-
_context2.prev =
|
|
276
|
-
|
|
274
|
+
case 5:
|
|
275
|
+
_context2.prev = 5;
|
|
276
|
+
_t = _context2["catch"](1);
|
|
277
277
|
// Track tool execution error
|
|
278
278
|
(0, _sendOperationalEvent.sendOperationalEvent)({
|
|
279
279
|
action: 'failed',
|
|
@@ -283,7 +283,7 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
|
|
|
283
283
|
toolName: toolName,
|
|
284
284
|
request: request,
|
|
285
285
|
extra: extra,
|
|
286
|
-
errorMessage:
|
|
286
|
+
errorMessage: _t instanceof Error ? _t.message : 'Unknown error'
|
|
287
287
|
}
|
|
288
288
|
});
|
|
289
289
|
|
|
@@ -291,8 +291,8 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
|
|
|
291
291
|
We don't use console.error here:
|
|
292
292
|
- when used alone, without the throw new McpError, it causes "Client error for command...", which will loop back to this catch
|
|
293
293
|
*/
|
|
294
|
-
throw new _types.McpError(-32000, "Failed to execute '".concat(toolName, "' tool: ").concat(
|
|
295
|
-
case
|
|
294
|
+
throw new _types.McpError(-32000, "Failed to execute '".concat(toolName, "' tool: ").concat(_t instanceof Error ? _t.message : 'Unknown error'));
|
|
295
|
+
case 6:
|
|
296
296
|
// Track tool not found error
|
|
297
297
|
(0, _sendOperationalEvent.sendOperationalEvent)({
|
|
298
298
|
action: 'notFound',
|
|
@@ -307,11 +307,11 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
|
|
|
307
307
|
toolRegistryForError = getToolRegistry();
|
|
308
308
|
console.error("Tool '".concat(request.params.name, "' not found, only the following tools are available: ").concat(Object.keys(toolRegistryForError).join(', ')));
|
|
309
309
|
return _context2.abrupt("return");
|
|
310
|
-
case
|
|
310
|
+
case 7:
|
|
311
311
|
case "end":
|
|
312
312
|
return _context2.stop();
|
|
313
313
|
}
|
|
314
|
-
}, _callee2, null, [[
|
|
314
|
+
}, _callee2, null, [[1, 5]]);
|
|
315
315
|
}));
|
|
316
316
|
return function (_x3, _x4) {
|
|
317
317
|
return _ref2.apply(this, arguments);
|
|
@@ -323,7 +323,7 @@ function runServer() {
|
|
|
323
323
|
function _runServer() {
|
|
324
324
|
_runServer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
325
325
|
var transport;
|
|
326
|
-
return _regenerator.default.wrap(function
|
|
326
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
327
327
|
while (1) switch (_context3.prev = _context3.next) {
|
|
328
328
|
case 0:
|
|
329
329
|
/**
|
|
@@ -339,9 +339,9 @@ function _runServer() {
|
|
|
339
339
|
actionSubject: 'ads.mcp.initialize'
|
|
340
340
|
});
|
|
341
341
|
transport = new _stdio.StdioServerTransport();
|
|
342
|
-
_context3.next =
|
|
342
|
+
_context3.next = 1;
|
|
343
343
|
return server.connect(transport);
|
|
344
|
-
case
|
|
344
|
+
case 1:
|
|
345
345
|
case "end":
|
|
346
346
|
return _context3.stop();
|
|
347
347
|
}
|
|
@@ -80,20 +80,20 @@ function mapAxeViolationsToADSFixes(violations) {
|
|
|
80
80
|
}
|
|
81
81
|
var analyzeA11yTool = exports.analyzeA11yTool = /*#__PURE__*/function () {
|
|
82
82
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
|
|
83
|
-
var code, componentName, context, _params$includePatter, includePatternAnalysis, violations, suggestions, axeResults, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, results, adsViolations, relevantGuidelines, summary;
|
|
84
|
-
return _regenerator.default.wrap(function
|
|
83
|
+
var code, componentName, context, _params$includePatter, includePatternAnalysis, violations, suggestions, axeResults, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, results, adsViolations, relevantGuidelines, summary, _t;
|
|
84
|
+
return _regenerator.default.wrap(function (_context) {
|
|
85
85
|
while (1) switch (_context.prev = _context.next) {
|
|
86
86
|
case 0:
|
|
87
87
|
code = params.code, componentName = params.componentName, context = params.context, _params$includePatter = params.includePatternAnalysis, includePatternAnalysis = _params$includePatter === void 0 ? true : _params$includePatter;
|
|
88
88
|
violations = [];
|
|
89
89
|
suggestions = [];
|
|
90
90
|
axeResults = {};
|
|
91
|
-
_context.prev =
|
|
92
|
-
_context.next =
|
|
91
|
+
_context.prev = 1;
|
|
92
|
+
_context.next = 2;
|
|
93
93
|
return _axeCore.default.run({
|
|
94
94
|
fromFrames: ['iframe', 'html']
|
|
95
95
|
});
|
|
96
|
-
case
|
|
96
|
+
case 2:
|
|
97
97
|
results = _context.sent;
|
|
98
98
|
// Process axe-core results
|
|
99
99
|
if (results.violations && results.violations.length > 0) {
|
|
@@ -179,9 +179,9 @@ var analyzeA11yTool = exports.analyzeA11yTool = /*#__PURE__*/function () {
|
|
|
179
179
|
}, null, 2)
|
|
180
180
|
}]
|
|
181
181
|
});
|
|
182
|
-
case
|
|
183
|
-
_context.prev =
|
|
184
|
-
|
|
182
|
+
case 3:
|
|
183
|
+
_context.prev = 3;
|
|
184
|
+
_t = _context["catch"](1);
|
|
185
185
|
// Fallback to pattern-based analysis if axe-core fails
|
|
186
186
|
// console.warn('Axe-core analysis failed, falling back to pattern analysis:', error);
|
|
187
187
|
|
|
@@ -230,11 +230,11 @@ var analyzeA11yTool = exports.analyzeA11yTool = /*#__PURE__*/function () {
|
|
|
230
230
|
}, null, 2)
|
|
231
231
|
}]
|
|
232
232
|
});
|
|
233
|
-
case
|
|
233
|
+
case 4:
|
|
234
234
|
case "end":
|
|
235
235
|
return _context.stop();
|
|
236
236
|
}
|
|
237
|
-
}, _callee, null, [[
|
|
237
|
+
}, _callee, null, [[1, 3]]);
|
|
238
238
|
}));
|
|
239
239
|
return function analyzeA11yTool(_x) {
|
|
240
240
|
return _ref.apply(this, arguments);
|
|
@@ -45,59 +45,59 @@ function mapAxeViolationsToADSFixes(violations) {
|
|
|
45
45
|
}
|
|
46
46
|
var analyzeLocalhostA11yTool = exports.analyzeLocalhostA11yTool = /*#__PURE__*/function () {
|
|
47
47
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
|
|
48
|
-
var url, componentName, context, selector, violations, suggestions, axeResults, browser, page, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, elementExists, availableElements, axePuppeteer, results, adsViolations, relevantGuidelines, summary;
|
|
49
|
-
return _regenerator.default.wrap(function
|
|
48
|
+
var url, componentName, context, selector, violations, suggestions, axeResults, browser, page, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, elementExists, availableElements, axePuppeteer, results, adsViolations, relevantGuidelines, summary, _t;
|
|
49
|
+
return _regenerator.default.wrap(function (_context) {
|
|
50
50
|
while (1) switch (_context.prev = _context.next) {
|
|
51
51
|
case 0:
|
|
52
52
|
url = params.url, componentName = params.componentName, context = params.context, selector = params.selector;
|
|
53
53
|
violations = [];
|
|
54
54
|
suggestions = [];
|
|
55
55
|
axeResults = {};
|
|
56
|
-
_context.next =
|
|
56
|
+
_context.next = 1;
|
|
57
57
|
return _puppeteer2.default.launch();
|
|
58
|
-
case
|
|
58
|
+
case 1:
|
|
59
59
|
browser = _context.sent;
|
|
60
|
-
_context.next =
|
|
60
|
+
_context.next = 2;
|
|
61
61
|
return browser.newPage();
|
|
62
|
-
case
|
|
62
|
+
case 2:
|
|
63
63
|
page = _context.sent;
|
|
64
|
-
_context.prev =
|
|
65
|
-
_context.next =
|
|
64
|
+
_context.prev = 3;
|
|
65
|
+
_context.next = 4;
|
|
66
66
|
return page.goto(url, {
|
|
67
67
|
waitUntil: 'networkidle0'
|
|
68
68
|
});
|
|
69
|
-
case
|
|
69
|
+
case 4:
|
|
70
70
|
if (!selector) {
|
|
71
|
-
_context.next =
|
|
71
|
+
_context.next = 7;
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
|
-
_context.next =
|
|
74
|
+
_context.next = 5;
|
|
75
75
|
return page.$(selector);
|
|
76
|
-
case
|
|
76
|
+
case 5:
|
|
77
77
|
elementExists = _context.sent;
|
|
78
78
|
if (elementExists) {
|
|
79
|
-
_context.next =
|
|
79
|
+
_context.next = 7;
|
|
80
80
|
break;
|
|
81
81
|
}
|
|
82
|
-
_context.next =
|
|
82
|
+
_context.next = 6;
|
|
83
83
|
return page.evaluate(function () {
|
|
84
84
|
var elements = Array.from(document.querySelectorAll('[id]'));
|
|
85
85
|
return elements.map(function (el) {
|
|
86
86
|
return "#".concat(el.id);
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
|
-
case
|
|
89
|
+
case 6:
|
|
90
90
|
availableElements = _context.sent;
|
|
91
91
|
throw new Error("Element with selector \"".concat(selector, "\" not found on the page after waiting. Available elements: ").concat(availableElements.join(', ')));
|
|
92
|
-
case
|
|
92
|
+
case 7:
|
|
93
93
|
// Run axe-core accessibility analysis
|
|
94
94
|
axePuppeteer = new _puppeteer.AxePuppeteer(page); // If selector is provided, analyze only that element
|
|
95
95
|
if (selector) {
|
|
96
96
|
axePuppeteer.include(selector);
|
|
97
97
|
}
|
|
98
|
-
_context.next =
|
|
98
|
+
_context.next = 8;
|
|
99
99
|
return axePuppeteer.analyze();
|
|
100
|
-
case
|
|
100
|
+
case 8:
|
|
101
101
|
results = _context.sent;
|
|
102
102
|
if (results.violations && results.violations.length > 0) {
|
|
103
103
|
adsViolations = mapAxeViolationsToADSFixes(results.violations);
|
|
@@ -153,9 +153,9 @@ var analyzeLocalhostA11yTool = exports.analyzeLocalhostA11yTool = /*#__PURE__*/f
|
|
|
153
153
|
incomplete: ((_axeResults$incomplet = axeResults.incomplete) === null || _axeResults$incomplet === void 0 ? void 0 : _axeResults$incomplet.length) || 0
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
_context.next =
|
|
156
|
+
_context.next = 9;
|
|
157
157
|
return browser.close();
|
|
158
|
-
case
|
|
158
|
+
case 9:
|
|
159
159
|
return _context.abrupt("return", {
|
|
160
160
|
content: [{
|
|
161
161
|
type: 'text',
|
|
@@ -169,12 +169,12 @@ var analyzeLocalhostA11yTool = exports.analyzeLocalhostA11yTool = /*#__PURE__*/f
|
|
|
169
169
|
}, null, 2)
|
|
170
170
|
}]
|
|
171
171
|
});
|
|
172
|
-
case
|
|
173
|
-
_context.prev =
|
|
174
|
-
|
|
175
|
-
_context.next =
|
|
172
|
+
case 10:
|
|
173
|
+
_context.prev = 10;
|
|
174
|
+
_t = _context["catch"](3);
|
|
175
|
+
_context.next = 11;
|
|
176
176
|
return browser.close();
|
|
177
|
-
case
|
|
177
|
+
case 11:
|
|
178
178
|
return _context.abrupt("return", {
|
|
179
179
|
content: [{
|
|
180
180
|
type: 'text',
|
|
@@ -197,16 +197,16 @@ var analyzeLocalhostA11yTool = exports.analyzeLocalhostA11yTool = /*#__PURE__*/f
|
|
|
197
197
|
},
|
|
198
198
|
violations: violations,
|
|
199
199
|
suggestions: [],
|
|
200
|
-
error: String(
|
|
200
|
+
error: String(_t),
|
|
201
201
|
recommendations: ['Use ADS components for better accessibility out of the box', 'Reference https://atlassian.design/llms-a11y.txt for detailed guidelines', 'Test with keyboard navigation and screen readers', 'Use automated accessibility testing tools']
|
|
202
202
|
}, null, 2)
|
|
203
203
|
}]
|
|
204
204
|
});
|
|
205
|
-
case
|
|
205
|
+
case 12:
|
|
206
206
|
case "end":
|
|
207
207
|
return _context.stop();
|
|
208
208
|
}
|
|
209
|
-
}, _callee, null, [[
|
|
209
|
+
}, _callee, null, [[3, 10]]);
|
|
210
210
|
}));
|
|
211
211
|
return function analyzeLocalhostA11yTool(_x) {
|
|
212
212
|
return _ref.apply(this, arguments);
|
|
@@ -15,12 +15,12 @@ var topics = Object.keys(_guidelines.accessibilityGuidelines);
|
|
|
15
15
|
var getA11yGuidelinesTool = exports.getA11yGuidelinesTool = /*#__PURE__*/function () {
|
|
16
16
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
17
17
|
var topic, guidelines;
|
|
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
|
topic = _ref.topic;
|
|
22
22
|
if (!(topic && _guidelines.accessibilityGuidelines[topic])) {
|
|
23
|
-
_context.next =
|
|
23
|
+
_context.next = 1;
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
26
|
guidelines = _guidelines.accessibilityGuidelines[topic];
|
|
@@ -34,7 +34,7 @@ var getA11yGuidelinesTool = exports.getA11yGuidelinesTool = /*#__PURE__*/functio
|
|
|
34
34
|
}), null, 2)
|
|
35
35
|
}]
|
|
36
36
|
});
|
|
37
|
-
case
|
|
37
|
+
case 1:
|
|
38
38
|
return _context.abrupt("return", {
|
|
39
39
|
content: [{
|
|
40
40
|
type: 'text',
|
|
@@ -46,7 +46,7 @@ var getA11yGuidelinesTool = exports.getA11yGuidelinesTool = /*#__PURE__*/functio
|
|
|
46
46
|
}, null, 2)
|
|
47
47
|
}]
|
|
48
48
|
});
|
|
49
|
-
case
|
|
49
|
+
case 2:
|
|
50
50
|
case "end":
|
|
51
51
|
return _context.stop();
|
|
52
52
|
}
|