@internetarchive/collection-browser 3.3.1 → 3.3.3

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 (84) 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/collection-browser.js +683 -683
  11. package/dist/src/collection-browser.js.map +1 -1
  12. package/dist/src/collection-facets/more-facets-content.js +118 -118
  13. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  14. package/dist/src/collection-facets.js +265 -266
  15. package/dist/src/collection-facets.js.map +1 -1
  16. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  17. package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
  18. package/dist/src/data-source/models.js.map +1 -1
  19. package/dist/src/tiles/base-tile-component.js.map +1 -1
  20. package/dist/src/tiles/grid/account-tile.js +36 -36
  21. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  22. package/dist/src/tiles/grid/collection-tile.js +77 -77
  23. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  24. package/dist/src/tiles/grid/item-tile.js +137 -137
  25. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  26. package/dist/src/tiles/hover/hover-pane-controller.d.ts +9 -1
  27. package/dist/src/tiles/hover/hover-pane-controller.js +105 -37
  28. package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
  29. package/dist/src/tiles/hover/tile-hover-pane.d.ts +1 -0
  30. package/dist/src/tiles/hover/tile-hover-pane.js +115 -112
  31. package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
  32. package/dist/src/tiles/list/tile-list-compact.js +99 -99
  33. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  34. package/dist/src/tiles/list/tile-list.js +297 -297
  35. package/dist/src/tiles/list/tile-list.js.map +1 -1
  36. package/dist/src/tiles/tile-dispatcher.d.ts +4 -1
  37. package/dist/src/tiles/tile-dispatcher.js +231 -204
  38. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  39. package/dist/src/utils/format-date.js.map +1 -1
  40. package/dist/test/collection-browser.test.js +189 -189
  41. package/dist/test/collection-browser.test.js.map +1 -1
  42. package/dist/test/tiles/grid/item-tile.test.js +77 -77
  43. package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
  44. package/dist/test/tiles/hover/hover-pane-controller.test.js +68 -21
  45. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
  46. package/dist/test/tiles/list/tile-list-compact.test.js +70 -70
  47. package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
  48. package/dist/test/tiles/list/tile-list.test.js +126 -126
  49. package/dist/test/tiles/list/tile-list.test.js.map +1 -1
  50. package/dist/test/tiles/tile-dispatcher.test.js +130 -52
  51. package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
  52. package/dist/test/utils/format-date.test.js.map +1 -1
  53. package/eslint.config.mjs +53 -53
  54. package/index.html +24 -24
  55. package/local.archive.org.cert +86 -86
  56. package/local.archive.org.key +27 -27
  57. package/package.json +118 -117
  58. package/renovate.json +6 -6
  59. package/src/collection-browser.ts +2829 -2829
  60. package/src/collection-facets/more-facets-content.ts +639 -639
  61. package/src/collection-facets.ts +994 -995
  62. package/src/data-source/collection-browser-data-source.ts +1401 -1401
  63. package/src/data-source/collection-browser-query-state.ts +65 -65
  64. package/src/data-source/models.ts +43 -43
  65. package/src/tiles/base-tile-component.ts +65 -65
  66. package/src/tiles/grid/account-tile.ts +113 -113
  67. package/src/tiles/grid/collection-tile.ts +163 -163
  68. package/src/tiles/grid/item-tile.ts +340 -340
  69. package/src/tiles/hover/hover-pane-controller.ts +613 -517
  70. package/src/tiles/hover/tile-hover-pane.ts +184 -180
  71. package/src/tiles/list/tile-list-compact.ts +239 -239
  72. package/src/tiles/list/tile-list.ts +700 -700
  73. package/src/tiles/tile-dispatcher.ts +517 -490
  74. package/src/utils/format-date.ts +62 -62
  75. package/test/collection-browser.test.ts +2403 -2403
  76. package/test/tiles/grid/item-tile.test.ts +520 -520
  77. package/test/tiles/hover/hover-pane-controller.test.ts +418 -353
  78. package/test/tiles/list/tile-list-compact.test.ts +282 -282
  79. package/test/tiles/list/tile-list.test.ts +552 -552
  80. package/test/tiles/tile-dispatcher.test.ts +283 -187
  81. package/test/utils/format-date.test.ts +89 -89
  82. package/tsconfig.json +20 -20
  83. package/web-dev-server.config.mjs +30 -30
  84. package/web-test-runner.config.mjs +41 -41
@@ -358,32 +358,32 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
358
358
  this.setPlaceholderType();
359
359
  }
360
360
  render() {
361
- return html `
361
+ return html `
362
362
  ${this.showSmartFacetBar && this.placeholderType === null
363
- ? html `<smart-facet-bar
364
- .query=${this.baseQuery}
365
- .aggregations=${this.dataSource.aggregations}
366
- .selectedFacets=${this.selectedFacets}
367
- .collectionTitles=${this.dataSource.collectionTitles}
368
- .filterToggleShown=${!this.mobileView}
369
- .filterToggleActive=${this.facetPaneVisible}
370
- .label=${this.smartFacetBarLabel}
371
- @facetsChanged=${this.facetsChanged}
363
+ ? html `<smart-facet-bar
364
+ .query=${this.baseQuery}
365
+ .aggregations=${this.dataSource.aggregations}
366
+ .selectedFacets=${this.selectedFacets}
367
+ .collectionTitles=${this.dataSource.collectionTitles}
368
+ .filterToggleShown=${!this.mobileView}
369
+ .filterToggleActive=${this.facetPaneVisible}
370
+ .label=${this.smartFacetBarLabel}
371
+ @facetsChanged=${this.facetsChanged}
372
372
  @filtersToggled=${() => {
373
373
  this.facetPaneVisible = !this.facetPaneVisible;
374
374
  this.emitFacetPaneVisibilityChanged();
375
- }}
375
+ }}
376
376
  ></smart-facet-bar>`
377
- : nothing}
378
-
379
- <div
380
- id="content-container"
381
- class=${this.mobileView ? 'mobile' : 'desktop'}
382
- >
377
+ : nothing}
378
+
379
+ <div
380
+ id="content-container"
381
+ class=${this.mobileView ? 'mobile' : 'desktop'}
382
+ >
383
383
  ${this.placeholderType
384
384
  ? this.emptyPlaceholderTemplate
385
- : this.collectionBrowserTemplate}
386
- </div>
385
+ : this.collectionBrowserTemplate}
386
+ </div>
387
387
  `;
388
388
  }
389
389
  /**
@@ -429,23 +429,23 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
429
429
  */
430
430
  get emptyPlaceholderTemplate() {
431
431
  var _a;
432
- return html `
433
- <empty-placeholder
434
- .placeholderType=${this.placeholderType}
435
- ?isMobileView=${this.mobileView}
436
- ?isCollection=${!!this.withinCollection}
437
- .detailMessage=${(_a = this.dataSource.queryErrorMessage) !== null && _a !== void 0 ? _a : ''}
438
- .baseNavigationUrl=${this.baseNavigationUrl}
439
- ></empty-placeholder>
432
+ return html `
433
+ <empty-placeholder
434
+ .placeholderType=${this.placeholderType}
435
+ ?isMobileView=${this.mobileView}
436
+ ?isCollection=${!!this.withinCollection}
437
+ .detailMessage=${(_a = this.dataSource.queryErrorMessage) !== null && _a !== void 0 ? _a : ''}
438
+ .baseNavigationUrl=${this.baseNavigationUrl}
439
+ ></empty-placeholder>
440
440
  `;
441
441
  }
442
442
  /**
443
443
  * Top-level template for rendering the left (facets) and right (results) columns.
444
444
  */
445
445
  get collectionBrowserTemplate() {
446
- return html `
447
- <div id="left-column-scroll-sentinel"></div>
448
- ${this.leftColumnTemplate} ${this.rightColumnTemplate}
446
+ return html `
447
+ <div id="left-column-scroll-sentinel"></div>
448
+ ${this.leftColumnTemplate} ${this.rightColumnTemplate}
449
449
  `;
450
450
  }
