accessibility-insights-report 4.6.7 → 4.7.0

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.
Files changed (2) hide show
  1. package/drop/index.js +48 -112
  2. package/package.json +2 -2
package/drop/index.js CHANGED
@@ -401,10 +401,9 @@ var import_uuid = require("uuid");
401
401
  var generateUID = import_uuid.v4;
402
402
 
403
403
  // src/common/target-helper.ts
404
- var _TargetHelper = class {
404
+ var _TargetHelper = class _TargetHelper {
405
405
  };
406
- var TargetHelper = _TargetHelper;
407
- TargetHelper.getTargetElements = (target, dom, targetIndex) => {
406
+ _TargetHelper.getTargetElements = (target, dom, targetIndex) => {
408
407
  if (!target || target.length < 1) {
409
408
  return [];
410
409
  }
@@ -421,7 +420,7 @@ TargetHelper.getTargetElements = (target, dom, targetIndex) => {
421
420
  }
422
421
  return Array.from(elements);
423
422
  };
424
- TargetHelper.getTargetElement = (target, dom, targetIndex) => {
423
+ _TargetHelper.getTargetElement = (target, dom, targetIndex) => {
425
424
  if (!target || target.length < 1) {
426
425
  return;
427
426
  }
@@ -439,7 +438,7 @@ TargetHelper.getTargetElement = (target, dom, targetIndex) => {
439
438
  // This returns undefined for undefined input for compatibility with non-strict-null-compatible
440
439
  // usages that we haven't investigated yet. The "!selector" clause can/should be removed once
441
440
  // #2869 is complete.
442
- TargetHelper.getTargetFromSelector = (selector) => {
441
+ _TargetHelper.getTargetFromSelector = (selector) => {
443
442
  if (selector === "") {
444
443
  return [];
445
444
  }
@@ -459,19 +458,19 @@ TargetHelper.getTargetFromSelector = (selector) => {
459
458
  };
460
459
  // This returns undefined for undefined input for compatibility with non-strict-null-compatible
461
460
  // usages that we haven't investigated yet. The ?s can/should be removed once #2869 is complete.
462
- TargetHelper.getSelectorFromTarget = (target) => {
461
+ _TargetHelper.getSelectorFromTarget = (target) => {
463
462
  var _a;
464
463
  return (_a = target == null ? void 0 : target.map(
465
464
  (targets) => typeof targets === "string" ? targets : targets.join(",")
466
465
  )) == null ? void 0 : _a.join(";");
467
466
  };
468
- TargetHelper.getSelectorFromTargetElement = (target, targetIndex) => {
467
+ _TargetHelper.getSelectorFromTargetElement = (target, targetIndex) => {
469
468
  if (target && target[targetIndex]) {
470
469
  const element = target[targetIndex];
471
470
  return typeof element === "string" ? element : element.join(",");
472
471
  }
473
472
  };
474
- TargetHelper.getShadowHost = (selectors, dom) => {
473
+ _TargetHelper.getShadowHost = (selectors, dom) => {
475
474
  let shadowHost = null;
476
475
  let queryElement = dom;
477
476
  for (let i = 0; i < selectors.length - 1; i++) {
@@ -483,6 +482,7 @@ TargetHelper.getShadowHost = (selectors, dom) => {
483
482
  }
484
483
  return shadowHost;
485
484
  };
485
+ var TargetHelper = _TargetHelper;
486
486
 
487
487
  // src/injected/adapters/extract-related-selectors.ts
488
488
  var import_lodash2 = require("lodash");
@@ -684,24 +684,11 @@ function createUnifiedRuleFromRuleResult(ruleResult) {
684
684
  }
685
685
 
686
686
  // src/common/components/cards/card-interaction-support.ts
687
- var allCardInteractionsSupported = {
688
- supportsHighlighting: true,
689
- supportsIssueFiling: true,
690
- supportsCopyFailureDetails: true
691
- };
692
687
  var noCardInteractionsSupported = {
693
688
  supportsHighlighting: false,
694
689
  supportsIssueFiling: false,
695
690
  supportsCopyFailureDetails: false
696
691
  };
697
- var onlyHighlightingSupported = {
698
- ...noCardInteractionsSupported,
699
- supportsHighlighting: true
700
- };
701
- var onlyUserConfigAgnosticCardInteractionsSupported = {
702
- ...allCardInteractionsSupported,
703
- supportsIssueFiling: false
704
- };
705
692
 
706
693
  // src/common/components/null-component.tsx
707
694
  var NullComponent = NamedFC("NullComponent", () => {
@@ -1200,9 +1187,6 @@ var React17 = __toESM(require("react"));
1200
1187
  function Term(props) {
1201
1188
  return /* @__PURE__ */ React17.createElement("strong", null, props.children);
1202
1189
  }
1203
- function Code(props) {
1204
- return /* @__PURE__ */ React17.createElement("span", { className: "insights-code" }, props.children);
1205
- }
1206
1190
 
1207
1191
  // src/common/components/cards/rich-resolution-content.tsx
1208
1192
  var React18 = __toESM(require("react"));
@@ -1215,49 +1199,6 @@ var RichResolutionContent = NamedFC(
1215
1199
  "RichResolutionContent",
1216
1200
  ({ deps: { LinkComponent }, contentId, contentVariables }) => {
1217
1201
  switch (contentId) {
1218
- case "android/ColorContrast": {
1219
- return /* @__PURE__ */ React18.createElement("div", { className: rich_resolution_content_default.combinationLists }, /* @__PURE__ */ React18.createElement("ul", { className: rich_resolution_content_default.multiLineTextYesBullet }, /* @__PURE__ */ React18.createElement("li", null, "If the text is intended to be invisible, it passes."), /* @__PURE__ */ React18.createElement("li", null, "If the text is intended to be visible, use", " ", /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://go.microsoft.com/fwlink/?linkid=2075365" }, "Accessibility Insights for Windows"), " ", "(or the", " ", /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://developer.paciellogroup.com/resources/contrastanalyser/" }, "Colour Contrast Analyser"), " ", "if you're testing on a Mac) to manually verify that it has sufficient contrast compared to the background. If the background is an image or gradient, test an area where contrast appears to be lowest.")));
1220
- }
1221
- case "android/TouchSizeWcag": {
1222
- const { logicalWidth, logicalHeight } = contentVariables;
1223
- return /* @__PURE__ */ React18.createElement("span", null, "The element has an insufficient target size (width: ", logicalWidth, "dp, height: ", logicalHeight, "dp). Set the element's", " ", /* @__PURE__ */ React18.createElement(Code, null, "minWidth"), " and ", /* @__PURE__ */ React18.createElement(Code, null, "minHeight"), " ", "attributes to at least 44dp.");
1224
- }
1225
- case "android/ActiveViewName": {
1226
- return /* @__PURE__ */ React18.createElement("span", null, "The view is active but has no name available to assistive technologies. Provide a name for the view using its", " ", /* @__PURE__ */ React18.createElement(Code, null, "contentDescription"), ",", " ", /* @__PURE__ */ React18.createElement(Code, null, "hint"), ", ", /* @__PURE__ */ React18.createElement(Code, null, "labelFor"), ", or", " ", /* @__PURE__ */ React18.createElement(Code, null, "text"), " attribute (depending on the view type)");
1227
- }
1228
- case "android/ImageViewName": {
1229
- return /* @__PURE__ */ React18.createElement("span", null, "The image has no alternate text and is not identified as decorative. If the image conveys meaningful content, provide alternate text using the", " ", /* @__PURE__ */ React18.createElement(Code, null, "contentDescription"), " attribute. If the image is decorative, give it an empty ", /* @__PURE__ */ React18.createElement(Code, null, "contentDescription"), ", or set its ", /* @__PURE__ */ React18.createElement(Code, null, "isImportantForAccessibility"), " attribute to false.");
1230
- }
1231
- case "android/EditTextValue": {
1232
- return /* @__PURE__ */ React18.createElement("span", null, "The element's ", /* @__PURE__ */ React18.createElement(Code, null, "contentDescription"), " overrides the text value required by assistive technologies. Remove the element's", " ", /* @__PURE__ */ React18.createElement(Code, null, "contentDescription"), " attribute.");
1233
- }
1234
- case "android/atfa/ClassNameCheck": {
1235
- return /* @__PURE__ */ React18.createElement("span", null, /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://developer.android.com/training/accessibility/testing.html#manual" }, "Manually test"), " ", "the control to verify that users receive sufficient information to understand the object's function.");
1236
- }
1237
- case "android/atfa/ClickableSpanCheck": {
1238
- return /* @__PURE__ */ React18.createElement("span", null, /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://developer.android.com/training/accessibility/testing.html#manual" }, "Manually test"), " ", "the item containing the link and verify that the hyperlinked text is announced and appears in the \u201CLinks\u201D section of Talkback\u2019s Context Menu.");
1239
- }
1240
- case "android/atfa/DuplicateClickableBoundsCheck": {
1241
- return /* @__PURE__ */ React18.createElement("span", null, "Turn on", " ", /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://support.google.com/accessibility/android/answer/6301490" }, "Switch Access for Android"), " ", "or use the", " ", /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://accessibilityinsights.io/docs/en/android/getstarted/fastpass/#complete-the-manual-test-for-tab-stops" }, "TabStops feature"), " ", "to navigate through the elements in the application. If an element appears to be focused more than once, there may be multiple interactive elements occupying the same screen location.");
1242
- }
1243
- case "android/atfa/DuplicateSpeakableTextCheck": {
1244
- return /* @__PURE__ */ React18.createElement("span", null, "If clickable ", /* @__PURE__ */ React18.createElement(Code, null, "View"), " objects have the ", /* @__PURE__ */ React18.createElement("i", null, "same"), " ", "speakable text and perform the ", /* @__PURE__ */ React18.createElement("i", null, "same"), " function, they pass.", /* @__PURE__ */ React18.createElement("br", null), "If clickable ", /* @__PURE__ */ React18.createElement(Code, null, "View"), " objects have the ", /* @__PURE__ */ React18.createElement("i", null, "same"), " ", "speakable text but perform ", /* @__PURE__ */ React18.createElement("i", null, "different"), " functions, they fail.");
1245
- }
1246
- case "android/atfa/LinkPurposeUnclearCheck": {
1247
- return /* @__PURE__ */ React18.createElement("span", null, "Examine the link in the context of the app to verify that the link's unique purpose is described by the link together with its preceding page content, which includes:", /* @__PURE__ */ React18.createElement("ul", null, /* @__PURE__ */ React18.createElement("li", null, "Text in the same sentence, paragraph, list item, or table cell as the link"), /* @__PURE__ */ React18.createElement("li", null, "Text in a parent list item"), /* @__PURE__ */ React18.createElement("li", null, "Text in the table header cell that's associated with cell that contains the link")));
1248
- }
1249
- case "android/atfa/RedundantDescriptionCheck": {
1250
- return /* @__PURE__ */ React18.createElement("span", null, "Listen to TalkBack's announcement of the element to verify that the item's role (type), state, and/or available actions are announced only once.");
1251
- }
1252
- case "android/atfa/TraversalOrderCheck": {
1253
- return /* @__PURE__ */ React18.createElement("span", null, "Turn on Talkback. Swipe right to move accessibility focus forward through the elements on the screen, then swipe left to navigate backwards. Verify that focus moves through the elements in a logical, consistent order when navigating forwards or backwards.");
1254
- }
1255
- case "android/atfa/TextContrastCheck": {
1256
- return /* @__PURE__ */ React18.createElement("div", { className: rich_resolution_content_default.combinationLists }, /* @__PURE__ */ React18.createElement("ul", { className: rich_resolution_content_default.multiLineTextYesBullet }, /* @__PURE__ */ React18.createElement("li", null, "If the text is intended to be invisible, it passes."), /* @__PURE__ */ React18.createElement("li", null, "If the text is intended to be visible, use", " ", /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://go.microsoft.com/fwlink/?linkid=2075365" }, "Accessibility Insights for Windows"), " ", "(or the", " ", /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://developer.paciellogroup.com/resources/contrastanalyser/" }, "Colour Contrast Analyser"), " ", "if you're testing on a Mac) to manually verify that it has sufficient contrast compared to the background. If the background is an image or gradient, test an area where contrast appears to be lowest.")));
1257
- }
1258
- case "android/atfa/ImageContrastCheck": {
1259
- return /* @__PURE__ */ React18.createElement("span", null, "Use", " ", /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://go.microsoft.com/fwlink/?linkid=2075365" }, "Accessibility Insights for Windows"), " ", "(or the", " ", /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://developer.paciellogroup.com/resources/contrastanalyser/" }, "Colour Contrast Analyser"), " ", "if you're testing on a Mac) to manually verify that the", " ", /* @__PURE__ */ React18.createElement(Code, null, "ImageView"), " has sufficient contrast compared to the background. If the background is an image or gradient, test an area where the contrast appears to be the lowest.");
1260
- }
1261
1202
  case "web/aria-input-field-name": {
1262
1203
  return /* @__PURE__ */ React18.createElement("div", null, "Inspect the element using the", " ", /* @__PURE__ */ React18.createElement(LinkComponent, { href: "https://developers.google.com/web/updates/2018/01/devtools" }, "Accessibility pane in the browser Developer Tools"), " ", "to verify that the field's accessible name is complete without its associated", " ", /* @__PURE__ */ React18.createElement("b", null, "<", "label", ">"), ".");
1263
1204
  }
@@ -1267,9 +1208,6 @@ var RichResolutionContent = NamedFC(
1267
1208
  case "web/th-has-data-cells": {
1268
1209
  return /* @__PURE__ */ React18.createElement("div", null, "Examine the header cell in the context of the table to verify that it has no data cells.");
1269
1210
  }
1270
- case "web/scrollable-region-focusable": {
1271
- return /* @__PURE__ */ React18.createElement("span", null, "Examine the element and ensure that, if there is scrollable content, the elements are accessible by keyboard.");
1272
- }
1273
1211
  case "web/label-content-name-mismatch": {
1274
1212
  return /* @__PURE__ */ React18.createElement("span", null, "Inspect the element using the Accessibility pane in the browser Developer tools and verify that the element\u2019s accessible name contains its visible text.");
1275
1213
  }
@@ -1514,7 +1452,11 @@ var React24 = __toESM(require("react"));
1514
1452
  var toast_default = { "toastContainer": "toast-container--L-5HM", "toastContent": "toast-content--8-Mx1" };
1515
1453
 
1516
1454
  // src/common/components/toast.tsx
1517
- var _Toast = class extends React24.Component {
1455
+ var Toast = class _Toast extends React24.Component {
1456
+ timeoutId;
1457
+ static defaultProps = {
1458
+ timeoutLength: 6e3
1459
+ };
1518
1460
  constructor(props) {
1519
1461
  super(props);
1520
1462
  this.state = { toastVisible: false, content: null };
@@ -1535,10 +1477,6 @@ var _Toast = class extends React24.Component {
1535
1477
  return /* @__PURE__ */ React24.createElement("div", { className: toast_default.toastContainer, "aria-live": "polite" }, this.state.toastVisible ? /* @__PURE__ */ React24.createElement("div", { className: (0, import_utilities4.css)("ms-fadeIn100", toast_default.toastContent) }, this.state.content) : null);
1536
1478
  }
1537
1479
  };
1538
- var Toast = _Toast;
1539
- Toast.defaultProps = {
1540
- timeoutLength: 6e3
1541
- };
1542
1480
 
1543
1481
  // src/common/components/cards/card-footer-instance-action-buttons.scss
1544
1482
  var card_footer_instance_action_buttons_default = { "kebabMenuIcon": "kebab-menu-icon--EUIj-", "kebabMenuButton": "kebab-menu-button--9Qt0a" };
@@ -2167,7 +2105,6 @@ var brand = "Accessibility Insights";
2167
2105
  var title = `${brand} for Web`;
2168
2106
  var toolName = title;
2169
2107
  var windowsProductName = `${brand} for Windows`;
2170
- var androidAppTitle = `${brand} for Android`;
2171
2108
 
2172
2109
  // src/reports/components/report-sections/reporter-header-section.tsx
2173
2110
  var React42 = __toESM(require("react"));
@@ -4364,6 +4301,7 @@ function evaluateLinkPurpose(node, options, virtualNode, context) {
4364
4301
 
4365
4302
  // src/scanner/document-utils.ts
4366
4303
  var DocumentUtils = class {
4304
+ dom;
4367
4305
  constructor(dom) {
4368
4306
  this.dom = dom || document;
4369
4307
  }
@@ -5487,38 +5425,36 @@ var fix_instruction_color_box_default = { "fixInstructionColorBox": "fix-instruc
5487
5425
  // src/common/components/fix-instruction-processor.tsx
5488
5426
  var recommendationsAutomationId = "recommendations";
5489
5427
  var FixInstructionProcessor = class {
5490
- constructor() {
5491
- this.colorValueMatcher = `(#[0-9a-f]{6})`;
5492
- this.foregroundColorText = "foreground color: ";
5493
- // the following warnings can be disabled because the values are actually constant strings and the string template is used merely for ease of reading
5494
- // eslint-disable-next-line security/detect-non-literal-regexp
5495
- this.foregroundRegExp = new RegExp(
5496
- `${this.foregroundColorText}${this.colorValueMatcher}`,
5497
- "i"
5498
- );
5499
- this.backgroundColorText = "background color: ";
5500
- // eslint-disable-next-line security/detect-non-literal-regexp
5501
- this.backgroundRegExp = new RegExp(
5502
- `${this.backgroundColorText}${this.colorValueMatcher}`,
5503
- "i"
5504
- );
5505
- this.foregroundRecommendedColorText = "Use foreground color: ";
5506
- // eslint-disable-next-line security/detect-non-literal-regexp
5507
- this.foregroundRecommendedRegExp = new RegExp(
5508
- `${this.foregroundRecommendedColorText}${this.colorValueMatcher}`,
5509
- "i"
5510
- );
5511
- this.backgroundRecommendedColorText = "Use background color: ";
5512
- // eslint-disable-next-line security/detect-non-literal-regexp
5513
- this.backgroundRecommendedRegExp = new RegExp(
5514
- `${this.backgroundRecommendedColorText}${this.colorValueMatcher}`,
5515
- "i"
5516
- );
5517
- this.contrastRatioText = "Expected contrast ratio of ";
5518
- // eslint-disable-next-line security/detect-non-literal-regexp
5519
- this.contrastRatioRegExp = new RegExp(`${this.contrastRatioText}`, "i");
5520
- this.originalMiddleSentence = " and the original foreground color: ";
5521
- }
5428
+ colorValueMatcher = `(#[0-9a-f]{6})`;
5429
+ foregroundColorText = "foreground color: ";
5430
+ // the following warnings can be disabled because the values are actually constant strings and the string template is used merely for ease of reading
5431
+ // eslint-disable-next-line security/detect-non-literal-regexp
5432
+ foregroundRegExp = new RegExp(
5433
+ `${this.foregroundColorText}${this.colorValueMatcher}`,
5434
+ "i"
5435
+ );
5436
+ backgroundColorText = "background color: ";
5437
+ // eslint-disable-next-line security/detect-non-literal-regexp
5438
+ backgroundRegExp = new RegExp(
5439
+ `${this.backgroundColorText}${this.colorValueMatcher}`,
5440
+ "i"
5441
+ );
5442
+ foregroundRecommendedColorText = "Use foreground color: ";
5443
+ // eslint-disable-next-line security/detect-non-literal-regexp
5444
+ foregroundRecommendedRegExp = new RegExp(
5445
+ `${this.foregroundRecommendedColorText}${this.colorValueMatcher}`,
5446
+ "i"
5447
+ );
5448
+ backgroundRecommendedColorText = "Use background color: ";
5449
+ // eslint-disable-next-line security/detect-non-literal-regexp
5450
+ backgroundRecommendedRegExp = new RegExp(
5451
+ `${this.backgroundRecommendedColorText}${this.colorValueMatcher}`,
5452
+ "i"
5453
+ );
5454
+ contrastRatioText = "Expected contrast ratio of ";
5455
+ // eslint-disable-next-line security/detect-non-literal-regexp
5456
+ contrastRatioRegExp = new RegExp(`${this.contrastRatioText}`, "i");
5457
+ originalMiddleSentence = " and the original foreground color: ";
5522
5458
  process(fixInstruction, recommendColor) {
5523
5459
  return this.tryProcessAsColorContrastRecommendation(fixInstruction, recommendColor) ?? this.tryProcessAsRelatedNodesReference(fixInstruction) ?? this.processAsNoop(fixInstruction);
5524
5460
  }
@@ -5686,12 +5622,12 @@ var FixInstructionProcessor = class {
5686
5622
 
5687
5623
  // src/common/date-provider.ts
5688
5624
  var import_luxon = require("luxon");
5689
- var DateProvider = class {
5625
+ var DateProvider = class _DateProvider {
5690
5626
  static getDateFromTimestamp(timestamp) {
5691
- if (DateProvider.isNumericalTimestamp(timestamp)) {
5692
- return DateProvider.getDateFromMillis(timestamp);
5627
+ if (_DateProvider.isNumericalTimestamp(timestamp)) {
5628
+ return _DateProvider.getDateFromMillis(timestamp);
5693
5629
  } else {
5694
- return DateProvider.getDateFromDateString(timestamp);
5630
+ return _DateProvider.getDateFromDateString(timestamp);
5695
5631
  }
5696
5632
  }
5697
5633
  static getCurrentDate() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accessibility-insights-report",
3
- "version": "4.6.7",
3
+ "version": "4.7.0",
4
4
  "description": "Accessibility Insights Report",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@fluentui/react": "^8.96.1",
22
- "axe-core": "4.6.3",
22
+ "axe-core": "4.7.2",
23
23
  "classnames": "^2.3.2",
24
24
  "lodash": "^4.17.21",
25
25
  "luxon": "^3.3.0",