@react-aria/live-announcer
Advanced tools
Comparing version 3.3.3 to 3.3.4
@@ -21,3 +21,3 @@ | ||
let $97cebfa4133ebec3$var$liveAnnouncer = null; | ||
function $97cebfa4133ebec3$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = $97cebfa4133ebec3$var$LIVEREGION_TIMEOUT_DELAY) { | ||
function $97cebfa4133ebec3$export$a9b970dcc4ae71a9(message, assertiveness = 'assertive', timeout = $97cebfa4133ebec3$var$LIVEREGION_TIMEOUT_DELAY) { | ||
if (!$97cebfa4133ebec3$var$liveAnnouncer) $97cebfa4133ebec3$var$liveAnnouncer = new $97cebfa4133ebec3$var$LiveAnnouncer(); | ||
@@ -43,6 +43,6 @@ $97cebfa4133ebec3$var$liveAnnouncer.announce(message, assertiveness, timeout); | ||
createLog(ariaLive) { | ||
let node = document.createElement("div"); | ||
node.setAttribute("role", "log"); | ||
node.setAttribute("aria-live", ariaLive); | ||
node.setAttribute("aria-relevant", "additions"); | ||
let node = document.createElement('div'); | ||
node.setAttribute('role', 'log'); | ||
node.setAttribute('aria-live', ariaLive); | ||
node.setAttribute('aria-relevant', 'additions'); | ||
return node; | ||
@@ -55,9 +55,9 @@ } | ||
} | ||
announce(message, assertiveness = "assertive", timeout = $97cebfa4133ebec3$var$LIVEREGION_TIMEOUT_DELAY) { | ||
announce(message, assertiveness = 'assertive', timeout = $97cebfa4133ebec3$var$LIVEREGION_TIMEOUT_DELAY) { | ||
if (!this.node) return; | ||
let node = document.createElement("div"); | ||
let node = document.createElement('div'); | ||
node.textContent = message; | ||
if (assertiveness === "assertive") this.assertiveLog.appendChild(node); | ||
if (assertiveness === 'assertive') this.assertiveLog.appendChild(node); | ||
else this.politeLog.appendChild(node); | ||
if (message !== "") setTimeout(()=>{ | ||
if (message !== '') setTimeout(()=>{ | ||
node.remove(); | ||
@@ -68,24 +68,24 @@ }, timeout); | ||
if (!this.node) return; | ||
if (!assertiveness || assertiveness === "assertive") this.assertiveLog.innerHTML = ""; | ||
if (!assertiveness || assertiveness === "polite") this.politeLog.innerHTML = ""; | ||
if (!assertiveness || assertiveness === 'assertive') this.assertiveLog.innerHTML = ''; | ||
if (!assertiveness || assertiveness === 'polite') this.politeLog.innerHTML = ''; | ||
} | ||
constructor(){ | ||
this.node = document.createElement("div"); | ||
this.node.dataset.liveAnnouncer = "true"; | ||
this.node = document.createElement('div'); | ||
this.node.dataset.liveAnnouncer = 'true'; | ||
// copied from VisuallyHidden | ||
Object.assign(this.node.style, { | ||
border: 0, | ||
clip: "rect(0 0 0 0)", | ||
clipPath: "inset(50%)", | ||
height: "1px", | ||
margin: "-1px", | ||
overflow: "hidden", | ||
clip: 'rect(0 0 0 0)', | ||
clipPath: 'inset(50%)', | ||
height: '1px', | ||
margin: '-1px', | ||
overflow: 'hidden', | ||
padding: 0, | ||
position: "absolute", | ||
width: "1px", | ||
whiteSpace: "nowrap" | ||
position: 'absolute', | ||
width: '1px', | ||
whiteSpace: 'nowrap' | ||
}); | ||
this.assertiveLog = this.createLog("assertive"); | ||
this.assertiveLog = this.createLog('assertive'); | ||
this.node.appendChild(this.assertiveLog); | ||
this.politeLog = this.createLog("polite"); | ||
this.politeLog = this.createLog('polite'); | ||
this.node.appendChild(this.politeLog); | ||
@@ -92,0 +92,0 @@ document.body.prepend(this.node); |
@@ -13,3 +13,3 @@ /* | ||
let $319e236875307eab$var$liveAnnouncer = null; | ||
function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) { | ||
function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = 'assertive', timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) { | ||
if (!$319e236875307eab$var$liveAnnouncer) $319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer(); | ||
@@ -35,6 +35,6 @@ $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout); | ||
createLog(ariaLive) { | ||
let node = document.createElement("div"); | ||
node.setAttribute("role", "log"); | ||
node.setAttribute("aria-live", ariaLive); | ||
node.setAttribute("aria-relevant", "additions"); | ||
let node = document.createElement('div'); | ||
node.setAttribute('role', 'log'); | ||
node.setAttribute('aria-live', ariaLive); | ||
node.setAttribute('aria-relevant', 'additions'); | ||
return node; | ||
@@ -47,9 +47,9 @@ } | ||
} | ||
announce(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) { | ||
announce(message, assertiveness = 'assertive', timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) { | ||
if (!this.node) return; | ||
let node = document.createElement("div"); | ||
let node = document.createElement('div'); | ||
node.textContent = message; | ||
if (assertiveness === "assertive") this.assertiveLog.appendChild(node); | ||
if (assertiveness === 'assertive') this.assertiveLog.appendChild(node); | ||
else this.politeLog.appendChild(node); | ||
if (message !== "") setTimeout(()=>{ | ||
if (message !== '') setTimeout(()=>{ | ||
node.remove(); | ||
@@ -60,24 +60,24 @@ }, timeout); | ||
if (!this.node) return; | ||
if (!assertiveness || assertiveness === "assertive") this.assertiveLog.innerHTML = ""; | ||
if (!assertiveness || assertiveness === "polite") this.politeLog.innerHTML = ""; | ||
if (!assertiveness || assertiveness === 'assertive') this.assertiveLog.innerHTML = ''; | ||
if (!assertiveness || assertiveness === 'polite') this.politeLog.innerHTML = ''; | ||
} | ||
constructor(){ | ||
this.node = document.createElement("div"); | ||
this.node.dataset.liveAnnouncer = "true"; | ||
this.node = document.createElement('div'); | ||
this.node.dataset.liveAnnouncer = 'true'; | ||
// copied from VisuallyHidden | ||
Object.assign(this.node.style, { | ||
border: 0, | ||
clip: "rect(0 0 0 0)", | ||
clipPath: "inset(50%)", | ||
height: "1px", | ||
margin: "-1px", | ||
overflow: "hidden", | ||
clip: 'rect(0 0 0 0)', | ||
clipPath: 'inset(50%)', | ||
height: '1px', | ||
margin: '-1px', | ||
overflow: 'hidden', | ||
padding: 0, | ||
position: "absolute", | ||
width: "1px", | ||
whiteSpace: "nowrap" | ||
position: 'absolute', | ||
width: '1px', | ||
whiteSpace: 'nowrap' | ||
}); | ||
this.assertiveLog = this.createLog("assertive"); | ||
this.assertiveLog = this.createLog('assertive'); | ||
this.node.appendChild(this.assertiveLog); | ||
this.politeLog = this.createLog("polite"); | ||
this.politeLog = this.createLog('polite'); | ||
this.node.appendChild(this.politeLog); | ||
@@ -84,0 +84,0 @@ document.body.prepend(this.node); |
{ | ||
"name": "@react-aria/live-announcer", | ||
"version": "3.3.3", | ||
"version": "3.3.4", | ||
"description": "Spectrum UI components in React", | ||
@@ -30,3 +30,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd" | ||
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48447
0