@internetarchive/collection-browser 2.11.0 → 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.
Files changed (54) hide show
  1. package/dist/src/assets/img/icons/quote.d.ts +1 -0
  2. package/dist/src/assets/img/icons/quote.js +7 -0
  3. package/dist/src/assets/img/icons/quote.js.map +1 -0
  4. package/dist/src/collection-browser.d.ts +4 -0
  5. package/dist/src/collection-browser.js +14 -2
  6. package/dist/src/collection-browser.js.map +1 -1
  7. package/dist/src/data-source/collection-browser-data-source.js +17 -5
  8. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  9. package/dist/src/data-source/collection-browser-query-state.d.ts +1 -0
  10. package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
  11. package/dist/src/models.d.ts +2 -0
  12. package/dist/src/models.js +9 -5
  13. package/dist/src/models.js.map +1 -1
  14. package/dist/src/restoration-state-handler.d.ts +6 -2
  15. package/dist/src/restoration-state-handler.js +27 -11
  16. package/dist/src/restoration-state-handler.js.map +1 -1
  17. package/dist/src/tiles/grid/item-tile.d.ts +1 -0
  18. package/dist/src/tiles/grid/item-tile.js +7 -1
  19. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  20. package/dist/src/tiles/grid/tile-stats.d.ts +46 -2
  21. package/dist/src/tiles/grid/tile-stats.js +93 -42
  22. package/dist/src/tiles/grid/tile-stats.js.map +1 -1
  23. package/dist/src/tiles/item-image.js +6 -3
  24. package/dist/src/tiles/item-image.js.map +1 -1
  25. package/dist/src/tiles/tile-dispatcher.d.ts +1 -0
  26. package/dist/src/tiles/tile-dispatcher.js +5 -0
  27. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  28. package/dist/test/collection-browser.test.js +41 -1
  29. package/dist/test/collection-browser.test.js.map +1 -1
  30. package/dist/test/mocks/mock-search-responses.d.ts +1 -0
  31. package/dist/test/mocks/mock-search-responses.js +46 -0
  32. package/dist/test/mocks/mock-search-responses.js.map +1 -1
  33. package/dist/test/mocks/mock-search-service.js +2 -1
  34. package/dist/test/mocks/mock-search-service.js.map +1 -1
  35. package/dist/test/restoration-state-handler.test.js +44 -4
  36. package/dist/test/restoration-state-handler.test.js.map +1 -1
  37. package/dist/test/tile-stats.test.js +39 -13
  38. package/dist/test/tile-stats.test.js.map +1 -1
  39. package/package.json +2 -2
  40. package/src/assets/img/icons/quote.ts +7 -0
  41. package/src/collection-browser.ts +13 -5
  42. package/src/data-source/collection-browser-data-source.ts +20 -3
  43. package/src/data-source/collection-browser-query-state.ts +1 -0
  44. package/src/models.ts +8 -0
  45. package/src/restoration-state-handler.ts +40 -11
  46. package/src/tiles/grid/item-tile.ts +4 -0
  47. package/src/tiles/grid/tile-stats.ts +107 -53
  48. package/src/tiles/item-image.ts +3 -0
  49. package/src/tiles/tile-dispatcher.ts +3 -0
  50. package/test/collection-browser.test.ts +62 -1
  51. package/test/mocks/mock-search-responses.ts +50 -0
  52. package/test/mocks/mock-search-service.ts +2 -0
  53. package/test/restoration-state-handler.test.ts +63 -4
  54. package/test/tile-stats.test.ts +51 -13
