wp/wp-includes/js/dist/a11y.js
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
     1 this["wp"] = this["wp"] || {}; this["wp"]["a11y"] =
     1 /******/ (function() { // webpackBootstrap
     2 /******/ (function(modules) { // webpackBootstrap
     2 /******/ 	"use strict";
     3 /******/ 	// The module cache
     3 /******/ 	// The require scope
     4 /******/ 	var installedModules = {};
     4 /******/ 	var __webpack_require__ = {};
     5 /******/
     5 /******/ 	
     6 /******/ 	// The require function
     6 /************************************************************************/
     7 /******/ 	function __webpack_require__(moduleId) {
     7 /******/ 	/* webpack/runtime/compat get default export */
     8 /******/
     8 /******/ 	!function() {
     9 /******/ 		// Check if module is in cache
     9 /******/ 		// getDefaultExport function for compatibility with non-harmony modules
    10 /******/ 		if(installedModules[moduleId]) {
    10 /******/ 		__webpack_require__.n = function(module) {
    11 /******/ 			return installedModules[moduleId].exports;
    11 /******/ 			var getter = module && module.__esModule ?
    12 /******/ 		}
    12 /******/ 				function() { return module['default']; } :
    13 /******/ 		// Create a new module (and put it into the cache)
    13 /******/ 				function() { return module; };
    14 /******/ 		var module = installedModules[moduleId] = {
    14 /******/ 			__webpack_require__.d(getter, { a: getter });
    15 /******/ 			i: moduleId,
    15 /******/ 			return getter;
    16 /******/ 			l: false,
       
    17 /******/ 			exports: {}
       
    18 /******/ 		};
    16 /******/ 		};
    19 /******/
    17 /******/ 	}();
    20 /******/ 		// Execute the module function
    18 /******/ 	
    21 /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
    19 /******/ 	/* webpack/runtime/define property getters */
    22 /******/
    20 /******/ 	!function() {
    23 /******/ 		// Flag the module as loaded
    21 /******/ 		// define getter functions for harmony exports
    24 /******/ 		module.l = true;
    22 /******/ 		__webpack_require__.d = function(exports, definition) {
    25 /******/
    23 /******/ 			for(var key in definition) {
    26 /******/ 		// Return the exports of the module
    24 /******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
    27 /******/ 		return module.exports;
    25 /******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
    28 /******/ 	}
    26 /******/ 				}
    29 /******/
    27 /******/ 			}
    30 /******/
    28 /******/ 		};
    31 /******/ 	// expose the modules object (__webpack_modules__)
    29 /******/ 	}();
    32 /******/ 	__webpack_require__.m = modules;
    30 /******/ 	
    33 /******/
    31 /******/ 	/* webpack/runtime/hasOwnProperty shorthand */
    34 /******/ 	// expose the module cache
    32 /******/ 	!function() {
    35 /******/ 	__webpack_require__.c = installedModules;
    33 /******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
    36 /******/
    34 /******/ 	}();
    37 /******/ 	// define getter function for harmony exports
    35 /******/ 	
    38 /******/ 	__webpack_require__.d = function(exports, name, getter) {
    36 /******/ 	/* webpack/runtime/make namespace object */
    39 /******/ 		if(!__webpack_require__.o(exports, name)) {
    37 /******/ 	!function() {
    40 /******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
    38 /******/ 		// define __esModule on exports
    41 /******/ 		}
    39 /******/ 		__webpack_require__.r = function(exports) {
    42 /******/ 	};
    40 /******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
    43 /******/
    41 /******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
    44 /******/ 	// define __esModule on exports
    42 /******/ 			}
    45 /******/ 	__webpack_require__.r = function(exports) {
    43 /******/ 			Object.defineProperty(exports, '__esModule', { value: true });
    46 /******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
    44 /******/ 		};
    47 /******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
    45 /******/ 	}();
    48 /******/ 		}
    46 /******/ 	
    49 /******/ 		Object.defineProperty(exports, '__esModule', { value: true });
       
    50 /******/ 	};
       
    51 /******/
       
    52 /******/ 	// create a fake namespace object
       
    53 /******/ 	// mode & 1: value is a module id, require it
       
    54 /******/ 	// mode & 2: merge all properties of value into the ns
       
    55 /******/ 	// mode & 4: return value when already ns object
       
    56 /******/ 	// mode & 8|1: behave like require
       
    57 /******/ 	__webpack_require__.t = function(value, mode) {
       
    58 /******/ 		if(mode & 1) value = __webpack_require__(value);
       
    59 /******/ 		if(mode & 8) return value;
       
    60 /******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
       
    61 /******/ 		var ns = Object.create(null);
       
    62 /******/ 		__webpack_require__.r(ns);
       
    63 /******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
       
    64 /******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
       
    65 /******/ 		return ns;
       
    66 /******/ 	};
       
    67 /******/
       
    68 /******/ 	// getDefaultExport function for compatibility with non-harmony modules
       
    69 /******/ 	__webpack_require__.n = function(module) {
       
    70 /******/ 		var getter = module && module.__esModule ?
       
    71 /******/ 			function getDefault() { return module['default']; } :
       
    72 /******/ 			function getModuleExports() { return module; };
       
    73 /******/ 		__webpack_require__.d(getter, 'a', getter);
       
    74 /******/ 		return getter;
       
    75 /******/ 	};
       
    76 /******/
       
    77 /******/ 	// Object.prototype.hasOwnProperty.call
       
    78 /******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
       
    79 /******/
       
    80 /******/ 	// __webpack_public_path__
       
    81 /******/ 	__webpack_require__.p = "";
       
    82 /******/
       
    83 /******/
       
    84 /******/ 	// Load entry module and return exports
       
    85 /******/ 	return __webpack_require__(__webpack_require__.s = "jncB");
       
    86 /******/ })
       
    87 /************************************************************************/
    47 /************************************************************************/
    88 /******/ ({
    48 var __webpack_exports__ = {};
    89 
       
    90 /***/ "Y8OO":
       
    91 /***/ (function(module, exports) {
       
    92 
       
    93 (function() { module.exports = window["wp"]["domReady"]; }());
       
    94 
       
    95 /***/ }),
       
    96 
       
    97 /***/ "jncB":
       
    98 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
    99 
       
   100 "use strict";
       
   101 // ESM COMPAT FLAG
    49 // ESM COMPAT FLAG
   102 __webpack_require__.r(__webpack_exports__);
    50 __webpack_require__.r(__webpack_exports__);
   103 
    51 
   104 // EXPORTS
    52 // EXPORTS
   105 __webpack_require__.d(__webpack_exports__, "setup", function() { return /* binding */ setup; });
    53 __webpack_require__.d(__webpack_exports__, {
   106 __webpack_require__.d(__webpack_exports__, "speak", function() { return /* binding */ speak; });
    54   "setup": function() { return /* binding */ setup; },
   107 
    55   "speak": function() { return /* binding */ speak; }
   108 // EXTERNAL MODULE: external ["wp","domReady"]
    56 });
   109 var external_wp_domReady_ = __webpack_require__("Y8OO");
    57 
   110 var external_wp_domReady_default = /*#__PURE__*/__webpack_require__.n(external_wp_domReady_);
    58 ;// CONCATENATED MODULE: external ["wp","domReady"]
   111 
    59 var external_wp_domReady_namespaceObject = window["wp"]["domReady"];
   112 // EXTERNAL MODULE: external ["wp","i18n"]
    60 var external_wp_domReady_default = /*#__PURE__*/__webpack_require__.n(external_wp_domReady_namespaceObject);
   113 var external_wp_i18n_ = __webpack_require__("l3Sj");
    61 ;// CONCATENATED MODULE: external ["wp","i18n"]
   114 
    62 var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
   115 // CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-intro-text.js
    63 ;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-intro-text.js
   116 /**
    64 /**
   117  * WordPress dependencies
    65  * WordPress dependencies
   118  */
    66  */
   119 
    67 
   120 /**
    68 /**
   128 
    76 
   129 function addIntroText() {
    77 function addIntroText() {
   130   const introText = document.createElement('p');
    78   const introText = document.createElement('p');
   131   introText.id = 'a11y-speak-intro-text';
    79   introText.id = 'a11y-speak-intro-text';
   132   introText.className = 'a11y-speak-intro-text';
    80   introText.className = 'a11y-speak-intro-text';
   133   introText.textContent = Object(external_wp_i18n_["__"])('Notifications');
    81   introText.textContent = (0,external_wp_i18n_namespaceObject.__)('Notifications');
   134   introText.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
    82   introText.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
   135   introText.setAttribute('hidden', 'hidden');
    83   introText.setAttribute('hidden', 'hidden');
   136   const {
    84   const {
   137     body
    85     body
   138   } = document;
    86   } = document;
   142   }
    90   }
   143 
    91 
   144   return introText;
    92   return introText;
   145 }
    93 }
   146 
    94 
   147 // CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js
    95 ;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js
   148 /**
    96 /**
   149  * Build the live regions markup.
    97  * Build the live regions markup.
   150  *
    98  *
   151  * @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
    99  * @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
   152  *
   100  *
   153  * @return {HTMLDivElement} The ARIA live region HTML element.
   101  * @return {HTMLDivElement} The ARIA live region HTML element.
   154  */
   102  */
   155 function addContainer(ariaLive = 'polite') {
   103 function addContainer() {
       
   104   let ariaLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'polite';
   156   const container = document.createElement('div');
   105   const container = document.createElement('div');
   157   container.id = `a11y-speak-${ariaLive}`;
   106   container.id = `a11y-speak-${ariaLive}`;
   158   container.className = 'a11y-speak-region';
   107   container.className = 'a11y-speak-region';
   159   container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
   108   container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
   160   container.setAttribute('aria-live', ariaLive);
   109   container.setAttribute('aria-live', ariaLive);
   169   }
   118   }
   170 
   119 
   171   return container;
   120   return container;
   172 }
   121 }
   173 
   122 
   174 // CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js
   123 ;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js
   175 /**
   124 /**
   176  * Clears the a11y-speak-region elements and hides the explanatory text.
   125  * Clears the a11y-speak-region elements and hides the explanatory text.
   177  */
   126  */
   178 function clear() {
   127 function clear() {
   179   const regions = document.getElementsByClassName('a11y-speak-region');
   128   const regions = document.getElementsByClassName('a11y-speak-region');
   187   if (introText) {
   136   if (introText) {
   188     introText.setAttribute('hidden', 'hidden');
   137     introText.setAttribute('hidden', 'hidden');
   189   }
   138   }
   190 }
   139 }
   191 
   140 
   192 // CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js
   141 ;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js
   193 let previousMessage = '';
   142 let previousMessage = '';
   194 /**
   143 /**
   195  * Filter the message to be announced to the screenreader.
   144  * Filter the message to be announced to the screenreader.
   196  *
   145  *
   197  * @param {string} message The message to be announced.
   146  * @param {string} message The message to be announced.
   219 
   168 
   220   previousMessage = message;
   169   previousMessage = message;
   221   return message;
   170   return message;
   222 }
   171 }
   223 
   172 
   224 // CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js
   173 ;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js
   225 /**
   174 /**
   226  * WordPress dependencies
   175  * WordPress dependencies
   227  */
   176  */
   228 
   177 
   229 /**
   178 /**
   262 external_wp_domReady_default()(setup);
   211 external_wp_domReady_default()(setup);
   263 /**
   212 /**
   264  * Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
   213  * Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
   265  * This module is inspired by the `speak` function in `wp-a11y.js`.
   214  * This module is inspired by the `speak` function in `wp-a11y.js`.
   266  *
   215  *
   267  * @param {string} message  The message to be announced by assistive technologies.
   216  * @param {string} message    The message to be announced by assistive technologies.
   268  * @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.
   217  * @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.
   269  *
   218  *
   270  * @example
   219  * @example
   271  * ```js
   220  * ```js
   272  * import { speak } from '@wordpress/a11y';
   221  * import { speak } from '@wordpress/a11y';
   304   if (introText) {
   253   if (introText) {
   305     introText.removeAttribute('hidden');
   254     introText.removeAttribute('hidden');
   306   }
   255   }
   307 }
   256 }
   308 
   257 
   309 
   258 (window.wp = window.wp || {}).a11y = __webpack_exports__;
   310 /***/ }),
   259 /******/ })()
   311 
   260 ;
   312 /***/ "l3Sj":
       
   313 /***/ (function(module, exports) {
       
   314 
       
   315 (function() { module.exports = window["wp"]["i18n"]; }());
       
   316 
       
   317 /***/ })
       
   318 
       
   319 /******/ });