@internetarchive/collection-browser 2.10.1-alpha-webdev7479.9 → 2.11.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/assets/img/icons/close-circle-dark.d.ts +2 -0
- package/dist/src/assets/img/icons/close-circle-dark.js +5 -0
- package/dist/src/assets/img/icons/close-circle-dark.js.map +1 -0
- package/dist/src/collection-browser.d.ts +8 -4
- package/dist/src/collection-browser.js +35 -21
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.d.ts +3 -2
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +36 -13
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js +26 -10
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +19 -9
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js +5 -15
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +0 -1
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/src/models.d.ts +0 -2
- package/dist/src/models.js +5 -9
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.d.ts +2 -6
- package/dist/src/restoration-state-handler.js +11 -27
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +0 -1
- package/dist/src/tiles/grid/item-tile.js +1 -7
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +2 -46
- package/dist/src/tiles/grid/tile-stats.js +41 -92
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/item-image.js +3 -6
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +0 -1
- package/dist/src/tiles/tile-dispatcher.js +0 -5
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/collection-browser.test.js +14 -0
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js +4 -4
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +2 -2
- package/src/assets/img/icons/close-circle-dark.ts +5 -0
- package/src/collection-browser.ts +37 -20
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +4 -1
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +38 -16
- package/src/collection-facets/smart-facets/smart-facet-button.ts +27 -10
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +21 -10
- package/src/data-source/collection-browser-data-source.ts +3 -14
- package/src/data-source/collection-browser-query-state.ts +0 -1
- package/src/models.ts +0 -8
- package/src/restoration-state-handler.ts +11 -33
- package/src/tiles/grid/item-tile.ts +0 -4
- package/src/tiles/grid/tile-stats.ts +52 -106
- package/src/tiles/item-image.ts +0 -3
- package/src/tiles/tile-dispatcher.ts +0 -3
- package/test/collection-browser.test.ts +19 -0
- package/test/restoration-state-handler.test.ts +4 -4
- package/dist/src/assets/img/icons/quote.d.ts +0 -1
- package/dist/src/assets/img/icons/quote.js +0 -7
- package/dist/src/assets/img/icons/quote.js.map +0 -1
- package/src/assets/img/icons/quote.ts +0 -7
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { svg } from 'lit';
|
|
2
|
+
export default svg `
|
|
3
|
+
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="m50 0c27.6142375 0 50 22.3857625 50 50s-22.3857625 50-50 50-50-22.3857625-50-50 22.3857625-50 50-50zm23.8159475 26.1840525c-1.4033215-1.4033215-3.5816761-1.5592461-5.1572272-.4677738l-.5598841.4677738-18.0988362 18.0989475-18.0988362-18.0989475-.5598841-.4677738c-1.5755511-1.0914723-3.7539057-.9355477-5.1572272.4677738-1.5787367 1.5787367-1.5787367 4.1383746 0 5.7171113l18.0989475 18.0988362-18.0989475 18.0988362c-1.5787367 1.5787367-1.5787367 4.1383746 0 5.7171113 1.4033215 1.4033215 3.5816761 1.5592461 5.1572272.4677738l.5598841-.4677738 18.0988362-18.0989475 18.0988362 18.0989475.5598841.4677738c1.5755511 1.0914723 3.7539057.9355477 5.1572272-.4677738 1.5787367-1.5787367 1.5787367-4.1383746 0-5.7171113l-18.0989475-18.0988362 18.0989475-18.0988362c1.5787367-1.5787367 1.5787367-4.1383746 0-5.7171113z" fill-rule="evenodd"/></svg>
|
|
4
|
+
`;
|
|
5
|
+
//# sourceMappingURL=close-circle-dark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close-circle-dark.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/close-circle-dark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,eAAe,GAAG,CAAA;;CAEjB,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport default svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m50 0c27.6142375 0 50 22.3857625 50 50s-22.3857625 50-50 50-50-22.3857625-50-50 22.3857625-50 50-50zm23.8159475 26.1840525c-1.4033215-1.4033215-3.5816761-1.5592461-5.1572272-.4677738l-.5598841.4677738-18.0988362 18.0989475-18.0988362-18.0989475-.5598841-.4677738c-1.5755511-1.0914723-3.7539057-.9355477-5.1572272.4677738-1.5787367 1.5787367-1.5787367 4.1383746 0 5.7171113l18.0989475 18.0988362-18.0989475 18.0988362c-1.5787367 1.5787367-1.5787367 4.1383746 0 5.7171113 1.4033215 1.4033215 3.5816761 1.5592461 5.1572272.4677738l.5598841-.4677738 18.0988362-18.0989475 18.0988362 18.0989475.5598841.4677738c1.5755511 1.0914723 3.7539057.9355477 5.1572272-.4677738 1.5787367-1.5787367 1.5787367-4.1383746 0-5.7171113l-18.0989475-18.0988362 18.0989475-18.0988362c1.5787367-1.5787367 1.5787367-4.1383746 0-5.7171113z\" fill-rule=\"evenodd\"/></svg>\n`;\n"]}
|
|
@@ -122,10 +122,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
122
122
|
modalManager?: ModalManagerInterface;
|
|
123
123
|
featureFeedbackService?: FeatureFeedbackServiceInterface;
|
|
124
124
|
recaptchaManager?: RecaptchaManagerInterface;
|
|
125
|
-
/**
|
|
126
|
-
* Whether we are representing a TV collection, needing slightly different tile handling.
|
|
127
|
-
*/
|
|
128
|
-
isTVCollection: boolean;
|
|
129
125
|
/**
|
|
130
126
|
* If item management UI active
|
|
131
127
|
*/
|
|
@@ -135,6 +131,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
135
131
|
enableSortOptionsSlot: boolean;
|
|
136
132
|
/** Whether to display a smart results carousel above the full results */
|
|
137
133
|
showSmartResults: boolean;
|
|
134
|
+
resultsHeader?: string;
|
|
138
135
|
/**
|
|
139
136
|
* The maximum number of pages we will load when a privileged user clicks
|
|
140
137
|
* the "Manage" button on the search page. Limited to 15 pages.
|
|
@@ -173,6 +170,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
173
170
|
private leftColumn?;
|
|
174
171
|
private collectionFacets?;
|
|
175
172
|
private manageBar?;
|
|
173
|
+
private smartFacetBar?;
|
|
176
174
|
analyticsHandler?: AnalyticsManagerInterface;
|
|
177
175
|
/** Whether layout size analytics have been sent already. */
|
|
178
176
|
private layoutSizeAnalyticsSent;
|
|
@@ -328,6 +326,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
328
326
|
* Handler when user request to bulk edit from /search/ page
|
|
329
327
|
*/
|
|
330
328
|
private handleManageItems;
|
|
329
|
+
refreshSmartFacets(): void;
|
|
331
330
|
/**
|
|
332
331
|
* Handler to show processing modal while removing item
|
|
333
332
|
*/
|
|
@@ -498,6 +497,11 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
498
497
|
* (e.g., metadata vs. full-text).
|
|
499
498
|
*/
|
|
500
499
|
private emitSearchTypeChanged;
|
|
500
|
+
/**
|
|
501
|
+
* Emits a `facetPaneVisibilityChanged` event indicating that the facet pane has
|
|
502
|
+
* been toggled open or closed.
|
|
503
|
+
*/
|
|
504
|
+
private emitFacetPaneVisibilityChanged;
|
|
501
505
|
/**
|
|
502
506
|
* Emits a `queryStateChanged` event indicating that one or more of this component's
|
|
503
507
|
* properties have changed in a way that could affect the set of search results.
|
|
@@ -29,7 +29,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
29
29
|
/**
|
|
30
30
|
* Which backend should be targeted by searches (e.g., metadata or FTS)
|
|
31
31
|
*/
|
|
32
|
-
this.searchType = SearchType.
|
|
32
|
+
this.searchType = SearchType.METADATA;
|
|
33
33
|
this.selectedSort = SortField.default;
|
|
34
34
|
this.selectedTitleFilter = null;
|
|
35
35
|
this.selectedCreatorFilter = null;
|
|
@@ -100,10 +100,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
100
100
|
this.mobileBreakpoint = 600;
|
|
101
101
|
this.loggedIn = false;
|
|
102
102
|
this.modalManager = undefined;
|
|
103
|
-
/**
|
|
104
|
-
* Whether we are representing a TV collection, needing slightly different tile handling.
|
|
105
|
-
*/
|
|
106
|
-
this.isTVCollection = false;
|
|
107
103
|
/**
|
|
108
104
|
* If item management UI active
|
|
109
105
|
*/
|
|
@@ -338,7 +334,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
338
334
|
render() {
|
|
339
335
|
return html `
|
|
340
336
|
${this.showSmartFacetBar
|
|
341
|
-
? html
|
|
337
|
+
? html `<smart-facet-bar
|
|
342
338
|
.query=${this.baseQuery}
|
|
343
339
|
.aggregations=${this.dataSource.aggregations}
|
|
344
340
|
.selectedFacets=${this.selectedFacets}
|
|
@@ -347,6 +343,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
347
343
|
@facetsChanged=${this.facetsChanged}
|
|
348
344
|
@filtersToggled=${() => {
|
|
349
345
|
this.facetPaneVisible = !this.facetPaneVisible;
|
|
346
|
+
this.emitFacetPaneVisibilityChanged();
|
|
350
347
|
}}
|
|
351
348
|
></smart-facet-bar>`
|
|
352
349
|
: nothing}
|
|
@@ -503,18 +500,21 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
503
500
|
* tiles and sort/filter bar are shown.
|
|
504
501
|
*/
|
|
505
502
|
get rightColumnTemplate() {
|
|
503
|
+
var _a;
|
|
504
|
+
const rightColumnClasses = classMap({
|
|
505
|
+
column: true,
|
|
506
|
+
'full-width': this.showSmartFacetBar && !this.facetPaneVisible,
|
|
507
|
+
'smart-results-spacing': !!this.showSmartResults,
|
|
508
|
+
});
|
|
506
509
|
return html `
|
|
507
|
-
<div
|
|
508
|
-
id="right-column"
|
|
509
|
-
class="column ${this.showSmartResults ? 'smart-results-spacing' : ''}"
|
|
510
|
-
>
|
|
510
|
+
<div id="right-column" class=${rightColumnClasses}>
|
|
511
511
|
${this.showSmartResults
|
|
512
512
|
? html `<slot name="smart-results"></slot>`
|
|
513
513
|
: nothing}
|
|
514
514
|
<section id="results">
|
|
515
515
|
${this.showSmartResults
|
|
516
516
|
? html `<h2 class="results-section-heading">
|
|
517
|
-
${msg('All results')}
|
|
517
|
+
${(_a = this.resultsHeader) !== null && _a !== void 0 ? _a : msg('All results')}
|
|
518
518
|
</h2>`
|
|
519
519
|
: nothing}
|
|
520
520
|
<div id="cb-top-view">
|
|
@@ -651,6 +651,10 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
651
651
|
},
|
|
652
652
|
}));
|
|
653
653
|
}
|
|
654
|
+
refreshSmartFacets() {
|
|
655
|
+
var _a;
|
|
656
|
+
(_a = this.smartFacetBar) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
657
|
+
}
|
|
654
658
|
/**
|
|
655
659
|
* Handler to show processing modal while removing item
|
|
656
660
|
*/
|
|
@@ -1311,6 +1315,15 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1311
1315
|
detail: this.searchType,
|
|
1312
1316
|
}));
|
|
1313
1317
|
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Emits a `facetPaneVisibilityChanged` event indicating that the facet pane has
|
|
1320
|
+
* been toggled open or closed.
|
|
1321
|
+
*/
|
|
1322
|
+
emitFacetPaneVisibilityChanged() {
|
|
1323
|
+
this.dispatchEvent(new CustomEvent('facetPaneVisibilityChanged', {
|
|
1324
|
+
detail: this.facetPaneVisible,
|
|
1325
|
+
}));
|
|
1326
|
+
}
|
|
1314
1327
|
/**
|
|
1315
1328
|
* Emits a `queryStateChanged` event indicating that one or more of this component's
|
|
1316
1329
|
* properties have changed in a way that could affect the set of search results.
|
|
@@ -1483,11 +1496,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1483
1496
|
selectedTitleFilter: (_c = this.selectedTitleFilter) !== null && _c !== void 0 ? _c : undefined,
|
|
1484
1497
|
selectedCreatorFilter: (_d = this.selectedCreatorFilter) !== null && _d !== void 0 ? _d : undefined,
|
|
1485
1498
|
};
|
|
1486
|
-
|
|
1487
|
-
forceReplace: this.dataSourceInstallInProgress,
|
|
1488
|
-
persistMetadataSearchType: this.isTVCollection,
|
|
1489
|
-
};
|
|
1490
|
-
this.restorationStateHandler.persistState(restorationState, persistOptions);
|
|
1499
|
+
this.restorationStateHandler.persistState(restorationState, this.dataSourceInstallInProgress);
|
|
1491
1500
|
}
|
|
1492
1501
|
/**
|
|
1493
1502
|
* Emits a `searchResultsLoadingChanged` event indicating that our loading state has
|
|
@@ -1689,7 +1698,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1689
1698
|
.mobileBreakpoint=${this.mobileBreakpoint}
|
|
1690
1699
|
.loggedIn=${this.loggedIn}
|
|
1691
1700
|
.isManageView=${this.isManageView}
|
|
1692
|
-
?showTvClips=${this.isTVCollection}
|
|
1693
1701
|
?enableHoverPane=${true}
|
|
1694
1702
|
@resultSelected=${(e) => this.resultSelected(e)}
|
|
1695
1703
|
>
|
|
@@ -1803,13 +1811,16 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1803
1811
|
flex: 1;
|
|
1804
1812
|
position: relative;
|
|
1805
1813
|
min-height: 90vh;
|
|
1806
|
-
border-left: 1px solid rgb(232, 232, 232);
|
|
1807
1814
|
border-right: 1px solid rgb(232, 232, 232);
|
|
1808
1815
|
margin-top: var(--rightColumnMarginTop, 0);
|
|
1809
1816
|
padding-top: 2rem;
|
|
1810
1817
|
background: #fff;
|
|
1811
1818
|
}
|
|
1812
1819
|
|
|
1820
|
+
#left-column:not([hidden]) + #right-column {
|
|
1821
|
+
border-left: 1px solid rgb(232, 232, 232);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1813
1824
|
#right-column.smart-results-spacing {
|
|
1814
1825
|
padding-top: 0.5rem;
|
|
1815
1826
|
border-right: none;
|
|
@@ -2278,9 +2289,6 @@ __decorate([
|
|
|
2278
2289
|
__decorate([
|
|
2279
2290
|
property({ type: Object })
|
|
2280
2291
|
], CollectionBrowser.prototype, "recaptchaManager", void 0);
|
|
2281
|
-
__decorate([
|
|
2282
|
-
property({ type: Boolean })
|
|
2283
|
-
], CollectionBrowser.prototype, "isTVCollection", void 0);
|
|
2284
2292
|
__decorate([
|
|
2285
2293
|
property({ type: Boolean })
|
|
2286
2294
|
], CollectionBrowser.prototype, "isManageView", void 0);
|
|
@@ -2293,6 +2301,9 @@ __decorate([
|
|
|
2293
2301
|
__decorate([
|
|
2294
2302
|
property({ type: Boolean, reflect: true })
|
|
2295
2303
|
], CollectionBrowser.prototype, "showSmartResults", void 0);
|
|
2304
|
+
__decorate([
|
|
2305
|
+
property({ type: String })
|
|
2306
|
+
], CollectionBrowser.prototype, "resultsHeader", void 0);
|
|
2296
2307
|
__decorate([
|
|
2297
2308
|
property({ type: Number })
|
|
2298
2309
|
], CollectionBrowser.prototype, "maxPagesToManage", void 0);
|
|
@@ -2335,6 +2346,9 @@ __decorate([
|
|
|
2335
2346
|
__decorate([
|
|
2336
2347
|
query('manage-bar')
|
|
2337
2348
|
], CollectionBrowser.prototype, "manageBar", void 0);
|
|
2349
|
+
__decorate([
|
|
2350
|
+
query('smart-facet-bar')
|
|
2351
|
+
], CollectionBrowser.prototype, "smartFacetBar", void 0);
|
|
2338
2352
|
__decorate([
|
|
2339
2353
|
property({ type: Object, attribute: false })
|
|
2340
2354
|
], CollectionBrowser.prototype, "analyticsHandler", void 0);
|