@spectrum-web-components/asset 0.7.0-devmode.0 → 0.7.0
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/sp-asset.js +1 -2
- package/sp-asset.js.map +1 -1
- package/src/Asset.js +6 -47
- package/src/Asset.js.map +1 -1
- package/src/asset.css.js +2 -4
- package/src/asset.css.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/spectrum-asset.css.js +2 -4
- package/src/spectrum-asset.css.js.map +1 -1
- package/stories/asset.stories.js +4 -19
- package/stories/asset.stories.js.map +1 -1
- package/test/asset.test-vrt.js +1 -3
- package/test/asset.test-vrt.js.map +1 -1
- package/test/asset.test.js +1 -21
- package/test/asset.test.js.map +1 -1
- package/test/benchmark/basic-test.js +1 -4
- package/test/benchmark/basic-test.js.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spectrum-web-components/asset",
|
3
|
-
"version": "0.7.0
|
3
|
+
"version": "0.7.0",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"lit-html"
|
58
58
|
],
|
59
59
|
"dependencies": {
|
60
|
-
"@spectrum-web-components/base": "^0.
|
60
|
+
"@spectrum-web-components/base": "^0.7.0",
|
61
61
|
"tslib": "^2.0.0"
|
62
62
|
},
|
63
63
|
"devDependencies": {
|
@@ -69,5 +69,5 @@
|
|
69
69
|
"./sp-*.js",
|
70
70
|
"./**/*.dev.js"
|
71
71
|
],
|
72
|
-
"gitHead": "
|
72
|
+
"gitHead": "05c81318844160db3f8156144106e643507fef97"
|
73
73
|
}
|
package/sp-asset.js
CHANGED
package/sp-asset.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["sp-asset.ts"],
|
4
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 { Asset } from './src/Asset.js';\n\ncustomElements.define('sp-asset', Asset);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-asset': Asset;\n }\n}\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,uCAEA,eAAe,OAAO,WAAY,CAAK",
|
6
6
|
"names": []
|
7
7
|
}
|
package/src/Asset.js
CHANGED
@@ -1,26 +1,9 @@
|
|
1
|
-
var
|
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
|
-
SpectrumElement
|
15
|
-
} from "@spectrum-web-components/base";
|
16
|
-
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
17
|
-
import styles from "./asset.css.js";
|
18
|
-
const file = (label) => html`
|
1
|
+
var n=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var i=(e,t,c,r)=>{for(var l=r>1?void 0:r?d(t,c):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(l=(r?s(t,c,l):s(l))||l);return r&&l&&n(t,c,l),l};import{html as o,SpectrumElement as h}from"@spectrum-web-components/base";import{property as p}from"@spectrum-web-components/base/src/decorators.js";import u from"./asset.css.js";const f=e=>o`
|
19
2
|
<svg
|
20
3
|
class="file"
|
21
4
|
role="img"
|
22
5
|
viewBox="0 0 128 128"
|
23
|
-
aria-label=${
|
6
|
+
aria-label=${e||"File"}
|
24
7
|
>
|
25
8
|
<path
|
26
9
|
class="fileBackground"
|
@@ -31,13 +14,12 @@ const file = (label) => html`
|
|
31
14
|
d="M113.1,23.3L92.6,2.9C90.7,1,88.2,0,85.5,0H24c-6.6,0-12,5.4-12,12v104c0,6.6,5.4,12,12,12h80c6.6,0,12-5.4,12-12V30.4C116,27.8,114.9,25.2,113.1,23.3z M90,6l20.1,20H92c-1.1,0-2-0.9-2-2V6z M112,116c0,4.4-3.6,8-8,8H24c-4.4,0-8-3.6-8-8V12c0-4.4,3.6-8,8-8h61.5c0.2,0,0.3,0,0.5,0v20c0,3.3,2.7,6,6,6h20c0,0.1,0,0.3,0,0.4V116z"
|
32
15
|
></path>
|
33
16
|
</svg>
|
34
|
-
|
35
|
-
const folder = (label) => html`
|
17
|
+
`,m=e=>o`
|
36
18
|
<svg
|
37
19
|
class="folder"
|
38
20
|
role="img"
|
39
21
|
viewBox="0 0 32 32"
|
40
|
-
aria-label=${
|
22
|
+
aria-label=${e||"Folder"}
|
41
23
|
>
|
42
24
|
<path
|
43
25
|
class="folderBackground"
|
@@ -48,30 +30,7 @@ const folder = (label) => html`
|
|
48
30
|
d="M29,6H18.3c-0.1,0-0.2,0-0.4-0.2l-3.1-3.1C14.4,2.3,13.8,2,13.1,2H3C1.3,2,0,3.3,0,5v22c0,1.6,1.3,3,3,3h26c1.7,0,3-1.4,3-3V9C32,7.3,30.7,6,29,6z M31,27c0,1.1-0.9,2-2,2H3c-1.1,0-2-0.9-2-2V7h28c1.1,0,2,0.9,2,2V27z"
|
49
31
|
></path>
|
50
32
|
</svg>
|
51
|
-
`;
|
52
|
-
export class Asset extends SpectrumElement {
|
53
|
-
constructor() {
|
54
|
-
super(...arguments);
|
55
|
-
this.label = "";
|
56
|
-
}
|
57
|
-
static get styles() {
|
58
|
-
return [styles];
|
59
|
-
}
|
60
|
-
render() {
|
61
|
-
if (this.variant === "file") {
|
62
|
-
return file(this.label);
|
63
|
-
} else if (this.variant === "folder") {
|
64
|
-
return folder(this.label);
|
65
|
-
}
|
66
|
-
return html`
|
33
|
+
`;export class Asset extends h{constructor(){super(...arguments);this.label=""}static get styles(){return[u]}render(){return this.variant==="file"?f(this.label):this.variant==="folder"?m(this.label):o`
|
67
34
|
<slot></slot>
|
68
|
-
|
69
|
-
}
|
70
|
-
}
|
71
|
-
__decorateClass([
|
72
|
-
property({ type: String, reflect: true })
|
73
|
-
], Asset.prototype, "variant", 2);
|
74
|
-
__decorateClass([
|
75
|
-
property()
|
76
|
-
], Asset.prototype, "label", 2);
|
35
|
+
`}}i([p({type:String,reflect:!0})],Asset.prototype,"variant",2),i([p()],Asset.prototype,"label",2);
|
77
36
|
//# sourceMappingURL=Asset.js.map
|
package/src/Asset.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["Asset.ts"],
|
4
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 CSSResultArray,\n html,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport styles from './asset.css.js';\n\nconst file = (label: string): TemplateResult => html`\n <svg\n class=\"file\"\n role=\"img\"\n viewBox=\"0 0 128 128\"\n aria-label=${label || 'File'}\n >\n <path\n class=\"fileBackground\"\n d=\"M24,126c-5.5,0-10-4.5-10-10V12c0-5.5,4.5-10,10-10h61.5c2.1,0,4.1,0.8,5.6,2.3l20.5,20.4c1.5,1.5,2.4,3.5,2.4,5.7V116c0,5.5-4.5,10-10,10H24z\"\n ></path>\n <path\n class=\"fileOutline\"\n d=\"M113.1,23.3L92.6,2.9C90.7,1,88.2,0,85.5,0H24c-6.6,0-12,5.4-12,12v104c0,6.6,5.4,12,12,12h80c6.6,0,12-5.4,12-12V30.4C116,27.8,114.9,25.2,113.1,23.3z M90,6l20.1,20H92c-1.1,0-2-0.9-2-2V6z M112,116c0,4.4-3.6,8-8,8H24c-4.4,0-8-3.6-8-8V12c0-4.4,3.6-8,8-8h61.5c0.2,0,0.3,0,0.5,0v20c0,3.3,2.7,6,6,6h20c0,0.1,0,0.3,0,0.4V116z\"\n ></path>\n </svg>\n`;\n\nconst folder = (label: string): TemplateResult => html`\n <svg\n class=\"folder\"\n role=\"img\"\n viewBox=\"0 0 32 32\"\n aria-label=${label || 'Folder'}\n >\n <path\n class=\"folderBackground\"\n d=\"M3,29.5c-1.4,0-2.5-1.1-2.5-2.5V5c0-1.4,1.1-2.5,2.5-2.5h10.1c0.5,0,1,0.2,1.4,0.6l3.1,3.1c0.2,0.2,0.4,0.3,0.7,0.3H29c1.4,0,2.5,1.1,2.5,2.5v18c0,1.4-1.1,2.5-2.5,2.5H3z\"\n ></path>\n <path\n class=\"folderOutline\"\n d=\"M29,6H18.3c-0.1,0-0.2,0-0.4-0.2l-3.1-3.1C14.4,2.3,13.8,2,13.1,2H3C1.3,2,0,3.3,0,5v22c0,1.6,1.3,3,3,3h26c1.7,0,3-1.4,3-3V9C32,7.3,30.7,6,29,6z M31,27c0,1.1-0.9,2-2,2H3c-1.1,0-2-0.9-2-2V7h28c1.1,0,2,0.9,2,2V27z\"\n ></path>\n </svg>\n`;\n\n/**\n * @element sp-asset\n * @slot - content to be displayed in the asset when an acceptable value for `file` is not present\n */\nexport class Asset extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: String, reflect: true })\n public variant: 'file' | 'folder' | undefined;\n\n @property()\n public label = '';\n\n protected override render(): TemplateResult {\n if (this.variant === 'file') {\n return file(this.label);\n } else if (this.variant === 'folder') {\n return folder(this.label);\n }\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
5
|
-
"mappings": "
|
5
|
+
"mappings": "wMAYA,0EAMA,2EAEA,8BAEA,KAAM,GAAO,AAAC,GAAkC;AAAA;AAAA;AAAA;AAAA;AAAA,qBAK3B,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaxB,EAAS,AAAC,GAAkC;AAAA;AAAA;AAAA;AAAA;AAAA,qBAK7B,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBvB,aAAM,aAAc,EAAgB,CAApC,kCASI,WAAQ,aARY,SAAyB,CAChD,MAAO,CAAC,CAAM,CAClB,CAQmB,QAAyB,CACxC,MAAI,MAAK,UAAY,OACV,EAAK,KAAK,KAAK,EACf,KAAK,UAAY,SACjB,EAAO,KAAK,KAAK,EAErB;AAAA;AAAA,SAGX,CACJ,CAfW,GADP,AAAC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAClC,AANJ,MAMI,uBAGA,GADP,AAAC,EAAS,GACH,AATJ,MASI",
|
6
6
|
"names": []
|
7
7
|
}
|
package/src/asset.css.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import
|
2
|
-
const styles = css`
|
1
|
+
import{css as t}from"@spectrum-web-components/base";const r=t`
|
3
2
|
:host{align-items:center;display:flex;height:100%;justify-content:center;width:100%}::slotted(*){max-height:100%;max-width:100%;object-fit:contain;transition:opacity var(--spectrum-global-animation-duration-100,.13s)}.file,.folder{height:100%;margin:var(
|
4
3
|
--spectrum-asset-icon-margin,var(--spectrum-global-dimension-size-250)
|
5
4
|
);max-width:var(
|
@@ -13,6 +12,5 @@ const styles = css`
|
|
13
12
|
)}.fileOutline,.folderOutline{fill:var(
|
14
13
|
--spectrum-asset-icon-outline-color,var(--spectrum-global-color-gray-500)
|
15
14
|
)}
|
16
|
-
`;
|
17
|
-
export default styles;
|
15
|
+
`;export default r;
|
18
16
|
//# sourceMappingURL=asset.css.js.map
|
package/src/asset.css.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["asset.css.ts"],
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{align-items:center;display:flex;height:100%;justify-content:center;width:100%}::slotted(*){max-height:100%;max-width:100%;object-fit:contain;transition:opacity var(--spectrum-global-animation-duration-100,.13s)}.file,.folder{height:100%;margin:var(\n--spectrum-asset-icon-margin,var(--spectrum-global-dimension-size-250)\n);max-width:var(\n--spectrum-asset-icon-max-width,var(--spectrum-global-dimension-static-size-1000)\n);min-width:var(\n--spectrum-asset-icon-min-width,var(--spectrum-global-dimension-size-600)\n);width:100%}.folderBackground{fill:var(\n--spectrum-asset-folder-background-color,var(--spectrum-global-color-gray-300)\n)}.fileBackground{fill:var(\n--spectrum-asset-file-background-color,var(--spectrum-global-color-gray-50)\n)}.fileOutline,.folderOutline{fill:var(\n--spectrum-asset-icon-outline-color,var(--spectrum-global-color-gray-500)\n)}\n`;\nexport default styles;"],
|
5
|
-
"mappings": "AAWA
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAef,cAAe",
|
6
6
|
"names": []
|
7
7
|
}
|
package/src/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export
|
1
|
+
export*from"./Asset.js";
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["index.ts"],
|
4
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\nexport * from './Asset.js';\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import
|
2
|
-
const styles = css`
|
1
|
+
import{css as t}from"@spectrum-web-components/base";const r=t`
|
3
2
|
:host{align-items:center;display:flex;height:100%;justify-content:center;width:100%}::slotted(*){max-height:100%;max-width:100%;object-fit:contain;transition:opacity var(--spectrum-global-animation-duration-100,.13s)}.file,.folder{height:100%;margin:var(
|
4
3
|
--spectrum-asset-icon-margin,var(--spectrum-global-dimension-size-250)
|
5
4
|
);max-width:var(
|
@@ -13,6 +12,5 @@ const styles = css`
|
|
13
12
|
)}.fileOutline,.folderOutline{fill:var(
|
14
13
|
--spectrum-asset-icon-outline-color,var(--spectrum-global-color-gray-500)
|
15
14
|
)}
|
16
|
-
`;
|
17
|
-
export default styles;
|
15
|
+
`;export default r;
|
18
16
|
//# sourceMappingURL=spectrum-asset.css.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["spectrum-asset.css.ts"],
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{align-items:center;display:flex;height:100%;justify-content:center;width:100%}::slotted(*){max-height:100%;max-width:100%;object-fit:contain;transition:opacity var(--spectrum-global-animation-duration-100,.13s)}.file,.folder{height:100%;margin:var(\n--spectrum-asset-icon-margin,var(--spectrum-global-dimension-size-250)\n);max-width:var(\n--spectrum-asset-icon-max-width,var(--spectrum-global-dimension-static-size-1000)\n);min-width:var(\n--spectrum-asset-icon-min-width,var(--spectrum-global-dimension-size-600)\n);width:100%}.folderBackground{fill:var(\n--spectrum-asset-folder-background-color,var(--spectrum-global-color-gray-300)\n)}.fileBackground{fill:var(\n--spectrum-asset-file-background-color,var(--spectrum-global-color-gray-50)\n)}.fileOutline,.folderOutline{fill:var(\n--spectrum-asset-icon-outline-color,var(--spectrum-global-color-gray-500)\n)}\n`;\nexport default styles;"],
|
5
|
-
"mappings": "AAWA
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAef,cAAe",
|
6
6
|
"names": []
|
7
7
|
}
|
package/stories/asset.stories.js
CHANGED
@@ -1,25 +1,10 @@
|
|
1
|
-
import
|
2
|
-
import "@spectrum-web-components/asset/sp-asset.js";
|
3
|
-
import { portrait } from "../../card/stories/images";
|
4
|
-
export default {
|
5
|
-
title: "Asset",
|
6
|
-
component: "sp-asset"
|
7
|
-
};
|
8
|
-
export const Default = () => {
|
9
|
-
return html`
|
1
|
+
import{html as t}from"@spectrum-web-components/base";import"@spectrum-web-components/asset/sp-asset.js";import{portrait as e}from"../../card/stories/images";export default{title:"Asset",component:"sp-asset"};export const Default=()=>t`
|
10
2
|
<sp-asset style="height: 128px">
|
11
|
-
<img src=${
|
3
|
+
<img src=${e} alt="Demo Graphic" />
|
12
4
|
</sp-asset>
|
13
|
-
|
14
|
-
};
|
15
|
-
export const File = () => {
|
16
|
-
return html`
|
5
|
+
`,File=()=>t`
|
17
6
|
<sp-asset variant="file"></sp-asset>
|
18
|
-
|
19
|
-
};
|
20
|
-
export const Folder = () => {
|
21
|
-
return html`
|
7
|
+
`,Folder=()=>t`
|
22
8
|
<sp-asset variant="folder"></sp-asset>
|
23
9
|
`;
|
24
|
-
};
|
25
10
|
//# sourceMappingURL=asset.stories.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["asset.stories.ts"],
|
4
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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/asset/sp-asset.js';\nimport { portrait } from '../../card/stories/images';\n\nexport default {\n title: 'Asset',\n component: 'sp-asset',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-asset style=\"height: 128px\">\n <img src=${portrait} alt=\"Demo Graphic\" />\n </sp-asset>\n `;\n};\n\nexport const File = (): TemplateResult => {\n return html`\n <sp-asset variant=\"file\"></sp-asset>\n `;\n};\n\nexport const Folder = (): TemplateResult => {\n return html`\n <sp-asset variant=\"folder\"></sp-asset>\n `;\n};\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,qDAEA,mDACA,qDAEA,cAAe,CACX,MAAO,QACP,UAAW,UACf,EAEO,YAAM,SAAU,IACZ;AAAA;AAAA,uBAEY;AAAA;AAAA,MAKV,KAAO,IACT;AAAA;AAAA,MAKE,OAAS,IACX;AAAA;",
|
6
6
|
"names": []
|
7
7
|
}
|
package/test/asset.test-vrt.js
CHANGED
@@ -1,4 +1,2 @@
|
|
1
|
-
import
|
2
|
-
import { regressVisuals } from "../../../test/visual/test.js";
|
3
|
-
regressVisuals("AssetStories", stories);
|
1
|
+
import*as s from"../stories/asset.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("AssetStories",s);
|
4
2
|
//# sourceMappingURL=asset.test-vrt.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["asset.test-vrt.ts"],
|
4
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 * as stories from '../stories/asset.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('AssetStories', stories);\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,8CACA,8DAEA,EAAe,eAAgB,CAAO",
|
6
6
|
"names": []
|
7
7
|
}
|
package/test/asset.test.js
CHANGED
@@ -1,22 +1,2 @@
|
|
1
|
-
import
|
2
|
-
import { testForLitDevWarnings } from "../../../test/testing-helpers";
|
3
|
-
import { Default, File, Folder } from "../stories/asset.stories.js";
|
4
|
-
describe("Asset", () => {
|
5
|
-
testForLitDevWarnings(async () => await fixture(Default()));
|
6
|
-
it("loads default asset accessibly", async () => {
|
7
|
-
const el = await fixture(Default());
|
8
|
-
await elementUpdated(el);
|
9
|
-
await expect(el).to.be.accessible();
|
10
|
-
});
|
11
|
-
it('loads [variant="file"] accessibly', async () => {
|
12
|
-
const el = await fixture(File());
|
13
|
-
await elementUpdated(el);
|
14
|
-
await expect(el).to.be.accessible();
|
15
|
-
});
|
16
|
-
it('loads [variant="folder"] accessibly', async () => {
|
17
|
-
const el = await fixture(Folder());
|
18
|
-
await elementUpdated(el);
|
19
|
-
await expect(el).to.be.accessible();
|
20
|
-
});
|
21
|
-
});
|
1
|
+
import{elementUpdated as e,expect as s,fixture as t}from"@open-wc/testing";import{testForLitDevWarnings as c}from"../../../test/testing-helpers";import{Default as i,File as o,Folder as l}from"../stories/asset.stories.js";describe("Asset",()=>{c(async()=>await t(i())),it("loads default asset accessibly",async()=>{const a=await t(i());await e(a),await s(a).to.be.accessible()}),it('loads [variant="file"] accessibly',async()=>{const a=await t(o());await e(a),await s(a).to.be.accessible()}),it('loads [variant="folder"] accessibly',async()=>{const a=await t(l());await e(a),await s(a).to.be.accessible()})});
|
22
2
|
//# sourceMappingURL=asset.test.js.map
|
package/test/asset.test.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["asset.test.ts"],
|
4
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 { elementUpdated, expect, fixture } from '@open-wc/testing';\n\nimport { Asset } from '@spectrum-web-components/asset';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers';\nimport { Default, File, Folder } from '../stories/asset.stories.js';\n\ndescribe('Asset', () => {\n testForLitDevWarnings(async () => await fixture<Asset>(Default()));\n it('loads default asset accessibly', async () => {\n const el = await fixture<Asset>(Default());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads [variant=\"file\"] accessibly', async () => {\n const el = await fixture<Asset>(File());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads [variant=\"folder\"] accessibly', async () => {\n const el = await fixture<Asset>(Folder());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n});\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,2EAGA,sEACA,4EAEA,SAAS,QAAS,IAAM,CACpB,EAAsB,SAAY,KAAM,GAAe,EAAQ,CAAC,CAAC,EACjE,GAAG,iCAAkC,SAAY,CAC7C,KAAM,GAAK,KAAM,GAAe,EAAQ,CAAC,EAEzC,KAAM,GAAe,CAAE,EAEvB,KAAM,GAAO,CAAE,EAAE,GAAG,GAAG,WAAW,CACtC,CAAC,EACD,GAAG,oCAAqC,SAAY,CAChD,KAAM,GAAK,KAAM,GAAe,EAAK,CAAC,EAEtC,KAAM,GAAe,CAAE,EAEvB,KAAM,GAAO,CAAE,EAAE,GAAG,GAAG,WAAW,CACtC,CAAC,EACD,GAAG,sCAAuC,SAAY,CAClD,KAAM,GAAK,KAAM,GAAe,EAAO,CAAC,EAExC,KAAM,GAAe,CAAE,EAEvB,KAAM,GAAO,CAAE,EAAE,GAAG,GAAG,WAAW,CACtC,CAAC,CACL,CAAC",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,7 +1,4 @@
|
|
1
|
-
import
|
2
|
-
import { html } from "lit";
|
3
|
-
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
4
|
-
measureFixtureCreation(html`
|
1
|
+
import"@spectrum-web-components/asset/sp-asset.js";import{html as r}from"lit";import{measureFixtureCreation as t}from"../../../../test/benchmark/helpers.js";t(r`
|
5
2
|
<sp-asset open></sp-asset>
|
6
3
|
`);
|
7
4
|
//# sourceMappingURL=basic-test.js.map
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["basic-test.ts"],
|
4
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 '@spectrum-web-components/asset/sp-asset.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-asset open></sp-asset>\n`);\n"],
|
5
|
-
"mappings": "AAYA
|
5
|
+
"mappings": "AAYA,mDACA,2BACA,+EAEA,EAAuB;AAAA;AAAA,CAEtB",
|
6
6
|
"names": []
|
7
7
|
}
|