@spectrum-web-components/core 0.0.2-snapshot.20251201180143 → 0.0.2

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.
@@ -17,7 +17,7 @@ class p extends u {
17
17
  if (e === this.variant)
18
18
  return;
19
19
  const s = this.variant;
20
- this.isValidVariant(e) ? (this.setAttribute("variant", e), this._variant = e) : (this.removeAttribute("variant"), this._variant = "", window.__swc.DEBUG && window.__swc.warn(
20
+ this.isValidVariant(e) ? (this.setAttribute("variant", e), this._variant = e) : (this.removeAttribute("variant"), this._variant = "", window.__swc?.DEBUG && window.__swc.warn(
21
21
  this,
22
22
  `<${this.localName}> element expects the "variant" attribute to be one of the following:`,
23
23
  "https://opensource.adobe.com/spectrum-web-components/components/alert-banner/#variants",
@@ -1 +1 @@
1
- {"version":3,"file":"AlertBanner.base.js","sources":["../../../components/alert-banner/AlertBanner.base.ts"],"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 */\nimport { CSSResultArray, PropertyValues, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@spectrum-web-components/core/shared/base/index.js';\n\nconst VALID_VARIANTS = ['neutral', 'info', 'negative'];\nexport type AlertBannerVariants = (typeof VALID_VARIANTS)[number];\n\n/**\n * Base class for alert banner components\n */\nexport abstract class AlertBannerBase extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [];\n }\n\n /**\n * Controls the display of the alert banner\n *\n * @param {Boolean} open\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Whether to include an icon-only close button to dismiss the alert banner\n *\n * @param {Boolean} dismissible\n */\n @property({ type: Boolean, reflect: true })\n public dismissible = false;\n\n /**\n * The variant applies specific styling when set to `negative` or `info`;\n * `variant` attribute is removed when it's passed an invalid variant.\n *\n * @param {String} variant\n */\n @property({ type: String })\n public set variant(variant: AlertBannerVariants) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n\n if (this.isValidVariant(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n } else {\n this.removeAttribute('variant');\n this._variant = '';\n\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"variant\" attribute to be one of the following:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/alert-banner/#variants',\n {\n issues: [...VALID_VARIANTS],\n }\n );\n }\n }\n this.requestUpdate('variant', oldValue);\n }\n\n public get variant(): AlertBannerVariants {\n return this._variant;\n }\n\n private _variant: AlertBannerVariants = '';\n\n protected isValidVariant(variant: string): boolean {\n return VALID_VARIANTS.includes(variant);\n }\n\n protected abstract renderIcon(variant: string): TemplateResult;\n\n protected shouldClose(): void {\n const applyDefault = this.dispatchEvent(\n new CustomEvent('close', {\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n if (applyDefault) {\n this.close();\n }\n }\n\n public close(): void {\n this.open = false;\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n if (event.code === 'Escape' && this.dismissible) {\n this.shouldClose();\n }\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n\n if (changes.has('open')) {\n if (this.open) {\n this.addEventListener('keydown', this.handleKeydown);\n } else {\n this.removeEventListener('keydown', this.handleKeydown);\n }\n }\n }\n}\n"],"names":["VALID_VARIANTS","AlertBannerBase","SpectrumElement","variant","oldValue","event","changes","__decorateClass","property"],"mappings":";;;;;;;AAgBA,MAAMA,IAAiB,CAAC,WAAW,QAAQ,UAAU;AAM9C,MAAeC,UAAwBC,EAAgB;AAAA,EAAvD,cAAA;AAA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A;AAAA,EADNC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAVxBP,EAWX,WAAA,QAAA,CAAA;AAQAM,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAlBxBP,EAmBX,WAAA,eAAA,CAAA;AASIM,EAAA;AAAA,EADVC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3BRP,EA4BP,WAAA,WAAA,CAAA;"}
1
+ {"version":3,"file":"AlertBanner.base.js","sources":["../../../components/alert-banner/AlertBanner.base.ts"],"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 */\nimport { CSSResultArray, PropertyValues, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@spectrum-web-components/core/shared/base/index.js';\n\nconst VALID_VARIANTS = ['neutral', 'info', 'negative'];\nexport type AlertBannerVariants = (typeof VALID_VARIANTS)[number];\n\n/**\n * Base class for alert banner components\n */\nexport abstract class AlertBannerBase extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [];\n }\n\n /**\n * Controls the display of the alert banner\n *\n * @param {Boolean} open\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Whether to include an icon-only close button to dismiss the alert banner\n *\n * @param {Boolean} dismissible\n */\n @property({ type: Boolean, reflect: true })\n public dismissible = false;\n\n /**\n * The variant applies specific styling when set to `negative` or `info`;\n * `variant` attribute is removed when it's passed an invalid variant.\n *\n * @param {String} variant\n */\n @property({ type: String })\n public set variant(variant: AlertBannerVariants) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n\n if (this.isValidVariant(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n } else {\n this.removeAttribute('variant');\n this._variant = '';\n\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"variant\" attribute to be one of the following:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/alert-banner/#variants',\n {\n issues: [...VALID_VARIANTS],\n }\n );\n }\n }\n this.requestUpdate('variant', oldValue);\n }\n\n public get variant(): AlertBannerVariants {\n return this._variant;\n }\n\n private _variant: AlertBannerVariants = '';\n\n protected isValidVariant(variant: string): boolean {\n return VALID_VARIANTS.includes(variant);\n }\n\n protected abstract renderIcon(variant: string): TemplateResult;\n\n protected shouldClose(): void {\n const applyDefault = this.dispatchEvent(\n new CustomEvent('close', {\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n if (applyDefault) {\n this.close();\n }\n }\n\n public close(): void {\n this.open = false;\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n if (event.code === 'Escape' && this.dismissible) {\n this.shouldClose();\n }\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n\n if (changes.has('open')) {\n if (this.open) {\n this.addEventListener('keydown', this.handleKeydown);\n } else {\n this.removeEventListener('keydown', this.handleKeydown);\n }\n }\n }\n}\n"],"names":["VALID_VARIANTS","AlertBannerBase","SpectrumElement","variant","oldValue","event","changes","__decorateClass","property"],"mappings":";;;;;;;AAgBA,MAAMA,IAAiB,CAAC,WAAW,QAAQ,UAAU;AAM9C,MAAeC,UAAwBC,EAAgB;AAAA,EAAvD,cAAA;AAAA,UAAA,GAAA,SAAA,GAWH,KAAO,OAAO,IAQd,KAAO,cAAc,IAwCrB,KAAQ,WAAgC;AAAA,EAAA;AAAA,EA1DxC,WAA2B,SAAyB;AAChD,WAAO,CAAA;AAAA,EACX;AAAA,EAyBA,IAAW,QAAQC,GAA8B;AAC7C,QAAIA,MAAY,KAAK;AACjB;AAE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S,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3BRP,EA4BP,WAAA,WAAA,CAAA;"}
@@ -1,5 +1,22 @@
1
+ import { PropertyValues } from 'lit';
1
2
  import { SpectrumElement } from '../../shared/base/index.js';
3
+ import { AssetVariant } from './Asset.types.js';
2
4
  export declare abstract class AssetBase extends SpectrumElement {
3
- variant: 'file' | 'folder' | undefined;
5
+ /**
6
+ * @internal
7
+ *
8
+ * A readonly array of all valid variants for the asset.
9
+ *
10
+ * This is an actual internal property, intended not for customer use
11
+ */
12
+ static readonly VARIANTS: readonly AssetVariant[];
13
+ /**
14
+ * The variant of the asset. When not provided, slot content is rendered (e.g., an image).
15
+ */
16
+ variant: AssetVariant | undefined;
17
+ /**
18
+ * Accessible label for the asset’s file or folder variant.
19
+ */
4
20
  label: string;
21
+ protected updated(changes: PropertyValues): void;
5
22
  }
@@ -1,22 +1,42 @@
1
- import { property as a } from "lit/decorators.js";
2
- import { SpectrumElement as f } from "@spectrum-web-components/core/shared/base/index.js";
3
- var i = Object.defineProperty, l = (r, p, o, m) => {
4
- for (var e = void 0, t = r.length - 1, s; t >= 0; t--)
5
- (s = r[t]) && (e = s(p, o, e) || e);
6
- return e && i(p, o, e), e;
1
+ import { property as i } from "lit/decorators.js";
2
+ import { SpectrumElement as c } from "@spectrum-web-components/core/shared/base/index.js";
3
+ import { ASSET_VARIANTS as u } from "./Asset.types.js";
4
+ var l = Object.defineProperty, a = (o, r, e, f) => {
5
+ for (var t = void 0, s = o.length - 1, n; s >= 0; s--)
6
+ (n = o[s]) && (t = n(r, e, t) || t);
7
+ return t && l(r, e, t), t;
7
8
  };
8
- class n extends f {
9
+ class p extends c {
9
10
  constructor() {
10
11
  super(...arguments), this.label = "";
11
12
  }
13
+ static {
14
+ this.VARIANTS = u;
15
+ }
16
+ // ──────────────────────
17
+ // IMPLEMENTATION
18
+ // ──────────────────────
19
+ updated(r) {
20
+ if (super.updated(r), window.__swc?.DEBUG) {
21
+ const e = this.constructor;
22
+ typeof this.variant < "u" && !e.VARIANTS.includes(this.variant) && window.__swc.warn(
23
+ this,
24
+ `<${this.localName}> element expects the "variant" attribute to be one of the following:`,
25
+ "https://opensource.adobe.com/spectrum-web-components/components/asset/",
26
+ {
27
+ issues: [...e.VARIANTS]
28
+ }
29
+ );
30
+ }
31
+ }
12
32
  }
13
- l([
14
- a({ type: String, reflect: !0 })
15
- ], n.prototype, "variant");
16
- l([
17
- a()
18
- ], n.prototype, "label");
33
+ a([
34
+ i({ type: String, reflect: !0 })
35
+ ], p.prototype, "variant");
36
+ a([
37
+ i()
38
+ ], p.prototype, "label");
19
39
  export {
20
- n as AssetBase
40
+ p as AssetBase
21
41
  };
22
42
  //# sourceMappingURL=Asset.base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Asset.base.js","sources":["../../../components/asset/Asset.base.ts"],"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 { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@spectrum-web-components/core/shared/base/index.js';\n\nexport abstract class AssetBase extends SpectrumElement {\n @property({ type: String, reflect: true })\n public variant: 'file' | 'folder' | undefined;\n\n @property()\n public label = '';\n}\n"],"names":["AssetBase","SpectrumElement","__decorateClass","property"],"mappings":";;;;;;;AAgBO,MAAeA,UAAkBC,EAAgB;AAAA,EAAjD,cAAA;AAAA,UAAA,GAAA,SAAA,GAKH,KAAO,QAAQ;AAAA,EAAA;AACnB;AAJWC,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GADvBH,EAEX,WAAA,SAAA;AAGAE,EAAA;AAAA,EADNC,EAAA;AAAS,GAJQH,EAKX,WAAA,OAAA;"}
1
+ {"version":3,"file":"Asset.base.js","sources":["../../../components/asset/Asset.base.ts"],"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 { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@spectrum-web-components/core/shared/base/index.js';\n\nimport { ASSET_VARIANTS, type AssetVariant } from './Asset.types.js';\n\nexport abstract class AssetBase extends SpectrumElement {\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n *\n * A readonly array of all valid variants for the asset.\n *\n * This is an actual internal property, intended not for customer use\n */\n static readonly VARIANTS: readonly AssetVariant[] = ASSET_VARIANTS;\n\n // ─────────────────\n // SHARED API\n // ─────────────────\n\n /**\n * The variant of the asset. When not provided, slot content is rendered (e.g., an image).\n */\n @property({ type: String, reflect: true })\n public variant: AssetVariant | undefined;\n\n /**\n * Accessible label for the asset’s file or folder variant.\n */\n @property()\n public label = '';\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (window.__swc?.DEBUG) {\n const constructor = this.constructor as typeof AssetBase;\n if (\n typeof this.variant !== 'undefined' &&\n !constructor.VARIANTS.includes(this.variant)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"variant\" attribute to be one of the following:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/asset/',\n {\n issues: [...constructor.VARIANTS],\n }\n );\n }\n }\n }\n}\n"],"names":["AssetBase","SpectrumElement","ASSET_VARIANTS","changes","constructor","__decorateClass","property"],"mappings":";;;;;;;;AAmBO,MAAeA,UAAkBC,EAAgB;AAAA,EAAjD,cAAA;AAAA,UAAA,GAAA,SAAA,GA4BH,KAAO,QAAQ;AAAA,EAAA;AAAA,EAhBf,OAAA;AAAA,SAAgB,WAAoCC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAsBjC,QAAQC,GAA+B;AAEtD,QADA,MAAM,QAAQA,CAAO,GACjB,OAAO,OAAO,OAAO;AACrB,YAAMC,IAAc,KAAK;AACzB,MACI,OAAO,KAAK,UAAY,OACxB,CAACA,EAAY,SAAS,SAAS,KAAK,OAAO,KAE3C,OAAO,MAAM;AAAA,QACT;AAAA,QACA,IAAI,KAAK,SAAS;AAAA,QAClB;AAAA,QACA;AAAA,UACI,QAAQ,CAAC,GAAGA,EAAY,QAAQ;AAAA,QAAA;AAAA,MACpC;AAAA,IAGZ;AAAA,EACJ;AACJ;AA/BWC,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GArBvBN,EAsBX,WAAA,SAAA;AAMAK,EAAA;AAAA,EADNC,EAAA;AAAS,GA3BQN,EA4BX,WAAA,OAAA;"}
@@ -0,0 +1,13 @@
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
+ export declare const ASSET_VARIANTS: readonly ["file", "folder"];
13
+ export type AssetVariant = (typeof ASSET_VARIANTS)[number];
@@ -0,0 +1,5 @@
1
+ const e = ["file", "folder"];
2
+ export {
3
+ e as ASSET_VARIANTS
4
+ };
5
+ //# sourceMappingURL=Asset.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Asset.types.js","sources":["../../../components/asset/Asset.types.ts"],"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 const ASSET_VARIANTS = ['file', 'folder'] as const;\n\nexport type AssetVariant = (typeof ASSET_VARIANTS)[number];\n"],"names":["ASSET_VARIANTS"],"mappings":"AAYO,MAAMA,IAAiB,CAAC,QAAQ,QAAQ;"}
@@ -10,3 +10,4 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  export * from './Asset.base.js';
13
+ export * from './Asset.types.js';
@@ -1,5 +1,7 @@
1
- import { AssetBase as o } from "./Asset.base.js";
1
+ import { AssetBase as r } from "./Asset.base.js";
2
+ import { ASSET_VARIANTS as s } from "./Asset.types.js";
2
3
  export {
3
- o as AssetBase
4
+ s as ASSET_VARIANTS,
5
+ r as AssetBase
4
6
  };
5
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -26,7 +26,7 @@ class i extends b(h, {
26
26
  updated(e) {
27
27
  super.updated(e), !this.indeterminate && e.has("progress") ? this.setAttribute("aria-valuenow", "" + this.progress) : this.hasAttribute("aria-valuenow") && this.removeAttribute("aria-valuenow"), e.has("label") && (this.label.length ? this.setAttribute("aria-label", this.label) : e.get("label") === this.getAttribute("aria-label") && this.removeAttribute("aria-label"));
28
28
  const s = () => !!(this.label || this.getAttribute("aria-label") || this.getAttribute("aria-labelledby") || this.slotEl.assignedNodes().length);
29
- window.__swc.DEBUG && !s() && this.getAttribute("role") === "progressbar" && window.__swc?.warn(
29
+ window.__swc?.DEBUG && !s() && this.getAttribute("role") === "progressbar" && window.__swc?.warn(
30
30
  this,
31
31
  "<sp-progress-circle> elements need one of the following to be accessible:",
32
32
  "https://opensource.adobe.com/spectrum-web-components/components/progress-circle/#accessibility",
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressCircle.base.js","sources":["../../../components/progress-circle/ProgressCircle.base.ts"],"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 */\nimport { PropertyValues } from 'lit';\nimport { property, query } from 'lit/decorators.js';\n\nimport {\n SizedMixin,\n SpectrumElement,\n} from '@spectrum-web-components/core/shared/base/index.js';\nimport { getLabelFromSlot } from '@spectrum-web-components/core/shared/get-label-from-slot.js';\n\nimport {\n PROGRESS_CIRCLE_VALID_SIZES,\n ProgressCircleStaticColor,\n} from './ProgressCircle.types.js';\n\n/**\n * A progress circle component that visually represents the completion progress of a task.\n * Can be used in both determinate (with specific progress value) and indeterminate (loading) states.\n *\n * @attribute {ElementSize} size - The size of the progress circle.\n *\n * @todo Why do we support both the slot and the label attribute? Should we deprecate the slot?\n *\n * @todo Figure out why our tool chain doesn't respect the line breaks in this slot description.\n *\n * @slot - Accessible label for the progress circle.\n *\n * Used to provide context about what is loading or progressing.\n *\n * @fires progress-change - Dispatched when the progress value changes\n */\nexport abstract class ProgressCircleBase extends SizedMixin(SpectrumElement, {\n validSizes: PROGRESS_CIRCLE_VALID_SIZES,\n}) {\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n *\n * A readonly array of the valid static colors for the progress circle.\n *\n * This is an actual internal property, intended not for customer use\n * but for use in internal validation logic, stories, tests, etc.\n *\n * Because S1 and S2 support different static colors, the value of this\n * property must be set in each subclass.\n */\n static readonly STATIC_COLORS: readonly string[];\n\n /**\n * @internal\n *\n * Static color variant for use on different backgrounds.\n *\n * This is a public property, but its valid values vary between S1 and S2,\n * so the property (and its docs) need to be redefined in each subclass.\n *\n * The type declared here is a union of the valid values for S1 and S2,\n * and should be narrowed in each subclass.\n */\n @property({ type: String, reflect: true, attribute: 'static-color' })\n public staticColor?: ProgressCircleStaticColor;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * Whether the progress circle shows indeterminate progress (loading state).\n *\n * When true, displays an animated loading indicator instead of a specific progress value.\n */\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n /**\n * Accessible label for the progress circle.\n *\n * Used to provide context about what is loading or progressing.\n */\n @property({ type: String })\n public label = '';\n\n /**\n * Progress value from 0 to 100.\n *\n * Only relevant when indeterminate is false.\n */\n @property({ type: Number })\n public progress = 0;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n /**\n * @internal\n */\n @query('slot')\n private slotEl!: HTMLSlotElement;\n\n protected makeRotation(rotation: number): string | undefined {\n return this.indeterminate\n ? undefined\n : `transform: rotate(${rotation}deg);`;\n }\n\n protected handleSlotchange(): void {\n const labelFromSlot = getLabelFromSlot(this.label, this.slotEl);\n if (labelFromSlot) {\n this.label = labelFromSlot;\n }\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'progressbar');\n }\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (!this.indeterminate && changes.has('progress')) {\n this.setAttribute('aria-valuenow', '' + this.progress);\n } else if (this.hasAttribute('aria-valuenow')) {\n this.removeAttribute('aria-valuenow');\n }\n if (changes.has('label')) {\n if (this.label.length) {\n this.setAttribute('aria-label', this.label);\n } else if (\n changes.get('label') === this.getAttribute('aria-label')\n ) {\n this.removeAttribute('aria-label');\n }\n }\n\n const hasAccessibleName = (): boolean => {\n return Boolean(\n this.label ||\n this.getAttribute('aria-label') ||\n this.getAttribute('aria-labelledby') ||\n this.slotEl.assignedNodes().length\n );\n };\n\n if (window.__swc.DEBUG) {\n if (\n !hasAccessibleName() &&\n this.getAttribute('role') === 'progressbar'\n ) {\n window.__swc?.warn(\n this,\n '<sp-progress-circle> elements need one of the following to be accessible:',\n 'https://opensource.adobe.com/spectrum-web-components/components/progress-circle/#accessibility',\n {\n type: 'accessibility',\n issues: [\n 'value supplied to the \"label\" attribute, which will be displayed visually as part of the element, or',\n 'text content supplied directly to the <sp-progress-circle> element, or',\n 'value supplied to the \"aria-label\" attribute, which will only be provided to screen readers, or',\n 'an element ID reference supplied to the \"aria-labelledby\" attribute, which will be provided by screen readers and will need to be managed manually by the parent application.',\n ],\n }\n );\n }\n }\n }\n}\n"],"names":["ProgressCircleBase","SizedMixin","SpectrumElement","PROGRESS_CIRCLE_VALID_SIZES","rotation","labelFromSlot","getLabelFromSlot","changes","hasAccessibleName","__decorateClass","property","query"],"mappings":";;;;;;;;;AAyCO,MAAeA,UAA2BC,EAAWC,GAAiB;AAAA,EACzE,YAAYC;AAChB,CAAC,EAAE;AAAA,EAFI,cAAA;AAAA,UAAA,GAAA,SAAA,GA4CH,KAAO,gBAAgB,IAQvB,KAAO,QAAQ,IAQf,KAAO,WAAW;AAAA,EAAA;AAAA,EAYR,aAAaC,GAAsC;AACzD,WAAO,KAAK,gBACN,SACA,qBAAqBA,CAAQ;AAAA,EACvC;AAAA,EAEU,mBAAyB;AAC/B,UAAMC,IAAgBC,EAAiB,KAAK,OAAO,KA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AA,EADNC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3DRV,EA4DX,WAAA,UAAA;AAUCS,EAAA;AAAA,EADPE,EAAM,MAAM;AAAA,GArEKX,EAsEV,WAAA,QAAA;"}
1
+ {"version":3,"file":"ProgressCircle.base.js","sources":["../../../components/progress-circle/ProgressCircle.base.ts"],"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 */\nimport { PropertyValues } from 'lit';\nimport { property, query } from 'lit/decorators.js';\n\nimport {\n SizedMixin,\n SpectrumElement,\n} from '@spectrum-web-components/core/shared/base/index.js';\nimport { getLabelFromSlot } from '@spectrum-web-components/core/shared/get-label-from-slot.js';\n\nimport {\n PROGRESS_CIRCLE_VALID_SIZES,\n ProgressCircleStaticColor,\n} from './ProgressCircle.types.js';\n\n/**\n * A progress circle component that visually represents the completion progress of a task.\n * Can be used in both determinate (with specific progress value) and indeterminate (loading) states.\n *\n * @attribute {ElementSize} size - The size of the progress circle.\n *\n * @todo Why do we support both the slot and the label attribute? Should we deprecate the slot?\n *\n * @todo Figure out why our tool chain doesn't respect the line breaks in this slot description.\n *\n * @slot - Accessible label for the progress circle.\n *\n * Used to provide context about what is loading or progressing.\n *\n * @fires progress-change - Dispatched when the progress value changes\n */\nexport abstract class ProgressCircleBase extends SizedMixin(SpectrumElement, {\n validSizes: PROGRESS_CIRCLE_VALID_SIZES,\n}) {\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n *\n * A readonly array of the valid static colors for the progress circle.\n *\n * This is an actual internal property, intended not for customer use\n * but for use in internal validation logic, stories, tests, etc.\n *\n * Because S1 and S2 support different static colors, the value of this\n * property must be set in each subclass.\n */\n static readonly STATIC_COLORS: readonly string[];\n\n /**\n * @internal\n *\n * Static color variant for use on different backgrounds.\n *\n * This is a public property, but its valid values vary between S1 and S2,\n * so the property (and its docs) need to be redefined in each subclass.\n *\n * The type declared here is a union of the valid values for S1 and S2,\n * and should be narrowed in each subclass.\n */\n @property({ type: String, reflect: true, attribute: 'static-color' })\n public staticColor?: ProgressCircleStaticColor;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * Whether the progress circle shows indeterminate progress (loading state).\n *\n * When true, displays an animated loading indicator instead of a specific progress value.\n */\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n /**\n * Accessible label for the progress circle.\n *\n * Used to provide context about what is loading or progressing.\n */\n @property({ type: String })\n public label = '';\n\n /**\n * Progress value from 0 to 100.\n *\n * Only relevant when indeterminate is false.\n */\n @property({ type: Number })\n public progress = 0;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n /**\n * @internal\n */\n @query('slot')\n private slotEl!: HTMLSlotElement;\n\n protected makeRotation(rotation: number): string | undefined {\n return this.indeterminate\n ? undefined\n : `transform: rotate(${rotation}deg);`;\n }\n\n protected handleSlotchange(): void {\n const labelFromSlot = getLabelFromSlot(this.label, this.slotEl);\n if (labelFromSlot) {\n this.label = labelFromSlot;\n }\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'progressbar');\n }\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (!this.indeterminate && changes.has('progress')) {\n this.setAttribute('aria-valuenow', '' + this.progress);\n } else if (this.hasAttribute('aria-valuenow')) {\n this.removeAttribute('aria-valuenow');\n }\n if (changes.has('label')) {\n if (this.label.length) {\n this.setAttribute('aria-label', this.label);\n } else if (\n changes.get('label') === this.getAttribute('aria-label')\n ) {\n this.removeAttribute('aria-label');\n }\n }\n\n const hasAccessibleName = (): boolean => {\n return Boolean(\n this.label ||\n this.getAttribute('aria-label') ||\n this.getAttribute('aria-labelledby') ||\n this.slotEl.assignedNodes().length\n );\n };\n\n if (window.__swc?.DEBUG) {\n if (\n !hasAccessibleName() &&\n this.getAttribute('role') === 'progressbar'\n ) {\n window.__swc?.warn(\n this,\n '<sp-progress-circle> elements need one of the following to be accessible:',\n 'https://opensource.adobe.com/spectrum-web-components/components/progress-circle/#accessibility',\n {\n type: 'accessibility',\n issues: [\n 'value supplied to the \"label\" attribute, which will be displayed visually as part of the element, or',\n 'text content supplied directly to the <sp-progress-circle> element, or',\n 'value supplied to the \"aria-label\" attribute, which will only be provided to screen readers, or',\n 'an element ID reference supplied to the \"aria-labelledby\" attribute, which will be provided by screen readers and will need to be managed manually by the parent application.',\n ],\n }\n );\n }\n }\n }\n}\n"],"names":["ProgressCircleBase","SizedMixin","SpectrumElement","PROGRESS_CIRCLE_VALID_SIZES","rotation","labelFromSlot","getLabelFromSlot","changes","hasAccessibleName","__decorateClass","property","query"],"mappings":";;;;;;;;;AAyCO,MAAeA,UAA2BC,EAAWC,GAAiB;AAAA,EACzE,YAAYC;AAChB,CAAC,EAAE;AAAA,EAFI,cAAA;AAAA,UAAA,GAAA,SAAA,GA4CH,KAAO,gBAAgB,IAQvB,KAAO,QAAQ,IAQf,KAAO,WAAW;AAAA,EAAA;AAAA,EAYR,aAAaC,GAAsC;AACzD,WAAO,KAAK,gBACN,SACA,qBAAqBA,CAAQ;AAAA,EACvC;AAAA,EAEU,mBAAyB;AAC/B,UAAMC,IAAgBC,EAAiB,KAAK,OAAO,KAAK,MAAM;AAC9D,IAAID,MACA,KAAK,QAAQA;AAAA,EAErB;AAAA,EAEmB,aAAaE,GAA+B;AAC3D,UAAM,aAAaA,CAAO,GACrB,KAAK,aAAa,MAAM,KACzB,KAAK,aAAa,QAAQ,aAAa;AAAA,EAE/C;AAAA,EAEmB,QAAQA,GAA+B;AACtD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= "1.11.0";
@@ -1,4 +1,4 @@
1
- const o = "1.11.0-snapshot.20251201180143";
1
+ const o = "1.11.0";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../../shared/base/version.ts"],"sourcesContent":["// Generated by genversion.\nexport const version = '1.11.0-snapshot.20251201180143';\n"],"names":["version"],"mappings":"AACO,MAAMA,IAAU;"}
1
+ {"version":3,"file":"version.js","sources":["../../../shared/base/version.ts"],"sourcesContent":["// Generated by genversion.\nexport const version = '1.11.0';\n"],"names":["version"],"mappings":"AACO,MAAMA,IAAU;"}
@@ -1,23 +1,12 @@
1
- import { MutationController as g } from "../node_modules/@lit-labs/observers/mutation-controller.js";
2
- const e = Symbol("slotContentIsPresent");
3
- function b(a, r) {
4
- var i, l;
1
+ import { MutationController as u } from "../node_modules/@lit-labs/observers/mutation-controller.js";
2
+ const t = Symbol("slotContentIsPresent");
3
+ function p(l, r) {
4
+ var o, i;
5
5
  const n = Array.isArray(r) ? r : [r];
6
- class c extends (l = a, i = e, l) {
6
+ class a extends (i = l, o = t, i) {
7
7
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
- constructor(...t) {
9
- super(t), this[i] = /* @__PURE__ */ new Map(), this.managePresenceObservedSlot = () => {
10
- let o = !1;
11
- n.forEach((s) => {
12
- const h = !!this.querySelector(`:scope > ${s}`), u = this[e].get(s) || !1;
13
- o = o || u !== h, this[e].set(
14
- s,
15
- !!this.querySelector(`:scope > ${s}`)
16
- );
17
- }), o && this.updateComplete.then(() => {
18
- this.requestUpdate();
19
- });
20
- }, new g(this, {
8
+ constructor(...e) {
9
+ super(...e), this[o] = /* @__PURE__ */ new Map(), new u(this, {
21
10
  config: {
22
11
  childList: !0,
23
12
  subtree: !0
@@ -32,22 +21,34 @@ function b(a, r) {
32
21
  */
33
22
  get slotContentIsPresent() {
34
23
  if (n.length === 1)
35
- return this[e].get(n[0]) || !1;
24
+ return this[t].get(n[0]) || !1;
36
25
  throw new Error(
37
26
  "Multiple selectors provided to `ObserveSlotPresence` use `getSlotContentPresence(selector: string)` instead."
38
27
  );
39
28
  }
40
- getSlotContentPresence(t) {
41
- if (this[e].has(t))
42
- return this[e].get(t) || !1;
29
+ getSlotContentPresence(e) {
30
+ if (this[t].has(e))
31
+ return this[t].get(e) || !1;
43
32
  throw new Error(
44
- `The provided selector \`${t}\` is not being observed.`
33
+ `The provided selector \`${e}\` is not being observed.`
45
34
  );
46
35
  }
36
+ managePresenceObservedSlot() {
37
+ let e = !1;
38
+ n.forEach((s) => {
39
+ const c = !!this.querySelector(`:scope > ${s}`), h = this[t].get(s) || !1;
40
+ e = e || h !== c, this[t].set(
41
+ s,
42
+ !!this.querySelector(`:scope > ${s}`)
43
+ );
44
+ }), e && this.updateComplete.then(() => {
45
+ this.requestUpdate();
46
+ });
47
+ }
47
48
  }
48
- return c;
49
+ return a;
49
50
  }
50
51
  export {
51
- b as ObserveSlotPresence
52
+ p as ObserveSlotPresence
52
53
  };
53
54
  //# sourceMappingURL=observe-slot-presence.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"observe-slot-presence.js","sources":["../../shared/observe-slot-presence.ts"],"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 */\nimport { ReactiveElement } from 'lit';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\n\nconst slotContentIsPresent = Symbol('slotContentIsPresent');\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 SlotPresenceObservingInterface {\n slotContentIsPresent: boolean;\n getSlotContentPresence(selector: string): boolean;\n managePresenceObservedSlot(): void;\n}\n\nexport function ObserveSlotPresence<T extends Constructor<ReactiveElement>>(\n constructor: T,\n lightDomSelector: string | string[]\n): T & Constructor<SlotPresenceObservingInterface> {\n const lightDomSelectors = Array.isArray(lightDomSelector)\n ? lightDomSelector\n : [lightDomSelector];\n class SlotPresenceObservingElement\n extends constructor\n implements SlotPresenceObservingInterface\n {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(...args: any[]) {\n super(args);\n\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n this.managePresenceObservedSlot();\n },\n });\n\n this.managePresenceObservedSlot();\n }\n\n /**\n * @private\n */\n public get slotContentIsPresent(): boolean {\n if (lightDomSelectors.length === 1) {\n return (\n this[slotContentIsPresent].get(lightDomSelectors[0]) ||\n false\n );\n } else {\n throw new Error(\n 'Multiple selectors provided to `ObserveSlotPresence` use `getSlotContentPresence(selector: string)` instead.'\n );\n }\n }\n private [slotContentIsPresent]: Map<string, boolean> = new Map();\n\n public getSlotContentPresence(selector: string): boolean {\n if (this[slotContentIsPresent].has(selector)) {\n return this[slotContentIsPresent].get(selector) || false;\n }\n throw new Error(\n `The provided selector \\`${selector}\\` is not being observed.`\n );\n }\n\n public managePresenceObservedSlot = (): void => {\n let changes = false;\n lightDomSelectors.forEach((selector) => {\n const nextValue = !!this.querySelector(`:scope > ${selector}`);\n const previousValue =\n this[slotContentIsPresent].get(selector) || false;\n changes = changes || previousValue !== nextValue;\n this[slotContentIsPresent].set(\n selector,\n !!this.querySelector(`:scope > ${selector}`)\n );\n });\n if (changes) {\n this.updateComplete.then(() => {\n this.requestUpdate();\n });\n }\n };\n }\n return SlotPresenceObservingElement;\n}\n"],"names":["slotContentIsPresent","ObserveSlotPresence","constructor","lightDomSelector","_a","_b","lightDomSelectors","SlotPresenceObservingElement","args","changes","selector","nextValue","previousValue","MutationController"],"mappings":";AAcA,MAA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oB,EAAE,IAAIU,CAAQ,KAAK;AAEvD,YAAM,IAAI;AAAA,QACN,2BAA2BA,CAAQ;AAAA,MAAA;AAAA,IAE3C;AAAA,EAAA;AAqBJ,SAAOH;AACX;"}
1
+ {"version":3,"file":"observe-slot-presence.js","sources":["../../shared/observe-slot-presence.ts"],"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 */\nimport { ReactiveElement } from 'lit';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\n\nconst slotContentIsPresent = Symbol('slotContentIsPresent');\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 SlotPresenceObservingInterface {\n slotContentIsPresent: boolean;\n getSlotContentPresence(selector: string): boolean;\n managePresenceObservedSlot(): void;\n}\n\nexport function ObserveSlotPresence<T extends Constructor<ReactiveElement>>(\n constructor: T,\n lightDomSelector: string | string[]\n): T & Constructor<SlotPresenceObservingInterface> {\n const lightDomSelectors = Array.isArray(lightDomSelector)\n ? lightDomSelector\n : [lightDomSelector];\n class SlotPresenceObservingElement\n extends constructor\n implements SlotPresenceObservingInterface\n {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(...args: any[]) {\n super(...args);\n\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n this.managePresenceObservedSlot();\n },\n });\n\n this.managePresenceObservedSlot();\n }\n\n /**\n * @private\n */\n public get slotContentIsPresent(): boolean {\n if (lightDomSelectors.length === 1) {\n return (\n this[slotContentIsPresent].get(lightDomSelectors[0]) ||\n false\n );\n } else {\n throw new Error(\n 'Multiple selectors provided to `ObserveSlotPresence` use `getSlotContentPresence(selector: string)` instead.'\n );\n }\n }\n private [slotContentIsPresent]: Map<string, boolean> = new Map();\n\n public getSlotContentPresence(selector: string): boolean {\n if (this[slotContentIsPresent].has(selector)) {\n return this[slotContentIsPresent].get(selector) || false;\n }\n throw new Error(\n `The provided selector \\`${selector}\\` is not being observed.`\n );\n }\n\n public managePresenceObservedSlot(): void {\n let changes = false;\n lightDomSelectors.forEach((selector) => {\n const nextValue = !!this.querySelector(`:scope > ${selector}`);\n const previousValue =\n this[slotContentIsPresent].get(selector) || false;\n changes = changes || previousValue !== nextValue;\n this[slotContentIsPresent].set(\n selector,\n !!this.querySelector(`:scope > ${selector}`)\n );\n });\n if (changes) {\n this.updateComplete.then(() => {\n this.requestUpdate();\n });\n }\n }\n }\n return SlotPresenceObservingElement;\n}\n"],"names":["slotContentIsPresent","ObserveSlotPresence","constructor","lightDomSelector","_a","_b","lightDomSelectors","SlotPresenceObservingElement","args","MutationController","selector","changes","nextValue","previousValue"],"mappings":";AAcA,MAAMA,IAAuB,OAAO,sBAAsB;AAcnD,SAASC,EACZC,GACAC,GAC+C;AA/BnD,MAAAC,GAAAC;AAgCI,QAAMC,IAAoB,MAAM,QAAQH,CAAgB,IAClDA,IACA,CAACA,CAAgB;AAAA,EACvB,MAAMI,WACMF,IAAAH,GAmCCE,IAAAJ,GAnCDK,GAEZ;AAAA;AAAA,IAEI,eAAeG,GAAa;AACxB,YAAM,GAAGA,CAAI,GA8BjB,KAASJ,CAAA,wBAAkD,IAAA,GA5BvD,IAAIK,EAAmB,MAAM;AAAA,QACzB,QAAQ;AAAA,UACJ,WAAW;AAAA,UACX,SAAS;AAAA,QAAA;AAAA,QAEb,UAAU,MAAM;AACZ,eAAK,2BAAA;AAAA,QACT;AAAA,MAAA,CACH,GAED,KAAK,2BAAA;AAAA,IACT;AAAA;AAAA;AAAA;AAAA,IAKA,IAAW,uBAAgC;AACvC,UAAIH,EAAkB,WAAW;AAC7B,eACI,KAAKN,CAAoB,EAAE,IAAIM,EAAkB,CAAC,CAAC,KACnD;AAGJ,YAAM,IAAI;AAAA,QACN;AAAA,MAAA;AAAA,IAGZ;AAAA,IAGO,uBAAuBI,GAA2B;AACrD,UAAI,KAAKV,CAAoB,EAAE,IAAIU,CAAQ;AACvC,eAAO,KAAKV,CAAoB,EAAE,IAAIU,CAAQ,KAAK;AAEvD,YAAM,IAAI;AAAA,QACN,2BAA2BA,CAAQ;AAAA,MAAA;AAAA,IAE3C;AAAA,IAEO,6BAAmC;AACtC,UAAIC,IAAU;AACd,MAAAL,EAAkB,QAAQ,CAACI,MAAa;AACpC,cAAME,IAAY,CAAC,CAAC,KAAK,cAAc,YAAYF,CAAQ,EAAE,GACvDG,IACF,KAAKb,CAAoB,EAAE,IAAIU,CAAQ,KAAK;AAChD,QAAAC,IAAUA,KAAWE,MAAkBD,GACvC,KAAKZ,CAAoB,EAAE;AAAA,UACvBU;AAAA,UACA,CAAC,CAAC,KAAK,cAAc,YAAYA,CAAQ,EAAE;AAAA,QAAA;AAAA,MAEnD,CAAC,GACGC,KACA,KAAK,eAAe,KAAK,MAAM;AAC3B,aAAK,cAAA;AAAA,MACT,CAAC;AAAA,IAET;AAAA,EAAA;AAEJ,SAAOJ;AACX;"}
@@ -12,7 +12,7 @@ function N(d, n, i = []) {
12
12
  class o extends (t = d, u = f, t) {
13
13
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
14
  constructor(...e) {
15
- super(e), this.slotHasContent = !1, new x(this, {
15
+ super(...e), this.slotHasContent = !1, new x(this, {
16
16
  config: {
17
17
  characterData: !0,
18
18
  subtree: !0
@@ -1 +1 @@
1
- {"version":3,"file":"observe-slot-text.js","sources":["../../shared/observe-slot-text.ts"],"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 */\nimport { PropertyValues, ReactiveElement } from 'lit';\nimport { property, queryAssignedNodes } from 'lit/decorators.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\n\nconst assignedNodesList = Symbol('assignedNodes');\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 SlotTextObservingInterface {\n slotHasContent: boolean;\n manageTextObservedSlot(): void;\n}\n\nexport function ObserveSlotText<T extends Constructor<ReactiveElement>>(\n constructor: T,\n slotName?: string,\n excludedSelectors: string[] = []\n): T & Constructor<SlotTextObservingInterface> {\n const notExcluded = (el: HTMLElement) => (selector: string) => {\n return el.matches(selector);\n };\n\n class SlotTextObservingElement\n extends constructor\n implements SlotTextObservingInterface\n {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(...args: any[]) {\n super(args);\n\n new MutationController(this, {\n config: {\n characterData: true,\n subtree: true,\n },\n callback: (mutationsList: Array<MutationRecord>) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'characterData') {\n this.manageTextObservedSlot();\n return;\n }\n }\n },\n });\n }\n\n @property({ type: Boolean, attribute: false })\n public slotHasContent = false;\n\n @queryAssignedNodes({\n slot: slotName,\n flatten: true,\n })\n private [assignedNodesList]!: NodeListOf<HTMLElement>;\n\n public manageTextObservedSlot(): void {\n if (!this[assignedNodesList]) {\n return;\n }\n const assignedNodes = [...this[assignedNodesList]].filter(\n (currentNode) => {\n const node = currentNode as HTMLElement;\n if (node.tagName) {\n return !excludedSelectors.some(notExcluded(node));\n }\n return node.textContent ? node.textContent.trim() : false;\n }\n );\n this.slotHasContent = assignedNodes.length > 0;\n }\n\n protected override update(changedProperties: PropertyValues): void {\n if (!this.hasUpdated) {\n const { childNodes } = this;\n const textNodes = [...childNodes].filter((currentNode) => {\n const node = currentNode as HTMLElement;\n if (node.tagName) {\n const excluded = excludedSelectors.some(\n notExcluded(node)\n );\n return !excluded\n ? // This pass happens at element upgrade and before slot rendering.\n // Confirm it would exisit in a targeted slot if there was one supplied.\n slotName\n ? node.getAttribute('slot') === slotName\n : !node.hasAttribute('slot')\n : false;\n }\n return node.textContent ? node.textContent.trim() : false;\n });\n this.slotHasContent = textNodes.length > 0;\n }\n super.update(changedProperties);\n }\n\n protected override firstUpdated(\n changedProperties: PropertyValues\n ): void {\n super.firstUpdated(changedProperties);\n this.updateComplete.then(() => {\n this.manageTextObservedSlot();\n });\n }\n }\n return SlotTextObservingElement;\n}\n"],"names":["assignedNodesList","ObserveSlotText","constructor","slotName","excludedSelectors","_a","_b","notExcluded","el","selector","SlotTextObservingElement","args","MutationController","mutationsList","mutation","assignedNodes","currentNode","node","changedProperties","childNodes","textNodes","__decorateClass","property","queryAssignedNodes"],"mappings":";;;;;;;AAeA,MAAMA,IAAoB,OAAO,eAAe;AAazC,SAASC,EACZC,GACAC,GACAC,IAA8B,CAAA,GACa;AAhC/C,MAAAC,GAAAC;AAiCI,QAAMC,IAAc,CAACC,MAAoB,CAACC,MAC/BD,EAAG,QAAQC,CAAQ;AAAA,EAG9B,MAAMC,WACMJ,IAAAJ,GA8BCG,IAAAL,GA9BDM,GAEZ;AAAA;AAAA,IAEI,eAAeK,GAAa;AACxB,YAAMA,CAAI,GAmBd,KAAO,iBAAiB,IAjBpB,IAAIC,EAAmB,MAAM;AAAA,QACzB,QAAQ;AAAA,UACJ,eAAe;AAAA,UACf,SAAS;AAAA,QAAA;AAAA,QAEb,UAAU,CAACC,MAAyC;AAChD,qBAAWC,KAAYD;AACnB,gBAAIC,EAAS,SAAS,iBAAiB;AACnC,mBAAK,uBAAA;AACL;AAAA,YACJ;AAAA,QAER;AAAA,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DNK;AACX;"}
1
+ {"version":3,"file":"observe-slot-text.js","sources":["../../shared/observe-slot-text.ts"],"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 */\nimport { PropertyValues, ReactiveElement } from 'lit';\nimport { property, queryAssignedNodes } from 'lit/decorators.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\n\nconst assignedNodesList = Symbol('assignedNodes');\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 SlotTextObservingInterface {\n slotHasContent: boolean;\n manageTextObservedSlot(): void;\n}\n\nexport function ObserveSlotText<T extends Constructor<ReactiveElement>>(\n constructor: T,\n slotName?: string,\n excludedSelectors: string[] = []\n): T & Constructor<SlotTextObservingInterface> {\n const notExcluded = (el: HTMLElement) => (selector: string) => {\n return el.matches(selector);\n };\n\n class SlotTextObservingElement\n extends constructor\n implements SlotTextObservingInterface\n {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(...args: any[]) {\n super(...args);\n\n new MutationController(this, {\n config: {\n characterData: true,\n subtree: true,\n },\n callback: (mutationsList: Array<MutationRecord>) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'characterData') {\n this.manageTextObservedSlot();\n return;\n }\n }\n },\n });\n }\n\n @property({ type: Boolean, attribute: false })\n public slotHasContent = false;\n\n @queryAssignedNodes({\n slot: slotName,\n flatten: true,\n })\n private [assignedNodesList]!: NodeListOf<HTMLElement>;\n\n public manageTextObservedSlot(): void {\n if (!this[assignedNodesList]) {\n return;\n }\n const assignedNodes = [...this[assignedNodesList]].filter(\n (currentNode) => {\n const node = currentNode as HTMLElement;\n if (node.tagName) {\n return !excludedSelectors.some(notExcluded(node));\n }\n return node.textContent ? node.textContent.trim() : false;\n }\n );\n this.slotHasContent = assignedNodes.length > 0;\n }\n\n protected override update(changedProperties: PropertyValues): void {\n if (!this.hasUpdated) {\n const { childNodes } = this;\n const textNodes = [...childNodes].filter((currentNode) => {\n const node = currentNode as HTMLElement;\n if (node.tagName) {\n const excluded = excludedSelectors.some(\n notExcluded(node)\n );\n return !excluded\n ? // This pass happens at element upgrade and before slot rendering.\n // Confirm it would exisit in a targeted slot if there was one supplied.\n slotName\n ? node.getAttribute('slot') === slotName\n : !node.hasAttribute('slot')\n : false;\n }\n return node.textContent ? node.textContent.trim() : false;\n });\n this.slotHasContent = textNodes.length > 0;\n }\n super.update(changedProperties);\n }\n\n protected override firstUpdated(\n changedProperties: PropertyValues\n ): void {\n super.firstUpdated(changedProperties);\n this.updateComplete.then(() => {\n this.manageTextObservedSlot();\n });\n }\n }\n return SlotTextObservingElement;\n}\n"],"names":["assignedNodesList","ObserveSlotText","constructor","slotName","excludedSelectors","_a","_b","notExcluded","el","selector","SlotTextObservingElement","args","MutationController","mutationsList","mutation","assignedNodes","currentNode","node","changedProperties","childNodes","textNodes","__decorateClass","property","queryAssignedNodes"],"mappings":";;;;;;;AAeA,MAAMA,IAAoB,OAAO,eAAe;AAazC,SAASC,EACZC,GACAC,GACAC,IAA8B,CAAA,GACa;AAhC/C,MAAAC,GAAAC;AAiCI,QAAMC,IAAc,CAACC,MAAoB,CAACC,MAC/BD,EAAG,QAAQC,CAAQ;AAAA,EAG9B,MAAMC,WACMJ,IAAAJ,GA8BCG,IAAAL,GA9BDM,GAEZ;AAAA;AAAA,IAEI,eAAeK,GAAa;AACxB,YAAM,GAAGA,CAAI,GAmBjB,KAAO,iBAAiB,IAjBpB,IAAIC,EAAmB,MAAM;AAAA,QACzB,QAAQ;AAAA,UACJ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;AAAA,EAAA,GAxB3CZ,EAyBK,WAAA,gBAAA,GAMEW,EAAA;AAAA,IAJRE,EAAmB;AAAA,MAChB,MAAMpB;AAAA,MACN,SAAS;AAAA,IAAA,CACZ;AAAA,EAAA,GA9BCO,EA+BO,WAAAL,CAAA,GAmDNK;AACX;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/core",
3
- "version": "0.0.2-snapshot.20251201180143",
3
+ "version": "0.0.2",
4
4
  "description": "Abstract base classes for Spectrum Web Components",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Adobe",