@internetarchive/collection-browser 4.3.1 → 4.3.2-alpha-webdev7939.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.
@@ -406,32 +406,32 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
406
406
  }
407
407
  }
408
408
  render() {
409
- return html `
409
+ return html `
410
410
  ${this.showSmartFacetBar && this.placeholderType === null
411
- ? html `<smart-facet-bar
412
- .query=${this.baseQuery}
413
- .aggregations=${this.dataSource.aggregations}
414
- .selectedFacets=${this.selectedFacets}
415
- .collectionTitles=${this.dataSource.collectionTitles}
416
- .filterToggleShown=${!this.mobileView}
417
- .filterToggleActive=${this.facetPaneVisible}
418
- .label=${this.smartFacetBarLabel}
419
- @facetsChanged=${this.facetsChanged}
411
+ ? html `<smart-facet-bar
412
+ .query=${this.baseQuery}
413
+ .aggregations=${this.dataSource.aggregations}
414
+ .selectedFacets=${this.selectedFacets}
415
+ .collectionTitles=${this.dataSource.collectionTitles}
416
+ .filterToggleShown=${!this.mobileView}
417
+ .filterToggleActive=${this.facetPaneVisible}
418
+ .label=${this.smartFacetBarLabel}
419
+ @facetsChanged=${this.facetsChanged}
420
420
  @filtersToggled=${() => {
421
421
  this.facetPaneVisible = !this.facetPaneVisible;
422
422
  this.emitFacetPaneVisibilityChanged();
423
- }}
423
+ }}
424
424
  ></smart-facet-bar>`
425
- : nothing}
426
-
427
- <div
428
- id="content-container"
429
- class=${this.mobileView ? 'mobile' : 'desktop'}
430
- >
425
+ : nothing}
426
+
427
+ <div
428
+ id="content-container"
429
+ class=${this.mobileView ? 'mobile' : 'desktop'}
430
+ >
431
431
  ${this.placeholderType
432
432
  ? this.emptyPlaceholderTemplate
433
- : this.collectionBrowserTemplate}
434
- </div>
433
+ : this.collectionBrowserTemplate}
434
+ </div>
435
435
  `;
436
436
  }
437
437
  /**
@@ -475,23 +475,23 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
475
475
  * Template for the placeholder content to show when no results are available.
476
476
  */
477
477
  get emptyPlaceholderTemplate() {
478
- return html `
479
- <empty-placeholder
480
- .placeholderType=${this.placeholderType}
481
- ?isMobileView=${this.mobileView}
482
- ?isCollection=${!!this.withinCollection}
483
- .detailMessage=${this.dataSource.queryErrorMessage ?? ''}
484
- .baseNavigationUrl=${this.baseNavigationUrl}
485
- ></empty-placeholder>
478
+ return html `
479
+ <empty-placeholder
480
+ .placeholderType=${this.placeholderType}
481
+ ?isMobileView=${this.mobileView}
482
+ ?isCollection=${!!this.withinCollection}
483
+ .detailMessage=${this.dataSource.queryErrorMessage ?? ''}
484
+ .baseNavigationUrl=${this.baseNavigationUrl}
485
+ ></empty-placeholder>
486
486
  `;
487
487
  }
488
488
  /**
489
489
  * Top-level template for rendering the left (facets) and right (results) columns.
490
490
  */
491
491
  get collectionBrowserTemplate() {
492
- return html `
493
- <div id="left-column-scroll-sentinel"></div>
494
- ${this.leftColumnTemplate} ${this.rightColumnTemplate}
492
+ return html `
493
+ <div id="left-column-scroll-sentinel"></div>
494
+ ${this.leftColumnTemplate} ${this.rightColumnTemplate}
495
495
  `;
496
496
  }
497
497
  /**
@@ -510,33 +510,33 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
510
510
  * accordion-style facets.
511
511
  */
512
512
  get mobileLeftColumnTemplate() {
513
- return html `
514
- <div
515
- id="left-column"
516
- class="column${this.isResizeToMobile ? ' preload' : ''}"
517
- >
518
- ${this.facetTopViewSlot} ${this.resultsCountTemplate}
519
- <div id="facets-header-container">${this.mobileFacetsTemplate}</div>
520
- </div>
513
+ return html `
514
+ <div
515
+ id="left-column"
516
+ class="column${this.isResizeToMobile ? ' preload' : ''}"
517
+ >
518
+ ${this.facetTopViewSlot} ${this.resultsCountTemplate}
519
+ <div id="facets-header-container">${this.mobileFacetsTemplate}</div>
520
+ </div>
521
521
  `;
522
522
  }
523
523
  /**
524
524
  * Template for the desktop version of the left column, displaying the facets sidebar.
525
525
  */
526
526
  get desktopLeftColumnTemplate() {
527
- return html `
528
- <div id="left-column" class="column" ?hidden=${!this.facetPaneVisible}>
529
- ${this.facetTopViewSlot}
530
- <div id="facets-header-container">
531
- <h2 id="facets-header" class="sr-only">${msg('Filters')}</h2>
532
- ${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(false)}
533
- </div>
534
- <div id="facets-container" aria-labelledby="facets-header">
535
- ${this.facetsTemplate}
536
- <div id="facets-scroll-sentinel"></div>
537
- </div>
538
- <div id="facets-bottom-fade"></div>
539
- </div>
527
+ return html `
528
+ <div id="left-column" class="column" ?hidden=${!this.facetPaneVisible}>
529
+ ${this.facetTopViewSlot}
530
+ <div id="facets-header-container">
531
+ <h2 id="facets-header" class="sr-only">${msg('Filters')}</h2>
532
+ ${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(false)}
533
+ </div>
534
+ <div id="facets-container" aria-labelledby="facets-header">
535
+ ${this.facetsTemplate}
536
+ <div id="facets-scroll-sentinel"></div>
537
+ </div>
538
+ <div id="facets-bottom-fade"></div>
539
+ </div>
540
540
  `;
541
541
  }
542
542
  /**
@@ -544,8 +544,8 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
544
544
  * - mainly used to render userlists
545
545
  */
546
546
  get facetTopViewSlot() {
547
- return html `<div id="facet-top-view">
548
- <slot name="facet-top-slot"></slot>
547
+ return html `<div id="facet-top-view">
548
+ <slot name="facet-top-slot"></slot>
549
549
  </div>`;
550
550
  }
551
551
  /**
@@ -560,15 +560,15 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
560
560
  const resultsCount = this.totalResults?.toLocaleString();
561
561
  const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';
562
562
  // Added data-testid for Playwright testing
563
- return html `
564
- <div id="results-total" class=${classes} data-testid="results-total">
565
- <span id="big-results-count">
566
- ${shouldShowSearching ? html `Searching&hellip;` : resultsCount}
567
- </span>
568
- <span id="big-results-label">
569
- ${shouldShowSearching ? nothing : resultsLabel}
570
- </span>
571
- </div>
563
+ return html `
564
+ <div id="results-total" class=${classes} data-testid="results-total">
565
+ <span id="big-results-count">
566
+ ${shouldShowSearching ? html `Searching&hellip;` : resultsCount}
567
+ </span>
568
+ <span id="big-results-label">
569
+ ${shouldShowSearching ? nothing : resultsLabel}
570
+ </span>
571
+ </div>
572
572
  `;
573
573
  }
574
574
  /**
@@ -581,45 +581,46 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
581
581
  'full-width': !this.facetPaneVisible,
582
582
  'smart-results-spacing': !!this.showSmartResults,
583
583
  });
584
- return html `
585
- <div id="right-column" class=${rightColumnClasses}>
584
+ return html `
585
+ <div id="right-column" class=${rightColumnClasses}>
586
586
  ${this.showSmartResults
587
587
  ? html `<slot name="smart-results"></slot>`
588
- : nothing}
589
- <section id="results">
590
- <h2 class="results-section-heading">
591
- <slot name="results-heading"></slot>
592
- </h2>
593
- <div id="cb-top-view">
594
- <slot name="cb-top-slot"></slot>
595
- </div>
588
+ : nothing}
589
+ <section id="results">
590
+ <h2 class="results-section-heading">
591
+ <slot name="results-heading"></slot>
592
+ </h2>
593
+ <div id="cb-top-view">
594
+ <slot name="cb-top-slot"></slot>
595
+ </div>
596
596
  ${this.isManageView
597
597
  ? this.manageBarTemplate
598
- : this.sortFilterBarTemplate}
599
- <slot name="cb-results"></slot>
598
+ : this.sortFilterBarTemplate}
599
+ <slot name="cb-results"></slot>
600
600
  ${this.displayMode === `list-compact` && this.totalResults
601
601
  ? this.listHeaderTemplate
602
- : nothing}
603
- ${this.suppressResultTiles ? nothing : this.infiniteScrollerTemplate}
604
- </section>
605
- </div>
602
+ : nothing}
603
+ ${this.suppressResultTiles ? nothing : this.infiniteScrollerTemplate}
604
+ </section>
605
+ </div>
606
606
  `;
607
607
  }
608
608
  /**
609
609
  * Template for the infinite scroller widget that contains the result tiles.
610
610
  */
