@internetarchive/collection-browser 2.10.1-alpha-webdev7479.10 → 2.12.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 -0
- package/dist/src/collection-browser.js +33 -7
- 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 +4 -5
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.js +2 -2
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/test/collection-browser.test.js +55 -1
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/mocks/mock-search-responses.d.ts +1 -0
- package/dist/test/mocks/mock-search-responses.js +46 -0
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.js +2 -1
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js +40 -0
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/dist/test/tile-stats.test.js +39 -13
- package/dist/test/tile-stats.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 +35 -7
- 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 +8 -5
- package/src/tiles/grid/tile-stats.ts +2 -2
- package/test/collection-browser.test.ts +81 -1
- package/test/mocks/mock-search-responses.ts +50 -0
- package/test/mocks/mock-search-service.ts +2 -0
- package/test/restoration-state-handler.test.ts +59 -0
- package/test/tile-stats.test.ts +51 -13
|
@@ -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"]}
|
|
@@ -135,6 +135,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
135
135
|
enableSortOptionsSlot: boolean;
|
|
136
136
|
/** Whether to display a smart results carousel above the full results */
|
|
137
137
|
showSmartResults: boolean;
|
|
138
|
+
resultsHeader?: string;
|
|
138
139
|
/**
|
|
139
140
|
* The maximum number of pages we will load when a privileged user clicks
|
|
140
141
|
* the "Manage" button on the search page. Limited to 15 pages.
|
|
@@ -173,6 +174,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
173
174
|
private leftColumn?;
|
|
174
175
|
private collectionFacets?;
|
|
175
176
|
private manageBar?;
|
|
177
|
+
private smartFacetBar?;
|
|
176
178
|
analyticsHandler?: AnalyticsManagerInterface;
|
|
177
179
|
/** Whether layout size analytics have been sent already. */
|
|
178
180
|
private layoutSizeAnalyticsSent;
|
|
@@ -328,6 +330,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
328
330
|
* Handler when user request to bulk edit from /search/ page
|
|
329
331
|
*/
|
|
330
332
|
private handleManageItems;
|
|
333
|
+
refreshSmartFacets(): void;
|
|
331
334
|
/**
|
|
332
335
|
* Handler to show processing modal while removing item
|
|
333
336
|
*/
|
|
@@ -498,6 +501,11 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
498
501
|
* (e.g., metadata vs. full-text).
|
|
499
502
|
*/
|
|
500
503
|
private emitSearchTypeChanged;
|
|
504
|
+
/**
|
|
505
|
+
* Emits a `facetPaneVisibilityChanged` event indicating that the facet pane has
|
|
506
|
+
* been toggled open or closed.
|
|
507
|
+
*/
|
|
508
|
+
private emitFacetPaneVisibilityChanged;
|
|
501
509
|
/**
|
|
502
510
|
* Emits a `queryStateChanged` event indicating that one or more of this component's
|
|
503
511
|
* properties have changed in a way that could affect the set of search results.
|
|
@@ -338,7 +338,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
338
338
|
render() {
|
|
339
339
|
return html `
|
|
340
340
|
${this.showSmartFacetBar
|
|
341
|
-
? html
|
|
341
|
+
? html `<smart-facet-bar
|
|
342
342
|
.query=${this.baseQuery}
|
|
343
343
|
.aggregations=${this.dataSource.aggregations}
|
|
344
344
|
.selectedFacets=${this.selectedFacets}
|
|
@@ -347,6 +347,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
347
347
|
@facetsChanged=${this.facetsChanged}
|
|
348
348
|
@filtersToggled=${() => {
|
|
349
349
|
this.facetPaneVisible = !this.facetPaneVisible;
|
|
350
|
+
this.emitFacetPaneVisibilityChanged();
|
|
350
351
|
}}
|
|
351
352
|
></smart-facet-bar>`
|
|
352
353
|
: nothing}
|
|
@@ -503,18 +504,21 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
503
504
|
* tiles and sort/filter bar are shown.
|
|
504
505
|
*/
|
|
505
506
|
get rightColumnTemplate() {
|
|
507
|
+
var _a;
|
|
508
|
+
const rightColumnClasses = classMap({
|
|
509
|
+
column: true,
|
|
510
|
+
'full-width': this.showSmartFacetBar && !this.facetPaneVisible,
|
|
511
|
+
'smart-results-spacing': !!this.showSmartResults,
|
|
512
|
+
});
|
|
506
513
|
return html `
|
|
507
|
-
<div
|
|
508
|
-
id="right-column"
|
|
509
|
-
class="column ${this.showSmartResults ? 'smart-results-spacing' : ''}"
|
|
510
|
-
>
|
|
514
|
+
<div id="right-column" class=${rightColumnClasses}>
|
|
511
515
|
${this.showSmartResults
|
|
512
516
|
? html `<slot name="smart-results"></slot>`
|
|
513
517
|
: nothing}
|
|
514
518
|
<section id="results">
|
|
515
519
|
${this.showSmartResults
|
|
516
520
|
? html `<h2 class="results-section-heading">
|
|
517
|
-
${msg('All results')}
|
|
521
|
+
${(_a = this.resultsHeader) !== null && _a !== void 0 ? _a : msg('All results')}
|
|
518
522
|
</h2>`
|
|
519
523
|
: nothing}
|
|
520
524
|
<div id="cb-top-view">
|
|
@@ -651,6 +655,10 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
651
655
|
},
|
|
652
656
|
}));
|
|
653
657
|
}
|
|
658
|
+
refreshSmartFacets() {
|
|
659
|
+
var _a;
|
|
660
|
+
(_a = this.smartFacetBar) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
661
|
+
}
|
|
654
662
|
/**
|
|
655
663
|
* Handler to show processing modal while removing item
|
|
656
664
|
*/
|
|
@@ -1311,6 +1319,15 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1311
1319
|
detail: this.searchType,
|
|
1312
1320
|
}));
|
|
1313
1321
|
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Emits a `facetPaneVisibilityChanged` event indicating that the facet pane has
|
|
1324
|
+
* been toggled open or closed.
|
|
1325
|
+
*/
|
|
1326
|
+
emitFacetPaneVisibilityChanged() {
|
|
1327
|
+
this.dispatchEvent(new CustomEvent('facetPaneVisibilityChanged', {
|
|
1328
|
+
detail: this.facetPaneVisible,
|
|
1329
|
+
}));
|
|
1330
|
+
}
|
|
1314
1331
|
/**
|
|
1315
1332
|
* Emits a `queryStateChanged` event indicating that one or more of this component's
|
|
1316
1333
|
* properties have changed in a way that could affect the set of search results.
|
|
@@ -1803,13 +1820,16 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1803
1820
|
flex: 1;
|
|
1804
1821
|
position: relative;
|
|
1805
1822
|
min-height: 90vh;
|
|
1806
|
-
border-left: 1px solid rgb(232, 232, 232);
|
|
1807
1823
|
border-right: 1px solid rgb(232, 232, 232);
|
|
1808
1824
|
margin-top: var(--rightColumnMarginTop, 0);
|
|
1809
1825
|
padding-top: 2rem;
|
|
1810
1826
|
background: #fff;
|
|
1811
1827
|
}
|
|
1812
1828
|
|
|
1829
|
+
#left-column:not([hidden]) + #right-column {
|
|
1830
|
+
border-left: 1px solid rgb(232, 232, 232);
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1813
1833
|
#right-column.smart-results-spacing {
|
|
1814
1834
|
padding-top: 0.5rem;
|
|
1815
1835
|
border-right: none;
|
|
@@ -2293,6 +2313,9 @@ __decorate([
|
|
|
2293
2313
|
__decorate([
|
|
2294
2314
|
property({ type: Boolean, reflect: true })
|
|
2295
2315
|
], CollectionBrowser.prototype, "showSmartResults", void 0);
|
|
2316
|
+
__decorate([
|
|
2317
|
+
property({ type: String })
|
|
2318
|
+
], CollectionBrowser.prototype, "resultsHeader", void 0);
|
|
2296
2319
|
__decorate([
|
|
2297
2320
|
property({ type: Number })
|
|
2298
2321
|
], CollectionBrowser.prototype, "maxPagesToManage", void 0);
|
|
@@ -2335,6 +2358,9 @@ __decorate([
|
|
|
2335
2358
|
__decorate([
|
|
2336
2359
|
query('manage-bar')
|
|
2337
2360
|
], CollectionBrowser.prototype, "manageBar", void 0);
|
|
2361
|
+
__decorate([
|
|
2362
|
+
query('smart-facet-bar')
|
|
2363
|
+
], CollectionBrowser.prototype, "smartFacetBar", void 0);
|
|
2338
2364
|
__decorate([
|
|
2339
2365
|
property({ type: Object, attribute: false })
|
|
2340
2366
|
], CollectionBrowser.prototype, "analyticsHandler", void 0);
|