accented 0.0.2 → 1.0.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 (212) hide show
  1. package/NOTICE +14 -0
  2. package/README.md +44 -187
  3. package/dist/accented.d.ts +8 -8
  4. package/dist/accented.d.ts.map +1 -1
  5. package/dist/accented.js +37 -30
  6. package/dist/accented.js.map +1 -1
  7. package/dist/common/tokens.d.ts +7 -0
  8. package/dist/common/tokens.d.ts.map +1 -0
  9. package/dist/common/tokens.js +8 -0
  10. package/dist/common/tokens.js.map +1 -0
  11. package/dist/constants.d.ts +2 -1
  12. package/dist/constants.d.ts.map +1 -1
  13. package/dist/constants.js +2 -1
  14. package/dist/constants.js.map +1 -1
  15. package/dist/dom-updater.d.ts +1 -1
  16. package/dist/dom-updater.d.ts.map +1 -1
  17. package/dist/dom-updater.js +73 -31
  18. package/dist/dom-updater.js.map +1 -1
  19. package/dist/elements/accented-dialog.d.ts +13 -10
  20. package/dist/elements/accented-dialog.d.ts.map +1 -1
  21. package/dist/elements/accented-dialog.js +110 -94
  22. package/dist/elements/accented-dialog.js.map +1 -1
  23. package/dist/elements/accented-trigger.d.ts +14 -9
  24. package/dist/elements/accented-trigger.d.ts.map +1 -1
  25. package/dist/elements/accented-trigger.js +77 -22
  26. package/dist/elements/accented-trigger.js.map +1 -1
  27. package/dist/fullscreen-listener.d.ts +2 -0
  28. package/dist/fullscreen-listener.d.ts.map +1 -0
  29. package/dist/fullscreen-listener.js +17 -0
  30. package/dist/fullscreen-listener.js.map +1 -0
  31. package/dist/intersection-observer.d.ts +1 -1
  32. package/dist/intersection-observer.d.ts.map +1 -1
  33. package/dist/intersection-observer.js +12 -6
  34. package/dist/intersection-observer.js.map +1 -1
  35. package/dist/log-and-rethrow.d.ts +1 -1
  36. package/dist/log-and-rethrow.d.ts.map +1 -1
  37. package/dist/log-and-rethrow.js +2 -3
  38. package/dist/log-and-rethrow.js.map +1 -1
  39. package/dist/logger.d.ts +1 -1
  40. package/dist/logger.d.ts.map +1 -1
  41. package/dist/logger.js +6 -3
  42. package/dist/logger.js.map +1 -1
  43. package/dist/register-elements.d.ts +1 -1
  44. package/dist/register-elements.d.ts.map +1 -1
  45. package/dist/register-elements.js +6 -7
  46. package/dist/register-elements.js.map +1 -1
  47. package/dist/resize-listener.d.ts +1 -1
  48. package/dist/resize-listener.d.ts.map +1 -1
  49. package/dist/resize-listener.js +3 -4
  50. package/dist/resize-listener.js.map +1 -1
  51. package/dist/scanner.d.ts +2 -2
  52. package/dist/scanner.d.ts.map +1 -1
  53. package/dist/scanner.js +76 -43
  54. package/dist/scanner.js.map +1 -1
  55. package/dist/scroll-listeners.d.ts +1 -1
  56. package/dist/scroll-listeners.d.ts.map +1 -1
  57. package/dist/scroll-listeners.js +3 -4
  58. package/dist/scroll-listeners.js.map +1 -1
  59. package/dist/state.d.ts +3 -2
  60. package/dist/state.d.ts.map +1 -1
  61. package/dist/state.js +5 -3
  62. package/dist/state.js.map +1 -1
  63. package/dist/task-queue.d.ts +4 -4
  64. package/dist/task-queue.d.ts.map +1 -1
  65. package/dist/task-queue.js +3 -2
  66. package/dist/task-queue.js.map +1 -1
  67. package/dist/types.d.ts +140 -49
  68. package/dist/types.d.ts.map +1 -1
  69. package/dist/types.js.map +1 -1
  70. package/dist/utils/are-elements-with-issues-equal.d.ts +3 -0
  71. package/dist/utils/are-elements-with-issues-equal.d.ts.map +1 -0
  72. package/dist/utils/are-elements-with-issues-equal.js +5 -0
  73. package/dist/utils/are-elements-with-issues-equal.js.map +1 -0
  74. package/dist/utils/are-issue-sets-equal.d.ts +2 -2
  75. package/dist/utils/are-issue-sets-equal.d.ts.map +1 -1
  76. package/dist/utils/are-issue-sets-equal.js +3 -3
  77. package/dist/utils/are-issue-sets-equal.js.map +1 -1
  78. package/dist/utils/containing-blocks.d.ts +3 -0
  79. package/dist/utils/containing-blocks.d.ts.map +1 -0
  80. package/dist/utils/containing-blocks.js +46 -0
  81. package/dist/utils/containing-blocks.js.map +1 -0
  82. package/dist/utils/contains.d.ts +2 -0
  83. package/dist/utils/contains.d.ts.map +1 -0
  84. package/dist/utils/contains.js +19 -0
  85. package/dist/utils/contains.js.map +1 -0
  86. package/dist/utils/deduplicate-nodes.d.ts +2 -0
  87. package/dist/utils/deduplicate-nodes.d.ts.map +1 -0
  88. package/dist/utils/deduplicate-nodes.js +4 -0
  89. package/dist/utils/deduplicate-nodes.js.map +1 -0
  90. package/dist/utils/deep-merge.d.ts +1 -1
  91. package/dist/utils/deep-merge.d.ts.map +1 -1
  92. package/dist/utils/deep-merge.js +8 -5
  93. package/dist/utils/deep-merge.js.map +1 -1
  94. package/dist/utils/dom-helpers.d.ts +9 -0
  95. package/dist/utils/dom-helpers.d.ts.map +1 -0
  96. package/dist/utils/dom-helpers.js +34 -0
  97. package/dist/utils/dom-helpers.js.map +1 -0
  98. package/dist/utils/ensure-non-empty.d.ts +2 -0
  99. package/dist/utils/ensure-non-empty.d.ts.map +1 -0
  100. package/dist/utils/ensure-non-empty.js +7 -0
  101. package/dist/utils/ensure-non-empty.js.map +1 -0
  102. package/dist/utils/get-element-html.d.ts +1 -1
  103. package/dist/utils/get-element-html.d.ts.map +1 -1
  104. package/dist/utils/get-element-html.js +4 -2
  105. package/dist/utils/get-element-html.js.map +1 -1
  106. package/dist/utils/get-element-position.d.ts +10 -2
  107. package/dist/utils/get-element-position.d.ts.map +1 -1
  108. package/dist/utils/get-element-position.js +64 -16
  109. package/dist/utils/get-element-position.js.map +1 -1
  110. package/dist/utils/get-parent.d.ts +2 -0
  111. package/dist/utils/get-parent.d.ts.map +1 -0
  112. package/dist/utils/get-parent.js +12 -0
  113. package/dist/utils/get-parent.js.map +1 -0
  114. package/dist/utils/get-scan-context.d.ts +3 -0
  115. package/dist/utils/get-scan-context.d.ts.map +1 -0
  116. package/dist/utils/get-scan-context.js +28 -0
  117. package/dist/utils/get-scan-context.js.map +1 -0
  118. package/dist/utils/get-scrollable-ancestors.d.ts +1 -1
  119. package/dist/utils/get-scrollable-ancestors.d.ts.map +1 -1
  120. package/dist/utils/get-scrollable-ancestors.js +10 -6
  121. package/dist/utils/get-scrollable-ancestors.js.map +1 -1
  122. package/dist/utils/is-node-in-scan-context.d.ts +3 -0
  123. package/dist/utils/is-node-in-scan-context.d.ts.map +1 -0
  124. package/dist/utils/is-node-in-scan-context.js +26 -0
  125. package/dist/utils/is-node-in-scan-context.js.map +1 -0
  126. package/dist/utils/is-non-empty.d.ts +2 -0
  127. package/dist/utils/is-non-empty.d.ts.map +1 -0
  128. package/dist/utils/is-non-empty.js +4 -0
  129. package/dist/utils/is-non-empty.js.map +1 -0
  130. package/dist/utils/normalize-context.d.ts +3 -0
  131. package/dist/utils/normalize-context.d.ts.map +1 -0
  132. package/dist/utils/normalize-context.js +59 -0
  133. package/dist/utils/normalize-context.js.map +1 -0
  134. package/dist/utils/recalculate-positions.d.ts +1 -1
  135. package/dist/utils/recalculate-positions.d.ts.map +1 -1
  136. package/dist/utils/recalculate-positions.js +5 -5
  137. package/dist/utils/recalculate-positions.js.map +1 -1
  138. package/dist/utils/recalculate-scrollable-ancestors.d.ts +1 -1
  139. package/dist/utils/recalculate-scrollable-ancestors.d.ts.map +1 -1
  140. package/dist/utils/recalculate-scrollable-ancestors.js +4 -4
  141. package/dist/utils/recalculate-scrollable-ancestors.js.map +1 -1
  142. package/dist/utils/shadow-dom-aware-mutation-observer.d.ts +10 -0
  143. package/dist/utils/shadow-dom-aware-mutation-observer.d.ts.map +1 -0
  144. package/dist/utils/shadow-dom-aware-mutation-observer.js +61 -0
  145. package/dist/utils/shadow-dom-aware-mutation-observer.js.map +1 -0
  146. package/dist/utils/supports-anchor-positioning.d.ts +1 -1
  147. package/dist/utils/supports-anchor-positioning.d.ts.map +1 -1
  148. package/dist/utils/supports-anchor-positioning.js +1 -1
  149. package/dist/utils/supports-anchor-positioning.js.map +1 -1
  150. package/dist/utils/transform-violations.d.ts +2 -2
  151. package/dist/utils/transform-violations.d.ts.map +1 -1
  152. package/dist/utils/transform-violations.js +23 -10
  153. package/dist/utils/transform-violations.js.map +1 -1
  154. package/dist/utils/update-elements-with-issues.d.ts +11 -5
  155. package/dist/utils/update-elements-with-issues.d.ts.map +1 -1
  156. package/dist/utils/update-elements-with-issues.js +56 -24
  157. package/dist/utils/update-elements-with-issues.js.map +1 -1
  158. package/dist/validate-options.d.ts +2 -2
  159. package/dist/validate-options.d.ts.map +1 -1
  160. package/dist/validate-options.js +91 -4
  161. package/dist/validate-options.js.map +1 -1
  162. package/package.json +15 -7
  163. package/src/accented.test.ts +2 -2
  164. package/src/accented.ts +45 -34
  165. package/src/common/tokens.ts +10 -0
  166. package/src/constants.ts +2 -1
  167. package/src/dom-updater.ts +87 -34
  168. package/src/elements/accented-dialog.ts +157 -122
  169. package/src/elements/accented-trigger.ts +119 -47
  170. package/src/fullscreen-listener.ts +21 -0
  171. package/src/intersection-observer.ts +27 -16
  172. package/src/log-and-rethrow.ts +2 -3
  173. package/src/logger.ts +14 -4
  174. package/src/register-elements.ts +7 -7
  175. package/src/resize-listener.ts +15 -11
  176. package/src/scanner.ts +113 -57
  177. package/src/scroll-listeners.ts +27 -19
  178. package/src/state.ts +27 -16
  179. package/src/task-queue.test.ts +5 -4
  180. package/src/task-queue.ts +8 -6
  181. package/src/types.ts +179 -76
  182. package/src/utils/are-elements-with-issues-equal.ts +11 -0
  183. package/src/utils/are-issue-sets-equal.test.ts +10 -6
  184. package/src/utils/are-issue-sets-equal.ts +8 -6
  185. package/src/utils/containing-blocks.ts +60 -0
  186. package/src/utils/contains.test.ts +54 -0
  187. package/src/utils/contains.ts +19 -0
  188. package/src/utils/deduplicate-nodes.ts +3 -0
  189. package/src/utils/deep-merge.test.ts +8 -1
  190. package/src/utils/deep-merge.ts +14 -8
  191. package/src/utils/dom-helpers.ts +42 -0
  192. package/src/utils/ensure-non-empty.ts +6 -0
  193. package/src/utils/get-element-html.ts +4 -2
  194. package/src/utils/get-element-position.ts +84 -16
  195. package/src/utils/get-parent.ts +14 -0
  196. package/src/utils/get-scan-context.test.ts +85 -0
  197. package/src/utils/get-scan-context.ts +36 -0
  198. package/src/utils/get-scrollable-ancestors.ts +15 -7
  199. package/src/utils/is-node-in-scan-context.test.ts +70 -0
  200. package/src/utils/is-node-in-scan-context.ts +29 -0
  201. package/src/utils/is-non-empty.ts +3 -0
  202. package/src/utils/normalize-context.test.ts +105 -0
  203. package/src/utils/normalize-context.ts +65 -0
  204. package/src/utils/recalculate-positions.ts +5 -5
  205. package/src/utils/recalculate-scrollable-ancestors.ts +4 -4
  206. package/src/utils/shadow-dom-aware-mutation-observer.ts +75 -0
  207. package/src/utils/supports-anchor-positioning.ts +3 -3
  208. package/src/utils/transform-violations.test.ts +28 -24
  209. package/src/utils/transform-violations.ts +30 -12
  210. package/src/utils/update-elements-with-issues.test.ts +139 -51
  211. package/src/utils/update-elements-with-issues.ts +123 -54
  212. package/src/validate-options.ts +154 -14
