@internetarchive/collection-browser 3.3.1 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/index.d.ts +0 -16
- package/dist/index.js.map +0 -1
- package/dist/src/app-root.d.ts +0 -105
- package/dist/src/app-root.js +0 -1076
- package/dist/src/app-root.js.map +0 -1
- package/dist/src/assets/img/icons/arrow-left.d.ts +0 -2
- package/dist/src/assets/img/icons/arrow-left.js +0 -10
- package/dist/src/assets/img/icons/arrow-left.js.map +0 -1
- package/dist/src/assets/img/icons/arrow-right.d.ts +0 -2
- package/dist/src/assets/img/icons/arrow-right.js +0 -10
- package/dist/src/assets/img/icons/arrow-right.js.map +0 -1
- package/dist/src/assets/img/icons/chevron.d.ts +0 -2
- package/dist/src/assets/img/icons/chevron.js +0 -4
- package/dist/src/assets/img/icons/chevron.js.map +0 -1
- package/dist/src/assets/img/icons/close-circle-dark.d.ts +0 -2
- package/dist/src/assets/img/icons/close-circle-dark.js +0 -5
- package/dist/src/assets/img/icons/close-circle-dark.js.map +0 -1
- package/dist/src/assets/img/icons/contract.d.ts +0 -2
- package/dist/src/assets/img/icons/contract.js +0 -9
- package/dist/src/assets/img/icons/contract.js.map +0 -1
- package/dist/src/assets/img/icons/empty-query.d.ts +0 -2
- package/dist/src/assets/img/icons/empty-query.js +0 -5
- package/dist/src/assets/img/icons/empty-query.js.map +0 -1
- package/dist/src/assets/img/icons/expand.d.ts +0 -2
- package/dist/src/assets/img/icons/expand.js +0 -9
- package/dist/src/assets/img/icons/expand.js.map +0 -1
- package/dist/src/assets/img/icons/eye-closed.d.ts +0 -2
- package/dist/src/assets/img/icons/eye-closed.js +0 -5
- package/dist/src/assets/img/icons/eye-closed.js.map +0 -1
- package/dist/src/assets/img/icons/eye.d.ts +0 -2
- package/dist/src/assets/img/icons/eye.js +0 -5
- package/dist/src/assets/img/icons/eye.js.map +0 -1
- package/dist/src/assets/img/icons/favorite-filled.d.ts +0 -1
- package/dist/src/assets/img/icons/favorite-filled.js +0 -10
- package/dist/src/assets/img/icons/favorite-filled.js.map +0 -1
- package/dist/src/assets/img/icons/favorite-unfilled.d.ts +0 -1
- package/dist/src/assets/img/icons/favorite-unfilled.js +0 -9
- package/dist/src/assets/img/icons/favorite-unfilled.js.map +0 -1
- package/dist/src/assets/img/icons/filter.d.ts +0 -2
- package/dist/src/assets/img/icons/filter.js +0 -10
- package/dist/src/assets/img/icons/filter.js.map +0 -1
- package/dist/src/assets/img/icons/login-required.d.ts +0 -1
- package/dist/src/assets/img/icons/login-required.js +0 -18
- package/dist/src/assets/img/icons/login-required.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/account.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/account.js +0 -14
- package/dist/src/assets/img/icons/mediatype/account.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/audio.js +0 -14
- package/dist/src/assets/img/icons/mediatype/audio.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/collection.js +0 -12
- package/dist/src/assets/img/icons/mediatype/collection.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/data.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/data.js +0 -15
- package/dist/src/assets/img/icons/mediatype/data.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/etree.js +0 -14
- package/dist/src/assets/img/icons/mediatype/etree.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/film.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/film.js +0 -14
- package/dist/src/assets/img/icons/mediatype/film.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/images.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/images.js +0 -13
- package/dist/src/assets/img/icons/mediatype/images.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/radio.js +0 -15
- package/dist/src/assets/img/icons/mediatype/radio.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/search.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/search.js +0 -14
- package/dist/src/assets/img/icons/mediatype/search.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/software.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/software.js +0 -13
- package/dist/src/assets/img/icons/mediatype/software.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/texts.js +0 -13
- package/dist/src/assets/img/icons/mediatype/texts.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-commercial.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-commercial.js +0 -12
- package/dist/src/assets/img/icons/mediatype/tv-commercial.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-fact-check.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-fact-check.js +0 -12
- package/dist/src/assets/img/icons/mediatype/tv-fact-check.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-quote.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/tv-quote.js +0 -12
- package/dist/src/assets/img/icons/mediatype/tv-quote.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/tv.js +0 -14
- package/dist/src/assets/img/icons/mediatype/tv.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/video.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/video.js +0 -14
- package/dist/src/assets/img/icons/mediatype/video.js.map +0 -1
- package/dist/src/assets/img/icons/mediatype/web.d.ts +0 -1
- package/dist/src/assets/img/icons/mediatype/web.js +0 -13
- package/dist/src/assets/img/icons/mediatype/web.js.map +0 -1
- package/dist/src/assets/img/icons/null-result.d.ts +0 -2
- package/dist/src/assets/img/icons/null-result.js +0 -5
- package/dist/src/assets/img/icons/null-result.js.map +0 -1
- package/dist/src/assets/img/icons/quote.d.ts +0 -1
- package/dist/src/assets/img/icons/quote.js +0 -7
- package/dist/src/assets/img/icons/quote.js.map +0 -1
- package/dist/src/assets/img/icons/restricted.d.ts +0 -1
- package/dist/src/assets/img/icons/restricted.js +0 -13
- package/dist/src/assets/img/icons/restricted.js.map +0 -1
- package/dist/src/assets/img/icons/reviews.d.ts +0 -1
- package/dist/src/assets/img/icons/reviews.js +0 -11
- package/dist/src/assets/img/icons/reviews.js.map +0 -1
- package/dist/src/assets/img/icons/upload.d.ts +0 -1
- package/dist/src/assets/img/icons/upload.js +0 -12
- package/dist/src/assets/img/icons/upload.js.map +0 -1
- package/dist/src/assets/img/icons/views.d.ts +0 -1
- package/dist/src/assets/img/icons/views.js +0 -11
- package/dist/src/assets/img/icons/views.js.map +0 -1
- package/dist/src/circular-activity-indicator.d.ts +0 -5
- package/dist/src/circular-activity-indicator.js +0 -66
- package/dist/src/circular-activity-indicator.js.map +0 -1
- package/dist/src/collection-browser.d.ts +0 -684
- package/dist/src/collection-browser.js +0 -2567
- package/dist/src/collection-browser.js.map +0 -1
- package/dist/src/collection-facets/facet-row.d.ts +0 -30
- package/dist/src/collection-facets/facet-row.js +0 -265
- package/dist/src/collection-facets/facet-row.js.map +0 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +0 -5
- package/dist/src/collection-facets/facet-tombstone-row.js +0 -43
- package/dist/src/collection-facets/facet-tombstone-row.js.map +0 -1
- package/dist/src/collection-facets/facets-template.d.ts +0 -13
- package/dist/src/collection-facets/facets-template.js +0 -68
- package/dist/src/collection-facets/facets-template.js.map +0 -1
- package/dist/src/collection-facets/models.d.ts +0 -9
- package/dist/src/collection-facets/models.js +0 -10
- package/dist/src/collection-facets/models.js.map +0 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +0 -109
- package/dist/src/collection-facets/more-facets-content.js +0 -547
- package/dist/src/collection-facets/more-facets-content.js.map +0 -1
- package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -36
- package/dist/src/collection-facets/more-facets-pagination.js +0 -264
- package/dist/src/collection-facets/more-facets-pagination.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/dedupe.d.ts +0 -10
- package/dist/src/collection-facets/smart-facets/dedupe.js +0 -35
- package/dist/src/collection-facets/smart-facets/dedupe.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.d.ts +0 -5
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js +0 -24
- package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/index.d.ts +0 -3
- package/dist/src/collection-facets/smart-facets/heuristics/index.js +0 -4
- package/dist/src/collection-facets/smart-facets/heuristics/index.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.d.ts +0 -4
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js +0 -14
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.d.ts +0 -6
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js +0 -68
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.d.ts +0 -9
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js +0 -69
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.d.ts +0 -21
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +0 -76
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/models.d.ts +0 -30
- package/dist/src/collection-facets/smart-facets/models.js +0 -2
- package/dist/src/collection-facets/smart-facets/models.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.d.ts +0 -54
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +0 -383
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-button.d.ts +0 -11
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js +0 -133
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.d.ts +0 -28
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +0 -172
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.d.ts +0 -2
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.js +0 -13
- package/dist/src/collection-facets/smart-facets/smart-facet-equals.js.map +0 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.d.ts +0 -5
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js +0 -18
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +0 -1
- package/dist/src/collection-facets/toggle-switch.d.ts +0 -41
- package/dist/src/collection-facets/toggle-switch.js +0 -174
- package/dist/src/collection-facets/toggle-switch.js.map +0 -1
- package/dist/src/collection-facets.d.ts +0 -113
- package/dist/src/collection-facets.js +0 -873
- package/dist/src/collection-facets.js.map +0 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +0 -261
- package/dist/src/data-source/collection-browser-data-source-interface.js +0 -2
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +0 -1
- package/dist/src/data-source/collection-browser-data-source.d.ts +0 -400
- package/dist/src/data-source/collection-browser-data-source.js +0 -1103
- package/dist/src/data-source/collection-browser-data-source.js.map +0 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +0 -49
- package/dist/src/data-source/collection-browser-query-state.js +0 -2
- package/dist/src/data-source/collection-browser-query-state.js.map +0 -1
- package/dist/src/data-source/models.d.ts +0 -32
- package/dist/src/data-source/models.js +0 -9
- package/dist/src/data-source/models.js.map +0 -1
- package/dist/src/empty-placeholder.d.ts +0 -23
- package/dist/src/empty-placeholder.js +0 -165
- package/dist/src/empty-placeholder.js.map +0 -1
- package/dist/src/expanded-date-picker.d.ts +0 -50
- package/dist/src/expanded-date-picker.js +0 -182
- package/dist/src/expanded-date-picker.js.map +0 -1
- package/dist/src/language-code-handler/language-code-handler.d.ts +0 -37
- package/dist/src/language-code-handler/language-code-handler.js +0 -27
- package/dist/src/language-code-handler/language-code-handler.js.map +0 -1
- package/dist/src/language-code-handler/language-code-mapping.d.ts +0 -1
- package/dist/src/language-code-handler/language-code-mapping.js +0 -563
- package/dist/src/language-code-handler/language-code-mapping.js.map +0 -1
- package/dist/src/manage/manage-bar.d.ts +0 -58
- package/dist/src/manage/manage-bar.js +0 -237
- package/dist/src/manage/manage-bar.js.map +0 -1
- package/dist/src/manage/remove-items-modal-content.d.ts +0 -9
- package/dist/src/manage/remove-items-modal-content.js +0 -104
- package/dist/src/manage/remove-items-modal-content.js.map +0 -1
- package/dist/src/mediatype/mediatype-config.d.ts +0 -11
- package/dist/src/mediatype/mediatype-config.js +0 -116
- package/dist/src/mediatype/mediatype-config.js.map +0 -1
- package/dist/src/models.d.ts +0 -302
- package/dist/src/models.js +0 -511
- package/dist/src/models.js.map +0 -1
- package/dist/src/restoration-state-handler.d.ts +0 -75
- package/dist/src/restoration-state-handler.js +0 -403
- package/dist/src/restoration-state-handler.js.map +0 -1
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +0 -6
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +0 -60
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js.map +0 -1
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +0 -21
- package/dist/src/sort-filter-bar/alpha-bar.js +0 -241
- package/dist/src/sort-filter-bar/alpha-bar.js.map +0 -1
- package/dist/src/sort-filter-bar/img/compact.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/compact.js +0 -5
- package/dist/src/sort-filter-bar/img/compact.js.map +0 -1
- package/dist/src/sort-filter-bar/img/list.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/list.js +0 -5
- package/dist/src/sort-filter-bar/img/list.js.map +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +0 -15
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js.map +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js +0 -17
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js.map +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js +0 -17
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js.map +0 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.js +0 -5
- package/dist/src/sort-filter-bar/img/sort-triangle.js.map +0 -1
- package/dist/src/sort-filter-bar/img/tile.d.ts +0 -1
- package/dist/src/sort-filter-bar/img/tile.js +0 -5
- package/dist/src/sort-filter-bar/img/tile.js.map +0 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +0 -278
- package/dist/src/sort-filter-bar/sort-filter-bar.js +0 -1161
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +0 -1
- package/dist/src/styles/ia-button.d.ts +0 -2
- package/dist/src/styles/ia-button.js +0 -134
- package/dist/src/styles/ia-button.js.map +0 -1
- package/dist/src/styles/item-image-styles.d.ts +0 -8
- package/dist/src/styles/item-image-styles.js +0 -123
- package/dist/src/styles/item-image-styles.js.map +0 -1
- package/dist/src/styles/sr-only.d.ts +0 -1
- package/dist/src/styles/sr-only.js +0 -18
- package/dist/src/styles/sr-only.js.map +0 -1
- package/dist/src/tiles/base-tile-component.d.ts +0 -27
- package/dist/src/tiles/base-tile-component.js +0 -82
- package/dist/src/tiles/base-tile-component.js.map +0 -1
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +0 -5
- package/dist/src/tiles/collection-browser-loading-tile.js +0 -29
- package/dist/src/tiles/collection-browser-loading-tile.js.map +0 -1
- package/dist/src/tiles/grid/account-tile.d.ts +0 -18
- package/dist/src/tiles/grid/account-tile.js +0 -111
- package/dist/src/tiles/grid/account-tile.js.map +0 -1
- package/dist/src/tiles/grid/collection-tile.d.ts +0 -15
- package/dist/src/tiles/grid/collection-tile.js +0 -160
- package/dist/src/tiles/grid/collection-tile.js.map +0 -1
- package/dist/src/tiles/grid/item-tile.d.ts +0 -41
- package/dist/src/tiles/grid/item-tile.js +0 -321
- package/dist/src/tiles/grid/item-tile.js.map +0 -1
- package/dist/src/tiles/grid/search-tile.d.ts +0 -10
- package/dist/src/tiles/grid/search-tile.js +0 -95
- package/dist/src/tiles/grid/search-tile.js.map +0 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +0 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +0 -128
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +0 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +0 -58
- package/dist/src/tiles/grid/tile-stats.js +0 -204
- package/dist/src/tiles/grid/tile-stats.js.map +0 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +0 -220
- package/dist/src/tiles/hover/hover-pane-controller.js +0 -378
- package/dist/src/tiles/hover/hover-pane-controller.js.map +0 -1
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +0 -19
- package/dist/src/tiles/hover/tile-hover-pane.js +0 -182
- package/dist/src/tiles/hover/tile-hover-pane.js.map +0 -1
- package/dist/src/tiles/image-block.d.ts +0 -19
- package/dist/src/tiles/image-block.js +0 -175
- package/dist/src/tiles/image-block.js.map +0 -1
- package/dist/src/tiles/item-image.d.ts +0 -40
- package/dist/src/tiles/item-image.js +0 -191
- package/dist/src/tiles/item-image.js.map +0 -1
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +0 -6
- package/dist/src/tiles/list/tile-list-compact-header.js +0 -85
- package/dist/src/tiles/list/tile-list-compact-header.js.map +0 -1
- package/dist/src/tiles/list/tile-list-compact.d.ts +0 -19
- package/dist/src/tiles/list/tile-list-compact.js +0 -223
- package/dist/src/tiles/list/tile-list-compact.js.map +0 -1
- package/dist/src/tiles/list/tile-list.d.ts +0 -54
- package/dist/src/tiles/list/tile-list.js +0 -621
- package/dist/src/tiles/list/tile-list.js.map +0 -1
- package/dist/src/tiles/models.d.ts +0 -1
- package/dist/src/tiles/models.js +0 -2
- package/dist/src/tiles/models.js.map +0 -1
- package/dist/src/tiles/overlay/icon-overlay.d.ts +0 -8
- package/dist/src/tiles/overlay/icon-overlay.js +0 -55
- package/dist/src/tiles/overlay/icon-overlay.js.map +0 -1
- package/dist/src/tiles/overlay/text-overlay.d.ts +0 -9
- package/dist/src/tiles/overlay/text-overlay.js +0 -74
- package/dist/src/tiles/overlay/text-overlay.js.map +0 -1
- package/dist/src/tiles/review-block.d.ts +0 -12
- package/dist/src/tiles/review-block.js +0 -134
- package/dist/src/tiles/review-block.js.map +0 -1
- package/dist/src/tiles/text-snippet-block.d.ts +0 -27
- package/dist/src/tiles/text-snippet-block.js +0 -132
- package/dist/src/tiles/text-snippet-block.js.map +0 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +0 -68
- package/dist/src/tiles/tile-dispatcher.js +0 -445
- package/dist/src/tiles/tile-dispatcher.js.map +0 -1
- package/dist/src/tiles/tile-display-value-provider.d.ts +0 -47
- package/dist/src/tiles/tile-display-value-provider.js +0 -95
- package/dist/src/tiles/tile-display-value-provider.js.map +0 -1
- package/dist/src/tiles/tile-mediatype-icon.d.ts +0 -27
- package/dist/src/tiles/tile-mediatype-icon.js +0 -130
- package/dist/src/tiles/tile-mediatype-icon.js.map +0 -1
- package/dist/src/utils/analytics-events.d.ts +0 -28
- package/dist/src/utils/analytics-events.js +0 -31
- package/dist/src/utils/analytics-events.js.map +0 -1
- package/dist/src/utils/array-equals.d.ts +0 -4
- package/dist/src/utils/array-equals.js +0 -11
- package/dist/src/utils/array-equals.js.map +0 -1
- package/dist/src/utils/collapse-repeated-quotes.d.ts +0 -11
- package/dist/src/utils/collapse-repeated-quotes.js +0 -14
- package/dist/src/utils/collapse-repeated-quotes.js.map +0 -1
- package/dist/src/utils/facet-utils.d.ts +0 -83
- package/dist/src/utils/facet-utils.js +0 -152
- package/dist/src/utils/facet-utils.js.map +0 -1
- package/dist/src/utils/format-count.d.ts +0 -7
- package/dist/src/utils/format-count.js +0 -76
- package/dist/src/utils/format-count.js.map +0 -1
- package/dist/src/utils/format-date.d.ts +0 -16
- package/dist/src/utils/format-date.js +0 -33
- package/dist/src/utils/format-date.js.map +0 -1
- package/dist/src/utils/format-unit-size.d.ts +0 -2
- package/dist/src/utils/format-unit-size.js +0 -34
- package/dist/src/utils/format-unit-size.js.map +0 -1
- package/dist/src/utils/local-date-from-utc.d.ts +0 -9
- package/dist/src/utils/local-date-from-utc.js +0 -16
- package/dist/src/utils/local-date-from-utc.js.map +0 -1
- package/dist/src/utils/log.d.ts +0 -7
- package/dist/src/utils/log.js +0 -14
- package/dist/src/utils/log.js.map +0 -1
- package/dist/src/utils/resolve-mediatype.d.ts +0 -8
- package/dist/src/utils/resolve-mediatype.js +0 -24
- package/dist/src/utils/resolve-mediatype.js.map +0 -1
- package/dist/src/utils/sha1.d.ts +0 -2
- package/dist/src/utils/sha1.js +0 -9
- package/dist/src/utils/sha1.js.map +0 -1
- package/dist/test/collection-browser.test.d.ts +0 -1
- package/dist/test/collection-browser.test.js +0 -1711
- package/dist/test/collection-browser.test.js.map +0 -1
- package/dist/test/collection-facets/facet-row.test.d.ts +0 -1
- package/dist/test/collection-facets/facet-row.test.js +0 -274
- package/dist/test/collection-facets/facet-row.test.js.map +0 -1
- package/dist/test/collection-facets/facets-template.test.d.ts +0 -1
- package/dist/test/collection-facets/facets-template.test.js +0 -101
- package/dist/test/collection-facets/facets-template.test.js.map +0 -1
- package/dist/test/collection-facets/more-facets-content.test.d.ts +0 -1
- package/dist/test/collection-facets/more-facets-content.test.js +0 -169
- package/dist/test/collection-facets/more-facets-content.test.js.map +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +0 -132
- package/dist/test/collection-facets/more-facets-pagination.test.js.map +0 -1
- package/dist/test/collection-facets/toggle-switch.test.d.ts +0 -1
- package/dist/test/collection-facets/toggle-switch.test.js +0 -96
- package/dist/test/collection-facets/toggle-switch.test.js.map +0 -1
- package/dist/test/collection-facets.test.d.ts +0 -2
- package/dist/test/collection-facets.test.js +0 -745
- package/dist/test/collection-facets.test.js.map +0 -1
- package/dist/test/data-source/collection-browser-data-source.test.d.ts +0 -1
- package/dist/test/data-source/collection-browser-data-source.test.js +0 -102
- package/dist/test/data-source/collection-browser-data-source.test.js.map +0 -1
- package/dist/test/empty-placeholder.test.d.ts +0 -1
- package/dist/test/empty-placeholder.test.js +0 -63
- package/dist/test/empty-placeholder.test.js.map +0 -1
- package/dist/test/expanded-date-picker.test.d.ts +0 -1
- package/dist/test/expanded-date-picker.test.js +0 -130
- package/dist/test/expanded-date-picker.test.js.map +0 -1
- package/dist/test/icon-overlay.test.d.ts +0 -1
- package/dist/test/icon-overlay.test.js +0 -30
- package/dist/test/icon-overlay.test.js.map +0 -1
- package/dist/test/image-block.test.d.ts +0 -1
- package/dist/test/image-block.test.js +0 -218
- package/dist/test/image-block.test.js.map +0 -1
- package/dist/test/item-image.test.d.ts +0 -1
- package/dist/test/item-image.test.js +0 -196
- package/dist/test/item-image.test.js.map +0 -1
- package/dist/test/manage/manage-bar.test.d.ts +0 -2
- package/dist/test/manage/manage-bar.test.js +0 -106
- package/dist/test/manage/manage-bar.test.js.map +0 -1
- package/dist/test/manage/remove-items-modal-content.test.d.ts +0 -1
- package/dist/test/manage/remove-items-modal-content.test.js +0 -65
- package/dist/test/manage/remove-items-modal-content.test.js.map +0 -1
- package/dist/test/mediatype-config.test.d.ts +0 -1
- package/dist/test/mediatype-config.test.js +0 -11
- package/dist/test/mediatype-config.test.js.map +0 -1
- package/dist/test/mocks/mock-analytics-handler.d.ts +0 -10
- package/dist/test/mocks/mock-analytics-handler.js +0 -16
- package/dist/test/mocks/mock-analytics-handler.js.map +0 -1
- package/dist/test/mocks/mock-search-responses.d.ts +0 -31
- package/dist/test/mocks/mock-search-responses.js +0 -1241
- package/dist/test/mocks/mock-search-responses.js.map +0 -1
- package/dist/test/mocks/mock-search-service.d.ts +0 -16
- package/dist/test/mocks/mock-search-service.js +0 -65
- package/dist/test/mocks/mock-search-service.js.map +0 -1
- package/dist/test/restoration-state-handler.test.d.ts +0 -1
- package/dist/test/restoration-state-handler.test.js +0 -375
- package/dist/test/restoration-state-handler.test.js.map +0 -1
- package/dist/test/review-block.test.d.ts +0 -1
- package/dist/test/review-block.test.js +0 -48
- package/dist/test/review-block.test.js.map +0 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +0 -13
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +0 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +0 -74
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -609
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +0 -1
- package/dist/test/text-overlay.test.d.ts +0 -1
- package/dist/test/text-overlay.test.js +0 -42
- package/dist/test/text-overlay.test.js.map +0 -1
- package/dist/test/text-snippet-block.test.d.ts +0 -1
- package/dist/test/text-snippet-block.test.js +0 -63
- package/dist/test/text-snippet-block.test.js.map +0 -1
- package/dist/test/tile-stats.test.d.ts +0 -1
- package/dist/test/tile-stats.test.js +0 -128
- package/dist/test/tile-stats.test.js.map +0 -1
- package/dist/test/tiles/grid/account-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/account-tile.test.js +0 -96
- package/dist/test/tiles/grid/account-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/collection-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/collection-tile.test.js +0 -96
- package/dist/test/tiles/grid/collection-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/item-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/item-tile.test.js +0 -427
- package/dist/test/tiles/grid/item-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/search-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/search-tile.test.js +0 -66
- package/dist/test/tiles/grid/search-tile.test.js.map +0 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +0 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -282
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +0 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +0 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js +0 -57
- package/dist/test/tiles/hover/tile-hover-pane.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +0 -251
- package/dist/test/tiles/list/tile-list-compact.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list.test.js +0 -469
- package/dist/test/tiles/list/tile-list.test.js.map +0 -1
- package/dist/test/tiles/tile-dispatcher.test.d.ts +0 -1
- package/dist/test/tiles/tile-dispatcher.test.js +0 -153
- package/dist/test/tiles/tile-dispatcher.test.js.map +0 -1
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +0 -1
- package/dist/test/tiles/tile-display-value-provider.test.js +0 -142
- package/dist/test/tiles/tile-display-value-provider.test.js.map +0 -1
- package/dist/test/tiles/tile-mediatype-icon.test.d.ts +0 -1
- package/dist/test/tiles/tile-mediatype-icon.test.js +0 -145
- package/dist/test/tiles/tile-mediatype-icon.test.js.map +0 -1
- package/dist/test/utils/array-equals.test.d.ts +0 -1
- package/dist/test/utils/array-equals.test.js +0 -27
- package/dist/test/utils/array-equals.test.js.map +0 -1
- package/dist/test/utils/format-count.test.d.ts +0 -1
- package/dist/test/utils/format-count.test.js +0 -24
- package/dist/test/utils/format-count.test.js.map +0 -1
- package/dist/test/utils/format-date.test.d.ts +0 -1
- package/dist/test/utils/format-date.test.js +0 -61
- package/dist/test/utils/format-date.test.js.map +0 -1
- package/dist/test/utils/format-unit-size.test.d.ts +0 -1
- package/dist/test/utils/format-unit-size.test.js +0 -18
- package/dist/test/utils/format-unit-size.test.js.map +0 -1
- package/dist/test/utils/local-date-from-utc.test.d.ts +0 -1
- package/dist/test/utils/local-date-from-utc.test.js +0 -27
- package/dist/test/utils/local-date-from-utc.test.js.map +0 -1
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import type { SortParam } from '@internetarchive/search-service';
|
|
2
|
-
import { HTMLTemplateResult, nothing, ReactiveController, ReactiveControllerHost } from 'lit';
|
|
3
|
-
import type { TileModel } from '../../models';
|
|
4
|
-
import type { CollectionTitles } from '../../data-source/models';
|
|
5
|
-
export interface HoverPaneProperties {
|
|
6
|
-
model?: TileModel;
|
|
7
|
-
baseNavigationUrl?: string;
|
|
8
|
-
baseImageUrl?: string;
|
|
9
|
-
loggedIn: boolean;
|
|
10
|
-
suppressBlurring: boolean;
|
|
11
|
-
sortParam: SortParam | null;
|
|
12
|
-
collectionTitles?: CollectionTitles;
|
|
13
|
-
}
|
|
14
|
-
export interface HoverPaneControllerOptions {
|
|
15
|
-
offsetX?: number;
|
|
16
|
-
offsetY?: number;
|
|
17
|
-
enableLongPress?: boolean;
|
|
18
|
-
showDelay?: number;
|
|
19
|
-
hideDelay?: number;
|
|
20
|
-
longPressDelay?: number;
|
|
21
|
-
mobileBreakpoint?: number;
|
|
22
|
-
}
|
|
23
|
-
/** A common interface for providing a hover pane element. */
|
|
24
|
-
export interface HoverPaneProviderInterface {
|
|
25
|
-
/** Returns the provider's currently rendered hover pane element. */
|
|
26
|
-
getHoverPane(): HTMLElement | undefined;
|
|
27
|
-
/** Returns properties that should be passed to the hover pane. */
|
|
28
|
-
getHoverPaneProps(): HoverPaneProperties;
|
|
29
|
-
}
|
|
30
|
-
export interface ToggleHoverPaneOptions {
|
|
31
|
-
coords: {
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
};
|
|
35
|
-
enableTouchBackdrop?: boolean;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* An interface for interacting with hover pane controllers (e.g.,
|
|
39
|
-
* to retrieve their current hover pane template).
|
|
40
|
-
*/
|
|
41
|
-
export interface HoverPaneControllerInterface extends ReactiveController {
|
|
42
|
-
/**
|
|
43
|
-
* Returns the hover pane template to render based on this controller's
|
|
44
|
-
* current state. The returned template may be `nothing` if the hover
|
|
45
|
-
* pane should not currently be rendered.
|
|
46
|
-
*/
|
|
47
|
-
getTemplate(): HTMLTemplateResult | typeof nothing;
|
|
48
|
-
/**
|
|
49
|
-
* Requests to manually toggle the state of the hover pane.
|
|
50
|
-
* If the hover pane is already shown, it will begin fading out and then
|
|
51
|
-
* subsequently be hidden and removed. If the hover pane is already fading
|
|
52
|
-
* out or hidden, it will fade back in and be shown.
|
|
53
|
-
*/
|
|
54
|
-
toggleHoverPane(options: ToggleHoverPaneOptions): void;
|
|
55
|
-
}
|
|
56
|
-
export declare class HoverPaneController implements HoverPaneControllerInterface {
|
|
57
|
-
/** The host element to which this controller should attach listeners */
|
|
58
|
-
private readonly host;
|
|
59
|
-
/**
|
|
60
|
-
* The hover pane element attached to this controller's host.
|
|
61
|
-
*/
|
|
62
|
-
private hoverPane?;
|
|
63
|
-
/**
|
|
64
|
-
* The properties to be passed to the hover pane element
|
|
65
|
-
*/
|
|
66
|
-
private hoverPaneProps?;
|
|
67
|
-
/**
|
|
68
|
-
* The breakpoint (in pixels) below which the mobile interface should be used.
|
|
69
|
-
*/
|
|
70
|
-
private mobileBreakpoint?;
|
|
71
|
-
/**
|
|
72
|
-
* The number of horizontal pixels the hover pane should be offset from the
|
|
73
|
-
* pointer position.
|
|
74
|
-
*/
|
|
75
|
-
private offsetX;
|
|
76
|
-
/**
|
|
77
|
-
* The number of vertical pixels the hover pane should be offset from the
|
|
78
|
-
* pointer position.
|
|
79
|
-
*/
|
|
80
|
-
private offsetY;
|
|
81
|
-
/**
|
|
82
|
-
* The delay between the mouse idling within the host element and when the hover
|
|
83
|
-
* pane should begin fading in (in milliseconds).
|
|
84
|
-
*/
|
|
85
|
-
private showDelay;
|
|
86
|
-
/**
|
|
87
|
-
* The delay between when the mouse leaves the host element and when the hover
|
|
88
|
-
* pane should begin fading out (in milliseconds).
|
|
89
|
-
*/
|
|
90
|
-
private hideDelay;
|
|
91
|
-
/**
|
|
92
|
-
* The delay between when a touch event begins on the host element and when the
|
|
93
|
-
* hover pane should begin fading in (in milliseconds).
|
|
94
|
-
*/
|
|
95
|
-
private longPressDelay;
|
|
96
|
-
/**
|
|
97
|
-
* Whether long press interactions should cause the hover pane to appear (when
|
|
98
|
-
* below the mobile breakpoint).
|
|
99
|
-
*/
|
|
100
|
-
private enableLongPress;
|
|
101
|
-
/**
|
|
102
|
-
* Used to control the current state of this provider's hover pane.
|
|
103
|
-
* - `'hidden'` => The hover pane is not present at all.
|
|
104
|
-
* - `'shown'` => The hover pane is either fading in or fully visible.
|
|
105
|
-
* - `'fading-out'` => The hover pane is fading out and about to be removed.
|
|
106
|
-
*/
|
|
107
|
-
private hoverPaneState;
|
|
108
|
-
/** The timer ID for showing the hover pane */
|
|
109
|
-
private showTimer?;
|
|
110
|
-
/** The timer ID for hiding the hover pane */
|
|
111
|
-
private hideTimer?;
|
|
112
|
-
/** The timer ID for recognizing a long press event */
|
|
113
|
-
private longPressTimer?;
|
|
114
|
-
/**
|
|
115
|
-
* Whether the touch backdrop should currently be rendered irrespective of other touch
|
|
116
|
-
* interactions being enabled.
|
|
117
|
-
*/
|
|
118
|
-
private forceTouchBackdrop;
|
|
119
|
-
/** A record of the last mouse position on the host element, for positioning the hover pane */
|
|
120
|
-
private lastPointerClientPos;
|
|
121
|
-
constructor(
|
|
122
|
-
/** The host element to which this controller should attach listeners */
|
|
123
|
-
host: ReactiveControllerHost & HoverPaneProviderInterface & HTMLElement,
|
|
124
|
-
/** Options for adjusting the hover pane behavior (offsets, delays, etc.) */
|
|
125
|
-
options?: HoverPaneControllerOptions);
|
|
126
|
-
hostConnected(): void;
|
|
127
|
-
hostDisconnected(): void;
|
|
128
|
-
hostUpdated(): void;
|
|
129
|
-
/** @inheritdoc */
|
|
130
|
-
getTemplate(): HTMLTemplateResult | typeof nothing;
|
|
131
|
-
/** @inheritdoc */
|
|
132
|
-
toggleHoverPane(options: ToggleHoverPaneOptions): void;
|
|
133
|
-
/**
|
|
134
|
-
* Produces a template for the invisible touch capture backdrop that
|
|
135
|
-
* is used to cancel the hover pane on touch devices. We want any
|
|
136
|
-
* touch interaction on the backdrop to remove the hover pane, and
|
|
137
|
-
* we don't want to bubble up mouse events that would otherwise
|
|
138
|
-
* affect the state of the hover pane (e.g., fading it back in).
|
|
139
|
-
*/
|
|
140
|
-
private get touchBackdropTemplate();
|
|
141
|
-
private get showTouchBackdrop();
|
|
142
|
-
/** Whether to use the mobile layout */
|
|
143
|
-
private get isMobileView();
|
|
144
|
-
private get isHoverEnabled();
|
|
145
|
-
private get isTouchEnabled();
|
|
146
|
-
/** Whether this controller should currently render its hover pane. */
|
|
147
|
-
private get shouldRenderHoverPane();
|
|
148
|
-
/**
|
|
149
|
-
* Returns the desired top/left offsets (in pixels) for this tile's hover pane.
|
|
150
|
-
* The desired offsets balance positioning the hover pane under the primary pointer
|
|
151
|
-
* while preventing it from flowing outside the viewport. The returned offsets are
|
|
152
|
-
* relative to the viewport, intended to position the pane as a popover element.
|
|
153
|
-
*
|
|
154
|
-
* These offsets are only valid if the hover pane is already rendered with its
|
|
155
|
-
* correct width and height. If the hover pane is not present, the returned offsets
|
|
156
|
-
* will simply represent the current pointer position.
|
|
157
|
-
*/
|
|
158
|
-
private get hoverPaneDesiredOffsets();
|
|
159
|
-
/**
|
|
160
|
-
* Adds to the host element all the listeners necessary to make the
|
|
161
|
-
* hover pane functional.
|
|
162
|
-
*/
|
|
163
|
-
private attachListeners;
|
|
164
|
-
/**
|
|
165
|
-
* Removes all the hover pane listeners from the host element.
|
|
166
|
-
*/
|
|
167
|
-
private detachListeners;
|
|
168
|
-
/**
|
|
169
|
-
* Handler for the mouseenter event on the host element.
|
|
170
|
-
*/
|
|
171
|
-
private handleMouseEnter;
|
|
172
|
-
/**
|
|
173
|
-
* Handler for the mousemove event on the host element.
|
|
174
|
-
* Aborts any pending hide/fade-out for the hover pane, and restarts the
|
|
175
|
-
* timer to show it.
|
|
176
|
-
*/
|
|
177
|
-
private handleMouseMove;
|
|
178
|
-
/**
|
|
179
|
-
* Handler for the mouseleave event on the host element.
|
|
180
|
-
* Hides the hover pane if present, and aborts the timer for showing it.
|
|
181
|
-
*/
|
|
182
|
-
private handleMouseLeave;
|
|
183
|
-
/**
|
|
184
|
-
* Handler for the touchstart event on the host element.
|
|
185
|
-
* Begins the timer for recognizing a long press event.
|
|
186
|
-
*/
|
|
187
|
-
private handleTouchStart;
|
|
188
|
-
/**
|
|
189
|
-
* Handler for events that should cancel a pending long press event
|
|
190
|
-
* (touchmove, touchend, touchcancel). Aborts the timer for recognizing
|
|
191
|
-
* a long press.
|
|
192
|
-
*/
|
|
193
|
-
private handleLongPressCancel;
|
|
194
|
-
/**
|
|
195
|
-
* Handler for the contextmenu event, which should be suppressed during
|
|
196
|
-
* mobile long-press events on the host element.
|
|
197
|
-
*/
|
|
198
|
-
private handleContextMenu;
|
|
199
|
-
/**
|
|
200
|
-
* Immediately causes the hover pane to begin fading out, if it is present.
|
|
201
|
-
*/
|
|
202
|
-
private handleBackdropInteraction;
|
|
203
|
-
/**
|
|
204
|
-
* Aborts and restarts the timer for showing the hover pane.
|
|
205
|
-
*/
|
|
206
|
-
private restartShowHoverPaneTimer;
|
|
207
|
-
/**
|
|
208
|
-
* Causes this tile's hover pane to be rendered, positioned, and made visible.
|
|
209
|
-
*/
|
|
210
|
-
private showHoverPane;
|
|
211
|
-
/**
|
|
212
|
-
* Causes this tile's hover pane to begin fading out and starts
|
|
213
|
-
* the timer for it to be removed.
|
|
214
|
-
*/
|
|
215
|
-
private fadeOutHoverPane;
|
|
216
|
-
/**
|
|
217
|
-
* Positions the hover pane with the correct offsets.
|
|
218
|
-
*/
|
|
219
|
-
private repositionHoverPane;
|
|
220
|
-
}
|
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
import { html, nothing, } from 'lit';
|
|
2
|
-
const clamp = (val, min = -Infinity, max = Infinity) => Math.max(min, Math.min(val, max));
|
|
3
|
-
export class HoverPaneController {
|
|
4
|
-
constructor(
|
|
5
|
-
/** The host element to which this controller should attach listeners */
|
|
6
|
-
host,
|
|
7
|
-
/** Options for adjusting the hover pane behavior (offsets, delays, etc.) */
|
|
8
|
-
options = {}) {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
10
|
-
this.host = host;
|
|
11
|
-
/**
|
|
12
|
-
* The breakpoint (in pixels) below which the mobile interface should be used.
|
|
13
|
-
*/
|
|
14
|
-
this.mobileBreakpoint = 600;
|
|
15
|
-
/**
|
|
16
|
-
* The number of horizontal pixels the hover pane should be offset from the
|
|
17
|
-
* pointer position.
|
|
18
|
-
*/
|
|
19
|
-
this.offsetX = -10;
|
|
20
|
-
/**
|
|
21
|
-
* The number of vertical pixels the hover pane should be offset from the
|
|
22
|
-
* pointer position.
|
|
23
|
-
*/
|
|
24
|
-
this.offsetY = 15;
|
|
25
|
-
/**
|
|
26
|
-
* The delay between the mouse idling within the host element and when the hover
|
|
27
|
-
* pane should begin fading in (in milliseconds).
|
|
28
|
-
*/
|
|
29
|
-
this.showDelay = 300;
|
|
30
|
-
/**
|
|
31
|
-
* The delay between when the mouse leaves the host element and when the hover
|
|
32
|
-
* pane should begin fading out (in milliseconds).
|
|
33
|
-
*/
|
|
34
|
-
this.hideDelay = 100;
|
|
35
|
-
/**
|
|
36
|
-
* The delay between when a touch event begins on the host element and when the
|
|
37
|
-
* hover pane should begin fading in (in milliseconds).
|
|
38
|
-
*/
|
|
39
|
-
this.longPressDelay = 600;
|
|
40
|
-
/**
|
|
41
|
-
* Whether long press interactions should cause the hover pane to appear (when
|
|
42
|
-
* below the mobile breakpoint).
|
|
43
|
-
*/
|
|
44
|
-
this.enableLongPress = false;
|
|
45
|
-
/**
|
|
46
|
-
* Used to control the current state of this provider's hover pane.
|
|
47
|
-
* - `'hidden'` => The hover pane is not present at all.
|
|
48
|
-
* - `'shown'` => The hover pane is either fading in or fully visible.
|
|
49
|
-
* - `'fading-out'` => The hover pane is fading out and about to be removed.
|
|
50
|
-
*/
|
|
51
|
-
this.hoverPaneState = 'hidden';
|
|
52
|
-
/**
|
|
53
|
-
* Whether the touch backdrop should currently be rendered irrespective of other touch
|
|
54
|
-
* interactions being enabled.
|
|
55
|
-
*/
|
|
56
|
-
this.forceTouchBackdrop = false;
|
|
57
|
-
/** A record of the last mouse position on the host element, for positioning the hover pane */
|
|
58
|
-
this.lastPointerClientPos = { x: 0, y: 0 };
|
|
59
|
-
/**
|
|
60
|
-
* Handler for the mouseenter event on the host element.
|
|
61
|
-
*/
|
|
62
|
-
// NB: Arrow function so 'this' remains bound to the controller
|
|
63
|
-
this.handleMouseEnter = (e) => {
|
|
64
|
-
// Delegate to the mousemove handler, as they are currently processed identically
|
|
65
|
-
this.handleMouseMove(e);
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Handler for the mousemove event on the host element.
|
|
69
|
-
* Aborts any pending hide/fade-out for the hover pane, and restarts the
|
|
70
|
-
* timer to show it.
|
|
71
|
-
*/
|
|
72
|
-
// NB: Arrow function so 'this' remains bound to the controller
|
|
73
|
-
this.handleMouseMove = (e) => {
|
|
74
|
-
var _a;
|
|
75
|
-
// The mouse is within the tile, so abort any pending removal of the hover pane
|
|
76
|
-
clearTimeout(this.hideTimer);
|
|
77
|
-
// If the hover pane is currently fading out, just make it fade back in where it is
|
|
78
|
-
if (this.hoverPaneState === 'fading-out') {
|
|
79
|
-
this.hoverPaneState = 'shown';
|
|
80
|
-
(_a = this.hoverPane) === null || _a === void 0 ? void 0 : _a.classList.add('fade-in');
|
|
81
|
-
}
|
|
82
|
-
// Restart the timer to show the hover pane anytime the mouse moves within the tile
|
|
83
|
-
if (this.hoverPaneState === 'hidden') {
|
|
84
|
-
this.restartShowHoverPaneTimer();
|
|
85
|
-
this.lastPointerClientPos = { x: e.clientX, y: e.clientY };
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Handler for the mouseleave event on the host element.
|
|
90
|
-
* Hides the hover pane if present, and aborts the timer for showing it.
|
|
91
|
-
*/
|
|
92
|
-
// NB: Arrow function so 'this' remains bound to the controller
|
|
93
|
-
this.handleMouseLeave = () => {
|
|
94
|
-
// Abort any timer to show the hover pane, as the mouse has left the tile
|
|
95
|
-
clearTimeout(this.showTimer);
|
|
96
|
-
// Hide the hover pane if it's already been shown
|
|
97
|
-
clearTimeout(this.hideTimer);
|
|
98
|
-
if (this.hoverPaneState !== 'hidden') {
|
|
99
|
-
this.hideTimer = window.setTimeout(() => {
|
|
100
|
-
this.fadeOutHoverPane();
|
|
101
|
-
}, this.hideDelay);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Handler for the touchstart event on the host element.
|
|
106
|
-
* Begins the timer for recognizing a long press event.
|
|
107
|
-
*/
|
|
108
|
-
// NB: Arrow function so 'this' remains bound to the controller
|
|
109
|
-
this.handleTouchStart = (e) => {
|
|
110
|
-
clearTimeout(this.longPressTimer);
|
|
111
|
-
if (e.touches.length === 1) {
|
|
112
|
-
this.longPressTimer = window.setTimeout(() => {
|
|
113
|
-
if (this.hoverPaneState === 'hidden') {
|
|
114
|
-
this.showHoverPane();
|
|
115
|
-
}
|
|
116
|
-
}, this.longPressDelay);
|
|
117
|
-
this.lastPointerClientPos = {
|
|
118
|
-
x: e.touches[0].clientX,
|
|
119
|
-
y: e.touches[0].clientY,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* Handler for events that should cancel a pending long press event
|
|
125
|
-
* (touchmove, touchend, touchcancel). Aborts the timer for recognizing
|
|
126
|
-
* a long press.
|
|
127
|
-
*/
|
|
128
|
-
// NB: Arrow function so 'this' remains bound to the controller
|
|
129
|
-
this.handleLongPressCancel = () => {
|
|
130
|
-
clearTimeout(this.longPressTimer);
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* Handler for the contextmenu event, which should be suppressed during
|
|
134
|
-
* mobile long-press events on the host element.
|
|
135
|
-
*/
|
|
136
|
-
// NB: Arrow function so 'this' remains bound to the controller
|
|
137
|
-
this.handleContextMenu = (e) => {
|
|
138
|
-
e.preventDefault();
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* Immediately causes the hover pane to begin fading out, if it is present.
|
|
142
|
-
*/
|
|
143
|
-
// NB: Arrow function so 'this' remains bound to the controller
|
|
144
|
-
this.handleBackdropInteraction = (e) => {
|
|
145
|
-
if (this.hoverPaneState !== 'hidden') {
|
|
146
|
-
this.fadeOutHoverPane();
|
|
147
|
-
}
|
|
148
|
-
e.stopPropagation();
|
|
149
|
-
};
|
|
150
|
-
this.mobileBreakpoint = (_a = options.mobileBreakpoint) !== null && _a !== void 0 ? _a : this.mobileBreakpoint;
|
|
151
|
-
this.offsetX = (_b = options.offsetX) !== null && _b !== void 0 ? _b : this.offsetX;
|
|
152
|
-
this.offsetY = (_c = options.offsetY) !== null && _c !== void 0 ? _c : this.offsetY;
|
|
153
|
-
this.showDelay = (_d = options.showDelay) !== null && _d !== void 0 ? _d : this.showDelay;
|
|
154
|
-
this.hideDelay = (_e = options.hideDelay) !== null && _e !== void 0 ? _e : this.hideDelay;
|
|
155
|
-
this.longPressDelay = (_f = options.longPressDelay) !== null && _f !== void 0 ? _f : this.longPressDelay;
|
|
156
|
-
this.enableLongPress = (_g = options.enableLongPress) !== null && _g !== void 0 ? _g : this.enableLongPress;
|
|
157
|
-
this.host.addController(this);
|
|
158
|
-
}
|
|
159
|
-
hostConnected() {
|
|
160
|
-
this.attachListeners();
|
|
161
|
-
}
|
|
162
|
-
hostDisconnected() {
|
|
163
|
-
this.detachListeners();
|
|
164
|
-
}
|
|
165
|
-
hostUpdated() {
|
|
166
|
-
this.hoverPane = this.host.getHoverPane();
|
|
167
|
-
this.hoverPaneProps = this.host.getHoverPaneProps();
|
|
168
|
-
}
|
|
169
|
-
/** @inheritdoc */
|
|
170
|
-
getTemplate() {
|
|
171
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
172
|
-
this.hoverPaneProps = this.host.getHoverPaneProps();
|
|
173
|
-
return this.shouldRenderHoverPane
|
|
174
|
-
? html ` ${this.touchBackdropTemplate}
|
|
175
|
-
<tile-hover-pane
|
|
176
|
-
popover
|
|
177
|
-
.model=${(_a = this.hoverPaneProps) === null || _a === void 0 ? void 0 : _a.model}
|
|
178
|
-
.baseNavigationUrl=${(_b = this.hoverPaneProps) === null || _b === void 0 ? void 0 : _b.baseNavigationUrl}
|
|
179
|
-
.baseImageUrl=${(_c = this.hoverPaneProps) === null || _c === void 0 ? void 0 : _c.baseImageUrl}
|
|
180
|
-
.loggedIn=${(_d = this.hoverPaneProps) === null || _d === void 0 ? void 0 : _d.loggedIn}
|
|
181
|
-
.suppressBlurring=${(_e = this.hoverPaneProps) === null || _e === void 0 ? void 0 : _e.suppressBlurring}
|
|
182
|
-
.sortParam=${(_f = this.hoverPaneProps) === null || _f === void 0 ? void 0 : _f.sortParam}
|
|
183
|
-
.collectionTitles=${(_g = this.hoverPaneProps) === null || _g === void 0 ? void 0 : _g.collectionTitles}
|
|
184
|
-
.mobileBreakpoint=${this.mobileBreakpoint}
|
|
185
|
-
.currentWidth=${window.innerWidth}
|
|
186
|
-
></tile-hover-pane>`
|
|
187
|
-
: nothing;
|
|
188
|
-
}
|
|
189
|
-
/** @inheritdoc */
|
|
190
|
-
toggleHoverPane(options) {
|
|
191
|
-
var _a;
|
|
192
|
-
if (this.hoverPaneState === 'shown') {
|
|
193
|
-
this.fadeOutHoverPane();
|
|
194
|
-
this.forceTouchBackdrop = false;
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
this.lastPointerClientPos = options.coords;
|
|
198
|
-
this.forceTouchBackdrop = (_a = options.enableTouchBackdrop) !== null && _a !== void 0 ? _a : false;
|
|
199
|
-
this.showHoverPane();
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Produces a template for the invisible touch capture backdrop that
|
|
204
|
-
* is used to cancel the hover pane on touch devices. We want any
|
|
205
|
-
* touch interaction on the backdrop to remove the hover pane, and
|
|
206
|
-
* we don't want to bubble up mouse events that would otherwise
|
|
207
|
-
* affect the state of the hover pane (e.g., fading it back in).
|
|
208
|
-
*/
|
|
209
|
-
get touchBackdropTemplate() {
|
|
210
|
-
return this.showTouchBackdrop
|
|
211
|
-
? html `<div
|
|
212
|
-
id="touch-backdrop"
|
|
213
|
-
@touchstart=${this.handleBackdropInteraction}
|
|
214
|
-
@touchmove=${this.handleBackdropInteraction}
|
|
215
|
-
@touchend=${this.handleBackdropInteraction}
|
|
216
|
-
@touchcancel=${this.handleBackdropInteraction}
|
|
217
|
-
@mouseenter=${(e) => e.stopPropagation()}
|
|
218
|
-
@mousemove=${(e) => e.stopPropagation()}
|
|
219
|
-
@mouseleave=${(e) => e.stopPropagation()}
|
|
220
|
-
></div>`
|
|
221
|
-
: nothing;
|
|
222
|
-
}
|
|
223
|
-
get showTouchBackdrop() {
|
|
224
|
-
return ((this.isTouchEnabled && this.enableLongPress) || this.forceTouchBackdrop);
|
|
225
|
-
}
|
|
226
|
-
/** Whether to use the mobile layout */
|
|
227
|
-
get isMobileView() {
|
|
228
|
-
return !!this.mobileBreakpoint && window.innerWidth < this.mobileBreakpoint;
|
|
229
|
-
}
|
|
230
|
-
get isHoverEnabled() {
|
|
231
|
-
return window.matchMedia('(hover: hover)').matches;
|
|
232
|
-
}
|
|
233
|
-
get isTouchEnabled() {
|
|
234
|
-
return ('ontouchstart' in window &&
|
|
235
|
-
window.matchMedia('(any-pointer: coarse)').matches);
|
|
236
|
-
}
|
|
237
|
-
/** Whether this controller should currently render its hover pane. */
|
|
238
|
-
get shouldRenderHoverPane() {
|
|
239
|
-
return this.hoverPaneState !== 'hidden';
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Returns the desired top/left offsets (in pixels) for this tile's hover pane.
|
|
243
|
-
* The desired offsets balance positioning the hover pane under the primary pointer
|
|
244
|
-
* while preventing it from flowing outside the viewport. The returned offsets are
|
|
245
|
-
* relative to the viewport, intended to position the pane as a popover element.
|
|
246
|
-
*
|
|
247
|
-
* These offsets are only valid if the hover pane is already rendered with its
|
|
248
|
-
* correct width and height. If the hover pane is not present, the returned offsets
|
|
249
|
-
* will simply represent the current pointer position.
|
|
250
|
-
*/
|
|
251
|
-
get hoverPaneDesiredOffsets() {
|
|
252
|
-
// Try to find offsets for the hover pane that:
|
|
253
|
-
// (a) cause it to lie entirely within the viewport, and
|
|
254
|
-
// (b) to the extent possible, minimize the distance between the
|
|
255
|
-
// nearest corner of the hover pane and the mouse position
|
|
256
|
-
// (with some additional offsets applied after the fact).
|
|
257
|
-
var _a;
|
|
258
|
-
let [left, top] = [
|
|
259
|
-
this.lastPointerClientPos.x,
|
|
260
|
-
this.lastPointerClientPos.y,
|
|
261
|
-
];
|
|
262
|
-
// Flip the hover pane according to which quadrant of the viewport the mouse is in.
|
|
263
|
-
// (Similar to how Wikipedia's link hover panes work)
|
|
264
|
-
const flipHorizontal = this.lastPointerClientPos.x > window.innerWidth / 2;
|
|
265
|
-
const flipVertical = this.lastPointerClientPos.y > window.innerHeight / 2;
|
|
266
|
-
const hoverPaneRect = (_a = this.hoverPane) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
267
|
-
if (hoverPaneRect) {
|
|
268
|
-
// If we need to flip the hover pane, do so by subtracting its width/height from left/top
|
|
269
|
-
if (flipHorizontal) {
|
|
270
|
-
left -= hoverPaneRect.width;
|
|
271
|
-
}
|
|
272
|
-
if (flipVertical) {
|
|
273
|
-
top -= hoverPaneRect.height;
|
|
274
|
-
}
|
|
275
|
-
// Apply desired offsets from the mouse position
|
|
276
|
-
left += (flipHorizontal ? -1 : 1) * this.offsetX;
|
|
277
|
-
top += (flipVertical ? -1 : 1) * this.offsetY;
|
|
278
|
-
// On mobile view, shunt the hover pane to avoid overflowing the viewport
|
|
279
|
-
if (this.isMobileView) {
|
|
280
|
-
left = clamp(left, 20, window.innerWidth - hoverPaneRect.width - 20);
|
|
281
|
-
top = clamp(top, 20, window.innerHeight - hoverPaneRect.height - 20);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
left += window.scrollX;
|
|
285
|
-
top += window.scrollY;
|
|
286
|
-
return { left, top };
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Adds to the host element all the listeners necessary to make the
|
|
290
|
-
* hover pane functional.
|
|
291
|
-
*/
|
|
292
|
-
attachListeners() {
|
|
293
|
-
if (this.isHoverEnabled) {
|
|
294
|
-
this.host.addEventListener('mouseenter', this.handleMouseEnter);
|
|
295
|
-
this.host.addEventListener('mousemove', this.handleMouseMove);
|
|
296
|
-
this.host.addEventListener('mouseleave', this.handleMouseLeave);
|
|
297
|
-
}
|
|
298
|
-
if (this.isTouchEnabled && this.enableLongPress) {
|
|
299
|
-
this.host.addEventListener('touchstart', this.handleTouchStart);
|
|
300
|
-
this.host.addEventListener('touchmove', this.handleLongPressCancel);
|
|
301
|
-
this.host.addEventListener('touchend', this.handleLongPressCancel);
|
|
302
|
-
this.host.addEventListener('touchcancel', this.handleLongPressCancel);
|
|
303
|
-
this.host.addEventListener('contextmenu', this.handleContextMenu);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Removes all the hover pane listeners from the host element.
|
|
308
|
-
*/
|
|
309
|
-
detachListeners() {
|
|
310
|
-
this.host.removeEventListener('mouseenter', this.handleMouseEnter);
|
|
311
|
-
this.host.removeEventListener('mousemove', this.handleMouseMove);
|
|
312
|
-
this.host.removeEventListener('mouseleave', this.handleMouseLeave);
|
|
313
|
-
this.host.removeEventListener('touchstart', this.handleTouchStart);
|
|
314
|
-
this.host.removeEventListener('touchmove', this.handleLongPressCancel);
|
|
315
|
-
this.host.removeEventListener('touchend', this.handleLongPressCancel);
|
|
316
|
-
this.host.removeEventListener('touchcancel', this.handleLongPressCancel);
|
|
317
|
-
this.host.removeEventListener('contextmenu', this.handleContextMenu);
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Aborts and restarts the timer for showing the hover pane.
|
|
321
|
-
*/
|
|
322
|
-
restartShowHoverPaneTimer() {
|
|
323
|
-
clearTimeout(this.showTimer);
|
|
324
|
-
this.showTimer = window.setTimeout(() => {
|
|
325
|
-
this.showHoverPane();
|
|
326
|
-
}, this.showDelay);
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Causes this tile's hover pane to be rendered, positioned, and made visible.
|
|
330
|
-
*/
|
|
331
|
-
async showHoverPane() {
|
|
332
|
-
var _a, _b, _c, _d;
|
|
333
|
-
this.hoverPaneState = 'shown';
|
|
334
|
-
this.host.requestUpdate();
|
|
335
|
-
// Wait for the state update to render the hover pane
|
|
336
|
-
await this.host.updateComplete;
|
|
337
|
-
// Ensure the hover pane element is still in the document before showing,
|
|
338
|
-
// as it might have been removed by the previous update.
|
|
339
|
-
if (!((_a = this.hoverPane) === null || _a === void 0 ? void 0 : _a.isConnected))
|
|
340
|
-
return;
|
|
341
|
-
(_c = (_b = this.hoverPane) === null || _b === void 0 ? void 0 : _b.showPopover) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
342
|
-
await new Promise(resolve => {
|
|
343
|
-
// Pane sizes aren't accurate until next frame
|
|
344
|
-
requestAnimationFrame(resolve);
|
|
345
|
-
});
|
|
346
|
-
// Apply the correct positioning to the hover pane
|
|
347
|
-
this.repositionHoverPane();
|
|
348
|
-
// The hover pane is initially not visible (to avoid it shifting around
|
|
349
|
-
// while being positioned). Since it now has the correct positioning, we
|
|
350
|
-
// can make it visible and begin its fade-in animation.
|
|
351
|
-
(_d = this.hoverPane) === null || _d === void 0 ? void 0 : _d.classList.add('visible', 'fade-in');
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Causes this tile's hover pane to begin fading out and starts
|
|
355
|
-
* the timer for it to be removed.
|
|
356
|
-
*/
|
|
357
|
-
fadeOutHoverPane() {
|
|
358
|
-
var _a;
|
|
359
|
-
this.hoverPaneState = 'fading-out';
|
|
360
|
-
(_a = this.hoverPane) === null || _a === void 0 ? void 0 : _a.classList.remove('fade-in');
|
|
361
|
-
clearTimeout(this.hideTimer);
|
|
362
|
-
this.hideTimer = window.setTimeout(() => {
|
|
363
|
-
this.hoverPaneState = 'hidden';
|
|
364
|
-
this.host.requestUpdate();
|
|
365
|
-
}, 100);
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Positions the hover pane with the correct offsets.
|
|
369
|
-
*/
|
|
370
|
-
repositionHoverPane() {
|
|
371
|
-
if (!this.hoverPane)
|
|
372
|
-
return;
|
|
373
|
-
const { top, left } = this.hoverPaneDesiredOffsets;
|
|
374
|
-
this.hoverPane.style.top = `${top}px`;
|
|
375
|
-
this.hoverPane.style.left = `${left}px`;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
//# sourceMappingURL=hover-pane-controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hover-pane-controller.js","sourceRoot":"","sources":["../../../../src/tiles/hover/hover-pane-controller.ts"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,EAEJ,OAAO,GAGR,MAAM,KAAK,CAAC;AA4Db,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAG,GAAG,CAAC,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,EAAE,CAC7D,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEpC,MAAM,OAAO,mBAAmB;IA8E9B;IACE,wEAAwE;IACvD,IAEJ;IACb,4EAA4E;IAC5E,UAAsC,EAAE;;QAJvB,SAAI,GAAJ,IAAI,CAER;QAvEf;;WAEG;QACK,qBAAgB,GAAY,GAAG,CAAC;QAExC;;;WAGG;QACK,YAAO,GAAW,CAAC,EAAE,CAAC;QAE9B;;;WAGG;QACK,YAAO,GAAW,EAAE,CAAC;QAE7B;;;WAGG;QACK,cAAS,GAAW,GAAG,CAAC;QAEhC;;;WAGG;QACK,cAAS,GAAW,GAAG,CAAC;QAEhC;;;WAGG;QACK,mBAAc,GAAW,GAAG,CAAC;QAErC;;;WAGG;QACK,oBAAe,GAAY,KAAK,CAAC;QAEzC;;;;;WAKG;QACK,mBAAc,GAAmB,QAAQ,CAAC;QAWlD;;;WAGG;QACK,uBAAkB,GAAY,KAAK,CAAC;QAE5C,8FAA8F;QACtF,yBAAoB,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QA4M9C;;WAEG;QACH,+DAA+D;QACvD,qBAAgB,GAAG,CAAC,CAAa,EAAQ,EAAE;YACjD,iFAAiF;YACjF,IAA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uB,CAAC;QACnD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;QACtC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC;IAC1C,CAAC;CACF","sourcesContent":["import type { SortParam } from '@internetarchive/search-service';\nimport {\n html,\n HTMLTemplateResult,\n nothing,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\nimport type { TileModel } from '../../models';\nimport type { CollectionTitles } from '../../data-source/models';\n\ntype HoverPaneState = 'hidden' | 'shown' | 'fading-out';\n\nexport interface HoverPaneProperties {\n model?: TileModel;\n baseNavigationUrl?: string;\n baseImageUrl?: string;\n loggedIn: boolean;\n suppressBlurring: boolean;\n sortParam: SortParam | null;\n collectionTitles?: CollectionTitles;\n}\n\nexport interface HoverPaneControllerOptions {\n offsetX?: number;\n offsetY?: number;\n enableLongPress?: boolean;\n showDelay?: number;\n hideDelay?: number;\n longPressDelay?: number;\n mobileBreakpoint?: number;\n}\n\n/** A common interface for providing a hover pane element. */\nexport interface HoverPaneProviderInterface {\n /** Returns the provider's currently rendered hover pane element. */\n getHoverPane(): HTMLElement | undefined;\n /** Returns properties that should be passed to the hover pane. */\n getHoverPaneProps(): HoverPaneProperties;\n}\n\nexport interface ToggleHoverPaneOptions {\n coords: { x: number; y: number };\n enableTouchBackdrop?: boolean;\n}\n\n/**\n * An interface for interacting with hover pane controllers (e.g.,\n * to retrieve their current hover pane template).\n */\nexport interface HoverPaneControllerInterface extends ReactiveController {\n /**\n * Returns the hover pane template to render based on this controller's\n * current state. The returned template may be `nothing` if the hover\n * pane should not currently be rendered.\n */\n getTemplate(): HTMLTemplateResult | typeof nothing;\n\n /**\n * Requests to manually toggle the state of the hover pane.\n * If the hover pane is already shown, it will begin fading out and then\n * subsequently be hidden and removed. If the hover pane is already fading\n * out or hidden, it will fade back in and be shown.\n */\n toggleHoverPane(options: ToggleHoverPaneOptions): void;\n}\n\nconst clamp = (val: number, min = -Infinity, max = Infinity) =>\n Math.max(min, Math.min(val, max));\n\nexport class HoverPaneController implements HoverPaneControllerInterface {\n /**\n * The hover pane element attached to this controller's host.\n */\n private hoverPane?: HTMLElement;\n\n /**\n * The properties to be passed to the hover pane element\n */\n private hoverPaneProps?: HoverPaneProperties;\n\n /**\n * The breakpoint (in pixels) below which the mobile interface should be used.\n */\n private mobileBreakpoint?: number = 600;\n\n /**\n * The number of horizontal pixels the hover pane should be offset from the\n * pointer position.\n */\n private offsetX: number = -10;\n\n /**\n * The number of vertical pixels the hover pane should be offset from the\n * pointer position.\n */\n private offsetY: number = 15;\n\n /**\n * The delay between the mouse idling within the host element and when the hover\n * pane should begin fading in (in milliseconds).\n */\n private showDelay: number = 300;\n\n /**\n * The delay between when the mouse leaves the host element and when the hover\n * pane should begin fading out (in milliseconds).\n */\n private hideDelay: number = 100;\n\n /**\n * The delay between when a touch event begins on the host element and when the\n * hover pane should begin fading in (in milliseconds).\n */\n private longPressDelay: number = 600;\n\n /**\n * Whether long press interactions should cause the hover pane to appear (when\n * below the mobile breakpoint).\n */\n private enableLongPress: boolean = false;\n\n /**\n * Used to control the current state of this provider's hover pane.\n * - `'hidden'` => The hover pane is not present at all.\n * - `'shown'` => The hover pane is either fading in or fully visible.\n * - `'fading-out'` => The hover pane is fading out and about to be removed.\n */\n private hoverPaneState: HoverPaneState = 'hidden';\n\n /** The timer ID for showing the hover pane */\n private showTimer?: number;\n\n /** The timer ID for hiding the hover pane */\n private hideTimer?: number;\n\n /** The timer ID for recognizing a long press event */\n private longPressTimer?: number;\n\n /**\n * Whether the touch backdrop should currently be rendered irrespective of other touch\n * interactions being enabled.\n */\n private forceTouchBackdrop: boolean = false;\n\n /** A record of the last mouse position on the host element, for positioning the hover pane */\n private lastPointerClientPos = { x: 0, y: 0 };\n\n constructor(\n /** The host element to which this controller should attach listeners */\n private readonly host: ReactiveControllerHost &\n HoverPaneProviderInterface &\n HTMLElement,\n /** Options for adjusting the hover pane behavior (offsets, delays, etc.) */\n options: HoverPaneControllerOptions = {},\n ) {\n this.mobileBreakpoint = options.mobileBreakpoint ?? this.mobileBreakpoint;\n this.offsetX = options.offsetX ?? this.offsetX;\n this.offsetY = options.offsetY ?? this.offsetY;\n this.showDelay = options.showDelay ?? this.showDelay;\n this.hideDelay = options.hideDelay ?? this.hideDelay;\n this.longPressDelay = options.longPressDelay ?? this.longPressDelay;\n this.enableLongPress = options.enableLongPress ?? this.enableLongPress;\n\n this.host.addController(this);\n }\n\n hostConnected(): void {\n this.attachListeners();\n }\n\n hostDisconnected(): void {\n this.detachListeners();\n }\n\n hostUpdated(): void {\n this.hoverPane = this.host.getHoverPane();\n this.hoverPaneProps = this.host.getHoverPaneProps();\n }\n\n /** @inheritdoc */\n getTemplate(): HTMLTemplateResult | typeof nothing {\n this.hoverPaneProps = this.host.getHoverPaneProps();\n\n return this.shouldRenderHoverPane\n ? html` ${this.touchBackdropTemplate}\n <tile-hover-pane\n popover\n .model=${this.hoverPaneProps?.model}\n .baseNavigationUrl=${this.hoverPaneProps?.baseNavigationUrl}\n .baseImageUrl=${this.hoverPaneProps?.baseImageUrl}\n .loggedIn=${this.hoverPaneProps?.loggedIn}\n .suppressBlurring=${this.hoverPaneProps?.suppressBlurring}\n .sortParam=${this.hoverPaneProps?.sortParam}\n .collectionTitles=${this.hoverPaneProps?.collectionTitles}\n .mobileBreakpoint=${this.mobileBreakpoint}\n .currentWidth=${window.innerWidth}\n ></tile-hover-pane>`\n : nothing;\n }\n\n /** @inheritdoc */\n toggleHoverPane(options: ToggleHoverPaneOptions): void {\n if (this.hoverPaneState === 'shown') {\n this.fadeOutHoverPane();\n this.forceTouchBackdrop = false;\n } else {\n this.lastPointerClientPos = options.coords;\n this.forceTouchBackdrop = options.enableTouchBackdrop ?? false;\n this.showHoverPane();\n }\n }\n\n /**\n * Produces a template for the invisible touch capture backdrop that\n * is used to cancel the hover pane on touch devices. We want any\n * touch interaction on the backdrop to remove the hover pane, and\n * we don't want to bubble up mouse events that would otherwise\n * affect the state of the hover pane (e.g., fading it back in).\n */\n private get touchBackdropTemplate(): HTMLTemplateResult | typeof nothing {\n return this.showTouchBackdrop\n ? html`<div\n id=\"touch-backdrop\"\n @touchstart=${this.handleBackdropInteraction}\n @touchmove=${this.handleBackdropInteraction}\n @touchend=${this.handleBackdropInteraction}\n @touchcancel=${this.handleBackdropInteraction}\n @mouseenter=${(e: MouseEvent) => e.stopPropagation()}\n @mousemove=${(e: MouseEvent) => e.stopPropagation()}\n @mouseleave=${(e: MouseEvent) => e.stopPropagation()}\n ></div>`\n : nothing;\n }\n\n private get showTouchBackdrop(): boolean {\n return (\n (this.isTouchEnabled && this.enableLongPress) || this.forceTouchBackdrop\n );\n }\n\n /** Whether to use the mobile layout */\n private get isMobileView(): boolean {\n return !!this.mobileBreakpoint && window.innerWidth < this.mobileBreakpoint;\n }\n\n private get isHoverEnabled(): boolean {\n return window.matchMedia('(hover: hover)').matches;\n }\n\n private get isTouchEnabled(): boolean {\n return (\n 'ontouchstart' in window &&\n window.matchMedia('(any-pointer: coarse)').matches\n );\n }\n\n /** Whether this controller should currently render its hover pane. */\n private get shouldRenderHoverPane(): boolean {\n return this.hoverPaneState !== 'hidden';\n }\n\n /**\n * Returns the desired top/left offsets (in pixels) for this tile's hover pane.\n * The desired offsets balance positioning the hover pane under the primary pointer\n * while preventing it from flowing outside the viewport. The returned offsets are\n * relative to the viewport, intended to position the pane as a popover element.\n *\n * These offsets are only valid if the hover pane is already rendered with its\n * correct width and height. If the hover pane is not present, the returned offsets\n * will simply represent the current pointer position.\n */\n private get hoverPaneDesiredOffsets(): { top: number; left: number } {\n // Try to find offsets for the hover pane that:\n // (a) cause it to lie entirely within the viewport, and\n // (b) to the extent possible, minimize the distance between the\n // nearest corner of the hover pane and the mouse position\n // (with some additional offsets applied after the fact).\n\n let [left, top] = [\n this.lastPointerClientPos.x,\n this.lastPointerClientPos.y,\n ];\n\n // Flip the hover pane according to which quadrant of the viewport the mouse is in.\n // (Similar to how Wikipedia's link hover panes work)\n const flipHorizontal = this.lastPointerClientPos.x > window.innerWidth / 2;\n const flipVertical = this.lastPointerClientPos.y > window.innerHeight / 2;\n\n const hoverPaneRect = this.hoverPane?.getBoundingClientRect();\n if (hoverPaneRect) {\n // If we need to flip the hover pane, do so by subtracting its width/height from left/top\n if (flipHorizontal) {\n left -= hoverPaneRect.width;\n }\n if (flipVertical) {\n top -= hoverPaneRect.height;\n }\n\n // Apply desired offsets from the mouse position\n left += (flipHorizontal ? -1 : 1) * this.offsetX;\n top += (flipVertical ? -1 : 1) * this.offsetY;\n\n // On mobile view, shunt the hover pane to avoid overflowing the viewport\n if (this.isMobileView) {\n left = clamp(left, 20, window.innerWidth - hoverPaneRect.width - 20);\n top = clamp(top, 20, window.innerHeight - hoverPaneRect.height - 20);\n }\n }\n\n left += window.scrollX;\n top += window.scrollY;\n\n return { left, top };\n }\n\n /**\n * Adds to the host element all the listeners necessary to make the\n * hover pane functional.\n */\n private attachListeners(): void {\n if (this.isHoverEnabled) {\n this.host.addEventListener('mouseenter', this.handleMouseEnter);\n this.host.addEventListener('mousemove', this.handleMouseMove);\n this.host.addEventListener('mouseleave', this.handleMouseLeave);\n }\n\n if (this.isTouchEnabled && this.enableLongPress) {\n this.host.addEventListener('touchstart', this.handleTouchStart);\n this.host.addEventListener('touchmove', this.handleLongPressCancel);\n this.host.addEventListener('touchend', this.handleLongPressCancel);\n this.host.addEventListener('touchcancel', this.handleLongPressCancel);\n this.host.addEventListener('contextmenu', this.handleContextMenu);\n }\n }\n\n /**\n * Removes all the hover pane listeners from the host element.\n */\n private detachListeners(): void {\n this.host.removeEventListener('mouseenter', this.handleMouseEnter);\n this.host.removeEventListener('mousemove', this.handleMouseMove);\n this.host.removeEventListener('mouseleave', this.handleMouseLeave);\n this.host.removeEventListener('touchstart', this.handleTouchStart);\n this.host.removeEventListener('touchmove', this.handleLongPressCancel);\n this.host.removeEventListener('touchend', this.handleLongPressCancel);\n this.host.removeEventListener('touchcancel', this.handleLongPressCancel);\n this.host.removeEventListener('contextmenu', this.handleContextMenu);\n }\n\n /**\n * Handler for the mouseenter event on the host element.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleMouseEnter = (e: MouseEvent): void => {\n // Delegate to the mousemove handler, as they are currently processed identically\n this.handleMouseMove(e);\n };\n\n /**\n * Handler for the mousemove event on the host element.\n * Aborts any pending hide/fade-out for the hover pane, and restarts the\n * timer to show it.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleMouseMove = (e: MouseEvent): void => {\n // The mouse is within the tile, so abort any pending removal of the hover pane\n clearTimeout(this.hideTimer);\n\n // If the hover pane is currently fading out, just make it fade back in where it is\n if (this.hoverPaneState === 'fading-out') {\n this.hoverPaneState = 'shown';\n this.hoverPane?.classList.add('fade-in');\n }\n\n // Restart the timer to show the hover pane anytime the mouse moves within the tile\n if (this.hoverPaneState === 'hidden') {\n this.restartShowHoverPaneTimer();\n this.lastPointerClientPos = { x: e.clientX, y: e.clientY };\n }\n };\n\n /**\n * Handler for the mouseleave event on the host element.\n * Hides the hover pane if present, and aborts the timer for showing it.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleMouseLeave = (): void => {\n // Abort any timer to show the hover pane, as the mouse has left the tile\n clearTimeout(this.showTimer);\n\n // Hide the hover pane if it's already been shown\n clearTimeout(this.hideTimer);\n if (this.hoverPaneState !== 'hidden') {\n this.hideTimer = window.setTimeout(() => {\n this.fadeOutHoverPane();\n }, this.hideDelay);\n }\n };\n\n /**\n * Handler for the touchstart event on the host element.\n * Begins the timer for recognizing a long press event.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleTouchStart = (e: TouchEvent): void => {\n clearTimeout(this.longPressTimer);\n\n if (e.touches.length === 1) {\n this.longPressTimer = window.setTimeout(() => {\n if (this.hoverPaneState === 'hidden') {\n this.showHoverPane();\n }\n }, this.longPressDelay);\n\n this.lastPointerClientPos = {\n x: e.touches[0].clientX,\n y: e.touches[0].clientY,\n };\n }\n };\n\n /**\n * Handler for events that should cancel a pending long press event\n * (touchmove, touchend, touchcancel). Aborts the timer for recognizing\n * a long press.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleLongPressCancel = (): void => {\n clearTimeout(this.longPressTimer);\n };\n\n /**\n * Handler for the contextmenu event, which should be suppressed during\n * mobile long-press events on the host element.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleContextMenu = (e: Event): void => {\n e.preventDefault();\n };\n\n /**\n * Immediately causes the hover pane to begin fading out, if it is present.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleBackdropInteraction = (e: Event): void => {\n if (this.hoverPaneState !== 'hidden') {\n this.fadeOutHoverPane();\n }\n e.stopPropagation();\n };\n\n /**\n * Aborts and restarts the timer for showing the hover pane.\n */\n private restartShowHoverPaneTimer(): void {\n clearTimeout(this.showTimer);\n this.showTimer = window.setTimeout(() => {\n this.showHoverPane();\n }, this.showDelay);\n }\n\n /**\n * Causes this tile's hover pane to be rendered, positioned, and made visible.\n */\n private async showHoverPane(): Promise<void> {\n this.hoverPaneState = 'shown';\n this.host.requestUpdate();\n\n // Wait for the state update to render the hover pane\n await this.host.updateComplete;\n\n // Ensure the hover pane element is still in the document before showing,\n // as it might have been removed by the previous update.\n if (!this.hoverPane?.isConnected) return;\n\n this.hoverPane?.showPopover?.();\n await new Promise(resolve => {\n // Pane sizes aren't accurate until next frame\n requestAnimationFrame(resolve);\n });\n\n // Apply the correct positioning to the hover pane\n this.repositionHoverPane();\n\n // The hover pane is initially not visible (to avoid it shifting around\n // while being positioned). Since it now has the correct positioning, we\n // can make it visible and begin its fade-in animation.\n this.hoverPane?.classList.add('visible', 'fade-in');\n }\n\n /**\n * Causes this tile's hover pane to begin fading out and starts\n * the timer for it to be removed.\n */\n private fadeOutHoverPane(): void {\n this.hoverPaneState = 'fading-out';\n this.hoverPane?.classList.remove('fade-in');\n\n clearTimeout(this.hideTimer);\n this.hideTimer = window.setTimeout(() => {\n this.hoverPaneState = 'hidden';\n this.host.requestUpdate();\n }, 100);\n }\n\n /**\n * Positions the hover pane with the correct offsets.\n */\n private repositionHoverPane(): void {\n if (!this.hoverPane) return;\n\n const { top, left } = this.hoverPaneDesiredOffsets;\n this.hoverPane.style.top = `${top}px`;\n this.hoverPane.style.left = `${left}px`;\n }\n}\n"]}
|