@@ -0,0 +1 @@
1
+ export declare const quoteIcon: import("lit").TemplateResult<2>;
@@ -0,0 +1,7 @@
1
+ import { svg } from 'lit';
2
+ export const quoteIcon = svg `
3
+ <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
4
+ <path d="m45.3394669 100.000002h7.4385828c6.4511217-.3595144 12.58904-1.9152224 18.4137548-4.6671261s10.8424956-6.3426695 15.0533425-10.7722976c4.2108468-4.429628 7.556034-9.6360206 10.0355616-15.6191778s3.7192914-12.2669975 3.7192914-18.8515208c0-9.0967521-2.2250498-17.4897316-6.6751493-25.1789383-4.4500995-7.6892068-10.5140669-13.7638762-18.1919023-18.22400833-7.6778355-4.46013212-16.0560287-6.68910874-25.1345797-6.68693148-6.8100007 0-13.2915728 1.31603472-19.4447163 3.94810096-6.1531434 2.63206624-11.4699901 6.17816545-15.9505399 10.63829755-4.4805499 4.4601321-8.03453942 9.7863622-10.66196865 15.9786902s-3.94114385 12.7005912-3.94114385 19.5247894c0 12.9271929 4.36092352 24.1624988 13.0827705 33.7059178 8.7218471 9.543419 19.4751667 14.9448198 32.2599589 16.2042045zm-28.136113-51.5246596c2.2707252-7.480036 5.6159125-13.1058597 10.0355616-16.8774711 4.2412972-3.9502783 8.9610997-5.4166529 14.1594076-4.399124.2979783.1786667.1783519.507675-.358879.9870248-.537231.4793498-1.433341 1.2572039-2.6883299 2.3335621-1.254989 1.0763582-2.3000881 2.1538058-3.1352974 3.2323429-1.074462 1.4358706-1.7911325 2.7976598-2.1500114 4.0853677-.358879 1.2877079-.448055 2.214814-.267528 2.7813184.180527.5665043.180527 1.1798542 0 1.8400496 3.1059345-.1786668 5.8236273.5545206 8.1530782 2.199562s3.9726817 3.7095139 4.9296923 6.1934174c.9570107 2.4839036 1.210401 5.2063926.760171 8.1674672-.45023 2.9610745-1.6595435 5.6094822-3.6279404 7.9452231-3.3451872 3.6495952-7.5712592 5.2205552-12.678216 4.7128802s-8.9154242-2.6767329-11.4254021-6.5071737c-1.5529673-2.1548953-2.4490773-4.8479697-2.6883299-8.0792232-.2392527-3.2312535.089176-6.1040841.9852859-8.6184917zm34.7655868 0c2.2098245-7.3013692 5.5854621-12.9271929 10.1269126-16.8774711 4.1825715-3.9502783 8.8719237-5.4166529 14.0680565-4.399124.358879.1786667.2838407.507675-.225115.9870248-.5089556.4793498-1.3898404 1.2572039-2.6426544 2.3335621-1.2528139 1.0763582-2.3283634 2.1538058-3.2266484 3.2323429-1.0744619 1.4358706-1.7911324 2.7976598-2.1500114 4.0853677s-.4632801 2.214814-.3132035 2.7813184c.1500767.5665043.1348515 1.1798542-.0456755 1.8400496 3.1059346-.1786668 5.8236273.5545206 8.1530782 2.199562s3.9726817 3.7095139 4.9296924 6.1934174c.9570106 2.4839036 1.2256261 5.2063926.8058464 8.1674672-.4197796 2.9610745-1.6443183 5.6094822-3.6736158 7.9452231-3.3451873 3.6495952-7.5712593 5.2205552-12.6782161 4.7128802s-8.9154242-2.6767329-11.4254021-6.5071737c-1.4942416-2.1548953-2.3609888-4.8479697-2.6002414-8.0792232-.2392527-3.2312535.0598131-6.1040841.8971975-8.6184917z"/>
5
+ </svg>
6
+ `;
7
+ //# sourceMappingURL=quote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/quote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;;;;CAI3B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const quoteIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"m45.3394669 100.000002h7.4385828c6.4511217-.3595144 12.58904-1.9152224 18.4137548-4.6671261s10.8424956-6.3426695 15.0533425-10.7722976c4.2108468-4.429628 7.556034-9.6360206 10.0355616-15.6191778s3.7192914-12.2669975 3.7192914-18.8515208c0-9.0967521-2.2250498-17.4897316-6.6751493-25.1789383-4.4500995-7.6892068-10.5140669-13.7638762-18.1919023-18.22400833-7.6778355-4.46013212-16.0560287-6.68910874-25.1345797-6.68693148-6.8100007 0-13.2915728 1.31603472-19.4447163 3.94810096-6.1531434 2.63206624-11.4699901 6.17816545-15.9505399 10.63829755-4.4805499 4.4601321-8.03453942 9.7863622-10.66196865 15.9786902s-3.94114385 12.7005912-3.94114385 19.5247894c0 12.9271929 4.36092352 24.1624988 13.0827705 33.7059178 8.7218471 9.543419 19.4751667 14.9448198 32.2599589 16.2042045zm-28.136113-51.5246596c2.2707252-7.480036 5.6159125-13.1058597 10.0355616-16.8774711 4.2412972-3.9502783 8.9610997-5.4166529 14.1594076-4.399124.2979783.1786667.1783519.507675-.358879.9870248-.537231.4793498-1.433341 1.2572039-2.6883299 2.3335621-1.254989 1.0763582-2.3000881 2.1538058-3.1352974 3.2323429-1.074462 1.4358706-1.7911325 2.7976598-2.1500114 4.0853677-.358879 1.2877079-.448055 2.214814-.267528 2.7813184.180527.5665043.180527 1.1798542 0 1.8400496 3.1059345-.1786668 5.8236273.5545206 8.1530782 2.199562s3.9726817 3.7095139 4.9296923 6.1934174c.9570107 2.4839036 1.210401 5.2063926.760171 8.1674672-.45023 2.9610745-1.6595435 5.6094822-3.6279404 7.9452231-3.3451872 3.6495952-7.5712592 5.2205552-12.678216 4.7128802s-8.9154242-2.6767329-11.4254021-6.5071737c-1.5529673-2.1548953-2.4490773-4.8479697-2.6883299-8.0792232-.2392527-3.2312535.089176-6.1040841.9852859-8.6184917zm34.7655868 0c2.2098245-7.3013692 5.5854621-12.9271929 10.1269126-16.8774711 4.1825715-3.9502783 8.8719237-5.4166529 14.0680565-4.399124.358879.1786667.2838407.507675-.225115.9870248-.5089556.4793498-1.3898404 1.2572039-2.6426544 2.3335621-1.2528139 1.0763582-2.3283634 2.1538058-3.2266484 3.2323429-1.0744619 1.4358706-1.7911324 2.7976598-2.1500114 4.0853677s-.4632801 2.214814-.3132035 2.7813184c.1500767.5665043.1348515 1.1798542-.0456755 1.8400496 3.1059346-.1786668 5.8236273.5545206 8.1530782 2.199562s3.9726817 3.7095139 4.9296924 6.1934174c.9570106 2.4839036 1.2256261 5.2063926.8058464 8.1674672-.4197796 2.9610745-1.6443183 5.6094822-3.6736158 7.9452231-3.3451873 3.6495952-7.5712593 5.2205552-12.6782161 4.7128802s-8.9154242-2.6767329-11.4254021-6.5071737c-1.4942416-2.1548953-2.3609888-4.8479697-2.6002414-8.0792232-.2392527-3.2312535.0598131-6.1040841.8971975-8.6184917z\"/>\n </svg>\n`;\n"]}
@@ -122,6 +122,10 @@ 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;
125
129
  /**
126
130
  * If item management UI active
127
131
  */
