@wordpress/a11y 4.32.0 → 4.32.1-next.b8c8708f3.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/build/index.js +50 -37
- package/build/index.js.map +7 -1
- package/build/module/index.js +30 -22
- package/build/module/index.js.map +7 -1
- package/build/script/add-container.js +33 -22
- package/build/script/add-container.js.map +7 -1
- package/build/script/add-intro-text.js +33 -27
- package/build/script/add-intro-text.js.map +7 -1
- package/build/shared/clear.js +26 -14
- package/build/shared/clear.js.map +7 -1
- package/build/shared/filter-message.js +25 -28
- package/build/shared/filter-message.js.map +7 -1
- package/build/shared/index.js +47 -46
- package/build/shared/index.js.map +7 -1
- package/build-module/index.js +17 -26
- package/build-module/index.js.map +7 -1
- package/build-module/module/index.js +8 -12
- package/build-module/module/index.js.map +7 -1
- package/build-module/script/add-container.js +15 -18
- package/build-module/script/add-container.js.map +7 -1
- package/build-module/script/add-intro-text.js +16 -24
- package/build-module/script/add-intro-text.js.map +7 -1
- package/build-module/shared/clear.js +9 -11
- package/build-module/shared/clear.js.map +7 -1
- package/build-module/shared/filter-message.js +8 -25
- package/build-module/shared/filter-message.js.map +7 -1
- package/build-module/shared/index.js +14 -40
- package/build-module/shared/index.js.map +7 -1
- package/package.json +12 -5
- package/build/index.native.js +0 -24
- package/build/index.native.js.map +0 -1
- package/build-module/index.native.js +0 -17
- package/build-module/index.native.js.map +0 -1
package/build/index.js
CHANGED
|
@@ -1,48 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
17
|
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var index_exports = {};
|
|
30
|
+
__export(index_exports, {
|
|
31
|
+
setup: () => setup,
|
|
32
|
+
speak: () => import_shared.speak
|
|
13
33
|
});
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
* WordPress dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Internal dependencies
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Create the live regions.
|
|
28
|
-
*/
|
|
34
|
+
module.exports = __toCommonJS(index_exports);
|
|
35
|
+
var import_dom_ready = __toESM(require("@wordpress/dom-ready"));
|
|
36
|
+
var import_add_container = __toESM(require("./script/add-container"));
|
|
37
|
+
var import_add_intro_text = __toESM(require("./script/add-intro-text"));
|
|
38
|
+
var import_shared = require("./shared/index");
|
|
29
39
|
function setup() {
|
|
30
|
-
const introText = document.getElementById(
|
|
31
|
-
const containerAssertive = document.getElementById(
|
|
32
|
-
|
|
40
|
+
const introText = document.getElementById("a11y-speak-intro-text");
|
|
41
|
+
const containerAssertive = document.getElementById(
|
|
42
|
+
"a11y-speak-assertive"
|
|
43
|
+
);
|
|
44
|
+
const containerPolite = document.getElementById("a11y-speak-polite");
|
|
33
45
|
if (introText === null) {
|
|
34
|
-
(0,
|
|
46
|
+
(0, import_add_intro_text.default)();
|
|
35
47
|
}
|
|
36
48
|
if (containerAssertive === null) {
|
|
37
|
-
(0,
|
|
49
|
+
(0, import_add_container.default)("assertive");
|
|
38
50
|
}
|
|
39
51
|
if (containerPolite === null) {
|
|
40
|
-
(0,
|
|
52
|
+
(0, import_add_container.default)("polite");
|
|
41
53
|
}
|
|
42
54
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
(0, import_dom_ready.default)(setup);
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
setup,
|
|
59
|
+
speak
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport domReady from '@wordpress/dom-ready';\n\n/**\n * Internal dependencies\n */\nimport addContainer from './script/add-container';\nimport addIntroText from './script/add-intro-text';\n\nexport { speak } from './shared/index';\n\n/**\n * Create the live regions.\n */\nexport function setup() {\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\tconst containerAssertive = document.getElementById(\n\t\t'a11y-speak-assertive'\n\t);\n\tconst containerPolite = document.getElementById( 'a11y-speak-polite' );\n\n\tif ( introText === null ) {\n\t\taddIntroText();\n\t}\n\n\tif ( containerAssertive === null ) {\n\t\taddContainer( 'assertive' );\n\t}\n\n\tif ( containerPolite === null ) {\n\t\taddContainer( 'polite' );\n\t}\n}\n\n/**\n * Run setup on domReady.\n */\ndomReady( setup );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAqB;AAKrB,2BAAyB;AACzB,4BAAyB;AAEzB,oBAAsB;AAKf,SAAS,QAAQ;AACvB,QAAM,YAAY,SAAS,eAAgB,uBAAwB;AACnE,QAAM,qBAAqB,SAAS;AAAA,IACnC;AAAA,EACD;AACA,QAAM,kBAAkB,SAAS,eAAgB,mBAAoB;AAErE,MAAK,cAAc,MAAO;AACzB,8BAAAA,SAAa;AAAA,EACd;AAEA,MAAK,uBAAuB,MAAO;AAClC,6BAAAC,SAAc,WAAY;AAAA,EAC3B;AAEA,MAAK,oBAAoB,MAAO;AAC/B,6BAAAA,SAAc,QAAS;AAAA,EACxB;AACD;AAAA,IAKA,iBAAAC,SAAU,KAAM;",
|
|
6
|
+
"names": ["addIntroText", "addContainer", "domReady"]
|
|
7
|
+
}
|
package/build/module/index.js
CHANGED
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
15
|
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var module_exports = {};
|
|
20
|
+
__export(module_exports, {
|
|
21
|
+
setup: () => setup,
|
|
22
|
+
speak: () => import_shared.speak
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(module_exports);
|
|
25
|
+
var import_shared = require("../shared/index");
|
|
26
|
+
const setup = () => {
|
|
27
|
+
};
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
setup,
|
|
31
|
+
speak
|
|
12
32
|
});
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* This no-op function is exported to provide compatibility with the `wp-a11y` Script.
|
|
20
|
-
*
|
|
21
|
-
* Filters should inject the relevant HTML on page load instead of requiring setup.
|
|
22
|
-
*/
|
|
23
|
-
const setup = () => {};
|
|
24
|
-
exports.setup = setup;
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/module/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nexport { speak } from '../shared/index';\n\n/**\n * This no-op function is exported to provide compatibility with the `wp-a11y` Script.\n *\n * Filters should inject the relevant HTML on page load instead of requiring setup.\n */\nexport const setup = () => {};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAsB;AAOf,MAAM,QAAQ,MAAM;AAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,30 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var add_container_exports = {};
|
|
20
|
+
__export(add_container_exports, {
|
|
21
|
+
default: () => addContainer
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
* @param {'polite'|'assertive'} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
|
|
11
|
-
*
|
|
12
|
-
* @return {HTMLDivElement} The ARIA live region HTML element.
|
|
13
|
-
*/
|
|
14
|
-
function addContainer(ariaLive = 'polite') {
|
|
15
|
-
const container = document.createElement('div');
|
|
23
|
+
module.exports = __toCommonJS(add_container_exports);
|
|
24
|
+
function addContainer(ariaLive = "polite") {
|
|
25
|
+
const container = document.createElement("div");
|
|
16
26
|
container.id = `a11y-speak-${ariaLive}`;
|
|
17
|
-
container.className =
|
|
18
|
-
container.setAttribute(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
container.className = "a11y-speak-region";
|
|
28
|
+
container.setAttribute(
|
|
29
|
+
"style",
|
|
30
|
+
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
|
31
|
+
);
|
|
32
|
+
container.setAttribute("aria-live", ariaLive);
|
|
33
|
+
container.setAttribute("aria-relevant", "additions text");
|
|
34
|
+
container.setAttribute("aria-atomic", "true");
|
|
35
|
+
const { body } = document;
|
|
25
36
|
if (body) {
|
|
26
37
|
body.appendChild(container);
|
|
27
38
|
}
|
|
28
39
|
return container;
|
|
29
40
|
}
|
|
30
|
-
//# sourceMappingURL=add-container.js.map
|
|
41
|
+
//# sourceMappingURL=add-container.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/script/add-container.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Build the live regions markup.\n *\n * @param {'polite'|'assertive'} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.\n *\n * @return {HTMLDivElement} The ARIA live region HTML element.\n */\nexport default function addContainer( ariaLive = 'polite' ) {\n\tconst container = document.createElement( 'div' );\n\tcontainer.id = `a11y-speak-${ ariaLive }`;\n\tcontainer.className = 'a11y-speak-region';\n\n\tcontainer.setAttribute(\n\t\t'style',\n\t\t'position:absolute;' +\n\t\t\t'margin:-1px;' +\n\t\t\t'padding:0;' +\n\t\t\t'height:1px;' +\n\t\t\t'width:1px;' +\n\t\t\t'overflow:hidden;' +\n\t\t\t'clip-path:inset(50%);' +\n\t\t\t'border:0;' +\n\t\t\t'word-wrap:normal !important;'\n\t);\n\tcontainer.setAttribute( 'aria-live', ariaLive );\n\tcontainer.setAttribute( 'aria-relevant', 'additions text' );\n\tcontainer.setAttribute( 'aria-atomic', 'true' );\n\n\tconst { body } = document;\n\tif ( body ) {\n\t\tbody.appendChild( container );\n\t}\n\n\treturn container;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOe,SAAR,aAA+B,WAAW,UAAW;AAC3D,QAAM,YAAY,SAAS,cAAe,KAAM;AAChD,YAAU,KAAK,cAAe,QAAS;AACvC,YAAU,YAAY;AAEtB,YAAU;AAAA,IACT;AAAA,IACA;AAAA,EASD;AACA,YAAU,aAAc,aAAa,QAAS;AAC9C,YAAU,aAAc,iBAAiB,gBAAiB;AAC1D,YAAU,aAAc,eAAe,MAAO;AAE9C,QAAM,EAAE,KAAK,IAAI;AACjB,MAAK,MAAO;AACX,SAAK,YAAa,SAAU;AAAA,EAC7B;AAEA,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,35 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var add_intro_text_exports = {};
|
|
20
|
+
__export(add_intro_text_exports, {
|
|
21
|
+
default: () => addIntroText
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Build the explanatory text to be placed before the aria live regions.
|
|
14
|
-
*
|
|
15
|
-
* This text is initially hidden from assistive technologies by using a `hidden`
|
|
16
|
-
* HTML attribute which is then removed once a message fills the aria-live regions.
|
|
17
|
-
*
|
|
18
|
-
* @return {HTMLParagraphElement} The explanatory text HTML element.
|
|
19
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(add_intro_text_exports);
|
|
24
|
+
var import_i18n = require("@wordpress/i18n");
|
|
20
25
|
function addIntroText() {
|
|
21
|
-
const introText = document.createElement(
|
|
22
|
-
introText.id =
|
|
23
|
-
introText.className =
|
|
24
|
-
introText.textContent = (0,
|
|
25
|
-
introText.setAttribute(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const introText = document.createElement("p");
|
|
27
|
+
introText.id = "a11y-speak-intro-text";
|
|
28
|
+
introText.className = "a11y-speak-intro-text";
|
|
29
|
+
introText.textContent = (0, import_i18n.__)("Notifications");
|
|
30
|
+
introText.setAttribute(
|
|
31
|
+
"style",
|
|
32
|
+
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
|
33
|
+
);
|
|
34
|
+
introText.setAttribute("hidden", "");
|
|
35
|
+
const { body } = document;
|
|
30
36
|
if (body) {
|
|
31
37
|
body.appendChild(introText);
|
|
32
38
|
}
|
|
33
39
|
return introText;
|
|
34
40
|
}
|
|
35
|
-
//# sourceMappingURL=add-intro-text.js.map
|
|
41
|
+
//# sourceMappingURL=add-intro-text.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/script/add-intro-text.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Build the explanatory text to be placed before the aria live regions.\n *\n * This text is initially hidden from assistive technologies by using a `hidden`\n * HTML attribute which is then removed once a message fills the aria-live regions.\n *\n * @return {HTMLParagraphElement} The explanatory text HTML element.\n */\nexport default function addIntroText() {\n\tconst introText = document.createElement( 'p' );\n\n\tintroText.id = 'a11y-speak-intro-text';\n\tintroText.className = 'a11y-speak-intro-text';\n\tintroText.textContent = __( 'Notifications' );\n\n\tintroText.setAttribute(\n\t\t'style',\n\t\t'position:absolute;' +\n\t\t\t'margin:-1px;' +\n\t\t\t'padding:0;' +\n\t\t\t'height:1px;' +\n\t\t\t'width:1px;' +\n\t\t\t'overflow:hidden;' +\n\t\t\t'clip-path:inset(50%);' +\n\t\t\t'border:0;' +\n\t\t\t'word-wrap:normal !important;'\n\t);\n\tintroText.setAttribute( 'hidden', '' );\n\n\tconst { body } = document;\n\tif ( body ) {\n\t\tbody.appendChild( introText );\n\t}\n\n\treturn introText;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAUJ,SAAR,eAAgC;AACtC,QAAM,YAAY,SAAS,cAAe,GAAI;AAE9C,YAAU,KAAK;AACf,YAAU,YAAY;AACtB,YAAU,kBAAc,gBAAI,eAAgB;AAE5C,YAAU;AAAA,IACT;AAAA,IACA;AAAA,EASD;AACA,YAAU,aAAc,UAAU,EAAG;AAErC,QAAM,EAAE,KAAK,IAAI;AACjB,MAAK,MAAO;AACX,SAAK,YAAa,SAAU;AAAA,EAC7B;AAEA,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/shared/clear.js
CHANGED
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var clear_exports = {};
|
|
20
|
+
__export(clear_exports, {
|
|
21
|
+
default: () => clear
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
/**
|
|
8
|
-
* Clears the a11y-speak-region elements and hides the explanatory text.
|
|
9
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(clear_exports);
|
|
10
24
|
function clear() {
|
|
11
|
-
const regions = document.getElementsByClassName(
|
|
12
|
-
const introText = document.getElementById(
|
|
25
|
+
const regions = document.getElementsByClassName("a11y-speak-region");
|
|
26
|
+
const introText = document.getElementById("a11y-speak-intro-text");
|
|
13
27
|
for (let i = 0; i < regions.length; i++) {
|
|
14
|
-
regions[i].textContent =
|
|
28
|
+
regions[i].textContent = "";
|
|
15
29
|
}
|
|
16
|
-
|
|
17
|
-
// Make sure the explanatory text is hidden from assistive technologies.
|
|
18
30
|
if (introText) {
|
|
19
|
-
introText.setAttribute(
|
|
31
|
+
introText.setAttribute("hidden", "hidden");
|
|
20
32
|
}
|
|
21
33
|
}
|
|
22
|
-
//# sourceMappingURL=clear.js.map
|
|
34
|
+
//# sourceMappingURL=clear.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shared/clear.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Clears the a11y-speak-region elements and hides the explanatory text.\n */\nexport default function clear() {\n\tconst regions = document.getElementsByClassName( 'a11y-speak-region' );\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\n\tfor ( let i = 0; i < regions.length; i++ ) {\n\t\tregions[ i ].textContent = '';\n\t}\n\n\t// Make sure the explanatory text is hidden from assistive technologies.\n\tif ( introText ) {\n\t\tintroText.setAttribute( 'hidden', 'hidden' );\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGe,SAAR,QAAyB;AAC/B,QAAM,UAAU,SAAS,uBAAwB,mBAAoB;AACrE,QAAM,YAAY,SAAS,eAAgB,uBAAwB;AAEnE,WAAU,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAM;AAC1C,YAAS,CAAE,EAAE,cAAc;AAAA,EAC5B;AAGA,MAAK,WAAY;AAChB,cAAU,aAAc,UAAU,QAAS;AAAA,EAC5C;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,36 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var filter_message_exports = {};
|
|
20
|
+
__export(filter_message_exports, {
|
|
21
|
+
default: () => filterMessage
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
let previousMessage =
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Filter the message to be announced to the screenreader.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} message The message to be announced.
|
|
13
|
-
*
|
|
14
|
-
* @return {string} The filtered message.
|
|
15
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(filter_message_exports);
|
|
24
|
+
let previousMessage = "";
|
|
16
25
|
function filterMessage(message) {
|
|
17
|
-
|
|
18
|
-
* Strip HTML tags (if any) from the message string. Ideally, messages should
|
|
19
|
-
* be simple strings, carefully crafted for specific use with A11ySpeak.
|
|
20
|
-
* When re-using already existing strings this will ensure simple HTML to be
|
|
21
|
-
* stripped out and replaced with a space. Browsers will collapse multiple
|
|
22
|
-
* spaces natively.
|
|
23
|
-
*/
|
|
24
|
-
message = message.replace(/<[^<>]+>/g, ' ');
|
|
25
|
-
|
|
26
|
-
/*
|
|
27
|
-
* Safari + VoiceOver don't announce repeated, identical strings. We use
|
|
28
|
-
* a `no-break space` to force them to think identical strings are different.
|
|
29
|
-
*/
|
|
26
|
+
message = message.replace(/<[^<>]+>/g, " ");
|
|
30
27
|
if (previousMessage === message) {
|
|
31
|
-
message +=
|
|
28
|
+
message += "\xA0";
|
|
32
29
|
}
|
|
33
30
|
previousMessage = message;
|
|
34
31
|
return message;
|
|
35
32
|
}
|
|
36
|
-
//# sourceMappingURL=filter-message.js.map
|
|
33
|
+
//# sourceMappingURL=filter-message.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shared/filter-message.js"],
|
|
4
|
+
"sourcesContent": ["let previousMessage = '';\n\n/**\n * Filter the message to be announced to the screenreader.\n *\n * @param {string} message The message to be announced.\n *\n * @return {string} The filtered message.\n */\nexport default function filterMessage( message ) {\n\t/*\n\t * Strip HTML tags (if any) from the message string. Ideally, messages should\n\t * be simple strings, carefully crafted for specific use with A11ySpeak.\n\t * When re-using already existing strings this will ensure simple HTML to be\n\t * stripped out and replaced with a space. Browsers will collapse multiple\n\t * spaces natively.\n\t */\n\tmessage = message.replace( /<[^<>]+>/g, ' ' );\n\n\t/*\n\t * Safari + VoiceOver don't announce repeated, identical strings. We use\n\t * a `no-break space` to force them to think identical strings are different.\n\t */\n\tif ( previousMessage === message ) {\n\t\tmessage += '\\u00A0';\n\t}\n\n\tpreviousMessage = message;\n\n\treturn message;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAI,kBAAkB;AASP,SAAR,cAAgC,SAAU;AAQhD,YAAU,QAAQ,QAAS,aAAa,GAAI;AAM5C,MAAK,oBAAoB,SAAU;AAClC,eAAW;AAAA,EACZ;AAEA,oBAAkB;AAElB,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/shared/index.js
CHANGED
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var shared_exports = {};
|
|
30
|
+
__export(shared_exports, {
|
|
31
|
+
speak: () => speak
|
|
6
32
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
|
|
16
|
-
* This module is inspired by the `speak` function in `wp-a11y.js`.
|
|
17
|
-
*
|
|
18
|
-
* @param {string} message The message to be announced by assistive technologies.
|
|
19
|
-
* @param {'polite'|'assertive'} [ariaLive] The politeness level for aria-live; default: 'polite'.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```js
|
|
23
|
-
* import { speak } from '@wordpress/a11y';
|
|
24
|
-
*
|
|
25
|
-
* // For polite messages that shouldn't interrupt what screen readers are currently announcing.
|
|
26
|
-
* speak( 'The message you want to send to the ARIA live region' );
|
|
27
|
-
*
|
|
28
|
-
* // For assertive messages that should interrupt what screen readers are currently announcing.
|
|
29
|
-
* speak( 'The message you want to send to the ARIA live region', 'assertive' );
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
33
|
+
module.exports = __toCommonJS(shared_exports);
|
|
34
|
+
var import_clear = __toESM(require("./clear"));
|
|
35
|
+
var import_filter_message = __toESM(require("./filter-message"));
|
|
32
36
|
function speak(message, ariaLive) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const containerPolite = document.getElementById('a11y-speak-polite');
|
|
42
|
-
if (containerAssertive && ariaLive === 'assertive') {
|
|
37
|
+
(0, import_clear.default)();
|
|
38
|
+
message = (0, import_filter_message.default)(message);
|
|
39
|
+
const introText = document.getElementById("a11y-speak-intro-text");
|
|
40
|
+
const containerAssertive = document.getElementById(
|
|
41
|
+
"a11y-speak-assertive"
|
|
42
|
+
);
|
|
43
|
+
const containerPolite = document.getElementById("a11y-speak-polite");
|
|
44
|
+
if (containerAssertive && ariaLive === "assertive") {
|
|
43
45
|
containerAssertive.textContent = message;
|
|
44
46
|
} else if (containerPolite) {
|
|
45
47
|
containerPolite.textContent = message;
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
/*
|
|
49
|
-
* Make the explanatory text available to assistive technologies by removing
|
|
50
|
-
* the 'hidden' HTML attribute.
|
|
51
|
-
*/
|
|
52
49
|
if (introText) {
|
|
53
|
-
introText.removeAttribute(
|
|
50
|
+
introText.removeAttribute("hidden");
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
|
-
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
speak
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shared/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport clear from './clear';\nimport filterMessage from './filter-message';\n\n/**\n * Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.\n * This module is inspired by the `speak` function in `wp-a11y.js`.\n *\n * @param {string} message The message to be announced by assistive technologies.\n * @param {'polite'|'assertive'} [ariaLive] The politeness level for aria-live; default: 'polite'.\n *\n * @example\n * ```js\n * import { speak } from '@wordpress/a11y';\n *\n * // For polite messages that shouldn't interrupt what screen readers are currently announcing.\n * speak( 'The message you want to send to the ARIA live region' );\n *\n * // For assertive messages that should interrupt what screen readers are currently announcing.\n * speak( 'The message you want to send to the ARIA live region', 'assertive' );\n * ```\n */\nexport function speak( message, ariaLive ) {\n\t/*\n\t * Clear previous messages to allow repeated strings being read out and hide\n\t * the explanatory text from assistive technologies.\n\t */\n\tclear();\n\n\tmessage = filterMessage( message );\n\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\tconst containerAssertive = document.getElementById(\n\t\t'a11y-speak-assertive'\n\t);\n\tconst containerPolite = document.getElementById( 'a11y-speak-polite' );\n\n\tif ( containerAssertive && ariaLive === 'assertive' ) {\n\t\tcontainerAssertive.textContent = message;\n\t} else if ( containerPolite ) {\n\t\tcontainerPolite.textContent = message;\n\t}\n\n\t/*\n\t * Make the explanatory text available to assistive technologies by removing\n\t * the 'hidden' HTML attribute.\n\t */\n\tif ( introText ) {\n\t\tintroText.removeAttribute( 'hidden' );\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAkB;AAClB,4BAA0B;AAoBnB,SAAS,MAAO,SAAS,UAAW;AAK1C,mBAAAA,SAAM;AAEN,gBAAU,sBAAAC,SAAe,OAAQ;AAEjC,QAAM,YAAY,SAAS,eAAgB,uBAAwB;AACnE,QAAM,qBAAqB,SAAS;AAAA,IACnC;AAAA,EACD;AACA,QAAM,kBAAkB,SAAS,eAAgB,mBAAoB;AAErE,MAAK,sBAAsB,aAAa,aAAc;AACrD,uBAAmB,cAAc;AAAA,EAClC,WAAY,iBAAkB;AAC7B,oBAAgB,cAAc;AAAA,EAC/B;AAMA,MAAK,WAAY;AAChB,cAAU,gBAAiB,QAAS;AAAA,EACrC;AACD;",
|
|
6
|
+
"names": ["clear", "filterMessage"]
|
|
7
|
+
}
|
package/build-module/index.js
CHANGED
|
@@ -1,35 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { speak } from './shared/index';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Create the live regions.
|
|
15
|
-
*/
|
|
16
|
-
export function setup() {
|
|
17
|
-
const introText = document.getElementById('a11y-speak-intro-text');
|
|
18
|
-
const containerAssertive = document.getElementById('a11y-speak-assertive');
|
|
19
|
-
const containerPolite = document.getElementById('a11y-speak-polite');
|
|
1
|
+
import domReady from "@wordpress/dom-ready";
|
|
2
|
+
import addContainer from "./script/add-container";
|
|
3
|
+
import addIntroText from "./script/add-intro-text";
|
|
4
|
+
import { speak } from "./shared/index";
|
|
5
|
+
function setup() {
|
|
6
|
+
const introText = document.getElementById("a11y-speak-intro-text");
|
|
7
|
+
const containerAssertive = document.getElementById(
|
|
8
|
+
"a11y-speak-assertive"
|
|
9
|
+
);
|
|
10
|
+
const containerPolite = document.getElementById("a11y-speak-polite");
|
|
20
11
|
if (introText === null) {
|
|
21
12
|
addIntroText();
|
|
22
13
|
}
|
|
23
14
|
if (containerAssertive === null) {
|
|
24
|
-
addContainer(
|
|
15
|
+
addContainer("assertive");
|
|
25
16
|
}
|
|
26
17
|
if (containerPolite === null) {
|
|
27
|
-
addContainer(
|
|
18
|
+
addContainer("polite");
|
|
28
19
|
}
|
|
29
20
|
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Run setup on domReady.
|
|
33
|
-
*/
|
|
34
21
|
domReady(setup);
|
|
35
|
-
|
|
22
|
+
export {
|
|
23
|
+
setup,
|
|
24
|
+
speak
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport domReady from '@wordpress/dom-ready';\n\n/**\n * Internal dependencies\n */\nimport addContainer from './script/add-container';\nimport addIntroText from './script/add-intro-text';\n\nexport { speak } from './shared/index';\n\n/**\n * Create the live regions.\n */\nexport function setup() {\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\tconst containerAssertive = document.getElementById(\n\t\t'a11y-speak-assertive'\n\t);\n\tconst containerPolite = document.getElementById( 'a11y-speak-polite' );\n\n\tif ( introText === null ) {\n\t\taddIntroText();\n\t}\n\n\tif ( containerAssertive === null ) {\n\t\taddContainer( 'assertive' );\n\t}\n\n\tif ( containerPolite === null ) {\n\t\taddContainer( 'polite' );\n\t}\n}\n\n/**\n * Run setup on domReady.\n */\ndomReady( setup );\n"],
|
|
5
|
+
"mappings": "AAGA,OAAO,cAAc;AAKrB,OAAO,kBAAkB;AACzB,OAAO,kBAAkB;AAEzB,SAAS,aAAa;AAKf,SAAS,QAAQ;AACvB,QAAM,YAAY,SAAS,eAAgB,uBAAwB;AACnE,QAAM,qBAAqB,SAAS;AAAA,IACnC;AAAA,EACD;AACA,QAAM,kBAAkB,SAAS,eAAgB,mBAAoB;AAErE,MAAK,cAAc,MAAO;AACzB,iBAAa;AAAA,EACd;AAEA,MAAK,uBAAuB,MAAO;AAClC,iBAAc,WAAY;AAAA,EAC3B;AAEA,MAAK,oBAAoB,MAAO;AAC/B,iBAAc,QAAS;AAAA,EACxB;AACD;AAKA,SAAU,KAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Filters should inject the relevant HTML on page load instead of requiring setup.
|
|
10
|
-
*/
|
|
11
|
-
export const setup = () => {};
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { speak } from "../shared/index";
|
|
2
|
+
const setup = () => {
|
|
3
|
+
};
|
|
4
|
+
export {
|
|
5
|
+
setup,
|
|
6
|
+
speak
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/module/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nexport { speak } from '../shared/index';\n\n/**\n * This no-op function is exported to provide compatibility with the `wp-a11y` Script.\n *\n * Filters should inject the relevant HTML on page load instead of requiring setup.\n */\nexport const setup = () => {};\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,aAAa;AAOf,MAAM,QAAQ,MAAM;AAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @param {'polite'|'assertive'} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
|
|
5
|
-
*
|
|
6
|
-
* @return {HTMLDivElement} The ARIA live region HTML element.
|
|
7
|
-
*/
|
|
8
|
-
export default function addContainer(ariaLive = 'polite') {
|
|
9
|
-
const container = document.createElement('div');
|
|
1
|
+
function addContainer(ariaLive = "polite") {
|
|
2
|
+
const container = document.createElement("div");
|
|
10
3
|
container.id = `a11y-speak-${ariaLive}`;
|
|
11
|
-
container.className =
|
|
12
|
-
container.setAttribute(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
container.className = "a11y-speak-region";
|
|
5
|
+
container.setAttribute(
|
|
6
|
+
"style",
|
|
7
|
+
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
|
8
|
+
);
|
|
9
|
+
container.setAttribute("aria-live", ariaLive);
|
|
10
|
+
container.setAttribute("aria-relevant", "additions text");
|
|
11
|
+
container.setAttribute("aria-atomic", "true");
|
|
12
|
+
const { body } = document;
|
|
19
13
|
if (body) {
|
|
20
14
|
body.appendChild(container);
|
|
21
15
|
}
|
|
22
16
|
return container;
|
|
23
17
|
}
|
|
24
|
-
|
|
18
|
+
export {
|
|
19
|
+
addContainer as default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=add-container.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/script/add-container.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Build the live regions markup.\n *\n * @param {'polite'|'assertive'} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.\n *\n * @return {HTMLDivElement} The ARIA live region HTML element.\n */\nexport default function addContainer( ariaLive = 'polite' ) {\n\tconst container = document.createElement( 'div' );\n\tcontainer.id = `a11y-speak-${ ariaLive }`;\n\tcontainer.className = 'a11y-speak-region';\n\n\tcontainer.setAttribute(\n\t\t'style',\n\t\t'position:absolute;' +\n\t\t\t'margin:-1px;' +\n\t\t\t'padding:0;' +\n\t\t\t'height:1px;' +\n\t\t\t'width:1px;' +\n\t\t\t'overflow:hidden;' +\n\t\t\t'clip-path:inset(50%);' +\n\t\t\t'border:0;' +\n\t\t\t'word-wrap:normal !important;'\n\t);\n\tcontainer.setAttribute( 'aria-live', ariaLive );\n\tcontainer.setAttribute( 'aria-relevant', 'additions text' );\n\tcontainer.setAttribute( 'aria-atomic', 'true' );\n\n\tconst { body } = document;\n\tif ( body ) {\n\t\tbody.appendChild( container );\n\t}\n\n\treturn container;\n}\n"],
|
|
5
|
+
"mappings": "AAOe,SAAR,aAA+B,WAAW,UAAW;AAC3D,QAAM,YAAY,SAAS,cAAe,KAAM;AAChD,YAAU,KAAK,cAAe,QAAS;AACvC,YAAU,YAAY;AAEtB,YAAU;AAAA,IACT;AAAA,IACA;AAAA,EASD;AACA,YAAU,aAAc,aAAa,QAAS;AAC9C,YAAU,aAAc,iBAAiB,gBAAiB;AAC1D,YAAU,aAAc,eAAe,MAAO;AAE9C,QAAM,EAAE,KAAK,IAAI;AACjB,MAAK,MAAO;AACX,SAAK,YAAa,SAAU;AAAA,EAC7B;AAEA,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
export default function addIntroText() {
|
|
15
|
-
const introText = document.createElement('p');
|
|
16
|
-
introText.id = 'a11y-speak-intro-text';
|
|
17
|
-
introText.className = 'a11y-speak-intro-text';
|
|
18
|
-
introText.textContent = __('Notifications');
|
|
19
|
-
introText.setAttribute('style', 'position:absolute;' + 'margin:-1px;' + 'padding:0;' + 'height:1px;' + 'width:1px;' + 'overflow:hidden;' + 'clip-path:inset(50%);' + 'border:0;' + 'word-wrap:normal !important;');
|
|
20
|
-
introText.setAttribute('hidden', '');
|
|
21
|
-
const {
|
|
22
|
-
body
|
|
23
|
-
} = document;
|
|
1
|
+
import { __ } from "@wordpress/i18n";
|
|
2
|
+
function addIntroText() {
|
|
3
|
+
const introText = document.createElement("p");
|
|
4
|
+
introText.id = "a11y-speak-intro-text";
|
|
5
|
+
introText.className = "a11y-speak-intro-text";
|
|
6
|
+
introText.textContent = __("Notifications");
|
|
7
|
+
introText.setAttribute(
|
|
8
|
+
"style",
|
|
9
|
+
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
|
10
|
+
);
|
|
11
|
+
introText.setAttribute("hidden", "");
|
|
12
|
+
const { body } = document;
|
|
24
13
|
if (body) {
|
|
25
14
|
body.appendChild(introText);
|
|
26
15
|
}
|
|
27
16
|
return introText;
|
|
28
17
|
}
|
|
29
|
-
|
|
18
|
+
export {
|
|
19
|
+
addIntroText as default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=add-intro-text.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/script/add-intro-text.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Build the explanatory text to be placed before the aria live regions.\n *\n * This text is initially hidden from assistive technologies by using a `hidden`\n * HTML attribute which is then removed once a message fills the aria-live regions.\n *\n * @return {HTMLParagraphElement} The explanatory text HTML element.\n */\nexport default function addIntroText() {\n\tconst introText = document.createElement( 'p' );\n\n\tintroText.id = 'a11y-speak-intro-text';\n\tintroText.className = 'a11y-speak-intro-text';\n\tintroText.textContent = __( 'Notifications' );\n\n\tintroText.setAttribute(\n\t\t'style',\n\t\t'position:absolute;' +\n\t\t\t'margin:-1px;' +\n\t\t\t'padding:0;' +\n\t\t\t'height:1px;' +\n\t\t\t'width:1px;' +\n\t\t\t'overflow:hidden;' +\n\t\t\t'clip-path:inset(50%);' +\n\t\t\t'border:0;' +\n\t\t\t'word-wrap:normal !important;'\n\t);\n\tintroText.setAttribute( 'hidden', '' );\n\n\tconst { body } = document;\n\tif ( body ) {\n\t\tbody.appendChild( introText );\n\t}\n\n\treturn introText;\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,UAAU;AAUJ,SAAR,eAAgC;AACtC,QAAM,YAAY,SAAS,cAAe,GAAI;AAE9C,YAAU,KAAK;AACf,YAAU,YAAY;AACtB,YAAU,cAAc,GAAI,eAAgB;AAE5C,YAAU;AAAA,IACT;AAAA,IACA;AAAA,EASD;AACA,YAAU,aAAc,UAAU,EAAG;AAErC,QAAM,EAAE,KAAK,IAAI;AACjB,MAAK,MAAO;AACX,SAAK,YAAa,SAAU;AAAA,EAC7B;AAEA,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default function clear() {
|
|
5
|
-
const regions = document.getElementsByClassName('a11y-speak-region');
|
|
6
|
-
const introText = document.getElementById('a11y-speak-intro-text');
|
|
1
|
+
function clear() {
|
|
2
|
+
const regions = document.getElementsByClassName("a11y-speak-region");
|
|
3
|
+
const introText = document.getElementById("a11y-speak-intro-text");
|
|
7
4
|
for (let i = 0; i < regions.length; i++) {
|
|
8
|
-
regions[i].textContent =
|
|
5
|
+
regions[i].textContent = "";
|
|
9
6
|
}
|
|
10
|
-
|
|
11
|
-
// Make sure the explanatory text is hidden from assistive technologies.
|
|
12
7
|
if (introText) {
|
|
13
|
-
introText.setAttribute(
|
|
8
|
+
introText.setAttribute("hidden", "hidden");
|
|
14
9
|
}
|
|
15
10
|
}
|
|
16
|
-
|
|
11
|
+
export {
|
|
12
|
+
clear as default
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=clear.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shared/clear.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Clears the a11y-speak-region elements and hides the explanatory text.\n */\nexport default function clear() {\n\tconst regions = document.getElementsByClassName( 'a11y-speak-region' );\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\n\tfor ( let i = 0; i < regions.length; i++ ) {\n\t\tregions[ i ].textContent = '';\n\t}\n\n\t// Make sure the explanatory text is hidden from assistive technologies.\n\tif ( introText ) {\n\t\tintroText.setAttribute( 'hidden', 'hidden' );\n\t}\n}\n"],
|
|
5
|
+
"mappings": "AAGe,SAAR,QAAyB;AAC/B,QAAM,UAAU,SAAS,uBAAwB,mBAAoB;AACrE,QAAM,YAAY,SAAS,eAAgB,uBAAwB;AAEnE,WAAU,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAM;AAC1C,YAAS,CAAE,EAAE,cAAc;AAAA,EAC5B;AAGA,MAAK,WAAY;AAChB,cAAU,aAAc,UAAU,QAAS;AAAA,EAC5C;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
let previousMessage =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Filter the message to be announced to the screenreader.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} message The message to be announced.
|
|
7
|
-
*
|
|
8
|
-
* @return {string} The filtered message.
|
|
9
|
-
*/
|
|
10
|
-
export default function filterMessage(message) {
|
|
11
|
-
/*
|
|
12
|
-
* Strip HTML tags (if any) from the message string. Ideally, messages should
|
|
13
|
-
* be simple strings, carefully crafted for specific use with A11ySpeak.
|
|
14
|
-
* When re-using already existing strings this will ensure simple HTML to be
|
|
15
|
-
* stripped out and replaced with a space. Browsers will collapse multiple
|
|
16
|
-
* spaces natively.
|
|
17
|
-
*/
|
|
18
|
-
message = message.replace(/<[^<>]+>/g, ' ');
|
|
19
|
-
|
|
20
|
-
/*
|
|
21
|
-
* Safari + VoiceOver don't announce repeated, identical strings. We use
|
|
22
|
-
* a `no-break space` to force them to think identical strings are different.
|
|
23
|
-
*/
|
|
1
|
+
let previousMessage = "";
|
|
2
|
+
function filterMessage(message) {
|
|
3
|
+
message = message.replace(/<[^<>]+>/g, " ");
|
|
24
4
|
if (previousMessage === message) {
|
|
25
|
-
message +=
|
|
5
|
+
message += "\xA0";
|
|
26
6
|
}
|
|
27
7
|
previousMessage = message;
|
|
28
8
|
return message;
|
|
29
9
|
}
|
|
30
|
-
|
|
10
|
+
export {
|
|
11
|
+
filterMessage as default
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=filter-message.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shared/filter-message.js"],
|
|
4
|
+
"sourcesContent": ["let previousMessage = '';\n\n/**\n * Filter the message to be announced to the screenreader.\n *\n * @param {string} message The message to be announced.\n *\n * @return {string} The filtered message.\n */\nexport default function filterMessage( message ) {\n\t/*\n\t * Strip HTML tags (if any) from the message string. Ideally, messages should\n\t * be simple strings, carefully crafted for specific use with A11ySpeak.\n\t * When re-using already existing strings this will ensure simple HTML to be\n\t * stripped out and replaced with a space. Browsers will collapse multiple\n\t * spaces natively.\n\t */\n\tmessage = message.replace( /<[^<>]+>/g, ' ' );\n\n\t/*\n\t * Safari + VoiceOver don't announce repeated, identical strings. We use\n\t * a `no-break space` to force them to think identical strings are different.\n\t */\n\tif ( previousMessage === message ) {\n\t\tmessage += '\\u00A0';\n\t}\n\n\tpreviousMessage = message;\n\n\treturn message;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,IAAI,kBAAkB;AASP,SAAR,cAAgC,SAAU;AAQhD,YAAU,QAAQ,QAAS,aAAa,GAAI;AAM5C,MAAK,oBAAoB,SAAU;AAClC,eAAW;AAAA,EACZ;AAEA,oBAAkB;AAElB,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,49 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import clear from './clear';
|
|
5
|
-
import filterMessage from './filter-message';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
|
|
9
|
-
* This module is inspired by the `speak` function in `wp-a11y.js`.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} message The message to be announced by assistive technologies.
|
|
12
|
-
* @param {'polite'|'assertive'} [ariaLive] The politeness level for aria-live; default: 'polite'.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```js
|
|
16
|
-
* import { speak } from '@wordpress/a11y';
|
|
17
|
-
*
|
|
18
|
-
* // For polite messages that shouldn't interrupt what screen readers are currently announcing.
|
|
19
|
-
* speak( 'The message you want to send to the ARIA live region' );
|
|
20
|
-
*
|
|
21
|
-
* // For assertive messages that should interrupt what screen readers are currently announcing.
|
|
22
|
-
* speak( 'The message you want to send to the ARIA live region', 'assertive' );
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export function speak(message, ariaLive) {
|
|
26
|
-
/*
|
|
27
|
-
* Clear previous messages to allow repeated strings being read out and hide
|
|
28
|
-
* the explanatory text from assistive technologies.
|
|
29
|
-
*/
|
|
1
|
+
import clear from "./clear";
|
|
2
|
+
import filterMessage from "./filter-message";
|
|
3
|
+
function speak(message, ariaLive) {
|
|
30
4
|
clear();
|
|
31
5
|
message = filterMessage(message);
|
|
32
|
-
const introText = document.getElementById(
|
|
33
|
-
const containerAssertive = document.getElementById(
|
|
34
|
-
|
|
35
|
-
|
|
6
|
+
const introText = document.getElementById("a11y-speak-intro-text");
|
|
7
|
+
const containerAssertive = document.getElementById(
|
|
8
|
+
"a11y-speak-assertive"
|
|
9
|
+
);
|
|
10
|
+
const containerPolite = document.getElementById("a11y-speak-polite");
|
|
11
|
+
if (containerAssertive && ariaLive === "assertive") {
|
|
36
12
|
containerAssertive.textContent = message;
|
|
37
13
|
} else if (containerPolite) {
|
|
38
14
|
containerPolite.textContent = message;
|
|
39
15
|
}
|
|
40
|
-
|
|
41
|
-
/*
|
|
42
|
-
* Make the explanatory text available to assistive technologies by removing
|
|
43
|
-
* the 'hidden' HTML attribute.
|
|
44
|
-
*/
|
|
45
16
|
if (introText) {
|
|
46
|
-
introText.removeAttribute(
|
|
17
|
+
introText.removeAttribute("hidden");
|
|
47
18
|
}
|
|
48
19
|
}
|
|
49
|
-
|
|
20
|
+
export {
|
|
21
|
+
speak
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shared/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport clear from './clear';\nimport filterMessage from './filter-message';\n\n/**\n * Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.\n * This module is inspired by the `speak` function in `wp-a11y.js`.\n *\n * @param {string} message The message to be announced by assistive technologies.\n * @param {'polite'|'assertive'} [ariaLive] The politeness level for aria-live; default: 'polite'.\n *\n * @example\n * ```js\n * import { speak } from '@wordpress/a11y';\n *\n * // For polite messages that shouldn't interrupt what screen readers are currently announcing.\n * speak( 'The message you want to send to the ARIA live region' );\n *\n * // For assertive messages that should interrupt what screen readers are currently announcing.\n * speak( 'The message you want to send to the ARIA live region', 'assertive' );\n * ```\n */\nexport function speak( message, ariaLive ) {\n\t/*\n\t * Clear previous messages to allow repeated strings being read out and hide\n\t * the explanatory text from assistive technologies.\n\t */\n\tclear();\n\n\tmessage = filterMessage( message );\n\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\tconst containerAssertive = document.getElementById(\n\t\t'a11y-speak-assertive'\n\t);\n\tconst containerPolite = document.getElementById( 'a11y-speak-polite' );\n\n\tif ( containerAssertive && ariaLive === 'assertive' ) {\n\t\tcontainerAssertive.textContent = message;\n\t} else if ( containerPolite ) {\n\t\tcontainerPolite.textContent = message;\n\t}\n\n\t/*\n\t * Make the explanatory text available to assistive technologies by removing\n\t * the 'hidden' HTML attribute.\n\t */\n\tif ( introText ) {\n\t\tintroText.removeAttribute( 'hidden' );\n\t}\n}\n"],
|
|
5
|
+
"mappings": "AAGA,OAAO,WAAW;AAClB,OAAO,mBAAmB;AAoBnB,SAAS,MAAO,SAAS,UAAW;AAK1C,QAAM;AAEN,YAAU,cAAe,OAAQ;AAEjC,QAAM,YAAY,SAAS,eAAgB,uBAAwB;AACnE,QAAM,qBAAqB,SAAS;AAAA,IACnC;AAAA,EACD;AACA,QAAM,kBAAkB,SAAS,eAAgB,mBAAoB;AAErE,MAAK,sBAAsB,aAAa,aAAc;AACrD,uBAAmB,cAAc;AAAA,EAClC,WAAY,iBAAkB;AAC7B,oBAAgB,cAAc;AAAA,EAC/B;AAMA,MAAK,WAAY;AAChB,cAAU,gBAAiB,QAAS;AAAA,EACrC;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/a11y",
|
|
3
|
-
"version": "4.32.0",
|
|
3
|
+
"version": "4.32.1-next.b8c8708f3.0",
|
|
4
4
|
"description": "Accessibility (a11y) utilities for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -26,17 +26,24 @@
|
|
|
26
26
|
},
|
|
27
27
|
"main": "build/index.js",
|
|
28
28
|
"module": "build-module/index.js",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./build-types/index.d.ts",
|
|
32
|
+
"import": "./build-module/index.js",
|
|
33
|
+
"require": "./build/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
29
37
|
"react-native": "src/index",
|
|
30
38
|
"wpScript": true,
|
|
31
39
|
"wpScriptModuleExports": "./build-module/module/index.js",
|
|
32
40
|
"types": "build-types",
|
|
33
41
|
"dependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@wordpress/
|
|
36
|
-
"@wordpress/i18n": "^6.5.0"
|
|
42
|
+
"@wordpress/dom-ready": "^4.32.1-next.b8c8708f3.0",
|
|
43
|
+
"@wordpress/i18n": "^6.5.1-next.b8c8708f3.0"
|
|
37
44
|
},
|
|
38
45
|
"publishConfig": {
|
|
39
46
|
"access": "public"
|
|
40
47
|
},
|
|
41
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "67cfd7e661931aeb0d06bec894599d287a4f8d0f"
|
|
42
49
|
}
|
package/build/index.native.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.speak = speak;
|
|
8
|
-
var _filterMessage = _interopRequireDefault(require("./shared/filter-message"));
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Update the ARIA live notification area text node.
|
|
15
|
-
*
|
|
16
|
-
* @param {string} message The message to be announced by Assistive Technologies.
|
|
17
|
-
* @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.
|
|
18
|
-
*/
|
|
19
|
-
function speak(message, ariaLive) {
|
|
20
|
-
message = (0, _filterMessage.default)(message);
|
|
21
|
-
// TODO: Use native module to speak message.
|
|
22
|
-
if (ariaLive === 'assertive') {} else {}
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_filterMessage","_interopRequireDefault","require","speak","message","ariaLive","filterMessage"],"sources":["@wordpress/a11y/src/index.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport filterMessage from './shared/filter-message';\n\n/**\n * Update the ARIA live notification area text node.\n *\n * @param {string} message The message to be announced by Assistive Technologies.\n * @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.\n */\nexport function speak( message, ariaLive ) {\n\tmessage = filterMessage( message );\n\t// TODO: Use native module to speak message.\n\tif ( ariaLive === 'assertive' ) {\n\t} else {\n\t}\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,KAAKA,CAAEC,OAAO,EAAEC,QAAQ,EAAG;EAC1CD,OAAO,GAAG,IAAAE,sBAAa,EAAEF,OAAQ,CAAC;EAClC;EACA,IAAKC,QAAQ,KAAK,WAAW,EAAG,CAChC,CAAC,MAAM,CACP;AACD","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
import filterMessage from './shared/filter-message';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Update the ARIA live notification area text node.
|
|
8
|
-
*
|
|
9
|
-
* @param {string} message The message to be announced by Assistive Technologies.
|
|
10
|
-
* @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.
|
|
11
|
-
*/
|
|
12
|
-
export function speak(message, ariaLive) {
|
|
13
|
-
message = filterMessage(message);
|
|
14
|
-
// TODO: Use native module to speak message.
|
|
15
|
-
if (ariaLive === 'assertive') {} else {}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["filterMessage","speak","message","ariaLive"],"sources":["@wordpress/a11y/src/index.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport filterMessage from './shared/filter-message';\n\n/**\n * Update the ARIA live notification area text node.\n *\n * @param {string} message The message to be announced by Assistive Technologies.\n * @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.\n */\nexport function speak( message, ariaLive ) {\n\tmessage = filterMessage( message );\n\t// TODO: Use native module to speak message.\n\tif ( ariaLive === 'assertive' ) {\n\t} else {\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,yBAAyB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,KAAKA,CAAEC,OAAO,EAAEC,QAAQ,EAAG;EAC1CD,OAAO,GAAGF,aAAa,CAAEE,OAAQ,CAAC;EAClC;EACA,IAAKC,QAAQ,KAAK,WAAW,EAAG,CAChC,CAAC,MAAM,CACP;AACD","ignoreList":[]}
|