@internetarchive/collection-browser 1.3.1-alpha.4 → 1.4.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 +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/assets/img/icons/contract.d.ts +2 -0
- package/dist/src/assets/img/icons/contract.js +9 -0
- package/dist/src/assets/img/icons/contract.js.map +1 -0
- package/dist/src/assets/img/icons/expand.js +1 -1
- package/dist/src/assets/img/icons/expand.js.map +1 -1
- package/dist/src/collection-browser.d.ts +0 -6
- package/dist/src/collection-browser.js +9 -26
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets.d.ts +1 -0
- package/dist/src/collection-facets.js +28 -9
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/expanded-date-picker.d.ts +4 -2
- package/dist/src/expanded-date-picker.js +17 -6
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/utils/analytics-events.d.ts +2 -0
- package/dist/src/utils/analytics-events.js +2 -0
- package/dist/src/utils/analytics-events.js.map +1 -1
- package/dist/test/collection-facets.test.js +132 -0
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/expanded-date-picker.test.js +39 -3
- package/dist/test/expanded-date-picker.test.js.map +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/src/assets/img/icons/contract.ts +9 -0
- package/src/assets/img/icons/expand.ts +1 -1
- package/src/collection-browser.ts +9 -30
- package/src/collection-facets.ts +39 -10
- package/src/expanded-date-picker.ts +22 -5
- package/src/utils/analytics-events.ts +2 -0
- package/test/collection-facets.test.ts +158 -1
- package/test/expanded-date-picker.test.ts +62 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { CollectionBrowser } from './src/collection-browser';
|
|
2
2
|
export { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';
|
|
3
|
-
export { CollectionDisplayMode
|
|
3
|
+
export { CollectionDisplayMode } from './src/models';
|
|
4
4
|
export { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';
|
|
5
5
|
export { CollectionTile } from './src/tiles/grid/collection-tile';
|
|
6
6
|
export { AccountTile } from './src/tiles/grid/account-tile';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { CollectionBrowser } from './src/collection-browser';
|
|
2
2
|
export { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';
|
|
3
|
-
export {
|
|
3
|
+
export {} from './src/models';
|
|
4
4
|
export { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';
|
|
5
5
|
export { CollectionTile } from './src/tiles/grid/collection-tile';
|
|
6
6
|
export { AccountTile } from './src/tiles/grid/account-tile';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAyB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAyB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { CollectionBrowser } from './src/collection-browser';\nexport { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';\nexport { CollectionDisplayMode } from './src/models';\nexport { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';\nexport { CollectionTile } from './src/tiles/grid/collection-tile';\nexport { AccountTile } from './src/tiles/grid/account-tile';\nexport { ItemTile } from './src/tiles/grid/item-tile';\nexport { TileList } from './src/tiles/list/tile-list';\nexport { TileListCompact } from './src/tiles/list/tile-list-compact';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
export default html `
|
|
3
|
+
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path
|
|
5
|
+
d="m55 45.734v-45l18.604 17.604 18.59-18.338 8.463 8.463-18.59 18.338 17.933 18.933zm-9.343 8.266v45l-18.604-17.604-18.59 18.338-8.463-8.463 18.59-18.338-17.933-18.933z"
|
|
6
|
+
/>
|
|
7
|
+
</svg>
|
|
8
|
+
`;
|
|
9
|
+
//# sourceMappingURL=contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,eAAe,IAAI,CAAA;;;;;;CAMlB,CAAC","sourcesContent":["import { html } from 'lit';\n\nexport default html`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m55 45.734v-45l18.604 17.604 18.59-18.338 8.463 8.463-18.59 18.338 17.933 18.933zm-9.343 8.266v45l-18.604-17.604-18.59 18.338-8.463-8.463 18.59-18.338-17.933-18.933z\"\n />\n </svg>\n`;\n"]}
|
|
@@ -2,7 +2,7 @@ import { html } from 'lit';
|
|
|
2
2
|
export default html `
|
|
3
3
|
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
4
4
|
<path
|
|
5
|
-
d="
|
|
5
|
+
d="m100.657 0v45l-18.604-17.604-18.59 18.338-8.463-8.463 18.59-18.338-17.933-18.933zm-100.657 99.734v-45l18.604 17.604 18.59-18.338 8.463 8.463-18.59 18.338 17.933 18.933z"
|
|
6
6
|
/>
|
|
7
7
|
</svg>
|
|
8
8
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expand.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/expand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,eAAe,IAAI,CAAA;;;;;;CAMlB,CAAC","sourcesContent":["import { html } from 'lit';\n\nexport default html`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"
|
|
1
|
+
{"version":3,"file":"expand.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/expand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,eAAe,IAAI,CAAA;;;;;;CAMlB,CAAC","sourcesContent":["import { html } from 'lit';\n\nexport default html`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m100.657 0v45l-18.604-17.604-18.59 18.338-8.463-8.463 18.59-18.338-17.933-18.933zm-100.657 99.734v-45l18.604 17.604 18.59-18.338 8.463 8.463-18.59 18.338 17.933 18.933z\"\n />\n </svg>\n`;\n"]}
|
|
@@ -21,7 +21,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
21
21
|
baseImageUrl: string;
|
|
22
22
|
searchService?: SearchServiceInterface;
|
|
23
23
|
searchType: SearchType;
|
|
24
|
-
withinCollection?: string;
|
|
25
24
|
baseQuery?: string;
|
|
26
25
|
displayMode?: CollectionDisplayMode;
|
|
27
26
|
sortParam: SortParam | null;
|
|
@@ -353,11 +352,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
353
352
|
facetClickHandler({ detail: { key, state: facetState, negative }, }: CustomEvent<FacetEventDetails>): void;
|
|
354
353
|
private fetchFacets;
|
|
355
354
|
private scrollToPage;
|
|
356
|
-
/**
|
|
357
|
-
* Additional params to pass to the search service if targeting a collection page,
|
|
358
|
-
* or null otherwise.
|
|
359
|
-
*/
|
|
360
|
-
private get collectionParams();
|
|
361
355
|
/**
|
|
362
356
|
* The query key is a string that uniquely identifies the current search.
|
|
363
357
|
* It consists of:
|
|
@@ -256,7 +256,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
256
256
|
setPlaceholderType() {
|
|
257
257
|
var _a;
|
|
258
258
|
this.placeholderType = null;
|
|
259
|
-
if (!((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim())
|
|
259
|
+
if (!((_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
260
260
|
this.placeholderType = 'empty-query';
|
|
261
261
|
}
|
|
262
262
|
else if (!this.searchResultsLoading &&
|
|
@@ -707,8 +707,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
707
707
|
changed.has('maxSelectedDate') ||
|
|
708
708
|
changed.has('sortParam') ||
|
|
709
709
|
changed.has('selectedFacets') ||
|
|
710
|
-
changed.has('searchService')
|
|
711
|
-
changed.has('withinCollection')) {
|
|
710
|
+
changed.has('searchService')) {
|
|
712
711
|
this.handleQueryChange();
|
|
713
712
|
}
|
|
714
713
|
if (changed.has('searchResultsLoading')) {
|
|
@@ -742,8 +741,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
742
741
|
const previousView = this.mobileView;
|
|
743
742
|
if (entry.target === this.contentContainer) {
|
|
744
743
|
this.contentWidth = entry.contentRect.width;
|
|
745
|
-
this.mobileView =
|
|
746
|
-
this.contentWidth > 0 && this.contentWidth < this.mobileBreakpoint;
|
|
744
|
+
this.mobileView = this.contentWidth < this.mobileBreakpoint;
|
|
747
745
|
// If changing from desktop to mobile disable transition
|
|
748
746
|
if (this.mobileView && !previousView) {
|
|
749
747
|
this.isResizeToMobile = true;
|
|
@@ -1131,15 +1129,14 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1131
1129
|
async fetchFacets() {
|
|
1132
1130
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1133
1131
|
const trimmedQuery = (_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim();
|
|
1134
|
-
if (!trimmedQuery
|
|
1132
|
+
if (!trimmedQuery)
|
|
1135
1133
|
return;
|
|
1136
1134
|
if (!this.searchService)
|
|
1137
1135
|
return;
|
|
1138
1136
|
const { facetFetchQueryKey } = this;
|
|
1139
1137
|
const sortParams = this.sortParam ? [this.sortParam] : [];
|
|
1140
1138
|
const params = {
|
|
1141
|
-
|
|
1142
|
-
query: trimmedQuery || '',
|
|
1139
|
+
query: trimmedQuery,
|
|
1143
1140
|
rows: 0,
|
|
1144
1141
|
filters: this.filterMap,
|
|
1145
1142
|
// Fetch a few extra buckets beyond the 6 we show, in case some get suppressed
|
|
@@ -1200,15 +1197,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1200
1197
|
}, 0);
|
|
1201
1198
|
});
|
|
1202
1199
|
}
|
|
1203
|
-
/**
|
|
1204
|
-
* Additional params to pass to the search service if targeting a collection page,
|
|
1205
|
-
* or null otherwise.
|
|
1206
|
-
*/
|
|
1207
|
-
get collectionParams() {
|
|
1208
|
-
return this.withinCollection
|
|
1209
|
-
? { pageType: 'collection_details', pageTarget: this.withinCollection }
|
|
1210
|
-
: null;
|
|
1211
|
-
}
|
|
1212
1200
|
/**
|
|
1213
1201
|
* The query key is a string that uniquely identifies the current search.
|
|
1214
1202
|
* It consists of:
|
|
@@ -1246,7 +1234,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1246
1234
|
async fetchPage(pageNumber, numInitialPages = 1) {
|
|
1247
1235
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1248
1236
|
const trimmedQuery = (_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim();
|
|
1249
|
-
if (!trimmedQuery
|
|
1237
|
+
if (!trimmedQuery)
|
|
1250
1238
|
return;
|
|
1251
1239
|
if (!this.searchService)
|
|
1252
1240
|
return;
|
|
@@ -1270,8 +1258,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1270
1258
|
this.pageFetchesInProgress[pageFetchQueryKey] = pageFetches;
|
|
1271
1259
|
const sortParams = this.sortParam ? [this.sortParam] : [];
|
|
1272
1260
|
const params = {
|
|
1273
|
-
|
|
1274
|
-
query: trimmedQuery || '',
|
|
1261
|
+
query: trimmedQuery,
|
|
1275
1262
|
page: pageNumber,
|
|
1276
1263
|
rows: numRows,
|
|
1277
1264
|
sort: sortParams,
|
|
@@ -1433,13 +1420,12 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1433
1420
|
async fetchPrefixFilterBuckets(filterType) {
|
|
1434
1421
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
1435
1422
|
const trimmedQuery = (_a = this.baseQuery) === null || _a === void 0 ? void 0 : _a.trim();
|
|
1436
|
-
if (!trimmedQuery
|
|
1423
|
+
if (!trimmedQuery)
|
|
1437
1424
|
return [];
|
|
1438
1425
|
const filterAggregationKey = prefixFilterAggregationKeys[filterType];
|
|
1439
1426
|
const sortParams = this.sortParam ? [this.sortParam] : [];
|
|
1440
1427
|
const params = {
|
|
1441
|
-
|
|
1442
|
-
query: trimmedQuery || '',
|
|
1428
|
+
query: trimmedQuery,
|
|
1443
1429
|
rows: 0,
|
|
1444
1430
|
filters: this.filterMap,
|
|
1445
1431
|
// Only fetch the firstTitle or firstCreator aggregation
|
|
@@ -1923,9 +1909,6 @@ __decorate([
|
|
|
1923
1909
|
__decorate([
|
|
1924
1910
|
property({ type: String })
|
|
1925
1911
|
], CollectionBrowser.prototype, "searchType", void 0);
|
|
1926
|
-
__decorate([
|
|
1927
|
-
property({ type: String })
|
|
1928
|
-
], CollectionBrowser.prototype, "withinCollection", void 0);
|
|
1929
1912
|
__decorate([
|
|
1930
1913
|
property({ type: String })
|
|
1931
1914
|
], CollectionBrowser.prototype, "baseQuery", void 0);
|