Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@primer/live-region-element

Package Overview
Dependencies
Maintainers
11
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@primer/live-region-element - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

dist/cjs/query.d.cts

37

dist/esm/index.js

@@ -357,15 +357,4 @@ const Ordering = {

function announce(message, options = {}) {
const liveRegion2 = findOrCreateLiveRegion(options.from, options.appendTo);
return liveRegion2.announce(message, options);
}
function announceFromElement(element, options = {}) {
const liveRegion2 = findOrCreateLiveRegion(options.from, options.appendTo);
return liveRegion2.announceFromElement(element, options);
}
let liveRegion = null;
function findOrCreateLiveRegion(from, appendTo) {
if (liveRegion !== null && liveRegion.isConnected) {
return liveRegion;
}
let liveRegion = null;
liveRegion = from ? getClosestLiveRegion(from) : null;

@@ -375,3 +364,10 @@ if (liveRegion !== null) {

}
liveRegion = document.querySelector("live-region");
let container = document.body;
if (from) {
const dialog = from.closest("dialog");
if (dialog) {
container = dialog;
}
}
liveRegion = container.querySelector("live-region");
if (liveRegion !== null) {

@@ -384,3 +380,3 @@ return liveRegion;

} else {
document.body.appendChild(liveRegion);
container.appendChild(liveRegion);
}

@@ -390,4 +386,8 @@ return liveRegion;

function getClosestLiveRegion(from) {
const dialog = from.closest("dialog");
let current = from;
while (current = current.parentElement) {
if (dialog && !dialog.contains(current)) {
break;
}
for (const child of current.childNodes) {

@@ -402,2 +402,11 @@ if (child instanceof LiveRegionElement) {

function announce(message, options = {}) {
const liveRegion = findOrCreateLiveRegion(options.from, options.appendTo);
return liveRegion.announce(message, options);
}
function announceFromElement(element, options = {}) {
const liveRegion = findOrCreateLiveRegion(options.from, options.appendTo);
return liveRegion.announceFromElement(element, options);
}
export { LiveRegionElement, announce, announceFromElement, templateContent };

@@ -359,15 +359,4 @@ import { HTMLElement, customElements } from '@lit-labs/ssr-dom-shim';

function announce(message, options = {}) {
const liveRegion2 = findOrCreateLiveRegion(options.from, options.appendTo);
return liveRegion2.announce(message, options);
}
function announceFromElement(element, options = {}) {
const liveRegion2 = findOrCreateLiveRegion(options.from, options.appendTo);
return liveRegion2.announceFromElement(element, options);
}
let liveRegion = null;
function findOrCreateLiveRegion(from, appendTo) {
if (liveRegion !== null && liveRegion.isConnected) {
return liveRegion;
}
let liveRegion = null;
liveRegion = from ? getClosestLiveRegion(from) : null;

@@ -377,3 +366,10 @@ if (liveRegion !== null) {

}
liveRegion = document.querySelector("live-region");
let container = document.body;
if (from) {
const dialog = from.closest("dialog");
if (dialog) {
container = dialog;
}
}
liveRegion = container.querySelector("live-region");
if (liveRegion !== null) {

@@ -386,3 +382,3 @@ return liveRegion;

} else {
document.body.appendChild(liveRegion);
container.appendChild(liveRegion);
}

@@ -392,4 +388,8 @@ return liveRegion;

function getClosestLiveRegion(from) {
const dialog = from.closest("dialog");
let current = from;
while (current = current.parentElement) {
if (dialog && !dialog.contains(current)) {
break;
}
for (const child of current.childNodes) {

@@ -404,2 +404,11 @@ if (child instanceof LiveRegionElement) {

function announce(message, options = {}) {
const liveRegion = findOrCreateLiveRegion(options.from, options.appendTo);
return liveRegion.announce(message, options);
}
function announceFromElement(element, options = {}) {
const liveRegion = findOrCreateLiveRegion(options.from, options.appendTo);
return liveRegion.announceFromElement(element, options);
}
export { LiveRegionElement, announce, announceFromElement, templateContent };
{
"name": "@primer/live-region-element",
"version": "0.3.0",
"version": "0.4.0",
"type": "module",

@@ -5,0 +5,0 @@ "main": "./dist/esm/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc