@internetarchive/collection-browser 3.1.0 → 3.1.1-alpha-webdev6778.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.
Files changed (81) hide show
  1. package/dist/src/app-root.js +606 -606
  2. package/dist/src/app-root.js.map +1 -1
  3. package/dist/src/collection-browser.d.ts +9 -0
  4. package/dist/src/collection-browser.js +7 -0
  5. package/dist/src/collection-browser.js.map +1 -1
  6. package/dist/src/collection-facets/facet-row.js +140 -140
  7. package/dist/src/collection-facets/facet-row.js.map +1 -1
  8. package/dist/src/collection-facets/models.js.map +1 -1
  9. package/dist/src/collection-facets/more-facets-content.d.ts +1 -0
  10. package/dist/src/collection-facets/more-facets-content.js +122 -118
  11. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  12. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +75 -75
  13. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
  14. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +54 -54
  15. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -1
  16. package/dist/src/collection-facets.d.ts +1 -0
  17. package/dist/src/collection-facets.js +269 -265
  18. package/dist/src/collection-facets.js.map +1 -1
  19. package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
  20. package/dist/src/data-source/collection-browser-data-source.js +27 -13
  21. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  22. package/dist/src/data-source/collection-browser-query-state.d.ts +1 -0
  23. package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
  24. package/dist/src/data-source/models.d.ts +1 -1
  25. package/dist/src/data-source/models.js.map +1 -1
  26. package/dist/src/expanded-date-picker.js +52 -52
  27. package/dist/src/expanded-date-picker.js.map +1 -1
  28. package/dist/src/manage/manage-bar.js +77 -77
  29. package/dist/src/manage/manage-bar.js.map +1 -1
  30. package/dist/src/models.js.map +1 -1
  31. package/dist/src/sort-filter-bar/sort-filter-bar.js +376 -376
  32. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  33. package/dist/src/tiles/grid/collection-tile.js +77 -77
  34. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  35. package/dist/src/tiles/grid/item-tile.js +139 -139
  36. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  37. package/dist/src/tiles/grid/search-tile.js +42 -42
  38. package/dist/src/tiles/grid/search-tile.js.map +1 -1
  39. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +119 -119
  40. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
  41. package/dist/src/tiles/list/tile-list.js +297 -297
  42. package/dist/src/tiles/list/tile-list.js.map +1 -1
  43. package/dist/src/tiles/tile-dispatcher.js +200 -200
  44. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  45. package/dist/src/utils/analytics-events.js.map +1 -1
  46. package/dist/test/collection-facets/facet-row.test.js +23 -23
  47. package/dist/test/collection-facets/facet-row.test.js.map +1 -1
  48. package/dist/test/collection-facets.test.js +20 -20
  49. package/dist/test/collection-facets.test.js.map +1 -1
  50. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +37 -37
  51. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
  52. package/dist/test/tiles/list/tile-list.test.js +113 -113
  53. package/dist/test/tiles/list/tile-list.test.js.map +1 -1
  54. package/package.json +2 -2
  55. package/src/app-root.ts +1140 -1140
  56. package/src/collection-browser.ts +14 -0
  57. package/src/collection-facets/facet-row.ts +296 -296
  58. package/src/collection-facets/models.ts +10 -10
  59. package/src/collection-facets/more-facets-content.ts +639 -636
  60. package/src/collection-facets/smart-facets/smart-facet-bar.ts +437 -437
  61. package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +185 -185
  62. package/src/collection-facets.ts +995 -992
  63. package/src/data-source/collection-browser-data-source-interface.ts +333 -333
  64. package/src/data-source/collection-browser-data-source.ts +21 -11
  65. package/src/data-source/collection-browser-query-state.ts +1 -0
  66. package/src/data-source/models.ts +1 -1
  67. package/src/expanded-date-picker.ts +191 -191
  68. package/src/manage/manage-bar.ts +247 -247
  69. package/src/models.ts +870 -870
  70. package/src/sort-filter-bar/sort-filter-bar.ts +1283 -1283
  71. package/src/tiles/grid/collection-tile.ts +162 -162
  72. package/src/tiles/grid/item-tile.ts +339 -339
  73. package/src/tiles/grid/search-tile.ts +90 -90
  74. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +130 -130
  75. package/src/tiles/list/tile-list.ts +696 -696
  76. package/src/tiles/tile-dispatcher.ts +486 -486
  77. package/src/utils/analytics-events.ts +29 -29
  78. package/test/collection-facets/facet-row.test.ts +375 -375
  79. package/test/collection-facets.test.ts +928 -928
  80. package/test/sort-filter-bar/sort-filter-bar.test.ts +885 -885
  81. package/test/tiles/list/tile-list.test.ts +497 -497
