@internetarchive/collection-browser 0.1.3 → 0.1.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/dist/src/assets/img/icons/mediatype/livemusic.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/livemusic.js +7 -0
- package/dist/src/assets/img/icons/mediatype/livemusic.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/photos.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/photos.js +7 -0
- package/dist/src/assets/img/icons/mediatype/photos.js.map +1 -0
- package/dist/src/helpers.d.ts +1 -0
- package/dist/src/helpers.js +20 -0
- package/dist/src/helpers.js.map +1 -0
- package/dist/src/mediatype/mediatype-color.d.ts +3 -0
- package/dist/src/mediatype/mediatype-color.js +15 -0
- package/dist/src/mediatype/mediatype-color.js.map +1 -0
- package/dist/src/mediatype/mediatype-display.d.ts +3 -0
- package/dist/src/mediatype/mediatype-display.js +86 -0
- package/dist/src/mediatype/mediatype-display.js.map +1 -0
- package/dist/src/mediatype/mediatype-icon.d.ts +10 -0
- package/dist/src/mediatype/mediatype-icon.js +105 -0
- package/dist/src/mediatype/mediatype-icon.js.map +1 -0
- package/dist/src/mediatype/mediatype-text.d.ts +3 -0
- package/dist/src/mediatype/mediatype-text.js +17 -0
- package/dist/src/mediatype/mediatype-text.js.map +1 -0
- package/dist/src/mediatype/mediatypeConfig.d.ts +3 -0
- package/dist/src/mediatype/mediatypeConfig.js +86 -0
- package/dist/src/mediatype/mediatypeConfig.js.map +1 -0
- package/dist/src/mediatype-icon.d.ts +9 -0
- package/dist/src/mediatype-icon.js +78 -0
- package/dist/src/mediatype-icon.js.map +1 -0
- package/dist/src/sort-filter-bar/img/grid.d.ts +1 -0
- package/dist/src/sort-filter-bar/img/grid.js +5 -0
- package/dist/src/sort-filter-bar/img/grid.js.map +1 -0
- package/dist/src/tiles/item-image.d.ts +3 -0
- package/dist/src/tiles/item-image.js +19 -9
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list-detail.d.ts +7 -0
- package/dist/src/tiles/list/tile-list-detail.js +28 -0
- package/dist/src/tiles/list/tile-list-detail.js.map +1 -0
- package/dist/src/tiles/loading-tile.d.ts +5 -0
- package/dist/src/tiles/loading-tile.js +32 -0
- package/dist/src/tiles/loading-tile.js.map +1 -0
- package/dist/src/utils/format-string.d.ts +2 -0
- package/dist/src/utils/format-string.js +7 -0
- package/dist/src/utils/format-string.js.map +1 -0
- package/dist/src/waveform-thumbnail.d.ts +7 -0
- package/dist/src/waveform-thumbnail.js +106 -0
- package/dist/src/waveform-thumbnail.js.map +1 -0
- package/dist/src/waveform-view.d.ts +0 -0
- package/dist/src/waveform-view.js +2 -0
- package/dist/src/waveform-view.js.map +1 -0
- package/dist/src/your-webcomponent.d.ts +8 -0
- package/dist/src/your-webcomponent.js +38 -0
- package/dist/src/your-webcomponent.js.map +1 -0
- package/dist/test/mediatype-icon.test.d.ts +0 -0
- package/dist/test/mediatype-icon.test.js +3 -0
- package/dist/test/mediatype-icon.test.js.map +1 -0
- package/dist/test/mediatypeConfig.test.d.ts +1 -0
- package/dist/test/mediatypeConfig.test.js +17 -0
- package/dist/test/mediatypeConfig.test.js.map +1 -0
- package/dist/test/utils/format-string.test.d.ts +1 -0
- package/dist/test/utils/format-string.test.js +17 -0
- package/dist/test/utils/format-string.test.js.map +1 -0
- package/dist/test/your-webcomponent.test.d.ts +1 -0
- package/dist/test/your-webcomponent.test.js +23 -0
- package/dist/test/your-webcomponent.test.js.map +1 -0
- package/package.json +1 -1
- package/src/tiles/item-image.ts +20 -10
|
@@ -7,6 +7,7 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
7
7
|
super(...arguments);
|
|
8
8
|
this.isListTile = false;
|
|
9
9
|
this.isDeemphasize = false;
|
|
10
|
+
this.isWaveform = false;
|
|
10
11
|
}
|
|
11
12
|
updated(changed) {
|
|
12
13
|
if (changed.has('model')) {
|
|
@@ -45,9 +46,9 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
45
46
|
get waveformTemplate() {
|
|
46
47
|
var _a;
|
|
47
48
|
return html `
|
|
48
|
-
<div class
|
|
49
|
+
<div class=${this.boxWaveformClass}>
|
|
49
50
|
<img
|
|
50
|
-
class
|
|
51
|
+
class=${this.itemImageWaveformClass}
|
|
51
52
|
src="${this.imageSrc}"
|
|
52
53
|
alt="${ifDefined((_a = this.model) === null || _a === void 0 ? void 0 : _a.identifier)}"
|
|
53
54
|
@load=${this.onLoadItemImageCheck}
|
|
@@ -67,7 +68,7 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
67
68
|
const aspectRatio = this.itemImageWaveform.naturalWidth /
|
|
68
69
|
this.itemImageWaveform.naturalHeight;
|
|
69
70
|
if (aspectRatio === 4) {
|
|
70
|
-
this.
|
|
71
|
+
this.isWaveform = true;
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
// Classes
|
|
@@ -77,6 +78,12 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
77
78
|
get imageBoxClass() {
|
|
78
79
|
return this.isDeemphasize ? 'item-image-box' : undefined;
|
|
79
80
|
}
|
|
81
|
+
get boxWaveformClass() {
|
|
82
|
+
return `item-audio${this.isWaveform ? ` ${this.randomGradient}` : ''}`;
|
|
83
|
+
}
|
|
84
|
+
get itemImageWaveformClass() {
|
|
85
|
+
return `item-image${this.isWaveform ? ' waveform' : ''}`;
|
|
86
|
+
}
|
|
80
87
|
get randomGradient() {
|
|
81
88
|
return `grad${Math.floor(Math.random() * (6 - 1) + 1)}`;
|
|
82
89
|
}
|
|
@@ -137,7 +144,7 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
137
144
|
text-align: center;
|
|
138
145
|
}
|
|
139
146
|
|
|
140
|
-
|
|
147
|
+
.grad1 {
|
|
141
148
|
background: linear-gradient(
|
|
142
149
|
hsl(300, 80%, 55%),
|
|
143
150
|
hsl(330, 80%, 33%) 35%,
|
|
@@ -146,7 +153,7 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
146
153
|
);
|
|
147
154
|
}
|
|
148
155
|
|
|
149
|
-
|
|
156
|
+
.grad2 {
|
|
150
157
|
background: linear-gradient(
|
|
151
158
|
hsl(200, 80%, 55%),
|
|
152
159
|
hsl(230, 80%, 33%) 35%,
|
|
@@ -155,7 +162,7 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
155
162
|
);
|
|
156
163
|
}
|
|
157
164
|
|
|
158
|
-
|
|
165
|
+
.grad3 {
|
|
159
166
|
background: linear-gradient(
|
|
160
167
|
hsl(160, 80%, 55%),
|
|
161
168
|
hsl(190, 80%, 33%) 35%,
|
|
@@ -164,7 +171,7 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
164
171
|
);
|
|
165
172
|
}
|
|
166
173
|
|
|
167
|
-
|
|
174
|
+
.grad4 {
|
|
168
175
|
background: linear-gradient(
|
|
169
176
|
hsl(250, 80%, 55%),
|
|
170
177
|
hsl(280, 80%, 33%) 35%,
|
|
@@ -173,7 +180,7 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
173
180
|
);
|
|
174
181
|
}
|
|
175
182
|
|
|
176
|
-
|
|
183
|
+
.grad5 {
|
|
177
184
|
background: linear-gradient(
|
|
178
185
|
hsl(280, 80%, 55%),
|
|
179
186
|
hsl(310, 80%, 33%) 35%,
|
|
@@ -182,7 +189,7 @@ let ItemImage = class ItemImage extends LitElement {
|
|
|
182
189
|
);
|
|
183
190
|
}
|
|
184
191
|
|
|
185
|
-
|
|
192
|
+
.grad6 {
|
|
186
193
|
background: linear-gradient(
|
|
187
194
|
hsl(340, 80%, 55%),
|
|
188
195
|
hsl(0, 80%, 33%) 35%,
|
|
@@ -205,6 +212,9 @@ __decorate([
|
|
|
205
212
|
__decorate([
|
|
206
213
|
state()
|
|
207
214
|
], ItemImage.prototype, "isDeemphasize", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
state()
|
|
217
|
+
], ItemImage.prototype, "isWaveform", void 0);
|
|
208
218
|
__decorate([
|
|
209
219
|
query('.item-image')
|
|
210
220
|
], ItemImage.prototype, "itemImageWaveform", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-image.js","sourceRoot":"","sources":["../../../src/tiles/item-image.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EAEH,IAAI,EACJ,OAAO,EAEP,UAAU,GACX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAKzD,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,UAAU;IAAzC;;QAK+B,eAAU,GAAG,KAAK,CAAC;QAE/B,kBAAa,
|
|
1
|
+
{"version":3,"file":"item-image.js","sourceRoot":"","sources":["../../../src/tiles/item-image.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EAEH,IAAI,EACJ,OAAO,EAEP,UAAU,GACX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAKzD,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,UAAU;IAAzC;;QAK+B,eAAU,GAAG,KAAK,CAAC;QAE/B,kBAAa,GAAY,KAAK,CAAC;QAE/B,eAAU,GAAY,KAAK,CAAC;IA4M/C,CAAC;IAxMW,OAAO,CAAC,OAAuB;QACvC,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,IAAI,CAAC,aAAa,EAAE,CAAC;SACtB;IACH,CAAC;IAEO,aAAa;;QACnB,IAAI,CAAC,aAAa;YAChB,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,CAAC,QAAQ,CAAC,aAAa,C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ArNY,SAAS","sourcesContent":["import {\n css,\n CSSResultGroup,\n html,\n nothing,\n PropertyValues,\n LitElement,\n} from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { TileModel } from '../models';\n\n@customElement('item-image')\nexport class ItemImage extends LitElement {\n @property({ type: Object }) model?: TileModel;\n\n @property({ type: String }) baseImageUrl?: string;\n\n @property({ type: Boolean }) isListTile = false;\n\n @state() private isDeemphasize: boolean = false;\n\n @state() private isWaveform: boolean = false;\n\n @query('.item-image') private itemImageWaveform!: HTMLImageElement;\n\n protected updated(changed: PropertyValues): void {\n if (changed.has('model')) {\n this.setDeemphsize();\n }\n }\n\n private setDeemphsize() {\n this.isDeemphasize =\n this.model?.collections.includes('deemphasize') ?? false;\n }\n\n render() {\n return html`\n <div class=${ifDefined(this.imageBoxClass)}>\n ${this.model?.mediatype === 'audio'\n ? this.waveformTemplate\n : this.backgroundImageTemplate}\n ${this.tileActionTemplate}\n </div>\n `;\n }\n\n private get imageSrc() {\n return `${this.baseImageUrl}/services/img/${this.model?.identifier}`;\n }\n\n // Templates\n private get backgroundImageTemplate() {\n return html`\n <div\n class=${this.imageClass}\n style=\"background-image:url(${this.imageSrc})\"\n ></div>\n `;\n }\n\n private get waveformTemplate() {\n return html`\n <div class=${this.boxWaveformClass}>\n <img\n class=${this.itemImageWaveformClass}\n src=\"${this.imageSrc}\"\n alt=\"${ifDefined(this.model?.identifier)}\"\n @load=${this.onLoadItemImageCheck}\n />\n </div>\n `;\n }\n\n private get tileActionTemplate() {\n if (!this.isDeemphasize) {\n return nothing;\n }\n return html`\n <div class=\"tile-action no-preview\">Content may be inappropriate</div>\n `;\n }\n\n private onLoadItemImageCheck() {\n const aspectRatio =\n this.itemImageWaveform.naturalWidth /\n this.itemImageWaveform.naturalHeight;\n if (aspectRatio === 4) {\n this.isWaveform = true;\n }\n }\n\n // Classes\n private get imageClass() {\n return `item-image ${this.isDeemphasize ? 'deemphasize' : 'default'}`;\n }\n\n private get imageBoxClass() {\n return this.isDeemphasize ? 'item-image-box' : undefined;\n }\n\n private get boxWaveformClass() {\n return `item-audio${this.isWaveform ? ` ${this.randomGradient}` : ''}`;\n }\n\n private get itemImageWaveformClass() {\n return `item-image${this.isWaveform ? ' waveform' : ''}`;\n }\n\n private get randomGradient() {\n return `grad${Math.floor(Math.random() * (6 - 1) + 1)}`;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n .item-image-box {\n width: 16rem;\n height: 16rem;\n overflow: hidden;\n position: relative;\n box-shadow: 1px 1px 2px 0px;\n display: flex;\n }\n\n .item-image {\n width: 16rem;\n height: 16rem;\n object-fit: contain;\n background-repeat: no-repeat;\n background-position: center center;\n position: relative;\n -webkit-appearance: none;\n overflow: visible;\n }\n\n .waveform {\n mix-blend-mode: screen;\n }\n\n .default {\n background-size: contain;\n filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));\n }\n\n .deemphasize {\n background-size: cover;\n filter: blur(15px);\n z-index: 1;\n }\n\n .tile-action {\n border: 1px solid currentColor;\n border-radius: 1px;\n padding: 5px;\n font-weight: 500;\n width: auto;\n position: absolute;\n z-index: 2;\n display: flex;\n top: 5.5rem;\n }\n\n .no-preview {\n background-color: #fffecb;\n color: #2c2c2c;\n font-size: 1.4rem;\n line-height: 2rem;\n text-align: center;\n }\n\n .grad1 {\n background: linear-gradient(\n hsl(300, 80%, 55%),\n hsl(330, 80%, 33%) 35%,\n hsl(330, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n .grad2 {\n background: linear-gradient(\n hsl(200, 80%, 55%),\n hsl(230, 80%, 33%) 35%,\n hsl(230, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n .grad3 {\n background: linear-gradient(\n hsl(160, 80%, 55%),\n hsl(190, 80%, 33%) 35%,\n hsl(190, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n .grad4 {\n background: linear-gradient(\n hsl(250, 80%, 55%),\n hsl(280, 80%, 33%) 35%,\n hsl(280, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n .grad5 {\n background: linear-gradient(\n hsl(280, 80%, 55%),\n hsl(310, 80%, 33%) 35%,\n hsl(310, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n .grad6 {\n background: linear-gradient(\n hsl(340, 80%, 55%),\n hsl(0, 80%, 33%) 35%,\n hsl(0, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
let TileListDetail = class TileListDetail extends LitElement {
|
|
5
|
+
render() {
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
|
+
return html `
|
|
8
|
+
<h1>${(_a = this.model) === null || _a === void 0 ? void 0 : _a.title}</h1>
|
|
9
|
+
<h2>${(_c = (_b = this.model) === null || _b === void 0 ? void 0 : _b.datePublished) === null || _c === void 0 ? void 0 : _c.toDateString()}</h2>
|
|
10
|
+
<p>${(_d = this.model) === null || _d === void 0 ? void 0 : _d.description}</p>
|
|
11
|
+
`;
|
|
12
|
+
}
|
|
13
|
+
static get styles() {
|
|
14
|
+
return css `
|
|
15
|
+
h1 {
|
|
16
|
+
margin-top: 0;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
property({ type: Object })
|
|
23
|
+
], TileListDetail.prototype, "model", void 0);
|
|
24
|
+
TileListDetail = __decorate([
|
|
25
|
+
customElement('tile-list-detail')
|
|
26
|
+
], TileListDetail);
|
|
27
|
+
export { TileListDetail };
|
|
28
|
+
//# sourceMappingURL=tile-list-detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-list-detail.js","sourceRoot":"","sources":["../../../../src/tiles/list/tile-list-detail.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI5D,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,UAAU;IAG5C,MAAM;;QACJ,OAAO,IAAI,CAAA;YACH,MAAA,IAAI,CAAC,KAAK,0CAAE,KAAK;YACjB,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,aAAa,0CAAE,YAAY,EAAE;WAC1C,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW;KAC7B,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;KAIT,CAAC;IACJ,CAAC;CACF,CAAA;AAjB6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAmB;AADnC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAkB1B;SAlBY,cAAc","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TileModel } from '../../models';\n\n@customElement('tile-list-detail')\nexport class TileListDetail extends LitElement {\n @property({ type: Object }) model?: TileModel;\n\n render() {\n return html`\n <h1>${this.model?.title}</h1>\n <h2>${this.model?.datePublished?.toDateString()}</h2>\n <p>${this.model?.description}</p>\n `;\n }\n\n static get styles() {\n return css`\n h1 {\n margin-top: 0;\n }\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
let LoadingTile = class LoadingTile extends LitElement {
|
|
5
|
+
render() {
|
|
6
|
+
return html ` <div id="container"></div> `;
|
|
7
|
+
}
|
|
8
|
+
static get styles() {
|
|
9
|
+
return css `
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
height: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#container {
|
|
16
|
+
background: linear-gradient(
|
|
17
|
+
to right,
|
|
18
|
+
rgba(25, 69, 154, 0.1),
|
|
19
|
+
rgb(105, 161, 234, 0.2)
|
|
20
|
+
);
|
|
21
|
+
background-size: 100% 100%;
|
|
22
|
+
display: block;
|
|
23
|
+
height: 100%;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
LoadingTile = __decorate([
|
|
29
|
+
customElement('loading-tile')
|
|
30
|
+
], LoadingTile);
|
|
31
|
+
export { LoadingTile };
|
|
32
|
+
//# sourceMappingURL=loading-tile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading-tile.js","sourceRoot":"","sources":["../../../src/tiles/loading-tile.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,UAAU;IACzC,MAAM;QACJ,OAAO,IAAI,CAAA,8BAA8B,CAAC;IAC5C,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;KAgBT,CAAC;IACJ,CAAC;CACF,CAAA;AAxBY,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAwBvB;SAxBY,WAAW","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('loading-tile')\nexport class LoadingTile extends LitElement {\n render() {\n return html` <div id=\"container\"></div> `;\n }\n\n static get styles() {\n return css`\n :host {\n display: block;\n height: 100%;\n }\n\n #container {\n background: linear-gradient(\n to right,\n rgba(25, 69, 154, 0.1),\n rgb(105, 161, 234, 0.2)\n );\n background-size: 100% 100%;\n display: block;\n height: 100%;\n }\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-string.js","sourceRoot":"","sources":["../../../src/utils/format-string.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;AAC/C,CAAC","sourcesContent":["export function strHasSpace(str: string): boolean {\n return /\\s/.test(str);\n}\n\nexport function isStrOneLiner(str: string): boolean {\n return !strHasSpace(str) && str.length >= 24;\n}\n"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
let WaveformThumbnail = class WaveformThumbnail extends LitElement {
|
|
5
|
+
render() {
|
|
6
|
+
const imgSrcUrl = `${this.baseNavigationUrl}/services/img/${this.identifier}`;
|
|
7
|
+
const randomGradient = `grad${Math.floor(Math.random() * (6 - 1) + 1)}`;
|
|
8
|
+
return html `
|
|
9
|
+
<div class="box" id=${randomGradient}>
|
|
10
|
+
<div
|
|
11
|
+
class="item-image"
|
|
12
|
+
style="background-image:url(${imgSrcUrl})"
|
|
13
|
+
></div>
|
|
14
|
+
</div>
|
|
15
|
+
`;
|
|
16
|
+
}
|
|
17
|
+
static get styles() {
|
|
18
|
+
return css `
|
|
19
|
+
.box {
|
|
20
|
+
width: 16rem;
|
|
21
|
+
height: 16rem;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
position: relative;
|
|
24
|
+
box-shadow: 1px 1px 2px 0px;
|
|
25
|
+
display: flex;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.item-image {
|
|
29
|
+
width: 16rem;
|
|
30
|
+
height: 16rem;
|
|
31
|
+
object-fit: cover;
|
|
32
|
+
background-repeat: no-repeat;
|
|
33
|
+
background-position: center center;
|
|
34
|
+
position: relative;
|
|
35
|
+
-webkit-appearance: none;
|
|
36
|
+
overflow: visible;
|
|
37
|
+
mix-blend-mode: screen;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#grad1 {
|
|
41
|
+
background: linear-gradient(
|
|
42
|
+
hsl(300, 80%, 55%),
|
|
43
|
+
hsl(330, 80%, 33%) 35%,
|
|
44
|
+
hsl(330, 80%, 22%) 70%,
|
|
45
|
+
hsl(0, 0%, 0%)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
#grad2 {
|
|
50
|
+
background: linear-gradient(
|
|
51
|
+
hsl(200, 80%, 55%),
|
|
52
|
+
hsl(230, 80%, 33%) 35%,
|
|
53
|
+
hsl(230, 80%, 22%) 70%,
|
|
54
|
+
hsl(0, 0%, 0%)
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#grad3 {
|
|
59
|
+
background: linear-gradient(
|
|
60
|
+
hsl(160, 80%, 55%),
|
|
61
|
+
hsl(190, 80%, 33%) 35%,
|
|
62
|
+
hsl(190, 80%, 22%) 70%,
|
|
63
|
+
hsl(0, 0%, 0%)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#grad4 {
|
|
68
|
+
background: linear-gradient(
|
|
69
|
+
hsl(250, 80%, 55%),
|
|
70
|
+
hsl(280, 80%, 33%) 35%,
|
|
71
|
+
hsl(280, 80%, 22%) 70%,
|
|
72
|
+
hsl(0, 0%, 0%)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
#grad5 {
|
|
77
|
+
background: linear-gradient(
|
|
78
|
+
hsl(280, 80%, 55%),
|
|
79
|
+
hsl(310, 80%, 33%) 35%,
|
|
80
|
+
hsl(310, 80%, 22%) 70%,
|
|
81
|
+
hsl(0, 0%, 0%)
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
#grad6 {
|
|
86
|
+
background: linear-gradient(
|
|
87
|
+
hsl(340, 80%, 55%),
|
|
88
|
+
hsl(0, 80%, 33%) 35%,
|
|
89
|
+
hsl(0, 80%, 22%) 70%,
|
|
90
|
+
hsl(0, 0%, 0%)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
__decorate([
|
|
97
|
+
property({ type: String })
|
|
98
|
+
], WaveformThumbnail.prototype, "baseNavigationUrl", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
property({ type: String })
|
|
101
|
+
], WaveformThumbnail.prototype, "identifier", void 0);
|
|
102
|
+
WaveformThumbnail = __decorate([
|
|
103
|
+
customElement('waveform-thumbnail')
|
|
104
|
+
], WaveformThumbnail);
|
|
105
|
+
export { WaveformThumbnail };
|
|
106
|
+
//# sourceMappingURL=waveform-thumbnail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waveform-thumbnail.js","sourceRoot":"","sources":["../../src/waveform-thumbnail.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG5D,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,UAAU;IAK/C,MAAM;QACJ,MAAM,SAAS,GAAG,GAAG,IAAI,CAAC,iBAAiB,iBAAiB,IAAI,CAAC,UAAU,EAAE,CAAC;QAC9E,MAAM,cAAc,GAAG,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAExE,OAAO,IAAI,CAAA;4BACa,cAAc;;;wCAGF,SAAS;;;KAG5C,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2ET,CAAC;IACJ,CAAC;CACF,CAAA;AAhG6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAA4B;AAE3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAqB;AAHrC,iBAAiB;IAD7B,aAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CAiG7B;SAjGY,iBAAiB","sourcesContent":["import { css, CSSResultGroup, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n@customElement('waveform-thumbnail')\nexport class WaveformThumbnail extends LitElement {\n @property({ type: String }) baseNavigationUrl?: string;\n\n @property({ type: String }) identifier?: string;\n\n render() {\n const imgSrcUrl = `${this.baseNavigationUrl}/services/img/${this.identifier}`;\n const randomGradient = `grad${Math.floor(Math.random() * (6 - 1) + 1)}`;\n\n return html`\n <div class=\"box\" id=${randomGradient}>\n <div\n class=\"item-image\"\n style=\"background-image:url(${imgSrcUrl})\"\n ></div>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n .box {\n width: 16rem;\n height: 16rem;\n overflow: hidden;\n position: relative;\n box-shadow: 1px 1px 2px 0px;\n display: flex;\n }\n\n .item-image {\n width: 16rem;\n height: 16rem;\n object-fit: cover;\n background-repeat: no-repeat;\n background-position: center center;\n position: relative;\n -webkit-appearance: none;\n overflow: visible;\n mix-blend-mode: screen;\n }\n\n #grad1 {\n background: linear-gradient(\n hsl(300, 80%, 55%),\n hsl(330, 80%, 33%) 35%,\n hsl(330, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad2 {\n background: linear-gradient(\n hsl(200, 80%, 55%),\n hsl(230, 80%, 33%) 35%,\n hsl(230, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad3 {\n background: linear-gradient(\n hsl(160, 80%, 55%),\n hsl(190, 80%, 33%) 35%,\n hsl(190, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad4 {\n background: linear-gradient(\n hsl(250, 80%, 55%),\n hsl(280, 80%, 33%) 35%,\n hsl(280, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad5 {\n background: linear-gradient(\n hsl(280, 80%, 55%),\n hsl(310, 80%, 33%) 35%,\n hsl(310, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad6 {\n background: linear-gradient(\n hsl(340, 80%, 55%),\n hsl(0, 80%, 33%) 35%,\n hsl(0, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n `;\n }\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waveform-view.js","sourceRoot":"","sources":["../../src/waveform-view.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css, LitElement } from 'lit';
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
|
+
let YourWebComponent = class YourWebComponent extends LitElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.title = 'Hey there';
|
|
8
|
+
this.counter = 5;
|
|
9
|
+
}
|
|
10
|
+
increment() {
|
|
11
|
+
this.counter += 1;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return html `
|
|
15
|
+
<h2>${this.title}, Number: ${this.counter}!</h2>
|
|
16
|
+
<button @click=${this.increment}>increment</button>
|
|
17
|
+
<slot name="my-slot"> </slot>
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
YourWebComponent.styles = css `
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
padding: 25px;
|
|
25
|
+
color: var(--your-webcomponent-text-color, #000);
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
__decorate([
|
|
29
|
+
property({ type: String })
|
|
30
|
+
], YourWebComponent.prototype, "title", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
property({ type: Number })
|
|
33
|
+
], YourWebComponent.prototype, "counter", void 0);
|
|
34
|
+
YourWebComponent = __decorate([
|
|
35
|
+
customElement('your-webcomponent')
|
|
36
|
+
], YourWebComponent);
|
|
37
|
+
export { YourWebComponent };
|
|
38
|
+
//# sourceMappingURL=your-webcomponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"your-webcomponent.js","sourceRoot":"","sources":["../../src/your-webcomponent.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG5D,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,UAAU;IAAhD;;QAC8B,UAAK,GAAG,WAAW,CAAC;QAEpB,YAAO,GAAG,CAAC,CAAC;IAqB1C,CAAC;IAnBS,SAAS;QACf,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;YACH,IAAI,CAAC,KAAK,aAAa,IAAI,CAAC,OAAO;uBACxB,IAAI,CAAC,SAAS;;KAEhC,CAAC;IACJ,CAAC;CASF,CAAA;AAPQ,uBAAM,GAAG,GAAG,CAAA;;;;;;GAMlB,CAAC;AAtB0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAqB;AAEpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAa;AAH7B,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAwB5B;SAxBY,gBAAgB","sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\n\n@customElement('your-webcomponent')\nexport class YourWebComponent extends LitElement {\n @property({ type: String }) title = 'Hey there';\n\n @property({ type: Number }) counter = 5;\n\n private increment() {\n this.counter += 1;\n }\n\n render() {\n return html`\n <h2>${this.title}, Number: ${this.counter}!</h2>\n <button @click=${this.increment}>increment</button>\n <slot name=\"my-slot\"> </slot>\n `;\n }\n\n static styles = css`\n :host {\n display: block;\n padding: 25px;\n color: var(--your-webcomponent-text-color, #000);\n }\n `;\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediatype-icon.test.js","sourceRoot":"","sources":["../../test/mediatype-icon.test.ts"],"names":[],"mappings":";AAAA,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC","sourcesContent":["describe('MediatypeIcon', () => {});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
import { mediatypeConfig } from '../src/mediatype/mediatypeConfig';
|
|
3
|
+
describe('mediatypeConfig', () => {
|
|
4
|
+
it('returns undefined', () => {
|
|
5
|
+
expect(mediatypeConfig['']).to.equal(undefined);
|
|
6
|
+
expect(mediatypeConfig.test).to.equal(undefined);
|
|
7
|
+
expect(mediatypeConfig.media).to.equal(undefined);
|
|
8
|
+
expect(mediatypeConfig.testing).to.equal(undefined);
|
|
9
|
+
});
|
|
10
|
+
it('returns audio', () => {
|
|
11
|
+
expect(mediatypeConfig.audio).to.exist;
|
|
12
|
+
expect(mediatypeConfig.audio.color).to.exist;
|
|
13
|
+
expect(mediatypeConfig.audio.icon).to.exist;
|
|
14
|
+
expect(mediatypeConfig.audio.text).to.exist;
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=mediatypeConfig.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediatypeConfig.test.js","sourceRoot":"","sources":["../../test/mediatypeConfig.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3B,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAChD,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACjD,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAClD,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QACvB,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QACvC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QAC7C,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QAC5C,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect } from '@open-wc/testing';\nimport { mediatypeConfig } from '../src/mediatype/mediatypeConfig';\n\ndescribe('mediatypeConfig', () => {\n it('returns undefined', () => {\n expect(mediatypeConfig['']).to.equal(undefined);\n expect(mediatypeConfig.test).to.equal(undefined);\n expect(mediatypeConfig.media).to.equal(undefined);\n expect(mediatypeConfig.testing).to.equal(undefined);\n });\n\n it('returns audio', () => {\n expect(mediatypeConfig.audio).to.exist;\n expect(mediatypeConfig.audio.color).to.exist;\n expect(mediatypeConfig.audio.icon).to.exist;\n expect(mediatypeConfig.audio.text).to.exist;\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
import { isStrOneLiner } from '../../src/utils/format-string';
|
|
3
|
+
const testShortTextNoSpaces = 'Loremipsumdolorsitamet';
|
|
4
|
+
const testLongText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua';
|
|
5
|
+
const testLongOnelineText = 'Loremipsumdolorsitamet,consecteturadipiscingelit,seddoeiusmodtemporincididuntutlaboreetdoloremagnaaliqua';
|
|
6
|
+
describe('isStrOneLiner', () => {
|
|
7
|
+
it('returns true if string has no spaces and have long text', () => {
|
|
8
|
+
expect(isStrOneLiner(testLongOnelineText)).to.equal(true);
|
|
9
|
+
});
|
|
10
|
+
it('returns false if string has no spaces but text length not more than 24', () => {
|
|
11
|
+
expect(isStrOneLiner(testShortTextNoSpaces)).to.equal(false);
|
|
12
|
+
});
|
|
13
|
+
it('returns false if string has spaces', () => {
|
|
14
|
+
expect(isStrOneLiner(testLongText)).to.equal(false);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=format-string.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-string.test.js","sourceRoot":"","sources":["../../../test/utils/format-string.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AACvD,MAAM,YAAY,GAChB,4HAA4H,CAAC;AAC/H,MAAM,mBAAmB,GACvB,0GAA0G,CAAC;AAE7G,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;QAChF,MAAM,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect } from '@open-wc/testing';\nimport { isStrOneLiner } from '../../src/utils/format-string';\n\nconst testShortTextNoSpaces = 'Loremipsumdolorsitamet';\nconst testLongText =\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua';\nconst testLongOnelineText =\n 'Loremipsumdolorsitamet,consecteturadipiscingelit,seddoeiusmodtemporincididuntutlaboreetdoloremagnaaliqua';\n\ndescribe('isStrOneLiner', () => {\n it('returns true if string has no spaces and have long text', () => {\n expect(isStrOneLiner(testLongOnelineText)).to.equal(true);\n });\n\n it('returns false if string has no spaces but text length not more than 24', () => {\n expect(isStrOneLiner(testShortTextNoSpaces)).to.equal(false);\n });\n\n it('returns false if string has spaces', () => {\n expect(isStrOneLiner(testLongText)).to.equal(false);\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../src/your-webcomponent';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { html, fixture, expect } from '@open-wc/testing';
|
|
2
|
+
import '../src/your-webcomponent';
|
|
3
|
+
describe('YourWebComponent', () => {
|
|
4
|
+
it('has a default title "Hey there" and counter 5', async () => {
|
|
5
|
+
const el = await fixture(html `<your-webcomponent></your-webcomponent>`);
|
|
6
|
+
expect(el.title).to.equal('Hey there');
|
|
7
|
+
expect(el.counter).to.equal(5);
|
|
8
|
+
});
|
|
9
|
+
it('increases the counter on button click', async () => {
|
|
10
|
+
const el = await fixture(html `<your-webcomponent></your-webcomponent>`);
|
|
11
|
+
el.shadowRoot.querySelector('button').click();
|
|
12
|
+
expect(el.counter).to.equal(6);
|
|
13
|
+
});
|
|
14
|
+
it('can override the title via attribute', async () => {
|
|
15
|
+
const el = await fixture(html `<your-webcomponent title="attribute title"></your-webcomponent>`);
|
|
16
|
+
expect(el.title).to.equal('attribute title');
|
|
17
|
+
});
|
|
18
|
+
it('passes the a11y audit', async () => {
|
|
19
|
+
const el = await fixture(html `<your-webcomponent></your-webcomponent>`);
|
|
20
|
+
await expect(el).shadowDom.to.be.accessible();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=your-webcomponent.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"your-webcomponent.test.js","sourceRoot":"","sources":["../../test/your-webcomponent.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,0BAA0B,CAAC;AAElC,QAAQ,CAAC,k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port type { YourWebComponent } from '../src/your-webcomponent';\nimport '../src/your-webcomponent';\n\ndescribe('YourWebComponent', () => {\n it('has a default title \"Hey there\" and counter 5', async () => {\n const el = await fixture<YourWebComponent>(\n html`<your-webcomponent></your-webcomponent>`\n );\n\n expect(el.title).to.equal('Hey there');\n expect(el.counter).to.equal(5);\n });\n\n it('increases the counter on button click', async () => {\n const el = await fixture<YourWebComponent>(\n html`<your-webcomponent></your-webcomponent>`\n );\n el.shadowRoot!.querySelector('button')!.click();\n\n expect(el.counter).to.equal(6);\n });\n\n it('can override the title via attribute', async () => {\n const el = await fixture<YourWebComponent>(\n html`<your-webcomponent title=\"attribute title\"></your-webcomponent>`\n );\n\n expect(el.title).to.equal('attribute title');\n });\n\n it('passes the a11y audit', async () => {\n const el = await fixture<YourWebComponent>(\n html`<your-webcomponent></your-webcomponent>`\n );\n\n await expect(el).shadowDom.to.be.accessible();\n });\n});\n"]}
|