611
611
  get infiniteScrollerTemplate() {
612
- return html `<infinite-scroller
613
- class=${this.infiniteScrollerClasses}
614
- itemCount=${this.placeholderType ? 0 : nothing}
615
- ariaLandmarkLabel="Search results"
616
- .cellProvider=${this}
617
- .placeholderCellTemplate=${this.placeholderCellTemplate}
618
- @scrollThresholdReached=${this.scrollThresholdReached}
619
- @visibleCellsChanged=${this.visibleCellsChanged}
612
+ return html `<infinite-scroller
613
+ class=${this.infiniteScrollerClasses}
614
+ itemCount=${this.placeholderType ? 0 : nothing}
615
+ ariaLandmarkLabel="Search results"
616
+ .estimatedCellHeight=${this.estimatedTileHeight}
617
+ .cellProvider=${this}
618
+ .placeholderCellTemplate=${this.placeholderCellTemplate}
619
+ @scrollThresholdReached=${this.scrollThresholdReached}
620
+ @visibleCellsChanged=${this.visibleCellsChanged}
620
621
  >${this.displayMode === 'grid'
621
622
  ? html `<slot name="result-last-tile" slot="result-last-tile"></slot>`
622
- : nothing}
623
+ : nothing}
623
624
  </infinite-scroller>`;
624
625
  }
625
626
  /**
@@ -632,6 +633,24 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
632
633
  hidden: !!this.placeholderType,
633
634
  });
634
635
  }
636
+ /**
637
+ * Best-effort hint of how tall a single rendered tile is, by display mode.
638
+ * The scroller uses this to better estimate the size its initial scroll
639
+ * spacer and buffer position before real cell heights are measured.
640
+ * Should roughly match the placeholder heights since the initial render
641
+ * of a new page generally shows placeholders only anyway.
642
+ */
643
+ get estimatedTileHeight() {
644
+ switch (this.displayMode) {
645
+ case 'list-detail':
646
+ return 80;
647
+ case 'list-compact':
648
+ return 45;
649
+ case 'grid':
650
+ default:
651
+ return 225;
652
+ }
653
+ }
635
654
  /**
636
655
  * Template for the sort & filtering bar that appears atop the search results.
637
656
  */
@@ -653,29 +672,29 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
653
672
  }
654
673
  // We only show relevance sort if a search query is currently defined
655
674
  sortFieldAvailability.relevance = this.isRelevanceSortAvailable;
656
- return html `
657
- <sort-filter-bar
658
- .defaultSortField=${this.defaultSortField}
659
- .defaultSortDirection=${this.defaultSortDirection}
660
- .selectedSort=${this.selectedSort}
661
- .sortDirection=${this.sortDirection}
662
- .sortFieldAvailability=${sortFieldAvailability}
663
- .displayMode=${this.displayMode}
664
- .selectedTitleFilter=${this.selectedTitleFilter}
665
- .selectedCreatorFilter=${this.selectedCreatorFilter}
666
- .prefixFilterCountMap=${this.dataSource.prefixFilterCountMap}
667
- .enableSortOptionsSlot=${this.enableSortOptionsSlot}
668
- .suppressDisplayModes=${this.suppressDisplayModes}
669
- @sortChanged=${this.userChangedSort}
670
- @displayModeChanged=${this.displayModeChanged}
671
- @titleLetterChanged=${this.titleLetterSelected}
672
- @creatorLetterChanged=${this.creatorLetterSelected}
673
- >
674
- ${this.tileBlurCheckboxTemplate}
675
- <slot name="sort-options-left" slot="sort-options-left"></slot>
676
- <slot name="sort-options" slot="sort-options"></slot>
677
- <slot name="sort-options-right" slot="sort-options-right"></slot>
678
- </sort-filter-bar>
675
+ return html `
676
+ <sort-filter-bar
677
+ .defaultSortField=${this.defaultSortField}
678
+ .defaultSortDirection=${this.defaultSortDirection}
679
+ .selectedSort=${this.selectedSort}
680
+ .sortDirection=${this.sortDirection}
681
+ .sortFieldAvailability=${sortFieldAvailability}
682
+ .displayMode=${this.displayMode}
683
+ .selectedTitleFilter=${this.selectedTitleFilter}
684
+ .selectedCreatorFilter=${this.selectedCreatorFilter}
685
+ .prefixFilterCountMap=${this.dataSource.prefixFilterCountMap}
686
+ .enableSortOptionsSlot=${this.enableSortOptionsSlot}
687
+ .suppressDisplayModes=${this.suppressDisplayModes}
688
+ @sortChanged=${this.userChangedSort}
689
+ @displayModeChanged=${this.displayModeChanged}
690
+ @titleLetterChanged=${this.titleLetterSelected}
691
+ @creatorLetterChanged=${this.creatorLetterSelected}
692
+ >
693
+ ${this.tileBlurCheckboxTemplate}
694
+ <slot name="sort-options-left" slot="sort-options-left"></slot>
695
+ <slot name="sort-options" slot="sort-options"></slot>
696
+ <slot name="sort-options-right" slot="sort-options-right"></slot>
697
+ </sort-filter-bar>
679
698
  `;
680
699
  }
681
700
  /**
@@ -686,20 +705,20 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
686
705
  // Only show the checkbox for @archive.org users
687
706
  if (!this.dataSource.sessionContext?.is_archive_user)
688
707
  return nothing;
689
- return html `
690
- <label
691
- id="tile-blur-label"
692
- for="tile-blur-check"
693
- slot="sort-options-right"
694
- >
695
- ${msg('Blurring')}
696
- <input
697
- id="tile-blur-check"
698
- type="checkbox"
699
- ?checked=${!this.shouldSuppressTileBlurring}
700
- @change=${this.tileBlurCheckboxChanged}
701
- />
702
- </label>
708
+ return html `
709
+ <label
710
+ id="tile-blur-label"
711
+ for="tile-blur-check"
712
+ slot="sort-options-right"
713
+ >
714
+ ${msg('Blurring')}
715
+ <input
716
+ id="tile-blur-check"
717
+ type="checkbox"
718
+ ?checked=${!this.shouldSuppressTileBlurring}
719
+ @change=${this.tileBlurCheckboxChanged}
720
+ />
721
+ </label>
703
722
  `;
704
723
  }
705
724
  /**
@@ -707,27 +726,27 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
707
726
  * showing the management view. This generally replaces the sort bar when present.
708
727
  */