@@ -1,696 +1,696 @@
1
- import { css, html, nothing, PropertyValues, TemplateResult } from 'lit';
2
- import { ifDefined } from 'lit/directives/if-defined.js';
3
- import { join } from 'lit/directives/join.js';
4
- import { map } from 'lit/directives/map.js';
5
- import { unsafeHTML } from 'lit/directives/unsafe-html.js';
6
- import { customElement, property, state } from 'lit/decorators.js';
7
- import { msg, str } from '@lit/localize';
8
- import DOMPurify from 'dompurify';
9
-
10
- import type { SortParam } from '@internetarchive/search-service';
11
- import { suppressedCollections } from '../../models';
12
- import type { CollectionTitles } from '../../data-source/models';
13
- import { BaseTileComponent } from '../base-tile-component';
14
-
15
- import { formatCount, NumberFormat } from '../../utils/format-count';
16
- import { formatDate, DateFormat } from '../../utils/format-date';
17
- import { isFirstMillisecondOfUTCYear } from '../../utils/local-date-from-utc';
18
-
19
- import '../image-block';
20
- import '../review-block';
21
- import '../text-snippet-block';
22
- import '../tile-mediatype-icon';
23
-
24
- @customElement('tile-list')
25
- export class TileList extends BaseTileComponent {
26
- /*
27
- * Reactive properties inherited from BaseTileComponent:
28
- * - model?: TileModel;
29
- * - currentWidth?: number;
30
- * - currentHeight?: number;
31
- * - baseNavigationUrl?: string;
32
- * - baseImageUrl?: string;
33
- * - collectionPagePath?: string;
34
- * - sortParam: SortParam | null = null;
35
- * - defaultSortParam: SortParam | null = null;
36
- * - creatorFilter?: string;
37
- * - mobileBreakpoint?: number;
38
- * - loggedIn = false;
39
- * - suppressBlurring = false;
40
- */
41
-
42
- @property({ type: Object })
43
- collectionTitles?: CollectionTitles;
44
-
45
- @state() private collectionLinks: (TemplateResult | typeof nothing)[] = [];
46
-
47
- render() {
48
- return html`
49
- <div id="list-line" class="${this.classSize}">
50
- ${this.classSize === 'mobile'
51
- ? this.mobileTemplate
52
- : this.desktopTemplate}
53
- </div>
54
- `;
55
- }
56
-
57
- /**
58
- * Templates
59
- */
60
- private get mobileTemplate() {
61
- return html`
62
- <div id="list-line-top">
63
- <div id="list-line-left">${this.imageBlockTemplate}</div>
64
- <div id="list-line-right">
65
- <div id="title-line">
66
- <div id="title">${this.titleTemplate}</div>
67
- ${this.iconRightTemplate}
68
- </div>
69
- </div>
70
- </div>
71
- <div id="list-line-bottom">${this.detailsTemplate}</div>
72
- `;
73
- }
74
-
75
- private get desktopTemplate() {
76
- return html`
77
- <div id="list-line-left">${this.imageBlockTemplate}</div>
78
- <div id="list-line-right">
79
- <div id="title-line">
80
- <div id="title">${this.titleTemplate}</div>
81
- ${this.iconRightTemplate}
82
- </div>
83
- ${this.detailsTemplate}
84
- </div>
85
- `;
86
- }
87
-
88
- private get imageBlockTemplate() {
89
- if (!this.model) return nothing;
90
-
91
- const isCollection = this.model.mediatype === 'collection';
92
- const href = this.displayValueProvider.itemPageUrl(
93
- this.model.identifier,
94
- isCollection,
95
- );
96
-
97
- return html`<a
98
- id="image-link"
99
- title=${msg(str`View ${this.model?.title}`)}
100
- href=${href}
101
- >
102
- <image-block
103
- .model=${this.model}
104
- .baseImageUrl=${this.baseImageUrl}
105
- .isCompactTile=${false}
106
- .isListTile=${true}
107
- .viewSize=${this.classSize}
108
- .loggedIn=${this.loggedIn}
109
- .suppressBlurring=${this.suppressBlurring}
110
- >
111
- </image-block>
112
- </a> `;
113
- }
114
-
115
- private get detailsTemplate() {
116
- return html`
117
- ${this.itemLineTemplate} ${this.creatorTemplate}
118
- <div id="dates-line">
119
- ${this.datePublishedTemplate} ${this.dateSortByTemplate}
120
- ${this.webArchivesCaptureDatesTemplate}
121
- </div>
122
- <div id="views-line">
123
- ${this.viewsTemplate} ${this.ratingTemplate} ${this.reviewsTemplate}
124
- </div>
125
- ${this.topicsTemplate} ${this.collectionsTemplate}
126
- ${this.descriptionTemplate} ${this.textSnippetsTemplate}
127
- ${this.reviewBlockTemplate}
128
- `;
129
- }
130
-
131
- // Data templates
132
- private get iconRightTemplate() {
133
- return html`
134
- <a
135
- id="icon-right"
136
- href=${this.mediatypeURL}
137
- title=${msg(str`See more: ${this.model?.mediatype}`)}
138
- >
139
- <tile-mediatype-icon .model=${this.model}> </tile-mediatype-icon>
140
- </a>
141
- `;
142
- }
143
-
144
- private get titleTemplate() {
145
- if (!this.model?.title) {
146
- return nothing;
147
- }
148
-
149
- // If the model has a server-specified href, use it
150
- // Otherwise construct a details link using the identifier
151
- return this.model?.href
152
- ? html`<a href="${this.baseNavigationUrl}${this.model.href}"
153
- >${this.model.title ?? this.model.identifier}</a
154
- >`
155
- : this.detailsLink(
156
- this.model.identifier,
157
- this.model.title,
158
- this.model.mediatype === 'collection',
159
- );
160
- }
161
-
162
- private get itemLineTemplate() {
163
- const source = this.sourceTemplate;
164
- const volume = this.volumeTemplate;
165
- const issue = this.issueTemplate;
166
- if (!source && !volume && !issue) {
167
- return nothing;
168
- }
169
- return html` <div id="item-line">${source} ${volume} ${issue}</div> `;
170
- }
171
-
172
- private get sourceTemplate() {
173
- if (!this.model?.source) {
174
- return nothing;
175
- }
176
- return html`
177
- <div id="source" class="metadata">
178
- ${this.labelTemplate(msg('Source'))}
179
- ${this.searchLink('source', this.model.source)}
180
- </div>
181
- `;
182
- }
183
-
184
- private get volumeTemplate() {
185
- return this.metadataTemplate(this.model?.volume, msg('Volume'));
186
- }
187
-
188
- private get issueTemplate() {
189
- return this.metadataTemplate(this.model?.issue, msg('Issue'));
190
- }
191
-
192
- private get creatorTemplate() {
193
- // "Archivist since" if account
194
- if (this.model?.mediatype === 'account') {
195
- return html`
196
- <div id="creator" class="metadata">
197
- <span class="label"
198
- >${this.displayValueProvider.accountLabel ?? nothing}</span
199
- >
200
- </div>
201
- `;
202
- }
203
- // "Creator" if not account tile
204
- if (!this.model?.creators || this.model.creators.length === 0) {
205
- return nothing;
206
- }
207
- return html`
208
- <div id="creator" class="metadata">
209
- ${this.labelTemplate(msg('By'))}
210
- ${join(
211
- map(this.model.creators, id => this.searchLink('creator', id)),
212
- ', ',
213
- )}
214
- </div>
215
- `;
216
- }
217
-
218
- private get datePublishedTemplate() {
219
- // If we're showing a date published of Jan 1 at midnight, only show the year.
220
- // This is because items with only a year for their publication date are normalized to
221
- // Jan 1 at midnight timestamps in the search engine documents.
222
- const date: Date | undefined = this.model?.datePublished;
223
- let format: DateFormat = 'long';
224
- if (isFirstMillisecondOfUTCYear(date)) {
225
- format = 'year-only';
226
- }
227
-
228
- return this.metadataTemplate(formatDate(date, format), msg('Published'));
229
- }
230
-
231
- // Show date label/value when sorted by date type
232
- // Except datePublished which is always shown
233
- private get dateSortByTemplate() {
234
- if (
235
- this.effectiveSort &&
236
- (this.effectiveSort.field === 'addeddate' ||
237
- this.effectiveSort.field === 'reviewdate' ||
238
- this.effectiveSort.field === 'publicdate')
239
- ) {
240
- return this.metadataTemplate(
241
- formatDate(this.date, 'long'),
242
- this.displayValueProvider.dateLabel,
243
- );
244
- }
245
- return nothing;
246
- }
247
-
248
- private get viewsTemplate() {
249
- const viewCount =
250
- this.effectiveSort?.field === 'week'
251
- ? this.model?.weeklyViewCount // weekly views
252
- : this.model?.viewCount; // all-time views
253
- if (viewCount == null) return nothing;
254
-
255
- // when its a search-tile, we don't have any stats to show
256
- if (this.model?.mediatype === 'search') {
257
- return this.metadataTemplate('(Favorited search query)', '');
258
- }
259
-
260
- return this.metadataTemplate(
261
- `${formatCount(viewCount, this.formatSize)}`,
262
- msg('Views'),
263
- );
264
- }
265
-
266
- private get ratingTemplate() {
267
- return this.metadataTemplate(this.model?.averageRating, msg('Avg Rating'));
268
- }
269
-
270
- private get reviewsTemplate() {
271
- return this.metadataTemplate(this.model?.commentCount, msg('Reviews'));
272
- }
273
-
274
- private get topicsTemplate() {
275
- if (!this.model?.subjects || this.model.subjects.length === 0) {
276
- return nothing;
277
- }
278
- return html`
279
- <div id="topics" class="metadata">
280
- ${this.labelTemplate(msg('Topics'))}
281
- ${join(
282
- map(this.model.subjects, id => this.searchLink('subject', id)),
283
- ', ',
284
- )}
285
- </div>
286
- `;
287
- }
288
-
289
- private get collectionsTemplate() {
290
- if (!this.collectionLinks || this.collectionLinks.length === 0) {
291
- return nothing;
292
- }
293
- return html`
294
- <div id="collections" class="metadata">
295
- ${this.labelTemplate(msg('Collections'))}
296
- ${join(this.collectionLinks, ', ')}
297
- </div>
298
- `;
299
- }
300
-
301
- private get descriptionTemplate() {
302
- return this.metadataTemplate(
303
- // Sanitize away any HTML tags and convert line breaks to spaces.
304
- unsafeHTML(
305
- DOMPurify.sanitize(this.model?.description?.replace(/\n/g, ' ') ?? ''),
306
- ),
307
- '',
308
- 'description',
309
- );
310
- }
311
-
312
- private get reviewBlockTemplate(): TemplateResult | typeof nothing {
313
- if (!this.model?.review) return nothing;
314
-
315
- const { reviewtitle, reviewbody, stars } = this.model.review;
316
- return html`
317
- <review-block
318
- viewsize="list"
319
- title=${ifDefined(reviewtitle)}
320
- body=${ifDefined(reviewbody)}
321
- starRating=${ifDefined(stars)}
322
- >
323
- </review-block>
324
- `;
325
- }
326
-
327
- private get textSnippetsTemplate(): TemplateResult | typeof nothing {
328
- if (!this.hasSnippets) return nothing;
329
-
330
- return html`<text-snippet-block
331
- viewsize="list"
332
- .snippets=${this.model?.snippets}
333
- ></text-snippet-block>`;
334
- }
335
-
336
- private get hasSnippets(): boolean {
337
- return !!this.model?.snippets?.length;
338
- }
339
-
340
- private get webArchivesCaptureDatesTemplate():
341
- | TemplateResult
342
- | typeof nothing {
343
- if (!this.model?.captureDates || !this.model.title) return nothing;
344
-
345
- return html`
346
- <ul class="capture-dates">
347
- ${map(
348
- this.model.captureDates,
349
- date =>
350
- html`<li>
351
- ${this.displayValueProvider.webArchivesCaptureLink(
352
- this.model!.title,
353
- date,
354
- )}
355
- </li>`,
356
- )}
357
- </ul>
358
- `;
359
- }
360
-
361
- // Utility functions
362
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
363
- private metadataTemplate(text: any, label = '', id?: string) {
364
- if (!text) return nothing;
365
- return html`
366
- <div id=${ifDefined(id)} class="metadata">
367
- ${this.labelTemplate(label)} ${text}
368
- </div>
369
- `;
370
- }
371
-
372
- private labelTemplate(label: string) {
373
- return html` ${label
374
- ? html`<span class="label">${label}: </span>`
375
- : nothing}`;
376
- }
377
-
378
- private searchLink(field: string, searchTerm: string) {
379
- if (!field || !searchTerm) {
380
- return nothing;
381
- }
382
- const query = encodeURIComponent(`${field}:"${searchTerm}"`);
383
- // No whitespace after closing tag
384
- // Note: single ' for href='' to wrap " in query var gets changed back by yarn format
385
- return html`<a
386
- href="${this.baseNavigationUrl}/search?query=${query}"
387
- rel="nofollow"
388
- >
389
- ${DOMPurify.sanitize(searchTerm)}</a
390
- >`;
391
- }
392
-
393
- private detailsLink(
394
- identifier?: string,
395
- text?: string,
396
- isCollection = false,
397
- ): TemplateResult | typeof nothing {
398
- if (!identifier) return nothing;
399
-
400
- const linkText = text ?? identifier;
401
- const linkHref = this.displayValueProvider.itemPageUrl(
402
- identifier,
403
- isCollection,
404
- );
405
-
406
- return html`<a href=${linkHref}> ${DOMPurify.sanitize(linkText)} </a>`;
407
- }
408
-
409
- /** The URL of this item's mediatype collection, if defined. */
410
- private get mediatypeURL(): string | typeof nothing {
411
- // NB: baseNavigationUrl can be an empty string
412
- if (this.baseNavigationUrl === undefined || !this.model?.mediatype)
413
- return nothing;
414
-
415
- // Need special handling for certain mediatypes that don't have a top-level collection page
416
- switch (this.model.mediatype) {
417
- case 'collection':
418
- return `${this.baseNavigationUrl}/search?query=mediatype:collection&sort=-downloads`;
419
- case 'account':
420
- return nothing;
421
- default:
422
- return this.displayValueProvider.itemPageUrl(
423
- this.model.mediatype,
424
- true,
425
- );
426
- }
427
- }
428
-
429
- protected updated(changed: PropertyValues): void {
430
- if (changed.has('model') || changed.has('collectionTitles')) {
431
- this.buildCollectionLinks();
432
- }
433
- }
434
-
435
- private async buildCollectionLinks() {
436
- if (!this.model?.collections || this.model.collections.length === 0) {
437
- return;
438
- }
439
-
440
- // Note: quirk of Lit: need to replace collectionLinks array,
441
- // otherwise it will not re-render. Can't simply alter the array.
442
- this.collectionLinks = [];
443
- const newCollectionLinks: (TemplateResult | typeof nothing)[] = [];
444
- for (const collection of this.model.collections) {
445
- // Don't include favorites or collections that are meant to be suppressed
446
- if (
447
- !suppressedCollections[collection] &&
448
- !collection.startsWith('fav-')
449
- ) {
450
- newCollectionLinks.push(
451
- this.detailsLink(
452
- collection,
453
- this.collectionTitles?.get(collection) ?? collection,
454
- true,
455
- ),
456
- );
457
- }
458
- }
459
- this.collectionLinks = newCollectionLinks;
460
- }
461
-
462
- /*
463
- * TODO: fix field names to match model in src/collection-browser.ts
464
- * private get dateSortSelector()
465
- * @see src/models.ts
466
- */
467
- private get date(): Date | undefined {
468
- switch (this.effectiveSort?.field) {
469
- case 'date':
470
- return this.model?.datePublished;
471
- case 'reviewdate':
472
- return this.model?.dateReviewed;
473
- case 'addeddate':
474
- return this.model?.dateAdded;
475
- default:
476
- return this.model?.dateArchived; // publicdate
477
- }
478
- }
479
-
480
- /**
481
- * Returns the active sort param if one is set, or the default sort param otherwise.
482
- */
483
- private get effectiveSort(): SortParam | null {
484
- return this.sortParam ?? this.defaultSortParam;
485
- }
486
-
487
- private get classSize(): string {
488
- if (
489
- this.mobileBreakpoint &&
490
- this.currentWidth &&
491
- this.currentWidth < this.mobileBreakpoint
492
- ) {
493
- return 'mobile';
494
- }
495
- return 'desktop';
496
- }
497
-
498
- private get formatSize(): NumberFormat {
499
- if (
500
- this.mobileBreakpoint &&
501
- this.currentWidth &&
502
- this.currentWidth < this.mobileBreakpoint
503
- ) {
504
- return 'short';
505
- }
506
- return 'long';
507
- }
508
-
509
- static get styles() {
510
- return css`
511
- html {
512
- font-size: unset;
513
- }
514
-
515
- div {
516
- font-size: 14px;
517
- }
518
-
519
- div a {
520
- text-decoration: none;
521
- }
522
-
523
- div a:link {
524
- color: var(--ia-theme-link-color, #4b64ff);
525
- }
526
-
527
- .label {
528
- font-weight: bold;
529
- }
530
-
531
- #list-line.mobile {
532
- --infiniteScrollerRowGap: 20px;
533
- --infiniteScrollerRowHeight: auto;
534
- }
535
-
536
- #list-line.desktop {
537
- --infiniteScrollerRowGap: 30px;
538
- --infiniteScrollerRowHeight: auto;
539
- }
540
-
541
- /* fields */
542
- #icon-right {
543
- width: 20px;
544
- padding-top: 5px;
545
- --iconHeight: 20px;
546
- --iconWidth: 20px;
547
- --iconTextAlign: right;
548
- margin-top: -8px;
549
- text-align: right;
550
- }
551
-
552
- #title {
553
- color: #4b64ff;
554
- text-decoration: none;
555
- font-size: 22px;
556
- font-weight: bold;
557
- /* align top of text with image */
558
- line-height: 25px;
559
- margin-top: -4px;
560
- padding-bottom: 2px;
561
- flex-grow: 1;
562
-
563
- display: -webkit-box;
564
- -webkit-box-orient: vertical;
565
- -webkit-line-clamp: 3;
566
- overflow: hidden;
567
- overflow-wrap: anywhere;
568
- }
569
-
570
- .metadata {
571
- line-height: 20px;
572
- }
573
-
574
- #description,
575
- #creator,
576
- #topics,
577
- #source {
578
- text-align: left;
579
- overflow: hidden;
580
- text-overflow: ellipsis;
581
- -webkit-box-orient: vertical;
582
- display: -webkit-box;
583
- word-break: break-word;
584
- -webkit-line-clamp: 3; /* number of lines to show */
585
- line-clamp: 3;
586
-
587
- /*
588
- * Safari doesn't always respect the line-clamping rules above,
589
- * so we add this to ensure these fields still get truncated
590
- */
591
- max-height: 60px;
592
- }
593
-
594
- #collections {
595
- display: -webkit-box;
596
- -webkit-box-orient: vertical;
597
- -webkit-line-clamp: 3;
598
- overflow: hidden;
599
- overflow-wrap: anywhere;
600
- }
601
-
602
- #collections > a {
603
- display: inline-block;
604
- }
605
-
606
- #icon {
607
- padding-top: 5px;
608
- }
609
-
610
- #description {
611
- padding-top: 10px;
612
- }
613
-
614
- /* Top level container */
615
- #list-line {
616
- display: flex;
617
- }
618
-
619
- #list-line.mobile {
620
- flex-direction: column;
621
- }
622
-
623
- #list-line.desktop {
624
- column-gap: 10px;
625
- }
626
-
627
- #list-line-top {
628
- display: flex;
629
- column-gap: 7px;
630
- }
631
-
632
- #list-line-bottom {
633
- padding-top: 4px;
634
- }
635
-
636
- #list-line-right,
637
- #list-line-top,
638
- #list-line-bottom {
639
- width: 100%;
640
- }
641
-
642
- /*
643
- * If the container becomes very tiny, don't let the thumbnail side take
644
- * up too much space. Shouldn't make a difference on ordinary viewport sizes.
645
- */
646
- #list-line-left {
647
- max-width: 25%;
648
-
649
- display: flex;
650
- flex-direction: column;
651
- row-gap: 5px;
652
- }
653
-
654
- div a:hover {
655
- text-decoration: underline;
656
- }
657
-
658
- /* Lines containing multiple div as row */
659
- #item-line,
660
- #dates-line,
661
- #views-line,
662
- #title-line {
663
- display: flex;
664
- flex-direction: row;
665
- column-gap: 10px;
666
- }
667
-
668
- /*
669
- * With the exception of the title line, allow these to wrap if
670
- * the space becomes too small to accommodate them together.
671
- *
672
- * The title line is excluded because it contains the mediatype icon
673
- * which we don't want to wrap.
674
- */
675
- #item-line,
676
- #dates-line,
677
- #views-line {
678
- flex-wrap: wrap;
679
- }
680
-
681
- .capture-dates {
682
- margin: 0;
683
- padding: 0;
684
- list-style-type: none;
685
- }
686
-
687
- .capture-dates a:link {
688
- text-decoration: none;
689
- color: var(--ia-theme-link-color, #4b64ff);
690
- }
691
- .capture-dates a:hover {
692
- text-decoration: underline;
693
- }
694
- `;
695
- }
696
- }
1
+ import { css, html, nothing, PropertyValues, TemplateResult } from 'lit';
2
+ import { ifDefined } from 'lit/directives/if-defined.js';
3
+ import { join } from 'lit/directives/join.js';
4
+ import { map } from 'lit/directives/map.js';
5
+ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
6
+ import { customElement, property, state } from 'lit/decorators.js';
7
+ import { msg, str } from '@lit/localize';
8
+ import DOMPurify from 'dompurify';
9
+
10
+ import type { SortParam } from '@internetarchive/search-service';
11
+ import { suppressedCollections } from '../../models';
12
+ import type { CollectionTitles } from '../../data-source/models';
13
+ import { BaseTileComponent } from '../base-tile-component';
14
+
15
+ import { formatCount, NumberFormat } from '../../utils/format-count';
16
+ import { formatDate, DateFormat } from '../../utils/format-date';
17
+ import { isFirstMillisecondOfUTCYear } from '../../utils/local-date-from-utc';
18
+
19
+ import '../image-block';
20
+ import '../review-block';
21
+ import '../text-snippet-block';
22
+ import '../tile-mediatype-icon';
23
+
24
+ @customElement('tile-list')
25
+ export class TileList extends BaseTileComponent {
26
+ /*
27
+ * Reactive properties inherited from BaseTileComponent:
28
+ * - model?: TileModel;
29
+ * - currentWidth?: number;
30
+ * - currentHeight?: number;
31
+ * - baseNavigationUrl?: string;
32
+ * - baseImageUrl?: string;
33
+ * - collectionPagePath?: string;
34
+ * - sortParam: SortParam | null = null;
35
+ * - defaultSortParam: SortParam | null = null;
36
+ * - creatorFilter?: string;
37
+ * - mobileBreakpoint?: number;
38
+ * - loggedIn = false;
39
+ * - suppressBlurring = false;
40
+ */
41
+
42
+ @property({ type: Object })
43
+ collectionTitles?: CollectionTitles;
44
+
45
+ @state() private collectionLinks: (TemplateResult | typeof nothing)[] = [];
46
+
47
+ render() {
48
+ return html`
49
+ <div id="list-line" class="${this.classSize}">
50
+ ${this.classSize === 'mobile'
51
+ ? this.mobileTemplate
52
+ : this.desktopTemplate}
53
+ </div>
54
+ `;
55
+ }
56
+
57
+ /**
58
+ * Templates
59
+ */
60
+ private get mobileTemplate() {
61
+ return html`
62
+ <div id="list-line-top">
63
+ <div id="list-line-left">${this.imageBlockTemplate}</div>
64
+ <div id="list-line-right">
65
+ <div id="title-line">
66
+ <div id="title">${this.titleTemplate}</div>
67
+ ${this.iconRightTemplate}
68
+ </div>
69
+ </div>
70
+ </div>
71
+ <div id="list-line-bottom">${this.detailsTemplate}</div>
72
+ `;
73
+ }
74
+
75
+ private get desktopTemplate() {
76
+ return html`
77
+ <div id="list-line-left">${this.imageBlockTemplate}</div>
78
+ <div id="list-line-right">
79
+ <div id="title-line">
80
+ <div id="title">${this.titleTemplate}</div>
81
+ ${this.iconRightTemplate}
82
+ </div>
83
+ ${this.detailsTemplate}
84
+ </div>
85
+ `;
86
+ }
87
+
88
+ private get imageBlockTemplate() {
89
+ if (!this.model) return nothing;
90
+
91
+ const isCollection = this.model.mediatype === 'collection';
92
+ const href = this.displayValueProvider.itemPageUrl(
93
+ this.model.identifier,
94
+ isCollection,
95
+ );
96
+
97
+ return html`<a
98
+ id="image-link"
99
+ title=${msg(str`View ${this.model?.title}`)}
100
+ href=${href}
101
+ >
102
+ <image-block
103
+ .model=${this.model}
104
+ .baseImageUrl=${this.baseImageUrl}
105
+ .isCompactTile=${false}
106
+ .isListTile=${true}
107
+ .viewSize=${this.classSize}
108
+ .loggedIn=${this.loggedIn}
109
+ .suppressBlurring=${this.suppressBlurring}
110
+ >
111
+ </image-block>
112
+ </a> `;
113
+ }
114
+
115
+ private get detailsTemplate() {
116
+ return html`
117
+ ${this.itemLineTemplate} ${this.creatorTemplate}
118
+ <div id="dates-line">
119
+ ${this.datePublishedTemplate} ${this.dateSortByTemplate}
120
+ ${this.webArchivesCaptureDatesTemplate}
121
+ </div>
122
+ <div id="views-line">
123
+ ${this.viewsTemplate} ${this.ratingTemplate} ${this.reviewsTemplate}
124
+ </div>
125
+ ${this.topicsTemplate} ${this.collectionsTemplate}
126
+ ${this.descriptionTemplate} ${this.textSnippetsTemplate}
127
+ ${this.reviewBlockTemplate}
128
+ `;
129
+ }
130
+
131
+ // Data templates
132
+ private get iconRightTemplate() {
133
+ return html`
134
+ <a
135
+ id="icon-right"
136
+ href=${this.mediatypeURL}
137
+ title=${msg(str`See more: ${this.model?.mediatype}`)}
138
+ >
139
+ <tile-mediatype-icon .model=${this.model}> </tile-mediatype-icon>
140
+ </a>
141
+ `;
142
+ }
143
+
144
+ private get titleTemplate() {
145
+ if (!this.model?.title) {
146
+ return nothing;
147
+ }
148
+
149
+ // If the model has a server-specified href, use it
150
+ // Otherwise construct a details link using the identifier
151
+ return this.model?.href
152
+ ? html`<a href="${this.baseNavigationUrl}${this.model.href}"
153
+ >${this.model.title ?? this.model.identifier}</a
154
+ >`
155
+ : this.detailsLink(
156
+ this.model.identifier,
157
+ this.model.title,
158
+ this.model.mediatype === 'collection',
159
+ );
160
+ }
161
+
162
+ private get itemLineTemplate() {
163
+ const source = this.sourceTemplate;
164
+ const volume = this.volumeTemplate;
165
+ const issue = this.issueTemplate;
166
+ if (!source && !volume && !issue) {
167
+ return nothing;
168
+ }
169
+ return html` <div id="item-line">${source} ${volume} ${issue}</div> `;
170
+ }
171
+
172
+ private get sourceTemplate() {
173
+ if (!this.model?.source) {
174
+ return nothing;
175
+ }
176
+ return html`
177
+ <div id="source" class="metadata">
178
+ ${this.labelTemplate(msg('Source'))}
179
+ ${this.searchLink('source', this.model.source)}
180
+ </div>
181
+ `;
182
+ }
183
+
184
+ private get volumeTemplate() {
185
+ return this.metadataTemplate(this.model?.volume, msg('Volume'));
186
+ }
187
+
188
+ private get issueTemplate() {
189
+ return this.metadataTemplate(this.model?.issue, msg('Issue'));
190
+ }
191
+
192
+ private get creatorTemplate() {
193
+ // "Archivist since" if account
194
+ if (this.model?.mediatype === 'account') {
195
+ return html`
196
+ <div id="creator" class="metadata">
197
+ <span class="label"
198
+ >${this.displayValueProvider.accountLabel ?? nothing}</span
199
+ >
200
+ </div>
201
+ `;
202
+ }
203
+ // "Creator" if not account tile
204
+ if (!this.model?.creators || this.model.creators.length === 0) {
205
+ return nothing;
206
+ }
207
+ return html`
208
+ <div id="creator" class="metadata">
209
+ ${this.labelTemplate(msg('By'))}
210
+ ${join(
211
+ map(this.model.creators, id => this.searchLink('creator', id)),
212
+ ', ',
213
+ )}
214
+ </div>
215
+ `;
216
+ }
217
+
218
+ private get datePublishedTemplate() {
219
+ // If we're showing a date published of Jan 1 at midnight, only show the year.
220
+ // This is because items with only a year for their publication date are normalized to
221
+ // Jan 1 at midnight timestamps in the search engine documents.
222
+ const date: Date | undefined = this.model?.datePublished;
223
+ let format: DateFormat = 'long';
224
+ if (isFirstMillisecondOfUTCYear(date)) {
225
+ format = 'year-only';
226
+ }
227
+
228
+ return this.metadataTemplate(formatDate(date, format), msg('Published'));
229
+ }
230
+
231
+ // Show date label/value when sorted by date type
232
+ // Except datePublished which is always shown
233
+ private get dateSortByTemplate() {
234
+ if (
235
+ this.effectiveSort &&
236
+ (this.effectiveSort.field === 'addeddate' ||
237
+ this.effectiveSort.field === 'reviewdate' ||
238
+ this.effectiveSort.field === 'publicdate')
239
+ ) {
240
+ return this.metadataTemplate(
241
+ formatDate(this.date, 'long'),
242
+ this.displayValueProvider.dateLabel,
243
+ );
244
+ }
245
+ return nothing;
246
+ }
247
+
248
+ private get viewsTemplate() {
249
+ const viewCount =
250
+ this.effectiveSort?.field === 'week'
251
+ ? this.model?.weeklyViewCount // weekly views
252
+ : this.model?.viewCount; // all-time views
253
+ if (viewCount == null) return nothing;
254
+
255
+ // when its a search-tile, we don't have any stats to show
256
+ if (this.model?.mediatype === 'search') {
257
+ return this.metadataTemplate('(Favorited search query)', '');
258
+ }
259
+
260
+ return this.metadataTemplate(
261
+ `${formatCount(viewCount, this.formatSize)}`,
262
+ msg('Views'),
263
+ );
264
+ }
265
+
266
+ private get ratingTemplate() {
267
+ return this.metadataTemplate(this.model?.averageRating, msg('Avg Rating'));
268
+ }
269
+
270
+ private get reviewsTemplate() {
271
+ return this.metadataTemplate(this.model?.commentCount, msg('Reviews'));
272
+ }
273
+
274
+ private get topicsTemplate() {
275
+ if (!this.model?.subjects || this.model.subjects.length === 0) {
276
+ return nothing;
277
+ }
278
+ return html`
279
+ <div id="topics" class="metadata">
280
+ ${this.labelTemplate(msg('Topics'))}
281
+ ${join(
282
+ map(this.model.subjects, id => this.searchLink('subject', id)),
283
+ ', ',
284
+ )}
285
+ </div>
286
+ `;
287
+ }
288
+
289
+ private get collectionsTemplate() {
290
+ if (!this.collectionLinks || this.collectionLinks.length === 0) {
291
+ return nothing;
292
+ }
293
+ return html`
294
+ <div id="collections" class="metadata">
295
+ ${this.labelTemplate(msg('Collections'))}
296
+ ${join(this.collectionLinks, ', ')}
297
+ </div>
298
+ `;
299
+ }
300
+
301
+ private get descriptionTemplate() {
302
+ return this.metadataTemplate(
303
+ // Sanitize away any HTML tags and convert line breaks to spaces.
304
+ unsafeHTML(
305
+ DOMPurify.sanitize(this.model?.description?.replace(/\n/g, ' ') ?? ''),
306
+ ),
307
+ '',
308
+ 'description',
309
+ );
310
+ }
311
+
312
+ private get reviewBlockTemplate(): TemplateResult | typeof nothing {
313
+ if (!this.model?.review) return nothing;
314
+
315
+ const { reviewtitle, reviewbody, stars } = this.model.review;
316
+ return html`
317
+ <review-block
318
+ viewsize="list"
319
+ title=${ifDefined(reviewtitle)}
320
+ body=${ifDefined(reviewbody)}
321
+ starRating=${ifDefined(stars)}
322
+ >
323
+ </review-block>
324
+ `;
325
+ }
326
+
327
+ private get textSnippetsTemplate(): TemplateResult | typeof nothing {
328
+ if (!this.hasSnippets) return nothing;
329
+
330
+ return html`<text-snippet-block
331
+ viewsize="list"
332
+ .snippets=${this.model?.snippets}
333
+ ></text-snippet-block>`;
334
+ }
335
+
336
+ private get hasSnippets(): boolean {
337
+ return !!this.model?.snippets?.length;
338
+ }
339
+
340
+ private get webArchivesCaptureDatesTemplate():
341
+ | TemplateResult
342
+ | typeof nothing {
343
+ if (!this.model?.captureDates || !this.model.title) return nothing;
344
+
345
+ return html`
346
+ <ul class="capture-dates">
347
+ ${map(
348
+ this.model.captureDates,
349
+ date =>
350
+ html`<li>
351
+ ${this.displayValueProvider.webArchivesCaptureLink(
352
+ this.model!.title,
353
+ date,
354
+ )}
355
+ </li>`,
356
+ )}
357
+ </ul>
358
+ `;
359
+ }
360
+
361
+ // Utility functions
362
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
363
+ private metadataTemplate(text: any, label = '', id?: string) {
364
+ if (!text) return nothing;
365
+ return html`
366
+ <div id=${ifDefined(id)} class="metadata">
367
+ ${this.labelTemplate(label)} ${text}
368
+ </div>
369
+ `;
370
+ }
371
+
372
+ private labelTemplate(label: string) {
373
+ return html` ${label
374
+ ? html`<span class="label">${label}: </span>`
375
+ : nothing}`;
376
+ }
377
+
378
+ private searchLink(field: string, searchTerm: string) {
379
+ if (!field || !searchTerm) {
380
+ return nothing;
381
+ }
382
+ const query = encodeURIComponent(`${field}:"${searchTerm}"`);
383
+ // No whitespace after closing tag
384
+ // Note: single ' for href='' to wrap " in query var gets changed back by yarn format
385
+ return html`<a
386
+ href="${this.baseNavigationUrl}/search?query=${query}"
387
+ rel="nofollow"
388
+ >
389
+ ${DOMPurify.sanitize(searchTerm)}</a
390
+ >`;
391
+ }
392
+
393
+ private detailsLink(
394
+ identifier?: string,
395
+ text?: string,
396
+ isCollection = false,
397
+ ): TemplateResult | typeof nothing {
398
+ if (!identifier) return nothing;
399
+
400
+ const linkText = text ?? identifier;
401
+ const linkHref = this.displayValueProvider.itemPageUrl(
402
+ identifier,
403
+ isCollection,
404
+ );
405
+
406
+ return html`<a href=${linkHref}> ${DOMPurify.sanitize(linkText)} </a>`;
407
+ }
408
+
409
+ /** The URL of this item's mediatype collection, if defined. */
410
+ private get mediatypeURL(): string | typeof nothing {
411
+ // NB: baseNavigationUrl can be an empty string
412
+ if (this.baseNavigationUrl === undefined || !this.model?.mediatype)
413
+ return nothing;
414
+
415
+ // Need special handling for certain mediatypes that don't have a top-level collection page
416
+ switch (this.model.mediatype) {
417
+ case 'collection':
418
+ return `${this.baseNavigationUrl}/search?query=mediatype:collection&sort=-downloads`;
419
+ case 'account':
420
+ return nothing;
421
+ default:
422
+ return this.displayValueProvider.itemPageUrl(
423
+ this.model.mediatype,
424
+ true,
425
+ );
426
+ }
427
+ }
428
+
429
+ protected updated(changed: PropertyValues): void {
430
+ if (changed.has('model') || changed.has('collectionTitles')) {
431
+ this.buildCollectionLinks();
432
+ }
433
+ }
434
+
435
+ private async buildCollectionLinks() {
436
+ if (!this.model?.collections || this.model.collections.length === 0) {
437
+ return;
438
+ }
439
+
440
+ // Note: quirk of Lit: need to replace collectionLinks array,
441
+ // otherwise it will not re-render. Can't simply alter the array.
442
+ this.collectionLinks = [];
443
+ const newCollectionLinks: (TemplateResult | typeof nothing)[] = [];
444
+ for (const collection of this.model.collections) {
445
+ // Don't include favorites or collections that are meant to be suppressed
446
+ if (
447
+ !suppressedCollections[collection] &&
448
+ !collection.startsWith('fav-')
449
+ ) {
450
+ newCollectionLinks.push(
451
+ this.detailsLink(
452
+ collection,
453
+ this.collectionTitles?.get(collection) ?? collection,
454
+ true,
455
+ ),
456
+ );
457
+ }
458
+ }
459
+ this.collectionLinks = newCollectionLinks;
460
+ }
461
+
462
+ /*
463
+ * TODO: fix field names to match model in src/collection-browser.ts
464
+ * private get dateSortSelector()
465
+ * @see src/models.ts
466
+ */
467
+ private get date(): Date | undefined {
468
+ switch (this.effectiveSort?.field) {
469
+ case 'date':
470
+ return this.model?.datePublished;
471
+ case 'reviewdate':
472
+ return this.model?.dateReviewed;
473
+ case 'addeddate':
474
+ return this.model?.dateAdded;
475
+ default:
476
+ return this.model?.dateArchived; // publicdate
477
+ }
478
+ }
479
+
480
+ /**
481
+ * Returns the active sort param if one is set, or the default sort param otherwise.
482
+ */
483
+ private get effectiveSort(): SortParam | null {
484
+ return this.sortParam ?? this.defaultSortParam;
485
+ }
486
+
487
+ private get classSize(): string {
488
+ if (
489
+ this.mobileBreakpoint &&
490
+ this.currentWidth &&
491
+ this.currentWidth < this.mobileBreakpoint
492
+ ) {
493
+ return 'mobile';
494
+ }
495
+ return 'desktop';
496
+ }
497
+
498
+ private get formatSize(): NumberFormat {
499
+ if (
500
+ this.mobileBreakpoint &&
501
+ this.currentWidth &&
502
+ this.currentWidth < this.mobileBreakpoint
503
+ ) {
504
+ return 'short';
505
+ }
506
+ return 'long';
507
+ }
508
+
509
+ static get styles() {
510
+ return css`
511
+ html {
512
+ font-size: unset;
513
+ }
514
+
515
+ div {
516
+ font-size: 14px;
517
+ }
518
+
519
+ div a {
520
+ text-decoration: none;
521
+ }
522
+
523
+ div a:link {
524
+ color: var(--ia-theme-link-color, #4b64ff);
525
+ }
526
+
527
+ .label {
528
+ font-weight: bold;
529
+ }
530
+
531
+ #list-line.mobile {
532
+ --infiniteScrollerRowGap: 20px;
533
+ --infiniteScrollerRowHeight: auto;
534
+ }
535
+
536
+ #list-line.desktop {
537
+ --infiniteScrollerRowGap: 30px;
538
+ --infiniteScrollerRowHeight: auto;
539
+ }
540
+
541
+ /* fields */
542
+ #icon-right {
543
+ width: 20px;
544
+ padding-top: 5px;
545
+ --iconHeight: 20px;
546
+ --iconWidth: 20px;
547
+ --iconTextAlign: right;
548
+ margin-top: -8px;
549
+ text-align: right;
550
+ }
551
+
552
+ #title {
553
+ color: #4b64ff;
554
+ text-decoration: none;
555
+ font-size: 22px;
556
+ font-weight: bold;
557
+ /* align top of text with image */
558
+ line-height: 25px;
559
+ margin-top: -4px;
560
+ padding-bottom: 2px;
561
+ flex-grow: 1;
562
+
563
+ display: -webkit-box;
564
+ -webkit-box-orient: vertical;
565
+ -webkit-line-clamp: 3;
566
+ overflow: hidden;
567
+ overflow-wrap: anywhere;
568
+ }
569
+
570
+ .metadata {
571
+ line-height: 20px;
572
+ }
573
+
574
+ #description,
575
+ #creator,
576
+ #topics,
577
+ #source {
578
+ text-align: left;
579
+ overflow: hidden;
580
+ text-overflow: ellipsis;
581
+ -webkit-box-orient: vertical;
582
+ display: -webkit-box;
583
+ word-break: break-word;
584
+ -webkit-line-clamp: 3; /* number of lines to show */
585
+ line-clamp: 3;
586
+
587
+ /*
588
+ * Safari doesn't always respect the line-clamping rules above,
589
+ * so we add this to ensure these fields still get truncated
590
+ */
591
+ max-height: 60px;
592
+ }
593
+
594
+ #collections {
595
+ display: -webkit-box;
596
+ -webkit-box-orient: vertical;
597
+ -webkit-line-clamp: 3;
598
+ overflow: hidden;
599
+ overflow-wrap: anywhere;
600
+ }
601
+
602
+ #collections > a {
603
+ display: inline-block;
604
+ }
605
+
606
+ #icon {
607
+ padding-top: 5px;
608
+ }
609
+
610
+ #description {
611
+ padding-top: 10px;
612
+ }
613
+
614
+ /* Top level container */
615
+ #list-line {
616
+ display: flex;
617
+ }
618
+
619
+ #list-line.mobile {
620
+ flex-direction: column;
621
+ }
622
+
623
+ #list-line.desktop {
624
+ column-gap: 10px;
625
+ }
626
+
627
+ #list-line-top {
628
+ display: flex;
629
+ column-gap: 7px;
630
+ }
631
+
632
+ #list-line-bottom {
633
+ padding-top: 4px;
634
+ }
635
+
636
+ #list-line-right,
637
+ #list-line-top,
638
+ #list-line-bottom {
639
+ width: 100%;
640
+ }
641
+
642
+ /*
643
+ * If the container becomes very tiny, don't let the thumbnail side take
644
+ * up too much space. Shouldn't make a difference on ordinary viewport sizes.
645
+ */
646
+ #list-line-left {
647
+ max-width: 25%;
648
+
649
+ display: flex;
650
+ flex-direction: column;
651
+ row-gap: 5px;
652
+ }
653
+
654
+ div a:hover {
655
+ text-decoration: underline;
656
+ }
657
+
658
+ /* Lines containing multiple div as row */
659
+ #item-line,
660
+ #dates-line,
661
+ #views-line,
662
+ #title-line {
663
+ display: flex;
664
+ flex-direction: row;
665
+ column-gap: 10px;
666
+ }
667
+
668
+ /*
669
+ * With the exception of the title line, allow these to wrap if
670
+ * the space becomes too small to accommodate them together.
671
+ *
672
+ * The title line is excluded because it contains the mediatype icon
673
+ * which we don't want to wrap.
674
+ */
675
+ #item-line,
676
+ #dates-line,
677
+ #views-line {
678
+ flex-wrap: wrap;
679
+ }
680
+
681
+ .capture-dates {
682
+ margin: 0;
683
+ padding: 0;
684
+ list-style-type: none;
685
+ }
686
+
687
+ .capture-dates a:link {
688
+ text-decoration: none;
689
+ color: var(--ia-theme-link-color, #4b64ff);
690
+ }
691
+ .capture-dates a:hover {
692
+ text-decoration: underline;
693
+ }
694
+ `;
695
+ }
696
+ }