package/NOTICE ADDED
@@ -0,0 +1,14 @@
1
+ NOTICE
2
+
3
+ This project, Accented, is licensed under the MIT License.
4
+
5
+ However, it depends on axe-core, which is licensed under the Mozilla Public License 2.0 (MPL-2.0). The source code for axe-core is available at:
6
+
7
+ https://github.com/dequelabs/axe-core
8
+
9
+ According to the MPL-2.0 requirements:
10
+ - Any modifications made to axe-core within this project will remain under the MPL-2.0 license.
11
+ - The original license and notices for axe-core are preserved.
12
+ - The full MPL-2.0 license can be found at: https://www.mozilla.org/MPL/2.0/
13
+
14
+ No changes have been made to axe-core within this project, beyond its use as a dependency.
package/README.md CHANGED
@@ -1,214 +1,71 @@
1
- # Accented
2
-
3
- Accented is a library that helps visually identify accessibility issues in a website or webapp under development.
4
-
5
- It can be set up in only a few lines of code
6
-
7
- It complements approaches to other means of continuous automated accessibility testing such as static code analysis and inclusion of accessibility tests in test suites. Think of it as a form of linting, but for a rendered web page rather than for source code.
8
-
9
- Accented uses the [axe-core](https://github.com/dequelabs/axe-core) testing engine.
10
-
11
- TODO: example screenshots, without Accented / with Accented.
12
-
13
- ## Basic usage
14
-
15
- * The library can be used in three ways:
16
- * NPM (with a bundler)
17
- * `import accented from 'https://esm.sh/accented';`.
18
- * `import('https://esm.sh/accented').then(({default: accented}) => { accented(); });` (this version will work in the console, unless it violates the content security policy, which shouldn't be the case locally).
19
- * For example, this works on medium.com
20
-
21
- ## API
22
-
23
- ### Exports
24
-
25
- * `accented`: the default library export. It’s the function that enables the continuous scanning and highlighting
26
- on the page in whose context in was called. Example: `const disable = accented(options)`.
27
- * Parameters: the only parameter is `options`. See [Options](#options).
28
- * Returns: a `disable` function that takes no parameters. When called, disables the scanning and highlighting,
29
- and cleans up any changes that Accented has made to the page.
30
-
31
- #### Type exports
32
-
33
- The following types are exported for TypeScript consumers:
34
-
35
- * `AccentedOptions`: the `options` parameter (see [Options](#options)).
36
- * `DisableAccented`: the type of the function returned by `accented`.
37
-
38
- ### Options
1
+ <a href="https://www.accented.dev">
2
+ <img alt="Accented" src="https://www.accented.dev/images/logo.svg" width="100" />
3
+ </a>
39
4
 
40
- #### `axeContext`
41
-
42
- **Type:** see [documentation](https://www.deque.com/axe/core-documentation/api-documentation/#context-parameter).
43
-
44
- **Default:** `document`.
45
-
46
- The `context` parameter for `axe.run()`.
47
-
48
- Determines what element(s) to scan for accessibility issues.
49
-
50
- Accepts a variety of shapes:
51
- * an element reference;
52
- * a selector;
53
- * a `NodeList`;
54
- * an include / exclude object;
55
- * and more.
56
-
57
- See documentation: https://www.deque.com/axe/core-documentation/api-documentation/#context-parameter
58
-
59
- #### `axeOptions`
60
-
61
- **Type:** object.
62
-
63
- **Default:** `{}`.
64
-
65
- The `options` parameter for `axe.run()`.
66
-
67
- Accented only supports two keys of the `options` object:
68
-
69
- * `rules`;
70
- * `runOnly`.
71
-
72
- Both properties are optional, and both control which accessibility rules your page is tested against.
73
-
74
- See documentation: https://www.deque.com/axe/core-documentation/api-documentation/#options-parameter
5
+ # Accented
75
6
 
76
- #### `output`
7
+ A frontend library for continuous accessibility testing and issue highlighting.
77
8
 
78
- An object controlling how the results of scans will be presented.
9
+ ## What is Accented?
79
10
 
80
- #### `output.console`
11
+ Accented is a visual library based on [axe-core](https://github.com/dequelabs/axe-core) that helps identify issues as soon as they are introduced.
81
12
 
82
- **Type:** boolean.
13
+ It adds interactive visual callouts for all accessibility issues that axe-core identifies.
83
14
 
84
- **Default:** `true`.
15
+ Example — without Accented vs. with Accented:
85
16
 
86
- Whether the list of elements with issues should be printed to the browser console whenever issues are added, removed, or changed.
17
+ ![Two screenshots of the same web application side by side. On the left, the regular state of the application. On the right, the same state but with bright outlines and buttons added to some page elements.](https://www.accented.dev/images/side-by-side.png)
87
18
 
88
- #### `callback`
19
+ [Try it out at the Playground (StackBlitz).](https://stackblitz.com/edit/accented-playground-react-ts?file=src%2Fmain.tsx)
89
20
 
90
- **Type:** function.
21
+ Accented can complement other tools commonly used for accessibility testing:
91
22
 
92
- **Default:** no-op (`() => {}`).
23
+ - **It can find more issues than source code linting.** The popular [`eslint-plugin-jsx-a11y`](https://www.npmjs.com/package/eslint-plugin-jsx-a11y) is great, and linters validate the whole codebase, but some issues can only be detected on the rendered page. For example, the linter cannot find issues with color contrast or heading order. Besides, Accented is not framework-specific.
24
+ - **It’s embedded into the project code, with no setup required in the browser or code editor.** You’d get a similar audit from [Lighthouse](https://developer.chrome.com/docs/lighthouse/overview) or [axe DevTools](https://www.deque.com/axe/devtools/), but with Accented, you don’t need a browser extension, and the results are always up to date.
25
+ - **You don’t need to write any extra code, unlike with adding accessibility tests to a test suite.** You can test for accessibility issues in your test suite, for example using [`@axe-core/playwright`](https://www.npmjs.com/package/@axe-core/playwright). For that, however, you need to write a test case for every state of the application that you want to test. Accented instead automatically tests anything that’s currently on the page in your browser.
93
26
 
94
- A function that Accented will call after every scan.
95
- It accepts a single `params` object with the following properties:
27
+ Learn more about Accented at [accented.dev](https://www.accented.dev).
96
28
 
97
- * `elementsWithIssues`: the most up-to-date array of all elements with accessibility issues.
98
- * `scanDuration`: how long the last scan took, in milliseconds (may be useful for performance tracking).
29
+ ## Installation and usage
99
30
 
100
- **Example:**
31
+ Install:
101
32
 
33
+ ```bash
34
+ npm install --save-dev accented
102
35
  ```
103
- accented({
104
- callback: ({ elementsWithIssues, scanDuration }) => {
105
- console.log('Elements with issues:', elementsWithIssues);
106
- console.log('Scan duration:', scanDuration);
107
- }
108
- });
109
- ```
110
-
111
- #### `name`
112
-
113
- **Type:** string.
114
-
115
- **Default:** `"accented"`.
116
-
117
- The character sequence that’s used in various elements, attributes and stylesheets that Accented adds to the page.
118
-
119
- You shouldn’t have to use this attribute unless some of the names on your page conflict with what Accented provides by default.
120
-
121
- * The data attribute that’s added to elements with issues (default: `data-accented`).
122
- * The custom elements for the button and the dialog that get created for each element with issues
123
- (default: `accented-trigger`, `accented-dialog`).
124
- * The CSS cascade layer containing page-wide Accented-specific styles (default: `accented`).
125
- * The prefix for some of the CSS custom properties used by Accented (default: `--accented-`).
126
- * The window property that’s used to prevent multiple axe-core scans from running simultaneously
127
- (default: `__accented_axe_running__`).
128
-
129
- Only lowercase alphanumeric characters and dashes (-) are allowed in the name,
130
- and it must start with a lowercase letter.
131
36
 
132
- **Example:**
37
+ Import and run at any moment during your app’s initialization:
133
38
 
39
+ ```js
40
+ if (isDevelopment) {
41
+ const { accented } = await import("accented");
42
+ accented();
43
+ }
134
44
  ```
135
- accented({name: 'my-name'});
136
- ```
137
-
138
- With the above option provided, the attribute set on elements with issues will be `data-my-name`,
139
- a custom element will be called `my-name-trigger`, and so on.
140
-
141
- #### `throttle`
142
-
143
- An object controlling when Accented will run its scans.
144
-
145
- #### `throttle.wait`
146
-
147
- **Type:** number.
148
-
149
- **Default:** 1000.
150
-
151
- The delay (in milliseconds) after a mutation or after the last Accented scan.
152
-
153
- If the page you’re scanning has a lot of nodes,
154
- scanning may take a noticeable time (~ a few hundred milliseconds),
155
- during which time the main thread will be blocked most of the time.
156
-
157
- You may want to experiment with this value if your page contents change frequently
158
- or if it has JavaScript-based animations running on the main thread.
159
-
160
- #### `throttle.leading`
161
-
162
- **Type:** boolean.
163
-
164
- **Default:** `true`.
165
-
166
- If set to true, the scan runs immediately after a mutation.
167
- In this case, `wait` only applies to subsequent scans,
168
- giving the page at least `wait` milliseconds between the end of the previous scan
169
- and the beginning of the next one.
170
-
171
- If set to false, the wait applies to mutations as well,
172
- delaying the output.
173
- This may be useful if you’re expecting bursts of mutations on your page.
174
-
175
- ### Styling
176
-
177
- TODO: Create a separate doc with info on using `:root` and CSS layers to control some aspects of styling.
178
-
179
- Documented CSS custom props:
180
- * `--accented-primary-color`
181
- * `--accented-secondary-color`
182
- * `--accented-outline-width`
183
- * `--accented-outline-style`
184
-
185
- ## Miscellaneous
186
-
187
- ### Shadow DOM
188
-
189
- Highlighting elements inside shadow DOM is not supported yet, see [#25](https://github.com/pomerantsev/accented/issues/25).
190
-
191
- ### Iframes
192
45
 
193
- Although axe-core is capable of scanning iframes, Accented doesn’t provide that as a special capability.
46
+ ⚠️ **Heads up!**
47
+ Don’t expose Accented to your users.
48
+ It’s for development use only.
194
49
 
195
- Instead, if you wish to scan the document in an iframe, initialize Accented inside the iframed document.
196
- There should be no interference between the instances of Accented running in the parent and child documents.
50
+ See the docs for your bundler or framework for how to run code only in the development environment.
197
51
 
198
- TODO: expand this section and better explain the concepts.
52
+ - [More detailed installation and usage guide](https://www.accented.dev/getting-started)
53
+ - [Full API](https://www.accented.dev/api)
199
54
 
200
- ## Frequently asked questions
55
+ ## More info
201
56
 
202
- <!-- TODO: how can this section be better formatted? This probably should be regular sections rather than a Q&A. -->
57
+ - [Accessibility](https://www.accented.dev/about#accessibility) (how accessible is Accented itself?)
58
+ - [Performance](https://www.accented.dev/how-it-works#performance) (does Accented affect runtime performance of my app?)
59
+ - [Browser support](https://www.accented.dev/about#browser-support) (will Accented work for me and my teammates?)
60
+ - [Versioning policy](https://www.accented.dev/about#versioning) (Accented follows [SemVer](https://semver.org/))
61
+ - [Changelog](https://github.com/pomerantsev/accented/blob/main/packages/accented/CHANGELOG.md)
203
62
 
204
- **Q:** can Accented be used in a CI (continuous integration) environment?
63
+ ## Contributing
205
64
 
206
- **A:** no, it’s only meant for local development. Accented runs accessibility tests on every state of the page that’s currently in the developer’s browser. However, if you additionally need something for CI, consider using [axe-core](https://www.npmjs.com/package/axe-core) in your automated test suite, either directly, or through wrappers such as [jest-axe](https://www.npmjs.com/package/jest-axe) or [axe-playwright](https://www.npmjs.com/package/axe-playwright).
65
+ Contributions are welcome!
207
66
 
208
- **Q:** does Accented affect performance?
67
+ - See [CONTRIBUTING.md](https://github.com/pomerantsev/accented/blob/main/CONTRIBUTING.md) for setup instructions and guidelines.
68
+ - Open an [issue](https://github.com/pomerantsev/accented/issues) or pull request if you spot a bug or want to propose a new feature.
69
+ - See [Milestones](https://github.com/pomerantsev/accented/milestones) to learn about our plans for Accented.
209
70
 
210
- **A:** TODO: it might (it’s inevitable because it’s on the main thread), but we’ve taken X, Y, and Z measures to make it less noticeable. You can also take A, B, and C steps yourself.
211
- * Only re-running on the changed part of the page.
212
- * Throttling calls and giving the ability to tweak it.
213
- * Providing the ability to select which rules to run, and which elements to run them on.
214
- * TODO: explore axe-core’s internals. Can I make it yield periodically?
71
+ Have feedback or ideas? Contact Pavel at [hello@pavelpomerantsev.com](mailto:hello@pavelpomerantsev.com).
@@ -1,11 +1,11 @@
1
- import type { AccentedOptions, DisableAccented } from './types';
1
+ import type { AccentedOptions, DisableAccented } from './types.ts';
2
2
  export type { AccentedOptions, DisableAccented };
3
3
  /**
4
- * Enables highlighting of elements with accessibility issues.
4
+ * Enables the continuous scanning and highlighting of accessibility issues on the page.
5
5
  *
6
- * @param {AccentedOptions} options - The options object.
6
+ * @param {AccentedOptions} options - The options object (optional).
7
7
  *
8
- * @returns A `disable` function that can be called to stop the scanning and highlighting.
8
+ * @returns A `disable` function that takes no parameters. When called, disables the scanning and highlighting, and cleans up any changes that Accented has made to the page.
9
9
  *
10
10
  * @example
11
11
  * accented();
@@ -19,11 +19,11 @@ export type { AccentedOptions, DisableAccented };
19
19
  * wait: 500,
20
20
  * leading: false
21
21
  * },
22
- * callback: ({ elementsWithIssues, scanDuration }) => {
23
- * console.log('Elements with issues:', elementsWithIssues);
24
- * console.log('Scan duration:', scanDuration);
22
+ * callback: ({ elementsWithIssues, performance }) => {
23
+ * console.log('Elements with issues:', elementsWithIssues);
24
+ * console.log('Total blocking time:', performance.totalBlockingTime);
25
25
  * }
26
26
  * });
27
27
  */
28
- export default function accented(options?: AccentedOptions): DisableAccented;
28
+ export declare function accented(options?: AccentedOptions): DisableAccented;
29
29
  //# sourceMappingURL=accented.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accented.d.ts","sourceRoot":"","sources":["../src/accented.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAKhE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,eAAe,CA4E/E"}
1
+ {"version":3,"file":"accented.d.ts","sourceRoot":"","sources":["../src/accented.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAMnE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,eAAe,CAsFvE"}
package/dist/accented.js CHANGED
@@ -1,21 +1,23 @@
1
- import registerElements from './register-elements.js';
2
- import createDomUpdater from './dom-updater.js';
3
- import createLogger from './logger.js';
4
- import createScanner from './scanner.js';
5
- import setupScrollListeners from './scroll-listeners.js';
6
- import setupResizeListener from './resize-listener.js';
7
- import setupIntersectionObserver from './intersection-observer.js';
1
+ import { createDomUpdater } from './dom-updater.js';
2
+ import { setupResizeListener as setupFullscreenListener } from './fullscreen-listener.js';
3
+ import { setupIntersectionObserver } from './intersection-observer.js';
4
+ import { logAndRethrow } from './log-and-rethrow.js';
5
+ import { createLogger } from './logger.js';
6
+ import { registerElements } from './register-elements.js';
7
+ import { setupResizeListener } from './resize-listener.js';
8
+ import { createScanner } from './scanner.js';
9
+ import { setupScrollListeners } from './scroll-listeners.js';
8
10
  import { enabled, extendedElementsWithIssues } from './state.js';
9
- import deepMerge from './utils/deep-merge.js';
10
- import validateOptions from './validate-options.js';
11
- import supportsAnchorPositioning from './utils/supports-anchor-positioning.js';
12
- import logAndRethrow from './log-and-rethrow.js';
11
+ import { initializeContainingBlockSupportSet } from './utils/containing-blocks.js';
12
+ import { deepMerge } from './utils/deep-merge.js';
13
+ import { supportsAnchorPositioning } from './utils/supports-anchor-positioning.js';
14
+ import { validateOptions } from './validate-options.js';
13
15
  /**
14
- * Enables highlighting of elements with accessibility issues.
16
+ * Enables the continuous scanning and highlighting of accessibility issues on the page.
15
17
  *
16
- * @param {AccentedOptions} options - The options object.
18
+ * @param {AccentedOptions} options - The options object (optional).
17
19
  *
18
- * @returns A `disable` function that can be called to stop the scanning and highlighting.
20
+ * @returns A `disable` function that takes no parameters. When called, disables the scanning and highlighting, and cleans up any changes that Accented has made to the page.
19
21
  *
20
22
  * @example
21
23
  * accented();
@@ -29,13 +31,13 @@ import logAndRethrow from './log-and-rethrow.js';
29
31
  * wait: 500,
30
32
  * leading: false
31
33
  * },
32
- * callback: ({ elementsWithIssues, scanDuration }) => {
33
- * console.log('Elements with issues:', elementsWithIssues);
34
- * console.log('Scan duration:', scanDuration);
34
+ * callback: ({ elementsWithIssues, performance }) => {
35
+ * console.log('Elements with issues:', elementsWithIssues);
36
+ * console.log('Total blocking time:', performance.totalBlockingTime);
35
37
  * }
36
38
  * });
37
39
  */
38
- export default function accented(options = {}) {
40
+ export function accented(options = {}) {
39
41
  validateOptions(options);
40
42
  try {
41
43
  if (typeof window === 'undefined' || typeof document === 'undefined') {
@@ -44,11 +46,11 @@ export default function accented(options = {}) {
44
46
  return () => { };
45
47
  }
46
48
  const defaultOutput = {
47
- console: true
49
+ console: true,
48
50
  };
49
51
  const defaultThrottle = {
50
52
  wait: 1000,
51
- leading: true
53
+ leading: true,
52
54
  };
53
55
  // IMPORTANT: when changing any of the properties or values, also do the following:
54
56
  // * update the default value in the type documentation accordingly;
@@ -56,28 +58,32 @@ export default function accented(options = {}) {
56
58
  // * update examples in the accented() function JSDoc;
57
59
  // * update examples in the Readme.
58
60
  const defaultOptions = {
59
- axeContext: document,
61
+ context: document,
60
62
  axeOptions: {},
61
63
  name: 'accented',
62
64
  output: defaultOutput,
63
65
  throttle: defaultThrottle,
64
- callback: () => { }
66
+ callback: () => { },
65
67
  };
66
- const { axeContext, axeOptions, name, output, throttle, callback } = deepMerge(defaultOptions, options);
68
+ const { context, axeOptions, name, output, throttle, callback } = deepMerge(defaultOptions, options);
67
69
  if (enabled.value) {
68
- // Add link to the recipes section of the docs (#56).
69
- console.warn('You are trying to run the Accented library more than once. ' +
70
- 'This will likely lead to errors.');
70
+ console.warn('You are trying to run the Accented library more than once, which may lead to errors. See https://www.accented.dev/getting-started#run-once-per-page');
71
71
  console.trace();
72
72
  }
73
73
  enabled.value = true;
74
+ initializeContainingBlockSupportSet();
74
75
  registerElements(name);
75
- const { disconnect: cleanupIntersectionObserver, intersectionObserver } = supportsAnchorPositioning(window) ? {} : setupIntersectionObserver();
76
- const cleanupScanner = createScanner(name, axeContext, axeOptions, throttle, callback);
76
+ const { disconnect: cleanupIntersectionObserver, intersectionObserver } = setupIntersectionObserver();
77
+ const cleanupScanner = createScanner(name, context, axeOptions, throttle, callback);
77
78
  const cleanupDomUpdater = createDomUpdater(name, intersectionObserver);
78
79
  const cleanupLogger = output.console ? createLogger() : () => { };
79
- const cleanupScrollListeners = supportsAnchorPositioning(window) ? () => { } : setupScrollListeners();
80
- const cleanupResizeListener = supportsAnchorPositioning(window) ? () => { } : setupResizeListener();
80
+ const cleanupScrollListeners = setupScrollListeners();
81
+ const cleanupResizeListener = supportsAnchorPositioning(window)
82
+ ? () => { }
83
+ : setupResizeListener();
84
+ const cleanupFullscreenListener = supportsAnchorPositioning(window)
85
+ ? () => { }
86
+ : setupFullscreenListener();
81
87
  return () => {
82
88
  try {
83
89
  enabled.value = false;
@@ -87,6 +93,7 @@ export default function accented(options = {}) {
87
93
  cleanupLogger();
88
94
  cleanupScrollListeners();
89
95
  cleanupResizeListener();
96
+ cleanupFullscreenListener();
90
97
  if (cleanupIntersectionObserver) {
91
98
  cleanupIntersectionObserver();
92
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"accented.js","sourceRoot":"","sources":["../src/accented.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,gBAAgB,MAAM,kBAAkB,CAAC;AAChD,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,aAAa,MAAM,cAAc,CAAC;AACzC,OAAO,oBAAoB,MAAM,uBAAuB,CAAC;AACzD,OAAO,mBAAmB,MAAM,sBAAsB,CAAC;AACvD,OAAO,yBAAyB,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAE9C,OAAO,eAAe,MAAM,uBAAuB,CAAC;AACpD,OAAO,yBAAyB,MAAM,wCAAwC,CAAC;AAC/E,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAIjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,UAA2B,EAAE;IAE5D,eAAe,CAAC,OAAO,CAAC,CAAC;IAEzB,IAAI,CAAC;QACH,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;YACrE,OAAO,CAAC,IAAI,CAAC,wGAAwG,CAAC,CAAC;YACvH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;gBACH,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;gBACtB,0BAA0B,CAAC,KAAK,GAAG,EAAE,CAAC;gBACtC,cAAc,EAAE,CAAC;gBACjB,iBAAiB,EAAE,CAAC;gBACpB,aAAa,EAAE,CAAC;gBAChB,sBAAsB,EAAE,CAAC;gBACzB,qBAAqB,EAAE,CAAC;gBACxB,yBAAyB,EAAE,CAAC;gBAC5B,IAAI,2BAA2B,EAAE,CAAC;oBAChC,2BAA2B,EAAE,CAAC;gBAChC,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,aAAa,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,aAAa,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const primaryColorDark = "oklch(0.5 0.3 0)";
2
+ export declare const primaryColorLight = "oklch(0.8 0.2 0)";
3
+ export declare const colorLight = "oklch(0.98 0 0)";
4
+ export declare const colorDark = "oklch(0.22 0 0)";
5
+ export declare const fontSystemSans = "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Adwaita Sans, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif";
6
+ export declare const fontSystemMono = "Menlo, Consolas, Monaco, Adwaita Mono, Liberation Mono, Lucida Console, monospace";
7
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/common/tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AACpD,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAC5C,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAG3C,eAAO,MAAM,cAAc,kKACsI,CAAC;AAClK,eAAO,MAAM,cAAc,sFAC0D,CAAC"}
@@ -0,0 +1,8 @@
1
+ export const primaryColorDark = 'oklch(0.5 0.3 0)';
2
+ export const primaryColorLight = 'oklch(0.8 0.2 0)';
3
+ export const colorLight = 'oklch(0.98 0 0)';
4
+ export const colorDark = 'oklch(0.22 0 0)';
5
+ /* https://systemfontstack.com/ */
6
+ export const fontSystemSans = '-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Adwaita Sans, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif';
7
+ export const fontSystemMono = 'Menlo, Consolas, Monaco, Adwaita Mono, Liberation Mono, Lucida Console, monospace';
8
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/common/tokens.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAC5C,MAAM,CAAC,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAE3C,kCAAkC;AAClC,MAAM,CAAC,MAAM,cAAc,GACzB,+JAA+J,CAAC;AAClK,MAAM,CAAC,MAAM,cAAc,GACzB,mFAAmF,CAAC"}
@@ -1,3 +1,4 @@
1
- export declare const accentedUrl = "https://www.npmjs.com/package/accented";
1
+ export declare const accentedUrl = "https://www.accented.dev";
2
2
  export declare const issuesUrl = "https://github.com/pomerantsev/accented/issues";
3
+ export declare const getAccentedElementNames: (name: string) => string[];
3
4
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,2CAA2C,CAAC;AACpE,eAAO,MAAM,SAAS,mDAAmD,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,6BAA6B,CAAC;AACtD,eAAO,MAAM,SAAS,mDAAmD,CAAC;AAC1E,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,aAA0C,CAAC"}
package/dist/constants.js CHANGED
@@ -1,3 +1,4 @@
1
- export const accentedUrl = 'https://www.npmjs.com/package/accented';
1
+ export const accentedUrl = 'https://www.accented.dev';
2
2
  export const issuesUrl = 'https://github.com/pomerantsev/accented/issues';
3
+ export const getAccentedElementNames = (name) => [`${name}-trigger`, `${name}-dialog`];
3
4
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,wCAAwC,CAAC;AACpE,MAAM,CAAC,MAAM,SAAS,GAAG,gDAAgD,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,0BAA0B,CAAC;AACtD,MAAM,CAAC,MAAM,SAAS,GAAG,gDAAgD,CAAC;AAC1E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,UAAU,EAAE,GAAG,IAAI,SAAS,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export default function createDomUpdater(name: string, intersectionObserver?: IntersectionObserver): () => void;
1
+ export declare function createDomUpdater(name: string, intersectionObserver?: IntersectionObserver): () => void;
2
2
  //# sourceMappingURL=dom-updater.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom-updater.d.ts","sourceRoot":"","sources":["../src/dom-updater.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,oBAAoB,cA0GjG"}
1
+ {"version":3,"file":"dom-updater.d.ts","sourceRoot":"","sources":["../src/dom-updater.ts"],"names":[],"mappings":"AAiCA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,oBAAoB,cAmIzF"}