@internetarchive/collection-browser 3.5.2-alpha-webdev8160.0 → 3.5.2-alpha-webdev8093.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/app-root.js +606 -606
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.js +764 -764
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +140 -140
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +23 -23
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +1 -0
- package/dist/src/collection-facets/more-facets-content.js +126 -127
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets.js +267 -267
- 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.d.ts +0 -4
- package/dist/src/models.js +0 -8
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +77 -77
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +137 -137
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +8 -0
- package/dist/src/tiles/hover/hover-pane-controller.js +13 -1
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/models.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +215 -215
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/collection-browser.test.js +189 -189
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +28 -28
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +1 -1
- package/src/app-root.ts +1140 -1140
- package/src/collection-browser.ts +3075 -3075
- package/src/collection-facets/facet-row.ts +299 -299
- package/src/collection-facets/facets-template.ts +83 -83
- package/src/collection-facets/more-facets-content.ts +642 -644
- package/src/collection-facets.ts +1010 -1010
- package/src/data-source/collection-browser-data-source-interface.ts +345 -345
- package/src/data-source/collection-browser-data-source.ts +1441 -1441
- package/src/data-source/collection-browser-query-state.ts +59 -59
- package/src/data-source/models.ts +56 -56
- package/src/models.ts +0 -9
- package/src/restoration-state-handler.ts +546 -546
- package/src/tiles/grid/collection-tile.ts +163 -163
- package/src/tiles/grid/item-tile.ts +340 -340
- package/src/tiles/hover/hover-pane-controller.ts +15 -1
- package/src/tiles/models.ts +1 -1
- package/src/tiles/tile-dispatcher.ts +517 -517
- package/test/collection-browser.test.ts +2413 -2413
- package/test/collection-facets/more-facets-content.test.ts +231 -231
- package/test/restoration-state-handler.test.ts +480 -480
- package/vite.config.ts +29 -29
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
CollectionExtraInfo,
|
|
3
|
-
PageElementName,
|
|
4
|
-
SearchServiceInterface,
|
|
5
|
-
SearchType,
|
|
6
|
-
SortDirection,
|
|
7
|
-
SortParam,
|
|
8
|
-
} from '@internetarchive/search-service';
|
|
9
|
-
import type { FacetLoadStrategy, SelectedFacets, SortField } from '../models';
|
|
10
|
-
import type { CollectionBrowserDataSourceInterface } from './collection-browser-data-source-interface';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Properties of collection browser that affect the overall search query
|
|
14
|
-
*/
|
|
15
|
-
export interface CollectionBrowserQueryState {
|
|
16
|
-
baseQuery?: string;
|
|
17
|
-
identifiers?: string[];
|
|
18
|
-
withinCollection?: string;
|
|
19
|
-
withinProfile?: string;
|
|
20
|
-
profileElement?: PageElementName;
|
|
21
|
-
searchType: SearchType;
|
|
22
|
-
selectedFacets?: SelectedFacets;
|
|
23
|
-
internalFilters?: SelectedFacets;
|
|
24
|
-
minSelectedDate?: string;
|
|
25
|
-
maxSelectedDate?: string;
|
|
26
|
-
selectedTitleFilter: string | null;
|
|
27
|
-
selectedCreatorFilter: string | null;
|
|
28
|
-
selectedSort?: SortField;
|
|
29
|
-
sortDirection: SortDirection | null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Interface representing search-related state and operations required by the
|
|
34
|
-
* data source on its host component.
|
|
35
|
-
*/
|
|
36
|
-
export interface CollectionBrowserSearchInterface
|
|
37
|
-
extends CollectionBrowserQueryState {
|
|
38
|
-
searchService?: SearchServiceInterface;
|
|
39
|
-
isTVCollection: boolean;
|
|
40
|
-
readonly sortParam: SortParam | null;
|
|
41
|
-
readonly defaultSortField: SortField | null;
|
|
42
|
-
readonly facetLoadStrategy: FacetLoadStrategy;
|
|
43
|
-
readonly initialPageNumber: number;
|
|
44
|
-
readonly maxPagesToManage: number;
|
|
45
|
-
readonly currentVisiblePageNumbers: number[];
|
|
46
|
-
readonly clearResultsOnEmptyQuery?: boolean;
|
|
47
|
-
readonly dataSource?: CollectionBrowserDataSourceInterface;
|
|
48
|
-
|
|
49
|
-
getSessionId(): Promise<string>;
|
|
50
|
-
setSearchResultsLoading(loading: boolean): void;
|
|
51
|
-
setFacetsLoading(loading: boolean): void;
|
|
52
|
-
setTotalResultCount(count: number): void;
|
|
53
|
-
setTileCount(count: number): void;
|
|
54
|
-
applyDefaultCollectionSort(collectionInfo?: CollectionExtraInfo): void;
|
|
55
|
-
emitEmptyResults(): void;
|
|
56
|
-
emitSearchError(): void;
|
|
57
|
-
emitQueryStateChanged(): void;
|
|
58
|
-
refreshVisibleResults(): void;
|
|
59
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
CollectionExtraInfo,
|
|
3
|
+
PageElementName,
|
|
4
|
+
SearchServiceInterface,
|
|
5
|
+
SearchType,
|
|
6
|
+
SortDirection,
|
|
7
|
+
SortParam,
|
|
8
|
+
} from '@internetarchive/search-service';
|
|
9
|
+
import type { FacetLoadStrategy, SelectedFacets, SortField } from '../models';
|
|
10
|
+
import type { CollectionBrowserDataSourceInterface } from './collection-browser-data-source-interface';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Properties of collection browser that affect the overall search query
|
|
14
|
+
*/
|
|
15
|
+
export interface CollectionBrowserQueryState {
|
|
16
|
+
baseQuery?: string;
|
|
17
|
+
identifiers?: string[];
|
|
18
|
+
withinCollection?: string;
|
|
19
|
+
withinProfile?: string;
|
|
20
|
+
profileElement?: PageElementName;
|
|
21
|
+
searchType: SearchType;
|
|
22
|
+
selectedFacets?: SelectedFacets;
|
|
23
|
+
internalFilters?: SelectedFacets;
|
|
24
|
+
minSelectedDate?: string;
|
|
25
|
+
maxSelectedDate?: string;
|
|
26
|
+
selectedTitleFilter: string | null;
|
|
27
|
+
selectedCreatorFilter: string | null;
|
|
28
|
+
selectedSort?: SortField;
|
|
29
|
+
sortDirection: SortDirection | null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Interface representing search-related state and operations required by the
|
|
34
|
+
* data source on its host component.
|
|
35
|
+
*/
|
|
36
|
+
export interface CollectionBrowserSearchInterface
|
|
37
|
+
extends CollectionBrowserQueryState {
|
|
38
|
+
searchService?: SearchServiceInterface;
|
|
39
|
+
isTVCollection: boolean;
|
|
40
|
+
readonly sortParam: SortParam | null;
|
|
41
|
+
readonly defaultSortField: SortField | null;
|
|
42
|
+
readonly facetLoadStrategy: FacetLoadStrategy;
|
|
43
|
+
readonly initialPageNumber: number;
|
|
44
|
+
readonly maxPagesToManage: number;
|
|
45
|
+
readonly currentVisiblePageNumbers: number[];
|
|
46
|
+
readonly clearResultsOnEmptyQuery?: boolean;
|
|
47
|
+
readonly dataSource?: CollectionBrowserDataSourceInterface;
|
|
48
|
+
|
|
49
|
+
getSessionId(): Promise<string>;
|
|
50
|
+
setSearchResultsLoading(loading: boolean): void;
|
|
51
|
+
setFacetsLoading(loading: boolean): void;
|
|
52
|
+
setTotalResultCount(count: number): void;
|
|
53
|
+
setTileCount(count: number): void;
|
|
54
|
+
applyDefaultCollectionSort(collectionInfo?: CollectionExtraInfo): void;
|
|
55
|
+
emitEmptyResults(): void;
|
|
56
|
+
emitSearchError(): void;
|
|
57
|
+
emitQueryStateChanged(): void;
|
|
58
|
+
refreshVisibleResults(): void;
|
|
59
|
+
}
|
|
@@ -1,56 +1,56 @@
|
|
|
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
|
-
* A Map from program (show) names to a mapping of all the channels that run them.
|
|
18
|
-
*/
|
|
19
|
-
export type TVProgramChannels = Map<string, Record<string, number>>;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Object storing the different TV channel mappings used by the data source.
|
|
23
|
-
*/
|
|
24
|
-
export type TVChannelMaps = {
|
|
25
|
-
channelToNetwork?: TVChannelAliases;
|
|
26
|
-
programToChannels?: TVProgramChannels;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The subset of search service params that uniquely specify the type of results
|
|
31
|
-
* that are sought by an instance of collection browser.
|
|
32
|
-
*/
|
|
33
|
-
export type PageSpecifierParams = {
|
|
34
|
-
/**
|
|
35
|
-
* What high-level type of page is being fetched for (search results, collection, or profile)
|
|
36
|
-
*/
|
|
37
|
-
pageType: PageType;
|
|
38
|
-
/**
|
|
39
|
-
* The target identifier for collection or profile pages (e.g., "prelinger", "@brewster", ...)
|
|
40
|
-
*/
|
|
41
|
-
pageTarget?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Which specific elements of a profile page to fetch. Corresponds to individual tab data
|
|
44
|
-
* (e.g., "uploads", "reviews", ...)
|
|
45
|
-
*/
|
|
46
|
-
pageElements?: PageElementName[];
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* List of profile page elements that do not currently allow faceting
|
|
51
|
-
*/
|
|
52
|
-
export const FACETLESS_PAGE_ELEMENTS: PageElementName[] = [
|
|
53
|
-
'forum_posts',
|
|
54
|
-
'lending',
|
|
55
|
-
'web_archives',
|
|
56
|
-
];
|
|
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
|
+
* A Map from program (show) names to a mapping of all the channels that run them.
|
|
18
|
+
*/
|
|
19
|
+
export type TVProgramChannels = Map<string, Record<string, number>>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Object storing the different TV channel mappings used by the data source.
|
|
23
|
+
*/
|
|
24
|
+
export type TVChannelMaps = {
|
|
25
|
+
channelToNetwork?: TVChannelAliases;
|
|
26
|
+
programToChannels?: TVProgramChannels;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The subset of search service params that uniquely specify the type of results
|
|
31
|
+
* that are sought by an instance of collection browser.
|
|
32
|
+
*/
|
|
33
|
+
export type PageSpecifierParams = {
|
|
34
|
+
/**
|
|
35
|
+
* What high-level type of page is being fetched for (search results, collection, or profile)
|
|
36
|
+
*/
|
|
37
|
+
pageType: PageType;
|
|
38
|
+
/**
|
|
39
|
+
* The target identifier for collection or profile pages (e.g., "prelinger", "@brewster", ...)
|
|
40
|
+
*/
|
|
41
|
+
pageTarget?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Which specific elements of a profile page to fetch. Corresponds to individual tab data
|
|
44
|
+
* (e.g., "uploads", "reviews", ...)
|
|
45
|
+
*/
|
|
46
|
+
pageElements?: PageElementName[];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* List of profile page elements that do not currently allow faceting
|
|
51
|
+
*/
|
|
52
|
+
export const FACETLESS_PAGE_ELEMENTS: PageElementName[] = [
|
|
53
|
+
'forum_posts',
|
|
54
|
+
'lending',
|
|
55
|
+
'web_archives',
|
|
56
|
+
];
|
package/src/models.ts
CHANGED
|
@@ -774,15 +774,6 @@ export const defaultFacetSort: Record<FacetOption, AggregationSortType> = {
|
|
|
774
774
|
sponsor: AggregationSortType.COUNT,
|
|
775
775
|
};
|
|
776
776
|
|
|
777
|
-
/**
|
|
778
|
-
* The default sort type to use for each facet type in TV search More... dialogs only
|
|
779
|
-
*/
|
|
780
|
-
export const tvMoreFacetSort: Record<FacetOption, AggregationSortType> = {
|
|
781
|
-
...defaultFacetSort,
|
|
782
|
-
creator: AggregationSortType.ALPHABETICAL,
|
|
783
|
-
program: AggregationSortType.ALPHABETICAL,
|
|
784
|
-
};
|
|
785
|
-
|
|
786
777
|
/**
|
|
787
778
|
* The sort type corresponding to facet bucket values, for each facet type
|
|
788
779
|
* (i.e., the opposite of "sort by count" for that type).
|