@spectrum-web-components/iconset 1.9.1-nightly.20251028225812 → 1.9.1-nightly.20251029132910

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.
@@ -1,123 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __decorateClass = (decorators, target, key, kind) => {
5
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
6
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
7
- if (decorator = decorators[i])
8
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9
- if (kind && result) __defProp(target, key, result);
10
- return result;
11
- };
12
- import {
13
- html
14
- } from "@spectrum-web-components/base";
15
- import { query } from "@spectrum-web-components/base/src/decorators.js";
16
- import { Iconset } from "./iconset.dev.js";
17
- export class IconsetSVG extends Iconset {
18
- constructor() {
19
- super(...arguments);
20
- this.iconMap = /* @__PURE__ */ new Map();
21
- }
22
- /**
23
- * First updated handler just ensures we've processed any slotted symbols
24
- */
25
- updated(changedProperties) {
26
- if (!this.slotContainer) {
27
- return;
28
- }
29
- const currentSVGNodes = this.getSVGNodes(this.slotContainer);
30
- this.updateSVG(currentSVGNodes);
31
- super.updated(changedProperties);
32
- }
33
- /**
34
- * Applies the requested icon from this iconset instance to the given element.
35
- *
36
- * @param el - the element to apply the icon to
37
- * @param icon - the name of the icon within this set to apply.
38
- */
39
- async applyIconToElement(el, icon, _size, label) {
40
- await this.updateComplete;
41
- const iconSymbol = this.iconMap.get(icon);
42
- if (!iconSymbol) {
43
- throw new Error(`Unable to find icon ${icon}`);
44
- }
45
- const clonedNode = this.prepareSvgClone(iconSymbol);
46
- clonedNode.setAttribute("role", "img");
47
- if (label) {
48
- clonedNode.setAttribute("aria-label", label);
49
- } else {
50
- clonedNode.setAttribute("aria-hidden", "true");
51
- }
52
- if (el.shadowRoot) {
53
- el.shadowRoot.appendChild(clonedNode);
54
- } else {
55
- el.appendChild(clonedNode);
56
- }
57
- }
58
- /**
59
- * Returns a list of all icons in this iconset.
60
- */
61
- getIconList() {
62
- return [...this.iconMap.keys()];
63
- }
64
- prepareSvgClone(sourceSvg) {
65
- const content = sourceSvg.cloneNode(true);
66
- const svg = document.createElementNS(
67
- "http://www.w3.org/2000/svg",
68
- "svg"
69
- );
70
- const viewBox = content.getAttribute("viewBox") || "";
71
- const cssText = "pointer-events: none; display: block; width: 100%; height: 100%;";
72
- svg.style.cssText = cssText;
73
- svg.setAttribute("viewBox", viewBox);
74
- svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
75
- svg.setAttribute("focusable", "false");
76
- while (content.childNodes.length > 0) {
77
- svg.appendChild(content.childNodes[0]);
78
- }
79
- return svg;
80
- }
81
- getSVGIconName(icon) {
82
- return icon;
83
- }
84
- getSanitizedIconName(icon) {
85
- return icon;
86
- }
87
- renderDefaultContent() {
88
- return html``;
89
- }
90
- render() {
91
- return html`
92
- <slot @slotchange=${this.onSlotChange}>
93
- ${this.renderDefaultContent()}
94
- </slot>
95
- `;
96
- }
97
- updateSVG(nodes) {
98
- const symbols = nodes.reduce((prev, svgNode) => {
99
- const containedSymbols = svgNode.querySelectorAll("symbol");
100
- prev.push(...containedSymbols);
101
- return prev;
102
- }, []);
103
- symbols.forEach((symbol) => {
104
- this.iconMap.set(this.getSanitizedIconName(symbol.id), symbol);
105
- });
106
- }
107
- getSVGNodes(slotTarget) {
108
- const nodes = slotTarget.assignedNodes({ flatten: true });
109
- const svgNodes = nodes.filter((node) => {
110
- return node.nodeName === "svg";
111
- });
112
- return svgNodes;
113
- }
114
- onSlotChange(event) {
115
- const slotTarget = event.target;
116
- const svgNodes = this.getSVGNodes(slotTarget);
117
- this.updateSVG(svgNodes);
118
- }
119
- }
120
- __decorateClass([
121
- query("slot")
122
- ], IconsetSVG.prototype, "slotContainer", 2);
123
- //# sourceMappingURL=iconset-svg.dev.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["iconset-svg.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { query } from '@spectrum-web-components/base/src/decorators.js';\n\nimport { Iconset } from './iconset.dev.js'\n\nexport abstract class IconsetSVG extends Iconset {\n private iconMap: Map<string, SVGSymbolElement> = new Map();\n\n @query('slot')\n private slotContainer?: HTMLSlotElement;\n\n /**\n * First updated handler just ensures we've processed any slotted symbols\n */\n public override updated(changedProperties: PropertyValues): void {\n if (!this.slotContainer) {\n return;\n }\n const currentSVGNodes = this.getSVGNodes(this.slotContainer);\n this.updateSVG(currentSVGNodes);\n super.updated(changedProperties);\n }\n /**\n * Applies the requested icon from this iconset instance to the given element.\n *\n * @param el - the element to apply the icon to\n * @param icon - the name of the icon within this set to apply.\n */\n public async applyIconToElement(\n el: HTMLElement,\n icon: string,\n _size: string,\n label: string\n ): Promise<void> {\n await this.updateComplete;\n const iconSymbol = this.iconMap.get(icon);\n if (!iconSymbol) {\n throw new Error(`Unable to find icon ${icon}`);\n }\n // we cannot share a single SVG globally across shadowroot boundaries\n // so copy the template node so we can inject it where we need it\n const clonedNode = this.prepareSvgClone(iconSymbol);\n clonedNode.setAttribute('role', 'img');\n if (label) {\n clonedNode.setAttribute('aria-label', label);\n } else {\n clonedNode.setAttribute('aria-hidden', 'true');\n }\n // append the svg to the node either in its shadowroot or directly into its dom\n if (el.shadowRoot) {\n el.shadowRoot.appendChild(clonedNode);\n } else {\n el.appendChild(clonedNode);\n }\n }\n\n /**\n * Returns a list of all icons in this iconset.\n */\n public getIconList(): string[] {\n return [...this.iconMap.keys()];\n }\n\n protected prepareSvgClone(sourceSvg: SVGSymbolElement): SVGSVGElement {\n const content = sourceSvg.cloneNode(true) as SVGSymbolElement;\n // we're going to create a new svg element that will have our symbol geometry inside\n const svg = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'svg'\n );\n const viewBox = content.getAttribute('viewBox') || '';\n // inline style isn't ideal but will work in all cases and means our icons don't need to know\n // if they are svg or spritesheet provided\n const cssText =\n 'pointer-events: none; display: block; width: 100%; height: 100%;';\n svg.style.cssText = cssText;\n // copy the viewbox and other properties into the svg\n svg.setAttribute('viewBox', viewBox);\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');\n svg.setAttribute('focusable', 'false');\n // move all the child nodes over to the svg\n while (content.childNodes.length > 0) {\n svg.appendChild(content.childNodes[0]);\n }\n return svg;\n }\n protected getSVGIconName(icon: string): string {\n return icon;\n }\n protected getSanitizedIconName(icon: string): string {\n return icon;\n }\n protected renderDefaultContent(): TemplateResult {\n return html``;\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot @slotchange=${this.onSlotChange}>\n ${this.renderDefaultContent()}\n </slot>\n `;\n }\n\n protected updateSVG(nodes: SVGElement[]): void {\n // iterate over the nodes that were passed in, and find all the top level symbols\n const symbols = nodes.reduce((prev, svgNode) => {\n const containedSymbols = svgNode.querySelectorAll('symbol');\n prev.push(...containedSymbols);\n return prev;\n }, [] as SVGSymbolElement[]);\n symbols.forEach((symbol) => {\n this.iconMap.set(this.getSanitizedIconName(symbol.id), symbol);\n });\n }\n\n protected getSVGNodes(slotTarget: HTMLSlotElement): SVGElement[] {\n const nodes = slotTarget.assignedNodes({ flatten: true });\n // find all the svg nodes\n const svgNodes = nodes.filter((node) => {\n return node.nodeName === 'svg';\n }) as SVGElement[];\n return svgNodes;\n }\n\n private onSlotChange(event: Event): void {\n const slotTarget = event.target as HTMLSlotElement;\n const svgN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";var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var a=(l,r,t,o)=>{for(var e=o>1?void 0:o?p(r,t):r,s=l.length-1,n;s>=0;s--)(n=l[s])&&(e=(o?n(r,t,e):n(e))||e);return o&&e&&c(r,t,e),e};import{html as d}from"@spectrum-web-components/base";import{query as u}from"@spectrum-web-components/base/src/decorators.js";import{Iconset as m}from"./iconset.js";export class IconsetSVG extends m{constructor(){super(...arguments);this.iconMap=new Map}updated(t){if(!this.slotContainer)return;const o=this.getSVGNodes(this.slotContainer);this.updateSVG(o),super.updated(t)}async applyIconToElement(t,o,e,s){await this.updateComplete;const n=this.iconMap.get(o);if(!n)throw new Error(`Unable to find icon ${o}`);const i=this.prepareSvgClone(n);i.setAttribute("role","img"),s?i.setAttribute("aria-label",s):i.setAttribute("aria-hidden","true"),t.shadowRoot?t.shadowRoot.appendChild(i):t.appendChild(i)}getIconList(){return[...this.iconMap.keys()]}prepareSvgClone(t){const o=t.cloneNode(!0),e=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=o.getAttribute("viewBox")||"",n="pointer-events: none; display: block; width: 100%; height: 100%;";for(e.style.cssText=n,e.setAttribute("viewBox",s),e.setAttribute("preserveAspectRatio","xMidYMid meet"),e.setAttribute("focusable","false");o.childNodes.length>0;)e.appendChild(o.childNodes[0]);return e}getSVGIconName(t){return t}getSanitizedIconName(t){return t}renderDefaultContent(){return d``}render(){return d`
2
- <slot @slotchange=${this.onSlotChange}>
3
- ${this.renderDefaultContent()}
4
- </slot>
5
- `}updateSVG(t){t.reduce((e,s)=>{const n=s.querySelectorAll("symbol");return e.push(...n),e},[]).forEach(e=>{this.iconMap.set(this.getSanitizedIconName(e.id),e)})}getSVGNodes(t){return t.assignedNodes({flatten:!0}).filter(s=>s.nodeName==="svg")}onSlotChange(t){const o=t.target,e=this.getSVGNodes(o);this.updateSVG(e)}}a([u("slot")],IconsetSVG.prototype,"slotContainer",2);
6
- //# sourceMappingURL=iconset-svg.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["iconset-svg.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { query } from '@spectrum-web-components/base/src/decorators.js';\n\nimport { Iconset } from './iconset.js';\n\nexport abstract class IconsetSVG extends Iconset {\n private iconMap: Map<string, SVGSymbolElement> = new Map();\n\n @query('slot')\n private slotContainer?: HTMLSlotElement;\n\n /**\n * First updated handler just ensures we've processed any slotted symbols\n */\n public override updated(changedProperties: PropertyValues): void {\n if (!this.slotContainer) {\n return;\n }\n const currentSVGNodes = this.getSVGNodes(this.slotContainer);\n this.updateSVG(currentSVGNodes);\n super.updated(changedProperties);\n }\n /**\n * Applies the requested icon from this iconset instance to the given element.\n *\n * @param el - the element to apply the icon to\n * @param icon - the name of the icon within this set to apply.\n */\n public async applyIconToElement(\n el: HTMLElement,\n icon: string,\n _size: string,\n label: string\n ): Promise<void> {\n await this.updateComplete;\n const iconSymbol = this.iconMap.get(icon);\n if (!iconSymbol) {\n throw new Error(`Unable to find icon ${icon}`);\n }\n // we cannot share a single SVG globally across shadowroot boundaries\n // so copy the template node so we can inject it where we need it\n const clonedNode = this.prepareSvgClone(iconSymbol);\n clonedNode.setAttribute('role', 'img');\n if (label) {\n clonedNode.setAttribute('aria-label', label);\n } else {\n clonedNode.setAttribute('aria-hidden', 'true');\n }\n // append the svg to the node either in its shadowroot or directly into its dom\n if (el.shadowRoot) {\n el.shadowRoot.appendChild(clonedNode);\n } else {\n el.appendChild(clonedNode);\n }\n }\n\n /**\n * Returns a list of all icons in this iconset.\n */\n public getIconList(): string[] {\n return [...this.iconMap.keys()];\n }\n\n protected prepareSvgClone(sourceSvg: SVGSymbolElement): SVGSVGElement {\n const content = sourceSvg.cloneNode(true) as SVGSymbolElement;\n // we're going to create a new svg element that will have our symbol geometry inside\n const svg = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'svg'\n );\n const viewBox = content.getAttribute('viewBox') || '';\n // inline style isn't ideal but will work in all cases and means our icons don't need to know\n // if they are svg or spritesheet provided\n const cssText =\n 'pointer-events: none; display: block; width: 100%; height: 100%;';\n svg.style.cssText = cssText;\n // copy the viewbox and other properties into the svg\n svg.setAttribute('viewBox', viewBox);\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');\n svg.setAttribute('focusable', 'false');\n // move all the child nodes over to the svg\n while (content.childNodes.length > 0) {\n svg.appendChild(content.childNodes[0]);\n }\n return svg;\n }\n protected getSVGIconName(icon: string): string {\n return icon;\n }\n protected getSanitizedIconName(icon: string): string {\n return icon;\n }\n protected renderDefaultContent(): TemplateResult {\n return html``;\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot @slotchange=${this.onSlotChange}>\n ${this.renderDefaultContent()}\n </slot>\n `;\n }\n\n protected updateSVG(nodes: SVGElement[]): void {\n // iterate over the nodes that were passed in, and find all the top level symbols\n const symbols = nodes.reduce((prev, svgNode) => {\n const containedSymbols = svgNode.querySelectorAll('symbol');\n prev.push(...containedSymbols);\n return prev;\n }, [] as SVGSymbolElement[]);\n symbols.forEach((symbol) => {\n this.iconMap.set(this.getSanitizedIconName(symbol.id), symbol);\n });\n }\n\n protected getSVGNodes(slotTarget: HTMLSlotElement): SVGElement[] {\n const nodes = slotTarget.assignedNodes({ flatten: true });\n // find all the svg nodes\n const svgNodes = nodes.filter((node) => {\n return node.nodeName === 'svg';\n }) as SVGElement[];\n return svgNodes;\n }\n\n private onSlotChange(event: Event): void {\n const slotTarget = event.target as HTMLSl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AsB,CAC3C,OAAOA,CACX,CACU,qBAAqBA,EAAsB,CACjD,OAAOA,CACX,CACU,sBAAuC,CAC7C,OAAON,GACX,CAEmB,QAAyB,CACxC,OAAOA;AAAA,gCACiB,KAAK,YAAY;AAAA,kBAC/B,KAAK,qBAAqB,CAAC;AAAA;AAAA,SAGzC,CAEU,UAAUgB,EAA2B,CAE3BA,EAAM,OAAO,CAACC,EAAMC,IAAY,CAC5C,MAAMC,EAAmBD,EAAQ,iBAAiB,QAAQ,EAC1D,OAAAD,EAAK,KAAK,GAAGE,CAAgB,EACtBF,CACX,EAAG,CAAC,CAAuB,EACnB,QAASG,GAAW,CACxB,KAAK,QAAQ,IAAI,KAAK,qBAAqBA,EAAO,EAAE,EAAGA,CAAM,CACjE,CAAC,CACL,CAEU,YAAYC,EAA2C,CAM7D,OALcA,EAAW,cAAc,CAAE,QAAS,EAAK,CAAC,EAEjC,OAAQC,GACpBA,EAAK,WAAa,KAC5B,CAEL,CAEQ,aAAaC,EAAoB,CACrC,MAAMF,EAAaE,EAAM,OACnBC,EAAW,KAAK,YAAYH,CAAU,EAC5C,KAAK,UAAUG,CAAQ,CAC3B,CACJ,CAzHYC,EAAA,CADPxB,EAAM,MAAM,GAHK,WAIV",
6
- "names": ["html", "query", "Iconset", "changedProperties", "currentSVGNodes", "el", "icon", "_size", "label", "iconSymbol", "clonedNode", "sourceSvg", "content", "svg", "viewBox", "cssText", "nodes", "prev", "svgNode", "containedSymbols", "symbol", "slotTarget", "node", "event", "svgNodes", "__decorateClass"]
7
- }
package/src/iconset.d.ts DELETED
@@ -1,31 +0,0 @@
1
- import { LitElement } from '@spectrum-web-components/base';
2
- export declare abstract class Iconset extends LitElement {
3
- protected registered: boolean;
4
- private _name;
5
- protected firstUpdated(): void;
6
- /**
7
- * Name of the iconset, used by the IconsetRegistry to serve this icon set
8
- * to consuming icons.
9
- */
10
- set name(value: string);
11
- get name(): string;
12
- /**
13
- * Applies an icon to the given element
14
- */
15
- abstract applyIconToElement(el: HTMLElement, icon: string, size: string, label: string): void;
16
- /**
17
- * Returns a list of all icons in this iconset.
18
- */
19
- abstract getIconList(): string[];
20
- private handleRemoved;
21
- /**
22
- * On updated we register the iconset if we're not already registered
23
- */
24
- connectedCallback(): void;
25
- /**
26
- * On disconnected we remove the iconset
27
- */
28
- disconnectedCallback(): void;
29
- private addIconset;
30
- private removeIconset;
31
- }
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __decorateClass = (decorators, target, key, kind) => {
5
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
6
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
7
- if (decorator = decorators[i])
8
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9
- if (kind && result) __defProp(target, key, result);
10
- return result;
11
- };
12
- import { IconsetRegistry } from "./iconset-registry.dev.js";
13
- import { LitElement } from "@spectrum-web-components/base";
14
- import { property } from "@spectrum-web-components/base/src/decorators.js";
15
- export class Iconset extends LitElement {
16
- constructor() {
17
- super(...arguments);
18
- this.registered = false;
19
- this.handleRemoved = ({
20
- detail
21
- }) => {
22
- if (detail.name === this.name) {
23
- this.registered = false;
24
- this.addIconset();
25
- }
26
- };
27
- }
28
- firstUpdated() {
29
- this.style.display = "none";
30
- if (true) {
31
- window.__swc.warn(
32
- this,
33
- "Iconsets have been deprecated and will be removed from the project in an upcoming version. For default Spectrum Icons, learn more about leveraging UI Icons (https://opensource.adobe.com/spectrum-web-components/components/icons-ui/) or Workflow Icons (https://opensource.adobe.com/spectrum-web-components/components/icons-workflow/) as an alternative.",
34
- "https://opensource.adobe.com/spectrum-web-components/components/iconset/#deprecated",
35
- { level: "deprecation" }
36
- );
37
- }
38
- }
39
- set name(value) {
40
- if (this.registered) {
41
- if (this._name) {
42
- IconsetRegistry.getInstance().removeIconset(this._name);
43
- }
44
- if (value) {
45
- IconsetRegistry.getInstance().addIconset(value, this);
46
- }
47
- }
48
- this._name = value;
49
- }
50
- get name() {
51
- return this._name;
52
- }
53
- /**
54
- * On updated we register the iconset if we're not already registered
55
- */
56
- connectedCallback() {
57
- super.connectedCallback();
58
- this.addIconset();
59
- window.addEventListener("sp-iconset-removed", this.handleRemoved);
60
- }
61
- /**
62
- * On disconnected we remove the iconset
63
- */
64
- disconnectedCallback() {
65
- super.disconnectedCallback();
66
- window.removeEventListener("sp-iconset-removed", this.handleRemoved);
67
- this.removeIconset();
68
- }
69
- addIconset() {
70
- if (!this.name || this.registered) {
71
- return;
72
- }
73
- IconsetRegistry.getInstance().addIconset(this.name, this);
74
- this.registered = true;
75
- }
76
- removeIconset() {
77
- if (!this.name) {
78
- return;
79
- }
80
- IconsetRegistry.getInstance().removeIconset(this.name);
81
- this.registered = false;
82
- }
83
- }
84
- __decorateClass([
85
- property()
86
- ], Iconset.prototype, "name", 1);
87
- //# sourceMappingURL=iconset.dev.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["iconset.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { IconsetRegistry } from './iconset-registry.dev.js'\n\nimport { LitElement } from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nexport abstract class Iconset extends LitElement {\n protected registered = false;\n\n private _name!: string;\n\n protected override firstUpdated(): void {\n // force no display for all iconsets\n this.style.display = 'none';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n 'Iconsets have been deprecated and will be removed from the project in an upcoming version. For default Spectrum Icons, learn more about leveraging UI Icons (https://opensource.adobe.com/spectrum-web-components/components/icons-ui/) or Workflow Icons (https://opensource.adobe.com/spectrum-web-components/components/icons-workflow/) as an alternative.',\n 'https://opensource.adobe.com/spectrum-web-components/components/iconset/#deprecated',\n { level: 'deprecation' }\n );\n }\n }\n\n /**\n * Name of the iconset, used by the IconsetRegistry to serve this icon set\n * to consuming icons.\n */\n @property()\n public set name(value: string) {\n // if we're already registered in the iconset registry\n // we'll need to update our registration\n if (this.registered) {\n if (this._name) {\n // remove from the iconset map using the old name\n IconsetRegistry.getInstance().removeIconset(this._name);\n }\n\n if (value) {\n // set in the map using the new name\n IconsetRegistry.getInstance().addIconset(value, this);\n }\n }\n this._name = value;\n }\n public get name(): string {\n return this._name;\n }\n\n /**\n * Applies an icon to the given element\n */\n public abstract applyIconToElement(\n el: HTMLElement,\n icon: string,\n size: string,\n label: string\n ): void;\n\n /**\n * Returns a list of all icons in this iconset.\n */\n public abstract getIconList(): string[];\n\n private handleRemoved = ({\n detail,\n }: {\n detail: { name: string };\n }): void => {\n if (detail.name === this.name) {\n this.registered = false;\n this.addIconset();\n }\n };\n\n /**\n * On updated we register the iconset if we're not already registered\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n this.addIconset();\n window.addEventListener('sp-iconset-removed', this.handleRemoved);\n }\n /**\n * On disconnected we remove the iconset\n */\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener('sp-iconset-removed', this.handleRemoved);\n this.removeIconset();\n }\n\n private addIconset(): void {\n if (!this.name || this.registered) {\n return;\n }\n IconsetRegistry.getInstance().addIconset(this.name, this);\n this.registered = true;\n }\n\n private removeIconset(): void {\n if (!this.name) {\n return;\n }\n IconsetRegistry.getInstance().removeIconset(this.name);\n this.registered = false;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAWA,SAAS,uBAAuB;AAEhC,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAElB,aAAe,gBAAgB,WAAW;AAAA,EAA1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aAAa;AAAA,EACtB;AACJ;AA9Ee;AAAA,EADV,SAAS;AAAA,GAtBQ,QAuBP;",
6
- "names": []
7
- }
package/src/iconset.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";var d=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var a=(i,n,e,s)=>{for(var t=s>1?void 0:s?m(n,e):n,r=i.length-1,c;r>=0;r--)(c=i[r])&&(t=(s?c(n,e,t):c(t))||t);return s&&t&&d(n,e,t),t};import{IconsetRegistry as o}from"./iconset-registry.js";import{LitElement as p}from"@spectrum-web-components/base";import{property as l}from"@spectrum-web-components/base/src/decorators.js";export class Iconset extends p{constructor(){super(...arguments);this.registered=!1;this.handleRemoved=({detail:e})=>{e.name===this.name&&(this.registered=!1,this.addIconset())}}firstUpdated(){this.style.display="none"}set name(e){this.registered&&(this._name&&o.getInstance().removeIconset(this._name),e&&o.getInstance().addIconset(e,this)),this._name=e}get name(){return this._name}connectedCallback(){super.connectedCallback(),this.addIconset(),window.addEventListener("sp-iconset-removed",this.handleRemoved)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("sp-iconset-removed",this.handleRemoved),this.removeIconset()}addIconset(){!this.name||this.registered||(o.getInstance().addIconset(this.name,this),this.registered=!0)}removeIconset(){this.name&&(o.getInstance().removeIconset(this.name),this.registered=!1)}}a([l()],Iconset.prototype,"name",1);
2
- //# sourceMappingURL=iconset.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["iconset.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { IconsetRegistry } from './iconset-registry.js';\n\nimport { LitElement } from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nexport abstract class Iconset extends LitElement {\n protected registered = false;\n\n private _name!: string;\n\n protected override firstUpdated(): void {\n // force no display for all iconsets\n this.style.display = 'none';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n 'Iconsets have been deprecated and will be removed from the project in an upcoming version. For default Spectrum Icons, learn more about leveraging UI Icons (https://opensource.adobe.com/spectrum-web-components/components/icons-ui/) or Workflow Icons (https://opensource.adobe.com/spectrum-web-components/components/icons-workflow/) as an alternative.',\n 'https://opensource.adobe.com/spectrum-web-components/components/iconset/#deprecated',\n { level: 'deprecation' }\n );\n }\n }\n\n /**\n * Name of the iconset, used by the IconsetRegistry to serve this icon set\n * to consuming icons.\n */\n @property()\n public set name(value: string) {\n // if we're already registered in the iconset registry\n // we'll need to update our registration\n if (this.registered) {\n if (this._name) {\n // remove from the iconset map using the old name\n IconsetRegistry.getInstance().removeIconset(this._name);\n }\n\n if (value) {\n // set in the map using the new name\n IconsetRegistry.getInstance().addIconset(value, this);\n }\n }\n this._name = value;\n }\n public get name(): string {\n return this._name;\n }\n\n /**\n * Applies an icon to the given element\n */\n public abstract applyIconToElement(\n el: HTMLElement,\n icon: string,\n size: string,\n label: string\n ): void;\n\n /**\n * Returns a list of all icons in this iconset.\n */\n public abstract getIconList(): string[];\n\n private handleRemoved = ({\n detail,\n }: {\n detail: { name: string };\n }): void => {\n if (detail.name === this.name) {\n this.registered = false;\n this.addIconset();\n }\n };\n\n /**\n * On updated we register the iconset if we're not already registered\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n this.addIconset();\n window.addEventListener('sp-iconset-removed', this.handleRemoved);\n }\n /**\n * On disconnected we remove the iconset\n */\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener('sp-iconset-removed', this.handleRemoved);\n this.removeIconset();\n }\n\n private addIconset(): void {\n if (!this.name || this.registered) {\n return;\n }\n IconsetRegistry.getInstance().addIconset(this.name, this);\n this.registered = true;\n }\n\n private removeIconset(): void {\n if (!this.name) {\n return;\n }\n IconsetRegistry.getInstance().removeIconset(this.name);\n this.registered = false;\n }\n}\n"],
5
- "mappings": "qNAWA,OAAS,mBAAAA,MAAuB,wBAEhC,OAAS,cAAAC,MAAkB,gCAC3B,OAAS,YAAAC,MAAgB,kDAElB,aAAe,gBAAgBD,CAAW,CAA1C,kCACH,KAAU,WAAa,GAyDvB,KAAQ,cAAgB,CAAC,CACrB,OAAAE,CACJ,IAEY,CACJA,EAAO,OAAS,KAAK,OACrB,KAAK,WAAa,GAClB,KAAK,WAAW,EAExB,EA9DmB,cAAqB,CAEpC,KAAK,MAAM,QAAU,MASzB,CAOA,IAAW,KAAKC,EAAe,CAGvB,KAAK,aACD,KAAK,OAELJ,EAAgB,YAAY,EAAE,cAAc,KAAK,KAAK,EAGtDI,GAEAJ,EAAgB,YAAY,EAAE,WAAWI,EAAO,IAAI,GAG5D,KAAK,MAAQA,CACjB,CACA,IAAW,MAAe,CACtB,OAAO,KAAK,KAChB,CA+BgB,mBAA0B,CACtC,MAAM,kBAAkB,EACxB,KAAK,WAAW,EAChB,OAAO,iBAAiB,qBAAsB,KAAK,aAAa,CACpE,CAIgB,sBAA6B,CACzC,MAAM,qBAAqB,EAC3B,OAAO,oBAAoB,qBAAsB,KAAK,aAAa,EACnE,KAAK,cAAc,CACvB,CAEQ,YAAmB,CACnB,CAAC,KAAK,MAAQ,KAAK,aAGvBJ,EAAgB,YAAY,EAAE,WAAW,KAAK,KAAM,IAAI,EACxD,KAAK,WAAa,GACtB,CAEQ,eAAsB,CACrB,KAAK,OAGVA,EAAgB,YAAY,EAAE,cAAc,KAAK,IAAI,EACrD,KAAK,WAAa,GACtB,CACJ,CA9EeK,EAAA,CADVH,EAAS,GAtBQ,QAuBP",
6
- "names": ["IconsetRegistry", "LitElement", "property", "detail", "value", "__decorateClass"]
7
- }
package/src/index.d.ts DELETED
@@ -1,14 +0,0 @@
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 * from './iconset.js';
13
- export * from './iconset-svg.js';
14
- export * from './iconset-registry.js';
package/src/index.dev.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- export * from "./iconset.dev.js";
3
- export * from "./iconset-svg.dev.js";
4
- export * from "./iconset-registry.dev.js";
5
- //# sourceMappingURL=index.dev.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["index.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport * from './iconset.dev.js'\nexport * from './iconset-svg.dev.js'\nexport * from './iconset-registry.dev.js'\n"],
5
- "mappings": ";AAWA,cAAc;AACd,cAAc;AACd,cAAc;",
6
- "names": []
7
- }
package/src/index.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";export*from"./iconset.js";export*from"./iconset-svg.js";export*from"./iconset-registry.js";
2
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["index.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport * from './iconset.js';\nexport * from './iconset-svg.js';\nexport * from './iconset-registry.js';\n"],
5
- "mappings": "aAWA,WAAc,eACd,WAAc,mBACd,WAAc",
6
- "names": []
7
- }