Socket
Socket
Sign inDemoInstall

@spectrum-web-components/shared

Package Overview
Dependencies
Maintainers
10
Versions
205
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/shared - npm Package Compare versions

Comparing version 0.42.3 to 0.42.4

./src/index.js

6

package.json
{
"name": "@spectrum-web-components/shared",
"version": "0.42.3",
"version": "0.42.4",
"publishConfig": {

@@ -104,3 +104,3 @@ "access": "public"

"@lit-labs/observers": "^2.0.2",
"@spectrum-web-components/base": "^0.42.3",
"@spectrum-web-components/base": "^0.42.4",
"focus-visible": "^5.1.0"

@@ -113,3 +113,3 @@ },

],
"gitHead": "a03edce4f21f232f1705d8eb222e6e5436cad4c3"
"gitHead": "4924ffd06681ced537edaed873a9ce8b42cf155c"
}

@@ -10,3 +10,3 @@ "use strict";

export const FocusVisiblePolyfillMixin = (SuperClass) => {
var _a;
var _a, _b;
const coordinateWithPolyfill = (instance) => {

@@ -47,3 +47,3 @@ if (instance.shadowRoot == null || instance.hasAttribute("data-js-focus-visible")) {

const $endPolyfillCoordination = Symbol("endPolyfillCoordination");
class FocusVisibleCoordinator extends SuperClass {
class FocusVisibleCoordinator extends (_b = SuperClass, _a = $endPolyfillCoordination, _b) {
constructor() {

@@ -77,5 +77,4 @@ super(...arguments);

}
_a = $endPolyfillCoordination;
return FocusVisibleCoordinator;
};
//# sourceMappingURL=focus-visible.dev.js.map

@@ -1,2 +0,2 @@

"use strict";let i=!0;try{document.body.querySelector(":focus-visible")}catch(a){i=!1,import("focus-visible")}export const FocusVisiblePolyfillMixin=a=>{var n;const s=l=>{if(l.shadowRoot==null||l.hasAttribute("data-js-focus-visible"))return()=>{};if(self.applyFocusVisiblePolyfill)self.applyFocusVisiblePolyfill(l.shadowRoot),l.manageAutoFocus&&l.manageAutoFocus();else{const e=()=>{self.applyFocusVisiblePolyfill&&l.shadowRoot&&self.applyFocusVisiblePolyfill(l.shadowRoot),l.manageAutoFocus&&l.manageAutoFocus()};return self.addEventListener("focus-visible-polyfill-ready",e,{once:!0}),()=>{self.removeEventListener("focus-visible-polyfill-ready",e)}}return()=>{}},o=Symbol("endPolyfillCoordination");class t extends a{constructor(){super(...arguments);this[n]=null}connectedCallback(){super.connectedCallback&&super.connectedCallback(),i||requestAnimationFrame(()=>{this[o]==null&&(this[o]=s(this))})}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),i||requestAnimationFrame(()=>{this[o]!=null&&(this[o](),this[o]=null)})}}return n=o,t};
"use strict";let i=!0;try{document.body.querySelector(":focus-visible")}catch(a){i=!1,import("focus-visible")}export const FocusVisiblePolyfillMixin=a=>{var s,t;const n=l=>{if(l.shadowRoot==null||l.hasAttribute("data-js-focus-visible"))return()=>{};if(self.applyFocusVisiblePolyfill)self.applyFocusVisiblePolyfill(l.shadowRoot),l.manageAutoFocus&&l.manageAutoFocus();else{const e=()=>{self.applyFocusVisiblePolyfill&&l.shadowRoot&&self.applyFocusVisiblePolyfill(l.shadowRoot),l.manageAutoFocus&&l.manageAutoFocus()};return self.addEventListener("focus-visible-polyfill-ready",e,{once:!0}),()=>{self.removeEventListener("focus-visible-polyfill-ready",e)}}return()=>{}},o=Symbol("endPolyfillCoordination");class c extends(t=a,s=o,t){constructor(){super(...arguments);this[s]=null}connectedCallback(){super.connectedCallback&&super.connectedCallback(),i||requestAnimationFrame(()=>{this[o]==null&&(this[o]=n(this))})}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),i||requestAnimationFrame(()=>{this[o]!=null&&(this[o](),this[o]=null)})}}return c};
//# sourceMappingURL=focus-visible.js.map

