@internetarchive/collection-browser 4.7.0 → 4.8.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/.husky/pre-commit +0 -0
- package/dist/src/app-root.js +0 -2
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/assets/img/icons/check.d.ts +2 -0
- package/dist/src/assets/img/icons/check.js +5 -0
- package/dist/src/assets/img/icons/check.js.map +1 -0
- package/dist/src/collection-facets/facet-row-template.d.ts +38 -0
- package/dist/src/collection-facets/facet-row-template.js +200 -0
- package/dist/src/collection-facets/facet-row-template.js.map +1 -0
- package/dist/src/collection-facets/facet-row.js +11 -186
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/models.d.ts +7 -2
- package/dist/src/collection-facets/models.js +7 -2
- package/dist/src/collection-facets/models.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +87 -21
- package/dist/src/collection-facets/more-facets-content.js +477 -200
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-scroller.d.ts +85 -0
- package/dist/src/collection-facets/more-facets-scroller.js +428 -0
- package/dist/src/collection-facets/more-facets-scroller.js.map +1 -0
- package/dist/src/collection-facets/page-window.d.ts +73 -0
- package/dist/src/collection-facets/page-window.js +202 -0
- package/dist/src/collection-facets/page-window.js.map +1 -0
- package/dist/src/collection-facets/toggle-switch.js +1 -0
- package/dist/src/collection-facets/toggle-switch.js.map +1 -1
- package/dist/src/models.d.ts +4 -0
- package/dist/src/models.js +16 -0
- package/dist/src/models.js.map +1 -1
- package/dist/src/utils/log.d.ts +1 -4
- package/dist/src/utils/normalize-filter-text.d.ts +28 -0
- package/dist/src/utils/normalize-filter-text.js +35 -0
- package/dist/src/utils/normalize-filter-text.js.map +1 -0
- package/dist/test/collection-facets/more-facets-content.test.js +367 -17
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-scroller.test.d.ts +1 -0
- package/dist/test/collection-facets/more-facets-scroller.test.js +288 -0
- package/dist/test/collection-facets/more-facets-scroller.test.js.map +1 -0
- package/dist/test/collection-facets/page-window.test.d.ts +1 -0
- package/dist/test/collection-facets/page-window.test.js +175 -0
- package/dist/test/collection-facets/page-window.test.js.map +1 -0
- package/dist/test/mocks/mock-search-responses.d.ts +6 -0
- package/dist/test/mocks/mock-search-responses.js +52 -0
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.js +2 -1
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/utils/normalize-filter-text.test.d.ts +1 -0
- package/dist/test/utils/normalize-filter-text.test.js +69 -0
- package/dist/test/utils/normalize-filter-text.test.js.map +1 -0
- package/docs/design/column-virtualization.md +214 -0
- package/package.json +20 -16
- package/src/app-root.ts +0 -2
- package/src/assets/img/icons/check.ts +5 -0
- package/src/collection-facets/facet-row-template.ts +242 -0
- package/src/collection-facets/facet-row.ts +15 -202
- package/src/collection-facets/models.ts +8 -2
- package/src/collection-facets/more-facets-content.ts +528 -221
- package/src/collection-facets/more-facets-scroller.ts +485 -0
- package/src/collection-facets/page-window.ts +247 -0
- package/src/collection-facets/toggle-switch.ts +1 -0
- package/src/models.ts +17 -0
- package/src/utils/normalize-filter-text.ts +54 -0
- package/test/collection-facets/more-facets-content.test.ts +509 -24
- package/test/collection-facets/more-facets-scroller.test.ts +401 -0
- package/test/collection-facets/page-window.test.ts +208 -0
- package/test/mocks/mock-search-responses.ts +56 -0
- package/test/mocks/mock-search-service.ts +2 -0
- package/test/utils/normalize-filter-text.test.ts +87 -0
- package/web-test-runner.config.mjs +7 -2
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.editorconfig +0 -29
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.github/workflows/ci.yml +0 -27
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.github/workflows/gh-pages-main.yml +0 -39
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.github/workflows/npm-publish.yml +0 -39
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.github/workflows/pr-preview.yml +0 -38
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.husky/pre-commit +0 -1
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.prettierignore +0 -1
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/LICENSE +0 -661
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/README.md +0 -84
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/eslint.config.mjs +0 -53
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/index.html +0 -24
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/index.ts +0 -29
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/local.archive.org.cert +0 -86
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/local.archive.org.key +0 -27
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/package.json +0 -120
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/renovate.json +0 -6
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/app-root.ts +0 -1284
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/arrow-left.ts +0 -10
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/arrow-right.ts +0 -10
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/chevron.ts +0 -4
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/close-circle-dark.ts +0 -5
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/contract.ts +0 -9
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/empty-query.ts +0 -5
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/expand.ts +0 -9
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/eye-closed.ts +0 -5
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/eye.ts +0 -5
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/favorite-filled.ts +0 -10
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/favorite-unfilled.ts +0 -9
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/filter.ts +0 -10
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/login-required.ts +0 -18
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/account.ts +0 -14
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/audio.ts +0 -14
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/collection.ts +0 -12
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/data.ts +0 -15
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/etree.ts +0 -14
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/film.ts +0 -14
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/images.ts +0 -13
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/radio.ts +0 -15
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/search.ts +0 -14
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/software.ts +0 -13
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/texts.ts +0 -13
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/tv.ts +0 -14
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/video.ts +0 -14
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/web.ts +0 -13
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/null-result.ts +0 -5
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/quote.ts +0 -7
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/restricted.ts +0 -13
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/reviews.ts +0 -11
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/upload.ts +0 -12
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/views.ts +0 -11
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/circular-activity-indicator.ts +0 -64
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-browser.ts +0 -3165
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/facet-row.ts +0 -309
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/facet-tombstone-row.ts +0 -40
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/facets-template.ts +0 -85
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/models.ts +0 -10
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/more-facets-content.ts +0 -644
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/more-facets-pagination.ts +0 -294
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/dedupe.ts +0 -44
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/models.ts +0 -36
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/toggle-switch.ts +0 -174
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets.ts +0 -1013
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/data-source/collection-browser-data-source-interface.ts +0 -351
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/data-source/collection-browser-data-source.ts +0 -1474
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/data-source/collection-browser-query-state.ts +0 -60
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/data-source/models.ts +0 -56
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/empty-placeholder.ts +0 -192
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/expanded-date-picker.ts +0 -191
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/language-code-handler/language-code-handler.ts +0 -64
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/language-code-handler/language-code-mapping.ts +0 -564
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/manage/manage-bar.ts +0 -276
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/manage/remove-items-modal-content.ts +0 -102
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/mediatype/mediatype-config.ts +0 -146
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/models.ts +0 -895
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/restoration-state-handler.ts +0 -550
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/alpha-bar.ts +0 -252
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/compact.ts +0 -5
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/list.ts +0 -5
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/sort-triangle.ts +0 -5
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/tile.ts +0 -5
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/sort-filter-bar.ts +0 -733
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/styles/ia-button.ts +0 -139
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/styles/item-image-styles.ts +0 -124
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/styles/sr-only.ts +0 -18
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/styles/tile-action-styles.ts +0 -59
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/base-tile-component.ts +0 -124
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/collection-browser-loading-tile.ts +0 -26
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/account-tile.ts +0 -113
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/collection-tile.ts +0 -184
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/item-tile.ts +0 -347
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/search-tile.ts +0 -90
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/tile-stats.ts +0 -211
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/hover/hover-pane-controller.ts +0 -638
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/hover/tile-hover-pane.ts +0 -184
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/image-block.ts +0 -162
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/item-image.ts +0 -214
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/list/tile-list-compact-header.ts +0 -112
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/list/tile-list-compact.ts +0 -278
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/list/tile-list.ts +0 -718
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/models.ts +0 -21
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/overlay/icon-overlay.ts +0 -57
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/overlay/text-overlay.ts +0 -79
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/review-block.ts +0 -130
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/text-snippet-block.ts +0 -132
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/tile-dispatcher.ts +0 -637
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/tile-display-value-provider.ts +0 -133
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/tile-mediatype-icon.ts +0 -133
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/analytics-events.ts +0 -29
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/array-equals.ts +0 -8
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/collapse-repeated-quotes.ts +0 -13
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/date-filter-field.ts +0 -11
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/facet-utils.ts +0 -183
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/format-count.ts +0 -95
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/format-date.ts +0 -62
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/format-unit-size.ts +0 -43
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/local-date-from-utc.ts +0 -15
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/log.ts +0 -14
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/resolve-mediatype.ts +0 -26
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/sha1.ts +0 -9
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-browser.test.ts +0 -2639
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/facet-row.test.ts +0 -421
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/facets-template.test.ts +0 -139
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/more-facets-content.test.ts +0 -231
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/more-facets-pagination.test.ts +0 -201
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/toggle-switch.test.ts +0 -164
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets.test.ts +0 -928
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/data-source/collection-browser-data-source.test.ts +0 -193
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/empty-placeholder.test.ts +0 -88
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/expanded-date-picker.test.ts +0 -201
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/icon-overlay.test.ts +0 -38
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/image-block.test.ts +0 -247
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/item-image.test.ts +0 -220
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/manage/manage-bar.test.ts +0 -347
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/manage/remove-items-modal-content.test.ts +0 -81
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/mediatype-config.test.ts +0 -11
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/mocks/mock-analytics-handler.ts +0 -30
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/mocks/mock-search-responses.ts +0 -1364
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/mocks/mock-search-service.ts +0 -134
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/restoration-state-handler.test.ts +0 -480
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/review-block.test.ts +0 -62
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/sort-filter-bar/alpha-bar.test.ts +0 -101
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/sort-filter-bar/sort-filter-bar.test.ts +0 -443
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/text-overlay.test.ts +0 -55
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/text-snippet-block.test.ts +0 -85
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tile-stats.test.ts +0 -191
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/grid/account-tile.test.ts +0 -121
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/grid/collection-tile.test.ts +0 -114
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/grid/item-tile.test.ts +0 -520
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/grid/search-tile.test.ts +0 -75
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/hover/hover-pane-controller.test.ts +0 -482
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/hover/tile-hover-pane.test.ts +0 -80
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/list/tile-list-compact-header.test.ts +0 -43
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/list/tile-list-compact.test.ts +0 -282
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/list/tile-list.test.ts +0 -576
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/tile-dispatcher.test.ts +0 -320
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/tile-display-value-provider.test.ts +0 -172
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/tile-mediatype-icon.test.ts +0 -160
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/array-equals.test.ts +0 -31
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/format-count.test.ts +0 -32
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/format-date.test.ts +0 -89
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/format-unit-size.test.ts +0 -21
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/local-date-from-utc.test.ts +0 -37
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/tsconfig.json +0 -25
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/types/dompurify.d.ts +0 -1
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/vite.config.ts +0 -29
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/web-dev-server.config.mjs +0 -30
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/web-test-runner.config.mjs +0 -52
- package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/yarn.lock +0 -5965
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.editorconfig +0 -29
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.github/workflows/ci.yml +0 -29
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.github/workflows/gh-pages-main.yml +0 -41
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.github/workflows/npm-publish.yml +0 -49
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.github/workflows/pr-preview.yml +0 -40
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.husky/pre-commit +0 -1
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.prettierignore +0 -1
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/LICENSE +0 -661
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/README.md +0 -68
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/eslint.config.mjs +0 -53
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/index.html +0 -24
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/index.ts +0 -29
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/local.archive.org.cert +0 -86
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/local.archive.org.key +0 -27
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/package.json +0 -129
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/pnpm-lock.yaml +0 -7366
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/pnpm-workspace.yaml +0 -46
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/renovate.json +0 -6
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/app-root.ts +0 -1284
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/arrow-left.ts +0 -10
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/arrow-right.ts +0 -10
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/chevron.ts +0 -4
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/close-circle-dark.ts +0 -5
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/contract.ts +0 -9
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/empty-query.ts +0 -5
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/expand.ts +0 -9
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/eye-closed.ts +0 -5
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/eye.ts +0 -5
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/favorite-filled.ts +0 -10
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/favorite-unfilled.ts +0 -9
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/filter.ts +0 -10
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/login-required.ts +0 -18
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/account.ts +0 -14
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/audio.ts +0 -14
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/collection.ts +0 -12
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/data.ts +0 -15
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/etree.ts +0 -14
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/film.ts +0 -14
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/images.ts +0 -13
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/radio.ts +0 -15
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/search.ts +0 -14
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/software.ts +0 -13
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/texts.ts +0 -13
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/tv.ts +0 -14
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/video.ts +0 -14
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/web.ts +0 -13
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/null-result.ts +0 -5
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/quote.ts +0 -7
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/restricted.ts +0 -13
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/reviews.ts +0 -11
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/upload.ts +0 -12
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/views.ts +0 -11
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/circular-activity-indicator.ts +0 -64
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-browser.ts +0 -3165
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/facet-row.ts +0 -309
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/facet-tombstone-row.ts +0 -40
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/facets-template.ts +0 -85
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/models.ts +0 -10
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/more-facets-content.ts +0 -644
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/more-facets-pagination.ts +0 -294
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/dedupe.ts +0 -44
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/models.ts +0 -36
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/toggle-switch.ts +0 -174
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets.ts +0 -1013
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/data-source/collection-browser-data-source-interface.ts +0 -351
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/data-source/collection-browser-data-source.ts +0 -1474
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/data-source/collection-browser-query-state.ts +0 -60
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/data-source/models.ts +0 -56
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/empty-placeholder.ts +0 -192
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/expanded-date-picker.ts +0 -191
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/language-code-handler/language-code-handler.ts +0 -64
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/language-code-handler/language-code-mapping.ts +0 -564
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/manage/manage-bar.ts +0 -276
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/manage/remove-items-modal-content.ts +0 -102
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/mediatype/mediatype-config.ts +0 -146
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/models.ts +0 -895
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/restoration-state-handler.ts +0 -550
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/alpha-bar.ts +0 -252
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/compact.ts +0 -5
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/list.ts +0 -5
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/sort-triangle.ts +0 -5
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/tile.ts +0 -5
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/sort-filter-bar.ts +0 -733
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/styles/ia-button.ts +0 -139
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/styles/item-image-styles.ts +0 -124
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/styles/sr-only.ts +0 -18
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/styles/tile-action-styles.ts +0 -59
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/base-tile-component.ts +0 -124
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/collection-browser-loading-tile.ts +0 -26
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/account-tile.ts +0 -113
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/collection-tile.ts +0 -184
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/item-tile.ts +0 -347
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/search-tile.ts +0 -90
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/tile-stats.ts +0 -211
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/hover/hover-pane-controller.ts +0 -638
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/hover/tile-hover-pane.ts +0 -184
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/image-block.ts +0 -162
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/item-image.ts +0 -214
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/list/tile-list-compact-header.ts +0 -112
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/list/tile-list-compact.ts +0 -278
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/list/tile-list.ts +0 -718
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/models.ts +0 -21
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/overlay/icon-overlay.ts +0 -57
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/overlay/text-overlay.ts +0 -79
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/review-block.ts +0 -130
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/text-snippet-block.ts +0 -132
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/tile-dispatcher.ts +0 -637
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/tile-display-value-provider.ts +0 -133
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/tile-mediatype-icon.ts +0 -133
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/analytics-events.ts +0 -29
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/array-equals.ts +0 -8
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/collapse-repeated-quotes.ts +0 -13
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/date-filter-field.ts +0 -11
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/facet-utils.ts +0 -183
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/format-count.ts +0 -95
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/format-date.ts +0 -62
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/format-unit-size.ts +0 -43
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/local-date-from-utc.ts +0 -15
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/log.ts +0 -14
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/resolve-mediatype.ts +0 -26
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/sha1.ts +0 -9
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-browser.test.ts +0 -2639
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/facet-row.test.ts +0 -421
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/facets-template.test.ts +0 -139
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/more-facets-content.test.ts +0 -231
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/more-facets-pagination.test.ts +0 -201
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/toggle-switch.test.ts +0 -164
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets.test.ts +0 -928
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/data-source/collection-browser-data-source.test.ts +0 -193
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/empty-placeholder.test.ts +0 -88
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/expanded-date-picker.test.ts +0 -201
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/icon-overlay.test.ts +0 -38
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/image-block.test.ts +0 -247
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/item-image.test.ts +0 -220
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/manage/manage-bar.test.ts +0 -347
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/manage/remove-items-modal-content.test.ts +0 -81
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/mediatype-config.test.ts +0 -11
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/mocks/mock-analytics-handler.ts +0 -30
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/mocks/mock-search-responses.ts +0 -1364
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/mocks/mock-search-service.ts +0 -134
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/restoration-state-handler.test.ts +0 -480
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/review-block.test.ts +0 -62
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/sort-filter-bar/alpha-bar.test.ts +0 -101
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/sort-filter-bar/sort-filter-bar.test.ts +0 -443
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/text-overlay.test.ts +0 -55
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/text-snippet-block.test.ts +0 -85
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tile-stats.test.ts +0 -191
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/grid/account-tile.test.ts +0 -121
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/grid/collection-tile.test.ts +0 -114
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/grid/item-tile.test.ts +0 -520
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/grid/search-tile.test.ts +0 -75
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/hover/hover-pane-controller.test.ts +0 -482
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/hover/tile-hover-pane.test.ts +0 -80
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/list/tile-list-compact-header.test.ts +0 -43
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/list/tile-list-compact.test.ts +0 -282
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/list/tile-list.test.ts +0 -576
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/tile-dispatcher.test.ts +0 -320
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/tile-display-value-provider.test.ts +0 -172
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/tile-mediatype-icon.test.ts +0 -160
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/array-equals.test.ts +0 -31
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/format-count.test.ts +0 -32
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/format-date.test.ts +0 -89
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/format-unit-size.test.ts +0 -21
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/local-date-from-utc.test.ts +0 -37
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/tsconfig.json +0 -25
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/types/dompurify.d.ts +0 -1
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/vite.config.ts +0 -29
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/web-dev-server.config.mjs +0 -30
- package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/web-test-runner.config.mjs +0 -52
- package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -36
- package/dist/src/collection-facets/more-facets-pagination.js +0 -260
- package/dist/src/collection-facets/more-facets-pagination.js.map +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +0 -126
- package/dist/test/collection-facets/more-facets-pagination.test.js.map +0 -1
- package/src/collection-facets/more-facets-pagination.ts +0 -294
- package/test/collection-facets/more-facets-pagination.test.ts +0 -201
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { expect, fixture, oneEvent } from '@open-wc/testing';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import sinon from 'sinon';
|
|
4
|
-
import '../../src/collection-facets/more-facets-pagination';
|
|
5
|
-
afterEach(() => {
|
|
6
|
-
sinon.restore();
|
|
7
|
-
});
|
|
8
|
-
describe('More facets pagination', () => {
|
|
9
|
-
describe('5 pages or less', () => {
|
|
10
|
-
it('shows all pages', async () => {
|
|
11
|
-
const el = await fixture(html `<more-facets-pagination .size=${5}></more-facets-pagination>`);
|
|
12
|
-
await el.updateComplete;
|
|
13
|
-
const pageButtons = el.shadowRoot?.querySelectorAll('button[data-page]');
|
|
14
|
-
expect(pageButtons.length).to.greaterThan(0);
|
|
15
|
-
pageButtons.forEach((button, index) => {
|
|
16
|
-
expect(button.textContent).to.contain(index + 1);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
it('should render pagination template', async () => {
|
|
21
|
-
const el = await fixture(html `<more-facets-pagination .size=${10}></more-facets-pagination>`);
|
|
22
|
-
await el.updateComplete;
|
|
23
|
-
expect(el.shadowRoot?.querySelector('.facets-pagination')).to.exist;
|
|
24
|
-
expect(el.shadowRoot?.querySelector('.arrow-icon')).to.exist;
|
|
25
|
-
});
|
|
26
|
-
it('should render page numbers', async () => {
|
|
27
|
-
const el = await fixture(html `<more-facets-pagination .size=${3}></more-facets-pagination>`);
|
|
28
|
-
await el.updateComplete;
|
|
29
|
-
const pageNumberElement = el.shadowRoot?.querySelector('.page-numbers');
|
|
30
|
-
expect(pageNumberElement).to.exist;
|
|
31
|
-
expect(pageNumberElement?.querySelectorAll('button').length).to.equal(3);
|
|
32
|
-
});
|
|
33
|
-
it('check current page and total pages', async () => {
|
|
34
|
-
const el = await fixture(html `<more-facets-pagination
|
|
35
|
-
.size=${4}
|
|
36
|
-
.currentPage=${2}
|
|
37
|
-
></more-facets-pagination>`);
|
|
38
|
-
await el.updateComplete;
|
|
39
|
-
const pageNumberElement = el.shadowRoot?.querySelector('.page-numbers');
|
|
40
|
-
expect(pageNumberElement).to.exist;
|
|
41
|
-
expect(pageNumberElement
|
|
42
|
-
?.querySelectorAll('button')[1]
|
|
43
|
-
.classList.contains('current')).to.be.true;
|
|
44
|
-
expect(el.pages?.length).to.equal(4);
|
|
45
|
-
});
|
|
46
|
-
it('get page numbers based of size and currentPage', async () => {
|
|
47
|
-
const el = await fixture(html `<more-facets-pagination
|
|
48
|
-
.size=${4}
|
|
49
|
-
.currentPage=${2}
|
|
50
|
-
></more-facets-pagination>`);
|
|
51
|
-
await el.updateComplete;
|
|
52
|
-
expect(el.pages?.length).to.equal(4);
|
|
53
|
-
});
|
|
54
|
-
describe('Selecting a page', () => {
|
|
55
|
-
it('fires event', async () => {
|
|
56
|
-
const el = await fixture(html `<more-facets-pagination></more-facets-pagination>`);
|
|
57
|
-
await el.updateComplete;
|
|
58
|
-
setTimeout(() => el.dispatchEvent(new CustomEvent('pageNumberClicked', { detail: { page: 15 } })));
|
|
59
|
-
const { detail } = await oneEvent(el, 'pageNumberClicked');
|
|
60
|
-
expect(detail?.page).to.equal(15);
|
|
61
|
-
});
|
|
62
|
-
it('sets off side effects with `onChange`', async () => {
|
|
63
|
-
const el = await fixture(html `<more-facets-pagination
|
|
64
|
-
.size=${'10'}
|
|
65
|
-
.currentPage=${2}
|
|
66
|
-
></more-facets-pagination>`);
|
|
67
|
-
expect(el.currentPage).to.equal(2); // confirm current page
|
|
68
|
-
const fake1 = sinon.fake();
|
|
69
|
-
const fake2 = sinon.fake();
|
|
70
|
-
el.observePageCount = fake1;
|
|
71
|
-
el.emitPageClick = fake2;
|
|
72
|
-
// select first page button
|
|
73
|
-
const pageButton = el.shadowRoot?.querySelector('.page-numbers > button');
|
|
74
|
-
// confirm button isn't selected
|
|
75
|
-
expect(pageButton.classList.contains('current')).to.be.false;
|
|
76
|
-
pageButton.click();
|
|
77
|
-
await el.updateComplete;
|
|
78
|
-
expect(fake1.callCount).to.equal(1);
|
|
79
|
-
expect(fake2.callCount).to.equal(1);
|
|
80
|
-
expect(el.currentPage).to.equal(1); // brings us back to currentPage
|
|
81
|
-
// confirm button is selected
|
|
82
|
-
expect(pageButton.classList.contains('current')).to.be.true;
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
describe('Using Arrows', () => {
|
|
86
|
-
it('going backwards', async () => {
|
|
87
|
-
const el = await fixture(html `<more-facets-pagination
|
|
88
|
-
.size=${'10'}
|
|
89
|
-
.currentPage=${2}
|
|
90
|
-
></more-facets-pagination>`);
|
|
91
|
-
expect(el.currentPage).to.equal(2); // confirm current page
|
|
92
|
-
const fake1 = sinon.fake();
|
|
93
|
-
const fake2 = sinon.fake();
|
|
94
|
-
el.observePageCount = fake1;
|
|
95
|
-
el.emitPageClick = fake2;
|
|
96
|
-
// select first page button
|
|
97
|
-
const rewindButton = el.shadowRoot?.querySelector('.facets-pagination > button.rewind');
|
|
98
|
-
rewindButton.click();
|
|
99
|
-
await el.updateComplete;
|
|
100
|
-
expect(fake1.callCount).to.equal(1);
|
|
101
|
-
expect(fake2.callCount).to.equal(1);
|
|
102
|
-
expect(el.currentPage).to.equal(1); // brings us back 1 page
|
|
103
|
-
// confirm button is selected
|
|
104
|
-
expect((el.shadowRoot?.querySelector('.page-numbers > button[data-page="1"]')).classList.contains('current')).to.be.true;
|
|
105
|
-
});
|
|
106
|
-
it('going forwards', async () => {
|
|
107
|
-
const el = await fixture(html `<more-facets-pagination
|
|
108
|
-
.size=${'10'}
|
|
109
|
-
.currentPage=${5}
|
|
110
|
-
></more-facets-pagination>`);
|
|
111
|
-
expect(el.currentPage).to.equal(5); // confirm current page
|
|
112
|
-
const fake1 = sinon.fake();
|
|
113
|
-
const fake2 = sinon.fake();
|
|
114
|
-
el.observePageCount = fake1;
|
|
115
|
-
el.emitPageClick = fake2;
|
|
116
|
-
// select first page button
|
|
117
|
-
const forwardButton = el.shadowRoot?.querySelector('.facets-pagination > button.forward');
|
|
118
|
-
forwardButton.click();
|
|
119
|
-
await el.updateComplete;
|
|
120
|
-
expect(fake1.callCount).to.equal(1);
|
|
121
|
-
expect(fake2.callCount).to.equal(1);
|
|
122
|
-
expect(el.currentPage).to.equal(6); // brings us forward 1 page
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
//# sourceMappingURL=more-facets-pagination.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"more-facets-pagination.test.js","sourceRoot":"","sources":["../../../test/collection-facets/more-facets-pagination.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,oDAAoD,CAAC;AAG5D,SAAS,CAAC,GAAG,EAAE;IACb,KAAK,CAAC,OAAO,EAAE,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE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AAC,CAAC,CAAC;YACpC,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,2BAA2B;QACjE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect, fixture, oneEvent } from '@open-wc/testing';\nimport { html } from 'lit';\nimport sinon from 'sinon';\nimport '../../src/collection-facets/more-facets-pagination';\nimport type { MoreFacetsPagination } from '../../src/collection-facets/more-facets-pagination';\n\nafterEach(() => {\n sinon.restore();\n});\n\ndescribe('More facets pagination', () => {\n describe('5 pages or less', () => {\n it('shows all pages', async () => {\n const el = await fixture<MoreFacetsPagination>(\n html`<more-facets-pagination .size=${5}></more-facets-pagination>`,\n );\n\n await el.updateComplete;\n\n const pageButtons = el.shadowRoot?.querySelectorAll(\n 'button[data-page]',\n ) as NodeList;\n expect(pageButtons.length).to.greaterThan(0);\n\n pageButtons.forEach((button, index) => {\n expect(button.textContent).to.contain(index + 1);\n });\n });\n });\n\n it('should render pagination template', async () => {\n const el = await fixture<MoreFacetsPagination>(\n html`<more-facets-pagination .size=${10}></more-facets-pagination>`,\n );\n\n await el.updateComplete;\n\n expect(el.shadowRoot?.querySelector('.facets-pagination')).to.exist;\n expect(el.shadowRoot?.querySelector('.arrow-icon')).to.exist;\n });\n\n it('should render page numbers', async () => {\n const el = await fixture<MoreFacetsPagination>(\n html`<more-facets-pagination .size=${3}></more-facets-pagination>`,\n );\n\n await el.updateComplete;\n\n const pageNumberElement = el.shadowRoot?.querySelector('.page-numbers');\n expect(pageNumberElement).to.exist;\n expect(pageNumberElement?.querySelectorAll('button').length).to.equal(3);\n });\n\n it('check current page and total pages', async () => {\n const el = await fixture<MoreFacetsPagination>(\n html`<more-facets-pagination\n .size=${4}\n .currentPage=${2}\n ></more-facets-pagination>`,\n );\n\n await el.updateComplete;\n\n const pageNumberElement = el.shadowRoot?.querySelector('.page-numbers');\n expect(pageNumberElement).to.exist;\n expect(\n pageNumberElement\n ?.querySelectorAll('button')[1]\n .classList.contains('current'),\n ).to.be.true;\n expect(el.pages?.length).to.equal(4);\n });\n\n it('get page numbers based of size and currentPage', async () => {\n const el = await fixture<MoreFacetsPagination>(\n html`<more-facets-pagination\n .size=${4}\n .currentPage=${2}\n ></more-facets-pagination>`,\n );\n\n await el.updateComplete;\n\n expect(el.pages?.length).to.equal(4);\n });\n\n describe('Selecting a page', () => {\n it('fires event', async () => {\n const el = await fixture<MoreFacetsPagination>(\n html`<more-facets-pagination></more-facets-pagination>`,\n );\n\n await el.updateComplete;\n\n setTimeout(() =>\n el.dispatchEvent(\n new CustomEvent('pageNumberClicked', { detail: { page: 15 } }),\n ),\n );\n const { detail } = await oneEvent(el, 'pageNumberClicked');\n expect(detail?.page).to.equal(15);\n });\n it('sets off side effects with `onChange`', async () => {\n const el = await fixture<MoreFacetsPagination>(\n html`<more-facets-pagination\n .size=${'10'}\n .currentPage=${2}\n ></more-facets-pagination>`,\n );\n\n expect(el.currentPage).to.equal(2); // confirm current page\n\n const fake1 = sinon.fake();\n const fake2 = sinon.fake();\n el.observePageCount = fake1;\n el.emitPageClick = fake2;\n\n // select first page button\n const pageButton = el.shadowRoot?.querySelector(\n '.page-numbers > button',\n ) as HTMLButtonElement;\n // confirm button isn't selected\n expect(pageButton.classList.contains('current')).to.be.false;\n pageButton.click();\n\n await el.updateComplete;\n\n expect(fake1.callCount).to.equal(1);\n expect(fake2.callCount).to.equal(1);\n expect(el.currentPage).to.equal(1); // brings us back to currentPage\n // confirm button is selected\n expect(pageButton.classList.contains('current')).to.be.true;\n });\n });\n\n describe('Using Arrows', () => {\n it('going backwards', async () => {\n const el = await fixture<MoreFacetsPagination>(\n html`<more-facets-pagination\n .size=${'10'}\n .currentPage=${2}\n ></more-facets-pagination>`,\n );\n\n expect(el.currentPage).to.equal(2); // confirm current page\n\n const fake1 = sinon.fake();\n const fake2 = sinon.fake();\n el.observePageCount = fake1;\n el.emitPageClick = fake2;\n\n // select first page button\n const rewindButton = el.shadowRoot?.querySelector(\n '.facets-pagination > button.rewind',\n ) as HTMLButtonElement;\n rewindButton.click();\n\n await el.updateComplete;\n\n expect(fake1.callCount).to.equal(1);\n expect(fake2.callCount).to.equal(1);\n expect(el.currentPage).to.equal(1); // brings us back 1 page\n // confirm button is selected\n expect(\n (\n el.shadowRoot?.querySelector(\n '.page-numbers > button[data-page=\"1\"]',\n ) as HTMLButtonElement\n ).classList.contains('current'),\n ).to.be.true;\n });\n\n it('going forwards', async () => {\n const el = await fixture<MoreFacetsPagination>(\n html`<more-facets-pagination\n .size=${'10'}\n .currentPage=${5}\n ></more-facets-pagination>`,\n );\n\n expect(el.currentPage).to.equal(5); // confirm current page\n\n const fake1 = sinon.fake();\n const fake2 = sinon.fake();\n el.observePageCount = fake1;\n el.emitPageClick = fake2;\n\n // select first page button\n const forwardButton = el.shadowRoot?.querySelector(\n '.facets-pagination > button.forward',\n ) as HTMLButtonElement;\n forwardButton.click();\n\n await el.updateComplete;\n\n expect(fake1.callCount).to.equal(1);\n expect(fake2.callCount).to.equal(1);\n expect(el.currentPage).to.equal(6); // brings us forward 1 page\n });\n });\n});\n"]}
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
css,
|
|
3
|
-
CSSResultGroup,
|
|
4
|
-
html,
|
|
5
|
-
LitElement,
|
|
6
|
-
nothing,
|
|
7
|
-
TemplateResult,
|
|
8
|
-
} from 'lit';
|
|
9
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
|
10
|
-
import arrowLeftIcon from '../assets/img/icons/arrow-left';
|
|
11
|
-
import arrowRightIcon from '../assets/img/icons/arrow-right';
|
|
12
|
-
import { srOnlyStyle } from '../styles/sr-only';
|
|
13
|
-
|
|
14
|
-
@customElement('more-facets-pagination')
|
|
15
|
-
export class MoreFacetsPagination extends LitElement {
|
|
16
|
-
/**
|
|
17
|
-
* Total number of pages
|
|
18
|
-
*/
|
|
19
|
-
@property({ type: Number }) size!: number;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Number of pages can be moved in back/forward
|
|
23
|
-
*/
|
|
24
|
-
@property({ type: Number }) step = 2;
|
|
25
|
-
|
|
26
|
-
@property({ type: Number }) currentPage: number = 1;
|
|
27
|
-
|
|
28
|
-
@state() pages?: number[] = [];
|
|
29
|
-
|
|
30
|
-
firstUpdated() {
|
|
31
|
-
this.observePageCount();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
-
override updated(changed: Map<string, any>) {
|
|
36
|
-
if (changed.has('size')) {
|
|
37
|
-
this.observePageCount();
|
|
38
|
-
}
|
|
39
|
-
if (changed.has('currentPage')) {
|
|
40
|
-
this.observePageCount();
|
|
41
|
-
this.emitPageClick();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** creates `this.pages` array that notes which pages to draw
|
|
46
|
-
* - `0` is elipses marker
|
|
47
|
-
* - rule: selected page is centered between -2/+2 pages
|
|
48
|
-
* - outlier: first page selected, show _1_ 2 3 ... N
|
|
49
|
-
* - outlier: second page selected, show 1 _2_ 3 4 ... N
|
|
50
|
-
* - outlier: last page selected, show 1 ... N-2 N-1 _N_
|
|
51
|
-
* - outlier: if page count = 7, & selected is either [2, 3, 4, 5, 6], show all pages
|
|
52
|
-
*/
|
|
53
|
-
observePageCount() {
|
|
54
|
-
this.pages = []; /* `0` is elipses marker */
|
|
55
|
-
|
|
56
|
-
const paginatorMaxPagesToShow = 7;
|
|
57
|
-
const atMinThreshold = this.size <= paginatorMaxPagesToShow;
|
|
58
|
-
|
|
59
|
-
/** Display outliers */
|
|
60
|
-
if (this.size <= 5) {
|
|
61
|
-
// display all pages
|
|
62
|
-
this.pages = [...Array(this.size).keys()].map(i => i + 1);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (this.size === paginatorMaxPagesToShow) {
|
|
67
|
-
// edge: 7 pages
|
|
68
|
-
if (this.currentPage === 2) {
|
|
69
|
-
this.pages = [1, 2, 3, 4, 0, this.size];
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (this.currentPage === this.size - 1) {
|
|
74
|
-
this.pages = [1, 0, 4, 5, this.size - 1, this.size];
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (this.currentPage === 1) {
|
|
80
|
-
// first page
|
|
81
|
-
this.pages = [1, 2, 3, 0, this.size];
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (this.currentPage === this.size) {
|
|
86
|
-
// last page
|
|
87
|
-
this.pages = [1, 0, this.size - 2, this.size - 1, this.size];
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (this.currentPage === this.size - 1) {
|
|
92
|
-
// second last page
|
|
93
|
-
this.pages = [
|
|
94
|
-
1,
|
|
95
|
-
0,
|
|
96
|
-
this.size - 3,
|
|
97
|
-
this.size - 2,
|
|
98
|
-
this.size - 1,
|
|
99
|
-
this.size,
|
|
100
|
-
];
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
atMinThreshold &&
|
|
106
|
-
this.currentPage > 1 &&
|
|
107
|
-
this.currentPage < paginatorMaxPagesToShow
|
|
108
|
-
) {
|
|
109
|
-
this.pages = [...Array(this.size).keys()].map(i => i + 1);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/* The rest here calculates the range to display in "page window" */
|
|
114
|
-
let startPage = this.currentPage - this.step;
|
|
115
|
-
let endPage = this.currentPage + this.step;
|
|
116
|
-
|
|
117
|
-
if (startPage <= 0) {
|
|
118
|
-
endPage += -startPage + 1;
|
|
119
|
-
startPage = 1;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (endPage >= this.size) {
|
|
123
|
-
startPage = Math.max(startPage - (endPage - this.size), 1);
|
|
124
|
-
endPage = this.size;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (startPage === 2) {
|
|
128
|
-
endPage -= 1;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (endPage === this.size - 1) {
|
|
132
|
-
startPage += 1;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// create first page node
|
|
136
|
-
this.createFirstNode(startPage);
|
|
137
|
-
|
|
138
|
-
// create middle pages node
|
|
139
|
-
this.createMiddelNode(startPage, endPage);
|
|
140
|
-
|
|
141
|
-
// create last page node
|
|
142
|
-
this.createLastNode(endPage);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
private createFirstNode(startPage: number) {
|
|
146
|
-
if (startPage > 1) {
|
|
147
|
-
this.pages?.push(1);
|
|
148
|
-
}
|
|
149
|
-
if (startPage > 2) {
|
|
150
|
-
this.pages?.push(0); // let's asssume 0 is for ellipsis template
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
private createMiddelNode(startPage: number, endPage: number) {
|
|
155
|
-
for (let page = startPage; page <= endPage; page += 1) {
|
|
156
|
-
this.pages?.push(page);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
private createLastNode(endPage: number) {
|
|
161
|
-
if (endPage < this.size - 1) {
|
|
162
|
-
this.pages?.push(0); // let's asssume 0 is for ellipsis template
|
|
163
|
-
}
|
|
164
|
-
if (endPage < this.size) {
|
|
165
|
-
this.pages?.push(this.size);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
private get getEllipsisTemplate() {
|
|
170
|
-
return html`<i class="ellipses">...</i>`;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
emitPageClick() {
|
|
174
|
-
this.dispatchEvent(
|
|
175
|
-
new CustomEvent('pageNumberClicked', {
|
|
176
|
-
detail: { page: this.currentPage },
|
|
177
|
-
bubbles: true,
|
|
178
|
-
composed: true,
|
|
179
|
-
}),
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
private onRewind() {
|
|
184
|
-
this.currentPage -= 1;
|
|
185
|
-
if (this.currentPage < 1) {
|
|
186
|
-
this.currentPage = 1;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
private onForward() {
|
|
191
|
-
this.currentPage += 1;
|
|
192
|
-
if (this.currentPage > this.size) {
|
|
193
|
-
this.currentPage = this.size;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
private onChange(page: number) {
|
|
198
|
-
this.currentPage = page;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
private getPageTemplate(page: number) {
|
|
202
|
-
return html`
|
|
203
|
-
<button
|
|
204
|
-
@click=${() => this.onChange(page)}
|
|
205
|
-
class=${this.currentPage === page ? 'current' : ''}
|
|
206
|
-
data-page=${page}
|
|
207
|
-
>
|
|
208
|
-
${page}
|
|
209
|
-
</button>
|
|
210
|
-
`;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
private get getPagesTemplate(): TemplateResult | typeof nothing {
|
|
214
|
-
if (!this.pages || !this.pages.length) {
|
|
215
|
-
return nothing;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
return html`
|
|
219
|
-
${this.pages?.map(
|
|
220
|
-
page =>
|
|
221
|
-
html`${page !== 0
|
|
222
|
-
? this.getPageTemplate(page)
|
|
223
|
-
: this.getEllipsisTemplate}`,
|
|
224
|
-
)}
|
|
225
|
-
`;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
render() {
|
|
229
|
-
return html`
|
|
230
|
-
<div class="facets-pagination">
|
|
231
|
-
<button class="arrow-icon rewind" @click=${this.onRewind}>
|
|
232
|
-
<span class="sr-only">Rewind pagination:</span>
|
|
233
|
-
${arrowLeftIcon}
|
|
234
|
-
</button>
|
|
235
|
-
<div class="page-numbers">${this.getPagesTemplate}</div>
|
|
236
|
-
<button class="arrow-icon forward" @click=${this.onForward}>
|
|
237
|
-
<span class="sr-only">Forward pagination:</span>
|
|
238
|
-
${arrowRightIcon}
|
|
239
|
-
</button>
|
|
240
|
-
</div>
|
|
241
|
-
`;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
static get styles(): CSSResultGroup {
|
|
245
|
-
return [
|
|
246
|
-
srOnlyStyle,
|
|
247
|
-
css`
|
|
248
|
-
.facets-pagination {
|
|
249
|
-
user-select: none;
|
|
250
|
-
margin-top: 10px;
|
|
251
|
-
background-color: #eee;
|
|
252
|
-
text-align: center;
|
|
253
|
-
}
|
|
254
|
-
.facets-pagination button {
|
|
255
|
-
border: none;
|
|
256
|
-
background: none;
|
|
257
|
-
}
|
|
258
|
-
.facets-pagination .arrow-icon {
|
|
259
|
-
width: 2.5rem;
|
|
260
|
-
vertical-align: middle;
|
|
261
|
-
}
|
|
262
|
-
.facets-pagination .arrow-icon svg {
|
|
263
|
-
height: 14px;
|
|
264
|
-
fill: #2c2c2c;
|
|
265
|
-
}
|
|
266
|
-
.facets-pagination button,
|
|
267
|
-
.facets-pagination i {
|
|
268
|
-
background: none;
|
|
269
|
-
border: 0;
|
|
270
|
-
cursor: pointer;
|
|
271
|
-
border-radius: 4px;
|
|
272
|
-
margin: 10px 5px;
|
|
273
|
-
padding: 5px;
|
|
274
|
-
font-size: 1.4rem;
|
|
275
|
-
color: inherit;
|
|
276
|
-
vertical-align: baseline;
|
|
277
|
-
display: inline-block;
|
|
278
|
-
min-width: 2.5rem;
|
|
279
|
-
}
|
|
280
|
-
.facets-pagination i {
|
|
281
|
-
cursor: auto;
|
|
282
|
-
display: inline;
|
|
283
|
-
}
|
|
284
|
-
.facets-pagination button.current {
|
|
285
|
-
background: #2c2c2c;
|
|
286
|
-
color: white;
|
|
287
|
-
}
|
|
288
|
-
.page-numbers {
|
|
289
|
-
display: inline-block;
|
|
290
|
-
}
|
|
291
|
-
`,
|
|
292
|
-
];
|
|
293
|
-
}
|
|
294
|
-
}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { expect, fixture, oneEvent } from '@open-wc/testing';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import sinon from 'sinon';
|
|
4
|
-
import '../../src/collection-facets/more-facets-pagination';
|
|
5
|
-
import type { MoreFacetsPagination } from '../../src/collection-facets/more-facets-pagination';
|
|
6
|
-
|
|
7
|
-
afterEach(() => {
|
|
8
|
-
sinon.restore();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
describe('More facets pagination', () => {
|
|
12
|
-
describe('5 pages or less', () => {
|
|
13
|
-
it('shows all pages', async () => {
|
|
14
|
-
const el = await fixture<MoreFacetsPagination>(
|
|
15
|
-
html`<more-facets-pagination .size=${5}></more-facets-pagination>`,
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
await el.updateComplete;
|
|
19
|
-
|
|
20
|
-
const pageButtons = el.shadowRoot?.querySelectorAll(
|
|
21
|
-
'button[data-page]',
|
|
22
|
-
) as NodeList;
|
|
23
|
-
expect(pageButtons.length).to.greaterThan(0);
|
|
24
|
-
|
|
25
|
-
pageButtons.forEach((button, index) => {
|
|
26
|
-
expect(button.textContent).to.contain(index + 1);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('should render pagination template', async () => {
|
|
32
|
-
const el = await fixture<MoreFacetsPagination>(
|
|
33
|
-
html`<more-facets-pagination .size=${10}></more-facets-pagination>`,
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
await el.updateComplete;
|
|
37
|
-
|
|
38
|
-
expect(el.shadowRoot?.querySelector('.facets-pagination')).to.exist;
|
|
39
|
-
expect(el.shadowRoot?.querySelector('.arrow-icon')).to.exist;
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('should render page numbers', async () => {
|
|
43
|
-
const el = await fixture<MoreFacetsPagination>(
|
|
44
|
-
html`<more-facets-pagination .size=${3}></more-facets-pagination>`,
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
await el.updateComplete;
|
|
48
|
-
|
|
49
|
-
const pageNumberElement = el.shadowRoot?.querySelector('.page-numbers');
|
|
50
|
-
expect(pageNumberElement).to.exist;
|
|
51
|
-
expect(pageNumberElement?.querySelectorAll('button').length).to.equal(3);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('check current page and total pages', async () => {
|
|
55
|
-
const el = await fixture<MoreFacetsPagination>(
|
|
56
|
-
html`<more-facets-pagination
|
|
57
|
-
.size=${4}
|
|
58
|
-
.currentPage=${2}
|
|
59
|
-
></more-facets-pagination>`,
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
await el.updateComplete;
|
|
63
|
-
|
|
64
|
-
const pageNumberElement = el.shadowRoot?.querySelector('.page-numbers');
|
|
65
|
-
expect(pageNumberElement).to.exist;
|
|
66
|
-
expect(
|
|
67
|
-
pageNumberElement
|
|
68
|
-
?.querySelectorAll('button')[1]
|
|
69
|
-
.classList.contains('current'),
|
|
70
|
-
).to.be.true;
|
|
71
|
-
expect(el.pages?.length).to.equal(4);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('get page numbers based of size and currentPage', async () => {
|
|
75
|
-
const el = await fixture<MoreFacetsPagination>(
|
|
76
|
-
html`<more-facets-pagination
|
|
77
|
-
.size=${4}
|
|
78
|
-
.currentPage=${2}
|
|
79
|
-
></more-facets-pagination>`,
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
await el.updateComplete;
|
|
83
|
-
|
|
84
|
-
expect(el.pages?.length).to.equal(4);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
describe('Selecting a page', () => {
|
|
88
|
-
it('fires event', async () => {
|
|
89
|
-
const el = await fixture<MoreFacetsPagination>(
|
|
90
|
-
html`<more-facets-pagination></more-facets-pagination>`,
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
await el.updateComplete;
|
|
94
|
-
|
|
95
|
-
setTimeout(() =>
|
|
96
|
-
el.dispatchEvent(
|
|
97
|
-
new CustomEvent('pageNumberClicked', { detail: { page: 15 } }),
|
|
98
|
-
),
|
|
99
|
-
);
|
|
100
|
-
const { detail } = await oneEvent(el, 'pageNumberClicked');
|
|
101
|
-
expect(detail?.page).to.equal(15);
|
|
102
|
-
});
|
|
103
|
-
it('sets off side effects with `onChange`', async () => {
|
|
104
|
-
const el = await fixture<MoreFacetsPagination>(
|
|
105
|
-
html`<more-facets-pagination
|
|
106
|
-
.size=${'10'}
|
|
107
|
-
.currentPage=${2}
|
|
108
|
-
></more-facets-pagination>`,
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
expect(el.currentPage).to.equal(2); // confirm current page
|
|
112
|
-
|
|
113
|
-
const fake1 = sinon.fake();
|
|
114
|
-
const fake2 = sinon.fake();
|
|
115
|
-
el.observePageCount = fake1;
|
|
116
|
-
el.emitPageClick = fake2;
|
|
117
|
-
|
|
118
|
-
// select first page button
|
|
119
|
-
const pageButton = el.shadowRoot?.querySelector(
|
|
120
|
-
'.page-numbers > button',
|
|
121
|
-
) as HTMLButtonElement;
|
|
122
|
-
// confirm button isn't selected
|
|
123
|
-
expect(pageButton.classList.contains('current')).to.be.false;
|
|
124
|
-
pageButton.click();
|
|
125
|
-
|
|
126
|
-
await el.updateComplete;
|
|
127
|
-
|
|
128
|
-
expect(fake1.callCount).to.equal(1);
|
|
129
|
-
expect(fake2.callCount).to.equal(1);
|
|
130
|
-
expect(el.currentPage).to.equal(1); // brings us back to currentPage
|
|
131
|
-
// confirm button is selected
|
|
132
|
-
expect(pageButton.classList.contains('current')).to.be.true;
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
describe('Using Arrows', () => {
|
|
137
|
-
it('going backwards', async () => {
|
|
138
|
-
const el = await fixture<MoreFacetsPagination>(
|
|
139
|
-
html`<more-facets-pagination
|
|
140
|
-
.size=${'10'}
|
|
141
|
-
.currentPage=${2}
|
|
142
|
-
></more-facets-pagination>`,
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
expect(el.currentPage).to.equal(2); // confirm current page
|
|
146
|
-
|
|
147
|
-
const fake1 = sinon.fake();
|
|
148
|
-
const fake2 = sinon.fake();
|
|
149
|
-
el.observePageCount = fake1;
|
|
150
|
-
el.emitPageClick = fake2;
|
|
151
|
-
|
|
152
|
-
// select first page button
|
|
153
|
-
const rewindButton = el.shadowRoot?.querySelector(
|
|
154
|
-
'.facets-pagination > button.rewind',
|
|
155
|
-
) as HTMLButtonElement;
|
|
156
|
-
rewindButton.click();
|
|
157
|
-
|
|
158
|
-
await el.updateComplete;
|
|
159
|
-
|
|
160
|
-
expect(fake1.callCount).to.equal(1);
|
|
161
|
-
expect(fake2.callCount).to.equal(1);
|
|
162
|
-
expect(el.currentPage).to.equal(1); // brings us back 1 page
|
|
163
|
-
// confirm button is selected
|
|
164
|
-
expect(
|
|
165
|
-
(
|
|
166
|
-
el.shadowRoot?.querySelector(
|
|
167
|
-
'.page-numbers > button[data-page="1"]',
|
|
168
|
-
) as HTMLButtonElement
|
|
169
|
-
).classList.contains('current'),
|
|
170
|
-
).to.be.true;
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it('going forwards', async () => {
|
|
174
|
-
const el = await fixture<MoreFacetsPagination>(
|
|
175
|
-
html`<more-facets-pagination
|
|
176
|
-
.size=${'10'}
|
|
177
|
-
.currentPage=${5}
|
|
178
|
-
></more-facets-pagination>`,
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
expect(el.currentPage).to.equal(5); // confirm current page
|
|
182
|
-
|
|
183
|
-
const fake1 = sinon.fake();
|
|
184
|
-
const fake2 = sinon.fake();
|
|
185
|
-
el.observePageCount = fake1;
|
|
186
|
-
el.emitPageClick = fake2;
|
|
187
|
-
|
|
188
|
-
// select first page button
|
|
189
|
-
const forwardButton = el.shadowRoot?.querySelector(
|
|
190
|
-
'.facets-pagination > button.forward',
|
|
191
|
-
) as HTMLButtonElement;
|
|
192
|
-
forwardButton.click();
|
|
193
|
-
|
|
194
|
-
await el.updateComplete;
|
|
195
|
-
|
|
196
|
-
expect(fake1.callCount).to.equal(1);
|
|
197
|
-
expect(fake2.callCount).to.equal(1);
|
|
198
|
-
expect(el.currentPage).to.equal(6); // brings us forward 1 page
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
});
|