@internetarchive/collection-browser 1.14.9-alpha.2 → 1.14.9
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/.editorconfig +29 -29
- package/.husky/pre-commit +4 -4
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -9
- package/dist/src/app-root.d.ts +72 -72
- package/dist/src/app-root.js +347 -347
- package/dist/src/assets/img/icons/arrow-left.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-left.js +2 -2
- package/dist/src/assets/img/icons/arrow-right.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-right.js +2 -2
- package/dist/src/assets/img/icons/chevron.d.ts +2 -2
- package/dist/src/assets/img/icons/chevron.js +2 -2
- package/dist/src/assets/img/icons/contract.d.ts +2 -2
- package/dist/src/assets/img/icons/contract.js +2 -2
- package/dist/src/assets/img/icons/empty-query.d.ts +2 -2
- package/dist/src/assets/img/icons/empty-query.js +2 -2
- package/dist/src/assets/img/icons/expand.d.ts +2 -2
- package/dist/src/assets/img/icons/expand.js +2 -2
- package/dist/src/assets/img/icons/eye-closed.d.ts +2 -2
- package/dist/src/assets/img/icons/eye-closed.js +2 -2
- package/dist/src/assets/img/icons/eye.d.ts +2 -2
- package/dist/src/assets/img/icons/eye.js +2 -2
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.js +2 -2
- package/dist/src/assets/img/icons/login-required.d.ts +1 -1
- package/dist/src/assets/img/icons/login-required.js +2 -2
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/account.js +2 -2
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/audio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/collection.js +2 -2
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/data.js +2 -2
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/etree.js +2 -2
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/film.js +2 -2
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/images.js +2 -2
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/radio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/search.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/search.js +2 -2
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/software.js +2 -2
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/texts.js +2 -2
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/tv.js +2 -2
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/video.js +2 -2
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/web.js +2 -2
- package/dist/src/assets/img/icons/null-result.d.ts +2 -2
- package/dist/src/assets/img/icons/null-result.js +2 -2
- package/dist/src/assets/img/icons/restricted.d.ts +1 -1
- package/dist/src/assets/img/icons/restricted.js +2 -2
- package/dist/src/assets/img/icons/reviews.d.ts +1 -1
- package/dist/src/assets/img/icons/reviews.js +2 -2
- package/dist/src/assets/img/icons/upload.d.ts +1 -1
- package/dist/src/assets/img/icons/upload.js +2 -2
- package/dist/src/assets/img/icons/views.d.ts +1 -1
- package/dist/src/assets/img/icons/views.js +2 -2
- package/dist/src/circular-activity-indicator.d.ts +5 -5
- package/dist/src/circular-activity-indicator.js +17 -17
- package/dist/src/collection-browser.d.ts +533 -533
- package/dist/src/collection-browser.js +1891 -1893
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -5
- package/dist/src/collection-facets/facet-tombstone-row.js +15 -15
- package/dist/src/collection-facets/facets-template.d.ts +20 -20
- package/dist/src/collection-facets/facets-template.js +152 -152
- package/dist/src/collection-facets/more-facets-content.d.ts +77 -77
- package/dist/src/collection-facets/more-facets-content.js +359 -359
- package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
- package/dist/src/collection-facets/more-facets-pagination.js +196 -196
- package/dist/src/collection-facets/toggle-switch.d.ts +41 -41
- package/dist/src/collection-facets/toggle-switch.js +94 -94
- package/dist/src/collection-facets.d.ts +104 -104
- package/dist/src/collection-facets.js +506 -506
- package/dist/src/empty-placeholder.d.ts +23 -23
- package/dist/src/empty-placeholder.js +74 -74
- package/dist/src/expanded-date-picker.d.ts +43 -43
- package/dist/src/expanded-date-picker.js +109 -109
- package/dist/src/language-code-handler/language-code-handler.d.ts +37 -37
- package/dist/src/language-code-handler/language-code-handler.js +26 -26
- package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +562 -562
- package/dist/src/manage/manage-bar.d.ts +26 -26
- package/dist/src/manage/manage-bar.js +53 -53
- package/dist/src/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +91 -91
- package/dist/src/models.d.ts +164 -164
- package/dist/src/models.js +269 -269
- package/dist/src/restoration-state-handler.d.ts +70 -70
- package/dist/src/restoration-state-handler.js +355 -355
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +6 -6
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +24 -24
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +21 -21
- package/dist/src/sort-filter-bar/alpha-bar.js +128 -128
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/compact.js +2 -2
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/list.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.js +2 -2
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/tile.js +2 -2
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +208 -208
- package/dist/src/sort-filter-bar/sort-filter-bar.js +637 -637
- package/dist/src/styles/item-image-styles.d.ts +8 -8
- package/dist/src/styles/item-image-styles.js +9 -9
- package/dist/src/styles/sr-only.d.ts +1 -1
- package/dist/src/styles/sr-only.js +2 -2
- package/dist/src/tiles/base-tile-component.d.ts +19 -19
- package/dist/src/tiles/base-tile-component.js +63 -63
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -5
- package/dist/src/tiles/collection-browser-loading-tile.js +15 -15
- package/dist/src/tiles/grid/account-tile.d.ts +18 -18
- package/dist/src/tiles/grid/account-tile.js +72 -72
- package/dist/src/tiles/grid/collection-tile.d.ts +15 -15
- package/dist/src/tiles/grid/collection-tile.js +80 -80
- package/dist/src/tiles/grid/item-tile.d.ts +27 -27
- package/dist/src/tiles/grid/item-tile.js +134 -134
- package/dist/src/tiles/grid/search-tile.d.ts +10 -10
- package/dist/src/tiles/grid/search-tile.js +51 -51
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +8 -8
- package/dist/src/tiles/grid/tile-stats.d.ts +11 -11
- package/dist/src/tiles/grid/tile-stats.js +48 -48
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +219 -219
- package/dist/src/tiles/hover/hover-pane-controller.js +352 -352
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +15 -15
- package/dist/src/tiles/hover/tile-hover-pane.js +38 -38
- package/dist/src/tiles/image-block.d.ts +17 -17
- package/dist/src/tiles/image-block.js +73 -73
- package/dist/src/tiles/item-image.d.ts +36 -36
- package/dist/src/tiles/item-image.js +127 -127
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +6 -6
- package/dist/src/tiles/list/tile-list-compact-header.js +38 -38
- package/dist/src/tiles/list/tile-list-compact.d.ts +15 -15
- package/dist/src/tiles/list/tile-list-compact.js +114 -114
- package/dist/src/tiles/list/tile-list.d.ts +46 -46
- package/dist/src/tiles/list/tile-list.js +302 -302
- package/dist/src/tiles/mediatype-icon.d.ts +9 -9
- package/dist/src/tiles/mediatype-icon.js +47 -47
- package/dist/src/tiles/overlay/icon-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/icon-overlay.js +40 -40
- package/dist/src/tiles/overlay/icon-text-overlay.d.ts +9 -9
- package/dist/src/tiles/overlay/icon-text-overlay.js +38 -38
- package/dist/src/tiles/overlay/text-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/text-overlay.js +42 -42
- package/dist/src/tiles/text-snippet-block.d.ts +27 -27
- package/dist/src/tiles/text-snippet-block.js +73 -73
- package/dist/src/tiles/tile-dispatcher.d.ts +64 -64
- package/dist/src/tiles/tile-dispatcher.js +231 -231
- package/dist/src/tiles/tile-display-value-provider.d.ts +43 -43
- package/dist/src/tiles/tile-display-value-provider.js +80 -80
- package/dist/src/utils/analytics-events.d.ts +25 -25
- package/dist/src/utils/analytics-events.js +27 -27
- package/dist/src/utils/array-equals.d.ts +4 -4
- package/dist/src/utils/array-equals.js +10 -10
- package/dist/src/utils/format-count.d.ts +7 -7
- package/dist/src/utils/format-count.js +76 -76
- package/dist/src/utils/format-date.d.ts +2 -2
- package/dist/src/utils/format-date.js +25 -25
- package/dist/src/utils/format-unit-size.d.ts +2 -2
- package/dist/src/utils/format-unit-size.js +33 -33
- package/dist/src/utils/local-date-from-utc.d.ts +9 -9
- package/dist/src/utils/local-date-from-utc.js +15 -15
- package/dist/src/utils/sha1.d.ts +2 -2
- package/dist/src/utils/sha1.js +8 -8
- package/dist/test/collection-browser.test.d.ts +1 -1
- package/dist/test/collection-browser.test.js +1098 -1098
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +134 -134
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +133 -133
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +117 -117
- package/dist/test/collection-facets/toggle-switch.test.d.ts +1 -1
- package/dist/test/collection-facets/toggle-switch.test.js +73 -73
- package/dist/test/collection-facets.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +682 -682
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +63 -63
- package/dist/test/expanded-date-picker.test.d.ts +1 -1
- package/dist/test/expanded-date-picker.test.js +95 -95
- package/dist/test/icon-overlay.test.d.ts +1 -1
- package/dist/test/icon-overlay.test.js +24 -24
- package/dist/test/image-block.test.d.ts +1 -1
- package/dist/test/image-block.test.js +48 -48
- package/dist/test/item-image.test.d.ts +1 -1
- package/dist/test/item-image.test.js +86 -86
- package/dist/test/manage/manage-bar.test.d.ts +1 -1
- package/dist/test/manage/manage-bar.test.js +72 -72
- package/dist/test/mediatype-config.test.d.ts +1 -1
- package/dist/test/mediatype-config.test.js +16 -16
- package/dist/test/mocks/mock-analytics-handler.d.ts +10 -10
- package/dist/test/mocks/mock-analytics-handler.js +15 -15
- package/dist/test/mocks/mock-collection-name-cache.d.ts +9 -9
- package/dist/test/mocks/mock-collection-name-cache.js +17 -17
- package/dist/test/mocks/mock-search-responses.d.ts +21 -21
- package/dist/test/mocks/mock-search-responses.js +709 -709
- package/dist/test/mocks/mock-search-service.d.ts +15 -15
- package/dist/test/mocks/mock-search-service.js +50 -50
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +270 -270
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +12 -12
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +73 -73
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +378 -378
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +48 -48
- package/dist/test/text-snippet-block.test.d.ts +1 -1
- package/dist/test/text-snippet-block.test.js +57 -57
- package/dist/test/tile-stats.test.d.ts +1 -1
- package/dist/test/tile-stats.test.js +33 -33
- package/dist/test/tiles/grid/account-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/account-tile.test.js +76 -76
- package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/collection-tile.test.js +73 -73
- package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +254 -254
- package/dist/test/tiles/grid/search-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/search-tile.test.js +51 -51
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +258 -258
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +1 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js +13 -13
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +143 -143
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +242 -242
- package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +94 -94
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +1 -1
- package/dist/test/tiles/tile-display-value-provider.test.js +141 -141
- package/dist/test/utils/array-equals.test.d.ts +1 -1
- package/dist/test/utils/array-equals.test.js +26 -26
- package/dist/test/utils/format-count.test.d.ts +1 -1
- package/dist/test/utils/format-count.test.js +23 -23
- package/dist/test/utils/format-date.test.d.ts +1 -1
- package/dist/test/utils/format-date.test.js +17 -17
- package/dist/test/utils/format-unit-size.test.d.ts +1 -1
- package/dist/test/utils/format-unit-size.test.js +17 -17
- package/dist/test/utils/local-date-from-utc.test.d.ts +1 -1
- package/dist/test/utils/local-date-from-utc.test.js +26 -26
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +1 -1
- package/renovate.json +6 -6
- package/src/collection-browser.ts +5 -4
- package/tsconfig.json +21 -21
- package/types/sentry.d.ts +1 -0
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
- package/dist/src/selected-facets.d.ts +0 -67
- package/dist/src/selected-facets.js +0 -149
- package/dist/src/selected-facets.js.map +0 -1
- package/src/selected-facets.ts +0 -216
|
@@ -1,533 +1,533 @@
|
|
|
1
|
-
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
-
import type { InfiniteScrollerCellProviderInterface } from '@internetarchive/infinite-scroller';
|
|
3
|
-
import { CollectionExtraInfo, SearchServiceInterface, SearchType, SortDirection, SortParam } from '@internetarchive/search-service';
|
|
4
|
-
import type { SharedResizeObserverInterface, SharedResizeObserverResizeHandlerInterface } from '@internetarchive/shared-resize-observer';
|
|
5
|
-
import '@internetarchive/infinite-scroller';
|
|
6
|
-
import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
|
|
7
|
-
import type { ModalManagerInterface } from '@internetarchive/modal-manager';
|
|
8
|
-
import type { FeatureFeedbackServiceInterface } from '@internetarchive/feature-feedback';
|
|
9
|
-
import type { RecaptchaManagerInterface } from '@internetarchive/recaptcha-manager';
|
|
10
|
-
import './tiles/tile-dispatcher';
|
|
11
|
-
import './tiles/collection-browser-loading-tile';
|
|
12
|
-
import './sort-filter-bar/sort-filter-bar';
|
|
13
|
-
import './manage/manage-bar';
|
|
14
|
-
import './collection-facets';
|
|
15
|
-
import './circular-activity-indicator';
|
|
16
|
-
import { SelectedFacets, SortField, CollectionBrowserContext, TileModel, CollectionDisplayMode, FacetEventDetails } from './models';
|
|
17
|
-
import { RestorationStateHandlerInterface } from './restoration-state-handler';
|
|
18
|
-
import './empty-placeholder';
|
|
19
|
-
export declare class CollectionBrowser extends LitElement implements InfiniteScrollerCellProviderInterface, SharedResizeObserverResizeHandlerInterface {
|
|
20
|
-
baseNavigationUrl?: string;
|
|
21
|
-
baseImageUrl: string;
|
|
22
|
-
searchService?: SearchServiceInterface;
|
|
23
|
-
searchType: SearchType;
|
|
24
|
-
withinCollection?: string;
|
|
25
|
-
baseQuery?: string;
|
|
26
|
-
displayMode?: CollectionDisplayMode;
|
|
27
|
-
sortParam: SortParam | null;
|
|
28
|
-
defaultSortParam: SortParam | null;
|
|
29
|
-
selectedSort: SortField;
|
|
30
|
-
selectedTitleFilter: string | null;
|
|
31
|
-
selectedCreatorFilter: string | null;
|
|
32
|
-
sortDirection: SortDirection | null;
|
|
33
|
-
pageSize: number;
|
|
34
|
-
resizeObserver?: SharedResizeObserverInterface;
|
|
35
|
-
currentPage?: number;
|
|
36
|
-
minSelectedDate?: string;
|
|
37
|
-
maxSelectedDate?: string;
|
|
38
|
-
selectedFacets?: SelectedFacets;
|
|
39
|
-
showHistogramDatePicker: boolean;
|
|
40
|
-
suppressPlaceholders: boolean;
|
|
41
|
-
suppressResultCount: boolean;
|
|
42
|
-
clearResultsOnEmptyQuery: boolean;
|
|
43
|
-
collectionPagePath: string;
|
|
44
|
-
collectionInfo?: CollectionExtraInfo;
|
|
45
|
-
parentCollections: string[];
|
|
46
|
-
/** describes where this component is being used */
|
|
47
|
-
searchContext: string;
|
|
48
|
-
collectionNameCache?: CollectionNameCacheInterface;
|
|
49
|
-
pageContext: CollectionBrowserContext;
|
|
50
|
-
restorationStateHandler: RestorationStateHandlerInterface;
|
|
51
|
-
mobileBreakpoint: number;
|
|
52
|
-
loggedIn: boolean;
|
|
53
|
-
modalManager?: ModalManagerInterface;
|
|
54
|
-
featureFeedbackService?: FeatureFeedbackServiceInterface;
|
|
55
|
-
recaptchaManager?: RecaptchaManagerInterface;
|
|
56
|
-
/**
|
|
57
|
-
* If item management UI active
|
|
58
|
-
*/
|
|
59
|
-
isManageView: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* The page that the consumer wants to load.
|
|
62
|
-
*/
|
|
63
|
-
private initialPageNumber;
|
|
64
|
-
/**
|
|
65
|
-
* This the the number of pages that we want to show.
|
|
66
|
-
*
|
|
67
|
-
* The data isn't necessarily loaded for all of the pages, but this lets us
|
|
68
|
-
* know how many cells we should render.
|
|
69
|
-
*/
|
|
70
|
-
private pagesToRender;
|
|
71
|
-
/**
|
|
72
|
-
* Whether the initial page fetch for a new query is currently in progress.
|
|
73
|
-
*/
|
|
74
|
-
private searchResultsLoading;
|
|
75
|
-
private facetsLoading;
|
|
76
|
-
private fullYearAggregationLoading;
|
|
77
|
-
private aggregations?;
|
|
78
|
-
private fullYearsHistogramAggregation;
|
|
79
|
-
private totalResults?;
|
|
80
|
-
private queryErrorMessage?;
|
|
81
|
-
private mobileView;
|
|
82
|
-
private mobileFacetsVisible;
|
|
83
|
-
private contentWidth?;
|
|
84
|
-
private defaultSortField;
|
|
85
|
-
private defaultSortDirection;
|
|
86
|
-
private placeholderType;
|
|
87
|
-
private prefixFilterCountMap;
|
|
88
|
-
private contentContainer;
|
|
89
|
-
private leftColumn?;
|
|
90
|
-
private collectionFacets?;
|
|
91
|
-
private analyticsHandler?;
|
|
92
|
-
/**
|
|
93
|
-
* When we're animated scrolling to the page, we don't want to fetch
|
|
94
|
-
* all of the pages as it scrolls so this lets us know if we're scrolling
|
|
95
|
-
*/
|
|
96
|
-
private isScrollingToCell;
|
|
97
|
-
/**
|
|
98
|
-
* When we've reached the end of the data, stop trying to fetch more
|
|
99
|
-
*/
|
|
100
|
-
private endOfDataReached;
|
|
101
|
-
/**
|
|
102
|
-
* When page width resizes from desktop to mobile, set true to
|
|
103
|
-
* disable expand/collapse transition when loading.
|
|
104
|
-
*/
|
|
105
|
-
private isResizeToMobile;
|
|
106
|
-
private leftColIntersectionObserver?;
|
|
107
|
-
private facetsIntersectionObserver?;
|
|
108
|
-
private placeholderCellTemplate;
|
|
109
|
-
private tileModelAtCellIndex;
|
|
110
|
-
private get sortFilterQueries();
|
|
111
|
-
private get estimatedTileCount();
|
|
112
|
-
/**
|
|
113
|
-
* The results per page so we can paginate.
|
|
114
|
-
*
|
|
115
|
-
* This allows us to start in the middle of the search results and
|
|
116
|
-
* fetch data before or after the current page. If we don't have a key
|
|
117
|
-
* for the previous/next page, we'll fetch the next/previous page to populate it
|
|
118
|
-
*/
|
|
119
|
-
private dataSource;
|
|
120
|
-
/**
|
|
121
|
-
* How many tiles to offset the data source by, to account for any removed tiles.
|
|
122
|
-
*/
|
|
123
|
-
private tileModelOffset;
|
|
124
|
-
private infiniteScroller;
|
|
125
|
-
private sessionIdGenPromise?;
|
|
126
|
-
/**
|
|
127
|
-
* Returns a promise resolving to a unique string that persists for the current browser session.
|
|
128
|
-
* Used in generating unique IDs for search requests, so that multiple requests coming from the
|
|
129
|
-
* same browser session can be identified.
|
|
130
|
-
*/
|
|
131
|
-
private getSessionId;
|
|
132
|
-
/**
|
|
133
|
-
* Go to the given page of results
|
|
134
|
-
*
|
|
135
|
-
* @param pageNumber
|
|
136
|
-
*/
|
|
137
|
-
goToPage(pageNumber: number): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* Clears all selected/negated facets, date ranges, and letter filters.
|
|
140
|
-
*
|
|
141
|
-
* By default, the current sort field/direction are not cleared,
|
|
142
|
-
* but this can be overridden by setting the `sort` option to `true`.
|
|
143
|
-
*
|
|
144
|
-
* Similarly, it is possible to finely control what is cleared by
|
|
145
|
-
* setting any of the `facets`, `dateRange`, or `letterFilters` flags
|
|
146
|
-
* in the options object.
|
|
147
|
-
*/
|
|
148
|
-
clearFilters({ facets, dateRange, letterFilters, sort, }?: {
|
|
149
|
-
facets?: boolean | undefined;
|
|
150
|
-
dateRange?: boolean | undefined;
|
|
151
|
-
letterFilters?: boolean | undefined;
|
|
152
|
-
sort?: boolean | undefined;
|
|
153
|
-
}): void;
|
|
154
|
-
/**
|
|
155
|
-
* Returns true if the current value of `this.selectedFacets` contains
|
|
156
|
-
* any facet buckets than have been selected or negated, or false otherwise.
|
|
157
|
-
*/
|
|
158
|
-
private get hasCheckedFacets();
|
|
159
|
-
/**
|
|
160
|
-
* Returns true if there are any currently selected/negated facet buckets,
|
|
161
|
-
* any selected date range, or any selected letter filters. False otherwise.
|
|
162
|
-
*
|
|
163
|
-
* Ignores sorting options.
|
|
164
|
-
*/
|
|
165
|
-
private get hasActiveFilters();
|
|
166
|
-
render(): TemplateResult<1>;
|
|
167
|
-
private setPlaceholderType;
|
|
168
|
-
private get emptyPlaceholderTemplate();
|
|
169
|
-
/**
|
|
170
|
-
* Top-level template for rendering the left (facets) and right (results) columns.
|
|
171
|
-
*/
|
|
172
|
-
private get collectionBrowserTemplate();
|
|
173
|
-
/**
|
|
174
|
-
* Template for either the mobile or desktop version of the left column, depending
|
|
175
|
-
* on current component state.
|
|
176
|
-
*/
|
|
177
|
-
private get leftColumnTemplate();
|
|
178
|
-
/**
|
|
179
|
-
* Template for the mobile version of the "left column" (which in this case, appears
|
|
180
|
-
* *above* the search results rather than beside them), for rendering the
|
|
181
|
-
* accordion-style facets.
|
|
182
|
-
*/
|
|
183
|
-
private get mobileLeftColumnTemplate();
|
|
184
|
-
/**
|
|
185
|
-
* Template for the desktop version of the left column, displaying the facets sidebar.
|
|
186
|
-
*/
|
|
187
|
-
private get desktopLeftColumnTemplate();
|
|
188
|
-
/**
|
|
189
|
-
* Slot which is placed at top of the facets area for user-profile page
|
|
190
|
-
* - mainly used to render userlists
|
|
191
|
-
*/
|
|
192
|
-
private get facetTopViewSlot();
|
|
193
|
-
/**
|
|
194
|
-
* Template for the "X Results" count at the top of the search results.
|
|
195
|
-
* Changes to the "Searching..." label if the search results are still loading.
|
|
196
|
-
*/
|
|
197
|
-
private get resultsCountTemplate();
|
|
198
|
-
/**
|
|
199
|
-
* Template for the right column of the collection browser, where the result
|
|
200
|
-
* tiles and sort/filter bar are shown.
|
|
201
|
-
*/
|
|
202
|
-
private get rightColumnTemplate();
|
|
203
|
-
private get infiniteScrollerTemplate();
|
|
204
|
-
private get infiniteScrollerClasses();
|
|
205
|
-
private get sortFilterBarTemplate();
|
|
206
|
-
private get manageBarTemplate();
|
|
207
|
-
/**
|
|
208
|
-
* Handler for when the user requests to remove all checked items via the manage bar.
|
|
209
|
-
* Emits an `itemRemovalRequested` event with all checked tile models.
|
|
210
|
-
*/
|
|
211
|
-
private handleRemoveItems;
|
|
212
|
-
/**
|
|
213
|
-
* Removes all tile models that are currently checked & adjusts the paging
|
|
214
|
-
* of the data source to account for any new gaps in the data.
|
|
215
|
-
*/
|
|
216
|
-
removeCheckedTiles(): void;
|
|
217
|
-
/**
|
|
218
|
-
* Checks every tile's management checkbox
|
|
219
|
-
*/
|
|
220
|
-
checkAllTiles(): void;
|
|
221
|
-
/**
|
|
222
|
-
* Unchecks every tile's management checkbox
|
|
223
|
-
*/
|
|
224
|
-
uncheckAllTiles(): void;
|
|
225
|
-
/**
|
|
226
|
-
* Applies the given map function to all of the tile models in every page of the data
|
|
227
|
-
* source. This method updates the data source object in immutable fashion.
|
|
228
|
-
*
|
|
229
|
-
* @param mapFn A callback function to apply on each tile model, as with Array.map
|
|
230
|
-
*/
|
|
231
|
-
private mapDataSource;
|
|
232
|
-
/**
|
|
233
|
-
* An array of all the tile models whose management checkboxes are checked
|
|
234
|
-
*/
|
|
235
|
-
get checkedTileModels(): TileModel[];
|
|
236
|
-
/**
|
|
237
|
-
* An array of all the tile models whose management checkboxes are unchecked
|
|
238
|
-
*/
|
|
239
|
-
get uncheckedTileModels(): TileModel[];
|
|
240
|
-
/**
|
|
241
|
-
* Returns a flattened, filtered array of all the tile models in the data source
|
|
242
|
-
* for which the given predicate returns a truthy value.
|
|
243
|
-
*
|
|
244
|
-
* @param predicate A callback function to apply on each tile model, as with Array.filter
|
|
245
|
-
* @returns A filtered array of tile models satisfying the predicate
|
|
246
|
-
*/
|
|
247
|
-
private getFilteredTileModels;
|
|
248
|
-
private userChangedSort;
|
|
249
|
-
private sendSortByAnalytics;
|
|
250
|
-
private selectedSortChanged;
|
|
251
|
-
private displayModeChanged;
|
|
252
|
-
/**
|
|
253
|
-
* Returns a query clause identifying the currently selected title filter,
|
|
254
|
-
* e.g., `firstTitle:X`.
|
|
255
|
-
*/
|
|
256
|
-
private get titleQuery();
|
|
257
|
-
/**
|
|
258
|
-
* Returns a query clause identifying the currently selected creator filter,
|
|
259
|
-
* e.g., `firstCreator:X`.
|
|
260
|
-
*/
|
|
261
|
-
private get creatorQuery();
|
|
262
|
-
/**
|
|
263
|
-
* Send Analytics when sorting by title's first letter
|
|
264
|
-
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
265
|
-
*/
|
|
266
|
-
private sendFilterByTitleAnalytics;
|
|
267
|
-
/**
|
|
268
|
-
* Send Analytics when filtering by creator's first letter
|
|
269
|
-
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
270
|
-
*/
|
|
271
|
-
private sendFilterByCreatorAnalytics;
|
|
272
|
-
/**
|
|
273
|
-
* Handler for changes to which letter is selected in the title alphabet bar.
|
|
274
|
-
*/
|
|
275
|
-
private titleLetterSelected;
|
|
276
|
-
/**
|
|
277
|
-
* Handler for changes to which letter is selected in the creator alphabet bar.
|
|
278
|
-
*/
|
|
279
|
-
private creatorLetterSelected;
|
|
280
|
-
/**
|
|
281
|
-
* The full template for how the facets should be structured in mobile view,
|
|
282
|
-
* including the collapsible container (with header) and the facets themselves.
|
|
283
|
-
*/
|
|
284
|
-
private get mobileFacetsTemplate();
|
|
285
|
-
/**
|
|
286
|
-
* The template for the facets component alone, without any surrounding wrappers.
|
|
287
|
-
*/
|
|
288
|
-
private get facetsTemplate();
|
|
289
|
-
/**
|
|
290
|
-
* The HTML template for the "Clear all filters" button, or `nothing` if no
|
|
291
|
-
* filters are currently active.
|
|
292
|
-
*
|
|
293
|
-
* @param mobile Whether to style/shorten the button for mobile view
|
|
294
|
-
*/
|
|
295
|
-
private clearFiltersBtnTemplate;
|
|
296
|
-
private get loadingTemplate();
|
|
297
|
-
private get listHeaderTemplate();
|
|
298
|
-
private histogramDateRangeUpdated;
|
|
299
|
-
private get dateRangeQueryClause();
|
|
300
|
-
/**
|
|
301
|
-
* Emits an event indicating a change in whether the manage mode is shown.
|
|
302
|
-
*/
|
|
303
|
-
private emitManageModeChangedEvent;
|
|
304
|
-
firstUpdated(): void;
|
|
305
|
-
updated(changed: PropertyValues): void;
|
|
306
|
-
disconnectedCallback(): void;
|
|
307
|
-
handleResize(entry: ResizeObserverEntry): void;
|
|
308
|
-
/**
|
|
309
|
-
* Sets up listeners for events that may require updating the left column height.
|
|
310
|
-
*/
|
|
311
|
-
private setupLeftColumnScrollListeners;
|
|
312
|
-
/**
|
|
313
|
-
* Sets up listeners to control whether the facet sidebar shows its bottom fade-out.
|
|
314
|
-
* Note this uses a separate IntersectionObserver from the left column, because we
|
|
315
|
-
* don't need granular intersection thresholds for this.
|
|
316
|
-
*/
|
|
317
|
-
private setupFacetsScrollListeners;
|
|
318
|
-
/**
|
|
319
|
-
* Updates the height of the left column according to its position on the page.
|
|
320
|
-
* Arrow function ensures proper `this` binding.
|
|
321
|
-
*/
|
|
322
|
-
private updateLeftColumnHeight;
|
|
323
|
-
/**
|
|
324
|
-
* Toggles whether the fade-out is visible at the bottom of the facets.
|
|
325
|
-
* It should only be visible if the facets are not scrolled to the bottom.
|
|
326
|
-
* Arrow function ensures proper `this` binding.
|
|
327
|
-
*/
|
|
328
|
-
private updateFacetFadeOut;
|
|
329
|
-
private emitBaseQueryChanged;
|
|
330
|
-
private emitSearchTypeChanged;
|
|
331
|
-
private emitEmptyResults;
|
|
332
|
-
private disconnectResizeObserver;
|
|
333
|
-
private setupResizeObserver;
|
|
334
|
-
/**
|
|
335
|
-
* When the visible cells change from the infinite scroller, we want to emit
|
|
336
|
-
* which page is currently visible so the consumer can update its UI or the URL
|
|
337
|
-
*
|
|
338
|
-
* @param e
|
|
339
|
-
* @returns
|
|
340
|
-
*/
|
|
341
|
-
private visibleCellsChanged;
|
|
342
|
-
private initialQueryChangeHappened;
|
|
343
|
-
private historyPopOccurred;
|
|
344
|
-
private previousQueryKey?;
|
|
345
|
-
/**
|
|
346
|
-
* Internal property to store the `resolve` function for the most recent
|
|
347
|
-
* `initialSearchComplete` promise, allowing us to resolve it at the appropriate time.
|
|
348
|
-
*/
|
|
349
|
-
private _initialSearchCompleteResolver;
|
|
350
|
-
/**
|
|
351
|
-
* Internal property to store the private value backing the `initialSearchComplete` getter.
|
|
352
|
-
*/
|
|
353
|
-
private _initialSearchCompletePromise;
|
|
354
|
-
/**
|
|
355
|
-
* A Promise which, after each query change, resolves once the fetches for the initial
|
|
356
|
-
* search have completed. Waits for *both* the hits and aggregations fetches to finish.
|
|
357
|
-
*
|
|
358
|
-
* Ensure you await this component's `updateComplete` promise before awaiting this
|
|
359
|
-
* one, to ensure you do not await an obsolete promise from the previous update.
|
|
360
|
-
*/
|
|
361
|
-
get initialSearchComplete(): Promise<boolean>;
|
|
362
|
-
private handleQueryChange;
|
|
363
|
-
private setupStateRestorationObserver;
|
|
364
|
-
private boundNavigationHandler?;
|
|
365
|
-
private historyNavigationHandler;
|
|
366
|
-
private restoreState;
|
|
367
|
-
private persistState;
|
|
368
|
-
private doInitialPageFetch;
|
|
369
|
-
private emitSearchResultsLoadingChanged;
|
|
370
|
-
/**
|
|
371
|
-
* Produces a compact unique ID for a search request that can help with debugging
|
|
372
|
-
* on the backend by making related requests easier to trace through different services.
|
|
373
|
-
* (e.g., tying the hits/aggregations requests for the same page back to a single hash).
|
|
374
|
-
*
|
|
375
|
-
* @param params The search service parameters for the request
|
|
376
|
-
* @param kind The kind of request (hits-only, aggregations-only, or both)
|
|
377
|
-
* @returns A Promise resolving to the uid to apply to the request
|
|
378
|
-
*/
|
|
379
|
-
private requestUID;
|
|
380
|
-
/**
|
|
381
|
-
* Constructs a search service FilterMap object from the combination of
|
|
382
|
-
* all the currently-applied filters. This includes any facets, letter
|
|
383
|
-
* filters, and date range.
|
|
384
|
-
*/
|
|
385
|
-
private get filterMap();
|
|
386
|
-
/** The full query, including year facets and date range clauses */
|
|
387
|
-
private get fullQuery();
|
|
388
|
-
/**
|
|
389
|
-
* Generates a query string for the given facets
|
|
390
|
-
*
|
|
391
|
-
* Example: `mediatype:("collection" OR "audio" OR -"etree") AND year:("2000" OR "2001")`
|
|
392
|
-
*/
|
|
393
|
-
private get facetQuery();
|
|
394
|
-
/**
|
|
395
|
-
* Builds an OR-joined facet clause for the given facet name and values.
|
|
396
|
-
*
|
|
397
|
-
* E.g., for name `subject` and values
|
|
398
|
-
* `{ foo: { state: 'selected' }, bar: { state: 'hidden' } }`
|
|
399
|
-
* this will produce the clause
|
|
400
|
-
* `subject:("foo" OR -"bar")`.
|
|
401
|
-
*
|
|
402
|
-
* @param facetName The facet type (e.g., 'collection')
|
|
403
|
-
* @param facetValues The facet buckets, mapped by their keys
|
|
404
|
-
*/
|
|
405
|
-
private buildFacetClause;
|
|
406
|
-
/**
|
|
407
|
-
* Handles some special pre-request normalization steps for certain facet types
|
|
408
|
-
* that require them.
|
|
409
|
-
*
|
|
410
|
-
* @param facetName The name of the facet type (e.g., 'language')
|
|
411
|
-
* @param facetValues An array of values for that facet type
|
|
412
|
-
*/
|
|
413
|
-
private prepareFacetForFetch;
|
|
414
|
-
/**
|
|
415
|
-
* Takes an array of facet clauses, and combines them into a
|
|
416
|
-
* full AND-joined facet query string. Empty clauses are ignored.
|
|
417
|
-
*/
|
|
418
|
-
private joinFacetClauses;
|
|
419
|
-
facetsChanged(e: CustomEvent<SelectedFacets>): void;
|
|
420
|
-
facetClickHandler({ detail: { key, state: facetState, negative }, }: CustomEvent<FacetEventDetails>): void;
|
|
421
|
-
private fetchFacets;
|
|
422
|
-
private scrollToPage;
|
|
423
|
-
/**
|
|
424
|
-
* Whether sorting by relevance makes sense for the current state.
|
|
425
|
-
* Currently equivalent to having a non-empty query.
|
|
426
|
-
*/
|
|
427
|
-
private get isRelevanceSortAvailable();
|
|
428
|
-
/**
|
|
429
|
-
* Whether a search may be performed in the current state of the component.
|
|
430
|
-
* This is only true if the search service is defined, and either
|
|
431
|
-
* (a) a non-empty query is set, or
|
|
432
|
-
* (b) we are on a collection page in metadata search mode.
|
|
433
|
-
*/
|
|
434
|
-
private get canPerformSearch();
|
|
435
|
-
/**
|
|
436
|
-
* Additional params to pass to the search service if targeting a collection page,
|
|
437
|
-
* or null otherwise.
|
|
438
|
-
*/
|
|
439
|
-
private get collectionParams();
|
|
440
|
-
/**
|
|
441
|
-
* The query key is a string that uniquely identifies the current search.
|
|
442
|
-
* It consists of:
|
|
443
|
-
* - The current base query
|
|
444
|
-
* - The current collection
|
|
445
|
-
* - The current search type
|
|
446
|
-
* - Any currently-applied facets
|
|
447
|
-
* - Any currently-applied date range
|
|
448
|
-
* - Any currently-applied prefix filters
|
|
449
|
-
* - The current sort options
|
|
450
|
-
*
|
|
451
|
-
* This lets us keep track of queries so we don't persist data that's
|
|
452
|
-
* no longer relevant.
|
|
453
|
-
*/
|
|
454
|
-
private get pageFetchQueryKey();
|
|
455
|
-
/**
|
|
456
|
-
* Similar to `pageFetchQueryKey` above, but excludes sort fields since they
|
|
457
|
-
* are not relevant in determining aggregation queries.
|
|
458
|
-
*/
|
|
459
|
-
private get facetFetchQueryKey();
|
|
460
|
-
private pageFetchesInProgress;
|
|
461
|
-
/**
|
|
462
|
-
* Fetches one or more pages of results and updates the data source.
|
|
463
|
-
*
|
|
464
|
-
* @param pageNumber The page number to fetch
|
|
465
|
-
* @param numInitialPages If this is an initial page fetch (`pageNumber = 1`),
|
|
466
|
-
* specifies how many pages to batch together in one request. Ignored
|
|
467
|
-
* if `pageNumber != 1`, defaulting to a single page.
|
|
468
|
-
*/
|
|
469
|
-
fetchPage(pageNumber: number, numInitialPages?: number): Promise<void>;
|
|
470
|
-
private preloadCollectionNames;
|
|
471
|
-
/**
|
|
472
|
-
* Applies any default sort option for the current collection, by checking
|
|
473
|
-
* for one in the collection's metadata. If none is found, defaults to sorting
|
|
474
|
-
* descending by:
|
|
475
|
-
* - Date Favorited for fav-* collections
|
|
476
|
-
* - Weekly views for all other collections
|
|
477
|
-
*/
|
|
478
|
-
private applyDefaultCollectionSort;
|
|
479
|
-
/**
|
|
480
|
-
* This is useful for determining whether we need to reload the scroller.
|
|
481
|
-
*
|
|
482
|
-
* When the fetch completes, we need to reload the scroller if the cells for that
|
|
483
|
-
* page are visible, but if the page is not currenlty visible, we don't need to reload
|
|
484
|
-
*/
|
|
485
|
-
private get currentVisiblePageNumbers();
|
|
486
|
-
/**
|
|
487
|
-
* Update the datasource from the fetch response
|
|
488
|
-
*
|
|
489
|
-
* @param pageNumber
|
|
490
|
-
* @param results
|
|
491
|
-
*/
|
|
492
|
-
private updateDataSource;
|
|
493
|
-
private getMediatype;
|
|
494
|
-
/**
|
|
495
|
-
* Returns the input string, but removing one set of quotes from all instances of
|
|
496
|
-
* ""clauses wrapped in two sets of quotes"". This assumes the quotes are already
|
|
497
|
-
* URL-encoded.
|
|
498
|
-
*
|
|
499
|
-
* This should be a temporary measure to address the fact that the __href__ field
|
|
500
|
-
* sometimes acquires extra quotation marks during query rewriting. Once there is a
|
|
501
|
-
* full Lucene parser in place that handles quoted queries correctly, this can likely
|
|
502
|
-
* be removed.
|
|
503
|
-
*/
|
|
504
|
-
private collapseRepeatedQuotes;
|
|
505
|
-
/** Fetches the aggregation buckets for the given prefix filter type. */
|
|
506
|
-
private fetchPrefixFilterBuckets;
|
|
507
|
-
/** Fetches and caches the prefix filter counts for the given filter type. */
|
|
508
|
-
private updatePrefixFilterCounts;
|
|
509
|
-
/**
|
|
510
|
-
* Fetches and caches the prefix filter counts for the current sort type,
|
|
511
|
-
* provided it is one that permits prefix filtering. (If not, this does nothing).
|
|
512
|
-
*/
|
|
513
|
-
private updatePrefixFiltersForCurrentSort;
|
|
514
|
-
/**
|
|
515
|
-
* Clears the cached letter counts for both title and creator, and
|
|
516
|
-
* fetches a new set of counts for whichever of them is the currently
|
|
517
|
-
* selected sort option (which may be neither).
|
|
518
|
-
*
|
|
519
|
-
* Call this whenever the counts are invalidated (e.g., by a query change).
|
|
520
|
-
*/
|
|
521
|
-
private refreshLetterCounts;
|
|
522
|
-
/**
|
|
523
|
-
* Callback when a result is selected
|
|
524
|
-
*/
|
|
525
|
-
resultSelected(event: CustomEvent<TileModel>): void;
|
|
526
|
-
cellForIndex(index: number): TemplateResult | undefined;
|
|
527
|
-
/**
|
|
528
|
-
* When the user scrolls near to the bottom of the page, fetch the next page
|
|
529
|
-
* increase the number of pages to render and start fetching data for the new page
|
|
530
|
-
*/
|
|
531
|
-
private scrollThresholdReached;
|
|
532
|
-
static get styles(): import("lit").CSSResult[];
|
|
533
|
-
}
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import type { InfiniteScrollerCellProviderInterface } from '@internetarchive/infinite-scroller';
|
|
3
|
+
import { CollectionExtraInfo, SearchServiceInterface, SearchType, SortDirection, SortParam } from '@internetarchive/search-service';
|
|
4
|
+
import type { SharedResizeObserverInterface, SharedResizeObserverResizeHandlerInterface } from '@internetarchive/shared-resize-observer';
|
|
5
|
+
import '@internetarchive/infinite-scroller';
|
|
6
|
+
import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
|
|
7
|
+
import type { ModalManagerInterface } from '@internetarchive/modal-manager';
|
|
8
|
+
import type { FeatureFeedbackServiceInterface } from '@internetarchive/feature-feedback';
|
|
9
|
+
import type { RecaptchaManagerInterface } from '@internetarchive/recaptcha-manager';
|
|
10
|
+
import './tiles/tile-dispatcher';
|
|
11
|
+
import './tiles/collection-browser-loading-tile';
|
|
12
|
+
import './sort-filter-bar/sort-filter-bar';
|
|
13
|
+
import './manage/manage-bar';
|
|
14
|
+
import './collection-facets';
|
|
15
|
+
import './circular-activity-indicator';
|
|
16
|
+
import { SelectedFacets, SortField, CollectionBrowserContext, TileModel, CollectionDisplayMode, FacetEventDetails } from './models';
|
|
17
|
+
import { RestorationStateHandlerInterface } from './restoration-state-handler';
|
|
18
|
+
import './empty-placeholder';
|
|
19
|
+
export declare class CollectionBrowser extends LitElement implements InfiniteScrollerCellProviderInterface, SharedResizeObserverResizeHandlerInterface {
|
|
20
|
+
baseNavigationUrl?: string;
|
|
21
|
+
baseImageUrl: string;
|
|
22
|
+
searchService?: SearchServiceInterface;
|
|
23
|
+
searchType: SearchType;
|
|
24
|
+
withinCollection?: string;
|
|
25
|
+
baseQuery?: string;
|
|
26
|
+
displayMode?: CollectionDisplayMode;
|
|
27
|
+
sortParam: SortParam | null;
|
|
28
|
+
defaultSortParam: SortParam | null;
|
|
29
|
+
selectedSort: SortField;
|
|
30
|
+
selectedTitleFilter: string | null;
|
|
31
|
+
selectedCreatorFilter: string | null;
|
|
32
|
+
sortDirection: SortDirection | null;
|
|
33
|
+
pageSize: number;
|
|
34
|
+
resizeObserver?: SharedResizeObserverInterface;
|
|
35
|
+
currentPage?: number;
|
|
36
|
+
minSelectedDate?: string;
|
|
37
|
+
maxSelectedDate?: string;
|
|
38
|
+
selectedFacets?: SelectedFacets;
|
|
39
|
+
showHistogramDatePicker: boolean;
|
|
40
|
+
suppressPlaceholders: boolean;
|
|
41
|
+
suppressResultCount: boolean;
|
|
42
|
+
clearResultsOnEmptyQuery: boolean;
|
|
43
|
+
collectionPagePath: string;
|
|
44
|
+
collectionInfo?: CollectionExtraInfo;
|
|
45
|
+
parentCollections: string[];
|
|
46
|
+
/** describes where this component is being used */
|
|
47
|
+
searchContext: string;
|
|
48
|
+
collectionNameCache?: CollectionNameCacheInterface;
|
|
49
|
+
pageContext: CollectionBrowserContext;
|
|
50
|
+
restorationStateHandler: RestorationStateHandlerInterface;
|
|
51
|
+
mobileBreakpoint: number;
|
|
52
|
+
loggedIn: boolean;
|
|
53
|
+
modalManager?: ModalManagerInterface;
|
|
54
|
+
featureFeedbackService?: FeatureFeedbackServiceInterface;
|
|
55
|
+
recaptchaManager?: RecaptchaManagerInterface;
|
|
56
|
+
/**
|
|
57
|
+
* If item management UI active
|
|
58
|
+
*/
|
|
59
|
+
isManageView: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The page that the consumer wants to load.
|
|
62
|
+
*/
|
|
63
|
+
private initialPageNumber;
|
|
64
|
+
/**
|
|
65
|
+
* This the the number of pages that we want to show.
|
|
66
|
+
*
|
|
67
|
+
* The data isn't necessarily loaded for all of the pages, but this lets us
|
|
68
|
+
* know how many cells we should render.
|
|
69
|
+
*/
|
|
70
|
+
private pagesToRender;
|
|
71
|
+
/**
|
|
72
|
+
* Whether the initial page fetch for a new query is currently in progress.
|
|
73
|
+
*/
|
|
74
|
+
private searchResultsLoading;
|
|
75
|
+
private facetsLoading;
|
|
76
|
+
private fullYearAggregationLoading;
|
|
77
|
+
private aggregations?;
|
|
78
|
+
private fullYearsHistogramAggregation;
|
|
79
|
+
private totalResults?;
|
|
80
|
+
private queryErrorMessage?;
|
|
81
|
+
private mobileView;
|
|
82
|
+
private mobileFacetsVisible;
|
|
83
|
+
private contentWidth?;
|
|
84
|
+
private defaultSortField;
|
|
85
|
+
private defaultSortDirection;
|
|
86
|
+
private placeholderType;
|
|
87
|
+
private prefixFilterCountMap;
|
|
88
|
+
private contentContainer;
|
|
89
|
+
private leftColumn?;
|
|
90
|
+
private collectionFacets?;
|
|
91
|
+
private analyticsHandler?;
|
|
92
|
+
/**
|
|
93
|
+
* When we're animated scrolling to the page, we don't want to fetch
|
|
94
|
+
* all of the pages as it scrolls so this lets us know if we're scrolling
|
|
95
|
+
*/
|
|
96
|
+
private isScrollingToCell;
|
|
97
|
+
/**
|
|
98
|
+
* When we've reached the end of the data, stop trying to fetch more
|
|
99
|
+
*/
|
|
100
|
+
private endOfDataReached;
|
|
101
|
+
/**
|
|
102
|
+
* When page width resizes from desktop to mobile, set true to
|
|
103
|
+
* disable expand/collapse transition when loading.
|
|
104
|
+
*/
|
|
105
|
+
private isResizeToMobile;
|
|
106
|
+
private leftColIntersectionObserver?;
|
|
107
|
+
private facetsIntersectionObserver?;
|
|
108
|
+
private placeholderCellTemplate;
|
|
109
|
+
private tileModelAtCellIndex;
|
|
110
|
+
private get sortFilterQueries();
|
|
111
|
+
private get estimatedTileCount();
|
|
112
|
+
/**
|
|
113
|
+
* The results per page so we can paginate.
|
|
114
|
+
*
|
|
115
|
+
* This allows us to start in the middle of the search results and
|
|
116
|
+
* fetch data before or after the current page. If we don't have a key
|
|
117
|
+
* for the previous/next page, we'll fetch the next/previous page to populate it
|
|
118
|
+
*/
|
|
119
|
+
private dataSource;
|
|
120
|
+
/**
|
|
121
|
+
* How many tiles to offset the data source by, to account for any removed tiles.
|
|
122
|
+
*/
|
|
123
|
+
private tileModelOffset;
|
|
124
|
+
private infiniteScroller;
|
|
125
|
+
private sessionIdGenPromise?;
|
|
126
|
+
/**
|
|
127
|
+
* Returns a promise resolving to a unique string that persists for the current browser session.
|
|
128
|
+
* Used in generating unique IDs for search requests, so that multiple requests coming from the
|
|
129
|
+
* same browser session can be identified.
|
|
130
|
+
*/
|
|
131
|
+
private getSessionId;
|
|
132
|
+
/**
|
|
133
|
+
* Go to the given page of results
|
|
134
|
+
*
|
|
135
|
+
* @param pageNumber
|
|
136
|
+
*/
|
|
137
|
+
goToPage(pageNumber: number): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Clears all selected/negated facets, date ranges, and letter filters.
|
|
140
|
+
*
|
|
141
|
+
* By default, the current sort field/direction are not cleared,
|
|
142
|
+
* but this can be overridden by setting the `sort` option to `true`.
|
|
143
|
+
*
|
|
144
|
+
* Similarly, it is possible to finely control what is cleared by
|
|
145
|
+
* setting any of the `facets`, `dateRange`, or `letterFilters` flags
|
|
146
|
+
* in the options object.
|
|
147
|
+
*/
|
|
148
|
+
clearFilters({ facets, dateRange, letterFilters, sort, }?: {
|
|
149
|
+
facets?: boolean | undefined;
|
|
150
|
+
dateRange?: boolean | undefined;
|
|
151
|
+
letterFilters?: boolean | undefined;
|
|
152
|
+
sort?: boolean | undefined;
|
|
153
|
+
}): void;
|
|
154
|
+
/**
|
|
155
|
+
* Returns true if the current value of `this.selectedFacets` contains
|
|
156
|
+
* any facet buckets than have been selected or negated, or false otherwise.
|
|
157
|
+
*/
|
|
158
|
+
private get hasCheckedFacets();
|
|
159
|
+
/**
|
|
160
|
+
* Returns true if there are any currently selected/negated facet buckets,
|
|
161
|
+
* any selected date range, or any selected letter filters. False otherwise.
|
|
162
|
+
*
|
|
163
|
+
* Ignores sorting options.
|
|
164
|
+
*/
|
|
165
|
+
private get hasActiveFilters();
|
|
166
|
+
render(): TemplateResult<1>;
|
|
167
|
+
private setPlaceholderType;
|
|
168
|
+
private get emptyPlaceholderTemplate();
|
|
169
|
+
/**
|
|
170
|
+
* Top-level template for rendering the left (facets) and right (results) columns.
|
|
171
|
+
*/
|
|
172
|
+
private get collectionBrowserTemplate();
|
|
173
|
+
/**
|
|
174
|
+
* Template for either the mobile or desktop version of the left column, depending
|
|
175
|
+
* on current component state.
|
|
176
|
+
*/
|
|
177
|
+
private get leftColumnTemplate();
|
|
178
|
+
/**
|
|
179
|
+
* Template for the mobile version of the "left column" (which in this case, appears
|
|
180
|
+
* *above* the search results rather than beside them), for rendering the
|
|
181
|
+
* accordion-style facets.
|
|
182
|
+
*/
|
|
183
|
+
private get mobileLeftColumnTemplate();
|
|
184
|
+
/**
|
|
185
|
+
* Template for the desktop version of the left column, displaying the facets sidebar.
|
|
186
|
+
*/
|
|
187
|
+
private get desktopLeftColumnTemplate();
|
|
188
|
+
/**
|
|
189
|
+
* Slot which is placed at top of the facets area for user-profile page
|
|
190
|
+
* - mainly used to render userlists
|
|
191
|
+
*/
|
|
192
|
+
private get facetTopViewSlot();
|
|
193
|
+
/**
|
|
194
|
+
* Template for the "X Results" count at the top of the search results.
|
|
195
|
+
* Changes to the "Searching..." label if the search results are still loading.
|
|
196
|
+
*/
|
|
197
|
+
private get resultsCountTemplate();
|
|
198
|
+
/**
|
|
199
|
+
* Template for the right column of the collection browser, where the result
|
|
200
|
+
* tiles and sort/filter bar are shown.
|
|
201
|
+
*/
|
|
202
|
+
private get rightColumnTemplate();
|
|
203
|
+
private get infiniteScrollerTemplate();
|
|
204
|
+
private get infiniteScrollerClasses();
|
|
205
|
+
private get sortFilterBarTemplate();
|
|
206
|
+
private get manageBarTemplate();
|
|
207
|
+
/**
|
|
208
|
+
* Handler for when the user requests to remove all checked items via the manage bar.
|
|
209
|
+
* Emits an `itemRemovalRequested` event with all checked tile models.
|
|
210
|
+
*/
|
|
211
|
+
private handleRemoveItems;
|
|
212
|
+
/**
|
|
213
|
+
* Removes all tile models that are currently checked & adjusts the paging
|
|
214
|
+
* of the data source to account for any new gaps in the data.
|
|
215
|
+
*/
|
|
216
|
+
removeCheckedTiles(): void;
|
|
217
|
+
/**
|
|
218
|
+
* Checks every tile's management checkbox
|
|
219
|
+
*/
|
|
220
|
+
checkAllTiles(): void;
|
|
221
|
+
/**
|
|
222
|
+
* Unchecks every tile's management checkbox
|
|
223
|
+
*/
|
|
224
|
+
uncheckAllTiles(): void;
|
|
225
|
+
/**
|
|
226
|
+
* Applies the given map function to all of the tile models in every page of the data
|
|
227
|
+
* source. This method updates the data source object in immutable fashion.
|
|
228
|
+
*
|
|
229
|
+
* @param mapFn A callback function to apply on each tile model, as with Array.map
|
|
230
|
+
*/
|
|
231
|
+
private mapDataSource;
|
|
232
|
+
/**
|
|
233
|
+
* An array of all the tile models whose management checkboxes are checked
|
|
234
|
+
*/
|
|
235
|
+
get checkedTileModels(): TileModel[];
|
|
236
|
+
/**
|
|
237
|
+
* An array of all the tile models whose management checkboxes are unchecked
|
|
238
|
+
*/
|
|
239
|
+
get uncheckedTileModels(): TileModel[];
|
|
240
|
+
/**
|
|
241
|
+
* Returns a flattened, filtered array of all the tile models in the data source
|
|
242
|
+
* for which the given predicate returns a truthy value.
|
|
243
|
+
*
|
|
244
|
+
* @param predicate A callback function to apply on each tile model, as with Array.filter
|
|
245
|
+
* @returns A filtered array of tile models satisfying the predicate
|
|
246
|
+
*/
|
|
247
|
+
private getFilteredTileModels;
|
|
248
|
+
private userChangedSort;
|
|
249
|
+
private sendSortByAnalytics;
|
|
250
|
+
private selectedSortChanged;
|
|
251
|
+
private displayModeChanged;
|
|
252
|
+
/**
|
|
253
|
+
* Returns a query clause identifying the currently selected title filter,
|
|
254
|
+
* e.g., `firstTitle:X`.
|
|
255
|
+
*/
|
|
256
|
+
private get titleQuery();
|
|
257
|
+
/**
|
|
258
|
+
* Returns a query clause identifying the currently selected creator filter,
|
|
259
|
+
* e.g., `firstCreator:X`.
|
|
260
|
+
*/
|
|
261
|
+
private get creatorQuery();
|
|
262
|
+
/**
|
|
263
|
+
* Send Analytics when sorting by title's first letter
|
|
264
|
+
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
265
|
+
*/
|
|
266
|
+
private sendFilterByTitleAnalytics;
|
|
267
|
+
/**
|
|
268
|
+
* Send Analytics when filtering by creator's first letter
|
|
269
|
+
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
270
|
+
*/
|
|
271
|
+
private sendFilterByCreatorAnalytics;
|
|
272
|
+
/**
|
|
273
|
+
* Handler for changes to which letter is selected in the title alphabet bar.
|
|
274
|
+
*/
|
|
275
|
+
private titleLetterSelected;
|
|
276
|
+
/**
|
|
277
|
+
* Handler for changes to which letter is selected in the creator alphabet bar.
|
|
278
|
+
*/
|
|
279
|
+
private creatorLetterSelected;
|
|
280
|
+
/**
|
|
281
|
+
* The full template for how the facets should be structured in mobile view,
|
|
282
|
+
* including the collapsible container (with header) and the facets themselves.
|
|
283
|
+
*/
|
|
284
|
+
private get mobileFacetsTemplate();
|
|
285
|
+
/**
|
|
286
|
+
* The template for the facets component alone, without any surrounding wrappers.
|
|
287
|
+
*/
|
|
288
|
+
private get facetsTemplate();
|
|
289
|
+
/**
|
|
290
|
+
* The HTML template for the "Clear all filters" button, or `nothing` if no
|
|
291
|
+
* filters are currently active.
|
|
292
|
+
*
|
|
293
|
+
* @param mobile Whether to style/shorten the button for mobile view
|
|
294
|
+
*/
|
|
295
|
+
private clearFiltersBtnTemplate;
|
|
296
|
+
private get loadingTemplate();
|
|
297
|
+
private get listHeaderTemplate();
|
|
298
|
+
private histogramDateRangeUpdated;
|
|
299
|
+
private get dateRangeQueryClause();
|
|
300
|
+
/**
|
|
301
|
+
* Emits an event indicating a change in whether the manage mode is shown.
|
|
302
|
+
*/
|
|
303
|
+
private emitManageModeChangedEvent;
|
|
304
|
+
firstUpdated(): void;
|
|
305
|
+
updated(changed: PropertyValues): void;
|
|
306
|
+
disconnectedCallback(): void;
|
|
307
|
+
handleResize(entry: ResizeObserverEntry): void;
|
|
308
|
+
/**
|
|
309
|
+
* Sets up listeners for events that may require updating the left column height.
|
|
310
|
+
*/
|
|
311
|
+
private setupLeftColumnScrollListeners;
|
|
312
|
+
/**
|
|
313
|
+
* Sets up listeners to control whether the facet sidebar shows its bottom fade-out.
|
|
314
|
+
* Note this uses a separate IntersectionObserver from the left column, because we
|
|
315
|
+
* don't need granular intersection thresholds for this.
|
|
316
|
+
*/
|
|
317
|
+
private setupFacetsScrollListeners;
|
|
318
|
+
/**
|
|
319
|
+
* Updates the height of the left column according to its position on the page.
|
|
320
|
+
* Arrow function ensures proper `this` binding.
|
|
321
|
+
*/
|
|
322
|
+
private updateLeftColumnHeight;
|
|
323
|
+
/**
|
|
324
|
+
* Toggles whether the fade-out is visible at the bottom of the facets.
|
|
325
|
+
* It should only be visible if the facets are not scrolled to the bottom.
|
|
326
|
+
* Arrow function ensures proper `this` binding.
|
|
327
|
+
*/
|
|
328
|
+
private updateFacetFadeOut;
|
|
329
|
+
private emitBaseQueryChanged;
|
|
330
|
+
private emitSearchTypeChanged;
|
|
331
|
+
private emitEmptyResults;
|
|
332
|
+
private disconnectResizeObserver;
|
|
333
|
+
private setupResizeObserver;
|
|
334
|
+
/**
|
|
335
|
+
* When the visible cells change from the infinite scroller, we want to emit
|
|
336
|
+
* which page is currently visible so the consumer can update its UI or the URL
|
|
337
|
+
*
|
|
338
|
+
* @param e
|
|
339
|
+
* @returns
|
|
340
|
+
*/
|
|
341
|
+
private visibleCellsChanged;
|
|
342
|
+
private initialQueryChangeHappened;
|
|
343
|
+
private historyPopOccurred;
|
|
344
|
+
private previousQueryKey?;
|
|
345
|
+
/**
|
|
346
|
+
* Internal property to store the `resolve` function for the most recent
|
|
347
|
+
* `initialSearchComplete` promise, allowing us to resolve it at the appropriate time.
|
|
348
|
+
*/
|
|
349
|
+
private _initialSearchCompleteResolver;
|
|
350
|
+
/**
|
|
351
|
+
* Internal property to store the private value backing the `initialSearchComplete` getter.
|
|
352
|
+
*/
|
|
353
|
+
private _initialSearchCompletePromise;
|
|
354
|
+
/**
|
|
355
|
+
* A Promise which, after each query change, resolves once the fetches for the initial
|
|
356
|
+
* search have completed. Waits for *both* the hits and aggregations fetches to finish.
|
|
357
|
+
*
|
|
358
|
+
* Ensure you await this component's `updateComplete` promise before awaiting this
|
|
359
|
+
* one, to ensure you do not await an obsolete promise from the previous update.
|
|
360
|
+
*/
|
|
361
|
+
get initialSearchComplete(): Promise<boolean>;
|
|
362
|
+
private handleQueryChange;
|
|
363
|
+
private setupStateRestorationObserver;
|
|
364
|
+
private boundNavigationHandler?;
|
|
365
|
+
private historyNavigationHandler;
|
|
366
|
+
private restoreState;
|
|
367
|
+
private persistState;
|
|
368
|
+
private doInitialPageFetch;
|
|
369
|
+
private emitSearchResultsLoadingChanged;
|
|
370
|
+
/**
|
|
371
|
+
* Produces a compact unique ID for a search request that can help with debugging
|
|
372
|
+
* on the backend by making related requests easier to trace through different services.
|
|
373
|
+
* (e.g., tying the hits/aggregations requests for the same page back to a single hash).
|
|
374
|
+
*
|
|
375
|
+
* @param params The search service parameters for the request
|
|
376
|
+
* @param kind The kind of request (hits-only, aggregations-only, or both)
|
|
377
|
+
* @returns A Promise resolving to the uid to apply to the request
|
|
378
|
+
*/
|
|
379
|
+
private requestUID;
|
|
380
|
+
/**
|
|
381
|
+
* Constructs a search service FilterMap object from the combination of
|
|
382
|
+
* all the currently-applied filters. This includes any facets, letter
|
|
383
|
+
* filters, and date range.
|
|
384
|
+
*/
|
|
385
|
+
private get filterMap();
|
|
386
|
+
/** The full query, including year facets and date range clauses */
|
|
387
|
+
private get fullQuery();
|
|
388
|
+
/**
|
|
389
|
+
* Generates a query string for the given facets
|
|
390
|
+
*
|
|
391
|
+
* Example: `mediatype:("collection" OR "audio" OR -"etree") AND year:("2000" OR "2001")`
|
|
392
|
+
*/
|
|
393
|
+
private get facetQuery();
|
|
394
|
+
/**
|
|
395
|
+
* Builds an OR-joined facet clause for the given facet name and values.
|
|
396
|
+
*
|
|
397
|
+
* E.g., for name `subject` and values
|
|
398
|
+
* `{ foo: { state: 'selected' }, bar: { state: 'hidden' } }`
|
|
399
|
+
* this will produce the clause
|
|
400
|
+
* `subject:("foo" OR -"bar")`.
|
|
401
|
+
*
|
|
402
|
+
* @param facetName The facet type (e.g., 'collection')
|
|
403
|
+
* @param facetValues The facet buckets, mapped by their keys
|
|
404
|
+
*/
|
|
405
|
+
private buildFacetClause;
|
|
406
|
+
/**
|
|
407
|
+
* Handles some special pre-request normalization steps for certain facet types
|
|
408
|
+
* that require them.
|
|
409
|
+
*
|
|
410
|
+
* @param facetName The name of the facet type (e.g., 'language')
|
|
411
|
+
* @param facetValues An array of values for that facet type
|
|
412
|
+
*/
|
|
413
|
+
private prepareFacetForFetch;
|
|
414
|
+
/**
|
|
415
|
+
* Takes an array of facet clauses, and combines them into a
|
|
416
|
+
* full AND-joined facet query string. Empty clauses are ignored.
|
|
417
|
+
*/
|
|
418
|
+
private joinFacetClauses;
|
|
419
|
+
facetsChanged(e: CustomEvent<SelectedFacets>): void;
|
|
420
|
+
facetClickHandler({ detail: { key, state: facetState, negative }, }: CustomEvent<FacetEventDetails>): void;
|
|
421
|
+
private fetchFacets;
|
|
422
|
+
private scrollToPage;
|
|
423
|
+
/**
|
|
424
|
+
* Whether sorting by relevance makes sense for the current state.
|
|
425
|
+
* Currently equivalent to having a non-empty query.
|
|
426
|
+
*/
|
|
427
|
+
private get isRelevanceSortAvailable();
|
|
428
|
+
/**
|
|
429
|
+
* Whether a search may be performed in the current state of the component.
|
|
430
|
+
* This is only true if the search service is defined, and either
|
|
431
|
+
* (a) a non-empty query is set, or
|
|
432
|
+
* (b) we are on a collection page in metadata search mode.
|
|
433
|
+
*/
|
|
434
|
+
private get canPerformSearch();
|
|
435
|
+
/**
|
|
436
|
+
* Additional params to pass to the search service if targeting a collection page,
|
|
437
|
+
* or null otherwise.
|
|
438
|
+
*/
|
|
439
|
+
private get collectionParams();
|
|
440
|
+
/**
|
|
441
|
+
* The query key is a string that uniquely identifies the current search.
|
|
442
|
+
* It consists of:
|
|
443
|
+
* - The current base query
|
|
444
|
+
* - The current collection
|
|
445
|
+
* - The current search type
|
|
446
|
+
* - Any currently-applied facets
|
|
447
|
+
* - Any currently-applied date range
|
|
448
|
+
* - Any currently-applied prefix filters
|
|
449
|
+
* - The current sort options
|
|
450
|
+
*
|
|
451
|
+
* This lets us keep track of queries so we don't persist data that's
|
|
452
|
+
* no longer relevant.
|
|
453
|
+
*/
|
|
454
|
+
private get pageFetchQueryKey();
|
|
455
|
+
/**
|
|
456
|
+
* Similar to `pageFetchQueryKey` above, but excludes sort fields since they
|
|
457
|
+
* are not relevant in determining aggregation queries.
|
|
458
|
+
*/
|
|
459
|
+
private get facetFetchQueryKey();
|
|
460
|
+
private pageFetchesInProgress;
|
|
461
|
+
/**
|
|
462
|
+
* Fetches one or more pages of results and updates the data source.
|
|
463
|
+
*
|
|
464
|
+
* @param pageNumber The page number to fetch
|
|
465
|
+
* @param numInitialPages If this is an initial page fetch (`pageNumber = 1`),
|
|
466
|
+
* specifies how many pages to batch together in one request. Ignored
|
|
467
|
+
* if `pageNumber != 1`, defaulting to a single page.
|
|
468
|
+
*/
|
|
469
|
+
fetchPage(pageNumber: number, numInitialPages?: number): Promise<void>;
|
|
470
|
+
private preloadCollectionNames;
|
|
471
|
+
/**
|
|
472
|
+
* Applies any default sort option for the current collection, by checking
|
|
473
|
+
* for one in the collection's metadata. If none is found, defaults to sorting
|
|
474
|
+
* descending by:
|
|
475
|
+
* - Date Favorited for fav-* collections
|
|
476
|
+
* - Weekly views for all other collections
|
|
477
|
+
*/
|
|
478
|
+
private applyDefaultCollectionSort;
|
|
479
|
+
/**
|
|
480
|
+
* This is useful for determining whether we need to reload the scroller.
|
|
481
|
+
*
|
|
482
|
+
* When the fetch completes, we need to reload the scroller if the cells for that
|
|
483
|
+
* page are visible, but if the page is not currenlty visible, we don't need to reload
|
|
484
|
+
*/
|
|
485
|
+
private get currentVisiblePageNumbers();
|
|
486
|
+
/**
|
|
487
|
+
* Update the datasource from the fetch response
|
|
488
|
+
*
|
|
489
|
+
* @param pageNumber
|
|
490
|
+
* @param results
|
|
491
|
+
*/
|
|
492
|
+
private updateDataSource;
|
|
493
|
+
private getMediatype;
|
|
494
|
+
/**
|
|
495
|
+
* Returns the input string, but removing one set of quotes from all instances of
|
|
496
|
+
* ""clauses wrapped in two sets of quotes"". This assumes the quotes are already
|
|
497
|
+
* URL-encoded.
|
|
498
|
+
*
|
|
499
|
+
* This should be a temporary measure to address the fact that the __href__ field
|
|
500
|
+
* sometimes acquires extra quotation marks during query rewriting. Once there is a
|
|
501
|
+
* full Lucene parser in place that handles quoted queries correctly, this can likely
|
|
502
|
+
* be removed.
|
|
503
|
+
*/
|
|
504
|
+
private collapseRepeatedQuotes;
|
|
505
|
+
/** Fetches the aggregation buckets for the given prefix filter type. */
|
|
506
|
+
private fetchPrefixFilterBuckets;
|
|
507
|
+
/** Fetches and caches the prefix filter counts for the given filter type. */
|
|
508
|
+
private updatePrefixFilterCounts;
|
|
509
|
+
/**
|
|
510
|
+
* Fetches and caches the prefix filter counts for the current sort type,
|
|
511
|
+
* provided it is one that permits prefix filtering. (If not, this does nothing).
|
|
512
|
+
*/
|
|
513
|
+
private updatePrefixFiltersForCurrentSort;
|
|
514
|
+
/**
|
|
515
|
+
* Clears the cached letter counts for both title and creator, and
|
|
516
|
+
* fetches a new set of counts for whichever of them is the currently
|
|
517
|
+
* selected sort option (which may be neither).
|
|
518
|
+
*
|
|
519
|
+
* Call this whenever the counts are invalidated (e.g., by a query change).
|
|
520
|
+
*/
|
|
521
|
+
private refreshLetterCounts;
|
|
522
|
+
/**
|
|
523
|
+
* Callback when a result is selected
|
|
524
|
+
*/
|
|
525
|
+
resultSelected(event: CustomEvent<TileModel>): void;
|
|
526
|
+
cellForIndex(index: number): TemplateResult | undefined;
|
|
527
|
+
/**
|
|
528
|
+
* When the user scrolls near to the bottom of the page, fetch the next page
|
|
529
|
+
* increase the number of pages to render and start fetching data for the new page
|
|
530
|
+
*/
|
|
531
|
+
private scrollThresholdReached;
|
|
532
|
+
static get styles(): import("lit").CSSResult[];
|
|
533
|
+
}
|