451
451
  /**
@@ -464,33 +464,33 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
464
464
  * accordion-style facets.
465
465
  */
466
466
  get mobileLeftColumnTemplate() {
467
- return html `
468
- <div
469
- id="left-column"
470
- class="column${this.isResizeToMobile ? ' preload' : ''}"
471
- >
472
- ${this.facetTopViewSlot} ${this.resultsCountTemplate}
473
- <div id="facets-header-container">${this.mobileFacetsTemplate}</div>
474
- </div>
467
+ return html `
468
+ <div
469
+ id="left-column"
470
+ class="column${this.isResizeToMobile ? ' preload' : ''}"
471
+ >
472
+ ${this.facetTopViewSlot} ${this.resultsCountTemplate}
473
+ <div id="facets-header-container">${this.mobileFacetsTemplate}</div>
474
+ </div>
475
475
  `;
476
476
  }
477
477
  /**
478
478
  * Template for the desktop version of the left column, displaying the facets sidebar.
479
479
  */
480
480
  get desktopLeftColumnTemplate() {
481
- return html `
482
- <div id="left-column" class="column" ?hidden=${!this.facetPaneVisible}>
483
- ${this.facetTopViewSlot}
484
- <div id="facets-header-container">
485
- <h2 id="facets-header" class="sr-only">${msg('Filters')}</h2>
486
- ${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(false)}
487
- </div>
488
- <div id="facets-container" aria-labelledby="facets-header">
489
- ${this.facetsTemplate}
490
- <div id="facets-scroll-sentinel"></div>
491
- </div>
492
- <div id="facets-bottom-fade"></div>
493
- </div>
481
+ return html `
482
+ <div id="left-column" class="column" ?hidden=${!this.facetPaneVisible}>
483
+ ${this.facetTopViewSlot}
484
+ <div id="facets-header-container">
485
+ <h2 id="facets-header" class="sr-only">${msg('Filters')}</h2>
486
+ ${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(false)}
487
+ </div>
488
+ <div id="facets-container" aria-labelledby="facets-header">
489
+ ${this.facetsTemplate}
490
+ <div id="facets-scroll-sentinel"></div>
491
+ </div>
492
+ <div id="facets-bottom-fade"></div>
493
+ </div>
494
494
  `;
495
495
  }
496
496
  /**
@@ -498,8 +498,8 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
498
498
  * - mainly used to render userlists
499
499
  */
500
500
  get facetTopViewSlot() {
501
- return html `<div id="facet-top-view">
502
- <slot name="facet-top-slot"></slot>
501
+ return html `<div id="facet-top-view">
502
+ <slot name="facet-top-slot"></slot>
503
503
  </div>`;
504
504
  }
505
505
  /**
@@ -514,15 +514,15 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
514
514
  const resultsCount = (_a = this.totalResults) === null || _a === void 0 ? void 0 : _a.toLocaleString();
515
515
  const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';
516
516
  // Added data-testid for Playwright testing
517
- return html `
518
- <div id="results-total" data-testid="results-total">
519
- <span id="big-results-count">
520
- ${shouldShowSearching ? html `Searching&hellip;` : resultsCount}
521
- </span>
522
- <span id="big-results-label">
523
- ${shouldShowSearching ? nothing : resultsLabel}
524
- </span>
525
- </div>
517
+ return html `
518
+ <div id="results-total" data-testid="results-total">
519
+ <span id="big-results-count">
520
+ ${shouldShowSearching ? html `Searching&hellip;` : resultsCount}
521
+ </span>
522
+ <span id="big-results-label">
523
+ ${shouldShowSearching ? nothing : resultsLabel}
524
+ </span>
525
+ </div>
526
526
  `;
527
527
  }
528
528
  /**
@@ -535,45 +535,45 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
535
535
  'full-width': !this.facetPaneVisible,
536
536
  'smart-results-spacing': !!this.showSmartResults,
537
537
  });
538
- return html `
539
- <div id="right-column" class=${rightColumnClasses}>
538
+ return html `
539
+ <div id="right-column" class=${rightColumnClasses}>
540
540
  ${this.showSmartResults
541
541
  ? html `<slot name="smart-results"></slot>`
542
- : nothing}
543
- <section id="results">
544
- <h2 class="results-section-heading">
545
- <slot name="results-heading"></slot>
546
- </h2>
547
- <div id="cb-top-view">
548
- <slot name="cb-top-slot"></slot>
549
- </div>
542
+ : nothing}
543
+ <section id="results">
544
+ <h2 class="results-section-heading">
545
+ <slot name="results-heading"></slot>
546
+ </h2>
547
+ <div id="cb-top-view">
548
+ <slot name="cb-top-slot"></slot>
549
+ </div>
550
550
  ${this.isManageView
551
551
  ? this.manageBarTemplate
552
- : this.sortFilterBarTemplate}
553
- <slot name="cb-results"></slot>
552
+ : this.sortFilterBarTemplate}
553
+ <slot name="cb-results"></slot>
554
554
  ${this.displayMode === `list-compact` && this.totalResults
555
555
  ? this.listHeaderTemplate
556
- : nothing}
557
- ${this.suppressResultTiles ? nothing : this.infiniteScrollerTemplate}
558
- </section>
559
- </div>
556
+ : nothing}
557
+ ${this.suppressResultTiles ? nothing : this.infiniteScrollerTemplate}
558
+ </section>
559
+ </div>
560
560
  `;
561
561
  }
562
562
  /**
563
563
  * Template for the infinite scroller widget that contains the result tiles.
564
564
  */