709
728
  get manageBarTemplate() {
710
- return html `
711
- <manage-bar
712
- .label=${this.manageViewLabel}
713
- .modalManager=${this.modalManager}
714
- .selectedItems=${this.dataSource.checkedTileModels}
715
- .profileElement=${this.profileElement}
716
- showSelectAll
717
- showUnselectAll
718
- ?showItemManageButton=${this.pageContext === 'search'}
719
- ?removeAllowed=${this.dataSource.checkedTileModels.length !== 0}
720
- @removeItems=${this.handleRemoveItems}
721
- @manageItems=${this.handleManageItems}
722
- @selectAll=${() => this.dataSource.checkAllTiles()}
723
- @unselectAll=${() => this.dataSource.uncheckAllTiles()}
729
+ return html `
730
+ <manage-bar
731
+ .label=${this.manageViewLabel}
732
+ .modalManager=${this.modalManager}
733
+ .selectedItems=${this.dataSource.checkedTileModels}
734
+ .profileElement=${this.profileElement}
735
+ showSelectAll
736
+ showUnselectAll
737
+ ?showItemManageButton=${this.pageContext === 'search'}
738
+ ?removeAllowed=${this.dataSource.checkedTileModels.length !== 0}
739
+ @removeItems=${this.handleRemoveItems}
740
+ @manageItems=${this.handleManageItems}
741
+ @selectAll=${() => this.dataSource.checkAllTiles()}
742
+ @unselectAll=${() => this.dataSource.uncheckAllTiles()}
724
743
  @cancel=${() => {
725
744
  this.isManageView = false;
726
745
  this.dataSource.uncheckAllTiles();
727
746
  if (this.searchResultsLoading)
728
747
  this.dataSource.resetPages();
729
- }}
730
- ></manage-bar>
748
+ }}
749
+ ></manage-bar>
731
750
  `;
732
751
  }
733
752
  /**
@@ -962,15 +981,15 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
962
981
  label: target.open ? 'open' : 'closed',
963
982
  });
964
983
  };
965
- return html `
966
- <details id="mobile-filter-collapse" @toggle=${toggleFacetsVisible}>
967
- <summary>
968
- <span class="collapser-icon">${chevronIcon}</span>
969
- <h2>${msg('Filters')}</h2>
970
- ${this.clearFiltersBtnTemplate(true)}
971
- </summary>
972
- ${this.facetsTemplate}
973
- </details>
984
+ return html `
985
+ <details id="mobile-filter-collapse" @toggle=${toggleFacetsVisible}>
986
+ <summary>
987
+ <span class="collapser-icon">${chevronIcon}</span>
988
+ <h2>${msg('Filters')}</h2>
989
+ ${this.clearFiltersBtnTemplate(true)}
990
+ </summary>
991
+ ${this.facetsTemplate}
992
+ </details>
974
993
  `;
975
994
  }
976
995
  /**
@@ -1054,50 +1073,50 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1054
1073
  const filterByNetworkLabel = msg('Filter by Network');
1055
1074
  const filterByShowLabel = msg('Filter by Show');
1056
1075
  const shows = showEntries.map(([show]) => show);
1057
- const loadingIndicator = html `
1058
- <span slot="empty-options">
1059
- <img src="https://archive.org/images/loading.gif" />
1060
- </span>
1076
+ const loadingIndicator = html `
1077
+ <span slot="empty-options">
1078
+ <img src="https://archive.org/images/loading.gif" />
1079
+ </span>
1061
1080
  `;
1062
- const errorMessage = html `
1063
- <span slot="empty-options">
1064
- ${msg('Unable to fetch options, try again later')}
1065
- </span>
1081
+ const errorMessage = html `
1082
+ <span slot="empty-options">
1083
+ ${msg('Unable to fetch options, try again later')}
1084
+ </span>
1066
1085
  `;
1067
- return html `
1068
- <div id="tv-filters" slot="facets-top">
1069
- <ia-combo-box
1070
- id="tv-networks"
1071
- class="tv-filter-dropdown"
1072
- placeholder=${filterByNetworkLabel}
1073
- clearable
1074
- wrap-arrow-keys
1075
- sort
1076
- .options=${networks.map((n, i) => ({ id: `network-${i}`, text: n }))}
1077
- @toggle=${this.tvDropdownToggled}
1078
- @change=${this.networksDropdownChanged}
1079
- >
1080
- <span slot="label" class="sr-only">${filterByNetworkLabel}</span>
1081
- ${this.tvMapsLoading ? loadingIndicator : nothing}
1082
- ${this.tvMapsErrored ? errorMessage : nothing}
1083
- </ia-combo-box>
1084
- <ia-combo-box
1085
- id="tv-shows"
1086
- class="tv-filter-dropdown"
1087
- placeholder=${filterByShowLabel}
1088
- max-autocomplete-entries="500"
1089
- clearable
1090
- wrap-arrow-keys
1091
- sort
1092
- .options=${shows.map((s, i) => ({ id: `show-${i}`, text: s }))}
1093
- @toggle=${this.tvDropdownToggled}
1094
- @change=${this.showsDropdownChanged}
1095
- >
1096
- <span slot="label" class="sr-only">${filterByShowLabel}</span>
1097
- ${this.tvMapsLoading ? loadingIndicator : nothing}
1098
- ${this.tvMapsErrored ? errorMessage : nothing}
1099
- </ia-combo-box>
1100
- </div>
1086
+ return html `
1087
+ <div id="tv-filters" slot="facets-top">
1088
+ <ia-combo-box
1089
+ id="tv-networks"
1090
+ class="tv-filter-dropdown"
1091
+ placeholder=${filterByNetworkLabel}
1092
+ clearable
1093
+ wrap-arrow-keys
1094
+ sort
1095
+ .options=${networks.map((n, i) => ({ id: `network-${i}`, text: n }))}
1096
+ @toggle=${this.tvDropdownToggled}
1097
+ @change=${this.networksDropdownChanged}
1098
+ >
1099
+ <span slot="label" class="sr-only">${filterByNetworkLabel}</span>
1100
+ ${this.tvMapsLoading ? loadingIndicator : nothing}
1101
+ ${this.tvMapsErrored ? errorMessage : nothing}
1102
+ </ia-combo-box>
1103
+ <ia-combo-box
1104
+ id="tv-shows"
1105
+ class="tv-filter-dropdown"
1106
+ placeholder=${filterByShowLabel}
1107
+ max-autocomplete-entries="500"
1108
+ clearable
1109
+ wrap-arrow-keys
1110
+ sort
1111
+ .options=${shows.map((s, i) => ({ id: `show-${i}`, text: s }))}
1112
+ @toggle=${this.tvDropdownToggled}
1113
+ @change=${this.showsDropdownChanged}
1114
+ >
1115
+ <span slot="label" class="sr-only">${filterByShowLabel}</span>
1116
+ ${this.tvMapsLoading ? loadingIndicator : nothing}
1117
+ ${this.tvMapsErrored ? errorMessage : nothing}
1118
+ </ia-combo-box>
1119
+ </div>
1101
1120
  `;
1102
1121
  }
1103
1122
  /**
@@ -1107,10 +1126,10 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1107
1126
  if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement))
1108
1127
  return nothing;
1109
1128
  if (this.facetLoadStrategy === 'off') {
1110
- return html `
1111
- <p class="facets-message">
1112
- ${msg('Facets are temporarily unavailable.')}
1113
- </p>
1129
+ return html `
1130
+ <p class="facets-message">
1131
+ ${msg('Facets are temporarily unavailable.')}
1132
+ </p>
1114
1133
  `;
1115
1134
  }
1116
1135
  // We switch to TV facet ordering & date picker if we are in a TV collection or showing TV search results
@@ -1119,46 +1138,46 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1119
1138
  const facetDisplayOrder = shouldUseTvInterface
1120
1139
  ? tvFacetDisplayOrder
1121
1140
  : defaultFacetDisplayOrder;
1122
- const facets = html `
1123
- <collection-facets
1124
- .collectionPagePath=${this.collectionPagePath}
1125
- .parentCollections=${this.dataSource.parentCollections}
1126
- .pageSpecifierParams=${this.dataSource.pageSpecifierParams}
1127
- .searchService=${this.searchService}
1128
- .featureFeedbackService=${this.featureFeedbackService}
1129
- .recaptchaManager=${this.recaptchaManager}
1130
- .resizeObserver=${this.resizeObserver}
1131
- .searchType=${this.searchType}
1132
- .aggregations=${this.dataSource.aggregations}
1133
- .histogramAggregation=${this.dataSource.histogramAggregation}
1134
- .minSelectedDate=${this.minSelectedDate}
1135
- .maxSelectedDate=${this.maxSelectedDate}
1136
- .selectedFacets=${this.selectedFacets}
1137
- .baseNavigationUrl=${this.baseNavigationUrl}
1138
- .collectionTitles=${this.dataSource.collectionTitles}
1139
- .tvChannelAliases=${this.dataSource.tvChannelAliases}
1140
- .showHistogramDatePicker=${this.showHistogramDatePicker}
1141
- .allowExpandingDatePicker=${!this.mobileView}
1142
- .allowDatePickerMonths=${shouldUseTvInterface}
1143
- .contentWidth=${this.contentWidth}
1144
- .query=${this.baseQuery}
1145
- .identifiers=${this.identifiers}
1146
- .filterMap=${this.dataSource.filterMap}
1147
- .isManageView=${this.isManageView}
1148
- .modalManager=${this.modalManager}
1149
- .analyticsHandler=${this.analyticsHandler}
1150
- .facetDisplayOrder=${facetDisplayOrder}
1151
- .isTvSearch=${shouldUseTvInterface}
1152
- ?collapsableFacets=${this.mobileView}
1153
- ?facetsLoading=${this.facetsLoading}
1154
- ?histogramAggregationLoading=${this.facetsLoading}
1155
- ?suppressMediatypeFacets=${this.suppressMediatypeFacets}
1156
- @facetClick=${this.facetClickHandler}
1157
- @facetsChanged=${this.facetsChanged}
1158
- @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
1159
- >
1160
- ${this.tvDropdownFiltersTemplate}
1161
- </collection-facets>
1141
+ const facets = html `
1142
+ <collection-facets
1143
+ .collectionPagePath=${this.collectionPagePath}
1144
+ .parentCollections=${this.dataSource.parentCollections}
1145
+ .pageSpecifierParams=${this.dataSource.pageSpecifierParams}
1146
+ .searchService=${this.searchService}
1147
+ .featureFeedbackService=${this.featureFeedbackService}
1148
+ .recaptchaManager=${this.recaptchaManager}
1149
+ .resizeObserver=${this.resizeObserver}
1150
+ .searchType=${this.searchType}
1151
+ .aggregations=${this.dataSource.aggregations}
1152
+ .histogramAggregation=${this.dataSource.histogramAggregation}
1153
+ .minSelectedDate=${this.minSelectedDate}
1154
+ .maxSelectedDate=${this.maxSelectedDate}
1155
+ .selectedFacets=${this.selectedFacets}
1156
+ .baseNavigationUrl=${this.baseNavigationUrl}
1157
+ .collectionTitles=${this.dataSource.collectionTitles}
1158
+ .tvChannelAliases=${this.dataSource.tvChannelAliases}
1159
+ .showHistogramDatePicker=${this.showHistogramDatePicker}
1160
+ .allowExpandingDatePicker=${!this.mobileView}
1161
+ .allowDatePickerMonths=${shouldUseTvInterface}
1162
+ .contentWidth=${this.contentWidth}
1163
+ .query=${this.baseQuery}
1164
+ .identifiers=${this.identifiers}
1165
+ .filterMap=${this.dataSource.filterMap}
1166
+ .isManageView=${this.isManageView}
1167
+ .modalManager=${this.modalManager}
1168
+ .analyticsHandler=${this.analyticsHandler}
1169
+ .facetDisplayOrder=${facetDisplayOrder}
1170
+ .isTvSearch=${shouldUseTvInterface}
1171
+ ?collapsableFacets=${this.mobileView}
1172
+ ?facetsLoading=${this.facetsLoading}
1173
+ ?histogramAggregationLoading=${this.facetsLoading}
1174
+ ?suppressMediatypeFacets=${this.suppressMediatypeFacets}
1175
+ @facetClick=${this.facetClickHandler}
1176
+ @facetsChanged=${this.facetsChanged}
1177
+ @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
1178
+ >
1179
+ ${this.tvDropdownFiltersTemplate}
1180
+ </collection-facets>
1162
1181
  `;
1163
1182
  // If we are using one of the opt-in facet load strategies, we may need to wrap the
1164
1183
  // desktop view facets in a <details> widget so that patrons can opt into loading them.
@@ -1166,20 +1185,20 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1166
1185
  const showDesktopOptInWidget = this.facetLoadStrategy === 'opt-in' ||
1167
1186
  (this.facetLoadStrategy === 'opt-in-or-login' && !this.loggedIn);
1168
1187
  if (showDesktopOptInWidget && !this.mobileView) {
1169
- return html `
1170
- <details
1171
- class="desktop-facets-dropdown"
1188
+ return html `
1189
+ <details
1190
+ class="desktop-facets-dropdown"
1172
1191
  @toggle=${(e) => {
1173
1192
  const target = e.target;
1174
1193
  this.collapsibleFacetsVisible = target.open;
1175
- }}
1176
- >
1177
- <summary>
1178
- <span class="collapser-icon">${chevronIcon}</span>
1179
- <h2>${msg('Filters')}</h2>
1180
- </summary>
1181
- ${facets}
1182
- </details>
1194
+ }}
1195
+ >
1196
+ <summary>
1197
+ <span class="collapser-icon">${chevronIcon}</span>
1198
+ <h2>${msg('Filters')}</h2>
1199
+ </summary>
1200
+ ${facets}
1201
+ </details>
1183
1202
  `;
1184
1203
  }
1185
1204
  // Otherwise, just render the facets component bare
@@ -1199,34 +1218,34 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1199
1218
  mobile,
1200
1219
  });
1201
1220
  const buttonText = mobile ? 'Clear all' : 'Clear all filters';
1202
- return html `
1203
- <div class="clear-filters-btn-row">
1221
+ return html `
1222
+ <div class="clear-filters-btn-row">
1204
1223
  ${mobile
1205
1224
  ? html `<span class="clear-filters-btn-separator">&nbsp;</span>`
1206
- : nothing}
1207
- <button class=${buttonClasses} @click=${this.clearFilters}>
1208
- ${buttonText}
1209
- </button>
1210
- </div>
1225
+ : nothing}
1226
+ <button class=${buttonClasses} @click=${this.clearFilters}>
1227
+ ${buttonText}
1228
+ </button>
1229
+ </div>
1211
1230
  `;
1212
1231
  }
1213
1232
  /**
1214
1233
  * Template for the table header content that appears atop the compact list view.
1215
1234
  */
