@internetarchive/collection-browser 2.14.1-alpha-webdev7568.0 → 2.14.1
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/collection-browser.js +1 -1
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +1 -10
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +5 -0
- package/dist/src/tiles/grid/item-tile.js +56 -20
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +0 -4
- package/dist/src/tiles/grid/tile-stats.js +0 -8
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +2 -0
- package/dist/src/tiles/tile-dispatcher.js +6 -0
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/package.json +1 -1
- package/src/collection-browser.ts +1 -1
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +1 -9
- package/src/tiles/grid/item-tile.ts +55 -20
- package/src/tiles/grid/tile-stats.ts +0 -6
- package/src/tiles/tile-dispatcher.ts +4 -0
|
@@ -65,9 +65,6 @@ export class SmartFacetBar extends LitElement {
|
|
|
65
65
|
return html`
|
|
66
66
|
<div id="smart-facets-container">
|
|
67
67
|
${this.filtersToggleTemplate}
|
|
68
|
-
${this.smartFacets.length > 0
|
|
69
|
-
? html`<p id="filters-label">${msg('Insights:')}</p>`
|
|
70
|
-
: nothing}
|
|
71
68
|
${repeat(
|
|
72
69
|
this.smartFacets,
|
|
73
70
|
f =>
|
|
@@ -341,7 +338,7 @@ export class SmartFacetBar extends LitElement {
|
|
|
341
338
|
margin: 0;
|
|
342
339
|
border: 0;
|
|
343
340
|
padding: 5px 8px;
|
|
344
|
-
border-radius:
|
|
341
|
+
border-radius: 5px;
|
|
345
342
|
background: white;
|
|
346
343
|
color: #2c2c2c;
|
|
347
344
|
border: 1px solid #194880;
|
|
@@ -365,11 +362,6 @@ export class SmartFacetBar extends LitElement {
|
|
|
365
362
|
#filters-toggle.active > svg {
|
|
366
363
|
filter: invert(1);
|
|
367
364
|
}
|
|
368
|
-
|
|
369
|
-
#filters-label {
|
|
370
|
-
font-weight: bold;
|
|
371
|
-
margin: 0 -5px 0 0;
|
|
372
|
-
}
|
|
373
365
|
`;
|
|
374
366
|
}
|
|
375
367
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { css, CSSResultGroup, html, nothing, TemplateResult } from 'lit';
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
|
+
import { map } from 'lit/directives/map.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
6
|
import { msg } from '@lit/localize';
|
|
5
7
|
|
|
6
|
-
import { map } from 'lit/directives/map.js';
|
|
7
8
|
import type { SortParam } from '@internetarchive/search-service';
|
|
8
9
|
import { DateFormat, formatDate } from '../../utils/format-date';
|
|
9
10
|
import { isFirstMillisecondOfUTCYear } from '../../utils/local-date-from-utc';
|
|
@@ -38,16 +39,17 @@ export class ItemTile extends BaseTileComponent {
|
|
|
38
39
|
|
|
39
40
|
@property({ type: Boolean }) showTvClips = false;
|
|
40
41
|
|
|
42
|
+
@property({ type: Boolean }) useSimpleLayout = false;
|
|
43
|
+
|
|
41
44
|
render() {
|
|
42
45
|
const itemTitle = this.model?.title;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
: [this.model?.viewCount, 'all-time views'];
|
|
46
|
+
const containerClasses = classMap({
|
|
47
|
+
container: true,
|
|
48
|
+
simple: this.useSimpleLayout,
|
|
49
|
+
});
|
|
48
50
|
|
|
49
51
|
return html`
|
|
50
|
-
<div class
|
|
52
|
+
<div class=${containerClasses}>
|
|
51
53
|
${this.infoButtonTemplate}
|
|
52
54
|
<div class="tile-details">
|
|
53
55
|
<div class="item-info">
|
|
@@ -67,19 +69,7 @@ export class ItemTile extends BaseTileComponent {
|
|
|
67
69
|
${this.reviewBlockTemplate}
|
|
68
70
|
</div>
|
|
69
71
|
|
|
70
|
-
|
|
71
|
-
.model=${this.model}
|
|
72
|
-
.mediatype=${this.model?.mediatype}
|
|
73
|
-
.collections=${this.model?.collections}
|
|
74
|
-
.viewCount=${viewCount}
|
|
75
|
-
.viewLabel=${viewLabel}
|
|
76
|
-
.favCount=${this.model?.favCount}
|
|
77
|
-
.commentCount=${this.model?.commentCount}
|
|
78
|
-
?isTvSearchResult=${this.model?.isTvSearchResult}
|
|
79
|
-
.tvClipCount=${this.model?.tvClipCount}
|
|
80
|
-
.showTvClips=${this.showTvClips}
|
|
81
|
-
>
|
|
82
|
-
</tile-stats>
|
|
72
|
+
${this.tileStatsTemplate}
|
|
83
73
|
</div>
|
|
84
74
|
</div>
|
|
85
75
|
`;
|
|
@@ -220,6 +210,33 @@ export class ItemTile extends BaseTileComponent {
|
|
|
220
210
|
`;
|
|
221
211
|
}
|
|
222
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Template for the stats row along the bottom of the tile.
|
|
215
|
+
*/
|
|
216
|
+
private get tileStatsTemplate(): TemplateResult | typeof nothing {
|
|
217
|
+
if (this.useSimpleLayout) return nothing;
|
|
218
|
+
|
|
219
|
+
const effectiveSort = this.sortParam ?? this.defaultSortParam;
|
|
220
|
+
const [viewCount, viewLabel] =
|
|
221
|
+
effectiveSort?.field === 'week'
|
|
222
|
+
? [this.model?.weeklyViewCount, 'weekly views']
|
|
223
|
+
: [this.model?.viewCount, 'all-time views'];
|
|
224
|
+
|
|
225
|
+
return html`
|
|
226
|
+
<tile-stats
|
|
227
|
+
.model=${this.model}
|
|
228
|
+
.mediatype=${this.model?.mediatype}
|
|
229
|
+
.viewCount=${viewCount}
|
|
230
|
+
.viewLabel=${viewLabel}
|
|
231
|
+
.favCount=${this.model?.favCount}
|
|
232
|
+
.commentCount=${this.model?.commentCount}
|
|
233
|
+
.tvClipCount=${this.model?.tvClipCount}
|
|
234
|
+
.showTvClips=${this.showTvClips}
|
|
235
|
+
>
|
|
236
|
+
</tile-stats>
|
|
237
|
+
`;
|
|
238
|
+
}
|
|
239
|
+
|
|
223
240
|
private get isSortedByDate(): boolean {
|
|
224
241
|
return ['date', 'reviewdate', 'addeddate', 'publicdate'].includes(
|
|
225
242
|
this.effectiveSort?.field as string,
|
|
@@ -267,6 +284,24 @@ export class ItemTile extends BaseTileComponent {
|
|
|
267
284
|
border: 1px solid ${tileBorderColor};
|
|
268
285
|
}
|
|
269
286
|
|
|
287
|
+
.simple .item-info {
|
|
288
|
+
padding-bottom: 5px;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.simple #title > .truncated {
|
|
292
|
+
-webkit-line-clamp: 2;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.simple .created-by > .truncated,
|
|
296
|
+
.simple .date-sorted-by > .truncated,
|
|
297
|
+
.simple .volume-issue > .truncated {
|
|
298
|
+
-webkit-line-clamp: 1;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.simple text-snippet-block {
|
|
302
|
+
margin-top: auto; /* Force the snippets to the bottom of the tile */
|
|
303
|
+
}
|
|
304
|
+
|
|
270
305
|
.capture-dates {
|
|
271
306
|
margin: 0;
|
|
272
307
|
padding: 0 5px;
|
|
@@ -20,9 +20,6 @@ export class TileStats extends LitElement {
|
|
|
20
20
|
/** The mediatype of the item these stats represent */
|
|
21
21
|
@property({ type: String }) mediatype?: string;
|
|
22
22
|
|
|
23
|
-
/** The collections this item is part of */
|
|
24
|
-
@property({ type: Array }) collections?: string[];
|
|
25
|
-
|
|
26
23
|
/** The number of uploaded items, if representing an account */
|
|
27
24
|
@property({ type: Number }) itemCount?: number;
|
|
28
25
|
|
|
@@ -38,9 +35,6 @@ export class TileStats extends LitElement {
|
|
|
38
35
|
/** The number of times the item has been reviewed */
|
|
39
36
|
@property({ type: Number }) commentCount?: number;
|
|
40
37
|
|
|
41
|
-
/** Whether the tile represents the result of a search */
|
|
42
|
-
@property({ type: Boolean }) isTvSearchResult = false;
|
|
43
|
-
|
|
44
38
|
/** Whether to show the number of TV clips in place of reviews */
|
|
45
39
|
@property({ type: Boolean }) showTvClips = false;
|
|
46
40
|
|
|
@@ -58,6 +58,9 @@ export class TileDispatcher
|
|
|
58
58
|
|
|
59
59
|
@property({ type: Boolean }) showTvClips = false;
|
|
60
60
|
|
|
61
|
+
/** Whether to use the simple layout in grid mode */
|
|
62
|
+
@property({ type: Boolean }) useSimpleLayout = false;
|
|
63
|
+
|
|
61
64
|
/** Whether this tile should include a hover pane at all (for applicable tile modes) */
|
|
62
65
|
@property({ type: Boolean }) enableHoverPane = false;
|
|
63
66
|
|
|
@@ -342,6 +345,7 @@ export class TileDispatcher
|
|
|
342
345
|
.creatorFilter=${creatorFilter}
|
|
343
346
|
.loggedIn=${this.loggedIn}
|
|
344
347
|
.isManageView=${this.isManageView}
|
|
348
|
+
?useSimpleLayout=${this.useSimpleLayout}
|
|
345
349
|
?showTvClips=${this.showTvClips}
|
|
346
350
|
?showInfoButton=${!this.isHoverEnabled}
|
|
347
351
|
@infoButtonPressed=${this.tileInfoButtonPressed}
|