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
0
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.7.0 to 0.7.1

139

dist/esm/index.js

@@ -7,31 +7,16 @@ const Ordering = {

var __accessCheck$2 = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
var __typeError$2 = (msg) => {
throw TypeError(msg);
};
var __privateGet$2 = (obj, member, getter) => {
__accessCheck$2(obj, member, "read from private field");
return getter ? getter.call(obj) : member.get(obj);
};
var __privateAdd$2 = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateSet$2 = (obj, member, value, setter) => {
__accessCheck$2(obj, member, "write to private field");
setter ? setter.call(obj, value) : member.set(obj, value);
return value;
};
var __privateMethod$1 = (obj, member, method) => {
__accessCheck$2(obj, member, "access private method");
return method;
};
var _compareFn, _heap, _heapifyDown, heapifyDown_fn, _heapifyUp, heapifyUp_fn;
var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
var __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet$2 = (obj, member, value, setter) => (__accessCheck$2(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var __privateMethod$1 = (obj, member, method) => (__accessCheck$2(obj, member, "access private method"), method);
var _compareFn, _heap, _MinHeap_instances, heapifyDown_fn, heapifyUp_fn;
class MinHeap {
constructor({ compareFn }) {
__privateAdd$2(this, _heapifyDown);
__privateAdd$2(this, _heapifyUp);
__privateAdd$2(this, _compareFn, void 0);
__privateAdd$2(this, _heap, void 0);
__privateAdd$2(this, _MinHeap_instances);
__privateAdd$2(this, _compareFn);
__privateAdd$2(this, _heap);
__privateSet$2(this, _compareFn, compareFn);

@@ -42,3 +27,3 @@ __privateSet$2(this, _heap, []);

__privateGet$2(this, _heap).push(value);
__privateMethod$1(this, _heapifyUp, heapifyUp_fn).call(this);
__privateMethod$1(this, _MinHeap_instances, heapifyUp_fn).call(this);
}

@@ -51,3 +36,3 @@ pop() {

}
__privateMethod$1(this, _heapifyDown, heapifyDown_fn).call(this);
__privateMethod$1(this, _MinHeap_instances, heapifyDown_fn).call(this);
return item;

@@ -65,3 +50,3 @@ }

__privateGet$2(this, _heap).pop();
__privateMethod$1(this, _heapifyDown, heapifyDown_fn).call(this);
__privateMethod$1(this, _MinHeap_instances, heapifyDown_fn).call(this);
}

@@ -77,3 +62,3 @@ clear() {

_heap = new WeakMap();
_heapifyDown = new WeakSet();
_MinHeap_instances = new WeakSet();
heapifyDown_fn = function() {

@@ -94,3 +79,2 @@ let index = 0;

};
_heapifyUp = new WeakSet();
heapifyUp_fn = function() {

@@ -137,32 +121,19 @@ let index = __privateGet$2(this, _heap).length - 1;

var __defProp = Object.defineProperty;
var __typeError$1 = (msg) => {
throw TypeError(msg);
};
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var __accessCheck$1 = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
};
var __privateGet$1 = (obj, member, getter) => {
__accessCheck$1(obj, member, "read from private field");
return getter ? getter.call(obj) : member.get(obj);
};
var __privateAdd$1 = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateSet$1 = (obj, member, value, setter) => {
__accessCheck$1(obj, member, "write to private field");
setter ? setter.call(obj, value) : member.set(obj, value);
return value;
};
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var _a, _promise, _resolve, _reject;
_a = Symbol.toStringTag;
class Deferred {
constructor() {
__publicField(this, _a, "Deferred");
__privateAdd$1(this, _promise, void 0);
__privateAdd$1(this, _resolve, void 0);
__privateAdd$1(this, _reject, void 0);
__privateAdd$1(this, _promise);
__privateAdd$1(this, _resolve);
__privateAdd$1(this, _reject);
__privateSet$1(this, _promise, new Promise((resolve, reject) => {

@@ -192,3 +163,2 @@ __privateSet$1(this, _resolve, resolve);

}
_a = Symbol.toStringTag;
_promise = new WeakMap();

@@ -198,25 +168,11 @@ _resolve = new WeakMap();

var __accessCheck = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
var __typeError = (msg) => {
throw TypeError(msg);
};
var __privateGet = (obj, member, getter) => {
__accessCheck(obj, member, "read from private field");
return getter ? getter.call(obj) : member.get(obj);
};
var __privateAdd = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateSet = (obj, member, value, setter) => {
__accessCheck(obj, member, "write to private field");
setter ? setter.call(obj, value) : member.set(obj, value);
return value;
};
var __privateMethod = (obj, member, method) => {
__accessCheck(obj, member, "access private method");
return method;
};
var _pending, _queue, _timeoutId, _performWork, performWork_fn, _updateContainerWithMessage, updateContainerWithMessage_fn;
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
var _pending, _queue, _timeoutId, _LiveRegionElement_instances, performWork_fn, updateContainerWithMessage_fn;
const DEFAULT_THROTTLE_DELAY_MS = 150;

@@ -226,4 +182,3 @@ class LiveRegionElement extends HTMLElement {

super();
__privateAdd(this, _performWork);
__privateAdd(this, _updateContainerWithMessage);
__privateAdd(this, _LiveRegionElement_instances);
/**

@@ -233,7 +188,7 @@ * A flag to indicate if a message has been announced and we are currently

*/
__privateAdd(this, _pending, void 0);
__privateAdd(this, _pending);
/**
* A priority queue to store messages to be announced by the live region.
*/
__privateAdd(this, _queue, void 0);
__privateAdd(this, _queue);
/**

@@ -244,3 +199,3 @@ * The id for a timeout being used by the live region to either wait until the

*/
__privateAdd(this, _timeoutId, void 0);
__privateAdd(this, _timeoutId);
if (!this.shadowRoot) {

@@ -286,3 +241,3 @@ const template2 = getTemplate();

__privateGet(this, _queue).insert(item);
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
return {

@@ -326,2 +281,3 @@ ...deferred.getPromise(),

}
__privateSet(this, _pending, false);
__privateGet(this, _queue).clear();

@@ -333,3 +289,3 @@ }

_timeoutId = new WeakMap();
_performWork = new WeakSet();
_LiveRegionElement_instances = new WeakSet();
performWork_fn = function() {

@@ -351,5 +307,5 @@ if (__privateGet(this, _pending)) {

if (message) {
__privateMethod(this, _updateContainerWithMessage, updateContainerWithMessage_fn).call(this, message);
__privateMethod(this, _LiveRegionElement_instances, updateContainerWithMessage_fn).call(this, message);
}
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
return;

@@ -360,6 +316,5 @@ }

__privateSet(this, _timeoutId, null);
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
}, timeout));
};
_updateContainerWithMessage = new WeakSet();
updateContainerWithMessage_fn = function(message) {

@@ -386,3 +341,3 @@ __privateSet(this, _pending, true);

__privateSet(this, _pending, false);
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
}, this.delay));

@@ -392,3 +347,3 @@ } else {

__privateSet(this, _pending, false);
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
}

@@ -395,0 +350,0 @@ };

@@ -9,31 +9,16 @@ import { HTMLElement, customElements } from '@lit-labs/ssr-dom-shim';

var __accessCheck$2 = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
var __typeError$2 = (msg) => {
throw TypeError(msg);
};
var __privateGet$2 = (obj, member, getter) => {
__accessCheck$2(obj, member, "read from private field");
return getter ? getter.call(obj) : member.get(obj);
};
var __privateAdd$2 = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateSet$2 = (obj, member, value, setter) => {
__accessCheck$2(obj, member, "write to private field");
setter ? setter.call(obj, value) : member.set(obj, value);
return value;
};
var __privateMethod$1 = (obj, member, method) => {
__accessCheck$2(obj, member, "access private method");
return method;
};
var _compareFn, _heap, _heapifyDown, heapifyDown_fn, _heapifyUp, heapifyUp_fn;
var __accessCheck$2 = (obj, member, msg) => member.has(obj) || __typeError$2("Cannot " + msg);
var __privateGet$2 = (obj, member, getter) => (__accessCheck$2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet$2 = (obj, member, value, setter) => (__accessCheck$2(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var __privateMethod$1 = (obj, member, method) => (__accessCheck$2(obj, member, "access private method"), method);
var _compareFn, _heap, _MinHeap_instances, heapifyDown_fn, heapifyUp_fn;
class MinHeap {
constructor({ compareFn }) {
__privateAdd$2(this, _heapifyDown);
__privateAdd$2(this, _heapifyUp);
__privateAdd$2(this, _compareFn, void 0);
__privateAdd$2(this, _heap, void 0);
__privateAdd$2(this, _MinHeap_instances);
__privateAdd$2(this, _compareFn);
__privateAdd$2(this, _heap);
__privateSet$2(this, _compareFn, compareFn);

@@ -44,3 +29,3 @@ __privateSet$2(this, _heap, []);

__privateGet$2(this, _heap).push(value);
__privateMethod$1(this, _heapifyUp, heapifyUp_fn).call(this);
__privateMethod$1(this, _MinHeap_instances, heapifyUp_fn).call(this);
}

@@ -53,3 +38,3 @@ pop() {

}
__privateMethod$1(this, _heapifyDown, heapifyDown_fn).call(this);
__privateMethod$1(this, _MinHeap_instances, heapifyDown_fn).call(this);
return item;

@@ -67,3 +52,3 @@ }

__privateGet$2(this, _heap).pop();
__privateMethod$1(this, _heapifyDown, heapifyDown_fn).call(this);
__privateMethod$1(this, _MinHeap_instances, heapifyDown_fn).call(this);
}

@@ -79,3 +64,3 @@ clear() {

_heap = new WeakMap();
_heapifyDown = new WeakSet();
_MinHeap_instances = new WeakSet();
heapifyDown_fn = function() {

@@ -96,3 +81,2 @@ let index = 0;

};
_heapifyUp = new WeakSet();
heapifyUp_fn = function() {

@@ -139,32 +123,19 @@ let index = __privateGet$2(this, _heap).length - 1;

var __defProp = Object.defineProperty;
var __typeError$1 = (msg) => {
throw TypeError(msg);
};
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var __accessCheck$1 = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
};
var __privateGet$1 = (obj, member, getter) => {
__accessCheck$1(obj, member, "read from private field");
return getter ? getter.call(obj) : member.get(obj);
};
var __privateAdd$1 = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateSet$1 = (obj, member, value, setter) => {
__accessCheck$1(obj, member, "write to private field");
setter ? setter.call(obj, value) : member.set(obj, value);
return value;
};
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var _a, _promise, _resolve, _reject;
_a = Symbol.toStringTag;
class Deferred {
constructor() {
__publicField(this, _a, "Deferred");
__privateAdd$1(this, _promise, void 0);
__privateAdd$1(this, _resolve, void 0);
__privateAdd$1(this, _reject, void 0);
__privateAdd$1(this, _promise);
__privateAdd$1(this, _resolve);
__privateAdd$1(this, _reject);
__privateSet$1(this, _promise, new Promise((resolve, reject) => {

@@ -194,3 +165,2 @@ __privateSet$1(this, _resolve, resolve);

}
_a = Symbol.toStringTag;
_promise = new WeakMap();

@@ -200,25 +170,11 @@ _resolve = new WeakMap();

var __accessCheck = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
var __typeError = (msg) => {
throw TypeError(msg);
};
var __privateGet = (obj, member, getter) => {
__accessCheck(obj, member, "read from private field");
return getter ? getter.call(obj) : member.get(obj);
};
var __privateAdd = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateSet = (obj, member, value, setter) => {
__accessCheck(obj, member, "write to private field");
setter ? setter.call(obj, value) : member.set(obj, value);
return value;
};
var __privateMethod = (obj, member, method) => {
__accessCheck(obj, member, "access private method");
return method;
};
var _pending, _queue, _timeoutId, _performWork, performWork_fn, _updateContainerWithMessage, updateContainerWithMessage_fn;
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
var _pending, _queue, _timeoutId, _LiveRegionElement_instances, performWork_fn, updateContainerWithMessage_fn;
const DEFAULT_THROTTLE_DELAY_MS = 150;

@@ -228,4 +184,3 @@ class LiveRegionElement extends (globalThis.HTMLElement ?? HTMLElement) {

super();
__privateAdd(this, _performWork);
__privateAdd(this, _updateContainerWithMessage);
__privateAdd(this, _LiveRegionElement_instances);
/**

@@ -235,7 +190,7 @@ * A flag to indicate if a message has been announced and we are currently

*/
__privateAdd(this, _pending, void 0);
__privateAdd(this, _pending);
/**
* A priority queue to store messages to be announced by the live region.
*/
__privateAdd(this, _queue, void 0);
__privateAdd(this, _queue);
/**

@@ -246,3 +201,3 @@ * The id for a timeout being used by the live region to either wait until the

*/
__privateAdd(this, _timeoutId, void 0);
__privateAdd(this, _timeoutId);
if (!this.shadowRoot) {

@@ -288,3 +243,3 @@ const template2 = getTemplate();

__privateGet(this, _queue).insert(item);
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
return {

@@ -328,2 +283,3 @@ ...deferred.getPromise(),

}
__privateSet(this, _pending, false);
__privateGet(this, _queue).clear();

@@ -335,3 +291,3 @@ }

_timeoutId = new WeakMap();
_performWork = new WeakSet();
_LiveRegionElement_instances = new WeakSet();
performWork_fn = function() {

@@ -353,5 +309,5 @@ if (__privateGet(this, _pending)) {

if (message) {
__privateMethod(this, _updateContainerWithMessage, updateContainerWithMessage_fn).call(this, message);
__privateMethod(this, _LiveRegionElement_instances, updateContainerWithMessage_fn).call(this, message);
}
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
return;

@@ -362,6 +318,5 @@ }

__privateSet(this, _timeoutId, null);
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
}, timeout));
};
_updateContainerWithMessage = new WeakSet();
updateContainerWithMessage_fn = function(message) {

@@ -388,3 +343,3 @@ __privateSet(this, _pending, true);

__privateSet(this, _pending, false);
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
}, this.delay));

@@ -394,3 +349,3 @@ } else {

__privateSet(this, _pending, false);
__privateMethod(this, _performWork, performWork_fn).call(this);
__privateMethod(this, _LiveRegionElement_instances, performWork_fn).call(this);
}

@@ -397,0 +352,0 @@ };

{
"name": "@primer/live-region-element",
"version": "0.7.0",
"version": "0.7.1",
"type": "module",

@@ -47,12 +47,12 @@ "main": "./dist/esm/index.js",

"devDependencies": {
"@custom-elements-manifest/analyzer": "^0.10.2",
"@custom-elements-manifest/analyzer": "^0.10.3",
"@rollup/plugin-inject": "^5.0.5",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"jsdom": "^24.1.0",
"publint": "^0.2.7",
"rimraf": "^5.0.7",
"@rollup/plugin-replace": "^5.0.7",
"jsdom": "^25.0.0",
"publint": "^0.2.8",
"rimraf": "^6.0.1",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-typescript2": "^0.36.0",
"typescript": "^5.4.5"
"typescript": "^5.5.3"
},

@@ -59,0 +59,0 @@ "sideEffects": [

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