565
565
  get infiniteScrollerTemplate() {
566
- return html `<infinite-scroller
567
- class=${this.infiniteScrollerClasses}
568
- itemCount=${this.placeholderType ? 0 : nothing}
569
- ariaLandmarkLabel="Search results"
570
- .cellProvider=${this}
571
- .placeholderCellTemplate=${this.placeholderCellTemplate}
572
- @scrollThresholdReached=${this.scrollThresholdReached}
573
- @visibleCellsChanged=${this.visibleCellsChanged}
566
+ return html `<infinite-scroller
567
+ class=${this.infiniteScrollerClasses}
568
+ itemCount=${this.placeholderType ? 0 : nothing}
569
+ ariaLandmarkLabel="Search results"
570
+ .cellProvider=${this}
571
+ .placeholderCellTemplate=${this.placeholderCellTemplate}
572
+ @scrollThresholdReached=${this.scrollThresholdReached}
573
+ @visibleCellsChanged=${this.visibleCellsChanged}
574
574
  >${this.displayMode === 'grid'
575
575
  ? html `<slot name="result-last-tile" slot="result-last-tile"></slot>`
576
- : nothing}
576
+ : nothing}
577
577
  </infinite-scroller>`;
578
578
  }
579
579
  /**
@@ -614,32 +614,32 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
614
614
  }
615
615
  // We only show relevance sort if a search query is currently defined
616
616
  sortFieldAvailability.relevance = this.isRelevanceSortAvailable;
617
- return html `
618
- <sort-filter-bar
619
- .defaultSortField=${this.defaultSortField}
620
- .defaultSortDirection=${this.defaultSortDirection}
621
- .defaultViewSort=${defaultViewSort}
622
- .defaultDateSort=${defaultDateSort}
623
- .selectedSort=${this.selectedSort}
624
- .sortDirection=${this.sortDirection}
625
- .sortFieldAvailability=${sortFieldAvailability}
626
- .displayMode=${this.displayMode}
627
- .selectedTitleFilter=${this.selectedTitleFilter}
628
- .selectedCreatorFilter=${this.selectedCreatorFilter}
629
- .prefixFilterCountMap=${this.dataSource.prefixFilterCountMap}
630
- .resizeObserver=${this.resizeObserver}
631
- .enableSortOptionsSlot=${this.enableSortOptionsSlot}
632
- .suppressDisplayModes=${this.suppressDisplayModes}
633
- @sortChanged=${this.userChangedSort}
634
- @displayModeChanged=${this.displayModeChanged}
635
- @titleLetterChanged=${this.titleLetterSelected}
636
- @creatorLetterChanged=${this.creatorLetterSelected}
637
- >
638
- ${this.tileBlurCheckboxTemplate}
639
- <slot name="sort-options-left" slot="sort-options-left"></slot>
640
- <slot name="sort-options" slot="sort-options"></slot>
641
- <slot name="sort-options-right" slot="sort-options-right"></slot>
642
- </sort-filter-bar>
617
+ return html `
618
+ <sort-filter-bar
619
+ .defaultSortField=${this.defaultSortField}
620
+ .defaultSortDirection=${this.defaultSortDirection}
621
+ .defaultViewSort=${defaultViewSort}
622
+ .defaultDateSort=${defaultDateSort}
623
+ .selectedSort=${this.selectedSort}
624
+ .sortDirection=${this.sortDirection}
625
+ .sortFieldAvailability=${sortFieldAvailability}
626
+ .displayMode=${this.displayMode}
627
+ .selectedTitleFilter=${this.selectedTitleFilter}
628
+ .selectedCreatorFilter=${this.selectedCreatorFilter}
629
+ .prefixFilterCountMap=${this.dataSource.prefixFilterCountMap}
630
+ .resizeObserver=${this.resizeObserver}
631
+ .enableSortOptionsSlot=${this.enableSortOptionsSlot}
632
+ .suppressDisplayModes=${this.suppressDisplayModes}
633
+ @sortChanged=${this.userChangedSort}
634
+ @displayModeChanged=${this.displayModeChanged}
635
+ @titleLetterChanged=${this.titleLetterSelected}
636
+ @creatorLetterChanged=${this.creatorLetterSelected}
637
+ >
638
+ ${this.tileBlurCheckboxTemplate}
639
+ <slot name="sort-options-left" slot="sort-options-left"></slot>
640
+ <slot name="sort-options" slot="sort-options"></slot>
641
+ <slot name="sort-options-right" slot="sort-options-right"></slot>
642
+ </sort-filter-bar>
643
643
  `;
644
644
  }
645
645
  /**
@@ -651,20 +651,20 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
651
651
  // Only show the checkbox for @archive.org users
652
652
  if (!((_a = this.dataSource.sessionContext) === null || _a === void 0 ? void 0 : _a.is_archive_user))
653
653
  return nothing;
654
- return html `
655
- <label
656
- id="tile-blur-label"
657
- for="tile-blur-check"
658
- slot="sort-options-right"
659
- >
660
- ${msg('Blurring')}
661
- <input
662
- id="tile-blur-check"
663
- type="checkbox"
664
- ?checked=${!this.shouldSuppressTileBlurring}
665
- @change=${this.tileBlurCheckboxChanged}
666
- />
667
- </label>
654
+ return html `
655
+ <label
656
+ id="tile-blur-label"
657
+ for="tile-blur-check"
658
+ slot="sort-options-right"
659
+ >
660
+ ${msg('Blurring')}
661
+ <input
662
+ id="tile-blur-check"
663
+ type="checkbox"
664
+ ?checked=${!this.shouldSuppressTileBlurring}
665
+ @change=${this.tileBlurCheckboxChanged}
666
+ />
667
+ </label>
668
668
  `;
669
669
  }
670
670
  /**
@@ -690,27 +690,27 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
690
690
  * showing the management view. This generally replaces the sort bar when present.
691
691
  */
692
692
  get manageBarTemplate() {
693
- return html `
694
- <manage-bar
695
- .label=${this.manageViewLabel}
696
- .modalManager=${this.modalManager}
697
- .selectedItems=${this.dataSource.checkedTileModels}
698
- .manageViewModalMsg=${this.manageViewModalMsg}
699
- showSelectAll
700
- showUnselectAll
701
- ?showItemManageButton=${this.pageContext === 'search'}
702
- ?removeAllowed=${this.dataSource.checkedTileModels.length !== 0}
703
- @removeItems=${this.handleRemoveItems}
704
- @manageItems=${this.handleManageItems}
705
- @selectAll=${() => this.dataSource.checkAllTiles()}
706
- @unselectAll=${() => this.dataSource.uncheckAllTiles()}
693
+ return html `
694
+ <manage-bar
695
+ .label=${this.manageViewLabel}
696
+ .modalManager=${this.modalManager}
697
+ .selectedItems=${this.dataSource.checkedTileModels}
698
+ .manageViewModalMsg=${this.manageViewModalMsg}
699
+ showSelectAll
700
+ showUnselectAll
701
+ ?showItemManageButton=${this.pageContext === 'search'}
702
+ ?removeAllowed=${this.dataSource.checkedTileModels.length !== 0}
703
+ @removeItems=${this.handleRemoveItems}
704
+ @manageItems=${this.handleManageItems}
705
+ @selectAll=${() => this.dataSource.checkAllTiles()}
706
+ @unselectAll=${() => this.dataSource.uncheckAllTiles()}
707
707
  @cancel=${() => {
708
708
  this.isManageView = false;
709
709
  this.dataSource.uncheckAllTiles();
710
710
  if (this.searchResultsLoading)
711
711
  this.dataSource.resetPages();
712
- }}
713
- ></manage-bar>
712
+ }}
713
+ ></manage-bar>
714
714
  `;
715
715
  }
716
716
  /**
@@ -958,15 +958,15 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
958
958
  label: target.open ? 'open' : 'closed',
959
959
  });
960
960
  };
961
- return html `
962
- <details id="mobile-filter-collapse" @toggle=${toggleFacetsVisible}>
963
- <summary>
964
- <span class="collapser-icon">${chevronIcon}</span>
965
- <h2>${msg('Filters')}</h2>
966
- ${this.clearFiltersBtnTemplate(true)}
967
- </summary>
968
- ${this.facetsTemplate}
969
- </details>
961
+ return html `
962
+ <details id="mobile-filter-collapse" @toggle=${toggleFacetsVisible}>
963
+ <summary>
964
+ <span class="collapser-icon">${chevronIcon}</span>
965
+ <h2>${msg('Filters')}</h2>
966
+ ${this.clearFiltersBtnTemplate(true)}
967
+ </summary>
968
+ ${this.facetsTemplate}
969
+ </details>
970
970
  `;
971
971
  }
