abledom 0.4.0 → 0.6.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.
@@ -67,12 +67,13 @@ interface AbleDOMProps {
67
67
  headless?: boolean;
68
68
  callbacks?: {
69
69
  onIssueAdded?(element: HTMLElement | null, rule: ValidationRule, issue: ValidationIssue): void;
70
- onIssueUpdated?(element: HTMLElement | null, rule: ValidationRule, issue: ValidationIssue): void;
71
- onIssueRemoved?(element: HTMLElement | null, rule: ValidationRule): void;
70
+ onIssueUpdated?(element: HTMLElement, rule: ValidationRule, issue: ValidationIssue): void;
71
+ onIssueRemoved?(element: HTMLElement, rule: ValidationRule): void;
72
72
  };
73
73
  }
74
74
  declare class AbleDOM {
75
75
  private _win;
76
+ private _isDisposed;
76
77
  private _props;
77
78
  private _observer;
78
79
  private _clearValidationTimeout;
@@ -85,19 +86,30 @@ declare class AbleDOM {
85
86
  private _startFunc;
86
87
  private _isStarted;
87
88
  private _issuesUI;
89
+ private _elementHighlighter;
88
90
  private _idlePromise;
89
91
  private _idleResolve;
92
+ private _currentAnchoredIssues;
93
+ private _currentNotAnchoredIssues;
90
94
  constructor(win: Window, props?: AbleDOMProps);
91
95
  private _onElementId;
96
+ private _getHighlighter;
92
97
  private _addIssue;
93
98
  private _removeIssue;
94
99
  private _validate;
95
100
  private _processElementDependingOnIds;
101
+ private _updateCurrentAnchoredIssues;
102
+ private _onIssueAdded;
103
+ private _onIssueUpdated;
104
+ private _onIssueRemoved;
96
105
  private _remove;
97
106
  private _onFocusIn;
98
107
  private _onFocusOut;
99
108
  private _notifyAsync;
100
- idle(): Promise<void>;
109
+ private _getCurrentIssues;
110
+ idle(): Promise<ValidationIssue[]>;
111
+ clearCurrentIssues(anchored?: boolean, notAnchored?: boolean): void;
112
+ highlightElement(element: HTMLElement | null, scrollIntoView?: boolean, autoHideTime?: number): void;
101
113
  log: typeof console.error;
102
114
  addRule(rule: ValidationRule): void;
103
115
  removeRule(rule: ValidationRule): void;
@@ -124,6 +136,13 @@ declare class FocusableElementLabelRule extends ValidationRule {
124
136
  accept(element: HTMLElement): boolean;
125
137
  validate(element: HTMLElement): ValidationResult | null;
126
138
  }
139
+ declare class ContrastRule extends ValidationRule {
140
+ type: ValidationRuleType;
141
+ name: string;
142
+ anchored: boolean;
143
+ accept(element: HTMLElement): boolean;
144
+ validate(element: HTMLElement): ValidationResult | null;
145
+ }
127
146
  /*!
128
147
  * Copyright (c) Microsoft Corporation. All rights reserved.
129
148
  * Licensed under the MIT License.
@@ -203,4 +222,4 @@ declare function hasAccessibilityAttribute(attributes: HTMLElementAttributes): b
203
222
  declare function matchesSelector(element: HTMLElement, selector: string): boolean;
204
223
  declare function isDisplayNone(element: HTMLElement): boolean;
205
224
  declare function isElementVisible(element: HTMLElement): boolean;
206
- export { AbleDOM, AbleDOMProps, AtomicRule, BadFocusRule, BlurIssue, CustomNotifyRule, ExistingIdRule, FindElementRule, FocusLostRule, FocusableElementLabelRule, ValidationIssue, ValidationResult, ValidationRule, ValidationRuleType, hasAccessibilityAttribute, isAccessibilityAffectingElement, isDisplayNone, isElementVisible, matchesSelector };
225
+ export { AbleDOM, AbleDOMProps, AtomicRule, BadFocusRule, BlurIssue, ContrastRule, CustomNotifyRule, ExistingIdRule, FindElementRule, FocusLostRule, FocusableElementLabelRule, ValidationIssue, ValidationResult, ValidationRule, ValidationRuleType, hasAccessibilityAttribute, isAccessibilityAffectingElement, isDisplayNone, isElementVisible, matchesSelector };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abledom",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "author": "Marat Abdullin <marata@microsoft.com>",
5
5
  "description": "Continuous detection of typical web application accessibility problems.",
6
6
  "license": "MIT",
@@ -41,23 +41,24 @@
41
41
  },
42
42
  "homepage": "https://github.com/microsoft/abledom#readme",
43
43
  "devDependencies": {
44
- "@playwright/test": "^1.55.0",
45
- "@typescript-eslint/eslint-plugin": "^8.40.0",
46
- "@typescript-eslint/parser": "^8.40.0",
44
+ "@playwright/test": "^1.56.1",
45
+ "@types/node": "^24.9.2",
46
+ "@typescript-eslint/eslint-plugin": "^8.46.2",
47
+ "@typescript-eslint/parser": "^8.46.2",
47
48
  "@xmldom/xmldom": "^0.9.8",
48
49
  "downlevel-dts": "^0.11.0",
49
50
  "esbuild-plugin-inline-import": "^1.1.0",
50
- "eslint": "^9.34.0",
51
+ "eslint": "^9.38.0",
51
52
  "eslint-config-prettier": "^10.1.8",
52
53
  "eslint-plugin-header": "^3.1.1",
53
54
  "eslint-plugin-import": "^2.32.0",
54
- "playwright": "^1.55.0",
55
+ "playwright": "^1.56.1",
55
56
  "prettier": "^3.6.2",
56
- "release-it": "^19.0.4",
57
- "rimraf": "^6.0.1",
58
- "start-server-and-test": "^2.0.13",
57
+ "release-it": "^19.0.5",
58
+ "rimraf": "^6.1.0",
59
+ "start-server-and-test": "^2.1.2",
59
60
  "tsup": "^8.5.0",
60
- "typescript": "^5.9.2",
61
- "vite": "^7.1.3"
61
+ "typescript": "^5.9.3",
62
+ "vite": "^7.1.12"
62
63
  }
63
64
  }