1216
1235
  get listHeaderTemplate() {
1217
- return html `
1218
- <div id="list-header">
1219
- <tile-dispatcher
1220
- .tileDisplayMode=${'list-header'}
1221
- .resizeObserver=${this.resizeObserver}
1222
- .sortParam=${this.sortParam}
1223
- .defaultSortParam=${this.defaultSortParam}
1224
- .mobileBreakpoint=${this.mobileBreakpoint}
1225
- .loggedIn=${this.loggedIn}
1226
- .suppressBlurring=${this.shouldSuppressTileBlurring}
1227
- >
1228
- </tile-dispatcher>
1229
- </div>
1236
+ return html `
1237
+ <div id="list-header">
1238
+ <tile-dispatcher
1239
+ .tileDisplayMode=${'list-header'}
1240
+ .resizeObserver=${this.resizeObserver}
1241
+ .sortParam=${this.sortParam}
1242
+ .defaultSortParam=${this.defaultSortParam}
1243
+ .mobileBreakpoint=${this.mobileBreakpoint}
1244
+ .loggedIn=${this.loggedIn}
1245
+ .suppressBlurring=${this.shouldSuppressTileBlurring}
1246
+ >
1247
+ </tile-dispatcher>
1248
+ </div>
1230
1249
  `;
1231
1250
  }
1232
1251
  /**
@@ -1794,25 +1813,31 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1794
1813
  label: facetType,
1795
1814
  });
1796
1815
  }
1797
- scrollToPage(pageNumber) {
1798
- return new Promise(resolve => {
1799
- const cellIndexToScrollTo = this.pageSize * (pageNumber - 1);
1800
- // without this setTimeout, Safari just pauses until the `fetchPage` is complete
1801
- // then scrolls to the cell
1802
- setTimeout(() => {
1803
- this.isScrollingToCell = true;
1804
- this.infiniteScroller?.scrollToCell(cellIndexToScrollTo, true);
1805
- // This timeout is to give the scroll animation time to finish
1806
- // then updating the infinite scroller once we're done scrolling
1807
- // There's no scroll animation completion callback so we're
1808
- // giving it 0.5s to finish.
1809
- setTimeout(() => {
1810
- this.isScrollingToCell = false;
1811
- this.infiniteScroller?.refreshAllVisibleCells();
1812
- resolve();
1813
- }, 500);
1814
- }, 0);
1816
+ async scrollToPage(pageNumber) {
1817
+ const cellIndexToScrollTo = this.pageSize * (pageNumber - 1);
1818
+ // Wait for the infinite scroller be rendered before proceeding
1819
+ let waitAttempts = 0;
1820
+ while (!this.infiniteScroller && waitAttempts < 20) {
1821
+ await this.updateComplete;
1822
+ waitAttempts++;
1823
+ }
1824
+ if (!this.infiniteScroller)
1825
+ return;
1826
+ // The scroller have its default `itemCount=0`, so propagate our estimated
1827
+ // tile count before jumping to the desired page.
1828
+ if (this.infiniteScroller.itemCount < this.estimatedTileCount) {
1829
+ this.infiniteScroller.itemCount = this.estimatedTileCount;
1830
+ await this.updateComplete;
1831
+ }
1832
+ // Without this setTimeout(0), Safari just pauses until the `fetchPage`
1833
+ // is complete then scrolls to the cell.
1834
+ await new Promise(resolve => {
1835
+ setTimeout(resolve, 0);
1815
1836
  });
1837
+ this.isScrollingToCell = true;
1838
+ await this.infiniteScroller.scrollToCell(cellIndexToScrollTo, true);
1839
+ this.isScrollingToCell = false;
1840
+ this.infiniteScroller.refreshAllVisibleCells();
1816
1841
  }
1817
1842
  /**
1818
1843
  * Whether sorting by relevance makes sense for the current state.
@@ -1956,28 +1981,28 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1956
1981
  const isRadioSearch = this.searchType === SearchType.RADIO;
1957
1982
  const { isTVCollection, isRadioCollection } = this;
1958
1983
  const shouldUseLocalTime = isTVSearch || isRadioSearch || isTVCollection || isRadioCollection;
1959
- return html `
1960
- <tile-dispatcher
1961
- .collectionPagePath=${this.collectionPagePath}
1962
- .baseNavigationUrl=${this.baseNavigationUrl}
1963
- .baseImageUrl=${this.baseImageUrl}
1964
- .model=${model}
1965
- .tileDisplayMode=${this.displayMode}
1966
- .resizeObserver=${this.resizeObserver}
1967
- .collectionTitles=${this.dataSource.collectionTitles}
1968
- .sortParam=${this.sortParam}
1969
- .defaultSortParam=${this.defaultSortParam}
1970
- .creatorFilter=${this.selectedCreatorFilter}
1971
- .mobileBreakpoint=${this.mobileBreakpoint}
1972
- .loggedIn=${this.loggedIn}
1973
- .suppressBlurring=${this.shouldSuppressTileBlurring}
1974
- .isManageView=${this.isManageView}
1975
- ?showTvClips=${isTVSearch || isTVCollection}
1976
- ?enableHoverPane=${true}
1977
- ?useLocalTime=${shouldUseLocalTime}
1978
- @resultSelected=${(e) => this.resultSelected(e)}
1979
- >
1980
- </tile-dispatcher>
1984
+ return html `
1985
+ <tile-dispatcher
1986
+ .collectionPagePath=${this.collectionPagePath}
1987
+ .baseNavigationUrl=${this.baseNavigationUrl}
1988
+ .baseImageUrl=${this.baseImageUrl}
1989
+ .model=${model}
1990
+ .tileDisplayMode=${this.displayMode}
1991
+ .resizeObserver=${this.resizeObserver}
1992
+ .collectionTitles=${this.dataSource.collectionTitles}
1993
+ .sortParam=${this.sortParam}
1994
+ .defaultSortParam=${this.defaultSortParam}
1995
+ .creatorFilter=${this.selectedCreatorFilter}
1996
+ .mobileBreakpoint=${this.mobileBreakpoint}
1997
+ .loggedIn=${this.loggedIn}
1998
+ .suppressBlurring=${this.shouldSuppressTileBlurring}
1999
+ .isManageView=${this.isManageView}
2000
+ ?showTvClips=${isTVSearch || isTVCollection}
2001
+ ?enableHoverPane=${true}
2002
+ ?useLocalTime=${shouldUseLocalTime}
2003
+ @resultSelected=${(e) => this.resultSelected(e)}
2004
+ >
2005
+ </tile-dispatcher>
1981
2006
  `;
1982
2007
  }
