Socket
Socket
Sign inDemoInstall

@spectrum-web-components/base

Package Overview
Dependencies
Maintainers
6
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.36.0 to 0.37.0

4

package.json
{
"name": "@spectrum-web-components/base",
"version": "0.36.0",
"version": "0.37.0",
"publishConfig": {

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

],
"gitHead": "a532ff8a410abeefb54d9638a2316ae82570566e"
"gitHead": "d771f62f0d8063070af43283bb0fd5e3400bad06"
}

@@ -26,3 +26,21 @@ "use strict";

hasVisibleFocusInTree() {
const activeElement = this.getRootNode().activeElement;
const getAncestors = (root = document) => {
var _a2;
let currentNode = root.activeElement;
while ((currentNode == null ? void 0 : currentNode.shadowRoot) && currentNode.shadowRoot.activeElement) {
currentNode = currentNode.shadowRoot.activeElement;
}
const ancestors = currentNode ? [currentNode] : [];
while (currentNode) {
const ancestor = currentNode.assignedSlot || currentNode.parentElement || ((_a2 = currentNode.getRootNode()) == null ? void 0 : _a2.host);
if (ancestor) {
ancestors.push(ancestor);
}
currentNode = ancestor;
}
return ancestors;
};
const activeElement = getAncestors(
this.getRootNode()
)[0];
if (!activeElement) {

@@ -29,0 +47,0 @@ return false;

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

"use strict";import{LitElement as a}from"lit";const i=new Set,l=()=>{const n=document.documentElement.dir==="rtl"?document.documentElement.dir:"ltr";i.forEach(s=>{s.setAttribute("dir",n)})},c=new MutationObserver(l);c.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const d=n=>typeof n.startManagingContentDirection!="undefined"||n.tagName==="SP-THEME";export function SpectrumMixin(n){class s extends n{get isLTR(){return this.dir==="ltr"}hasVisibleFocusInTree(){const e=this.getRootNode().activeElement;if(!e)return!1;try{return e.matches(":focus-visible")||e.matches(".focus-visible")}catch(t){return e.matches(".focus-visible")}}connectedCallback(){if(!this.hasAttribute("dir")){let e=this.assignedSlot||this.parentNode;for(;e!==document.documentElement&&!d(e);)e=e.assignedSlot||e.parentNode||e.host;if(this.dir=e.dir==="rtl"?e.dir:this.dir||"ltr",e===document.documentElement)i.add(this);else{const{localName:t}=e;t.search("-")>-1&&!customElements.get(t)?customElements.whenDefined(t).then(()=>{e.startManagingContentDirection(this)}):e.startManagingContentDirection(this)}this._dirParent=e}super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._dirParent&&(this._dirParent===document.documentElement?i.delete(this):this._dirParent.stopManagingContentDirection(this),this.removeAttribute("dir"))}}return s}export class SpectrumElement extends SpectrumMixin(a){}
"use strict";import{LitElement as u}from"lit";const c=new Set,g=()=>{const s=document.documentElement.dir==="rtl"?document.documentElement.dir:"ltr";c.forEach(o=>{o.setAttribute("dir",s)})},w=new MutationObserver(g);w.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const p=s=>typeof s.startManagingContentDirection!="undefined"||s.tagName==="SP-THEME";export function SpectrumMixin(s){class o extends s{get isLTR(){return this.dir==="ltr"}hasVisibleFocusInTree(){const n=((r=document)=>{var l;let t=r.activeElement;for(;t!=null&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;const a=t?[t]:[];for(;t;){const i=t.assignedSlot||t.parentElement||((l=t.getRootNode())==null?void 0:l.host);i&&a.push(i),t=i}return a})(this.getRootNode())[0];if(!n)return!1;try{return n.matches(":focus-visible")||n.matches(".focus-visible")}catch(r){return n.matches(".focus-visible")}}connectedCallback(){if(!this.hasAttribute("dir")){let e=this.assignedSlot||this.parentNode;for(;e!==document.documentElement&&!p(e);)e=e.assignedSlot||e.parentNode||e.host;if(this.dir=e.dir==="rtl"?e.dir:this.dir||"ltr",e===document.documentElement)c.add(this);else{const{localName:n}=e;n.search("-")>-1&&!customElements.get(n)?customElements.whenDefined(n).then(()=>{e.startManagingContentDirection(this)}):e.startManagingContentDirection(this)}this._dirParent=e}super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._dirParent&&(this._dirParent===document.documentElement?c.delete(this):this._dirParent.stopManagingContentDirection(this),this.removeAttribute("dir"))}}return o}export class SpectrumElement extends SpectrumMixin(u){}
//# sourceMappingURL=Base.js.map

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

"overlay-trigger": () => import("@spectrum-web-components/overlay/overlay-trigger.js"),
"active-overlay": () => import("@spectrum-web-components/overlay/active-overlay.js"),
"sp-overlay": () => import("@spectrum-web-components/overlay/sp-overlay.js"),
"sp-picker": () => import("@spectrum-web-components/picker/sp-picker.js"),

@@ -51,0 +51,0 @@ "sp-picker-button": () => import("@spectrum-web-components/picker-button/sp-picker-button.js"),

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