first commit
This commit is contained in:
176
wp-includes/js/dist/a11y.js
vendored
Normal file
176
wp-includes/js/dist/a11y.js
vendored
Normal file
@@ -0,0 +1,176 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
setup: () => (/* binding */ setup),
|
||||
speak: () => (/* reexport */ speak)
|
||||
});
|
||||
|
||||
;// external ["wp","domReady"]
|
||||
const external_wp_domReady_namespaceObject = window["wp"]["domReady"];
|
||||
var external_wp_domReady_default = /*#__PURE__*/__webpack_require__.n(external_wp_domReady_namespaceObject);
|
||||
;// ./node_modules/@wordpress/a11y/build-module/script/add-container.js
|
||||
function addContainer(ariaLive = "polite") {
|
||||
const container = document.createElement("div");
|
||||
container.id = `a11y-speak-${ariaLive}`;
|
||||
container.className = "a11y-speak-region";
|
||||
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;"
|
||||
);
|
||||
container.setAttribute("aria-live", ariaLive);
|
||||
container.setAttribute("aria-relevant", "additions text");
|
||||
container.setAttribute("aria-atomic", "true");
|
||||
const { body } = document;
|
||||
if (body) {
|
||||
body.appendChild(container);
|
||||
}
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
;// external ["wp","i18n"]
|
||||
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
||||
;// ./node_modules/@wordpress/a11y/build-module/script/add-intro-text.js
|
||||
|
||||
function addIntroText() {
|
||||
const introText = document.createElement("p");
|
||||
introText.id = "a11y-speak-intro-text";
|
||||
introText.className = "a11y-speak-intro-text";
|
||||
introText.textContent = (0,external_wp_i18n_namespaceObject.__)("Notifications");
|
||||
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;"
|
||||
);
|
||||
introText.setAttribute("hidden", "");
|
||||
const { body } = document;
|
||||
if (body) {
|
||||
body.appendChild(introText);
|
||||
}
|
||||
return introText;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/a11y/build-module/shared/clear.js
|
||||
function clear() {
|
||||
const regions = document.getElementsByClassName("a11y-speak-region");
|
||||
const introText = document.getElementById("a11y-speak-intro-text");
|
||||
for (let i = 0; i < regions.length; i++) {
|
||||
regions[i].textContent = "";
|
||||
}
|
||||
if (introText) {
|
||||
introText.setAttribute("hidden", "hidden");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/a11y/build-module/shared/filter-message.js
|
||||
let previousMessage = "";
|
||||
function filterMessage(message) {
|
||||
message = message.replace(/<[^<>]+>/g, " ");
|
||||
if (previousMessage === message) {
|
||||
message += "\xA0";
|
||||
}
|
||||
previousMessage = message;
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/a11y/build-module/shared/index.js
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;// ./node_modules/@wordpress/a11y/build-module/index.js
|
||||
|
||||
|
||||
|
||||
|
||||
function setup() {
|
||||
const introText = document.getElementById("a11y-speak-intro-text");
|
||||
const containerAssertive = document.getElementById(
|
||||
"a11y-speak-assertive"
|
||||
);
|
||||
const containerPolite = document.getElementById("a11y-speak-polite");
|
||||
if (introText === null) {
|
||||
addIntroText();
|
||||
}
|
||||
if (containerAssertive === null) {
|
||||
addContainer("assertive");
|
||||
}
|
||||
if (containerPolite === null) {
|
||||
addContainer("polite");
|
||||
}
|
||||
}
|
||||
external_wp_domReady_default()(setup);
|
||||
|
||||
|
||||
(window.wp = window.wp || {}).a11y = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
Reference in New Issue
Block a user