mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-08 01:17:59 +01:00
7f7d48df61
The Script Module has the same API as the `wp-a11y` WP Script. Key changes: - Add `@wordpress/a11y` to the list of Script and Module dual packages. - Update `script-modules-packages.min.php` to include the a11y module. - Modify `WP_Script_Modules` class to track and handle a11y module availability. - Add method to print required HTML markup for a11y `speak()` functionality. See #60647. Props jonsurrell, gziolo, czapla. Built from https://develop.svn.wordpress.org/trunk@59089 git-svn-id: http://core.svn.wordpress.org/trunk@58485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
803 B
JavaScript
1 line
803 B
JavaScript
var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{m:()=>a,L:()=>o});let n="";function o(e,t){!function(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let t=0;t<e.length;t++)e[t].textContent="";t&&t.setAttribute("hidden","hidden")}(),e=function(e){return e=e.replace(/<[^<>]+>/g," "),n===e&&(e+=" "),n=e,e}(e);const o=document.getElementById("a11y-speak-intro-text"),a=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");a&&"assertive"===t?a.textContent=e:r&&(r.textContent=e),o&&o.removeAttribute("hidden")}const a=()=>{};var r=t.m,s=t.L;export{r as setup,s as speak}; |