@internetarchive/collection-browser 2.15.1-alpha-webdev7667.2 → 2.16.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 (94) hide show
  1. package/dist/src/collection-browser.d.ts +0 -17
  2. package/dist/src/collection-browser.js +3 -70
  3. package/dist/src/collection-browser.js.map +1 -1
  4. package/dist/src/collection-facets/more-facets-content.d.ts +2 -1
  5. package/dist/src/collection-facets/more-facets-content.js +6 -3
  6. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  7. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +1 -1
  8. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
  9. package/dist/src/collection-facets.d.ts +9 -3
  10. package/dist/src/collection-facets.js +85 -41
  11. package/dist/src/collection-facets.js.map +1 -1
  12. package/dist/src/data-source/collection-browser-data-source-interface.d.ts +8 -3
  13. package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
  14. package/dist/src/data-source/collection-browser-data-source.d.ts +5 -1
  15. package/dist/src/data-source/collection-browser-data-source.js +25 -8
  16. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  17. package/dist/src/data-source/models.d.ts +4 -0
  18. package/dist/src/data-source/models.js.map +1 -1
  19. package/dist/src/expanded-date-picker.d.ts +4 -0
  20. package/dist/src/expanded-date-picker.js +10 -0
  21. package/dist/src/expanded-date-picker.js.map +1 -1
  22. package/dist/src/models.d.ts +0 -7
  23. package/dist/src/models.js +0 -31
  24. package/dist/src/models.js.map +1 -1
  25. package/dist/src/tiles/base-tile-component.d.ts +0 -1
  26. package/dist/src/tiles/base-tile-component.js +0 -4
  27. package/dist/src/tiles/base-tile-component.js.map +1 -1
  28. package/dist/src/tiles/grid/account-tile.js +0 -2
  29. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  30. package/dist/src/tiles/grid/collection-tile.js +0 -2
  31. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  32. package/dist/src/tiles/grid/item-tile.js +0 -2
  33. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  34. package/dist/src/tiles/grid/search-tile.js +0 -2
  35. package/dist/src/tiles/grid/search-tile.js.map +1 -1
  36. package/dist/src/tiles/hover/hover-pane-controller.d.ts +0 -1
  37. package/dist/src/tiles/hover/hover-pane-controller.js +12 -7
  38. package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
  39. package/dist/src/tiles/hover/tile-hover-pane.d.ts +0 -1
  40. package/dist/src/tiles/hover/tile-hover-pane.js +0 -5
  41. package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
  42. package/dist/src/tiles/image-block.d.ts +0 -1
  43. package/dist/src/tiles/image-block.js +0 -7
  44. package/dist/src/tiles/image-block.js.map +1 -1
  45. package/dist/src/tiles/item-image.d.ts +0 -1
  46. package/dist/src/tiles/item-image.js +2 -7
  47. package/dist/src/tiles/item-image.js.map +1 -1
  48. package/dist/src/tiles/list/tile-list-compact-header.js +0 -1
  49. package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
  50. package/dist/src/tiles/list/tile-list-compact.js +0 -2
  51. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  52. package/dist/src/tiles/list/tile-list.js +0 -2
  53. package/dist/src/tiles/list/tile-list.js.map +1 -1
  54. package/dist/src/tiles/tile-dispatcher.js +0 -7
  55. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  56. package/dist/test/collection-browser.test.js +44 -1
  57. package/dist/test/collection-browser.test.js.map +1 -1
  58. package/dist/test/collection-facets.test.js +24 -14
  59. package/dist/test/collection-facets.test.js.map +1 -1
  60. package/dist/test/mocks/mock-search-responses.d.ts +2 -0
  61. package/dist/test/mocks/mock-search-responses.js +92 -0
  62. package/dist/test/mocks/mock-search-responses.js.map +1 -1
  63. package/dist/test/mocks/mock-search-service.js +3 -1
  64. package/dist/test/mocks/mock-search-service.js.map +1 -1
  65. package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -1
  66. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
  67. package/package.json +3 -3
  68. package/src/collection-browser.ts +3 -68
  69. package/src/collection-facets/more-facets-content.ts +5 -2
  70. package/src/collection-facets/smart-facets/smart-facet-bar.ts +2 -1
  71. package/src/collection-facets.ts +109 -40
  72. package/src/data-source/collection-browser-data-source-interface.ts +13 -3
  73. package/src/data-source/collection-browser-data-source.ts +30 -9
  74. package/src/data-source/models.ts +5 -0
  75. package/src/expanded-date-picker.ts +10 -0
  76. package/src/models.ts +0 -36
  77. package/src/tiles/base-tile-component.ts +0 -2
  78. package/src/tiles/grid/account-tile.ts +0 -2
  79. package/src/tiles/grid/collection-tile.ts +0 -2
  80. package/src/tiles/grid/item-tile.ts +0 -2
  81. package/src/tiles/grid/search-tile.ts +0 -2
  82. package/src/tiles/hover/hover-pane-controller.ts +7 -2
  83. package/src/tiles/hover/tile-hover-pane.ts +0 -3
  84. package/src/tiles/image-block.ts +0 -5
  85. package/src/tiles/item-image.ts +2 -6
  86. package/src/tiles/list/tile-list-compact-header.ts +0 -1
  87. package/src/tiles/list/tile-list-compact.ts +0 -2
  88. package/src/tiles/list/tile-list.ts +0 -2
  89. package/src/tiles/tile-dispatcher.ts +0 -7
  90. package/test/collection-browser.test.ts +68 -1
  91. package/test/collection-facets.test.ts +24 -14
  92. package/test/mocks/mock-search-responses.ts +100 -0
  93. package/test/mocks/mock-search-service.ts +4 -0
  94. package/test/tiles/hover/hover-pane-controller.test.ts +0 -1