972
972
  /**
@@ -976,10 +976,10 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
976
976
  if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement))
977
977
  return nothing;
978
978
  if (this.facetLoadStrategy === 'off') {
979
- return html `
980
- <p class="facets-message">
981
- ${msg('Facets are temporarily unavailable.')}
982
- </p>
979
+ return html `
980
+ <p class="facets-message">
981
+ ${msg('Facets are temporarily unavailable.')}
982
+ </p>
983
983
  `;
984
984
  }
985
985
  // We switch to TV facet ordering & date picker if we are in a TV collection or showing TV search results
@@ -988,45 +988,45 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
988
988
  const facetDisplayOrder = shouldUseTvInterface
989
989
  ? tvFacetDisplayOrder
990
990
  : defaultFacetDisplayOrder;
991
- const facets = html `
992
- <collection-facets
993
- .collectionPagePath=${this.collectionPagePath}
994
- .parentCollections=${this.dataSource.parentCollections}
995
- .pageSpecifierParams=${this.dataSource.pageSpecifierParams}
996
- .searchService=${this.searchService}
997
- .featureFeedbackService=${this.featureFeedbackService}
998
- .recaptchaManager=${this.recaptchaManager}
999
- .resizeObserver=${this.resizeObserver}
1000
- .searchType=${this.searchType}
1001
- .aggregations=${this.dataSource.aggregations}
1002
- .histogramAggregation=${this.dataSource.histogramAggregation}
1003
- .minSelectedDate=${this.minSelectedDate}
1004
- .maxSelectedDate=${this.maxSelectedDate}
1005
- .selectedFacets=${this.selectedFacets}
1006
- .baseNavigationUrl=${this.baseNavigationUrl}
1007
- .collectionTitles=${this.dataSource.collectionTitles}
1008
- .tvChannelAliases=${this.dataSource.tvChannelAliases}
1009
- .showHistogramDatePicker=${this.showHistogramDatePicker}
1010
- .allowExpandingDatePicker=${!this.mobileView}
1011
- .allowDatePickerMonths=${shouldUseTvInterface}
1012
- .contentWidth=${this.contentWidth}
1013
- .query=${this.baseQuery}
1014
- .identifiers=${this.identifiers}
1015
- .filterMap=${this.dataSource.filterMap}
1016
- .isManageView=${this.isManageView}
1017
- .modalManager=${this.modalManager}
1018
- .analyticsHandler=${this.analyticsHandler}
1019
- .facetDisplayOrder=${facetDisplayOrder}
1020
- .isTvSearch=${shouldUseTvInterface}
1021
- ?collapsableFacets=${this.mobileView}
1022
- ?facetsLoading=${this.facetsLoading}
1023
- ?histogramAggregationLoading=${this.facetsLoading}
1024
- ?suppressMediatypeFacets=${this.suppressMediatypeFacets}
1025
- @facetClick=${this.facetClickHandler}
1026
- @facetsChanged=${this.facetsChanged}
1027
- @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
1028
- >
1029
- </collection-facets>
991
+ const facets = html `
992
+ <collection-facets
993
+ .collectionPagePath=${this.collectionPagePath}
994
+ .parentCollections=${this.dataSource.parentCollections}
995
+ .pageSpecifierParams=${this.dataSource.pageSpecifierParams}
996
+ .searchService=${this.searchService}
997
+ .featureFeedbackService=${this.featureFeedbackService}
998
+ .recaptchaManager=${this.recaptchaManager}
999
+ .resizeObserver=${this.resizeObserver}
1000
+ .searchType=${this.searchType}
1001
+ .aggregations=${this.dataSource.aggregations}
1002
+ .histogramAggregation=${this.dataSource.histogramAggregation}
1003
+ .minSelectedDate=${this.minSelectedDate}
1004
+ .maxSelectedDate=${this.maxSelectedDate}
1005
+ .selectedFacets=${this.selectedFacets}
1006
+ .baseNavigationUrl=${this.baseNavigationUrl}
1007
+ .collectionTitles=${this.dataSource.collectionTitles}
1008
+ .tvChannelAliases=${this.dataSource.tvChannelAliases}
1009
+ .showHistogramDatePicker=${this.showHistogramDatePicker}
1010
+ .allowExpandingDatePicker=${!this.mobileView}
1011
+ .allowDatePickerMonths=${shouldUseTvInterface}
1012
+ .contentWidth=${this.contentWidth}
1013
+ .query=${this.baseQuery}
1014
+ .identifiers=${this.identifiers}
1015
+ .filterMap=${this.dataSource.filterMap}
1016
+ .isManageView=${this.isManageView}
1017
+ .modalManager=${this.modalManager}
1018
+ .analyticsHandler=${this.analyticsHandler}
1019
+ .facetDisplayOrder=${facetDisplayOrder}
1020
+ .isTvSearch=${shouldUseTvInterface}
1021
+ ?collapsableFacets=${this.mobileView}
1022
+ ?facetsLoading=${this.facetsLoading}
1023
+ ?histogramAggregationLoading=${this.facetsLoading}
1024
+ ?suppressMediatypeFacets=${this.suppressMediatypeFacets}
1025
+ @facetClick=${this.facetClickHandler}
1026
+ @facetsChanged=${this.facetsChanged}
1027
+ @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
1028
+ >
1029
+ </collection-facets>
1030
1030
  `;
1031
1031
  // If we are using one of the opt-in facet load strategies, we may need to wrap the
1032
1032
  // desktop view facets in a <details> widget so that patrons can opt into loading them.
@@ -1034,20 +1034,20 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1034
1034
  const showDesktopOptInWidget = this.facetLoadStrategy === 'opt-in' ||
1035
1035
  (this.facetLoadStrategy === 'opt-in-or-login' && !this.loggedIn);
1036
1036
  if (showDesktopOptInWidget && !this.mobileView) {
1037
- return html `
1038
- <details
1039
- class="desktop-facets-dropdown"
1037
+ return html `
1038
+ <details
1039
+ class="desktop-facets-dropdown"
1040
1040
  @toggle=${(e) => {
1041
1041
  const target = e.target;
1042
1042
  this.collapsibleFacetsVisible = target.open;
1043
- }}
1044
- >
1045
- <summary>
1046
- <span class="collapser-icon">${chevronIcon}</span>
1047
- <h2>${msg('Filters')}</h2>
1048
- </summary>
1049
- ${facets}
1050
- </details>
1043
+ }}
1044
+ >
1045
+ <summary>
1046
+ <span class="collapser-icon">${chevronIcon}</span>
1047
+ <h2>${msg('Filters')}</h2>
1048
+ </summary>
1049
+ ${facets}
1050
+ </details>
1051
1051
  `;
1052
1052
  }
1053
1053
  // Otherwise, just render the facets component bare
@@ -1067,34 +1067,34 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1067
1067
  mobile,
1068
1068
  });
1069
1069
  const buttonText = mobile ? 'Clear all' : 'Clear all filters';
1070
- return html `
1071
- <div class="clear-filters-btn-row">
1070
+ return html `
1071
+ <div class="clear-filters-btn-row">
1072
1072
  ${mobile
1073
1073
  ? html `<span class="clear-filters-btn-separator">&nbsp;</span>`
1074
- : nothing}
1075
- <button class=${buttonClasses} @click=${this.clearFilters}>
1076
- ${buttonText}
1077
- </button>
1078
- </div>
1074
+ : nothing}
1075
+ <button class=${buttonClasses} @click=${this.clearFilters}>
1076
+ ${buttonText}
1077
+ </button>
1078
+ </div>
1079
1079
  `;
1080
1080
  }
1081
1081
  /**
1082
1082
  * Template for the table header content that appears atop the compact list view.
1083
1083
  */
