@internetarchive/collection-browser 2.0.1-alpha.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/app-root.d.ts +1 -0
- package/dist/src/app-root.js +38 -1
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.js +2 -3
- package/dist/src/assets/img/icons/favorite-filled.js.map +1 -1
- package/dist/src/assets/img/icons/favorite-unfilled.d.ts +1 -0
- package/dist/src/assets/img/icons/favorite-unfilled.js +9 -0
- package/dist/src/assets/img/icons/favorite-unfilled.js.map +1 -0
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +15 -0
- 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 +9 -1
- package/dist/src/data-source/collection-browser-data-source.js +30 -11
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/models.d.ts +2 -1
- package/dist/src/models.js +12 -11
- package/dist/src/models.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +2 -0
- package/dist/src/tiles/grid/item-tile.js +18 -0
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +3 -0
- package/dist/src/tiles/list/tile-list.js +18 -0
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/review-block.d.ts +12 -0
- package/dist/src/tiles/review-block.js +134 -0
- package/dist/src/tiles/review-block.js.map +1 -0
- package/dist/test/collection-browser.test.js +38 -4
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.js +12 -0
- package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -1
- package/dist/test/review-block.test.d.ts +1 -0
- package/dist/test/review-block.test.js +49 -0
- package/dist/test/review-block.test.js.map +1 -0
- package/dist/test/tiles/grid/item-tile.test.js +30 -0
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +30 -0
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/package.json +2 -2
- package/src/app-root.ts +41 -1
- package/src/assets/img/icons/favorite-filled.ts +2 -3
- package/src/assets/img/icons/favorite-unfilled.ts +9 -0
- package/src/data-source/collection-browser-data-source-interface.ts +17 -0
- package/src/data-source/collection-browser-data-source.ts +38 -11
- package/src/models.ts +7 -1
- package/src/tiles/grid/item-tile.ts +18 -0
- package/src/tiles/list/tile-list.ts +18 -0
- package/src/tiles/review-block.ts +130 -0
- package/test/collection-browser.test.ts +52 -4
- package/test/data-source/collection-browser-data-source.test.ts +14 -0
- package/test/review-block.test.ts +63 -0
- package/test/tiles/grid/item-tile.test.ts +33 -0
- package/test/tiles/list/tile-list.test.ts +33 -0
package/dist/src/app-root.d.ts
CHANGED
package/dist/src/app-root.js
CHANGED
|
@@ -273,6 +273,14 @@ let AppRoot = class AppRoot extends LitElement {
|
|
|
273
273
|
/>
|
|
274
274
|
<label for="show-dummy-snippets">Show dummy snippets</label>
|
|
275
275
|
</div>
|
|
276
|
+
<div class="checkbox-control">
|
|
277
|
+
<input
|
|
278
|
+
type="checkbox"
|
|
279
|
+
id="show-dummy-reviews"
|
|
280
|
+
@click=${this.reviewsChanged}
|
|
281
|
+
/>
|
|
282
|
+
<label for="show-dummy-reviews">Show dummy reviews</label>
|
|
283
|
+
</div>
|
|
276
284
|
<div class="checkbox-control">
|
|
277
285
|
<input
|
|
278
286
|
type="checkbox"
|
|
@@ -505,9 +513,38 @@ let AppRoot = class AppRoot extends LitElement {
|
|
|
505
513
|
// Re-perform the current search to show/hide the snippets immediately
|
|
506
514
|
this.reperformCurrentSearch();
|
|
507
515
|
}
|
|
516
|
+
async reviewsChanged(e) {
|
|
517
|
+
const target = e.target;
|
|
518
|
+
if (target.checked) {
|
|
519
|
+
// Decorate the default search service with a wrapper that adds
|
|
520
|
+
// dummy reviews to any successful searches
|
|
521
|
+
this.searchService = {
|
|
522
|
+
async search(params, searchType) {
|
|
523
|
+
var _a;
|
|
524
|
+
const searchResponse = await SearchService.default.search(params, searchType);
|
|
525
|
+
(_a = searchResponse.success) === null || _a === void 0 ? void 0 : _a.response.results.forEach((result, i) => {
|
|
526
|
+
Object.defineProperty(result, 'review', {
|
|
527
|
+
value: {
|
|
528
|
+
title: 'My Great Review',
|
|
529
|
+
body: "This item is really great and that's why I'm leaving this review on it and giving it so many star...",
|
|
530
|
+
stars: (i + 3) % 6,
|
|
531
|
+
},
|
|
532
|
+
});
|
|
533
|
+
});
|
|
534
|
+
return searchResponse;
|
|
535
|
+
},
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
// Restore the default seach service
|
|
540
|
+
this.searchService = SearchService.default;
|
|
541
|
+
}
|
|
542
|
+
// Re-perform the current search to show/hide the reviews immediately
|
|
543
|
+
this.reperformCurrentSearch();
|
|
544
|
+
}
|
|
508
545
|
async reperformCurrentSearch() {
|
|
509
546
|
const oldQuery = this.searchQuery;
|
|
510
|
-
this.searchQuery = ''; // Should just reset to the placeholder
|
|
547
|
+
this.searchQuery = '-'; // Should just reset to the placeholder
|
|
511
548
|
await this.updateComplete;
|
|
512
549
|
// For unclear reasons, Safari refuses to re-apply the old query until the next tick, hence:
|
|
513
550
|
await new Promise(res => {
|
package/dist/src/app-root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-root.js","sourceRoot":"","sources":["../../src/app-root.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,OAAO,EAEL,gBAAgB,GACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,aAAa,EAEb,UAAU,EACV,WAAW,GACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAkB,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,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E;2CAAsD;AAElB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;6CAA+B;AAE9C;IAA3B,KAAK,CAAC,mBAAmB,CAAC;+CAA2C;AAGtE;IADC,KAAK,CAAC,wBAAwB,CAAC;oDACe;AAElB;IAA5B,KAAK,CAAC,oBAAoB,CAAC;gDAA4C;AAE3C;IAA5B,KAAK,CAAC,oBAAoB,CAAC;kDAA+C;AAEnD;IAAvB,KAAK,CAAC,eAAe,CAAC;6CAA8C;AArC1D,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAq+BnB;SAr+BY,OAAO","sourcesContent":["/* eslint-disable no-console */\nimport {\n AnalyticsEvent,\n AnalyticsManager,\n} from '@internetarchive/analytics-manager';\nimport {\n SearchService,\n SearchServiceInterface,\n SearchType,\n StringField,\n} from '@internetarchive/search-service';\nimport { html, css, LitElement, PropertyValues, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\n\nimport type { ModalManagerInterface } from '@internetarchive/modal-manager';\nimport type { AnalyticsManagerInterface } from '@internetarchive/analytics-manager';\nimport type { CollectionBrowser } from '../src/collection-browser';\n\nimport '../src/collection-browser';\n\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n private searchService: SearchServiceInterface =\n this.initSearchServiceFromUrlParams();\n\n private resizeObserver = new SharedResizeObserver();\n\n @state() private toggleSlots: boolean = false;\n\n @state() private currentPage?: number;\n\n @state() private searchQuery?: string;\n\n @state() private withinCollection?: string;\n\n @state() private cellWidth: number = 18;\n\n @state() private cellHeight: number = 29;\n\n @state() private rowGap: number = 1.7;\n\n @state() private colGap: number = 1.7;\n\n @state() private loggedIn: boolean = false;\n\n @state() private searchType: SearchType = SearchType.METADATA;\n\n @property({ type: Object, reflect: false }) latestAction?: AnalyticsEvent;\n\n @query('#base-query-field') private baseQueryField!: HTMLInputElement;\n\n @query('#base-collection-field')\n private baseCollectionField!: HTMLInputElement;\n\n @query('#page-number-input') private pageNumberInput!: HTMLInputElement;\n\n @query('collection-browser') private collectionBrowser!: CollectionBrowser;\n\n @query('modal-manager') private modalManager!: ModalManagerInterface;\n\n private analyticsManager = new AnalyticsManager();\n\n private analyticsHandler: AnalyticsManagerInterface = {\n sendPing: this.sendAnalytics.bind(this),\n sendEvent: this.sendAnalytics.bind(this),\n sendEventNoSampling: this.sendAnalytics.bind(this),\n };\n\n private sendAnalytics(ae: AnalyticsEvent) {\n console.log('Analytics Received ----', ae);\n this.latestAction = ae;\n this.analyticsManager?.sendEvent(ae);\n }\n\n private initSearchServiceFromUrlParams() {\n const params = new URL(window.location.href).searchParams;\n return new SearchService({\n includeCredentials: false,\n baseUrl: params.get('search_base_url') ?? undefined,\n servicePath: params.get('search_service_path') ?? undefined,\n debuggingEnabled: !!params.get('debugging') ?? undefined,\n });\n }\n\n private searchPressed(e: Event) {\n e.preventDefault();\n this.searchQuery = this.baseQueryField.value;\n this.collectionBrowser.searchType = this.searchType;\n\n this.goToCurrentPage();\n }\n\n private collectionChanged(e: Event) {\n e.preventDefault();\n this.withinCollection = this.baseCollectionField.value;\n this.collectionBrowser.withinCollection = this.withinCollection;\n\n this.goToCurrentPage();\n }\n\n private goToCurrentPage() {\n const page = this.currentPage ?? 1;\n if (page > 1) {\n this.collectionBrowser.goToPage(page);\n }\n }\n\n private changePagePressed(e: Event) {\n e.preventDefault();\n this.currentPage = this.pageNumberInput.valueAsNumber;\n this.collectionBrowser.goToPage(this.currentPage);\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has('currentPage') && this.currentPage) {\n this.pageNumberInput.value = this.currentPage.toString();\n }\n\n if (changed.has('searchQuery')) {\n this.queryUpdated();\n }\n }\n\n private queryUpdated() {\n this.collectionBrowser.baseQuery = this.searchQuery;\n }\n\n private get getClass() {\n const searchParams = new URLSearchParams(window.location.search);\n\n return searchParams.get('hide-dev-tools') ? 'hidden' : '';\n }\n\n render() {\n return html`\n <div class=\"dev-tool-container\">\n <div id=\"dev-tools\" class=${this.getClass}>\n <div id=\"search-and-page-inputs\">\n <form @submit=${this.searchPressed}>\n <label for=\"base-query-field\"> Query: </label>\n <input\n type=\"text\"\n id=\"base-query-field\"\n .value=${this.searchQuery ?? ''}\n />\n <input type=\"submit\" value=\"Search\" />\n </form>\n <form @submit=${this.changePagePressed}>\n <label for=\"page-number-input\"> Page: </label>\n <input type=\"number\" value=\"1\" id=\"page-number-input\" />\n <input type=\"submit\" value=\"Go\" />\n </form>\n </div>\n <div>\n <form @submit=${this.collectionChanged}>\n <label for=\"base-collection-field\"> Within collection: </label>\n <input\n type=\"text\"\n id=\"base-collection-field\"\n .value=${this.withinCollection ?? ''}\n />\n <input type=\"submit\" value=\"Search\" />\n </form>\n </div>\n\n <div id=\"search-types\">\n Search type:\n <span class=\"search-type\">\n <input\n type=\"radio\"\n id=\"metadata-search\"\n name=\"search-type\"\n value=\"metadata\"\n .checked=${this.searchType === SearchType.METADATA}\n @click=${this.searchTypeSelected}\n />\n <label for=\"metadata-search\">Metadata</label>\n </span>\n <span class=\"search-type\">\n <input\n type=\"radio\"\n id=\"fulltext-search\"\n name=\"search-type\"\n value=\"fulltext\"\n .checked=${this.searchType === SearchType.FULLTEXT}\n @click=${this.searchTypeSelected}\n />\n <label for=\"fulltext-search\">Full text</label>\n </span>\n </div>\n\n <div id=\"toggle-controls\">\n <button\n @click=${() => {\n const details =\n this.shadowRoot?.getElementById('cell-size-control');\n details?.classList.toggle('hidden');\n const rowGapControls =\n this.shadowRoot?.getElementById('cell-gap-control');\n rowGapControls?.classList.toggle('hidden');\n }}\n >\n Toggle Cell Controls\n </button>\n <button\n @click=${() => {\n const details = this.shadowRoot?.getElementById(\n 'latest-event-details'\n );\n details?.classList.toggle('hidden');\n }}\n >\n Last Event Captured\n </button>\n </div>\n\n <div id=\"last-event\">\n <pre id=\"latest-event-details\" class=\"hidden\">\n ${JSON.stringify(this.latestAction, null, 2)}\n </pre\n >\n </div>\n\n <fieldset class=\"cell-controls\">\n <legend>Cell Controls</legend>\n <div>\n <label for=\"cell-width-slider\">Cell width:</label>\n <input\n type=\"range\"\n min=\"10\"\n max=\"100\"\n value=\"18\"\n step=\"0.1\"\n id=\"cell-width-slider\"\n @input=${this.widthChanged}\n />\n <span>${this.cellWidth}rem</span>\n </div>\n <div>\n <label for=\"cell-height-slider\">Cell height:</label>\n <input\n type=\"range\"\n min=\"10\"\n max=\"100\"\n value=\"29\"\n step=\"0.1\"\n id=\"cell-height-slider\"\n @input=${this.heightChanged}\n />\n <span>${this.cellHeight}rem</span>\n </div>\n <div>\n <label for=\"cell-row-gap-slider\">Row gap:</label>\n <input\n type=\"range\"\n min=\"0\"\n max=\"5\"\n value=\"1.7\"\n step=\"0.1\"\n id=\"cell-row-gap-slider\"\n @input=${this.rowGapChanged}\n />\n <span>${this.rowGap}rem</span>\n </div>\n <div>\n <label for=\"cell-col-gap-slider\">Col gap:</label>\n <input\n type=\"range\"\n min=\"0\"\n max=\"5\"\n value=\"1.7\"\n step=\"0.1\"\n id=\"cell-col-gap-slider\"\n @input=${this.colGapChanged}\n />\n <span>${this.colGap}rem</span>\n </div>\n </fieldset>\n\n <fieldset class=\"other-controls\">\n <legend>Other Controls</legend>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"simulate-login\"\n @click=${this.loginChanged}\n />\n <label for=\"simulate-login\">Simulate login</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-date-picker\"\n checked\n @click=${this.datePickerChanged}\n />\n <label for=\"enable-date-picker\">Enable date picker</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-facets\"\n checked\n @click=${this.facetsChanged}\n />\n <label for=\"enable-facets\">Enable facets</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-management\"\n @click=${this.manageModeCheckboxChanged}\n />\n <label for=\"enable-management\">Enable manage mode</label>\n </div>\n </fieldset>\n\n <fieldset class=\"cb-visual-appearance\">\n <legend>CB Visual Appearance</legend>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"show-dummy-snippets\"\n @click=${this.snippetsChanged}\n />\n <label for=\"show-dummy-snippets\">Show dummy snippets</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"show-facet-group-outline-check\"\n @click=${this.toggleFacetGroupOutline}\n />\n <label for=\"show-facet-group-outline-check\">\n Show facet group outlines\n </label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"show-outline-check\"\n @click=${this.outlineChanged}\n />\n <label for=\"show-outline-check\">Show cell outlines</label>\n </div>\n </fieldset>\n\n <fieldset class=\"user-profile-controls\">\n <legend>User Profile Controls</legend>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-facet-top-slot\"\n @click=${this.facetTopSlotCheckboxChanged}\n />\n <label for=\"enable-facet-top-slot\">Show facet top slot</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-cb-top-slot\"\n @click=${this.cbTopSlotCheckboxChanged}\n />\n <label for=\"enable-cb-top-slot\">Show CB top slot</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-sortbar-left-slot\"\n @click=${this.sortBarSlotCheckboxChanged}\n />\n <label for=\"enable-sortbar-left-slot\"\n >Show sortbar left slot</label\n >\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-result-last-tile-slot\"\n @click=${this.resultLastTileSlotCheckboxChanged}\n />\n <label for=\"enable-result-last-tile-slot\">\n Show result last tile slot\n </label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-loanstab-topbar-view\"\n @click=${this.loansTabTopBarViewCheckboxChanged}\n />\n <label for=\"enable-loanstab-topbar-view\">\n Show loans-tab top-bar view\n </label>\n </div>\n </fieldset>\n\n <fieldset class=\"user-profile-controls\">\n <legend>Set Placeholder Types</legend>\n <div class=\"checkbox-control\">\n <input\n id=\"enable-loading-placeholder\"\n type=\"radio\"\n @click=${() => this.setPlaceholderType('loading-placeholder')}\n name=\"placeholder-radio\"\n />\n <label for=\"enable-loading-placeholder\"\n >Loading Placeholder</label\n >\n </div>\n <div class=\"checkbox-control\">\n <input\n id=\"enable-empty-placeholder\"\n type=\"radio\"\n @click=${() => this.setPlaceholderType('error-placeholder')}\n value=\"empty-placeholder\"\n name=\"placeholder-radio\"\n />\n <label for=\"enable-empty-placeholder\">Empty Placeholder</label>\n </div>\n </fieldset>\n </div>\n <button id=\"toggle-dev-tools-btn\" @click=${this.toggleDevTools}>\n Toggle Search Controls\n </button>\n </div>\n <div id=\"collection-browser-container\">\n <collection-browser\n .baseNavigationUrl=${'https://archive.org'}\n .baseImageUrl=${'https://archive.org'}\n .searchService=${this.searchService}\n .resizeObserver=${this.resizeObserver}\n .showHistogramDatePicker=${true}\n .loggedIn=${this.loggedIn}\n .modalManager=${this.modalManager}\n .analyticsHandler=${this.analyticsHandler}\n @visiblePageChanged=${this.visiblePageChanged}\n @baseQueryChanged=${this.baseQueryChanged}\n @searchTypeChanged=${this.searchTypeChanged}\n @manageModeChanged=${this.manageModeChanged}\n >\n ${this.toggleSlots\n ? html`<div slot=\"sortbar-left-slot\">Sort Slot</div>`\n : nothing}\n ${this.toggleSlots\n ? html`<div slot=\"facet-top-slot\">Facet Slot</div>`\n : nothing}\n </collection-browser>\n </div>\n <modal-manager></modal-manager>\n `;\n }\n\n private async setPlaceholderType(type: String) {\n switch (type) {\n case 'loading-placeholder':\n this.collectionBrowser.baseQuery = '';\n this.collectionBrowser.suppressPlaceholders = true;\n this.collectionBrowser.clearResultsOnEmptyQuery = true;\n this.requestUpdate();\n await this.collectionBrowser.updateComplete;\n break;\n default:\n break;\n }\n }\n\n private baseQueryChanged(e: CustomEvent<{ baseQuery?: string }>): void {\n this.searchQuery = e.detail.baseQuery;\n }\n\n /** Handler for search type changes coming from collection browser */\n private searchTypeChanged(e: CustomEvent<SearchType>): void {\n this.searchType = e.detail;\n }\n\n /** Handler for user input selecting a search type */\n private searchTypeSelected(e: Event) {\n const target = e.target as HTMLInputElement;\n this.searchType =\n target.value === 'fulltext' ? SearchType.FULLTEXT : SearchType.METADATA;\n }\n\n private loginChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n if (target.checked) {\n this.loggedIn = true;\n } else {\n this.loggedIn = false;\n }\n }\n\n private outlineChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n if (target.checked) {\n this.collectionBrowser.style.setProperty(\n '--infiniteScrollerCellOutline',\n '1px solid #33D1FF'\n );\n } else {\n this.collectionBrowser.style.removeProperty(\n '--infiniteScrollerCellOutline'\n );\n }\n }\n\n private toggleDevTools() {\n const pageUrl = new URL(window.location.href);\n const { searchParams } = pageUrl;\n\n if (searchParams.get('hide-dev-tools')) {\n searchParams.delete('hide-dev-tools');\n } else {\n searchParams.set('hide-dev-tools', 'true');\n }\n\n this.shadowRoot?.getElementById('dev-tools')?.classList.toggle('hidden');\n\n if (window.history.replaceState) {\n window.history.replaceState(\n {\n path: pageUrl.toString(),\n },\n '',\n pageUrl.toString()\n );\n }\n }\n\n private toggleFacetGroupOutline(e: Event) {\n const target = e.target as HTMLInputElement;\n if (target.checked) {\n this.collectionBrowser.classList.add('showFacetGroupOutlines');\n this.modalManager.classList.add('showFacetGroupOutlines');\n } else {\n this.collectionBrowser.classList.remove('showFacetGroupOutlines');\n this.modalManager.classList.remove('showFacetGroupOutlines');\n }\n }\n\n private async snippetsChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n if (target.checked) {\n // Decorate the default search service with a wrapper that adds\n // dummy snippets to any successful searches\n this.searchService = {\n async search(params, searchType) {\n const searchResponse = await SearchService.default.search(\n params,\n searchType\n );\n searchResponse.success?.response.results.forEach(result => {\n Object.defineProperty(result, 'highlight', {\n value: new StringField([\n 'this is a text {{{snippet}}} block with potentially',\n 'multiple {{{snippets}}} and such',\n 'but the {{{snippet}}} block may be quite long perhaps',\n 'depending on how many {{{snippet}}} matches there are',\n 'there may be multiple lines of {{{snippets}}} to show',\n 'but each {{{snippet}}} should be relatively short',\n 'and {{{snippets}}} are each a {{{snippet}}} of text',\n 'but every {{{snippet}}} might have multiple matches',\n 'the {{{snippets}}} should be separated and surrounded by ellipses',\n ]),\n });\n });\n return searchResponse;\n },\n };\n } else {\n // Restore the default seach service\n this.searchService = SearchService.default;\n }\n\n // Re-perform the current search to show/hide the snippets immediately\n this.reperformCurrentSearch();\n }\n\n private async reperformCurrentSearch(): Promise<void> {\n const oldQuery = this.searchQuery;\n this.searchQuery = ''; // Should just reset to the placeholder\n await this.updateComplete;\n // For unclear reasons, Safari refuses to re-apply the old query until the next tick, hence:\n await new Promise(res => {\n setTimeout(res, 0);\n });\n this.searchQuery = oldQuery; // Re-apply the original query\n }\n\n private datePickerChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n this.collectionBrowser.showHistogramDatePicker = target.checked;\n\n // When disabling the date picker from the demo app, also clear any existing date range params\n if (!this.collectionBrowser.showHistogramDatePicker) {\n this.collectionBrowser.minSelectedDate = undefined;\n this.collectionBrowser.maxSelectedDate = undefined;\n }\n }\n\n private facetsChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n this.collectionBrowser.suppressFacets = !target.checked;\n }\n\n /**\n * Handler for when collection browser's manage mode changes.\n * This lets us disable the checkbox in the dev panel when the user cancels out\n * of manage mode from within collection browser.\n */\n private manageModeChanged(e: CustomEvent<boolean>): void {\n const manageCheckbox = this.shadowRoot?.querySelector(\n '#enable-management'\n ) as HTMLInputElement;\n if (manageCheckbox) manageCheckbox.checked = e.detail;\n }\n\n /**\n * Handler for when the dev panel's \"Enable manage mode\" checkbox is changed.\n */\n private manageModeCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n this.collectionBrowser.isManageView = target.checked;\n }\n\n /**\n * Handler for when the dev panel's \"Show facet top slot\" checkbox is changed.\n */\n private facetTopSlotCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const p = document.createElement('p');\n p.style.setProperty('border', '1px solid #000');\n p.textContent = 'New stuff as a child.';\n p.style.setProperty('height', '20rem');\n p.style.backgroundColor = '#00000';\n p.setAttribute('slot', 'facet-top-slot');\n\n if (target.checked) {\n this.collectionBrowser.appendChild(p);\n } else {\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n private toggleSlotOptions() {\n this.toggleSlots = !this.toggleSlots;\n }\n\n private resultLastTileSlotCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const div = document.createElement('div');\n const title = document.createElement('h3');\n title.textContent = 'Upload';\n\n div.setAttribute('slot', 'result-last-tile');\n div.setAttribute('class', 'result-last-tile');\n div.appendChild(title);\n\n if (target.checked) {\n this.collectionBrowser.appendChild(div);\n } else {\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n /**\n * Handler for when the dev panel's \"Show cb top slot\" checkbox is changed.\n */\n private cbTopSlotCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const p = document.createElement('p');\n p.style.setProperty('border', '1px solid #000');\n p.textContent = 'My Favorite list header.';\n p.style.setProperty('height', '10rem');\n p.style.backgroundColor = '#00000';\n p.setAttribute('slot', 'cb-top-slot');\n\n if (target.checked) {\n this.collectionBrowser.appendChild(p);\n } else {\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n /**\n * Handler for when the dev panel's \"Show facet top slot\" checkbox is changed.\n */\n private sortBarSlotCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const div = document.createElement('div');\n div.style.setProperty('border', '1px solid #000');\n div.textContent = 'Btn';\n div.style.setProperty('height', '3rem');\n div.style.setProperty('width', '3rem');\n div.style.backgroundColor = '#00000';\n div.setAttribute('slot', 'sortbar-left-slot');\n\n if (target.checked) {\n this.collectionBrowser.appendChild(div);\n } else {\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n private rowGapChanged(e: Event) {\n const input = e.target as HTMLInputElement;\n this.rowGap = parseFloat(input.value);\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserRowGap',\n `${input.value}rem`\n );\n }\n\n private colGapChanged(e: Event) {\n const input = e.target as HTMLInputElement;\n this.colGap = parseFloat(input.value);\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserColGap',\n `${input.value}rem`\n );\n }\n\n private widthChanged(e: Event) {\n const input = e.target as HTMLInputElement;\n this.cellWidth = parseFloat(input.value);\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserCellMinWidth',\n `${input.value}rem`\n );\n }\n\n private heightChanged(e: Event) {\n const input = e.target as HTMLInputElement;\n this.cellHeight = parseFloat(input.value);\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserCellMinHeight',\n `${input.value}rem`\n );\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserCellMaxHeight',\n `${input.value}rem`\n );\n }\n\n private visiblePageChanged(e: CustomEvent<{ pageNumber: number }>) {\n const { pageNumber } = e.detail;\n if (pageNumber === this.currentPage) return;\n this.currentPage = pageNumber;\n }\n\n /**\n * Handler for when the dev panel's \"Show loanstab topbar view\" checkbox is changed.\n */\n private loansTabTopBarViewCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const p = document.createElement('p');\n p.style.setProperty('border', '1px solid #000');\n p.textContent = 'New stuff as a child.';\n p.style.setProperty('height', '20px');\n p.style.backgroundColor = '#00000';\n p.setAttribute('slot', 'loans-tab-filter-bar-options-slot');\n\n if (target.checked) {\n this.collectionBrowser.isLoansTab = true;\n this.collectionBrowser.appendChild(p);\n } else {\n this.collectionBrowser.isLoansTab = false;\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n static styles = css`\n :host {\n display: block;\n --primaryButtonBGColor: #194880;\n --ia-theme-link-color: #4b64ff;\n }\n\n /* add the following styles to ensure proper modal visibility */\n body.modal-manager-open {\n overflow: hidden;\n }\n modal-manager {\n display: none;\n }\n modal-manager[mode='open'] {\n display: block;\n }\n modal-manager.more-search-facets {\n --modalWidth: 85rem;\n --modalBorder: 2px solid var(--primaryButtonBGColor, #194880);\n --modalTitleLineHeight: 4rem;\n --modalTitleFontSize: 1.8rem;\n --modalCornerRadius: 0;\n --modalBottomPadding: 0;\n --modalBottomMargin: 0;\n --modalScrollOffset: 0;\n --modalCornerRadius: 0.5rem;\n }\n modal-manager.expanded-date-picker {\n --modalWidth: 58rem;\n --modalBorder: 2px solid var(--primaryButtonBGColor, #194880);\n --modalTitleLineHeight: 4rem;\n --modalTitleFontSize: 1.8rem;\n --modalCornerRadius: 0;\n --modalBottomPadding: 0;\n --modalBottomMargin: 0;\n --modalScrollOffset: 0;\n --modalCornerRadius: 0.5rem;\n }\n\n input,\n button {\n font-size: 1.6rem;\n }\n\n modal-manager.showFacetGroupOutlines,\n collection-browser.showFacetGroupOutlines {\n --facet-row-border-top: 1px solid red;\n --facet-row-border-bottom: 1px solid blue;\n }\n\n collection-browser {\n /* Same as production */\n max-width: 135rem;\n margin: auto;\n }\n\n #collection-browser-container {\n /* Same as production */\n padding-left: 0.5rem;\n margin-bottom: 2rem;\n }\n\n #base-query-field {\n width: 300px;\n }\n\n .dev-tool-container {\n position: relative;\n }\n #dev-tools {\n position: relative;\n top: 0;\n left: 0;\n z-index: 1;\n -webkit-backdrop-filter: blur(10px);\n backdrop-filter: blur(10px);\n padding: 0.5rem 1rem;\n border: 1px solid black;\n font-size: 1.4rem;\n background: #ffffffb3;\n }\n\n #dev-tools > * {\n display: flex;\n }\n\n #toggle-dev-tools-btn {\n position: fixed;\n left: 77.4%;\n top: 0;\n background: red;\n padding: 5px;\n color: white;\n font-size: 1.4rem;\n margin: 0;\n z-index: 1;\n cursor: pointer;\n }\n\n #search-and-page-inputs {\n flex-wrap: wrap;\n row-gap: 2px;\n }\n\n #search-and-page-inputs > form {\n margin-right: 1rem;\n }\n\n #search-and-page-inputs label {\n display: inline-block;\n min-width: 50px;\n }\n\n #page-number-input {\n width: 75px;\n }\n\n .search-type {\n margin-right: 1rem;\n }\n\n .cell-controls {\n display: flex;\n flex-wrap: wrap;\n }\n .cell-controls div {\n display: flex;\n align-items: center;\n }\n .cell-controls input[type='range'] {\n width: 120px;\n }\n #cell-controls label {\n display: inline-block;\n width: 10rem;\n }\n\n #cell-size-control,\n #cell-gap-control {\n flex-basis: calc(50% - 1rem);\n flex-grow: 1;\n }\n\n #cell-gap-control {\n margin-left: 1rem;\n }\n\n #checkbox-controls {\n padding-top: 0.5rem;\n flex-wrap: wrap;\n }\n\n .checkbox-control {\n flex-basis: 50%;\n }\n .checkbox-control label {\n user-select: none;\n }\n\n #last-event {\n background-color: aliceblue;\n padding: 5px;\n margin: 5px auto;\n }\n\n .hidden {\n display: none;\n }\n\n #toggle-controls {\n background-color: lightskyblue;\n padding: 5px;\n margin: 5px auto;\n }\n\n #search-types {\n margin: 5px auto;\n background-color: aliceblue;\n font-size: 1.6rem;\n }\n\n // slots\n div[slot='cb-top-slot'] {\n height: 50px;\n border: 1px solid red;\n background: bisque;\n }\n div[slot='facet-top-slot'] {\n border: 1px solid red;\n width: 100%;\n height: 150px;\n background-color: darkseagreen;\n }\n div[slot='sort-slot-left'] {\n height: 50px;\n border: 1px solid red;\n background: bisque;\n }\n\n /* user profile controls */\n .user-profile-controls {\n width: fit-content;\n }\n\n fieldset {\n display: inline-block !important;\n }\n\n .result-last-tile {\n border-radius: 4px;\n background-color: white;\n border: 3px dashed #555;\n box-shadow: none;\n display: grid;\n align-content: center;\n }\n .result-last-tile:hover {\n box-shadow: rgba(8, 8, 32, 0.8) 0 0 6px 2px;\n transition: box-shadow 0.1s ease 0s;\n cursor: pointer;\n border: 3px dashed #4b64ff;\n }\n .result-last-tile h3 {\n margin-bottom: 4rem;\n margin: 0px auto;\n font-size: 2.8rem;\n color: rgb(44, 44, 44);\n font-weight: 200;\n text-align: center;\n }\n `;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"app-root.js","sourceRoot":"","sources":["../../src/app-root.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,OAAO,EAEL,gBAAgB,GACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,aAAa,EAEb,UAAU,EACV,WAAW,GACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAkB,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAM/E,OAAO,2BAA2B,CAAC;AAGnC,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,UAAU;IAAvC;;QACU,kBAAa,GACnB,IAAI,CAAC,8BAA8B,EAAE,CAAC;QAEhC,mBAAc,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAEnC,gBAAW,GAAY,KAAK,CAAC;QAQ7B,cAAS,GAAW,EAAE,CAAC;QAEvB,eAAU,GAAW,EAAE,CAAC;QAExB,WAAM,GAAW,GAAG,CAAC;QAErB,WAAM,GAAW,GAAG,CAAC;QAErB,aAAQ,GAAY,KAAK,CAAC;QAE1B,eAAU,GAAe,UAAU,CAAC,QAAQ,CAAC;QAetD,qBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAE1C,qBAAgB,GAA8B;YACpD,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;YACvC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;YACxC,mBAAmB,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;SACnD,CAAC;IAg+BJ,CAAC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;AAE7B;IAAR,KAAK,EAAE;uCAA8B;AAE7B;IAAR,KAAK,EAAE;yCAAmC;AAElC;IAAR,KAAK,EAAE;2CAAsD;AAElB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;6CAA+B;AAE9C;IAA3B,KAAK,CAAC,mBAAmB,CAAC;+CAA2C;AAGtE;IADC,KAAK,CAAC,wBAAwB,CAAC;oDACe;AAElB;IAA5B,KAAK,CAAC,oBAAoB,CAAC;gDAA4C;AAE3C;IAA5B,KAAK,CAAC,oBAAoB,CAAC;kDAA+C;AAEnD;IAAvB,KAAK,CAAC,eAAe,CAAC;6CAA8C;AArC1D,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CA6gCnB;SA7gCY,OAAO","sourcesContent":["/* eslint-disable no-console */\nimport {\n AnalyticsEvent,\n AnalyticsManager,\n} from '@internetarchive/analytics-manager';\nimport {\n SearchService,\n SearchServiceInterface,\n SearchType,\n StringField,\n} from '@internetarchive/search-service';\nimport { html, css, LitElement, PropertyValues, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { SharedResizeObserver } from '@internetarchive/shared-resize-observer';\n\nimport type { ModalManagerInterface } from '@internetarchive/modal-manager';\nimport type { AnalyticsManagerInterface } from '@internetarchive/analytics-manager';\nimport type { CollectionBrowser } from '../src/collection-browser';\n\nimport '../src/collection-browser';\n\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n private searchService: SearchServiceInterface =\n this.initSearchServiceFromUrlParams();\n\n private resizeObserver = new SharedResizeObserver();\n\n @state() private toggleSlots: boolean = false;\n\n @state() private currentPage?: number;\n\n @state() private searchQuery?: string;\n\n @state() private withinCollection?: string;\n\n @state() private cellWidth: number = 18;\n\n @state() private cellHeight: number = 29;\n\n @state() private rowGap: number = 1.7;\n\n @state() private colGap: number = 1.7;\n\n @state() private loggedIn: boolean = false;\n\n @state() private searchType: SearchType = SearchType.METADATA;\n\n @property({ type: Object, reflect: false }) latestAction?: AnalyticsEvent;\n\n @query('#base-query-field') private baseQueryField!: HTMLInputElement;\n\n @query('#base-collection-field')\n private baseCollectionField!: HTMLInputElement;\n\n @query('#page-number-input') private pageNumberInput!: HTMLInputElement;\n\n @query('collection-browser') private collectionBrowser!: CollectionBrowser;\n\n @query('modal-manager') private modalManager!: ModalManagerInterface;\n\n private analyticsManager = new AnalyticsManager();\n\n private analyticsHandler: AnalyticsManagerInterface = {\n sendPing: this.sendAnalytics.bind(this),\n sendEvent: this.sendAnalytics.bind(this),\n sendEventNoSampling: this.sendAnalytics.bind(this),\n };\n\n private sendAnalytics(ae: AnalyticsEvent) {\n console.log('Analytics Received ----', ae);\n this.latestAction = ae;\n this.analyticsManager?.sendEvent(ae);\n }\n\n private initSearchServiceFromUrlParams() {\n const params = new URL(window.location.href).searchParams;\n return new SearchService({\n includeCredentials: false,\n baseUrl: params.get('search_base_url') ?? undefined,\n servicePath: params.get('search_service_path') ?? undefined,\n debuggingEnabled: !!params.get('debugging') ?? undefined,\n });\n }\n\n private searchPressed(e: Event) {\n e.preventDefault();\n this.searchQuery = this.baseQueryField.value;\n this.collectionBrowser.searchType = this.searchType;\n\n this.goToCurrentPage();\n }\n\n private collectionChanged(e: Event) {\n e.preventDefault();\n this.withinCollection = this.baseCollectionField.value;\n this.collectionBrowser.withinCollection = this.withinCollection;\n\n this.goToCurrentPage();\n }\n\n private goToCurrentPage() {\n const page = this.currentPage ?? 1;\n if (page > 1) {\n this.collectionBrowser.goToPage(page);\n }\n }\n\n private changePagePressed(e: Event) {\n e.preventDefault();\n this.currentPage = this.pageNumberInput.valueAsNumber;\n this.collectionBrowser.goToPage(this.currentPage);\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has('currentPage') && this.currentPage) {\n this.pageNumberInput.value = this.currentPage.toString();\n }\n\n if (changed.has('searchQuery')) {\n this.queryUpdated();\n }\n }\n\n private queryUpdated() {\n this.collectionBrowser.baseQuery = this.searchQuery;\n }\n\n private get getClass() {\n const searchParams = new URLSearchParams(window.location.search);\n\n return searchParams.get('hide-dev-tools') ? 'hidden' : '';\n }\n\n render() {\n return html`\n <div class=\"dev-tool-container\">\n <div id=\"dev-tools\" class=${this.getClass}>\n <div id=\"search-and-page-inputs\">\n <form @submit=${this.searchPressed}>\n <label for=\"base-query-field\"> Query: </label>\n <input\n type=\"text\"\n id=\"base-query-field\"\n .value=${this.searchQuery ?? ''}\n />\n <input type=\"submit\" value=\"Search\" />\n </form>\n <form @submit=${this.changePagePressed}>\n <label for=\"page-number-input\"> Page: </label>\n <input type=\"number\" value=\"1\" id=\"page-number-input\" />\n <input type=\"submit\" value=\"Go\" />\n </form>\n </div>\n <div>\n <form @submit=${this.collectionChanged}>\n <label for=\"base-collection-field\"> Within collection: </label>\n <input\n type=\"text\"\n id=\"base-collection-field\"\n .value=${this.withinCollection ?? ''}\n />\n <input type=\"submit\" value=\"Search\" />\n </form>\n </div>\n\n <div id=\"search-types\">\n Search type:\n <span class=\"search-type\">\n <input\n type=\"radio\"\n id=\"metadata-search\"\n name=\"search-type\"\n value=\"metadata\"\n .checked=${this.searchType === SearchType.METADATA}\n @click=${this.searchTypeSelected}\n />\n <label for=\"metadata-search\">Metadata</label>\n </span>\n <span class=\"search-type\">\n <input\n type=\"radio\"\n id=\"fulltext-search\"\n name=\"search-type\"\n value=\"fulltext\"\n .checked=${this.searchType === SearchType.FULLTEXT}\n @click=${this.searchTypeSelected}\n />\n <label for=\"fulltext-search\">Full text</label>\n </span>\n </div>\n\n <div id=\"toggle-controls\">\n <button\n @click=${() => {\n const details =\n this.shadowRoot?.getElementById('cell-size-control');\n details?.classList.toggle('hidden');\n const rowGapControls =\n this.shadowRoot?.getElementById('cell-gap-control');\n rowGapControls?.classList.toggle('hidden');\n }}\n >\n Toggle Cell Controls\n </button>\n <button\n @click=${() => {\n const details = this.shadowRoot?.getElementById(\n 'latest-event-details'\n );\n details?.classList.toggle('hidden');\n }}\n >\n Last Event Captured\n </button>\n </div>\n\n <div id=\"last-event\">\n <pre id=\"latest-event-details\" class=\"hidden\">\n ${JSON.stringify(this.latestAction, null, 2)}\n </pre\n >\n </div>\n\n <fieldset class=\"cell-controls\">\n <legend>Cell Controls</legend>\n <div>\n <label for=\"cell-width-slider\">Cell width:</label>\n <input\n type=\"range\"\n min=\"10\"\n max=\"100\"\n value=\"18\"\n step=\"0.1\"\n id=\"cell-width-slider\"\n @input=${this.widthChanged}\n />\n <span>${this.cellWidth}rem</span>\n </div>\n <div>\n <label for=\"cell-height-slider\">Cell height:</label>\n <input\n type=\"range\"\n min=\"10\"\n max=\"100\"\n value=\"29\"\n step=\"0.1\"\n id=\"cell-height-slider\"\n @input=${this.heightChanged}\n />\n <span>${this.cellHeight}rem</span>\n </div>\n <div>\n <label for=\"cell-row-gap-slider\">Row gap:</label>\n <input\n type=\"range\"\n min=\"0\"\n max=\"5\"\n value=\"1.7\"\n step=\"0.1\"\n id=\"cell-row-gap-slider\"\n @input=${this.rowGapChanged}\n />\n <span>${this.rowGap}rem</span>\n </div>\n <div>\n <label for=\"cell-col-gap-slider\">Col gap:</label>\n <input\n type=\"range\"\n min=\"0\"\n max=\"5\"\n value=\"1.7\"\n step=\"0.1\"\n id=\"cell-col-gap-slider\"\n @input=${this.colGapChanged}\n />\n <span>${this.colGap}rem</span>\n </div>\n </fieldset>\n\n <fieldset class=\"other-controls\">\n <legend>Other Controls</legend>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"simulate-login\"\n @click=${this.loginChanged}\n />\n <label for=\"simulate-login\">Simulate login</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-date-picker\"\n checked\n @click=${this.datePickerChanged}\n />\n <label for=\"enable-date-picker\">Enable date picker</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-facets\"\n checked\n @click=${this.facetsChanged}\n />\n <label for=\"enable-facets\">Enable facets</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-management\"\n @click=${this.manageModeCheckboxChanged}\n />\n <label for=\"enable-management\">Enable manage mode</label>\n </div>\n </fieldset>\n\n <fieldset class=\"cb-visual-appearance\">\n <legend>CB Visual Appearance</legend>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"show-dummy-snippets\"\n @click=${this.snippetsChanged}\n />\n <label for=\"show-dummy-snippets\">Show dummy snippets</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"show-dummy-reviews\"\n @click=${this.reviewsChanged}\n />\n <label for=\"show-dummy-reviews\">Show dummy reviews</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"show-facet-group-outline-check\"\n @click=${this.toggleFacetGroupOutline}\n />\n <label for=\"show-facet-group-outline-check\">\n Show facet group outlines\n </label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"show-outline-check\"\n @click=${this.outlineChanged}\n />\n <label for=\"show-outline-check\">Show cell outlines</label>\n </div>\n </fieldset>\n\n <fieldset class=\"user-profile-controls\">\n <legend>User Profile Controls</legend>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-facet-top-slot\"\n @click=${this.facetTopSlotCheckboxChanged}\n />\n <label for=\"enable-facet-top-slot\">Show facet top slot</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-cb-top-slot\"\n @click=${this.cbTopSlotCheckboxChanged}\n />\n <label for=\"enable-cb-top-slot\">Show CB top slot</label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-sortbar-left-slot\"\n @click=${this.sortBarSlotCheckboxChanged}\n />\n <label for=\"enable-sortbar-left-slot\"\n >Show sortbar left slot</label\n >\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-result-last-tile-slot\"\n @click=${this.resultLastTileSlotCheckboxChanged}\n />\n <label for=\"enable-result-last-tile-slot\">\n Show result last tile slot\n </label>\n </div>\n <div class=\"checkbox-control\">\n <input\n type=\"checkbox\"\n id=\"enable-loanstab-topbar-view\"\n @click=${this.loansTabTopBarViewCheckboxChanged}\n />\n <label for=\"enable-loanstab-topbar-view\">\n Show loans-tab top-bar view\n </label>\n </div>\n </fieldset>\n\n <fieldset class=\"user-profile-controls\">\n <legend>Set Placeholder Types</legend>\n <div class=\"checkbox-control\">\n <input\n id=\"enable-loading-placeholder\"\n type=\"radio\"\n @click=${() => this.setPlaceholderType('loading-placeholder')}\n name=\"placeholder-radio\"\n />\n <label for=\"enable-loading-placeholder\"\n >Loading Placeholder</label\n >\n </div>\n <div class=\"checkbox-control\">\n <input\n id=\"enable-empty-placeholder\"\n type=\"radio\"\n @click=${() => this.setPlaceholderType('error-placeholder')}\n value=\"empty-placeholder\"\n name=\"placeholder-radio\"\n />\n <label for=\"enable-empty-placeholder\">Empty Placeholder</label>\n </div>\n </fieldset>\n </div>\n <button id=\"toggle-dev-tools-btn\" @click=${this.toggleDevTools}>\n Toggle Search Controls\n </button>\n </div>\n <div id=\"collection-browser-container\">\n <collection-browser\n .baseNavigationUrl=${'https://archive.org'}\n .baseImageUrl=${'https://archive.org'}\n .searchService=${this.searchService}\n .resizeObserver=${this.resizeObserver}\n .showHistogramDatePicker=${true}\n .loggedIn=${this.loggedIn}\n .modalManager=${this.modalManager}\n .analyticsHandler=${this.analyticsHandler}\n @visiblePageChanged=${this.visiblePageChanged}\n @baseQueryChanged=${this.baseQueryChanged}\n @searchTypeChanged=${this.searchTypeChanged}\n @manageModeChanged=${this.manageModeChanged}\n >\n ${this.toggleSlots\n ? html`<div slot=\"sortbar-left-slot\">Sort Slot</div>`\n : nothing}\n ${this.toggleSlots\n ? html`<div slot=\"facet-top-slot\">Facet Slot</div>`\n : nothing}\n </collection-browser>\n </div>\n <modal-manager></modal-manager>\n `;\n }\n\n private async setPlaceholderType(type: String) {\n switch (type) {\n case 'loading-placeholder':\n this.collectionBrowser.baseQuery = '';\n this.collectionBrowser.suppressPlaceholders = true;\n this.collectionBrowser.clearResultsOnEmptyQuery = true;\n this.requestUpdate();\n await this.collectionBrowser.updateComplete;\n break;\n default:\n break;\n }\n }\n\n private baseQueryChanged(e: CustomEvent<{ baseQuery?: string }>): void {\n this.searchQuery = e.detail.baseQuery;\n }\n\n /** Handler for search type changes coming from collection browser */\n private searchTypeChanged(e: CustomEvent<SearchType>): void {\n this.searchType = e.detail;\n }\n\n /** Handler for user input selecting a search type */\n private searchTypeSelected(e: Event) {\n const target = e.target as HTMLInputElement;\n this.searchType =\n target.value === 'fulltext' ? SearchType.FULLTEXT : SearchType.METADATA;\n }\n\n private loginChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n if (target.checked) {\n this.loggedIn = true;\n } else {\n this.loggedIn = false;\n }\n }\n\n private outlineChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n if (target.checked) {\n this.collectionBrowser.style.setProperty(\n '--infiniteScrollerCellOutline',\n '1px solid #33D1FF'\n );\n } else {\n this.collectionBrowser.style.removeProperty(\n '--infiniteScrollerCellOutline'\n );\n }\n }\n\n private toggleDevTools() {\n const pageUrl = new URL(window.location.href);\n const { searchParams } = pageUrl;\n\n if (searchParams.get('hide-dev-tools')) {\n searchParams.delete('hide-dev-tools');\n } else {\n searchParams.set('hide-dev-tools', 'true');\n }\n\n this.shadowRoot?.getElementById('dev-tools')?.classList.toggle('hidden');\n\n if (window.history.replaceState) {\n window.history.replaceState(\n {\n path: pageUrl.toString(),\n },\n '',\n pageUrl.toString()\n );\n }\n }\n\n private toggleFacetGroupOutline(e: Event) {\n const target = e.target as HTMLInputElement;\n if (target.checked) {\n this.collectionBrowser.classList.add('showFacetGroupOutlines');\n this.modalManager.classList.add('showFacetGroupOutlines');\n } else {\n this.collectionBrowser.classList.remove('showFacetGroupOutlines');\n this.modalManager.classList.remove('showFacetGroupOutlines');\n }\n }\n\n private async snippetsChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n if (target.checked) {\n // Decorate the default search service with a wrapper that adds\n // dummy snippets to any successful searches\n this.searchService = {\n async search(params, searchType) {\n const searchResponse = await SearchService.default.search(\n params,\n searchType\n );\n searchResponse.success?.response.results.forEach(result => {\n Object.defineProperty(result, 'highlight', {\n value: new StringField([\n 'this is a text {{{snippet}}} block with potentially',\n 'multiple {{{snippets}}} and such',\n 'but the {{{snippet}}} block may be quite long perhaps',\n 'depending on how many {{{snippet}}} matches there are',\n 'there may be multiple lines of {{{snippets}}} to show',\n 'but each {{{snippet}}} should be relatively short',\n 'and {{{snippets}}} are each a {{{snippet}}} of text',\n 'but every {{{snippet}}} might have multiple matches',\n 'the {{{snippets}}} should be separated and surrounded by ellipses',\n ]),\n });\n });\n return searchResponse;\n },\n };\n } else {\n // Restore the default seach service\n this.searchService = SearchService.default;\n }\n\n // Re-perform the current search to show/hide the snippets immediately\n this.reperformCurrentSearch();\n }\n\n private async reviewsChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n if (target.checked) {\n // Decorate the default search service with a wrapper that adds\n // dummy reviews to any successful searches\n this.searchService = {\n async search(params, searchType) {\n const searchResponse = await SearchService.default.search(\n params,\n searchType\n );\n searchResponse.success?.response.results.forEach((result, i) => {\n Object.defineProperty(result, 'review', {\n value: {\n title: 'My Great Review',\n body: \"This item is really great and that's why I'm leaving this review on it and giving it so many star...\",\n stars: (i + 3) % 6,\n },\n });\n });\n return searchResponse;\n },\n };\n } else {\n // Restore the default seach service\n this.searchService = SearchService.default;\n }\n\n // Re-perform the current search to show/hide the reviews immediately\n this.reperformCurrentSearch();\n }\n\n private async reperformCurrentSearch(): Promise<void> {\n const oldQuery = this.searchQuery;\n this.searchQuery = '-'; // Should just reset to the placeholder\n await this.updateComplete;\n // For unclear reasons, Safari refuses to re-apply the old query until the next tick, hence:\n await new Promise(res => {\n setTimeout(res, 0);\n });\n this.searchQuery = oldQuery; // Re-apply the original query\n }\n\n private datePickerChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n this.collectionBrowser.showHistogramDatePicker = target.checked;\n\n // When disabling the date picker from the demo app, also clear any existing date range params\n if (!this.collectionBrowser.showHistogramDatePicker) {\n this.collectionBrowser.minSelectedDate = undefined;\n this.collectionBrowser.maxSelectedDate = undefined;\n }\n }\n\n private facetsChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n this.collectionBrowser.suppressFacets = !target.checked;\n }\n\n /**\n * Handler for when collection browser's manage mode changes.\n * This lets us disable the checkbox in the dev panel when the user cancels out\n * of manage mode from within collection browser.\n */\n private manageModeChanged(e: CustomEvent<boolean>): void {\n const manageCheckbox = this.shadowRoot?.querySelector(\n '#enable-management'\n ) as HTMLInputElement;\n if (manageCheckbox) manageCheckbox.checked = e.detail;\n }\n\n /**\n * Handler for when the dev panel's \"Enable manage mode\" checkbox is changed.\n */\n private manageModeCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n this.collectionBrowser.isManageView = target.checked;\n }\n\n /**\n * Handler for when the dev panel's \"Show facet top slot\" checkbox is changed.\n */\n private facetTopSlotCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const p = document.createElement('p');\n p.style.setProperty('border', '1px solid #000');\n p.textContent = 'New stuff as a child.';\n p.style.setProperty('height', '20rem');\n p.style.backgroundColor = '#00000';\n p.setAttribute('slot', 'facet-top-slot');\n\n if (target.checked) {\n this.collectionBrowser.appendChild(p);\n } else {\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n private toggleSlotOptions() {\n this.toggleSlots = !this.toggleSlots;\n }\n\n private resultLastTileSlotCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const div = document.createElement('div');\n const title = document.createElement('h3');\n title.textContent = 'Upload';\n\n div.setAttribute('slot', 'result-last-tile');\n div.setAttribute('class', 'result-last-tile');\n div.appendChild(title);\n\n if (target.checked) {\n this.collectionBrowser.appendChild(div);\n } else {\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n /**\n * Handler for when the dev panel's \"Show cb top slot\" checkbox is changed.\n */\n private cbTopSlotCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const p = document.createElement('p');\n p.style.setProperty('border', '1px solid #000');\n p.textContent = 'My Favorite list header.';\n p.style.setProperty('height', '10rem');\n p.style.backgroundColor = '#00000';\n p.setAttribute('slot', 'cb-top-slot');\n\n if (target.checked) {\n this.collectionBrowser.appendChild(p);\n } else {\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n /**\n * Handler for when the dev panel's \"Show facet top slot\" checkbox is changed.\n */\n private sortBarSlotCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const div = document.createElement('div');\n div.style.setProperty('border', '1px solid #000');\n div.textContent = 'Btn';\n div.style.setProperty('height', '3rem');\n div.style.setProperty('width', '3rem');\n div.style.backgroundColor = '#00000';\n div.setAttribute('slot', 'sortbar-left-slot');\n\n if (target.checked) {\n this.collectionBrowser.appendChild(div);\n } else {\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n private rowGapChanged(e: Event) {\n const input = e.target as HTMLInputElement;\n this.rowGap = parseFloat(input.value);\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserRowGap',\n `${input.value}rem`\n );\n }\n\n private colGapChanged(e: Event) {\n const input = e.target as HTMLInputElement;\n this.colGap = parseFloat(input.value);\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserColGap',\n `${input.value}rem`\n );\n }\n\n private widthChanged(e: Event) {\n const input = e.target as HTMLInputElement;\n this.cellWidth = parseFloat(input.value);\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserCellMinWidth',\n `${input.value}rem`\n );\n }\n\n private heightChanged(e: Event) {\n const input = e.target as HTMLInputElement;\n this.cellHeight = parseFloat(input.value);\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserCellMinHeight',\n `${input.value}rem`\n );\n this.collectionBrowser.style.setProperty(\n '--collectionBrowserCellMaxHeight',\n `${input.value}rem`\n );\n }\n\n private visiblePageChanged(e: CustomEvent<{ pageNumber: number }>) {\n const { pageNumber } = e.detail;\n if (pageNumber === this.currentPage) return;\n this.currentPage = pageNumber;\n }\n\n /**\n * Handler for when the dev panel's \"Show loanstab topbar view\" checkbox is changed.\n */\n private loansTabTopBarViewCheckboxChanged(e: Event) {\n const target = e.target as HTMLInputElement;\n\n const p = document.createElement('p');\n p.style.setProperty('border', '1px solid #000');\n p.textContent = 'New stuff as a child.';\n p.style.setProperty('height', '20px');\n p.style.backgroundColor = '#00000';\n p.setAttribute('slot', 'loans-tab-filter-bar-options-slot');\n\n if (target.checked) {\n this.collectionBrowser.isLoansTab = true;\n this.collectionBrowser.appendChild(p);\n } else {\n this.collectionBrowser.isLoansTab = false;\n this.collectionBrowser.removeChild(\n this.collectionBrowser.lastElementChild as Element\n );\n }\n }\n\n static styles = css`\n :host {\n display: block;\n --primaryButtonBGColor: #194880;\n --ia-theme-link-color: #4b64ff;\n }\n\n /* add the following styles to ensure proper modal visibility */\n body.modal-manager-open {\n overflow: hidden;\n }\n modal-manager {\n display: none;\n }\n modal-manager[mode='open'] {\n display: block;\n }\n modal-manager.more-search-facets {\n --modalWidth: 85rem;\n --modalBorder: 2px solid var(--primaryButtonBGColor, #194880);\n --modalTitleLineHeight: 4rem;\n --modalTitleFontSize: 1.8rem;\n --modalCornerRadius: 0;\n --modalBottomPadding: 0;\n --modalBottomMargin: 0;\n --modalScrollOffset: 0;\n --modalCornerRadius: 0.5rem;\n }\n modal-manager.expanded-date-picker {\n --modalWidth: 58rem;\n --modalBorder: 2px solid var(--primaryButtonBGColor, #194880);\n --modalTitleLineHeight: 4rem;\n --modalTitleFontSize: 1.8rem;\n --modalCornerRadius: 0;\n --modalBottomPadding: 0;\n --modalBottomMargin: 0;\n --modalScrollOffset: 0;\n --modalCornerRadius: 0.5rem;\n }\n\n input,\n button {\n font-size: 1.6rem;\n }\n\n modal-manager.showFacetGroupOutlines,\n collection-browser.showFacetGroupOutlines {\n --facet-row-border-top: 1px solid red;\n --facet-row-border-bottom: 1px solid blue;\n }\n\n collection-browser {\n /* Same as production */\n max-width: 135rem;\n margin: auto;\n }\n\n #collection-browser-container {\n /* Same as production */\n padding-left: 0.5rem;\n margin-bottom: 2rem;\n }\n\n #base-query-field {\n width: 300px;\n }\n\n .dev-tool-container {\n position: relative;\n }\n #dev-tools {\n position: relative;\n top: 0;\n left: 0;\n z-index: 1;\n -webkit-backdrop-filter: blur(10px);\n backdrop-filter: blur(10px);\n padding: 0.5rem 1rem;\n border: 1px solid black;\n font-size: 1.4rem;\n background: #ffffffb3;\n }\n\n #dev-tools > * {\n display: flex;\n }\n\n #toggle-dev-tools-btn {\n position: fixed;\n left: 77.4%;\n top: 0;\n background: red;\n padding: 5px;\n color: white;\n font-size: 1.4rem;\n margin: 0;\n z-index: 1;\n cursor: pointer;\n }\n\n #search-and-page-inputs {\n flex-wrap: wrap;\n row-gap: 2px;\n }\n\n #search-and-page-inputs > form {\n margin-right: 1rem;\n }\n\n #search-and-page-inputs label {\n display: inline-block;\n min-width: 50px;\n }\n\n #page-number-input {\n width: 75px;\n }\n\n .search-type {\n margin-right: 1rem;\n }\n\n .cell-controls {\n display: flex;\n flex-wrap: wrap;\n }\n .cell-controls div {\n display: flex;\n align-items: center;\n }\n .cell-controls input[type='range'] {\n width: 120px;\n }\n #cell-controls label {\n display: inline-block;\n width: 10rem;\n }\n\n #cell-size-control,\n #cell-gap-control {\n flex-basis: calc(50% - 1rem);\n flex-grow: 1;\n }\n\n #cell-gap-control {\n margin-left: 1rem;\n }\n\n #checkbox-controls {\n padding-top: 0.5rem;\n flex-wrap: wrap;\n }\n\n .checkbox-control {\n flex-basis: 50%;\n }\n .checkbox-control label {\n user-select: none;\n }\n\n #last-event {\n background-color: aliceblue;\n padding: 5px;\n margin: 5px auto;\n }\n\n .hidden {\n display: none;\n }\n\n #toggle-controls {\n background-color: lightskyblue;\n padding: 5px;\n margin: 5px auto;\n }\n\n #search-types {\n margin: 5px auto;\n background-color: aliceblue;\n font-size: 1.6rem;\n }\n\n // slots\n div[slot='cb-top-slot'] {\n height: 50px;\n border: 1px solid red;\n background: bisque;\n }\n div[slot='facet-top-slot'] {\n border: 1px solid red;\n width: 100%;\n height: 150px;\n background-color: darkseagreen;\n }\n div[slot='sort-slot-left'] {\n height: 50px;\n border: 1px solid red;\n background: bisque;\n }\n\n /* user profile controls */\n .user-profile-controls {\n width: fit-content;\n }\n\n fieldset {\n display: inline-block !important;\n }\n\n .result-last-tile {\n border-radius: 4px;\n background-color: white;\n border: 3px dashed #555;\n box-shadow: none;\n display: grid;\n align-content: center;\n }\n .result-last-tile:hover {\n box-shadow: rgba(8, 8, 32, 0.8) 0 0 6px 2px;\n transition: box-shadow 0.1s ease 0s;\n cursor: pointer;\n border: 3px dashed #4b64ff;\n }\n .result-last-tile h3 {\n margin-bottom: 4rem;\n margin: 0px auto;\n font-size: 2.8rem;\n color: rgb(44, 44, 44);\n font-weight: 200;\n text-align: center;\n }\n `;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const favoriteFilledIcon: import("lit-html").TemplateResult<
|
|
1
|
+
export declare const favoriteFilledIcon: import("lit-html").TemplateResult<1>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const favoriteFilledIcon =
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
export const favoriteFilledIcon = html `
|
|
3
3
|
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
4
4
|
<path
|
|
5
5
|
d="m81.0388846 100-30.9636029-22.5595033-30.7410319 22.5595033 10.6670595-37.3922042-30.0013093-25.2155916h37.5556428l12.5196389-37.3922042 12.3690754 37.3922042h37.5556429l-29.7034563 25.2155916z"
|
|
6
6
|
fill="#333"
|
|
7
7
|
/>
|
|
8
|
-
<title>Icon of a star, filled in</title>
|
|
9
8
|
</svg>
|
|
10
9
|
`;
|
|
11
10
|
//# sourceMappingURL=favorite-filled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favorite-filled.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/favorite-filled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"favorite-filled.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/favorite-filled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAA;;;;;;;CAOrC,CAAC","sourcesContent":["import { html } from 'lit';\n\nexport const favoriteFilledIcon = html`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m81.0388846 100-30.9636029-22.5595033-30.7410319 22.5595033 10.6670595-37.3922042-30.0013093-25.2155916h37.5556428l12.5196389-37.3922042 12.3690754 37.3922042h37.5556429l-29.7034563 25.2155916z\"\n fill=\"#333\"\n />\n </svg>\n`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const favoriteUnfilledIcon: import("lit-html").TemplateResult<1>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
export const favoriteUnfilledIcon = html `
|
|
3
|
+
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path
|
|
5
|
+
d="m69.0481858 61.4006179 13.2757509 38.38311-32.1794134-24.4730516-32.2508245 24.6893237 13.2757507-38.4552008-31.1694495-21.9945074 38.1677832-.5115002 11.8339172-39.0387916 11.6162817 38.8946104 38.3820179.6556814zm-2.8122554 15.58874-6.7092871-19.2276004 18.0365221-11.7267421-21.6445066.5115-5.9169584-19.5914862-5.9169587 19.5914862-21.6445064-.5115 18.036522 11.7267421-6.5664638 19.3752146 16.0880061-12.3824233z"
|
|
6
|
+
/>
|
|
7
|
+
</svg>
|
|
8
|
+
`;
|
|
9
|
+
//# sourceMappingURL=favorite-unfilled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"favorite-unfilled.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/favorite-unfilled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAA;;;;;;CAMvC,CAAC","sourcesContent":["import { html } from 'lit';\n\nexport const favoriteUnfilledIcon = html`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m69.0481858 61.4006179 13.2757509 38.38311-32.1794134-24.4730516-32.2508245 24.6893237 13.2757507-38.4552008-31.1694495-21.9945074 38.1677832-.5115002 11.8339172-39.0387916 11.6162817 38.8946104 38.3820179.6556814zm-2.8122554 15.58874-6.7092871-19.2276004 18.0365221-11.7267421-21.6445066.5115-5.9169584-19.5914862-5.9169587 19.5914862-21.6445064-.5115 18.036522 11.7267421-6.5664638 19.3752146 16.0880061-12.3824233z\"\n />\n </svg>\n`;\n"]}
|
|
@@ -116,10 +116,20 @@ export interface CollectionBrowserDataSourceInterface extends ReactiveController
|
|
|
116
116
|
/**
|
|
117
117
|
* Adds the given page of tile models to the data source.
|
|
118
118
|
* If the given page number already exists, that page will be overwritten.
|
|
119
|
+
* This method expects that the provided tiles already fit the configured page size; it
|
|
120
|
+
* will not split them into multiple pages.
|
|
119
121
|
* @param pageNum Which page number to add (indexed starting from 1)
|
|
120
122
|
* @param pageTiles The array of tile models for the new page
|
|
121
123
|
*/
|
|
122
124
|
addPage(pageNum: number, pageTiles: TileModel[]): void;
|
|
125
|
+
/**
|
|
126
|
+
* Adds all of the given pages of tile models to the data source, splitting them into
|
|
127
|
+
* multiple pages according to the configured page size if necessary. Any pages that
|
|
128
|
+
* have tiles added by this method will have any existing content overwritten.
|
|
129
|
+
* @param firstPageNum Which page number to start adding pages from (pages are indexed starting from 1)
|
|
130
|
+
* @param tiles The full array of tile models to add across one or more pages
|
|
131
|
+
*/
|
|
132
|
+
addMultiplePages(firstPageNum: number, tiles: TileModel[]): void;
|
|
123
133
|
/**
|
|
124
134
|
* Returns the given page of tile models from the data source.
|
|
125
135
|
* @param pageNum Which page number to get (indexed starting from 1)
|
|
@@ -184,6 +194,11 @@ export interface CollectionBrowserDataSourceInterface extends ReactiveController
|
|
|
184
194
|
* @param pageSize
|
|
185
195
|
*/
|
|
186
196
|
setPageSize(pageSize: number): void;
|
|
197
|
+
/**
|
|
198
|
+
* Sets the total result count for this data source to the given value.
|
|
199
|
+
* @param count The number of total results to set
|
|
200
|
+
*/
|
|
201
|
+
setTotalResultCount(count: number): void;
|
|
187
202
|
/**
|
|
188
203
|
* Sets whether this data source should suppress further data fetches, i.e. ignore any
|
|
189
204
|
* future query changes on its host that would trigger a page/facet fetch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-browser-data-source-interface.js","sourceRoot":"","sources":["../../../src/data-source/collection-browser-data-source-interface.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n FilterMap,\n Aggregation,\n CollectionExtraInfo,\n AccountExtraInfo,\n PageElementMap,\n} from '@internetarchive/search-service';\nimport type { ReactiveController } from 'lit';\nimport type {\n PrefixFilterType,\n PrefixFilterCounts,\n TileModel,\n} from '../models';\nimport type { PageSpecifierParams, CollectionTitles } from './models';\n\nexport interface CollectionBrowserDataSourceInterface\n extends ReactiveController {\n /**\n * How many tile models are present in this data source\n */\n readonly size: number;\n\n /**\n * How many results there are in the full result set for the current query\n * (not necessarily all loaded yet).\n */\n readonly totalResults: number;\n\n /**\n * Whether the host has a valid set of properties for performing a search.\n * For instance, on the search page this requires a valid search service and a\n * non-empty query, while collection pages allow searching with an empty query\n * for MDS but not FTS.\n */\n readonly canPerformSearch: boolean;\n\n /**\n * Whether the end of the set of results for the current query state has been\n * encountered (i.e., the last page of results).\n */\n readonly endOfDataReached: boolean;\n\n /**\n * True if the initial work for a new query state has been completed (i.e., firing initial\n * page/facet requests). False otherwise.\n */\n readonly queryInitialized: boolean;\n\n /**\n * A string key compactly representing the current full search state, which can\n * be used to determine, e.g., when a new search is required or whether an arriving\n * response is outdated.\n */\n readonly pageFetchQueryKey: string;\n\n /**\n * Similar to `pageFetchQueryKey`, but excluding properties that do not affect\n * the validity of a set of facets (e.g., sort).\n */\n readonly facetFetchQueryKey: string;\n\n /**\n * An object representing any collection- or profile-specific properties to be passed along\n * to the search service, specifying the exact page/tab to fetch results for.\n */\n readonly pageSpecifierParams: PageSpecifierParams | null;\n\n /**\n * A FilterMap object representing all filters applied to the current search,\n * including any facets, letter filters, and date ranges.\n */\n readonly filterMap: FilterMap;\n\n /**\n * The full set of aggregations retrieved for the current search.\n */\n readonly aggregations?: Record<string, Aggregation>;\n\n /**\n * The `year_histogram` aggregation retrieved for the current search.\n */\n readonly yearHistogramAggregation?: Aggregation;\n\n /**\n * A map from collection identifiers that appear on hits or aggregations for the\n * current search, to their human-readable collection titles.\n */\n readonly collectionTitles: CollectionTitles;\n\n /**\n * The \"extra info\" package provided by the PPS for collection pages, including details\n * used to populate the target collection header & About tab content.\n */\n readonly collectionExtraInfo?: CollectionExtraInfo;\n\n /**\n * The \"extra info\" package provided by the PPS for profile pages, including details\n * used to populate the profile header.\n */\n readonly accountExtraInfo?: AccountExtraInfo;\n\n /**\n * The set of requested page elements for profile pages, if applicable. These represent\n * any content specific to the current profile tab.\n */\n readonly pageElements?: PageElementMap;\n\n /**\n * An array of the current target collection's parent collections. Should include *all*\n * ancestors in the collection hierarchy, not just the immediate parent.\n */\n readonly parentCollections?: string[];\n\n /**\n * An object storing result counts for the current search bucketed by letter prefix.\n * Keys are the result field on which the prefixes are considered (e.g., title/creator)\n * and values are a Record mapping letters to their counts.\n */\n readonly prefixFilterCountMap: Partial<\n Record<PrefixFilterType, PrefixFilterCounts>\n >;\n\n /**\n * Any error message from the most recent search results response.\n */\n readonly queryErrorMessage?: string;\n\n /**\n * An array of all the tile models whose management checkboxes are checked\n */\n readonly checkedTileModels: TileModel[];\n\n /**\n * An array of all the tile models whose management checkboxes are unchecked\n */\n readonly uncheckedTileModels: TileModel[];\n\n /**\n * A Promise which, after each query change, resolves once the fetches for the initial\n * search have completed. Waits for *both* the hits and aggregations fetches to finish.\n *\n * Ensure you await this component's `updateComplete` promise before awaiting this\n * one, to ensure you do not await an obsolete promise from the previous update.\n */\n readonly initialSearchComplete: Promise<boolean>;\n\n /**\n * Resets the data source to its empty state, with no result pages, aggregations, etc.\n */\n reset(): void;\n\n /**\n * Adds the given page of tile models to the data source.\n * If the given page number already exists, that page will be overwritten.\n * @param pageNum Which page number to add (indexed starting from 1)\n * @param pageTiles The array of tile models for the new page\n */\n addPage(pageNum: number, pageTiles: TileModel[]): void;\n\n /**\n * Returns the given page of tile models from the data source.\n * @param pageNum Which page number to get (indexed starting from 1)\n */\n getPage(pageNum: number): TileModel[];\n\n /**\n * Returns the full set of paged tile models stored in this data source.\n */\n getAllPages(): Record<string, TileModel[]>;\n\n /**\n * Whether the data source contains any tiles for the given page number.\n * @param pageNum Which page number to query (indexed starting from 1)\n */\n hasPage(pageNum: number): boolean;\n\n /**\n * Returns the single tile model appearing at the given index in the\n * data source, with respect to the current page size. Returns `undefined` if\n * the corresponding page is not present on the data source or if it does not\n * contain a tile model at the corresponding index.\n * @param index The 0-based index (within the full data source) of the tile to get\n */\n getTileModelAt(index: number): TileModel | undefined;\n\n /**\n * Returns the first numeric tile index corresponding to the given tile model object,\n * or -1 if the given tile model is not present.\n * @param tile The tile model to search for in the data source\n */\n indexOf(tile: TileModel): number;\n\n /**\n * Requests that the data source fire a backend request for the given page of results.\n * @param pageNum Which page number to fetch results for\n * @param numInitialPages How many pages should be batched together on an initial fetch\n */\n fetchPage(pageNum: number, numInitialPages?: number): Promise<void>;\n\n /**\n * Requests that the data source update its prefix bucket result counts for the given\n * type of prefix filter.\n * @param filterType Which prefixable field to update the buckets for (e.g., title/creator)\n */\n updatePrefixFilterCounts(filterType: PrefixFilterType): Promise<void>;\n\n /**\n * Fetches and caches the prefix filter counts for the current sort type,\n * provided it is one that permits prefix filtering. (If not, this does nothing).\n */\n updatePrefixFiltersForCurrentSort(): Promise<void>;\n\n /**\n * Clears the cached letter counts for both title and creator, and\n * fetches a new set of counts for whichever of them is the currently\n * selected sort option (which may be neither).\n *\n * Call this whenever the counts are invalidated (e.g., by a query change).\n */\n refreshLetterCounts(): void;\n\n /**\n * Returns the current page size of the data source.\n */\n getPageSize(): number;\n\n /**\n * Changes the page size used by the data source, discarding any previously-fetched pages.\n *\n * **Note: this operation will reset any data stored in the data source!**\n * @param pageSize\n */\n setPageSize(pageSize: number): void;\n\n /**\n * Sets whether this data source should suppress further data fetches, i.e. ignore any\n * future query changes on its host that would trigger a page/facet fetch.\n * @param suppressed Whether further fetches for this data source should be suppressed\n */\n setFetchesSuppressed(suppressed: boolean): void;\n\n /**\n * Notifies the data source that a query change has occurred, which may trigger a data\n * reset & new fetches.\n */\n handleQueryChange(): void;\n\n /**\n * Applies the given map function to all of the tile models in every page of the data\n * source.\n * @param callback A callback function to apply on each tile model, as with Array.map\n */\n map(\n callback: (model: TileModel, index: number, array: TileModel[]) => TileModel\n ): void;\n\n /**\n * Checks every tile's management checkbox\n */\n checkAllTiles(): void;\n\n /**\n * Unchecks every tile's management checkbox\n */\n uncheckAllTiles(): void;\n\n /**\n * Removes all tile models that are currently checked & adjusts the paging\n * of the data source to account for any new gaps in the data.\n */\n removeCheckedTiles(): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"collection-browser-data-source-interface.js","sourceRoot":"","sources":["../../../src/data-source/collection-browser-data-source-interface.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n FilterMap,\n Aggregation,\n CollectionExtraInfo,\n AccountExtraInfo,\n PageElementMap,\n} from '@internetarchive/search-service';\nimport type { ReactiveController } from 'lit';\nimport type {\n PrefixFilterType,\n PrefixFilterCounts,\n TileModel,\n} from '../models';\nimport type { PageSpecifierParams, CollectionTitles } from './models';\n\nexport interface CollectionBrowserDataSourceInterface\n extends ReactiveController {\n /**\n * How many tile models are present in this data source\n */\n readonly size: number;\n\n /**\n * How many results there are in the full result set for the current query\n * (not necessarily all loaded yet).\n */\n readonly totalResults: number;\n\n /**\n * Whether the host has a valid set of properties for performing a search.\n * For instance, on the search page this requires a valid search service and a\n * non-empty query, while collection pages allow searching with an empty query\n * for MDS but not FTS.\n */\n readonly canPerformSearch: boolean;\n\n /**\n * Whether the end of the set of results for the current query state has been\n * encountered (i.e., the last page of results).\n */\n readonly endOfDataReached: boolean;\n\n /**\n * True if the initial work for a new query state has been completed (i.e., firing initial\n * page/facet requests). False otherwise.\n */\n readonly queryInitialized: boolean;\n\n /**\n * A string key compactly representing the current full search state, which can\n * be used to determine, e.g., when a new search is required or whether an arriving\n * response is outdated.\n */\n readonly pageFetchQueryKey: string;\n\n /**\n * Similar to `pageFetchQueryKey`, but excluding properties that do not affect\n * the validity of a set of facets (e.g., sort).\n */\n readonly facetFetchQueryKey: string;\n\n /**\n * An object representing any collection- or profile-specific properties to be passed along\n * to the search service, specifying the exact page/tab to fetch results for.\n */\n readonly pageSpecifierParams: PageSpecifierParams | null;\n\n /**\n * A FilterMap object representing all filters applied to the current search,\n * including any facets, letter filters, and date ranges.\n */\n readonly filterMap: FilterMap;\n\n /**\n * The full set of aggregations retrieved for the current search.\n */\n readonly aggregations?: Record<string, Aggregation>;\n\n /**\n * The `year_histogram` aggregation retrieved for the current search.\n */\n readonly yearHistogramAggregation?: Aggregation;\n\n /**\n * A map from collection identifiers that appear on hits or aggregations for the\n * current search, to their human-readable collection titles.\n */\n readonly collectionTitles: CollectionTitles;\n\n /**\n * The \"extra info\" package provided by the PPS for collection pages, including details\n * used to populate the target collection header & About tab content.\n */\n readonly collectionExtraInfo?: CollectionExtraInfo;\n\n /**\n * The \"extra info\" package provided by the PPS for profile pages, including details\n * used to populate the profile header.\n */\n readonly accountExtraInfo?: AccountExtraInfo;\n\n /**\n * The set of requested page elements for profile pages, if applicable. These represent\n * any content specific to the current profile tab.\n */\n readonly pageElements?: PageElementMap;\n\n /**\n * An array of the current target collection's parent collections. Should include *all*\n * ancestors in the collection hierarchy, not just the immediate parent.\n */\n readonly parentCollections?: string[];\n\n /**\n * An object storing result counts for the current search bucketed by letter prefix.\n * Keys are the result field on which the prefixes are considered (e.g., title/creator)\n * and values are a Record mapping letters to their counts.\n */\n readonly prefixFilterCountMap: Partial<\n Record<PrefixFilterType, PrefixFilterCounts>\n >;\n\n /**\n * Any error message from the most recent search results response.\n */\n readonly queryErrorMessage?: string;\n\n /**\n * An array of all the tile models whose management checkboxes are checked\n */\n readonly checkedTileModels: TileModel[];\n\n /**\n * An array of all the tile models whose management checkboxes are unchecked\n */\n readonly uncheckedTileModels: TileModel[];\n\n /**\n * A Promise which, after each query change, resolves once the fetches for the initial\n * search have completed. Waits for *both* the hits and aggregations fetches to finish.\n *\n * Ensure you await this component's `updateComplete` promise before awaiting this\n * one, to ensure you do not await an obsolete promise from the previous update.\n */\n readonly initialSearchComplete: Promise<boolean>;\n\n /**\n * Resets the data source to its empty state, with no result pages, aggregations, etc.\n */\n reset(): void;\n\n /**\n * Adds the given page of tile models to the data source.\n * If the given page number already exists, that page will be overwritten.\n * This method expects that the provided tiles already fit the configured page size; it\n * will not split them into multiple pages.\n * @param pageNum Which page number to add (indexed starting from 1)\n * @param pageTiles The array of tile models for the new page\n */\n addPage(pageNum: number, pageTiles: TileModel[]): void;\n\n /**\n * Adds all of the given pages of tile models to the data source, splitting them into\n * multiple pages according to the configured page size if necessary. Any pages that\n * have tiles added by this method will have any existing content overwritten.\n * @param firstPageNum Which page number to start adding pages from (pages are indexed starting from 1)\n * @param tiles The full array of tile models to add across one or more pages\n */\n addMultiplePages(firstPageNum: number, tiles: TileModel[]): void;\n\n /**\n * Returns the given page of tile models from the data source.\n * @param pageNum Which page number to get (indexed starting from 1)\n */\n getPage(pageNum: number): TileModel[];\n\n /**\n * Returns the full set of paged tile models stored in this data source.\n */\n getAllPages(): Record<string, TileModel[]>;\n\n /**\n * Whether the data source contains any tiles for the given page number.\n * @param pageNum Which page number to query (indexed starting from 1)\n */\n hasPage(pageNum: number): boolean;\n\n /**\n * Returns the single tile model appearing at the given index in the\n * data source, with respect to the current page size. Returns `undefined` if\n * the corresponding page is not present on the data source or if it does not\n * contain a tile model at the corresponding index.\n * @param index The 0-based index (within the full data source) of the tile to get\n */\n getTileModelAt(index: number): TileModel | undefined;\n\n /**\n * Returns the first numeric tile index corresponding to the given tile model object,\n * or -1 if the given tile model is not present.\n * @param tile The tile model to search for in the data source\n */\n indexOf(tile: TileModel): number;\n\n /**\n * Requests that the data source fire a backend request for the given page of results.\n * @param pageNum Which page number to fetch results for\n * @param numInitialPages How many pages should be batched together on an initial fetch\n */\n fetchPage(pageNum: number, numInitialPages?: number): Promise<void>;\n\n /**\n * Requests that the data source update its prefix bucket result counts for the given\n * type of prefix filter.\n * @param filterType Which prefixable field to update the buckets for (e.g., title/creator)\n */\n updatePrefixFilterCounts(filterType: PrefixFilterType): Promise<void>;\n\n /**\n * Fetches and caches the prefix filter counts for the current sort type,\n * provided it is one that permits prefix filtering. (If not, this does nothing).\n */\n updatePrefixFiltersForCurrentSort(): Promise<void>;\n\n /**\n * Clears the cached letter counts for both title and creator, and\n * fetches a new set of counts for whichever of them is the currently\n * selected sort option (which may be neither).\n *\n * Call this whenever the counts are invalidated (e.g., by a query change).\n */\n refreshLetterCounts(): void;\n\n /**\n * Returns the current page size of the data source.\n */\n getPageSize(): number;\n\n /**\n * Changes the page size used by the data source, discarding any previously-fetched pages.\n *\n * **Note: this operation will reset any data stored in the data source!**\n * @param pageSize\n */\n setPageSize(pageSize: number): void;\n\n /**\n * Sets the total result count for this data source to the given value.\n * @param count The number of total results to set\n */\n setTotalResultCount(count: number): void;\n\n /**\n * Sets whether this data source should suppress further data fetches, i.e. ignore any\n * future query changes on its host that would trigger a page/facet fetch.\n * @param suppressed Whether further fetches for this data source should be suppressed\n */\n setFetchesSuppressed(suppressed: boolean): void;\n\n /**\n * Notifies the data source that a query change has occurred, which may trigger a data\n * reset & new fetches.\n */\n handleQueryChange(): void;\n\n /**\n * Applies the given map function to all of the tile models in every page of the data\n * source.\n * @param callback A callback function to apply on each tile model, as with Array.map\n */\n map(\n callback: (model: TileModel, index: number, array: TileModel[]) => TileModel\n ): void;\n\n /**\n * Checks every tile's management checkbox\n */\n checkAllTiles(): void;\n\n /**\n * Unchecks every tile's management checkbox\n */\n uncheckAllTiles(): void;\n\n /**\n * Removes all tile models that are currently checked & adjusts the paging\n * of the data source to account for any new gaps in the data.\n */\n removeCheckedTiles(): void;\n}\n"]}
|
|
@@ -130,6 +130,10 @@ export declare class CollectionBrowserDataSource implements CollectionBrowserDat
|
|
|
130
130
|
* @inheritdoc
|
|
131
131
|
*/
|
|
132
132
|
addPage(pageNum: number, pageTiles: TileModel[]): void;
|
|
133
|
+
/**
|
|
134
|
+
* @inheritdoc
|
|
135
|
+
*/
|
|
136
|
+
addMultiplePages(firstPageNum: number, tiles: TileModel[]): void;
|
|
133
137
|
/**
|
|
134
138
|
* @inheritdoc
|
|
135
139
|
*/
|
|
@@ -158,6 +162,10 @@ export declare class CollectionBrowserDataSource implements CollectionBrowserDat
|
|
|
158
162
|
* @inheritdoc
|
|
159
163
|
*/
|
|
160
164
|
setPageSize(pageSize: number): void;
|
|
165
|
+
/**
|
|
166
|
+
* @inheritdoc
|
|
167
|
+
*/
|
|
168
|
+
setTotalResultCount(count: number): void;
|
|
161
169
|
/**
|
|
162
170
|
* @inheritdoc
|
|
163
171
|
*/
|
|
@@ -332,7 +340,7 @@ export declare class CollectionBrowserDataSource implements CollectionBrowserDat
|
|
|
332
340
|
* @param pageNumber
|
|
333
341
|
* @param results
|
|
334
342
|
*/
|
|
335
|
-
private
|
|
343
|
+
private addFetchedResultsToDataSource;
|
|
336
344
|
/**
|
|
337
345
|
* Fetches the aggregation buckets for the given prefix filter type.
|
|
338
346
|
*/
|
|
@@ -203,13 +203,11 @@ export class CollectionBrowserDataSource {
|
|
|
203
203
|
this.queryErrorMessage = undefined;
|
|
204
204
|
this.offset = 0;
|
|
205
205
|
this.numTileModels = 0;
|
|
206
|
-
this.totalResults = 0;
|
|
207
206
|
this.endOfDataReached = false;
|
|
208
207
|
this.queryInitialized = false;
|
|
209
208
|
// Invalidate any fetches in progress
|
|
210
209
|
this.fetchesInProgress.clear();
|
|
211
|
-
|
|
212
|
-
this.host.setTotalResultCount(0);
|
|
210
|
+
this.setTotalResultCount(0);
|
|
213
211
|
this.requestHostUpdate();
|
|
214
212
|
}
|
|
215
213
|
/**
|
|
@@ -220,6 +218,21 @@ export class CollectionBrowserDataSource {
|
|
|
220
218
|
this.numTileModels += pageTiles.length;
|
|
221
219
|
this.requestHostUpdate();
|
|
222
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* @inheritdoc
|
|
223
|
+
*/
|
|
224
|
+
addMultiplePages(firstPageNum, tiles) {
|
|
225
|
+
const numPages = Math.ceil(tiles.length / this.pageSize);
|
|
226
|
+
for (let i = 0; i < numPages; i += 1) {
|
|
227
|
+
const pageStartIndex = this.pageSize * i;
|
|
228
|
+
this.addPage(firstPageNum + i, tiles.slice(pageStartIndex, pageStartIndex + this.pageSize));
|
|
229
|
+
}
|
|
230
|
+
const visiblePages = this.host.currentVisiblePageNumbers;
|
|
231
|
+
const needsReload = visiblePages.some(page => page >= firstPageNum && page <= firstPageNum + numPages);
|
|
232
|
+
if (needsReload) {
|
|
233
|
+
this.refreshVisibleResults();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
223
236
|
/**
|
|
224
237
|
* @inheritdoc
|
|
225
238
|
*/
|
|
@@ -266,6 +279,15 @@ export class CollectionBrowserDataSource {
|
|
|
266
279
|
this.reset();
|
|
267
280
|
this.pageSize = pageSize;
|
|
268
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* @inheritdoc
|
|
284
|
+
*/
|
|
285
|
+
setTotalResultCount(count) {
|
|
286
|
+
this.totalResults = count;
|
|
287
|
+
if (this.activeOnHost) {
|
|
288
|
+
this.host.setTotalResultCount(count);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
269
291
|
/**
|
|
270
292
|
* @inheritdoc
|
|
271
293
|
*/
|
|
@@ -766,13 +788,10 @@ export class CollectionBrowserDataSource {
|
|
|
766
788
|
this.requestHostUpdate();
|
|
767
789
|
return;
|
|
768
790
|
}
|
|
769
|
-
this.
|
|
770
|
-
if (this.activeOnHost) {
|
|
771
|
-
this.host.setTotalResultCount(this.totalResults);
|
|
791
|
+
this.setTotalResultCount(success.response.totalResults - this.offset);
|
|
792
|
+
if (this.activeOnHost && this.totalResults === 0) {
|
|
772
793
|
// display event to offshoot when result count is zero.
|
|
773
|
-
|
|
774
|
-
this.host.emitEmptyResults();
|
|
775
|
-
}
|
|
794
|
+
this.host.emitEmptyResults();
|
|
776
795
|
}
|
|
777
796
|
if (this.host.withinCollection) {
|
|
778
797
|
this.collectionExtraInfo = success.response.collectionExtraInfo;
|
|
@@ -809,7 +828,7 @@ export class CollectionBrowserDataSource {
|
|
|
809
828
|
}
|
|
810
829
|
for (let i = 0; i < numPages; i += 1) {
|
|
811
830
|
const pageStartIndex = this.pageSize * i;
|
|
812
|
-
this.
|
|
831
|
+
this.addFetchedResultsToDataSource(pageNumber + i, results.slice(pageStartIndex, pageStartIndex + this.pageSize));
|
|
813
832
|
}
|
|
814
833
|
}
|
|
815
834
|
// When we reach the end of the data, we can set the infinite scroller's
|
|
@@ -830,7 +849,7 @@ export class CollectionBrowserDataSource {
|
|
|
830
849
|
* @param pageNumber
|
|
831
850
|
* @param results
|
|
832
851
|
*/
|
|
833
|
-
|
|
852
|
+
addFetchedResultsToDataSource(pageNumber, results) {
|
|
834
853
|
const tiles = [];
|
|
835
854
|
results === null || results === void 0 ? void 0 : results.forEach(result => {
|
|
836
855
|
if (!result.identifier)
|