@internetarchive/collection-browser 3.4.1-alpha-webdev7761.4 → 3.4.1

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 (216) hide show
  1. package/.editorconfig +29 -29
  2. package/.github/workflows/ci.yml +27 -27
  3. package/.github/workflows/gh-pages-main.yml +39 -39
  4. package/.github/workflows/npm-publish.yml +39 -39
  5. package/.github/workflows/pr-preview.yml +38 -38
  6. package/.husky/pre-commit +4 -4
  7. package/.prettierignore +1 -1
  8. package/LICENSE +661 -661
  9. package/README.md +83 -83
  10. package/dist/src/app-root.js +28 -19
  11. package/dist/src/app-root.js.map +1 -1
  12. package/dist/src/collection-browser.d.ts +4 -24
  13. package/dist/src/collection-browser.js +125 -286
  14. package/dist/src/collection-browser.js.map +1 -1
  15. package/dist/src/collection-facets/facet-row.js +143 -143
  16. package/dist/src/collection-facets/facet-row.js.map +1 -1
  17. package/dist/src/collection-facets/more-facets-content.d.ts +1 -1
  18. package/dist/src/collection-facets/more-facets-content.js +48 -34
  19. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  20. package/dist/src/collection-facets/more-facets-pagination.js +10 -6
  21. package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
  22. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +21 -16
  23. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +1 -1
  24. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +10 -7
  25. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
  26. package/dist/src/collection-facets/smart-facets/smart-facet-button.js +2 -3
  27. package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +1 -1
  28. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +11 -9
  29. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -1
  30. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js +7 -7
  31. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +1 -1
  32. package/dist/src/collection-facets/toggle-switch.js +6 -4
  33. package/dist/src/collection-facets/toggle-switch.js.map +1 -1
  34. package/dist/src/collection-facets.js +310 -309
  35. package/dist/src/collection-facets.js.map +1 -1
  36. package/dist/src/data-source/collection-browser-data-source-interface.d.ts +1 -10
  37. package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
  38. package/dist/src/data-source/collection-browser-data-source.d.ts +1 -19
  39. package/dist/src/data-source/collection-browser-data-source.js +65 -71
  40. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  41. package/dist/src/data-source/collection-browser-query-state.d.ts +2 -1
  42. package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
  43. package/dist/src/data-source/models.d.ts +0 -11
  44. package/dist/src/data-source/models.js.map +1 -1
  45. package/dist/src/empty-placeholder.js +18 -19
  46. package/dist/src/empty-placeholder.js.map +1 -1
  47. package/dist/src/expanded-date-picker.js +10 -6
  48. package/dist/src/expanded-date-picker.js.map +1 -1
  49. package/dist/src/language-code-handler/language-code-handler.js +2 -2
  50. package/dist/src/language-code-handler/language-code-handler.js.map +1 -1
  51. package/dist/src/manage/manage-bar.js +15 -9
  52. package/dist/src/manage/manage-bar.js.map +1 -1
  53. package/dist/src/manage/remove-items-modal-content.js +2 -2
  54. package/dist/src/manage/remove-items-modal-content.js.map +1 -1
  55. package/dist/src/models.d.ts +6 -2
  56. package/dist/src/models.js +54 -46
  57. package/dist/src/models.js.map +1 -1
  58. package/dist/src/restoration-state-handler.d.ts +2 -1
  59. package/dist/src/restoration-state-handler.js +19 -12
  60. package/dist/src/restoration-state-handler.js.map +1 -1
  61. package/dist/src/sort-filter-bar/alpha-bar.js +14 -9
  62. package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
  63. package/dist/src/sort-filter-bar/sort-filter-bar.js +24 -14
  64. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  65. package/dist/src/tiles/base-tile-component.js +2 -1
  66. package/dist/src/tiles/base-tile-component.js.map +1 -1
  67. package/dist/src/tiles/grid/account-tile.js +7 -5
  68. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  69. package/dist/src/tiles/grid/collection-tile.js +6 -3
  70. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  71. package/dist/src/tiles/grid/item-tile.js +33 -23
  72. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  73. package/dist/src/tiles/grid/search-tile.js +2 -1
  74. package/dist/src/tiles/grid/search-tile.js.map +1 -1
  75. package/dist/src/tiles/grid/tile-stats.js +3 -2
  76. package/dist/src/tiles/grid/tile-stats.js.map +1 -1
  77. package/dist/src/tiles/hover/hover-pane-controller.js +28 -21
  78. package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
  79. package/dist/src/tiles/hover/tile-hover-pane.js +4 -3
  80. package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
  81. package/dist/src/tiles/image-block.js +8 -5
  82. package/dist/src/tiles/image-block.js.map +1 -1
  83. package/dist/src/tiles/item-image.js +19 -12
  84. package/dist/src/tiles/item-image.js.map +1 -1
  85. package/dist/src/tiles/list/tile-list-compact.js +25 -17
  86. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  87. package/dist/src/tiles/list/tile-list.js +55 -34
  88. package/dist/src/tiles/list/tile-list.js.map +1 -1
  89. package/dist/src/tiles/overlay/icon-overlay.js +2 -1
  90. package/dist/src/tiles/overlay/icon-overlay.js.map +1 -1
  91. package/dist/src/tiles/overlay/text-overlay.js +4 -2
  92. package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
  93. package/dist/src/tiles/text-snippet-block.js +4 -2
  94. package/dist/src/tiles/text-snippet-block.js.map +1 -1
  95. package/dist/src/tiles/tile-dispatcher.js +30 -22
  96. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  97. package/dist/src/tiles/tile-display-value-provider.js +9 -5
  98. package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
  99. package/dist/src/tiles/tile-mediatype-icon.js +19 -12
  100. package/dist/src/tiles/tile-mediatype-icon.js.map +1 -1
  101. package/dist/src/utils/collapse-repeated-quotes.js +1 -1
  102. package/dist/src/utils/collapse-repeated-quotes.js.map +1 -1
  103. package/dist/src/utils/facet-utils.js +5 -3
  104. package/dist/src/utils/facet-utils.js.map +1 -1
  105. package/dist/src/utils/format-count.js +10 -10
  106. package/dist/src/utils/format-count.js.map +1 -1
  107. package/dist/src/utils/resolve-mediatype.js +3 -2
  108. package/dist/src/utils/resolve-mediatype.js.map +1 -1
  109. package/dist/test/collection-browser.test.js +380 -336
  110. package/dist/test/collection-browser.test.js.map +1 -1
  111. package/dist/test/collection-facets/facet-row.test.js +52 -37
  112. package/dist/test/collection-facets/facet-row.test.js.map +1 -1
  113. package/dist/test/collection-facets/facets-template.test.js +23 -17
  114. package/dist/test/collection-facets/facets-template.test.js.map +1 -1
  115. package/dist/test/collection-facets/more-facets-content.test.js +32 -22
  116. package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
  117. package/dist/test/collection-facets/more-facets-pagination.test.js +22 -16
  118. package/dist/test/collection-facets/more-facets-pagination.test.js.map +1 -1
  119. package/dist/test/collection-facets/toggle-switch.test.js +19 -22
  120. package/dist/test/collection-facets/toggle-switch.test.js.map +1 -1
  121. package/dist/test/collection-facets.test.js +77 -60
  122. package/dist/test/collection-facets.test.js.map +1 -1
  123. package/dist/test/empty-placeholder.test.js +17 -11
  124. package/dist/test/empty-placeholder.test.js.map +1 -1
  125. package/dist/test/expanded-date-picker.test.js +14 -8
  126. package/dist/test/expanded-date-picker.test.js.map +1 -1
  127. package/dist/test/icon-overlay.test.js +6 -7
  128. package/dist/test/icon-overlay.test.js.map +1 -1
  129. package/dist/test/image-block.test.js +26 -16
  130. package/dist/test/image-block.test.js.map +1 -1
  131. package/dist/test/item-image.test.js +32 -23
  132. package/dist/test/item-image.test.js.map +1 -1
  133. package/dist/test/manage/manage-bar.test.js +33 -21
  134. package/dist/test/manage/manage-bar.test.js.map +1 -1
  135. package/dist/test/manage/remove-items-modal-content.test.js +15 -10
  136. package/dist/test/manage/remove-items-modal-content.test.js.map +1 -1
  137. package/dist/test/mocks/mock-search-service.js +3 -2
  138. package/dist/test/mocks/mock-search-service.js.map +1 -1
  139. package/dist/test/restoration-state-handler.test.js +54 -14
  140. package/dist/test/restoration-state-handler.test.js.map +1 -1
  141. package/dist/test/review-block.test.js +18 -16
  142. package/dist/test/review-block.test.js.map +1 -1
  143. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +3 -2
  144. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +1 -1
  145. package/dist/test/sort-filter-bar/alpha-bar.test.js +24 -18
  146. package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
  147. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +180 -178
  148. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
  149. package/dist/test/text-overlay.test.js +15 -16
  150. package/dist/test/text-overlay.test.js.map +1 -1
  151. package/dist/test/text-snippet-block.test.js +19 -14
  152. package/dist/test/text-snippet-block.test.js.map +1 -1
  153. package/dist/test/tile-stats.test.js +34 -73
  154. package/dist/test/tile-stats.test.js.map +1 -1
  155. package/dist/test/tiles/grid/account-tile.test.js +25 -25
  156. package/dist/test/tiles/grid/account-tile.test.js.map +1 -1
  157. package/dist/test/tiles/grid/collection-tile.test.js +19 -13
  158. package/dist/test/tiles/grid/collection-tile.test.js.map +1 -1
  159. package/dist/test/tiles/grid/item-tile.test.js +91 -64
  160. package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
  161. package/dist/test/tiles/grid/search-tile.test.js +13 -9
  162. package/dist/test/tiles/grid/search-tile.test.js.map +1 -1
  163. package/dist/test/tiles/hover/hover-pane-controller.test.js +35 -23
  164. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
  165. package/dist/test/tiles/hover/tile-hover-pane.test.js +16 -12
  166. package/dist/test/tiles/hover/tile-hover-pane.test.js.map +1 -1
  167. package/dist/test/tiles/list/tile-list-compact.test.js +48 -34
  168. package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
  169. package/dist/test/tiles/list/tile-list.test.js +105 -76
  170. package/dist/test/tiles/list/tile-list.test.js.map +1 -1
  171. package/dist/test/tiles/tile-dispatcher.test.js +30 -17
  172. package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
  173. package/dist/test/tiles/tile-mediatype-icon.test.js +24 -12
  174. package/dist/test/tiles/tile-mediatype-icon.test.js.map +1 -1
  175. package/eslint.config.mjs +53 -53
  176. package/index.html +24 -24
  177. package/local.archive.org.cert +86 -86
  178. package/local.archive.org.key +27 -27
  179. package/package.json +118 -120
  180. package/renovate.json +6 -6
  181. package/src/collection-browser.ts +15 -246
  182. package/src/collection-facets/facet-row.ts +296 -299
  183. package/src/collection-facets/more-facets-content.ts +8 -5
  184. package/src/collection-facets.ts +995 -1010
  185. package/src/data-source/collection-browser-data-source-interface.ts +333 -345
  186. package/src/data-source/collection-browser-data-source.ts +1401 -1441
  187. package/src/data-source/collection-browser-query-state.ts +65 -59
  188. package/src/data-source/models.ts +43 -56
  189. package/src/models.ts +870 -866
  190. package/src/restoration-state-handler.ts +544 -546
  191. package/test/collection-browser.test.ts +2403 -2413
  192. package/test/restoration-state-handler.test.ts +510 -480
  193. package/tsconfig.json +20 -25
  194. package/vite.config.ts +22 -29
  195. package/web-dev-server.config.mjs +30 -30
  196. package/web-test-runner.config.mjs +41 -41
  197. package/dist/src/combo-box/caret-closed.d.ts +0 -2
  198. package/dist/src/combo-box/caret-closed.js +0 -7
  199. package/dist/src/combo-box/caret-closed.js.map +0 -1
  200. package/dist/src/combo-box/caret-open.d.ts +0 -2
  201. package/dist/src/combo-box/caret-open.js +0 -7
  202. package/dist/src/combo-box/caret-open.js.map +0 -1
  203. package/dist/src/combo-box/clear.d.ts +0 -2
  204. package/dist/src/combo-box/clear.js +0 -11
  205. package/dist/src/combo-box/clear.js.map +0 -1
  206. package/dist/src/combo-box/ia-combo-box.d.ts +0 -422
  207. package/dist/src/combo-box/ia-combo-box.js +0 -1203
  208. package/dist/src/combo-box/ia-combo-box.js.map +0 -1
  209. package/dist/src/combo-box/models.d.ts +0 -75
  210. package/dist/src/combo-box/models.js +0 -40
  211. package/dist/src/combo-box/models.js.map +0 -1
  212. package/src/combo-box/caret-closed.ts +0 -7
  213. package/src/combo-box/caret-open.ts +0 -7
  214. package/src/combo-box/clear.ts +0 -11
  215. package/src/combo-box/ia-combo-box.ts +0 -1288
  216. package/src/combo-box/models.ts +0 -113
