axe-core 4.12.1 → 4.13.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.
- package/README.md +10 -7
- package/axe.d.ts +4 -15
- package/axe.js +4011 -3559
- package/axe.min.js +2 -2
- package/gather-internals.js +1 -1
- package/locales/README.md +2 -2
- package/locales/_template.json +15 -5
- package/locales/sv.json +1147 -0
- package/package.json +65 -73
- package/sri-history.json +4 -0
package/README.md
CHANGED
|
@@ -28,6 +28,12 @@ First download the package:
|
|
|
28
28
|
npm install axe-core --save-dev
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
Or, using pnpm:
|
|
32
|
+
|
|
33
|
+
```console
|
|
34
|
+
pnpm add --save-dev axe-core
|
|
35
|
+
```
|
|
36
|
+
|
|
31
37
|
Now include the javascript file in each of your iframes in your fixtures or test systems:
|
|
32
38
|
|
|
33
39
|
```html
|
|
@@ -95,17 +101,13 @@ The [axe-core API](doc/API.md) package consists of:
|
|
|
95
101
|
|
|
96
102
|
Axe can be built using your local language. To do so, a localization file must be added to the `./locales` directory. This file must be named in the following manner: `<langcode>.json`. To build axe using this locale, instead of the default, run axe with the `--lang` flag, like so:
|
|
97
103
|
|
|
98
|
-
`
|
|
99
|
-
|
|
100
|
-
or equivalently:
|
|
101
|
-
|
|
102
|
-
`npm run build -- --lang=nl`
|
|
104
|
+
`pnpm run build -- --lang=nl`
|
|
103
105
|
|
|
104
106
|
This will create a new build for axe, called `axe.<lang>.js` and `axe.<lang>.min.js`. If you want to build all localized versions, simply pass in `--all-lang` instead. If you want to build multiple localized versions (but not all of them), you can pass in a comma-separated list of languages to the `--lang` flag, like `--lang=nl,ja`.
|
|
105
107
|
|
|
106
|
-
To create a new translation for axe, start by running `
|
|
108
|
+
To create a new translation for axe, start by running `pnpm run translate -- --lang=<langcode>`. This will create a json file in the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/doc/check-message-template.md).
|
|
107
109
|
|
|
108
|
-
To update an existing translation file, re-run `
|
|
110
|
+
To update an existing translation file, re-run `pnpm run translate -- --lang=<langcode>`. This will add new messages used in English and remove messages which were not used in English.
|
|
109
111
|
|
|
110
112
|
Additionally, locale can be applied at runtime by passing a `locale` object to `axe.configure()`. The locale object must be of the same shape as existing locales in the `./locales` directory. For example:
|
|
111
113
|
|
|
@@ -153,6 +155,7 @@ Axe-core supports the following locales. Do note that since locales are contribu
|
|
|
153
155
|
- Polish
|
|
154
156
|
- Portuguese (Brazilian)
|
|
155
157
|
- Spanish
|
|
158
|
+
- Swedish
|
|
156
159
|
|
|
157
160
|
## Updates & Security
|
|
158
161
|
|
package/axe.d.ts
CHANGED
|
@@ -37,12 +37,7 @@ declare namespace axe {
|
|
|
37
37
|
| 'sectionhead';
|
|
38
38
|
|
|
39
39
|
type HtmlContentTypes =
|
|
40
|
-
| '
|
|
41
|
-
| 'sectioning'
|
|
42
|
-
| 'heading'
|
|
43
|
-
| 'phrasing'
|
|
44
|
-
| 'embedded'
|
|
45
|
-
| 'interactive';
|
|
40
|
+
'flow' | 'sectioning' | 'heading' | 'phrasing' | 'embedded' | 'interactive';
|
|
46
41
|
|
|
47
42
|
// Array of length 2 or greater
|
|
48
43
|
type MultiArray<T> = [T, T, ...T[]];
|
|
@@ -65,10 +60,7 @@ declare namespace axe {
|
|
|
65
60
|
|
|
66
61
|
// Context options
|
|
67
62
|
type Selector =
|
|
68
|
-
|
|
|
69
|
-
| BaseSelector
|
|
70
|
-
| LabelledShadowDomSelector
|
|
71
|
-
| LabelledFramesSelector;
|
|
63
|
+
Node | BaseSelector | LabelledShadowDomSelector | LabelledFramesSelector;
|
|
72
64
|
type SelectorList = Array<Selector | FramesSelector> | NodeList;
|
|
73
65
|
type ContextProp = Selector | SelectorList;
|
|
74
66
|
type ContextObject =
|
|
@@ -85,9 +77,7 @@ declare namespace axe {
|
|
|
85
77
|
type ElementContext = ContextSpec;
|
|
86
78
|
|
|
87
79
|
type SerialSelector =
|
|
88
|
-
|
|
|
89
|
-
| LabelledShadowDomSelector
|
|
90
|
-
| LabelledFramesSelector;
|
|
80
|
+
BaseSelector | LabelledShadowDomSelector | LabelledFramesSelector;
|
|
91
81
|
type SerialFrameSelector = SerialSelector | FramesSelector;
|
|
92
82
|
type SerialSelectorList = Array<SerialFrameSelector>;
|
|
93
83
|
|
|
@@ -310,8 +300,7 @@ declare namespace axe {
|
|
|
310
300
|
virtualNode: VirtualNode
|
|
311
301
|
) => boolean | undefined | void);
|
|
312
302
|
after?:
|
|
313
|
-
|
|
|
314
|
-
| ((results: AfterResult[], options: unknown) => AfterResult[]);
|
|
303
|
+
string | ((results: AfterResult[], options: unknown) => AfterResult[]);
|
|
315
304
|
options?: any;
|
|
316
305
|
matches?: string;
|
|
317
306
|
enabled?: boolean;
|