@@ -9,4 +9,3 @@ "use strict";

result = (kind ? decorator(target, key, result) : decorator(result)) || result;
if (kind && result)
__defProp(target, key, result);
if (kind && result) __defProp(target, key, result);
return result;

@@ -13,0 +12,0 @@ };

"use strict";
export const getLabelFromSlot = (label, slotEl) => {
if (label)
return null;
if (label) return null;
const textContent = slotEl.assignedNodes().reduce((accumulator, node) => {

@@ -6,0 +5,0 @@ if (node.textContent) {

@@ -9,4 +9,3 @@ "use strict";

result = (kind ? decorator(target, key, result) : decorator(result)) || result;
if (kind && result)
__defProp(target, key, result);
if (kind && result) __defProp(target, key, result);
return result;

@@ -13,0 +12,0 @@ };

@@ -5,5 +5,5 @@ "use strict";

export function ObserveSlotPresence(constructor, lightDomSelector) {
var _a;
var _a, _b;
const lightDomSelectors = Array.isArray(lightDomSelector) ? lightDomSelector : [lightDomSelector];
class SlotPresenceObservingElement extends constructor {
class SlotPresenceObservingElement extends (_b = constructor, _a = slotContentIsPresent, _b) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -62,5 +62,4 @@ constructor(...args) {

}
_a = slotContentIsPresent;
return SlotPresenceObservingElement;
}
//# sourceMappingURL=observe-slot-presence.dev.js.map

@@ -1,2 +0,2 @@

"use strict";import{MutationController as g}from"@lit-labs/observers/mutation-controller.js";const t=Symbol("slotContentIsPresent");export function ObserveSlotPresence(o,s){var l;const r=Array.isArray(s)?s:[s];class i extends o{constructor(...e){super(e);this[l]=new Map;this.managePresenceObservedSlot=()=>{let e=!1;r.forEach(n=>{const a=!!this.querySelector(`:scope > ${n}`),c=this[t].get(n)||!1;e=e||c!==a,this[t].set(n,!!this.querySelector(`:scope > ${n}`))}),e&&this.updateComplete.then(()=>{this.requestUpdate()})};new g(this,{config:{childList:!0,subtree:!0},callback:()=>{this.managePresenceObservedSlot()}}),this.managePresenceObservedSlot()}get slotContentIsPresent(){if(r.length===1)return this[t].get(r[0])||!1;throw new Error("Multiple selectors provided to `ObserveSlotPresence` use `getSlotContentPresence(selector: string)` instead.")}getSlotContentPresence(e){if(this[t].has(e))return this[t].get(e)||!1;throw new Error(`The provided selector \`${e}\` is not being observed.`)}}return l=t,i}
"use strict";import{MutationController as u}from"@lit-labs/observers/mutation-controller.js";const t=Symbol("slotContentIsPresent");export function ObserveSlotPresence(l,s){var o,i;const r=Array.isArray(s)?s:[s];class a extends(i=l,o=t,i){constructor(...e){super(e);this[o]=new Map;this.managePresenceObservedSlot=()=>{let e=!1;r.forEach(n=>{const c=!!this.querySelector(`:scope > ${n}`),g=this[t].get(n)||!1;e=e||g!==c,this[t].set(n,!!this.querySelector(`:scope > ${n}`))}),e&&this.updateComplete.then(()=>{this.requestUpdate()})};new u(this,{config:{childList:!0,subtree:!0},callback:()=>{this.managePresenceObservedSlot()}}),this.managePresenceObservedSlot()}get slotContentIsPresent(){if(r.length===1)return this[t].get(r[0])||!1;throw new Error("Multiple selectors provided to `ObserveSlotPresence` use `getSlotContentPresence(selector: string)` instead.")}getSlotContentPresence(e){if(this[t].has(e))return this[t].get(e)||!1;throw new Error(`The provided selector \`${e}\` is not being observed.`)}}return a}
//# sourceMappingURL=observe-slot-presence.js.map

@@ -9,4 +9,3 @@ "use strict";

result = (kind ? decorator(target, key, result) : decorator(result)) || result;
if (kind && result)
__defProp(target, key, result);
if (kind && result) __defProp(target, key, result);
return result;

@@ -21,7 +20,7 @@ };

export function ObserveSlotText(constructor, slotName, excludedSelectors = []) {
var _a;
var _a, _b;
const notExcluded = (el) => (selector) => {
return el.matches(selector);
};
class SlotTextObservingElement extends constructor {
class SlotTextObservingElement extends (_b = constructor, _a = assignedNodesList, _b) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -47,4 +46,3 @@ constructor(...args) {

manageTextObservedSlot() {
if (!this[assignedNodesList])
return;
if (!this[assignedNodesList]) return;
const assignedNodes = [...this[assignedNodesList]].filter(

@@ -89,3 +87,2 @@ (currentNode) => {

}
_a = assignedNodesList;
__decorateClass([

@@ -92,0 +89,0 @@ property({ type: Boolean, attribute: false })

@@ -1,2 +0,2 @@

"use strict";var g=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var u=(c,e,s,o)=>{for(var t=o>1?void 0:o?h(e,s):e,l=c.length-1,a;l>=0;l--)(a=c[l])&&(t=(o?a(e,s,t):a(t))||t);return o&&t&&g(e,s,t),t};import{property as x,queryAssignedNodes as T}from"@spectrum-web-components/base/src/decorators.js";import{MutationController as b}from"@lit-labs/observers/mutation-controller.js";const p=Symbol("assignedNodes");export function ObserveSlotText(c,e,s=[]){var l;const o=a=>f=>a.matches(f);class t extends c{constructor(...n){super(n);this.slotHasContent=!1;new b(this,{config:{characterData:!0,subtree:!0},callback:d=>{for(const r of d)if(r.type==="characterData"){this.manageTextObservedSlot();return}}})}manageTextObservedSlot(){if(!this[p])return;const n=[...this[p]].filter(d=>{const r=d;return r.tagName?!s.some(o(r)):r.textContent?r.textContent.trim():!1});this.slotHasContent=n.length>0}update(n){if(!this.hasUpdated){const{childNodes:d}=this,r=[...d].filter(m=>{const i=m;return i.tagName?s.some(o(i))?!1:e?i.getAttribute("slot")===e:!i.hasAttribute("slot"):i.textContent?i.textContent.trim():!1});this.slotHasContent=r.length>0}super.update(n)}firstUpdated(n){super.firstUpdated(n),this.updateComplete.then(()=>{this.manageTextObservedSlot()})}}return l=p,u([x({type:Boolean,attribute:!1})],t.prototype,"slotHasContent",2),u([T({slot:e,flatten:!0})],t.prototype,l,2),t}
"use strict";var h=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var u=(c,e,s,o)=>{for(var t=o>1?void 0:o?x(e,s):e,a=c.length-1,i;a>=0;a--)(i=c[a])&&(t=(o?i(e,s,t):i(t))||t);return o&&t&&h(e,s,t),t};import{property as T,queryAssignedNodes as b}from"@spectrum-web-components/base/src/decorators.js";import{MutationController as v}from"@lit-labs/observers/mutation-controller.js";const p=Symbol("assignedNodes");export function ObserveSlotText(c,e,s=[]){var a,i;const o=f=>m=>f.matches(m);class t extends(i=c,a=p,i){constructor(...n){super(n);this.slotHasContent=!1;new v(this,{config:{characterData:!0,subtree:!0},callback:d=>{for(const r of d)if(r.type==="characterData"){this.manageTextObservedSlot();return}}})}manageTextObservedSlot(){if(!this[p])return;const n=[...this[p]].filter(d=>{const r=d;return r.tagName?!s.some(o(r)):r.textContent?r.textContent.trim():!1});this.slotHasContent=n.length>0}update(n){if(!this.hasUpdated){const{childNodes:d}=this,r=[...d].filter(g=>{const l=g;return l.tagName?s.some(o(l))?!1:e?l.getAttribute("slot")===e:!l.hasAttribute("slot"):l.textContent?l.textContent.trim():!1});this.slotHasContent=r.length>0}super.update(n)}firstUpdated(n){super.firstUpdated(n),this.updateComplete.then(()=>{this.manageTextObservedSlot()})}}return u([T({type:Boolean,attribute:!1})],t.prototype,"slotHasContent",2),u([b({slot:e,flatten:!0})],t.prototype,a,2),t}
//# sourceMappingURL=observe-slot-text.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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