@spectrum-web-components/base 1.12.0-snapshot.20260422090428 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/base",
3
- "version": "1.12.0-snapshot.20260422090428",
3
+ "version": "1.12.0",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Adobe",
package/src/Base.d.ts CHANGED
@@ -16,6 +16,7 @@ type Constructor<T = Record<string, unknown>> = {
16
16
  };
17
17
  export interface SpectrumInterface {
18
18
  shadowRoot: ShadowRoot;
19
+ isLTR: boolean;
19
20
  hasVisibleFocusInTree(): boolean;
20
21
  }
21
22
  export declare function SpectrumMixin<T extends Constructor<ReactiveElement>>(constructor: T): T & Constructor<SpectrumInterface>;
package/src/Base.dev.js CHANGED
@@ -4,6 +4,9 @@ import { LitElement } from "lit";
4
4
  import { coreVersion, version } from "./version.dev.js";
5
5
  export function SpectrumMixin(constructor) {
6
6
  class SpectrumMixinElement extends constructor {
7
+ get isLTR() {
8
+ return getComputedStyle(this).direction !== "rtl";
9
+ }
7
10
  hasVisibleFocusInTree() {
8
11
  const getAncestors = (root = document) => {
9
12
  var _a2;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["Base.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { LitElement, ReactiveElement } from 'lit';\n\nimport { coreVersion, version } from './version.dev.js'\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport interface SpectrumInterface {\n shadowRoot: ShadowRoot;\n hasVisibleFocusInTree(): boolean;\n}\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @internal\n */\n public override shadowRoot!: ShadowRoot;\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot.activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode ? [currentNode] : [];\n while (currentNode) {\n const ancestor =\n currentNode.assignedSlot ||\n currentNode.parentElement ||\n (currentNode.getRootNode() as ShadowRoot)?.host;\n if (ancestor) {\n ancestors.push(ancestor as HTMLElement);\n }\n currentNode = ancestor as HTMLElement;\n }\n return ancestors;\n };\n const activeElement = getAncestors(this.getRootNode() as Document)[0];\n if (!activeElement) {\n return false;\n }\n // Browsers without support for the `:focus-visible`\n // selector will throw on the following test (Safari, older things).\n // Some won't throw, but will be focusing item rather than the menu and\n // will rely on the polyfill to know whether focus is \"visible\" or not.\n // .focus-visible polyfill class will intentionally not be checked in 2nd-gen.\n // 2nd-gen targets browsers with native support for :focus-visible.\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n }\n }\n return SpectrumMixinElement;\n}\n\n/**\n * Base class for 1st-gen Spectrum Web Components.\n */\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n /**\n * The version of the 1st-gen Spectrum Web Components library.\n */\n static VERSION = version;\n\n /**\n * The version of the core base package.\n */\n static CORE_VERSION = coreVersion;\n\n public override get dir(): CSSStyleDeclaration['direction'] {\n return getComputedStyle(this).direction ?? 'ltr';\n }\n}\n\nif (process.env.NODE_ENV === 'development') {\n const ignoreWarningTypes = {\n default: false,\n accessibility: false,\n api: false,\n };\n const ignoreWarningLevels = {\n default: false,\n low: false,\n medium: false,\n high: false,\n deprecation: false,\n };\n window.__swc = {\n ...window.__swc,\n DEBUG: true,\n ignoreWarningLocalNames: {\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = `${localName}:${type}:${level}` as BrandedSWCWarningID;\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id)) {\n return;\n }\n if (window.__swc.ignoreWarningLocalNames[localName]) {\n return;\n }\n if (window.__swc.ignoreWarningTypes[type]) {\n return;\n }\n if (window.__swc.ignoreWarningLevels[level]) {\n return;\n }\n window.__swc.issuedWarnings.add(id);\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const inspectElement = element\n ? '\\nInspect this issue in the follow element:'\n : '';\n const displayURL = (element ? '\\n\\n' : '\\n') + url + '\\n';\n const messages: unknown[] = [];\n messages.push(intro + message + '\\n' + listedIssues + inspectElement);\n if (element) {\n messages.push(element);\n }\n messages.push(displayURL, {\n data: {\n localName,\n type,\n level,\n },\n });\n console.warn(...messages);\n },\n };\n\n window.__swc.warn(\n undefined,\n 'Spectrum Web Components is in dev mode. Not recommended for production!',\n 'https://opensource.adobe.com/spectrum-web-components/dev-mode/',\n { type: 'default' }\n );\n}\n"],
5
- "mappings": ";AAAA;AAYA,SAAS,kBAAmC;AAE5C,SAAS,aAAa,eAAe;AAa9B,gBAAS,c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AAAA,QACF;AAAA,MACF,CAAC;AACD,cAAQ,KAAK,GAAG,QAAQ;AAAA,IAC1B;AAAA,EACF;AAEA,SAAO,MAAM;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,MAAM,UAAU;AAAA,EACpB;AACF;",
4
+ "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { LitElement, ReactiveElement } from 'lit';\n\nimport { coreVersion, version } from './version.dev.js'\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport interface SpectrumInterface {\n shadowRoot: ShadowRoot;\n isLTR: boolean;\n hasVisibleFocusInTree(): boolean;\n}\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @internal\n */\n public override shadowRoot!: ShadowRoot;\n public get isLTR(): boolean {\n return getComputedStyle(this).direction !== 'rtl';\n }\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot.activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode ? [currentNode] : [];\n while (currentNode) {\n const ancestor =\n currentNode.assignedSlot ||\n currentNode.parentElement ||\n (currentNode.getRootNode() as ShadowRoot)?.host;\n if (ancestor) {\n ancestors.push(ancestor as HTMLElement);\n }\n currentNode = ancestor as HTMLElement;\n }\n return ancestors;\n };\n const activeElement = getAncestors(this.getRootNode() as Document)[0];\n if (!activeElement) {\n return false;\n }\n // Browsers without support for the `:focus-visible`\n // selector will throw on the following test (Safari, older things).\n // Some won't throw, but will be focusing item rather than the menu and\n // will rely on the polyfill to know whether focus is \"visible\" or not.\n // .focus-visible polyfill class will intentionally not be checked in 2nd-gen.\n // 2nd-gen targets browsers with native support for :focus-visible.\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n }\n }\n return SpectrumMixinElement;\n}\n\n/**\n * Base class for 1st-gen Spectrum Web Components.\n */\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n /**\n * The version of the 1st-gen Spectrum Web Components library.\n */\n static VERSION = version;\n\n /**\n * The version of the core base package.\n */\n static CORE_VERSION = coreVersion;\n\n public override get dir(): CSSStyleDeclaration['direction'] {\n return getComputedStyle(this).direction ?? 'ltr';\n }\n}\n\nif (process.env.NODE_ENV === 'development') {\n const ignoreWarningTypes = {\n default: false,\n accessibility: false,\n api: false,\n };\n const ignoreWarningLevels = {\n default: false,\n low: false,\n medium: false,\n high: false,\n deprecation: false,\n };\n window.__swc = {\n ...window.__swc,\n DEBUG: true,\n ignoreWarningLocalNames: {\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = `${localName}:${type}:${level}` as BrandedSWCWarningID;\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id)) {\n return;\n }\n if (window.__swc.ignoreWarningLocalNames[localName]) {\n return;\n }\n if (window.__swc.ignoreWarningTypes[type]) {\n return;\n }\n if (window.__swc.ignoreWarningLevels[level]) {\n return;\n }\n window.__swc.issuedWarnings.add(id);\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const inspectElement = element\n ? '\\nInspect this issue in the follow element:'\n : '';\n const displayURL = (element ? '\\n\\n' : '\\n') + url + '\\n';\n const messages: unknown[] = [];\n messages.push(intro + message + '\\n' + listedIssues + inspectElement);\n if (element) {\n messages.push(element);\n }\n messages.push(displayURL, {\n data: {\n localName,\n type,\n level,\n },\n });\n console.warn(...messages);\n },\n };\n\n window.__swc.warn(\n undefined,\n 'Spectrum Web Components is in dev mode. Not recommended for production!',\n 'https://opensource.adobe.com/spectrum-web-components/dev-mode/',\n { type: 'default' }\n );\n}\n"],
5
+ "mappings": ";AAAA;AAYA,SAAS,kBAAmC;AAE5C,SAAS,aAAa,eAAe;AAc9B,gBAAS,cACd,aACoC;AAAA,EACpC,MAAM,6BAA6B,YAAY;AAAA,IAK7C,IAAW,QAAiB;AAC1B,aAAO,iBAAiB,IAAI,EAAE,cAAc;AAAA,IAC9C;AAAA,IACO,wBAAiC;AACtC,YAAM,eAAe,CAAC,OAAiB,aAA4B;AAxCzE,YAAAA;AAyCQ,YAAI,cAAc,KAAK;AACvB,gBACE,2CAAa,eACb,YAAY,WAAW,eACvB;AACA,wBAAc,YAAY,WAAW;AAAA,QACvC;AACA,cAAM,YAA2B,cAAc,CAAC,WAAW,IAAI,CAAC;AAChE,eAAO,aAAa;AAClB,gBAAM,WACJ,YAAY,gBACZ,YAAY,mBACXA,MAAA,YAAY,YAAY,MAAxB,gBAAAA,IAA0C;AAC7C,cAAI,UAAU;AACZ,sBAAU,KAAK,QAAuB;AAAA,UACxC;AACA,wBAAc;AAAA,QAChB;AACA,eAAO;AAAA,MACT;AACA,YAAM,gBAAgB,aAAa,KAAK,YAAY,CAAa,EAAE,CAAC;AACpE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,EAAE,GAAG;AAChE;AAAA,MACF;AACA,UAAI,OAAO,MAAM,wBAAwB,SAAS,GAAG;AACnD;AAAA,MACF;AACA,UAAI,OAAO,MAAM,mBAAmB,IAAI,GAAG;AACzC;AAAA,MACF;AACA,UAAI,OAAO,MAAM,oBAAoB,KAAK,GAAG;AAC3C;AAAA,MACF;AACA,aAAO,MAAM,eAAe,IAAI,EAAE;AAClC,UAAI,eAAe;AACnB,UAAI,UAAU,OAAO,QAAQ;AAC3B,eAAO,QAAQ,EAAE;AACjB,uBAAe,OAAO,KAAK,UAAU,IAAI;AAAA,MAC3C;AACA,YAAM,QAAQ,UAAU,gBAAgB,yBAAyB;AACjE,YAAM,iBAAiB,UACnB,gDACA;AACJ,YAAM,cAAc,UAAU,SAAS,QAAQ,MAAM;AACrD,YAAM,WAAsB,CAAC;AAC7B,eAAS,KAAK,QAAQ,UAAU,OAAO,eAAe,cAAc;AACpE,UAAI,SAAS;AACX,iBAAS,KAAK,OAAO;AAAA,MACvB;AACA,eAAS,KAAK,YAAY;AAAA,QACxB,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF,CAAC;AACD,cAAQ,KAAK,GAAG,QAAQ;AAAA,IAC1B;AAAA,EACF;AAEA,SAAO,MAAM;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,MAAM,UAAU;AAAA,EACpB;AACF;",
6
6
  "names": ["_a"]
7
7
  }
package/src/Base.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";import{LitElement as d}from"lit";import{coreVersion as m,version as u}from"./version.js";export function SpectrumMixin(o){class s extends o{hasVisibleFocusInTree(){const n=((r=document)=>{var a;let e=r.activeElement;for(;e!=null&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;const i=e?[e]:[];for(;e;){const t=e.assignedSlot||e.parentElement||((a=e.getRootNode())==null?void 0:a.host);t&&i.push(t),e=t}return i})(this.getRootNode())[0];return n?n.matches(":focus-visible")||n.matches(".focus-visible"):!1}}return s}export class SpectrumElement extends SpectrumMixin(d){get dir(){var s;return(s=getComputedStyle(this).direction)!=null?s:"ltr"}}SpectrumElement.VERSION=u,SpectrumElement.CORE_VERSION=m;
1
+ "use strict";import{LitElement as d}from"lit";import{coreVersion as m,version as u}from"./version.js";export function SpectrumMixin(o){class n extends o{get isLTR(){return getComputedStyle(this).direction!=="rtl"}hasVisibleFocusInTree(){const s=((r=document)=>{var a;let e=r.activeElement;for(;e!=null&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;const i=e?[e]:[];for(;e;){const t=e.assignedSlot||e.parentElement||((a=e.getRootNode())==null?void 0:a.host);t&&i.push(t),e=t}return i})(this.getRootNode())[0];return s?s.matches(":focus-visible")||s.matches(".focus-visible"):!1}}return n}export class SpectrumElement extends SpectrumMixin(d){get dir(){var n;return(n=getComputedStyle(this).direction)!=null?n:"ltr"}}SpectrumElement.VERSION=u,SpectrumElement.CORE_VERSION=m;
2
2
  //# sourceMappingURL=Base.js.map
package/src/Base.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["Base.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { LitElement, ReactiveElement } from 'lit';\n\nimport { coreVersion, version } from './version.js';\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport interface SpectrumInterface {\n shadowRoot: ShadowRoot;\n hasVisibleFocusInTree(): boolean;\n}\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @internal\n */\n public override shadowRoot!: ShadowRoot;\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot.activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode ? [currentNode] : [];\n while (currentNode) {\n const ancestor =\n currentNode.assignedSlot ||\n currentNode.parentElement ||\n (currentNode.getRootNode() as ShadowRoot)?.host;\n if (ancestor) {\n ancestors.push(ancestor as HTMLElement);\n }\n currentNode = ancestor as HTMLElement;\n }\n return ancestors;\n };\n const activeElement = getAncestors(this.getRootNode() as Document)[0];\n if (!activeElement) {\n return false;\n }\n // Browsers without support for the `:focus-visible`\n // selector will throw on the following test (Safari, older things).\n // Some won't throw, but will be focusing item rather than the menu and\n // will rely on the polyfill to know whether focus is \"visible\" or not.\n // .focus-visible polyfill class will intentionally not be checked in 2nd-gen.\n // 2nd-gen targets browsers with native support for :focus-visible.\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n }\n }\n return SpectrumMixinElement;\n}\n\n/**\n * Base class for 1st-gen Spectrum Web Components.\n */\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n /**\n * The version of the 1st-gen Spectrum Web Components library.\n */\n static VERSION = version;\n\n /**\n * The version of the core base package.\n */\n static CORE_VERSION = coreVersion;\n\n public override get dir(): CSSStyleDeclaration['direction'] {\n return getComputedStyle(this).direction ?? 'ltr';\n }\n}\n\nif (process.env.NODE_ENV === 'development') {\n const ignoreWarningTypes = {\n default: false,\n accessibility: false,\n api: false,\n };\n const ignoreWarningLevels = {\n default: false,\n low: false,\n medium: false,\n high: false,\n deprecation: false,\n };\n window.__swc = {\n ...window.__swc,\n DEBUG: true,\n ignoreWarningLocalNames: {\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = `${localName}:${type}:${level}` as BrandedSWCWarningID;\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id)) {\n return;\n }\n if (window.__swc.ignoreWarningLocalNames[localName]) {\n return;\n }\n if (window.__swc.ignoreWarningTypes[type]) {\n return;\n }\n if (window.__swc.ignoreWarningLevels[level]) {\n return;\n }\n window.__swc.issuedWarnings.add(id);\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const inspectElement = element\n ? '\\nInspect this issue in the follow element:'\n : '';\n const displayURL = (element ? '\\n\\n' : '\\n') + url + '\\n';\n const messages: unknown[] = [];\n messages.push(intro + message + '\\n' + listedIssues + inspectElement);\n if (element) {\n messages.push(element);\n }\n messages.push(displayURL, {\n data: {\n localName,\n type,\n level,\n },\n });\n console.warn(...messages);\n },\n };\n\n window.__swc.warn(\n undefined,\n 'Spectrum Web Components is in dev mode. Not recommended for production!',\n 'https://opensource.adobe.com/spectrum-web-components/dev-mode/',\n { type: 'default' }\n );\n}\n"],
5
- "mappings": "aAYA,OAAS,cAAAA,MAAmC,MAE5C,OAAS,eAAAC,EAAa,WAAAC,MAAe,eAa9B,gBAAS,cACdC,EACoC,CACpC,MAAMC,UAA6BD,CAAY,CAKtC,uBAAiC,CAsBtC,MAAME,GArBe,CAACC,EAAiB,WAA4B,CApCzE,IAAAC,EAqCQ,IAAIC,EAAcF,EAAK,cACvB,KACEE,GAAA,MAAAA,EAAa,YACbA,EAAY,WAAW,eAEvBA,EAAcA,EAAY,WAAW,cAEvC,MAAMC,EAA2BD,EAAc,CAACA,CAAW,EAAI,CAAC,EAChE,KAAOA,GAAa,CAClB,MAAME,EACJF,EAAY,cACZA,EAAY,iBACXD,EAAAC,EAAY,YAAY,IAAxB,YAAAD,EAA0C,MACzCG,GACFD,EAAU,KAAKC,CAAuB,EAExCF,EAAcE,CAChB,CACA,OAAOD,CACT,GACmC,KAAK,YAAY,CAAa,EAAE,CAAC,EACpE,OAAKJ,EAUHA,EAAc,QAAQ,gBAAgB,GACtCA,EAAc,QAAQ,gBAAgB,EAV/B,EAYX,CACF,CACA,OAAOD,CACT,CAKO,aAAM,wBAAwB,cAAcJ,CAAU,CAAE,CAW7D,IAAoB,KAAwC,CA1F9D,IAAAO,EA2FI,OAAOA,EAAA,iBAAiB,IAAI,EAAE,YAAvB,KAAAA,EAAoC,KAC7C,CACF,CAda,gBAIJ,QAAUL,EAJN,gBASJ,aAAeD",
4
+ "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { LitElement, ReactiveElement } from 'lit';\n\nimport { coreVersion, version } from './version.js';\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport interface SpectrumInterface {\n shadowRoot: ShadowRoot;\n isLTR: boolean;\n hasVisibleFocusInTree(): boolean;\n}\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @internal\n */\n public override shadowRoot!: ShadowRoot;\n public get isLTR(): boolean {\n return getComputedStyle(this).direction !== 'rtl';\n }\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot.activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode ? [currentNode] : [];\n while (currentNode) {\n const ancestor =\n currentNode.assignedSlot ||\n currentNode.parentElement ||\n (currentNode.getRootNode() as ShadowRoot)?.host;\n if (ancestor) {\n ancestors.push(ancestor as HTMLElement);\n }\n currentNode = ancestor as HTMLElement;\n }\n return ancestors;\n };\n const activeElement = getAncestors(this.getRootNode() as Document)[0];\n if (!activeElement) {\n return false;\n }\n // Browsers without support for the `:focus-visible`\n // selector will throw on the following test (Safari, older things).\n // Some won't throw, but will be focusing item rather than the menu and\n // will rely on the polyfill to know whether focus is \"visible\" or not.\n // .focus-visible polyfill class will intentionally not be checked in 2nd-gen.\n // 2nd-gen targets browsers with native support for :focus-visible.\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n }\n }\n return SpectrumMixinElement;\n}\n\n/**\n * Base class for 1st-gen Spectrum Web Components.\n */\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n /**\n * The version of the 1st-gen Spectrum Web Components library.\n */\n static VERSION = version;\n\n /**\n * The version of the core base package.\n */\n static CORE_VERSION = coreVersion;\n\n public override get dir(): CSSStyleDeclaration['direction'] {\n return getComputedStyle(this).direction ?? 'ltr';\n }\n}\n\nif (process.env.NODE_ENV === 'development') {\n const ignoreWarningTypes = {\n default: false,\n accessibility: false,\n api: false,\n };\n const ignoreWarningLevels = {\n default: false,\n low: false,\n medium: false,\n high: false,\n deprecation: false,\n };\n window.__swc = {\n ...window.__swc,\n DEBUG: true,\n ignoreWarningLocalNames: {\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = `${localName}:${type}:${level}` as BrandedSWCWarningID;\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id)) {\n return;\n }\n if (window.__swc.ignoreWarningLocalNames[localName]) {\n return;\n }\n if (window.__swc.ignoreWarningTypes[type]) {\n return;\n }\n if (window.__swc.ignoreWarningLevels[level]) {\n return;\n }\n window.__swc.issuedWarnings.add(id);\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const inspectElement = element\n ? '\\nInspect this issue in the follow element:'\n : '';\n const displayURL = (element ? '\\n\\n' : '\\n') + url + '\\n';\n const messages: unknown[] = [];\n messages.push(intro + message + '\\n' + listedIssues + inspectElement);\n if (element) {\n messages.push(element);\n }\n messages.push(displayURL, {\n data: {\n localName,\n type,\n level,\n },\n });\n console.warn(...messages);\n },\n };\n\n window.__swc.warn(\n undefined,\n 'Spectrum Web Components is in dev mode. Not recommended for production!',\n 'https://opensource.adobe.com/spectrum-web-components/dev-mode/',\n { type: 'default' }\n );\n}\n"],
5
+ "mappings": "aAYA,OAAS,cAAAA,MAAmC,MAE5C,OAAS,eAAAC,EAAa,WAAAC,MAAe,eAc9B,gBAAS,cACdC,EACoC,CACpC,MAAMC,UAA6BD,CAAY,CAK7C,IAAW,OAAiB,CAC1B,OAAO,iBAAiB,IAAI,EAAE,YAAc,KAC9C,CACO,uBAAiC,CAsBtC,MAAME,GArBe,CAACC,EAAiB,WAA4B,CAxCzE,IAAAC,EAyCQ,IAAIC,EAAcF,EAAK,cACvB,KACEE,GAAA,MAAAA,EAAa,YACbA,EAAY,WAAW,eAEvBA,EAAcA,EAAY,WAAW,cAEvC,MAAMC,EAA2BD,EAAc,CAACA,CAAW,EAAI,CAAC,EAChE,KAAOA,GAAa,CAClB,MAAME,EACJF,EAAY,cACZA,EAAY,iBACXD,EAAAC,EAAY,YAAY,IAAxB,YAAAD,EAA0C,MACzCG,GACFD,EAAU,KAAKC,CAAuB,EAExCF,EAAcE,CAChB,CACA,OAAOD,CACT,GACmC,KAAK,YAAY,CAAa,EAAE,CAAC,EACpE,OAAKJ,EAUHA,EAAc,QAAQ,gBAAgB,GACtCA,EAAc,QAAQ,gBAAgB,EAV/B,EAYX,CACF,CACA,OAAOD,CACT,CAKO,aAAM,wBAAwB,cAAcJ,CAAU,CAAE,CAW7D,IAAoB,KAAwC,CA9F9D,IAAAO,EA+FI,OAAOA,EAAA,iBAAiB,IAAI,EAAE,YAAvB,KAAAA,EAAoC,KAC7C,CACF,CAda,gBAIJ,QAAUL,EAJN,gBASJ,aAAeD",
6
6
  "names": ["LitElement", "coreVersion", "version", "constructor", "SpectrumMixinElement", "activeElement", "root", "_a", "currentNode", "ancestors", "ancestor"]
7
7
  }
package/src/version.d.ts CHANGED
@@ -12,8 +12,8 @@
12
12
  /**
13
13
  * The version of the 1st-gen Spectrum Web Components library.
14
14
  */
15
- export declare const version = "1.12.0-snapshot.20260422090428";
15
+ export declare const version = "1.12.0";
16
16
  /**
17
17
  * The version of the core base package.
18
18
  */
19
- export declare const coreVersion = "0.1.0-snapshot.20260422090428";
19
+ export declare const coreVersion = "0.1.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- export const version = "1.12.0-snapshot.20260422090428";
3
- export const coreVersion = "0.1.0-snapshot.20260422090428";
2
+ export const version = "1.12.0";
3
+ export const coreVersion = "0.1.0";
4
4
  //# sourceMappingURL=version.dev.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["version.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Auto-generated from 1st-gen/tools/base/package.json\n// Generation: 1st-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 1st-gen Spectrum Web Components library.\n */\nexport const version = '1.12.0-snapshot.20260422090428';\n\n/**\n * The version of the core base package.\n */\nexport const coreVersion = '0.1.0-snapshot.20260422090428';\n"],
4
+ "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Auto-generated from 1st-gen/tools/base/package.json\n// Generation: 1st-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 1st-gen Spectrum Web Components library.\n */\nexport const version = '1.12.0';\n\n/**\n * The version of the core base package.\n */\nexport const coreVersion = '0.1.0';\n"],
5
5
  "mappings": ";AAmBO,aAAM,UAAU;AAKhB,aAAM,cAAc;",
6
6
  "names": []
7
7
  }
package/src/version.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";export const version="1.12.0-snapshot.20260422090428",coreVersion="0.1.0-snapshot.20260422090428";
1
+ "use strict";export const version="1.12.0",coreVersion="0.1.0";
2
2
  //# sourceMappingURL=version.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["version.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Auto-generated from 1st-gen/tools/base/package.json\n// Generation: 1st-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 1st-gen Spectrum Web Components library.\n */\nexport const version = '1.12.0-snapshot.20260422090428';\n\n/**\n * The version of the core base package.\n */\nexport const coreVersion = '0.1.0-snapshot.20260422090428';\n"],
5
- "mappings": "aAmBO,aAAM,QAAU,iCAKV,YAAc",
4
+ "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Auto-generated from 1st-gen/tools/base/package.json\n// Generation: 1st-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 1st-gen Spectrum Web Components library.\n */\nexport const version = '1.12.0';\n\n/**\n * The version of the core base package.\n */\nexport const coreVersion = '0.1.0';\n"],
5
+ "mappings": "aAmBO,aAAM,QAAU,SAKV,YAAc",
6
6
  "names": []
7
7
  }