@internetarchive/collection-browser 4.7.1-alpha-webdev9189.0 → 4.8.1-webdev-9227.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/src/app-root.js +0 -2
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/assets/img/icons/check.d.ts +2 -0
- package/dist/src/assets/img/icons/check.js +5 -0
- package/dist/src/assets/img/icons/check.js.map +1 -0
- package/dist/src/collection-browser.d.ts +2 -1
- package/dist/src/collection-browser.js +5 -27
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row-template.d.ts +38 -0
- package/dist/src/collection-facets/facet-row-template.js +200 -0
- package/dist/src/collection-facets/facet-row-template.js.map +1 -0
- package/dist/src/collection-facets/facet-row.js +11 -186
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/models.d.ts +7 -2
- package/dist/src/collection-facets/models.js +7 -2
- package/dist/src/collection-facets/models.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +87 -21
- package/dist/src/collection-facets/more-facets-content.js +479 -201
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-scroller.d.ts +85 -0
- package/dist/src/collection-facets/more-facets-scroller.js +429 -0
- package/dist/src/collection-facets/more-facets-scroller.js.map +1 -0
- package/dist/src/collection-facets/page-window.d.ts +73 -0
- package/dist/src/collection-facets/page-window.js +202 -0
- package/dist/src/collection-facets/page-window.js.map +1 -0
- package/dist/src/collection-facets/toggle-switch.js +1 -0
- package/dist/src/collection-facets/toggle-switch.js.map +1 -1
- package/dist/src/collection-facets.js +3 -2
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/empty-placeholder.d.ts +7 -7
- package/dist/src/empty-placeholder.js +29 -15
- package/dist/src/empty-placeholder.js.map +1 -1
- package/dist/src/expanded-date-picker.js +3 -2
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/locales/es.d.ts +94 -0
- package/dist/src/locales/es.js +109 -0
- package/dist/src/locales/es.js.map +1 -0
- package/dist/src/manage/manage-bar.d.ts +3 -2
- package/dist/src/manage/manage-bar.js +6 -7
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/manage/remove-items-modal-content.js +3 -2
- package/dist/src/manage/remove-items-modal-content.js.map +1 -1
- package/dist/src/models.d.ts +4 -0
- package/dist/src/models.js +22 -2
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +3 -3
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.js +3 -2
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +3 -2
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +3 -2
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.js +3 -2
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js +3 -2
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +3 -1
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +3 -2
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/overlay/text-overlay.js +3 -1
- package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
- package/dist/src/tiles/review-block.js +3 -2
- package/dist/src/tiles/review-block.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +2 -1
- package/dist/src/tiles/tile-dispatcher.js +5 -4
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/utils/log.d.ts +1 -4
- package/dist/src/utils/normalize-filter-text.d.ts +28 -0
- package/dist/src/utils/normalize-filter-text.js +35 -0
- package/dist/src/utils/normalize-filter-text.js.map +1 -0
- package/locales/es.d.ts +1 -0
- package/locales/es.js +1 -0
- package/package.json +15 -1
- package/.editorconfig +0 -29
- package/.github/workflows/ci.yml +0 -29
- package/.github/workflows/gh-pages-main.yml +0 -41
- package/.github/workflows/npm-publish.yml +0 -42
- package/.github/workflows/pr-preview.yml +0 -40
- package/.husky/pre-commit +0 -1
- package/.prettierignore +0 -1
- package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -36
- package/dist/src/collection-facets/more-facets-pagination.js +0 -260
- package/dist/src/collection-facets/more-facets-pagination.js.map +0 -1
- package/dist/test/collection-browser.test.d.ts +0 -1
- package/dist/test/collection-browser.test.js +0 -1849
- package/dist/test/collection-browser.test.js.map +0 -1
- package/dist/test/collection-facets/facet-row.test.d.ts +0 -1
- package/dist/test/collection-facets/facet-row.test.js +0 -291
- package/dist/test/collection-facets/facet-row.test.js.map +0 -1
- package/dist/test/collection-facets/facets-template.test.d.ts +0 -1
- package/dist/test/collection-facets/facets-template.test.js +0 -95
- package/dist/test/collection-facets/facets-template.test.js.map +0 -1
- package/dist/test/collection-facets/more-facets-content.test.d.ts +0 -1
- package/dist/test/collection-facets/more-facets-content.test.js +0 -159
- package/dist/test/collection-facets/more-facets-content.test.js.map +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +0 -126
- package/dist/test/collection-facets/more-facets-pagination.test.js.map +0 -1
- package/dist/test/collection-facets/toggle-switch.test.d.ts +0 -1
- package/dist/test/collection-facets/toggle-switch.test.js +0 -99
- package/dist/test/collection-facets/toggle-switch.test.js.map +0 -1
- package/dist/test/collection-facets.test.d.ts +0 -2
- package/dist/test/collection-facets.test.js +0 -728
- package/dist/test/collection-facets.test.js.map +0 -1
- package/dist/test/data-source/collection-browser-data-source.test.d.ts +0 -1
- package/dist/test/data-source/collection-browser-data-source.test.js +0 -154
- package/dist/test/data-source/collection-browser-data-source.test.js.map +0 -1
- package/dist/test/empty-placeholder.test.d.ts +0 -1
- package/dist/test/empty-placeholder.test.js +0 -57
- package/dist/test/empty-placeholder.test.js.map +0 -1
- package/dist/test/expanded-date-picker.test.d.ts +0 -1
- package/dist/test/expanded-date-picker.test.js +0 -124
- package/dist/test/expanded-date-picker.test.js.map +0 -1
- package/dist/test/icon-overlay.test.d.ts +0 -1
- package/dist/test/icon-overlay.test.js +0 -31
- package/dist/test/icon-overlay.test.js.map +0 -1
- package/dist/test/image-block.test.d.ts +0 -1
- package/dist/test/image-block.test.js +0 -208
- package/dist/test/image-block.test.js.map +0 -1
- package/dist/test/item-image.test.d.ts +0 -1
- package/dist/test/item-image.test.js +0 -187
- package/dist/test/item-image.test.js.map +0 -1
- package/dist/test/manage/manage-bar.test.d.ts +0 -3
- package/dist/test/manage/manage-bar.test.js +0 -216
- package/dist/test/manage/manage-bar.test.js.map +0 -1
- package/dist/test/manage/remove-items-modal-content.test.d.ts +0 -1
- package/dist/test/manage/remove-items-modal-content.test.js +0 -60
- package/dist/test/manage/remove-items-modal-content.test.js.map +0 -1
- package/dist/test/mediatype-config.test.d.ts +0 -1
- package/dist/test/mediatype-config.test.js +0 -11
- package/dist/test/mediatype-config.test.js.map +0 -1
- package/dist/test/mocks/mock-analytics-handler.d.ts +0 -10
- package/dist/test/mocks/mock-analytics-handler.js +0 -16
- package/dist/test/mocks/mock-analytics-handler.js.map +0 -1
- package/dist/test/mocks/mock-search-responses.d.ts +0 -31
- package/dist/test/mocks/mock-search-responses.js +0 -1241
- package/dist/test/mocks/mock-search-responses.js.map +0 -1
- package/dist/test/mocks/mock-search-service.d.ts +0 -16
- package/dist/test/mocks/mock-search-service.js +0 -64
- package/dist/test/mocks/mock-search-service.js.map +0 -1
- package/dist/test/restoration-state-handler.test.d.ts +0 -1
- package/dist/test/restoration-state-handler.test.js +0 -335
- package/dist/test/restoration-state-handler.test.js.map +0 -1
- package/dist/test/review-block.test.d.ts +0 -1
- package/dist/test/review-block.test.js +0 -46
- package/dist/test/review-block.test.js.map +0 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +0 -12
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +0 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +0 -68
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -326
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +0 -1
- package/dist/test/text-overlay.test.d.ts +0 -1
- package/dist/test/text-overlay.test.js +0 -43
- package/dist/test/text-overlay.test.js.map +0 -1
- package/dist/test/text-snippet-block.test.d.ts +0 -1
- package/dist/test/text-snippet-block.test.js +0 -58
- package/dist/test/text-snippet-block.test.js.map +0 -1
- package/dist/test/tile-stats.test.d.ts +0 -1
- package/dist/test/tile-stats.test.js +0 -167
- package/dist/test/tile-stats.test.js.map +0 -1
- package/dist/test/tiles/grid/account-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/account-tile.test.js +0 -96
- package/dist/test/tiles/grid/account-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/collection-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/collection-tile.test.js +0 -90
- package/dist/test/tiles/grid/collection-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/item-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/item-tile.test.js +0 -400
- package/dist/test/tiles/grid/item-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/search-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/search-tile.test.js +0 -62
- package/dist/test/tiles/grid/search-tile.test.js.map +0 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +0 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -351
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +0 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +0 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js +0 -53
- package/dist/test/tiles/hover/tile-hover-pane.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list-compact-header.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list-compact-header.test.js +0 -36
- package/dist/test/tiles/list/tile-list-compact-header.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +0 -237
- package/dist/test/tiles/list/tile-list-compact.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list.test.js +0 -460
- package/dist/test/tiles/list/tile-list.test.js.map +0 -1
- package/dist/test/tiles/tile-dispatcher.test.d.ts +0 -1
- package/dist/test/tiles/tile-dispatcher.test.js +0 -246
- package/dist/test/tiles/tile-dispatcher.test.js.map +0 -1
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +0 -1
- package/dist/test/tiles/tile-display-value-provider.test.js +0 -142
- package/dist/test/tiles/tile-display-value-provider.test.js.map +0 -1
- package/dist/test/tiles/tile-mediatype-icon.test.d.ts +0 -1
- package/dist/test/tiles/tile-mediatype-icon.test.js +0 -133
- package/dist/test/tiles/tile-mediatype-icon.test.js.map +0 -1
- package/dist/test/utils/array-equals.test.d.ts +0 -1
- package/dist/test/utils/array-equals.test.js +0 -27
- package/dist/test/utils/array-equals.test.js.map +0 -1
- package/dist/test/utils/format-count.test.d.ts +0 -1
- package/dist/test/utils/format-count.test.js +0 -24
- package/dist/test/utils/format-count.test.js.map +0 -1
- package/dist/test/utils/format-date.test.d.ts +0 -1
- package/dist/test/utils/format-date.test.js +0 -61
- package/dist/test/utils/format-date.test.js.map +0 -1
- package/dist/test/utils/format-unit-size.test.d.ts +0 -1
- package/dist/test/utils/format-unit-size.test.js +0 -18
- package/dist/test/utils/format-unit-size.test.js.map +0 -1
- package/dist/test/utils/local-date-from-utc.test.d.ts +0 -1
- package/dist/test/utils/local-date-from-utc.test.js +0 -27
- package/dist/test/utils/local-date-from-utc.test.js.map +0 -1
- package/eslint.config.mjs +0 -53
- package/index.html +0 -24
- package/index.ts +0 -29
- package/local.archive.org.cert +0 -86
- package/local.archive.org.key +0 -27
- package/pnpm-workspace.yaml +0 -30
- package/renovate.json +0 -6
- package/src/app-root.ts +0 -1284
- package/src/assets/img/icons/arrow-left.ts +0 -10
- package/src/assets/img/icons/arrow-right.ts +0 -10
- package/src/assets/img/icons/chevron.ts +0 -4
- package/src/assets/img/icons/close-circle-dark.ts +0 -5
- package/src/assets/img/icons/contract.ts +0 -9
- package/src/assets/img/icons/empty-query.ts +0 -5
- package/src/assets/img/icons/expand.ts +0 -9
- package/src/assets/img/icons/eye-closed.ts +0 -5
- package/src/assets/img/icons/eye.ts +0 -5
- package/src/assets/img/icons/favorite-filled.ts +0 -10
- package/src/assets/img/icons/favorite-unfilled.ts +0 -9
- package/src/assets/img/icons/filter.ts +0 -10
- package/src/assets/img/icons/login-required.ts +0 -18
- package/src/assets/img/icons/mediatype/account.ts +0 -14
- package/src/assets/img/icons/mediatype/audio.ts +0 -14
- package/src/assets/img/icons/mediatype/collection.ts +0 -12
- package/src/assets/img/icons/mediatype/data.ts +0 -15
- package/src/assets/img/icons/mediatype/etree.ts +0 -14
- package/src/assets/img/icons/mediatype/film.ts +0 -14
- package/src/assets/img/icons/mediatype/images.ts +0 -13
- package/src/assets/img/icons/mediatype/radio.ts +0 -15
- package/src/assets/img/icons/mediatype/search.ts +0 -14
- package/src/assets/img/icons/mediatype/software.ts +0 -13
- package/src/assets/img/icons/mediatype/texts.ts +0 -13
- package/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
- package/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
- package/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
- package/src/assets/img/icons/mediatype/tv.ts +0 -14
- package/src/assets/img/icons/mediatype/video.ts +0 -14
- package/src/assets/img/icons/mediatype/web.ts +0 -13
- package/src/assets/img/icons/null-result.ts +0 -5
- package/src/assets/img/icons/quote.ts +0 -7
- package/src/assets/img/icons/restricted.ts +0 -13
- package/src/assets/img/icons/reviews.ts +0 -11
- package/src/assets/img/icons/upload.ts +0 -12
- package/src/assets/img/icons/views.ts +0 -11
- package/src/circular-activity-indicator.ts +0 -64
- package/src/collection-browser.ts +0 -3187
- package/src/collection-facets/facet-row.ts +0 -309
- package/src/collection-facets/facet-tombstone-row.ts +0 -40
- package/src/collection-facets/facets-template.ts +0 -85
- package/src/collection-facets/models.ts +0 -10
- package/src/collection-facets/more-facets-content.ts +0 -644
- package/src/collection-facets/more-facets-pagination.ts +0 -294
- package/src/collection-facets/smart-facets/dedupe.ts +0 -44
- package/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
- package/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
- package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
- package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
- package/src/collection-facets/smart-facets/models.ts +0 -36
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
- package/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
- package/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
- package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
- package/src/collection-facets/toggle-switch.ts +0 -174
- package/src/collection-facets.ts +0 -1013
- package/src/data-source/collection-browser-data-source-interface.ts +0 -351
- package/src/data-source/collection-browser-data-source.ts +0 -1474
- package/src/data-source/collection-browser-query-state.ts +0 -60
- package/src/data-source/models.ts +0 -56
- package/src/empty-placeholder.ts +0 -192
- package/src/expanded-date-picker.ts +0 -191
- package/src/language-code-handler/language-code-handler.ts +0 -64
- package/src/language-code-handler/language-code-mapping.ts +0 -564
- package/src/manage/manage-bar.ts +0 -276
- package/src/manage/remove-items-modal-content.ts +0 -102
- package/src/mediatype/mediatype-config.ts +0 -146
- package/src/models.ts +0 -895
- package/src/restoration-state-handler.ts +0 -550
- package/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
- package/src/sort-filter-bar/alpha-bar.ts +0 -252
- package/src/sort-filter-bar/img/compact.ts +0 -5
- package/src/sort-filter-bar/img/list.ts +0 -5
- package/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
- package/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
- package/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
- package/src/sort-filter-bar/img/sort-triangle.ts +0 -5
- package/src/sort-filter-bar/img/tile.ts +0 -5
- package/src/sort-filter-bar/sort-filter-bar.ts +0 -734
- package/src/styles/ia-button.ts +0 -139
- package/src/styles/item-image-styles.ts +0 -124
- package/src/styles/sr-only.ts +0 -18
- package/src/styles/tile-action-styles.ts +0 -59
- package/src/tiles/base-tile-component.ts +0 -124
- package/src/tiles/collection-browser-loading-tile.ts +0 -26
- package/src/tiles/grid/account-tile.ts +0 -113
- package/src/tiles/grid/collection-tile.ts +0 -184
- package/src/tiles/grid/item-tile.ts +0 -347
- package/src/tiles/grid/search-tile.ts +0 -90
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
- package/src/tiles/grid/tile-stats.ts +0 -211
- package/src/tiles/hover/hover-pane-controller.ts +0 -638
- package/src/tiles/hover/tile-hover-pane.ts +0 -184
- package/src/tiles/image-block.ts +0 -162
- package/src/tiles/item-image.ts +0 -214
- package/src/tiles/list/tile-list-compact-header.ts +0 -112
- package/src/tiles/list/tile-list-compact.ts +0 -278
- package/src/tiles/list/tile-list.ts +0 -718
- package/src/tiles/models.ts +0 -21
- package/src/tiles/overlay/icon-overlay.ts +0 -57
- package/src/tiles/overlay/text-overlay.ts +0 -79
- package/src/tiles/review-block.ts +0 -130
- package/src/tiles/text-snippet-block.ts +0 -132
- package/src/tiles/tile-dispatcher.ts +0 -637
- package/src/tiles/tile-display-value-provider.ts +0 -133
- package/src/tiles/tile-mediatype-icon.ts +0 -133
- package/src/utils/analytics-events.ts +0 -29
- package/src/utils/array-equals.ts +0 -8
- package/src/utils/collapse-repeated-quotes.ts +0 -13
- package/src/utils/date-filter-field.ts +0 -11
- package/src/utils/facet-utils.ts +0 -183
- package/src/utils/format-count.ts +0 -95
- package/src/utils/format-date.ts +0 -62
- package/src/utils/format-unit-size.ts +0 -43
- package/src/utils/local-date-from-utc.ts +0 -15
- package/src/utils/log.ts +0 -14
- package/src/utils/resolve-mediatype.ts +0 -26
- package/src/utils/sha1.ts +0 -9
- package/test/collection-browser.test.ts +0 -2694
- package/test/collection-facets/facet-row.test.ts +0 -421
- package/test/collection-facets/facets-template.test.ts +0 -139
- package/test/collection-facets/more-facets-content.test.ts +0 -231
- package/test/collection-facets/more-facets-pagination.test.ts +0 -201
- package/test/collection-facets/toggle-switch.test.ts +0 -164
- package/test/collection-facets.test.ts +0 -928
- package/test/data-source/collection-browser-data-source.test.ts +0 -193
- package/test/empty-placeholder.test.ts +0 -88
- package/test/expanded-date-picker.test.ts +0 -201
- package/test/icon-overlay.test.ts +0 -38
- package/test/image-block.test.ts +0 -247
- package/test/item-image.test.ts +0 -220
- package/test/manage/manage-bar.test.ts +0 -347
- package/test/manage/remove-items-modal-content.test.ts +0 -81
- package/test/mediatype-config.test.ts +0 -11
- package/test/mocks/mock-analytics-handler.ts +0 -30
- package/test/mocks/mock-search-responses.ts +0 -1364
- package/test/mocks/mock-search-service.ts +0 -134
- package/test/restoration-state-handler.test.ts +0 -480
- package/test/review-block.test.ts +0 -62
- package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
- package/test/sort-filter-bar/alpha-bar.test.ts +0 -101
- package/test/sort-filter-bar/sort-filter-bar.test.ts +0 -472
- package/test/text-overlay.test.ts +0 -55
- package/test/text-snippet-block.test.ts +0 -85
- package/test/tile-stats.test.ts +0 -191
- package/test/tiles/grid/account-tile.test.ts +0 -121
- package/test/tiles/grid/collection-tile.test.ts +0 -114
- package/test/tiles/grid/item-tile.test.ts +0 -520
- package/test/tiles/grid/search-tile.test.ts +0 -75
- package/test/tiles/hover/hover-pane-controller.test.ts +0 -482
- package/test/tiles/hover/tile-hover-pane.test.ts +0 -80
- package/test/tiles/list/tile-list-compact-header.test.ts +0 -43
- package/test/tiles/list/tile-list-compact.test.ts +0 -282
- package/test/tiles/list/tile-list.test.ts +0 -576
- package/test/tiles/tile-dispatcher.test.ts +0 -320
- package/test/tiles/tile-display-value-provider.test.ts +0 -172
- package/test/tiles/tile-mediatype-icon.test.ts +0 -160
- package/test/utils/array-equals.test.ts +0 -31
- package/test/utils/format-count.test.ts +0 -32
- package/test/utils/format-date.test.ts +0 -89
- package/test/utils/format-unit-size.test.ts +0 -21
- package/test/utils/local-date-from-utc.test.ts +0 -37
- package/tsconfig.json +0 -25
- package/types/dompurify.d.ts +0 -1
- package/vite.config.ts +0 -29
- package/web-dev-server.config.mjs +0 -30
- package/web-test-runner.config.mjs +0 -52
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import type { SortParam } from '@internetarchive/search-service';
|
|
2
|
-
import {
|
|
3
|
-
css,
|
|
4
|
-
CSSResultGroup,
|
|
5
|
-
html,
|
|
6
|
-
LitElement,
|
|
7
|
-
nothing,
|
|
8
|
-
TemplateResult,
|
|
9
|
-
} from 'lit';
|
|
10
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
11
|
-
import '@a11y/focus-trap';
|
|
12
|
-
|
|
13
|
-
import { suppressedCollections, type TileModel } from '../../models';
|
|
14
|
-
import type { CollectionTitles } from '../../data-source/models';
|
|
15
|
-
import '../list/tile-list';
|
|
16
|
-
|
|
17
|
-
@customElement('tile-hover-pane')
|
|
18
|
-
export class TileHoverPane extends LitElement {
|
|
19
|
-
@property({ type: Object }) model?: TileModel;
|
|
20
|
-
|
|
21
|
-
@property({ type: String }) baseNavigationUrl?: string;
|
|
22
|
-
|
|
23
|
-
@property({ type: String }) baseImageUrl?: string;
|
|
24
|
-
|
|
25
|
-
@property({ type: Boolean }) loggedIn: boolean = false;
|
|
26
|
-
|
|
27
|
-
@property({ type: Boolean }) suppressBlurring: boolean = false;
|
|
28
|
-
|
|
29
|
-
@property({ type: Object }) sortParam?: SortParam;
|
|
30
|
-
|
|
31
|
-
@property({ type: Number }) mobileBreakpoint?: number;
|
|
32
|
-
|
|
33
|
-
@property({ type: Number }) currentWidth?: number;
|
|
34
|
-
|
|
35
|
-
@property({ type: Object })
|
|
36
|
-
collectionTitles?: CollectionTitles;
|
|
37
|
-
|
|
38
|
-
protected render(): TemplateResult {
|
|
39
|
-
return html`
|
|
40
|
-
<div id="container">
|
|
41
|
-
<focus-trap>
|
|
42
|
-
${this.headerTemplate}
|
|
43
|
-
<div id="hover-tile-list">
|
|
44
|
-
<tile-list
|
|
45
|
-
.model=${this.model}
|
|
46
|
-
.baseNavigationUrl=${this.baseNavigationUrl}
|
|
47
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
48
|
-
.loggedIn=${this.loggedIn}
|
|
49
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
50
|
-
.sortParam=${this.sortParam}
|
|
51
|
-
.collectionTitles=${this.collectionTitles}
|
|
52
|
-
.mobileBreakpoint=${this.mobileBreakpoint}
|
|
53
|
-
.currentWidth=${this.currentWidth}
|
|
54
|
-
></tile-list>
|
|
55
|
-
</div>
|
|
56
|
-
</focus-trap>
|
|
57
|
-
</div>
|
|
58
|
-
`;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
private get headerTemplate(): TemplateResult | typeof nothing {
|
|
62
|
-
// early return if item does't have parent collection
|
|
63
|
-
if (this.model?.collections?.length === 0) return nothing;
|
|
64
|
-
|
|
65
|
-
let collectionTitle = '';
|
|
66
|
-
let collectionIdentifier = '';
|
|
67
|
-
|
|
68
|
-
for (const collection of this.model?.collections || []) {
|
|
69
|
-
if (
|
|
70
|
-
!suppressedCollections[collection] &&
|
|
71
|
-
!collection.startsWith('fav-')
|
|
72
|
-
) {
|
|
73
|
-
collectionTitle = this.collectionTitles?.get(collection) ?? collection;
|
|
74
|
-
collectionIdentifier = collection;
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// sometimes item does have collections but they are in suppressed or favorite list,
|
|
80
|
-
// let's not render that
|
|
81
|
-
if (!collectionIdentifier) return nothing;
|
|
82
|
-
|
|
83
|
-
return html`
|
|
84
|
-
<div id="list-line-header">
|
|
85
|
-
<a href="${this.baseNavigationUrl}/details/${collectionIdentifier}">
|
|
86
|
-
<img
|
|
87
|
-
src="${this.baseImageUrl}/services/img/${collectionIdentifier}"
|
|
88
|
-
alt=""
|
|
89
|
-
/><span>${collectionTitle}</span>
|
|
90
|
-
</a>
|
|
91
|
-
</div>
|
|
92
|
-
`;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
static get styles(): CSSResultGroup {
|
|
96
|
-
const hoverPaneHeaderBGColor = css`var(--hoverPaneHeaderBGColor, #edf0ff)`;
|
|
97
|
-
const iaLinkColor = css`var(--ia-theme-link-color, #4b64ff)`;
|
|
98
|
-
const iaFontFamily = css`var(--ia-theme-base-font-family, "Helvetica Neue", Helvetica, Arial, sans-serif);`;
|
|
99
|
-
|
|
100
|
-
return css`
|
|
101
|
-
:host {
|
|
102
|
-
margin: 0;
|
|
103
|
-
border: 0;
|
|
104
|
-
padding: 0;
|
|
105
|
-
overflow: visible;
|
|
106
|
-
color: inherit;
|
|
107
|
-
background: none;
|
|
108
|
-
visibility: hidden;
|
|
109
|
-
opacity: 0;
|
|
110
|
-
transform: translateY(8px);
|
|
111
|
-
transition:
|
|
112
|
-
opacity 0.1s ease-in,
|
|
113
|
-
transform 0.1s ease-in;
|
|
114
|
-
--image-width: auto;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
:host(.visible) {
|
|
118
|
-
visibility: visible;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
:host(.fade-in) {
|
|
122
|
-
opacity: 1;
|
|
123
|
-
transform: translateY(0);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
@media (prefers-reduced-motion: reduce) {
|
|
127
|
-
:host {
|
|
128
|
-
transition-duration: 0.001s !important; /* Imperceptibly fast */
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
#container {
|
|
133
|
-
width: max-content;
|
|
134
|
-
max-width: min(45vw, 600px);
|
|
135
|
-
border: 1px solid #ddd;
|
|
136
|
-
border-radius: 4px;
|
|
137
|
-
box-shadow: 4px 4px 8px 0 rgba(0, 0, 0, 0.8);
|
|
138
|
-
background: white;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
@media screen and (max-width: 600px) {
|
|
142
|
-
#container {
|
|
143
|
-
max-width: 80vw;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/* main tile-list container */
|
|
148
|
-
#hover-tile-list {
|
|
149
|
-
padding: 10px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/* header on hover panel to show collection icon and title */
|
|
153
|
-
#list-line-header {
|
|
154
|
-
background: ${hoverPaneHeaderBGColor};
|
|
155
|
-
}
|
|
156
|
-
#list-line-header a {
|
|
157
|
-
display: flex;
|
|
158
|
-
align-items: center;
|
|
159
|
-
column-gap: 5px;
|
|
160
|
-
height: 3.4rem;
|
|
161
|
-
padding: 0 10px;
|
|
162
|
-
border-radius: 4px 4px 0 0;
|
|
163
|
-
width: fit-content;
|
|
164
|
-
font-size: 1.4rem;
|
|
165
|
-
color: ${iaLinkColor};
|
|
166
|
-
font-family: ${iaFontFamily};
|
|
167
|
-
text-decoration: none;
|
|
168
|
-
width: auto;
|
|
169
|
-
}
|
|
170
|
-
#list-line-header a span {
|
|
171
|
-
white-space: nowrap;
|
|
172
|
-
overflow: hidden;
|
|
173
|
-
text-overflow: ellipsis;
|
|
174
|
-
}
|
|
175
|
-
#list-line-header a:hover {
|
|
176
|
-
text-decoration: underline;
|
|
177
|
-
}
|
|
178
|
-
#list-line-header a img {
|
|
179
|
-
width: 30px;
|
|
180
|
-
max-height: 30px;
|
|
181
|
-
}
|
|
182
|
-
`;
|
|
183
|
-
}
|
|
184
|
-
}
|
package/src/tiles/image-block.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { css, CSSResultGroup, html, LitElement, nothing } from 'lit';
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
-
import { ClassInfo, classMap } from 'lit/directives/class-map.js';
|
|
4
|
-
|
|
5
|
-
import type { TileModel, TileOverlayType } from '../models';
|
|
6
|
-
|
|
7
|
-
import './overlay/icon-overlay';
|
|
8
|
-
import './overlay/text-overlay';
|
|
9
|
-
|
|
10
|
-
@customElement('image-block')
|
|
11
|
-
export class ImageBlock extends LitElement {
|
|
12
|
-
@property({ type: String }) baseImageUrl?: string;
|
|
13
|
-
|
|
14
|
-
@property({ type: Boolean }) isCompactTile = false;
|
|
15
|
-
|
|
16
|
-
@property({ type: Boolean }) isListTile = false;
|
|
17
|
-
|
|
18
|
-
@property({ type: Boolean }) loggedIn = false;
|
|
19
|
-
|
|
20
|
-
@property({ type: Boolean }) suppressBlurring = false;
|
|
21
|
-
|
|
22
|
-
@property({ type: Object }) model?: TileModel;
|
|
23
|
-
|
|
24
|
-
@property({ type: String }) viewSize: string = 'desktop';
|
|
25
|
-
|
|
26
|
-
render() {
|
|
27
|
-
if (!this.model?.identifier) return nothing;
|
|
28
|
-
|
|
29
|
-
return html`
|
|
30
|
-
<div class=${classMap(this.baseClass)}>
|
|
31
|
-
<item-image
|
|
32
|
-
.model=${this.model}
|
|
33
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
34
|
-
.isListTile=${this.isListTile}
|
|
35
|
-
.isCompactTile=${this.isCompactTile}
|
|
36
|
-
.loggedIn=${this.loggedIn}
|
|
37
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
38
|
-
style="--imgHeight: 100%; --imgWidth: 100%"
|
|
39
|
-
>
|
|
40
|
-
</item-image>
|
|
41
|
-
${this.textOverlayTemplate} ${this.iconOverlayTemplate}
|
|
42
|
-
</div>
|
|
43
|
-
`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
private get baseClass(): ClassInfo {
|
|
47
|
-
return {
|
|
48
|
-
container: true,
|
|
49
|
-
list: this.isListTile && !this.isCompactTile,
|
|
50
|
-
'list-compact': this.isListTile && this.isCompactTile,
|
|
51
|
-
collection: this.model?.mediatype === 'collection', // fill the image in container
|
|
52
|
-
[this.viewSize]: true,
|
|
53
|
-
'search-image': this.model?.mediatype === 'search',
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
private get iconOverlayTemplate() {
|
|
58
|
-
// Only list tiles use the icon overlay
|
|
59
|
-
if (!this.isListTile) return nothing;
|
|
60
|
-
|
|
61
|
-
const { overlayType } = this;
|
|
62
|
-
if (!overlayType) return nothing;
|
|
63
|
-
|
|
64
|
-
return html`
|
|
65
|
-
<icon-overlay
|
|
66
|
-
class=${this.isCompactTile ? 'list-compact' : 'list-detail'}
|
|
67
|
-
.type=${this.overlayType}
|
|
68
|
-
>
|
|
69
|
-
</icon-overlay>
|
|
70
|
-
`;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
private get textOverlayTemplate() {
|
|
74
|
-
// List tiles do not require the text overlay
|
|
75
|
-
if (this.isListTile) return nothing;
|
|
76
|
-
|
|
77
|
-
const { overlayType } = this;
|
|
78
|
-
if (!overlayType) return nothing;
|
|
79
|
-
|
|
80
|
-
return html` <text-overlay .type=${this.overlayType}></text-overlay> `;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private get overlayType(): TileOverlayType | undefined {
|
|
84
|
-
if (this.suppressBlurring) return undefined;
|
|
85
|
-
|
|
86
|
-
// Prioritize showing the login-required overlay if needed.
|
|
87
|
-
// Otherwise, if a content warning is required, show that overlay instead.
|
|
88
|
-
// If neither flag is present, no overlay should be shown.
|
|
89
|
-
if (this.model?.loginRequired && !this.loggedIn) {
|
|
90
|
-
return 'login-required';
|
|
91
|
-
}
|
|
92
|
-
if (this.model?.contentWarning) {
|
|
93
|
-
return 'content-warning';
|
|
94
|
-
}
|
|
95
|
-
return undefined;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
static get styles(): CSSResultGroup {
|
|
99
|
-
const imageBlockBackgroundColor = css`var(--imageBlockBackgroundColor, #f1f1f4)`;
|
|
100
|
-
|
|
101
|
-
return css`
|
|
102
|
-
div {
|
|
103
|
-
display: flex;
|
|
104
|
-
justify-content: center;
|
|
105
|
-
position: relative;
|
|
106
|
-
background-color: ${imageBlockBackgroundColor};
|
|
107
|
-
border-radius: 4px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.grid {
|
|
111
|
-
height: var(--imgBlockHeight, 16rem);
|
|
112
|
-
flex: 1;
|
|
113
|
-
position: initial;
|
|
114
|
-
padding: 5px;
|
|
115
|
-
border-radius: 4px 4px 0 0;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.collection.grid,
|
|
119
|
-
.grid.search-image {
|
|
120
|
-
display: block;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** tile-list view */
|
|
124
|
-
.list {
|
|
125
|
-
border-radius: 0;
|
|
126
|
-
background-color: var(--imageBlockListBackgroundColor, #ebebee);
|
|
127
|
-
box-shadow: 1px 1px 2px rgb(0, 0, 0, 0.2);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.list.desktop {
|
|
131
|
-
width: 100px;
|
|
132
|
-
max-width: 100%;
|
|
133
|
-
height: 100px;
|
|
134
|
-
max-width: 100%;
|
|
135
|
-
display: inline-block;
|
|
136
|
-
position: relative;
|
|
137
|
-
text-align: center;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.list.mobile {
|
|
141
|
-
width: var(--image-width, 90px);
|
|
142
|
-
height: 90px;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/** tile-list-compact view */
|
|
146
|
-
.container.list-compact {
|
|
147
|
-
display: block;
|
|
148
|
-
text-align: center;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.list-compact.desktop {
|
|
152
|
-
width: 45px;
|
|
153
|
-
height: 45px;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.list-compact.mobile {
|
|
157
|
-
width: 30px;
|
|
158
|
-
height: 30px;
|
|
159
|
-
}
|
|
160
|
-
`;
|
|
161
|
-
}
|
|
162
|
-
}
|
package/src/tiles/item-image.ts
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
css,
|
|
3
|
-
CSSResultGroup,
|
|
4
|
-
html,
|
|
5
|
-
LitElement,
|
|
6
|
-
nothing,
|
|
7
|
-
PropertyValues,
|
|
8
|
-
} from 'lit';
|
|
9
|
-
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
10
|
-
import { ClassInfo, classMap } from 'lit/directives/class-map.js';
|
|
11
|
-
|
|
12
|
-
import type { TileModel } from '../models';
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
baseItemImageStyles,
|
|
16
|
-
waveformGradientStyles,
|
|
17
|
-
} from '../styles/item-image-styles';
|
|
18
|
-
import { searchIcon } from '../assets/img/icons/mediatype/search';
|
|
19
|
-
|
|
20
|
-
@customElement('item-image')
|
|
21
|
-
export class ItemImage extends LitElement {
|
|
22
|
-
/**
|
|
23
|
-
* Map to cache which identifiers have waveform-style thumbnails, so that
|
|
24
|
-
* they can have their waveform styling applied immediately, rather than
|
|
25
|
-
* waiting for the image content to load before applying it (which can
|
|
26
|
-
* cause noticeable flicker when such tiles refresh).
|
|
27
|
-
*/
|
|
28
|
-
private static readonly waveformByIdentifier = new Map<string, boolean>();
|
|
29
|
-
|
|
30
|
-
@property({ type: Object }) model?: TileModel;
|
|
31
|
-
|
|
32
|
-
@property({ type: String }) baseImageUrl?: string;
|
|
33
|
-
|
|
34
|
-
@property({ type: Boolean }) isListTile = false;
|
|
35
|
-
|
|
36
|
-
@property({ type: Boolean }) isCompactTile = false;
|
|
37
|
-
|
|
38
|
-
@property({ type: Boolean }) loggedIn = false;
|
|
39
|
-
|
|
40
|
-
@property({ type: Boolean }) suppressBlurring = false;
|
|
41
|
-
|
|
42
|
-
@state() private isWaveform = false;
|
|
43
|
-
|
|
44
|
-
@state() private isNotFound = false;
|
|
45
|
-
|
|
46
|
-
@query('img') private baseImage!: HTMLImageElement;
|
|
47
|
-
|
|
48
|
-
protected willUpdate(changed: PropertyValues): void {
|
|
49
|
-
if (changed.has('model')) {
|
|
50
|
-
// If this identifier is known to have a waveform image, then set isWaveform upfront
|
|
51
|
-
const identifier = this.model?.identifier;
|
|
52
|
-
this.isWaveform =
|
|
53
|
-
ItemImage.waveformByIdentifier.get(identifier as string) === true;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
render() {
|
|
58
|
-
return html`
|
|
59
|
-
<div class=${classMap(this.itemBaseClass)}>${this.imageTemplate}</div>
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
private get imageTemplate() {
|
|
64
|
-
if (this.model?.mediatype === 'search') {
|
|
65
|
-
return html`${searchIcon}`;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return html`
|
|
69
|
-
<img
|
|
70
|
-
class=${classMap(this.itemImageClass)}
|
|
71
|
-
src="${this.imageSrc}"
|
|
72
|
-
alt=""
|
|
73
|
-
@load=${this.onLoad}
|
|
74
|
-
@error=${this.onError}
|
|
75
|
-
/>
|
|
76
|
-
`;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Helpers
|
|
81
|
-
*/
|
|
82
|
-
private get imageSrc() {
|
|
83
|
-
if (this.isNotFound) return this.notFoundSrc;
|
|
84
|
-
|
|
85
|
-
// Use the correct image for web capture tiles, if possible
|
|
86
|
-
if (this.model?.captureDates && this.model.identifier) {
|
|
87
|
-
try {
|
|
88
|
-
const url = new URL(this.model.identifier);
|
|
89
|
-
const domain = encodeURIComponent(url.hostname);
|
|
90
|
-
return this.baseImageUrl
|
|
91
|
-
? `https://web.archive.org/thumb/${domain}?generate=1`
|
|
92
|
-
: nothing;
|
|
93
|
-
} catch {
|
|
94
|
-
return this.notFoundSrc;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Use the thumbnail URL specified in the model if it exists
|
|
99
|
-
if (this.model?.thumbnailUrl) return this.model.thumbnailUrl;
|
|
100
|
-
|
|
101
|
-
// Don't try to load invalid image URLs
|
|
102
|
-
return this.baseImageUrl && this.model?.identifier
|
|
103
|
-
? `${this.baseImageUrl}/services/img/${this.model.identifier}`
|
|
104
|
-
: nothing;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
private get notFoundSrc() {
|
|
108
|
-
return this.baseImageUrl
|
|
109
|
-
? `${this.baseImageUrl}/images/notfound.png`
|
|
110
|
-
: nothing;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
private get hashBasedGradient() {
|
|
114
|
-
if (!this.model?.identifier) {
|
|
115
|
-
return 'waveform-grad0';
|
|
116
|
-
}
|
|
117
|
-
const gradient = this.hashStrToInt(this.model.identifier) % 6; // returns 0-5
|
|
118
|
-
return `waveform-grad${gradient}`;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
private hashStrToInt(str: string): number {
|
|
122
|
-
return str
|
|
123
|
-
.split('')
|
|
124
|
-
.reduce((acc: number, char: string) => acc + char.charCodeAt(0), 0);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Classes
|
|
129
|
-
*/
|
|
130
|
-
private get itemBaseClass(): ClassInfo {
|
|
131
|
-
return {
|
|
132
|
-
'drop-shadow': true,
|
|
133
|
-
'list-box': this.isListTile,
|
|
134
|
-
'search-image': this.model?.mediatype === 'search',
|
|
135
|
-
[this.hashBasedGradient]: this.isWaveform,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
private get itemImageClass(): ClassInfo {
|
|
140
|
-
const hasSensitiveContent = !!(
|
|
141
|
-
this.model?.contentWarning || this.model?.loginRequired
|
|
142
|
-
);
|
|
143
|
-
const shouldBlur = hasSensitiveContent && !this.suppressBlurring;
|
|
144
|
-
|
|
145
|
-
return {
|
|
146
|
-
contain: !this.isCompactTile && !this.isWaveform,
|
|
147
|
-
cover: this.isCompactTile,
|
|
148
|
-
blur: shouldBlur,
|
|
149
|
-
waveform: this.isWaveform,
|
|
150
|
-
'account-image': this.isAccountImage, // for account tile image
|
|
151
|
-
'collection-image': this.model?.mediatype === 'collection', // for collection tile image
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Helper function to determine if account tile image
|
|
157
|
-
*/
|
|
158
|
-
private get isAccountImage() {
|
|
159
|
-
return (
|
|
160
|
-
this.model?.mediatype === 'account' &&
|
|
161
|
-
!this.isCompactTile &&
|
|
162
|
-
!this.isListTile
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Event listener sets isWaveform true if image is waveform
|
|
168
|
-
*/
|
|
169
|
-
private onLoad() {
|
|
170
|
-
if (
|
|
171
|
-
(this.model?.mediatype === 'audio' ||
|
|
172
|
-
this.model?.mediatype === 'etree') &&
|
|
173
|
-
this.baseImage.naturalWidth / this.baseImage.naturalHeight === 4
|
|
174
|
-
) {
|
|
175
|
-
this.isWaveform = true;
|
|
176
|
-
if (this.model?.identifier) {
|
|
177
|
-
ItemImage.waveformByIdentifier.set(this.model.identifier, true);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
private onError() {
|
|
183
|
-
this.isNotFound = true;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* CSS
|
|
188
|
-
*/
|
|
189
|
-
static get styles(): CSSResultGroup {
|
|
190
|
-
return [
|
|
191
|
-
baseItemImageStyles,
|
|
192
|
-
waveformGradientStyles,
|
|
193
|
-
css`
|
|
194
|
-
img {
|
|
195
|
-
height: var(--imgHeight, 16rem);
|
|
196
|
-
width: var(--imgWidth, 16rem);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.search-image {
|
|
200
|
-
display: flex;
|
|
201
|
-
align-items: center;
|
|
202
|
-
justify-content: center;
|
|
203
|
-
background: rgb(245, 245, 247);
|
|
204
|
-
border-radius: 4px;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
svg {
|
|
208
|
-
height: 10rem;
|
|
209
|
-
width: 10rem;
|
|
210
|
-
}
|
|
211
|
-
`,
|
|
212
|
-
];
|
|
213
|
-
}
|
|
214
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { css, html, nothing } from 'lit';
|
|
2
|
-
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
-
import { msg } from '@lit/localize';
|
|
5
|
-
import { BaseTileComponent } from '../base-tile-component';
|
|
6
|
-
|
|
7
|
-
@customElement('tile-list-compact-header')
|
|
8
|
-
export class TileListCompactHeader extends BaseTileComponent {
|
|
9
|
-
/*
|
|
10
|
-
* Reactive properties inherited from BaseTileComponent:
|
|
11
|
-
* - model?: TileModel;
|
|
12
|
-
* - tileActions: TileAction[] = [];
|
|
13
|
-
* - currentWidth?: number;
|
|
14
|
-
* - currentHeight?: number;
|
|
15
|
-
* - baseNavigationUrl?: string;
|
|
16
|
-
* - baseImageUrl?: string;
|
|
17
|
-
* - collectionPagePath?: string;
|
|
18
|
-
* - sortParam: SortParam | null = null;
|
|
19
|
-
* - creatorFilter?: string;
|
|
20
|
-
* - mobileBreakpoint?: number;
|
|
21
|
-
* - loggedIn = false;
|
|
22
|
-
* - suppressBlurring = false;
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
render() {
|
|
26
|
-
const hasActions = this.tileActions.length > 0;
|
|
27
|
-
const headerClasses = classMap({
|
|
28
|
-
mobile: this.classSize === 'mobile',
|
|
29
|
-
desktop: this.classSize === 'desktop',
|
|
30
|
-
'has-actions': hasActions,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
return html`
|
|
34
|
-
<div id="list-line-header" class=${headerClasses}>
|
|
35
|
-
<div id="thumb"></div>
|
|
36
|
-
${hasActions ? html`<div id="actions-header"></div>` : nothing}
|
|
37
|
-
<div id="title">${msg('Title')}</div>
|
|
38
|
-
<div id="creator">${msg('Creator')}</div>
|
|
39
|
-
<div id="date">
|
|
40
|
-
${this.displayValueProvider.dateLabel || msg('Published')}
|
|
41
|
-
</div>
|
|
42
|
-
<div id="icon">${msg('Type')}</div>
|
|
43
|
-
<div id="views">${this.displayValueProvider.viewsLabel}</div>
|
|
44
|
-
</div>
|
|
45
|
-
`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
private get classSize(): string {
|
|
49
|
-
if (
|
|
50
|
-
this.mobileBreakpoint &&
|
|
51
|
-
this.currentWidth &&
|
|
52
|
-
this.currentWidth < this.mobileBreakpoint
|
|
53
|
-
) {
|
|
54
|
-
return 'mobile';
|
|
55
|
-
}
|
|
56
|
-
return 'desktop';
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
static get styles() {
|
|
60
|
-
return css`
|
|
61
|
-
html {
|
|
62
|
-
font-size: unset;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
div {
|
|
66
|
-
font-size: 14px;
|
|
67
|
-
font-weight: bold;
|
|
68
|
-
line-height: 20px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.mobile #views {
|
|
72
|
-
display: none;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
#views {
|
|
76
|
-
text-align: right;
|
|
77
|
-
padding-right: 8px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
#list-line-header {
|
|
81
|
-
display: grid;
|
|
82
|
-
column-gap: 10px;
|
|
83
|
-
align-items: flex-end;
|
|
84
|
-
padding-bottom: 2px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
#list-line-header.mobile {
|
|
88
|
-
grid-template-columns: 36px 3fr 2fr 68px 35px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
#list-line-header.desktop {
|
|
92
|
-
grid-template-columns: 51px 3fr 2fr 95px 30px 115px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/*
|
|
96
|
-
* When tile actions are present in the rows below, reserve a matching
|
|
97
|
-
* column here so the columns stay aligned with each row.
|
|
98
|
-
*/
|
|
99
|
-
#list-line-header.mobile.has-actions {
|
|
100
|
-
grid-template-columns:
|
|
101
|
-
36px var(--tileActionColumnWidth, 90px) 3fr 2fr
|
|
102
|
-
68px 35px;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
#list-line-header.desktop.has-actions {
|
|
106
|
-
grid-template-columns:
|
|
107
|
-
51px var(--tileActionColumnWidth, 100px) 3fr 2fr
|
|
108
|
-
95px 30px 115px;
|
|
109
|
-
}
|
|
110
|
-
`;
|
|
111
|
-
}
|
|
112
|
-
}
|