author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 19 | 3d72ae0968f4 |
child 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1 |
/******/ (() => { // webpackBootstrap |
19 | 2 |
/******/ "use strict"; |
3 |
/******/ // The require scope |
|
4 |
/******/ var __webpack_require__ = {}; |
|
5 |
/******/ |
|
6 |
/************************************************************************/ |
|
7 |
/******/ /* webpack/runtime/compat get default export */ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
8 |
/******/ (() => { |
19 | 9 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
10 |
/******/ __webpack_require__.n = (module) => { |
19 | 11 |
/******/ var getter = module && module.__esModule ? |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
12 |
/******/ () => (module['default']) : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
13 |
/******/ () => (module); |
19 | 14 |
/******/ __webpack_require__.d(getter, { a: getter }); |
15 |
/******/ return getter; |
|
9 | 16 |
/******/ }; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
17 |
/******/ })(); |
19 | 18 |
/******/ |
19 |
/******/ /* webpack/runtime/define property getters */ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
20 |
/******/ (() => { |
19 | 21 |
/******/ // define getter functions for harmony exports |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
22 |
/******/ __webpack_require__.d = (exports, definition) => { |
19 | 23 |
/******/ for(var key in definition) { |
24 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
|
25 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
|
26 |
/******/ } |
|
27 |
/******/ } |
|
28 |
/******/ }; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
29 |
/******/ })(); |
19 | 30 |
/******/ |
31 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
32 |
/******/ (() => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
33 |
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
34 |
/******/ })(); |
19 | 35 |
/******/ |
36 |
/******/ /* webpack/runtime/make namespace object */ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
37 |
/******/ (() => { |
19 | 38 |
/******/ // define __esModule on exports |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
39 |
/******/ __webpack_require__.r = (exports) => { |
19 | 40 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
41 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|
42 |
/******/ } |
|
43 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|
44 |
/******/ }; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
45 |
/******/ })(); |
19 | 46 |
/******/ |
9 | 47 |
/************************************************************************/ |
19 | 48 |
var __webpack_exports__ = {}; |
16 | 49 |
// ESM COMPAT FLAG |
9 | 50 |
__webpack_require__.r(__webpack_exports__); |
51 |
||
16 | 52 |
// EXPORTS |
19 | 53 |
__webpack_require__.d(__webpack_exports__, { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
54 |
setup: () => (/* binding */ setup), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
55 |
speak: () => (/* binding */ speak) |
19 | 56 |
}); |
16 | 57 |
|
19 | 58 |
;// CONCATENATED MODULE: external ["wp","domReady"] |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
59 |
const external_wp_domReady_namespaceObject = window["wp"]["domReady"]; |
19 | 60 |
var external_wp_domReady_default = /*#__PURE__*/__webpack_require__.n(external_wp_domReady_namespaceObject); |
61 |
;// CONCATENATED MODULE: external ["wp","i18n"] |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
62 |
const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
19 | 63 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-intro-text.js |
16 | 64 |
/** |
65 |
* WordPress dependencies |
|
66 |
*/ |
|
67 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
68 |
|
16 | 69 |
/** |
70 |
* Build the explanatory text to be placed before the aria live regions. |
|
71 |
* |
|
72 |
* This text is initially hidden from assistive technologies by using a `hidden` |
|
73 |
* HTML attribute which is then removed once a message fills the aria-live regions. |
|
74 |
* |
|
75 |
* @return {HTMLParagraphElement} The explanatory text HTML element. |
|
76 |
*/ |
|
77 |
function addIntroText() { |
|
18 | 78 |
const introText = document.createElement('p'); |
16 | 79 |
introText.id = 'a11y-speak-intro-text'; |
80 |
introText.className = 'a11y-speak-intro-text'; |
|
19 | 81 |
introText.textContent = (0,external_wp_i18n_namespaceObject.__)('Notifications'); |
16 | 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;'); |
83 |
introText.setAttribute('hidden', 'hidden'); |
|
18 | 84 |
const { |
85 |
body |
|
86 |
} = document; |
|
16 | 87 |
if (body) { |
88 |
body.appendChild(introText); |
|
89 |
} |
|
90 |
return introText; |
|
91 |
} |
|
92 |
||
19 | 93 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js |
9 | 94 |
/** |
95 |
* Build the live regions markup. |
|
96 |
* |
|
16 | 97 |
* @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'. |
9 | 98 |
* |
16 | 99 |
* @return {HTMLDivElement} The ARIA live region HTML element. |
9 | 100 |
*/ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
101 |
function addContainer(ariaLive = 'polite') { |
18 | 102 |
const container = document.createElement('div'); |
103 |
container.id = `a11y-speak-${ariaLive}`; |
|
9 | 104 |
container.className = 'a11y-speak-region'; |
105 |
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;'); |
|
106 |
container.setAttribute('aria-live', ariaLive); |
|
107 |
container.setAttribute('aria-relevant', 'additions text'); |
|
108 |
container.setAttribute('aria-atomic', 'true'); |
|
18 | 109 |
const { |
110 |
body |
|
111 |
} = document; |
|
16 | 112 |
if (body) { |
113 |
body.appendChild(container); |
|
114 |
} |
|
9 | 115 |
return container; |
16 | 116 |
} |
9 | 117 |
|
19 | 118 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js |
9 | 119 |
/** |
16 | 120 |
* Clears the a11y-speak-region elements and hides the explanatory text. |
9 | 121 |
*/ |
16 | 122 |
function clear() { |
18 | 123 |
const regions = document.getElementsByClassName('a11y-speak-region'); |
124 |
const introText = document.getElementById('a11y-speak-intro-text'); |
|
125 |
for (let i = 0; i < regions.length; i++) { |
|
9 | 126 |
regions[i].textContent = ''; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
127 |
} |
16 | 128 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
129 |
// Make sure the explanatory text is hidden from assistive technologies. |
16 | 130 |
if (introText) { |
131 |
introText.setAttribute('hidden', 'hidden'); |
|
132 |
} |
|
133 |
} |
|
9 | 134 |
|
19 | 135 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js |
18 | 136 |
let previousMessage = ''; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
137 |
|
9 | 138 |
/** |
139 |
* Filter the message to be announced to the screenreader. |
|
140 |
* |
|
141 |
* @param {string} message The message to be announced. |
|
142 |
* |
|
143 |
* @return {string} The filtered message. |
|
144 |
*/ |
|
16 | 145 |
function filterMessage(message) { |
9 | 146 |
/* |
147 |
* Strip HTML tags (if any) from the message string. Ideally, messages should |
|
148 |
* be simple strings, carefully crafted for specific use with A11ySpeak. |
|
149 |
* When re-using already existing strings this will ensure simple HTML to be |
|
150 |
* stripped out and replaced with a space. Browsers will collapse multiple |
|
151 |
* spaces natively. |
|
152 |
*/ |
|
153 |
message = message.replace(/<[^<>]+>/g, ' '); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
154 |
|
16 | 155 |
/* |
156 |
* Safari + VoiceOver don't announce repeated, identical strings. We use |
|
157 |
* a `no-break space` to force them to think identical strings are different. |
|
158 |
*/ |
|
9 | 159 |
if (previousMessage === message) { |
18 | 160 |
message += '\u00A0'; |
9 | 161 |
} |
162 |
previousMessage = message; |
|
163 |
return message; |
|
16 | 164 |
} |
9 | 165 |
|
19 | 166 |
;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js |
9 | 167 |
/** |
168 |
* WordPress dependencies |
|
169 |
*/ |
|
170 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
171 |
|
9 | 172 |
/** |
173 |
* Internal dependencies |
|
174 |
*/ |
|
175 |
||
176 |
||
177 |
||
178 |
||
16 | 179 |
|
9 | 180 |
/** |
181 |
* Create the live regions. |
|
182 |
*/ |
|
16 | 183 |
function setup() { |
18 | 184 |
const introText = document.getElementById('a11y-speak-intro-text'); |
185 |
const containerAssertive = document.getElementById('a11y-speak-assertive'); |
|
186 |
const containerPolite = document.getElementById('a11y-speak-polite'); |
|
16 | 187 |
if (introText === null) { |
188 |
addIntroText(); |
|
9 | 189 |
} |
190 |
if (containerAssertive === null) { |
|
16 | 191 |
addContainer('assertive'); |
9 | 192 |
} |
16 | 193 |
if (containerPolite === null) { |
194 |
addContainer('polite'); |
|
195 |
} |
|
196 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
197 |
|
9 | 198 |
/** |
199 |
* Run setup on domReady. |
|
200 |
*/ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
201 |
external_wp_domReady_default()(setup); |
9 | 202 |
|
203 |
/** |
|
204 |
* Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions. |
|
16 | 205 |
* This module is inspired by the `speak` function in `wp-a11y.js`. |
9 | 206 |
* |
19 | 207 |
* @param {string} message The message to be announced by assistive technologies. |
16 | 208 |
* @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'. |
9 | 209 |
* |
210 |
* @example |
|
211 |
* ```js |
|
212 |
* import { speak } from '@wordpress/a11y'; |
|
213 |
* |
|
214 |
* // For polite messages that shouldn't interrupt what screen readers are currently announcing. |
|
215 |
* speak( 'The message you want to send to the ARIA live region' ); |
|
216 |
* |
|
217 |
* // For assertive messages that should interrupt what screen readers are currently announcing. |
|
218 |
* speak( 'The message you want to send to the ARIA live region', 'assertive' ); |
|
219 |
* ``` |
|
220 |
*/ |
|
16 | 221 |
function speak(message, ariaLive) { |
222 |
/* |
|
223 |
* Clear previous messages to allow repeated strings being read out and hide |
|
224 |
* the explanatory text from assistive technologies. |
|
225 |
*/ |
|
226 |
clear(); |
|
227 |
message = filterMessage(message); |
|
18 | 228 |
const introText = document.getElementById('a11y-speak-intro-text'); |
229 |
const containerAssertive = document.getElementById('a11y-speak-assertive'); |
|
230 |
const containerPolite = document.getElementById('a11y-speak-polite'); |
|
16 | 231 |
if (containerAssertive && ariaLive === 'assertive') { |
9 | 232 |
containerAssertive.textContent = message; |
233 |
} else if (containerPolite) { |
|
234 |
containerPolite.textContent = message; |
|
235 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
236 |
|
16 | 237 |
/* |
238 |
* Make the explanatory text available to assistive technologies by removing |
|
239 |
* the 'hidden' HTML attribute. |
|
240 |
*/ |
|
241 |
if (introText) { |
|
242 |
introText.removeAttribute('hidden'); |
|
243 |
} |
|
244 |
} |
|
9 | 245 |
|
19 | 246 |
(window.wp = window.wp || {}).a11y = __webpack_exports__; |
247 |
/******/ })() |
|
248 |
; |