@spectrum-web-components/base 1.8.0 → 1.9.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 +1 -1
- package/src/Base.dev.js +1 -1
- package/src/Base.dev.js.map +2 -2
- package/src/Base.js +1 -1
- package/src/Base.js.map +3 -3
- package/src/constants.d.ts +20 -0
- package/src/constants.dev.js +12 -0
- package/src/constants.dev.js.map +7 -0
- package/src/constants.js +2 -0
- package/src/constants.js.map +7 -0
- package/src/index.d.ts +1 -0
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +2 -2
- package/src/index.js +1 -1
- package/src/index.js.map +2 -2
- package/src/version.js +1 -1
package/package.json
CHANGED
package/src/Base.dev.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a, _b, _c;
|
|
3
|
-
import { LitElement } from "lit";
|
|
4
3
|
import { version } from "@spectrum-web-components/base/src/version.js";
|
|
4
|
+
import { LitElement } from "lit";
|
|
5
5
|
const observedForElements = /* @__PURE__ */ new Set();
|
|
6
6
|
const updateRTL = () => {
|
|
7
7
|
const dir = document.documentElement.dir === "rtl" ? document.documentElement.dir : "ltr";
|
package/src/Base.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Base.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright 2025 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';\nimport { version } from '@spectrum-web-components/base/src/version.js';\ntype ThemeRoot = HTMLElement & {\n startManagingContentDirection: (el: HTMLElement) => void;\n stopManagingContentDirection: (el: HTMLElement) => void;\n};\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 dir: 'ltr' | 'rtl';\n}\n\nconst observedForElements: Set<HTMLElement> = new Set();\n\nconst updateRTL = (): void => {\n const dir =\n document.documentElement.dir === 'rtl'\n ? document.documentElement.dir\n : 'ltr';\n observedForElements.forEach((el) => {\n el.setAttribute('dir', dir);\n });\n};\n\nconst rtlObserver = new MutationObserver(updateRTL);\n\nrtlObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n});\n\ntype ContentDirectionManager = HTMLElement & {\n startManagingContentDirection?(): void;\n};\n\nconst canManageContentDirection = (el: ContentDirectionManager): boolean =>\n typeof el.startManagingContentDirection !== 'undefined' ||\n el.tagName === 'SP-THEME';\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @private\n */\n public override shadowRoot!: ShadowRoot;\n private _dirParent?: HTMLElement;\n\n /**\n * @private\n */\n public override dir!: 'ltr' | 'rtl';\n\n /**\n * @private\n */\n public get isLTR(): boolean {\n return this.dir === 'ltr';\n }\n\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n // eslint-disable-next-line @spectrum-web-components/document-active-element\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot\n .activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode\n ? [currentNode]\n : [];\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(\n this.getRootNode() as Document\n )[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 try {\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n /* c8 ignore next 3 */\n } catch (error) {\n return activeElement.matches('.focus-visible');\n }\n }\n\n public override connectedCallback(): void {\n if (!this.hasAttribute('dir')) {\n let dirParent = ((this as HTMLElement).assignedSlot ||\n this.parentNode) as HTMLElement;\n while (\n dirParent !== document.documentElement &&\n !canManageContentDirection(\n dirParent as ContentDirectionManager\n )\n ) {\n dirParent = ((dirParent as HTMLElement).assignedSlot || // step into the shadow DOM of the parent of a slotted node\n dirParent.parentNode || // DOM Element detected\n (dirParent as unknown as ShadowRoot)\n .host) as HTMLElement;\n }\n this.dir =\n dirParent.dir === 'rtl' ? dirParent.dir : this.dir || 'ltr';\n if (dirParent === document.documentElement) {\n observedForElements.add(this);\n } else {\n const { localName } = dirParent;\n if (\n localName.search('-') > -1 &&\n !customElements.get(localName)\n ) {\n /* c8 ignore next 5 */\n customElements.whenDefined(localName).then(() => {\n (\n dirParent as ThemeRoot\n ).startManagingContentDirection(this);\n });\n } else {\n (dirParent as ThemeRoot).startManagingContentDirection(\n this\n );\n }\n }\n this._dirParent = dirParent as HTMLElement;\n }\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this._dirParent) {\n if (this._dirParent === document.documentElement) {\n observedForElements.delete(this);\n } else {\n (this._dirParent as ThemeRoot).stopManagingContentDirection(\n this\n );\n }\n this.removeAttribute('dir');\n }\n }\n }\n return SpectrumMixinElement;\n}\n\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n static VERSION = version;\n}\n\nif (window.__swc.DEBUG) {\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 ignoreWarningLocalNames: {\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n /* c8 ignore next 1 */\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 /* c8 ignore next 3 */\n if (window.__swc.ignoreWarningLocalNames[localName]) return;\n if (window.__swc.ignoreWarningTypes[type]) return;\n if (window.__swc.ignoreWarningLevels[level]) return;\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(\n intro + message + '\\n' + listedIssues + inspectElement\n );\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,
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 { version } from '@spectrum-web-components/base/src/version.js';\nimport { LitElement, ReactiveElement } from 'lit';\ntype ThemeRoot = HTMLElement & {\n startManagingContentDirection: (el: HTMLElement) => void;\n stopManagingContentDirection: (el: HTMLElement) => void;\n};\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 dir: 'ltr' | 'rtl';\n}\n\nconst observedForElements: Set<HTMLElement> = new Set();\n\nconst updateRTL = (): void => {\n const dir =\n document.documentElement.dir === 'rtl'\n ? document.documentElement.dir\n : 'ltr';\n observedForElements.forEach((el) => {\n el.setAttribute('dir', dir);\n });\n};\n\nconst rtlObserver = new MutationObserver(updateRTL);\n\nrtlObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n});\n\ntype ContentDirectionManager = HTMLElement & {\n startManagingContentDirection?(): void;\n};\n\nconst canManageContentDirection = (el: ContentDirectionManager): boolean =>\n typeof el.startManagingContentDirection !== 'undefined' ||\n el.tagName === 'SP-THEME';\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @private\n */\n public override shadowRoot!: ShadowRoot;\n private _dirParent?: HTMLElement;\n\n /**\n * @private\n */\n public override dir!: 'ltr' | 'rtl';\n\n /**\n * @private\n */\n public get isLTR(): boolean {\n return this.dir === 'ltr';\n }\n\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n // eslint-disable-next-line @spectrum-web-components/document-active-element\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot\n .activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode\n ? [currentNode]\n : [];\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(\n this.getRootNode() as Document\n )[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 try {\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n /* c8 ignore next 3 */\n } catch (error) {\n return activeElement.matches('.focus-visible');\n }\n }\n\n public override connectedCallback(): void {\n if (!this.hasAttribute('dir')) {\n let dirParent = ((this as HTMLElement).assignedSlot ||\n this.parentNode) as HTMLElement;\n while (\n dirParent !== document.documentElement &&\n !canManageContentDirection(\n dirParent as ContentDirectionManager\n )\n ) {\n dirParent = ((dirParent as HTMLElement).assignedSlot || // step into the shadow DOM of the parent of a slotted node\n dirParent.parentNode || // DOM Element detected\n (dirParent as unknown as ShadowRoot)\n .host) as HTMLElement;\n }\n this.dir =\n dirParent.dir === 'rtl' ? dirParent.dir : this.dir || 'ltr';\n if (dirParent === document.documentElement) {\n observedForElements.add(this);\n } else {\n const { localName } = dirParent;\n if (\n localName.search('-') > -1 &&\n !customElements.get(localName)\n ) {\n /* c8 ignore next 5 */\n customElements.whenDefined(localName).then(() => {\n (\n dirParent as ThemeRoot\n ).startManagingContentDirection(this);\n });\n } else {\n (dirParent as ThemeRoot).startManagingContentDirection(\n this\n );\n }\n }\n this._dirParent = dirParent as HTMLElement;\n }\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this._dirParent) {\n if (this._dirParent === document.documentElement) {\n observedForElements.delete(this);\n } else {\n (this._dirParent as ThemeRoot).stopManagingContentDirection(\n this\n );\n }\n this.removeAttribute('dir');\n }\n }\n }\n return SpectrumMixinElement;\n}\n\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n static VERSION = version;\n}\n\nif (window.__swc.DEBUG) {\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 ignoreWarningLocalNames: {\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n /* c8 ignore next 1 */\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 /* c8 ignore next 3 */\n if (window.__swc.ignoreWarningLocalNames[localName]) return;\n if (window.__swc.ignoreWarningTypes[type]) return;\n if (window.__swc.ignoreWarningLevels[level]) return;\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(\n intro + message + '\\n' + listedIssues + inspectElement\n );\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,eAAe;AACxB,SAAS,kBAAmC;AAmB5C,MAAM,sBAAwC,oBAAI,IAAI;AAEtD,MAAM,YAAY,MAAY;AAC1B,QAAM,MACF,SAAS,gBAAgB,QAAQ,QAC3B,SAAS,gBAAgB,MACzB;AACV,sBAAoB,QAAQ,CAAC,OAAO;AAChC,OAAG,aAAa,OAAO,GAAG;AAAA,EAC9B,CAAC;AACL;AAEA,MAAM,cAAc,IAAI,iBAAiB,SAAS;AAElD,YAAY,QAAQ,SAAS,iBAAiB;AAAA,EAC1C,YAAY;AAAA,EACZ,iBAAiB,CAAC,KAAK;AAC3B,CAAC;AAMD,MAAM,4BAA4B,CAAC,OAC/B,OAAO,GAAG,kCAAkC,eAC5C,GAAG,YAAY;AAEZ,gBAAS,cACZ,aACkC;AAAA,EAClC,MAAM,6BAA6B,YAAY;AAAA;AAAA;AAAA;AAAA,IAe3C,IAAW,QAAiB;AACxB,aAAO,KAAK,QAAQ;AAAA,IACxB;AAAA,IAEO,wBAAiC;AACpC,YAAM,eAAe,CAAC,OAAiB,aAA4B;AAlF/E,YAAAA;AAoFgB,YAAI,cAAc,KAAK;AACvB,gBACI,2CAAa,eACb,YAAY,WAAW,eACzB;AACE,wBAAc,YAAY,WACrB;AAAA,QAC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AAI,OAAO,MAAM,wBAAwB,SAAS,EAAG;AACrD,UAAI,OAAO,MAAM,mBAAmB,IAAI,EAAG;AAC3C,UAAI,OAAO,MAAM,oBAAoB,KAAK,EAAG;AAC7C,aAAO,MAAM,eAAe,IAAI,EAAE;AAClC,UAAI,eAAe;AACnB,UAAI,UAAU,OAAO,QAAQ;AACzB,eAAO,QAAQ,EAAE;AACjB,uBAAe,OAAO,KAAK,UAAU,IAAI;AAAA,MAC7C;AACA,YAAM,QAAQ,UAAU,gBAAgB,yBAAyB;AACjE,YAAM,iBAAiB,UACjB,gDACA;AACN,YAAM,cAAc,UAAU,SAAS,QAAQ,MAAM;AACrD,YAAM,WAAsB,CAAC;AAC7B,eAAS;AAAA,QACL,QAAQ,UAAU,OAAO,eAAe;AAAA,MAC5C;AACA,UAAI,SAAS;AACT,iBAAS,KAAK,OAAO;AAAA,MACzB;AACA,eAAS,KAAK,YAAY;AAAA,QACtB,MAAM;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA,MACJ,CAAC;AACD,cAAQ,KAAK,GAAG,QAAQ;AAAA,IAC5B;AAAA,EACJ;AAEA,SAAO,MAAM;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,MAAM,UAAU;AAAA,EACtB;AACJ;",
|
|
6
6
|
"names": ["_a"]
|
|
7
7
|
}
|
package/src/Base.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import{
|
|
1
|
+
"use strict";import{version as m}from"@spectrum-web-components/base/src/version.js";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){}SpectrumElement.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 2025 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';\nimport { version } from '@spectrum-web-components/base/src/version.js';\ntype ThemeRoot = HTMLElement & {\n startManagingContentDirection: (el: HTMLElement) => void;\n stopManagingContentDirection: (el: HTMLElement) => void;\n};\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 dir: 'ltr' | 'rtl';\n}\n\nconst observedForElements: Set<HTMLElement> = new Set();\n\nconst updateRTL = (): void => {\n const dir =\n document.documentElement.dir === 'rtl'\n ? document.documentElement.dir\n : 'ltr';\n observedForElements.forEach((el) => {\n el.setAttribute('dir', dir);\n });\n};\n\nconst rtlObserver = new MutationObserver(updateRTL);\n\nrtlObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n});\n\ntype ContentDirectionManager = HTMLElement & {\n startManagingContentDirection?(): void;\n};\n\nconst canManageContentDirection = (el: ContentDirectionManager): boolean =>\n typeof el.startManagingContentDirection !== 'undefined' ||\n el.tagName === 'SP-THEME';\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @private\n */\n public override shadowRoot!: ShadowRoot;\n private _dirParent?: HTMLElement;\n\n /**\n * @private\n */\n public override dir!: 'ltr' | 'rtl';\n\n /**\n * @private\n */\n public get isLTR(): boolean {\n return this.dir === 'ltr';\n }\n\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n // eslint-disable-next-line @spectrum-web-components/document-active-element\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot\n .activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode\n ? [currentNode]\n : [];\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(\n this.getRootNode() as Document\n )[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 try {\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n /* c8 ignore next 3 */\n } catch (error) {\n return activeElement.matches('.focus-visible');\n }\n }\n\n public override connectedCallback(): void {\n if (!this.hasAttribute('dir')) {\n let dirParent = ((this as HTMLElement).assignedSlot ||\n this.parentNode) as HTMLElement;\n while (\n dirParent !== document.documentElement &&\n !canManageContentDirection(\n dirParent as ContentDirectionManager\n )\n ) {\n dirParent = ((dirParent as HTMLElement).assignedSlot || // step into the shadow DOM of the parent of a slotted node\n dirParent.parentNode || // DOM Element detected\n (dirParent as unknown as ShadowRoot)\n .host) as HTMLElement;\n }\n this.dir =\n dirParent.dir === 'rtl' ? dirParent.dir : this.dir || 'ltr';\n if (dirParent === document.documentElement) {\n observedForElements.add(this);\n } else {\n const { localName } = dirParent;\n if (\n localName.search('-') > -1 &&\n !customElements.get(localName)\n ) {\n /* c8 ignore next 5 */\n customElements.whenDefined(localName).then(() => {\n (\n dirParent as ThemeRoot\n ).startManagingContentDirection(this);\n });\n } else {\n (dirParent as ThemeRoot).startManagingContentDirection(\n this\n );\n }\n }\n this._dirParent = dirParent as HTMLElement;\n }\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this._dirParent) {\n if (this._dirParent === document.documentElement) {\n observedForElements.delete(this);\n } else {\n (this._dirParent as ThemeRoot).stopManagingContentDirection(\n this\n );\n }\n this.removeAttribute('dir');\n }\n }\n }\n return SpectrumMixinElement;\n}\n\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n static VERSION = version;\n}\n\nif (window.__swc.DEBUG) {\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 ignoreWarningLocalNames: {\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n /* c8 ignore next 1 */\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 /* c8 ignore next 3 */\n if (window.__swc.ignoreWarningLocalNames[localName]) return;\n if (window.__swc.ignoreWarningTypes[type]) return;\n if (window.__swc.ignoreWarningLevels[level]) return;\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(\n intro + message + '\\n' + listedIssues + inspectElement\n );\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,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 { version } from '@spectrum-web-components/base/src/version.js';\nimport { LitElement, ReactiveElement } from 'lit';\ntype ThemeRoot = HTMLElement & {\n startManagingContentDirection: (el: HTMLElement) => void;\n stopManagingContentDirection: (el: HTMLElement) => void;\n};\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 dir: 'ltr' | 'rtl';\n}\n\nconst observedForElements: Set<HTMLElement> = new Set();\n\nconst updateRTL = (): void => {\n const dir =\n document.documentElement.dir === 'rtl'\n ? document.documentElement.dir\n : 'ltr';\n observedForElements.forEach((el) => {\n el.setAttribute('dir', dir);\n });\n};\n\nconst rtlObserver = new MutationObserver(updateRTL);\n\nrtlObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n});\n\ntype ContentDirectionManager = HTMLElement & {\n startManagingContentDirection?(): void;\n};\n\nconst canManageContentDirection = (el: ContentDirectionManager): boolean =>\n typeof el.startManagingContentDirection !== 'undefined' ||\n el.tagName === 'SP-THEME';\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @private\n */\n public override shadowRoot!: ShadowRoot;\n private _dirParent?: HTMLElement;\n\n /**\n * @private\n */\n public override dir!: 'ltr' | 'rtl';\n\n /**\n * @private\n */\n public get isLTR(): boolean {\n return this.dir === 'ltr';\n }\n\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n // eslint-disable-next-line @spectrum-web-components/document-active-element\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot\n .activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode\n ? [currentNode]\n : [];\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(\n this.getRootNode() as Document\n )[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 try {\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n /* c8 ignore next 3 */\n } catch (error) {\n return activeElement.matches('.focus-visible');\n }\n }\n\n public override connectedCallback(): void {\n if (!this.hasAttribute('dir')) {\n let dirParent = ((this as HTMLElement).assignedSlot ||\n this.parentNode) as HTMLElement;\n while (\n dirParent !== document.documentElement &&\n !canManageContentDirection(\n dirParent as ContentDirectionManager\n )\n ) {\n dirParent = ((dirParent as HTMLElement).assignedSlot || // step into the shadow DOM of the parent of a slotted node\n dirParent.parentNode || // DOM Element detected\n (dirParent as unknown as ShadowRoot)\n .host) as HTMLElement;\n }\n this.dir =\n dirParent.dir === 'rtl' ? dirParent.dir : this.dir || 'ltr';\n if (dirParent === document.documentElement) {\n observedForElements.add(this);\n } else {\n const { localName } = dirParent;\n if (\n localName.search('-') > -1 &&\n !customElements.get(localName)\n ) {\n /* c8 ignore next 5 */\n customElements.whenDefined(localName).then(() => {\n (\n dirParent as ThemeRoot\n ).startManagingContentDirection(this);\n });\n } else {\n (dirParent as ThemeRoot).startManagingContentDirection(\n this\n );\n }\n }\n this._dirParent = dirParent as HTMLElement;\n }\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this._dirParent) {\n if (this._dirParent === document.documentElement) {\n observedForElements.delete(this);\n } else {\n (this._dirParent as ThemeRoot).stopManagingContentDirection(\n this\n );\n }\n this.removeAttribute('dir');\n }\n }\n }\n return SpectrumMixinElement;\n}\n\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n static VERSION = version;\n}\n\nif (window.__swc.DEBUG) {\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 ignoreWarningLocalNames: {\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n /* c8 ignore next 1 */\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n /* c8 ignore next 1 */\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 /* c8 ignore next 3 */\n if (window.__swc.ignoreWarningLocalNames[localName]) return;\n if (window.__swc.ignoreWarningTypes[type]) return;\n if (window.__swc.ignoreWarningLevels[level]) return;\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(\n intro + message + '\\n' + listedIssues + inspectElement\n );\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,WAAAA,MAAe,+CACxB,OAAS,cAAAC,MAAmC,MAmB5C,MAAMC,EAAwC,IAAI,IAE5CC,EAAY,IAAY,CAC1B,MAAMC,EACF,SAAS,gBAAgB,MAAQ,MAC3B,SAAS,gBAAgB,IACzB,MACVF,EAAoB,QAASG,GAAO,CAChCA,EAAG,aAAa,MAAOD,CAAG,CAC9B,CAAC,CACL,EAEME,EAAc,IAAI,iBAAiBH,CAAS,EAElDG,EAAY,QAAQ,SAAS,gBAAiB,CAC1C,WAAY,GACZ,gBAAiB,CAAC,KAAK,CAC3B,CAAC,EAMD,MAAMC,EAA6BF,GAC/B,OAAOA,EAAG,+BAAkC,aAC5CA,EAAG,UAAY,WAEZ,gBAAS,cACZG,EACkC,CAClC,MAAMC,UAA6BD,CAAY,CAe3C,IAAW,OAAiB,CACxB,OAAO,KAAK,MAAQ,KACxB,CAEO,uBAAiC,CA0BpC,MAAME,GAzBe,CAACC,EAAiB,WAA4B,CAlF/E,IAAAC,EAoFgB,IAAIC,EAAcF,EAAK,cACvB,KACIE,GAAA,MAAAA,EAAa,YACbA,EAAY,WAAW,eAEvBA,EAAcA,EAAY,WACrB,cAET,MAAMC,EAA2BD,EAC3B,CAACA,CAAW,EACZ,CAAC,EACP,KAAOA,GAAa,CAChB,MAAME,EACF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ir", "el", "rtlObserver", "canManageContentDirection", "constructor", "SpectrumMixinElement", "activeElement", "root", "_a", "currentNode", "ancestors", "ancestor", "error", "dirParent", "localName"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Array of input component tag names for easier iteration and maintenance.
|
|
14
|
+
*/
|
|
15
|
+
export declare const INPUT_COMPONENT_TAGS: readonly ["SP-SEARCH", "SP-TEXTFIELD", "SP-NUMBER-FIELD", "SP-COMBOBOX", "SP-COLOR-FIELD"];
|
|
16
|
+
/**
|
|
17
|
+
* Regular expression pattern to match Spectrum Web Components input elements.
|
|
18
|
+
* Used to identify components that should maintain focus during menu interactions.
|
|
19
|
+
*/
|
|
20
|
+
export declare const INPUT_COMPONENT_PATTERN: RegExp;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
export const INPUT_COMPONENT_TAGS = [
|
|
3
|
+
"SP-SEARCH",
|
|
4
|
+
"SP-TEXTFIELD",
|
|
5
|
+
"SP-NUMBER-FIELD",
|
|
6
|
+
"SP-COMBOBOX",
|
|
7
|
+
"SP-COLOR-FIELD"
|
|
8
|
+
];
|
|
9
|
+
export const INPUT_COMPONENT_PATTERN = new RegExp(
|
|
10
|
+
`^(${INPUT_COMPONENT_TAGS.join("|")})$`
|
|
11
|
+
);
|
|
12
|
+
//# sourceMappingURL=constants.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["constants.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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/**\n * Array of input component tag names for easier iteration and maintenance.\n */\nexport const INPUT_COMPONENT_TAGS = [\n 'SP-SEARCH',\n 'SP-TEXTFIELD',\n 'SP-NUMBER-FIELD',\n 'SP-COMBOBOX',\n 'SP-COLOR-FIELD',\n] as const;\n\n/**\n * Regular expression pattern to match Spectrum Web Components input elements.\n * Used to identify components that should maintain focus during menu interactions.\n */\nexport const INPUT_COMPONENT_PATTERN = new RegExp(\n `^(${INPUT_COMPONENT_TAGS.join('|')})$`\n);\n"],
|
|
5
|
+
"mappings": ";AAeO,aAAM,uBAAuB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAMO,aAAM,0BAA0B,IAAI;AAAA,EACvC,KAAK,qBAAqB,KAAK,GAAG,CAAC;AACvC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/constants.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["constants.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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/**\n * Array of input component tag names for easier iteration and maintenance.\n */\nexport const INPUT_COMPONENT_TAGS = [\n 'SP-SEARCH',\n 'SP-TEXTFIELD',\n 'SP-NUMBER-FIELD',\n 'SP-COMBOBOX',\n 'SP-COLOR-FIELD',\n] as const;\n\n/**\n * Regular expression pattern to match Spectrum Web Components input elements.\n * Used to identify components that should maintain focus during menu interactions.\n */\nexport const INPUT_COMPONENT_PATTERN = new RegExp(\n `^(${INPUT_COMPONENT_TAGS.join('|')})$`\n);\n"],
|
|
5
|
+
"mappings": "aAeO,aAAM,qBAAuB,CAChC,YACA,eACA,kBACA,cACA,gBACJ,EAMa,wBAA0B,IAAI,OACvC,KAAK,qBAAqB,KAAK,GAAG,CAAC,IACvC",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/index.d.ts
CHANGED
package/src/index.dev.js
CHANGED
package/src/index.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright 2025 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\nexport * from './Base.dev.js'\nexport * from './sizedMixin.dev.js'\nexport * from 'lit';\n"],
|
|
5
|
-
"mappings": ";AAYA,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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\nexport * from './Base.dev.js'\nexport * from './sizedMixin.dev.js'\nexport * from './constants.dev.js'\nexport * from 'lit';\n"],
|
|
5
|
+
"mappings": ";AAYA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";export*from"./Base.js";export*from"./sizedMixin.js";export*from"lit";
|
|
1
|
+
"use strict";export*from"./Base.js";export*from"./sizedMixin.js";export*from"./constants.js";export*from"lit";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright 2025 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\nexport * from './Base.js';\nexport * from './sizedMixin.js';\nexport * from 'lit';\n"],
|
|
5
|
-
"mappings": "aAYA,WAAc,YACd,WAAc,kBACd,WAAc",
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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\nexport * from './Base.js';\nexport * from './sizedMixin.js';\nexport * from './constants.js';\nexport * from 'lit';\n"],
|
|
5
|
+
"mappings": "aAYA,WAAc,YACd,WAAc,kBACd,WAAc,iBACd,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '1.
|
|
2
|
+
export const version = '1.9.0';
|