accented 0.0.0-20250404114312 → 0.0.0-20250618181418
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 +0 -207
- package/dist/accented.d.ts +2 -2
- package/dist/accented.d.ts.map +1 -1
- package/dist/accented.js +29 -23
- package/dist/accented.js.map +1 -1
- package/dist/common/tokens.d.ts +2 -0
- package/dist/common/tokens.d.ts.map +1 -0
- package/dist/common/tokens.js +2 -0
- package/dist/common/tokens.js.map +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/dom-updater.d.ts +1 -1
- package/dist/dom-updater.d.ts.map +1 -1
- package/dist/dom-updater.js +43 -16
- package/dist/dom-updater.js.map +1 -1
- package/dist/elements/accented-dialog.d.ts +13 -10
- package/dist/elements/accented-dialog.d.ts.map +1 -1
- package/dist/elements/accented-dialog.js +46 -69
- package/dist/elements/accented-dialog.js.map +1 -1
- package/dist/elements/accented-trigger.d.ts +12 -9
- package/dist/elements/accented-trigger.d.ts.map +1 -1
- package/dist/elements/accented-trigger.js +14 -15
- package/dist/elements/accented-trigger.js.map +1 -1
- package/dist/fullscreen-listener.d.ts +1 -1
- package/dist/fullscreen-listener.d.ts.map +1 -1
- package/dist/fullscreen-listener.js +3 -4
- package/dist/fullscreen-listener.js.map +1 -1
- package/dist/intersection-observer.d.ts +1 -1
- package/dist/intersection-observer.d.ts.map +1 -1
- package/dist/intersection-observer.js +12 -6
- package/dist/intersection-observer.js.map +1 -1
- package/dist/log-and-rethrow.d.ts +1 -1
- package/dist/log-and-rethrow.d.ts.map +1 -1
- package/dist/log-and-rethrow.js +2 -3
- package/dist/log-and-rethrow.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +6 -3
- package/dist/logger.js.map +1 -1
- package/dist/register-elements.d.ts +1 -1
- package/dist/register-elements.d.ts.map +1 -1
- package/dist/register-elements.js +6 -7
- package/dist/register-elements.js.map +1 -1
- package/dist/resize-listener.d.ts +1 -1
- package/dist/resize-listener.d.ts.map +1 -1
- package/dist/resize-listener.js +3 -4
- package/dist/resize-listener.js.map +1 -1
- package/dist/scanner.d.ts +2 -2
- package/dist/scanner.d.ts.map +1 -1
- package/dist/scanner.js +39 -36
- package/dist/scanner.js.map +1 -1
- package/dist/scroll-listeners.d.ts +1 -1
- package/dist/scroll-listeners.d.ts.map +1 -1
- package/dist/scroll-listeners.js +3 -4
- package/dist/scroll-listeners.js.map +1 -1
- package/dist/state.d.ts +1 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +4 -5
- package/dist/state.js.map +1 -1
- package/dist/task-queue.d.ts +4 -4
- package/dist/task-queue.d.ts.map +1 -1
- package/dist/task-queue.js +3 -2
- package/dist/task-queue.js.map +1 -1
- package/dist/types.d.ts +28 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/are-elements-with-issues-equal.d.ts +2 -2
- package/dist/utils/are-elements-with-issues-equal.d.ts.map +1 -1
- package/dist/utils/are-elements-with-issues-equal.js +3 -3
- package/dist/utils/are-elements-with-issues-equal.js.map +1 -1
- package/dist/utils/are-issue-sets-equal.d.ts +2 -2
- package/dist/utils/are-issue-sets-equal.d.ts.map +1 -1
- package/dist/utils/are-issue-sets-equal.js +3 -3
- package/dist/utils/are-issue-sets-equal.js.map +1 -1
- package/dist/utils/containing-blocks.d.ts +3 -0
- package/dist/utils/containing-blocks.d.ts.map +1 -0
- package/dist/utils/containing-blocks.js +46 -0
- package/dist/utils/containing-blocks.js.map +1 -0
- package/dist/utils/contains.d.ts +2 -0
- package/dist/utils/contains.d.ts.map +1 -0
- package/dist/utils/contains.js +19 -0
- package/dist/utils/contains.js.map +1 -0
- package/dist/utils/deduplicate-nodes.d.ts +2 -0
- package/dist/utils/deduplicate-nodes.d.ts.map +1 -0
- package/dist/utils/deduplicate-nodes.js +4 -0
- package/dist/utils/deduplicate-nodes.js.map +1 -0
- package/dist/utils/deep-merge.d.ts +1 -1
- package/dist/utils/deep-merge.d.ts.map +1 -1
- package/dist/utils/deep-merge.js +6 -5
- package/dist/utils/deep-merge.js.map +1 -1
- package/dist/utils/dom-helpers.d.ts +3 -0
- package/dist/utils/dom-helpers.d.ts.map +1 -1
- package/dist/utils/dom-helpers.js +15 -0
- package/dist/utils/dom-helpers.js.map +1 -1
- package/dist/utils/ensure-non-empty.d.ts +2 -0
- package/dist/utils/ensure-non-empty.d.ts.map +1 -0
- package/dist/utils/ensure-non-empty.js +7 -0
- package/dist/utils/ensure-non-empty.js.map +1 -0
- package/dist/utils/get-element-html.d.ts +1 -1
- package/dist/utils/get-element-html.d.ts.map +1 -1
- package/dist/utils/get-element-html.js +4 -2
- package/dist/utils/get-element-html.js.map +1 -1
- package/dist/utils/get-element-position.d.ts +10 -2
- package/dist/utils/get-element-position.d.ts.map +1 -1
- package/dist/utils/get-element-position.js +34 -23
- package/dist/utils/get-element-position.js.map +1 -1
- package/dist/utils/get-parent.d.ts +1 -1
- package/dist/utils/get-parent.d.ts.map +1 -1
- package/dist/utils/get-parent.js +1 -1
- package/dist/utils/get-parent.js.map +1 -1
- package/dist/utils/get-scan-context.d.ts +3 -0
- package/dist/utils/get-scan-context.d.ts.map +1 -0
- package/dist/utils/get-scan-context.js +28 -0
- package/dist/utils/get-scan-context.js.map +1 -0
- package/dist/utils/get-scrollable-ancestors.d.ts +1 -1
- package/dist/utils/get-scrollable-ancestors.d.ts.map +1 -1
- package/dist/utils/get-scrollable-ancestors.js +5 -5
- package/dist/utils/get-scrollable-ancestors.js.map +1 -1
- package/dist/utils/is-node-in-scan-context.d.ts +3 -0
- package/dist/utils/is-node-in-scan-context.d.ts.map +1 -0
- package/dist/utils/is-node-in-scan-context.js +26 -0
- package/dist/utils/is-node-in-scan-context.js.map +1 -0
- package/dist/utils/is-non-empty.d.ts +2 -0
- package/dist/utils/is-non-empty.d.ts.map +1 -0
- package/dist/utils/is-non-empty.js +4 -0
- package/dist/utils/is-non-empty.js.map +1 -0
- package/dist/utils/normalize-context.d.ts +3 -0
- package/dist/utils/normalize-context.d.ts.map +1 -0
- package/dist/utils/normalize-context.js +59 -0
- package/dist/utils/normalize-context.js.map +1 -0
- package/dist/utils/recalculate-positions.d.ts +1 -1
- package/dist/utils/recalculate-positions.d.ts.map +1 -1
- package/dist/utils/recalculate-positions.js +5 -5
- package/dist/utils/recalculate-positions.js.map +1 -1
- package/dist/utils/recalculate-scrollable-ancestors.d.ts +1 -1
- package/dist/utils/recalculate-scrollable-ancestors.d.ts.map +1 -1
- package/dist/utils/recalculate-scrollable-ancestors.js +4 -4
- package/dist/utils/recalculate-scrollable-ancestors.js.map +1 -1
- package/dist/utils/shadow-dom-aware-mutation-observer.d.ts +1 -1
- package/dist/utils/shadow-dom-aware-mutation-observer.d.ts.map +1 -1
- package/dist/utils/shadow-dom-aware-mutation-observer.js +19 -22
- package/dist/utils/shadow-dom-aware-mutation-observer.js.map +1 -1
- package/dist/utils/supports-anchor-positioning.d.ts +1 -1
- package/dist/utils/supports-anchor-positioning.d.ts.map +1 -1
- package/dist/utils/supports-anchor-positioning.js +1 -1
- package/dist/utils/supports-anchor-positioning.js.map +1 -1
- package/dist/utils/transform-violations.d.ts +2 -2
- package/dist/utils/transform-violations.d.ts.map +1 -1
- package/dist/utils/transform-violations.js +9 -9
- package/dist/utils/transform-violations.js.map +1 -1
- package/dist/utils/update-elements-with-issues.d.ts +11 -5
- package/dist/utils/update-elements-with-issues.d.ts.map +1 -1
- package/dist/utils/update-elements-with-issues.js +54 -26
- package/dist/utils/update-elements-with-issues.js.map +1 -1
- package/dist/validate-options.d.ts +2 -2
- package/dist/validate-options.d.ts.map +1 -1
- package/dist/validate-options.js +91 -4
- package/dist/validate-options.js.map +1 -1
- package/package.json +11 -5
- package/src/accented.test.ts +2 -2
- package/src/accented.ts +38 -28
- package/src/common/tokens.ts +1 -0
- package/src/dom-updater.ts +59 -22
- package/src/elements/accented-dialog.ts +102 -106
- package/src/elements/accented-trigger.ts +58 -48
- package/src/fullscreen-listener.ts +15 -11
- package/src/intersection-observer.ts +27 -16
- package/src/log-and-rethrow.ts +2 -3
- package/src/logger.ts +14 -4
- package/src/register-elements.ts +7 -7
- package/src/resize-listener.ts +15 -11
- package/src/scanner.ts +70 -50
- package/src/scroll-listeners.ts +27 -19
- package/src/state.ts +24 -21
- package/src/task-queue.test.ts +5 -4
- package/src/task-queue.ts +8 -6
- package/src/types.ts +74 -42
- package/src/utils/are-elements-with-issues-equal.ts +7 -5
- package/src/utils/are-issue-sets-equal.test.ts +10 -6
- package/src/utils/are-issue-sets-equal.ts +8 -6
- package/src/utils/containing-blocks.ts +60 -0
- package/src/utils/contains.test.ts +55 -0
- package/src/utils/contains.ts +19 -0
- package/src/utils/deduplicate-nodes.ts +3 -0
- package/src/utils/deep-merge.test.ts +8 -1
- package/src/utils/deep-merge.ts +11 -8
- package/src/utils/dom-helpers.ts +20 -0
- package/src/utils/ensure-non-empty.ts +6 -0
- package/src/utils/get-element-html.ts +4 -2
- package/src/utils/get-element-position.ts +51 -22
- package/src/utils/get-parent.ts +1 -1
- package/src/utils/get-scan-context.test.ts +85 -0
- package/src/utils/get-scan-context.ts +36 -0
- package/src/utils/get-scrollable-ancestors.ts +8 -5
- package/src/utils/is-node-in-scan-context.test.ts +70 -0
- package/src/utils/is-node-in-scan-context.ts +29 -0
- package/src/utils/is-non-empty.ts +3 -0
- package/src/utils/normalize-context.test.ts +105 -0
- package/src/utils/normalize-context.ts +65 -0
- package/src/utils/recalculate-positions.ts +5 -5
- package/src/utils/recalculate-scrollable-ancestors.ts +4 -4
- package/src/utils/shadow-dom-aware-mutation-observer.ts +21 -24
- package/src/utils/supports-anchor-positioning.ts +3 -3
- package/src/utils/transform-violations.test.ts +22 -20
- package/src/utils/transform-violations.ts +14 -10
- package/src/utils/update-elements-with-issues.test.ts +102 -49
- package/src/utils/update-elements-with-issues.ts +122 -58
- package/src/validate-options.ts +154 -14
package/README.md
CHANGED
|
@@ -9,210 +9,3 @@ It complements approaches to other means of continuous automated accessibility t
|
|
|
9
9
|
Accented uses the [axe-core](https://github.com/dequelabs/axe-core) testing engine.
|
|
10
10
|
|
|
11
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
|
-
* `performance`: runtime performance of the last scan. An object:
|
|
99
|
-
* `totalBlockingTime`: how long the main thread was blocked by Accented during the last scan, in milliseconds.
|
|
100
|
-
It’s further divided into the `scan` and `domUpdate` phases.
|
|
101
|
-
* `scan`: how long the `scan` phase took, in milliseconds.
|
|
102
|
-
* `domUpdate`: how long the `domUpdate` phase took, in milliseconds.
|
|
103
|
-
|
|
104
|
-
**Example:**
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
accented({
|
|
108
|
-
callback: ({ elementsWithIssues, performance }) => {
|
|
109
|
-
console.log('Elements with issues:', elementsWithIssues);
|
|
110
|
-
console.log('Total blocking time:', performance.totalBlockingTime);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
#### `name`
|
|
116
|
-
|
|
117
|
-
**Type:** string.
|
|
118
|
-
|
|
119
|
-
**Default:** `"accented"`.
|
|
120
|
-
|
|
121
|
-
The character sequence that’s used in various elements, attributes and stylesheets that Accented adds to the page.
|
|
122
|
-
|
|
123
|
-
You shouldn’t have to use this attribute unless some of the names on your page conflict with what Accented provides by default.
|
|
124
|
-
|
|
125
|
-
* The data attribute that’s added to elements with issues (default: `data-accented`).
|
|
126
|
-
* The custom elements for the button and the dialog that get created for each element with issues
|
|
127
|
-
(default: `accented-trigger`, `accented-dialog`).
|
|
128
|
-
* The CSS cascade layer containing page-wide Accented-specific styles (default: `accented`).
|
|
129
|
-
* The prefix for some of the CSS custom properties used by Accented (default: `--accented-`).
|
|
130
|
-
* The window property that’s used to prevent multiple axe-core scans from running simultaneously
|
|
131
|
-
(default: `__accented_axe_running__`).
|
|
132
|
-
|
|
133
|
-
Only lowercase alphanumeric characters and dashes (-) are allowed in the name,
|
|
134
|
-
and it must start with a lowercase letter.
|
|
135
|
-
|
|
136
|
-
**Example:**
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
accented({name: 'my-name'});
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
With the above option provided, the attribute set on elements with issues will be `data-my-name`,
|
|
143
|
-
a custom element will be called `my-name-trigger`, and so on.
|
|
144
|
-
|
|
145
|
-
#### `throttle`
|
|
146
|
-
|
|
147
|
-
An object controlling when Accented will run its scans.
|
|
148
|
-
|
|
149
|
-
#### `throttle.wait`
|
|
150
|
-
|
|
151
|
-
**Type:** number.
|
|
152
|
-
|
|
153
|
-
**Default:** 1000.
|
|
154
|
-
|
|
155
|
-
The delay (in milliseconds) after a mutation or after the last Accented scan.
|
|
156
|
-
|
|
157
|
-
If the page you’re scanning has a lot of nodes,
|
|
158
|
-
scanning may take a noticeable time (~ a few hundred milliseconds),
|
|
159
|
-
during which time the main thread will be blocked most of the time.
|
|
160
|
-
|
|
161
|
-
You may want to experiment with this value if your page contents change frequently
|
|
162
|
-
or if it has JavaScript-based animations running on the main thread.
|
|
163
|
-
|
|
164
|
-
#### `throttle.leading`
|
|
165
|
-
|
|
166
|
-
**Type:** boolean.
|
|
167
|
-
|
|
168
|
-
**Default:** `true`.
|
|
169
|
-
|
|
170
|
-
If set to true, the scan runs immediately after a mutation.
|
|
171
|
-
In this case, `wait` only applies to subsequent scans,
|
|
172
|
-
giving the page at least `wait` milliseconds between the end of the previous scan
|
|
173
|
-
and the beginning of the next one.
|
|
174
|
-
|
|
175
|
-
If set to false, the wait applies to mutations as well,
|
|
176
|
-
delaying the output.
|
|
177
|
-
This may be useful if you’re expecting bursts of mutations on your page.
|
|
178
|
-
|
|
179
|
-
### Styling
|
|
180
|
-
|
|
181
|
-
TODO: Create a separate doc with info on using `:root` and CSS layers to control some aspects of styling.
|
|
182
|
-
|
|
183
|
-
Documented CSS custom props:
|
|
184
|
-
* `--accented-primary-color`
|
|
185
|
-
* `--accented-secondary-color`
|
|
186
|
-
* `--accented-outline-width`
|
|
187
|
-
* `--accented-outline-style`
|
|
188
|
-
|
|
189
|
-
## Miscellaneous
|
|
190
|
-
|
|
191
|
-
### Shadow DOM
|
|
192
|
-
|
|
193
|
-
Highlighting elements inside shadow DOM is not supported yet, see [#25](https://github.com/pomerantsev/accented/issues/25).
|
|
194
|
-
|
|
195
|
-
### Iframes
|
|
196
|
-
|
|
197
|
-
Although axe-core is capable of scanning iframes, Accented doesn’t provide that as a special capability.
|
|
198
|
-
|
|
199
|
-
Instead, if you wish to scan the document in an iframe, initialize Accented inside the iframed document.
|
|
200
|
-
There should be no interference between the instances of Accented running in the parent and child documents.
|
|
201
|
-
|
|
202
|
-
TODO: expand this section and better explain the concepts.
|
|
203
|
-
|
|
204
|
-
## Frequently asked questions
|
|
205
|
-
|
|
206
|
-
<!-- TODO: how can this section be better formatted? This probably should be regular sections rather than a Q&A. -->
|
|
207
|
-
|
|
208
|
-
**Q:** can Accented be used in a CI (continuous integration) environment?
|
|
209
|
-
|
|
210
|
-
**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).
|
|
211
|
-
|
|
212
|
-
**Q:** does Accented affect performance?
|
|
213
|
-
|
|
214
|
-
**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.
|
|
215
|
-
* Only re-running on the changed part of the page.
|
|
216
|
-
* Throttling calls and giving the ability to tweak it.
|
|
217
|
-
* Providing the ability to select which rules to run, and which elements to run them on.
|
|
218
|
-
* TODO: explore axe-core’s internals. Can I make it yield periodically?
|
package/dist/accented.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccentedOptions, DisableAccented } from './types';
|
|
1
|
+
import type { AccentedOptions, DisableAccented } from './types.ts';
|
|
2
2
|
export type { AccentedOptions, DisableAccented };
|
|
3
3
|
/**
|
|
4
4
|
* Enables highlighting of elements with accessibility issues.
|
|
@@ -25,5 +25,5 @@ export type { AccentedOptions, DisableAccented };
|
|
|
25
25
|
* }
|
|
26
26
|
* });
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export declare function accented(options?: AccentedOptions): DisableAccented;
|
|
29
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,YAAY,CAAC;AAMnE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,eAAe,CAwFvE"}
|
package/dist/accented.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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';
|
|
9
10
|
import { enabled, extendedElementsWithIssues } from './state.js';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import supportsAnchorPositioning from './utils/supports-anchor-positioning.js';
|
|
13
|
-
import
|
|
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';
|
|
14
15
|
/**
|
|
15
16
|
* Enables highlighting of elements with accessibility issues.
|
|
16
17
|
*
|
|
@@ -36,7 +37,7 @@ import logAndRethrow from './log-and-rethrow.js';
|
|
|
36
37
|
* }
|
|
37
38
|
* });
|
|
38
39
|
*/
|
|
39
|
-
export
|
|
40
|
+
export function accented(options = {}) {
|
|
40
41
|
validateOptions(options);
|
|
41
42
|
try {
|
|
42
43
|
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
@@ -45,11 +46,11 @@ export default function accented(options = {}) {
|
|
|
45
46
|
return () => { };
|
|
46
47
|
}
|
|
47
48
|
const defaultOutput = {
|
|
48
|
-
console: true
|
|
49
|
+
console: true,
|
|
49
50
|
};
|
|
50
51
|
const defaultThrottle = {
|
|
51
52
|
wait: 1000,
|
|
52
|
-
leading: true
|
|
53
|
+
leading: true,
|
|
53
54
|
};
|
|
54
55
|
// IMPORTANT: when changing any of the properties or values, also do the following:
|
|
55
56
|
// * update the default value in the type documentation accordingly;
|
|
@@ -57,14 +58,14 @@ export default function accented(options = {}) {
|
|
|
57
58
|
// * update examples in the accented() function JSDoc;
|
|
58
59
|
// * update examples in the Readme.
|
|
59
60
|
const defaultOptions = {
|
|
60
|
-
|
|
61
|
+
context: document,
|
|
61
62
|
axeOptions: {},
|
|
62
63
|
name: 'accented',
|
|
63
64
|
output: defaultOutput,
|
|
64
65
|
throttle: defaultThrottle,
|
|
65
|
-
callback: () => { }
|
|
66
|
+
callback: () => { },
|
|
66
67
|
};
|
|
67
|
-
const {
|
|
68
|
+
const { context, axeOptions, name, output, throttle, callback } = deepMerge(defaultOptions, options);
|
|
68
69
|
if (enabled.value) {
|
|
69
70
|
// Add link to the recipes section of the docs (#56).
|
|
70
71
|
console.warn('You are trying to run the Accented library more than once. ' +
|
|
@@ -72,14 +73,19 @@ export default function accented(options = {}) {
|
|
|
72
73
|
console.trace();
|
|
73
74
|
}
|
|
74
75
|
enabled.value = true;
|
|
76
|
+
initializeContainingBlockSupportSet();
|
|
75
77
|
registerElements(name);
|
|
76
|
-
const { disconnect: cleanupIntersectionObserver, intersectionObserver } =
|
|
77
|
-
const cleanupScanner = createScanner(name,
|
|
78
|
+
const { disconnect: cleanupIntersectionObserver, intersectionObserver } = setupIntersectionObserver();
|
|
79
|
+
const cleanupScanner = createScanner(name, context, axeOptions, throttle, callback);
|
|
78
80
|
const cleanupDomUpdater = createDomUpdater(name, intersectionObserver);
|
|
79
81
|
const cleanupLogger = output.console ? createLogger() : () => { };
|
|
80
|
-
const cleanupScrollListeners =
|
|
81
|
-
const cleanupResizeListener = supportsAnchorPositioning(window)
|
|
82
|
-
|
|
82
|
+
const cleanupScrollListeners = setupScrollListeners();
|
|
83
|
+
const cleanupResizeListener = supportsAnchorPositioning(window)
|
|
84
|
+
? () => { }
|
|
85
|
+
: setupResizeListener();
|
|
86
|
+
const cleanupFullscreenListener = supportsAnchorPositioning(window)
|
|
87
|
+
? () => { }
|
|
88
|
+
: setupFullscreenListener();
|
|
83
89
|
return () => {
|
|
84
90
|
try {
|
|
85
91
|
enabled.value = false;
|
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":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EA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,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 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/common/tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/common/tokens.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC"}
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -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;AAC1E,eAAO,MAAM,uBAAuB,
|
|
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;AAC1E,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,aAA0C,CAAC"}
|
package/dist/dom-updater.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
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":"
|
|
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"}
|
package/dist/dom-updater.js
CHANGED
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
import { effect } from '@preact/signals-core';
|
|
2
|
+
import { primaryColor } from './common/tokens.js';
|
|
2
3
|
import { extendedElementsWithIssues, rootNodes } from './state.js';
|
|
3
|
-
import areElementsWithIssuesEqual from './utils/are-elements-with-issues-equal.js';
|
|
4
|
-
import supportsAnchorPositioning from './utils/supports-anchor-positioning.js';
|
|
4
|
+
import { areElementsWithIssuesEqual } from './utils/are-elements-with-issues-equal.js';
|
|
5
5
|
import { isDocument, isDocumentFragment, isShadowRoot } from './utils/dom-helpers.js';
|
|
6
|
-
import getParent from './utils/get-parent.js';
|
|
7
|
-
|
|
6
|
+
import { getParent } from './utils/get-parent.js';
|
|
7
|
+
import { supportsAnchorPositioning } from './utils/supports-anchor-positioning.js';
|
|
8
|
+
const shouldInsertTriggerInsideElement = (element) => {
|
|
9
|
+
/**
|
|
10
|
+
* No parent means that the element is a root node,
|
|
11
|
+
* which cannot have siblings.
|
|
12
|
+
*/
|
|
13
|
+
const noParent = !getParent(element);
|
|
14
|
+
/**
|
|
15
|
+
* Table cells get a special treatment because if a sibling to a TH or TD is inserted,
|
|
16
|
+
* it alters the table layout, no matter how that sibling is positioned.
|
|
17
|
+
* We don't want tables to look broken, so we're inserting the trigger inside the table cell.
|
|
18
|
+
*/
|
|
19
|
+
const isTableCell = element.nodeName === 'TH' || element.nodeName === 'TD';
|
|
20
|
+
/**
|
|
21
|
+
* We want to put the trigger inside the <summary> element,
|
|
22
|
+
* because otherwise it will be hidden by the browser when the <details> element is collapsed
|
|
23
|
+
* (since none of the siblings of <summary> are visible then).
|
|
24
|
+
*/
|
|
25
|
+
const isSummary = element.nodeName === 'SUMMARY';
|
|
26
|
+
return noParent || isTableCell || isSummary;
|
|
27
|
+
};
|
|
28
|
+
export function createDomUpdater(name, intersectionObserver) {
|
|
8
29
|
const attrName = `data-${name}`;
|
|
9
30
|
function getAnchorNames(anchorNameValue) {
|
|
10
31
|
return anchorNameValue
|
|
11
32
|
.split(',')
|
|
12
|
-
.map(anchorName => anchorName.trim())
|
|
13
|
-
.filter(anchorName => anchorName.startsWith('--'));
|
|
33
|
+
.map((anchorName) => anchorName.trim())
|
|
34
|
+
.filter((anchorName) => anchorName.startsWith('--'));
|
|
14
35
|
}
|
|
15
36
|
function setAnchorName(elementWithIssues) {
|
|
16
37
|
const { element, id, anchorNameValue } = elementWithIssues;
|
|
@@ -34,15 +55,18 @@ export default function createDomUpdater(name, intersectionObserver) {
|
|
|
34
55
|
}
|
|
35
56
|
function setIssues(extendedElementsWithIssues) {
|
|
36
57
|
for (const elementWithIssues of extendedElementsWithIssues) {
|
|
58
|
+
if (elementWithIssues.skipRender) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
37
61
|
elementWithIssues.element.setAttribute(attrName, elementWithIssues.id.toString());
|
|
38
62
|
if (supportsAnchorPositioning(window)) {
|
|
39
63
|
setAnchorName(elementWithIssues);
|
|
40
64
|
}
|
|
41
|
-
if (
|
|
42
|
-
elementWithIssues.element.insertAdjacentElement('
|
|
65
|
+
if (shouldInsertTriggerInsideElement(elementWithIssues.element)) {
|
|
66
|
+
elementWithIssues.element.insertAdjacentElement('beforeend', elementWithIssues.trigger);
|
|
43
67
|
}
|
|
44
68
|
else {
|
|
45
|
-
elementWithIssues.element.insertAdjacentElement('
|
|
69
|
+
elementWithIssues.element.insertAdjacentElement('afterend', elementWithIssues.trigger);
|
|
46
70
|
}
|
|
47
71
|
if (intersectionObserver) {
|
|
48
72
|
intersectionObserver.observe(elementWithIssues.element);
|
|
@@ -51,6 +75,9 @@ export default function createDomUpdater(name, intersectionObserver) {
|
|
|
51
75
|
}
|
|
52
76
|
function removeIssues(extendedElementsWithIssues) {
|
|
53
77
|
for (const elementWithIssues of extendedElementsWithIssues) {
|
|
78
|
+
if (elementWithIssues.skipRender) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
54
81
|
elementWithIssues.element.removeAttribute(attrName);
|
|
55
82
|
if (supportsAnchorPositioning(window)) {
|
|
56
83
|
removeAnchorName(elementWithIssues);
|
|
@@ -67,7 +94,7 @@ export default function createDomUpdater(name, intersectionObserver) {
|
|
|
67
94
|
:root {
|
|
68
95
|
/* Ensure that the primary / secondary color combination meets WCAG 1.4.3 Contrast (Minimum) */
|
|
69
96
|
/* OKLCH stuff: https://oklch.com/ */
|
|
70
|
-
--${name}-primary-color:
|
|
97
|
+
--${name}-primary-color: ${primaryColor};
|
|
71
98
|
--${name}-secondary-color: oklch(0.98 0 0);
|
|
72
99
|
--${name}-outline-width: 2px;
|
|
73
100
|
--${name}-outline-style: solid;
|
|
@@ -85,8 +112,8 @@ export default function createDomUpdater(name, intersectionObserver) {
|
|
|
85
112
|
let previousRootNodes = new Set();
|
|
86
113
|
const disposeOfStyleSheetsEffect = effect(() => {
|
|
87
114
|
const newRootNodes = rootNodes.value;
|
|
88
|
-
const addedRootNodes = [...newRootNodes].filter(rootNode => !previousRootNodes.has(rootNode));
|
|
89
|
-
const removedRootNodes = [...previousRootNodes].filter(rootNode => !newRootNodes.has(rootNode));
|
|
115
|
+
const addedRootNodes = [...newRootNodes].filter((rootNode) => !previousRootNodes.has(rootNode));
|
|
116
|
+
const removedRootNodes = [...previousRootNodes].filter((rootNode) => !newRootNodes.has(rootNode));
|
|
90
117
|
for (const rootNode of addedRootNodes) {
|
|
91
118
|
if (isDocument(rootNode) || (isDocumentFragment(rootNode) && isShadowRoot(rootNode))) {
|
|
92
119
|
rootNode.adoptedStyleSheets.push(stylesheet);
|
|
@@ -100,11 +127,11 @@ export default function createDomUpdater(name, intersectionObserver) {
|
|
|
100
127
|
previousRootNodes = newRootNodes;
|
|
101
128
|
});
|
|
102
129
|
const disposeOfElementsEffect = effect(() => {
|
|
103
|
-
const added = extendedElementsWithIssues.value.filter(elementWithIssues => {
|
|
104
|
-
return !previousExtendedElementsWithIssues.some(previousElementWithIssues => areElementsWithIssuesEqual(previousElementWithIssues, elementWithIssues));
|
|
130
|
+
const added = extendedElementsWithIssues.value.filter((elementWithIssues) => {
|
|
131
|
+
return !previousExtendedElementsWithIssues.some((previousElementWithIssues) => areElementsWithIssuesEqual(previousElementWithIssues, elementWithIssues));
|
|
105
132
|
});
|
|
106
|
-
const removed = previousExtendedElementsWithIssues.filter(previousElementWithIssues => {
|
|
107
|
-
return !extendedElementsWithIssues.value.some(elementWithIssues => areElementsWithIssuesEqual(elementWithIssues, previousElementWithIssues));
|
|
133
|
+
const removed = previousExtendedElementsWithIssues.filter((previousElementWithIssues) => {
|
|
134
|
+
return !extendedElementsWithIssues.value.some((elementWithIssues) => areElementsWithIssuesEqual(elementWithIssues, previousElementWithIssues));
|
|
108
135
|
});
|
|
109
136
|
removeIssues(removed);
|
|
110
137
|
setIssues(added);
|
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,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEnE,OAAO,0BAA0B,MAAM,2CAA2C,CAAC;
|
|
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,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA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,GAAG,kCAAkC,CAAC,MAAM,CAAC,CAAC,yBAAyB,EAAE,EAAE;YACtF,OAAO,CAAC,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAClE,0BAA0B,CAAC,iBAAiB,EAAE,yBAAyB,CAAC,CACzE,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,kCAAkC,GAAG,CAAC,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,EAAE;QACV,0BAA0B,EAAE,CAAC;QAC7B,uBAAuB,EAAE,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { Issue } from '../types';
|
|
2
1
|
import type { Signal } from '@preact/signals-core';
|
|
2
|
+
import type { Issue } from '../types.ts';
|
|
3
3
|
export interface AccentedDialog extends HTMLElement {
|
|
4
4
|
issues: Signal<Array<Issue>> | undefined;
|
|
5
5
|
element: Element | undefined;
|
|
6
6
|
showModal: () => void;
|
|
7
|
+
open: boolean;
|
|
7
8
|
}
|
|
8
|
-
declare const
|
|
9
|
+
export declare const getAccentedDialog: () => {
|
|
9
10
|
new (): {
|
|
10
|
-
"__#1@#disposeOfEffect": (() => void) | undefined;
|
|
11
11
|
"__#1@#abortController": AbortController | undefined;
|
|
12
12
|
issues: Signal<Array<Issue>> | undefined;
|
|
13
13
|
element: Element | undefined;
|
|
14
|
-
|
|
14
|
+
open: boolean;
|
|
15
15
|
connectedCallback(): void;
|
|
16
16
|
disconnectedCallback(): void;
|
|
17
17
|
showModal(): void;
|
|
@@ -40,13 +40,14 @@ declare const _default: () => {
|
|
|
40
40
|
click(): void;
|
|
41
41
|
hidePopover(): void;
|
|
42
42
|
showPopover(): void;
|
|
43
|
-
togglePopover(
|
|
43
|
+
togglePopover(options?: boolean): boolean;
|
|
44
44
|
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
45
45
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
46
46
|
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
47
47
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
48
48
|
readonly attributes: NamedNodeMap;
|
|
49
|
-
|
|
49
|
+
get classList(): DOMTokenList;
|
|
50
|
+
set classList(value: string);
|
|
50
51
|
className: string;
|
|
51
52
|
readonly clientHeight: number;
|
|
52
53
|
readonly clientLeft: number;
|
|
@@ -61,7 +62,8 @@ declare const _default: () => {
|
|
|
61
62
|
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
|
|
62
63
|
outerHTML: string;
|
|
63
64
|
readonly ownerDocument: Document;
|
|
64
|
-
|
|
65
|
+
get part(): DOMTokenList;
|
|
66
|
+
set part(value: string);
|
|
65
67
|
readonly prefix: string | null;
|
|
66
68
|
readonly scrollHeight: number;
|
|
67
69
|
scrollLeft: number;
|
|
@@ -138,7 +140,7 @@ declare const _default: () => {
|
|
|
138
140
|
readonly previousSibling: ChildNode | null;
|
|
139
141
|
textContent: string | null;
|
|
140
142
|
appendChild<T extends Node>(node: T): T;
|
|
141
|
-
cloneNode(
|
|
143
|
+
cloneNode(subtree?: boolean): Node;
|
|
142
144
|
compareDocumentPosition(other: Node): number;
|
|
143
145
|
contains(other: Node | null): boolean;
|
|
144
146
|
getRootNode(options?: GetRootNodeOptions): Node;
|
|
@@ -200,6 +202,7 @@ declare const _default: () => {
|
|
|
200
202
|
ariaPosInSet: string | null;
|
|
201
203
|
ariaPressed: string | null;
|
|
202
204
|
ariaReadOnly: string | null;
|
|
205
|
+
ariaRelevant: string | null;
|
|
203
206
|
ariaRequired: string | null;
|
|
204
207
|
ariaRoleDescription: string | null;
|
|
205
208
|
ariaRowCount: string | null;
|
|
@@ -241,7 +244,8 @@ declare const _default: () => {
|
|
|
241
244
|
replaceChildren(...nodes: (Node | string)[]): void;
|
|
242
245
|
readonly assignedSlot: HTMLSlotElement | null;
|
|
243
246
|
readonly attributeStyleMap: StylePropertyMap;
|
|
244
|
-
|
|
247
|
+
get style(): CSSStyleDeclaration;
|
|
248
|
+
set style(cssText: string);
|
|
245
249
|
contentEditable: string;
|
|
246
250
|
enterKeyHint: string;
|
|
247
251
|
inputMode: string;
|
|
@@ -352,5 +356,4 @@ declare const _default: () => {
|
|
|
352
356
|
focus(options?: FocusOptions): void;
|
|
353
357
|
};
|
|
354
358
|
};
|
|
355
|
-
export default _default;
|
|
356
359
|
//# sourceMappingURL=accented-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accented-dialog.d.ts","sourceRoot":"","sources":["../../src/elements/accented-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"accented-dialog.d.ts","sourceRoot":"","sources":["../../src/elements/accented-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC;IACzC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;CACf;AAID,eAAO,MAAM,iBAAiB;;iCAoOR,eAAe,GAAG,SAAS;gBAErC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,SAAS;iBAE/B,OAAO,GAAG,SAAS;;;;;qCAqJN,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBnC,CAAC"}
|