@spectrum-web-components/shared 0.40.3 → 0.40.4
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 +3 -3
- package/src/like-anchor.dev.js +8 -4
- package/src/like-anchor.dev.js.map +2 -2
- package/src/like-anchor.js +12 -11
- package/src/like-anchor.js.map +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/shared",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
],
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@lit-labs/observers": "^2.0.0",
|
|
100
|
-
"@spectrum-web-components/base": "^0.40.
|
|
100
|
+
"@spectrum-web-components/base": "^0.40.4",
|
|
101
101
|
"focus-visible": "^5.1.0"
|
|
102
102
|
},
|
|
103
103
|
"types": "./src/index.d.ts",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"sideEffects": [
|
|
106
106
|
"./**/*.dev.js"
|
|
107
107
|
],
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "e7bca020d0da71c4d92e95044bf58780d2e8e603"
|
|
109
109
|
}
|
package/src/like-anchor.dev.js
CHANGED
|
@@ -36,24 +36,28 @@ export function LikeAnchor(constructor) {
|
|
|
36
36
|
aria-labelledby=${ifDefined(labelledby)}
|
|
37
37
|
aria-hidden=${ifDefined(ariaHidden ? "true" : void 0)}
|
|
38
38
|
tabindex=${ifDefined(tabindex)}
|
|
39
|
+
referrerpolicy=${ifDefined(this.referrerpolicy)}
|
|
39
40
|
rel=${ifDefined(this.rel)}
|
|
40
41
|
>${anchorContent}</a>`;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
__decorateClass([
|
|
44
|
-
property(
|
|
45
|
+
property()
|
|
45
46
|
], LikeAnchorElement.prototype, "download", 2);
|
|
46
47
|
__decorateClass([
|
|
47
48
|
property()
|
|
48
49
|
], LikeAnchorElement.prototype, "label", 2);
|
|
49
50
|
__decorateClass([
|
|
50
|
-
property(
|
|
51
|
+
property()
|
|
51
52
|
], LikeAnchorElement.prototype, "href", 2);
|
|
52
53
|
__decorateClass([
|
|
53
|
-
property(
|
|
54
|
+
property()
|
|
54
55
|
], LikeAnchorElement.prototype, "target", 2);
|
|
55
56
|
__decorateClass([
|
|
56
|
-
property(
|
|
57
|
+
property()
|
|
58
|
+
], LikeAnchorElement.prototype, "referrerpolicy", 2);
|
|
59
|
+
__decorateClass([
|
|
60
|
+
property()
|
|
57
61
|
], LikeAnchorElement.prototype, "rel", 2);
|
|
58
62
|
return LikeAnchorElement;
|
|
59
63
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["like-anchor.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 {\n html,\n ReactiveElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.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\ntype RenderAnchorOptions = {\n id: string;\n className?: string;\n ariaHidden?: boolean;\n anchorContent?: TemplateResult | TemplateResult[];\n labelledby?: string;\n tabindex?: -1 | 0;\n};\n\nexport interface LikeAnchorInterface {\n download?: string;\n label?: string;\n href?: string;\n rel?: string;\n target?: '_blank' | '_parent' | '_self' | '_top';\n renderAnchor(options: RenderAnchorOptions): TemplateResult;\n}\n\nexport function LikeAnchor<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<LikeAnchorInterface> {\n class LikeAnchorElement extends constructor {\n @property(
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EACI;AAAA,OAGG;AACP,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AA0BnB,gBAAS,WACZ,aACoC;AAAA,EACpC,MAAM,0BAA0B,YAAY;AAAA,
|
|
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 {\n html,\n ReactiveElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.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\ntype RenderAnchorOptions = {\n id: string;\n className?: string;\n ariaHidden?: boolean;\n anchorContent?: TemplateResult | TemplateResult[];\n labelledby?: string;\n tabindex?: -1 | 0;\n};\n\nexport interface LikeAnchorInterface {\n download?: string;\n label?: string;\n href?: string;\n rel?: string;\n target?: '_blank' | '_parent' | '_self' | '_top';\n renderAnchor(options: RenderAnchorOptions): TemplateResult;\n}\n\nexport function LikeAnchor<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<LikeAnchorInterface> {\n class LikeAnchorElement extends constructor {\n /**\n * Causes the browser to treat the linked URL as a download.\n */\n @property()\n public download?: string;\n\n /**\n * An accessible label that describes the component.\n * It will be applied to aria-label, but not visually rendered.\n */\n @property()\n public label?: string;\n\n /**\n * The URL that the hyperlink points to.\n */\n @property()\n public href?: string;\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).\n */\n @property()\n public target?: '_blank' | '_parent' | '_self' | '_top';\n\n /**\n * How much of the referrer to send when following the link.\n */\n @property()\n public referrerpolicy?:\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'same-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @property()\n public rel?: string;\n\n public renderAnchor({\n id,\n className,\n ariaHidden,\n labelledby,\n tabindex,\n // prettier-ignore\n anchorContent = html`<slot></slot>`,\n }: RenderAnchorOptions): TemplateResult {\n // prettier-ignore\n return html\n `<a\n id=${id}\n class=${ifDefined(className)}\n href=${ifDefined(this.href)}\n download=${ifDefined(this.download)}\n target=${ifDefined(this.target)}\n aria-label=${ifDefined(this.label)}\n aria-labelledby=${ifDefined(labelledby)}\n aria-hidden=${ifDefined(ariaHidden ? 'true' : undefined)}\n tabindex=${ifDefined(tabindex)}\n referrerpolicy=${ifDefined(this.referrerpolicy)}\n rel=${ifDefined(this.rel)}\n >${anchorContent}</a>`;\n }\n }\n return LikeAnchorElement;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EACI;AAAA,OAGG;AACP,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AA0BnB,gBAAS,WACZ,aACoC;AAAA,EACpC,MAAM,0BAA0B,YAAY;AAAA,IA8CjC,aAAa;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAEA,gBAAgB;AAAA,IACpB,GAAwC;AAEpC,aAAO;AAAA,yBAEM,EAAE;AAAA,4BACC,UAAU,SAAS,CAAC;AAAA,2BACrB,UAAU,KAAK,IAAI,CAAC;AAAA,+BAChB,UAAU,KAAK,QAAQ,CAAC;AAAA,6BAC1B,UAAU,KAAK,MAAM,CAAC;AAAA,iCAClB,UAAU,KAAK,KAAK,CAAC;AAAA,sCAChB,UAAU,UAAU,CAAC;AAAA,kCACzB,UAAU,aAAa,SAAS,MAAS,CAAC;AAAA,+BAC7C,UAAU,QAAQ,CAAC;AAAA,qCACb,UAAU,KAAK,cAAc,CAAC;AAAA,0BACzC,UAAU,KAAK,GAAG,CAAC;AAAA,mBAC1B,aAAa;AAAA,IACxB;AAAA,EACJ;AAlEW;AAAA,IADN,SAAS;AAAA,KAJR,kBAKK;AAOA;AAAA,IADN,SAAS;AAAA,KAXR,kBAYK;AAMA;AAAA,IADN,SAAS;AAAA,KAjBR,kBAkBK;AAMA;AAAA,IADN,SAAS;AAAA,KAvBR,kBAwBK;AAMA;AAAA,IADN,SAAS;AAAA,KA7BR,kBA8BK;AAcA;AAAA,IADN,SAAS;AAAA,KA3CR,kBA4CK;AA4BX,SAAO;AACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/like-anchor.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var f=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var n=(s,r,p,o)=>{for(var t=o>1?void 0:o?b(r,p):r,a=s.length-1,l;a>=0;a--)(l=s[a])&&(t=(o?l(r,p,t):l(t))||t);return o&&t&&f(r,p,t),t};import{html as c}from"@spectrum-web-components/base";import{property as i}from"@spectrum-web-components/base/src/decorators.js";import{ifDefined as e}from"@spectrum-web-components/base/src/directives.js";export function LikeAnchor(s){class r extends s{renderAnchor({id:t,className:a,ariaHidden:l,labelledby:d,tabindex:g,anchorContent:u=c`<slot></slot>`}){return c`<a
|
|
2
2
|
id=${t}
|
|
3
|
-
class=${
|
|
4
|
-
href=${
|
|
5
|
-
download=${
|
|
6
|
-
target=${
|
|
7
|
-
aria-label=${
|
|
8
|
-
aria-labelledby=${
|
|
9
|
-
aria-hidden=${
|
|
10
|
-
tabindex=${
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
class=${e(a)}
|
|
4
|
+
href=${e(this.href)}
|
|
5
|
+
download=${e(this.download)}
|
|
6
|
+
target=${e(this.target)}
|
|
7
|
+
aria-label=${e(this.label)}
|
|
8
|
+
aria-labelledby=${e(d)}
|
|
9
|
+
aria-hidden=${e(l?"true":void 0)}
|
|
10
|
+
tabindex=${e(g)}
|
|
11
|
+
referrerpolicy=${e(this.referrerpolicy)}
|
|
12
|
+
rel=${e(this.rel)}
|
|
13
|
+
>${u}</a>`}}return n([i()],r.prototype,"download",2),n([i()],r.prototype,"label",2),n([i()],r.prototype,"href",2),n([i()],r.prototype,"target",2),n([i()],r.prototype,"referrerpolicy",2),n([i()],r.prototype,"rel",2),r}
|
|
13
14
|
//# sourceMappingURL=like-anchor.js.map
|
package/src/like-anchor.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["like-anchor.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 {\n html,\n ReactiveElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.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\ntype RenderAnchorOptions = {\n id: string;\n className?: string;\n ariaHidden?: boolean;\n anchorContent?: TemplateResult | TemplateResult[];\n labelledby?: string;\n tabindex?: -1 | 0;\n};\n\nexport interface LikeAnchorInterface {\n download?: string;\n label?: string;\n href?: string;\n rel?: string;\n target?: '_blank' | '_parent' | '_self' | '_top';\n renderAnchor(options: RenderAnchorOptions): TemplateResult;\n}\n\nexport function LikeAnchor<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<LikeAnchorInterface> {\n class LikeAnchorElement extends constructor {\n @property(
|
|
5
|
-
"mappings": "qNAWA,OACI,QAAAA,MAGG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,aAAAC,MAAiB,kDA0BnB,gBAAS,WACZC,EACoC,CACpC,MAAMC,UAA0BD,CAAY,
|
|
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 {\n html,\n ReactiveElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.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\ntype RenderAnchorOptions = {\n id: string;\n className?: string;\n ariaHidden?: boolean;\n anchorContent?: TemplateResult | TemplateResult[];\n labelledby?: string;\n tabindex?: -1 | 0;\n};\n\nexport interface LikeAnchorInterface {\n download?: string;\n label?: string;\n href?: string;\n rel?: string;\n target?: '_blank' | '_parent' | '_self' | '_top';\n renderAnchor(options: RenderAnchorOptions): TemplateResult;\n}\n\nexport function LikeAnchor<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<LikeAnchorInterface> {\n class LikeAnchorElement extends constructor {\n /**\n * Causes the browser to treat the linked URL as a download.\n */\n @property()\n public download?: string;\n\n /**\n * An accessible label that describes the component.\n * It will be applied to aria-label, but not visually rendered.\n */\n @property()\n public label?: string;\n\n /**\n * The URL that the hyperlink points to.\n */\n @property()\n public href?: string;\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).\n */\n @property()\n public target?: '_blank' | '_parent' | '_self' | '_top';\n\n /**\n * How much of the referrer to send when following the link.\n */\n @property()\n public referrerpolicy?:\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'same-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @property()\n public rel?: string;\n\n public renderAnchor({\n id,\n className,\n ariaHidden,\n labelledby,\n tabindex,\n // prettier-ignore\n anchorContent = html`<slot></slot>`,\n }: RenderAnchorOptions): TemplateResult {\n // prettier-ignore\n return html\n `<a\n id=${id}\n class=${ifDefined(className)}\n href=${ifDefined(this.href)}\n download=${ifDefined(this.download)}\n target=${ifDefined(this.target)}\n aria-label=${ifDefined(this.label)}\n aria-labelledby=${ifDefined(labelledby)}\n aria-hidden=${ifDefined(ariaHidden ? 'true' : undefined)}\n tabindex=${ifDefined(tabindex)}\n referrerpolicy=${ifDefined(this.referrerpolicy)}\n rel=${ifDefined(this.rel)}\n >${anchorContent}</a>`;\n }\n }\n return LikeAnchorElement;\n}\n"],
|
|
5
|
+
"mappings": "qNAWA,OACI,QAAAA,MAGG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,aAAAC,MAAiB,kDA0BnB,gBAAS,WACZC,EACoC,CACpC,MAAMC,UAA0BD,CAAY,CA8CjC,aAAa,CAChB,GAAAE,EACA,UAAAC,EACA,WAAAC,EACA,WAAAC,EACA,SAAAC,EAEA,cAAAC,EAAgBV,gBACpB,EAAwC,CAEpC,OAAOA;AAAA,yBAEMK,CAAE;AAAA,4BACCH,EAAUI,CAAS,CAAC;AAAA,2BACrBJ,EAAU,KAAK,IAAI,CAAC;AAAA,+BAChBA,EAAU,KAAK,QAAQ,CAAC;AAAA,6BAC1BA,EAAU,KAAK,MAAM,CAAC;AAAA,iCAClBA,EAAU,KAAK,KAAK,CAAC;AAAA,sCAChBA,EAAUM,CAAU,CAAC;AAAA,kCACzBN,EAAUK,EAAa,OAAS,MAAS,CAAC;AAAA,+BAC7CL,EAAUO,CAAQ,CAAC;AAAA,qCACbP,EAAU,KAAK,cAAc,CAAC;AAAA,0BACzCA,EAAU,KAAK,GAAG,CAAC;AAAA,mBAC1BQ,CAAa,MACxB,CACJ,CAlEW,OAAAC,EAAA,CADNV,EAAS,GAJRG,EAKK,wBAOAO,EAAA,CADNV,EAAS,GAXRG,EAYK,qBAMAO,EAAA,CADNV,EAAS,GAjBRG,EAkBK,oBAMAO,EAAA,CADNV,EAAS,GAvBRG,EAwBK,sBAMAO,EAAA,CADNV,EAAS,GA7BRG,EA8BK,8BAcAO,EAAA,CADNV,EAAS,GA3CRG,EA4CK,mBA4BJA,CACX",
|
|
6
6
|
"names": ["html", "property", "ifDefined", "constructor", "LikeAnchorElement", "id", "className", "ariaHidden", "labelledby", "tabindex", "anchorContent", "__decorateClass"]
|
|
7
7
|
}
|