@wordpress/a11y 4.31.1-next.f56bd8138.0 → 4.32.1-next.47f435fc9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/index.js +50 -37
  3. package/build/index.js.map +7 -1
  4. package/build/module/index.js +30 -22
  5. package/build/module/index.js.map +7 -1
  6. package/build/script/add-container.js +33 -22
  7. package/build/script/add-container.js.map +7 -1
  8. package/build/script/add-intro-text.js +33 -27
  9. package/build/script/add-intro-text.js.map +7 -1
  10. package/build/shared/clear.js +26 -14
  11. package/build/shared/clear.js.map +7 -1
  12. package/build/shared/filter-message.js +25 -28
  13. package/build/shared/filter-message.js.map +7 -1
  14. package/build/shared/index.js +47 -46
  15. package/build/shared/index.js.map +7 -1
  16. package/build-module/index.js +17 -26
  17. package/build-module/index.js.map +7 -1
  18. package/build-module/module/index.js +8 -12
  19. package/build-module/module/index.js.map +7 -1
  20. package/build-module/script/add-container.js +15 -18
  21. package/build-module/script/add-container.js.map +7 -1
  22. package/build-module/script/add-intro-text.js +16 -24
  23. package/build-module/script/add-intro-text.js.map +7 -1
  24. package/build-module/shared/clear.js +9 -11
  25. package/build-module/shared/clear.js.map +7 -1
  26. package/build-module/shared/filter-message.js +8 -25
  27. package/build-module/shared/filter-message.js.map +7 -1
  28. package/build-module/shared/index.js +14 -40
  29. package/build-module/shared/index.js.map +7 -1
  30. package/package.json +12 -5
  31. package/build/index.native.js +0 -24
  32. package/build/index.native.js.map +0 -1
  33. package/build-module/index.native.js +0 -17
  34. package/build-module/index.native.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.32.0 (2025-10-01)
6
+
5
7
  ## 4.31.0 (2025-09-17)
6
8
 
7
9
  ## 4.30.0 (2025-09-03)
package/build/index.js CHANGED
@@ -1,48 +1,61 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.setup = setup;
8
- Object.defineProperty(exports, "speak", {
9
- enumerable: true,
10
- get: function () {
11
- return _index.speak;
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
- var _domReady = _interopRequireDefault(require("@wordpress/dom-ready"));
15
- var _addContainer = _interopRequireDefault(require("./script/add-container"));
16
- var _addIntroText = _interopRequireDefault(require("./script/add-intro-text"));
17
- var _index = require("./shared/index");
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('a11y-speak-intro-text');
31
- const containerAssertive = document.getElementById('a11y-speak-assertive');
32
- const containerPolite = document.getElementById('a11y-speak-polite');
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, _addIntroText.default)();
46
+ (0, import_add_intro_text.default)();
35
47
  }
36
48
  if (containerAssertive === null) {
37
- (0, _addContainer.default)('assertive');
49
+ (0, import_add_container.default)("assertive");
38
50
  }
39
51
  if (containerPolite === null) {
40
- (0, _addContainer.default)('polite');
52
+ (0, import_add_container.default)("polite");
41
53
  }
42
54
  }
