@internetarchive/collection-browser 0.1.1 → 0.1.3
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/demo/app-root.ts +1 -0
- package/dist/demo/app-root.js +1 -0
- package/dist/demo/app-root.js.map +1 -1
- package/dist/src/collection-browser.d.ts +1 -0
- package/dist/src/collection-browser.js +7 -1
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +1 -1
- package/dist/src/tiles/grid/item-tile.js +2 -5
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +1 -1
- package/dist/src/tiles/item-image.js +3 -3
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.d.ts +1 -0
- package/dist/src/tiles/list/tile-list-compact.js +4 -1
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +1 -0
- package/dist/src/tiles/list/tile-list.js +4 -1
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +1 -0
- package/dist/src/tiles/tile-dispatcher.js +6 -1
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/utils/format-date.js.map +1 -1
- package/dist/test/collection-browser.test.js +28 -0
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/mocks/mock-collection-name-cache.d.ts +7 -0
- package/dist/test/mocks/mock-collection-name-cache.js +14 -0
- package/dist/test/mocks/mock-collection-name-cache.js.map +1 -0
- package/dist/test/mocks/mock-search-responses.d.ts +3 -0
- package/dist/test/mocks/mock-search-responses.js +32 -0
- package/dist/test/mocks/mock-search-responses.js.map +1 -0
- package/dist/test/mocks/mock-search-service.d.ts +8 -0
- package/dist/test/mocks/mock-search-service.js +16 -0
- package/dist/test/mocks/mock-search-service.js.map +1 -0
- package/package.json +3 -3
- package/src/collection-browser.ts +8 -1
- package/src/tiles/grid/item-tile.ts +2 -5
- package/src/tiles/item-image.ts +3 -3
- package/src/tiles/list/tile-list-compact.ts +3 -1
- package/src/tiles/list/tile-list.ts +3 -1
- package/src/tiles/tile-dispatcher.ts +5 -1
- package/src/utils/format-date.ts +1 -1
- package/test/collection-browser.test.ts +39 -0
- package/test/mocks/mock-collection-name-cache.ts +16 -0
- package/test/mocks/mock-search-responses.ts +37 -0
- package/test/mocks/mock-search-service.ts +35 -0
- package/dist/src/assets/img/icons/mediatype/livemusic.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/livemusic.js +0 -7
- package/dist/src/assets/img/icons/mediatype/livemusic.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/photos.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/photos.js +0 -7
- package/dist/src/assets/img/icons/mediatype/photos.js.map +0 -1
- package/dist/src/helpers.d.ts +0 -1
- package/dist/src/helpers.js +0 -20
- package/dist/src/helpers.js.map +0 -1
- package/dist/src/mediatype/mediatype-color.d.ts +0 -3
- package/dist/src/mediatype/mediatype-color.js +0 -15
- package/dist/src/mediatype/mediatype-color.js.map +0 -1
- package/dist/src/mediatype/mediatype-display.d.ts +0 -3
- package/dist/src/mediatype/mediatype-display.js +0 -86
- package/dist/src/mediatype/mediatype-display.js.map +0 -1
- package/dist/src/mediatype/mediatype-icon.d.ts +0 -10
- package/dist/src/mediatype/mediatype-icon.js +0 -105
- package/dist/src/mediatype/mediatype-icon.js.map +0 -1
- package/dist/src/mediatype/mediatype-text.d.ts +0 -3
- package/dist/src/mediatype/mediatype-text.js +0 -17
- package/dist/src/mediatype/mediatype-text.js.map +0 -1
- package/dist/src/mediatype/mediatypeConfig.d.ts +0 -3
- package/dist/src/mediatype/mediatypeConfig.js +0 -86
- package/dist/src/mediatype/mediatypeConfig.js.map +0 -1
- package/dist/src/mediatype-icon.d.ts +0 -9
- package/dist/src/mediatype-icon.js +0 -78
- package/dist/src/mediatype-icon.js.map +0 -1
- package/dist/src/sort-filter-bar/img/grid.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/grid.js +0 -5
- package/dist/src/sort-filter-bar/img/grid.js.map +0 -1
- package/dist/src/tiles/list/tile-list-detail.d.ts +0 -7
- package/dist/src/tiles/list/tile-list-detail.js +0 -28
- package/dist/src/tiles/list/tile-list-detail.js.map +0 -1
- package/dist/src/tiles/loading-tile.d.ts +0 -5
- package/dist/src/tiles/loading-tile.js +0 -32
- package/dist/src/tiles/loading-tile.js.map +0 -1
- package/dist/src/utils/format-string.d.ts +0 -2
- package/dist/src/utils/format-string.js +0 -7
- package/dist/src/utils/format-string.js.map +0 -1
- package/dist/src/waveform-thumbnail.d.ts +0 -7
- package/dist/src/waveform-thumbnail.js +0 -106
- package/dist/src/waveform-thumbnail.js.map +0 -1
- package/dist/src/waveform-view.d.ts +0 -0
- package/dist/src/waveform-view.js +0 -2
- package/dist/src/waveform-view.js.map +0 -1
- package/dist/src/your-webcomponent.d.ts +0 -8
- package/dist/src/your-webcomponent.js +0 -38
- package/dist/src/your-webcomponent.js.map +0 -1
- package/dist/test/mediatype-icon.test.d.ts +0 -0
- package/dist/test/mediatype-icon.test.js +0 -3
- package/dist/test/mediatype-icon.test.js.map +0 -1
- package/dist/test/mediatypeConfig.test.d.ts +0 -1
- package/dist/test/mediatypeConfig.test.js +0 -17
- package/dist/test/mediatypeConfig.test.js.map +0 -1
- package/dist/test/utils/format-string.test.d.ts +0 -1
- package/dist/test/utils/format-string.test.js +0 -17
- package/dist/test/utils/format-string.test.js.map +0 -1
- package/dist/test/your-webcomponent.test.d.ts +0 -1
- package/dist/test/your-webcomponent.test.js +0 -23
- package/dist/test/your-webcomponent.test.js.map +0 -1
|
@@ -39,6 +39,8 @@ export class TileList extends LitElement {
|
|
|
39
39
|
|
|
40
40
|
@state() private collectionLinks: TemplateResult[] = [];
|
|
41
41
|
|
|
42
|
+
@property({ type: String }) baseImageUrl?: string;
|
|
43
|
+
|
|
42
44
|
protected updated(changed: PropertyValues): void {
|
|
43
45
|
if (changed.has('model')) {
|
|
44
46
|
this.fetchCollectionNames();
|
|
@@ -133,7 +135,7 @@ export class TileList extends LitElement {
|
|
|
133
135
|
return nothing;
|
|
134
136
|
}
|
|
135
137
|
return html` <img
|
|
136
|
-
src="${this.
|
|
138
|
+
src="${this.baseImageUrl}/services/img/${this.model.identifier}"
|
|
137
139
|
alt="${this.model.identifier}"
|
|
138
140
|
class=${this.model?.mediatype}
|
|
139
141
|
/>`;
|
|
@@ -41,6 +41,8 @@ export class TileDispatcher
|
|
|
41
41
|
|
|
42
42
|
@property({ type: Number }) mobileBreakpoint?: number;
|
|
43
43
|
|
|
44
|
+
@property({ type: String }) baseImageUrl?: string;
|
|
45
|
+
|
|
44
46
|
render() {
|
|
45
47
|
return html`
|
|
46
48
|
<div id="container">
|
|
@@ -148,10 +150,10 @@ export class TileDispatcher
|
|
|
148
150
|
default:
|
|
149
151
|
return html`<item-tile
|
|
150
152
|
.model=${model}
|
|
151
|
-
.baseNavigationUrl=${this.baseNavigationUrl}
|
|
152
153
|
.currentWidth=${this.currentWidth}
|
|
153
154
|
.currentHeight=${this.currentHeight}
|
|
154
155
|
.collectionNameCache=${this.collectionNameCache}
|
|
156
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
155
157
|
></item-tile>`;
|
|
156
158
|
}
|
|
157
159
|
case 'list-compact':
|
|
@@ -162,6 +164,7 @@ export class TileDispatcher
|
|
|
162
164
|
.baseNavigationUrl=${baseNavigationUrl}
|
|
163
165
|
.sortParam=${sortParam}
|
|
164
166
|
.mobileBreakpoint=${mobileBreakpoint}
|
|
167
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
165
168
|
></tile-list-compact>`;
|
|
166
169
|
case 'list-detail':
|
|
167
170
|
return html`<tile-list
|
|
@@ -172,6 +175,7 @@ export class TileDispatcher
|
|
|
172
175
|
.baseNavigationUrl=${baseNavigationUrl}
|
|
173
176
|
.sortParam=${sortParam}
|
|
174
177
|
.mobileBreakpoint=${mobileBreakpoint}
|
|
178
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
175
179
|
></tile-list>`;
|
|
176
180
|
default:
|
|
177
181
|
return nothing;
|
package/src/utils/format-date.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { expect, fixture } from '@open-wc/testing';
|
|
|
3
3
|
import { html } from 'lit';
|
|
4
4
|
import { CollectionBrowser } from '../src/collection-browser';
|
|
5
5
|
import '../src/collection-browser';
|
|
6
|
+
import { MockSearchService } from './mocks/mock-search-service';
|
|
7
|
+
import { MockCollectionNameCache } from './mocks/mock-collection-name-cache';
|
|
6
8
|
|
|
7
9
|
describe('Collection Browser', () => {
|
|
8
10
|
it('should render with a sort bar, facets, and infinite scroller', async () => {
|
|
@@ -17,4 +19,41 @@ describe('Collection Browser', () => {
|
|
|
17
19
|
expect(sortBar).to.exist;
|
|
18
20
|
expect(infiniteScroller).to.exist;
|
|
19
21
|
});
|
|
22
|
+
|
|
23
|
+
it('queries the search service when given a base query', async () => {
|
|
24
|
+
const searchService = new MockSearchService();
|
|
25
|
+
|
|
26
|
+
const el = await fixture<CollectionBrowser>(
|
|
27
|
+
html`<collection-browser
|
|
28
|
+
.searchService=${searchService}
|
|
29
|
+
></collection-browser>`
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
el.baseQuery = 'collection:foo';
|
|
33
|
+
await el.updateComplete;
|
|
34
|
+
|
|
35
|
+
expect(searchService.searchParams?.query).to.equal('collection:foo');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('queries for collection names after a fetch', async () => {
|
|
39
|
+
const searchService = new MockSearchService();
|
|
40
|
+
const collectionNameCache = new MockCollectionNameCache();
|
|
41
|
+
|
|
42
|
+
const el = await fixture<CollectionBrowser>(
|
|
43
|
+
html`<collection-browser
|
|
44
|
+
.searchService=${searchService}
|
|
45
|
+
.collectionNameCache=${collectionNameCache}
|
|
46
|
+
></collection-browser>`
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
el.baseQuery = 'blahblah';
|
|
50
|
+
await el.updateComplete;
|
|
51
|
+
|
|
52
|
+
expect(collectionNameCache.preloadIdentifiersRequested).to.deep.equal([
|
|
53
|
+
'foo',
|
|
54
|
+
'bar',
|
|
55
|
+
'baz',
|
|
56
|
+
'boop',
|
|
57
|
+
]);
|
|
58
|
+
});
|
|
20
59
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
|
|
2
|
+
|
|
3
|
+
export class MockCollectionNameCache implements CollectionNameCacheInterface {
|
|
4
|
+
collectionNamesRequested: string[] = [];
|
|
5
|
+
|
|
6
|
+
preloadIdentifiersRequested: string[] = [];
|
|
7
|
+
|
|
8
|
+
async collectionNameFor(identifier: string): Promise<string | null> {
|
|
9
|
+
this.collectionNamesRequested.push(identifier);
|
|
10
|
+
return `${identifier}-name`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async preloadIdentifiers(identifiers: string[]): Promise<void> {
|
|
14
|
+
this.preloadIdentifiersRequested = identifiers;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Result } from '@internetarchive/result-type';
|
|
2
|
+
import {
|
|
3
|
+
Metadata,
|
|
4
|
+
SearchResponse,
|
|
5
|
+
SearchServiceError,
|
|
6
|
+
} from '@internetarchive/search-service';
|
|
7
|
+
|
|
8
|
+
export const mockSuccessResponse: Result<SearchResponse, SearchServiceError> = {
|
|
9
|
+
success: {
|
|
10
|
+
rawResponse: {},
|
|
11
|
+
response: {
|
|
12
|
+
numFound: 2,
|
|
13
|
+
docs: [
|
|
14
|
+
new Metadata({
|
|
15
|
+
identifier: 'foo',
|
|
16
|
+
collections_raw: ['foo', 'bar'],
|
|
17
|
+
}),
|
|
18
|
+
new Metadata({
|
|
19
|
+
identifier: 'bar',
|
|
20
|
+
collections_raw: ['baz', 'boop'],
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
start: 0,
|
|
24
|
+
},
|
|
25
|
+
responseHeader: {
|
|
26
|
+
status: 0,
|
|
27
|
+
QTime: 0,
|
|
28
|
+
params: {
|
|
29
|
+
query: 'collection:foo',
|
|
30
|
+
qin: 'collection:foo',
|
|
31
|
+
fields: 'identifier, collections_raw',
|
|
32
|
+
wt: 'foo',
|
|
33
|
+
start: 0,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Result } from '@internetarchive/result-type';
|
|
2
|
+
import {
|
|
3
|
+
MetadataResponse,
|
|
4
|
+
SearchParams,
|
|
5
|
+
SearchResponse,
|
|
6
|
+
SearchServiceInterface,
|
|
7
|
+
SearchServiceError,
|
|
8
|
+
} from '@internetarchive/search-service';
|
|
9
|
+
import { mockSuccessResponse } from './mock-search-responses';
|
|
10
|
+
|
|
11
|
+
export class MockSearchService implements SearchServiceInterface {
|
|
12
|
+
searchParams?: SearchParams;
|
|
13
|
+
|
|
14
|
+
async search(
|
|
15
|
+
params: SearchParams
|
|
16
|
+
): Promise<Result<SearchResponse, SearchServiceError>> {
|
|
17
|
+
this.searchParams = params;
|
|
18
|
+
return mockSuccessResponse;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async fetchMetadata(
|
|
22
|
+
identifier: string
|
|
23
|
+
): Promise<Result<MetadataResponse, SearchServiceError>> {
|
|
24
|
+
console.debug('fetchMetadata', identifier);
|
|
25
|
+
throw new Error('Method not implemented.');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async fetchMetadataValue<T>(
|
|
29
|
+
identifier: string,
|
|
30
|
+
keypath: string
|
|
31
|
+
): Promise<Result<T, SearchServiceError>> {
|
|
32
|
+
console.debug('fetchMetadataValue', identifier, keypath);
|
|
33
|
+
throw new Error('Method not implemented.');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const livemusicIcon: import("lit-html").TemplateResult<2>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { svg } from 'lit';
|
|
2
|
-
export const livemusicIcon = svg `
|
|
3
|
-
<svg viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
-
<path d="m136.125893 117.288073c14.41013-4.850562 27.83316-2.109766 39.480173 7.796632 10.335962 8.792594 14.330094 20.428621 14.288498 33.809481-.091795 25.476855-.015572 50.965113-.049872 76.441968-.003811 2.805419-.034301 5.648851-.457344 8.401051-3.376719 21.854139-21.133078 36.299386-43.127486 35.204588-20.210769-1.003564-37.307792-18.132586-37.799436-38.393946-.346818-14.513672-.060979-29.057755-.301084-43.586633 0-12.597776-.06479-25.191751.034301-37.789527.0343-3.656928.16007-7.401288.903253-10.963182 3.18997-15.36138 12.272049-25.963431 27.028997-30.920432zm69.082871-95.288073v20.8201628h-42.6892v27.2482979s2.61448.5740085 3.574902.8363038c23.797103 6.5155667 41.073252 15.8669636 55.262332 37.0824705 8.594246 12.852468 11.643202 31.380398 11.643202 46.760785v15.304359h-20.889162c0-5.538611.099091-10.750305-.038112-15.961998-.099091-3.896415-.167692-7.857454-.842274-11.689246-5.328051-30.262793-30.775402-49.8170956-57.026916-51.5315184-29.311903-1.9120945-57.1907972 18.1858064-64.1500399 46.8520184-1.6657464 6.843753-1.7799637 13.736569-1.7780383 20.63947l.0023262 1.88283c.0030489 1.883022.0050308 3.76653-.0231721 5.649734-.0228671 1.364696 0 2.72559 0 4.052272h-20.5918884c-5.5529117-51.542923 24.3078039-93.7420516 70.1221835-99.8660762v-27.3889489h-42.6205979v-20.6909159z" fill="gray" fill-rule="evenodd" transform="matrix(1 0 0 -1 0 301)"/>
|
|
5
|
-
</svg>
|
|
6
|
-
`;
|
|
7
|
-
//# sourceMappingURL=livemusic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"livemusic.js","sourceRoot":"","sources":["../../../../../../src/assets/img/icons/mediatype/livemusic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;;;;CAI/B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const livemusicIcon = svg`\n<svg viewBox=\"0 0 300 300\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m136.125893 117.288073c14.41013-4.850562 27.83316-2.109766 39.480173 7.796632 10.335962 8.792594 14.330094 20.428621 14.288498 33.809481-.091795 25.476855-.015572 50.965113-.049872 76.441968-.003811 2.805419-.034301 5.648851-.457344 8.401051-3.376719 21.854139-21.133078 36.299386-43.127486 35.204588-20.210769-1.003564-37.307792-18.132586-37.799436-38.393946-.346818-14.513672-.060979-29.057755-.301084-43.586633 0-12.597776-.06479-25.191751.034301-37.789527.0343-3.656928.16007-7.401288.903253-10.963182 3.18997-15.36138 12.272049-25.963431 27.028997-30.920432zm69.082871-95.288073v20.8201628h-42.6892v27.2482979s2.61448.5740085 3.574902.8363038c23.797103 6.5155667 41.073252 15.8669636 55.262332 37.0824705 8.594246 12.852468 11.643202 31.380398 11.643202 46.760785v15.304359h-20.889162c0-5.538611.099091-10.750305-.038112-15.961998-.099091-3.896415-.167692-7.857454-.842274-11.689246-5.328051-30.262793-30.775402-49.8170956-57.026916-51.5315184-29.311903-1.9120945-57.1907972 18.1858064-64.1500399 46.8520184-1.6657464 6.843753-1.7799637 13.736569-1.7780383 20.63947l.0023262 1.88283c.0030489 1.883022.0050308 3.76653-.0231721 5.649734-.0228671 1.364696 0 2.72559 0 4.052272h-20.5918884c-5.5529117-51.542923 24.3078039-93.7420516 70.1221835-99.8660762v-27.3889489h-42.6205979v-20.6909159z\" fill=\"gray\" fill-rule=\"evenodd\" transform=\"matrix(1 0 0 -1 0 301)\"/>\n</svg>\n`;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const photosIcon: import("lit-html").TemplateResult<2>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { svg } from 'lit';
|
|
2
|
-
export const photosIcon = svg `
|
|
3
|
-
<svg viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
-
<path d="m43.0952612 181.159979c2.1744514 0 21.7161099 3.336499 21.7161099 3.336499v21.030628l-44.8113711-6.289709c4.5382599-51.29161 9.6729948-105.5332879 14.6089046-156.237397 66.1329874 6.484496 144.5110704 16.1138469 211.0385514 22.4035567-.987813 6.4876377-1.581132 21.8160564-1.972471 28.3005524-4.939065-.5906421-15.599873 0-20.535783-.5906421v-9.0418506c-56.065498-5.3032118-112.326666-12.180422-168.3953197-17.6847035 0 0-7.7005244 74.2858081-11.6486211 114.7730661zm31.7867547-81.562016h205.1179841v158.402037h-205.1179841zm18.9514955 140.126691h167.8051566v-64.461671l-21.122791 35.963191-28.428821-67.408598-24.2819 28.891194-66.530637-54.634392h-27.4410076zm64.5550106-40.487257c0-11.394994-9.082832-20.436845-20.731453-20.436845-11.250971 0-20.923965 9.041851-20.923965 20.436845 0 11.203349 9.672994 20.439986 20.923965 20.439986 11.648621 0 20.731453-9.236637 20.731453-20.439986z" fill="gray" transform="matrix(1 0 0 -1 0 301)"/>
|
|
5
|
-
</svg>
|
|
6
|
-
`;
|
|
7
|
-
//# sourceMappingURL=photos.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"photos.js","sourceRoot":"","sources":["../../../../../../src/assets/img/icons/mediatype/photos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;CAI5B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const photosIcon = svg`\n<svg viewBox=\"0 0 300 300\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m43.0952612 181.159979c2.1744514 0 21.7161099 3.336499 21.7161099 3.336499v21.030628l-44.8113711-6.289709c4.5382599-51.29161 9.6729948-105.5332879 14.6089046-156.237397 66.1329874 6.484496 144.5110704 16.1138469 211.0385514 22.4035567-.987813 6.4876377-1.581132 21.8160564-1.972471 28.3005524-4.939065-.5906421-15.599873 0-20.535783-.5906421v-9.0418506c-56.065498-5.3032118-112.326666-12.180422-168.3953197-17.6847035 0 0-7.7005244 74.2858081-11.6486211 114.7730661zm31.7867547-81.562016h205.1179841v158.402037h-205.1179841zm18.9514955 140.126691h167.8051566v-64.461671l-21.122791 35.963191-28.428821-67.408598-24.2819 28.891194-66.530637-54.634392h-27.4410076zm64.5550106-40.487257c0-11.394994-9.082832-20.436845-20.731453-20.436845-11.250971 0-20.923965 9.041851-20.923965 20.436845 0 11.203349 9.672994 20.439986 20.923965 20.439986 11.648621 0 20.731453-9.236637 20.731453-20.439986z\" fill=\"gray\" transform=\"matrix(1 0 0 -1 0 301)\"/>\n</svg>\n`;\n"]}
|
package/dist/src/helpers.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const nFormatter: (num: any, digits: number) => string;
|
package/dist/src/helpers.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const nFormatter = (num, digits) => {
|
|
2
|
-
const lookup = [
|
|
3
|
-
{ value: 1, symbol: '' },
|
|
4
|
-
{ value: 1e3, symbol: 'K' },
|
|
5
|
-
{ value: 1e6, symbol: 'M' },
|
|
6
|
-
{ value: 1e9, symbol: 'B' },
|
|
7
|
-
{ value: 1e12, symbol: 'T' },
|
|
8
|
-
{ value: 1e15, symbol: 'P' },
|
|
9
|
-
{ value: 1e18, symbol: 'E' },
|
|
10
|
-
];
|
|
11
|
-
const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
|
|
12
|
-
const item = lookup
|
|
13
|
-
.slice()
|
|
14
|
-
.reverse()
|
|
15
|
-
.find(i => num >= i.value);
|
|
16
|
-
return item
|
|
17
|
-
? (num / item.value).toFixed(digits).replace(rx, '$1') + item.symbol
|
|
18
|
-
: '0';
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=helpers.js.map
|
package/dist/src/helpers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAQ,EAAE,MAAc,EAAE,EAAE;IACrD,MAAM,MAAM,GAAG;QACb,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;QACxB,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;QAC3B,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;QAC3B,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;QAC3B,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;QAC5B,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;QAC5B,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;KAC7B,CAAC;IACF,MAAM,EAAE,GAAG,0BAA0B,CAAC;IACtC,MAAM,IAAI,GAAG,MAAM;SAChB,KAAK,EAAE;SACP,OAAO,EAAE;SACT,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,IAAI;QACT,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM;QACpE,CAAC,CAAC,GAAG,CAAC;AACV,CAAC,CAAC","sourcesContent":["export const nFormatter = (num: any, digits: number) => {\n const lookup = [\n { value: 1, symbol: '' },\n { value: 1e3, symbol: 'K' },\n { value: 1e6, symbol: 'M' },\n { value: 1e9, symbol: 'B' },\n { value: 1e12, symbol: 'T' },\n { value: 1e15, symbol: 'P' },\n { value: 1e18, symbol: 'E' },\n ];\n const rx = /\\.0+$|(\\.[0-9]*[1-9])0+$/;\n const item = lookup\n .slice()\n .reverse()\n .find(i => num >= i.value);\n return item\n ? (num / item.value).toFixed(digits).replace(rx, '$1') + item.symbol\n : '0';\n};\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const mediatypeColor = {
|
|
2
|
-
account: '#000000',
|
|
3
|
-
audio: '#8fdaef',
|
|
4
|
-
data: '#333333',
|
|
5
|
-
etree: '#3871c1',
|
|
6
|
-
film: '#bf1b2c',
|
|
7
|
-
image: '#62c4a9',
|
|
8
|
-
movies: '#bf1b2c',
|
|
9
|
-
software: '#80cc28',
|
|
10
|
-
texts: '#f9a72b',
|
|
11
|
-
tv: '#f25d54',
|
|
12
|
-
video: '#bf1b2c',
|
|
13
|
-
web: '#fddd10',
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=mediatype-color.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mediatype-color.js","sourceRoot":"","sources":["../../../src/mediatype/mediatype-color.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAA8B;IACvD,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,SAAS;IAChB,EAAE,EAAE,SAAS;IACb,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,SAAS;CACf,CAAC","sourcesContent":["export const mediatypeColor: { [key: string]: string } = {\n account: '#000000',\n audio: '#8fdaef',\n data: '#333333',\n etree: '#3871c1',\n film: '#bf1b2c',\n image: '#62c4a9',\n movies: '#bf1b2c',\n software: '#80cc28',\n texts: '#f9a72b',\n tv: '#f25d54',\n video: '#bf1b2c',\n web: '#fddd10',\n};\n"]}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { accountIcon } from '../assets/img/icons/mediatype/account';
|
|
2
|
-
import { audioIcon } from '../assets/img/icons/mediatype/audio';
|
|
3
|
-
import { collectionIcon } from '../assets/img/icons/mediatype/collection';
|
|
4
|
-
import { dataIcon } from '../assets/img/icons/mediatype/data';
|
|
5
|
-
import { etreeIcon } from '../assets/img/icons/mediatype/etree';
|
|
6
|
-
import { imagesIcon } from '../assets/img/icons/mediatype/images';
|
|
7
|
-
import { filmIcon } from '../assets/img/icons/mediatype/film';
|
|
8
|
-
import { radioIcon } from '../assets/img/icons/mediatype/radio';
|
|
9
|
-
import { softwareIcon } from '../assets/img/icons/mediatype/software';
|
|
10
|
-
import { textsIcon } from '../assets/img/icons/mediatype/texts';
|
|
11
|
-
import { tvIcon } from '../assets/img/icons/mediatype/tv';
|
|
12
|
-
import { videoIcon } from '../assets/img/icons/mediatype/video';
|
|
13
|
-
import { webIcon } from '../assets/img/icons/mediatype/web';
|
|
14
|
-
export const mediatypeData = {
|
|
15
|
-
account: {
|
|
16
|
-
color: '#000000',
|
|
17
|
-
icon: accountIcon,
|
|
18
|
-
text: 'Account',
|
|
19
|
-
},
|
|
20
|
-
audio: {
|
|
21
|
-
color: '#8fdaef',
|
|
22
|
-
icon: audioIcon,
|
|
23
|
-
text: 'Audio',
|
|
24
|
-
},
|
|
25
|
-
collection: {
|
|
26
|
-
color: '#000000',
|
|
27
|
-
icon: collectionIcon,
|
|
28
|
-
text: 'Collection',
|
|
29
|
-
},
|
|
30
|
-
data: {
|
|
31
|
-
color: '#333333',
|
|
32
|
-
icon: dataIcon,
|
|
33
|
-
text: 'Data',
|
|
34
|
-
},
|
|
35
|
-
etree: {
|
|
36
|
-
color: '#3871c1',
|
|
37
|
-
icon: etreeIcon,
|
|
38
|
-
text: 'E-tree',
|
|
39
|
-
},
|
|
40
|
-
film: {
|
|
41
|
-
color: '#bf1b2c',
|
|
42
|
-
icon: filmIcon,
|
|
43
|
-
text: 'Film',
|
|
44
|
-
},
|
|
45
|
-
image: {
|
|
46
|
-
color: '#62c4a9',
|
|
47
|
-
icon: imagesIcon,
|
|
48
|
-
text: 'Image',
|
|
49
|
-
},
|
|
50
|
-
movies: {
|
|
51
|
-
color: '#bf1b2c',
|
|
52
|
-
icon: filmIcon,
|
|
53
|
-
text: 'Movie',
|
|
54
|
-
},
|
|
55
|
-
radio: {
|
|
56
|
-
color: '#8fdaef',
|
|
57
|
-
icon: radioIcon,
|
|
58
|
-
text: 'Radio',
|
|
59
|
-
},
|
|
60
|
-
software: {
|
|
61
|
-
color: '#80cc28',
|
|
62
|
-
icon: softwareIcon,
|
|
63
|
-
text: 'Software',
|
|
64
|
-
},
|
|
65
|
-
texts: {
|
|
66
|
-
color: '#f9a72b',
|
|
67
|
-
icon: textsIcon,
|
|
68
|
-
text: 'Text',
|
|
69
|
-
},
|
|
70
|
-
tv: {
|
|
71
|
-
color: '#f25d54',
|
|
72
|
-
icon: tvIcon,
|
|
73
|
-
text: 'TV',
|
|
74
|
-
},
|
|
75
|
-
video: {
|
|
76
|
-
color: '#bf1b2c',
|
|
77
|
-
icon: videoIcon,
|
|
78
|
-
text: 'Video',
|
|
79
|
-
},
|
|
80
|
-
web: {
|
|
81
|
-
color: '#fddd10',
|
|
82
|
-
icon: webIcon,
|
|
83
|
-
text: 'Web',
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=mediatype-display.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mediatype-display.js","sourceRoot":"","sources":["../../../src/mediatype/mediatype-display.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAE5D,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,OAAO,EAAE;QACP,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;KAChB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,OAAO;KACd;IACD,UAAU,EAAE;QACV,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,YAAY;KACnB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;KACb;IACD,KAAK,EAAE;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;KACf;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;KACb;IACD,KAAK,EAAE;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACd;IACD,MAAM,EAAE;QACN,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,OAAO;KACd;IACD,KAAK,EAAE;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,OAAO;KACd;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,UAAU;KACjB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,MAAM;KACb;IACD,EAAE,EAAE;QACF,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACX;IACD,KAAK,EAAE;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,OAAO;KACd;IACD,GAAG,EAAE;QACH,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,KAAK;KACZ;CACF,CAAC","sourcesContent":["import { accountIcon } from '../assets/img/icons/mediatype/account';\nimport { audioIcon } from '../assets/img/icons/mediatype/audio';\nimport { collectionIcon } from '../assets/img/icons/mediatype/collection';\nimport { dataIcon } from '../assets/img/icons/mediatype/data';\nimport { etreeIcon } from '../assets/img/icons/mediatype/etree';\nimport { imagesIcon } from '../assets/img/icons/mediatype/images';\nimport { filmIcon } from '../assets/img/icons/mediatype/film';\nimport { radioIcon } from '../assets/img/icons/mediatype/radio';\nimport { softwareIcon } from '../assets/img/icons/mediatype/software';\nimport { textsIcon } from '../assets/img/icons/mediatype/texts';\nimport { tvIcon } from '../assets/img/icons/mediatype/tv';\nimport { videoIcon } from '../assets/img/icons/mediatype/video';\nimport { webIcon } from '../assets/img/icons/mediatype/web';\n\nexport const mediatypeData: { [key: string]: any } = {\n account: {\n color: '#000000',\n icon: accountIcon,\n text: 'Account',\n },\n audio: {\n color: '#8fdaef',\n icon: audioIcon,\n text: 'Audio',\n },\n collection: {\n color: '#000000',\n icon: collectionIcon,\n text: 'Collection',\n },\n data: {\n color: '#333333',\n icon: dataIcon,\n text: 'Data',\n },\n etree: {\n color: '#3871c1',\n icon: etreeIcon,\n text: 'E-tree',\n },\n film: {\n color: '#bf1b2c',\n icon: filmIcon,\n text: 'Film',\n },\n image: {\n color: '#62c4a9',\n icon: imagesIcon,\n text: 'Image',\n },\n movies: {\n color: '#bf1b2c',\n icon: filmIcon,\n text: 'Movie',\n },\n radio: {\n color: '#8fdaef',\n icon: radioIcon,\n text: 'Radio',\n },\n software: {\n color: '#80cc28',\n icon: softwareIcon,\n text: 'Software',\n },\n texts: {\n color: '#f9a72b',\n icon: textsIcon,\n text: 'Text',\n },\n tv: {\n color: '#f25d54',\n icon: tvIcon,\n text: 'TV',\n },\n video: {\n color: '#bf1b2c',\n icon: videoIcon,\n text: 'Video',\n },\n web: {\n color: '#fddd10',\n icon: webIcon,\n text: 'Web',\n },\n};\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement } from 'lit';
|
|
2
|
-
export declare class MediatypeIcon extends LitElement {
|
|
3
|
-
mediatype: string | undefined;
|
|
4
|
-
collections: string[] | undefined;
|
|
5
|
-
showText: boolean;
|
|
6
|
-
private readonly mediatypeIcons;
|
|
7
|
-
private get displayMediaType();
|
|
8
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
-
static get styles(): CSSResultGroup;
|
|
10
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { css, html, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import { accountIcon } from '../assets/img/icons/mediatype/account';
|
|
5
|
-
import { audioIcon } from '../assets/img/icons/mediatype/audio';
|
|
6
|
-
import { collectionIcon } from '../assets/img/icons/mediatype/collection';
|
|
7
|
-
import { dataIcon } from '../assets/img/icons/mediatype/data';
|
|
8
|
-
import { etreeIcon } from '../assets/img/icons/mediatype/etree';
|
|
9
|
-
import { imagesIcon } from '../assets/img/icons/mediatype/images';
|
|
10
|
-
import { filmIcon } from '../assets/img/icons/mediatype/film';
|
|
11
|
-
import { radioIcon } from '../assets/img/icons/mediatype/radio';
|
|
12
|
-
import { softwareIcon } from '../assets/img/icons/mediatype/software';
|
|
13
|
-
import { textsIcon } from '../assets/img/icons/mediatype/texts';
|
|
14
|
-
import { tvIcon } from '../assets/img/icons/mediatype/tv';
|
|
15
|
-
import { videoIcon } from '../assets/img/icons/mediatype/video';
|
|
16
|
-
import { webIcon } from '../assets/img/icons/mediatype/web';
|
|
17
|
-
import { mediatypeColor } from './mediatype-color';
|
|
18
|
-
import { mediatypeText } from './mediatype-text';
|
|
19
|
-
let MediatypeIcon = class MediatypeIcon extends LitElement {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
this.showText = false;
|
|
23
|
-
this.mediatypeIcons = {
|
|
24
|
-
account: accountIcon,
|
|
25
|
-
audio: audioIcon,
|
|
26
|
-
collection: collectionIcon,
|
|
27
|
-
data: dataIcon,
|
|
28
|
-
etree: etreeIcon,
|
|
29
|
-
film: filmIcon,
|
|
30
|
-
image: imagesIcon,
|
|
31
|
-
movies: filmIcon,
|
|
32
|
-
radio: radioIcon,
|
|
33
|
-
software: softwareIcon,
|
|
34
|
-
texts: textsIcon,
|
|
35
|
-
tv: tvIcon,
|
|
36
|
-
video: videoIcon,
|
|
37
|
-
web: webIcon,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
get displayMediaType() {
|
|
41
|
-
var _a, _b;
|
|
42
|
-
const tvIdentifier = ['tvnews', 'tvarchive', 'television'];
|
|
43
|
-
const radioIdentifier = ['radio', 'radioprogram'];
|
|
44
|
-
if (this.mediatype === 'movies' &&
|
|
45
|
-
((_a = this.collections) === null || _a === void 0 ? void 0 : _a.some(id => tvIdentifier.indexOf(id) >= 0))) {
|
|
46
|
-
return 'tv';
|
|
47
|
-
}
|
|
48
|
-
if (this.mediatype === 'audio' &&
|
|
49
|
-
((_b = this.collections) === null || _b === void 0 ? void 0 : _b.some(id => radioIdentifier.indexOf(id) >= 0))) {
|
|
50
|
-
return 'radio';
|
|
51
|
-
}
|
|
52
|
-
return this.mediatype;
|
|
53
|
-
}
|
|
54
|
-
render() {
|
|
55
|
-
if (!this.mediatype) {
|
|
56
|
-
return html ``;
|
|
57
|
-
}
|
|
58
|
-
const displayMediatype = this.displayMediaType || '';
|
|
59
|
-
const fillColor = mediatypeColor[displayMediatype];
|
|
60
|
-
return html `
|
|
61
|
-
<div id="icon" class="${this.showText ? 'show-text' : 'hide-text'}" style="--iconFillColor=${fillColor}">
|
|
62
|
-
${this.mediatypeIcons[displayMediatype]}
|
|
63
|
-
<p class="status-text">${mediatypeText[displayMediatype]}</p>
|
|
64
|
-
</div>
|
|
65
|
-
`;
|
|
66
|
-
}
|
|
67
|
-
static get styles() {
|
|
68
|
-
return css `
|
|
69
|
-
.status-text {
|
|
70
|
-
font-size: 14px;
|
|
71
|
-
color: #2c2c2c;
|
|
72
|
-
margin: auto;
|
|
73
|
-
display: block;
|
|
74
|
-
text-align: center;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
#icon.hide-text p {
|
|
78
|
-
display: none;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
svg {
|
|
82
|
-
height: var(--iconHeight, 10px);
|
|
83
|
-
width: var(--iconWidth, 10px);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.fill-color {
|
|
87
|
-
fill: var(--iconFillColor, '#000000');
|
|
88
|
-
}
|
|
89
|
-
`;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
__decorate([
|
|
93
|
-
property({ type: String })
|
|
94
|
-
], MediatypeIcon.prototype, "mediatype", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
property({ type: Array })
|
|
97
|
-
], MediatypeIcon.prototype, "collections", void 0);
|
|
98
|
-
__decorate([
|
|
99
|
-
property({ type: Boolean })
|
|
100
|
-
], MediatypeIcon.prototype, "showText", void 0);
|
|
101
|
-
MediatypeIcon = __decorate([
|
|
102
|
-
customElement('mediatype-icon')
|
|
103
|
-
], MediatypeIcon);
|
|
104
|
-
export { MediatypeIcon };
|
|
105
|
-
//# sourceMappingURL=mediatype-icon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mediatype-icon.js","sourceRoot":"","sources":["../../../src/mediatype/mediatype-icon.ts"],"names":[],"mappings":"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","sourcesContent":["import { css, CSSResultGroup, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { accountIcon } from '../assets/img/icons/mediatype/account';\nimport { audioIcon } from '../assets/img/icons/mediatype/audio';\nimport { collectionIcon } from '../assets/img/icons/mediatype/collection';\nimport { dataIcon } from '../assets/img/icons/mediatype/data';\nimport { etreeIcon } from '../assets/img/icons/mediatype/etree';\nimport { imagesIcon } from '../assets/img/icons/mediatype/images';\nimport { filmIcon } from '../assets/img/icons/mediatype/film';\nimport { radioIcon } from '../assets/img/icons/mediatype/radio';\nimport { softwareIcon } from '../assets/img/icons/mediatype/software';\nimport { textsIcon } from '../assets/img/icons/mediatype/texts';\nimport { tvIcon } from '../assets/img/icons/mediatype/tv';\nimport { videoIcon } from '../assets/img/icons/mediatype/video';\nimport { webIcon } from '../assets/img/icons/mediatype/web';\n\nimport { mediatypeColor } from './mediatype-color';\nimport { mediatypeText } from './mediatype-text';\n\n@customElement('mediatype-icon')\nexport class MediatypeIcon extends LitElement {\n @property({ type: String }) mediatype: string | undefined;\n\n @property({ type: Array }) collections: string[] | undefined;\n\n @property({ type: Boolean }) showText = false;\n\n private readonly mediatypeIcons: { [key: string]: any } = {\n account: accountIcon,\n audio: audioIcon,\n collection: collectionIcon,\n data: dataIcon,\n etree: etreeIcon,\n film: filmIcon,\n image: imagesIcon,\n movies: filmIcon,\n radio: radioIcon,\n software: softwareIcon,\n texts: textsIcon,\n tv: tvIcon,\n video: videoIcon,\n web: webIcon,\n };\n\n private get displayMediaType() {\n const tvIdentifier = ['tvnews', 'tvarchive', 'television'];\n const radioIdentifier = ['radio', 'radioprogram'];\n\n if (\n this.mediatype === 'movies' &&\n this.collections?.some(id => tvIdentifier.indexOf(id) >= 0)\n ) {\n return 'tv';\n }\n if (\n this.mediatype === 'audio' &&\n this.collections?.some(id => radioIdentifier.indexOf(id) >= 0)\n ) {\n return 'radio';\n }\n return this.mediatype;\n }\n\n render() {\n if (!this.mediatype) {\n return html``;\n }\n\n const displayMediatype = this.displayMediaType || '';\n const fillColor = mediatypeColor[displayMediatype];\n\n return html`\n <div id=\"icon\" class=\"${this.showText ? 'show-text' : 'hide-text'}\" style=\"--iconFillColor=${fillColor}\">\n ${this.mediatypeIcons[displayMediatype]}\n <p class=\"status-text\">${mediatypeText[displayMediatype]}</p>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n .status-text {\n font-size: 14px;\n color: #2c2c2c;\n margin: auto;\n display: block;\n text-align: center;\n }\n\n #icon.hide-text p {\n display: none;\n }\n\n svg {\n height: var(--iconHeight, 10px);\n width: var(--iconWidth, 10px);\n }\n\n .fill-color {\n fill: var(--iconFillColor, '#000000');\n }\n `;\n }\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const mediatypeText = {
|
|
2
|
-
account: 'Account',
|
|
3
|
-
audio: 'Audio',
|
|
4
|
-
collection: 'Collection',
|
|
5
|
-
data: 'Data',
|
|
6
|
-
etree: 'E-tree',
|
|
7
|
-
film: 'Film',
|
|
8
|
-
image: 'Image',
|
|
9
|
-
movies: 'Movie',
|
|
10
|
-
radio: 'Radio',
|
|
11
|
-
software: 'Software',
|
|
12
|
-
texts: 'Text',
|
|
13
|
-
tv: 'TV',
|
|
14
|
-
video: 'Video',
|
|
15
|
-
web: 'Web',
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=mediatype-text.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mediatype-text.js","sourceRoot":"","sources":["../../../src/mediatype/mediatype-text.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,MAAM;IACb,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;CACX,CAAC","sourcesContent":["export const mediatypeText: { [key: string]: any } = {\n account: 'Account',\n audio: 'Audio',\n collection: 'Collection',\n data: 'Data',\n etree: 'E-tree',\n film: 'Film',\n image: 'Image',\n movies: 'Movie',\n radio: 'Radio',\n software: 'Software',\n texts: 'Text',\n tv: 'TV',\n video: 'Video',\n web: 'Web',\n};\n"]}
|