1084
1084
  get listHeaderTemplate() {
1085
- return html `
1086
- <div id="list-header">
1087
- <tile-dispatcher
1088
- .tileDisplayMode=${'list-header'}
1089
- .resizeObserver=${this.resizeObserver}
1090
- .sortParam=${this.sortParam}
1091
- .defaultSortParam=${this.defaultSortParam}
1092
- .mobileBreakpoint=${this.mobileBreakpoint}
1093
- .loggedIn=${this.loggedIn}
1094
- .suppressBlurring=${this.shouldSuppressTileBlurring}
1095
- >
1096
- </tile-dispatcher>
1097
- </div>
1085
+ return html `
1086
+ <div id="list-header">
1087
+ <tile-dispatcher
1088
+ .tileDisplayMode=${'list-header'}
1089
+ .resizeObserver=${this.resizeObserver}
1090
+ .sortParam=${this.sortParam}
1091
+ .defaultSortParam=${this.defaultSortParam}
1092
+ .mobileBreakpoint=${this.mobileBreakpoint}
1093
+ .loggedIn=${this.loggedIn}
1094
+ .suppressBlurring=${this.shouldSuppressTileBlurring}
1095
+ >
1096
+ </tile-dispatcher>
1097
+ </div>
1098
1098
  `;
1099
1099
  }
1100
1100
  /**
@@ -1854,28 +1854,28 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1854
1854
  const isRadioSearch = this.searchType === SearchType.RADIO;
1855
1855
  const { isTVCollection, isRadioCollection } = this;
1856
1856
  const shouldUseLocalTime = isTVSearch || isRadioSearch || isTVCollection || isRadioCollection;
1857
- return html `
1858
- <tile-dispatcher
1859
- .collectionPagePath=${this.collectionPagePath}
1860
- .baseNavigationUrl=${this.baseNavigationUrl}
1861
- .baseImageUrl=${this.baseImageUrl}
1862
- .model=${model}
1863
- .tileDisplayMode=${this.displayMode}
1864
- .resizeObserver=${this.resizeObserver}
1865
- .collectionTitles=${this.dataSource.collectionTitles}
1866
- .sortParam=${this.sortParam}
1867
- .defaultSortParam=${this.defaultSortParam}
1868
- .creatorFilter=${this.selectedCreatorFilter}
1869
- .mobileBreakpoint=${this.mobileBreakpoint}
1870
- .loggedIn=${this.loggedIn}
1871
- .suppressBlurring=${this.shouldSuppressTileBlurring}
1872
- .isManageView=${this.isManageView}
1873
- ?showTvClips=${isTVSearch || isTVCollection}
1874
- ?enableHoverPane=${true}
1875
- ?useLocalTime=${shouldUseLocalTime}
1876
- @resultSelected=${(e) => this.resultSelected(e)}
1877
- >
1878
- </tile-dispatcher>
1857
+ return html `
1858
+ <tile-dispatcher
1859
+ .collectionPagePath=${this.collectionPagePath}
1860
+ .baseNavigationUrl=${this.baseNavigationUrl}
1861
+ .baseImageUrl=${this.baseImageUrl}
1862
+ .model=${model}
1863
+ .tileDisplayMode=${this.displayMode}
1864
+ .resizeObserver=${this.resizeObserver}
1865
+ .collectionTitles=${this.dataSource.collectionTitles}
1866
+ .sortParam=${this.sortParam}
1867
+ .defaultSortParam=${this.defaultSortParam}
1868
+ .creatorFilter=${this.selectedCreatorFilter}
1869
+ .mobileBreakpoint=${this.mobileBreakpoint}
1870
+ .loggedIn=${this.loggedIn}
1871
+ .suppressBlurring=${this.shouldSuppressTileBlurring}
1872
+ .isManageView=${this.isManageView}
1873
+ ?showTvClips=${isTVSearch || isTVCollection}
1874
+ ?enableHoverPane=${true}
1875
+ ?useLocalTime=${shouldUseLocalTime}
1876
+ @resultSelected=${(e) => this.resultSelected(e)}
1877
+ >
1878
+ </tile-dispatcher>
1879
1879
  `;
1880
1880
  }
