@internetarchive/collection-browser 3.0.1 → 3.0.2-alpha-webdev7960.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/src/collection-browser.js +680 -680
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +130 -130
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets.js +263 -263
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/test/collection-browser.test.js +183 -183
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +2 -2
- package/src/collection-browser.ts +2775 -2775
- package/src/collection-facets/facet-row.ts +282 -282
- package/src/collection-facets.ts +990 -990
- package/src/data-source/collection-browser-data-source-interface.ts +333 -333
- package/src/data-source/collection-browser-data-source.ts +1390 -1390
- package/src/data-source/collection-browser-query-state.ts +63 -63
- package/src/data-source/models.ts +43 -43
- package/src/models.ts +870 -870
- package/src/restoration-state-handler.ts +544 -544
- package/test/collection-browser.test.ts +2340 -2340
- package/test/restoration-state-handler.test.ts +510 -510
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
CollectionExtraInfo,
|
|
3
|
-
PageElementName,
|
|
4
|
-
SearchServiceInterface,
|
|
5
|
-
SearchType,
|
|
6
|
-
SortDirection,
|
|
7
|
-
SortParam,
|
|
8
|
-
} from '@internetarchive/search-service';
|
|
9
|
-
import type {
|
|
10
|
-
FacetLoadStrategy,
|
|
11
|
-
SelectedFacets,
|
|
12
|
-
SortField,
|
|
13
|
-
TvClipFilterType,
|
|
14
|
-
} from '../models';
|
|
15
|
-
import type { CollectionBrowserDataSourceInterface } from './collection-browser-data-source-interface';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Properties of collection browser that affect the overall search query
|
|
19
|
-
*/
|
|
20
|
-
export interface CollectionBrowserQueryState {
|
|
21
|
-
baseQuery?: string;
|
|
22
|
-
withinCollection?: string;
|
|
23
|
-
withinProfile?: string;
|
|
24
|
-
profileElement?: PageElementName;
|
|
25
|
-
searchType: SearchType;
|
|
26
|
-
selectedFacets?: SelectedFacets;
|
|
27
|
-
internalFilters?: SelectedFacets;
|
|
28
|
-
minSelectedDate?: string;
|
|
29
|
-
maxSelectedDate?: string;
|
|
30
|
-
selectedTitleFilter: string | null;
|
|
31
|
-
selectedCreatorFilter: string | null;
|
|
32
|
-
tvClipFilter?: TvClipFilterType;
|
|
33
|
-
selectedSort?: SortField;
|
|
34
|
-
sortDirection: SortDirection | null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Interface representing search-related state and operations required by the
|
|
39
|
-
* data source on its host component.
|
|
40
|
-
*/
|
|
41
|
-
export interface CollectionBrowserSearchInterface
|
|
42
|
-
extends CollectionBrowserQueryState {
|
|
43
|
-
searchService?: SearchServiceInterface;
|
|
44
|
-
isTVCollection: boolean;
|
|
45
|
-
readonly sortParam: SortParam | null;
|
|
46
|
-
readonly defaultSortField: SortField | null;
|
|
47
|
-
readonly facetLoadStrategy: FacetLoadStrategy;
|
|
48
|
-
readonly initialPageNumber: number;
|
|
49
|
-
readonly maxPagesToManage: number;
|
|
50
|
-
readonly currentVisiblePageNumbers: number[];
|
|
51
|
-
readonly clearResultsOnEmptyQuery?: boolean;
|
|
52
|
-
readonly dataSource?: CollectionBrowserDataSourceInterface;
|
|
53
|
-
|
|
54
|
-
getSessionId(): Promise<string>;
|
|
55
|
-
setSearchResultsLoading(loading: boolean): void;
|
|
56
|
-
setFacetsLoading(loading: boolean): void;
|
|
57
|
-
setTotalResultCount(count: number): void;
|
|
58
|
-
setTileCount(count: number): void;
|
|
59
|
-
applyDefaultCollectionSort(collectionInfo?: CollectionExtraInfo): void;
|
|
60
|
-
emitEmptyResults(): void;
|
|
61
|
-
emitQueryStateChanged(): void;
|
|
62
|
-
refreshVisibleResults(): void;
|
|
63
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
CollectionExtraInfo,
|
|
3
|
+
PageElementName,
|
|
4
|
+
SearchServiceInterface,
|
|
5
|
+
SearchType,
|
|
6
|
+
SortDirection,
|
|
7
|
+
SortParam,
|
|
8
|
+
} from '@internetarchive/search-service';
|
|
9
|
+
import type {
|
|
10
|
+
FacetLoadStrategy,
|
|
11
|
+
SelectedFacets,
|
|
12
|
+
SortField,
|
|
13
|
+
TvClipFilterType,
|
|
14
|
+
} from '../models';
|
|
15
|
+
import type { CollectionBrowserDataSourceInterface } from './collection-browser-data-source-interface';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Properties of collection browser that affect the overall search query
|
|
19
|
+
*/
|
|
20
|
+
export interface CollectionBrowserQueryState {
|
|
21
|
+
baseQuery?: string;
|
|
22
|
+
withinCollection?: string;
|
|
23
|
+
withinProfile?: string;
|
|
24
|
+
profileElement?: PageElementName;
|
|
25
|
+
searchType: SearchType;
|
|
26
|
+
selectedFacets?: SelectedFacets;
|
|
27
|
+
internalFilters?: SelectedFacets;
|
|
28
|
+
minSelectedDate?: string;
|
|
29
|
+
maxSelectedDate?: string;
|
|
30
|
+
selectedTitleFilter: string | null;
|
|
31
|
+
selectedCreatorFilter: string | null;
|
|
32
|
+
tvClipFilter?: TvClipFilterType;
|
|
33
|
+
selectedSort?: SortField;
|
|
34
|
+
sortDirection: SortDirection | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Interface representing search-related state and operations required by the
|
|
39
|
+
* data source on its host component.
|
|
40
|
+
*/
|
|
41
|
+
export interface CollectionBrowserSearchInterface
|
|
42
|
+
extends CollectionBrowserQueryState {
|
|
43
|
+
searchService?: SearchServiceInterface;
|
|
44
|
+
isTVCollection: boolean;
|
|
45
|
+
readonly sortParam: SortParam | null;
|
|
46
|
+
readonly defaultSortField: SortField | null;
|
|
47
|
+
readonly facetLoadStrategy: FacetLoadStrategy;
|
|
48
|
+
readonly initialPageNumber: number;
|
|
49
|
+
readonly maxPagesToManage: number;
|
|
50
|
+
readonly currentVisiblePageNumbers: number[];
|
|
51
|
+
readonly clearResultsOnEmptyQuery?: boolean;
|
|
52
|
+
readonly dataSource?: CollectionBrowserDataSourceInterface;
|
|
53
|
+
|
|
54
|
+
getSessionId(): Promise<string>;
|
|
55
|
+
setSearchResultsLoading(loading: boolean): void;
|
|
56
|
+
setFacetsLoading(loading: boolean): void;
|
|
57
|
+
setTotalResultCount(count: number): void;
|
|
58
|
+
setTileCount(count: number): void;
|
|
59
|
+
applyDefaultCollectionSort(collectionInfo?: CollectionExtraInfo): void;
|
|
60
|
+
emitEmptyResults(): void;
|
|
61
|
+
emitQueryStateChanged(): void;
|
|
62
|
+
refreshVisibleResults(): void;
|
|
63
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
PageElementName,
|
|
3
|
-
PageType,
|
|
4
|
-
} from '@internetarchive/search-service';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A Map from collection identifiers to their corresponding collection titles.
|
|
8
|
-
*/
|
|
9
|
-
export type CollectionTitles = Map<string, string>;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* A Map from channel names to their corresponding, more human-readable network name.
|
|
13
|
-
*/
|
|
14
|
-
export type TVChannelAliases = Map<string, string>;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The subset of search service params that uniquely specify the type of results
|
|
18
|
-
* that are sought by an instance of collection browser.
|
|
19
|
-
*/
|
|
20
|
-
export type PageSpecifierParams = {
|
|
21
|
-
/**
|
|
22
|
-
* What high-level type of page is being fetched for (search results, collection, or profile)
|
|
23
|
-
*/
|
|
24
|
-
pageType: PageType;
|
|
25
|
-
/**
|
|
26
|
-
* The target identifier for collection or profile pages (e.g., "prelinger", "@brewster", ...)
|
|
27
|
-
*/
|
|
28
|
-
pageTarget: string;
|
|
29
|
-
/**
|
|
30
|
-
* Which specific elements of a profile page to fetch. Corresponds to individual tab data
|
|
31
|
-
* (e.g., "uploads", "reviews", ...)
|
|
32
|
-
*/
|
|
33
|
-
pageElements?: PageElementName[];
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* List of profile page elements that do not currently allow faceting
|
|
38
|
-
*/
|
|
39
|
-
export const FACETLESS_PAGE_ELEMENTS: PageElementName[] = [
|
|
40
|
-
'forum_posts',
|
|
41
|
-
'lending',
|
|
42
|
-
'web_archives',
|
|
43
|
-
];
|
|
1
|
+
import type {
|
|
2
|
+
PageElementName,
|
|
3
|
+
PageType,
|
|
4
|
+
} from '@internetarchive/search-service';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A Map from collection identifiers to their corresponding collection titles.
|
|
8
|
+
*/
|
|
9
|
+
export type CollectionTitles = Map<string, string>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A Map from channel names to their corresponding, more human-readable network name.
|
|
13
|
+
*/
|
|
14
|
+
export type TVChannelAliases = Map<string, string>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The subset of search service params that uniquely specify the type of results
|
|
18
|
+
* that are sought by an instance of collection browser.
|
|
19
|
+
*/
|
|
20
|
+
export type PageSpecifierParams = {
|
|
21
|
+
/**
|
|
22
|
+
* What high-level type of page is being fetched for (search results, collection, or profile)
|
|
23
|
+
*/
|
|
24
|
+
pageType: PageType;
|
|
25
|
+
/**
|
|
26
|
+
* The target identifier for collection or profile pages (e.g., "prelinger", "@brewster", ...)
|
|
27
|
+
*/
|
|
28
|
+
pageTarget: string;
|
|
29
|
+
/**
|
|
30
|
+
* Which specific elements of a profile page to fetch. Corresponds to individual tab data
|
|
31
|
+
* (e.g., "uploads", "reviews", ...)
|
|
32
|
+
*/
|
|
33
|
+
pageElements?: PageElementName[];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List of profile page elements that do not currently allow faceting
|
|
38
|
+
*/
|
|
39
|
+
export const FACETLESS_PAGE_ELEMENTS: PageElementName[] = [
|
|
40
|
+
'forum_posts',
|
|
41
|
+
'lending',
|
|
42
|
+
'web_archives',
|
|
43
|
+
];
|