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