1881
1881
  /**
@@ -1911,441 +1911,441 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1911
1911
  static get styles() {
1912
1912
  return [
1913
1913
  srOnlyStyle,
1914
- css `
1915
- :host {
1916
- display: block;
1917
- --leftColumnWidth: 18rem;
1918
- --leftColumnPaddingTop: 2rem;
1919
- --leftColumnPaddingRight: 2.5rem;
1920
- }
1921
-
1922
- #facet-top-view {
1923
- display: flex;
1924
- }
1925
-
1926
- /**
1927
- * When page width resizes from desktop to mobile, use this class to
1928
- * disable expand/collapse transition when loading.
1929
- */
1930
- .preload * {
1931
- transition: none !important;
1932
- -webkit-transition: none !important;
1933
- -moz-transition: none !important;
1934
- -ms-transition: none !important;
1935
- -o-transition: none !important;
1936
- }
1937
-
1938
- #content-container {
1939
- display: flex;
1940
- }
1941
-
1942
- empty-placeholder {
1943
- margin-top: var(--placeholderMarginTop, 0);
1944
- }
1945
-
1946
- .collapser-icon {
1947
- display: inline-block;
1948
- }
1949
-
1950
- .collapser-icon svg {
1951
- display: inline-block;
1952
- width: 12px;
1953
- height: 12px;
1954
- transition: transform 0.2s ease-out;
1955
- }
1956
-
1957
- #mobile-filter-collapse {
1958
- width: 100%;
1959
- }
1960
-
1961
- #mobile-filter-collapse > summary {
1962
- cursor: pointer;
1963
- list-style: none;
1964
- }
1965
-
1966
- #mobile-filter-collapse[open] > summary {
1967
- margin-bottom: 10px;
1968
- }
1969
-
1970
- #mobile-filter-collapse h2 {
1971
- display: inline-block;
1972
- margin: 0;
1973
- font-size: 2rem;
1974
- }
1975
-
1976
- #mobile-filter-collapse[open] svg {
1977
- transform: rotate(90deg);
1978
- }
1979
-
1980
- #content-container.mobile {
1981
- display: block;
1982
- }
1983
-
1984
- #right-column {
1985
- flex: 1;
1986
- position: relative;
1987
- min-height: 90vh;
1988
- border-right: 1px solid rgb(232, 232, 232);
1989
- margin-top: var(--rightColumnMarginTop, 0);
1990
- padding-top: var(--rightColumnPaddingTop, 2rem);
1991
- background: #fff;
1992
- }
1993
-
1994
- #left-column:not([hidden]) + #right-column {
1995
- border-left: 1px solid rgb(232, 232, 232);
1996
- }
1997
-
1998
- #right-column.smart-results-spacing {
1999
- padding-top: 0.5rem;
2000
- border-right: none;
2001
- background: transparent;
2002
- min-width: 0;
2003
- }
2004
-
2005
- #results {
2006
- background: #fff;
2007
- padding-left: 1rem;
2008
- padding-right: 1rem;
2009
- }
2010
-
2011
- #right-column.smart-results-spacing #results {
2012
- border-radius: 10px 10px 0px 0px;
2013
- padding-top: 0.5rem;
2014
- margin-top: 1rem;
2015
- }
2016
-
2017
- .mobile #right-column {
2018
- border-left: none;
2019
- }
2020
-
2021
- .mobile #results {
2022
- padding: 5px 5px 0;
2023
- }
2024
-
2025
- #left-column {
2026
- width: var(--leftColumnWidth, 18rem);
2027
- /* Prevents Safari from shrinking col at first draw */
2028
- min-width: var(--leftColumnWidth, 18rem);
2029
- padding-top: var(--leftColumnPaddingTop, 2rem);
2030
- /* Reduced padding by 0.2rem to add the invisible border in the rule below */
2031
- padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);
2032
- border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */
2033
- z-index: 1;
2034
- }
2035
-
2036
- .desktop #left-column {
2037
- top: 0;
2038
- position: sticky;
2039
- height: calc(100vh - 2rem);
2040
- max-height: calc(100vh - 2rem);
2041
- overflow-x: hidden;
2042
- overflow-y: scroll;
2043
-
2044
- /*
2045
- * Firefox doesn't support any of the -webkit-scrollbar stuff below, but
2046
- * does at least give us a tiny bit of control over width & color.
2047
- */
2048
- scrollbar-width: thin;
2049
- scrollbar-color: transparent transparent;
2050
- }
2051
- .desktop #left-column:hover {
2052
- scrollbar-color: auto;
2053
- }
2054
- .desktop #left-column::-webkit-scrollbar {
2055
- appearance: none;
2056
- width: 6px;
2057
- }
2058
- .desktop #left-column::-webkit-scrollbar-button {
2059
- height: 3px;
2060
- background: transparent;
2061
- }
2062
- .desktop #left-column::-webkit-scrollbar-corner {
2063
- background: transparent;
2064
- }
2065
- .desktop #left-column::-webkit-scrollbar-thumb {
2066
- border-radius: 4px;
2067
- }
2068
- .desktop #left-column:hover::-webkit-scrollbar-thumb {
2069
- background: rgba(0, 0, 0, 0.15);
2070
- }
2071
- .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {
2072
- background: rgba(0, 0, 0, 0.2);
2073
- }
2074
- .desktop #left-column:hover::-webkit-scrollbar-thumb:active {
2075
- background: rgba(0, 0, 0, 0.3);
2076
- }
2077
-
2078
- #facets-bottom-fade {
2079
- background: linear-gradient(
2080
- to bottom,
2081
- #f5f5f700 0%,
2082
- #f5f5f7c0 50%,
2083
- #f5f5f7 80%,
2084
- #f5f5f7 100%
2085
- );
2086
- position: fixed;
2087
- bottom: 0;
2088
- height: 50px;
2089
- /* Wide enough to cover the content, but leave the scrollbar uncovered */
2090
- width: calc(
2091
- var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px
2092
- );
2093
- z-index: 2;
2094
- pointer-events: none;
2095
- transition: height 0.1s ease;
2096
- }
2097
- #facets-bottom-fade.hidden {
2098
- height: 0;
2099
- }
2100
-
2101
- .facets-message {
2102
- font-size: 1.4rem;
2103
- }
2104
-
2105
- .desktop-facets-dropdown > summary {
2106
- cursor: pointer;
2107
- list-style: none;
2108
- }
2109
-
2110
- .desktop-facets-dropdown h2 {
2111
- display: inline-block;
2112
- margin: 0;
2113
- font-size: 1.6rem;
2114
- }
2115
-
2116
- .desktop-facets-dropdown[open] > summary {
2117
- margin-bottom: 10px;
2118
- }
2119
-
2120
- .desktop-facets-dropdown[open] svg {
2121
- transform: rotate(90deg);
2122
- }
2123
-
2124
- .desktop #left-column-scroll-sentinel {
2125
- width: 1px;
2126
- height: 100vh;
2127
- background: transparent;
2128
- }
2129
-
2130
- .desktop #facets-scroll-sentinel {
2131
- width: 1px;
2132
- height: 1px;
2133
- background: transparent;
2134
- }
2135
-
2136
- #facets-header-container {
2137
- display: flex;
2138
- justify-content: space-between;
2139
- align-items: flex-start;
2140
- clear: both;
2141
- }
2142
-
2143
- .desktop #facets-header-container {
2144
- flex-wrap: wrap;
2145
- }
2146
-
2147
- .mobile #left-column {
2148
- width: 100%;
2149
- min-width: 0;
2150
- padding: 5px 0;
2151
- border: 0;
2152
- }
2153
-
2154
- .clear-filters-btn-row {
2155
- display: inline-block;
2156
- }
2157
-
2158
- .desktop .clear-filters-btn-row {
2159
- width: 100%;
2160
- }
2161
-
2162
- .clear-filters-btn {
2163
- display: inline-block;
2164
- appearance: none;
2165
- margin: 0;
2166
- padding: 0;
2167
- border: 0;
2168
- background: none;
2169
- color: var(--ia-theme-link-color);
2170
- font-size: 1.4rem;
2171
- font-family: inherit;
2172
- cursor: pointer;
2173
- }
2174
-
2175
- .clear-filters-btn:hover {
2176
- text-decoration: underline;
2177
- }
2178
-
2179
- .clear-filters-btn-separator {
2180
- display: inline-block;
2181
- margin-left: 5px;
2182
- border-left: 1px solid #2c2c2c;
2183
- font-size: 1.4rem;
2184
- line-height: 1.3rem;
2185
- }
2186
-
2187
- #facets-container {
2188
- position: relative;
2189
- max-height: 0;
2190
- transition: max-height 0.2s ease-in-out;
2191
- z-index: 1;
2192
- margin-top: var(--facetsContainerMarginTop, 5rem);
2193
- padding-bottom: 2rem;
2194
- }
2195
-
2196
- .desktop #facets-container {
2197
- width: 18rem;
2198
- }
2199
-
2200
- .mobile #facets-container {
2201
- overflow: hidden;
2202
- padding-bottom: 0;
2203
- padding-left: 10px;
2204
- padding-right: 10px;
2205
- }
2206
-
2207
- #facets-container.expanded {
2208
- max-height: 2000px;
2209
- }
2210
-
2211
- .results-section-heading {
2212
- margin: 0.5rem 0.3rem;
2213
- font-size: 2rem;
2214
- line-height: 25px;
2215
- }
2216
-
2217
- #results-total {
2218
- display: flex;
2219
- align-items: baseline;
2220
- }
2221
-
2222
- .mobile #results-total {
2223
- position: absolute;
2224
- right: 10px;
2225
- }
2226
-
2227
- #big-results-count {
2228
- font-size: 2.4rem;
2229
- font-weight: 500;
2230
- margin-right: 5px;
2231
- }
2232
-
2233
- .mobile #big-results-count {
2234
- font-size: 2rem;
2235
- }
2236
-
2237
- #big-results-label {
2238
- font-size: 1.4rem;
2239
- font-weight: 200;
2240
- }
2241
-
2242
- #list-header {
2243
- max-height: 4.2rem;
2244
- }
2245
-
2246
- .loading-cover {
2247
- position: absolute;
2248
- top: 0;
2249
- left: 0;
2250
- width: 100%;
2251
- height: 100%;
2252
- display: flex;
2253
- justify-content: center;
2254
- z-index: 1;
2255
- padding-top: 50px;
2256
- }
2257
-
2258
- #tile-blur-label {
2259
- display: flex;
2260
- align-items: center;
2261
- column-gap: 5px;
2262
- }
2263
-
2264
- #tile-blur-check {
2265
- margin: 0 5px 0 0;
2266
- width: 15px;
2267
- }
2268
-
2269
- circular-activity-indicator {
2270
- width: 30px;
2271
- height: 30px;
2272
- }
2273
-
2274
- sort-filter-bar {
2275
- display: block;
2276
- margin-bottom: 4rem;
2277
- }
2278
-
2279
- infinite-scroller {
2280
- display: block;
2281
- --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);
2282
- --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);
2283
- }
2284
-
2285
- infinite-scroller.list-compact {
2286
- --infiniteScrollerCellMinWidth: var(
2287
- --collectionBrowserCellMinWidth,
2288
- 100%
2289
- );
2290
- --infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */
2291
- --infiniteScrollerCellMaxHeight: 56px;
2292
- --infiniteScrollerRowGap: 10px;
2293
- }
2294
-
2295
- infinite-scroller.list-detail {
2296
- --infiniteScrollerCellMinWidth: var(
2297
- --collectionBrowserCellMinWidth,
2298
- 100%
2299
- );
2300
- --infiniteScrollerCellMinHeight: var(
2301
- --collectionBrowserCellMinHeight,
2302
- 5rem
2303
- );
2304
- /*
2305
- 30px in spec, compensating for a -4px margin
2306
- to align title with top of item image
2307
- src/tiles/list/tile-list.ts
2308
- */
2309
- --infiniteScrollerRowGap: 34px;
2310
- }
2311
-
2312
- .mobile infinite-scroller.list-detail {
2313
- --infiniteScrollerRowGap: 24px;
2314
- }
2315
-
2316
- infinite-scroller.grid {
2317
- --infiniteScrollerCellMinWidth: var(
2318
- --collectionBrowserCellMinWidth,
2319
- 17rem
2320
- );
2321
- --infiniteScrollerCellMaxWidth: var(
2322
- --collectionBrowserCellMaxWidth,
2323
- 1fr
2324
- );
2325
- }
2326
-
2327
- /* Allow tiles to shrink a bit further at smaller viewport widths */
2328
- @media screen and (max-width: 880px) {
2329
- infinite-scroller.grid {
2330
- --infiniteScrollerCellMinWidth: var(
2331
- --collectionBrowserCellMinWidth,
2332
- 15rem
2333
- );
2334
- }
2335
- }
2336
- /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */
2337
- @media screen and (max-width: 360px) {
2338
- infinite-scroller.grid {
2339
- --infiniteScrollerCellMinWidth: var(
2340
- --collectionBrowserCellMinWidth,
2341
- 12rem
2342
- );
2343
- }
2344
- }
2345
-
2346
- infinite-scroller.hidden {
2347
- display: none;
2348
- }
1914
+ css `
1915
+ :host {
1916
+ display: block;
1917
+ --leftColumnWidth: 18rem;
1918
+ --leftColumnPaddingTop: 2rem;
1919
+ --leftColumnPaddingRight: 2.5rem;
1920
+ }
1921
+
1922
+ #facet-top-view {
1923
+ display: flex;
1924
+ }
1925
+
1926
+ /**
1927
+ * When page width resizes from desktop to mobile, use this class to
1928
+ * disable expand/collapse transition when loading.
1929
+ */
1930
+ .preload * {
1931
+ transition: none !important;
1932
+ -webkit-transition: none !important;
1933
+ -moz-transition: none !important;
1934
+ -ms-transition: none !important;
1935
+ -o-transition: none !important;
1936
+ }
1937
+
1938
+ #content-container {
1939
+ display: flex;
1940
+ }
1941
+
1942
+ empty-placeholder {
1943
+ margin-top: var(--placeholderMarginTop, 0);
1944
+ }
1945
+
1946
+ .collapser-icon {
1947
+ display: inline-block;
1948
+ }
1949
+
1950
+ .collapser-icon svg {
1951
+ display: inline-block;
1952
+ width: 12px;
1953
+ height: 12px;
1954
+ transition: transform 0.2s ease-out;
1955
+ }
1956
+
1957
+ #mobile-filter-collapse {
1958
+ width: 100%;
1959
+ }
1960
+
1961
+ #mobile-filter-collapse > summary {
1962
+ cursor: pointer;
1963
+ list-style: none;
1964
+ }
1965
+
1966
+ #mobile-filter-collapse[open] > summary {
1967
+ margin-bottom: 10px;
1968
+ }
1969
+
1970
+ #mobile-filter-collapse h2 {
1971
+ display: inline-block;
1972
+ margin: 0;
1973
+ font-size: 2rem;
1974
+ }
1975
+
1976
+ #mobile-filter-collapse[open] svg {
1977
+ transform: rotate(90deg);
1978
+ }
1979
+
1980
+ #content-container.mobile {
1981
+ display: block;
1982
+ }
1983
+
1984
+ #right-column {
1985
+ flex: 1;
1986
+ position: relative;
1987
+ min-height: 90vh;
1988
+ border-right: 1px solid rgb(232, 232, 232);
1989
+ margin-top: var(--rightColumnMarginTop, 0);
1990
+ padding-top: var(--rightColumnPaddingTop, 2rem);
1991
+ background: #fff;
1992
+ }
1993
+
1994
+ #left-column:not([hidden]) + #right-column {
1995
+ border-left: 1px solid rgb(232, 232, 232);
1996
+ }
1997
+
1998
+ #right-column.smart-results-spacing {
1999
+ padding-top: 0.5rem;
2000
+ border-right: none;
2001
+ background: transparent;
2002
+ min-width: 0;
2003
+ }
2004
+
2005
+ #results {
2006
+ background: #fff;
2007
+ padding-left: 1rem;
2008
+ padding-right: 1rem;
2009
+ }
2010
+
2011
+ #right-column.smart-results-spacing #results {
2012
+ border-radius: 10px 10px 0px 0px;
2013
+ padding-top: 0.5rem;
2014
+ margin-top: 1rem;
2015
+ }
2016
+
2017
+ .mobile #right-column {
2018
+ border-left: none;
2019
+ }
2020
+
2021
+ .mobile #results {
2022
+ padding: 5px 5px 0;
2023
+ }
2024
+
2025
+ #left-column {
2026
+ width: var(--leftColumnWidth, 18rem);
2027
+ /* Prevents Safari from shrinking col at first draw */
2028
+ min-width: var(--leftColumnWidth, 18rem);
2029
+ padding-top: var(--leftColumnPaddingTop, 2rem);
2030
+ /* Reduced padding by 0.2rem to add the invisible border in the rule below */
2031
+ padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);
2032
+ border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */
2033
+ z-index: 1;
2034
+ }
2035
+
2036
+ .desktop #left-column {
2037
+ top: 0;
2038
+ position: sticky;
2039
+ height: calc(100vh - 2rem);
2040
+ max-height: calc(100vh - 2rem);
2041
+ overflow-x: hidden;
2042
+ overflow-y: scroll;
2043
+
2044
+ /*
2045
+ * Firefox doesn't support any of the -webkit-scrollbar stuff below, but
2046
+ * does at least give us a tiny bit of control over width & color.
2047
+ */
2048
+ scrollbar-width: thin;
2049
+ scrollbar-color: transparent transparent;
2050
+ }
2051
+ .desktop #left-column:hover {
2052
+ scrollbar-color: auto;
2053
+ }
2054
+ .desktop #left-column::-webkit-scrollbar {
2055
+ appearance: none;
2056
+ width: 6px;
2057
+ }
2058
+ .desktop #left-column::-webkit-scrollbar-button {
2059
+ height: 3px;
2060
+ background: transparent;
2061
+ }
2062
+ .desktop #left-column::-webkit-scrollbar-corner {
2063
+ background: transparent;
2064
+ }
2065
+ .desktop #left-column::-webkit-scrollbar-thumb {
2066
+ border-radius: 4px;
2067
+ }
2068
+ .desktop #left-column:hover::-webkit-scrollbar-thumb {
2069
+ background: rgba(0, 0, 0, 0.15);
2070
+ }
2071
+ .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {
2072
+ background: rgba(0, 0, 0, 0.2);
2073
+ }
2074
+ .desktop #left-column:hover::-webkit-scrollbar-thumb:active {
2075
+ background: rgba(0, 0, 0, 0.3);
2076
+ }
2077
+
2078
+ #facets-bottom-fade {
2079
+ background: linear-gradient(
2080
+ to bottom,
2081
+ #f5f5f700 0%,
2082
+ #f5f5f7c0 50%,
2083
+ #f5f5f7 80%,
2084
+ #f5f5f7 100%
2085
+ );
2086
+ position: fixed;
2087
+ bottom: 0;
2088
+ height: 50px;
2089
+ /* Wide enough to cover the content, but leave the scrollbar uncovered */
2090
+ width: calc(
2091
+ var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px
2092
+ );
2093
+ z-index: 2;
2094
+ pointer-events: none;
2095
+ transition: height 0.1s ease;
2096
+ }
2097
+ #facets-bottom-fade.hidden {
2098
+ height: 0;
2099
+ }
2100
+
2101
+ .facets-message {
2102
+ font-size: 1.4rem;
2103
+ }
2104
+
2105
+ .desktop-facets-dropdown > summary {
2106
+ cursor: pointer;
2107
+ list-style: none;
2108
+ }
2109
+
2110
+ .desktop-facets-dropdown h2 {
2111
+ display: inline-block;
2112
+ margin: 0;
2113
+ font-size: 1.6rem;
2114
+ }
2115
+
2116
+ .desktop-facets-dropdown[open] > summary {
2117
+ margin-bottom: 10px;
2118
+ }
2119
+
2120
+ .desktop-facets-dropdown[open] svg {
2121
+ transform: rotate(90deg);
2122
+ }
2123
+
2124
+ .desktop #left-column-scroll-sentinel {
2125
+ width: 1px;
2126
+ height: 100vh;
2127
+ background: transparent;
2128
+ }
2129
+
2130
+ .desktop #facets-scroll-sentinel {
2131
+ width: 1px;
2132
+ height: 1px;
2133
+ background: transparent;
2134
+ }
2135
+
2136
+ #facets-header-container {
2137
+ display: flex;
2138
+ justify-content: space-between;
2139
+ align-items: flex-start;
2140
+ clear: both;
2141
+ }
2142
+
2143
+ .desktop #facets-header-container {
2144
+ flex-wrap: wrap;
2145
+ }
2146
+
2147
+ .mobile #left-column {
2148
+ width: 100%;
2149
+ min-width: 0;
2150
+ padding: 5px 0;
2151
+ border: 0;
2152
+ }
2153
+
2154
+ .clear-filters-btn-row {
2155
+ display: inline-block;
2156
+ }
2157
+
2158
+ .desktop .clear-filters-btn-row {
2159
+ width: 100%;
2160
+ }
2161
+
2162
+ .clear-filters-btn {
2163
+ display: inline-block;
2164
+ appearance: none;
2165
+ margin: 0;
2166
+ padding: 0;
2167
+ border: 0;
2168
+ background: none;
2169
+ color: var(--ia-theme-link-color);
2170
+ font-size: 1.4rem;
2171
+ font-family: inherit;
2172
+ cursor: pointer;
2173
+ }
2174
+
2175
+ .clear-filters-btn:hover {
2176
+ text-decoration: underline;
2177
+ }
2178
+
2179
+ .clear-filters-btn-separator {
2180
+ display: inline-block;
2181
+ margin-left: 5px;
2182
+ border-left: 1px solid #2c2c2c;
2183
+ font-size: 1.4rem;
2184
+ line-height: 1.3rem;
2185
+ }
2186
+
2187
+ #facets-container {
2188
+ position: relative;
2189
+ max-height: 0;
2190
+ transition: max-height 0.2s ease-in-out;
2191
+ z-index: 1;
2192
+ margin-top: var(--facetsContainerMarginTop, 5rem);
2193
+ padding-bottom: 2rem;
2194
+ }
2195
+
2196
+ .desktop #facets-container {
2197
+ width: 18rem;
2198
+ }
2199
+
2200
+ .mobile #facets-container {
2201
+ overflow: hidden;
2202
+ padding-bottom: 0;
2203
+ padding-left: 10px;
2204
+ padding-right: 10px;
2205
+ }
2206
+
2207
+ #facets-container.expanded {
2208
+ max-height: 2000px;
2209
+ }
2210
+
2211
+ .results-section-heading {
2212
+ margin: 0.5rem 0.3rem;
2213
+ font-size: 2rem;
2214
+ line-height: 25px;
2215
+ }
2216
+
2217
+ #results-total {
2218
+ display: flex;
2219
+ align-items: baseline;
2220
+ }
2221
+
2222
+ .mobile #results-total {
2223
+ position: absolute;
2224
+ right: 10px;
2225
+ }
2226
+
2227
+ #big-results-count {
2228
+ font-size: 2.4rem;
2229
+ font-weight: 500;
2230
+ margin-right: 5px;
2231
+ }
2232
+
2233
+ .mobile #big-results-count {
2234
+ font-size: 2rem;
2235
+ }
2236
+
2237
+ #big-results-label {
2238
+ font-size: 1.4rem;
2239
+ font-weight: 200;
2240
+ }
2241
+
2242
+ #list-header {
2243
+ max-height: 4.2rem;
2244
+ }
2245
+
2246
+ .loading-cover {
2247
+ position: absolute;
2248
+ top: 0;
2249
+ left: 0;
2250
+ width: 100%;
2251
+ height: 100%;
2252
+ display: flex;
2253
+ justify-content: center;
2254
+ z-index: 1;
2255
+ padding-top: 50px;
2256
+ }
2257
+
2258
+ #tile-blur-label {
2259
+ display: flex;
2260
+ align-items: center;
2261
+ column-gap: 5px;
2262
+ }
2263
+
2264
+ #tile-blur-check {
2265
+ margin: 0 5px 0 0;
2266
+ width: 15px;
2267
+ }
2268
+
2269
+ circular-activity-indicator {
2270
+ width: 30px;
2271
+ height: 30px;
2272
+ }
2273
+
2274
+ sort-filter-bar {
2275
+ display: block;
2276
+ margin-bottom: 4rem;
2277
+ }
2278
+
2279
+ infinite-scroller {
2280
+ display: block;
2281
+ --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);
2282
+ --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);
2283
+ }
2284
+
2285
+ infinite-scroller.list-compact {
2286
+ --infiniteScrollerCellMinWidth: var(
2287
+ --collectionBrowserCellMinWidth,
2288
+ 100%
2289
+ );
2290
+ --infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */
2291
+ --infiniteScrollerCellMaxHeight: 56px;
2292
+ --infiniteScrollerRowGap: 10px;
2293
+ }
2294
+
2295
+ infinite-scroller.list-detail {
2296
+ --infiniteScrollerCellMinWidth: var(
2297
+ --collectionBrowserCellMinWidth,
2298
+ 100%
2299
+ );
2300
+ --infiniteScrollerCellMinHeight: var(
2301
+ --collectionBrowserCellMinHeight,
2302
+ 5rem
2303
+ );
2304
+ /*
2305
+ 30px in spec, compensating for a -4px margin
2306
+ to align title with top of item image
2307
+ src/tiles/list/tile-list.ts
2308
+ */
2309
+ --infiniteScrollerRowGap: 34px;
2310
+ }
2311
+
2312
+ .mobile infinite-scroller.list-detail {
2313
+ --infiniteScrollerRowGap: 24px;
2314
+ }
2315
+
2316
+ infinite-scroller.grid {
2317
+ --infiniteScrollerCellMinWidth: var(
2318
+ --collectionBrowserCellMinWidth,
2319
+ 17rem
2320
+ );
2321
+ --infiniteScrollerCellMaxWidth: var(
2322
+ --collectionBrowserCellMaxWidth,
2323
+ 1fr
2324
+ );
2325
+ }
2326
+
2327
+ /* Allow tiles to shrink a bit further at smaller viewport widths */
2328
+ @media screen and (max-width: 880px) {
2329
+ infinite-scroller.grid {
2330
+ --infiniteScrollerCellMinWidth: var(
2331
+ --collectionBrowserCellMinWidth,
2332
+ 15rem
2333
+ );
2334
+ }
2335
+ }
2336
+ /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */
2337
+ @media screen and (max-width: 360px) {
2338
+ infinite-scroller.grid {
2339
+ --infiniteScrollerCellMinWidth: var(
2340
+ --collectionBrowserCellMinWidth,
2341
+ 12rem
2342
+ );
2343
+ }
2344
+ }
2345
+
2346
+ infinite-scroller.hidden {
2347
+ display: none;
2348
+ }
2349
2349
  `,
2350
2350
  ];
2351
2351
  }