@@ -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.METADATA;
32
+ this.searchType = SearchType.DEFAULT;
33
33
  this.selectedSort = SortField.default;
34
34
  this.selectedTitleFilter = null;
35
35
  this.selectedCreatorFilter = null;
@@ -100,6 +100,10 @@ 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;
103
107
  /**
104
108
  * If item management UI active
105
109
  */
@@ -1496,7 +1500,11 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1496
1500
  selectedTitleFilter: (_c = this.selectedTitleFilter) !== null && _c !== void 0 ? _c : undefined,
1497
1501
  selectedCreatorFilter: (_d = this.selectedCreatorFilter) !== null && _d !== void 0 ? _d : undefined,
1498
1502
  };
1499
- this.restorationStateHandler.persistState(restorationState, this.dataSourceInstallInProgress);
1503
+ const persistOptions = {
1504
+ forceReplace: this.dataSourceInstallInProgress,
1505
+ persistMetadataSearchType: this.isTVCollection,
1506
+ };
1507
+ this.restorationStateHandler.persistState(restorationState, persistOptions);
1500
1508
  }
1501
1509
  /**
1502
1510
  * Emits a `searchResultsLoadingChanged` event indicating that our loading state has
@@ -1698,6 +1706,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1698
1706
  .mobileBreakpoint=${this.mobileBreakpoint}
1699
1707
  .loggedIn=${this.loggedIn}
1700
1708
  .isManageView=${this.isManageView}
1709
+ ?showTvClips=${this.isTVCollection}
1701
1710
  ?enableHoverPane=${true}
1702
1711
  @resultSelected=${(e) => this.resultSelected(e)}
1703
1712
  >
@@ -2289,6 +2298,9 @@ __decorate([
2289
2298
  __decorate([
2290
2299
  property({ type: Object })
2291
2300
  ], CollectionBrowser.prototype, "recaptchaManager", void 0);
2301
+ __decorate([
2302
+ property({ type: Boolean })
2303
+ ], CollectionBrowser.prototype, "isTVCollection", void 0);
2292
2304
  __decorate([
2293
2305
  property({ type: Boolean })
2294
2306
  ], CollectionBrowser.prototype, "isManageView", void 0);