@spectrum-web-components/iconset 0.6.6 → 0.6.9-devmode.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +24 -6
- package/src/iconset-registry.dev.js +33 -0
- package/src/iconset-registry.dev.js.map +7 -0
- package/src/iconset-registry.js +30 -41
- package/src/iconset-registry.js.map +7 -1
- package/src/iconset-svg.dev.js +108 -0
- package/src/iconset-svg.dev.js.map +7 -0
- package/src/iconset-svg.js +97 -120
- package/src/iconset-svg.js.map +7 -1
- package/src/iconset.dev.js +73 -0
- package/src/iconset.dev.js.map +7 -0
- package/src/iconset.js +66 -80
- package/src/iconset.js.map +7 -1
- package/src/index.dev.js +4 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +4 -14
- package/src/index.js.map +7 -1
- package/stories/icons-demo.js +139 -126
- package/stories/icons-demo.js.map +7 -1
- package/test/iconset.test.js +69 -86
- package/test/iconset.test.js.map +7 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spectrum-web-components/iconset",
|
3
|
-
"version": "0.6.
|
3
|
+
"version": "0.6.9-devmode.24+07474d44f",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -19,9 +19,27 @@
|
|
19
19
|
"main": "./src/index.js",
|
20
20
|
"module": "./src/index.js",
|
21
21
|
"exports": {
|
22
|
-
".":
|
23
|
-
|
24
|
-
|
22
|
+
".": {
|
23
|
+
"development": "./src/index.dev.js",
|
24
|
+
"default": "./src/index.js"
|
25
|
+
},
|
26
|
+
"./package.json": "./package.json",
|
27
|
+
"./src/iconset-registry.js": {
|
28
|
+
"development": "./src/iconset-registry.dev.js",
|
29
|
+
"default": "./src/iconset-registry.js"
|
30
|
+
},
|
31
|
+
"./src/iconset-svg.js": {
|
32
|
+
"development": "./src/iconset-svg.dev.js",
|
33
|
+
"default": "./src/iconset-svg.js"
|
34
|
+
},
|
35
|
+
"./src/iconset.js": {
|
36
|
+
"development": "./src/iconset.dev.js",
|
37
|
+
"default": "./src/iconset.js"
|
38
|
+
},
|
39
|
+
"./src/index.js": {
|
40
|
+
"development": "./src/index.dev.js",
|
41
|
+
"default": "./src/index.js"
|
42
|
+
}
|
25
43
|
},
|
26
44
|
"scripts": {
|
27
45
|
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
|
@@ -41,7 +59,7 @@
|
|
41
59
|
"lit-html"
|
42
60
|
],
|
43
61
|
"dependencies": {
|
44
|
-
"@spectrum-web-components/base": "^0.5.
|
62
|
+
"@spectrum-web-components/base": "^0.5.9-devmode.24+07474d44f",
|
45
63
|
"tslib": "^2.0.0"
|
46
64
|
},
|
47
65
|
"types": "./src/index.d.ts",
|
@@ -50,5 +68,5 @@
|
|
50
68
|
"./src/index.js",
|
51
69
|
"./stories/icons-demo.js"
|
52
70
|
],
|
53
|
-
"gitHead": "
|
71
|
+
"gitHead": "07474d44f6cee1db241b9ccf3dc812514ffbe7fa"
|
54
72
|
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
export class IconsetRegistry {
|
2
|
+
constructor() {
|
3
|
+
this.iconsetMap = /* @__PURE__ */ new Map();
|
4
|
+
}
|
5
|
+
static getInstance() {
|
6
|
+
if (!IconsetRegistry.instance) {
|
7
|
+
IconsetRegistry.instance = new IconsetRegistry();
|
8
|
+
}
|
9
|
+
return IconsetRegistry.instance;
|
10
|
+
}
|
11
|
+
addIconset(name, iconset) {
|
12
|
+
this.iconsetMap.set(name, iconset);
|
13
|
+
const event = new CustomEvent("sp-iconset-added", {
|
14
|
+
bubbles: true,
|
15
|
+
composed: true,
|
16
|
+
detail: { name, iconset }
|
17
|
+
});
|
18
|
+
setTimeout(() => window.dispatchEvent(event), 0);
|
19
|
+
}
|
20
|
+
removeIconset(name) {
|
21
|
+
this.iconsetMap.delete(name);
|
22
|
+
const event = new CustomEvent("sp-iconset-removed", {
|
23
|
+
bubbles: true,
|
24
|
+
composed: true,
|
25
|
+
detail: { name }
|
26
|
+
});
|
27
|
+
setTimeout(() => window.dispatchEvent(event), 0);
|
28
|
+
}
|
29
|
+
getIconset(name) {
|
30
|
+
return this.iconsetMap.get(name);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
//# sourceMappingURL=iconset-registry.dev.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["iconset-registry.ts"],
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Iconset } from './iconset.dev.js'\nexport interface IconsetAddedDetail {\n name: string;\n iconset: Iconset;\n}\nexport interface IconsetRemovedDetail {\n name: string;\n}\n\nexport class IconsetRegistry {\n // singleton getter\n public static getInstance(): IconsetRegistry {\n if (!IconsetRegistry.instance) {\n IconsetRegistry.instance = new IconsetRegistry();\n }\n return IconsetRegistry.instance;\n }\n private static instance: IconsetRegistry;\n\n private iconsetMap = new Map<string, Iconset>();\n\n public addIconset(name: string, iconset: Iconset): void {\n this.iconsetMap.set(name, iconset);\n\n // dispatch a sp-iconset-added event on window to let everyone know we have a new iconset\n // note we're using window here for efficiency since we don't need to bubble through the dom since everyone\n // will know where to look for this event\n const event = new CustomEvent('sp-iconset-added', {\n bubbles: true,\n composed: true,\n detail: { name, iconset },\n });\n // we're dispatching this event in the next tick to allow the iconset to finish any slotchange or other event\n // listeners caused by connection to the dom and first render to complete, this way any icons listening for\n // this iconset will be able to access the completed iconset\n setTimeout(() => window.dispatchEvent(event), 0);\n }\n public removeIconset(name: string): void {\n this.iconsetMap.delete(name);\n // dispatch a sp-iconset-removed event on window to let everyone know we have a new iconset\n // note we're using window here for efficiency since we don't need to bubble through the dom since everyone\n // will know where to look for this event\n const event = new CustomEvent('sp-iconset-removed', {\n bubbles: true,\n composed: true,\n detail: { name },\n });\n // we're dispatching this event in the next tick To keep the event model consistent with the added event\n setTimeout(() => window.dispatchEvent(event), 0);\n }\n public getIconset(name: string): Iconset | undefined {\n return this.iconsetMap.get(name);\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-iconset-added': CustomEvent<IconsetAddedDetail>;\n 'sp-iconset-removed': CustomEvent<IconsetRemovedDetail>;\n }\n}\n"],
|
5
|
+
"mappings": "AAoBO,aAAM,gBAAgB;AAAA,EAAtB;AAUK,sBAAa,oBAAI,IAAqB;AAAA;AAAA,SARhC,cAA+B;AACzC,QAAI,CAAC,gBAAgB,UAAU;AAC3B,sBAAgB,WAAW,IAAI,gBAAgB;AAAA,IACnD;AACA,WAAO,gBAAgB;AAAA,EAC3B;AAAA,EAKO,WAAW,MAAc,SAAwB;AACpD,SAAK,WAAW,IAAI,MAAM,OAAO;AAKjC,UAAM,QAAQ,IAAI,YAAY,oBAAoB;AAAA,MAC9C,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ,EAAE,MAAM,QAAQ;AAAA,IAC5B,CAAC;AAID,eAAW,MAAM,OAAO,cAAc,KAAK,GAAG,CAAC;AAAA,EACnD;AAAA,EACO,cAAc,MAAoB;AACrC,SAAK,WAAW,OAAO,IAAI;AAI3B,UAAM,QAAQ,IAAI,YAAY,sBAAsB;AAAA,MAChD,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ,EAAE,KAAK;AAAA,IACnB,CAAC;AAED,eAAW,MAAM,OAAO,cAAc,KAAK,GAAG,CAAC;AAAA,EACnD;AAAA,EACO,WAAW,MAAmC;AACjD,WAAO,KAAK,WAAW,IAAI,IAAI;AAAA,EACnC;AACJ;",
|
6
|
+
"names": []
|
7
|
+
}
|
package/src/iconset-registry.js
CHANGED
@@ -1,44 +1,33 @@
|
|
1
1
|
export class IconsetRegistry {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
IconsetRegistry.instance = new IconsetRegistry();
|
9
|
-
}
|
10
|
-
return IconsetRegistry.instance;
|
11
|
-
}
|
12
|
-
addIconset(name, iconset) {
|
13
|
-
this.iconsetMap.set(name, iconset);
|
14
|
-
// dispatch a sp-iconset-added event on window to let everyone know we have a new iconset
|
15
|
-
// note we're using window here for efficiency since we don't need to bubble through the dom since everyone
|
16
|
-
// will know where to look for this event
|
17
|
-
const event = new CustomEvent('sp-iconset-added', {
|
18
|
-
bubbles: true,
|
19
|
-
composed: true,
|
20
|
-
detail: { name, iconset },
|
21
|
-
});
|
22
|
-
// we're dispatching this event in the next tick to allow the iconset to finish any slotchange or other event
|
23
|
-
// listeners caused by connection to the dom and first render to complete, this way any icons listening for
|
24
|
-
// this iconset will be able to access the completed iconset
|
25
|
-
setTimeout(() => window.dispatchEvent(event), 0);
|
26
|
-
}
|
27
|
-
removeIconset(name) {
|
28
|
-
this.iconsetMap.delete(name);
|
29
|
-
// dispatch a sp-iconset-removed event on window to let everyone know we have a new iconset
|
30
|
-
// note we're using window here for efficiency since we don't need to bubble through the dom since everyone
|
31
|
-
// will know where to look for this event
|
32
|
-
const event = new CustomEvent('sp-iconset-removed', {
|
33
|
-
bubbles: true,
|
34
|
-
composed: true,
|
35
|
-
detail: { name },
|
36
|
-
});
|
37
|
-
// we're dispatching this event in the next tick To keep the event model consistent with the added event
|
38
|
-
setTimeout(() => window.dispatchEvent(event), 0);
|
39
|
-
}
|
40
|
-
getIconset(name) {
|
41
|
-
return this.iconsetMap.get(name);
|
2
|
+
constructor() {
|
3
|
+
this.iconsetMap = /* @__PURE__ */ new Map();
|
4
|
+
}
|
5
|
+
static getInstance() {
|
6
|
+
if (!IconsetRegistry.instance) {
|
7
|
+
IconsetRegistry.instance = new IconsetRegistry();
|
42
8
|
}
|
9
|
+
return IconsetRegistry.instance;
|
10
|
+
}
|
11
|
+
addIconset(name, iconset) {
|
12
|
+
this.iconsetMap.set(name, iconset);
|
13
|
+
const event = new CustomEvent("sp-iconset-added", {
|
14
|
+
bubbles: true,
|
15
|
+
composed: true,
|
16
|
+
detail: { name, iconset }
|
17
|
+
});
|
18
|
+
setTimeout(() => window.dispatchEvent(event), 0);
|
19
|
+
}
|
20
|
+
removeIconset(name) {
|
21
|
+
this.iconsetMap.delete(name);
|
22
|
+
const event = new CustomEvent("sp-iconset-removed", {
|
23
|
+
bubbles: true,
|
24
|
+
composed: true,
|
25
|
+
detail: { name }
|
26
|
+
});
|
27
|
+
setTimeout(() => window.dispatchEvent(event), 0);
|
28
|
+
}
|
29
|
+
getIconset(name) {
|
30
|
+
return this.iconsetMap.get(name);
|
31
|
+
}
|
43
32
|
}
|
44
|
-
//# sourceMappingURL=iconset-registry.js.map
|
33
|
+
//# sourceMappingURL=iconset-registry.js.map
|
@@ -1 +1,7 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["iconset-registry.ts"],
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Iconset } from './iconset.js';\nexport interface IconsetAddedDetail {\n name: string;\n iconset: Iconset;\n}\nexport interface IconsetRemovedDetail {\n name: string;\n}\n\nexport class IconsetRegistry {\n // singleton getter\n public static getInstance(): IconsetRegistry {\n if (!IconsetRegistry.instance) {\n IconsetRegistry.instance = new IconsetRegistry();\n }\n return IconsetRegistry.instance;\n }\n private static instance: IconsetRegistry;\n\n private iconsetMap = new Map<string, Iconset>();\n\n public addIconset(name: string, iconset: Iconset): void {\n this.iconsetMap.set(name, iconset);\n\n // dispatch a sp-iconset-added event on window to let everyone know we have a new iconset\n // note we're using window here for efficiency since we don't need to bubble through the dom since everyone\n // will know where to look for this event\n const event = new CustomEvent('sp-iconset-added', {\n bubbles: true,\n composed: true,\n detail: { name, iconset },\n });\n // we're dispatching this event in the next tick to allow the iconset to finish any slotchange or other event\n // listeners caused by connection to the dom and first render to complete, this way any icons listening for\n // this iconset will be able to access the completed iconset\n setTimeout(() => window.dispatchEvent(event), 0);\n }\n public removeIconset(name: string): void {\n this.iconsetMap.delete(name);\n // dispatch a sp-iconset-removed event on window to let everyone know we have a new iconset\n // note we're using window here for efficiency since we don't need to bubble through the dom since everyone\n // will know where to look for this event\n const event = new CustomEvent('sp-iconset-removed', {\n bubbles: true,\n composed: true,\n detail: { name },\n });\n // we're dispatching this event in the next tick To keep the event model consistent with the added event\n setTimeout(() => window.dispatchEvent(event), 0);\n }\n public getIconset(name: string): Iconset | undefined {\n return this.iconsetMap.get(name);\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-iconset-added': CustomEvent<IconsetAddedDetail>;\n 'sp-iconset-removed': CustomEvent<IconsetRemovedDetail>;\n }\n}\n"],
|
5
|
+
"mappings": "AAoBO,aAAM,gBAAgB;AAAA,EAAtB;AAUK,sBAAa,oBAAI,IAAqB;AAAA;AAAA,SARhC,cAA+B;AACzC,QAAI,CAAC,gBAAgB,UAAU;AAC3B,sBAAgB,WAAW,IAAI,gBAAgB;AAAA,IACnD;AACA,WAAO,gBAAgB;AAAA,EAC3B;AAAA,EAKO,WAAW,MAAc,SAAwB;AACpD,SAAK,WAAW,IAAI,MAAM,OAAO;AAKjC,UAAM,QAAQ,IAAI,YAAY,oBAAoB;AAAA,MAC9C,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ,EAAE,MAAM,QAAQ;AAAA,IAC5B,CAAC;AAID,eAAW,MAAM,OAAO,cAAc,KAAK,GAAG,CAAC;AAAA,EACnD;AAAA,EACO,cAAc,MAAoB;AACrC,SAAK,WAAW,OAAO,IAAI;AAI3B,UAAM,QAAQ,IAAI,YAAY,sBAAsB;AAAA,MAChD,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ,EAAE,KAAK;AAAA,IACnB,CAAC;AAED,eAAW,MAAM,OAAO,cAAc,KAAK,GAAG,CAAC;AAAA,EACnD;AAAA,EACO,WAAW,MAAmC;AACjD,WAAO,KAAK,WAAW,IAAI,IAAI;AAAA,EACnC;AACJ;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
6
|
+
if (decorator = decorators[i])
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
8
|
+
if (kind && result)
|
9
|
+
__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
|
+
updated(changedProperties) {
|
23
|
+
if (!this.slotContainer) {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
const currentSVGNodes = this.getSVGNodes(this.slotContainer);
|
27
|
+
this.updateSVG(currentSVGNodes);
|
28
|
+
super.updated(changedProperties);
|
29
|
+
}
|
30
|
+
async applyIconToElement(el, icon, _size, label) {
|
31
|
+
await this.updateComplete;
|
32
|
+
const iconSymbol = this.iconMap.get(icon);
|
33
|
+
if (!iconSymbol) {
|
34
|
+
throw new Error(`Unable to find icon ${icon}`);
|
35
|
+
}
|
36
|
+
const clonedNode = this.prepareSvgClone(iconSymbol);
|
37
|
+
clonedNode.setAttribute("role", "img");
|
38
|
+
if (label) {
|
39
|
+
clonedNode.setAttribute("aria-label", label);
|
40
|
+
} else {
|
41
|
+
clonedNode.setAttribute("aria-hidden", "true");
|
42
|
+
}
|
43
|
+
if (el.shadowRoot) {
|
44
|
+
el.shadowRoot.appendChild(clonedNode);
|
45
|
+
} else {
|
46
|
+
el.appendChild(clonedNode);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
getIconList() {
|
50
|
+
return [...this.iconMap.keys()];
|
51
|
+
}
|
52
|
+
prepareSvgClone(sourceSvg) {
|
53
|
+
const content = sourceSvg.cloneNode(true);
|
54
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
55
|
+
const viewBox = content.getAttribute("viewBox") || "";
|
56
|
+
const cssText = "pointer-events: none; display: block; width: 100%; height: 100%;";
|
57
|
+
svg.style.cssText = cssText;
|
58
|
+
svg.setAttribute("viewBox", viewBox);
|
59
|
+
svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
|
60
|
+
svg.setAttribute("focusable", "false");
|
61
|
+
while (content.childNodes.length > 0) {
|
62
|
+
svg.appendChild(content.childNodes[0]);
|
63
|
+
}
|
64
|
+
return svg;
|
65
|
+
}
|
66
|
+
getSVGIconName(icon) {
|
67
|
+
return icon;
|
68
|
+
}
|
69
|
+
getSanitizedIconName(icon) {
|
70
|
+
return icon;
|
71
|
+
}
|
72
|
+
renderDefaultContent() {
|
73
|
+
return html``;
|
74
|
+
}
|
75
|
+
render() {
|
76
|
+
return html`
|
77
|
+
<slot @slotchange=${this.onSlotChange}>
|
78
|
+
${this.renderDefaultContent()}
|
79
|
+
</slot>
|
80
|
+
`;
|
81
|
+
}
|
82
|
+
updateSVG(nodes) {
|
83
|
+
const symbols = nodes.reduce((prev, svgNode) => {
|
84
|
+
const containedSymbols = svgNode.querySelectorAll("symbol");
|
85
|
+
prev.push(...containedSymbols);
|
86
|
+
return prev;
|
87
|
+
}, []);
|
88
|
+
symbols.forEach((symbol) => {
|
89
|
+
this.iconMap.set(this.getSanitizedIconName(symbol.id), symbol);
|
90
|
+
});
|
91
|
+
}
|
92
|
+
getSVGNodes(slotTarget) {
|
93
|
+
const nodes = slotTarget.assignedNodes({ flatten: true });
|
94
|
+
const svgNodes = nodes.filter((node) => {
|
95
|
+
return node.nodeName === "svg";
|
96
|
+
});
|
97
|
+
return svgNodes;
|
98
|
+
}
|
99
|
+
onSlotChange(event) {
|
100
|
+
const slotTarget = event.target;
|
101
|
+
const svgNodes = this.getSVGNodes(slotTarget);
|
102
|
+
this.updateSVG(svgNodes);
|
103
|
+
}
|
104
|
+
}
|
105
|
+
__decorateClass([
|
106
|
+
query("slot")
|
107
|
+
], IconsetSVG.prototype, "slotContainer", 2);
|
108
|
+
//# sourceMappingURL=iconset-svg.dev.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["iconset-svg.ts"],
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning 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 svgNodes = this.getSVGNodes(slotTarget);\n this.updateSVG(svgNodes);\n }\n}\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAKA;AAEA;AAEO,aAAe,mBAAmB,QAAQ;AAAA,EAA1C;AAAA;AACK,mBAAyC,oBAAI,IAAI;AAAA;AAAA,EAQzC,QAAQ,mBAAyC;AAC7D,QAAI,CAAC,KAAK,eAAe;AACrB;AAAA,IACJ;AACA,UAAM,kBAAkB,KAAK,YAAY,KAAK,aAAa;AAC3D,SAAK,UAAU,eAAe;AAC9B,UAAM,QAAQ,iBAAiB;AAAA,EACnC;AAAA,QAOa,mBACT,IACA,MACA,OACA,OACa;AACb,UAAM,KAAK;AACX,UAAM,aAAa,KAAK,QAAQ,IAAI,IAAI;AACxC,QAAI,CAAC,YAAY;AACb,YAAM,IAAI,MAAM,uBAAuB,MAAM;AAAA,IACjD;AAGA,UAAM,aAAa,KAAK,gBAAgB,UAAU;AAClD,eAAW,aAAa,QAAQ,KAAK;AACrC,QAAI,OAAO;AACP,iBAAW,aAAa,cAAc,KAAK;AAAA,IAC/C,OAAO;AACH,iBAAW,aAAa,eAAe,MAAM;AAAA,IACjD;AAEA,QAAI,GAAG,YAAY;AACf,SAAG,WAAW,YAAY,UAAU;AAAA,IACxC,OAAO;AACH,SAAG,YAAY,UAAU;AAAA,IAC7B;AAAA,EACJ;AAAA,EAKO,cAAwB;AAC3B,WAAO,CAAC,GAAG,KAAK,QAAQ,KAAK,CAAC;AAAA,EAClC;AAAA,EAEU,gBAAgB,WAA4C;AAClE,UAAM,UAAU,UAAU,UAAU,IAAI;AAExC,UAAM,MAAM,SAAS,gBACjB,8BACA,KACJ;AACA,UAAM,UAAU,QAAQ,aAAa,SAAS,KAAK;AAGnD,UAAM,UACF;AACJ,QAAI,MAAM,UAAU;AAEpB,QAAI,aAAa,WAAW,OAAO;AACnC,QAAI,aAAa,uBAAuB,eAAe;AACvD,QAAI,aAAa,aAAa,OAAO;AAErC,WAAO,QAAQ,WAAW,SAAS,GAAG;AAClC,UAAI,YAAY,QAAQ,WAAW,EAAE;AAAA,IACzC;AACA,WAAO;AAAA,EACX;AAAA,EACU,eAAe,MAAsB;AAC3C,WAAO;AAAA,EACX;AAAA,EACU,qBAAqB,MAAsB;AACjD,WAAO;AAAA,EACX;AAAA,EACU,uBAAuC;AAC7C,WAAO;AAAA,EACX;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA,gCACiB,KAAK;AAAA,kBACnB,KAAK,qBAAqB;AAAA;AAAA;AAAA,EAGxC;AAAA,EAEU,UAAU,OAA2B;AAE3C,UAAM,UAAU,MAAM,OAAO,CAAC,MAAM,YAAY;AAC5C,YAAM,mBAAmB,QAAQ,iBAAiB,QAAQ;AAC1D,WAAK,KAAK,GAAG,gBAAgB;AAC7B,aAAO;AAAA,IACX,GAAG,CAAC,CAAuB;AAC3B,YAAQ,QAAQ,CAAC,WAAW;AACxB,WAAK,QAAQ,IAAI,KAAK,qBAAqB,OAAO,EAAE,GAAG,MAAM;AAAA,IACjE,CAAC;AAAA,EACL;AAAA,EAEU,YAAY,YAA2C;AAC7D,UAAM,QAAQ,WAAW,cAAc,EAAE,SAAS,KAAK,CAAC;AAExD,UAAM,WAAW,MAAM,OAAO,CAAC,SAAS;AACpC,aAAO,KAAK,aAAa;AAAA,IAC7B,CAAC;AACD,WAAO;AAAA,EACX;AAAA,EAEQ,aAAa,OAAoB;AACrC,UAAM,aAAa,MAAM;AACzB,UAAM,WAAW,KAAK,YAAY,UAAU;AAC5C,SAAK,UAAU,QAAQ;AAAA,EAC3B;AACJ;AAzHY;AAAA,EADR,AAAC,MAAM,MAAM;AAAA,GACL,AAJL,WAIK;",
|
6
|
+
"names": []
|
7
|
+
}
|
package/src/iconset-svg.js
CHANGED
@@ -1,131 +1,108 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
import {
|
13
|
-
|
14
|
-
|
15
|
-
import {
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
6
|
+
if (decorator = decorators[i])
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
8
|
+
if (kind && result)
|
9
|
+
__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.js";
|
16
17
|
export class IconsetSVG extends Iconset {
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
constructor() {
|
19
|
+
super(...arguments);
|
20
|
+
this.iconMap = /* @__PURE__ */ new Map();
|
21
|
+
}
|
22
|
+
updated(changedProperties) {
|
23
|
+
if (!this.slotContainer) {
|
24
|
+
return;
|
20
25
|
}
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
super.updated(changedProperties);
|
26
|
+
const currentSVGNodes = this.getSVGNodes(this.slotContainer);
|
27
|
+
this.updateSVG(currentSVGNodes);
|
28
|
+
super.updated(changedProperties);
|
29
|
+
}
|
30
|
+
async applyIconToElement(el, icon, _size, label) {
|
31
|
+
await this.updateComplete;
|
32
|
+
const iconSymbol = this.iconMap.get(icon);
|
33
|
+
if (!iconSymbol) {
|
34
|
+
throw new Error(`Unable to find icon ${icon}`);
|
31
35
|
}
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
async applyIconToElement(el, icon, _size, label) {
|
39
|
-
await this.updateComplete;
|
40
|
-
const iconSymbol = this.iconMap.get(icon);
|
41
|
-
if (!iconSymbol) {
|
42
|
-
throw new Error(`Unable to find icon ${icon}`);
|
43
|
-
}
|
44
|
-
// we cannot share a single SVG globally across shadowroot boundaries
|
45
|
-
// so copy the template node so we can inject it where we need it
|
46
|
-
const clonedNode = this.prepareSvgClone(iconSymbol);
|
47
|
-
clonedNode.setAttribute('role', 'img');
|
48
|
-
if (label) {
|
49
|
-
clonedNode.setAttribute('aria-label', label);
|
50
|
-
}
|
51
|
-
else {
|
52
|
-
clonedNode.setAttribute('aria-hidden', 'true');
|
53
|
-
}
|
54
|
-
// append the svg to the node either in its shadowroot or directly into its dom
|
55
|
-
if (el.shadowRoot) {
|
56
|
-
el.shadowRoot.appendChild(clonedNode);
|
57
|
-
}
|
58
|
-
else {
|
59
|
-
el.appendChild(clonedNode);
|
60
|
-
}
|
36
|
+
const clonedNode = this.prepareSvgClone(iconSymbol);
|
37
|
+
clonedNode.setAttribute("role", "img");
|
38
|
+
if (label) {
|
39
|
+
clonedNode.setAttribute("aria-label", label);
|
40
|
+
} else {
|
41
|
+
clonedNode.setAttribute("aria-hidden", "true");
|
61
42
|
}
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
return [...this.iconMap.keys()];
|
43
|
+
if (el.shadowRoot) {
|
44
|
+
el.shadowRoot.appendChild(clonedNode);
|
45
|
+
} else {
|
46
|
+
el.appendChild(clonedNode);
|
67
47
|
}
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
svg.appendChild(content.childNodes[0]);
|
84
|
-
}
|
85
|
-
return svg;
|
48
|
+
}
|
49
|
+
getIconList() {
|
50
|
+
return [...this.iconMap.keys()];
|
51
|
+
}
|
52
|
+
prepareSvgClone(sourceSvg) {
|
53
|
+
const content = sourceSvg.cloneNode(true);
|
54
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
55
|
+
const viewBox = content.getAttribute("viewBox") || "";
|
56
|
+
const cssText = "pointer-events: none; display: block; width: 100%; height: 100%;";
|
57
|
+
svg.style.cssText = cssText;
|
58
|
+
svg.setAttribute("viewBox", viewBox);
|
59
|
+
svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
|
60
|
+
svg.setAttribute("focusable", "false");
|
61
|
+
while (content.childNodes.length > 0) {
|
62
|
+
svg.appendChild(content.childNodes[0]);
|
86
63
|
}
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
64
|
+
return svg;
|
65
|
+
}
|
66
|
+
getSVGIconName(icon) {
|
67
|
+
return icon;
|
68
|
+
}
|
69
|
+
getSanitizedIconName(icon) {
|
70
|
+
return icon;
|
71
|
+
}
|
72
|
+
renderDefaultContent() {
|
73
|
+
return html``;
|
74
|
+
}
|
75
|
+
render() {
|
76
|
+
return html`
|
98
77
|
<slot @slotchange=${this.onSlotChange}>
|
99
78
|
${this.renderDefaultContent()}
|
100
79
|
</slot>
|
101
80
|
`;
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
this.updateSVG(svgNodes);
|
126
|
-
}
|
81
|
+
}
|
82
|
+
updateSVG(nodes) {
|
83
|
+
const symbols = nodes.reduce((prev, svgNode) => {
|
84
|
+
const containedSymbols = svgNode.querySelectorAll("symbol");
|
85
|
+
prev.push(...containedSymbols);
|
86
|
+
return prev;
|
87
|
+
}, []);
|
88
|
+
symbols.forEach((symbol) => {
|
89
|
+
this.iconMap.set(this.getSanitizedIconName(symbol.id), symbol);
|
90
|
+
});
|
91
|
+
}
|
92
|
+
getSVGNodes(slotTarget) {
|
93
|
+
const nodes = slotTarget.assignedNodes({ flatten: true });
|
94
|
+
const svgNodes = nodes.filter((node) => {
|
95
|
+
return node.nodeName === "svg";
|
96
|
+
});
|
97
|
+
return svgNodes;
|
98
|
+
}
|
99
|
+
onSlotChange(event) {
|
100
|
+
const slotTarget = event.target;
|
101
|
+
const svgNodes = this.getSVGNodes(slotTarget);
|
102
|
+
this.updateSVG(svgNodes);
|
103
|
+
}
|
127
104
|
}
|
128
|
-
|
129
|
-
|
130
|
-
], IconsetSVG.prototype, "slotContainer",
|
131
|
-
//# sourceMappingURL=iconset-svg.js.map
|
105
|
+
__decorateClass([
|
106
|
+
query("slot")
|
107
|
+
], IconsetSVG.prototype, "slotContainer", 2);
|
108
|
+
//# sourceMappingURL=iconset-svg.js.map
|
package/src/iconset-svg.js.map
CHANGED
@@ -1 +1,7 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["iconset-svg.ts"],
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning 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 HTMLSlotElement;\n const svgNodes = this.getSVGNodes(slotTarget);\n this.updateSVG(svgNodes);\n }\n}\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAKA;AAEA;AAEO,aAAe,mBAAmB,QAAQ;AAAA,EAA1C;AAAA;AACK,mBAAyC,oBAAI,IAAI;AAAA;AAAA,EAQzC,QAAQ,mBAAyC;AAC7D,QAAI,CAAC,KAAK,eAAe;AACrB;AAAA,IACJ;AACA,UAAM,kBAAkB,KAAK,YAAY,KAAK,aAAa;AAC3D,SAAK,UAAU,eAAe;AAC9B,UAAM,QAAQ,iBAAiB;AAAA,EACnC;AAAA,QAOa,mBACT,IACA,MACA,OACA,OACa;AACb,UAAM,KAAK;AACX,UAAM,aAAa,KAAK,QAAQ,IAAI,IAAI;AACxC,QAAI,CAAC,YAAY;AACb,YAAM,IAAI,MAAM,uBAAuB,MAAM;AAAA,IACjD;AAGA,UAAM,aAAa,KAAK,gBAAgB,UAAU;AAClD,eAAW,aAAa,QAAQ,KAAK;AACrC,QAAI,OAAO;AACP,iBAAW,aAAa,cAAc,KAAK;AAAA,IAC/C,OAAO;AACH,iBAAW,aAAa,eAAe,MAAM;AAAA,IACjD;AAEA,QAAI,GAAG,YAAY;AACf,SAAG,WAAW,YAAY,UAAU;AAAA,IACxC,OAAO;AACH,SAAG,YAAY,UAAU;AAAA,IAC7B;AAAA,EACJ;AAAA,EAKO,cAAwB;AAC3B,WAAO,CAAC,GAAG,KAAK,QAAQ,KAAK,CAAC;AAAA,EAClC;AAAA,EAEU,gBAAgB,WAA4C;AAClE,UAAM,UAAU,UAAU,UAAU,IAAI;AAExC,UAAM,MAAM,SAAS,gBACjB,8BACA,KACJ;AACA,UAAM,UAAU,QAAQ,aAAa,SAAS,KAAK;AAGnD,UAAM,UACF;AACJ,QAAI,MAAM,UAAU;AAEpB,QAAI,aAAa,WAAW,OAAO;AACnC,QAAI,aAAa,uBAAuB,eAAe;AACvD,QAAI,aAAa,aAAa,OAAO;AAErC,WAAO,QAAQ,WAAW,SAAS,GAAG;AAClC,UAAI,YAAY,QAAQ,WAAW,EAAE;AAAA,IACzC;AACA,WAAO;AAAA,EACX;AAAA,EACU,eAAe,MAAsB;AAC3C,WAAO;AAAA,EACX;AAAA,EACU,qBAAqB,MAAsB;AACjD,WAAO;AAAA,EACX;AAAA,EACU,uBAAuC;AAC7C,WAAO;AAAA,EACX;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA,gCACiB,KAAK;AAAA,kBACnB,KAAK,qBAAqB;AAAA;AAAA;AAAA,EAGxC;AAAA,EAEU,UAAU,OAA2B;AAE3C,UAAM,UAAU,MAAM,OAAO,CAAC,MAAM,YAAY;AAC5C,YAAM,mBAAmB,QAAQ,iBAAiB,QAAQ;AAC1D,WAAK,KAAK,GAAG,gBAAgB;AAC7B,aAAO;AAAA,IACX,GAAG,CAAC,CAAuB;AAC3B,YAAQ,QAAQ,CAAC,WAAW;AACxB,WAAK,QAAQ,IAAI,KAAK,qBAAqB,OAAO,EAAE,GAAG,MAAM;AAAA,IACjE,CAAC;AAAA,EACL;AAAA,EAEU,YAAY,YAA2C;AAC7D,UAAM,QAAQ,WAAW,cAAc,EAAE,SAAS,KAAK,CAAC;AAExD,UAAM,WAAW,MAAM,OAAO,CAAC,SAAS;AACpC,aAAO,KAAK,aAAa;AAAA,IAC7B,CAAC;AACD,WAAO;AAAA,EACX;AAAA,EAEQ,aAAa,OAAoB;AACrC,UAAM,aAAa,MAAM;AACzB,UAAM,WAAW,KAAK,YAAY,UAAU;AAC5C,SAAK,UAAU,QAAQ;AAAA,EAC3B;AACJ;AAzHY;AAAA,EADR,AAAC,MAAM,MAAM;AAAA,GACL,AAJL,WAIK;",
|
6
|
+
"names": []
|
7
|
+
}
|