@@ -4,7 +4,6 @@ import {
4
4
  LitElement,
5
5
  PropertyValues,
6
6
  TemplateResult,
7
- HTMLTemplateResult,
8
7
  nothing,
9
8
  } from 'lit';
10
9
  import { customElement, property, query, state } from 'lit/decorators.js';
@@ -32,7 +31,6 @@ import '@internetarchive/infinite-scroller';
32
31
  import type { ModalManagerInterface } from '@internetarchive/modal-manager';
33
32
  import type { FeatureFeedbackServiceInterface } from '@internetarchive/feature-feedback';
34
33
  import type { RecaptchaManagerInterface } from '@internetarchive/recaptcha-manager';
35
- import type { IAComboBox } from '@internetarchive/elements/ia-combo-box/ia-combo-box';
36
34
  import {
37
35
  SelectedFacets,
38
36
  SortField,
@@ -47,11 +45,11 @@ import {
47
45
  FacetLoadStrategy,
48
46
  defaultFacetDisplayOrder,
49
47
  tvFacetDisplayOrder,
48
+ TvClipFilterType,
50
49
  TileBlurOverrideState,
51
50
  defaultSortAvailability,
52
51
  favoritesSortAvailability,
53
52
  tvSortAvailability,
54
- FacetBucket,
55
53
  } from './models';
56
54
  import {
57
55
  RestorationStateHandlerInterface,
@@ -71,7 +69,6 @@ import {
71
69
  analyticsActions,
72
70
  analyticsCategories,
73
71
  } from './utils/analytics-events';
74
- import { updateSelectedFacetBucket } from './utils/facet-utils';
75
72
  import chevronIcon from './assets/img/icons/chevron';
76
73
  import { srOnlyStyle } from './styles/sr-only';
77
74
  import { sha1 } from './utils/sha1';
@@ -80,7 +77,6 @@ import type { PlaceholderType } from './empty-placeholder';
80
77
  import type { ManageBar } from './manage/manage-bar';
81
78
  import type { SmartFacetBar } from './collection-facets/smart-facets/smart-facet-bar';
82
79
 
83
- import '@internetarchive/elements/ia-combo-box/ia-combo-box';
84
80
  import './empty-placeholder';
85
81
  import './tiles/tile-dispatcher';
86
82
  import './tiles/collection-browser-loading-tile';
@@ -150,6 +146,8 @@ export class CollectionBrowser
150
146
 
151
147
  @property({ type: String }) selectedCreatorFilter: string | null = null;
152
148
 
149
+ @property({ type: String }) tvClipFilter: TvClipFilterType = 'all';
150
+
153
151
  @property({ type: String }) sortDirection: SortDirection | null = null;
154
152
 
155
153
  @property({ type: String }) defaultSortField: Exclude<
@@ -358,16 +356,6 @@ export class CollectionBrowser
358
356
 
359
357
  @state() private placeholderType: PlaceholderType = null;
360
358
 
361
- @state() private selectedTVNetwork?: string = undefined;
362
-
363
- @state() private selectedTVShow?: string = undefined;
364
-
365
- @state() private tvMapsPopulated: boolean = false;
366
-
367
- @state() private loadingNetworks: boolean = false;
368
-
369
- @state() private loadingShows: boolean = false;
370
-
371
359
  @query('#content-container') private contentContainer!: HTMLDivElement;
372
360
 
373
361
  @query('#left-column') private leftColumn?: HTMLDivElement;
@@ -378,10 +366,6 @@ export class CollectionBrowser
378
366
 
379
367
  @query('smart-facet-bar') private smartFacetBar?: SmartFacetBar;
380
368
 
381
- @query('#tv-networks') private tvNetworksDropdown?: IAComboBox;
382
-
383
- @query('#tv-shows') private tvShowsDropdown?: IAComboBox;
384
-
385
369
  @property({ type: Object, attribute: false })
386
370
  analyticsHandler?: AnalyticsManagerInterface;
387
371
 
@@ -545,29 +529,11 @@ export class CollectionBrowser
545
529
  this.selectedSort = SortField.default;
546
530
  }
547
531
 
548
- this.clearTVDropdowns();
549
-
550
532
  if (this.smartFacetBar) {
551
533
  this.smartFacetBar.deselectAll();
552
534
  }
553
535
  }
