UNPKG

@wordpress/a11y

Version:
25 lines (24 loc) 733 B
// packages/a11y/src/shared/index.ts import clear from "./clear.mjs"; import filterMessage from "./filter-message.mjs"; function speak(message, ariaLive) { clear(); message = filterMessage(message); const introText = document.getElementById("a11y-speak-intro-text"); const containerAssertive = document.getElementById( "a11y-speak-assertive" ); const containerPolite = document.getElementById("a11y-speak-polite"); if (containerAssertive && ariaLive === "assertive") { containerAssertive.textContent = message; } else if (containerPolite) { containerPolite.textContent = message; } if (introText) { introText.removeAttribute("hidden"); } } export { speak }; //# sourceMappingURL=index.mjs.map