@internetarchive/collection-browser 4.8.0 → 4.8.1-webdev-9227.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/src/collection-browser.d.ts +2 -1
- package/dist/src/collection-browser.js +3 -3
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.js +3 -2
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-scroller.js +3 -2
- package/dist/src/collection-facets/more-facets-scroller.js.map +1 -1
- package/dist/src/collection-facets.js +3 -2
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/empty-placeholder.d.ts +7 -7
- package/dist/src/empty-placeholder.js +29 -15
- package/dist/src/empty-placeholder.js.map +1 -1
- package/dist/src/expanded-date-picker.js +3 -2
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/locales/es.d.ts +94 -0
- package/dist/src/locales/es.js +109 -0
- package/dist/src/locales/es.js.map +1 -0
- package/dist/src/manage/manage-bar.d.ts +3 -2
- package/dist/src/manage/manage-bar.js +6 -7
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/manage/remove-items-modal-content.js +3 -2
- package/dist/src/manage/remove-items-modal-content.js.map +1 -1
- package/dist/src/models.js +6 -2
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +3 -2
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.js +3 -2
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +3 -2
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +3 -2
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.js +3 -2
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js +3 -2
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +3 -1
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +3 -2
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/overlay/text-overlay.js +3 -1
- package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
- package/dist/src/tiles/review-block.js +3 -2
- package/dist/src/tiles/review-block.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +2 -1
- package/dist/src/tiles/tile-dispatcher.js +5 -4
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/locales/es.d.ts +1 -0
- package/locales/es.js +1 -0
- package/package.json +13 -1
- package/.editorconfig +0 -29
- package/.github/workflows/ci.yml +0 -29
- package/.github/workflows/gh-pages-main.yml +0 -41
- package/.github/workflows/npm-publish.yml +0 -42
- package/.github/workflows/pr-preview.yml +0 -40
- package/.husky/pre-commit +0 -1
- package/.prettierignore +0 -1
- package/dist/test/collection-browser.test.d.ts +0 -1
- package/dist/test/collection-browser.test.js +0 -1815
- package/dist/test/collection-browser.test.js.map +0 -1
- package/dist/test/collection-facets/facet-row.test.d.ts +0 -1
- package/dist/test/collection-facets/facet-row.test.js +0 -291
- package/dist/test/collection-facets/facet-row.test.js.map +0 -1
- package/dist/test/collection-facets/facets-template.test.d.ts +0 -1
- package/dist/test/collection-facets/facets-template.test.js +0 -95
- package/dist/test/collection-facets/facets-template.test.js.map +0 -1
- package/dist/test/collection-facets/more-facets-content.test.d.ts +0 -1
- package/dist/test/collection-facets/more-facets-content.test.js +0 -509
- package/dist/test/collection-facets/more-facets-content.test.js.map +0 -1
- package/dist/test/collection-facets/more-facets-scroller.test.d.ts +0 -1
- package/dist/test/collection-facets/more-facets-scroller.test.js +0 -288
- package/dist/test/collection-facets/more-facets-scroller.test.js.map +0 -1
- package/dist/test/collection-facets/page-window.test.d.ts +0 -1
- package/dist/test/collection-facets/page-window.test.js +0 -175
- package/dist/test/collection-facets/page-window.test.js.map +0 -1
- package/dist/test/collection-facets/toggle-switch.test.d.ts +0 -1
- package/dist/test/collection-facets/toggle-switch.test.js +0 -99
- package/dist/test/collection-facets/toggle-switch.test.js.map +0 -1
- package/dist/test/collection-facets.test.d.ts +0 -2
- package/dist/test/collection-facets.test.js +0 -728
- package/dist/test/collection-facets.test.js.map +0 -1
- package/dist/test/data-source/collection-browser-data-source.test.d.ts +0 -1
- package/dist/test/data-source/collection-browser-data-source.test.js +0 -154
- package/dist/test/data-source/collection-browser-data-source.test.js.map +0 -1
- package/dist/test/empty-placeholder.test.d.ts +0 -1
- package/dist/test/empty-placeholder.test.js +0 -57
- package/dist/test/empty-placeholder.test.js.map +0 -1
- package/dist/test/expanded-date-picker.test.d.ts +0 -1
- package/dist/test/expanded-date-picker.test.js +0 -124
- package/dist/test/expanded-date-picker.test.js.map +0 -1
- package/dist/test/icon-overlay.test.d.ts +0 -1
- package/dist/test/icon-overlay.test.js +0 -31
- package/dist/test/icon-overlay.test.js.map +0 -1
- package/dist/test/image-block.test.d.ts +0 -1
- package/dist/test/image-block.test.js +0 -208
- package/dist/test/image-block.test.js.map +0 -1
- package/dist/test/item-image.test.d.ts +0 -1
- package/dist/test/item-image.test.js +0 -187
- package/dist/test/item-image.test.js.map +0 -1
- package/dist/test/manage/manage-bar.test.d.ts +0 -3
- package/dist/test/manage/manage-bar.test.js +0 -216
- package/dist/test/manage/manage-bar.test.js.map +0 -1
- package/dist/test/manage/remove-items-modal-content.test.d.ts +0 -1
- package/dist/test/manage/remove-items-modal-content.test.js +0 -60
- package/dist/test/manage/remove-items-modal-content.test.js.map +0 -1
- package/dist/test/mediatype-config.test.d.ts +0 -1
- package/dist/test/mediatype-config.test.js +0 -11
- package/dist/test/mediatype-config.test.js.map +0 -1
- package/dist/test/mocks/mock-analytics-handler.d.ts +0 -10
- package/dist/test/mocks/mock-analytics-handler.js +0 -16
- package/dist/test/mocks/mock-analytics-handler.js.map +0 -1
- package/dist/test/mocks/mock-search-responses.d.ts +0 -37
- package/dist/test/mocks/mock-search-responses.js +0 -1293
- 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 -335
- package/dist/test/restoration-state-handler.test.js.map +0 -1
- package/dist/test/review-block.test.d.ts +0 -1
- package/dist/test/review-block.test.js +0 -46
- package/dist/test/review-block.test.js.map +0 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +0 -12
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +0 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +0 -68
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -304
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +0 -1
- package/dist/test/text-overlay.test.d.ts +0 -1
- package/dist/test/text-overlay.test.js +0 -43
- package/dist/test/text-overlay.test.js.map +0 -1
- package/dist/test/text-snippet-block.test.d.ts +0 -1
- package/dist/test/text-snippet-block.test.js +0 -58
- package/dist/test/text-snippet-block.test.js.map +0 -1
- package/dist/test/tile-stats.test.d.ts +0 -1
- package/dist/test/tile-stats.test.js +0 -167
- package/dist/test/tile-stats.test.js.map +0 -1
- package/dist/test/tiles/grid/account-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/account-tile.test.js +0 -96
- package/dist/test/tiles/grid/account-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/collection-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/collection-tile.test.js +0 -90
- package/dist/test/tiles/grid/collection-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/item-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/item-tile.test.js +0 -400
- package/dist/test/tiles/grid/item-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/search-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/search-tile.test.js +0 -62
- package/dist/test/tiles/grid/search-tile.test.js.map +0 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +0 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -351
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +0 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +0 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js +0 -53
- package/dist/test/tiles/hover/tile-hover-pane.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list-compact-header.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list-compact-header.test.js +0 -36
- package/dist/test/tiles/list/tile-list-compact-header.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +0 -237
- package/dist/test/tiles/list/tile-list-compact.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list.test.js +0 -460
- package/dist/test/tiles/list/tile-list.test.js.map +0 -1
- package/dist/test/tiles/tile-dispatcher.test.d.ts +0 -1
- package/dist/test/tiles/tile-dispatcher.test.js +0 -246
- package/dist/test/tiles/tile-dispatcher.test.js.map +0 -1
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +0 -1
- package/dist/test/tiles/tile-display-value-provider.test.js +0 -142
- package/dist/test/tiles/tile-display-value-provider.test.js.map +0 -1
- package/dist/test/tiles/tile-mediatype-icon.test.d.ts +0 -1
- package/dist/test/tiles/tile-mediatype-icon.test.js +0 -133
- package/dist/test/tiles/tile-mediatype-icon.test.js.map +0 -1
- package/dist/test/utils/array-equals.test.d.ts +0 -1
- package/dist/test/utils/array-equals.test.js +0 -27
- package/dist/test/utils/array-equals.test.js.map +0 -1
- package/dist/test/utils/format-count.test.d.ts +0 -1
- package/dist/test/utils/format-count.test.js +0 -24
- package/dist/test/utils/format-count.test.js.map +0 -1
- package/dist/test/utils/format-date.test.d.ts +0 -1
- package/dist/test/utils/format-date.test.js +0 -61
- package/dist/test/utils/format-date.test.js.map +0 -1
- package/dist/test/utils/format-unit-size.test.d.ts +0 -1
- package/dist/test/utils/format-unit-size.test.js +0 -18
- package/dist/test/utils/format-unit-size.test.js.map +0 -1
- package/dist/test/utils/local-date-from-utc.test.d.ts +0 -1
- package/dist/test/utils/local-date-from-utc.test.js +0 -27
- package/dist/test/utils/local-date-from-utc.test.js.map +0 -1
- package/dist/test/utils/normalize-filter-text.test.d.ts +0 -1
- package/dist/test/utils/normalize-filter-text.test.js +0 -69
- package/dist/test/utils/normalize-filter-text.test.js.map +0 -1
- package/docs/design/column-virtualization.md +0 -214
- package/eslint.config.mjs +0 -53
- package/index.html +0 -24
- package/index.ts +0 -29
- package/local.archive.org.cert +0 -86
- package/local.archive.org.key +0 -27
- package/pnpm-workspace.yaml +0 -30
- package/renovate.json +0 -6
- package/src/app-root.ts +0 -1282
- package/src/assets/img/icons/arrow-left.ts +0 -10
- package/src/assets/img/icons/arrow-right.ts +0 -10
- package/src/assets/img/icons/check.ts +0 -5
- package/src/assets/img/icons/chevron.ts +0 -4
- package/src/assets/img/icons/close-circle-dark.ts +0 -5
- package/src/assets/img/icons/contract.ts +0 -9
- package/src/assets/img/icons/empty-query.ts +0 -5
- package/src/assets/img/icons/expand.ts +0 -9
- package/src/assets/img/icons/eye-closed.ts +0 -5
- package/src/assets/img/icons/eye.ts +0 -5
- package/src/assets/img/icons/favorite-filled.ts +0 -10
- package/src/assets/img/icons/favorite-unfilled.ts +0 -9
- package/src/assets/img/icons/filter.ts +0 -10
- package/src/assets/img/icons/login-required.ts +0 -18
- package/src/assets/img/icons/mediatype/account.ts +0 -14
- package/src/assets/img/icons/mediatype/audio.ts +0 -14
- package/src/assets/img/icons/mediatype/collection.ts +0 -12
- package/src/assets/img/icons/mediatype/data.ts +0 -15
- package/src/assets/img/icons/mediatype/etree.ts +0 -14
- package/src/assets/img/icons/mediatype/film.ts +0 -14
- package/src/assets/img/icons/mediatype/images.ts +0 -13
- package/src/assets/img/icons/mediatype/radio.ts +0 -15
- package/src/assets/img/icons/mediatype/search.ts +0 -14
- package/src/assets/img/icons/mediatype/software.ts +0 -13
- package/src/assets/img/icons/mediatype/texts.ts +0 -13
- package/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
- package/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
- package/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
- package/src/assets/img/icons/mediatype/tv.ts +0 -14
- package/src/assets/img/icons/mediatype/video.ts +0 -14
- package/src/assets/img/icons/mediatype/web.ts +0 -13
- package/src/assets/img/icons/null-result.ts +0 -5
- package/src/assets/img/icons/quote.ts +0 -7
- package/src/assets/img/icons/restricted.ts +0 -13
- package/src/assets/img/icons/reviews.ts +0 -11
- package/src/assets/img/icons/upload.ts +0 -12
- package/src/assets/img/icons/views.ts +0 -11
- package/src/circular-activity-indicator.ts +0 -64
- package/src/collection-browser.ts +0 -3165
- package/src/collection-facets/facet-row-template.ts +0 -242
- package/src/collection-facets/facet-row.ts +0 -122
- package/src/collection-facets/facet-tombstone-row.ts +0 -40
- package/src/collection-facets/facets-template.ts +0 -85
- package/src/collection-facets/models.ts +0 -16
- package/src/collection-facets/more-facets-content.ts +0 -951
- package/src/collection-facets/more-facets-scroller.ts +0 -485
- package/src/collection-facets/page-window.ts +0 -247
- package/src/collection-facets/smart-facets/dedupe.ts +0 -44
- package/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
- package/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
- package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
- package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
- package/src/collection-facets/smart-facets/models.ts +0 -36
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
- package/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
- package/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
- package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
- package/src/collection-facets/toggle-switch.ts +0 -175
- package/src/collection-facets.ts +0 -1013
- package/src/data-source/collection-browser-data-source-interface.ts +0 -351
- package/src/data-source/collection-browser-data-source.ts +0 -1474
- package/src/data-source/collection-browser-query-state.ts +0 -60
- package/src/data-source/models.ts +0 -56
- package/src/empty-placeholder.ts +0 -192
- package/src/expanded-date-picker.ts +0 -191
- package/src/language-code-handler/language-code-handler.ts +0 -64
- package/src/language-code-handler/language-code-mapping.ts +0 -564
- package/src/manage/manage-bar.ts +0 -276
- package/src/manage/remove-items-modal-content.ts +0 -102
- package/src/mediatype/mediatype-config.ts +0 -146
- package/src/models.ts +0 -912
- package/src/restoration-state-handler.ts +0 -550
- package/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
- package/src/sort-filter-bar/alpha-bar.ts +0 -252
- package/src/sort-filter-bar/img/compact.ts +0 -5
- package/src/sort-filter-bar/img/list.ts +0 -5
- package/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
- package/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
- package/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
- package/src/sort-filter-bar/img/sort-triangle.ts +0 -5
- package/src/sort-filter-bar/img/tile.ts +0 -5
- package/src/sort-filter-bar/sort-filter-bar.ts +0 -733
- package/src/styles/ia-button.ts +0 -139
- package/src/styles/item-image-styles.ts +0 -124
- package/src/styles/sr-only.ts +0 -18
- package/src/styles/tile-action-styles.ts +0 -59
- package/src/tiles/base-tile-component.ts +0 -124
- package/src/tiles/collection-browser-loading-tile.ts +0 -26
- package/src/tiles/grid/account-tile.ts +0 -113
- package/src/tiles/grid/collection-tile.ts +0 -184
- package/src/tiles/grid/item-tile.ts +0 -347
- package/src/tiles/grid/search-tile.ts +0 -90
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
- package/src/tiles/grid/tile-stats.ts +0 -211
- package/src/tiles/hover/hover-pane-controller.ts +0 -638
- package/src/tiles/hover/tile-hover-pane.ts +0 -184
- package/src/tiles/image-block.ts +0 -162
- package/src/tiles/item-image.ts +0 -214
- package/src/tiles/list/tile-list-compact-header.ts +0 -112
- package/src/tiles/list/tile-list-compact.ts +0 -278
- package/src/tiles/list/tile-list.ts +0 -718
- package/src/tiles/models.ts +0 -21
- package/src/tiles/overlay/icon-overlay.ts +0 -57
- package/src/tiles/overlay/text-overlay.ts +0 -79
- package/src/tiles/review-block.ts +0 -130
- package/src/tiles/text-snippet-block.ts +0 -132
- package/src/tiles/tile-dispatcher.ts +0 -637
- package/src/tiles/tile-display-value-provider.ts +0 -133
- package/src/tiles/tile-mediatype-icon.ts +0 -133
- package/src/utils/analytics-events.ts +0 -29
- package/src/utils/array-equals.ts +0 -8
- package/src/utils/collapse-repeated-quotes.ts +0 -13
- package/src/utils/date-filter-field.ts +0 -11
- package/src/utils/facet-utils.ts +0 -183
- package/src/utils/format-count.ts +0 -95
- package/src/utils/format-date.ts +0 -62
- package/src/utils/format-unit-size.ts +0 -43
- package/src/utils/local-date-from-utc.ts +0 -15
- package/src/utils/log.ts +0 -14
- package/src/utils/normalize-filter-text.ts +0 -54
- package/src/utils/resolve-mediatype.ts +0 -26
- package/src/utils/sha1.ts +0 -9
- package/test/collection-browser.test.ts +0 -2639
- package/test/collection-facets/facet-row.test.ts +0 -421
- package/test/collection-facets/facets-template.test.ts +0 -139
- package/test/collection-facets/more-facets-content.test.ts +0 -716
- package/test/collection-facets/more-facets-scroller.test.ts +0 -401
- package/test/collection-facets/page-window.test.ts +0 -208
- package/test/collection-facets/toggle-switch.test.ts +0 -164
- package/test/collection-facets.test.ts +0 -928
- package/test/data-source/collection-browser-data-source.test.ts +0 -193
- package/test/empty-placeholder.test.ts +0 -88
- package/test/expanded-date-picker.test.ts +0 -201
- package/test/icon-overlay.test.ts +0 -38
- package/test/image-block.test.ts +0 -247
- package/test/item-image.test.ts +0 -220
- package/test/manage/manage-bar.test.ts +0 -347
- package/test/manage/remove-items-modal-content.test.ts +0 -81
- package/test/mediatype-config.test.ts +0 -11
- package/test/mocks/mock-analytics-handler.ts +0 -30
- package/test/mocks/mock-search-responses.ts +0 -1420
- package/test/mocks/mock-search-service.ts +0 -136
- package/test/restoration-state-handler.test.ts +0 -480
- package/test/review-block.test.ts +0 -62
- package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
- package/test/sort-filter-bar/alpha-bar.test.ts +0 -101
- package/test/sort-filter-bar/sort-filter-bar.test.ts +0 -443
- package/test/text-overlay.test.ts +0 -55
- package/test/text-snippet-block.test.ts +0 -85
- package/test/tile-stats.test.ts +0 -191
- package/test/tiles/grid/account-tile.test.ts +0 -121
- package/test/tiles/grid/collection-tile.test.ts +0 -114
- package/test/tiles/grid/item-tile.test.ts +0 -520
- package/test/tiles/grid/search-tile.test.ts +0 -75
- package/test/tiles/hover/hover-pane-controller.test.ts +0 -482
- package/test/tiles/hover/tile-hover-pane.test.ts +0 -80
- package/test/tiles/list/tile-list-compact-header.test.ts +0 -43
- package/test/tiles/list/tile-list-compact.test.ts +0 -282
- package/test/tiles/list/tile-list.test.ts +0 -576
- package/test/tiles/tile-dispatcher.test.ts +0 -320
- package/test/tiles/tile-display-value-provider.test.ts +0 -172
- package/test/tiles/tile-mediatype-icon.test.ts +0 -160
- package/test/utils/array-equals.test.ts +0 -31
- package/test/utils/format-count.test.ts +0 -32
- package/test/utils/format-date.test.ts +0 -89
- package/test/utils/format-unit-size.test.ts +0 -21
- package/test/utils/local-date-from-utc.test.ts +0 -37
- package/test/utils/normalize-filter-text.test.ts +0 -87
- package/tsconfig.json +0 -25
- package/types/dompurify.d.ts +0 -1
- package/vite.config.ts +0 -29
- package/web-dev-server.config.mjs +0 -30
- package/web-test-runner.config.mjs +0 -57
package/src/tiles/models.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What type of simplified tile layout to use.
|
|
3
|
-
* - `default`: Do not apply any layout simplifications.
|
|
4
|
-
* - `stats-only`: Only show the tile stats row, but not text snippets.
|
|
5
|
-
* - `snippets-only`: Only show the text snippets row (if snippets exist), but not tile stats.
|
|
6
|
-
* - `minimal`: Show neither tile stats nor the text snippets.
|
|
7
|
-
*/
|
|
8
|
-
export type LayoutType = 'default' | 'stats-only' | 'snippets-only' | 'minimal';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Describes an action button to render on a tile.
|
|
12
|
-
* Styling is controlled via the CSS custom properties documented in
|
|
13
|
-
* `src/styles/tile-action-styles.ts`.
|
|
14
|
-
*/
|
|
15
|
-
export interface TileAction {
|
|
16
|
-
/** Unique identifier for this action, included in the `tileActionClicked` event */
|
|
17
|
-
id: string;
|
|
18
|
-
|
|
19
|
-
/** Visible label text displayed on the button */
|
|
20
|
-
label: string;
|
|
21
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
css,
|
|
3
|
-
CSSResultGroup,
|
|
4
|
-
html,
|
|
5
|
-
LitElement,
|
|
6
|
-
nothing,
|
|
7
|
-
TemplateResult,
|
|
8
|
-
} from 'lit';
|
|
9
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
10
|
-
import { TILE_OVERLAY_ICONS, TileOverlayType } from '../../models';
|
|
11
|
-
|
|
12
|
-
@customElement('icon-overlay')
|
|
13
|
-
export class IconOverlay extends LitElement {
|
|
14
|
-
@property({ type: String }) type?: TileOverlayType;
|
|
15
|
-
|
|
16
|
-
render() {
|
|
17
|
-
return html`<div class="icon-overlay">${this.iconTemplate}</div>`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
private get iconTemplate(): TemplateResult | typeof nothing {
|
|
21
|
-
if (!this.type) return nothing;
|
|
22
|
-
return html`${TILE_OVERLAY_ICONS[this.type] ?? nothing}`;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static get styles(): CSSResultGroup {
|
|
26
|
-
return css`
|
|
27
|
-
:host {
|
|
28
|
-
position: absolute;
|
|
29
|
-
top: 50%;
|
|
30
|
-
left: 50%;
|
|
31
|
-
transform: translate(-50%, -50%);
|
|
32
|
-
width: 100%;
|
|
33
|
-
z-index: 2;
|
|
34
|
-
background-color: rgb(255, 254, 203);
|
|
35
|
-
display: flex;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
border: 1px solid #2c2c2c;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.icon-overlay {
|
|
41
|
-
height: 20px;
|
|
42
|
-
width: 20px;
|
|
43
|
-
padding: 2px;
|
|
44
|
-
padding: 2px;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:host(.list-detail) .icon-overlay {
|
|
48
|
-
height: 20px;
|
|
49
|
-
width: 20px;
|
|
50
|
-
}
|
|
51
|
-
:host(.list-compact) .icon-overlay {
|
|
52
|
-
height: 15px;
|
|
53
|
-
width: 15px;
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
css,
|
|
3
|
-
CSSResultGroup,
|
|
4
|
-
html,
|
|
5
|
-
LitElement,
|
|
6
|
-
nothing,
|
|
7
|
-
TemplateResult,
|
|
8
|
-
} from 'lit';
|
|
9
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
10
|
-
import {
|
|
11
|
-
TILE_OVERLAY_ICONS,
|
|
12
|
-
TILE_OVERLAY_TEXT,
|
|
13
|
-
TileOverlayType,
|
|
14
|
-
} from '../../models';
|
|
15
|
-
|
|
16
|
-
@customElement('text-overlay')
|
|
17
|
-
export class TextOverlay extends LitElement {
|
|
18
|
-
@property({ type: String }) type?: TileOverlayType;
|
|
19
|
-
|
|
20
|
-
render() {
|
|
21
|
-
return html`
|
|
22
|
-
<div class="overlay no-preview">
|
|
23
|
-
<div class="icon-overlay">${this.iconTemplate}</div>
|
|
24
|
-
<p class="text-overlay">${this.textTemplate}</p>
|
|
25
|
-
</div>
|
|
26
|
-
`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
private get iconTemplate(): TemplateResult | typeof nothing {
|
|
30
|
-
if (!this.type) return nothing;
|
|
31
|
-
return html`${TILE_OVERLAY_ICONS[this.type] ?? nothing}`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
private get textTemplate(): TemplateResult | typeof nothing {
|
|
35
|
-
if (!this.type) return nothing;
|
|
36
|
-
return html`${TILE_OVERLAY_TEXT[this.type] ?? nothing}`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static get styles(): CSSResultGroup {
|
|
40
|
-
return css`
|
|
41
|
-
:host {
|
|
42
|
-
align-items: center;
|
|
43
|
-
display: flex;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.overlay {
|
|
47
|
-
border: 1px solid #2c2c2c;
|
|
48
|
-
border-radius: 1px;
|
|
49
|
-
position: absolute;
|
|
50
|
-
right: 0;
|
|
51
|
-
left: 0;
|
|
52
|
-
top: 50%;
|
|
53
|
-
transform: translate(0px, -50%);
|
|
54
|
-
width: auto;
|
|
55
|
-
height: auto;
|
|
56
|
-
padding: 5px;
|
|
57
|
-
background-color: #fffecb;
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
border-radius: 1px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.icon-overlay {
|
|
64
|
-
width: 40px;
|
|
65
|
-
height: 40px;
|
|
66
|
-
display: inherit;
|
|
67
|
-
}
|
|
68
|
-
.text-overlay {
|
|
69
|
-
margin: 0;
|
|
70
|
-
vertical-align: bottom;
|
|
71
|
-
padding-left: 5px;
|
|
72
|
-
text-align: center;
|
|
73
|
-
color: #2c2c2c;
|
|
74
|
-
font-size: 1.4rem;
|
|
75
|
-
line-height: 2rem;
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
css,
|
|
3
|
-
CSSResultGroup,
|
|
4
|
-
html,
|
|
5
|
-
LitElement,
|
|
6
|
-
nothing,
|
|
7
|
-
TemplateResult,
|
|
8
|
-
} from 'lit';
|
|
9
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
10
|
-
import { msg } from '@lit/localize';
|
|
11
|
-
import { favoriteFilledIcon } from '../assets/img/icons/favorite-filled';
|
|
12
|
-
import { favoriteUnfilledIcon } from '../assets/img/icons/favorite-unfilled';
|
|
13
|
-
import { srOnlyStyle } from '../styles/sr-only';
|
|
14
|
-
|
|
15
|
-
@customElement('review-block')
|
|
16
|
-
export class ReviewBlock extends LitElement {
|
|
17
|
-
@property({ type: String }) title = '';
|
|
18
|
-
|
|
19
|
-
@property({ type: String }) body = '';
|
|
20
|
-
|
|
21
|
-
@property({ type: Number }) starRating = 0;
|
|
22
|
-
|
|
23
|
-
@property({ type: String }) viewSize = 'desktop';
|
|
24
|
-
|
|
25
|
-
render() {
|
|
26
|
-
if (!this.title && !this.body && !this.starRating) return nothing;
|
|
27
|
-
|
|
28
|
-
return html`
|
|
29
|
-
<div class="review-container">
|
|
30
|
-
<div class="snippet-view ${this.viewSize}">
|
|
31
|
-
${this.starsTemplate}
|
|
32
|
-
<p class="review-title">${this.title}</p>
|
|
33
|
-
<p class="review-body">${this.body}</p>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
private get starsTemplate(): TemplateResult | typeof nothing {
|
|
40
|
-
if (this.starRating <= 0) return nothing;
|
|
41
|
-
|
|
42
|
-
const numFilledStars = Math.min(5, this.starRating);
|
|
43
|
-
const numUnfilledStars = Math.min(5, 5 - this.starRating);
|
|
44
|
-
return html`
|
|
45
|
-
<div class="star-rating">
|
|
46
|
-
<span class="sr-only">${this.starRating} ${msg('out of 5 stars')}</span>
|
|
47
|
-
${Array(numFilledStars).fill(this.filledStarTemplate)}
|
|
48
|
-
${Array(numUnfilledStars).fill(this.unfilledStarTemplate)}
|
|
49
|
-
</div>
|
|
50
|
-
`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
private get filledStarTemplate(): TemplateResult {
|
|
54
|
-
return html`<span aria-hidden="true">${favoriteFilledIcon}</span>`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
private get unfilledStarTemplate(): TemplateResult {
|
|
58
|
-
return html`
|
|
59
|
-
<span class="unfilled-star" aria-hidden="true">
|
|
60
|
-
${favoriteUnfilledIcon}
|
|
61
|
-
</span>
|
|
62
|
-
`;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
static get styles(): CSSResultGroup {
|
|
66
|
-
return [
|
|
67
|
-
srOnlyStyle,
|
|
68
|
-
css`
|
|
69
|
-
.review-container {
|
|
70
|
-
display: flex;
|
|
71
|
-
flex-direction: row;
|
|
72
|
-
flex-wrap: wrap;
|
|
73
|
-
width: calc(100% - 10px);
|
|
74
|
-
border: 1px solid #ccc;
|
|
75
|
-
margin-top: var(--containerTopMargin, 10px);
|
|
76
|
-
margin-left: var(--containerLeftMargin, 0px);
|
|
77
|
-
padding: 5px;
|
|
78
|
-
box-sizing: border-box;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.review-title,
|
|
82
|
-
.review-body {
|
|
83
|
-
display: -webkit-box;
|
|
84
|
-
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
overflow-wrap: break-word;
|
|
87
|
-
word-break: break-word;
|
|
88
|
-
-webkit-line-clamp: var(--maxLines, 3);
|
|
89
|
-
-webkit-box-orient: vertical;
|
|
90
|
-
margin: 0;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.review-title {
|
|
94
|
-
font-size: 1.4rem;
|
|
95
|
-
line-height: 2rem;
|
|
96
|
-
max-height: 6rem;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.review-title > a[href] {
|
|
100
|
-
color: inherit;
|
|
101
|
-
text-decoration: none;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.review-title > a[href]:hover {
|
|
105
|
-
text-decoration: underline;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.review-body {
|
|
109
|
-
font-size: 1rem;
|
|
110
|
-
line-height: 1.4rem;
|
|
111
|
-
max-height: 4.2rem;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.star-rating svg {
|
|
115
|
-
width: 10px;
|
|
116
|
-
height: 10px;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.unfilled-star {
|
|
120
|
-
fill: #ccc;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.list {
|
|
124
|
-
margin: 0;
|
|
125
|
-
padding-left: 5px;
|
|
126
|
-
}
|
|
127
|
-
`,
|
|
128
|
-
];
|
|
129
|
-
}
|
|
130
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
css,
|
|
3
|
-
CSSResultGroup,
|
|
4
|
-
html,
|
|
5
|
-
LitElement,
|
|
6
|
-
nothing,
|
|
7
|
-
TemplateResult,
|
|
8
|
-
} from 'lit';
|
|
9
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
10
|
-
import { join } from 'lit/directives/join.js';
|
|
11
|
-
|
|
12
|
-
@customElement('text-snippet-block')
|
|
13
|
-
export class TextSnippetBlock extends LitElement {
|
|
14
|
-
@property({ type: Array }) snippets?: string[] = [];
|
|
15
|
-
|
|
16
|
-
@property({ type: String }) viewSize: string = 'desktop';
|
|
17
|
-
|
|
18
|
-
render() {
|
|
19
|
-
if (!this.snippets?.length) return html`${nothing}`;
|
|
20
|
-
|
|
21
|
-
return html`
|
|
22
|
-
<div class="container">
|
|
23
|
-
<div class="snippet-view ${this.viewSize}">
|
|
24
|
-
${this.ellipsisJoinedSnippets}
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
`;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* An array of HTML templates derived from the snippets, with ellipses inserted
|
|
32
|
-
* at the beginning, end, and between each pair of snippets.
|
|
33
|
-
*/
|
|
34
|
-
private get ellipsisJoinedSnippets(): TemplateResult {
|
|
35
|
-
return html`
|
|
36
|
-
… ${join(this.snippetTemplates, html` … `)} …
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Returns an array of HTML span templates containing this item's snippets with all of
|
|
42
|
-
* their `{{{triple-brace-delimited}}}` matches replaced by `<mark>HTML mark tags</mark>`.
|
|
43
|
-
*
|
|
44
|
-
* This approach safely avoids the use of `unsafeHTML` and leaves any existing HTML tags
|
|
45
|
-
* in the snippets intact (as inert text), rather than stripping them away with DOMPurify.
|
|
46
|
-
*
|
|
47
|
-
* Note on `<em>` vs. `<mark>`:
|
|
48
|
-
* The old search page snippets had search keywords demarcated with `<em>` tags.
|
|
49
|
-
* The `<mark>` tag is semantically more accurate for this use case than `<em>`,
|
|
50
|
-
* but screen-reader behavior may be different. `<em>` will likely be read in a
|
|
51
|
-
* different tone, while `<mark>` is often read no differently than ordinary text
|
|
52
|
-
* in many screen-readers (though there are ways to work around this if needed).
|
|
53
|
-
*/
|
|
54
|
-
private get snippetTemplates(): TemplateResult[] | undefined {
|
|
55
|
-
return this.snippets?.map(s => {
|
|
56
|
-
const matches = s.matchAll(/{{{(.+?)}}}/gs);
|
|
57
|
-
const templates: TemplateResult[] = [];
|
|
58
|
-
|
|
59
|
-
// Convert each match into an HTML template that includes:
|
|
60
|
-
// - Everything from the end of the previous match (or the beginning of the
|
|
61
|
-
// string) up to the current match, as raw text.
|
|
62
|
-
// - The current match (excluding the curly braces) wrapped in a `<mark>` tag.
|
|
63
|
-
let index = 0;
|
|
64
|
-
for (const match of matches) {
|
|
65
|
-
if (match.index != null) {
|
|
66
|
-
templates.push(html`
|
|
67
|
-
${s.slice(index, match.index)}
|
|
68
|
-
<mark>${match[1]}</mark>
|
|
69
|
-
`);
|
|
70
|
-
index = match.index + match[0].length;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Include any text from the last match to the end
|
|
75
|
-
templates.push(html`${s.slice(index)}`);
|
|
76
|
-
|
|
77
|
-
// Squash everything into a single span template
|
|
78
|
-
return html`<span>${templates}</span>`;
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
static get styles(): CSSResultGroup {
|
|
83
|
-
return css`
|
|
84
|
-
.container {
|
|
85
|
-
display: flex;
|
|
86
|
-
flex-direction: row;
|
|
87
|
-
flex-wrap: wrap;
|
|
88
|
-
width: calc(100% - 10px);
|
|
89
|
-
border-left: 5px solid #194880;
|
|
90
|
-
margin-top: var(--containerTopMargin, 10px);
|
|
91
|
-
margin-left: var(--containerLeftMargin, 0px);
|
|
92
|
-
border-radius: 3px;
|
|
93
|
-
box-sizing: border-box;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.snippet-view {
|
|
97
|
-
display: -webkit-box;
|
|
98
|
-
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
99
|
-
font-size: 14px;
|
|
100
|
-
overflow: hidden;
|
|
101
|
-
overflow-wrap: break-word;
|
|
102
|
-
-webkit-line-clamp: var(--maxLines, 3);
|
|
103
|
-
-webkit-box-orient: vertical;
|
|
104
|
-
margin-left: 5px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.grid {
|
|
108
|
-
font-size: 1.2rem;
|
|
109
|
-
line-height: 1.5rem;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.list {
|
|
113
|
-
margin: 0;
|
|
114
|
-
padding-left: 15px;
|
|
115
|
-
font-size: 1.4rem;
|
|
116
|
-
line-height: 2rem;
|
|
117
|
-
|
|
118
|
-
/*
|
|
119
|
-
* Safari doesn't always respect the line-clamping rules,
|
|
120
|
-
* so we add this to ensure these fields still get truncated.
|
|
121
|
-
*/
|
|
122
|
-
max-height: 6rem;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
mark {
|
|
126
|
-
/* blue, 20% transparency */
|
|
127
|
-
background-color: #0000ff33;
|
|
128
|
-
color: inherit;
|
|
129
|
-
}
|
|
130
|
-
`;
|
|
131
|
-
}
|
|
132
|
-
}
|