@@ -180,8 +180,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
180
180
  private facetsLoading;
181
181
  private totalResults?;
182
182
  private mobileView;
183
- private tileBlurPreference;
184
- private tileBlurOverride?;
185
183
  private collapsibleFacetsVisible;
186
184
  private contentWidth?;
187
185
  private placeholderType;
@@ -331,11 +329,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
331
329
  * Template for the sort & filtering bar that appears atop the search results.
332
330
  */
333
331
  private get sortFilterBarTemplate();
334
- /**
335
- * Template for the Blurring toggle for admins to enable/disable blurring of
336
- * sensitive content in result tiles.
337
- */
338
- private get tileBlurCheckboxTemplate();
339
332
  /**
340
333
  * Template for the manage bar UI that appears atop the search results when we are
341
334
  * showing the management view. This generally replaces the sort bar when present.
@@ -364,16 +357,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
364
357
  * of the data source to account for any new gaps in the data.
365
358
  */
366
359
  removeCheckedTiles(): void;
367
- /**
368
- * Handler for when the tile blurring checkbox state is toggled
369
- */
370
- private tileBlurCheckboxChanged;
371
- /**
372
- * Whether result tiles that contain sensitive content should be blurred.
373
- * First considers the `tileBlurOverride` if set, falling back to the setting in
374
- * user preferences if not.
375
- */
376
- private get shouldBlurTiles();
377
360
  /**
378
361
  * Handler for when the user changes the selected sort option or direction.
379
362
  */
@@ -149,7 +149,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
149
149
  this.searchResultsLoading = false;
150
150
  this.facetsLoading = false;
151
151
  this.mobileView = false;
152
- this.tileBlurPreference = true;
153
152
  this.collapsibleFacetsVisible = false;
154
153
  this.placeholderType = null;
155
154
  /** Whether layout size analytics have been sent already. */
@@ -598,38 +597,12 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
598
597
  @titleLetterChanged=${this.titleLetterSelected}
599
598
  @creatorLetterChanged=${this.creatorLetterSelected}
600
599
  >
601
- ${this.tileBlurCheckboxTemplate}
602
600
  <slot name="sort-options-left" slot="sort-options-left"></slot>
603
601
  <slot name="sort-options" slot="sort-options"></slot>
604
602
  <slot name="sort-options-right" slot="sort-options-right"></slot>
605
603
  </sort-filter-bar>
