accented 0.0.1-dev.4 → 0.0.2
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/README.md +214 -0
- package/dist/accented.d.ts +28 -7
- package/dist/accented.d.ts.map +1 -1
- package/dist/accented.js +100 -42
- package/dist/accented.js.map +1 -1
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +3 -0
- package/dist/constants.js.map +1 -0
- package/dist/dom-updater.d.ts +1 -6
- package/dist/dom-updater.d.ts.map +1 -1
- package/dist/dom-updater.js +94 -20
- package/dist/dom-updater.js.map +1 -1
- package/dist/elements/accented-dialog.d.ts +356 -0
- package/dist/elements/accented-dialog.d.ts.map +1 -0
- package/dist/elements/accented-dialog.js +361 -0
- package/dist/elements/accented-dialog.js.map +1 -0
- package/dist/elements/accented-trigger.d.ts +359 -0
- package/dist/elements/accented-trigger.d.ts.map +1 -0
- package/dist/elements/accented-trigger.js +159 -0
- package/dist/elements/accented-trigger.js.map +1 -0
- package/dist/intersection-observer.d.ts +5 -0
- package/dist/intersection-observer.d.ts.map +1 -0
- package/dist/intersection-observer.js +28 -0
- package/dist/intersection-observer.js.map +1 -0
- package/dist/log-and-rethrow.d.ts +2 -0
- package/dist/log-and-rethrow.d.ts.map +1 -0
- package/dist/log-and-rethrow.js +7 -0
- package/dist/log-and-rethrow.js.map +1 -0
- package/dist/logger.d.ts +2 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +25 -0
- package/dist/logger.js.map +1 -0
- package/dist/register-elements.d.ts +2 -0
- package/dist/register-elements.d.ts.map +1 -0
- package/dist/register-elements.js +21 -0
- package/dist/register-elements.js.map +1 -0
- package/dist/resize-listener.d.ts +2 -0
- package/dist/resize-listener.d.ts.map +1 -0
- package/dist/resize-listener.js +18 -0
- package/dist/resize-listener.js.map +1 -0
- package/dist/scanner.d.ts +3 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +120 -0
- package/dist/scanner.js.map +1 -0
- package/dist/scroll-listeners.d.ts +2 -0
- package/dist/scroll-listeners.d.ts.map +1 -0
- package/dist/scroll-listeners.js +38 -0
- package/dist/scroll-listeners.js.map +1 -0
- package/dist/state.d.ts +6 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +14 -0
- package/dist/state.js.map +1 -0
- package/dist/task-queue.d.ts +3 -4
- package/dist/task-queue.d.ts.map +1 -1
- package/dist/task-queue.js +27 -23
- package/dist/task-queue.js.map +1 -1
- package/dist/types.d.ts +136 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/are-issue-sets-equal.d.ts +3 -0
- package/dist/utils/are-issue-sets-equal.d.ts.map +1 -0
- package/dist/utils/are-issue-sets-equal.js +6 -0
- package/dist/utils/are-issue-sets-equal.js.map +1 -0
- package/dist/utils/deep-merge.d.ts +4 -0
- package/dist/utils/deep-merge.d.ts.map +1 -0
- package/dist/utils/deep-merge.js +18 -0
- package/dist/utils/deep-merge.js.map +1 -0
- package/dist/utils/get-element-html.d.ts +2 -0
- package/dist/utils/get-element-html.d.ts.map +1 -0
- package/dist/utils/get-element-html.js +14 -0
- package/dist/utils/get-element-html.js.map +1 -0
- package/dist/utils/get-element-position.d.ts +3 -0
- package/dist/utils/get-element-position.d.ts.map +1 -0
- package/dist/utils/get-element-position.js +22 -0
- package/dist/utils/get-element-position.js.map +1 -0
- package/dist/utils/get-scrollable-ancestors.d.ts +2 -0
- package/dist/utils/get-scrollable-ancestors.d.ts.map +1 -0
- package/dist/utils/get-scrollable-ancestors.js +15 -0
- package/dist/utils/get-scrollable-ancestors.js.map +1 -0
- package/dist/utils/recalculate-positions.d.ts +2 -0
- package/dist/utils/recalculate-positions.d.ts.map +1 -0
- package/dist/utils/recalculate-positions.js +27 -0
- package/dist/utils/recalculate-positions.js.map +1 -0
- package/dist/utils/recalculate-scrollable-ancestors.d.ts +2 -0
- package/dist/utils/recalculate-scrollable-ancestors.d.ts.map +1 -0
- package/dist/utils/recalculate-scrollable-ancestors.js +13 -0
- package/dist/utils/recalculate-scrollable-ancestors.js.map +1 -0
- package/dist/utils/supports-anchor-positioning.d.ts +6 -0
- package/dist/utils/supports-anchor-positioning.d.ts.map +1 -0
- package/dist/utils/supports-anchor-positioning.js +4 -0
- package/dist/utils/supports-anchor-positioning.js.map +1 -0
- package/dist/utils/transform-violations.d.ts +4 -0
- package/dist/utils/transform-violations.d.ts.map +1 -0
- package/dist/utils/transform-violations.js +48 -0
- package/dist/utils/transform-violations.js.map +1 -0
- package/dist/utils/update-elements-with-issues.d.ts +7 -0
- package/dist/utils/update-elements-with-issues.d.ts.map +1 -0
- package/dist/utils/update-elements-with-issues.js +64 -0
- package/dist/utils/update-elements-with-issues.js.map +1 -0
- package/dist/validate-options.d.ts +3 -0
- package/dist/validate-options.d.ts.map +1 -0
- package/dist/validate-options.js +42 -0
- package/dist/validate-options.js.map +1 -0
- package/package.json +9 -4
- package/src/accented.test.ts +24 -0
- package/src/accented.ts +119 -0
- package/src/constants.ts +2 -0
- package/src/dom-updater.ts +112 -0
- package/src/elements/accented-dialog.ts +384 -0
- package/src/elements/accented-trigger.ts +179 -0
- package/src/intersection-observer.ts +28 -0
- package/src/log-and-rethrow.ts +9 -0
- package/src/logger.ts +26 -0
- package/src/register-elements.ts +21 -0
- package/src/resize-listener.ts +17 -0
- package/src/scanner.ts +139 -0
- package/src/scroll-listeners.ts +37 -0
- package/src/state.ts +24 -0
- package/src/task-queue.test.ts +135 -0
- package/src/task-queue.ts +59 -0
- package/src/types.ts +155 -0
- package/src/utils/are-issue-sets-equal.test.ts +49 -0
- package/src/utils/are-issue-sets-equal.ts +10 -0
- package/src/utils/deep-merge.test.ts +34 -0
- package/src/utils/deep-merge.ts +18 -0
- package/src/utils/get-element-html.ts +13 -0
- package/src/utils/get-element-position.ts +21 -0
- package/src/utils/get-scrollable-ancestors.ts +14 -0
- package/src/utils/recalculate-positions.ts +27 -0
- package/src/utils/recalculate-scrollable-ancestors.ts +13 -0
- package/src/utils/supports-anchor-positioning.ts +7 -0
- package/src/utils/transform-violations.test.ts +124 -0
- package/src/utils/transform-violations.ts +56 -0
- package/src/utils/update-elements-with-issues.test.ts +283 -0
- package/src/utils/update-elements-with-issues.ts +75 -0
- package/src/validate-options.ts +44 -0
- package/dist/utils/issuesToElements.d.ts +0 -3
- package/dist/utils/issuesToElements.d.ts.map +0 -1
- package/dist/utils/issuesToElements.js +0 -16
- package/dist/utils/issuesToElements.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
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
|
|
39
|
+
|
|
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
|
|
75
|
+
|
|
76
|
+
#### `output`
|
|
77
|
+
|
|
78
|
+
An object controlling how the results of scans will be presented.
|
|
79
|
+
|
|
80
|
+
#### `output.console`
|
|
81
|
+
|
|
82
|
+
**Type:** boolean.
|
|
83
|
+
|
|
84
|
+
**Default:** `true`.
|
|
85
|
+
|
|
86
|
+
Whether the list of elements with issues should be printed to the browser console whenever issues are added, removed, or changed.
|
|
87
|
+
|
|
88
|
+
#### `callback`
|
|
89
|
+
|
|
90
|
+
**Type:** function.
|
|
91
|
+
|
|
92
|
+
**Default:** no-op (`() => {}`).
|
|
93
|
+
|
|
94
|
+
A function that Accented will call after every scan.
|
|
95
|
+
It accepts a single `params` object with the following properties:
|
|
96
|
+
|
|
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).
|
|
99
|
+
|
|
100
|
+
**Example:**
|
|
101
|
+
|
|
102
|
+
```
|
|
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
|
+
|
|
132
|
+
**Example:**
|
|
133
|
+
|
|
134
|
+
```
|
|
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
|
+
|
|
193
|
+
Although axe-core is capable of scanning iframes, Accented doesn’t provide that as a special capability.
|
|
194
|
+
|
|
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.
|
|
197
|
+
|
|
198
|
+
TODO: expand this section and better explain the concepts.
|
|
199
|
+
|
|
200
|
+
## Frequently asked questions
|
|
201
|
+
|
|
202
|
+
<!-- TODO: how can this section be better formatted? This probably should be regular sections rather than a Q&A. -->
|
|
203
|
+
|
|
204
|
+
**Q:** can Accented be used in a CI (continuous integration) environment?
|
|
205
|
+
|
|
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).
|
|
207
|
+
|
|
208
|
+
**Q:** does Accented affect performance?
|
|
209
|
+
|
|
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?
|
package/dist/accented.d.ts
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { AccentedOptions, DisableAccented } from './types';
|
|
2
|
+
export type { AccentedOptions, DisableAccented };
|
|
3
|
+
/**
|
|
4
|
+
* Enables highlighting of elements with accessibility issues.
|
|
5
|
+
*
|
|
6
|
+
* @param {AccentedOptions} options - The options object.
|
|
7
|
+
*
|
|
8
|
+
* @returns A `disable` function that can be called to stop the scanning and highlighting.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* accented();
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const disableAccented = accented({
|
|
15
|
+
* output: {
|
|
16
|
+
* console: false
|
|
17
|
+
* },
|
|
18
|
+
* throttle: {
|
|
19
|
+
* wait: 500,
|
|
20
|
+
* leading: false
|
|
21
|
+
* },
|
|
22
|
+
* callback: ({ elementsWithIssues, scanDuration }) => {
|
|
23
|
+
* console.log('Elements with issues:', elementsWithIssues);
|
|
24
|
+
* console.log('Scan duration:', scanDuration);
|
|
25
|
+
* }
|
|
26
|
+
* });
|
|
27
|
+
*/
|
|
28
|
+
export default function accented(options?: AccentedOptions): DisableAccented;
|
|
8
29
|
//# sourceMappingURL=accented.d.ts.map
|
package/dist/accented.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accented.d.ts","sourceRoot":"","sources":["../src/accented.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/accented.js
CHANGED
|
@@ -1,46 +1,104 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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';
|
|
8
|
+
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';
|
|
13
|
+
/**
|
|
14
|
+
* Enables highlighting of elements with accessibility issues.
|
|
15
|
+
*
|
|
16
|
+
* @param {AccentedOptions} options - The options object.
|
|
17
|
+
*
|
|
18
|
+
* @returns A `disable` function that can be called to stop the scanning and highlighting.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* accented();
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const disableAccented = accented({
|
|
25
|
+
* output: {
|
|
26
|
+
* console: false
|
|
27
|
+
* },
|
|
28
|
+
* throttle: {
|
|
29
|
+
* wait: 500,
|
|
30
|
+
* leading: false
|
|
31
|
+
* },
|
|
32
|
+
* callback: ({ elementsWithIssues, scanDuration }) => {
|
|
33
|
+
* console.log('Elements with issues:', elementsWithIssues);
|
|
34
|
+
* console.log('Scan duration:', scanDuration);
|
|
35
|
+
* }
|
|
36
|
+
* });
|
|
37
|
+
*/
|
|
38
|
+
export default function accented(options = {}) {
|
|
39
|
+
validateOptions(options);
|
|
40
|
+
try {
|
|
41
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
42
|
+
console.warn('Accented: this script can only run in the browser, and it’s likely running on the server now. Exiting.');
|
|
43
|
+
console.trace();
|
|
44
|
+
return () => { };
|
|
26
45
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
const defaultOutput = {
|
|
47
|
+
console: true
|
|
48
|
+
};
|
|
49
|
+
const defaultThrottle = {
|
|
50
|
+
wait: 1000,
|
|
51
|
+
leading: true
|
|
52
|
+
};
|
|
53
|
+
// IMPORTANT: when changing any of the properties or values, also do the following:
|
|
54
|
+
// * update the default value in the type documentation accordingly;
|
|
55
|
+
// * update validations and validation tests if necessary;
|
|
56
|
+
// * update examples in the accented() function JSDoc;
|
|
57
|
+
// * update examples in the Readme.
|
|
58
|
+
const defaultOptions = {
|
|
59
|
+
axeContext: document,
|
|
60
|
+
axeOptions: {},
|
|
61
|
+
name: 'accented',
|
|
62
|
+
output: defaultOutput,
|
|
63
|
+
throttle: defaultThrottle,
|
|
64
|
+
callback: () => { }
|
|
65
|
+
};
|
|
66
|
+
const { axeContext, axeOptions, name, output, throttle, callback } = deepMerge(defaultOptions, options);
|
|
67
|
+
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.');
|
|
71
|
+
console.trace();
|
|
37
72
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
73
|
+
enabled.value = true;
|
|
74
|
+
registerElements(name);
|
|
75
|
+
const { disconnect: cleanupIntersectionObserver, intersectionObserver } = supportsAnchorPositioning(window) ? {} : setupIntersectionObserver();
|
|
76
|
+
const cleanupScanner = createScanner(name, axeContext, axeOptions, throttle, callback);
|
|
77
|
+
const cleanupDomUpdater = createDomUpdater(name, intersectionObserver);
|
|
78
|
+
const cleanupLogger = output.console ? createLogger() : () => { };
|
|
79
|
+
const cleanupScrollListeners = supportsAnchorPositioning(window) ? () => { } : setupScrollListeners();
|
|
80
|
+
const cleanupResizeListener = supportsAnchorPositioning(window) ? () => { } : setupResizeListener();
|
|
81
|
+
return () => {
|
|
82
|
+
try {
|
|
83
|
+
enabled.value = false;
|
|
84
|
+
extendedElementsWithIssues.value = [];
|
|
85
|
+
cleanupScanner();
|
|
86
|
+
cleanupDomUpdater();
|
|
87
|
+
cleanupLogger();
|
|
88
|
+
cleanupScrollListeners();
|
|
89
|
+
cleanupResizeListener();
|
|
90
|
+
if (cleanupIntersectionObserver) {
|
|
91
|
+
cleanupIntersectionObserver();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
logAndRethrow(error);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
logAndRethrow(error);
|
|
101
|
+
return () => { };
|
|
102
|
+
}
|
|
45
103
|
}
|
|
46
104
|
//# sourceMappingURL=accented.js.map
|
package/dist/accented.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accented.js","sourceRoot":"","sources":["../src/accented.ts"],"names":[],"mappings":"
|
|
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,a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Aa,EAAE,CAAC;gBAChB,sBAAsB,EAAE,CAAC;gBACzB,qBAAqB,EAAE,CAAC;gBACxB,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 @@
|
|
|
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"}
|
|
@@ -0,0 +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"}
|
package/dist/dom-updater.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export default
|
|
2
|
-
#private;
|
|
3
|
-
elements: Array<Element>;
|
|
4
|
-
constructor();
|
|
5
|
-
update(newElements: Array<Element>): void;
|
|
6
|
-
}
|
|
1
|
+
export default function createDomUpdater(name: string, intersectionObserver?: IntersectionObserver): () => void;
|
|
7
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":"
|
|
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"}
|
package/dist/dom-updater.js
CHANGED
|
@@ -1,29 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { effect } from '@preact/signals-core';
|
|
2
|
+
import { extendedElementsWithIssues } from './state.js';
|
|
3
|
+
import supportsAnchorPositioning from './utils/supports-anchor-positioning.js';
|
|
4
|
+
export default function createDomUpdater(name, intersectionObserver) {
|
|
5
|
+
const attrName = `data-${name}`;
|
|
6
|
+
function getAnchorNames(anchorNameValue) {
|
|
7
|
+
return anchorNameValue
|
|
8
|
+
.split(',')
|
|
9
|
+
.map(anchorName => anchorName.trim())
|
|
10
|
+
.filter(anchorName => anchorName.startsWith('--'));
|
|
6
11
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
function setAnchorName(element, id) {
|
|
13
|
+
const anchorNameValue = element.style.getPropertyValue('anchor-name') || window.getComputedStyle(element).getPropertyValue('anchor-name');
|
|
14
|
+
const anchorNames = getAnchorNames(anchorNameValue);
|
|
15
|
+
if (anchorNames.length > 0) {
|
|
16
|
+
element.style.setProperty('anchor-name', `${anchorNameValue}, --${name}-anchor-${id}`);
|
|
10
17
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
element.setAttribute(attrName, '');
|
|
18
|
+
else {
|
|
19
|
+
element.style.setProperty('anchor-name', `--${name}-anchor-${id}`);
|
|
14
20
|
}
|
|
15
21
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
function removeAnchorName(element, id) {
|
|
23
|
+
const anchorNameValue = element.style.getPropertyValue('anchor-name');
|
|
24
|
+
const anchorNames = getAnchorNames(anchorNameValue);
|
|
25
|
+
const index = anchorNames.indexOf(`--${name}-anchor-${id}`);
|
|
26
|
+
if (anchorNames.length === 1 && index === 0) {
|
|
27
|
+
element.style.removeProperty('anchor-name');
|
|
28
|
+
}
|
|
29
|
+
else if (anchorNames.length > 1 && index > -1) {
|
|
30
|
+
element.style.setProperty('anchor-name', anchorNames.filter((_, i) => i !== index).join(', '));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function setIssues(extendedElementsWithIssues) {
|
|
34
|
+
for (const elementWithIssues of extendedElementsWithIssues) {
|
|
35
|
+
elementWithIssues.element.setAttribute(attrName, elementWithIssues.id.toString());
|
|
36
|
+
if (supportsAnchorPositioning(window)) {
|
|
37
|
+
setAnchorName(elementWithIssues.element, elementWithIssues.id);
|
|
38
|
+
}
|
|
39
|
+
if (elementWithIssues.element.parentElement) {
|
|
40
|
+
elementWithIssues.element.insertAdjacentElement('afterend', elementWithIssues.trigger);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
elementWithIssues.element.insertAdjacentElement('beforeend', elementWithIssues.trigger);
|
|
44
|
+
}
|
|
45
|
+
if (intersectionObserver) {
|
|
46
|
+
intersectionObserver.observe(elementWithIssues.element);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function removeIssues(extendedElementsWithIssues) {
|
|
51
|
+
for (const elementWithIssues of extendedElementsWithIssues) {
|
|
52
|
+
elementWithIssues.element.removeAttribute(attrName);
|
|
53
|
+
if (supportsAnchorPositioning(window)) {
|
|
54
|
+
removeAnchorName(elementWithIssues.element, elementWithIssues.id);
|
|
55
|
+
}
|
|
56
|
+
elementWithIssues.trigger.remove();
|
|
57
|
+
if (intersectionObserver) {
|
|
58
|
+
intersectionObserver.unobserve(elementWithIssues.element);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const stylesheet = new CSSStyleSheet();
|
|
63
|
+
stylesheet.replaceSync(`
|
|
64
|
+
@layer ${name} {
|
|
65
|
+
:root {
|
|
66
|
+
--${name}-primary-color: red;
|
|
67
|
+
--${name}-secondary-color: white;
|
|
68
|
+
--${name}-outline-width: 2px;
|
|
69
|
+
--${name}-outline-style: solid;
|
|
70
|
+
}
|
|
71
|
+
|
|
21
72
|
[${attrName}]:not(:focus-visible) {
|
|
22
|
-
outline:
|
|
23
|
-
outline-offset: -
|
|
73
|
+
outline-width: var(--${name}-outline-width) !important;
|
|
74
|
+
outline-offset: calc(-1 * var(--${name}-outline-width)) !important;
|
|
75
|
+
outline-color: var(--${name}-primary-color) !important;
|
|
76
|
+
outline-style: var(--${name}-outline-style) !important;
|
|
24
77
|
}
|
|
25
|
-
`;
|
|
26
|
-
document.head.appendChild(styleElement);
|
|
27
78
|
}
|
|
79
|
+
`);
|
|
80
|
+
let previousExtendedElementsWithIssues = [];
|
|
81
|
+
document.adoptedStyleSheets.push(stylesheet);
|
|
82
|
+
const removeStylesheet = () => {
|
|
83
|
+
if (document.adoptedStyleSheets.includes(stylesheet)) {
|
|
84
|
+
document.adoptedStyleSheets.splice(document.adoptedStyleSheets.indexOf(stylesheet), 1);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const disposeOfElementsEffect = effect(() => {
|
|
88
|
+
const added = extendedElementsWithIssues.value.filter(elementWithIssues => {
|
|
89
|
+
return !previousExtendedElementsWithIssues.some(previousElementWithIssues => previousElementWithIssues.element === elementWithIssues.element);
|
|
90
|
+
});
|
|
91
|
+
const removed = previousExtendedElementsWithIssues.filter(previousElementWithIssues => {
|
|
92
|
+
return !extendedElementsWithIssues.value.some(elementWithIssues => elementWithIssues.element === previousElementWithIssues.element);
|
|
93
|
+
});
|
|
94
|
+
removeIssues(removed);
|
|
95
|
+
setIssues(added);
|
|
96
|
+
previousExtendedElementsWithIssues = [...extendedElementsWithIssues.value];
|
|
97
|
+
});
|
|
98
|
+
return () => {
|
|
99
|
+
removeStylesheet();
|
|
100
|
+
disposeOfElementsEffect();
|
|
101
|
+
};
|
|
28
102
|
}
|
|
29
103
|
//# sourceMappingURL=dom-updater.js.map
|
package/dist/dom-updater.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-updater.js","sourceRoot":"","sources":["../src/dom-updater.ts"],"names":[],"mappings":"AAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"dom-updater.js","sourceRoot":"","sources":["../src/dom-updater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,yBAAyB,MAAM,wCAAwC,CAAC;AAE/E,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,IAAY,EAAE,oBAA2C;IAChG,MAAM,QAAQ,GAAG,QAAQ,IAAI,EAAE,CAAC;IAEhC,SAAS,cAAc,CAAE,eAAuB;QAC9C,OAAO,eAAe;aACnB,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;aACpC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,SAAS,aAAa,CAAE,OAAoB,EAAE,EAAU;QACtD,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAC1I,MAAM,WAAW,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;QACpD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,GAAG,eAAe,OAAO,IAAI,WAAW,EAAE,EAAE,CAAC,CAAC;QACzF,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK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