@internetarchive/collection-browser 0.2.5 → 0.2.7-alpha.2
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/{tiles/grid → assets/img}/icons/favorite-filled.d.ts +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/favorite-filled.js +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/favorite-filled.js.map +1 -1
- package/dist/src/assets/img/icons/login-required.d.ts +1 -0
- package/dist/src/assets/img/icons/login-required.js +30 -0
- package/dist/src/assets/img/icons/login-required.js.map +1 -0
- package/dist/src/{tiles/grid → assets/img}/icons/reviews.d.ts +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/reviews.js +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/reviews.js.map +1 -1
- package/dist/src/{tiles/grid → assets/img}/icons/upload.d.ts +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/upload.js +0 -0
- package/dist/src/{tiles/grid → assets/img}/icons/upload.js.map +1 -1
- package/dist/src/assets/img/icons/views.d.ts +1 -0
- package/dist/src/{tiles/grid → assets/img}/icons/views.js +1 -1
- package/dist/src/assets/img/icons/views.js.map +1 -0
- package/dist/src/collection-browser.js +15 -10
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.d.ts +1 -0
- package/dist/src/tiles/grid/account-tile.js +45 -78
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +7 -0
- package/dist/src/tiles/grid/item-tile.js +76 -122
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +10 -0
- package/dist/src/tiles/grid/tile-stats.js +134 -0
- package/dist/src/tiles/grid/tile-stats.js.map +1 -0
- package/dist/src/tiles/item-image.d.ts +5 -0
- package/dist/src/tiles/item-image.js +21 -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 +10 -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 +5 -0
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/mediatype-icon.js +4 -0
- package/dist/src/tiles/mediatype-icon.js.map +1 -1
- package/dist/src/tiles/overlay/icon-overlay.d.ts +7 -0
- package/dist/src/tiles/overlay/icon-overlay.js +43 -0
- package/dist/src/tiles/overlay/icon-overlay.js.map +1 -0
- package/dist/src/tiles/overlay/text-overlay.d.ts +8 -0
- package/dist/src/tiles/overlay/text-overlay.js +53 -0
- package/dist/src/tiles/overlay/text-overlay.js.map +1 -0
- package/dist/src/tiles/tile-dispatcher.d.ts +1 -0
- package/dist/src/tiles/tile-dispatcher.js +7 -0
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/icon-overlay.test.d.ts +1 -0
- package/dist/test/icon-overlay.test.js +23 -0
- package/dist/test/icon-overlay.test.js.map +1 -0
- package/dist/test/item-image.test.d.ts +1 -0
- package/dist/test/item-image.test.js +75 -0
- package/dist/test/item-image.test.js.map +1 -0
- package/dist/test/text-overlay.test.d.ts +1 -0
- package/dist/test/text-overlay.test.js +37 -0
- package/dist/test/text-overlay.test.js.map +1 -0
- package/dist/test/tile-stats.test.d.ts +1 -0
- package/dist/test/tile-stats.test.js +42 -0
- package/dist/test/tile-stats.test.js.map +1 -0
- package/package.json +2 -2
- package/src/{tiles/grid → assets/img}/icons/favorite-filled.ts +0 -0
- package/src/assets/img/icons/login-required.ts +30 -0
- package/src/{tiles/grid → assets/img}/icons/reviews.ts +0 -0
- package/src/{tiles/grid → assets/img}/icons/upload.ts +0 -0
- package/src/{tiles/grid → assets/img}/icons/views.ts +1 -1
- package/src/collection-browser.ts +15 -10
- package/src/tiles/grid/account-tile.ts +44 -77
- package/src/tiles/grid/item-tile.ts +73 -123
- package/src/tiles/grid/tile-stats.ts +132 -0
- package/src/tiles/item-image.ts +22 -2
- package/src/tiles/list/tile-list-compact.ts +8 -1
- package/src/tiles/list/tile-list.ts +3 -0
- package/src/tiles/mediatype-icon.ts +4 -0
- package/src/tiles/overlay/icon-overlay.ts +34 -0
- package/src/tiles/overlay/text-overlay.ts +44 -0
- package/src/tiles/tile-dispatcher.ts +5 -0
- package/test/icon-overlay.test.ts +30 -0
- package/test/item-image.test.ts +85 -0
- package/test/text-overlay.test.ts +44 -0
- package/test/tile-stats.test.ts +57 -0
- package/dist/src/tiles/grid/icons/account.d.ts +0 -1
- package/dist/src/tiles/grid/icons/account.js +0 -12
- package/dist/src/tiles/grid/icons/account.js.map +0 -1
- package/dist/src/tiles/grid/icons/views.d.ts +0 -2
- package/dist/src/tiles/grid/icons/views.js.map +0 -1
- package/dist/src/tiles/item-tile-image.d.ts +0 -15
- package/dist/src/tiles/item-tile-image.js +0 -68
- package/dist/src/tiles/item-tile-image.js.map +0 -1
- package/src/tiles/grid/icons/account.ts +0 -12
- package/src/tiles/item-tile-image.ts +0 -61
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { css, CSSResultGroup, html, LitElement } from 'lit';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
|
|
4
|
+
import { restrictedIcon } from '../../assets/img/icons/restricted';
|
|
5
|
+
import { loginRequiredIcon } from '../../assets/img/icons/login-required';
|
|
6
|
+
|
|
7
|
+
@customElement('icon-overlay')
|
|
8
|
+
export class IconOverlay extends LitElement {
|
|
9
|
+
@property({ type: Boolean }) loggedIn = false;
|
|
10
|
+
|
|
11
|
+
@property({ type: Boolean }) loginRequired = false;
|
|
12
|
+
|
|
13
|
+
render() {
|
|
14
|
+
if (this.loginRequired && !this.loggedIn) {
|
|
15
|
+
return html`${loginRequiredIcon} `;
|
|
16
|
+
}
|
|
17
|
+
return html`${restrictedIcon}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static get styles(): CSSResultGroup {
|
|
21
|
+
return css`
|
|
22
|
+
:host {
|
|
23
|
+
position: absolute;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
z-index: 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
svg {
|
|
30
|
+
padding: 25%;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { css, CSSResultGroup, html, LitElement } from 'lit';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
|
|
4
|
+
@customElement('text-overlay')
|
|
5
|
+
export class TextOverlay extends LitElement {
|
|
6
|
+
@property({ type: Boolean }) loggedIn = false;
|
|
7
|
+
|
|
8
|
+
@property({ type: Boolean }) loginRequired = false;
|
|
9
|
+
|
|
10
|
+
render() {
|
|
11
|
+
return html` <div class="overlay no-preview">${this.textDisplay}</div> `;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
private get textDisplay() {
|
|
15
|
+
return this.loginRequired && !this.loggedIn
|
|
16
|
+
? 'Log in\nto view this item'
|
|
17
|
+
: 'Content may be inappropriate';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static get styles(): CSSResultGroup {
|
|
21
|
+
return css`
|
|
22
|
+
.overlay {
|
|
23
|
+
border: 1px solid #2c2c2c;
|
|
24
|
+
border-radius: 1px;
|
|
25
|
+
position: absolute;
|
|
26
|
+
right: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
top: 35%;
|
|
29
|
+
margin: auto;
|
|
30
|
+
width: auto;
|
|
31
|
+
padding: 5px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.no-preview {
|
|
35
|
+
background-color: #fffecb;
|
|
36
|
+
color: #2c2c2c;
|
|
37
|
+
font-size: 1.4rem;
|
|
38
|
+
line-height: 2rem;
|
|
39
|
+
text-align: center;
|
|
40
|
+
white-space: pre-wrap; // for the newline character
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -43,6 +43,8 @@ export class TileDispatcher
|
|
|
43
43
|
|
|
44
44
|
@property({ type: String }) baseImageUrl?: string;
|
|
45
45
|
|
|
46
|
+
@property({ type: Boolean }) loggedIn = false;
|
|
47
|
+
|
|
46
48
|
render() {
|
|
47
49
|
return html`
|
|
48
50
|
<div id="container">
|
|
@@ -154,6 +156,7 @@ export class TileDispatcher
|
|
|
154
156
|
.currentHeight=${this.currentHeight}
|
|
155
157
|
.collectionNameCache=${this.collectionNameCache}
|
|
156
158
|
.baseImageUrl=${this.baseImageUrl}
|
|
159
|
+
.loggedIn=${this.loggedIn}
|
|
157
160
|
></item-tile>`;
|
|
158
161
|
}
|
|
159
162
|
case 'list-compact':
|
|
@@ -165,6 +168,7 @@ export class TileDispatcher
|
|
|
165
168
|
.sortParam=${sortParam}
|
|
166
169
|
.mobileBreakpoint=${mobileBreakpoint}
|
|
167
170
|
.baseImageUrl=${this.baseImageUrl}
|
|
171
|
+
.loggedIn=${this.loggedIn}
|
|
168
172
|
></tile-list-compact>`;
|
|
169
173
|
case 'list-detail':
|
|
170
174
|
return html`<tile-list
|
|
@@ -176,6 +180,7 @@ export class TileDispatcher
|
|
|
176
180
|
.sortParam=${sortParam}
|
|
177
181
|
.mobileBreakpoint=${mobileBreakpoint}
|
|
178
182
|
.baseImageUrl=${this.baseImageUrl}
|
|
183
|
+
.loggedIn=${this.loggedIn}
|
|
179
184
|
></tile-list>`;
|
|
180
185
|
default:
|
|
181
186
|
return nothing;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import { IconOverlay } from '../src/tiles/overlay/icon-overlay';
|
|
5
|
+
|
|
6
|
+
import '../src/tiles/overlay/icon-overlay';
|
|
7
|
+
|
|
8
|
+
describe('Icon Overlay component', () => {
|
|
9
|
+
it('should render component if loggedIn required', async () => {
|
|
10
|
+
const el = await fixture<IconOverlay>(html`
|
|
11
|
+
<icon-overlay .loggedIn=${false} .loginRequired=${true}> </icon-overlay>
|
|
12
|
+
`);
|
|
13
|
+
|
|
14
|
+
const svgTitle = el.shadowRoot
|
|
15
|
+
?.querySelector('svg')
|
|
16
|
+
?.querySelector('title')?.textContent;
|
|
17
|
+
expect(svgTitle).to.equal('Log in to view this item');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should render component if content warning', async () => {
|
|
21
|
+
const el = await fixture<IconOverlay>(html`
|
|
22
|
+
<icon-overlay .loggedIn=${false} .loginRequired=${false}> </icon-overlay>
|
|
23
|
+
`);
|
|
24
|
+
|
|
25
|
+
const svgTitle = el.shadowRoot
|
|
26
|
+
?.querySelector('svg')
|
|
27
|
+
?.querySelector('title')?.textContent;
|
|
28
|
+
expect(svgTitle).to.equal('Content may be inappropriate');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
// import sinon from 'sinon';
|
|
5
|
+
|
|
6
|
+
import { TileModel } from '../src/models';
|
|
7
|
+
import { ItemImage } from '../src/tiles/item-image';
|
|
8
|
+
|
|
9
|
+
import '../src/tiles/item-image';
|
|
10
|
+
|
|
11
|
+
const baseImageUrl = 'https://archive.org';
|
|
12
|
+
const testBookModel: TileModel = {
|
|
13
|
+
collections: [],
|
|
14
|
+
commentCount: 0,
|
|
15
|
+
creators: [],
|
|
16
|
+
favCount: 0,
|
|
17
|
+
identifier: '18730130BloomfieldRecordCompleteIssue',
|
|
18
|
+
itemCount: 0,
|
|
19
|
+
mediatype: 'texts',
|
|
20
|
+
subjects: [],
|
|
21
|
+
title: 'Sample Waveform',
|
|
22
|
+
viewCount: 0,
|
|
23
|
+
loginRequired: false,
|
|
24
|
+
contentWarning: false,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const testAudioModel: TileModel = {
|
|
28
|
+
collections: [],
|
|
29
|
+
commentCount: 0,
|
|
30
|
+
creators: [],
|
|
31
|
+
favCount: 0,
|
|
32
|
+
identifier: 'dwd2015-01-24',
|
|
33
|
+
itemCount: 0,
|
|
34
|
+
mediatype: 'audio',
|
|
35
|
+
subjects: [],
|
|
36
|
+
title: 'Sample Waveform',
|
|
37
|
+
viewCount: 0,
|
|
38
|
+
loginRequired: false,
|
|
39
|
+
contentWarning: false,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
describe('ItemImage component', () => {
|
|
43
|
+
it('should render initial component', async () => {
|
|
44
|
+
const el = await fixture<ItemImage>(html`
|
|
45
|
+
<item-image
|
|
46
|
+
.isListTile=${false}
|
|
47
|
+
.isCompactTile=${false}
|
|
48
|
+
.model=${testBookModel}
|
|
49
|
+
.baseImageUrl=${baseImageUrl}
|
|
50
|
+
>
|
|
51
|
+
</item-image>
|
|
52
|
+
`);
|
|
53
|
+
|
|
54
|
+
const dropShadow = el.shadowRoot?.querySelector('.drop-shadow');
|
|
55
|
+
const imgClassName = dropShadow?.querySelector('img')?.className;
|
|
56
|
+
|
|
57
|
+
expect(dropShadow).to.exist;
|
|
58
|
+
expect(imgClassName).to.eql(' contain ');
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should render component if mediatype is waveform', async () => {
|
|
62
|
+
// const onLoad = sinon.spy();
|
|
63
|
+
const el = await fixture<ItemImage>(html`
|
|
64
|
+
<item-image
|
|
65
|
+
.isListTile=${false}
|
|
66
|
+
.isCompactTile=${false}
|
|
67
|
+
.model=${testAudioModel}
|
|
68
|
+
.baseImageUrl=${baseImageUrl}
|
|
69
|
+
>
|
|
70
|
+
</item-image>
|
|
71
|
+
`);
|
|
72
|
+
|
|
73
|
+
const dropShadow = el.shadowRoot?.querySelector('.drop-shadow');
|
|
74
|
+
// const image = dropShadow?.querySelector('img');
|
|
75
|
+
|
|
76
|
+
expect(dropShadow).to.exist;
|
|
77
|
+
/**
|
|
78
|
+
* TODO:
|
|
79
|
+
* - simulate image onLoad event
|
|
80
|
+
* - check if image className is waveform
|
|
81
|
+
*/
|
|
82
|
+
// const imgClassName = dropShadow?.querySelector('img')?.className;
|
|
83
|
+
// expect(imgClassName).to.eql(' waveform ');
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import { TextOverlay } from '../src/tiles/overlay/text-overlay';
|
|
5
|
+
|
|
6
|
+
import '../src/tiles/overlay/text-overlay';
|
|
7
|
+
|
|
8
|
+
describe('Text Overlay component', () => {
|
|
9
|
+
it('should render initial component', async () => {
|
|
10
|
+
const el = await fixture<TextOverlay>(html`<text-overlay></text-overlay>`);
|
|
11
|
+
|
|
12
|
+
const overlay = el.shadowRoot?.querySelector('.overlay');
|
|
13
|
+
const noPreview = el.shadowRoot?.querySelector('.no-preview');
|
|
14
|
+
|
|
15
|
+
expect(overlay).to.exist;
|
|
16
|
+
expect(noPreview).to.exist;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should render component if loggedIn required', async () => {
|
|
20
|
+
const el = await fixture<TextOverlay>(html`
|
|
21
|
+
<text-overlay .loggedIn=${false} .loginRequired=${true}> </text-overlay>
|
|
22
|
+
`);
|
|
23
|
+
|
|
24
|
+
const overlay = el.shadowRoot?.querySelector('.overlay');
|
|
25
|
+
const noPreview = el.shadowRoot?.querySelector('.no-preview');
|
|
26
|
+
|
|
27
|
+
expect(overlay).to.exist;
|
|
28
|
+
expect(noPreview).to.exist;
|
|
29
|
+
expect(noPreview?.textContent).to.equal('Log in\nto view this item');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should render component if content warning', async () => {
|
|
33
|
+
const el = await fixture<TextOverlay>(html`
|
|
34
|
+
<text-overlay .loggedIn=${false} .loginRequired=${false}> </text-overlay>
|
|
35
|
+
`);
|
|
36
|
+
|
|
37
|
+
const overlay = el.shadowRoot?.querySelector('.overlay');
|
|
38
|
+
const noPreview = el.shadowRoot?.querySelector('.no-preview');
|
|
39
|
+
|
|
40
|
+
expect(overlay).to.exist;
|
|
41
|
+
expect(noPreview).to.exist;
|
|
42
|
+
expect(noPreview?.textContent).to.equal('Content may be inappropriate');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import { TileStats } from '../src/tiles/grid/tile-stats';
|
|
5
|
+
|
|
6
|
+
import '../src/tiles/grid/tile-stats';
|
|
7
|
+
|
|
8
|
+
describe('Tile Stats', () => {
|
|
9
|
+
it('should render initial component', async () => {
|
|
10
|
+
const el = await fixture<TileStats>(html`<tile-stats></tile-stats>`);
|
|
11
|
+
|
|
12
|
+
const itemStats = el.shadowRoot?.querySelector('.item-stats');
|
|
13
|
+
const statsRow = el.shadowRoot?.querySelector('#stats-row');
|
|
14
|
+
const statsRowCount = statsRow?.childElementCount;
|
|
15
|
+
|
|
16
|
+
expect(itemStats).to.exist;
|
|
17
|
+
expect(statsRow).to.exist;
|
|
18
|
+
expect(statsRowCount).to.equal(4);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should render component with value', async () => {
|
|
22
|
+
const el = await fixture<TileStats>(
|
|
23
|
+
html`
|
|
24
|
+
<tile-stats
|
|
25
|
+
.mediatype=${'account'}
|
|
26
|
+
.itemCount=${1}
|
|
27
|
+
.favCount=${2}
|
|
28
|
+
.commentCount=${3}
|
|
29
|
+
>
|
|
30
|
+
</tile-stats>
|
|
31
|
+
`
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const statsRow = el.shadowRoot?.querySelector('#stats-row');
|
|
35
|
+
|
|
36
|
+
const mediatypeStat = statsRow?.children.item(0);
|
|
37
|
+
// get second column item in stats row
|
|
38
|
+
const itemStatCount = statsRow?.children
|
|
39
|
+
.item(1)
|
|
40
|
+
?.querySelector('.status-text')?.textContent;
|
|
41
|
+
// get third column item in stats row
|
|
42
|
+
const favoritesStatCount = statsRow?.children
|
|
43
|
+
.item(2)
|
|
44
|
+
?.querySelector('.status-text')?.textContent;
|
|
45
|
+
// get fourth column item in stats row
|
|
46
|
+
const reviewsStatCount = statsRow?.children
|
|
47
|
+
.item(3)
|
|
48
|
+
?.querySelector('.status-text')?.textContent;
|
|
49
|
+
|
|
50
|
+
expect(mediatypeStat).to.exist;
|
|
51
|
+
|
|
52
|
+
// Snapshot testing - reference: https://open-wc.org/docs/testing/semantic-dom-diff/#snapshot-testing
|
|
53
|
+
expect(itemStatCount).to.equalSnapshot(1);
|
|
54
|
+
expect(favoritesStatCount).to.equalSnapshot(2);
|
|
55
|
+
expect(reviewsStatCount).to.equalSnapshot(3);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const accountIcon: import("lit-html").TemplateResult<2>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { svg } from 'lit';
|
|
2
|
-
export const accountIcon = svg `
|
|
3
|
-
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
-
<path
|
|
5
|
-
d="m89.6854559 79.6500588c1.7300364 6.4823648 2.180423 13.3122689 3.3145441 20.3499412h-86c.5683151-15.8558542 2.98334063-30.7849367 15.1676149-41.6581341 22.9948067-20.518674 59.250299-9.0032844 67.517841 21.3081929zm-40.0998307-79.6500588c10.872402.0493248 19.9700408 9.25722341 19.917959 20.1421788-.0829413 11.042868-8.9616237 19.8492523-20.0602807 19.8578212-11.1181198 0-19.9397193-8.7904706-19.9397193-19.8908727-.0327543-11.11998815 9.0125781-20.17487063 20.082041-20.1091273z"
|
|
6
|
-
fill="#333"
|
|
7
|
-
fill-rule="evenodd"
|
|
8
|
-
/>
|
|
9
|
-
<title>Icon of a person</title>
|
|
10
|
-
</svg>
|
|
11
|
-
`;
|
|
12
|
-
//# sourceMappingURL=account.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../../src/tiles/grid/icons/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;CAS7B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const accountIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m89.6854559 79.6500588c1.7300364 6.4823648 2.180423 13.3122689 3.3145441 20.3499412h-86c.5683151-15.8558542 2.98334063-30.7849367 15.1676149-41.6581341 22.9948067-20.518674 59.250299-9.0032844 67.517841 21.3081929zm-40.0998307-79.6500588c10.872402.0493248 19.9700408 9.25722341 19.917959 20.1421788-.0829413 11.042868-8.9616237 19.8492523-20.0602807 19.8578212-11.1181198 0-19.9397193-8.7904706-19.9397193-19.8908727-.0327543-11.11998815 9.0125781-20.17487063 20.082041-20.1091273z\"\n fill=\"#333\"\n fill-rule=\"evenodd\"\n />\n <title>Icon of a person</title>\n </svg>\n`;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"views.js","sourceRoot":"","sources":["../../../../../src/tiles/grid/icons/views.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,eAAe,GAAG,CAAA;;;;;;;;CAQjB,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport default svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m98 50.5704143c-.2830293-.471515-.671154-1.1088947-1.1643742-1.9121392s-1.6003642-2.3617474-3.3214321-4.6755089c-1.7210678-2.3137614-3.522258-4.5325939-5.4035703-6.6564975-1.8813124-2.1239037-4.2828993-4.473133-7.2047606-7.0476881-2.9218612-2.5745551-5.8895067-4.7933876-8.9029363-6.6564976-3.0134295-1.86311-6.4628491-3.4330878-10.3482587-4.7099336-3.8854095-1.2768458-7.7822651-1.9142256-11.6905667-1.9121443-3.9083017.0020914-7.8051573.6154781-11.6905668 1.8401652-3.8854096 1.2246871-7.3702078 2.8301329-10.4543947 4.8163375-3.0841869 1.9862045-6.0278997 4.1695691-8.8311384 6.5500937s-5.2048256 4.7652219-7.2047605 7.1540919c-1.99993501 2.38887-3.75430043 4.5722346-5.26309632 6.5500938s-2.63883199 3.583305-3.39010829 4.8163374l-1.13003609 1.8401602c.2830293.4715149.67115403 1.1088946 1.16437421 1.9121391.49322017.8032445 1.5878776 2.3617475 3.28397229 4.6755089s3.47439274 4.521119 5.3348942 6.6220728c1.8605014 2.1009538 4.2506422 4.4387083 7.1704224 7.0132633 2.9197801 2.5745551 5.8874256 4.7819127 8.9029363 6.6220729 3.0155106 1.8401601 6.4774168 3.398663 10.3857184 4.6755088 3.9083017 1.2768458 7.8176438 1.9142256 11.7280266 1.9121443 3.9103827-.0020914 7.7957922-.6154781 11.6562286-1.8401652s7.3337886-2.818658 10.4200566-4.7819127 6.0299808-4.1351444 8.8311384-6.515669 5.2152311-4.7652219 7.2422203-7.1540919 3.8052873-4.5607597 5.3348942-6.515669c1.5296068-1.9549093 2.6721295-3.5488802 3.427568-4.7819127zm-24.5142913 0c0 6.467683-2.3079374 12.0152859-6.9238123 16.6428087s-10.1495139 6.9412843-16.600917 6.9412843c-6.4992683 0-12.0453939-2.3137615-16.6383767-6.9412843s-6.8894742-10.1751257-6.8894742-16.6428087 2.2964914-12.003811 6.8894742-16.608384 10.1391084-6.9068595 16.6383767-6.9068595c6.4534842 0 11.9871232 2.3022865 16.600917 6.9068595s6.9217312 10.140701 6.9238123 16.608384zm-23.5247293-10.552755c2.8261308 0 5.2870289 1.0619518 7.3826944 3.1858555 2.0956655 2.1239036 3.1434982 4.5795368 3.1434982 7.3668995 0 2.8332624-1.0478327 5.2888956-3.1434982 7.3668995-2.0956655 2.078004-4.5565636 3.1170059-7.3826944 3.1170059-2.873996 0-5.3348941-1.0264838-7.3826944-3.0794516-2.0478002-2.0529677-3.0717003-4.5200758-3.0717003-7.4013243 0-2.8332624 1.0239001-5.3003705 3.0717003-7.4013243 2.0478003-2.1009538 4.5086984-3.1514307 7.3826944-3.1514307z\"\n fill=\"#333\"\n />\n <title>Eye icon</title>\n </svg>\n`;\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { TileModel } from '../models';
|
|
3
|
-
import './image/item-image';
|
|
4
|
-
import './image/waveform-image';
|
|
5
|
-
export declare class ItemTileImage extends LitElement {
|
|
6
|
-
model?: TileModel;
|
|
7
|
-
baseImageUrl?: string;
|
|
8
|
-
isListTile: boolean;
|
|
9
|
-
isCompactTile: boolean;
|
|
10
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
-
private get imageSrc();
|
|
12
|
-
private get isWithWaveformMediatype();
|
|
13
|
-
private get itemImageTemplate();
|
|
14
|
-
private get waveformImageTemplate();
|
|
15
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import './image/item-image';
|
|
5
|
-
import './image/waveform-image';
|
|
6
|
-
let ItemTileImage = class ItemTileImage extends LitElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.isListTile = false;
|
|
10
|
-
this.isCompactTile = false;
|
|
11
|
-
}
|
|
12
|
-
render() {
|
|
13
|
-
return html `
|
|
14
|
-
${this.isWithWaveformMediatype
|
|
15
|
-
? this.waveformImageTemplate
|
|
16
|
-
: this.itemImageTemplate}
|
|
17
|
-
`;
|
|
18
|
-
}
|
|
19
|
-
get imageSrc() {
|
|
20
|
-
var _a;
|
|
21
|
-
return `${this.baseImageUrl}/services/img/${(_a = this.model) === null || _a === void 0 ? void 0 : _a.identifier}`;
|
|
22
|
-
}
|
|
23
|
-
get isWithWaveformMediatype() {
|
|
24
|
-
var _a, _b;
|
|
25
|
-
return (((_a = this.model) === null || _a === void 0 ? void 0 : _a.mediatype) === 'audio' || ((_b = this.model) === null || _b === void 0 ? void 0 : _b.mediatype) === 'etree');
|
|
26
|
-
}
|
|
27
|
-
// Templates
|
|
28
|
-
get itemImageTemplate() {
|
|
29
|
-
return html `
|
|
30
|
-
<item-image
|
|
31
|
-
.model=${this.model}
|
|
32
|
-
.imageSrc=${this.imageSrc}
|
|
33
|
-
.isCompactTile=${this.isCompactTile}
|
|
34
|
-
.isListTile=${this.isListTile}
|
|
35
|
-
>
|
|
36
|
-
</item-image>
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
39
|
-
get waveformImageTemplate() {
|
|
40
|
-
var _a;
|
|
41
|
-
return html `
|
|
42
|
-
<waveform-image
|
|
43
|
-
.imageSrc=${this.imageSrc}
|
|
44
|
-
.identifier=${(_a = this.model) === null || _a === void 0 ? void 0 : _a.identifier}
|
|
45
|
-
.isCompactTile=${this.isCompactTile}
|
|
46
|
-
.isListTile=${this.isListTile}
|
|
47
|
-
>
|
|
48
|
-
</waveform-image>
|
|
49
|
-
`;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
__decorate([
|
|
53
|
-
property({ type: Object })
|
|
54
|
-
], ItemTileImage.prototype, "model", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
property({ type: String })
|
|
57
|
-
], ItemTileImage.prototype, "baseImageUrl", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
property({ type: Boolean })
|
|
60
|
-
], ItemTileImage.prototype, "isListTile", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
property({ type: Boolean })
|
|
63
|
-
], ItemTileImage.prototype, "isCompactTile", void 0);
|
|
64
|
-
ItemTileImage = __decorate([
|
|
65
|
-
customElement('item-tile-image')
|
|
66
|
-
], ItemTileImage);
|
|
67
|
-
export { ItemTileImage };
|
|
68
|
-
//# sourceMappingURL=item-tile-image.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-tile-image.js","sourceRoot":"","sources":["../../../src/tiles/item-tile-image.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI5D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,wBAAwB,CAAC;AAGhC,IAAa,aAAa,GAA1B,MAAa,aAAc,SAAQ,UAAU;IAA7C;;QAK+B,eAAU,GAAG,KAAK,CAAC;QAEnB,kBAAa,GAAG,KAAK,CAAC;IA4CrD,CAAC;IA1CC,MAAM;QACJ,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,uBAAuB;YAC5B,CAAC,CAAC,IAAI,CAAC,qBAAqB;YAC5B,CAAC,CAAC,IAAI,CAAC,iBAAiB;KAC3B,CAAC;IACJ,CAAC;IAED,IAAY,QAAQ;;QAClB,OAAO,GAAG,IAAI,CAAC,YAAY,iBAAiB,MAAA,IAAI,CAAC,KAAK,0CAAE,UAAU,EAAE,CAAC;IACvE,CAAC;IAED,IAAY,uBAAuB;;QACjC,OAAO,CACL,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS,MAAK,OAAO,IAAI,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS,MAAK,OAAO,CACvE,CAAC;IACJ,CAAC;IAED,YAAY;IACZ,IAAY,iBAAiB;QAC3B,OAAO,IAAI,CAAA;;iBAEE,IAAI,CAAC,KAAK;oBACP,IAAI,CAAC,QAAQ;yBACR,IAAI,CAAC,aAAa;sBACrB,IAAI,CAAC,UAAU;;;KAGhC,CAAC;IACJ,CAAC;IAED,IAAY,qBAAqB;;QAC/B,OAAO,IAAI,CAAA;;oBAEK,IAAI,CAAC,QAAQ;sBACX,MAAA,IAAI,CAAC,KAAK,0CAAE,UAAU;yBACnB,IAAI,CAAC,aAAa;sBACrB,IAAI,CAAC,UAAU;;;KAGhC,CAAC;IACJ,CAAC;CACF,CAAA;AAlD6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAuB;AAErB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAAoB;AAEnB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAAuB;AAPxC,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAmDzB;SAnDY,aAAa","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { TileModel } from '../models';\n\nimport './image/item-image';\nimport './image/waveform-image';\n\n@customElement('item-tile-image')\nexport class ItemTileImage extends LitElement {\n @property({ type: Object }) model?: TileModel;\n\n @property({ type: String }) baseImageUrl?: string;\n\n @property({ type: Boolean }) isListTile = false;\n\n @property({ type: Boolean }) isCompactTile = false;\n\n render() {\n return html`\n ${this.isWithWaveformMediatype\n ? this.waveformImageTemplate\n : this.itemImageTemplate}\n `;\n }\n\n private get imageSrc() {\n return `${this.baseImageUrl}/services/img/${this.model?.identifier}`;\n }\n\n private get isWithWaveformMediatype() {\n return (\n this.model?.mediatype === 'audio' || this.model?.mediatype === 'etree'\n );\n }\n\n // Templates\n private get itemImageTemplate() {\n return html`\n <item-image\n .model=${this.model}\n .imageSrc=${this.imageSrc}\n .isCompactTile=${this.isCompactTile}\n .isListTile=${this.isListTile}\n >\n </item-image>\n `;\n }\n\n private get waveformImageTemplate() {\n return html`\n <waveform-image\n .imageSrc=${this.imageSrc}\n .identifier=${this.model?.identifier}\n .isCompactTile=${this.isCompactTile}\n .isListTile=${this.isListTile}\n >\n </waveform-image>\n `;\n }\n}\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { svg } from 'lit';
|
|
2
|
-
|
|
3
|
-
export const accountIcon = svg`
|
|
4
|
-
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
-
<path
|
|
6
|
-
d="m89.6854559 79.6500588c1.7300364 6.4823648 2.180423 13.3122689 3.3145441 20.3499412h-86c.5683151-15.8558542 2.98334063-30.7849367 15.1676149-41.6581341 22.9948067-20.518674 59.250299-9.0032844 67.517841 21.3081929zm-40.0998307-79.6500588c10.872402.0493248 19.9700408 9.25722341 19.917959 20.1421788-.0829413 11.042868-8.9616237 19.8492523-20.0602807 19.8578212-11.1181198 0-19.9397193-8.7904706-19.9397193-19.8908727-.0327543-11.11998815 9.0125781-20.17487063 20.082041-20.1091273z"
|
|
7
|
-
fill="#333"
|
|
8
|
-
fill-rule="evenodd"
|
|
9
|
-
/>
|
|
10
|
-
<title>Icon of a person</title>
|
|
11
|
-
</svg>
|
|
12
|
-
`;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { html, LitElement } from 'lit';
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
-
|
|
4
|
-
import { TileModel } from '../models';
|
|
5
|
-
|
|
6
|
-
import './image/item-image';
|
|
7
|
-
import './image/waveform-image';
|
|
8
|
-
|
|
9
|
-
@customElement('item-tile-image')
|
|
10
|
-
export class ItemTileImage extends LitElement {
|
|
11
|
-
@property({ type: Object }) model?: TileModel;
|
|
12
|
-
|
|
13
|
-
@property({ type: String }) baseImageUrl?: string;
|
|
14
|
-
|
|
15
|
-
@property({ type: Boolean }) isListTile = false;
|
|
16
|
-
|
|
17
|
-
@property({ type: Boolean }) isCompactTile = false;
|
|
18
|
-
|
|
19
|
-
render() {
|
|
20
|
-
return html`
|
|
21
|
-
${this.isWithWaveformMediatype
|
|
22
|
-
? this.waveformImageTemplate
|
|
23
|
-
: this.itemImageTemplate}
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
private get imageSrc() {
|
|
28
|
-
return `${this.baseImageUrl}/services/img/${this.model?.identifier}`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
private get isWithWaveformMediatype() {
|
|
32
|
-
return (
|
|
33
|
-
this.model?.mediatype === 'audio' || this.model?.mediatype === 'etree'
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Templates
|
|
38
|
-
private get itemImageTemplate() {
|
|
39
|
-
return html`
|
|
40
|
-
<item-image
|
|
41
|
-
.model=${this.model}
|
|
42
|
-
.imageSrc=${this.imageSrc}
|
|
43
|
-
.isCompactTile=${this.isCompactTile}
|
|
44
|
-
.isListTile=${this.isListTile}
|
|
45
|
-
>
|
|
46
|
-
</item-image>
|
|
47
|
-
`;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
private get waveformImageTemplate() {
|
|
51
|
-
return html`
|
|
52
|
-
<waveform-image
|
|
53
|
-
.imageSrc=${this.imageSrc}
|
|
54
|
-
.identifier=${this.model?.identifier}
|
|
55
|
-
.isCompactTile=${this.isCompactTile}
|
|
56
|
-
.isListTile=${this.isListTile}
|
|
57
|
-
>
|
|
58
|
-
</waveform-image>
|
|
59
|
-
`;
|
|
60
|
-
}
|
|
61
|
-
}
|