606
604
  `;
607
605
  }
608
- /**
609
- * Template for the Blurring toggle for admins to enable/disable blurring of
610
- * sensitive content in result tiles.
611
- */
612
- get tileBlurCheckboxTemplate() {
613
- var _a;
614
- // Only show the checkbox for @archive.org users
615
- if (!((_a = this.dataSource.sessionContext) === null || _a === void 0 ? void 0 : _a.is_archive_user))
616
- return nothing;
617
- return html `
618
- <label
619
- id="tile-blur-label"
620
- for="tile-blur-check"
621
- slot="sort-options-right"
622
- >
623
- ${msg('Blurring')}
624
- <input
625
- id="tile-blur-check"
626
- type="checkbox"
627
- ?checked=${!this.shouldBlurTiles}
628
- @change=${this.tileBlurCheckboxChanged}
629
- />
630
- </label>
631
- `;
632
- }
633
606
  /**
634
607
  * Template for the manage bar UI that appears atop the search results when we are
635
608
  * showing the management view. This generally replaces the sort bar when present.
@@ -713,28 +686,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
713
686
  removeCheckedTiles() {
714
687
  this.dataSource.removeCheckedTiles();
715
688
  }
716
- /**
717
- * Handler for when the tile blurring checkbox state is toggled
718
- */
719
- tileBlurCheckboxChanged(e) {
720
- var _a;
721
- const { checked } = e.target;
722
- this.tileBlurOverride = checked;
723
- (_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.refreshAllVisibleCells();
724
- }
725
- /**
726
- * Whether result tiles that contain sensitive content should be blurred.
727
- * First considers the `tileBlurOverride` if set, falling back to the setting in
728
- * user preferences if not.
729
- */
730
- get shouldBlurTiles() {
731
- var _a, _b;
732
- const { sessionContext } = this.dataSource;
733
- const userPrefs = sessionContext === null || sessionContext === void 0 ? void 0 : sessionContext.pps_relevant_user_preferences;
734
- const blurringPref = userPrefs === null || userPrefs === void 0 ? void 0 : userPrefs.display__blur_moderated_content;
735
- const blurringPrefState = blurringPref === undefined ? undefined : blurringPref === 'on';
736
- return (_b = (_a = this.tileBlurOverride) !== null && _a !== void 0 ? _a : blurringPrefState) !== null && _b !== void 0 ? _b : true;
737
- }
738
689
  /**
739
690
  * Handler for when the user changes the selected sort option or direction.
740
691
  */
@@ -941,13 +892,13 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
941
892
  .resizeObserver=${this.resizeObserver}
942
893
  .searchType=${this.searchType}
943
894
  .aggregations=${this.dataSource.aggregations}
944
- .fullYearsHistogramAggregation=${this.dataSource
945
- .yearHistogramAggregation}
895
+ .histogramAggregation=${this.dataSource.histogramAggregation}
946
896
  .minSelectedDate=${this.minSelectedDate}
947
897
  .maxSelectedDate=${this.maxSelectedDate}
948
898
  .selectedFacets=${this.selectedFacets}
949
899
  .baseNavigationUrl=${this.baseNavigationUrl}
950
900
  .collectionTitles=${this.dataSource.collectionTitles}
901
+ .tvChannelAliases=${this.dataSource.tvChannelAliases}
951
902
  .showHistogramDatePicker=${this.showHistogramDatePicker}
952
903
  .allowExpandingDatePicker=${!this.mobileView}
953
904
  .allowDatePickerMonths=${shouldUseTvInterface}
@@ -961,7 +912,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
961
912
  .isTvSearch=${shouldUseTvInterface}
962
913
  ?collapsableFacets=${this.mobileView}
963
914
  ?facetsLoading=${this.facetsLoading}
964
- ?fullYearAggregationLoading=${this.facetsLoading}
915
+ ?histogramAggregationLoading=${this.facetsLoading}
965
916
  ?suppressMediatypeFacets=${this.suppressMediatypeFacets}
966
917
  @facetClick=${this.facetClickHandler}
967
918
  @facetsChanged=${this.facetsChanged}
@@ -1032,7 +983,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1032
983
  .defaultSortParam=${this.defaultSortParam}
1033
984
  .mobileBreakpoint=${this.mobileBreakpoint}
1034
985
  .loggedIn=${this.loggedIn}
1035
- .suppressBlurring=${!this.shouldBlurTiles}
1036
986
  >
1037
987
  </tile-dispatcher>
1038
988
  </div>
@@ -1778,7 +1728,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1778
1728
  .creatorFilter=${this.selectedCreatorFilter}
1779
1729
  .mobileBreakpoint=${this.mobileBreakpoint}
1780
1730
  .loggedIn=${this.loggedIn}
1781
- .suppressBlurring=${!this.shouldBlurTiles}
1782
1731
  .isManageView=${this.isManageView}
1783
1732
  ?showTvClips=${this.isTVCollection || this.searchType === SearchType.TV}
1784
1733
  ?enableHoverPane=${true}
@@ -2165,16 +2114,6 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
2165
2114
  padding-top: 50px;
2166
2115
  }
2167
2116
 
2168
- #tile-blur-label {
2169
- display: flex;
2170
- align-items: center;
2171
- column-gap: 5px;
2172
- }
2173
-
2174
- #tile-blur-check {
2175
- margin: 0 5px 0 0;
2176
- }
2177
-
2178
2117
  circular-activity-indicator {
2179
2118
  width: 30px;
2180
2119
  height: 30px;
@@ -2430,12 +2369,6 @@ __decorate([
2430
2369
  __decorate([
2431
2370
  state()
2432
2371
  ], CollectionBrowser.prototype, "mobileView", void 0);
2433
- __decorate([
2434
- state()
2435
- ], CollectionBrowser.prototype, "tileBlurPreference", void 0);
2436
- __decorate([
2437
- state()
2438
- ], CollectionBrowser.prototype, "tileBlurOverride", void 0);
2439
2372
  __decorate([
2440
2373
  state()
2441
2374
  ], CollectionBrowser.prototype, "collapsibleFacetsVisible", void 0);