WordPress/wp-includes/js/dist/a11y.js.map

1 line
10 KiB
Plaintext

{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/a11y/src/addContainer.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/a11y/src/clear.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/a11y/src/filterMessage.js","webpack://wp.[name]//Users/gziolo/PhpstormProjects/gutenberg/packages/a11y/src/index.js","webpack://wp.[name]/external {\"this\":[\"wp\",\"domReady\"]}"],"names":["addContainer","ariaLive","container","document","createElement","id","className","setAttribute","querySelector","appendChild","clear","regions","querySelectorAll","i","length","textContent","previousMessage","filterMessage","message","replace","setup","containerPolite","getElementById","containerAssertive","domReady","speak"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;;;;;;;AAOA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAAUC,QAAV,EAAqB;AACzCA,UAAQ,GAAGA,QAAQ,IAAI,QAAvB;AAEA,MAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAT,CAAwB,KAAxB,CAAlB;AACAF,W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Af;;;;;;;;;;;;;AC5BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;;;;AAGO,IAAMG,KAAK,GAAG,SAARA,KAAQ,GAAW;AAC/B,MAAIC,eAAe,GAAGlB,QAAQ,CAACmB,cAAT,CAAyB,mBAAzB,CAAtB;AACA,MAAIC,kBAAkB,GAAGpB,QAAQ,CAACmB,cAAT,CAAyB,sBAAzB,CAAzB;;AAEA,MAAKD,eAAe,KAAK,IAAzB,EAAgC;AAC/BA,mBAAe,GAAGrB,6DAAY,CAAE,QAAF,CAA9B;AACA;;AACD,MAAKuB,kBAAkB,KAAK,IAA5B,EAAmC;AAClCA,sBAAkB,GAAGvB,6DAAY,CAAE,WAAF,CAAjC;AACA;AACD,CAVM;AAYP;;;;AAGAwB,2DAAQ,CAAEJ,KAAF,CAAR;AAEA;;;;;;;;AAOO,IAAMK,KAAK,GAAG,SAARA,KAAQ,CAAUP,OAAV,EAAmBjB,QAAnB,EAA8B;AAClD;AACAS,wDAAK;AAELQ,SAAO,GAAGD,8DAAa,CAAEC,OAAF,CAAvB;AAEA,MAAMG,eAAe,GAAGlB,QAAQ,CAACmB,cAAT,CAAyB,mBAAzB,CAAxB;AACA,MAAMC,kBAAkB,GAAGpB,QAAQ,CAACmB,cAAT,CAAyB,sBAAzB,CAA3B;;AAEA,MAAKC,kBAAkB,IAAI,gBAAgBtB,QAA3C,EAAsD;AACrDsB,sBAAkB,CAACR,WAAnB,GAAiCG,OAAjC;AACA,GAFD,MAEO,IAAKG,eAAL,EAAuB;AAC7BA,mBAAe,CAACN,WAAhB,GAA8BG,OAA9B;AACA;AACD,CAdM;;;;;;;;;;;;AChCP,aAAa,yCAAyC,EAAE,I","file":"a11y.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/a11y/build-module/index.js\");\n","/**\n * Build the live regions markup.\n *\n * @param {string} ariaLive Optional. Value for the 'aria-live' attribute, default 'polite'.\n *\n * @return {Object} $container The ARIA live region jQuery object.\n */\nconst addContainer = function( ariaLive ) {\n\tariaLive = ariaLive || 'polite';\n\n\tconst container = document.createElement( 'div' );\n\tcontainer.id = 'a11y-speak-' + ariaLive;\n\tcontainer.className = 'a11y-speak-region';\n\n\tcontainer.setAttribute( 'style', (\n\t\t'position: absolute;' +\n\t\t'margin: -1px;' +\n\t\t'padding: 0;' +\n\t\t'height: 1px;' +\n\t\t'width: 1px;' +\n\t\t'overflow: hidden;' +\n\t\t'clip: rect(1px, 1px, 1px, 1px);' +\n\t\t'-webkit-clip-path: inset(50%);' +\n\t\t'clip-path: inset(50%);' +\n\t\t'border: 0;' +\n\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\tdocument.querySelector( 'body' ).appendChild( container );\n\treturn container;\n};\n\nexport default addContainer;\n","/**\n * Clear the a11y-speak-region elements.\n */\nconst clear = function() {\n\tconst regions = document.querySelectorAll( '.a11y-speak-region' );\n\tfor ( let i = 0; i < regions.length; i++ ) {\n\t\tregions[ i ].textContent = '';\n\t}\n};\n\nexport default clear;\n","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 */\nconst filterMessage = function( 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\tif ( previousMessage === message ) {\n\t\tmessage += '\\u00A0';\n\t}\n\n\tpreviousMessage = message;\n\n\treturn message;\n};\n\nexport default filterMessage;\n","import addContainer from './addContainer';\nimport clear from './clear';\nimport domReady from '@wordpress/dom-ready';\nimport filterMessage from './filterMessage';\n\n/**\n * Create the live regions.\n */\nexport const setup = function() {\n\tlet containerPolite = document.getElementById( 'a11y-speak-polite' );\n\tlet containerAssertive = document.getElementById( 'a11y-speak-assertive' );\n\n\tif ( containerPolite === null ) {\n\t\tcontainerPolite = addContainer( 'polite' );\n\t}\n\tif ( containerAssertive === null ) {\n\t\tcontainerAssertive = addContainer( 'assertive' );\n\t}\n};\n\n/**\n * Run setup on domReady.\n */\ndomReady( setup );\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 Optional. The politeness level for aria-live. Possible values:\n * polite or assertive. Default polite.\n */\nexport const speak = function( message, ariaLive ) {\n\t// Clear previous messages to allow repeated strings being read out.\n\tclear();\n\n\tmessage = filterMessage( message );\n\n\tconst containerPolite = document.getElementById( 'a11y-speak-polite' );\n\tconst containerAssertive = document.getElementById( 'a11y-speak-assertive' );\n\n\tif ( containerAssertive && 'assertive' === ariaLive ) {\n\t\tcontainerAssertive.textContent = message;\n\t} else if ( containerPolite ) {\n\t\tcontainerPolite.textContent = message;\n\t}\n};\n","(function() { module.exports = this[\"wp\"][\"domReady\"]; }());"],"sourceRoot":""}