@react-aria/live-announcer 3.4.1 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAID,8DAA8D,GAC9D,MAAM,iDAA2B;AAEjC,IAAI,sCAAsC;AAOnC,SAAS,0CACd,OAAgB,EAChB,gBAA+B,WAAW,EAC1C,UAAU,8CAAwB;IAElC,IAAI,CAAC,qCAAe;QAClB,sCAAgB,IAAI;QACpB,4EAA4E;QAC5E,wEAAwE;QACxE,mFAAmF;QAEnF,iGAAiG;QACjG,sDAAsD;QACtD,2DAA2D;QAC3D,aAAa;QACb,IAAI,CAAE,CAAA,OAAO,6BAA6B,YAAY,2BAA2B,OAAO,SAAS,WAAU,GACzG,WAAW;YACT,IAAI,gDAAA,0DAAA,oCAAe,UAAU,IAC3B,gDAAA,0DAAA,oCAAe,QAAQ,CAAC,SAAS,eAAe;QAEpD,GAAG;aAEH,oCAAc,QAAQ,CAAC,SAAS,eAAe;IAEnD,OACE,oCAAc,QAAQ,CAAC,SAAS,eAAe;AAEnD;AAKO,SAAS,0CAAe,aAA4B;IACzD,IAAI,qCACF,oCAAc,KAAK,CAAC;AAExB;AAKO,SAAS;IACd,IAAI,qCAAe;QACjB,oCAAc,OAAO;QACrB,sCAAgB;IAClB;AACF;AAEA,2FAA2F;AAC3F,0FAA0F;AAC1F,mGAAmG;AACnG,iGAAiG;AACjG,0EAA0E;AAC1E,sHAAsH;AACtH,MAAM;IAiCJ,aAAa;YACJ;QAAP,QAAO,aAAA,IAAI,CAAC,IAAI,cAAT,iCAAA,WAAW,WAAW;IAC/B;IAEA,UAAU,QAAgB,EAAE;QAC1B,IAAI,OAAO,SAAS,aAAa,CAAC;QAClC,KAAK,YAAY,CAAC,QAAQ;QAC1B,KAAK,YAAY,CAAC,aAAa;QAC/B,KAAK,YAAY,CAAC,iBAAiB;Q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AC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;gBAC7B,QAAQ;gBACR,MAAM;gBACN,UAAU;gBACV,QAAQ;gBACR,QAAQ;gBACR,UAAU;gBACV,SAAS;gBACT,UAAU;gBACV,OAAO;gBACP,YAAY;YACd;YAEA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY;YAEvC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS;YAEpC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACjC;IACF;AA+DF","sources":["packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\ntype Assertiveness = 'assertive' | 'polite';\n\n/* Inspired by https://github.com/AlmeroSteyn/react-aria-live */\nconst LIVEREGION_TIMEOUT_DELAY = 7000;\n\nlet liveAnnouncer: LiveAnnouncer | null = null;\n\ntype Message = string | {'aria-labelledby': string};\n\n/**\n * Announces the message using screen reader technology.\n */\nexport function announce(\n message: Message,\n assertiveness: Assertiveness = 'assertive',\n timeout = LIVEREGION_TIMEOUT_DELAY\n) {\n if (!liveAnnouncer) {\n liveAnnouncer = new LiveAnnouncer();\n // wait for the live announcer regions to be added to the dom, then announce\n // otherwise Safari won't announce the message if it's added too quickly\n // found most times less than 100ms were not consistent when announcing with Safari\n\n // IS_REACT_ACT_ENVIRONMENT is used by React 18. Previous versions checked for the `jest` global.\n // https://github.com/reactwg/react-18/discussions/102\n // if we're in a test environment, announce without waiting\n // @ts-ignore\n if (!(typeof IS_REACT_ACT_ENVIRONMENT === 'boolean' ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== 'undefined')) {\n setTimeout(() => {\n if (liveAnnouncer?.isAttached()) {\n liveAnnouncer?.announce(message, assertiveness, timeout);\n }\n }, 100);\n } else {\n liveAnnouncer.announce(message, assertiveness, timeout);\n }\n } else {\n liveAnnouncer.announce(message, assertiveness, timeout);\n }\n}\n\n/**\n * Stops all queued announcements.\n */\nexport function clearAnnouncer(assertiveness: Assertiveness) {\n if (liveAnnouncer) {\n liveAnnouncer.clear(assertiveness);\n }\n}\n\n/**\n * Removes the announcer from the DOM.\n */\nexport function destroyAnnouncer() {\n if (liveAnnouncer) {\n liveAnnouncer.destroy();\n liveAnnouncer = null;\n }\n}\n\n// LiveAnnouncer is implemented using vanilla DOM, not React. That's because as of React 18\n// ReactDOM.render is deprecated, and the replacement, ReactDOM.createRoot is moved into a\n// subpath import `react-dom/client`. That makes it hard for us to support multiple React versions.\n// As a global API, we can't use portals without introducing a breaking API change. LiveAnnouncer\n// is simple enough to implement without React, so that's what we do here.\n// See this discussion for more details: https://github.com/reactwg/react-18/discussions/125#discussioncomment-2382638\nclass LiveAnnouncer {\n node: HTMLElement | null = null;\n assertiveLog: HTMLElement | null = null;\n politeLog: HTMLElement | null = null;\n\n constructor() {\n if (typeof document !== 'undefined') {\n this.node = document.createElement('div');\n this.node.dataset.liveAnnouncer = 'true';\n // copied from VisuallyHidden\n Object.assign(this.node.style, {\n border: 0,\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n width: '1px',\n whiteSpace: 'nowrap'\n });\n\n this.assertiveLog = this.createLog('assertive');\n this.node.appendChild(this.assertiveLog);\n\n this.politeLog = this.createLog('polite');\n this.node.appendChild(this.politeLog);\n\n document.body.prepend(this.node);\n }\n }\n\n isAttached() {\n return this.node?.isConnected;\n }\n\n createLog(ariaLive: string) {\n let node = document.createElement('div');\n node.setAttribute('role', 'log');\n node.setAttribute('aria-live', ariaLive);\n node.setAttribute('aria-relevant', 'additions');\n return node;\n }\n\n destroy() {\n if (!this.node) {\n return;\n }\n\n document.body.removeChild(this.node);\n this.node = null;\n }\n\n announce(message: Message, assertiveness = 'assertive', timeout = LIVEREGION_TIMEOUT_DELAY) {\n if (!this.node) {\n return;\n }\n\n let node = document.createElement('div');\n if (typeof message === 'object') {\n // To read an aria-labelledby, the element must have an appropriate role, such as img.\n node.setAttribute('role', 'img');\n node.setAttribute('aria-labelledby', message['aria-labelledby']);\n } else {\n node.textContent = message;\n }\n\n if (assertiveness === 'assertive') {\n this.assertiveLog?.appendChild(node);\n } else {\n this.politeLog?.appendChild(node);\n }\n\n if (message !== '') {\n setTimeout(() => {\n node.remove();\n }, timeout);\n }\n }\n\n clear(assertiveness: Assertiveness) {\n if (!this.node) {\n return;\n }\n\n if ((!assertiveness || assertiveness === 'assertive') && this.assertiveLog) {\n this.assertiveLog.innerHTML = '';\n }\n\n if ((!assertiveness || assertiveness === 'polite') && this.politeLog) {\n this.politeLog.innerHTML = '';\n }\n }\n}\n"],"names":[],"version":3,"file":"LiveAnnouncer.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAID,8DAA8D,GAC9D,MAAM,iDAA2B;AAEjC,IAAI,sCAAsC;AAOnC,SAAS,0CACd,OAAgB,EAChB,gBAA+B,WAAW,EAC1C,UAAU,8CAAwB;IAElC,IAAI,CAAC,qCAAe;QAClB,sCAAgB,IAAI;QACpB,4EAA4E;QAC5E,wEAAwE;QACxE,mFAAmF;QAEnF,iGAAiG;QACjG,sDAAsD;QACtD,2DAA2D;QAC3D,aAAa;QACb,IAAI,CAAE,CAAA,OAAO,6BAA6B,YAAY,2BAA2B,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.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\ntype Assertiveness = 'assertive' | 'polite';\n\n/* Inspired by https://github.com/AlmeroSteyn/react-aria-live */\nconst LIVEREGION_TIMEOUT_DELAY = 7000;\n\nlet liveAnnouncer: LiveAnnouncer | null = null;\n\ntype Message = string | {'aria-labelledby': string};\n\n/**\n * Announces the message using screen reader technology.\n */\nexport function announce(\n message: Message,\n assertiveness: Assertiveness = 'assertive',\n timeout = LIVEREGION_TIMEOUT_DELAY\n): void {\n if (!liveAnnouncer) {\n liveAnnouncer = new LiveAnnouncer();\n // wait for the live announcer regions to be added to the dom, then announce\n // otherwise Safari won't announce the message if it's added too quickly\n // found most times less than 100ms were not consistent when announcing with Safari\n\n // IS_REACT_ACT_ENVIRONMENT is used by React 18. Previous versions checked for the `jest` global.\n // https://github.com/reactwg/react-18/discussions/102\n // if we're in a test environment, announce without waiting\n // @ts-ignore\n if (!(typeof IS_REACT_ACT_ENVIRONMENT === 'boolean' ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== 'undefined')) {\n setTimeout(() => {\n if (liveAnnouncer?.isAttached()) {\n liveAnnouncer?.announce(message, assertiveness, timeout);\n }\n }, 100);\n } else {\n liveAnnouncer.announce(message, assertiveness, timeout);\n }\n } else {\n liveAnnouncer.announce(message, assertiveness, timeout);\n }\n}\n\n/**\n * Stops all queued announcements.\n */\nexport function clearAnnouncer(assertiveness: Assertiveness): void {\n if (liveAnnouncer) {\n liveAnnouncer.clear(assertiveness);\n }\n}\n\n/**\n * Removes the announcer from the DOM.\n */\nexport function destroyAnnouncer(): void {\n if (liveAnnouncer) {\n liveAnnouncer.destroy();\n liveAnnouncer = null;\n }\n}\n\n// LiveAnnouncer is implemented using vanilla DOM, not React. That's because as of React 18\n// ReactDOM.render is deprecated, and the replacement, ReactDOM.createRoot is moved into a\n// subpath import `react-dom/client`. That makes it hard for us to support multiple React versions.\n// As a global API, we can't use portals without introducing a breaking API change. LiveAnnouncer\n// is simple enough to implement without React, so that's what we do here.\n// See this discussion for more details: https://github.com/reactwg/react-18/discussions/125#discussioncomment-2382638\nclass LiveAnnouncer {\n node: HTMLElement | null = null;\n assertiveLog: HTMLElement | null = null;\n politeLog: HTMLElement | null = null;\n\n constructor() {\n if (typeof document !== 'undefined') {\n this.node = document.createElement('div');\n this.node.dataset.liveAnnouncer = 'true';\n // copied from VisuallyHidden\n Object.assign(this.node.style, {\n border: 0,\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n width: '1px',\n whiteSpace: 'nowrap'\n });\n\n this.assertiveLog = this.createLog('assertive');\n this.node.appendChild(this.assertiveLog);\n\n this.politeLog = this.createLog('polite');\n this.node.appendChild(this.politeLog);\n\n document.body.prepend(this.node);\n }\n }\n\n isAttached() {\n return this.node?.isConnected;\n }\n\n createLog(ariaLive: string) {\n let node = document.createElement('div');\n node.setAttribute('role', 'log');\n node.setAttribute('aria-live', ariaLive);\n node.setAttribute('aria-relevant', 'additions');\n return node;\n }\n\n destroy() {\n if (!this.node) {\n return;\n }\n\n document.body.removeChild(this.node);\n this.node = null;\n }\n\n announce(message: Message, assertiveness = 'assertive', timeout = LIVEREGION_TIMEOUT_DELAY) {\n if (!this.node) {\n return;\n }\n\n let node = document.createElement('div');\n if (typeof message === 'object') {\n // To read an aria-labelledby, the element must have an appropriate role, such as img.\n node.setAttribute('role', 'img');\n node.setAttribute('aria-labelledby', message['aria-labelledby']);\n } else {\n node.textContent = message;\n }\n\n if (assertiveness === 'assertive') {\n this.assertiveLog?.appendChild(node);\n } else {\n this.politeLog?.appendChild(node);\n }\n\n if (message !== '') {\n setTimeout(() => {\n node.remove();\n }, timeout);\n }\n }\n\n clear(assertiveness: Assertiveness) {\n if (!this.node) {\n return;\n }\n\n if ((!assertiveness || assertiveness === 'assertive') && this.assertiveLog) {\n this.assertiveLog.innerHTML = '';\n }\n\n if ((!assertiveness || assertiveness === 'polite') && this.politeLog) {\n this.politeLog.innerHTML = '';\n }\n }\n}\n"],"names":[],"version":3,"file":"LiveAnnouncer.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;CAUC,GAID,8DAA8D,GAC9D,MAAM,iDAA2B;AAEjC,IAAI,sCAAsC;AAOnC,SAAS,0CACd,OAAgB,EAChB,gBAA+B,WAAW,EAC1C,UAAU,8CAAwB;IAElC,IAAI,CAAC,qCAAe;QAClB,sCAAgB,IAAI;QACpB,4EAA4E;QAC5E,wEAAwE;QACxE,mFAAmF;QAEnF,iGAAiG;QACjG,sDAAsD;QACtD,2DAA2D;QAC3D,aAAa;QACb,IAAI,CAAE,CAAA,OAAO,6BAA6B,YAAY,2BAA2B,OAAO,SAAS,WAAU,GACzG,WAAW;YACT,IAAI,gDAAA,0DAAA,oCAAe,UAAU,IAC3B,gDAAA,0DAAA,oCAAe,QAAQ,CAAC,SAAS,eAAe;QAEpD,GAAG;aAEH,oCAAc,QAAQ,CAAC,SAAS,eAAe;IAEnD,OACE,oCAAc,QAAQ,CAAC,SAAS,eAAe;AAEnD;AAKO,SAAS,0CAAe,aAA4B;IACzD,IAAI,qCACF,oCAAc,KAAK,CAAC;AAExB;AAKO,SAAS;IACd,IAAI,qCAAe;QACjB,oCAAc,OAAO;QACrB,sCAAgB;IAClB;AACF;AAEA,2FAA2F;AAC3F,0FAA0F;AAC1F,mGAAmG;AACnG,iGAAiG;AACjG,0EAA0E;AAC1E,sHAAsH;AACtH,MAAM;IAiCJ,aAAa;YACJ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AE/B;IAxFA,aAAc;aAJd,OAA2B;aAC3B,eAAmC;aACnC,YAAgC;QAG9B,IAAI,OAAO,aAAa,aAAa;YACnC,IAAI,CAAC,IAAI,GAAG,SAAS,aAAa,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,GAAG;YAClC,6BAA6B;YAC7B,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;gBAC7B,QAAQ;gBACR,MAAM;gBACN,UAAU;gBACV,QAAQ;gBACR,QAAQ;gBACR,UAAU;gBACV,SAAS;gBACT,UAAU;gBACV,OAAO;gBACP,YAAY;YACd;YAEA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY;YAEvC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS;YAEpC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACjC;IACF;AA+DF","sources":["packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\ntype Assertiveness = 'assertive' | 'polite';\n\n/* Inspired by https://github.com/AlmeroSteyn/react-aria-live */\nconst LIVEREGION_TIMEOUT_DELAY = 7000;\n\nlet liveAnnouncer: LiveAnnouncer | null = null;\n\ntype Message = string | {'aria-labelledby': string};\n\n/**\n * Announces the message using screen reader technology.\n */\nexport function announce(\n message: Message,\n assertiveness: Assertiveness = 'assertive',\n timeout = LIVEREGION_TIMEOUT_DELAY\n) {\n if (!liveAnnouncer) {\n liveAnnouncer = new LiveAnnouncer();\n // wait for the live announcer regions to be added to the dom, then announce\n // otherwise Safari won't announce the message if it's added too quickly\n // found most times less than 100ms were not consistent when announcing with Safari\n\n // IS_REACT_ACT_ENVIRONMENT is used by React 18. Previous versions checked for the `jest` global.\n // https://github.com/reactwg/react-18/discussions/102\n // if we're in a test environment, announce without waiting\n // @ts-ignore\n if (!(typeof IS_REACT_ACT_ENVIRONMENT === 'boolean' ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== 'undefined')) {\n setTimeout(() => {\n if (liveAnnouncer?.isAttached()) {\n liveAnnouncer?.announce(message, assertiveness, timeout);\n }\n }, 100);\n } else {\n liveAnnouncer.announce(message, assertiveness, timeout);\n }\n } else {\n liveAnnouncer.announce(message, assertiveness, timeout);\n }\n}\n\n/**\n * Stops all queued announcements.\n */\nexport function clearAnnouncer(assertiveness: Assertiveness) {\n if (liveAnnouncer) {\n liveAnnouncer.clear(assertiveness);\n }\n}\n\n/**\n * Removes the announcer from the DOM.\n */\nexport function destroyAnnouncer() {\n if (liveAnnouncer) {\n liveAnnouncer.destroy();\n liveAnnouncer = null;\n }\n}\n\n// LiveAnnouncer is implemented using vanilla DOM, not React. That's because as of React 18\n// ReactDOM.render is deprecated, and the replacement, ReactDOM.createRoot is moved into a\n// subpath import `react-dom/client`. That makes it hard for us to support multiple React versions.\n// As a global API, we can't use portals without introducing a breaking API change. LiveAnnouncer\n// is simple enough to implement without React, so that's what we do here.\n// See this discussion for more details: https://github.com/reactwg/react-18/discussions/125#discussioncomment-2382638\nclass LiveAnnouncer {\n node: HTMLElement | null = null;\n assertiveLog: HTMLElement | null = null;\n politeLog: HTMLElement | null = null;\n\n constructor() {\n if (typeof document !== 'undefined') {\n this.node = document.createElement('div');\n this.node.dataset.liveAnnouncer = 'true';\n // copied from VisuallyHidden\n Object.assign(this.node.style, {\n border: 0,\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n width: '1px',\n whiteSpace: 'nowrap'\n });\n\n this.assertiveLog = this.createLog('assertive');\n this.node.appendChild(this.assertiveLog);\n\n this.politeLog = this.createLog('polite');\n this.node.appendChild(this.politeLog);\n\n document.body.prepend(this.node);\n }\n }\n\n isAttached() {\n return this.node?.isConnected;\n }\n\n createLog(ariaLive: string) {\n let node = document.createElement('div');\n node.setAttribute('role', 'log');\n node.setAttribute('aria-live', ariaLive);\n node.setAttribute('aria-relevant', 'additions');\n return node;\n }\n\n destroy() {\n if (!this.node) {\n return;\n }\n\n document.body.removeChild(this.node);\n this.node = null;\n }\n\n announce(message: Message, assertiveness = 'assertive', timeout = LIVEREGION_TIMEOUT_DELAY) {\n if (!this.node) {\n return;\n }\n\n let node = document.createElement('div');\n if (typeof message === 'object') {\n // To read an aria-labelledby, the element must have an appropriate role, such as img.\n node.setAttribute('role', 'img');\n node.setAttribute('aria-labelledby', message['aria-labelledby']);\n } else {\n node.textContent = message;\n }\n\n if (assertiveness === 'assertive') {\n this.assertiveLog?.appendChild(node);\n } else {\n this.politeLog?.appendChild(node);\n }\n\n if (message !== '') {\n setTimeout(() => {\n node.remove();\n }, timeout);\n }\n }\n\n clear(assertiveness: Assertiveness) {\n if (!this.node) {\n return;\n }\n\n if ((!assertiveness || assertiveness === 'assertive') && this.assertiveLog) {\n this.assertiveLog.innerHTML = '';\n }\n\n if ((!assertiveness || assertiveness === 'polite') && this.politeLog) {\n this.politeLog.innerHTML = '';\n }\n }\n}\n"],"names":[],"version":3,"file":"LiveAnnouncer.module.js.map"}
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;CAUC,GAID,8DAA8D,GAC9D,MAAM,iDAA2B;AAEjC,IAAI,sCAAsC;AAOnC,SAAS,0CACd,OAAgB,EAChB,gBAA+B,WAAW,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vC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS;YAEpC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACjC;IACF;AA+DF","sources":["packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\ntype Assertiveness = 'assertive' | 'polite';\n\n/* Inspired by https://github.com/AlmeroSteyn/react-aria-live */\nconst LIVEREGION_TIMEOUT_DELAY = 7000;\n\nlet liveAnnouncer: LiveAnnouncer | null = null;\n\ntype Message = string | {'aria-labelledby': string};\n\n/**\n * Announces the message using screen reader technology.\n */\nexport function announce(\n message: Message,\n assertiveness: Assertiveness = 'assertive',\n timeout = LIVEREGION_TIMEOUT_DELAY\n): void {\n if (!liveAnnouncer) {\n liveAnnouncer = new LiveAnnouncer();\n // wait for the live announcer regions to be added to the dom, then announce\n // otherwise Safari won't announce the message if it's added too quickly\n // found most times less than 100ms were not consistent when announcing with Safari\n\n // IS_REACT_ACT_ENVIRONMENT is used by React 18. Previous versions checked for the `jest` global.\n // https://github.com/reactwg/react-18/discussions/102\n // if we're in a test environment, announce without waiting\n // @ts-ignore\n if (!(typeof IS_REACT_ACT_ENVIRONMENT === 'boolean' ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== 'undefined')) {\n setTimeout(() => {\n if (liveAnnouncer?.isAttached()) {\n liveAnnouncer?.announce(message, assertiveness, timeout);\n }\n }, 100);\n } else {\n liveAnnouncer.announce(message, assertiveness, timeout);\n }\n } else {\n liveAnnouncer.announce(message, assertiveness, timeout);\n }\n}\n\n/**\n * Stops all queued announcements.\n */\nexport function clearAnnouncer(assertiveness: Assertiveness): void {\n if (liveAnnouncer) {\n liveAnnouncer.clear(assertiveness);\n }\n}\n\n/**\n * Removes the announcer from the DOM.\n */\nexport function destroyAnnouncer(): void {\n if (liveAnnouncer) {\n liveAnnouncer.destroy();\n liveAnnouncer = null;\n }\n}\n\n// LiveAnnouncer is implemented using vanilla DOM, not React. That's because as of React 18\n// ReactDOM.render is deprecated, and the replacement, ReactDOM.createRoot is moved into a\n// subpath import `react-dom/client`. That makes it hard for us to support multiple React versions.\n// As a global API, we can't use portals without introducing a breaking API change. LiveAnnouncer\n// is simple enough to implement without React, so that's what we do here.\n// See this discussion for more details: https://github.com/reactwg/react-18/discussions/125#discussioncomment-2382638\nclass LiveAnnouncer {\n node: HTMLElement | null = null;\n assertiveLog: HTMLElement | null = null;\n politeLog: HTMLElement | null = null;\n\n constructor() {\n if (typeof document !== 'undefined') {\n this.node = document.createElement('div');\n this.node.dataset.liveAnnouncer = 'true';\n // copied from VisuallyHidden\n Object.assign(this.node.style, {\n border: 0,\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n width: '1px',\n whiteSpace: 'nowrap'\n });\n\n this.assertiveLog = this.createLog('assertive');\n this.node.appendChild(this.assertiveLog);\n\n this.politeLog = this.createLog('polite');\n this.node.appendChild(this.politeLog);\n\n document.body.prepend(this.node);\n }\n }\n\n isAttached() {\n return this.node?.isConnected;\n }\n\n createLog(ariaLive: string) {\n let node = document.createElement('div');\n node.setAttribute('role', 'log');\n node.setAttribute('aria-live', ariaLive);\n node.setAttribute('aria-relevant', 'additions');\n return node;\n }\n\n destroy() {\n if (!this.node) {\n return;\n }\n\n document.body.removeChild(this.node);\n this.node = null;\n }\n\n announce(message: Message, assertiveness = 'assertive', timeout = LIVEREGION_TIMEOUT_DELAY) {\n if (!this.node) {\n return;\n }\n\n let node = document.createElement('div');\n if (typeof message === 'object') {\n // To read an aria-labelledby, the element must have an appropriate role, such as img.\n node.setAttribute('role', 'img');\n node.setAttribute('aria-labelledby', message['aria-labelledby']);\n } else {\n node.textContent = message;\n }\n\n if (assertiveness === 'assertive') {\n this.assertiveLog?.appendChild(node);\n } else {\n this.politeLog?.appendChild(node);\n }\n\n if (message !== '') {\n setTimeout(() => {\n node.remove();\n }, timeout);\n }\n }\n\n clear(assertiveness: Assertiveness) {\n if (!this.node) {\n return;\n }\n\n if ((!assertiveness || assertiveness === 'assertive') && this.assertiveLog) {\n this.assertiveLog.innerHTML = '';\n }\n\n if ((!assertiveness || assertiveness === 'polite') && this.politeLog) {\n this.politeLog.innerHTML = '';\n }\n }\n}\n"],"names":[],"version":3,"file":"LiveAnnouncer.module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAYA,qBAAqB,WAAW,GAAG,QAAQ,CAAC;AAO5C,eAAe,MAAM,GAAG;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAC,CAAC;AAEpD;;GAEG;AACH,yBACE,OAAO,EAAE,OAAO,EAChB,aAAa,GAAE,aAA2B,EAC1C,OAAO,SAA2B,
|
|
1
|
+
{"mappings":"AAYA,qBAAqB,WAAW,GAAG,QAAQ,CAAC;AAO5C,eAAe,MAAM,GAAG;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAC,CAAC;AAEpD;;GAEG;AACH,yBACE,OAAO,EAAE,OAAO,EAChB,aAAa,GAAE,aAA2B,EAC1C,OAAO,SAA2B,GACjC,IAAI,CAuBN;AAED;;GAEG;AACH,+BAA+B,aAAa,EAAE,aAAa,GAAG,IAAI,CAIjE;AAED;;GAEG;AACH,oCAAoC,IAAI,CAKvC","sources":["packages/@react-aria/live-announcer/src/packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx","packages/@react-aria/live-announcer/src/packages/@react-aria/live-announcer/src/index.ts","packages/@react-aria/live-announcer/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {announce, clearAnnouncer, destroyAnnouncer} from './LiveAnnouncer';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/live-announcer",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "9b66d270572f482948afee95622a85cdf68ed408"
|
|
31
31
|
}
|
package/src/LiveAnnouncer.tsx
CHANGED
|
@@ -26,7 +26,7 @@ export function announce(
|
|
|
26
26
|
message: Message,
|
|
27
27
|
assertiveness: Assertiveness = 'assertive',
|
|
28
28
|
timeout = LIVEREGION_TIMEOUT_DELAY
|
|
29
|
-
) {
|
|
29
|
+
): void {
|
|
30
30
|
if (!liveAnnouncer) {
|
|
31
31
|
liveAnnouncer = new LiveAnnouncer();
|
|
32
32
|
// wait for the live announcer regions to be added to the dom, then announce
|
|
@@ -54,7 +54,7 @@ export function announce(
|
|
|
54
54
|
/**
|
|
55
55
|
* Stops all queued announcements.
|
|
56
56
|
*/
|
|
57
|
-
export function clearAnnouncer(assertiveness: Assertiveness) {
|
|
57
|
+
export function clearAnnouncer(assertiveness: Assertiveness): void {
|
|
58
58
|
if (liveAnnouncer) {
|
|
59
59
|
liveAnnouncer.clear(assertiveness);
|
|
60
60
|
}
|
|
@@ -63,7 +63,7 @@ export function clearAnnouncer(assertiveness: Assertiveness) {
|
|
|
63
63
|
/**
|
|
64
64
|
* Removes the announcer from the DOM.
|
|
65
65
|
*/
|
|
66
|
-
export function destroyAnnouncer() {
|
|
66
|
+
export function destroyAnnouncer(): void {
|
|
67
67
|
if (liveAnnouncer) {
|
|
68
68
|
liveAnnouncer.destroy();
|
|
69
69
|
liveAnnouncer = null;
|