554
536
 
555
- /**
556
- * Resets any selected TV network/show dropdowns to their default state
557
- */
558
- private clearTVDropdowns(): void {
559
- this.selectedTVNetwork = undefined;
560
- this.selectedTVShow = undefined;
561
-
562
- if (this.tvNetworksDropdown) {
563
- this.tvNetworksDropdown.clearSelectedOption();
564
- }
565
-
566
- if (this.tvShowsDropdown) {
567
- this.tvShowsDropdown.clearSelectedOption();
568
- }
569
- }
570
-
571
537
  /**
572
538
  * Returns true if the current value of `this.selectedFacets` contains
573
539
  * any facet buckets than have been selected or negated, or false otherwise.
@@ -765,13 +731,12 @@ export class CollectionBrowser
765
731
 
766
732
  const shouldShowSearching =
767
733
  this.searchResultsLoading || this.totalResults === undefined;
768
- const classes = classMap({ filtered: this.hasActiveFilters });
769
734
  const resultsCount = this.totalResults?.toLocaleString();
770
735
  const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';
771
736
 
772
737
  // Added data-testid for Playwright testing
773
738
  return html`
774
- <div id="results-total" class=${classes} data-testid="results-total">
739
+ <div id="results-total" data-testid="results-total">
775
740
  <span id="big-results-count">
776
741
  ${shouldShowSearching ? html`Searching&hellip;` : resultsCount}
777
742
  </span>
@@ -1281,154 +1246,6 @@ export class CollectionBrowser
1281
1246
  `;
1282
1247
  }
1283
1248
 
1284
- private async networksDropdownToggled(): Promise<void> {
1285
- if (this.tvMapsPopulated) return;
1286
- this.loadingNetworks = true;
1287
- await this.dataSource.populateTVChannelMaps();
1288
- this.loadingNetworks = false;
1289
- this.tvMapsPopulated = true;
1290
- }
1291
-
1292
- private async showsDropdownToggled(): Promise<void> {
1293
- if (this.tvMapsPopulated) return;
1294
- this.loadingShows = true;
1295
- await this.dataSource.populateTVChannelMaps();
1296
- this.loadingShows = false;
1297
- this.tvMapsPopulated = true;
1298
- }
1299
-
1300
- private async networksDropdownChanged(): Promise<void> {
1301
- const previousNetwork = this.selectedTVNetwork;
1302
- const newNetwork = this.tvNetworksDropdown!.selectedOption?.text;
1303
- this.selectedTVNetwork = newNetwork ?? undefined;
1304
-
1305
- const entries = this.dataSource.tvChannelMaps.channelToNetwork!.entries();
1306
- for (const [channel, network] of entries) {
1307
- if (network === previousNetwork) {
1308
- // Remove any previously-applied network filter
1309
- const removedBucket: FacetBucket = {
1310
- key: channel.toLowerCase(),
1311
- count: 0,
1312
- state: 'none',
1313
- };
1314
- this.selectedFacets = updateSelectedFacetBucket(
1315
- this.selectedFacets,
1316
- 'creator',
1317
- removedBucket,
1318
- true,
1319
- );
1320
- } else if (network === this.selectedTVNetwork) {
1321
- const newBucket: FacetBucket = {
1322
- key: channel.toLowerCase(),
1323
- count: 0,
1324
- state: 'selected',
1325
- };
1326
- this.selectedFacets = updateSelectedFacetBucket(
1327
- this.selectedFacets,
1328
- 'creator',
1329
- newBucket,
1330
- );
1331
- }
1332
- }
1333
- }
1334
-
1335
- private async showsDropdownChanged(): Promise<void> {
1336
- const previousShow = this.selectedTVShow;
1337
- const newShow = this.tvShowsDropdown!.selectedOption?.text;
1338
- this.selectedTVShow = newShow ?? undefined;
1339
-
1340
- // Remove any previously-applied shows filter
1341
- if (previousShow !== undefined) {
1342
- const removedBucket: FacetBucket = {
1343
- key: previousShow,
1344
- count: 0,
1345
- state: 'none',
1346
- };
1347
- this.selectedFacets = updateSelectedFacetBucket(
1348
- this.selectedFacets,
1349
- 'program',
1350
- removedBucket,
1351
- true,
1352
- );
1353
- }
1354
-
1355
- if (this.selectedTVShow) {
1356
- const newBucket: FacetBucket = {
1357
- key: this.selectedTVShow,
1358
- count: 0,
1359
- state: 'selected',
1360
- };
1361
- this.selectedFacets = updateSelectedFacetBucket(
1362
- this.selectedFacets,
1363
- 'program',
1364
- newBucket,
1365
- );
1366
- }
1367
- }
1368
-
1369
- private get tvDropdownFiltersTemplate(): TemplateResult | typeof nothing {
1370
- if (this.searchType !== SearchType.TV) return nothing;
1371
-
1372
- const { channelToNetwork, programToChannels } =
1373
- this.dataSource.tvChannelMaps;
1374
- const networks = channelToNetwork
1375
- ? [...new Set(channelToNetwork.values())]
1376
- : [];
1377
-
1378
- let showEntries = programToChannels ? [...programToChannels.entries()] : [];
1379
-
1380
- if (channelToNetwork && this.selectedTVNetwork) {
1381
- showEntries = showEntries.filter(([, channels]) =>
1382
- Object.keys(channels).some(
1383
- c => channelToNetwork.get(c) === this.selectedTVNetwork,
1384
- ),
1385
- );
1386
- }
1387
-
1388
- const shows = showEntries.map(([show]) => show);
1389
- const loadingIndicator = html`
1390
- <img src="https://archive.org/images/loading.gif" />
1391
- `;
1392
-
1393
- return html`
1394
- <div id="tv-filters" slot="facets-top">
1395
- <ia-combo-box
1396
- id="tv-networks"
1397
- class="tv-filter-dropdown"
1398
- placeholder="Filter by Network"
1399
- clearable
1400
- wrap-arrow-keys
1401
- sort
1402
- .options=${networks.map((n, i) => ({ id: `network-${i}`, text: n }))}
1403
- @toggle=${this.networksDropdownToggled}
1404
- @change=${this.networksDropdownChanged}
1405
- >
1406
- <span slot="label" class="sr-only">${msg('Filter by Network')}</span>
1407
- ${this.loadingNetworks
1408
- ? html`<span slot="empty-options">${loadingIndicator}</span>`
1409
- : nothing}
1410
- </ia-combo-box>
1411
- <ia-combo-box
1412
- id="tv-shows"
1413
- class="tv-filter-dropdown"
1414
- placeholder="Filter by Show"
1415
- max-autocomplete-entries="500"
1416
- clearable
1417
- wrap-arrow-keys
1418
- sort
1419
- .options=${shows.map((s, i) => ({ id: `show-${i}`, text: s }))}
1420
- @toggle=${this.showsDropdownToggled}
1421
- @change=${this.showsDropdownChanged}
1422
- >
1423
- <span slot="label" class="sr-only">${msg('Filter by Show')}</span>
1424
- ${this.loadingShows
1425
- ? html`<span slot="empty-options">${loadingIndicator}</span>`
1426
- : nothing}
1427
- </ia-combo-box>
1428
- </div>
1429
- `;
1430
- }
1431
-
1432
1249
  /**
1433
1250
  * The template for the facets component alone, without any surrounding wrappers.
1434
1251
  */
