@adobe/spectrum-wc-core 2.0.0-beta.2 → 2.0.0-beta.3
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/CHANGELOG.md +75 -9
- package/dist/components/accordion/Accordion.base.js +28 -22
- package/dist/components/accordion/Accordion.base.js.map +1 -1
- package/dist/components/accordion/AccordionItem.base.d.ts +16 -6
- package/dist/components/accordion/AccordionItem.base.js +6 -3
- package/dist/components/accordion/AccordionItem.base.js.map +1 -1
- package/dist/components/action-group/ActionGroup.base.d.ts +108 -0
- package/dist/components/action-group/ActionGroup.base.js +53 -0
- package/dist/components/action-group/ActionGroup.base.js.map +1 -0
- package/dist/components/action-group/ActionGroup.types.d.ts +17 -0
- package/dist/components/action-group/ActionGroup.types.js +12 -0
- package/dist/components/action-group/ActionGroup.types.js.map +1 -0
- package/dist/components/action-group/index.d.ts +13 -0
- package/dist/components/action-group/index.js +3 -0
- package/dist/components/alert-banner/AlertBanner.base.js +11 -10
- package/dist/components/alert-banner/AlertBanner.base.js.map +1 -1
- package/dist/components/asset/Asset.base.d.ts +1 -1
- package/dist/components/asset/Asset.base.js +14 -8
- package/dist/components/asset/Asset.base.js.map +1 -1
- package/dist/components/avatar/Avatar.base.js +18 -22
- package/dist/components/avatar/Avatar.base.js.map +1 -1
- package/dist/components/badge/Badge.base.d.ts +24 -8
- package/dist/components/badge/Badge.base.js +22 -17
- package/dist/components/badge/Badge.base.js.map +1 -1
- package/dist/components/button/Button.base.d.ts +20 -10
- package/dist/components/button/Button.base.js +17 -12
- package/dist/components/button/Button.base.js.map +1 -1
- package/dist/components/button-group/ButtonGroup.base.js +19 -12
- package/dist/components/button-group/ButtonGroup.base.js.map +1 -1
- package/dist/components/card/Card.base.d.ts +95 -46
- package/dist/components/card/Card.base.js +71 -23
- package/dist/components/card/Card.base.js.map +1 -1
- package/dist/components/card/Card.types.d.ts +1 -0
- package/dist/components/card/Card.types.js +2 -2
- package/dist/components/card/Card.types.js.map +1 -1
- package/dist/components/card/index.js +3 -3
- package/dist/components/divider/Divider.base.js +13 -8
- package/dist/components/divider/Divider.base.js.map +1 -1
- package/dist/components/dropzone/Dropzone.base.d.ts +74 -0
- package/dist/components/dropzone/Dropzone.base.js +82 -0
- package/dist/components/dropzone/Dropzone.base.js.map +1 -0
- package/dist/components/dropzone/Dropzone.types.d.ts +43 -0
- package/dist/components/dropzone/Dropzone.types.js +15 -0
- package/dist/components/dropzone/Dropzone.types.js.map +1 -0
- package/dist/components/dropzone/index.d.ts +13 -0
- package/dist/components/dropzone/index.js +3 -0
- package/dist/components/icon/Icon.base.d.ts +11 -7
- package/dist/components/icon/Icon.base.js +13 -20
- package/dist/components/icon/Icon.base.js.map +1 -1
- package/dist/components/illustrated-message/IllustratedMessage.base.d.ts +22 -8
- package/dist/components/illustrated-message/IllustratedMessage.base.js +33 -20
- package/dist/components/illustrated-message/IllustratedMessage.base.js.map +1 -1
- package/dist/components/infield-button/InfieldButton.base.d.ts +28 -0
- package/dist/components/infield-button/InfieldButton.base.js +22 -0
- package/dist/components/infield-button/InfieldButton.base.js.map +1 -0
- package/dist/components/infield-button/InfieldButton.types.d.ts +13 -0
- package/dist/components/infield-button/InfieldButton.types.js +11 -0
- package/dist/components/infield-button/InfieldButton.types.js.map +1 -0
- package/dist/components/infield-button/index.d.ts +13 -0
- package/dist/components/infield-button/index.js +3 -0
- package/dist/components/meter/Meter.base.js +11 -9
- package/dist/components/meter/Meter.base.js.map +1 -1
- package/dist/components/popover/Popover.base.js +46 -42
- package/dist/components/popover/Popover.base.js.map +1 -1
- package/dist/components/progress-circle/ProgressCircle.base.d.ts +0 -1
- package/dist/components/progress-circle/ProgressCircle.base.js +26 -22
- package/dist/components/progress-circle/ProgressCircle.base.js.map +1 -1
- package/dist/components/status-light/StatusLight.base.d.ts +1 -1
- package/dist/components/status-light/StatusLight.base.js +12 -9
- package/dist/components/status-light/StatusLight.base.js.map +1 -1
- package/dist/components/tabs/Tabs.base.js +44 -32
- package/dist/components/tabs/Tabs.base.js.map +1 -1
- package/dist/components/tooltip/Tooltip.base.js +57 -22
- package/dist/components/tooltip/Tooltip.base.js.map +1 -1
- package/dist/controllers/color-controller/src/color-controller.js +45 -44
- package/dist/controllers/color-controller/src/color-controller.js.map +1 -1
- package/dist/controllers/drag-and-drop-controller/index.d.ts +12 -0
- package/dist/controllers/drag-and-drop-controller/index.js +2 -0
- package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.d.ts +68 -0
- package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js +56 -0
- package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js.map +1 -0
- package/dist/controllers/index.d.ts +4 -1
- package/dist/controllers/index.js +14 -11
- package/dist/controllers/page-scroll-lock-controller/index.d.ts +12 -0
- package/dist/controllers/page-scroll-lock-controller/index.js +2 -0
- package/dist/controllers/{page-scroll-lock.js → page-scroll-lock-controller/src/page-scroll-lock.js} +1 -1
- package/dist/controllers/page-scroll-lock-controller/src/page-scroll-lock.js.map +1 -0
- package/dist/controllers/slot-presence-controller/index.d.ts +12 -0
- package/dist/controllers/slot-presence-controller/index.js +2 -0
- package/dist/controllers/slot-presence-controller/src/slot-presence-controller.d.ts +57 -0
- package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js +44 -0
- package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js.map +1 -0
- package/dist/controllers/slot-text-controller/index.d.ts +12 -0
- package/dist/controllers/slot-text-controller/index.js +2 -0
- package/dist/controllers/slot-text-controller/src/slot-text-controller.d.ts +92 -0
- package/dist/controllers/slot-text-controller/src/slot-text-controller.js +53 -0
- package/dist/controllers/slot-text-controller/src/slot-text-controller.js.map +1 -0
- package/dist/element/index.d.ts +1 -1
- package/dist/element/index.js +2 -2
- package/dist/element/spectrum-element.d.ts +58 -15
- package/dist/element/spectrum-element.js +55 -36
- package/dist/element/spectrum-element.js.map +1 -1
- package/dist/element/version.d.ts +2 -2
- package/dist/element/version.js +1 -1
- package/dist/element/version.js.map +1 -1
- package/dist/mixins/index.d.ts +0 -2
- package/dist/mixins/index.js +4 -6
- package/dist/mixins/linear-progress-mixin.d.ts +1 -2
- package/dist/mixins/linear-progress-mixin.js +35 -34
- package/dist/mixins/linear-progress-mixin.js.map +1 -1
- package/dist/mixins/pending-mixin.js +12 -11
- package/dist/mixins/pending-mixin.js.map +1 -1
- package/dist/mixins/sized-mixin.d.ts +28 -0
- package/dist/mixins/sized-mixin.js +6 -6
- package/dist/mixins/sized-mixin.js.map +1 -1
- package/dist/utils/dev-validation.d.ts +88 -0
- package/dist/utils/dev-validation.js +33 -0
- package/dist/utils/dev-validation.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +12 -10
- package/dist/utils/is-focus-visible-in-tree.d.ts +33 -0
- package/dist/utils/is-focus-visible-in-tree.js +11 -0
- package/dist/utils/is-focus-visible-in-tree.js.map +1 -0
- package/package.json +68 -15
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/defineProperty.js +0 -12
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPrimitive.js +0 -14
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPropertyKey.js +0 -9
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/typeof.js +0 -11
- package/dist/controllers/page-scroll-lock.js.map +0 -1
- package/dist/mixins/observe-slot-presence.d.ts +0 -12
- package/dist/mixins/observe-slot-presence.js +0 -40
- package/dist/mixins/observe-slot-presence.js.map +0 -1
- package/dist/mixins/observe-slot-text.d.ts +0 -11
- package/dist/mixins/observe-slot-text.js +0 -60
- package/dist/mixins/observe-slot-text.js.map +0 -1
- /package/dist/controllers/{page-scroll-lock.d.ts → page-scroll-lock-controller/src/page-scroll-lock.d.ts} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 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 { SlotPresenceController } from './src/slot-presence-controller.js';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* A reactive controller that observes whether slotted content matching
|
|
4
|
+
* given CSS selectors is present in the host's light DOM.
|
|
5
|
+
*
|
|
6
|
+
* Replaces the `ObserveSlotPresence` mixin with a composition-based approach.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* class MyComponent extends SpectrumElement {
|
|
11
|
+
* private slotPresence = new SlotPresenceController(this, '[slot="icon"]');
|
|
12
|
+
*
|
|
13
|
+
* get hasIcon(): boolean {
|
|
14
|
+
* return this.slotPresence.isPresent;
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* // Observing multiple selectors
|
|
22
|
+
* class MyComponent extends SpectrumElement {
|
|
23
|
+
* private slotPresence = new SlotPresenceController(this, [
|
|
24
|
+
* '[slot="icon"]',
|
|
25
|
+
* '[slot="description"]',
|
|
26
|
+
* ]);
|
|
27
|
+
*
|
|
28
|
+
* get hasIcon(): boolean {
|
|
29
|
+
* return this.slotPresence.getPresence('[slot="icon"]');
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* get hasDescription(): boolean {
|
|
33
|
+
* return this.slotPresence.getPresence('[slot="description"]');
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare class SlotPresenceController implements ReactiveController {
|
|
39
|
+
private host;
|
|
40
|
+
private selectors;
|
|
41
|
+
private presenceMap;
|
|
42
|
+
private observer;
|
|
43
|
+
constructor(host: ReactiveElement, selectors: string | string[]);
|
|
44
|
+
/**
|
|
45
|
+
* Whether slotted content is present. Use this when observing a single
|
|
46
|
+
* selector. Throws if multiple selectors were provided — use
|
|
47
|
+
* `getPresence(selector)` instead.
|
|
48
|
+
*/
|
|
49
|
+
get isPresent(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Returns whether content matching the given selector is present.
|
|
52
|
+
*/
|
|
53
|
+
getPresence(selector: string): boolean;
|
|
54
|
+
private checkPresence;
|
|
55
|
+
hostConnected(): void;
|
|
56
|
+
hostDisconnected(): void;
|
|
57
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region controllers/slot-presence-controller/src/slot-presence-controller.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
constructor(e, t) {
|
|
4
|
+
this.presenceMap = /* @__PURE__ */ new Map(), this.host = e, this.selectors = Array.isArray(t) ? t : [t], this.host.addController(this), this.observer = new MutationObserver(() => {
|
|
5
|
+
this.checkPresence();
|
|
6
|
+
}), this.checkPresence();
|
|
7
|
+
}
|
|
8
|
+
get isPresent() {
|
|
9
|
+
if (this.selectors.length === 1) {
|
|
10
|
+
var e;
|
|
11
|
+
return (e = this.presenceMap.get(this.selectors[0])) == null ? !1 : e;
|
|
12
|
+
}
|
|
13
|
+
throw Error("Multiple selectors provided to SlotPresenceController — use getPresence(selector) instead.");
|
|
14
|
+
}
|
|
15
|
+
getPresence(e) {
|
|
16
|
+
if (this.presenceMap.has(e)) {
|
|
17
|
+
var t;
|
|
18
|
+
return (t = this.presenceMap.get(e)) == null ? !1 : t;
|
|
19
|
+
}
|
|
20
|
+
throw Error(`The provided selector \`${e}\` is not being observed.`);
|
|
21
|
+
}
|
|
22
|
+
checkPresence() {
|
|
23
|
+
let e = !1;
|
|
24
|
+
for (let n of this.selectors) {
|
|
25
|
+
var t;
|
|
26
|
+
let r = !!this.host.querySelector(`:scope > ${n}`);
|
|
27
|
+
((t = this.presenceMap.get(n)) == null ? !1 : t) !== r && (e = !0), this.presenceMap.set(n, r);
|
|
28
|
+
}
|
|
29
|
+
e && this.host.requestUpdate();
|
|
30
|
+
}
|
|
31
|
+
hostConnected() {
|
|
32
|
+
this.observer.observe(this.host, {
|
|
33
|
+
childList: !0,
|
|
34
|
+
subtree: !0
|
|
35
|
+
}), this.checkPresence();
|
|
36
|
+
}
|
|
37
|
+
hostDisconnected() {
|
|
38
|
+
this.observer.disconnect();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { e as SlotPresenceController };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=slot-presence-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-presence-controller.js","names":[],"sources":["../../../../controllers/slot-presence-controller/src/slot-presence-controller.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\n\n/**\n * A reactive controller that observes whether slotted content matching\n * given CSS selectors is present in the host's light DOM.\n *\n * Replaces the `ObserveSlotPresence` mixin with a composition-based approach.\n *\n * @example\n * ```typescript\n * class MyComponent extends SpectrumElement {\n * private slotPresence = new SlotPresenceController(this, '[slot=\"icon\"]');\n *\n * get hasIcon(): boolean {\n * return this.slotPresence.isPresent;\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Observing multiple selectors\n * class MyComponent extends SpectrumElement {\n * private slotPresence = new SlotPresenceController(this, [\n * '[slot=\"icon\"]',\n * '[slot=\"description\"]',\n * ]);\n *\n * get hasIcon(): boolean {\n * return this.slotPresence.getPresence('[slot=\"icon\"]');\n * }\n *\n * get hasDescription(): boolean {\n * return this.slotPresence.getPresence('[slot=\"description\"]');\n * }\n * }\n * ```\n */\nexport class SlotPresenceController implements ReactiveController {\n private host: ReactiveElement;\n private selectors: string[];\n private presenceMap = new Map<string, boolean>();\n private observer: MutationObserver;\n\n constructor(host: ReactiveElement, selectors: string | string[]) {\n this.host = host;\n this.selectors = Array.isArray(selectors) ? selectors : [selectors];\n this.host.addController(this);\n\n this.observer = new MutationObserver(() => {\n this.checkPresence();\n });\n\n // Check initial state synchronously\n this.checkPresence();\n }\n\n /**\n * Whether slotted content is present. Use this when observing a single\n * selector. Throws if multiple selectors were provided — use\n * `getPresence(selector)` instead.\n */\n get isPresent(): boolean {\n if (this.selectors.length === 1) {\n return this.presenceMap.get(this.selectors[0]) ?? false;\n }\n throw new Error(\n 'Multiple selectors provided to SlotPresenceController — use getPresence(selector) instead.'\n );\n }\n\n /**\n * Returns whether content matching the given selector is present.\n */\n getPresence(selector: string): boolean {\n if (this.presenceMap.has(selector)) {\n return this.presenceMap.get(selector) ?? false;\n }\n throw new Error(\n `The provided selector \\`${selector}\\` is not being observed.`\n );\n }\n\n private checkPresence(): void {\n let changed = false;\n for (const selector of this.selectors) {\n const nextValue = !!this.host.querySelector(`:scope > ${selector}`);\n const previousValue = this.presenceMap.get(selector) ?? false;\n if (previousValue !== nextValue) {\n changed = true;\n }\n this.presenceMap.set(selector, nextValue);\n }\n if (changed) {\n // The `ObserveSlotPresence` mixin this controller replaces deferred the\n // re-render with `this.updateComplete.then(() => this.requestUpdate())`.\n // The controller requests the update synchronously instead. This is\n // safe because `checkPresence` only runs from the constructor, the\n // `MutationObserver` callback, and `hostConnected` — never from inside\n // the host's own `update()`/`render()` — so there is no re-entrant\n // update. Lit batches `requestUpdate()` calls into the next microtask,\n // so multiple presence changes in one tick still coalesce into a single\n // render. See the controller stories for the behavioral test.\n this.host.requestUpdate();\n }\n }\n\n hostConnected(): void {\n this.observer.observe(this.host, {\n childList: true,\n subtree: true,\n });\n this.checkPresence();\n }\n\n hostDisconnected(): void {\n this.observer.disconnect();\n }\n}\n"],"mappings":";AAkDA,IAAa,IAAb,MAAkE;CAMhE,YAAY,GAAuB,GAA8B;AAU/D,qCAboB,IAAI,KAAsB,EAI9C,KAAK,OAAO,GACZ,KAAK,YAAY,MAAM,QAAQ,EAAU,GAAG,IAAY,CAAC,EAAU,EACnE,KAAK,KAAK,cAAc,KAAK,EAE7B,KAAK,WAAW,IAAI,uBAAuB;AACzC,QAAK,eAAe;IACpB,EAGF,KAAK,eAAe;;CAQtB,IAAI,YAAqB;AACvB,MAAI,KAAK,UAAU,WAAW,GAAG;;AAC/B,WAAA,IAAO,KAAK,YAAY,IAAI,KAAK,UAAU,GAAG,KAAA,OAAI,KAAJ;;AAEhD,QAAU,MACR,6FACD;;CAMH,YAAY,GAA2B;AACrC,MAAI,KAAK,YAAY,IAAI,EAAS,EAAE;;AAClC,WAAA,IAAO,KAAK,YAAY,IAAI,EAAS,KAAA,OAAI,KAAJ;;AAEvC,QAAU,MACR,2BAA2B,EAAS,2BACrC;;CAGH,gBAA8B;EAC5B,IAAI,IAAU;AACd,OAAK,IAAM,KAAY,KAAK,WAAW;;GACrC,IAAM,IAAY,CAAC,CAAC,KAAK,KAAK,cAAc,YAAY,IAAW;AAKnE,KAHA,IADsB,KAAK,YAAY,IAAI,EAAS,KAAA,OAAI,KAAJ,OAC9B,MACpB,IAAU,KAEZ,KAAK,YAAY,IAAI,GAAU,EAAU;;AAE3C,EAAI,KAUF,KAAK,KAAK,eAAe;;CAI7B,gBAAsB;AAKpB,EAJA,KAAK,SAAS,QAAQ,KAAK,MAAM;GAC/B,WAAW;GACX,SAAS;GACV,CAAC,EACF,KAAK,eAAe;;CAGtB,mBAAyB;AACvB,OAAK,SAAS,YAAY"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 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 { SlotTextController, type SlotTextConfig, } from './src/slot-text-controller.js';
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveElement } from 'lit';
|
|
2
|
+
export interface SlotTextConfig {
|
|
3
|
+
/**
|
|
4
|
+
* The slot name to observe. Use `''` (empty string) for the default slot.
|
|
5
|
+
*
|
|
6
|
+
* @default '' (default slot)
|
|
7
|
+
*/
|
|
8
|
+
slotName?: string;
|
|
9
|
+
/**
|
|
10
|
+
* CSS selectors for elements to exclude when checking for content.
|
|
11
|
+
* Matched elements are ignored — only non-excluded elements and
|
|
12
|
+
* non-empty text nodes count as "content."
|
|
13
|
+
*/
|
|
14
|
+
excludeSelectors?: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A reactive controller that observes whether a slot contains meaningful
|
|
18
|
+
* text or element content.
|
|
19
|
+
*
|
|
20
|
+
* Replaces the `ObserveSlotText` mixin with a composition-based approach.
|
|
21
|
+
*
|
|
22
|
+
* Monitors for `characterData` mutations (text changes) and re-evaluates
|
|
23
|
+
* on slot change events. The host is requested to update whenever the
|
|
24
|
+
* content state changes.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* class MyButton extends SpectrumElement {
|
|
29
|
+
* private slotText = new SlotTextController(this);
|
|
30
|
+
*
|
|
31
|
+
* get hasLabel(): boolean {
|
|
32
|
+
* return this.slotText.hasContent;
|
|
33
|
+
* }
|
|
34
|
+
*
|
|
35
|
+
* override render() {
|
|
36
|
+
* return html`<slot @slotchange=${this.slotText.handleSlotChange}></slot>`;
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* // Named slot with exclusions
|
|
44
|
+
* class MyComponent extends SpectrumElement {
|
|
45
|
+
* private slotText = new SlotTextController(this, {
|
|
46
|
+
* slotName: 'description',
|
|
47
|
+
* excludeSelectors: ['.visually-hidden'],
|
|
48
|
+
* });
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare class SlotTextController implements ReactiveController {
|
|
53
|
+
private host;
|
|
54
|
+
private slotName;
|
|
55
|
+
private excludeSelectors;
|
|
56
|
+
private observer;
|
|
57
|
+
private _hasContent;
|
|
58
|
+
constructor(host: ReactiveElement, config?: SlotTextConfig);
|
|
59
|
+
/**
|
|
60
|
+
* Whether the observed slot has meaningful content (text nodes or
|
|
61
|
+
* non-excluded elements).
|
|
62
|
+
*/
|
|
63
|
+
get hasContent(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Bind this to the slot's `@slotchange` event in the template.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```html
|
|
69
|
+
* <slot @slotchange=${this.slotText.handleSlotChange}></slot>
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
handleSlotChange: (event: Event) => void;
|
|
73
|
+
private evaluateNodes;
|
|
74
|
+
/**
|
|
75
|
+
* Checks initial content from light DOM children before the first render,
|
|
76
|
+
* before slots are assigned.
|
|
77
|
+
*
|
|
78
|
+
* This runs from `hostConnected`, which Lit invokes during the host's
|
|
79
|
+
* `connectedCallback` — before the first `update()`. It sets `_hasContent`
|
|
80
|
+
* directly and intentionally does not call `requestUpdate()`: the first
|
|
81
|
+
* render has not happened yet, so it will read the correct value when it
|
|
82
|
+
* runs. This differs from the `ObserveSlotText` mixin, where `slotHasContent`
|
|
83
|
+
* was a reactive `@property` assigned in `update()`. After the first render,
|
|
84
|
+
* `handleSlotChange` (bound via `@slotchange`) and the `characterData`
|
|
85
|
+
* observer take over and do call `requestUpdate()` on change. The
|
|
86
|
+
* controller stories cover initial content being reflected on first paint.
|
|
87
|
+
*/
|
|
88
|
+
private checkInitialContent;
|
|
89
|
+
private checkContent;
|
|
90
|
+
hostConnected(): void;
|
|
91
|
+
hostDisconnected(): void;
|
|
92
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//#region controllers/slot-text-controller/src/slot-text-controller.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
constructor(e, t = {}) {
|
|
4
|
+
var n, r;
|
|
5
|
+
this._hasContent = !1, this.handleSlotChange = (e) => {
|
|
6
|
+
let t = e.target.assignedNodes({ flatten: !0 });
|
|
7
|
+
this.evaluateNodes(t);
|
|
8
|
+
}, this.host = e, this.slotName = (n = t.slotName) == null ? "" : n, this.excludeSelectors = (r = t.excludeSelectors) == null ? [] : r, this.host.addController(this), this.observer = new MutationObserver((e) => {
|
|
9
|
+
for (let t of e) if (t.type === "characterData") {
|
|
10
|
+
this.checkContent();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
get hasContent() {
|
|
16
|
+
return this._hasContent;
|
|
17
|
+
}
|
|
18
|
+
evaluateNodes(e) {
|
|
19
|
+
let t = [...e].some((e) => {
|
|
20
|
+
let t = e;
|
|
21
|
+
return t.tagName ? !this.excludeSelectors.some((e) => t.matches(e)) : this.slotName ? !1 : e.nodeType === Node.TEXT_NODE && e.textContent ? e.textContent.trim().length > 0 : !1;
|
|
22
|
+
});
|
|
23
|
+
t !== this._hasContent && (this._hasContent = t, this.host.requestUpdate());
|
|
24
|
+
}
|
|
25
|
+
checkInitialContent() {
|
|
26
|
+
let { childNodes: e } = this.host;
|
|
27
|
+
this._hasContent = [...e].filter((e) => {
|
|
28
|
+
let t = e;
|
|
29
|
+
return t.tagName ? this.excludeSelectors.some((e) => t.matches(e)) ? !1 : this.slotName ? t.getAttribute("slot") === this.slotName : !t.hasAttribute("slot") : this.slotName ? !1 : e.nodeType === Node.TEXT_NODE && e.textContent ? e.textContent.trim().length > 0 : !1;
|
|
30
|
+
}).length > 0;
|
|
31
|
+
}
|
|
32
|
+
checkContent() {
|
|
33
|
+
var e;
|
|
34
|
+
let t = (e = this.host.shadowRoot) == null ? void 0 : e.querySelector(this.slotName ? `slot[name="${this.slotName}"]` : "slot:not([name])");
|
|
35
|
+
if (t) {
|
|
36
|
+
let e = t.assignedNodes({ flatten: !0 });
|
|
37
|
+
this.evaluateNodes(e);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
hostConnected() {
|
|
41
|
+
this.observer.observe(this.host, {
|
|
42
|
+
characterData: !0,
|
|
43
|
+
subtree: !0
|
|
44
|
+
}), this.checkInitialContent();
|
|
45
|
+
}
|
|
46
|
+
hostDisconnected() {
|
|
47
|
+
this.observer.disconnect();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { e as SlotTextController };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=slot-text-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-text-controller.js","names":[],"sources":["../../../../controllers/slot-text-controller/src/slot-text-controller.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\n\nexport interface SlotTextConfig {\n /**\n * The slot name to observe. Use `''` (empty string) for the default slot.\n *\n * @default '' (default slot)\n */\n slotName?: string;\n\n /**\n * CSS selectors for elements to exclude when checking for content.\n * Matched elements are ignored — only non-excluded elements and\n * non-empty text nodes count as \"content.\"\n */\n excludeSelectors?: string[];\n}\n\n/**\n * A reactive controller that observes whether a slot contains meaningful\n * text or element content.\n *\n * Replaces the `ObserveSlotText` mixin with a composition-based approach.\n *\n * Monitors for `characterData` mutations (text changes) and re-evaluates\n * on slot change events. The host is requested to update whenever the\n * content state changes.\n *\n * @example\n * ```typescript\n * class MyButton extends SpectrumElement {\n * private slotText = new SlotTextController(this);\n *\n * get hasLabel(): boolean {\n * return this.slotText.hasContent;\n * }\n *\n * override render() {\n * return html`<slot @slotchange=${this.slotText.handleSlotChange}></slot>`;\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Named slot with exclusions\n * class MyComponent extends SpectrumElement {\n * private slotText = new SlotTextController(this, {\n * slotName: 'description',\n * excludeSelectors: ['.visually-hidden'],\n * });\n * }\n * ```\n */\nexport class SlotTextController implements ReactiveController {\n private host: ReactiveElement;\n private slotName: string;\n private excludeSelectors: string[];\n private observer: MutationObserver;\n private _hasContent = false;\n\n constructor(host: ReactiveElement, config: SlotTextConfig = {}) {\n this.host = host;\n this.slotName = config.slotName ?? '';\n this.excludeSelectors = config.excludeSelectors ?? [];\n this.host.addController(this);\n\n this.observer = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === 'characterData') {\n this.checkContent();\n return;\n }\n }\n });\n }\n\n /**\n * Whether the observed slot has meaningful content (text nodes or\n * non-excluded elements).\n */\n get hasContent(): boolean {\n return this._hasContent;\n }\n\n /**\n * Bind this to the slot's `@slotchange` event in the template.\n *\n * @example\n * ```html\n * <slot @slotchange=${this.slotText.handleSlotChange}></slot>\n * ```\n */\n handleSlotChange = (event: Event): void => {\n const slot = event.target as HTMLSlotElement;\n const nodes = slot.assignedNodes({ flatten: true });\n this.evaluateNodes(nodes);\n };\n\n private evaluateNodes(nodes: Iterable<Node>): void {\n const hasContent = [...nodes].some((node) => {\n const el = node as HTMLElement;\n if (el.tagName) {\n return !this.excludeSelectors.some((sel) => el.matches(sel));\n }\n // A bare text node can never carry a `slot` attribute, so it is only\n // ever assigned to the default slot. When observing a named slot it must\n // not count as content.\n if (this.slotName) {\n return false;\n }\n // Only real text nodes count. Comment nodes (e.g. Lit's child-part\n // markers left behind by a `${cond ? nothing : label}` binding) also\n // lack a `tagName`, and their `textContent` is the marker data, which\n // would otherwise be misread as label text.\n return node.nodeType === Node.TEXT_NODE && node.textContent\n ? node.textContent.trim().length > 0\n : false;\n });\n\n if (hasContent !== this._hasContent) {\n this._hasContent = hasContent;\n this.host.requestUpdate();\n }\n }\n\n /**\n * Checks initial content from light DOM children before the first render,\n * before slots are assigned.\n *\n * This runs from `hostConnected`, which Lit invokes during the host's\n * `connectedCallback` — before the first `update()`. It sets `_hasContent`\n * directly and intentionally does not call `requestUpdate()`: the first\n * render has not happened yet, so it will read the correct value when it\n * runs. This differs from the `ObserveSlotText` mixin, where `slotHasContent`\n * was a reactive `@property` assigned in `update()`. After the first render,\n * `handleSlotChange` (bound via `@slotchange`) and the `characterData`\n * observer take over and do call `requestUpdate()` on change. The\n * controller stories cover initial content being reflected on first paint.\n */\n private checkInitialContent(): void {\n const { childNodes } = this.host;\n const relevant = [...childNodes].filter((node) => {\n const el = node as HTMLElement;\n if (el.tagName) {\n const excluded = this.excludeSelectors.some((sel) => el.matches(sel));\n if (excluded) {\n return false;\n }\n // Match slot assignment: named slot checks slot attribute,\n // default slot checks for no slot attribute\n return this.slotName\n ? el.getAttribute('slot') === this.slotName\n : !el.hasAttribute('slot');\n }\n // A bare text node has no `slot` attribute, so it is only assigned to\n // the default slot; it never counts as content for a named slot.\n if (this.slotName) {\n return false;\n }\n // Only real text nodes count. Comment nodes (e.g. Lit's child-part\n // markers left behind by a `${cond ? nothing : label}` binding) also\n // lack a `tagName`, and their `textContent` is the marker data, which\n // would otherwise be misread as label text.\n return node.nodeType === Node.TEXT_NODE && node.textContent\n ? node.textContent.trim().length > 0\n : false;\n });\n this._hasContent = relevant.length > 0;\n }\n\n private checkContent(): void {\n // Re-query assigned nodes from the slot element in the shadow root\n const slot = this.host.shadowRoot?.querySelector(\n this.slotName ? `slot[name=\"${this.slotName}\"]` : 'slot:not([name])'\n ) as HTMLSlotElement | null;\n if (slot) {\n const nodes = slot.assignedNodes({ flatten: true });\n this.evaluateNodes(nodes);\n }\n }\n\n hostConnected(): void {\n this.observer.observe(this.host, {\n characterData: true,\n subtree: true,\n });\n this.checkInitialContent();\n }\n\n hostDisconnected(): void {\n this.observer.disconnect();\n }\n}\n"],"mappings":";AAkEA,IAAa,IAAb,MAA8D;CAO5D,YAAY,GAAuB,IAAyB,EAAE,EAAE;;AAM9D,qBARoB,6BAkCF,MAAuB;GAEzC,IAAM,IADO,EAAM,OACA,cAAc,EAAE,SAAS,IAAM,CAAC;AACnD,QAAK,cAAc,EAAM;KAlCzB,KAAK,OAAO,GACZ,KAAK,YAAA,IAAW,EAAO,aAAA,OAAY,KAAZ,GACvB,KAAK,oBAAA,IAAmB,EAAO,qBAAA,OAAoB,EAAE,GAAtB,GAC/B,KAAK,KAAK,cAAc,KAAK,EAE7B,KAAK,WAAW,IAAI,kBAAkB,MAAc;AAClD,QAAK,IAAM,KAAY,EACrB,KAAI,EAAS,SAAS,iBAAiB;AACrC,SAAK,cAAc;AACnB;;IAGJ;;CAOJ,IAAI,aAAsB;AACxB,SAAO,KAAK;;CAiBd,cAAsB,GAA6B;EACjD,IAAM,IAAa,CAAC,GAAG,EAAM,CAAC,MAAM,MAAS;GAC3C,IAAM,IAAK;AAcX,UAbI,EAAG,UACE,CAAC,KAAK,iBAAiB,MAAM,MAAQ,EAAG,QAAQ,EAAI,CAAC,GAK1D,KAAK,WACA,KAMF,EAAK,aAAa,KAAK,aAAa,EAAK,cAC5C,EAAK,YAAY,MAAM,CAAC,SAAS,IACjC;IACJ;AAEF,EAAI,MAAe,KAAK,gBACtB,KAAK,cAAc,GACnB,KAAK,KAAK,eAAe;;CAkB7B,sBAAoC;EAClC,IAAM,EAAE,kBAAe,KAAK;AA2B5B,OAAK,cA1BY,CAAC,GAAG,EAAW,CAAC,QAAQ,MAAS;GAChD,IAAM,IAAK;AAqBX,UApBI,EAAG,UACY,KAAK,iBAAiB,MAAM,MAAQ,EAAG,QAAQ,EAAI,CAAC,GAE5D,KAIF,KAAK,WACR,EAAG,aAAa,OAAO,KAAK,KAAK,WACjC,CAAC,EAAG,aAAa,OAAO,GAI1B,KAAK,WACA,KAMF,EAAK,aAAa,KAAK,aAAa,EAAK,cAC5C,EAAK,YAAY,MAAM,CAAC,SAAS,IACjC;IACJ,CAC0B,SAAS;;CAGvC,eAA6B;;EAE3B,IAAM,KAAA,IAAO,KAAK,KAAK,eAAA,OAAA,KAAA,IAAA,EAAY,cACjC,KAAK,WAAW,cAAc,KAAK,SAAS,MAAM,mBACnD;AACD,MAAI,GAAM;GACR,IAAM,IAAQ,EAAK,cAAc,EAAE,SAAS,IAAM,CAAC;AACnD,QAAK,cAAc,EAAM;;;CAI7B,gBAAsB;AAKpB,EAJA,KAAK,SAAS,QAAQ,KAAK,MAAM;GAC/B,eAAe;GACf,SAAS;GACV,CAAC,EACF,KAAK,qBAAqB;;CAG5B,mBAAyB;AACvB,OAAK,SAAS,YAAY"}
|
package/dist/element/index.d.ts
CHANGED
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
export { defineElement } from './define-element.js';
|
|
13
|
-
export { SpectrumElement
|
|
13
|
+
export { SpectrumElement } from './spectrum-element.js';
|
|
14
14
|
export { coreVersion, version } from './version.js';
|
package/dist/element/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { defineElement as e } from "./define-element.js";
|
|
2
2
|
import { coreVersion as t, version as n } from "./version.js";
|
|
3
|
-
import { SpectrumElement as r
|
|
4
|
-
export { r as SpectrumElement,
|
|
3
|
+
import { SpectrumElement as r } from "./spectrum-element.js";
|
|
4
|
+
export { r as SpectrumElement, t as coreVersion, e as defineElement, n as version };
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import { LitElement
|
|
2
|
-
|
|
3
|
-
new (...args: any[]): T;
|
|
4
|
-
prototype: T;
|
|
5
|
-
};
|
|
6
|
-
export interface SpectrumInterface {
|
|
7
|
-
shadowRoot: ShadowRoot;
|
|
8
|
-
hasVisibleFocusInTree(): boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare function SpectrumMixin<T extends Constructor<ReactiveElement>>(constructor: T): T & Constructor<SpectrumInterface>;
|
|
11
|
-
declare const SpectrumElement_base: typeof LitElement & Constructor<SpectrumInterface>;
|
|
12
|
-
export declare class SpectrumElement extends SpectrumElement_base {
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class SpectrumElement extends LitElement {
|
|
13
3
|
/**
|
|
14
4
|
* @internal
|
|
15
5
|
*/
|
|
@@ -18,9 +8,62 @@ export declare class SpectrumElement extends SpectrumElement_base {
|
|
|
18
8
|
* @internal
|
|
19
9
|
*/
|
|
20
10
|
static CORE_VERSION: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Builds the deduplication key for a dev-mode warning. The `message` is part of
|
|
14
|
+
* the key so two distinct problems that share a `type`/`level` (the common
|
|
15
|
+
* case) do not suppress each other; only a verbatim repeat of the same warning
|
|
16
|
+
* is deduplicated. Exported so the dedup key can be unit tested without relying
|
|
17
|
+
* on the `NODE_ENV`-gated `window.__swc` setup below.
|
|
18
|
+
*/
|
|
19
|
+
export declare function warningId(localName: string, type: WarningType, level: WarningLevel, message: string): BrandedSWCWarningID;
|
|
20
|
+
/**
|
|
21
|
+
* A group of dev-mode warnings that share a `warningId`, collected within a
|
|
22
|
+
* single microtask so they can be emitted as one console line with a count.
|
|
23
|
+
*/
|
|
24
|
+
type BatchedWarning = {
|
|
25
|
+
message: string;
|
|
26
|
+
url: string;
|
|
27
|
+
localName: string;
|
|
28
|
+
type: WarningType;
|
|
29
|
+
level: WarningLevel;
|
|
30
|
+
listedIssues: string;
|
|
31
|
+
elements: HTMLElement[];
|
|
32
|
+
count: number;
|
|
21
33
|
/**
|
|
22
|
-
*
|
|
34
|
+
* Elements already counted in this batch, keyed by identity. A repeated
|
|
35
|
+
* `warn()` for an element already here does not bump `count` again.
|
|
23
36
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
countedElements?: Set<HTMLElement>;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the dev-mode warning (the only warning with no element) has been
|
|
40
|
+
* counted, so repeats of it collapse to one.
|
|
41
|
+
*/
|
|
42
|
+
countedDevModeWarning?: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Builds the `console.warn` arguments for a grouped dev warning: the message
|
|
46
|
+
* and a count line, then the element ref(s) to inspect. By default one
|
|
47
|
+
* representative element is shown; `verbose` shows every collected element
|
|
48
|
+
* (already capped at collection time). Exported so the grouped output can be
|
|
49
|
+
* unit tested without the `NODE_ENV`-gated `window.__swc` setup below.
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare function buildGroupedWarningArgs(batch: BatchedWarning, verbose: boolean): unknown[];
|
|
54
|
+
/**
|
|
55
|
+
* Records one warning occurrence into its batch, counting by element identity:
|
|
56
|
+
* `count` becomes the number of distinct elements with this warning, not the
|
|
57
|
+
* number of `warn()` calls. A host that warns once per child (same message,
|
|
58
|
+
* same element) still counts as one affected element. `count` is uncapped;
|
|
59
|
+
* `maxDisplayed` only limits how many element refs are kept for display.
|
|
60
|
+
*
|
|
61
|
+
* @param batch - Grouped-warning batch to record into.
|
|
62
|
+
* @param element - Element the warning is about, or `undefined` for the
|
|
63
|
+
* dev-mode warning, which is not about a specific element.
|
|
64
|
+
* @param maxDisplayed - Cap on element refs kept for display; does not affect
|
|
65
|
+
* `count`.
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare function recordAffectedElement(batch: BatchedWarning, element: HTMLElement | undefined, maxDisplayed: number): void;
|
|
26
69
|
export {};
|
|
@@ -1,26 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { LitElement as r } from "lit";
|
|
1
|
+
import { coreVersion as e, version as t } from "./version.js";
|
|
2
|
+
import { LitElement as n } from "lit";
|
|
4
3
|
//#region element/spectrum-element.ts
|
|
5
|
-
var i;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var t;
|
|
10
|
-
let n = e(this.getRootNode());
|
|
11
|
-
return (t = n == null ? void 0 : n.matches(":focus-visible")) == null ? !1 : t;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return n;
|
|
4
|
+
var r, i = class extends n {};
|
|
5
|
+
r = i, r.VERSION = t, r.CORE_VERSION = e;
|
|
6
|
+
function a(e, t, n, r) {
|
|
7
|
+
return `${e}:${t}:${n}:${r}`;
|
|
15
8
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
function o(e, t) {
|
|
10
|
+
let { message: n, url: r, localName: i, type: a, level: o, listedIssues: s, elements: c, count: l } = e, u = o === "deprecation" ? "DEPRECATION NOTICE: " : "", d = t ? c : c.slice(0, 1), f = "";
|
|
11
|
+
f = l === 1 ? d.length ? "\nAffected element:" : "" : `\n${l} <${i}> elements affected:`;
|
|
12
|
+
let p = [u + n + "\n" + s + f];
|
|
13
|
+
for (let e of d) p.push(e);
|
|
14
|
+
return p.push((d.length ? "\n\n" : "\n") + r + "\n", { data: {
|
|
15
|
+
localName: i,
|
|
16
|
+
type: a,
|
|
17
|
+
level: o,
|
|
18
|
+
count: l
|
|
19
|
+
} }), p;
|
|
20
|
+
}
|
|
21
|
+
function s(e, t, n) {
|
|
22
|
+
var r;
|
|
23
|
+
if (!t) {
|
|
24
|
+
if (e.countedDevModeWarning) return;
|
|
25
|
+
e.countedDevModeWarning = !0, e.count += 1;
|
|
26
|
+
return;
|
|
20
27
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
let i = (r = e.countedElements) == null ? e.countedElements = /* @__PURE__ */ new Set() : r;
|
|
29
|
+
i.has(t) || (i.add(t), e.count += 1, e.elements.length < n && e.elements.push(t));
|
|
30
|
+
}
|
|
31
|
+
if (process.env.NODE_ENV !== "production") {
|
|
32
|
+
var c, l, u;
|
|
24
33
|
let e = {
|
|
25
34
|
default: !1,
|
|
26
35
|
accessibility: !1,
|
|
@@ -31,36 +40,46 @@ if (i = o, i.VERSION = n, i.CORE_VERSION = t, process.env.NODE_ENV === "developm
|
|
|
31
40
|
medium: !1,
|
|
32
41
|
high: !1,
|
|
33
42
|
deprecation: !1
|
|
43
|
+
}, n = /* @__PURE__ */ new Map(), r = !1, i = () => {
|
|
44
|
+
r = !1, n.forEach((e, t) => {
|
|
45
|
+
console.warn(...o(e, !!window.__swc.verbose)), window.__swc.issuedWarnings.add(t);
|
|
46
|
+
}), n.clear();
|
|
34
47
|
};
|
|
35
48
|
window.__swc = {
|
|
36
49
|
...window.__swc,
|
|
37
50
|
DEBUG: !0,
|
|
38
|
-
ignoreWarningLocalNames: { ...((
|
|
51
|
+
ignoreWarningLocalNames: { ...((c = window.__swc) == null ? void 0 : c.ignoreWarningLocalNames) || {} },
|
|
39
52
|
ignoreWarningTypes: {
|
|
40
53
|
...e,
|
|
41
|
-
...((
|
|
54
|
+
...((l = window.__swc) == null ? void 0 : l.ignoreWarningTypes) || {}
|
|
42
55
|
},
|
|
43
56
|
ignoreWarningLevels: {
|
|
44
57
|
...t,
|
|
45
|
-
...((
|
|
58
|
+
...((u = window.__swc) == null ? void 0 : u.ignoreWarningLevels) || {}
|
|
46
59
|
},
|
|
47
60
|
issuedWarnings: /* @__PURE__ */ new Set(),
|
|
48
|
-
warn: (e, t,
|
|
49
|
-
let { localName:
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
warn: (e, t, o, { type: c = "api", level: l = "default", issues: u } = {}) => {
|
|
62
|
+
let { localName: d = "base" } = e || {}, f = a(d, c, l, t);
|
|
63
|
+
if (window.__swc.ignoreWarningLocalNames[d] || window.__swc.ignoreWarningTypes[c] || window.__swc.ignoreWarningLevels[l] || !window.__swc.verbose && window.__swc.issuedWarnings.has(f)) return;
|
|
64
|
+
let p = n.get(f);
|
|
65
|
+
if (!p) {
|
|
66
|
+
let e = "";
|
|
67
|
+
u && u.length && (u.unshift(""), e = u.join("\n - ") + "\n"), p = {
|
|
68
|
+
message: t,
|
|
69
|
+
url: o,
|
|
70
|
+
localName: d,
|
|
71
|
+
type: c,
|
|
72
|
+
level: l,
|
|
73
|
+
listedIssues: e,
|
|
74
|
+
elements: [],
|
|
75
|
+
count: 0
|
|
76
|
+
}, n.set(f, p);
|
|
77
|
+
}
|
|
78
|
+
s(p, e, 10), r || (r = !0, queueMicrotask(i));
|
|
60
79
|
}
|
|
61
80
|
}, window.__swc.warn(void 0, "Spectrum Web Components is in dev mode. Not recommended for production!", "https://opensource.adobe.com/spectrum-web-components/dev-mode/", { type: "default" });
|
|
62
81
|
}
|
|
63
82
|
//#endregion
|
|
64
|
-
export {
|
|
83
|
+
export { i as SpectrumElement, o as buildGroupedWarningArgs, s as recordAffectedElement, a as warningId };
|
|
65
84
|
|
|
66
85
|
//# sourceMappingURL=spectrum-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spectrum-element.js","names":[],"sources":["../../element/spectrum-element.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { LitElement, ReactiveElement } from 'lit';\n\nimport { getActiveElement } from '../utils/get-active-element.js';\nimport { coreVersion, version } from './version.js';\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport interface SpectrumInterface {\n shadowRoot: ShadowRoot;\n hasVisibleFocusInTree(): boolean;\n}\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @internal\n */\n public override shadowRoot!: ShadowRoot;\n\n /**\n * @internal\n */\n public hasVisibleFocusInTree(): boolean {\n const active = getActiveElement(\n this.getRootNode() as Document | ShadowRoot\n );\n\n return active?.matches(':focus-visible') ?? false;\n }\n }\n return SpectrumMixinElement;\n}\n\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n /**\n * @internal\n */\n static VERSION = version;\n\n /**\n * @internal\n */\n static CORE_VERSION = coreVersion;\n\n /**\n * @internal\n */\n public override get dir(): CSSStyleDeclaration['direction'] {\n return getComputedStyle(this).direction ?? 'ltr';\n }\n}\n\nif (process.env.NODE_ENV === 'development') {\n const ignoreWarningTypes = {\n default: false,\n accessibility: false,\n api: false,\n };\n const ignoreWarningLevels = {\n default: false,\n low: false,\n medium: false,\n high: false,\n deprecation: false,\n };\n window.__swc = {\n ...window.__swc,\n DEBUG: true,\n ignoreWarningLocalNames: {\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = `${localName}:${type}:${level}` as BrandedSWCWarningID;\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id)) {\n return;\n }\n if (window.__swc.ignoreWarningLocalNames[localName]) {\n return;\n }\n if (window.__swc.ignoreWarningTypes[type]) {\n return;\n }\n if (window.__swc.ignoreWarningLevels[level]) {\n return;\n }\n window.__swc.issuedWarnings.add(id);\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const inspectElement = element\n ? '\\nInspect this issue in the follow element:'\n : '';\n const displayURL = (element ? '\\n\\n' : '\\n') + url + '\\n';\n const messages: unknown[] = [];\n messages.push(intro + message + '\\n' + listedIssues + inspectElement);\n if (element) {\n messages.push(element);\n }\n messages.push(displayURL, {\n data: {\n localName,\n type,\n level,\n },\n });\n console.warn(...messages);\n },\n };\n\n window.__swc.warn(\n undefined,\n 'Spectrum Web Components is in dev mode. Not recommended for production!',\n 'https://opensource.adobe.com/spectrum-web-components/dev-mode/',\n { type: 'default' }\n );\n}\n"],"mappings":";;;;;AA4BA,SAAgB,EACd,GACoC;CACpC,MAAM,UAA6B,EAAY;EAS7C,wBAAwC;;GACtC,IAAM,IAAS,EACb,KAAK,aAAa,CACnB;AAED,WAAA,IAAA,KAAA,OAAA,KAAA,IAAO,EAAQ,QAAQ,iBAAiB,KAAA,OAAI,KAAJ;;;AAG5C,QAAO;;AAGT,IAAa,IAAb,cAAqC,EAAc,EAAW,CAAC;CAc7D,IAAoB,MAAwC;;AAC1D,UAAA,IAAO,iBAAiB,KAAK,CAAC,cAAA,OAAa,QAAb;;;AAIlC,uBAfmB,oBAKK,GAUxB,QAAA,IAAA,aAA6B,eAAe;;CAC1C,IAAM,IAAqB;EACzB,SAAS;EACT,eAAe;EACf,KAAK;EACN,EACK,IAAsB;EAC1B,SAAS;EACT,KAAK;EACL,QAAQ;EACR,MAAM;EACN,aAAa;EACd;AA+DD,CA9DA,OAAO,QAAQ;EACb,GAAG,OAAO;EACV,OAAO;EACP,yBAAyB,EACvB,KAAA,IAAI,OAAO,UAAA,OAAA,KAAA,IAAA,EAAO,4BAA2B,EAAE,EAChD;EACD,oBAAoB;GAClB,GAAG;GACH,KAAA,IAAI,OAAO,UAAA,OAAA,KAAA,IAAA,EAAO,uBAAsB,EAAE;GAC3C;EACD,qBAAqB;GACnB,GAAG;GACH,KAAA,IAAI,OAAO,UAAA,OAAA,KAAA,IAAA,EAAO,wBAAuB,EAAE;GAC5C;EACD,gCAAgB,IAAI,KAAK;EACzB,OACE,GACA,GACA,GACA,EAAE,UAAO,OAAO,WAAQ,WAAW,cAAW,EAAE,KACvC;GACT,IAAM,EAAE,eAAY,WAAW,KAAW,EAAE,EACtC,IAAK,GAAG,EAAU,GAAG,EAAK,GAAG;AAUnC,OATI,CAAC,OAAO,MAAM,WAAW,OAAO,MAAM,eAAe,IAAI,EAAG,IAG5D,OAAO,MAAM,wBAAwB,MAGrC,OAAO,MAAM,mBAAmB,MAGhC,OAAO,MAAM,oBAAoB,GACnC;AAEF,UAAO,MAAM,eAAe,IAAI,EAAG;GACnC,IAAI,IAAe;AACnB,GAAI,KAAU,EAAO,WACnB,EAAO,QAAQ,GAAG,EAClB,IAAe,EAAO,KAAK,WAAW,GAAG;GAE3C,IAAM,IAAQ,MAAU,gBAAgB,yBAAyB,IAC3D,IAAiB,IACnB,gDACA,IACE,KAAc,IAAU,SAAS,QAAQ,IAAM,MAC/C,IAAsB,EAAE;AAY9B,GAXA,EAAS,KAAK,IAAQ,IAAU,OAAO,IAAe,EAAe,EACjE,KACF,EAAS,KAAK,EAAQ,EAExB,EAAS,KAAK,GAAY,EACxB,MAAM;IACJ;IACA;IACA;IACD,EACF,CAAC,EACF,QAAQ,KAAK,GAAG,EAAS;;EAE5B,EAED,OAAO,MAAM,KACX,KAAA,GACA,2EACA,kEACA,EAAE,MAAM,WAAW,CACpB"}
|
|
1
|
+
{"version":3,"file":"spectrum-element.js","names":[],"sources":["../../element/spectrum-element.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { LitElement } from 'lit';\n\nimport { coreVersion, version } from './version.js';\n\nexport class SpectrumElement extends LitElement {\n /**\n * @internal\n */\n static VERSION = version;\n\n /**\n * @internal\n */\n static CORE_VERSION = coreVersion;\n}\n\n/**\n * Builds the deduplication key for a dev-mode warning. The `message` is part of\n * the key so two distinct problems that share a `type`/`level` (the common\n * case) do not suppress each other; only a verbatim repeat of the same warning\n * is deduplicated. Exported so the dedup key can be unit tested without relying\n * on the `NODE_ENV`-gated `window.__swc` setup below.\n */\nexport function warningId(\n localName: string,\n type: WarningType,\n level: WarningLevel,\n message: string\n): BrandedSWCWarningID {\n return `${localName}:${type}:${level}:${message}` as BrandedSWCWarningID;\n}\n\n/**\n * A group of dev-mode warnings that share a `warningId`, collected within a\n * single microtask so they can be emitted as one console line with a count.\n */\ntype BatchedWarning = {\n message: string;\n url: string;\n localName: string;\n type: WarningType;\n level: WarningLevel;\n listedIssues: string;\n elements: HTMLElement[];\n count: number;\n\n /**\n * Elements already counted in this batch, keyed by identity. A repeated\n * `warn()` for an element already here does not bump `count` again.\n */\n countedElements?: Set<HTMLElement>;\n\n /**\n * Whether the dev-mode warning (the only warning with no element) has been\n * counted, so repeats of it collapse to one.\n */\n countedDevModeWarning?: boolean;\n};\n\n/**\n * Builds the `console.warn` arguments for a grouped dev warning: the message\n * and a count line, then the element ref(s) to inspect. By default one\n * representative element is shown; `verbose` shows every collected element\n * (already capped at collection time). Exported so the grouped output can be\n * unit tested without the `NODE_ENV`-gated `window.__swc` setup below.\n *\n * @internal\n */\nexport function buildGroupedWarningArgs(\n batch: BatchedWarning,\n verbose: boolean\n): unknown[] {\n const {\n message,\n url,\n localName,\n type,\n level,\n listedIssues,\n elements,\n count,\n } = batch;\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const shown = verbose ? elements : elements.slice(0, 1);\n let countLine = '';\n if (count === 1) {\n countLine = shown.length ? '\\nAffected element:' : '';\n } else {\n countLine = `\\n${count} <${localName}> elements affected:`;\n }\n const args: unknown[] = [intro + message + '\\n' + listedIssues + countLine];\n for (const el of shown) {\n args.push(el);\n }\n args.push((shown.length ? '\\n\\n' : '\\n') + url + '\\n', {\n data: { localName, type, level, count },\n });\n return args;\n}\n\n/**\n * Records one warning occurrence into its batch, counting by element identity:\n * `count` becomes the number of distinct elements with this warning, not the\n * number of `warn()` calls. A host that warns once per child (same message,\n * same element) still counts as one affected element. `count` is uncapped;\n * `maxDisplayed` only limits how many element refs are kept for display.\n *\n * @param batch - Grouped-warning batch to record into.\n * @param element - Element the warning is about, or `undefined` for the\n * dev-mode warning, which is not about a specific element.\n * @param maxDisplayed - Cap on element refs kept for display; does not affect\n * `count`.\n * @internal\n */\nexport function recordAffectedElement(\n batch: BatchedWarning,\n element: HTMLElement | undefined,\n maxDisplayed: number\n): void {\n if (!element) {\n // The dev-mode warning is the only warning with no element; count it once\n // however often it fires.\n if (batch.countedDevModeWarning) {\n return;\n }\n batch.countedDevModeWarning = true;\n batch.count += 1;\n return;\n }\n const countedElements = (batch.countedElements ??= new Set<HTMLElement>());\n if (countedElements.has(element)) {\n return; // this element is already counted for the batch\n }\n countedElements.add(element);\n batch.count += 1;\n if (batch.elements.length < maxDisplayed) {\n batch.elements.push(element);\n }\n}\n\n// Enabled in every environment except production (the ecosystem convention);\n// a production build strips this block via dead-code elimination.\nif (process.env.NODE_ENV !== 'production') {\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\n // Grouped warnings: collect same-`warningId` warnings fired within one\n // microtask and emit a single console line with the total count. By default\n // one representative element is shown for inspection; `verbose` lists all\n // collected elements (capped at WARNING_ELEMENT_CAP).\n const WARNING_ELEMENT_CAP = 10;\n const batchedWarnings = new Map<BrandedSWCWarningID, BatchedWarning>();\n let flushScheduled = false;\n\n const flushWarnings = (): void => {\n flushScheduled = false;\n batchedWarnings.forEach((batch, id) => {\n console.warn(\n ...buildGroupedWarningArgs(batch, Boolean(window.__swc.verbose))\n );\n window.__swc.issuedWarnings.add(id);\n });\n batchedWarnings.clear();\n };\n\n window.__swc = {\n ...window.__swc,\n DEBUG: true,\n ignoreWarningLocalNames: {\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = warningId(localName, type, level, message);\n // Ignore filters short-circuit before any batching.\n if (window.__swc.ignoreWarningLocalNames[localName]) {\n return;\n }\n if (window.__swc.ignoreWarningTypes[type]) {\n return;\n }\n if (window.__swc.ignoreWarningLevels[level]) {\n return;\n }\n // Session dedup: each id emits one grouped line per session. `verbose`\n // bypasses it so every microtask flush re-emits.\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id)) {\n return;\n }\n // Collect into the per-id batch; `flushWarnings` builds the grouped\n // message on the next microtask.\n let batch = batchedWarnings.get(id);\n if (!batch) {\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n batch = {\n message,\n url,\n localName,\n type,\n level,\n listedIssues,\n elements: [],\n count: 0,\n };\n batchedWarnings.set(id, batch);\n }\n recordAffectedElement(batch, element, WARNING_ELEMENT_CAP);\n if (!flushScheduled) {\n flushScheduled = true;\n queueMicrotask(flushWarnings);\n }\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"],"mappings":";;;OAgBa,IAAb,cAAqC,EAAW;mBAI7B,oBAKK;AAUxB,SAAgB,EACd,GACA,GACA,GACA,GACqB;AACrB,QAAO,GAAG,EAAU,GAAG,EAAK,GAAG,EAAM,GAAG;;AAuC1C,SAAgB,EACd,GACA,GACW;CACX,IAAM,EACJ,YACA,QACA,cACA,SACA,UACA,iBACA,aACA,aACE,GACE,IAAQ,MAAU,gBAAgB,yBAAyB,IAC3D,IAAQ,IAAU,IAAW,EAAS,MAAM,GAAG,EAAE,EACnD,IAAY;AAChB,CAGE,IAHE,MAAU,IACA,EAAM,SAAS,wBAAwB,KAEvC,KAAK,EAAM,IAAI,EAAU;CAEvC,IAAM,IAAkB,CAAC,IAAQ,IAAU,OAAO,IAAe,EAAU;AAC3E,MAAK,IAAM,KAAM,EACf,GAAK,KAAK,EAAG;AAKf,QAHA,EAAK,MAAM,EAAM,SAAS,SAAS,QAAQ,IAAM,MAAM,EACrD,MAAM;EAAE;EAAW;EAAM;EAAO;EAAO,EACxC,CAAC,EACK;;AAiBT,SAAgB,EACd,GACA,GACA,GACM;;AACN,KAAI,CAAC,GAAS;AAGZ,MAAI,EAAM,sBACR;AAGF,EADA,EAAM,wBAAwB,IAC9B,EAAM,SAAS;AACf;;CAEF,IAAM,KAAA,IAAmB,EAAM,oBAAA,OAAN,EAAM,kCAAoB,IAAI,KAAkB,GAA1C;AAC3B,GAAgB,IAAI,EAAQ,KAGhC,EAAgB,IAAI,EAAQ,EAC5B,EAAM,SAAS,GACX,EAAM,SAAS,SAAS,KAC1B,EAAM,SAAS,KAAK,EAAQ;;AAMhC,IAAA,QAAA,IAAA,aAA6B,cAAc;;CACzC,IAAM,IAAqB;EACzB,SAAS;EACT,eAAe;EACf,KAAK;EACN,EACK,IAAsB;EAC1B,SAAS;EACT,KAAK;EACL,QAAQ;EACR,MAAM;EACN,aAAa;EACd,EAOK,oBAAkB,IAAI,KAA0C,EAClE,IAAiB,IAEf,UAA4B;AAQhC,EAPA,IAAiB,IACjB,EAAgB,SAAS,GAAO,MAAO;AAIrC,GAHA,QAAQ,KACN,GAAG,EAAwB,GAAO,EAAQ,OAAO,MAAM,QAAS,CACjE,EACD,OAAO,MAAM,eAAe,IAAI,EAAG;IACnC,EACF,EAAgB,OAAO;;AAsEzB,CAnEA,OAAO,QAAQ;EACb,GAAG,OAAO;EACV,OAAO;EACP,yBAAyB,EACvB,KAAA,IAAI,OAAO,UAAA,OAAA,KAAA,IAAA,EAAO,4BAA2B,EAAE,EAChD;EACD,oBAAoB;GAClB,GAAG;GACH,KAAA,IAAI,OAAO,UAAA,OAAA,KAAA,IAAA,EAAO,uBAAsB,EAAE;GAC3C;EACD,qBAAqB;GACnB,GAAG;GACH,KAAA,IAAI,OAAO,UAAA,OAAA,KAAA,IAAA,EAAO,wBAAuB,EAAE;GAC5C;EACD,gCAAgB,IAAI,KAAK;EACzB,OACE,GACA,GACA,GACA,EAAE,UAAO,OAAO,WAAQ,WAAW,cAAW,EAAE,KACvC;GACT,IAAM,EAAE,eAAY,WAAW,KAAW,EAAE,EACtC,IAAK,EAAU,GAAW,GAAM,GAAO,EAAQ;AAarD,OAXI,OAAO,MAAM,wBAAwB,MAGrC,OAAO,MAAM,mBAAmB,MAGhC,OAAO,MAAM,oBAAoB,MAKjC,CAAC,OAAO,MAAM,WAAW,OAAO,MAAM,eAAe,IAAI,EAAG,CAC9D;GAIF,IAAI,IAAQ,EAAgB,IAAI,EAAG;AACnC,OAAI,CAAC,GAAO;IACV,IAAI,IAAe;AAenB,IAdI,KAAU,EAAO,WACnB,EAAO,QAAQ,GAAG,EAClB,IAAe,EAAO,KAAK,WAAW,GAAG,OAE3C,IAAQ;KACN;KACA;KACA;KACA;KACA;KACA;KACA,UAAU,EAAE;KACZ,OAAO;KACR,EACD,EAAgB,IAAI,GAAI,EAAM;;AAGhC,GADA,EAAsB,GAAO,GAAS,GAAoB,EACrD,MACH,IAAiB,IACjB,eAAe,EAAc;;EAGlC,EAED,OAAO,MAAM,KACX,KAAA,GACA,2EACA,kEACA,EAAE,MAAM,WAAW,CACpB"}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
/**
|
|
13
13
|
* The version of the 2nd-gen Spectrum Web Components library.
|
|
14
14
|
*/
|
|
15
|
-
export declare const version = "2.0.0-beta.
|
|
15
|
+
export declare const version = "2.0.0-beta.2";
|
|
16
16
|
/**
|
|
17
17
|
* The version of the core base package.
|
|
18
18
|
*/
|
|
19
|
-
export declare const coreVersion = "2.0.0-beta.
|
|
19
|
+
export declare const coreVersion = "2.0.0-beta.2";
|
package/dist/element/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../element/version.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Auto-generated from 2nd-gen/packages/core/package.json\n// Generation: 2nd-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 2nd-gen Spectrum Web Components library.\n */\nexport const version = '2.0.0-beta.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../element/version.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Auto-generated from 2nd-gen/packages/core/package.json\n// Generation: 2nd-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 2nd-gen Spectrum Web Components library.\n */\nexport const version = '2.0.0-beta.2';\n\n/**\n * The version of the core base package.\n */\nexport const coreVersion = '2.0.0-beta.2';\n"],"mappings":";AAmBA,IAAa,IAAU,gBAKV,IAAc"}
|
package/dist/mixins/index.d.ts
CHANGED
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { DisabledMixin, type DisabledInterface } from './disabled-mixin.js';
|
|
13
13
|
export { LINEAR_PROGRESS_LABEL_POSITIONS, LINEAR_PROGRESS_STATIC_COLORS, LINEAR_PROGRESS_VALID_SIZES, LinearProgressMixin, type LinearProgressInterface, type LinearProgressLabelPosition, type LinearProgressSize, type LinearProgressStaticColor, } from './linear-progress-mixin.js';
|
|
14
|
-
export { ObserveSlotPresence, type SlotPresenceObservingInterface, } from './observe-slot-presence.js';
|
|
15
|
-
export { ObserveSlotText, type SlotTextObservingInterface, } from './observe-slot-text.js';
|
|
16
14
|
export { PendingMixin, type PendingInterface } from './pending-mixin.js';
|
|
17
15
|
export { DEFAULT_ELEMENT_SIZES, ELEMENT_SIZES, SizedMixin, } from './sized-mixin.js';
|
|
18
16
|
export type { DefaultElementSize, ElementSize, SizedElementConstructor, SizedElementInterface, } from './sized-mixin.js';
|
package/dist/mixins/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { DisabledMixin as e } from "./disabled-mixin.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { DEFAULT_ELEMENT_SIZES as c, ELEMENT_SIZES as l, SizedMixin as u } from "./sized-mixin.js";
|
|
7
|
-
export { c as DEFAULT_ELEMENT_SIZES, e as DisabledMixin, l as ELEMENT_SIZES, n as LINEAR_PROGRESS_LABEL_POSITIONS, r as LINEAR_PROGRESS_STATIC_COLORS, i as LINEAR_PROGRESS_VALID_SIZES, a as LinearProgressMixin, t as ObserveSlotPresence, o as ObserveSlotText, s as PendingMixin, u as SizedMixin };
|
|
2
|
+
import { LINEAR_PROGRESS_LABEL_POSITIONS as t, LINEAR_PROGRESS_STATIC_COLORS as n, LINEAR_PROGRESS_VALID_SIZES as r, LinearProgressMixin as i } from "./linear-progress-mixin.js";
|
|
3
|
+
import { PendingMixin as a } from "./pending-mixin.js";
|
|
4
|
+
import { DEFAULT_ELEMENT_SIZES as o, ELEMENT_SIZES as s, SizedMixin as c } from "./sized-mixin.js";
|
|
5
|
+
export { o as DEFAULT_ELEMENT_SIZES, e as DisabledMixin, s as ELEMENT_SIZES, t as LINEAR_PROGRESS_LABEL_POSITIONS, n as LINEAR_PROGRESS_STATIC_COLORS, r as LINEAR_PROGRESS_VALID_SIZES, i as LinearProgressMixin, a as PendingMixin, c as SizedMixin };
|