1983
2008
  /**
@@ -2012,479 +2037,479 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
2012
2037
  static get styles() {
2013
2038
  return [
2014
2039
  srOnlyStyle,
2015
- css `
2016
- :host {
2017
- display: block;
2018
- --leftColumnWidth: 18rem;
2019
- --leftColumnPaddingTop: 2rem;
2020
- --leftColumnPaddingRight: 2.5rem;
2021
- }
2022
-
2023
- #facet-top-view {
2024
- display: flex;
2025
- }
2026
-
2027
- /**
2028
- * When page width resizes from desktop to mobile, use this class to
2029
- * disable expand/collapse transition when loading.
2030
- */
2031
- .preload * {
2032
- transition: none !important;
2033
- -webkit-transition: none !important;
2034
- -moz-transition: none !important;
2035
- -ms-transition: none !important;
2036
- -o-transition: none !important;
2037
- }
2038
-
2039
- #content-container {
2040
- display: flex;
2041
- }
2042
-
2043
- empty-placeholder {
2044
- margin-top: var(--placeholderMarginTop, 0);
2045
- }
2046
-
2047
- .collapser-icon {
2048
- display: inline-block;
2049
- }
2050
-
2051
- .collapser-icon svg {
2052
- display: inline-block;
2053
- width: 12px;
2054
- height: 12px;
2055
- transition: transform 0.2s ease-out;
2056
- }
2057
-
2058
- #mobile-filter-collapse {
2059
- width: 100%;
2060
- }
2061
-
2062
- #mobile-filter-collapse > summary {
2063
- cursor: pointer;
2064
- list-style: none;
2065
- }
2066
-
2067
- #mobile-filter-collapse[open] > summary {
2068
- margin-bottom: 10px;
2069
- }
2070
-
2071
- #mobile-filter-collapse h2 {
2072
- display: inline-block;
2073
- margin: 0;
2074
- font-size: 2rem;
2075
- }
2076
-
2077
- #mobile-filter-collapse[open] svg {
2078
- transform: rotate(90deg);
2079
- }
2080
-
2081
- #content-container.mobile {
2082
- display: block;
2083
- }
2084
-
2085
- #right-column {
2086
- flex: 1;
2087
- position: relative;
2088
- min-height: 90vh;
2089
- border-right: 1px solid rgb(232, 232, 232);
2090
- margin-top: var(--rightColumnMarginTop, 0);
2091
- padding-top: var(--rightColumnPaddingTop, 2rem);
2092
- background: #fff;
2093
- }
2094
-
2095
- #left-column:not([hidden]) + #right-column {
2096
- border-left: 1px solid rgb(232, 232, 232);
2097
- }
2098
-
2099
- #right-column.smart-results-spacing {
2100
- padding-top: 0.5rem;
2101
- border-right: none;
2102
- background: transparent;
2103
- min-width: 0;
2104
- }
2105
-
2106
- #results {
2107
- background: #fff;
2108
- padding-left: 1rem;
2109
- padding-right: 1rem;
2110
- }
2111
-
2112
- #right-column.smart-results-spacing #results {
2113
- border-radius: 10px 10px 0px 0px;
2114
- padding-top: 0.5rem;
2115
- margin-top: 1rem;
2116
- }
2117
-
2118
- .mobile #right-column {
2119
- border-left: none;
2120
- }
2121
-
2122
- .mobile #results {
2123
- padding: 5px 5px 0;
2124
- }
2125
-
2126
- #left-column {
2127
- width: var(--leftColumnWidth, 18rem);
2128
- /* Prevents Safari from shrinking col at first draw */
2129
- min-width: var(--leftColumnWidth, 18rem);
2130
- padding-top: var(--leftColumnPaddingTop, 2rem);
2131
- /* Reduced padding by 0.2rem to add the invisible border in the rule below */
2132
- padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);
2133
- border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */
2134
- z-index: 1;
2135
- }
2136
-
2137
- .desktop #left-column {
2138
- top: 0;
2139
- position: sticky;
2140
- height: calc(100vh - 2rem);
2141
- max-height: calc(100vh - 2rem);
2142
- overflow-x: hidden;
2143
- overflow-y: scroll;
2144
-
2145
- /*
2146
- * Firefox doesn't support any of the -webkit-scrollbar stuff below, but
2147
- * does at least give us a tiny bit of control over width & color.
2148
- */
2149
- scrollbar-width: thin;
2150
- scrollbar-color: transparent transparent;
2151
- }
2152
- .desktop #left-column:hover {
2153
- scrollbar-color: auto;
2154
- }
2155
- .desktop #left-column::-webkit-scrollbar {
2156
- appearance: none;
2157
- width: 6px;
2158
- }
2159
- .desktop #left-column::-webkit-scrollbar-button {
2160
- height: 3px;
2161
- background: transparent;
2162
- }
2163
- .desktop #left-column::-webkit-scrollbar-corner {
2164
- background: transparent;
2165
- }
2166
- .desktop #left-column::-webkit-scrollbar-thumb {
2167
- border-radius: 4px;
2168
- }
2169
- .desktop #left-column:hover::-webkit-scrollbar-thumb {
2170
- background: rgba(0, 0, 0, 0.15);
2171
- }
2172
- .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {
2173
- background: rgba(0, 0, 0, 0.2);
2174
- }
2175
- .desktop #left-column:hover::-webkit-scrollbar-thumb:active {
2176
- background: rgba(0, 0, 0, 0.3);
2177
- }
2178
-
2179
- #facets-bottom-fade {
2180
- background: linear-gradient(
2181
- to bottom,
2182
- #fbfbfd00 0%,
2183
- #fbfbfdc0 50%,
2184
- #fbfbfd 80%,
2185
- #fbfbfd 100%
2186
- );
2187
- position: fixed;
2188
- bottom: 0;
2189
- height: 50px;
2190
- /* Wide enough to cover the content, but leave the scrollbar uncovered */
2191
- width: calc(
2192
- var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px
2193
- );
2194
- z-index: 2;
2195
- pointer-events: none;
2196
- transition: height 0.1s ease;
2197
- }
2198
- #facets-bottom-fade.hidden {
2199
- height: 0;
2200
- }
2201
-
2202
- .facets-message {
2203
- font-size: 1.4rem;
2204
- }
2205
-
2206
- .desktop-facets-dropdown > summary {
2207
- cursor: pointer;
2208
- list-style: none;
2209
- }
2210
-
2211
- .desktop-facets-dropdown h2 {
2212
- display: inline-block;
2213
- margin: 0;
2214
- font-size: 1.6rem;
2215
- }
2216
-
2217
- .desktop-facets-dropdown[open] > summary {
2218
- margin-bottom: 10px;
2219
- }
2220
-
2221
- .desktop-facets-dropdown[open] svg {
2222
- transform: rotate(90deg);
2223
- }
2224
-
2225
- .desktop #left-column-scroll-sentinel {
2226
- width: 1px;
2227
- height: 100vh;
2228
- background: transparent;
2229
- }
2230
-
2231
- .desktop #facets-scroll-sentinel {
2232
- width: 1px;
2233
- height: 1px;
2234
- background: transparent;
2235
- }
2236
-
2237
- #facets-header-container {
2238
- display: flex;
2239
- justify-content: space-between;
2240
- align-items: flex-start;
2241
- clear: both;
2242
- }
2243
-
2244
- .desktop #facets-header-container {
2245
- flex-wrap: wrap;
2246
- }
2247
-
2248
- .mobile #left-column {
2249
- width: 100%;
2250
- min-width: 0;
2251
- padding: 5px 0;
2252
- border: 0;
2253
- }
2254
-
2255
- .clear-filters-btn-row {
2256
- display: inline-block;
2257
- }
2258
-
2259
- .desktop .clear-filters-btn-row {
2260
- width: 100%;
2261
- }
2262
-
2263
- .clear-filters-btn {
2264
- display: inline-block;
2265
- appearance: none;
2266
- margin: 0;
2267
- padding: 0;
2268
- border: 0;
2269
- background: none;
2270
- color: var(--ia-theme-link-color);
2271
- font-size: 1.4rem;
2272
- font-family: inherit;
2273
- cursor: pointer;
2274
- }
2275
-
2276
- .clear-filters-btn:hover {
2277
- text-decoration: underline;
2278
- }
2279
-
2280
- .clear-filters-btn-separator {
2281
- display: inline-block;
2282
- margin-left: 5px;
2283
- border-left: 1px solid #2c2c2c;
2284
- font-size: 1.4rem;
2285
- line-height: 1.3rem;
2286
- }
2287
-
2288
- #tv-filters {
2289
- margin-bottom: 15px;
2290
- }
2291
-
2292
- #tv-shows {
2293
- --comboBoxListWidth: 300px;
2294
- }
2295
-
2296
- .tv-filter-dropdown {
2297
- display: block;
2298
- font-size: 14px;
2299
- margin-left: 1px;
2300
- margin-bottom: 5px;
2301
- }
2302
-
2303
- .tv-filter-dropdown::part(combo-box) {
2304
- outline-offset: 1px;
2305
- }
2306
-
2307
- .tv-filter-dropdown::part(option) {
2308
- line-height: 1.1;
2309
- padding: 7px;
2310
- }
2311
-
2312
- .tv-filter-dropdown::part(clear-button) {
2313
- flex: 0 0 26px;
2314
- --combo-box-clear-icon-size: 14px;
2315
- }
2316
-
2317
- .tv-filter-dropdown::part(icon) {
2318
- width: 1.4rem;
2319
- height: 1.4rem;
2320
- }
2321
-
2322
- #facets-container {
2323
- position: relative;
2324
- max-height: 0;
2325
- transition: max-height 0.2s ease-in-out;
2326
- z-index: 1;
2327
- margin-top: var(--facetsContainerMarginTop, 3rem);
2328
- padding-bottom: 2rem;
2329
- }
2330
-
2331
- .desktop #facets-container {
2332
- width: 18rem;
2333
- }
2334
-
2335
- .mobile #facets-container {
2336
- overflow: hidden;
2337
- padding-bottom: 0;
2338
- padding-left: 10px;
2339
- padding-right: 10px;
2340
- }
2341
-
2342
- #facets-container.expanded {
2343
- max-height: 2000px;
2344
- }
2345
-
2346
- .results-section-heading {
2347
- margin: 0.5rem 0.3rem;
2348
- font-size: 2rem;
2349
- line-height: 25px;
2350
- }
2351
-
2352
- #results-total {
2353
- display: flex;
2354
- align-items: baseline;
2355
- }
2356
-
2357
- #results-total:not(.filtered) {
2358
- padding-bottom: 2rem;
2359
- }
2360
-
2361
- .mobile #results-total {
2362
- position: absolute;
2363
- right: 10px;
2364
- }
2365
-
2366
- #big-results-count {
2367
- font-size: 2.4rem;
2368
- font-weight: 500;
2369
- margin-right: 5px;
2370
- }
2371
-
2372
- .mobile #big-results-count {
2373
- font-size: 2rem;
2374
- }
2375
-
2376
- #big-results-label {
2377
- font-size: 1.4rem;
2378
- font-weight: 200;
2379
- }
2380
-
2381
- #list-header {
2382
- max-height: 4.2rem;
2383
- }
2384
-
2385
- .loading-cover {
2386
- position: absolute;
2387
- top: 0;
2388
- left: 0;
2389
- width: 100%;
2390
- height: 100%;
2391
- display: flex;
2392
- justify-content: center;
2393
- z-index: 1;
2394
- padding-top: 50px;
2395
- }
2396
-
2397
- #tile-blur-label {
2398
- display: flex;
2399
- align-items: center;
2400
- column-gap: 5px;
2401
- }
2402
-
2403
- #tile-blur-check {
2404
- margin: 0 5px 0 0;
2405
- width: 15px;
2406
- }
2407
-
2408
- circular-activity-indicator {
2409
- width: 30px;
2410
- height: 30px;
2411
- }
2412
-
2413
- sort-filter-bar {
2414
- display: block;
2415
- margin-bottom: 4rem;
2416
- }
2417
-
2418
- infinite-scroller {
2419
- display: block;
2420
- --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);
2421
- --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);
2422
- }
2423
-
2424
- infinite-scroller.list-compact {
2425
- --infiniteScrollerCellMinWidth: var(
2426
- --collectionBrowserCellMinWidth,
2427
- 100%
2428
- );
2429
- --infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */
2430
- --infiniteScrollerCellMaxHeight: 56px;
2431
- --infiniteScrollerRowGap: 10px;
2432
- }
2433
-
2434
- infinite-scroller.list-detail {
2435
- --infiniteScrollerCellMinWidth: var(
2436
- --collectionBrowserCellMinWidth,
2437
- 100%
2438
- );
2439
- --infiniteScrollerCellMinHeight: var(
2440
- --collectionBrowserCellMinHeight,
2441
- 5rem
2442
- );
2443
- /*
2444
- 30px in spec, compensating for a -4px margin
2445
- to align title with top of item image
2446
- src/tiles/list/tile-list.ts
2447
- */
2448
- --infiniteScrollerRowGap: 34px;
2449
- }
2450
-
2451
- .mobile infinite-scroller.list-detail {
2452
- --infiniteScrollerRowGap: 24px;
2453
- }
2454
-
2455
- infinite-scroller.grid {
2456
- --infiniteScrollerCellMinWidth: var(
2457
- --collectionBrowserCellMinWidth,
2458
- 17rem
2459
- );
2460
- --infiniteScrollerCellMaxWidth: var(
2461
- --collectionBrowserCellMaxWidth,
2462
- 1fr
2463
- );
2464
- }
2465
-
2466
- /* Allow tiles to shrink a bit further at smaller viewport widths */
2467
- @media screen and (max-width: 880px) {
2468
- infinite-scroller.grid {
2469
- --infiniteScrollerCellMinWidth: var(
2470
- --collectionBrowserCellMinWidth,
2471
- 15rem
2472
- );
2473
- }
2474
- }
2475
- /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */
2476
- @media screen and (max-width: 360px) {
2477
- infinite-scroller.grid {
2478
- --infiniteScrollerCellMinWidth: var(
2479
- --collectionBrowserCellMinWidth,
2480
- 12rem
2481
- );
2482
- }
2483
- }
2484
-
2485
- infinite-scroller.hidden {
2486
- display: none;
2487
- }
2040
+ css `
2041
+ :host {
2042
+ display: block;
2043
+ --leftColumnWidth: 18rem;
2044
+ --leftColumnPaddingTop: 2rem;
2045
+ --leftColumnPaddingRight: 2.5rem;
2046
+ }
2047
+
2048
+ #facet-top-view {
2049
+ display: flex;
2050
+ }
2051
+
2052
+ /**
2053
+ * When page width resizes from desktop to mobile, use this class to
2054
+ * disable expand/collapse transition when loading.
2055
+ */
2056
+ .preload * {
2057
+ transition: none !important;
2058
+ -webkit-transition: none !important;
2059
+ -moz-transition: none !important;
2060
+ -ms-transition: none !important;
2061
+ -o-transition: none !important;
2062
+ }
2063
+
2064
+ #content-container {
2065
+ display: flex;
2066
+ }
2067
+
2068
+ empty-placeholder {
2069
+ margin-top: var(--placeholderMarginTop, 0);
2070
+ }
2071
+
2072
+ .collapser-icon {
2073
+ display: inline-block;
2074
+ }
2075
+
2076
+ .collapser-icon svg {
2077
+ display: inline-block;
2078
+ width: 12px;
2079
+ height: 12px;
2080
+ transition: transform 0.2s ease-out;
2081
+ }
2082
+
2083
+ #mobile-filter-collapse {
2084
+ width: 100%;
2085
+ }
2086
+
2087
+ #mobile-filter-collapse > summary {
2088
+ cursor: pointer;
2089
+ list-style: none;
2090
+ }
2091
+
2092
+ #mobile-filter-collapse[open] > summary {
2093
+ margin-bottom: 10px;
2094
+ }
2095
+
2096
+ #mobile-filter-collapse h2 {
2097
+ display: inline-block;
2098
+ margin: 0;
2099
+ font-size: 2rem;
2100
+ }
2101
+
2102
+ #mobile-filter-collapse[open] svg {
2103
+ transform: rotate(90deg);
2104
+ }
2105
+
2106
+ #content-container.mobile {
2107
+ display: block;
2108
+ }
2109
+
2110
+ #right-column {
2111
+ flex: 1;
2112
+ position: relative;
2113
+ min-height: 90vh;
2114
+ border-right: 1px solid rgb(232, 232, 232);
2115
+ margin-top: var(--rightColumnMarginTop, 0);
2116
+ padding-top: var(--rightColumnPaddingTop, 2rem);
2117
+ background: #fff;
2118
+ }
2119
+
2120
+ #left-column:not([hidden]) + #right-column {
2121
+ border-left: 1px solid rgb(232, 232, 232);
2122
+ }
2123
+
2124
+ #right-column.smart-results-spacing {
2125
+ padding-top: 0.5rem;
2126
+ border-right: none;
2127
+ background: transparent;
2128
+ min-width: 0;
2129
+ }
2130
+
2131
+ #results {
2132
+ background: #fff;
2133
+ padding-left: 1rem;
2134
+ padding-right: 1rem;
2135
+ }
2136
+
2137
+ #right-column.smart-results-spacing #results {
2138
+ border-radius: 10px 10px 0px 0px;
2139
+ padding-top: 0.5rem;
2140
+ margin-top: 1rem;
2141
+ }
2142
+
2143
+ .mobile #right-column {
2144
+ border-left: none;
2145
+ }
2146
+
2147
+ .mobile #results {
2148
+ padding: 5px 5px 0;
2149
+ }
2150
+
2151
+ #left-column {
2152
+ width: var(--leftColumnWidth, 18rem);
2153
+ /* Prevents Safari from shrinking col at first draw */
2154
+ min-width: var(--leftColumnWidth, 18rem);
2155
+ padding-top: var(--leftColumnPaddingTop, 2rem);
2156
+ /* Reduced padding by 0.2rem to add the invisible border in the rule below */
2157
+ padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);
2158
+ border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */
2159
+ z-index: 1;
2160
+ }
2161
+
2162
+ .desktop #left-column {
2163
+ top: 0;
2164
+ position: sticky;
2165
+ height: calc(100vh - 2rem);
2166
+ max-height: calc(100vh - 2rem);
2167
+ overflow-x: hidden;
2168
+ overflow-y: scroll;
2169
+
2170
+ /*
2171
+ * Firefox doesn't support any of the -webkit-scrollbar stuff below, but
2172
+ * does at least give us a tiny bit of control over width & color.
2173
+ */
2174
+ scrollbar-width: thin;
2175
+ scrollbar-color: transparent transparent;
2176
+ }
2177
+ .desktop #left-column:hover {
2178
+ scrollbar-color: auto;
2179
+ }
2180
+ .desktop #left-column::-webkit-scrollbar {
2181
+ appearance: none;
2182
+ width: 6px;
2183
+ }
2184
+ .desktop #left-column::-webkit-scrollbar-button {
2185
+ height: 3px;
2186
+ background: transparent;
2187
+ }
2188
+ .desktop #left-column::-webkit-scrollbar-corner {
2189
+ background: transparent;
2190
+ }
2191
+ .desktop #left-column::-webkit-scrollbar-thumb {
2192
+ border-radius: 4px;
2193
+ }
2194
+ .desktop #left-column:hover::-webkit-scrollbar-thumb {
2195
+ background: rgba(0, 0, 0, 0.15);
2196
+ }
2197
+ .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {
2198
+ background: rgba(0, 0, 0, 0.2);
2199
+ }
2200
+ .desktop #left-column:hover::-webkit-scrollbar-thumb:active {
2201
+ background: rgba(0, 0, 0, 0.3);
2202
+ }
2203
+
2204
+ #facets-bottom-fade {
2205
+ background: linear-gradient(
2206
+ to bottom,
2207
+ #fbfbfd00 0%,
2208
+ #fbfbfdc0 50%,
2209
+ #fbfbfd 80%,
2210
+ #fbfbfd 100%
2211
+ );
2212
+ position: fixed;
2213
+ bottom: 0;
2214
+ height: 50px;
2215
+ /* Wide enough to cover the content, but leave the scrollbar uncovered */
2216
+ width: calc(
2217
+ var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px
2218
+ );
2219
+ z-index: 2;
2220
+ pointer-events: none;
2221
+ transition: height 0.1s ease;
2222
+ }
2223
+ #facets-bottom-fade.hidden {
2224
+ height: 0;
2225
+ }
2226
+
2227
+ .facets-message {
2228
+ font-size: 1.4rem;
2229
+ }
2230
+
2231
+ .desktop-facets-dropdown > summary {
2232
+ cursor: pointer;
2233
+ list-style: none;
2234
+ }
2235
+
2236
+ .desktop-facets-dropdown h2 {
2237
+ display: inline-block;
2238
+ margin: 0;
2239
+ font-size: 1.6rem;
2240
+ }
2241
+
2242
+ .desktop-facets-dropdown[open] > summary {
2243
+ margin-bottom: 10px;
2244
+ }
2245
+
2246
+ .desktop-facets-dropdown[open] svg {
2247
+ transform: rotate(90deg);
2248
+ }
2249
+
2250
+ .desktop #left-column-scroll-sentinel {
2251
+ width: 1px;
2252
+ height: 100vh;
2253
+ background: transparent;
2254
+ }
2255
+
2256
+ .desktop #facets-scroll-sentinel {
2257
+ width: 1px;
2258
+ height: 1px;
2259
+ background: transparent;
2260
+ }
2261
+
2262
+ #facets-header-container {
2263
+ display: flex;
2264
+ justify-content: space-between;
2265
+ align-items: flex-start;
2266
+ clear: both;
2267
+ }
2268
+
2269
+ .desktop #facets-header-container {
2270
+ flex-wrap: wrap;
2271
+ }
2272
+
2273
+ .mobile #left-column {
2274
+ width: 100%;
2275
+ min-width: 0;
2276
+ padding: 5px 0;
2277
+ border: 0;
2278
+ }
2279
+
2280
+ .clear-filters-btn-row {
2281
+ display: inline-block;
2282
+ }
2283
+
2284
+ .desktop .clear-filters-btn-row {
2285
+ width: 100%;
2286
+ }
2287
+
2288
+ .clear-filters-btn {
2289
+ display: inline-block;
2290
+ appearance: none;
2291
+ margin: 0;
2292
+ padding: 0;
2293
+ border: 0;
2294
+ background: none;
2295
+ color: var(--ia-theme-link-color);
2296
+ font-size: 1.4rem;
2297
+ font-family: inherit;
2298
+ cursor: pointer;
2299
+ }
2300
+
2301
+ .clear-filters-btn:hover {
2302
+ text-decoration: underline;
2303
+ }
2304
+
2305
+ .clear-filters-btn-separator {
2306
+ display: inline-block;
2307
+ margin-left: 5px;
2308
+ border-left: 1px solid #2c2c2c;
2309
+ font-size: 1.4rem;
2310
+ line-height: 1.3rem;
2311
+ }
2312
+
2313
+ #tv-filters {
2314
+ margin-bottom: 15px;
2315
+ }
2316
+
2317
+ #tv-shows {
2318
+ --comboBoxListWidth: 300px;
2319
+ }
2320
+
2321
+ .tv-filter-dropdown {
2322
+ display: block;
2323
+ font-size: 14px;
2324
+ margin-left: 1px;
2325
+ margin-bottom: 5px;
2326
+ }
2327
+
2328
+ .tv-filter-dropdown::part(combo-box) {
2329
+ outline-offset: 1px;
2330
+ }
2331
+
2332
+ .tv-filter-dropdown::part(option) {
2333
+ line-height: 1.1;
2334
+ padding: 7px;
2335
+ }
2336
+
2337
+ .tv-filter-dropdown::part(clear-button) {
2338
+ flex: 0 0 26px;
2339
+ --combo-box-clear-icon-size: 14px;
2340
+ }
2341
+
2342
+ .tv-filter-dropdown::part(icon) {
2343
+ width: 1.4rem;
2344
+ height: 1.4rem;
2345
+ }
2346
+
2347
+ #facets-container {
2348
+ position: relative;
2349
+ max-height: 0;
2350
+ transition: max-height 0.2s ease-in-out;
2351
+ z-index: 1;
2352
+ margin-top: var(--facetsContainerMarginTop, 3rem);
2353
+ padding-bottom: 2rem;
2354
+ }
2355
+
2356
+ .desktop #facets-container {
2357
+ width: 18rem;
2358
+ }
2359
+
2360
+ .mobile #facets-container {
2361
+ overflow: hidden;
2362
+ padding-bottom: 0;
2363
+ padding-left: 10px;
2364
+ padding-right: 10px;
2365
+ }
2366
+
2367
+ #facets-container.expanded {
2368
+ max-height: 2000px;
2369
+ }
2370
+
2371
+ .results-section-heading {
2372
+ margin: 0.5rem 0.3rem;
2373
+ font-size: 2rem;
2374
+ line-height: 25px;
2375
+ }
2376
+
2377
+ #results-total {
2378
+ display: flex;
2379
+ align-items: baseline;
2380
+ }
2381
+
2382
+ #results-total:not(.filtered) {
2383
+ padding-bottom: 2rem;
2384
+ }
2385
+
2386
+ .mobile #results-total {
2387
+ position: absolute;
2388
+ right: 10px;
2389
+ }
2390
+
2391
+ #big-results-count {
2392
+ font-size: 2.4rem;
2393
+ font-weight: 500;
2394
+ margin-right: 5px;
2395
+ }
2396
+
2397
+ .mobile #big-results-count {
2398
+ font-size: 2rem;
2399
+ }
2400
+
2401
+ #big-results-label {
2402
+ font-size: 1.4rem;
2403
+ font-weight: 200;
2404
+ }
2405
+
2406
+ #list-header {
2407
+ max-height: 4.2rem;
2408
+ }
2409
+
2410
+ .loading-cover {
2411
+ position: absolute;
2412
+ top: 0;
2413
+ left: 0;
2414
+ width: 100%;
2415
+ height: 100%;
2416
+ display: flex;
2417
+ justify-content: center;
2418
+ z-index: 1;
2419
+ padding-top: 50px;
2420
+ }
2421
+
2422
+ #tile-blur-label {
2423
+ display: flex;
2424
+ align-items: center;
2425
+ column-gap: 5px;
2426
+ }
2427
+
2428
+ #tile-blur-check {
2429
+ margin: 0 5px 0 0;
2430
+ width: 15px;
2431
+ }
2432
+
2433
+ circular-activity-indicator {
2434
+ width: 30px;
2435
+ height: 30px;
2436
+ }
2437
+
2438
+ sort-filter-bar {
2439
+ display: block;
2440
+ margin-bottom: 4rem;
2441
+ }
2442
+
2443
+ infinite-scroller {
2444
+ display: block;
2445
+ --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);
2446
+ --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);
2447
+ }
2448
+
2449
+ infinite-scroller.list-compact {
2450
+ --infiniteScrollerCellMinWidth: var(
2451
+ --collectionBrowserCellMinWidth,
2452
+ 100%
2453
+ );
2454
+ --infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */
2455
+ --infiniteScrollerCellMaxHeight: 56px;
2456
+ --infiniteScrollerRowGap: 10px;
2457
+ }
2458
+
2459
+ infinite-scroller.list-detail {
2460
+ --infiniteScrollerCellMinWidth: var(
2461
+ --collectionBrowserCellMinWidth,
2462
+ 100%
2463
+ );
2464
+ --infiniteScrollerCellMinHeight: var(
2465
+ --collectionBrowserCellMinHeight,
2466
+ 5rem
2467
+ );
2468
+ /*
2469
+ 30px in spec, compensating for a -4px margin
2470
+ to align title with top of item image
2471
+ src/tiles/list/tile-list.ts
2472
+ */
2473
+ --infiniteScrollerRowGap: 34px;
2474
+ }
2475
+
2476
+ .mobile infinite-scroller.list-detail {
2477
+ --infiniteScrollerRowGap: 24px;
2478
+ }
2479
+
2480
+ infinite-scroller.grid {
2481
+ --infiniteScrollerCellMinWidth: var(
2482
+ --collectionBrowserCellMinWidth,
2483
+ 17rem
2484
+ );
2485
+ --infiniteScrollerCellMaxWidth: var(
2486
+ --collectionBrowserCellMaxWidth,
2487
+ 1fr
2488
+ );
2489
+ }
2490
+
2491
+ /* Allow tiles to shrink a bit further at smaller viewport widths */
2492
+ @media screen and (max-width: 880px) {
2493
+ infinite-scroller.grid {
2494
+ --infiniteScrollerCellMinWidth: var(
2495
+ --collectionBrowserCellMinWidth,
2496
+ 15rem
2497
+ );
2498
+ }
2499
+ }
2500
+ /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */
2501
+ @media screen and (max-width: 360px) {
2502
+ infinite-scroller.grid {
2503
+ --infiniteScrollerCellMinWidth: var(
2504
+ --collectionBrowserCellMinWidth,
2505
+ 12rem
2506
+ );
2507
+ }
2508
+ }
2509
+
2510
+ infinite-scroller.hidden {
2511
+ display: none;
2512
+ }
2488
2513
  `,
2489
2514
  ];
2490
2515
  }