43
-
44
- /**
45
- * Run setup on domReady.
46
- */
47
- (0, _domReady.default)(setup);
48
- //# sourceMappingURL=index.js.map
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
@@ -1 +1,7 @@
1
- {"version":3,"names":["_domReady","_interopRequireDefault","require","_addContainer","_addIntroText","_index","setup","introText","document","getElementById","containerAssertive","containerPolite","addIntroText","addContainer","domReady"],"sources":["@wordpress/a11y/src/index.js"],"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"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACO,SAASI,KAAKA,CAAA,EAAG;EACvB,MAAMC,SAAS,GAAGC,QAAQ,CAACC,cAAc,CAAE,uBAAwB,CAAC;EACpE,MAAMC,kBAAkB,GAAGF,QAAQ,CAACC,cAAc,CACjD,sBACD,CAAC;EACD,MAAME,eAAe,GAAGH,QAAQ,CAACC,cAAc,CAAE,mBAAoB,CAAC;EAEtE,IAAKF,SAAS,KAAK,IAAI,EAAG;IACzB,IAAAK,qBAAY,EAAC,CAAC;EACf;EAEA,IAAKF,kBAAkB,KAAK,IAAI,EAAG;IAClC,IAAAG,qBAAY,EAAE,WAAY,CAAC;EAC5B;EAEA,IAAKF,eAAe,KAAK,IAAI,EAAG;IAC/B,IAAAE,qBAAY,EAAE,QAAS,CAAC;EACzB;AACD;;AAEA;AACA;AACA;AACA,IAAAC,iBAAQ,EAAER,KAAM,CAAC","ignoreList":[]}
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
+ }
@@ -1,25 +1,33 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.setup = void 0;
7
- Object.defineProperty(exports, "speak", {
8
- enumerable: true,
9
- get: function () {
10
- return _index.speak;
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
- var _index = require("../shared/index");
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
- {"version":3,"names":["_index","require","setup","exports"],"sources":["@wordpress/a11y/src/module/index.ts"],"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"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMC,KAAK,GAAGA,CAAA,KAAM,CAAC,CAAC;AAACC,OAAA,CAAAD,KAAA,GAAAA,KAAA","ignoreList":[]}
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.defineProperty(exports, "__esModule", {
4
- value: true
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.default = addContainer;
7
- /**
8
- * Build the live regions markup.
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 = 'a11y-speak-region';
18
- container.setAttribute('style', 'position:absolute;' + 'margin:-1px;' + 'padding:0;' + 'height:1px;' + 'width:1px;' + 'overflow:hidden;' + 'clip-path:inset(50%);' + 'border:0;' + 'word-wrap:normal !important;');
19
- container.setAttribute('aria-live', ariaLive);
20
- container.setAttribute('aria-relevant', 'additions text');
21
- container.setAttribute('aria-atomic', 'true');
22
- const {
23
- body
24
- } = document;
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
- {"version":3,"names":["addContainer","ariaLive","container","document","createElement","id","className","setAttribute","body","appendChild"],"sources":["@wordpress/a11y/src/script/add-container.js"],"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"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,YAAYA,CAAEC,QAAQ,GAAG,QAAQ,EAAG;EAC3D,MAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAa,CAAE,KAAM,CAAC;EACjDF,SAAS,CAACG,EAAE,GAAG,cAAeJ,QAAQ,EAAG;EACzCC,SAAS,CAACI,SAAS,GAAG,mBAAmB;EAEzCJ,SAAS,CAACK,YAAY,CACrB,OAAO,EACP,oBAAoB,GACnB,cAAc,GACd,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,kBAAkB,GAClB,uBAAuB,GACvB,WAAW,GACX,8BACF,CAAC;EACDL,SAAS,CAACK,YAAY,CAAE,WAAW,EAAEN,QAAS,CAAC;EAC/CC,SAAS,CAACK,YAAY,CAAE,eAAe,EAAE,gBAAiB,CAAC;EAC3DL,SAAS,CAACK,YAAY,CAAE,aAAa,EAAE,MAAO,CAAC;EAE/C,MAAM;IAAEC;EAAK,CAAC,GAAGL,QAAQ;EACzB,IAAKK,IAAI,EAAG;IACXA,IAAI,CAACC,WAAW,CAAEP,SAAU,CAAC;EAC9B;EAEA,OAAOA,SAAS;AACjB","ignoreList":[]}
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.defineProperty(exports, "__esModule", {
4
- value: true
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.default = addIntroText;
7
- var _i18n = require("@wordpress/i18n");
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('p');
22
- introText.id = 'a11y-speak-intro-text';
23
- introText.className = 'a11y-speak-intro-text';
24
- introText.textContent = (0, _i18n.__)('Notifications');
25
- 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;');
26
- introText.setAttribute('hidden', '');
27
- const {
28
- body
29
- } = document;
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
- {"version":3,"names":["_i18n","require","addIntroText","introText","document","createElement","id","className","textContent","__","setAttribute","body","appendChild"],"sources":["@wordpress/a11y/src/script/add-intro-text.ts"],"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"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,YAAYA,CAAA,EAAG;EACtC,MAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAa,CAAE,GAAI,CAAC;EAE/CF,SAAS,CAACG,EAAE,GAAG,uBAAuB;EACtCH,SAAS,CAACI,SAAS,GAAG,uBAAuB;EAC7CJ,SAAS,CAACK,WAAW,GAAG,IAAAC,QAAE,EAAE,eAAgB,CAAC;EAE7CN,SAAS,CAACO,YAAY,CACrB,OAAO,EACP,oBAAoB,GACnB,cAAc,GACd,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,kBAAkB,GAClB,uBAAuB,GACvB,WAAW,GACX,8BACF,CAAC;EACDP,SAAS,CAACO,YAAY,CAAE,QAAQ,EAAE,EAAG,CAAC;EAEtC,MAAM;IAAEC;EAAK,CAAC,GAAGP,QAAQ;EACzB,IAAKO,IAAI,EAAG;IACXA,IAAI,CAACC,WAAW,CAAET,SAAU,CAAC;EAC9B;EAEA,OAAOA,SAAS;AACjB","ignoreList":[]}
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
+ }
@@ -1,22 +1,34 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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.default = clear;
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('a11y-speak-region');
12
- const introText = document.getElementById('a11y-speak-intro-text');
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('hidden', 'hidden');
31
+ introText.setAttribute("hidden", "hidden");
20
32
  }
21
33
  }
22
- //# sourceMappingURL=clear.js.map
34
+ //# sourceMappingURL=clear.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["clear","regions","document","getElementsByClassName","introText","getElementById","i","length","textContent","setAttribute"],"sources":["@wordpress/a11y/src/shared/clear.js"],"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"],"mappings":";;;;;;AAAA;AACA;AACA;AACe,SAASA,KAAKA,CAAA,EAAG;EAC/B,MAAMC,OAAO,GAAGC,QAAQ,CAACC,sBAAsB,CAAE,mBAAoB,CAAC;EACtE,MAAMC,SAAS,GAAGF,QAAQ,CAACG,cAAc,CAAE,uBAAwB,CAAC;EAEpE,KAAM,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,OAAO,CAACM,MAAM,EAAED,CAAC,EAAE,EAAG;IAC1CL,OAAO,CAAEK,CAAC,CAAE,CAACE,WAAW,GAAG,EAAE;EAC9B;;EAEA;EACA,IAAKJ,SAAS,EAAG;IAChBA,SAAS,CAACK,YAAY,CAAE,QAAQ,EAAE,QAAS,CAAC;EAC7C;AACD","ignoreList":[]}
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.defineProperty(exports, "__esModule", {
4
- value: true
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.default = filterMessage;
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 += '\u00A0';
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
- {"version":3,"names":["previousMessage","filterMessage","message","replace"],"sources":["@wordpress/a11y/src/shared/filter-message.js"],"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"],"mappings":";;;;;;AAAA,IAAIA,eAAe,GAAG,EAAE;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,aAAaA,CAAEC,OAAO,EAAG;EAChD;AACD;AACA;AACA;AACA;AACA;AACA;EACCA,OAAO,GAAGA,OAAO,CAACC,OAAO,CAAE,WAAW,EAAE,GAAI,CAAC;;EAE7C;AACD;AACA;AACA;EACC,IAAKH,eAAe,KAAKE,OAAO,EAAG;IAClCA,OAAO,IAAI,QAAQ;EACpB;EAEAF,eAAe,GAAGE,OAAO;EAEzB,OAAOA,OAAO;AACf","ignoreList":[]}
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
+ }
@@ -1,56 +1,57 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
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.speak = speak;
8
- var _clear = _interopRequireDefault(require("./clear"));
9
- var _filterMessage = _interopRequireDefault(require("./filter-message"));
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
- * Clear previous messages to allow repeated strings being read out and hide
35
- * the explanatory text from assistive technologies.
36
- */
37
- (0, _clear.default)();
38
- message = (0, _filterMessage.default)(message);
39
- const introText = document.getElementById('a11y-speak-intro-text');
40
- const containerAssertive = document.getElementById('a11y-speak-assertive');
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('hidden');
50
+ introText.removeAttribute("hidden");
54
51
  }
55
52
  }
56
- //# sourceMappingURL=index.js.map
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
- {"version":3,"names":["_clear","_interopRequireDefault","require","_filterMessage","speak","message","ariaLive","clear","filterMessage","introText","document","getElementById","containerAssertive","containerPolite","textContent","removeAttribute"],"sources":["@wordpress/a11y/src/shared/index.js"],"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"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,KAAKA,CAAEC,OAAO,EAAEC,QAAQ,EAAG;EAC1C;AACD;AACA;AACA;EACC,IAAAC,cAAK,EAAC,CAAC;EAEPF,OAAO,GAAG,IAAAG,sBAAa,EAAEH,OAAQ,CAAC;EAElC,MAAMI,SAAS,GAAGC,QAAQ,CAACC,cAAc,CAAE,uBAAwB,CAAC;EACpE,MAAMC,kBAAkB,GAAGF,QAAQ,CAACC,cAAc,CACjD,sBACD,CAAC;EACD,MAAME,eAAe,GAAGH,QAAQ,CAACC,cAAc,CAAE,mBAAoB,CAAC;EAEtE,IAAKC,kBAAkB,IAAIN,QAAQ,KAAK,WAAW,EAAG;IACrDM,kBAAkB,CAACE,WAAW,GAAGT,OAAO;EACzC,CAAC,MAAM,IAAKQ,eAAe,EAAG;IAC7BA,eAAe,CAACC,WAAW,GAAGT,OAAO;EACtC;;EAEA;AACD;AACA;AACA;EACC,IAAKI,SAAS,EAAG;IAChBA,SAAS,CAACM,eAAe,CAAE,QAAS,CAAC;EACtC;AACD","ignoreList":[]}
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
+ }
@@ -1,35 +1,26 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import domReady from '@wordpress/dom-ready';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import addContainer from './script/add-container';
10
- import addIntroText from './script/add-intro-text';
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('assertive');
15
+ addContainer("assertive");
25
16
  }
26
17
  if (containerPolite === null) {
27
- addContainer('polite');
18
+ addContainer("polite");
28
19
  }
29
20
  }
30
-
31
- /**
32
- * Run setup on domReady.
33
- */
34
21
  domReady(setup);
35
- //# sourceMappingURL=index.js.map
22
+ export {
23
+ setup,
24
+ speak
25
+ };
26
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["domReady","addContainer","addIntroText","speak","setup","introText","document","getElementById","containerAssertive","containerPolite"],"sources":["@wordpress/a11y/src/index.js"],"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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;;AAE3C;AACA;AACA;AACA,OAAOC,YAAY,MAAM,wBAAwB;AACjD,OAAOC,YAAY,MAAM,yBAAyB;AAElD,SAASC,KAAK,QAAQ,gBAAgB;;AAEtC;AACA;AACA;AACA,OAAO,SAASC,KAAKA,CAAA,EAAG;EACvB,MAAMC,SAAS,GAAGC,QAAQ,CAACC,cAAc,CAAE,uBAAwB,CAAC;EACpE,MAAMC,kBAAkB,GAAGF,QAAQ,CAACC,cAAc,CACjD,sBACD,CAAC;EACD,MAAME,eAAe,GAAGH,QAAQ,CAACC,cAAc,CAAE,mBAAoB,CAAC;EAEtE,IAAKF,SAAS,KAAK,IAAI,EAAG;IACzBH,YAAY,CAAC,CAAC;EACf;EAEA,IAAKM,kBAAkB,KAAK,IAAI,EAAG;IAClCP,YAAY,CAAE,WAAY,CAAC;EAC5B;EAEA,IAAKQ,eAAe,KAAK,IAAI,EAAG;IAC/BR,YAAY,CAAE,QAAS,CAAC;EACzB;AACD;;AAEA;AACA;AACA;AACAD,QAAQ,CAAEI,KAAM,CAAC","ignoreList":[]}
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
- * Internal dependencies
3
- */
4
- export { speak } from '../shared/index';
5
-
6
- /**
7
- * This no-op function is exported to provide compatibility with the `wp-a11y` Script.
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
- {"version":3,"names":["speak","setup"],"sources":["@wordpress/a11y/src/module/index.ts"],"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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGA,CAAA,KAAM,CAAC,CAAC","ignoreList":[]}
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
- * Build the live regions markup.
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 = 'a11y-speak-region';
12
- container.setAttribute('style', 'position:absolute;' + 'margin:-1px;' + 'padding:0;' + 'height:1px;' + 'width:1px;' + 'overflow:hidden;' + 'clip-path:inset(50%);' + 'border:0;' + 'word-wrap:normal !important;');
13
- container.setAttribute('aria-live', ariaLive);
14
- container.setAttribute('aria-relevant', 'additions text');
15
- container.setAttribute('aria-atomic', 'true');
16
- const {
17
- body
18
- } = document;
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
- //# sourceMappingURL=add-container.js.map
18
+ export {
19
+ addContainer as default
20
+ };
21
+ //# sourceMappingURL=add-container.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["addContainer","ariaLive","container","document","createElement","id","className","setAttribute","body","appendChild"],"sources":["@wordpress/a11y/src/script/add-container.js"],"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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,YAAYA,CAAEC,QAAQ,GAAG,QAAQ,EAAG;EAC3D,MAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAa,CAAE,KAAM,CAAC;EACjDF,SAAS,CAACG,EAAE,GAAG,cAAeJ,QAAQ,EAAG;EACzCC,SAAS,CAACI,SAAS,GAAG,mBAAmB;EAEzCJ,SAAS,CAACK,YAAY,CACrB,OAAO,EACP,oBAAoB,GACnB,cAAc,GACd,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,kBAAkB,GAClB,uBAAuB,GACvB,WAAW,GACX,8BACF,CAAC;EACDL,SAAS,CAACK,YAAY,CAAE,WAAW,EAAEN,QAAS,CAAC;EAC/CC,SAAS,CAACK,YAAY,CAAE,eAAe,EAAE,gBAAiB,CAAC;EAC3DL,SAAS,CAACK,YAAY,CAAE,aAAa,EAAE,MAAO,CAAC;EAE/C,MAAM;IAAEC;EAAK,CAAC,GAAGL,QAAQ;EACzB,IAAKK,IAAI,EAAG;IACXA,IAAI,CAACC,WAAW,CAAEP,SAAU,CAAC;EAC9B;EAEA,OAAOA,SAAS;AACjB","ignoreList":[]}
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
- * WordPress dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
-
6
- /**
7
- * Build the explanatory text to be placed before the aria live regions.
8
- *
9
- * This text is initially hidden from assistive technologies by using a `hidden`
10
- * HTML attribute which is then removed once a message fills the aria-live regions.
11
- *
12
- * @return {HTMLParagraphElement} The explanatory text HTML element.
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
- //# sourceMappingURL=add-intro-text.js.map
18
+ export {
19
+ addIntroText as default
20
+ };
21
+ //# sourceMappingURL=add-intro-text.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__","addIntroText","introText","document","createElement","id","className","textContent","setAttribute","body","appendChild"],"sources":["@wordpress/a11y/src/script/add-intro-text.ts"],"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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC,MAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAa,CAAE,GAAI,CAAC;EAE/CF,SAAS,CAACG,EAAE,GAAG,uBAAuB;EACtCH,SAAS,CAACI,SAAS,GAAG,uBAAuB;EAC7CJ,SAAS,CAACK,WAAW,GAAGP,EAAE,CAAE,eAAgB,CAAC;EAE7CE,SAAS,CAACM,YAAY,CACrB,OAAO,EACP,oBAAoB,GACnB,cAAc,GACd,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,kBAAkB,GAClB,uBAAuB,GACvB,WAAW,GACX,8BACF,CAAC;EACDN,SAAS,CAACM,YAAY,CAAE,QAAQ,EAAE,EAAG,CAAC;EAEtC,MAAM;IAAEC;EAAK,CAAC,GAAGN,QAAQ;EACzB,IAAKM,IAAI,EAAG;IACXA,IAAI,CAACC,WAAW,CAAER,SAAU,CAAC;EAC9B;EAEA,OAAOA,SAAS;AACjB","ignoreList":[]}
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
- * Clears the a11y-speak-region elements and hides the explanatory text.
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('hidden', 'hidden');
8
+ introText.setAttribute("hidden", "hidden");
14
9
  }
15
10
  }
16
- //# sourceMappingURL=clear.js.map
11
+ export {
12
+ clear as default
13
+ };
14
+ //# sourceMappingURL=clear.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["clear","regions","document","getElementsByClassName","introText","getElementById","i","length","textContent","setAttribute"],"sources":["@wordpress/a11y/src/shared/clear.js"],"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"],"mappings":"AAAA;AACA;AACA;AACA,eAAe,SAASA,KAAKA,CAAA,EAAG;EAC/B,MAAMC,OAAO,GAAGC,QAAQ,CAACC,sBAAsB,CAAE,mBAAoB,CAAC;EACtE,MAAMC,SAAS,GAAGF,QAAQ,CAACG,cAAc,CAAE,uBAAwB,CAAC;EAEpE,KAAM,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,OAAO,CAACM,MAAM,EAAED,CAAC,EAAE,EAAG;IAC1CL,OAAO,CAAEK,CAAC,CAAE,CAACE,WAAW,GAAG,EAAE;EAC9B;;EAEA;EACA,IAAKJ,SAAS,EAAG;IAChBA,SAAS,CAACK,YAAY,CAAE,QAAQ,EAAE,QAAS,CAAC;EAC7C;AACD","ignoreList":[]}
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 += '\u00A0';
5
+ message += "\xA0";
26
6
  }
27
7
  previousMessage = message;
28
8
  return message;
29
9
  }
30
- //# sourceMappingURL=filter-message.js.map
10
+ export {
11
+ filterMessage as default
12
+ };
13
+ //# sourceMappingURL=filter-message.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["previousMessage","filterMessage","message","replace"],"sources":["@wordpress/a11y/src/shared/filter-message.js"],"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"],"mappings":"AAAA,IAAIA,eAAe,GAAG,EAAE;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,aAAaA,CAAEC,OAAO,EAAG;EAChD;AACD;AACA;AACA;AACA;AACA;AACA;EACCA,OAAO,GAAGA,OAAO,CAACC,OAAO,CAAE,WAAW,EAAE,GAAI,CAAC;;EAE7C;AACD;AACA;AACA;EACC,IAAKH,eAAe,KAAKE,OAAO,EAAG;IAClCA,OAAO,IAAI,QAAQ;EACpB;EAEAF,eAAe,GAAGE,OAAO;EAEzB,OAAOA,OAAO;AACf","ignoreList":[]}
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
- * Internal dependencies
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('a11y-speak-intro-text');
33
- const containerAssertive = document.getElementById('a11y-speak-assertive');
34
- const containerPolite = document.getElementById('a11y-speak-polite');
35
- if (containerAssertive && ariaLive === 'assertive') {
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('hidden');
17
+ introText.removeAttribute("hidden");
47
18
  }
48
19
  }
49
- //# sourceMappingURL=index.js.map
20
+ export {
21
+ speak
22
+ };
23
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["clear","filterMessage","speak","message","ariaLive","introText","document","getElementById","containerAssertive","containerPolite","textContent","removeAttribute"],"sources":["@wordpress/a11y/src/shared/index.js"],"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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,SAAS;AAC3B,OAAOC,aAAa,MAAM,kBAAkB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,KAAKA,CAAEC,OAAO,EAAEC,QAAQ,EAAG;EAC1C;AACD;AACA;AACA;EACCJ,KAAK,CAAC,CAAC;EAEPG,OAAO,GAAGF,aAAa,CAAEE,OAAQ,CAAC;EAElC,MAAME,SAAS,GAAGC,QAAQ,CAACC,cAAc,CAAE,uBAAwB,CAAC;EACpE,MAAMC,kBAAkB,GAAGF,QAAQ,CAACC,cAAc,CACjD,sBACD,CAAC;EACD,MAAME,eAAe,GAAGH,QAAQ,CAACC,cAAc,CAAE,mBAAoB,CAAC;EAEtE,IAAKC,kBAAkB,IAAIJ,QAAQ,KAAK,WAAW,EAAG;IACrDI,kBAAkB,CAACE,WAAW,GAAGP,OAAO;EACzC,CAAC,MAAM,IAAKM,eAAe,EAAG;IAC7BA,eAAe,CAACC,WAAW,GAAGP,OAAO;EACtC;;EAEA;AACD;AACA;AACA;EACC,IAAKE,SAAS,EAAG;IAChBA,SAAS,CAACM,eAAe,CAAE,QAAS,CAAC;EACtC;AACD","ignoreList":[]}
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.31.1-next.f56bd8138.0",
3
+ "version": "4.32.1-next.47f435fc9.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
- "@babel/runtime": "7.25.7",
35
- "@wordpress/dom-ready": "^4.31.1-next.f56bd8138.0",
36
- "@wordpress/i18n": "^6.4.1-next.f56bd8138.0"
42
+ "@wordpress/dom-ready": "^4.32.1-next.47f435fc9.0",
43
+ "@wordpress/i18n": "^6.5.1-next.47f435fc9.0"
37
44
  },
38
45
  "publishConfig": {
39
46
  "access": "public"
40
47
  },
41
- "gitHead": "ea4a281fd857f48338877590de8c8eb9b9a8cef4"
48
+ "gitHead": "9720f22c138771d2ed1a0522725c3cdf1c242953"
42
49
  }
@@ -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":[]}