@internetarchive/collection-browser 3.3.2 → 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.
- package/.editorconfig +29 -29
- package/.github/workflows/ci.yml +27 -27
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.husky/pre-commit +4 -4
- package/.prettierignore +1 -1
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/index.d.ts +16 -0
- package/dist/index.js.map +1 -0
- package/dist/src/app-root.d.ts +105 -0
- package/dist/src/app-root.js +1076 -0
- package/dist/src/app-root.js.map +1 -0
- package/dist/src/assets/img/icons/arrow-left.d.ts +2 -0
- package/dist/src/assets/img/icons/arrow-left.js +10 -0
- package/dist/src/assets/img/icons/arrow-left.js.map +1 -0
- package/dist/src/assets/img/icons/arrow-right.d.ts +2 -0
- package/dist/src/assets/img/icons/arrow-right.js +10 -0
- package/dist/src/assets/img/icons/arrow-right.js.map +1 -0
- package/dist/src/assets/img/icons/chevron.d.ts +2 -0
- package/dist/src/assets/img/icons/chevron.js +4 -0
- package/dist/src/assets/img/icons/chevron.js.map +1 -0
- package/dist/src/assets/img/icons/close-circle-dark.d.ts +2 -0
- package/dist/src/assets/img/icons/close-circle-dark.js +5 -0
- package/dist/src/assets/img/icons/close-circle-dark.js.map +1 -0
- package/dist/src/assets/img/icons/contract.d.ts +2 -0
- package/dist/src/assets/img/icons/contract.js +9 -0
- package/dist/src/assets/img/icons/contract.js.map +1 -0
- package/dist/src/assets/img/icons/empty-query.d.ts +2 -0
- package/dist/src/assets/img/icons/empty-query.js +5 -0
- package/dist/src/assets/img/icons/empty-query.js.map +1 -0
- package/dist/src/assets/img/icons/expand.d.ts +2 -0
- package/dist/src/assets/img/icons/expand.js +9 -0
- package/dist/src/assets/img/icons/expand.js.map +1 -0
- package/dist/src/assets/img/icons/eye-closed.d.ts +2 -0
- package/dist/src/assets/img/icons/eye-closed.js +5 -0
- package/dist/src/assets/img/icons/eye-closed.js.map +1 -0
- package/dist/src/assets/img/icons/eye.d.ts +2 -0
- package/dist/src/assets/img/icons/eye.js +5 -0
- package/dist/src/assets/img/icons/eye.js.map +1 -0
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -0
- package/dist/src/assets/img/icons/favorite-filled.js +10 -0
- package/dist/src/assets/img/icons/favorite-filled.js.map +1 -0
- package/dist/src/assets/img/icons/favorite-unfilled.d.ts +1 -0
- package/dist/src/assets/img/icons/favorite-unfilled.js +9 -0
- package/dist/src/assets/img/icons/favorite-unfilled.js.map +1 -0
- package/dist/src/assets/img/icons/filter.d.ts +2 -0
- package/dist/src/assets/img/icons/filter.js +10 -0
- package/dist/src/assets/img/icons/filter.js.map +1 -0
- package/dist/src/assets/img/icons/login-required.d.ts +1 -0
- package/dist/src/assets/img/icons/login-required.js +18 -0
- package/dist/src/assets/img/icons/login-required.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/account.js +14 -0
- package/dist/src/assets/img/icons/mediatype/account.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/audio.js +14 -0
- package/dist/src/assets/img/icons/mediatype/audio.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/collection.js +12 -0
- package/dist/src/assets/img/icons/mediatype/collection.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/data.js +15 -0
- package/dist/src/assets/img/icons/mediatype/data.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/etree.js +14 -0
- package/dist/src/assets/img/icons/mediatype/etree.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/film.js +14 -0
- package/dist/src/assets/img/icons/mediatype/film.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/images.js +13 -0
- package/dist/src/assets/img/icons/mediatype/images.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/radio.js +15 -0
- package/dist/src/assets/img/icons/mediatype/radio.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/search.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/search.js +14 -0
- package/dist/src/assets/img/icons/mediatype/search.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/software.js +13 -0
- package/dist/src/assets/img/icons/mediatype/software.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/texts.js +13 -0
- package/dist/src/assets/img/icons/mediatype/texts.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/tv-commercial.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/tv-commercial.js +12 -0
- package/dist/src/assets/img/icons/mediatype/tv-commercial.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/tv-fact-check.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/tv-fact-check.js +12 -0
- package/dist/src/assets/img/icons/mediatype/tv-fact-check.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/tv-quote.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/tv-quote.js +12 -0
- package/dist/src/assets/img/icons/mediatype/tv-quote.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/tv.js +14 -0
- package/dist/src/assets/img/icons/mediatype/tv.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/video.js +14 -0
- package/dist/src/assets/img/icons/mediatype/video.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/web.js +13 -0
- package/dist/src/assets/img/icons/mediatype/web.js.map +1 -0
- package/dist/src/assets/img/icons/null-result.d.ts +2 -0
- package/dist/src/assets/img/icons/null-result.js +5 -0
- package/dist/src/assets/img/icons/null-result.js.map +1 -0
- package/dist/src/assets/img/icons/quote.d.ts +1 -0
- package/dist/src/assets/img/icons/quote.js +7 -0
- package/dist/src/assets/img/icons/quote.js.map +1 -0
- package/dist/src/assets/img/icons/restricted.d.ts +1 -0
- package/dist/src/assets/img/icons/restricted.js +13 -0
- package/dist/src/assets/img/icons/restricted.js.map +1 -0
- package/dist/src/assets/img/icons/reviews.d.ts +1 -0
- package/dist/src/assets/img/icons/reviews.js +11 -0
- package/dist/src/assets/img/icons/reviews.js.map +1 -0
- package/dist/src/assets/img/icons/upload.d.ts +1 -0
- package/dist/src/assets/img/icons/upload.js +12 -0
- package/dist/src/assets/img/icons/upload.js.map +1 -0
- package/dist/src/assets/img/icons/views.d.ts +1 -0
- package/dist/src/assets/img/icons/views.js +11 -0
- package/dist/src/assets/img/icons/views.js.map +1 -0
- package/dist/src/circular-activity-indicator.d.ts +5 -0
- package/dist/src/circular-activity-indicator.js +66 -0
- package/dist/src/circular-activity-indicator.js.map +1 -0
- package/dist/src/collection-browser.d.ts +684 -0
- package/dist/src/collection-browser.js +2567 -0
- package/dist/src/collection-browser.js.map +1 -0
- package/dist/src/collection-facets/facet-row.d.ts +30 -0
- package/dist/src/collection-facets/facet-row.js +265 -0
- package/dist/src/collection-facets/facet-row.js.map +1 -0
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -0
- package/dist/src/collection-facets/facet-tombstone-row.js +43 -0
- package/dist/src/collection-facets/facet-tombstone-row.js.map +1 -0
- package/dist/src/collection-facets/facets-template.d.ts +13 -0
- package/dist/src/collection-facets/facets-template.js +68 -0
- package/dist/src/collection-facets/facets-template.js.map +1 -0
- package/dist/src/collection-facets/models.d.ts +9 -0
- package/dist/src/collection-facets/models.js +10 -0
- package/dist/src/collection-facets/models.js.map +1 -0
- package/dist/src/collection-facets/more-facets-content.d.ts +109 -0
- package/dist/src/collection-facets/more-facets-content.js +547 -0
- package/dist/src/collection-facets/more-facets-content.js.map +1 -0
- package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -0
- package/dist/src/collection-facets/more-facets-pagination.js +264 -0
- package/dist/src/collection-facets/more-facets-pagination.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/dedupe.d.ts +10 -0
- package/dist/src/collection-facets/smart-facets/dedupe.js +35 -0
- package/dist/src/collection-facets/smart-facets/dedupe.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.d.ts +5 -0
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js +24 -0
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/index.d.ts +3 -0
- package/dist/src/collection-facets/smart-facets/heuristics/index.js +4 -0
- package/dist/src/collection-facets/smart-facets/heuristics/index.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.d.ts +4 -0
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js +14 -0
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.d.ts +6 -0
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js +68 -0
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.d.ts +9 -0
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js +69 -0
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.d.ts +21 -0
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +76 -0
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/models.d.ts +30 -0
- package/dist/src/collection-facets/smart-facets/models.js +2 -0
- package/dist/src/collection-facets/smart-facets/models.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.d.ts +54 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +383 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-button.d.ts +11 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js +133 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.d.ts +28 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +172 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.d.ts +2 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.js +13 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.d.ts +5 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js +18 -0
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +1 -0
- package/dist/src/collection-facets/toggle-switch.d.ts +41 -0
- package/dist/src/collection-facets/toggle-switch.js +174 -0
- package/dist/src/collection-facets/toggle-switch.js.map +1 -0
- package/dist/src/collection-facets.d.ts +113 -0
- package/dist/src/collection-facets.js +872 -0
- package/dist/src/collection-facets.js.map +1 -0
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +261 -0
- package/dist/src/data-source/collection-browser-data-source-interface.js +2 -0
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -0
- package/dist/src/data-source/collection-browser-data-source.d.ts +400 -0
- package/dist/src/data-source/collection-browser-data-source.js +1103 -0
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -0
- package/dist/src/data-source/collection-browser-query-state.d.ts +49 -0
- package/dist/src/data-source/collection-browser-query-state.js +2 -0
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -0
- package/dist/src/data-source/models.d.ts +32 -0
- package/dist/src/data-source/models.js +9 -0
- package/dist/src/data-source/models.js.map +1 -0
- package/dist/src/empty-placeholder.d.ts +23 -0
- package/dist/src/empty-placeholder.js +165 -0
- package/dist/src/empty-placeholder.js.map +1 -0
- package/dist/src/expanded-date-picker.d.ts +50 -0
- package/dist/src/expanded-date-picker.js +182 -0
- package/dist/src/expanded-date-picker.js.map +1 -0
- package/dist/src/language-code-handler/language-code-handler.d.ts +37 -0
- package/dist/src/language-code-handler/language-code-handler.js +27 -0
- package/dist/src/language-code-handler/language-code-handler.js.map +1 -0
- package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -0
- package/dist/src/language-code-handler/language-code-mapping.js +563 -0
- package/dist/src/language-code-handler/language-code-mapping.js.map +1 -0
- package/dist/src/manage/manage-bar.d.ts +58 -0
- package/dist/src/manage/manage-bar.js +237 -0
- package/dist/src/manage/manage-bar.js.map +1 -0
- package/dist/src/manage/remove-items-modal-content.d.ts +9 -0
- package/dist/src/manage/remove-items-modal-content.js +104 -0
- package/dist/src/manage/remove-items-modal-content.js.map +1 -0
- package/dist/src/mediatype/mediatype-config.d.ts +11 -0
- package/dist/src/mediatype/mediatype-config.js +116 -0
- package/dist/src/mediatype/mediatype-config.js.map +1 -0
- package/dist/src/models.d.ts +302 -0
- package/dist/src/models.js +511 -0
- package/dist/src/models.js.map +1 -0
- package/dist/src/restoration-state-handler.d.ts +75 -0
- package/dist/src/restoration-state-handler.js +403 -0
- package/dist/src/restoration-state-handler.js.map +1 -0
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +6 -0
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +60 -0
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js.map +1 -0
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +21 -0
- package/dist/src/sort-filter-bar/alpha-bar.js +241 -0
- package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -0
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -0
- package/dist/src/sort-filter-bar/img/compact.js +5 -0
- package/dist/src/sort-filter-bar/img/compact.js.map +1 -0
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -0
- package/dist/src/sort-filter-bar/img/list.js +5 -0
- package/dist/src/sort-filter-bar/img/list.js.map +1 -0
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -0
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +15 -0
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js.map +1 -0
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -0
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js +17 -0
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js.map +1 -0
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -0
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js +17 -0
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js.map +1 -0
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -0
- package/dist/src/sort-filter-bar/img/sort-triangle.js +5 -0
- package/dist/src/sort-filter-bar/img/sort-triangle.js.map +1 -0
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -0
- package/dist/src/sort-filter-bar/img/tile.js +5 -0
- package/dist/src/sort-filter-bar/img/tile.js.map +1 -0
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +278 -0
- package/dist/src/sort-filter-bar/sort-filter-bar.js +1161 -0
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -0
- package/dist/src/styles/ia-button.d.ts +2 -0
- package/dist/src/styles/ia-button.js +134 -0
- package/dist/src/styles/ia-button.js.map +1 -0
- package/dist/src/styles/item-image-styles.d.ts +8 -0
- package/dist/src/styles/item-image-styles.js +123 -0
- package/dist/src/styles/item-image-styles.js.map +1 -0
- package/dist/src/styles/sr-only.d.ts +1 -0
- package/dist/src/styles/sr-only.js +18 -0
- package/dist/src/styles/sr-only.js.map +1 -0
- package/dist/src/tiles/base-tile-component.d.ts +27 -0
- package/dist/src/tiles/base-tile-component.js +82 -0
- package/dist/src/tiles/base-tile-component.js.map +1 -0
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -0
- package/dist/src/tiles/collection-browser-loading-tile.js +29 -0
- package/dist/src/tiles/collection-browser-loading-tile.js.map +1 -0
- package/dist/src/tiles/grid/account-tile.d.ts +18 -0
- package/dist/src/tiles/grid/account-tile.js +111 -0
- package/dist/src/tiles/grid/account-tile.js.map +1 -0
- package/dist/src/tiles/grid/collection-tile.d.ts +15 -0
- package/dist/src/tiles/grid/collection-tile.js +160 -0
- package/dist/src/tiles/grid/collection-tile.js.map +1 -0
- package/dist/src/tiles/grid/item-tile.d.ts +41 -0
- package/dist/src/tiles/grid/item-tile.js +321 -0
- package/dist/src/tiles/grid/item-tile.js.map +1 -0
- package/dist/src/tiles/grid/search-tile.d.ts +10 -0
- package/dist/src/tiles/grid/search-tile.js +95 -0
- package/dist/src/tiles/grid/search-tile.js.map +1 -0
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -0
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +128 -0
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -0
- package/dist/src/tiles/grid/tile-stats.d.ts +58 -0
- package/dist/src/tiles/grid/tile-stats.js +204 -0
- package/dist/src/tiles/grid/tile-stats.js.map +1 -0
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +228 -0
- package/dist/src/tiles/hover/hover-pane-controller.js +446 -0
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -0
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +20 -0
- package/dist/src/tiles/hover/tile-hover-pane.js +185 -0
- package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -0
- package/dist/src/tiles/image-block.d.ts +19 -0
- package/dist/src/tiles/image-block.js +175 -0
- package/dist/src/tiles/image-block.js.map +1 -0
- package/dist/src/tiles/item-image.d.ts +40 -0
- package/dist/src/tiles/item-image.js +191 -0
- package/dist/src/tiles/item-image.js.map +1 -0
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +6 -0
- package/dist/src/tiles/list/tile-list-compact-header.js +85 -0
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -0
- package/dist/src/tiles/list/tile-list-compact.d.ts +19 -0
- package/dist/src/tiles/list/tile-list-compact.js +223 -0
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -0
- package/dist/src/tiles/list/tile-list.d.ts +54 -0
- package/dist/src/tiles/list/tile-list.js +621 -0
- package/dist/src/tiles/list/tile-list.js.map +1 -0
- package/dist/src/tiles/models.d.ts +1 -0
- package/dist/src/tiles/models.js +2 -0
- package/dist/src/tiles/models.js.map +1 -0
- package/dist/src/tiles/overlay/icon-overlay.d.ts +8 -0
- package/dist/src/tiles/overlay/icon-overlay.js +55 -0
- package/dist/src/tiles/overlay/icon-overlay.js.map +1 -0
- package/dist/src/tiles/overlay/text-overlay.d.ts +9 -0
- package/dist/src/tiles/overlay/text-overlay.js +74 -0
- package/dist/src/tiles/overlay/text-overlay.js.map +1 -0
- package/dist/src/tiles/review-block.d.ts +12 -0
- package/dist/src/tiles/review-block.js +134 -0
- package/dist/src/tiles/review-block.js.map +1 -0
- package/dist/src/tiles/text-snippet-block.d.ts +27 -0
- package/dist/src/tiles/text-snippet-block.js +132 -0
- package/dist/src/tiles/text-snippet-block.js.map +1 -0
- package/dist/src/tiles/tile-dispatcher.d.ts +71 -0
- package/dist/src/tiles/tile-dispatcher.js +472 -0
- package/dist/src/tiles/tile-dispatcher.js.map +1 -0
- package/dist/src/tiles/tile-display-value-provider.d.ts +47 -0
- package/dist/src/tiles/tile-display-value-provider.js +95 -0
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -0
- package/dist/src/tiles/tile-mediatype-icon.d.ts +27 -0
- package/dist/src/tiles/tile-mediatype-icon.js +130 -0
- package/dist/src/tiles/tile-mediatype-icon.js.map +1 -0
- package/dist/src/utils/analytics-events.d.ts +28 -0
- package/dist/src/utils/analytics-events.js +31 -0
- package/dist/src/utils/analytics-events.js.map +1 -0
- package/dist/src/utils/array-equals.d.ts +4 -0
- package/dist/src/utils/array-equals.js +11 -0
- package/dist/src/utils/array-equals.js.map +1 -0
- package/dist/src/utils/collapse-repeated-quotes.d.ts +11 -0
- package/dist/src/utils/collapse-repeated-quotes.js +14 -0
- package/dist/src/utils/collapse-repeated-quotes.js.map +1 -0
- package/dist/src/utils/facet-utils.d.ts +83 -0
- package/dist/src/utils/facet-utils.js +152 -0
- package/dist/src/utils/facet-utils.js.map +1 -0
- package/dist/src/utils/format-count.d.ts +7 -0
- package/dist/src/utils/format-count.js +76 -0
- package/dist/src/utils/format-count.js.map +1 -0
- package/dist/src/utils/format-date.d.ts +16 -0
- package/dist/src/utils/format-date.js +33 -0
- package/dist/src/utils/format-date.js.map +1 -0
- package/dist/src/utils/format-unit-size.d.ts +2 -0
- package/dist/src/utils/format-unit-size.js +34 -0
- package/dist/src/utils/format-unit-size.js.map +1 -0
- package/dist/src/utils/local-date-from-utc.d.ts +9 -0
- package/dist/src/utils/local-date-from-utc.js +16 -0
- package/dist/src/utils/local-date-from-utc.js.map +1 -0
- package/dist/src/utils/log.d.ts +7 -0
- package/dist/src/utils/log.js +14 -0
- package/dist/src/utils/log.js.map +1 -0
- package/dist/src/utils/resolve-mediatype.d.ts +8 -0
- package/dist/src/utils/resolve-mediatype.js +24 -0
- package/dist/src/utils/resolve-mediatype.js.map +1 -0
- package/dist/src/utils/sha1.d.ts +2 -0
- package/dist/src/utils/sha1.js +9 -0
- package/dist/src/utils/sha1.js.map +1 -0
- package/dist/test/collection-browser.test.d.ts +1 -0
- package/dist/test/collection-browser.test.js +1711 -0
- package/dist/test/collection-browser.test.js.map +1 -0
- package/dist/test/collection-facets/facet-row.test.d.ts +1 -0
- package/dist/test/collection-facets/facet-row.test.js +274 -0
- package/dist/test/collection-facets/facet-row.test.js.map +1 -0
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -0
- package/dist/test/collection-facets/facets-template.test.js +101 -0
- package/dist/test/collection-facets/facets-template.test.js.map +1 -0
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -0
- package/dist/test/collection-facets/more-facets-content.test.js +169 -0
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -0
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -0
- package/dist/test/collection-facets/more-facets-pagination.test.js +132 -0
- package/dist/test/collection-facets/more-facets-pagination.test.js.map +1 -0
- package/dist/test/collection-facets/toggle-switch.test.d.ts +1 -0
- package/dist/test/collection-facets/toggle-switch.test.js +96 -0
- package/dist/test/collection-facets/toggle-switch.test.js.map +1 -0
- package/dist/test/collection-facets.test.d.ts +2 -0
- package/dist/test/collection-facets.test.js +745 -0
- package/dist/test/collection-facets.test.js.map +1 -0
- package/dist/test/data-source/collection-browser-data-source.test.d.ts +1 -0
- package/dist/test/data-source/collection-browser-data-source.test.js +102 -0
- package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -0
- package/dist/test/empty-placeholder.test.d.ts +1 -0
- package/dist/test/empty-placeholder.test.js +63 -0
- package/dist/test/empty-placeholder.test.js.map +1 -0
- package/dist/test/expanded-date-picker.test.d.ts +1 -0
- package/dist/test/expanded-date-picker.test.js +130 -0
- package/dist/test/expanded-date-picker.test.js.map +1 -0
- package/dist/test/icon-overlay.test.d.ts +1 -0
- package/dist/test/icon-overlay.test.js +30 -0
- package/dist/test/icon-overlay.test.js.map +1 -0
- package/dist/test/image-block.test.d.ts +1 -0
- package/dist/test/image-block.test.js +218 -0
- package/dist/test/image-block.test.js.map +1 -0
- package/dist/test/item-image.test.d.ts +1 -0
- package/dist/test/item-image.test.js +196 -0
- package/dist/test/item-image.test.js.map +1 -0
- package/dist/test/manage/manage-bar.test.d.ts +2 -0
- package/dist/test/manage/manage-bar.test.js +106 -0
- package/dist/test/manage/manage-bar.test.js.map +1 -0
- package/dist/test/manage/remove-items-modal-content.test.d.ts +1 -0
- package/dist/test/manage/remove-items-modal-content.test.js +65 -0
- package/dist/test/manage/remove-items-modal-content.test.js.map +1 -0
- package/dist/test/mediatype-config.test.d.ts +1 -0
- package/dist/test/mediatype-config.test.js +11 -0
- package/dist/test/mediatype-config.test.js.map +1 -0
- package/dist/test/mocks/mock-analytics-handler.d.ts +10 -0
- package/dist/test/mocks/mock-analytics-handler.js +16 -0
- package/dist/test/mocks/mock-analytics-handler.js.map +1 -0
- package/dist/test/mocks/mock-search-responses.d.ts +31 -0
- package/dist/test/mocks/mock-search-responses.js +1241 -0
- package/dist/test/mocks/mock-search-responses.js.map +1 -0
- package/dist/test/mocks/mock-search-service.d.ts +16 -0
- package/dist/test/mocks/mock-search-service.js +65 -0
- package/dist/test/mocks/mock-search-service.js.map +1 -0
- package/dist/test/restoration-state-handler.test.d.ts +1 -0
- package/dist/test/restoration-state-handler.test.js +375 -0
- package/dist/test/restoration-state-handler.test.js.map +1 -0
- package/dist/test/review-block.test.d.ts +1 -0
- package/dist/test/review-block.test.js +48 -0
- package/dist/test/review-block.test.js.map +1 -0
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +1 -0
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +13 -0
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +1 -0
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -0
- package/dist/test/sort-filter-bar/alpha-bar.test.js +74 -0
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -0
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -0
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +609 -0
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -0
- package/dist/test/text-overlay.test.d.ts +1 -0
- package/dist/test/text-overlay.test.js +42 -0
- package/dist/test/text-overlay.test.js.map +1 -0
- package/dist/test/text-snippet-block.test.d.ts +1 -0
- package/dist/test/text-snippet-block.test.js +63 -0
- package/dist/test/text-snippet-block.test.js.map +1 -0
- package/dist/test/tile-stats.test.d.ts +1 -0
- package/dist/test/tile-stats.test.js +128 -0
- package/dist/test/tile-stats.test.js.map +1 -0
- package/dist/test/tiles/grid/account-tile.test.d.ts +1 -0
- package/dist/test/tiles/grid/account-tile.test.js +96 -0
- package/dist/test/tiles/grid/account-tile.test.js.map +1 -0
- package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -0
- package/dist/test/tiles/grid/collection-tile.test.js +96 -0
- package/dist/test/tiles/grid/collection-tile.test.js.map +1 -0
- package/dist/test/tiles/grid/item-tile.test.d.ts +1 -0
- package/dist/test/tiles/grid/item-tile.test.js +427 -0
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -0
- package/dist/test/tiles/grid/search-tile.test.d.ts +1 -0
- package/dist/test/tiles/grid/search-tile.test.js +66 -0
- package/dist/test/tiles/grid/search-tile.test.js.map +1 -0
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -0
- package/dist/test/tiles/hover/hover-pane-controller.test.js +329 -0
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -0
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +1 -0
- package/dist/test/tiles/hover/tile-hover-pane.test.js +57 -0
- package/dist/test/tiles/hover/tile-hover-pane.test.js.map +1 -0
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -0
- package/dist/test/tiles/list/tile-list-compact.test.js +251 -0
- package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -0
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -0
- package/dist/test/tiles/list/tile-list.test.js +469 -0
- package/dist/test/tiles/list/tile-list.test.js.map +1 -0
- package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -0
- package/dist/test/tiles/tile-dispatcher.test.js +231 -0
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -0
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +1 -0
- package/dist/test/tiles/tile-display-value-provider.test.js +142 -0
- package/dist/test/tiles/tile-display-value-provider.test.js.map +1 -0
- package/dist/test/tiles/tile-mediatype-icon.test.d.ts +1 -0
- package/dist/test/tiles/tile-mediatype-icon.test.js +145 -0
- package/dist/test/tiles/tile-mediatype-icon.test.js.map +1 -0
- package/dist/test/utils/array-equals.test.d.ts +1 -0
- package/dist/test/utils/array-equals.test.js +27 -0
- package/dist/test/utils/array-equals.test.js.map +1 -0
- package/dist/test/utils/format-count.test.d.ts +1 -0
- package/dist/test/utils/format-count.test.js +24 -0
- package/dist/test/utils/format-count.test.js.map +1 -0
- package/dist/test/utils/format-date.test.d.ts +1 -0
- package/dist/test/utils/format-date.test.js +61 -0
- package/dist/test/utils/format-date.test.js.map +1 -0
- package/dist/test/utils/format-unit-size.test.d.ts +1 -0
- package/dist/test/utils/format-unit-size.test.js +18 -0
- package/dist/test/utils/format-unit-size.test.js.map +1 -0
- package/dist/test/utils/local-date-from-utc.test.d.ts +1 -0
- package/dist/test/utils/local-date-from-utc.test.js +27 -0
- package/dist/test/utils/local-date-from-utc.test.js.map +1 -0
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +118 -117
- package/renovate.json +6 -6
- package/src/collection-browser.ts +2829 -2829
- package/src/collection-facets/more-facets-content.ts +639 -639
- package/src/collection-facets.ts +994 -995
- package/src/data-source/collection-browser-data-source.ts +1401 -1401
- package/src/data-source/collection-browser-query-state.ts +65 -65
- package/src/data-source/models.ts +43 -43
- package/src/tiles/base-tile-component.ts +65 -65
- package/src/tiles/grid/account-tile.ts +113 -113
- package/src/tiles/grid/collection-tile.ts +163 -163
- package/src/tiles/grid/item-tile.ts +340 -340
- package/src/tiles/hover/hover-pane-controller.ts +613 -517
- package/src/tiles/hover/tile-hover-pane.ts +184 -180
- package/src/tiles/list/tile-list-compact.ts +239 -239
- package/src/tiles/list/tile-list.ts +700 -700
- package/src/tiles/tile-dispatcher.ts +517 -490
- package/src/utils/format-date.ts +62 -62
- package/test/collection-browser.test.ts +2403 -2403
- package/test/tiles/grid/item-tile.test.ts +520 -520
- package/test/tiles/hover/hover-pane-controller.test.ts +418 -353
- package/test/tiles/list/tile-list-compact.test.ts +282 -282
- package/test/tiles/list/tile-list.test.ts +552 -552
- package/test/tiles/tile-dispatcher.test.ts +283 -187
- package/test/utils/format-date.test.ts +89 -89
- package/tsconfig.json +20 -20
- package/web-dev-server.config.mjs +30 -30
- 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
|
+
}
|