diff --git a/index.ts b/index.ts index 166959842..4294bb46a 100644 --- a/index.ts +++ b/index.ts @@ -1,6 +1,11 @@ export { CollectionBrowser } from './src/collection-browser'; +export { + CollectionBrowserDataSource, + CollectionBrowserDataSourceInterface, +} from './src/data-source/collection-browser-data-source'; +export { CollectionBrowserQueryState } from './src/data-source/models'; export { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar'; -export { CollectionDisplayMode, SortField } from './src/models'; +export { CollectionDisplayMode, SortField, TileModel } from './src/models'; export { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile'; export { CollectionTile } from './src/tiles/grid/collection-tile'; export { AccountTile } from './src/tiles/grid/account-tile'; diff --git a/package.json b/package.json index fd005337a..3a7584d27 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "The Internet Archive Collection Browser.", "license": "AGPL-3.0-only", "author": "Internet Archive", - "version": "1.14.15", + "version": "1.14.17-beta.5", "main": "dist/index.js", "module": "dist/index.js", "scripts": { @@ -14,6 +14,7 @@ "format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore", "circular": "madge --circular --extensions ts .", "test": "tsc && yarn run lint && yarn run circular && wtr --coverage", + "test:fast": "tsc && wtr --coverage", "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"", "deploy": "yarn run deploy:run -e $(git branch --show-current)", "deploy:run": "yarn run prepare:ghpages && touch ghpages/.nojekyll && yarn run deploy:gh", @@ -23,7 +24,6 @@ "types": "dist/index.d.ts", "dependencies": { "@internetarchive/analytics-manager": "^0.1.2", - "@internetarchive/collection-name-cache": "^0.2.16", "@internetarchive/feature-feedback": "^0.1.4", "@internetarchive/field-parsers": "^0.1.4", "@internetarchive/histogram-date-range": "^1.2.0", @@ -32,7 +32,7 @@ "@internetarchive/infinite-scroller": "1.0.1", "@internetarchive/local-cache": "^0.2.1", "@internetarchive/modal-manager": "^0.2.8", - "@internetarchive/search-service": "^1.2.4", + "@internetarchive/search-service": "^1.2.5-alpha.10", "@internetarchive/shared-resize-observer": "^0.2.0", "@lit/localize": "^0.11.2", "dompurify": "^2.3.6", diff --git a/src/app-root.ts b/src/app-root.ts index fb2b57bbf..44e24d17f 100644 --- a/src/app-root.ts +++ b/src/app-root.ts @@ -9,11 +9,9 @@ import { SearchType, StringField, } from '@internetarchive/search-service'; -import { LocalCache } from '@internetarchive/local-cache'; import { html, css, LitElement, PropertyValues, nothing } from 'lit'; import { customElement, property, query, state } from 'lit/decorators.js'; import { SharedResizeObserver } from '@internetarchive/shared-resize-observer'; -import { CollectionNameCache } from '@internetarchive/collection-name-cache'; import type { ModalManagerInterface } from '@internetarchive/modal-manager'; import type { AnalyticsManagerInterface } from '@internetarchive/analytics-manager'; @@ -28,13 +26,6 @@ export class AppRoot extends LitElement { private resizeObserver = new SharedResizeObserver(); - private localCache = new LocalCache(); - - private collectionNameCache = new CollectionNameCache({ - searchService: this.searchService, - localCache: this.localCache, - }); - @state() private toggleSlots: boolean = false; @state() private currentPage?: number; @@ -404,6 +395,55 @@ export class AppRoot extends LitElement { +
+ Placeholder type +
+ this.showEmptyPlaceholder('empty query')} + value="empty query" + /> +
+ ${this.withinCollection + ? html` +
+ + this.showEmptyPlaceholder('collection error')} + value="collection error" + /> +
+
+ + this.showEmptyPlaceholder('empty collection')} + value="empty collection" + /> +
+ ` + : nothing} +
+ this.showEmptyPlaceholder('query error')} + value="query error" + /> +
+
+ this.showEmptyPlaceholder('placeholder loading')} + value="placeholder loading" + /> +
+