1- /* eslint-disable no-console */
21import {
32 AnalyticsEvent ,
43 AnalyticsManager ,
76 SearchService ,
87 SearchServiceInterface ,
98 SearchType ,
10- StringField ,
119} from '@internetarchive/search-service' ;
1210import { html , css , LitElement , PropertyValues , nothing } from 'lit' ;
1311import { customElement , property , query , state } from 'lit/decorators.js' ;
@@ -18,6 +16,7 @@ import type { AnalyticsManagerInterface } from '@internetarchive/analytics-manag
1816import type { CollectionBrowser } from '../src/collection-browser' ;
1917
2018import '../src/collection-browser' ;
19+ import { StringField } from '@internetarchive/iaux-item-metadata' ;
2120
2221@customElement ( 'app-root' )
2322export class AppRoot extends LitElement {
@@ -83,7 +82,7 @@ export class AppRoot extends LitElement {
8382 includeCredentials : false ,
8483 baseUrl : params . get ( 'search_base_url' ) ?? undefined ,
8584 servicePath : params . get ( 'search_service_path' ) ?? undefined ,
86- debuggingEnabled : ! ! params . get ( 'debugging' ) ?? undefined ,
85+ debuggingEnabled : ! ! params . get ( 'debugging' ) ,
8786 } ) ;
8887 }
8988
@@ -210,7 +209,7 @@ export class AppRoot extends LitElement {
210209 <butto n
211210 @click = ${ ( ) => {
212211 const details = this . shadowRoot ?. getElementById (
213- 'latest-event-details'
212+ 'latest-event-details' ,
214213 ) ;
215214 details ?. classList . toggle ( 'hidden' ) ;
216215 } }
@@ -504,7 +503,7 @@ export class AppRoot extends LitElement {
504503 ` ;
505504 }
506505
507- private async setPlaceholderType ( type : String ) {
506+ private async setPlaceholderType ( type : string ) {
508507 switch ( type ) {
509508 case 'loading-placeholder' :
510509 this . collectionBrowser . baseQuery = '' ;
@@ -548,11 +547,11 @@ export class AppRoot extends LitElement {
548547 if ( target . checked ) {
549548 this . collectionBrowser . style . setProperty (
550549 '--infiniteScrollerCellOutline' ,
551- '1px solid #33D1FF'
550+ '1px solid #33D1FF' ,
552551 ) ;
553552 } else {
554553 this . collectionBrowser . style . removeProperty (
555- '--infiniteScrollerCellOutline'
554+ '--infiniteScrollerCellOutline' ,
556555 ) ;
557556 }
558557 }
@@ -575,7 +574,7 @@ export class AppRoot extends LitElement {
575574 path : pageUrl . toString ( ) ,
576575 } ,
577576 '' ,
578- pageUrl . toString ( )
577+ pageUrl . toString ( ) ,
579578 ) ;
580579 }
581580 }
@@ -600,7 +599,7 @@ export class AppRoot extends LitElement {
600599 async search ( params , searchType ) {
601600 const searchResponse = await SearchService . default . search (
602601 params ,
603- searchType
602+ searchType ,
604603 ) ;
605604 searchResponse . success ?. response . results . forEach ( result => {
606605 Object . defineProperty ( result , 'highlight' , {
@@ -638,7 +637,7 @@ export class AppRoot extends LitElement {
638637 async search ( params , searchType ) {
639638 const searchResponse = await SearchService . default . search (
640639 params ,
641- searchType
640+ searchType ,
642641 ) ;
643642 searchResponse . success ?. response . results . forEach ( ( result , i ) => {
644643 Object . defineProperty ( result , 'review' , {
@@ -700,7 +699,7 @@ export class AppRoot extends LitElement {
700699 */
701700 private manageModeChanged ( e : CustomEvent < boolean > ) : void {
702701 const manageCheckbox = this . shadowRoot ?. querySelector (
703- '#enable-management'
702+ '#enable-management' ,
704703 ) as HTMLInputElement ;
705704 if ( manageCheckbox ) manageCheckbox . checked = e . detail ;
706705 }
@@ -780,7 +779,7 @@ export class AppRoot extends LitElement {
780779 this . collectionBrowser . appendChild ( p ) ;
781780 } else {
782781 this . collectionBrowser . removeChild (
783- this . collectionBrowser . lastElementChild as Element
782+ this . collectionBrowser . lastElementChild as Element ,
784783 ) ;
785784 }
786785 }
@@ -804,7 +803,7 @@ export class AppRoot extends LitElement {
804803 this . collectionBrowser . appendChild ( div ) ;
805804 } else {
806805 this . collectionBrowser . removeChild (
807- this . collectionBrowser . lastElementChild as Element
806+ this . collectionBrowser . lastElementChild as Element ,
808807 ) ;
809808 }
810809 }
@@ -826,7 +825,7 @@ export class AppRoot extends LitElement {
826825 this . collectionBrowser . appendChild ( p ) ;
827826 } else {
828827 this . collectionBrowser . removeChild (
829- this . collectionBrowser . lastElementChild as Element
828+ this . collectionBrowser . lastElementChild as Element ,
830829 ) ;
831830 }
832831 }
@@ -848,7 +847,7 @@ export class AppRoot extends LitElement {
848847 this . collectionBrowser . appendChild ( div ) ;
849848 } else {
850849 const slottedEl = this . collectionBrowser . querySelector (
851- '[slot="sort-options-left"]'
850+ '[slot="sort-options-left"]' ,
852851 ) ;
853852 if ( slottedEl ) this . collectionBrowser . removeChild ( slottedEl ) ;
854853 }
@@ -871,7 +870,7 @@ export class AppRoot extends LitElement {
871870 this . collectionBrowser . appendChild ( div ) ;
872871 } else {
873872 const slottedEl = this . collectionBrowser . querySelector (
874- '[slot="sort-options-right"]'
873+ '[slot="sort-options-right"]' ,
875874 ) ;
876875 if ( slottedEl ) this . collectionBrowser . removeChild ( slottedEl ) ;
877876 }
@@ -882,7 +881,7 @@ export class AppRoot extends LitElement {
882881 this . rowGap = parseFloat ( input . value ) ;
883882 this . collectionBrowser . style . setProperty (
884883 '--collectionBrowserRowGap' ,
885- `${ input . value } rem`
884+ `${ input . value } rem` ,
886885 ) ;
887886 }
888887
@@ -891,7 +890,7 @@ export class AppRoot extends LitElement {
891890 this . colGap = parseFloat ( input . value ) ;
892891 this . collectionBrowser . style . setProperty (
893892 '--collectionBrowserColGap' ,
894- `${ input . value } rem`
893+ `${ input . value } rem` ,
895894 ) ;
896895 }
897896
@@ -900,7 +899,7 @@ export class AppRoot extends LitElement {
900899 this . cellWidth = parseFloat ( input . value ) ;
901900 this . collectionBrowser . style . setProperty (
902901 '--collectionBrowserCellMinWidth' ,
903- `${ input . value } rem`
902+ `${ input . value } rem` ,
904903 ) ;
905904 }
906905
@@ -909,11 +908,11 @@ export class AppRoot extends LitElement {
909908 this . cellHeight = parseFloat ( input . value ) ;
910909 this . collectionBrowser . style . setProperty (
911910 '--collectionBrowserCellMinHeight' ,
912- `${ input . value } rem`
911+ `${ input . value } rem` ,
913912 ) ;
914913 this . collectionBrowser . style . setProperty (
915914 '--collectionBrowserCellMaxHeight' ,
916- `${ input . value } rem`
915+ `${ input . value } rem` ,
917916 ) ;
918917 }
919918
@@ -940,7 +939,7 @@ export class AppRoot extends LitElement {
940939 this . collectionBrowser . enableSortOptionsSlot = true ;
941940 } else {
942941 const slottedEl = this . collectionBrowser . querySelector (
943- '[slot="sort-options"]'
942+ '[slot="sort-options"]' ,
944943 ) ;
945944 if ( slottedEl ) this . collectionBrowser . removeChild ( slottedEl ) ;
946945 this . collectionBrowser . enableSortOptionsSlot = false ;
0 commit comments