@internetarchive/collection-browser 2.7.14-alpha-webdev7002.4 → 2.7.14-alpha-webdev7397.0
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/.github/workflows/ci.yml +3 -3
- package/.github/workflows/gh-pages-main.yml +2 -2
- package/.github/workflows/pr-preview.yml +2 -2
- package/.prettierignore +1 -0
- package/dist/index.d.ts +13 -16
- package/dist/index.js +11 -16
- package/dist/index.js.map +1 -1
- package/dist/src/app-root.d.ts +107 -107
- package/dist/src/app-root.js +531 -531
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/assets/img/icons/arrow-left.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-left.js +2 -2
- package/dist/src/assets/img/icons/arrow-right.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-right.js +2 -2
- package/dist/src/assets/img/icons/chevron.d.ts +2 -2
- package/dist/src/assets/img/icons/chevron.js +2 -2
- package/dist/src/assets/img/icons/contract.d.ts +2 -2
- package/dist/src/assets/img/icons/contract.js +2 -2
- package/dist/src/assets/img/icons/empty-query.d.ts +2 -2
- package/dist/src/assets/img/icons/empty-query.js +2 -2
- package/dist/src/assets/img/icons/expand.d.ts +2 -2
- package/dist/src/assets/img/icons/expand.js +2 -2
- package/dist/src/assets/img/icons/eye-closed.d.ts +2 -2
- package/dist/src/assets/img/icons/eye-closed.js +2 -2
- package/dist/src/assets/img/icons/eye.d.ts +2 -2
- package/dist/src/assets/img/icons/eye.js +2 -2
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.js +2 -2
- package/dist/src/assets/img/icons/favorite-unfilled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-unfilled.js +2 -2
- package/dist/src/assets/img/icons/filter.d.ts +2 -2
- package/dist/src/assets/img/icons/filter.js +2 -2
- package/dist/src/assets/img/icons/login-required.d.ts +1 -1
- package/dist/src/assets/img/icons/login-required.js +2 -2
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/account.js +2 -2
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/audio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/collection.js +2 -2
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/data.js +2 -2
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/etree.js +2 -2
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/film.js +2 -2
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/images.js +2 -2
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/radio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/search.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/search.js +2 -2
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/software.js +2 -2
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/texts.js +2 -2
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/tv.js +2 -2
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/video.js +2 -2
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/web.js +2 -2
- package/dist/src/assets/img/icons/null-result.d.ts +2 -2
- package/dist/src/assets/img/icons/null-result.js +2 -2
- package/dist/src/assets/img/icons/restricted.d.ts +1 -1
- package/dist/src/assets/img/icons/restricted.js +2 -2
- package/dist/src/assets/img/icons/reviews.d.ts +1 -1
- package/dist/src/assets/img/icons/reviews.js +2 -2
- package/dist/src/assets/img/icons/upload.d.ts +1 -1
- package/dist/src/assets/img/icons/upload.js +2 -2
- package/dist/src/assets/img/icons/views.d.ts +1 -1
- package/dist/src/assets/img/icons/views.js +2 -2
- package/dist/src/circular-activity-indicator.d.ts +5 -5
- package/dist/src/circular-activity-indicator.js +17 -17
- package/dist/src/circular-activity-indicator.js.map +1 -1
- package/dist/src/collection-browser.d.ts +606 -606
- package/dist/src/collection-browser.js +1679 -1677
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.d.ts +30 -30
- package/dist/src/collection-facets/facet-row.js +118 -118
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -5
- package/dist/src/collection-facets/facet-tombstone-row.js +15 -15
- package/dist/src/collection-facets/facet-tombstone-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.d.ts +13 -13
- package/dist/src/collection-facets/facets-template.js +49 -49
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +106 -106
- package/dist/src/collection-facets/more-facets-content.js +406 -408
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
- package/dist/src/collection-facets/more-facets-pagination.js +197 -196
- package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/dedupe.d.ts +10 -10
- package/dist/src/collection-facets/smart-facets/dedupe.js +33 -33
- package/dist/src/collection-facets/smart-facets/dedupe.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/{browser-language/browser-language-heuristic.d.ts → browser-language-heuristic.d.ts} +5 -5
- package/dist/src/collection-facets/smart-facets/heuristics/{browser-language/browser-language-heuristic.js → browser-language-heuristic.js} +23 -23
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language-heuristic.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/{query-keywords/query-keywords-heuristic.d.ts → query-keywords-heuristic.d.ts} +5 -4
- package/dist/src/collection-facets/smart-facets/heuristics/{query-keywords/query-keywords-map.js → query-keywords-heuristic.js} +45 -35
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords-heuristic.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/heuristics/{wikidata/wikidata-heuristic.d.ts → wikidata-heuristic.d.ts} +5 -4
- package/dist/src/collection-facets/smart-facets/heuristics/{wikidata/wikidata-entity-map.js → wikidata-heuristic.js} +173 -133
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.js.map +1 -0
- package/dist/src/collection-facets/smart-facets/models.d.ts +26 -26
- package/dist/src/collection-facets/smart-facets/models.js +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.d.ts +31 -31
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +237 -240
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-button.d.ts +11 -11
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js +86 -86
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.d.ts +16 -16
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +100 -100
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.d.ts +2 -2
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.js +12 -12
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.d.ts +5 -5
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js +15 -17
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +1 -1
- package/dist/src/collection-facets/toggle-switch.d.ts +41 -41
- package/dist/src/collection-facets/toggle-switch.js +94 -94
- package/dist/src/collection-facets/toggle-switch.js.map +1 -1
- package/dist/src/collection-facets.d.ts +103 -103
- package/dist/src/collection-facets.js +521 -522
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +245 -245
- package/dist/src/data-source/collection-browser-data-source-interface.js +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.d.ts +377 -377
- package/dist/src/data-source/collection-browser-data-source.js +1003 -1004
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +44 -44
- package/dist/src/data-source/collection-browser-query-state.js +1 -1
- package/dist/src/data-source/models.d.ts +28 -28
- package/dist/src/data-source/models.js +8 -8
- package/dist/src/empty-placeholder.d.ts +23 -23
- package/dist/src/empty-placeholder.js +87 -88
- package/dist/src/empty-placeholder.js.map +1 -1
- package/dist/src/expanded-date-picker.d.ts +43 -43
- package/dist/src/expanded-date-picker.js +109 -109
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/language-code-handler/language-code-handler.d.ts +37 -37
- package/dist/src/language-code-handler/language-code-handler.js +26 -26
- package/dist/src/language-code-handler/language-code-handler.js.map +1 -1
- package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +562 -562
- package/dist/src/language-code-handler/language-code-mapping.js.map +1 -1
- package/dist/src/manage/manage-bar.d.ts +58 -58
- package/dist/src/manage/manage-bar.js +175 -175
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/manage/remove-items-modal-content.d.ts +9 -9
- package/dist/src/manage/remove-items-modal-content.js +34 -34
- package/dist/src/manage/remove-items-modal-content.js.map +1 -1
- package/dist/src/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +92 -91
- package/dist/src/mediatype/mediatype-config.js.map +1 -1
- package/dist/src/models.d.ts +228 -228
- package/dist/src/models.js +401 -401
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.d.ts +70 -70
- package/dist/src/restoration-state-handler.js +362 -363
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +6 -6
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +24 -24
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +21 -21
- package/dist/src/sort-filter-bar/alpha-bar.js +136 -136
- package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/compact.js +2 -2
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/list.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.js +2 -2
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/tile.js +2 -2
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +223 -223
- package/dist/src/sort-filter-bar/sort-filter-bar.js +696 -697
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/styles/ia-button.d.ts +2 -2
- package/dist/src/styles/ia-button.js +17 -17
- package/dist/src/styles/item-image-styles.d.ts +8 -8
- package/dist/src/styles/item-image-styles.js +9 -9
- package/dist/src/styles/sr-only.d.ts +1 -1
- package/dist/src/styles/sr-only.js +2 -2
- package/dist/src/tiles/base-tile-component.d.ts +19 -19
- package/dist/src/tiles/base-tile-component.js +64 -64
- package/dist/src/tiles/base-tile-component.js.map +1 -1
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -5
- package/dist/src/tiles/collection-browser-loading-tile.js +15 -15
- package/dist/src/tiles/collection-browser-loading-tile.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.d.ts +18 -18
- package/dist/src/tiles/grid/account-tile.js +72 -72
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.d.ts +15 -15
- package/dist/src/tiles/grid/collection-tile.js +80 -80
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +34 -34
- package/dist/src/tiles/grid/item-tile.js +159 -160
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/search-tile.d.ts +10 -10
- package/dist/src/tiles/grid/search-tile.js +51 -51
- package/dist/src/tiles/grid/search-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +8 -8
- package/dist/src/tiles/grid/tile-stats.d.ts +11 -11
- package/dist/src/tiles/grid/tile-stats.js +54 -54
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +219 -219
- package/dist/src/tiles/hover/hover-pane-controller.js +352 -352
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +18 -18
- package/dist/src/tiles/hover/tile-hover-pane.js +72 -70
- package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
- package/dist/src/tiles/image-block.d.ts +18 -18
- package/dist/src/tiles/image-block.js +89 -89
- package/dist/src/tiles/image-block.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +39 -39
- package/dist/src/tiles/item-image.js +154 -154
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +6 -6
- package/dist/src/tiles/list/tile-list-compact-header.js +38 -38
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.d.ts +19 -19
- package/dist/src/tiles/list/tile-list-compact.js +122 -122
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +54 -54
- package/dist/src/tiles/list/tile-list.js +324 -326
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/mediatype-icon.d.ts +9 -9
- package/dist/src/tiles/mediatype-icon.js +47 -47
- package/dist/src/tiles/mediatype-icon.js.map +1 -1
- package/dist/src/tiles/overlay/icon-overlay.d.ts +8 -8
- package/dist/src/tiles/overlay/icon-overlay.js +25 -25
- package/dist/src/tiles/overlay/icon-overlay.js.map +1 -1
- package/dist/src/tiles/overlay/text-overlay.d.ts +9 -9
- package/dist/src/tiles/overlay/text-overlay.js +31 -31
- package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
- package/dist/src/tiles/review-block.d.ts +12 -12
- package/dist/src/tiles/review-block.js +56 -56
- package/dist/src/tiles/review-block.js.map +1 -1
- package/dist/src/tiles/text-snippet-block.d.ts +27 -27
- package/dist/src/tiles/text-snippet-block.js +73 -73
- package/dist/src/tiles/text-snippet-block.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +64 -64
- package/dist/src/tiles/tile-dispatcher.js +230 -230
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.d.ts +47 -47
- package/dist/src/tiles/tile-display-value-provider.js +94 -94
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/src/utils/analytics-events.d.ts +28 -28
- package/dist/src/utils/analytics-events.js +30 -30
- package/dist/src/utils/array-equals.d.ts +4 -4
- package/dist/src/utils/array-equals.js +10 -10
- package/dist/src/utils/collapse-repeated-quotes.d.ts +11 -11
- package/dist/src/utils/collapse-repeated-quotes.js +13 -13
- package/dist/src/utils/facet-utils.d.ts +83 -83
- package/dist/src/utils/facet-utils.js +145 -145
- package/dist/src/utils/facet-utils.js.map +1 -1
- package/dist/src/utils/format-count.d.ts +7 -7
- package/dist/src/utils/format-count.js +75 -76
- package/dist/src/utils/format-count.js.map +1 -1
- package/dist/src/utils/format-date.d.ts +2 -2
- package/dist/src/utils/format-date.js +27 -27
- package/dist/src/utils/format-date.js.map +1 -1
- package/dist/src/utils/format-unit-size.d.ts +2 -2
- package/dist/src/utils/format-unit-size.js +33 -33
- package/dist/src/utils/format-unit-size.js.map +1 -1
- package/dist/src/utils/local-date-from-utc.d.ts +9 -9
- package/dist/src/utils/local-date-from-utc.js +15 -15
- package/dist/src/utils/log.d.ts +7 -7
- package/dist/src/utils/log.js +13 -15
- package/dist/src/utils/log.js.map +1 -1
- package/dist/src/utils/resolve-mediatype.d.ts +8 -8
- package/dist/src/utils/resolve-mediatype.js +23 -23
- package/dist/src/utils/resolve-mediatype.js.map +1 -1
- package/dist/src/utils/sha1.d.ts +2 -2
- package/dist/src/utils/sha1.js +8 -8
- package/dist/test/collection-browser.test.d.ts +1 -1
- package/dist/test/collection-browser.test.js +1309 -1308
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.d.ts +1 -1
- package/dist/test/collection-facets/facet-row.test.js +230 -227
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +91 -91
- package/dist/test/collection-facets/facets-template.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +140 -141
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +116 -117
- package/dist/test/collection-facets/more-facets-pagination.test.js.map +1 -1
- package/dist/test/collection-facets/toggle-switch.test.d.ts +1 -1
- package/dist/test/collection-facets/toggle-switch.test.js +82 -73
- package/dist/test/collection-facets/toggle-switch.test.js.map +1 -1
- package/dist/test/collection-facets.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +692 -692
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.d.ts +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.js +89 -89
- package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -1
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +62 -63
- package/dist/test/empty-placeholder.test.js.map +1 -1
- package/dist/test/expanded-date-picker.test.d.ts +1 -1
- package/dist/test/expanded-date-picker.test.js +97 -96
- package/dist/test/expanded-date-picker.test.js.map +1 -1
- package/dist/test/icon-overlay.test.d.ts +1 -1
- package/dist/test/icon-overlay.test.js +23 -24
- package/dist/test/icon-overlay.test.js.map +1 -1
- package/dist/test/image-block.test.d.ts +1 -1
- package/dist/test/image-block.test.js +106 -107
- package/dist/test/image-block.test.js.map +1 -1
- package/dist/test/item-image.test.d.ts +1 -1
- package/dist/test/item-image.test.js +84 -85
- package/dist/test/item-image.test.js.map +1 -1
- package/dist/test/manage/manage-bar.test.d.ts +2 -2
- package/dist/test/manage/manage-bar.test.js +100 -101
- package/dist/test/manage/manage-bar.test.js.map +1 -1
- package/dist/test/manage/remove-items-modal-content.test.d.ts +1 -1
- package/dist/test/manage/remove-items-modal-content.test.js +44 -45
- package/dist/test/manage/remove-items-modal-content.test.js.map +1 -1
- package/dist/test/mediatype-config.test.d.ts +1 -1
- package/dist/test/mediatype-config.test.js +16 -16
- package/dist/test/mocks/mock-analytics-handler.d.ts +10 -10
- package/dist/test/mocks/mock-analytics-handler.js +15 -15
- package/dist/test/mocks/mock-search-responses.d.ts +25 -25
- package/dist/test/mocks/mock-search-responses.js +942 -942
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.d.ts +15 -15
- package/dist/test/mocks/mock-search-service.js +54 -54
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +270 -270
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/dist/test/review-block.test.d.ts +1 -1
- package/dist/test/review-block.test.js +43 -44
- package/dist/test/review-block.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +12 -12
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +73 -73
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +425 -426
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +37 -38
- package/dist/test/text-overlay.test.js.map +1 -1
- package/dist/test/text-snippet-block.test.d.ts +1 -1
- package/dist/test/text-snippet-block.test.js +56 -57
- package/dist/test/text-snippet-block.test.js.map +1 -1
- package/dist/test/tile-stats.test.d.ts +1 -1
- package/dist/test/tile-stats.test.js +98 -99
- package/dist/test/tile-stats.test.js.map +1 -1
- package/dist/test/tiles/grid/account-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/account-tile.test.js +75 -76
- package/dist/test/tiles/grid/account-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/collection-tile.test.js +72 -73
- package/dist/test/tiles/grid/collection-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +311 -312
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/search-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/search-tile.test.js +50 -51
- package/dist/test/tiles/grid/search-tile.test.js.map +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +259 -259
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +1 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js +56 -56
- package/dist/test/tiles/hover/tile-hover-pane.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +142 -143
- package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +296 -297
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +100 -100
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +1 -1
- package/dist/test/tiles/tile-display-value-provider.test.js +141 -141
- package/dist/test/utils/array-equals.test.d.ts +1 -1
- package/dist/test/utils/array-equals.test.js +26 -26
- package/dist/test/utils/format-count.test.d.ts +1 -1
- package/dist/test/utils/format-count.test.js +23 -23
- package/dist/test/utils/format-count.test.js.map +1 -1
- package/dist/test/utils/format-date.test.d.ts +1 -1
- package/dist/test/utils/format-date.test.js +30 -30
- package/dist/test/utils/format-date.test.js.map +1 -1
- package/dist/test/utils/format-unit-size.test.d.ts +1 -1
- package/dist/test/utils/format-unit-size.test.js +17 -17
- package/dist/test/utils/local-date-from-utc.test.d.ts +1 -1
- package/dist/test/utils/local-date-from-utc.test.js +26 -26
- package/dist/test/utils/local-date-from-utc.test.js.map +1 -1
- package/eslint.config.mjs +53 -0
- package/index.html +0 -3
- package/index.ts +1 -15
- package/package.json +41 -39
- package/src/app-root.ts +21 -22
- package/src/collection-browser.ts +44 -40
- package/src/collection-facets/facets-template.ts +7 -6
- package/src/collection-facets/more-facets-content.ts +11 -13
- package/src/collection-facets/more-facets-pagination.ts +3 -2
- package/src/collection-facets/smart-facets/dedupe.ts +2 -2
- package/src/collection-facets/smart-facets/heuristics/{browser-language/browser-language-heuristic.ts → browser-language-heuristic.ts} +1 -1
- package/src/collection-facets/smart-facets/heuristics/query-keywords-heuristic.ts +55 -0
- package/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.ts +191 -0
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +6 -8
- package/src/collection-facets/smart-facets/smart-facet-button.ts +5 -3
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +4 -4
- package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +8 -13
- package/src/collection-facets/toggle-switch.ts +2 -2
- package/src/collection-facets.ts +18 -19
- package/src/data-source/collection-browser-data-source-interface.ts +5 -1
- package/src/data-source/collection-browser-data-source.ts +37 -34
- package/src/empty-placeholder.ts +19 -16
- package/src/expanded-date-picker.ts +1 -1
- package/src/language-code-handler/language-code-handler.ts +1 -1
- package/src/manage/manage-bar.ts +23 -20
- package/src/manage/remove-items-modal-content.ts +2 -2
- package/src/mediatype/mediatype-config.ts +1 -0
- package/src/models.ts +3 -3
- package/src/restoration-state-handler.ts +14 -15
- package/src/sort-filter-bar/alpha-bar.ts +16 -17
- package/src/sort-filter-bar/sort-filter-bar.ts +14 -15
- package/src/tiles/grid/account-tile.ts +1 -1
- package/src/tiles/grid/collection-tile.ts +1 -1
- package/src/tiles/grid/item-tile.ts +9 -9
- package/src/tiles/grid/tile-stats.ts +4 -4
- package/src/tiles/hover/hover-pane-controller.ts +1 -1
- package/src/tiles/hover/tile-hover-pane.ts +4 -2
- package/src/tiles/item-image.ts +1 -1
- package/src/tiles/list/tile-list-compact.ts +2 -2
- package/src/tiles/list/tile-list.ts +22 -24
- package/src/tiles/tile-dispatcher.ts +5 -5
- package/src/tiles/tile-display-value-provider.ts +4 -4
- package/src/utils/facet-utils.ts +6 -6
- package/src/utils/format-count.ts +2 -3
- package/src/utils/format-date.ts +1 -1
- package/src/utils/format-unit-size.ts +1 -1
- package/src/utils/log.ts +1 -3
- package/test/collection-browser.test.ts +125 -124
- package/test/collection-facets/facet-row.test.ts +31 -28
- package/test/collection-facets/facets-template.test.ts +9 -9
- package/test/collection-facets/more-facets-content.test.ts +14 -15
- package/test/collection-facets/more-facets-pagination.test.ts +18 -19
- package/test/collection-facets/toggle-switch.test.ts +28 -18
- package/test/collection-facets.test.ts +46 -39
- package/test/data-source/collection-browser-data-source.test.ts +2 -2
- package/test/empty-placeholder.test.ts +6 -7
- package/test/expanded-date-picker.test.ts +25 -20
- package/test/icon-overlay.test.ts +0 -1
- package/test/image-block.test.ts +6 -7
- package/test/item-image.test.ts +0 -1
- package/test/manage/manage-bar.test.ts +19 -16
- package/test/manage/remove-items-modal-content.test.ts +4 -5
- package/test/mocks/mock-search-responses.ts +2 -1
- package/test/mocks/mock-search-service.ts +1 -1
- package/test/restoration-state-handler.test.ts +12 -12
- package/test/review-block.test.ts +1 -2
- package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +1 -1
- package/test/sort-filter-bar/alpha-bar.test.ts +5 -5
- package/test/sort-filter-bar/sort-filter-bar.test.ts +38 -39
- package/test/text-overlay.test.ts +0 -1
- package/test/text-snippet-block.test.ts +5 -6
- package/test/tile-stats.test.ts +26 -35
- package/test/tiles/grid/account-tile.test.ts +2 -3
- package/test/tiles/grid/collection-tile.test.ts +3 -4
- package/test/tiles/grid/item-tile.test.ts +13 -14
- package/test/tiles/grid/search-tile.test.ts +1 -2
- package/test/tiles/hover/hover-pane-controller.test.ts +15 -15
- package/test/tiles/hover/tile-hover-pane.test.ts +5 -5
- package/test/tiles/list/tile-list-compact.test.ts +1 -2
- package/test/tiles/list/tile-list.test.ts +10 -11
- package/test/tiles/tile-dispatcher.test.ts +5 -5
- package/test/utils/format-count.test.ts +1 -1
- package/test/utils/format-date.test.ts +1 -1
- package/test/utils/local-date-from-utc.test.ts +1 -1
- package/tsconfig.json +0 -1
- 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.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.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.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +0 -49
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +0 -1
- 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 -36
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -134
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -60
|
@@ -1,406 +1,405 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
expect(
|
|
13
|
-
expect(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _a, _b, _c;
|
|
1
|
+
import { expect, fixture } from '@open-wc/testing';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import '../../../src/tiles/list/tile-list';
|
|
4
|
+
describe('List Tile', () => {
|
|
5
|
+
it('should render initial component', async () => {
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
const el = await fixture(html `<tile-list .model=${{}}></tile-list>`);
|
|
8
|
+
const listContainer = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#list-line');
|
|
9
|
+
const itemTitle = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#title');
|
|
10
|
+
const imageBlock = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('image-block');
|
|
11
|
+
expect(listContainer).to.exist;
|
|
12
|
+
expect(itemTitle).to.exist;
|
|
13
|
+
expect(imageBlock).to.exist;
|
|
14
|
+
});
|
|
15
|
+
it('should render the mobile template if below mobile breakpoint', async () => {
|
|
16
|
+
var _a, _b, _c;
|
|
18
17
|
const el = await fixture(html `
|
|
19
18
|
<tile-list .mobileBreakpoint=${500} .currentWidth=${400}> </tile-list>
|
|
20
|
-
`);
|
|
21
|
-
const listContainer = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('list-line');
|
|
22
|
-
const topLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.getElementById('list-line-top');
|
|
23
|
-
const bottomLine = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('list-line-bottom');
|
|
24
|
-
expect(listContainer).to.exist;
|
|
25
|
-
expect(listContainer === null || listContainer === void 0 ? void 0 : listContainer.classList.contains('mobile')).to.be.true;
|
|
26
|
-
expect(topLine).to.exist;
|
|
27
|
-
expect(bottomLine).to.exist;
|
|
28
|
-
});
|
|
29
|
-
it('should render title link with model href if provided', async () => {
|
|
30
|
-
var _a;
|
|
19
|
+
`);
|
|
20
|
+
const listContainer = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('list-line');
|
|
21
|
+
const topLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.getElementById('list-line-top');
|
|
22
|
+
const bottomLine = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('list-line-bottom');
|
|
23
|
+
expect(listContainer).to.exist;
|
|
24
|
+
expect(listContainer === null || listContainer === void 0 ? void 0 : listContainer.classList.contains('mobile')).to.be.true;
|
|
25
|
+
expect(topLine).to.exist;
|
|
26
|
+
expect(bottomLine).to.exist;
|
|
27
|
+
});
|
|
28
|
+
it('should render title link with model href if provided', async () => {
|
|
29
|
+
var _a;
|
|
31
30
|
const el = await fixture(html `
|
|
32
31
|
<tile-list
|
|
33
32
|
.baseNavigationUrl=${''}
|
|
34
33
|
.model=${{ title: 'foo', href: '/foo/bar' }}
|
|
35
34
|
></tile-list>
|
|
36
|
-
`);
|
|
37
|
-
const title = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#title > a');
|
|
38
|
-
expect(title).to.exist;
|
|
39
|
-
expect(title === null || title === void 0 ? void 0 : title.getAttribute('href')).to.equal('/foo/bar');
|
|
40
|
-
});
|
|
41
|
-
it('should render with creator element but not dates', async () => {
|
|
42
|
-
var _a, _b;
|
|
35
|
+
`);
|
|
36
|
+
const title = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#title > a');
|
|
37
|
+
expect(title).to.exist;
|
|
38
|
+
expect(title === null || title === void 0 ? void 0 : title.getAttribute('href')).to.equal('/foo/bar');
|
|
39
|
+
});
|
|
40
|
+
it('should render with creator element but not dates', async () => {
|
|
41
|
+
var _a, _b;
|
|
43
42
|
const el = await fixture(html `
|
|
44
43
|
<tile-list .model=${{ creators: ['someone'] }}></tile-list>
|
|
45
|
-
`);
|
|
46
|
-
const creator = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#creator');
|
|
47
|
-
const datesLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#dates-line');
|
|
48
|
-
expect(creator).to.exist;
|
|
49
|
-
expect(datesLine === null || datesLine === void 0 ? void 0 : datesLine.children.length).to.equal(0);
|
|
50
|
-
});
|
|
51
|
-
it('should render with snippet block when it has snippets', async () => {
|
|
52
|
-
var _a;
|
|
44
|
+
`);
|
|
45
|
+
const creator = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#creator');
|
|
46
|
+
const datesLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#dates-line');
|
|
47
|
+
expect(creator).to.exist;
|
|
48
|
+
expect(datesLine === null || datesLine === void 0 ? void 0 : datesLine.children.length).to.equal(0);
|
|
49
|
+
});
|
|
50
|
+
it('should render with snippet block when it has snippets', async () => {
|
|
51
|
+
var _a;
|
|
53
52
|
const el = await fixture(html `
|
|
54
53
|
<tile-list .model=${{ snippets: ['some {{{snippet}}} text'] }}>
|
|
55
54
|
</tile-list>
|
|
56
|
-
`);
|
|
57
|
-
const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
|
|
58
|
-
expect(snippetBlock).to.exist;
|
|
59
|
-
});
|
|
60
|
-
it('should not render snippet block when no snippets are present', async () => {
|
|
61
|
-
var _a;
|
|
62
|
-
const el = await fixture(html `<tile-list></tile-list>`);
|
|
63
|
-
const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
|
|
64
|
-
expect(snippetBlock).to.not.exist;
|
|
65
|
-
});
|
|
66
|
-
it('should not render suppressed collections', async () => {
|
|
67
|
-
var _a;
|
|
55
|
+
`);
|
|
56
|
+
const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
|
|
57
|
+
expect(snippetBlock).to.exist;
|
|
58
|
+
});
|
|
59
|
+
it('should not render snippet block when no snippets are present', async () => {
|
|
60
|
+
var _a;
|
|
61
|
+
const el = await fixture(html `<tile-list></tile-list>`);
|
|
62
|
+
const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
|
|
63
|
+
expect(snippetBlock).to.not.exist;
|
|
64
|
+
});
|
|
65
|
+
it('should not render suppressed collections', async () => {
|
|
66
|
+
var _a;
|
|
68
67
|
const el = await fixture(html `
|
|
69
68
|
<tile-list
|
|
70
69
|
.model=${{ collections: ['deemphasize', 'community', 'foo'] }}
|
|
71
70
|
.baseNavigationUrl=${'base'}
|
|
72
71
|
>
|
|
73
72
|
</tile-list>
|
|
74
|
-
`);
|
|
75
|
-
const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
|
|
76
|
-
expect(collectionsRow).to.exist;
|
|
77
|
-
const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
|
|
78
|
-
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
|
|
79
|
-
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/foo');
|
|
80
|
-
});
|
|
81
|
-
it('should not render fav- collections', async () => {
|
|
82
|
-
var _a;
|
|
73
|
+
`);
|
|
74
|
+
const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
|
|
75
|
+
expect(collectionsRow).to.exist;
|
|
76
|
+
const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
|
|
77
|
+
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
|
|
78
|
+
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/foo');
|
|
79
|
+
});
|
|
80
|
+
it('should not render fav- collections', async () => {
|
|
81
|
+
var _a;
|
|
83
82
|
const el = await fixture(html `
|
|
84
83
|
<tile-list
|
|
85
84
|
.model=${{ collections: ['fav-foo', 'bar'] }}
|
|
86
85
|
.baseNavigationUrl=${'base'}
|
|
87
86
|
>
|
|
88
87
|
</tile-list>
|
|
89
|
-
`);
|
|
90
|
-
const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
|
|
91
|
-
expect(collectionsRow).to.exist;
|
|
92
|
-
const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
|
|
93
|
-
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
|
|
94
|
-
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/bar');
|
|
95
|
-
});
|
|
96
|
-
it('should render weekly views when sorting by week', async () => {
|
|
97
|
-
var _a, _b;
|
|
88
|
+
`);
|
|
89
|
+
const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
|
|
90
|
+
expect(collectionsRow).to.exist;
|
|
91
|
+
const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
|
|
92
|
+
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
|
|
93
|
+
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/bar');
|
|
94
|
+
});
|
|
95
|
+
it('should render weekly views when sorting by week', async () => {
|
|
96
|
+
var _a, _b;
|
|
98
97
|
const el = await fixture(html `
|
|
99
98
|
<tile-list
|
|
100
99
|
.model=${{ viewCount: 50, weeklyViewCount: 10 }}
|
|
101
100
|
.sortParam=${{ field: 'week', direction: 'desc' }}
|
|
102
101
|
>
|
|
103
102
|
</tile-list>
|
|
104
|
-
`);
|
|
105
|
-
const viewsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('views-line');
|
|
106
|
-
expect(viewsRow).to.exist;
|
|
107
|
-
expect((_b = viewsRow === null || viewsRow === void 0 ? void 0 : viewsRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Views: 10');
|
|
108
|
-
});
|
|
109
|
-
it('should render published date when sorting by it', async () => {
|
|
110
|
-
var _a, _b;
|
|
111
|
-
const model = {
|
|
112
|
-
dateAdded: new Date(2010, 0, 2),
|
|
113
|
-
dateArchived: new Date(2011, 0, 2),
|
|
114
|
-
datePublished: new Date(2012, 0, 2),
|
|
115
|
-
dateReviewed: new Date(2013, 0, 2),
|
|
116
|
-
};
|
|
103
|
+
`);
|
|
104
|
+
const viewsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('views-line');
|
|
105
|
+
expect(viewsRow).to.exist;
|
|
106
|
+
expect((_b = viewsRow === null || viewsRow === void 0 ? void 0 : viewsRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Views: 10');
|
|
107
|
+
});
|
|
108
|
+
it('should render published date when sorting by it', async () => {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
const model = {
|
|
111
|
+
dateAdded: new Date(2010, 0, 2),
|
|
112
|
+
dateArchived: new Date(2011, 0, 2),
|
|
113
|
+
datePublished: new Date(2012, 0, 2),
|
|
114
|
+
dateReviewed: new Date(2013, 0, 2),
|
|
115
|
+
};
|
|
117
116
|
const el = await fixture(html `
|
|
118
117
|
<tile-list
|
|
119
118
|
.model=${model}
|
|
120
119
|
.sortParam=${{ field: 'date', direction: 'desc' }}
|
|
121
120
|
>
|
|
122
121
|
</tile-list>
|
|
123
|
-
`);
|
|
124
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
125
|
-
expect(dateRow).to.exist;
|
|
126
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: Jan 02, 2012');
|
|
127
|
-
});
|
|
128
|
-
it('should render added date when sorting by it', async () => {
|
|
129
|
-
var _a, _b;
|
|
130
|
-
const model = {
|
|
131
|
-
dateAdded: new Date(2010, 0, 2),
|
|
132
|
-
dateArchived: new Date(2011, 0, 2),
|
|
133
|
-
datePublished: new Date(2012, 0, 2),
|
|
134
|
-
dateReviewed: new Date(2013, 0, 2),
|
|
135
|
-
};
|
|
122
|
+
`);
|
|
123
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
124
|
+
expect(dateRow).to.exist;
|
|
125
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: Jan 02, 2012');
|
|
126
|
+
});
|
|
127
|
+
it('should render added date when sorting by it', async () => {
|
|
128
|
+
var _a, _b;
|
|
129
|
+
const model = {
|
|
130
|
+
dateAdded: new Date(2010, 0, 2),
|
|
131
|
+
dateArchived: new Date(2011, 0, 2),
|
|
132
|
+
datePublished: new Date(2012, 0, 2),
|
|
133
|
+
dateReviewed: new Date(2013, 0, 2),
|
|
134
|
+
};
|
|
136
135
|
const el = await fixture(html `
|
|
137
136
|
<tile-list
|
|
138
137
|
.model=${model}
|
|
139
138
|
.sortParam=${{ field: 'addeddate', direction: 'desc' }}
|
|
140
139
|
>
|
|
141
140
|
</tile-list>
|
|
142
|
-
`);
|
|
143
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
144
|
-
expect(dateRow).to.exist;
|
|
145
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Added: Jan 02, 2010');
|
|
146
|
-
});
|
|
147
|
-
it('should render archived date when sorting by it', async () => {
|
|
148
|
-
var _a, _b;
|
|
149
|
-
const model = {
|
|
150
|
-
dateAdded: new Date(2010, 0, 2),
|
|
151
|
-
dateArchived: new Date(2011, 0, 2),
|
|
152
|
-
datePublished: new Date(2012, 0, 2),
|
|
153
|
-
dateReviewed: new Date(2013, 0, 2),
|
|
154
|
-
};
|
|
141
|
+
`);
|
|
142
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
143
|
+
expect(dateRow).to.exist;
|
|
144
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Added: Jan 02, 2010');
|
|
145
|
+
});
|
|
146
|
+
it('should render archived date when sorting by it', async () => {
|
|
147
|
+
var _a, _b;
|
|
148
|
+
const model = {
|
|
149
|
+
dateAdded: new Date(2010, 0, 2),
|
|
150
|
+
dateArchived: new Date(2011, 0, 2),
|
|
151
|
+
datePublished: new Date(2012, 0, 2),
|
|
152
|
+
dateReviewed: new Date(2013, 0, 2),
|
|
153
|
+
};
|
|
155
154
|
const el = await fixture(html `
|
|
156
155
|
<tile-list
|
|
157
156
|
.model=${model}
|
|
158
157
|
.sortParam=${{ field: 'publicdate', direction: 'desc' }}
|
|
159
158
|
>
|
|
160
159
|
</tile-list>
|
|
161
|
-
`);
|
|
162
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
163
|
-
expect(dateRow).to.exist;
|
|
164
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Archived: Jan 02, 2011');
|
|
165
|
-
});
|
|
166
|
-
it('should render reviewed date when sorting by it', async () => {
|
|
167
|
-
var _a, _b;
|
|
168
|
-
const model = {
|
|
169
|
-
dateAdded: new Date(2010, 0, 2),
|
|
170
|
-
dateArchived: new Date(2011, 0, 2),
|
|
171
|
-
datePublished: new Date(2012, 0, 2),
|
|
172
|
-
dateReviewed: new Date(2013, 0, 2),
|
|
173
|
-
};
|
|
160
|
+
`);
|
|
161
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
162
|
+
expect(dateRow).to.exist;
|
|
163
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Archived: Jan 02, 2011');
|
|
164
|
+
});
|
|
165
|
+
it('should render reviewed date when sorting by it', async () => {
|
|
166
|
+
var _a, _b;
|
|
167
|
+
const model = {
|
|
168
|
+
dateAdded: new Date(2010, 0, 2),
|
|
169
|
+
dateArchived: new Date(2011, 0, 2),
|
|
170
|
+
datePublished: new Date(2012, 0, 2),
|
|
171
|
+
dateReviewed: new Date(2013, 0, 2),
|
|
172
|
+
};
|
|
174
173
|
const el = await fixture(html `
|
|
175
174
|
<tile-list
|
|
176
175
|
.model=${model}
|
|
177
176
|
.sortParam=${{ field: 'reviewdate', direction: 'desc' }}
|
|
178
177
|
>
|
|
179
178
|
</tile-list>
|
|
180
|
-
`);
|
|
181
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
182
|
-
expect(dateRow).to.exist;
|
|
183
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Reviewed: Jan 02, 2013');
|
|
184
|
-
});
|
|
185
|
-
it('should only show the year for a date published of Jan 1 at midnight', async () => {
|
|
186
|
-
var _a, _b;
|
|
187
|
-
const model = {
|
|
188
|
-
datePublished: new Date(2012, 0, 1, 0, 0, 0, 0),
|
|
189
|
-
};
|
|
179
|
+
`);
|
|
180
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
181
|
+
expect(dateRow).to.exist;
|
|
182
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Reviewed: Jan 02, 2013');
|
|
183
|
+
});
|
|
184
|
+
it('should only show the year for a date published of Jan 1 at midnight', async () => {
|
|
185
|
+
var _a, _b;
|
|
186
|
+
const model = {
|
|
187
|
+
datePublished: new Date(2012, 0, 1, 0, 0, 0, 0),
|
|
188
|
+
};
|
|
190
189
|
const el = await fixture(html `
|
|
191
190
|
<tile-list
|
|
192
191
|
.model=${model}
|
|
193
192
|
.sortParam=${{ field: 'date', direction: 'desc' }}
|
|
194
193
|
>
|
|
195
194
|
</tile-list>
|
|
196
|
-
`);
|
|
197
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
198
|
-
expect(dateRow).to.exist;
|
|
199
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: 2012');
|
|
200
|
-
});
|
|
201
|
-
it('should show full date added/archived/reviewed, even on Jan 1 at midnight', async () => {
|
|
202
|
-
var _a, _b, _c, _d, _e, _f;
|
|
203
|
-
const model = {
|
|
204
|
-
dateAdded: new Date(2010, 0, 1, 0, 0, 0, 0),
|
|
205
|
-
dateArchived: new Date(2011, 0, 1, 0, 0, 0, 0),
|
|
206
|
-
datePublished: new Date(2012, 0, 1, 0, 0, 0, 0),
|
|
207
|
-
dateReviewed: new Date(2013, 0, 1, 0, 0, 0, 0),
|
|
208
|
-
};
|
|
195
|
+
`);
|
|
196
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
197
|
+
expect(dateRow).to.exist;
|
|
198
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: 2012');
|
|
199
|
+
});
|
|
200
|
+
it('should show full date added/archived/reviewed, even on Jan 1 at midnight', async () => {
|
|
201
|
+
var _a, _b, _c, _d, _e, _f;
|
|
202
|
+
const model = {
|
|
203
|
+
dateAdded: new Date(2010, 0, 1, 0, 0, 0, 0),
|
|
204
|
+
dateArchived: new Date(2011, 0, 1, 0, 0, 0, 0),
|
|
205
|
+
datePublished: new Date(2012, 0, 1, 0, 0, 0, 0),
|
|
206
|
+
dateReviewed: new Date(2013, 0, 1, 0, 0, 0, 0),
|
|
207
|
+
};
|
|
209
208
|
const el = await fixture(html `
|
|
210
209
|
<tile-list
|
|
211
210
|
.model=${model}
|
|
212
211
|
.sortParam=${{ field: 'addeddate', direction: 'desc' }}
|
|
213
212
|
>
|
|
214
213
|
</tile-list>
|
|
215
|
-
`);
|
|
216
|
-
let dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
217
|
-
expect(dateRow).to.exist;
|
|
218
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Added: Jan 01, 2010');
|
|
219
|
-
el.sortParam = { field: 'publicdate', direction: 'desc' };
|
|
220
|
-
await el.updateComplete;
|
|
221
|
-
dateRow = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('dates-line');
|
|
222
|
-
expect(dateRow).to.exist;
|
|
223
|
-
expect((_d = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _d === void 0 ? void 0 : _d.trim()).to.contain('Archived: Jan 01, 2011');
|
|
224
|
-
el.sortParam = { field: 'reviewdate', direction: 'desc' };
|
|
225
|
-
await el.updateComplete;
|
|
226
|
-
dateRow = (_e = el.shadowRoot) === null || _e === void 0 ? void 0 : _e.getElementById('dates-line');
|
|
227
|
-
expect(dateRow).to.exist;
|
|
228
|
-
expect((_f = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _f === void 0 ? void 0 : _f.trim()).to.contain('Reviewed: Jan 01, 2013');
|
|
229
|
-
});
|
|
230
|
-
it('should render links to /search pages (not search.php) for subject, creator, and source', async () => {
|
|
231
|
-
var _a, _b, _c;
|
|
232
|
-
const model = {
|
|
233
|
-
subjects: ['foo'],
|
|
234
|
-
creators: ['bar'],
|
|
235
|
-
source: 'baz',
|
|
236
|
-
};
|
|
214
|
+
`);
|
|
215
|
+
let dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
216
|
+
expect(dateRow).to.exist;
|
|
217
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Added: Jan 01, 2010');
|
|
218
|
+
el.sortParam = { field: 'publicdate', direction: 'desc' };
|
|
219
|
+
await el.updateComplete;
|
|
220
|
+
dateRow = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('dates-line');
|
|
221
|
+
expect(dateRow).to.exist;
|
|
222
|
+
expect((_d = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _d === void 0 ? void 0 : _d.trim()).to.contain('Archived: Jan 01, 2011');
|
|
223
|
+
el.sortParam = { field: 'reviewdate', direction: 'desc' };
|
|
224
|
+
await el.updateComplete;
|
|
225
|
+
dateRow = (_e = el.shadowRoot) === null || _e === void 0 ? void 0 : _e.getElementById('dates-line');
|
|
226
|
+
expect(dateRow).to.exist;
|
|
227
|
+
expect((_f = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _f === void 0 ? void 0 : _f.trim()).to.contain('Reviewed: Jan 01, 2013');
|
|
228
|
+
});
|
|
229
|
+
it('should render links to /search pages (not search.php) for subject, creator, and source', async () => {
|
|
230
|
+
var _a, _b, _c;
|
|
231
|
+
const model = {
|
|
232
|
+
subjects: ['foo'],
|
|
233
|
+
creators: ['bar'],
|
|
234
|
+
source: 'baz',
|
|
235
|
+
};
|
|
237
236
|
const el = await fixture(html `
|
|
238
237
|
<tile-list .model=${model}></tile-list>
|
|
239
|
-
`);
|
|
240
|
-
const subjectLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#topics a[href]');
|
|
241
|
-
expect(subjectLink).to.exist;
|
|
242
|
-
expect(subjectLink === null || subjectLink === void 0 ? void 0 : subjectLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('subject:"foo"')}`);
|
|
243
|
-
const creatorLink = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#creator a[href]');
|
|
244
|
-
expect(creatorLink).to.exist;
|
|
245
|
-
expect(creatorLink === null || creatorLink === void 0 ? void 0 : creatorLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('creator:"bar"')}`);
|
|
246
|
-
const sourceLink = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('#source a[href]');
|
|
247
|
-
expect(sourceLink).to.exist;
|
|
248
|
-
expect(sourceLink === null || sourceLink === void 0 ? void 0 : sourceLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('source:"baz"')}`);
|
|
249
|
-
});
|
|
250
|
-
it('should render multi-line descriptions with spaces b/w lines', async () => {
|
|
251
|
-
var _a, _b;
|
|
238
|
+
`);
|
|
239
|
+
const subjectLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#topics a[href]');
|
|
240
|
+
expect(subjectLink).to.exist;
|
|
241
|
+
expect(subjectLink === null || subjectLink === void 0 ? void 0 : subjectLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('subject:"foo"')}`);
|
|
242
|
+
const creatorLink = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#creator a[href]');
|
|
243
|
+
expect(creatorLink).to.exist;
|
|
244
|
+
expect(creatorLink === null || creatorLink === void 0 ? void 0 : creatorLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('creator:"bar"')}`);
|
|
245
|
+
const sourceLink = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('#source a[href]');
|
|
246
|
+
expect(sourceLink).to.exist;
|
|
247
|
+
expect(sourceLink === null || sourceLink === void 0 ? void 0 : sourceLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('source:"baz"')}`);
|
|
248
|
+
});
|
|
249
|
+
it('should render multi-line descriptions with spaces b/w lines', async () => {
|
|
250
|
+
var _a, _b;
|
|
252
251
|
const el = await fixture(html `
|
|
253
252
|
<tile-list .model=${{ description: 'line1\nline2' }}> </tile-list>
|
|
254
|
-
`);
|
|
255
|
-
const descriptionBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('description');
|
|
256
|
-
expect(descriptionBlock).to.exist;
|
|
257
|
-
expect((_b = descriptionBlock === null || descriptionBlock === void 0 ? void 0 : descriptionBlock.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('line1 line2'); // line break replaced by space
|
|
258
|
-
});
|
|
259
|
-
it('should render mediatype icon as link to corresponding mediatype collection details', async () => {
|
|
260
|
-
var _a;
|
|
261
|
-
const model = {
|
|
262
|
-
mediatype: 'texts',
|
|
263
|
-
};
|
|
253
|
+
`);
|
|
254
|
+
const descriptionBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('description');
|
|
255
|
+
expect(descriptionBlock).to.exist;
|
|
256
|
+
expect((_b = descriptionBlock === null || descriptionBlock === void 0 ? void 0 : descriptionBlock.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('line1 line2'); // line break replaced by space
|
|
257
|
+
});
|
|
258
|
+
it('should render mediatype icon as link to corresponding mediatype collection details', async () => {
|
|
259
|
+
var _a;
|
|
260
|
+
const model = {
|
|
261
|
+
mediatype: 'texts',
|
|
262
|
+
};
|
|
264
263
|
const el = await fixture(html `
|
|
265
264
|
<tile-list
|
|
266
265
|
.baseNavigationUrl=${'https://archive.org'}
|
|
267
266
|
.model=${model}
|
|
268
267
|
></tile-list>
|
|
269
|
-
`);
|
|
270
|
-
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
271
|
-
expect(mediatypeLink).to.exist;
|
|
272
|
-
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/details/texts`);
|
|
273
|
-
});
|
|
274
|
-
it('should render mediatype icon as link even with empty baseNavigationUrl', async () => {
|
|
275
|
-
var _a;
|
|
276
|
-
const model = {
|
|
277
|
-
mediatype: 'texts',
|
|
278
|
-
};
|
|
268
|
+
`);
|
|
269
|
+
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
270
|
+
expect(mediatypeLink).to.exist;
|
|
271
|
+
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/details/texts`);
|
|
272
|
+
});
|
|
273
|
+
it('should render mediatype icon as link even with empty baseNavigationUrl', async () => {
|
|
274
|
+
var _a;
|
|
275
|
+
const model = {
|
|
276
|
+
mediatype: 'texts',
|
|
277
|
+
};
|
|
279
278
|
const el = await fixture(html `
|
|
280
279
|
<tile-list .baseNavigationUrl=${''} .model=${model}></tile-list>
|
|
281
|
-
`);
|
|
282
|
-
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
283
|
-
expect(mediatypeLink).to.exist;
|
|
284
|
-
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`/details/texts`);
|
|
285
|
-
});
|
|
286
|
-
it('should render collection mediatype icon as link to search page', async () => {
|
|
287
|
-
var _a;
|
|
288
|
-
const model = {
|
|
289
|
-
mediatype: 'collection',
|
|
290
|
-
};
|
|
280
|
+
`);
|
|
281
|
+
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
282
|
+
expect(mediatypeLink).to.exist;
|
|
283
|
+
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`/details/texts`);
|
|
284
|
+
});
|
|
285
|
+
it('should render collection mediatype icon as link to search page', async () => {
|
|
286
|
+
var _a;
|
|
287
|
+
const model = {
|
|
288
|
+
mediatype: 'collection',
|
|
289
|
+
};
|
|
291
290
|
const el = await fixture(html `
|
|
292
291
|
<tile-list
|
|
293
292
|
.baseNavigationUrl=${'https://archive.org'}
|
|
294
293
|
.model=${model}
|
|
295
294
|
></tile-list>
|
|
296
|
-
`);
|
|
297
|
-
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
298
|
-
expect(mediatypeLink).to.exist;
|
|
299
|
-
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/search?query=mediatype:collection&sort=-downloads`);
|
|
300
|
-
});
|
|
301
|
-
it('should not render account mediatype icon as link', async () => {
|
|
302
|
-
var _a;
|
|
303
|
-
const model = {
|
|
304
|
-
mediatype: 'account',
|
|
305
|
-
};
|
|
295
|
+
`);
|
|
296
|
+
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
297
|
+
expect(mediatypeLink).to.exist;
|
|
298
|
+
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/search?query=mediatype:collection&sort=-downloads`);
|
|
299
|
+
});
|
|
300
|
+
it('should not render account mediatype icon as link', async () => {
|
|
301
|
+
var _a;
|
|
302
|
+
const model = {
|
|
303
|
+
mediatype: 'account',
|
|
304
|
+
};
|
|
306
305
|
const el = await fixture(html `
|
|
307
306
|
<tile-list
|
|
308
307
|
.baseNavigationUrl=${'https://archive.org'}
|
|
309
308
|
.model=${model}
|
|
310
309
|
></tile-list>
|
|
311
|
-
`);
|
|
312
|
-
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
313
|
-
expect(mediatypeLink).to.exist;
|
|
314
|
-
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).not.to.exist;
|
|
315
|
-
});
|
|
316
|
-
it('should render date added for accounts', async () => {
|
|
317
|
-
var _a, _b;
|
|
310
|
+
`);
|
|
311
|
+
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
312
|
+
expect(mediatypeLink).to.exist;
|
|
313
|
+
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).not.to.exist;
|
|
314
|
+
});
|
|
315
|
+
it('should render date added for accounts', async () => {
|
|
316
|
+
var _a, _b;
|
|
318
317
|
const el = await fixture(html `
|
|
319
318
|
<tile-list
|
|
320
|
-
.model=${{
|
|
321
|
-
mediatype: 'account',
|
|
322
|
-
dateAdded: new Date('2015-05-05T00:00:00'),
|
|
319
|
+
.model=${{
|
|
320
|
+
mediatype: 'account',
|
|
321
|
+
dateAdded: new Date('2015-05-05T00:00:00'),
|
|
323
322
|
}}
|
|
324
323
|
>
|
|
325
324
|
</tile-list>
|
|
326
|
-
`);
|
|
327
|
-
const creatorBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('creator');
|
|
328
|
-
expect(creatorBlock).to.exist;
|
|
329
|
-
expect((_b = creatorBlock === null || creatorBlock === void 0 ? void 0 : creatorBlock.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Archivist since 2015');
|
|
330
|
-
});
|
|
331
|
-
it('should render web capture date links if present', async () => {
|
|
332
|
-
var _a, _b, _c, _d, _e;
|
|
333
|
-
const captureDates = [
|
|
334
|
-
new Date('2010-01-02T12:34:56Z'),
|
|
335
|
-
new Date('2011-02-03T12:43:21Z'),
|
|
336
|
-
];
|
|
325
|
+
`);
|
|
326
|
+
const creatorBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('creator');
|
|
327
|
+
expect(creatorBlock).to.exist;
|
|
328
|
+
expect((_b = creatorBlock === null || creatorBlock === void 0 ? void 0 : creatorBlock.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Archivist since 2015');
|
|
329
|
+
});
|
|
330
|
+
it('should render web capture date links if present', async () => {
|
|
331
|
+
var _a, _b, _c, _d, _e;
|
|
332
|
+
const captureDates = [
|
|
333
|
+
new Date('2010-01-02T12:34:56Z'),
|
|
334
|
+
new Date('2011-02-03T12:43:21Z'),
|
|
335
|
+
];
|
|
337
336
|
const el = await fixture(html `
|
|
338
337
|
<tile-list
|
|
339
|
-
.model=${{
|
|
340
|
-
identifier: 'foo',
|
|
341
|
-
title: 'https://example.com/',
|
|
342
|
-
captureDates,
|
|
338
|
+
.model=${{
|
|
339
|
+
identifier: 'foo',
|
|
340
|
+
title: 'https://example.com/',
|
|
341
|
+
captureDates,
|
|
343
342
|
}}
|
|
344
343
|
></tile-list>
|
|
345
|
-
`);
|
|
346
|
-
const captureDatesUl = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.capture-dates');
|
|
347
|
-
expect(captureDatesUl, 'capture dates container').to.exist;
|
|
348
|
-
expect(captureDatesUl === null || captureDatesUl === void 0 ? void 0 : captureDatesUl.children.length).to.equal(2);
|
|
349
|
-
const firstDateLink = (_b = captureDatesUl === null || captureDatesUl === void 0 ? void 0 : captureDatesUl.children[0]) === null || _b === void 0 ? void 0 : _b.querySelector('a[href]');
|
|
350
|
-
expect(firstDateLink, 'first date link').to.exist;
|
|
351
|
-
expect(firstDateLink === null || firstDateLink === void 0 ? void 0 : firstDateLink.getAttribute('href')).to.equal('https://web.archive.org/web/20100102123456/https%3A%2F%2Fexample.com%2F');
|
|
352
|
-
expect((_c = firstDateLink === null || firstDateLink === void 0 ? void 0 : firstDateLink.textContent) === null || _c === void 0 ? void 0 : _c.trim()).to.equal('Jan 02, 2010');
|
|
353
|
-
const secondDateLink = (_d = captureDatesUl === null || captureDatesUl === void 0 ? void 0 : captureDatesUl.children[1]) === null || _d === void 0 ? void 0 : _d.querySelector('a[href]');
|
|
354
|
-
expect(secondDateLink, 'second date link').to.exist;
|
|
355
|
-
expect(secondDateLink === null || secondDateLink === void 0 ? void 0 : secondDateLink.getAttribute('href')).to.equal('https://web.archive.org/web/20110203124321/https%3A%2F%2Fexample.com%2F');
|
|
356
|
-
expect((_e = secondDateLink === null || secondDateLink === void 0 ? void 0 : secondDateLink.textContent) === null || _e === void 0 ? void 0 : _e.trim()).to.equal('Feb 03, 2011');
|
|
357
|
-
});
|
|
358
|
-
it('should not render web captures if no title is present', async () => {
|
|
359
|
-
var _a;
|
|
360
|
-
const captureDates = [
|
|
361
|
-
new Date('2010-01-02T12:34:56Z'),
|
|
362
|
-
new Date('2011-02-03T12:43:21Z'),
|
|
363
|
-
];
|
|
344
|
+
`);
|
|
345
|
+
const captureDatesUl = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.capture-dates');
|
|
346
|
+
expect(captureDatesUl, 'capture dates container').to.exist;
|
|
347
|
+
expect(captureDatesUl === null || captureDatesUl === void 0 ? void 0 : captureDatesUl.children.length).to.equal(2);
|
|
348
|
+
const firstDateLink = (_b = captureDatesUl === null || captureDatesUl === void 0 ? void 0 : captureDatesUl.children[0]) === null || _b === void 0 ? void 0 : _b.querySelector('a[href]');
|
|
349
|
+
expect(firstDateLink, 'first date link').to.exist;
|
|
350
|
+
expect(firstDateLink === null || firstDateLink === void 0 ? void 0 : firstDateLink.getAttribute('href')).to.equal('https://web.archive.org/web/20100102123456/https%3A%2F%2Fexample.com%2F');
|
|
351
|
+
expect((_c = firstDateLink === null || firstDateLink === void 0 ? void 0 : firstDateLink.textContent) === null || _c === void 0 ? void 0 : _c.trim()).to.equal('Jan 02, 2010');
|
|
352
|
+
const secondDateLink = (_d = captureDatesUl === null || captureDatesUl === void 0 ? void 0 : captureDatesUl.children[1]) === null || _d === void 0 ? void 0 : _d.querySelector('a[href]');
|
|
353
|
+
expect(secondDateLink, 'second date link').to.exist;
|
|
354
|
+
expect(secondDateLink === null || secondDateLink === void 0 ? void 0 : secondDateLink.getAttribute('href')).to.equal('https://web.archive.org/web/20110203124321/https%3A%2F%2Fexample.com%2F');
|
|
355
|
+
expect((_e = secondDateLink === null || secondDateLink === void 0 ? void 0 : secondDateLink.textContent) === null || _e === void 0 ? void 0 : _e.trim()).to.equal('Feb 03, 2011');
|
|
356
|
+
});
|
|
357
|
+
it('should not render web captures if no title is present', async () => {
|
|
358
|
+
var _a;
|
|
359
|
+
const captureDates = [
|
|
360
|
+
new Date('2010-01-02T12:34:56Z'),
|
|
361
|
+
new Date('2011-02-03T12:43:21Z'),
|
|
362
|
+
];
|
|
364
363
|
const el = await fixture(html `
|
|
365
364
|
<tile-list
|
|
366
|
-
.model=${{
|
|
367
|
-
identifier: 'foo',
|
|
368
|
-
captureDates,
|
|
365
|
+
.model=${{
|
|
366
|
+
identifier: 'foo',
|
|
367
|
+
captureDates,
|
|
369
368
|
}}
|
|
370
369
|
></tile-list>
|
|
371
|
-
`);
|
|
372
|
-
const captureDatesUl = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.capture-dates');
|
|
373
|
-
expect(captureDatesUl).not.to.exist;
|
|
374
|
-
});
|
|
375
|
-
it('should render review snippet if present', async () => {
|
|
376
|
-
var _a;
|
|
377
|
-
const review = {
|
|
378
|
-
title: 'Foo',
|
|
379
|
-
body: 'foo bar baz',
|
|
380
|
-
stars: 3,
|
|
381
|
-
};
|
|
370
|
+
`);
|
|
371
|
+
const captureDatesUl = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.capture-dates');
|
|
372
|
+
expect(captureDatesUl).not.to.exist;
|
|
373
|
+
});
|
|
374
|
+
it('should render review snippet if present', async () => {
|
|
375
|
+
var _a;
|
|
376
|
+
const review = {
|
|
377
|
+
title: 'Foo',
|
|
378
|
+
body: 'foo bar baz',
|
|
379
|
+
stars: 3,
|
|
380
|
+
};
|
|
382
381
|
const el = await fixture(html `
|
|
383
382
|
<tile-list
|
|
384
|
-
.model=${{
|
|
385
|
-
identifier: 'foo',
|
|
386
|
-
review,
|
|
383
|
+
.model=${{
|
|
384
|
+
identifier: 'foo',
|
|
385
|
+
review,
|
|
387
386
|
}}
|
|
388
387
|
></tile-list>
|
|
389
|
-
`);
|
|
390
|
-
const reviewBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('review-block');
|
|
391
|
-
expect(reviewBlock).to.exist;
|
|
392
|
-
});
|
|
393
|
-
it('should not render review snippet block when no review is present', async () => {
|
|
394
|
-
var _a;
|
|
388
|
+
`);
|
|
389
|
+
const reviewBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('review-block');
|
|
390
|
+
expect(reviewBlock).to.exist;
|
|
391
|
+
});
|
|
392
|
+
it('should not render review snippet block when no review is present', async () => {
|
|
393
|
+
var _a;
|
|
395
394
|
const el = await fixture(html `
|
|
396
395
|
<tile-list
|
|
397
|
-
.model=${{
|
|
398
|
-
identifier: 'foo',
|
|
396
|
+
.model=${{
|
|
397
|
+
identifier: 'foo',
|
|
399
398
|
}}
|
|
400
399
|
></tile-list>
|
|
401
|
-
`);
|
|
402
|
-
const reviewBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('review-block');
|
|
403
|
-
expect(reviewBlock).not.to.exist;
|
|
404
|
-
});
|
|
405
|
-
});
|
|
400
|
+
`);
|
|
401
|
+
const reviewBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('review-block');
|
|
402
|
+
expect(reviewBlock).not.to.exist;
|
|
403
|
+
});
|
|
404
|
+
});
|
|
406
405
|
//# sourceMappingURL=tile-list.test.js.map
|