@internetarchive/collection-browser 1.14.17 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/src/app-root.d.ts +0 -2
- package/dist/src/app-root.js +0 -8
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.d.ts +49 -200
- package/dist/src/collection-browser.js +191 -762
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.d.ts +2 -2
- package/dist/src/collection-facets/facet-row.js +5 -10
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.d.ts +2 -2
- package/dist/src/collection-facets/facets-template.js +2 -2
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +2 -9
- package/dist/src/collection-facets/more-facets-content.js +13 -18
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets.d.ts +2 -3
- package/dist/src/collection-facets.js +12 -13
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +217 -0
- package/dist/src/data-source/collection-browser-data-source-interface.js +2 -0
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -0
- package/dist/src/data-source/collection-browser-data-source.d.ts +352 -0
- package/dist/src/data-source/collection-browser-data-source.js +912 -0
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -0
- package/dist/src/data-source/collection-browser-query-state.d.ts +43 -0
- package/dist/src/data-source/collection-browser-query-state.js +2 -0
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -0
- package/dist/src/data-source/models.d.ts +28 -0
- package/dist/src/data-source/models.js +9 -0
- package/dist/src/data-source/models.js.map +1 -0
- package/dist/src/manage/manage-bar.d.ts +1 -1
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/models.d.ts +21 -4
- package/dist/src/models.js +111 -0
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +26 -23
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +1 -0
- package/dist/src/tiles/grid/item-tile.js +28 -1
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.js +13 -8
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +2 -2
- package/dist/src/tiles/hover/hover-pane-controller.js +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +2 -2
- package/dist/src/tiles/hover/tile-hover-pane.js +2 -2
- package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +3 -0
- package/dist/src/tiles/item-image.js +30 -2
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +4 -3
- package/dist/src/tiles/list/tile-list.js +39 -14
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +2 -2
- package/dist/src/tiles/tile-dispatcher.js +5 -5
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.d.ts +6 -2
- package/dist/src/tiles/tile-display-value-provider.js +15 -1
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/src/utils/collapse-repeated-quotes.d.ts +11 -0
- package/dist/src/utils/collapse-repeated-quotes.js +14 -0
- package/dist/src/utils/collapse-repeated-quotes.js.map +1 -0
- package/dist/src/utils/log.d.ts +7 -0
- package/dist/src/utils/log.js +16 -0
- package/dist/src/utils/log.js.map +1 -0
- package/dist/src/utils/resolve-mediatype.d.ts +8 -0
- package/dist/src/utils/resolve-mediatype.js +24 -0
- package/dist/src/utils/resolve-mediatype.js.map +1 -0
- package/dist/test/collection-browser.test.js +142 -92
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +6 -17
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +2 -2
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/collection-facets.test.js +5 -5
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.d.ts +1 -0
- package/dist/test/data-source/collection-browser-data-source.test.js +80 -0
- package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -0
- package/dist/test/item-image.test.js +33 -34
- package/dist/test/item-image.test.js.map +1 -1
- package/dist/test/mocks/mock-search-responses.d.ts +3 -0
- package/dist/test/mocks/mock-search-responses.js +131 -0
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.js +4 -1
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +41 -4
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/dist/test/tile-stats.test.js +62 -0
- package/dist/test/tile-stats.test.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +44 -0
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +18 -17
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +44 -5
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +12 -0
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/index.ts +4 -1
- package/package.json +3 -4
- package/src/app-root.ts +0 -10
- package/src/collection-browser.ts +219 -935
- package/src/collection-facets/facet-row.ts +4 -9
- package/src/collection-facets/facets-template.ts +3 -3
- package/src/collection-facets/more-facets-content.ts +15 -20
- package/src/collection-facets.ts +11 -14
- package/src/data-source/collection-browser-data-source-interface.ts +272 -0
- package/src/data-source/collection-browser-data-source.ts +1166 -0
- package/src/data-source/collection-browser-query-state.ts +54 -0
- package/src/data-source/models.ts +38 -0
- package/src/manage/manage-bar.ts +1 -1
- package/src/models.ts +164 -3
- package/src/sort-filter-bar/sort-filter-bar.ts +26 -23
- package/src/tiles/grid/item-tile.ts +36 -1
- package/src/tiles/grid/tile-stats.ts +12 -7
- package/src/tiles/hover/hover-pane-controller.ts +3 -3
- package/src/tiles/hover/tile-hover-pane.ts +3 -3
- package/src/tiles/item-image.ts +28 -0
- package/src/tiles/list/tile-list.ts +56 -23
- package/src/tiles/tile-dispatcher.ts +5 -5
- package/src/tiles/tile-display-value-provider.ts +20 -2
- package/src/utils/collapse-repeated-quotes.ts +13 -0
- package/src/utils/log.ts +16 -0
- package/src/utils/resolve-mediatype.ts +26 -0
- package/test/collection-browser.test.ts +213 -106
- package/test/collection-facets/facet-row.test.ts +5 -18
- package/test/collection-facets/more-facets-content.test.ts +4 -2
- package/test/collection-facets.test.ts +5 -5
- package/test/data-source/collection-browser-data-source.test.ts +103 -0
- package/test/item-image.test.ts +34 -36
- package/test/mocks/mock-search-responses.ts +144 -0
- package/test/mocks/mock-search-service.ts +6 -0
- package/test/sort-filter-bar/sort-filter-bar.test.ts +50 -4
- package/test/tile-stats.test.ts +104 -0
- package/test/tiles/grid/item-tile.test.ts +55 -0
- package/test/tiles/hover/hover-pane-controller.test.ts +19 -17
- package/test/tiles/list/tile-list.test.ts +55 -5
- package/test/tiles/tile-dispatcher.test.ts +13 -0
- package/dist/test/mocks/mock-collection-name-cache.d.ts +0 -9
- package/dist/test/mocks/mock-collection-name-cache.js +0 -18
- package/dist/test/mocks/mock-collection-name-cache.js.map +0 -1
- package/test/mocks/mock-collection-name-cache.ts +0 -24
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type { InfiniteScrollerCellProviderInterface } from '@internetarchive/infinite-scroller';
|
|
3
|
-
import { CollectionExtraInfo, SearchServiceInterface, SearchType, SortDirection, SortParam } from '@internetarchive/search-service';
|
|
3
|
+
import { CollectionExtraInfo, PageElementName, SearchServiceInterface, SearchType, SortDirection, SortParam } from '@internetarchive/search-service';
|
|
4
4
|
import type { SharedResizeObserverInterface, SharedResizeObserverResizeHandlerInterface } from '@internetarchive/shared-resize-observer';
|
|
5
5
|
import '@internetarchive/infinite-scroller';
|
|
6
|
-
import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
|
|
7
6
|
import type { ModalManagerInterface } from '@internetarchive/modal-manager';
|
|
8
7
|
import type { FeatureFeedbackServiceInterface } from '@internetarchive/feature-feedback';
|
|
9
8
|
import type { RecaptchaManagerInterface } from '@internetarchive/recaptcha-manager';
|
|
9
|
+
import { SelectedFacets, SortField, CollectionBrowserContext, TileModel, CollectionDisplayMode, FacetEventDetails } from './models';
|
|
10
|
+
import { RestorationStateHandlerInterface } from './restoration-state-handler';
|
|
11
|
+
import type { CollectionBrowserQueryState, CollectionBrowserSearchInterface } from './data-source/collection-browser-query-state';
|
|
12
|
+
import type { CollectionBrowserDataSourceInterface } from './data-source/collection-browser-data-source-interface';
|
|
13
|
+
import './empty-placeholder';
|
|
10
14
|
import './tiles/tile-dispatcher';
|
|
11
15
|
import './tiles/collection-browser-loading-tile';
|
|
12
16
|
import './sort-filter-bar/sort-filter-bar';
|
|
13
17
|
import './manage/manage-bar';
|
|
14
18
|
import './collection-facets';
|
|
15
19
|
import './circular-activity-indicator';
|
|
16
|
-
|
|
17
|
-
import { RestorationStateHandlerInterface } from './restoration-state-handler';
|
|
18
|
-
import './empty-placeholder';
|
|
19
|
-
export declare class CollectionBrowser extends LitElement implements InfiniteScrollerCellProviderInterface, SharedResizeObserverResizeHandlerInterface {
|
|
20
|
+
export declare class CollectionBrowser extends LitElement implements InfiniteScrollerCellProviderInterface, SharedResizeObserverResizeHandlerInterface, CollectionBrowserSearchInterface {
|
|
20
21
|
baseNavigationUrl?: string;
|
|
21
22
|
baseImageUrl: string;
|
|
22
23
|
searchService?: SearchServiceInterface;
|
|
23
24
|
searchType: SearchType;
|
|
24
25
|
withinCollection?: string;
|
|
26
|
+
withinProfile?: string;
|
|
27
|
+
profileElement?: PageElementName;
|
|
25
28
|
baseQuery?: string;
|
|
26
29
|
displayMode?: CollectionDisplayMode;
|
|
27
|
-
sortParam: SortParam | null;
|
|
28
30
|
defaultSortParam: SortParam | null;
|
|
29
31
|
selectedSort: SortField;
|
|
30
32
|
selectedTitleFilter: string | null;
|
|
31
33
|
selectedCreatorFilter: string | null;
|
|
32
34
|
sortDirection: SortDirection | null;
|
|
33
35
|
pageSize: number;
|
|
34
|
-
resizeObserver?: SharedResizeObserverInterface;
|
|
35
36
|
currentPage?: number;
|
|
36
37
|
minSelectedDate?: string;
|
|
37
38
|
maxSelectedDate?: string;
|
|
@@ -39,18 +40,18 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
39
40
|
showHistogramDatePicker: boolean;
|
|
40
41
|
suppressPlaceholders: boolean;
|
|
41
42
|
suppressResultCount: boolean;
|
|
43
|
+
suppressURLQuery: boolean;
|
|
42
44
|
suppressFacets: boolean;
|
|
45
|
+
suppressSortBar: boolean;
|
|
43
46
|
clearResultsOnEmptyQuery: boolean;
|
|
44
47
|
collectionPagePath: string;
|
|
45
|
-
collectionInfo?: CollectionExtraInfo;
|
|
46
|
-
parentCollections: string[];
|
|
47
48
|
/** describes where this component is being used */
|
|
48
49
|
searchContext: string;
|
|
49
|
-
collectionNameCache?: CollectionNameCacheInterface;
|
|
50
50
|
pageContext: CollectionBrowserContext;
|
|
51
51
|
restorationStateHandler: RestorationStateHandlerInterface;
|
|
52
52
|
mobileBreakpoint: number;
|
|
53
53
|
loggedIn: boolean;
|
|
54
|
+
resizeObserver?: SharedResizeObserverInterface;
|
|
54
55
|
modalManager?: ModalManagerInterface;
|
|
55
56
|
featureFeedbackService?: FeatureFeedbackServiceInterface;
|
|
56
57
|
recaptchaManager?: RecaptchaManagerInterface;
|
|
@@ -59,10 +60,18 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
59
60
|
*/
|
|
60
61
|
isManageView: boolean;
|
|
61
62
|
isLoansTab: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The results per page so we can paginate.
|
|
65
|
+
*
|
|
66
|
+
* This allows us to start in the middle of the search results and
|
|
67
|
+
* fetch data before or after the current page. If we don't have a key
|
|
68
|
+
* for the previous/next page, we'll fetch the next/previous page to populate it
|
|
69
|
+
*/
|
|
70
|
+
dataSource: CollectionBrowserDataSourceInterface;
|
|
62
71
|
/**
|
|
63
72
|
* The page that the consumer wants to load.
|
|
64
73
|
*/
|
|
65
|
-
|
|
74
|
+
initialPageNumber: number;
|
|
66
75
|
/**
|
|
67
76
|
* This the the number of pages that we want to show.
|
|
68
77
|
*
|
|
@@ -75,18 +84,13 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
75
84
|
*/
|
|
76
85
|
private searchResultsLoading;
|
|
77
86
|
private facetsLoading;
|
|
78
|
-
private fullYearAggregationLoading;
|
|
79
|
-
private aggregations?;
|
|
80
|
-
private fullYearsHistogramAggregation;
|
|
81
87
|
private totalResults?;
|
|
82
|
-
private queryErrorMessage?;
|
|
83
88
|
private mobileView;
|
|
84
89
|
private mobileFacetsVisible;
|
|
85
90
|
private contentWidth?;
|
|
86
91
|
private defaultSortField;
|
|
87
92
|
private defaultSortDirection;
|
|
88
93
|
private placeholderType;
|
|
89
|
-
private prefixFilterCountMap;
|
|
90
94
|
private contentContainer;
|
|
91
95
|
private leftColumn?;
|
|
92
96
|
private collectionFacets?;
|
|
@@ -96,10 +100,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
96
100
|
* all of the pages as it scrolls so this lets us know if we're scrolling
|
|
97
101
|
*/
|
|
98
102
|
private isScrollingToCell;
|
|
99
|
-
/**
|
|
100
|
-
* When we've reached the end of the data, stop trying to fetch more
|
|
101
|
-
*/
|
|
102
|
-
private endOfDataReached;
|
|
103
103
|
/**
|
|
104
104
|
* When page width resizes from desktop to mobile, set true to
|
|
105
105
|
* disable expand/collapse transition when loading.
|
|
@@ -108,17 +108,9 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
108
108
|
private leftColIntersectionObserver?;
|
|
109
109
|
private facetsIntersectionObserver?;
|
|
110
110
|
private placeholderCellTemplate;
|
|
111
|
+
constructor();
|
|
111
112
|
private tileModelAtCellIndex;
|
|
112
|
-
private get sortFilterQueries();
|
|
113
113
|
private get estimatedTileCount();
|
|
114
|
-
/**
|
|
115
|
-
* The results per page so we can paginate.
|
|
116
|
-
*
|
|
117
|
-
* This allows us to start in the middle of the search results and
|
|
118
|
-
* fetch data before or after the current page. If we don't have a key
|
|
119
|
-
* for the previous/next page, we'll fetch the next/previous page to populate it
|
|
120
|
-
*/
|
|
121
|
-
private dataSource;
|
|
122
114
|
/**
|
|
123
115
|
* How many tiles to offset the data source by, to account for any removed tiles.
|
|
124
116
|
*/
|
|
@@ -130,13 +122,25 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
130
122
|
* Used in generating unique IDs for search requests, so that multiple requests coming from the
|
|
131
123
|
* same browser session can be identified.
|
|
132
124
|
*/
|
|
133
|
-
|
|
125
|
+
getSessionId(): Promise<string>;
|
|
134
126
|
/**
|
|
135
127
|
* Go to the given page of results
|
|
136
128
|
*
|
|
137
129
|
* @param pageNumber
|
|
138
130
|
*/
|
|
139
131
|
goToPage(pageNumber: number): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Sets the state for whether the initial set of search results is loading in.
|
|
134
|
+
*/
|
|
135
|
+
setSearchResultsLoading(loading: boolean): void;
|
|
136
|
+
/**
|
|
137
|
+
* Sets the state for whether facet data is loading in
|
|
138
|
+
*/
|
|
139
|
+
setFacetsLoading(loading: boolean): void;
|
|
140
|
+
/**
|
|
141
|
+
* Sets the total number of results to be displayed for the current search
|
|
142
|
+
*/
|
|
143
|
+
setTotalResultCount(totalResults: number): void;
|
|
140
144
|
/**
|
|
141
145
|
* Clears all selected/negated facets, date ranges, and letter filters.
|
|
142
146
|
*
|
|
@@ -216,40 +220,10 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
216
220
|
* of the data source to account for any new gaps in the data.
|
|
217
221
|
*/
|
|
218
222
|
removeCheckedTiles(): void;
|
|
219
|
-
/**
|
|
220
|
-
* Checks every tile's management checkbox
|
|
221
|
-
*/
|
|
222
|
-
checkAllTiles(): void;
|
|
223
|
-
/**
|
|
224
|
-
* Unchecks every tile's management checkbox
|
|
225
|
-
*/
|
|
226
|
-
uncheckAllTiles(): void;
|
|
227
|
-
/**
|
|
228
|
-
* Applies the given map function to all of the tile models in every page of the data
|
|
229
|
-
* source. This method updates the data source object in immutable fashion.
|
|
230
|
-
*
|
|
231
|
-
* @param mapFn A callback function to apply on each tile model, as with Array.map
|
|
232
|
-
*/
|
|
233
|
-
private mapDataSource;
|
|
234
|
-
/**
|
|
235
|
-
* An array of all the tile models whose management checkboxes are checked
|
|
236
|
-
*/
|
|
237
|
-
get checkedTileModels(): TileModel[];
|
|
238
|
-
/**
|
|
239
|
-
* An array of all the tile models whose management checkboxes are unchecked
|
|
240
|
-
*/
|
|
241
|
-
get uncheckedTileModels(): TileModel[];
|
|
242
|
-
/**
|
|
243
|
-
* Returns a flattened, filtered array of all the tile models in the data source
|
|
244
|
-
* for which the given predicate returns a truthy value.
|
|
245
|
-
*
|
|
246
|
-
* @param predicate A callback function to apply on each tile model, as with Array.filter
|
|
247
|
-
* @returns A filtered array of tile models satisfying the predicate
|
|
248
|
-
*/
|
|
249
|
-
private getFilteredTileModels;
|
|
250
223
|
private userChangedSort;
|
|
251
224
|
private sendSortByAnalytics;
|
|
252
225
|
private selectedSortChanged;
|
|
226
|
+
get sortParam(): SortParam | null;
|
|
253
227
|
private displayModeChanged;
|
|
254
228
|
/**
|
|
255
229
|
* Returns a query clause identifying the currently selected title filter,
|
|
@@ -303,6 +277,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
303
277
|
* Emits an event indicating a change in whether the manage mode is shown.
|
|
304
278
|
*/
|
|
305
279
|
private emitManageModeChangedEvent;
|
|
280
|
+
installDataSourceAndQueryState(dataSource: CollectionBrowserDataSourceInterface, queryState: CollectionBrowserQueryState): Promise<void>;
|
|
306
281
|
firstUpdated(): void;
|
|
307
282
|
updated(changed: PropertyValues): void;
|
|
308
283
|
disconnectedCallback(): void;
|
|
@@ -330,7 +305,8 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
330
305
|
private updateFacetFadeOut;
|
|
331
306
|
private emitBaseQueryChanged;
|
|
332
307
|
private emitSearchTypeChanged;
|
|
333
|
-
|
|
308
|
+
emitQueryStateChanged(): void;
|
|
309
|
+
emitEmptyResults(): void;
|
|
334
310
|
private disconnectResizeObserver;
|
|
335
311
|
private setupResizeObserver;
|
|
336
312
|
/**
|
|
@@ -344,15 +320,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
344
320
|
private initialQueryChangeHappened;
|
|
345
321
|
private historyPopOccurred;
|
|
346
322
|
private previousQueryKey?;
|
|
347
|
-
/**
|
|
348
|
-
* Internal property to store the `resolve` function for the most recent
|
|
349
|
-
* `initialSearchComplete` promise, allowing us to resolve it at the appropriate time.
|
|
350
|
-
*/
|
|
351
|
-
private _initialSearchCompleteResolver;
|
|
352
|
-
/**
|
|
353
|
-
* Internal property to store the private value backing the `initialSearchComplete` getter.
|
|
354
|
-
*/
|
|
355
|
-
private _initialSearchCompletePromise;
|
|
356
323
|
/**
|
|
357
324
|
* A Promise which, after each query change, resolves once the fetches for the initial
|
|
358
325
|
* search have completed. Waits for *both* the hits and aggregations fetches to finish.
|
|
@@ -367,60 +334,9 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
367
334
|
private historyNavigationHandler;
|
|
368
335
|
private restoreState;
|
|
369
336
|
private persistState;
|
|
370
|
-
private doInitialPageFetch;
|
|
371
337
|
private emitSearchResultsLoadingChanged;
|
|
372
|
-
/**
|
|
373
|
-
* Produces a compact unique ID for a search request that can help with debugging
|
|
374
|
-
* on the backend by making related requests easier to trace through different services.
|
|
375
|
-
* (e.g., tying the hits/aggregations requests for the same page back to a single hash).
|
|
376
|
-
*
|
|
377
|
-
* @param params The search service parameters for the request
|
|
378
|
-
* @param kind The kind of request (hits-only, aggregations-only, or both)
|
|
379
|
-
* @returns A Promise resolving to the uid to apply to the request
|
|
380
|
-
*/
|
|
381
|
-
private requestUID;
|
|
382
|
-
/**
|
|
383
|
-
* Constructs a search service FilterMap object from the combination of
|
|
384
|
-
* all the currently-applied filters. This includes any facets, letter
|
|
385
|
-
* filters, and date range.
|
|
386
|
-
*/
|
|
387
|
-
private get filterMap();
|
|
388
|
-
/** The full query, including year facets and date range clauses */
|
|
389
|
-
private get fullQuery();
|
|
390
|
-
/**
|
|
391
|
-
* Generates a query string for the given facets
|
|
392
|
-
*
|
|
393
|
-
* Example: `mediatype:("collection" OR "audio" OR -"etree") AND year:("2000" OR "2001")`
|
|
394
|
-
*/
|
|
395
|
-
private get facetQuery();
|
|
396
|
-
/**
|
|
397
|
-
* Builds an OR-joined facet clause for the given facet name and values.
|
|
398
|
-
*
|
|
399
|
-
* E.g., for name `subject` and values
|
|
400
|
-
* `{ foo: { state: 'selected' }, bar: { state: 'hidden' } }`
|
|
401
|
-
* this will produce the clause
|
|
402
|
-
* `subject:("foo" OR -"bar")`.
|
|
403
|
-
*
|
|
404
|
-
* @param facetName The facet type (e.g., 'collection')
|
|
405
|
-
* @param facetValues The facet buckets, mapped by their keys
|
|
406
|
-
*/
|
|
407
|
-
private buildFacetClause;
|
|
408
|
-
/**
|
|
409
|
-
* Handles some special pre-request normalization steps for certain facet types
|
|
410
|
-
* that require them.
|
|
411
|
-
*
|
|
412
|
-
* @param facetName The name of the facet type (e.g., 'language')
|
|
413
|
-
* @param facetValues An array of values for that facet type
|
|
414
|
-
*/
|
|
415
|
-
private prepareFacetForFetch;
|
|
416
|
-
/**
|
|
417
|
-
* Takes an array of facet clauses, and combines them into a
|
|
418
|
-
* full AND-joined facet query string. Empty clauses are ignored.
|
|
419
|
-
*/
|
|
420
|
-
private joinFacetClauses;
|
|
421
338
|
facetsChanged(e: CustomEvent<SelectedFacets>): void;
|
|
422
339
|
facetClickHandler({ detail: { facetType, bucket, negative }, }: CustomEvent<FacetEventDetails>): void;
|
|
423
|
-
private fetchFacets;
|
|
424
340
|
private scrollToPage;
|
|
425
341
|
/**
|
|
426
342
|
* Whether sorting by relevance makes sense for the current state.
|
|
@@ -428,48 +344,9 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
428
344
|
*/
|
|
429
345
|
private get isRelevanceSortAvailable();
|
|
430
346
|
/**
|
|
431
|
-
*
|
|
432
|
-
* This is only true if the search service is defined, and either
|
|
433
|
-
* (a) a non-empty query is set, or
|
|
434
|
-
* (b) we are on a collection page in metadata search mode.
|
|
347
|
+
* Sets the total number of tiles displayed in the infinite scroller.
|
|
435
348
|
*/
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Additional params to pass to the search service if targeting a collection page,
|
|
439
|
-
* or null otherwise.
|
|
440
|
-
*/
|
|
441
|
-
private get collectionParams();
|
|
442
|
-
/**
|
|
443
|
-
* The query key is a string that uniquely identifies the current search.
|
|
444
|
-
* It consists of:
|
|
445
|
-
* - The current base query
|
|
446
|
-
* - The current collection
|
|
447
|
-
* - The current search type
|
|
448
|
-
* - Any currently-applied facets
|
|
449
|
-
* - Any currently-applied date range
|
|
450
|
-
* - Any currently-applied prefix filters
|
|
451
|
-
* - The current sort options
|
|
452
|
-
*
|
|
453
|
-
* This lets us keep track of queries so we don't persist data that's
|
|
454
|
-
* no longer relevant.
|
|
455
|
-
*/
|
|
456
|
-
private get pageFetchQueryKey();
|
|
457
|
-
/**
|
|
458
|
-
* Similar to `pageFetchQueryKey` above, but excludes sort fields since they
|
|
459
|
-
* are not relevant in determining aggregation queries.
|
|
460
|
-
*/
|
|
461
|
-
private get facetFetchQueryKey();
|
|
462
|
-
private pageFetchesInProgress;
|
|
463
|
-
/**
|
|
464
|
-
* Fetches one or more pages of results and updates the data source.
|
|
465
|
-
*
|
|
466
|
-
* @param pageNumber The page number to fetch
|
|
467
|
-
* @param numInitialPages If this is an initial page fetch (`pageNumber = 1`),
|
|
468
|
-
* specifies how many pages to batch together in one request. Ignored
|
|
469
|
-
* if `pageNumber != 1`, defaulting to a single page.
|
|
470
|
-
*/
|
|
471
|
-
fetchPage(pageNumber: number, numInitialPages?: number): Promise<void>;
|
|
472
|
-
private preloadCollectionNames;
|
|
349
|
+
setTileCount(count: number): void;
|
|
473
350
|
/**
|
|
474
351
|
* Applies any default sort option for the current collection, by checking
|
|
475
352
|
* for one in the collection's metadata. If none is found, defaults to sorting
|
|
@@ -477,50 +354,22 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
477
354
|
* - Date Favorited for fav-* collections
|
|
478
355
|
* - Weekly views for all other collections
|
|
479
356
|
*/
|
|
480
|
-
|
|
357
|
+
applyDefaultCollectionSort(collectionInfo?: CollectionExtraInfo): void;
|
|
358
|
+
/**
|
|
359
|
+
* Applies the default sort option for the current profile element
|
|
360
|
+
*/
|
|
361
|
+
applyDefaultProfileSort(): void;
|
|
481
362
|
/**
|
|
482
363
|
* This is useful for determining whether we need to reload the scroller.
|
|
483
364
|
*
|
|
484
365
|
* When the fetch completes, we need to reload the scroller if the cells for that
|
|
485
366
|
* page are visible, but if the page is not currenlty visible, we don't need to reload
|
|
486
367
|
*/
|
|
487
|
-
|
|
368
|
+
get currentVisiblePageNumbers(): number[];
|
|
488
369
|
/**
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
* @param pageNumber
|
|
492
|
-
* @param results
|
|
493
|
-
*/
|
|
494
|
-
private updateDataSource;
|
|
495
|
-
private getMediatype;
|
|
496
|
-
/**
|
|
497
|
-
* Returns the input string, but removing one set of quotes from all instances of
|
|
498
|
-
* ""clauses wrapped in two sets of quotes"". This assumes the quotes are already
|
|
499
|
-
* URL-encoded.
|
|
500
|
-
*
|
|
501
|
-
* This should be a temporary measure to address the fact that the __href__ field
|
|
502
|
-
* sometimes acquires extra quotation marks during query rewriting. Once there is a
|
|
503
|
-
* full Lucene parser in place that handles quoted queries correctly, this can likely
|
|
504
|
-
* be removed.
|
|
505
|
-
*/
|
|
506
|
-
private collapseRepeatedQuotes;
|
|
507
|
-
/** Fetches the aggregation buckets for the given prefix filter type. */
|
|
508
|
-
private fetchPrefixFilterBuckets;
|
|
509
|
-
/** Fetches and caches the prefix filter counts for the given filter type. */
|
|
510
|
-
private updatePrefixFilterCounts;
|
|
511
|
-
/**
|
|
512
|
-
* Fetches and caches the prefix filter counts for the current sort type,
|
|
513
|
-
* provided it is one that permits prefix filtering. (If not, this does nothing).
|
|
514
|
-
*/
|
|
515
|
-
private updatePrefixFiltersForCurrentSort;
|
|
516
|
-
/**
|
|
517
|
-
* Clears the cached letter counts for both title and creator, and
|
|
518
|
-
* fetches a new set of counts for whichever of them is the currently
|
|
519
|
-
* selected sort option (which may be neither).
|
|
520
|
-
*
|
|
521
|
-
* Call this whenever the counts are invalidated (e.g., by a query change).
|
|
370
|
+
* Refreshes all visible result cells in the infinite scroller.
|
|
522
371
|
*/
|
|
523
|
-
|
|
372
|
+
refreshVisibleResults(): void;
|
|
524
373
|
/**
|
|
525
374
|
* Callback when a result is selected
|
|
526
375
|
*/
|