@internetarchive/collection-browser 3.3.1-alpha3 → 3.3.2
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/package.json +1 -1
- package/dist/index.d.ts +0 -16
- package/dist/index.js.map +0 -1
- package/dist/src/app-root.d.ts +0 -105
- package/dist/src/app-root.js +0 -1076
- package/dist/src/app-root.js.map +0 -1
- package/dist/src/assets/img/icons/arrow-left.d.ts +0 -2
- package/dist/src/assets/img/icons/arrow-left.js +0 -10
- package/dist/src/assets/img/icons/arrow-left.js.map +0 -1
- package/dist/src/assets/img/icons/arrow-right.d.ts +0 -2
- package/dist/src/assets/img/icons/arrow-right.js +0 -10
- package/dist/src/assets/img/icons/arrow-right.js.map +0 -1
- package/dist/src/assets/img/icons/chevron.d.ts +0 -2
- package/dist/src/assets/img/icons/chevron.js +0 -4
- package/dist/src/assets/img/icons/chevron.js.map +0 -1
- package/dist/src/assets/img/icons/close-circle-dark.d.ts +0 -2
- package/dist/src/assets/img/icons/close-circle-dark.js +0 -5
- package/dist/src/assets/img/icons/close-circle-dark.js.map +0 -1
- package/dist/src/assets/img/icons/contract.d.ts +0 -2
- package/dist/src/assets/img/icons/contract.js +0 -9
- package/dist/src/assets/img/icons/contract.js.map +0 -1
- package/dist/src/assets/img/icons/empty-query.d.ts +0 -2
- package/dist/src/assets/img/icons/empty-query.js +0 -5
- package/dist/src/assets/img/icons/empty-query.js.map +0 -1
- package/dist/src/assets/img/icons/expand.d.ts +0 -2
- package/dist/src/assets/img/icons/expand.js +0 -9
- package/dist/src/assets/img/icons/expand.js.map +0 -1
- package/dist/src/assets/img/icons/eye-closed.d.ts +0 -2
- package/dist/src/assets/img/icons/eye-closed.js +0 -5
- package/dist/src/assets/img/icons/eye-closed.js.map +0 -1
- package/dist/src/assets/img/icons/eye.d.ts +0 -2
- package/dist/src/assets/img/icons/eye.js +0 -5
- package/dist/src/assets/img/icons/eye.js.map +0 -1
- package/dist/src/assets/img/icons/favorite-filled.d.ts +0 -1
- package/dist/src/assets/img/icons/favorite-filled.js +0 -10
- package/dist/src/assets/img/icons/favorite-filled.js.map +0 -1
- package/dist/src/assets/img/icons/favorite-unfilled.d.ts +0 -1
- package/dist/src/assets/img/icons/favorite-unfilled.js +0 -9
- package/dist/src/assets/img/icons/favorite-unfilled.js.map +0 -1
- package/dist/src/assets/img/icons/filter.d.ts +0 -2
- package/dist/src/assets/img/icons/filter.js +0 -10
- package/dist/src/assets/img/icons/filter.js.map +0 -1
- package/dist/src/assets/img/icons/login-required.d.ts +0 -1
- package/dist/src/assets/img/icons/login-required.js +0 -18
- package/dist/src/assets/img/icons/login-required.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/account.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/account.js +0 -14
- package/dist/src/assets/img/icons/mediatype/account.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/audio.js +0 -14
- package/dist/src/assets/img/icons/mediatype/audio.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/collection.js +0 -12
- package/dist/src/assets/img/icons/mediatype/collection.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/data.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/data.js +0 -15
- package/dist/src/assets/img/icons/mediatype/data.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/etree.js +0 -14
- package/dist/src/assets/img/icons/mediatype/etree.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/film.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/film.js +0 -14
- package/dist/src/assets/img/icons/mediatype/film.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/images.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/images.js +0 -13
- package/dist/src/assets/img/icons/mediatype/images.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/radio.js +0 -15
- package/dist/src/assets/img/icons/mediatype/radio.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/search.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/search.js +0 -14
- package/dist/src/assets/img/icons/mediatype/search.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/software.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/software.js +0 -13
- package/dist/src/assets/img/icons/mediatype/software.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/texts.js +0 -13
- package/dist/src/assets/img/icons/mediatype/texts.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-commercial.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-commercial.js +0 -12
- package/dist/src/assets/img/icons/mediatype/tv-commercial.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-fact-check.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-fact-check.js +0 -12
- package/dist/src/assets/img/icons/mediatype/tv-fact-check.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-quote.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-quote.js +0 -12
- package/dist/src/assets/img/icons/mediatype/tv-quote.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/tv.js +0 -14
- package/dist/src/assets/img/icons/mediatype/tv.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/video.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/video.js +0 -14
- package/dist/src/assets/img/icons/mediatype/video.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/web.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/web.js +0 -13
- package/dist/src/assets/img/icons/mediatype/web.js.map +0 -1
- package/dist/src/assets/img/icons/null-result.d.ts +0 -2
- package/dist/src/assets/img/icons/null-result.js +0 -5
- package/dist/src/assets/img/icons/null-result.js.map +0 -1
- package/dist/src/assets/img/icons/quote.d.ts +0 -1
- package/dist/src/assets/img/icons/quote.js +0 -7
- package/dist/src/assets/img/icons/quote.js.map +0 -1
- package/dist/src/assets/img/icons/restricted.d.ts +0 -1
- package/dist/src/assets/img/icons/restricted.js +0 -13
- package/dist/src/assets/img/icons/restricted.js.map +0 -1
- package/dist/src/assets/img/icons/reviews.d.ts +0 -1
- package/dist/src/assets/img/icons/reviews.js +0 -11
- package/dist/src/assets/img/icons/reviews.js.map +0 -1
- package/dist/src/assets/img/icons/upload.d.ts +0 -1
- package/dist/src/assets/img/icons/upload.js +0 -12
- package/dist/src/assets/img/icons/upload.js.map +0 -1
- package/dist/src/assets/img/icons/views.d.ts +0 -1
- package/dist/src/assets/img/icons/views.js +0 -11
- package/dist/src/assets/img/icons/views.js.map +0 -1
- package/dist/src/circular-activity-indicator.d.ts +0 -5
- package/dist/src/circular-activity-indicator.js +0 -66
- package/dist/src/circular-activity-indicator.js.map +0 -1
- package/dist/src/collection-browser.d.ts +0 -684
- package/dist/src/collection-browser.js +0 -2567
- package/dist/src/collection-browser.js.map +0 -1
- package/dist/src/collection-facets/facet-row.d.ts +0 -30
- package/dist/src/collection-facets/facet-row.js +0 -265
- package/dist/src/collection-facets/facet-row.js.map +0 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +0 -5
- package/dist/src/collection-facets/facet-tombstone-row.js +0 -43
- package/dist/src/collection-facets/facet-tombstone-row.js.map +0 -1
- package/dist/src/collection-facets/facets-template.d.ts +0 -13
- package/dist/src/collection-facets/facets-template.js +0 -68
- package/dist/src/collection-facets/facets-template.js.map +0 -1
- package/dist/src/collection-facets/models.d.ts +0 -9
- package/dist/src/collection-facets/models.js +0 -10
- package/dist/src/collection-facets/models.js.map +0 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +0 -109
- package/dist/src/collection-facets/more-facets-content.js +0 -547
- package/dist/src/collection-facets/more-facets-content.js.map +0 -1
- package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -36
- package/dist/src/collection-facets/more-facets-pagination.js +0 -264
- package/dist/src/collection-facets/more-facets-pagination.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/dedupe.d.ts +0 -10
- package/dist/src/collection-facets/smart-facets/dedupe.js +0 -35
- package/dist/src/collection-facets/smart-facets/dedupe.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.d.ts +0 -5
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js +0 -24
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/index.d.ts +0 -3
- package/dist/src/collection-facets/smart-facets/heuristics/index.js +0 -4
- package/dist/src/collection-facets/smart-facets/heuristics/index.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.d.ts +0 -4
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js +0 -14
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.d.ts +0 -6
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js +0 -68
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.d.ts +0 -9
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js +0 -69
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.d.ts +0 -21
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +0 -76
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/models.d.ts +0 -30
- package/dist/src/collection-facets/smart-facets/models.js +0 -2
- package/dist/src/collection-facets/smart-facets/models.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.d.ts +0 -54
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +0 -383
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-button.d.ts +0 -11
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js +0 -133
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.d.ts +0 -28
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +0 -172
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.d.ts +0 -2
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.js +0 -13
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.d.ts +0 -5
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js +0 -18
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +0 -1
- package/dist/src/collection-facets/toggle-switch.d.ts +0 -41
- package/dist/src/collection-facets/toggle-switch.js +0 -174
- package/dist/src/collection-facets/toggle-switch.js.map +0 -1
- package/dist/src/collection-facets.d.ts +0 -113
- package/dist/src/collection-facets.js +0 -873
- package/dist/src/collection-facets.js.map +0 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +0 -261
- package/dist/src/data-source/collection-browser-data-source-interface.js +0 -2
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +0 -1
- package/dist/src/data-source/collection-browser-data-source.d.ts +0 -400
- package/dist/src/data-source/collection-browser-data-source.js +0 -1103
- package/dist/src/data-source/collection-browser-data-source.js.map +0 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +0 -49
- package/dist/src/data-source/collection-browser-query-state.js +0 -2
- package/dist/src/data-source/collection-browser-query-state.js.map +0 -1
- package/dist/src/data-source/models.d.ts +0 -32
- package/dist/src/data-source/models.js +0 -9
- package/dist/src/data-source/models.js.map +0 -1
- package/dist/src/empty-placeholder.d.ts +0 -23
- package/dist/src/empty-placeholder.js +0 -165
- package/dist/src/empty-placeholder.js.map +0 -1
- package/dist/src/expanded-date-picker.d.ts +0 -50
- package/dist/src/expanded-date-picker.js +0 -182
- package/dist/src/expanded-date-picker.js.map +0 -1
- package/dist/src/language-code-handler/language-code-handler.d.ts +0 -37
- package/dist/src/language-code-handler/language-code-handler.js +0 -27
- package/dist/src/language-code-handler/language-code-handler.js.map +0 -1
- package/dist/src/language-code-handler/language-code-mapping.d.ts +0 -1
- package/dist/src/language-code-handler/language-code-mapping.js +0 -563
- package/dist/src/language-code-handler/language-code-mapping.js.map +0 -1
- package/dist/src/manage/manage-bar.d.ts +0 -58
- package/dist/src/manage/manage-bar.js +0 -237
- package/dist/src/manage/manage-bar.js.map +0 -1
- package/dist/src/manage/remove-items-modal-content.d.ts +0 -9
- package/dist/src/manage/remove-items-modal-content.js +0 -104
- package/dist/src/manage/remove-items-modal-content.js.map +0 -1
- package/dist/src/mediatype/mediatype-config.d.ts +0 -11
- package/dist/src/mediatype/mediatype-config.js +0 -116
- package/dist/src/mediatype/mediatype-config.js.map +0 -1
- package/dist/src/models.d.ts +0 -302
- package/dist/src/models.js +0 -511
- package/dist/src/models.js.map +0 -1
- package/dist/src/restoration-state-handler.d.ts +0 -75
- package/dist/src/restoration-state-handler.js +0 -403
- package/dist/src/restoration-state-handler.js.map +0 -1
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +0 -6
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +0 -60
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js.map +0 -1
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +0 -21
- package/dist/src/sort-filter-bar/alpha-bar.js +0 -241
- package/dist/src/sort-filter-bar/alpha-bar.js.map +0 -1
- package/dist/src/sort-filter-bar/img/compact.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/compact.js +0 -5
- package/dist/src/sort-filter-bar/img/compact.js.map +0 -1
- package/dist/src/sort-filter-bar/img/list.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/list.js +0 -5
- package/dist/src/sort-filter-bar/img/list.js.map +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +0 -15
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js.map +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js +0 -17
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js.map +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js +0 -17
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js.map +0 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.js +0 -5
- package/dist/src/sort-filter-bar/img/sort-triangle.js.map +0 -1
- package/dist/src/sort-filter-bar/img/tile.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/tile.js +0 -5
- package/dist/src/sort-filter-bar/img/tile.js.map +0 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +0 -278
- package/dist/src/sort-filter-bar/sort-filter-bar.js +0 -1161
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +0 -1
- package/dist/src/styles/ia-button.d.ts +0 -2
- package/dist/src/styles/ia-button.js +0 -134
- package/dist/src/styles/ia-button.js.map +0 -1
- package/dist/src/styles/item-image-styles.d.ts +0 -8
- package/dist/src/styles/item-image-styles.js +0 -123
- package/dist/src/styles/item-image-styles.js.map +0 -1
- package/dist/src/styles/sr-only.d.ts +0 -1
- package/dist/src/styles/sr-only.js +0 -18
- package/dist/src/styles/sr-only.js.map +0 -1
- package/dist/src/tiles/base-tile-component.d.ts +0 -27
- package/dist/src/tiles/base-tile-component.js +0 -82
- package/dist/src/tiles/base-tile-component.js.map +0 -1
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +0 -5
- package/dist/src/tiles/collection-browser-loading-tile.js +0 -29
- package/dist/src/tiles/collection-browser-loading-tile.js.map +0 -1
- package/dist/src/tiles/grid/account-tile.d.ts +0 -18
- package/dist/src/tiles/grid/account-tile.js +0 -111
- package/dist/src/tiles/grid/account-tile.js.map +0 -1
- package/dist/src/tiles/grid/collection-tile.d.ts +0 -15
- package/dist/src/tiles/grid/collection-tile.js +0 -160
- package/dist/src/tiles/grid/collection-tile.js.map +0 -1
- package/dist/src/tiles/grid/item-tile.d.ts +0 -41
- package/dist/src/tiles/grid/item-tile.js +0 -321
- package/dist/src/tiles/grid/item-tile.js.map +0 -1
- package/dist/src/tiles/grid/search-tile.d.ts +0 -10
- package/dist/src/tiles/grid/search-tile.js +0 -95
- package/dist/src/tiles/grid/search-tile.js.map +0 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +0 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +0 -128
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +0 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +0 -58
- package/dist/src/tiles/grid/tile-stats.js +0 -204
- package/dist/src/tiles/grid/tile-stats.js.map +0 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +0 -220
- package/dist/src/tiles/hover/hover-pane-controller.js +0 -378
- package/dist/src/tiles/hover/hover-pane-controller.js.map +0 -1
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +0 -19
- package/dist/src/tiles/hover/tile-hover-pane.js +0 -182
- package/dist/src/tiles/hover/tile-hover-pane.js.map +0 -1
- package/dist/src/tiles/image-block.d.ts +0 -19
- package/dist/src/tiles/image-block.js +0 -175
- package/dist/src/tiles/image-block.js.map +0 -1
- package/dist/src/tiles/item-image.d.ts +0 -40
- package/dist/src/tiles/item-image.js +0 -191
- package/dist/src/tiles/item-image.js.map +0 -1
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +0 -6
- package/dist/src/tiles/list/tile-list-compact-header.js +0 -85
- package/dist/src/tiles/list/tile-list-compact-header.js.map +0 -1
- package/dist/src/tiles/list/tile-list-compact.d.ts +0 -19
- package/dist/src/tiles/list/tile-list-compact.js +0 -223
- package/dist/src/tiles/list/tile-list-compact.js.map +0 -1
- package/dist/src/tiles/list/tile-list.d.ts +0 -54
- package/dist/src/tiles/list/tile-list.js +0 -621
- package/dist/src/tiles/list/tile-list.js.map +0 -1
- package/dist/src/tiles/models.d.ts +0 -1
- package/dist/src/tiles/models.js +0 -2
- package/dist/src/tiles/models.js.map +0 -1
- package/dist/src/tiles/overlay/icon-overlay.d.ts +0 -8
- package/dist/src/tiles/overlay/icon-overlay.js +0 -55
- package/dist/src/tiles/overlay/icon-overlay.js.map +0 -1
- package/dist/src/tiles/overlay/text-overlay.d.ts +0 -9
- package/dist/src/tiles/overlay/text-overlay.js +0 -74
- package/dist/src/tiles/overlay/text-overlay.js.map +0 -1
- package/dist/src/tiles/review-block.d.ts +0 -12
- package/dist/src/tiles/review-block.js +0 -134
- package/dist/src/tiles/review-block.js.map +0 -1
- package/dist/src/tiles/text-snippet-block.d.ts +0 -27
- package/dist/src/tiles/text-snippet-block.js +0 -132
- package/dist/src/tiles/text-snippet-block.js.map +0 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +0 -68
- package/dist/src/tiles/tile-dispatcher.js +0 -445
- package/dist/src/tiles/tile-dispatcher.js.map +0 -1
- package/dist/src/tiles/tile-display-value-provider.d.ts +0 -47
- package/dist/src/tiles/tile-display-value-provider.js +0 -95
- package/dist/src/tiles/tile-display-value-provider.js.map +0 -1
- package/dist/src/tiles/tile-mediatype-icon.d.ts +0 -27
- package/dist/src/tiles/tile-mediatype-icon.js +0 -130
- package/dist/src/tiles/tile-mediatype-icon.js.map +0 -1
- package/dist/src/utils/analytics-events.d.ts +0 -28
- package/dist/src/utils/analytics-events.js +0 -31
- package/dist/src/utils/analytics-events.js.map +0 -1
- package/dist/src/utils/array-equals.d.ts +0 -4
- package/dist/src/utils/array-equals.js +0 -11
- package/dist/src/utils/array-equals.js.map +0 -1
- package/dist/src/utils/collapse-repeated-quotes.d.ts +0 -11
- package/dist/src/utils/collapse-repeated-quotes.js +0 -14
- package/dist/src/utils/collapse-repeated-quotes.js.map +0 -1
- package/dist/src/utils/facet-utils.d.ts +0 -83
- package/dist/src/utils/facet-utils.js +0 -152
- package/dist/src/utils/facet-utils.js.map +0 -1
- package/dist/src/utils/format-count.d.ts +0 -7
- package/dist/src/utils/format-count.js +0 -76
- package/dist/src/utils/format-count.js.map +0 -1
- package/dist/src/utils/format-date.d.ts +0 -16
- package/dist/src/utils/format-date.js +0 -33
- package/dist/src/utils/format-date.js.map +0 -1
- package/dist/src/utils/format-unit-size.d.ts +0 -2
- package/dist/src/utils/format-unit-size.js +0 -34
- package/dist/src/utils/format-unit-size.js.map +0 -1
- package/dist/src/utils/local-date-from-utc.d.ts +0 -9
- package/dist/src/utils/local-date-from-utc.js +0 -16
- package/dist/src/utils/local-date-from-utc.js.map +0 -1
- package/dist/src/utils/log.d.ts +0 -7
- package/dist/src/utils/log.js +0 -14
- package/dist/src/utils/log.js.map +0 -1
- package/dist/src/utils/resolve-mediatype.d.ts +0 -8
- package/dist/src/utils/resolve-mediatype.js +0 -24
- package/dist/src/utils/resolve-mediatype.js.map +0 -1
- package/dist/src/utils/sha1.d.ts +0 -2
- package/dist/src/utils/sha1.js +0 -9
- package/dist/src/utils/sha1.js.map +0 -1
- package/dist/test/collection-browser.test.d.ts +0 -1
- package/dist/test/collection-browser.test.js +0 -1711
- 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 -274
- 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 -101
- 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 -169
- 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 -132
- 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 -96
- 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 -745
- 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 -102
- 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 -63
- 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 -130
- 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 -30
- 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 -218
- 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 -196
- package/dist/test/item-image.test.js.map +0 -1
- package/dist/test/manage/manage-bar.test.d.ts +0 -2
- package/dist/test/manage/manage-bar.test.js +0 -106
- 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 -65
- 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 -65
- 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 -375
- 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 -48
- 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 -13
- 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 -74
- 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 -609
- 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 -42
- 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 -63
- 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 -128
- 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 -96
- 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 -427
- 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 -66
- 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 -282
- 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 -57
- package/dist/test/tiles/hover/tile-hover-pane.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 -251
- 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 -469
- 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 -153
- 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 -145
- 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
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
var TileDispatcher_1;
|
|
2
|
-
import { __decorate } from "tslib";
|
|
3
|
-
import { css, html, nothing } from 'lit';
|
|
4
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
5
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
|
-
import { msg } from '@lit/localize';
|
|
7
|
-
import './grid/collection-tile';
|
|
8
|
-
import './grid/item-tile';
|
|
9
|
-
import './grid/account-tile';
|
|
10
|
-
import './grid/search-tile';
|
|
11
|
-
import './hover/tile-hover-pane';
|
|
12
|
-
import './list/tile-list';
|
|
13
|
-
import './list/tile-list-compact';
|
|
14
|
-
import './list/tile-list-compact-header';
|
|
15
|
-
import { BaseTileComponent } from './base-tile-component';
|
|
16
|
-
import { HoverPaneController, } from './hover/hover-pane-controller';
|
|
17
|
-
let TileDispatcher = TileDispatcher_1 = class TileDispatcher extends BaseTileComponent {
|
|
18
|
-
constructor() {
|
|
19
|
-
/*
|
|
20
|
-
* Reactive properties inherited from BaseTileComponent:
|
|
21
|
-
* - model?: TileModel;
|
|
22
|
-
* - currentWidth?: number;
|
|
23
|
-
* - currentHeight?: number;
|
|
24
|
-
* - baseNavigationUrl?: string;
|
|
25
|
-
* - baseImageUrl?: string;
|
|
26
|
-
* - collectionPagePath?: string;
|
|
27
|
-
* - sortParam: SortParam | null = null;
|
|
28
|
-
* - defaultSortParam: SortParam | null = null;
|
|
29
|
-
* - creatorFilter?: string;
|
|
30
|
-
* - mobileBreakpoint?: number;
|
|
31
|
-
* - loggedIn = false;
|
|
32
|
-
* - suppressTileBlurring = false;
|
|
33
|
-
* - useLocalTime = false;
|
|
34
|
-
*/
|
|
35
|
-
super(...arguments);
|
|
36
|
-
this.isManageView = false;
|
|
37
|
-
this.showTvClips = false;
|
|
38
|
-
/** What type of simple layout to use in grid mode, if any */
|
|
39
|
-
this.simpleLayoutType = 'none';
|
|
40
|
-
/** Whether this tile should include a hover pane at all (for applicable tile modes) */
|
|
41
|
-
this.enableHoverPane = false;
|
|
42
|
-
this.manageCheckTitle = msg('Remove this item from the list');
|
|
43
|
-
}
|
|
44
|
-
render() {
|
|
45
|
-
var _a, _b;
|
|
46
|
-
const isGridMode = this.tileDisplayMode === 'grid';
|
|
47
|
-
const hoverPaneTemplate = (_b = (_a = this.hoverPaneController) === null || _a === void 0 ? void 0 : _a.getTemplate()) !== null && _b !== void 0 ? _b : nothing;
|
|
48
|
-
return html `
|
|
49
|
-
<div id="container" class=${isGridMode ? 'hoverable' : nothing}>
|
|
50
|
-
${this.tileDisplayMode === 'list-header'
|
|
51
|
-
? this.headerTemplate
|
|
52
|
-
: this.tileTemplate}
|
|
53
|
-
${this.manageCheckTemplate} ${hoverPaneTemplate}
|
|
54
|
-
</div>
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
57
|
-
firstUpdated() {
|
|
58
|
-
if (this.shouldPrepareHoverPane) {
|
|
59
|
-
this.hoverPaneController = new HoverPaneController(this, {
|
|
60
|
-
mobileBreakpoint: this.mobileBreakpoint,
|
|
61
|
-
enableLongPress: false,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
get headerTemplate() {
|
|
66
|
-
const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } = this;
|
|
67
|
-
return html `
|
|
68
|
-
<tile-list-compact-header
|
|
69
|
-
class="header"
|
|
70
|
-
.currentWidth=${currentWidth}
|
|
71
|
-
.sortParam=${sortParam !== null && sortParam !== void 0 ? sortParam : defaultSortParam}
|
|
72
|
-
.mobileBreakpoint=${mobileBreakpoint}
|
|
73
|
-
>
|
|
74
|
-
</tile-list-compact-header>
|
|
75
|
-
`;
|
|
76
|
-
}
|
|
77
|
-
get tileTemplate() {
|
|
78
|
-
return html `
|
|
79
|
-
${this.tileDisplayMode === 'list-detail'
|
|
80
|
-
? this.tile
|
|
81
|
-
: this.linkTileTemplate}
|
|
82
|
-
`;
|
|
83
|
-
}
|
|
84
|
-
get linkTileTemplate() {
|
|
85
|
-
var _a, _b, _c;
|
|
86
|
-
return html `
|
|
87
|
-
<a
|
|
88
|
-
href=${this.linkTileHref}
|
|
89
|
-
aria-label=${(_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : 'Untitled item'}
|
|
90
|
-
title=${this.shouldPrepareHoverPane
|
|
91
|
-
? nothing // Don't show title tooltips when we have the tile info popups
|
|
92
|
-
: ifDefined((_c = this.model) === null || _c === void 0 ? void 0 : _c.title)}
|
|
93
|
-
@click=${this.handleLinkClicked}
|
|
94
|
-
@contextmenu=${this.handleLinkContextMenu}
|
|
95
|
-
>
|
|
96
|
-
${this.tile}
|
|
97
|
-
</a>
|
|
98
|
-
`;
|
|
99
|
-
}
|
|
100
|
-
get linkTileHref() {
|
|
101
|
-
var _a;
|
|
102
|
-
if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.identifier) || this.baseNavigationUrl == null)
|
|
103
|
-
return nothing;
|
|
104
|
-
// Use the server-specified href if available.
|
|
105
|
-
// Otherwise, construct a details page URL from the item identifier.
|
|
106
|
-
if (this.model.href) {
|
|
107
|
-
return `${this.baseNavigationUrl}${this.model.href}`;
|
|
108
|
-
}
|
|
109
|
-
return this.displayValueProvider.itemPageUrl(this.model.identifier, this.model.mediatype === 'collection');
|
|
110
|
-
}
|
|
111
|
-
get manageCheckTemplate() {
|
|
112
|
-
var _a;
|
|
113
|
-
if (!this.isManageView || this.tileDisplayMode !== 'grid')
|
|
114
|
-
return nothing;
|
|
115
|
-
return html `
|
|
116
|
-
<div class="manage-check">
|
|
117
|
-
<input
|
|
118
|
-
type="checkbox"
|
|
119
|
-
title=${this.manageCheckTitle}
|
|
120
|
-
.checked=${(_a = this.model) === null || _a === void 0 ? void 0 : _a.checked}
|
|
121
|
-
@change=${this.handleLinkClicked}
|
|
122
|
-
/>
|
|
123
|
-
</div>
|
|
124
|
-
`;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Whether hover pane behavior should be prepared for this tile
|
|
128
|
-
* (e.g., whether mouse listeners should be attached, etc.)
|
|
129
|
-
*/
|
|
130
|
-
get shouldPrepareHoverPane() {
|
|
131
|
-
var _a, _b;
|
|
132
|
-
return (this.enableHoverPane &&
|
|
133
|
-
!!this.tileDisplayMode &&
|
|
134
|
-
TileDispatcher_1.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode] &&
|
|
135
|
-
((_a = this.model) === null || _a === void 0 ? void 0 : _a.mediatype) !== 'search' && // don't show hover panes on search tiles
|
|
136
|
-
!((_b = this.model) === null || _b === void 0 ? void 0 : _b.captureDates) // don't show hover panes on web archive tiles
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
get isHoverEnabled() {
|
|
140
|
-
return window.matchMedia('(hover: hover)').matches;
|
|
141
|
-
}
|
|
142
|
-
/** @inheritdoc */
|
|
143
|
-
getHoverPane() {
|
|
144
|
-
return this.hoverPane;
|
|
145
|
-
}
|
|
146
|
-
/** @inheritdoc */
|
|
147
|
-
getHoverPaneProps() {
|
|
148
|
-
return this;
|
|
149
|
-
}
|
|
150
|
-
handleResize(entry) {
|
|
151
|
-
this.currentWidth = entry.contentRect.width;
|
|
152
|
-
this.currentHeight = entry.contentRect.height;
|
|
153
|
-
}
|
|
154
|
-
disconnectedCallback() {
|
|
155
|
-
this.stopResizeObservation(this.resizeObserver);
|
|
156
|
-
}
|
|
157
|
-
stopResizeObservation(observer) {
|
|
158
|
-
observer === null || observer === void 0 ? void 0 : observer.removeObserver({
|
|
159
|
-
handler: this,
|
|
160
|
-
target: this.container,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
startResizeObservation() {
|
|
164
|
-
var _a;
|
|
165
|
-
this.stopResizeObservation(this.resizeObserver);
|
|
166
|
-
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.addObserver({
|
|
167
|
-
handler: this,
|
|
168
|
-
target: this.container,
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
updated(props) {
|
|
172
|
-
if (props.has('resizeObserver')) {
|
|
173
|
-
const previousObserver = props.get('resizeObserver');
|
|
174
|
-
this.stopResizeObservation(previousObserver);
|
|
175
|
-
this.startResizeObservation();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Handler for when the tile link is left-clicked. Emits the `resultSelected` event.
|
|
180
|
-
* In manage view, it also checks/unchecks the tile.
|
|
181
|
-
*/
|
|
182
|
-
handleLinkClicked(e) {
|
|
183
|
-
if (this.isManageView) {
|
|
184
|
-
e.preventDefault();
|
|
185
|
-
if (this.model)
|
|
186
|
-
this.model.checked = !this.model.checked;
|
|
187
|
-
}
|
|
188
|
-
this.dispatchEvent(new CustomEvent('resultSelected', { detail: this.model }));
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Handler for when the tile link is right-clicked.
|
|
192
|
-
* In manage view, it opens the item in a new tab. Otherwise, does nothing.
|
|
193
|
-
*/
|
|
194
|
-
handleLinkContextMenu(e) {
|
|
195
|
-
if (this.isManageView && this.linkTileHref !== nothing) {
|
|
196
|
-
e.preventDefault();
|
|
197
|
-
window.open(this.linkTileHref, '_blank');
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
tileInfoButtonPressed(e) {
|
|
201
|
-
var _a;
|
|
202
|
-
(_a = this.hoverPaneController) === null || _a === void 0 ? void 0 : _a.toggleHoverPane({
|
|
203
|
-
coords: e.detail,
|
|
204
|
-
enableTouchBackdrop: true,
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
get tile() {
|
|
208
|
-
const { model, collectionPagePath, baseNavigationUrl, currentWidth, currentHeight, sortParam, creatorFilter, mobileBreakpoint, defaultSortParam, } = this;
|
|
209
|
-
if (!model)
|
|
210
|
-
return nothing;
|
|
211
|
-
switch (this.tileDisplayMode) {
|
|
212
|
-
case 'grid':
|
|
213
|
-
switch (model.mediatype) {
|
|
214
|
-
case 'collection':
|
|
215
|
-
return html `<collection-tile
|
|
216
|
-
.model=${model}
|
|
217
|
-
.collectionPagePath=${collectionPagePath}
|
|
218
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
219
|
-
.currentWidth=${currentWidth}
|
|
220
|
-
.currentHeight=${currentHeight}
|
|
221
|
-
.creatorFilter=${creatorFilter}
|
|
222
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
223
|
-
.isManageView=${this.isManageView}
|
|
224
|
-
?showInfoButton=${!this.isHoverEnabled}
|
|
225
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
226
|
-
>
|
|
227
|
-
</collection-tile>`;
|
|
228
|
-
case 'account':
|
|
229
|
-
return html `<account-tile
|
|
230
|
-
.model=${model}
|
|
231
|
-
.collectionPagePath=${collectionPagePath}
|
|
232
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
233
|
-
.currentWidth=${currentWidth}
|
|
234
|
-
.currentHeight=${currentHeight}
|
|
235
|
-
.creatorFilter=${creatorFilter}
|
|
236
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
237
|
-
.isManageView=${this.isManageView}
|
|
238
|
-
?showInfoButton=${!this.isHoverEnabled}
|
|
239
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
240
|
-
>
|
|
241
|
-
</account-tile>`;
|
|
242
|
-
case 'search':
|
|
243
|
-
return html `<search-tile
|
|
244
|
-
.model=${model}
|
|
245
|
-
.collectionPagePath=${collectionPagePath}
|
|
246
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
247
|
-
.currentWidth=${currentWidth}
|
|
248
|
-
.currentHeight=${currentHeight}
|
|
249
|
-
.creatorFilter=${creatorFilter}
|
|
250
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
251
|
-
.isManageView=${this.isManageView}
|
|
252
|
-
?showInfoButton=${false}
|
|
253
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
254
|
-
>
|
|
255
|
-
</search-tile>`;
|
|
256
|
-
default:
|
|
257
|
-
return html `<item-tile
|
|
258
|
-
.model=${model}
|
|
259
|
-
.collectionPagePath=${collectionPagePath}
|
|
260
|
-
.currentWidth=${this.currentWidth}
|
|
261
|
-
.currentHeight=${this.currentHeight}
|
|
262
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
263
|
-
.sortParam=${sortParam}
|
|
264
|
-
.defaultSortParam=${defaultSortParam}
|
|
265
|
-
.creatorFilter=${creatorFilter}
|
|
266
|
-
.loggedIn=${this.loggedIn}
|
|
267
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
268
|
-
.isManageView=${this.isManageView}
|
|
269
|
-
.simpleLayoutType=${this.simpleLayoutType}
|
|
270
|
-
?showTvClips=${this.showTvClips}
|
|
271
|
-
?showInfoButton=${!this.isHoverEnabled}
|
|
272
|
-
?useLocalTime=${this.useLocalTime}
|
|
273
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
274
|
-
>
|
|
275
|
-
</item-tile>`;
|
|
276
|
-
}
|
|
277
|
-
case 'list-compact':
|
|
278
|
-
return html `<tile-list-compact
|
|
279
|
-
.model=${model}
|
|
280
|
-
.collectionPagePath=${collectionPagePath}
|
|
281
|
-
.currentWidth=${currentWidth}
|
|
282
|
-
.currentHeight=${currentHeight}
|
|
283
|
-
.baseNavigationUrl=${baseNavigationUrl}
|
|
284
|
-
.sortParam=${sortParam}
|
|
285
|
-
.defaultSortParam=${defaultSortParam}
|
|
286
|
-
.creatorFilter=${creatorFilter}
|
|
287
|
-
.mobileBreakpoint=${mobileBreakpoint}
|
|
288
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
289
|
-
.loggedIn=${this.loggedIn}
|
|
290
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
291
|
-
?useLocalTime=${this.useLocalTime}
|
|
292
|
-
>
|
|
293
|
-
</tile-list-compact>`;
|
|
294
|
-
case 'list-detail':
|
|
295
|
-
return html `<tile-list
|
|
296
|
-
.model=${model}
|
|
297
|
-
.collectionPagePath=${collectionPagePath}
|
|
298
|
-
.collectionTitles=${this.collectionTitles}
|
|
299
|
-
.currentWidth=${currentWidth}
|
|
300
|
-
.currentHeight=${currentHeight}
|
|
301
|
-
.baseNavigationUrl=${baseNavigationUrl}
|
|
302
|
-
.sortParam=${sortParam}
|
|
303
|
-
.defaultSortParam=${defaultSortParam}
|
|
304
|
-
.creatorFilter=${creatorFilter}
|
|
305
|
-
.mobileBreakpoint=${mobileBreakpoint}
|
|
306
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
307
|
-
.loggedIn=${this.loggedIn}
|
|
308
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
309
|
-
?useLocalTime=${this.useLocalTime}
|
|
310
|
-
>
|
|
311
|
-
</tile-list>`;
|
|
312
|
-
default:
|
|
313
|
-
return nothing;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
static get styles() {
|
|
317
|
-
return css `
|
|
318
|
-
:host {
|
|
319
|
-
display: block;
|
|
320
|
-
height: 100%;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
collection-tile {
|
|
324
|
-
--tileBorderColor: #555555;
|
|
325
|
-
--tileBackgroundColor: #666666;
|
|
326
|
-
--imageBlockBackgroundColor: #666666;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
account-tile {
|
|
330
|
-
--tileBorderColor: #dddddd;
|
|
331
|
-
--imageBlockBackgroundColor: #fcf5e6;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
item-tile {
|
|
335
|
-
--tileBorderColor: #dddddd;
|
|
336
|
-
--imageBlockBackgroundColor: #f1f1f4;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
search-tile {
|
|
340
|
-
--tileBorderColor: #555555;
|
|
341
|
-
--tileBackgroundColor: #666666;
|
|
342
|
-
--imageBlockBackgroundColor: #666666;
|
|
343
|
-
--iconFillColor: #2c2c2c;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
#container {
|
|
347
|
-
position: relative;
|
|
348
|
-
height: 100%;
|
|
349
|
-
border-radius: 4px;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
#container.hoverable:hover {
|
|
353
|
-
box-shadow: var(--tileHoverBoxShadow, 0 0 6px 2px rgba(8, 8, 32, 0.8));
|
|
354
|
-
transition: box-shadow 0.1s ease;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
a {
|
|
358
|
-
display: block;
|
|
359
|
-
height: 100%;
|
|
360
|
-
color: unset;
|
|
361
|
-
text-decoration: none;
|
|
362
|
-
transition: transform 0.05s ease;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
a :first-child {
|
|
366
|
-
display: block;
|
|
367
|
-
height: 100%;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.manage-check {
|
|
371
|
-
position: absolute;
|
|
372
|
-
right: 0;
|
|
373
|
-
top: 0;
|
|
374
|
-
border: 5px solid #2c2c2c;
|
|
375
|
-
border-radius: 3px;
|
|
376
|
-
background-color: #2c2c2c;
|
|
377
|
-
z-index: 1;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
.manage-check > input[type='checkbox'] {
|
|
381
|
-
display: block;
|
|
382
|
-
margin: 0;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
#touch-backdrop {
|
|
386
|
-
position: fixed;
|
|
387
|
-
width: 100vw;
|
|
388
|
-
height: 100vh;
|
|
389
|
-
top: 0;
|
|
390
|
-
left: 0;
|
|
391
|
-
z-index: 2;
|
|
392
|
-
background: transparent;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
tile-hover-pane {
|
|
396
|
-
position: absolute;
|
|
397
|
-
top: 0;
|
|
398
|
-
left: -9999px;
|
|
399
|
-
z-index: 2;
|
|
400
|
-
}
|
|
401
|
-
`;
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
/** Maps each display mode to whether hover panes should appear in that mode */
|
|
405
|
-
TileDispatcher.HOVER_PANE_DISPLAY_MODES = {
|
|
406
|
-
grid: true,
|
|
407
|
-
'list-compact': true,
|
|
408
|
-
'list-detail': false,
|
|
409
|
-
'list-header': false,
|
|
410
|
-
};
|
|
411
|
-
__decorate([
|
|
412
|
-
property({ type: String })
|
|
413
|
-
], TileDispatcher.prototype, "tileDisplayMode", void 0);
|
|
414
|
-
__decorate([
|
|
415
|
-
property({ type: Boolean })
|
|
416
|
-
], TileDispatcher.prototype, "isManageView", void 0);
|
|
417
|
-
__decorate([
|
|
418
|
-
property({ type: Object })
|
|
419
|
-
], TileDispatcher.prototype, "resizeObserver", void 0);
|
|
420
|
-
__decorate([
|
|
421
|
-
property({ type: Object })
|
|
422
|
-
], TileDispatcher.prototype, "collectionTitles", void 0);
|
|
423
|
-
__decorate([
|
|
424
|
-
property({ type: Boolean })
|
|
425
|
-
], TileDispatcher.prototype, "showTvClips", void 0);
|
|
426
|
-
__decorate([
|
|
427
|
-
property({ type: String })
|
|
428
|
-
], TileDispatcher.prototype, "simpleLayoutType", void 0);
|
|
429
|
-
__decorate([
|
|
430
|
-
property({ type: Boolean })
|
|
431
|
-
], TileDispatcher.prototype, "enableHoverPane", void 0);
|
|
432
|
-
__decorate([
|
|
433
|
-
property({ type: String })
|
|
434
|
-
], TileDispatcher.prototype, "manageCheckTitle", void 0);
|
|
435
|
-
__decorate([
|
|
436
|
-
query('#container')
|
|
437
|
-
], TileDispatcher.prototype, "container", void 0);
|
|
438
|
-
__decorate([
|
|
439
|
-
query('tile-hover-pane')
|
|
440
|
-
], TileDispatcher.prototype, "hoverPane", void 0);
|
|
441
|
-
TileDispatcher = TileDispatcher_1 = __decorate([
|
|
442
|
-
customElement('tile-dispatcher')
|
|
443
|
-
], TileDispatcher);
|
|
444
|
-
export { TileDispatcher };
|
|
445
|
-
//# sourceMappingURL=tile-dispatcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tile-dispatcher.js","sourceRoot":"","sources":["../../../src/tiles/tile-dispatcher.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAOpC,OAAO,wBAAwB,CAAC;AAChC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,yBAAyB,CAAC;AACjC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AAEzC,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R+C,CAQ9C;AAtC0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAmC;AAEjC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAAsB;AAEtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAgD;AAG3E;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDACS;AAEP;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAAqB;AAGrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAA6C;AAG3C;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uDAAyB;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAEzB;AAKM;IADP,KAAK,CAAC,YAAY,CAAC;iDACe;AAG3B;IADP,KAAK,CAAC,iBAAiB,CAAC;iDACS;AAlDvB,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CA4c1B","sourcesContent":["import { css, html, nothing, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { msg } from '@lit/localize';\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { TileDisplayMode } from '../models';\nimport type { CollectionTitles } from '../data-source/models';\nimport './grid/collection-tile';\nimport './grid/item-tile';\nimport './grid/account-tile';\nimport './grid/search-tile';\nimport './hover/tile-hover-pane';\nimport './list/tile-list';\nimport './list/tile-list-compact';\nimport './list/tile-list-compact-header';\nimport type { TileHoverPane } from './hover/tile-hover-pane';\nimport { BaseTileComponent } from './base-tile-component';\nimport { SimpleLayoutType } from './models';\nimport {\n HoverPaneController,\n HoverPaneControllerInterface,\n HoverPaneProperties,\n HoverPaneProviderInterface,\n} from './hover/hover-pane-controller';\n\n@customElement('tile-dispatcher')\nexport class TileDispatcher\n extends BaseTileComponent\n implements\n SharedResizeObserverResizeHandlerInterface,\n HoverPaneProviderInterface\n{\n /*\n * Reactive properties inherited from BaseTileComponent:\n * - model?: TileModel;\n * - currentWidth?: number;\n * - currentHeight?: number;\n * - baseNavigationUrl?: string;\n * - baseImageUrl?: string;\n * - collectionPagePath?: string;\n * - sortParam: SortParam | null = null;\n * - defaultSortParam: SortParam | null = null;\n * - creatorFilter?: string;\n * - mobileBreakpoint?: number;\n * - loggedIn = false;\n * - suppressTileBlurring = false;\n * - useLocalTime = false;\n */\n\n @property({ type: String }) tileDisplayMode?: TileDisplayMode;\n\n @property({ type: Boolean }) isManageView = false;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object })\n collectionTitles?: CollectionTitles;\n\n @property({ type: Boolean }) showTvClips = false;\n\n /** What type of simple layout to use in grid mode, if any */\n @property({ type: String }) simpleLayoutType: SimpleLayoutType = 'none';\n\n /** Whether this tile should include a hover pane at all (for applicable tile modes) */\n @property({ type: Boolean }) enableHoverPane = false;\n\n @property({ type: String }) manageCheckTitle = msg(\n 'Remove this item from the list',\n );\n\n private hoverPaneController?: HoverPaneControllerInterface;\n\n @query('#container')\n private container!: HTMLDivElement;\n\n @query('tile-hover-pane')\n private hoverPane?: TileHoverPane;\n\n /** Maps each display mode to whether hover panes should appear in that mode */\n private static readonly HOVER_PANE_DISPLAY_MODES: Record<\n TileDisplayMode,\n boolean\n > = {\n grid: true,\n 'list-compact': true,\n 'list-detail': false,\n 'list-header': false,\n };\n\n render() {\n const isGridMode = this.tileDisplayMode === 'grid';\n const hoverPaneTemplate =\n this.hoverPaneController?.getTemplate() ?? nothing;\n return html`\n <div id=\"container\" class=${isGridMode ? 'hoverable' : nothing}>\n ${this.tileDisplayMode === 'list-header'\n ? this.headerTemplate\n : this.tileTemplate}\n ${this.manageCheckTemplate} ${hoverPaneTemplate}\n </div>\n `;\n }\n\n protected firstUpdated(): void {\n if (this.shouldPrepareHoverPane) {\n this.hoverPaneController = new HoverPaneController(this, {\n mobileBreakpoint: this.mobileBreakpoint,\n enableLongPress: false,\n });\n }\n }\n\n private get headerTemplate() {\n const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } =\n this;\n return html`\n <tile-list-compact-header\n class=\"header\"\n .currentWidth=${currentWidth}\n .sortParam=${sortParam ?? defaultSortParam}\n .mobileBreakpoint=${mobileBreakpoint}\n >\n </tile-list-compact-header>\n `;\n }\n\n private get tileTemplate() {\n return html`\n ${this.tileDisplayMode === 'list-detail'\n ? this.tile\n : this.linkTileTemplate}\n `;\n }\n\n private get linkTileTemplate() {\n return html`\n <a\n href=${this.linkTileHref}\n aria-label=${this.model?.title ?? 'Untitled item'}\n title=${this.shouldPrepareHoverPane\n ? nothing // Don't show title tooltips when we have the tile info popups\n : ifDefined(this.model?.title)}\n @click=${this.handleLinkClicked}\n @contextmenu=${this.handleLinkContextMenu}\n >\n ${this.tile}\n </a>\n `;\n }\n\n private get linkTileHref(): string | typeof nothing {\n if (!this.model?.identifier || this.baseNavigationUrl == null)\n return nothing;\n\n // Use the server-specified href if available.\n // Otherwise, construct a details page URL from the item identifier.\n if (this.model.href) {\n return `${this.baseNavigationUrl}${this.model.href}`;\n }\n\n return this.displayValueProvider.itemPageUrl(\n this.model.identifier,\n this.model.mediatype === 'collection',\n );\n }\n\n private get manageCheckTemplate() {\n if (!this.isManageView || this.tileDisplayMode !== 'grid') return nothing;\n\n return html`\n <div class=\"manage-check\">\n <input\n type=\"checkbox\"\n title=${this.manageCheckTitle}\n .checked=${this.model?.checked}\n @change=${this.handleLinkClicked}\n />\n </div>\n `;\n }\n\n /**\n * Whether hover pane behavior should be prepared for this tile\n * (e.g., whether mouse listeners should be attached, etc.)\n */\n private get shouldPrepareHoverPane(): boolean {\n return (\n this.enableHoverPane &&\n !!this.tileDisplayMode &&\n TileDispatcher.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode] &&\n this.model?.mediatype !== 'search' && // don't show hover panes on search tiles\n !this.model?.captureDates // don't show hover panes on web archive tiles\n );\n }\n\n private get isHoverEnabled(): boolean {\n return window.matchMedia('(hover: hover)').matches;\n }\n\n /** @inheritdoc */\n getHoverPane(): TileHoverPane | undefined {\n return this.hoverPane;\n }\n\n /** @inheritdoc */\n getHoverPaneProps(): HoverPaneProperties {\n return this;\n }\n\n handleResize(entry: ResizeObserverEntry): void {\n this.currentWidth = entry.contentRect.width;\n this.currentHeight = entry.contentRect.height;\n }\n\n disconnectedCallback(): void {\n this.stopResizeObservation(this.resizeObserver);\n }\n\n private stopResizeObservation(observer?: SharedResizeObserverInterface) {\n observer?.removeObserver({\n handler: this,\n target: this.container,\n });\n }\n\n private startResizeObservation() {\n this.stopResizeObservation(this.resizeObserver);\n this.resizeObserver?.addObserver({\n handler: this,\n target: this.container,\n });\n }\n\n updated(props: PropertyValues) {\n if (props.has('resizeObserver')) {\n const previousObserver = props.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.stopResizeObservation(previousObserver);\n this.startResizeObservation();\n }\n }\n\n /**\n * Handler for when the tile link is left-clicked. Emits the `resultSelected` event.\n * In manage view, it also checks/unchecks the tile.\n */\n private handleLinkClicked(e: Event): void {\n if (this.isManageView) {\n e.preventDefault();\n if (this.model) this.model.checked = !this.model.checked;\n }\n\n this.dispatchEvent(\n new CustomEvent('resultSelected', { detail: this.model }),\n );\n }\n\n /**\n * Handler for when the tile link is right-clicked.\n * In manage view, it opens the item in a new tab. Otherwise, does nothing.\n */\n private handleLinkContextMenu(e: Event): void {\n if (this.isManageView && this.linkTileHref !== nothing) {\n e.preventDefault();\n window.open(this.linkTileHref, '_blank');\n }\n }\n\n private tileInfoButtonPressed(\n e: CustomEvent<{ x: number; y: number }>,\n ): void {\n this.hoverPaneController?.toggleHoverPane({\n coords: e.detail,\n enableTouchBackdrop: true,\n });\n }\n\n private get tile() {\n const {\n model,\n collectionPagePath,\n baseNavigationUrl,\n currentWidth,\n currentHeight,\n sortParam,\n creatorFilter,\n mobileBreakpoint,\n defaultSortParam,\n } = this;\n\n if (!model) return nothing;\n\n switch (this.tileDisplayMode) {\n case 'grid':\n switch (model.mediatype) {\n case 'collection':\n return html`<collection-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${!this.isHoverEnabled}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </collection-tile>`;\n case 'account':\n return html`<account-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${!this.isHoverEnabled}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </account-tile>`;\n case 'search':\n return html`<search-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${false}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </search-tile>`;\n default:\n return html`<item-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${this.currentWidth}\n .currentHeight=${this.currentHeight}\n .baseImageUrl=${this.baseImageUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .simpleLayoutType=${this.simpleLayoutType}\n ?showTvClips=${this.showTvClips}\n ?showInfoButton=${!this.isHoverEnabled}\n ?useLocalTime=${this.useLocalTime}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </item-tile>`;\n }\n case 'list-compact':\n return html`<tile-list-compact\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list-compact>`;\n case 'list-detail':\n return html`<tile-list\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .collectionTitles=${this.collectionTitles}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list>`;\n default:\n return nothing;\n }\n }\n\n static get styles() {\n return css`\n :host {\n display: block;\n height: 100%;\n }\n\n collection-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n }\n\n account-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #fcf5e6;\n }\n\n item-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #f1f1f4;\n }\n\n search-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n --iconFillColor: #2c2c2c;\n }\n\n #container {\n position: relative;\n height: 100%;\n border-radius: 4px;\n }\n\n #container.hoverable:hover {\n box-shadow: var(--tileHoverBoxShadow, 0 0 6px 2px rgba(8, 8, 32, 0.8));\n transition: box-shadow 0.1s ease;\n }\n\n a {\n display: block;\n height: 100%;\n color: unset;\n text-decoration: none;\n transition: transform 0.05s ease;\n }\n\n a :first-child {\n display: block;\n height: 100%;\n }\n\n .manage-check {\n position: absolute;\n right: 0;\n top: 0;\n border: 5px solid #2c2c2c;\n border-radius: 3px;\n background-color: #2c2c2c;\n z-index: 1;\n }\n\n .manage-check > input[type='checkbox'] {\n display: block;\n margin: 0;\n }\n\n #touch-backdrop {\n position: fixed;\n width: 100vw;\n height: 100vh;\n top: 0;\n left: 0;\n z-index: 2;\n background: transparent;\n }\n\n tile-hover-pane {\n position: absolute;\n top: 0;\n left: -9999px;\n z-index: 2;\n }\n `;\n }\n}\n"]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { TemplateResult, nothing } from 'lit';
|
|
2
|
-
import type { SortParam } from '@internetarchive/search-service';
|
|
3
|
-
import type { TileModel } from '../models';
|
|
4
|
-
/**
|
|
5
|
-
* A class encapsulating shared logic for converting model values into display values
|
|
6
|
-
* across different types of tiles.
|
|
7
|
-
*/
|
|
8
|
-
export declare class TileDisplayValueProvider {
|
|
9
|
-
private model?;
|
|
10
|
-
private baseNavigationUrl?;
|
|
11
|
-
private collectionPagePath?;
|
|
12
|
-
private sortParam?;
|
|
13
|
-
private creatorFilter?;
|
|
14
|
-
constructor(options?: {
|
|
15
|
-
model?: TileModel;
|
|
16
|
-
baseNavigationUrl?: string;
|
|
17
|
-
collectionPagePath?: string;
|
|
18
|
-
sortParam?: SortParam;
|
|
19
|
-
creatorFilter?: string;
|
|
20
|
-
});
|
|
21
|
-
/**
|
|
22
|
-
* Examines the creator(s) for the given tile model, returning
|
|
23
|
-
* the first creator whose name matches the provided filter
|
|
24
|
-
* (or simply the first creator overall if no filter is provided).
|
|
25
|
-
*/
|
|
26
|
-
get firstCreatorMatchingFilter(): string | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* The label indicating what year an account item was created.
|
|
29
|
-
* E.g., "Archivist since 2015"
|
|
30
|
-
*/
|
|
31
|
-
get accountLabel(): string;
|
|
32
|
-
/**
|
|
33
|
-
* The readable label for the current sort if it is a type of date sort,
|
|
34
|
-
* or the empty string otherwise.
|
|
35
|
-
*/
|
|
36
|
-
get dateLabel(): string;
|
|
37
|
-
/**
|
|
38
|
-
* Produces a URL pointing at the item page for the given identifier,
|
|
39
|
-
* using the current base URL and the correct path based on whether the
|
|
40
|
-
* item is specified to be a collection (default false).
|
|
41
|
-
*/
|
|
42
|
-
itemPageUrl(identifier?: string, isCollection?: boolean): string | typeof nothing;
|
|
43
|
-
/**
|
|
44
|
-
* Produces a template for a link to a single web capture of the given URL and date
|
|
45
|
-
*/
|
|
46
|
-
webArchivesCaptureLink(url: string, date: Date): TemplateResult;
|
|
47
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { html, nothing } from 'lit';
|
|
2
|
-
import { msg, str } from '@lit/localize';
|
|
3
|
-
import { formatDate } from '../utils/format-date';
|
|
4
|
-
/**
|
|
5
|
-
* A class encapsulating shared logic for converting model values into display values
|
|
6
|
-
* across different types of tiles.
|
|
7
|
-
*/
|
|
8
|
-
export class TileDisplayValueProvider {
|
|
9
|
-
constructor(options = {}) {
|
|
10
|
-
var _a;
|
|
11
|
-
this.model = options.model;
|
|
12
|
-
this.baseNavigationUrl = options.baseNavigationUrl;
|
|
13
|
-
this.collectionPagePath = (_a = options.collectionPagePath) !== null && _a !== void 0 ? _a : '/details/';
|
|
14
|
-
this.sortParam = options.sortParam;
|
|
15
|
-
this.creatorFilter = options.creatorFilter;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Examines the creator(s) for the given tile model, returning
|
|
19
|
-
* the first creator whose name matches the provided filter
|
|
20
|
-
* (or simply the first creator overall if no filter is provided).
|
|
21
|
-
*/
|
|
22
|
-
get firstCreatorMatchingFilter() {
|
|
23
|
-
var _a, _b;
|
|
24
|
-
let matchingCreator;
|
|
25
|
-
// If we're filtering by creator initial and have multiple creators, we want
|
|
26
|
-
// to surface the first creator who matches the filter.
|
|
27
|
-
if (this.creatorFilter && ((_a = this.model) === null || _a === void 0 ? void 0 : _a.creators.length)) {
|
|
28
|
-
const firstLetter = this.creatorFilter; // This is just to satisfy tsc
|
|
29
|
-
matchingCreator = this.model.creators.find(creator =>
|
|
30
|
-
// Decompose combining characters first, so that e.g., filtering on E matches É too.
|
|
31
|
-
// Then remove anything that isn't strictly alphabetic, since our filters currently
|
|
32
|
-
// only handle A-Z. The first such letter (if one exists) is what needs to match.
|
|
33
|
-
creator
|
|
34
|
-
.normalize('NFD')
|
|
35
|
-
.replace(/[^A-Z]+/gi, '')
|
|
36
|
-
.toUpperCase()
|
|
37
|
-
.startsWith(firstLetter));
|
|
38
|
-
}
|
|
39
|
-
return matchingCreator !== null && matchingCreator !== void 0 ? matchingCreator : (_b = this.model) === null || _b === void 0 ? void 0 : _b.creator;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* The label indicating what year an account item was created.
|
|
43
|
-
* E.g., "Archivist since 2015"
|
|
44
|
-
*/
|
|
45
|
-
get accountLabel() {
|
|
46
|
-
var _a;
|
|
47
|
-
return ((_a = this.model) === null || _a === void 0 ? void 0 : _a.dateAdded)
|
|
48
|
-
? msg(str `Archivist since ${this.model.dateAdded.getFullYear()}`)
|
|
49
|
-
: '';
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* The readable label for the current sort if it is a type of date sort,
|
|
53
|
-
* or the empty string otherwise.
|
|
54
|
-
*/
|
|
55
|
-
get dateLabel() {
|
|
56
|
-
var _a;
|
|
57
|
-
switch ((_a = this.sortParam) === null || _a === void 0 ? void 0 : _a.field) {
|
|
58
|
-
case 'publicdate':
|
|
59
|
-
return msg('Archived');
|
|
60
|
-
case 'reviewdate':
|
|
61
|
-
return msg('Reviewed');
|
|
62
|
-
case 'addeddate':
|
|
63
|
-
return msg('Added');
|
|
64
|
-
case 'date':
|
|
65
|
-
return msg('Published');
|
|
66
|
-
default:
|
|
67
|
-
return '';
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Produces a URL pointing at the item page for the given identifier,
|
|
72
|
-
* using the current base URL and the correct path based on whether the
|
|
73
|
-
* item is specified to be a collection (default false).
|
|
74
|
-
*/
|
|
75
|
-
itemPageUrl(identifier, isCollection = false) {
|
|
76
|
-
if (!identifier || this.baseNavigationUrl == null)
|
|
77
|
-
return nothing;
|
|
78
|
-
const basePath = isCollection ? this.collectionPagePath : '/details/';
|
|
79
|
-
return `${this.baseNavigationUrl}${basePath}${identifier}`;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Produces a template for a link to a single web capture of the given URL and date
|
|
83
|
-
*/
|
|
84
|
-
webArchivesCaptureLink(url, date) {
|
|
85
|
-
// Convert the date into the format used to identify wayback captures (e.g., '20150102124550')
|
|
86
|
-
const captureDateStr = date
|
|
87
|
-
.toISOString()
|
|
88
|
-
.replace(/[TZ:-]/g, '')
|
|
89
|
-
.replace(/\..*/, '');
|
|
90
|
-
const captureHref = `https://web.archive.org/web/${captureDateStr}/${encodeURIComponent(url)}`;
|
|
91
|
-
const captureText = formatDate(date, 'long');
|
|
92
|
-
return html ` <a href=${captureHref}> ${captureText} </a> `;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=tile-display-value-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tile-display-value-provider.js","sourceRoot":"","sources":["../../../src/tiles/tile-display-value-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAA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from 'lit';\nimport { msg, str } from '@lit/localize';\nimport type { SortParam } from '@internetarchive/search-service';\nimport type { TileModel } from '../models';\nimport { formatDate } from '../utils/format-date';\n\n/**\n * A class encapsulating shared logic for converting model values into display values\n * across different types of tiles.\n */\nexport class TileDisplayValueProvider {\n private model?: TileModel;\n\n private baseNavigationUrl?: string;\n\n private collectionPagePath?: string;\n\n private sortParam?: SortParam;\n\n private creatorFilter?: string;\n\n constructor(\n options: {\n model?: TileModel;\n baseNavigationUrl?: string;\n collectionPagePath?: string;\n sortParam?: SortParam;\n creatorFilter?: string;\n } = {},\n ) {\n this.model = options.model;\n this.baseNavigationUrl = options.baseNavigationUrl;\n this.collectionPagePath = options.collectionPagePath ?? '/details/';\n this.sortParam = options.sortParam;\n this.creatorFilter = options.creatorFilter;\n }\n\n /**\n * Examines the creator(s) for the given tile model, returning\n * the first creator whose name matches the provided filter\n * (or simply the first creator overall if no filter is provided).\n */\n get firstCreatorMatchingFilter(): string | undefined {\n let matchingCreator;\n\n // If we're filtering by creator initial and have multiple creators, we want\n // to surface the first creator who matches the filter.\n if (this.creatorFilter && this.model?.creators.length) {\n const firstLetter = this.creatorFilter; // This is just to satisfy tsc\n matchingCreator = this.model.creators.find(creator =>\n // Decompose combining characters first, so that e.g., filtering on E matches É too.\n // Then remove anything that isn't strictly alphabetic, since our filters currently\n // only handle A-Z. The first such letter (if one exists) is what needs to match.\n creator\n .normalize('NFD')\n .replace(/[^A-Z]+/gi, '')\n .toUpperCase()\n .startsWith(firstLetter),\n );\n }\n\n return matchingCreator ?? this.model?.creator;\n }\n\n /**\n * The label indicating what year an account item was created.\n * E.g., \"Archivist since 2015\"\n */\n get accountLabel(): string {\n return this.model?.dateAdded\n ? msg(str`Archivist since ${this.model.dateAdded.getFullYear()}`)\n : '';\n }\n\n /**\n * The readable label for the current sort if it is a type of date sort,\n * or the empty string otherwise.\n */\n get dateLabel(): string {\n switch (this.sortParam?.field) {\n case 'publicdate':\n return msg('Archived');\n case 'reviewdate':\n return msg('Reviewed');\n case 'addeddate':\n return msg('Added');\n case 'date':\n return msg('Published');\n default:\n return '';\n }\n }\n\n /**\n * Produces a URL pointing at the item page for the given identifier,\n * using the current base URL and the correct path based on whether the\n * item is specified to be a collection (default false).\n */\n itemPageUrl(\n identifier?: string,\n isCollection = false,\n ): string | typeof nothing {\n if (!identifier || this.baseNavigationUrl == null) return nothing;\n const basePath = isCollection ? this.collectionPagePath : '/details/';\n return `${this.baseNavigationUrl}${basePath}${identifier}`;\n }\n\n /**\n * Produces a template for a link to a single web capture of the given URL and date\n */\n webArchivesCaptureLink(url: string, date: Date): TemplateResult {\n // Convert the date into the format used to identify wayback captures (e.g., '20150102124550')\n const captureDateStr = date\n .toISOString()\n .replace(/[TZ:-]/g, '')\n .replace(/\\..*/, '');\n const captureHref = `https://web.archive.org/web/${captureDateStr}/${encodeURIComponent(\n url,\n )}`;\n const captureText = formatDate(date, 'long');\n\n return html` <a href=${captureHref}> ${captureText} </a> `;\n }\n}\n"]}
|