@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
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { expect } from '@open-wc/testing';
|
|
2
|
-
import { formatCount } from '../../src/utils/format-count';
|
|
3
|
-
|
|
4
|
-
const testCount = 805342;
|
|
5
|
-
|
|
6
|
-
describe('formatCount', () => {
|
|
7
|
-
it('returns blank when undefined number', () => {
|
|
8
|
-
expect(formatCount(undefined)).to.equal('');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('returns blank when negative number', () => {
|
|
12
|
-
expect(formatCount(testCount * -1)).to.equal('');
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('returns long number when no NumberFormat', () => {
|
|
16
|
-
expect(formatCount(testCount)).to.equal('805,342');
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('returns short number when short NumberFormat', () => {
|
|
20
|
-
expect(formatCount(testCount, 'short')).to.equal('805K');
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('returns decimal when value of significant digits < 10', () => {
|
|
24
|
-
expect(formatCount(testCount * 10, 'short', 'long')).to.equal(
|
|
25
|
-
'8.1 million',
|
|
26
|
-
);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('returns locale formatted number', () => {
|
|
30
|
-
expect(formatCount(testCount, 'long', 'long', 'de-DE')).to.equal('805.342');
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { expect } from '@open-wc/testing';
|
|
2
|
-
import { formatDate } from '../../src/utils/format-date';
|
|
3
|
-
|
|
4
|
-
const testDate = new Date(2020, 11, 9);
|
|
5
|
-
|
|
6
|
-
describe('formatDate', () => {
|
|
7
|
-
it('returns blank when undefined date', () => {
|
|
8
|
-
expect(formatDate(undefined)).to.equal('');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('returns short date when no DateFormat', () => {
|
|
12
|
-
expect(formatDate(testDate)).to.equal('Dec 2020');
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('returns long date when long DateFormat', () => {
|
|
16
|
-
expect(formatDate(testDate, 'long')).to.equal('Dec 09, 2020');
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('returns year-only date when year-only DateFormat', () => {
|
|
20
|
-
expect(formatDate(testDate, 'year-only')).to.equal('2020');
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('returns correct year for old "Jan 1 at midnight" dates and year-only DateFormat', () => {
|
|
24
|
-
// Many standard timezones have a discontinuity in date parsing at some point during
|
|
25
|
-
// the 19th or 20th century, corresponding to the creation of the timezone.
|
|
26
|
-
// Dates prior to the discontinuity generally have a non-hour-aligned timezone offset
|
|
27
|
-
// which can throw off the calculated year for dates which are close to a year boundary.
|
|
28
|
-
// This is particularly problematic for "Jan 1 at midnight" dates, which are what we
|
|
29
|
-
// receive from the search engine for date metadata that only specifies the year.
|
|
30
|
-
// So we must ensure these older dates still output the correct year, not the prior one.
|
|
31
|
-
expect(formatDate(new Date('1234-01-01T00:00:00Z'), 'year-only')).to.equal(
|
|
32
|
-
'1234',
|
|
33
|
-
);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('uses UTC time zone by default or when useLocalTime is explicitly false', () => {
|
|
37
|
-
// Default options
|
|
38
|
-
expect(formatDate(new Date('2025-02-15T00:00:00Z'), 'long')).to.equal(
|
|
39
|
-
'Feb 15, 2025',
|
|
40
|
-
);
|
|
41
|
-
expect(formatDate(new Date('2025-02-15T23:59:59Z'), 'long')).to.equal(
|
|
42
|
-
'Feb 15, 2025',
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
// Explicit `useLocalTime: false` option
|
|
46
|
-
const options = { useLocalTime: false };
|
|
47
|
-
expect(
|
|
48
|
-
formatDate(new Date('2025-02-15T00:00:00Z'), 'long', options),
|
|
49
|
-
).to.equal('Feb 15, 2025');
|
|
50
|
-
expect(
|
|
51
|
-
formatDate(new Date('2025-02-15T23:59:59Z'), 'long', options),
|
|
52
|
-
).to.equal('Feb 15, 2025');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('uses local time zone when specified', () => {
|
|
56
|
-
// N.B.:
|
|
57
|
-
// - Positive offset corresponds to UTC-x zones
|
|
58
|
-
// - Negative offset corresponds to UTC+x zones
|
|
59
|
-
const offset = new Date().getTimezoneOffset();
|
|
60
|
-
const options = { useLocalTime: true };
|
|
61
|
-
|
|
62
|
-
// The expected behavior depends on the local time where the tests are run:
|
|
63
|
-
if (offset > 0) {
|
|
64
|
-
// If we're testing under a positive offset, the first second of the UTC day should locally fall on the previous day
|
|
65
|
-
expect(
|
|
66
|
-
formatDate(new Date('2025-02-15T00:00:00Z'), 'long', options),
|
|
67
|
-
).to.equal('Feb 14, 2025');
|
|
68
|
-
} else if (offset < 0) {
|
|
69
|
-
// If we're testing under a negative offset, the last second of the UTC day should locally fall on the next day
|
|
70
|
-
expect(
|
|
71
|
-
formatDate(new Date('2025-02-15T23:59:59Z'), 'long', options),
|
|
72
|
-
).to.equal('Feb 16, 2025');
|
|
73
|
-
} else {
|
|
74
|
-
// If we're testing *in* UTC, then both seconds should locally fall on the same day
|
|
75
|
-
expect(
|
|
76
|
-
formatDate(new Date('2025-02-15T00:00:00Z'), 'long', options),
|
|
77
|
-
).to.equal('Feb 15, 2025');
|
|
78
|
-
expect(
|
|
79
|
-
formatDate(new Date('2025-02-15T23:59:59Z'), 'long', options),
|
|
80
|
-
).to.equal('Feb 15, 2025');
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('returns locale formatted date', () => {
|
|
85
|
-
expect(formatDate(testDate, 'long', { locale: 'de-DE' })).to.equal(
|
|
86
|
-
'09. Dez. 2020',
|
|
87
|
-
);
|
|
88
|
-
});
|
|
89
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { expect } from '@open-wc/testing';
|
|
2
|
-
import { nothing } from 'lit';
|
|
3
|
-
import { formatUnitSize } from '../../src/utils/format-unit-size';
|
|
4
|
-
|
|
5
|
-
describe('formatUnitSize', () => {
|
|
6
|
-
it('returns blank when undefined number', () => {
|
|
7
|
-
expect(formatUnitSize(undefined, 1)).to.equal(nothing);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('returns collection data is in singular form', () => {
|
|
11
|
-
expect(formatUnitSize(1025, 1)).to.equal('1 kilobyte');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('return collection size data in kilobytes and plural form', () => {
|
|
15
|
-
expect(formatUnitSize(15000, 1)).to.equal('14.6 kilobytes');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('return huge collection size data', () => {
|
|
19
|
-
expect(formatUnitSize(454154654134, 1)).to.equal('423 gigabytes');
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { expect } from '@open-wc/testing';
|
|
2
|
-
import {
|
|
3
|
-
localDateFromUTC,
|
|
4
|
-
isFirstMillisecondOfUTCYear,
|
|
5
|
-
} from '../../src/utils/local-date-from-utc';
|
|
6
|
-
|
|
7
|
-
describe('localDateFromUTC', () => {
|
|
8
|
-
it('converts dates from UTC to local timezone', async () => {
|
|
9
|
-
const date = new Date(1990, 1, 2, 3, 4, 5, 6);
|
|
10
|
-
const dateFromUTC = new Date(Date.UTC(1990, 1, 2, 3, 4, 5, 6));
|
|
11
|
-
expect(localDateFromUTC(date).toISOString()).to.equal(
|
|
12
|
-
dateFromUTC.toISOString(),
|
|
13
|
-
);
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe('isFirstMillisecondOfUTCYear', () => {
|
|
18
|
-
it('returns true when date is exactly Jan 1 at midnight in UTC', async () => {
|
|
19
|
-
const midnightOnNewYearsDay = new Date('2010-01-01T00:00:00Z');
|
|
20
|
-
expect(isFirstMillisecondOfUTCYear(midnightOnNewYearsDay)).to.be.true;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('returns false when date is not exactly Jan 1 at midnight in UTC', async () => {
|
|
24
|
-
const oneMillisecondTooEarly = new Date('2009-12-31T23:59:59.999Z');
|
|
25
|
-
expect(isFirstMillisecondOfUTCYear(oneMillisecondTooEarly)).to.be.false;
|
|
26
|
-
|
|
27
|
-
const oneMillisecondTooLate = new Date('2010-01-01T00:00:00.001Z');
|
|
28
|
-
expect(isFirstMillisecondOfUTCYear(oneMillisecondTooLate)).to.be.false;
|
|
29
|
-
|
|
30
|
-
const middleOfTheYear = new Date('2010-06-01T00:00:00Z');
|
|
31
|
-
expect(isFirstMillisecondOfUTCYear(middleOfTheYear)).to.be.false;
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('returns false when no date provided', async () => {
|
|
35
|
-
expect(isFirstMillisecondOfUTCYear(undefined)).to.be.false;
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { expect } from '@open-wc/testing';
|
|
2
|
-
import {
|
|
3
|
-
filterTextIncludes,
|
|
4
|
-
normalizeFilterText,
|
|
5
|
-
} from '../../src/utils/normalize-filter-text';
|
|
6
|
-
|
|
7
|
-
/** Whether filtering for `filter` would find `text` */
|
|
8
|
-
function finds(text: string, filter: string): boolean {
|
|
9
|
-
return filterTextIncludes(
|
|
10
|
-
normalizeFilterText(text),
|
|
11
|
-
normalizeFilterText(filter),
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
describe('normalizeFilterText', () => {
|
|
16
|
-
it('lowercases text', () => {
|
|
17
|
-
expect(normalizeFilterText('Puppies')).to.deep.equal({
|
|
18
|
-
spaced: 'puppies',
|
|
19
|
-
joined: 'puppies',
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('removes punctuation other than word joiners', () => {
|
|
24
|
-
expect(normalizeFilterText('A.O.R.').spaced).to.equal('aor');
|
|
25
|
-
expect(normalizeFilterText('Dr. Drew').spaced).to.equal('dr drew');
|
|
26
|
-
expect(normalizeFilterText("Children's books").spaced).to.equal(
|
|
27
|
-
'childrens books',
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('turns word joiners into spaces in one form and removes them in the other', () => {
|
|
32
|
-
expect(normalizeFilterText('WC-TV')).to.deep.equal({
|
|
33
|
-
spaced: 'wc tv',
|
|
34
|
-
joined: 'wctv',
|
|
35
|
-
});
|
|
36
|
-
expect(normalizeFilterText('AC/DC')).to.deep.equal({
|
|
37
|
-
spaced: 'ac dc',
|
|
38
|
-
joined: 'acdc',
|
|
39
|
-
});
|
|
40
|
-
expect(normalizeFilterText('snake_case')).to.deep.equal({
|
|
41
|
-
spaced: 'snake case',
|
|
42
|
-
joined: 'snakecase',
|
|
43
|
-
});
|
|
44
|
-
expect(normalizeFilterText('1950–1960').spaced).to.equal('1950 1960');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('removes accents', () => {
|
|
48
|
-
expect(normalizeFilterText('Café Müller').spaced).to.equal('cafe muller');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('collapses and trims whitespace', () => {
|
|
52
|
-
expect(normalizeFilterText(' Dogs -- Fiction ')).to.deep.equal({
|
|
53
|
-
spaced: 'dogs fiction',
|
|
54
|
-
joined: 'dogs fiction',
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('keeps symbols that carry meaning', () => {
|
|
59
|
-
expect(normalizeFilterText('C++').spaced).to.equal('c++');
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('reduces text that is only punctuation to nothing', () => {
|
|
63
|
-
expect(normalizeFilterText('...')).to.deep.equal({
|
|
64
|
-
spaced: '',
|
|
65
|
-
joined: '',
|
|
66
|
-
});
|
|
67
|
-
expect(normalizeFilterText(' - ').spaced).to.equal('');
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
describe('filterTextIncludes', () => {
|
|
72
|
-
it('matches hyphenated words typed apart or together', () => {
|
|
73
|
-
expect(finds('WC-TV', 'wc tv')).to.be.true;
|
|
74
|
-
expect(finds('WC-TV', 'wctv')).to.be.true;
|
|
75
|
-
expect(finds('WC-TV', 'wc-tv')).to.be.true;
|
|
76
|
-
expect(finds('Human-animal relationships', 'human animal')).to.be.true;
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('matches regardless of other punctuation', () => {
|
|
80
|
-
expect(finds('A.O.R.', 'aor')).to.be.true;
|
|
81
|
-
expect(finds('Dr. Drew', 'dr drew')).to.be.true;
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it("doesn't match words that are apart in the value but typed together", () => {
|
|
85
|
-
expect(finds('WC TV', 'wctv')).to.be.false;
|
|
86
|
-
});
|
|
87
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"noEmitOnError": true,
|
|
7
|
-
"lib": [
|
|
8
|
-
"ESNext",
|
|
9
|
-
"dom",
|
|
10
|
-
"dom.iterable"
|
|
11
|
-
],
|
|
12
|
-
"strict": true,
|
|
13
|
-
"esModuleInterop": false,
|
|
14
|
-
"allowSyntheticDefaultImports": true,
|
|
15
|
-
"experimentalDecorators": true,
|
|
16
|
-
"importHelpers": true,
|
|
17
|
-
"outDir": "dist",
|
|
18
|
-
"sourceMap": true,
|
|
19
|
-
"inlineSources": true,
|
|
20
|
-
"rootDir": "./",
|
|
21
|
-
"declaration": true,
|
|
22
|
-
"useDefineForClassFields": false,
|
|
23
|
-
},
|
|
24
|
-
"include": ["src", "test", "index.ts", "types"],
|
|
25
|
-
}
|
package/types/dompurify.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module 'dompurify';
|
package/vite.config.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import { resolve } from 'path';
|
|
3
|
-
import basicSsl from '@vitejs/plugin-basic-ssl';
|
|
4
|
-
|
|
5
|
-
// https://vitejs.dev/config/
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
base: '',
|
|
8
|
-
build: {
|
|
9
|
-
outDir: 'ghpages',
|
|
10
|
-
manifest: true,
|
|
11
|
-
rollupOptions: {
|
|
12
|
-
input: {
|
|
13
|
-
main: resolve(__dirname, 'index.html'),
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
server: {
|
|
18
|
-
host: 'local.archive.org',
|
|
19
|
-
port: 8080,
|
|
20
|
-
open: true,
|
|
21
|
-
cors: true,
|
|
22
|
-
},
|
|
23
|
-
plugins: [
|
|
24
|
-
basicSsl({
|
|
25
|
-
name: 'archive-dev',
|
|
26
|
-
domains: ['local.archive.org'],
|
|
27
|
-
}),
|
|
28
|
-
],
|
|
29
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
-
|
|
3
|
-
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
-
const hmr = process.argv.includes('--hmr');
|
|
5
|
-
|
|
6
|
-
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
-
nodeResolve: true,
|
|
8
|
-
open: '/',
|
|
9
|
-
watch: !hmr,
|
|
10
|
-
|
|
11
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
12
|
-
// esbuildTarget: 'auto'
|
|
13
|
-
|
|
14
|
-
/** Set appIndex to enable SPA routing */
|
|
15
|
-
// appIndex: 'demo/index.html',
|
|
16
|
-
|
|
17
|
-
/** Confgure bare import resolve plugin */
|
|
18
|
-
// nodeResolve: {
|
|
19
|
-
// exportConditions: ['browser', 'development']
|
|
20
|
-
// },
|
|
21
|
-
|
|
22
|
-
plugins: [
|
|
23
|
-
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
24
|
-
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
25
|
-
],
|
|
26
|
-
|
|
27
|
-
http2: true,
|
|
28
|
-
sslCert: './local.archive.org.cert',
|
|
29
|
-
sslKey: './local.archive.org.key',
|
|
30
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import rollupImage from '@rollup/plugin-image';
|
|
2
|
-
import { rollupAdapter } from '@web/dev-server-rollup';
|
|
3
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
4
|
-
|
|
5
|
-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
6
|
-
|
|
7
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
8
|
-
/** Test files to run */
|
|
9
|
-
files: 'dist/test/**/*.test.js',
|
|
10
|
-
|
|
11
|
-
/** Resolve bare module imports */
|
|
12
|
-
nodeResolve: {
|
|
13
|
-
exportConditions: ['browser', 'development'],
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
mimeTypes: {
|
|
17
|
-
'**/*.scss': 'js',
|
|
18
|
-
'**/*.css': 'js',
|
|
19
|
-
'**/*.svg': 'js',
|
|
20
|
-
'**/*.json': 'js',
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
/** Filter out lit dev mode logs */
|
|
24
|
-
filterBrowserLogs(log) {
|
|
25
|
-
for (const arg of log.args) {
|
|
26
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
plugins: [rollupAdapter(rollupImage())],
|
|
34
|
-
|
|
35
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
36
|
-
// esbuildTarget: 'auto',
|
|
37
|
-
|
|
38
|
-
/** Amount of browsers to run concurrently */
|
|
39
|
-
// concurrentBrowsers: 2,
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Amount of test files per browser to test concurrently. Files run in
|
|
43
|
-
* browser tabs, and Chrome doesn't render tabs in the background, so they
|
|
44
|
-
* get no animation frames or ResizeObserver callbacks. Running one at a time
|
|
45
|
-
* keeps each in the foreground (and is faster than the throttled default).
|
|
46
|
-
*/
|
|
47
|
-
concurrency: 1,
|
|
48
|
-
|
|
49
|
-
/** Browsers to run tests on */
|
|
50
|
-
// browsers: [
|
|
51
|
-
// playwrightLauncher({ product: 'chromium' }),
|
|
52
|
-
// playwrightLauncher({ product: 'firefox' }),
|
|
53
|
-
// playwrightLauncher({ product: 'webkit' }),
|
|
54
|
-
// ],
|
|
55
|
-
|
|
56
|
-
// See documentation for all available options
|
|
57
|
-
});
|