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