@@ -1488,7 +1305,6 @@ export class CollectionBrowser
1488
1305
  @facetsChanged=${this.facetsChanged}
1489
1306
  @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
1490
1307
  >
1491
- ${this.tvDropdownFiltersTemplate}
1492
1308
  </collection-facets>
1493
1309
  `;
1494
1310
 
@@ -1645,6 +1461,7 @@ export class CollectionBrowser
1645
1461
  this.sortDirection = queryState.sortDirection;
1646
1462
  this.selectedTitleFilter = queryState.selectedTitleFilter;
1647
1463
  this.selectedCreatorFilter = queryState.selectedCreatorFilter;
1464
+ this.tvClipFilter = queryState.tvClipFilter ?? 'all';
1648
1465
 
1649
1466
  this.pagesToRender = this.initialPageNumber;
1650
1467
 
@@ -1753,10 +1570,6 @@ export class CollectionBrowser
1753
1570
  }
1754
1571
  }
1755
1572
 
1756
- if (changed.has('searchType') && this.searchType === SearchType.TV) {
1757
- this.applyDefaultTVSearchSort();
1758
- }
1759
-
1760
1573
  if (changed.has('profileElement')) {
1761
1574
  this.applyDefaultProfileSort();
1762
1575
  }
@@ -2094,6 +1907,7 @@ export class CollectionBrowser
2094
1907
  sortDirection: this.sortDirection,
2095
1908
  selectedTitleFilter: this.selectedTitleFilter,
2096
1909
  selectedCreatorFilter: this.selectedCreatorFilter,
1910
+ tvClipFilter: this.tvClipFilter,
2097
1911
  },
2098
1912
  }),
2099
1913
  );
@@ -2257,17 +2071,17 @@ export class CollectionBrowser
2257
2071
  this.currentPage = restorationState.currentPage ?? 1;
2258
2072
  this.minSelectedDate = restorationState.minSelectedDate;
2259
2073
  this.maxSelectedDate = restorationState.maxSelectedDate;
2074
+ this.tvClipFilter = restorationState.tvClipFilter ?? 'all';
2260
2075
  if (this.currentPage > 1) {
2261
2076
  this.goToPage(this.currentPage);
2262
2077
  }
2263
2078
  }
2264
2079
 
2265
2080
  private persistState() {
2266
- const isDefaultSort = this.selectedSort === this.defaultSortField;
2267
2081
  const restorationState: RestorationState = {
2268
2082
  displayMode: this.displayMode,
2269
2083
  searchType: this.suppressURLSinParam ? undefined : this.searchType,
2270
- selectedSort: isDefaultSort ? SortField.default : this.selectedSort,
2084
+ selectedSort: this.selectedSort,
2271
2085
  sortDirection: this.sortDirection ?? undefined,
2272
2086
  selectedFacets: this.selectedFacets ?? getDefaultSelectedFacets(),
2273
2087
  baseQuery: this.suppressURLQuery ? undefined : this.baseQuery,
@@ -2278,6 +2092,7 @@ export class CollectionBrowser
2278
2092
  maxSelectedDate: this.maxSelectedDate,
2279
2093
  selectedTitleFilter: this.selectedTitleFilter ?? undefined,
2280
2094
  selectedCreatorFilter: this.selectedCreatorFilter ?? undefined,
2095
+ tvClipFilter: this.tvClipFilter,
2281
2096
  };
2282
2097
  const persistOptions: RestorationStatePersistOptions = {
2283
2098
  forceReplace: this.dataSourceInstallInProgress,
@@ -2372,14 +2187,6 @@ export class CollectionBrowser
2372
2187
  }
2373
2188
  }
2374
2189
 
2375
- /**
2376
- * Applies the default sort options for the TV search results page
2377
- */
2378
- applyDefaultTVSearchSort(): void {
2379
- this.defaultSortField = SortField.datearchived;
2380
- this.defaultSortDirection = 'desc';
2381
- }
2382
-
2383
2190
  /**
2384
2191
  * Applies any default sort option for the current collection, by checking
2385
2192
  * for one in the collection's metadata. If none is found, defaults to sorting
@@ -2503,7 +2310,7 @@ export class CollectionBrowser
2503
2310
  });
2504
2311
  }
2505
2312
 
2506
- cellForIndex(index: number): HTMLTemplateResult | undefined {
2313
+ cellForIndex(index: number): TemplateResult | undefined {
2507
2314
  const model = this.tileModelAtCellIndex(index);
2508
2315
  if (!model) return undefined;
2509
2316
 
@@ -2748,10 +2555,10 @@ export class CollectionBrowser
2748
2555
  #facets-bottom-fade {
2749
2556
  background: linear-gradient(
2750
2557
  to bottom,
2751
- #fbfbfd00 0%,
2752
- #fbfbfdc0 50%,
2753
- #fbfbfd 80%,
2754
- #fbfbfd 100%
2558
+ #f5f5f700 0%,
2559
+ #f5f5f7c0 50%,
2560
+ #f5f5f7 80%,
2561
+ #f5f5f7 100%
2755
2562
  );
2756
2563
  position: fixed;
2757
2564
  bottom: 0;
@@ -2854,46 +2661,12 @@ export class CollectionBrowser
2854
2661
  line-height: 1.3rem;
2855
2662
  }
2856
2663
 
2857
- #tv-filters {
2858
- margin-bottom: 15px;
2859
- }
2860
-
2861
- #tv-shows {
2862
- --comboBoxListWidth: 300px;
2863
- }
2864
-
2865
- .tv-filter-dropdown {
2866
- display: block;
2867
- font-size: 14px;
2868
- margin-left: 1px;
2869
- margin-bottom: 5px;
2870
- }
2871
-
2872
- .tv-filter-dropdown::part(combo-box) {
2873
- outline-offset: 1px;
2874
- }
2875
-
2876
- .tv-filter-dropdown::part(option) {
2877
- line-height: 1.1;
2878
- padding: 7px;
2879
- }
2880
-
2881
- .tv-filter-dropdown::part(clear-button) {
2882
- flex: 0 0 26px;
2883
- --combo-box-clear-icon-size: 14px;
2884
- }
2885
-
2886
- .tv-filter-dropdown::part(icon) {
2887
- width: 1.4rem;
2888
- height: 1.4rem;
2889
- }
2890
-
2891
2664
  #facets-container {
2892
2665
  position: relative;
2893
2666
  max-height: 0;
2894
2667
  transition: max-height 0.2s ease-in-out;
2895
2668
  z-index: 1;
2896
- margin-top: var(--facetsContainerMarginTop, 3rem);
2669
+ margin-top: var(--facetsContainerMarginTop, 5rem);
2897
2670
  padding-bottom: 2rem;
2898
2671
  }
2899
2672
 
@@ -2923,10 +2696,6 @@ export class CollectionBrowser
2923
2696
  align-items: baseline;
2924
2697
  }
2925
2698
 
2926
- #results-total:not(.filtered) {
2927
- padding-bottom: 2rem;
2928
- }
2929
-
2930
2699
  .mobile #results-total {
2931
2700
  position: absolute;
2932
2701
  right: 10px;