@internetarchive/collection-browser 0.4.3-alpha.9 → 0.4.4-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +29 -29
- package/.github/workflows/ci.yml +26 -26
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.husky/pre-commit +4 -4
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -9
- package/dist/src/app-root.d.ts +50 -48
- package/dist/src/app-root.js +449 -412
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/assets/img/icons/arrow-left.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-left.js +2 -2
- package/dist/src/assets/img/icons/arrow-right.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-right.js +2 -2
- package/dist/src/assets/img/icons/chevron.d.ts +2 -2
- package/dist/src/assets/img/icons/chevron.js +2 -2
- package/dist/src/assets/img/icons/empty-query.d.ts +2 -2
- package/dist/src/assets/img/icons/empty-query.js +2 -2
- package/dist/src/assets/img/icons/eye-closed.d.ts +2 -2
- package/dist/src/assets/img/icons/eye-closed.js +2 -2
- package/dist/src/assets/img/icons/eye.d.ts +2 -2
- package/dist/src/assets/img/icons/eye.js +2 -2
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.js +2 -2
- package/dist/src/assets/img/icons/login-required.d.ts +1 -1
- package/dist/src/assets/img/icons/login-required.js +2 -2
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/account.js +2 -2
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/audio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/collection.js +2 -2
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/data.js +2 -2
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/etree.js +2 -2
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/film.js +2 -2
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/images.js +2 -2
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/radio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/software.js +2 -2
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/texts.js +2 -2
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/tv.js +2 -2
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/video.js +2 -2
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/web.js +2 -2
- package/dist/src/assets/img/icons/null-result.d.ts +2 -2
- package/dist/src/assets/img/icons/null-result.js +2 -2
- package/dist/src/assets/img/icons/restricted.d.ts +1 -1
- package/dist/src/assets/img/icons/restricted.js +2 -2
- package/dist/src/assets/img/icons/reviews.d.ts +1 -1
- package/dist/src/assets/img/icons/reviews.js +2 -2
- package/dist/src/assets/img/icons/upload.d.ts +1 -1
- package/dist/src/assets/img/icons/upload.js +2 -2
- package/dist/src/assets/img/icons/views.d.ts +1 -1
- package/dist/src/assets/img/icons/views.js +2 -2
- package/dist/src/circular-activity-indicator.d.ts +5 -5
- package/dist/src/circular-activity-indicator.js +17 -17
- package/dist/src/collection-browser.d.ts +315 -276
- package/dist/src/collection-browser.js +1276 -1179
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -5
- package/dist/src/collection-facets/facet-tombstone-row.js +15 -15
- package/dist/src/collection-facets/facets-template.d.ts +16 -16
- package/dist/src/collection-facets/facets-template.js +125 -125
- package/dist/src/collection-facets/more-facets-content.d.ts +77 -77
- package/dist/src/collection-facets/more-facets-content.js +357 -357
- package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
- package/dist/src/collection-facets/more-facets-pagination.js +192 -192
- package/dist/src/collection-facets.d.ts +78 -78
- package/dist/src/collection-facets.js +391 -391
- package/dist/src/empty-placeholder.d.ts +11 -11
- package/dist/src/empty-placeholder.js +42 -42
- package/dist/src/language-code-handler/language-code-handler.d.ts +37 -37
- package/dist/src/language-code-handler/language-code-handler.js +26 -26
- package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +562 -562
- package/dist/src/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +85 -85
- package/dist/src/models.d.ts +114 -112
- package/dist/src/models.js +125 -125
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.d.ts +45 -45
- package/dist/src/restoration-state-handler.js +230 -230
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +12 -12
- package/dist/src/sort-filter-bar/alpha-bar.js +52 -52
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/compact.js +2 -2
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/list.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.js +2 -2
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/tile.js +2 -2
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +108 -108
- package/dist/src/sort-filter-bar/sort-filter-bar.js +428 -428
- package/dist/src/styles/item-image-styles.d.ts +8 -8
- package/dist/src/styles/item-image-styles.js +22 -12
- package/dist/src/styles/item-image-styles.js.map +1 -1
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -5
- package/dist/src/tiles/collection-browser-loading-tile.js +16 -16
- package/dist/src/tiles/collection-browser-loading-tile.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.d.ts +17 -17
- package/dist/src/tiles/grid/account-tile.js +48 -47
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.d.ts +14 -7
- package/dist/src/tiles/grid/collection-tile.js +112 -146
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +29 -29
- package/dist/src/tiles/grid/item-tile.js +110 -105
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +12 -8
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +10 -10
- package/dist/src/tiles/grid/tile-stats.js +41 -40
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/image-block.d.ts +17 -17
- package/dist/src/tiles/image-block.js +76 -72
- package/dist/src/tiles/image-block.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +35 -35
- package/dist/src/tiles/item-image.js +117 -116
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/account-label.d.ts +1 -1
- package/dist/src/tiles/list/account-label.js +6 -6
- package/dist/src/tiles/list/date-label.d.ts +1 -1
- package/dist/src/tiles/list/date-label.js +12 -12
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +12 -12
- package/dist/src/tiles/list/tile-list-compact-header.js +41 -41
- package/dist/src/tiles/list/tile-list-compact.d.ts +21 -21
- package/dist/src/tiles/list/tile-list-compact.js +93 -93
- package/dist/src/tiles/list/tile-list.d.ts +53 -53
- package/dist/src/tiles/list/tile-list.js +279 -279
- package/dist/src/tiles/mediatype-icon.d.ts +9 -9
- package/dist/src/tiles/mediatype-icon.js +47 -47
- package/dist/src/tiles/overlay/icon-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/icon-overlay.js +40 -40
- package/dist/src/tiles/overlay/icon-text-overlay.d.ts +9 -9
- package/dist/src/tiles/overlay/icon-text-overlay.js +38 -38
- package/dist/src/tiles/overlay/text-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/text-overlay.js +42 -42
- package/dist/src/tiles/text-snippet-block.d.ts +27 -27
- package/dist/src/tiles/text-snippet-block.js +73 -73
- package/dist/src/tiles/tile-dispatcher.d.ts +36 -36
- package/dist/src/tiles/tile-dispatcher.js +145 -128
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/utils/analytics-events.d.ts +22 -22
- package/dist/src/utils/analytics-events.js +24 -24
- package/dist/src/utils/format-count.d.ts +7 -7
- package/dist/src/utils/format-count.js +76 -76
- package/dist/src/utils/format-date.d.ts +2 -2
- package/dist/src/utils/format-date.js +23 -23
- package/dist/src/utils/format-unit-size.d.ts +2 -0
- package/dist/src/utils/format-unit-size.js +34 -0
- package/dist/src/utils/format-unit-size.js.map +1 -0
- package/dist/test/collection-browser.test.d.ts +1 -1
- package/dist/test/collection-browser.test.js +646 -646
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +62 -62
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +114 -114
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +117 -117
- package/dist/test/collection-facets.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +544 -544
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +33 -33
- package/dist/test/icon-overlay.test.d.ts +1 -1
- package/dist/test/icon-overlay.test.js +24 -24
- package/dist/test/image-block.test.d.ts +1 -1
- package/dist/test/image-block.test.js +48 -48
- package/dist/test/item-image.test.d.ts +1 -1
- package/dist/test/item-image.test.js +84 -80
- package/dist/test/item-image.test.js.map +1 -1
- package/dist/test/mediatype-config.test.d.ts +1 -1
- package/dist/test/mediatype-config.test.js +16 -16
- package/dist/test/mocks/mock-analytics-handler.d.ts +10 -10
- package/dist/test/mocks/mock-analytics-handler.js +15 -15
- package/dist/test/mocks/mock-collection-name-cache.d.ts +7 -7
- package/dist/test/mocks/mock-collection-name-cache.js +13 -13
- package/dist/test/mocks/mock-search-responses.d.ts +12 -12
- package/dist/test/mocks/mock-search-responses.js +341 -341
- package/dist/test/mocks/mock-search-service.d.ts +13 -13
- package/dist/test/mocks/mock-search-service.js +40 -40
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +125 -125
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +43 -43
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +141 -141
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +48 -48
- package/dist/test/text-snippet-block.test.d.ts +1 -1
- package/dist/test/text-snippet-block.test.js +57 -57
- package/dist/test/tile-stats.test.d.ts +1 -1
- package/dist/test/tile-stats.test.js +33 -33
- package/dist/test/tiles/grid/account-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/account-tile.test.js +60 -60
- package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -0
- package/dist/test/tiles/grid/collection-tile.test.js +73 -0
- package/dist/test/tiles/grid/collection-tile.test.js.map +1 -0
- package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +142 -129
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +92 -92
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +123 -123
- package/dist/test/utils/format-count.test.d.ts +1 -1
- package/dist/test/utils/format-count.test.js +23 -23
- package/dist/test/utils/format-date.test.d.ts +1 -1
- package/dist/test/utils/format-date.test.js +17 -17
- package/dist/test/utils/format-unit-size.test.d.ts +1 -0
- package/dist/test/utils/format-unit-size.test.js +18 -0
- package/dist/test/utils/format-unit-size.test.js.map +1 -0
- package/index.html +24 -24
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +2 -2
- package/renovate.json +6 -6
- package/src/app-root.ts +214 -169
- package/src/collection-browser.ts +122 -3
- package/src/models.ts +2 -0
- package/src/styles/item-image-styles.ts +13 -3
- package/src/tiles/collection-browser-loading-tile.ts +1 -1
- package/src/tiles/grid/account-tile.ts +4 -2
- package/src/tiles/grid/collection-tile.ts +106 -136
- package/src/tiles/grid/item-tile.ts +8 -2
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +6 -2
- package/src/tiles/grid/tile-stats.ts +1 -0
- package/src/tiles/image-block.ts +5 -2
- package/src/tiles/item-image.ts +4 -3
- package/src/tiles/tile-dispatcher.ts +17 -0
- package/src/utils/format-unit-size.ts +43 -0
- package/test/item-image.test.ts +4 -0
- package/test/tiles/grid/collection-tile.test.ts +85 -0
- package/test/tiles/grid/item-tile.test.ts +30 -4
- package/test/utils/format-unit-size.test.ts +21 -0
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
package/dist/src/app-root.js
CHANGED
|
@@ -1,257 +1,265 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
/* eslint-disable no-console */
|
|
3
|
-
import { AnalyticsManager, } from '@internetarchive/analytics-manager';
|
|
4
|
-
import { SearchService, SearchType, StringField, } from '@internetarchive/search-service';
|
|
5
|
-
import { LocalCache } from '@internetarchive/local-cache';
|
|
6
|
-
import { html, css, LitElement } from 'lit';
|
|
7
|
-
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
8
|
-
import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
|
|
9
|
-
import { CollectionNameCache } from '@internetarchive/collection-name-cache';
|
|
10
|
-
import '../src/collection-browser';
|
|
11
|
-
let AppRoot = class AppRoot extends LitElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.searchService = this.initSearchServiceFromUrlParams();
|
|
15
|
-
this.resizeObserver = new SharedResizeObserver();
|
|
16
|
-
this.localCache = new LocalCache();
|
|
17
|
-
this.collectionNameCache = new CollectionNameCache({
|
|
18
|
-
searchService: this.searchService,
|
|
19
|
-
localCache: this.localCache,
|
|
20
|
-
});
|
|
21
|
-
this.cellWidth = 18;
|
|
22
|
-
this.cellHeight = 29;
|
|
23
|
-
this.rowGap = 1.7;
|
|
24
|
-
this.colGap = 1.7;
|
|
25
|
-
this.loggedIn = false;
|
|
26
|
-
this.searchType = SearchType.METADATA;
|
|
27
|
-
this.analyticsManager = new AnalyticsManager();
|
|
28
|
-
this.analyticsHandler = {
|
|
29
|
-
sendPing: this.sendAnalytics.bind(this),
|
|
30
|
-
sendEvent: this.sendAnalytics.bind(this),
|
|
31
|
-
sendEventNoSampling: this.sendAnalytics.bind(this),
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
sendAnalytics(ae) {
|
|
35
|
-
var _a;
|
|
36
|
-
console.log('Analytics Received ----', ae);
|
|
37
|
-
this.latestAction = ae;
|
|
38
|
-
(_a = this.analyticsManager) === null || _a === void 0 ? void 0 : _a.sendEvent(ae);
|
|
39
|
-
}
|
|
40
|
-
initSearchServiceFromUrlParams() {
|
|
41
|
-
var _a, _b, _c;
|
|
42
|
-
const params = new URL(window.location.href).searchParams;
|
|
43
|
-
return new SearchService({
|
|
44
|
-
includeCredentials: false,
|
|
45
|
-
baseUrl: (_a = params.get('search_base_url')) !== null && _a !== void 0 ? _a : undefined,
|
|
46
|
-
servicePath: (_b = params.get('search_service_path')) !== null && _b !== void 0 ? _b : undefined,
|
|
47
|
-
debuggingEnabled: (_c = !!params.get('debugging')) !== null && _c !== void 0 ? _c : undefined,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
searchPressed(e) {
|
|
51
|
-
var _a, _b;
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
this.searchQuery = this.baseQueryField.value;
|
|
54
|
-
if (((_a = this.currentPage) !== null && _a !== void 0 ? _a : 1) > 1) {
|
|
55
|
-
this.collectionBrowser.goToPage((_b = this.currentPage) !== null && _b !== void 0 ? _b : 1);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
changePagePressed(e) {
|
|
59
|
-
e.preventDefault();
|
|
60
|
-
this.currentPage = this.pageNumberInput.valueAsNumber;
|
|
61
|
-
this.collectionBrowser.goToPage(this.currentPage);
|
|
62
|
-
}
|
|
63
|
-
updated(changed) {
|
|
64
|
-
if (changed.has('currentPage') && this.currentPage) {
|
|
65
|
-
this.pageNumberInput.value = this.currentPage.toString();
|
|
66
|
-
}
|
|
67
|
-
if (changed.has('searchQuery')) {
|
|
68
|
-
this.queryUpdated();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
queryUpdated() {
|
|
72
|
-
this.collectionBrowser.baseQuery = this.searchQuery;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
import { AnalyticsManager, } from '@internetarchive/analytics-manager';
|
|
4
|
+
import { SearchService, SearchType, StringField, } from '@internetarchive/search-service';
|
|
5
|
+
import { LocalCache } from '@internetarchive/local-cache';
|
|
6
|
+
import { html, css, LitElement } from 'lit';
|
|
7
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
8
|
+
import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
|
|
9
|
+
import { CollectionNameCache } from '@internetarchive/collection-name-cache';
|
|
10
|
+
import '../src/collection-browser';
|
|
11
|
+
let AppRoot = class AppRoot extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.searchService = this.initSearchServiceFromUrlParams();
|
|
15
|
+
this.resizeObserver = new SharedResizeObserver();
|
|
16
|
+
this.localCache = new LocalCache();
|
|
17
|
+
this.collectionNameCache = new CollectionNameCache({
|
|
18
|
+
searchService: this.searchService,
|
|
19
|
+
localCache: this.localCache,
|
|
20
|
+
});
|
|
21
|
+
this.cellWidth = 18;
|
|
22
|
+
this.cellHeight = 29;
|
|
23
|
+
this.rowGap = 1.7;
|
|
24
|
+
this.colGap = 1.7;
|
|
25
|
+
this.loggedIn = false;
|
|
26
|
+
this.searchType = SearchType.METADATA;
|
|
27
|
+
this.analyticsManager = new AnalyticsManager();
|
|
28
|
+
this.analyticsHandler = {
|
|
29
|
+
sendPing: this.sendAnalytics.bind(this),
|
|
30
|
+
sendEvent: this.sendAnalytics.bind(this),
|
|
31
|
+
sendEventNoSampling: this.sendAnalytics.bind(this),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
sendAnalytics(ae) {
|
|
35
|
+
var _a;
|
|
36
|
+
console.log('Analytics Received ----', ae);
|
|
37
|
+
this.latestAction = ae;
|
|
38
|
+
(_a = this.analyticsManager) === null || _a === void 0 ? void 0 : _a.sendEvent(ae);
|
|
39
|
+
}
|
|
40
|
+
initSearchServiceFromUrlParams() {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
const params = new URL(window.location.href).searchParams;
|
|
43
|
+
return new SearchService({
|
|
44
|
+
includeCredentials: false,
|
|
45
|
+
baseUrl: (_a = params.get('search_base_url')) !== null && _a !== void 0 ? _a : undefined,
|
|
46
|
+
servicePath: (_b = params.get('search_service_path')) !== null && _b !== void 0 ? _b : undefined,
|
|
47
|
+
debuggingEnabled: (_c = !!params.get('debugging')) !== null && _c !== void 0 ? _c : undefined,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
searchPressed(e) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
this.searchQuery = this.baseQueryField.value;
|
|
54
|
+
if (((_a = this.currentPage) !== null && _a !== void 0 ? _a : 1) > 1) {
|
|
55
|
+
this.collectionBrowser.goToPage((_b = this.currentPage) !== null && _b !== void 0 ? _b : 1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
changePagePressed(e) {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
this.currentPage = this.pageNumberInput.valueAsNumber;
|
|
61
|
+
this.collectionBrowser.goToPage(this.currentPage);
|
|
62
|
+
}
|
|
63
|
+
updated(changed) {
|
|
64
|
+
if (changed.has('currentPage') && this.currentPage) {
|
|
65
|
+
this.pageNumberInput.value = this.currentPage.toString();
|
|
66
|
+
}
|
|
67
|
+
if (changed.has('searchQuery')) {
|
|
68
|
+
this.queryUpdated();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
queryUpdated() {
|
|
72
|
+
this.collectionBrowser.baseQuery = this.searchQuery;
|
|
73
|
+
}
|
|
74
|
+
get getClass() {
|
|
75
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
76
|
+
return searchParams.get('hide-dev-tools') ? 'hidden' : '';
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
var _a;
|
|
76
80
|
return html `
|
|
77
|
-
<div
|
|
78
|
-
<div id="
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
81
|
+
<div class="dev-tool-container">
|
|
82
|
+
<div id="dev-tools" class=${this.getClass}>
|
|
83
|
+
<div id="search-and-page-inputs">
|
|
84
|
+
<form @submit=${this.searchPressed}>
|
|
85
|
+
Query:
|
|
86
|
+
<input
|
|
87
|
+
type="text"
|
|
88
|
+
id="base-query-field"
|
|
89
|
+
.value=${(_a = this.searchQuery) !== null && _a !== void 0 ? _a : ''}
|
|
90
|
+
/>
|
|
91
|
+
<input type="submit" value="Search" />
|
|
92
|
+
</form>
|
|
93
|
+
<form @submit=${this.changePagePressed}>
|
|
94
|
+
Page: <input type="number" value="1" id="page-number-input" />
|
|
95
|
+
<input type="submit" value="Go" />
|
|
96
|
+
</form>
|
|
97
|
+
</div>
|
|
93
98
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
99
|
+
<div id="search-types">
|
|
100
|
+
Search type:
|
|
101
|
+
<span class="search-type">
|
|
102
|
+
<input
|
|
103
|
+
type="radio"
|
|
104
|
+
id="metadata-search"
|
|
105
|
+
name="search-type"
|
|
106
|
+
value="metadata"
|
|
107
|
+
?checked=${this.searchType === SearchType.METADATA}
|
|
108
|
+
@click=${this.searchTypeSelected}
|
|
109
|
+
/>
|
|
110
|
+
<label for="metadata-search">Metadata</label>
|
|
111
|
+
</span>
|
|
112
|
+
<span class="search-type">
|
|
113
|
+
<input
|
|
114
|
+
type="radio"
|
|
115
|
+
id="fulltext-search"
|
|
116
|
+
name="search-type"
|
|
117
|
+
value="fulltext"
|
|
118
|
+
?checked=${this.searchType === SearchType.FULLTEXT}
|
|
119
|
+
@click=${this.searchTypeSelected}
|
|
120
|
+
/>
|
|
121
|
+
<label for="fulltext-search">Full text</label>
|
|
122
|
+
</span>
|
|
123
|
+
</div>
|
|
119
124
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
var _a, _b;
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
125
|
+
<div id="toggle-controls">
|
|
126
|
+
<button
|
|
127
|
+
@click=${() => {
|
|
128
|
+
var _a, _b;
|
|
129
|
+
const details = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('cell-size-control');
|
|
130
|
+
details === null || details === void 0 ? void 0 : details.classList.toggle('hidden');
|
|
131
|
+
const rowGapControls = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.getElementById('cell-gap-control');
|
|
132
|
+
rowGapControls === null || rowGapControls === void 0 ? void 0 : rowGapControls.classList.toggle('hidden');
|
|
128
133
|
}}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var _a;
|
|
135
|
-
const details = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('latest-event-details');
|
|
136
|
-
details === null || details === void 0 ? void 0 : details.classList.toggle('hidden');
|
|
134
|
+
>
|
|
135
|
+
Toggle Cell Controls
|
|
136
|
+
</button>
|
|
137
|
+
<button
|
|
138
|
+
@click=${() => {
|
|
139
|
+
var _a;
|
|
140
|
+
const details = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('latest-event-details');
|
|
141
|
+
details === null || details === void 0 ? void 0 : details.classList.toggle('hidden');
|
|
137
142
|
}}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
143
|
+
>
|
|
144
|
+
Last Event Captured
|
|
145
|
+
</button>
|
|
146
|
+
</div>
|
|
142
147
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
<div id="last-event">
|
|
149
|
+
<pre id="latest-event-details" class="hidden">
|
|
150
|
+
${JSON.stringify(this.latestAction, null, 2)}
|
|
151
|
+
</pre
|
|
152
|
+
>
|
|
153
|
+
</div>
|
|
149
154
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
<div id="cell-controls" class="hidden">
|
|
156
|
+
<div id="cell-size-control">
|
|
157
|
+
<div>
|
|
158
|
+
<label for="cell-width-slider">Min cell width:</label>
|
|
159
|
+
<input
|
|
160
|
+
type="range"
|
|
161
|
+
min="10"
|
|
162
|
+
max="100"
|
|
163
|
+
value="18"
|
|
164
|
+
step="0.1"
|
|
165
|
+
id="cell-width-slider"
|
|
166
|
+
@input=${this.widthChanged}
|
|
167
|
+
/>
|
|
168
|
+
<span>${this.cellWidth}rem</span>
|
|
169
|
+
</div>
|
|
170
|
+
<div>
|
|
171
|
+
<label for="cell-height-slider">Cell height:</label>
|
|
172
|
+
<input
|
|
173
|
+
type="range"
|
|
174
|
+
min="10"
|
|
175
|
+
max="100"
|
|
176
|
+
value="29"
|
|
177
|
+
step="0.1"
|
|
178
|
+
id="cell-height-slider"
|
|
179
|
+
@input=${this.heightChanged}
|
|
180
|
+
/>
|
|
181
|
+
<span>${this.cellHeight}rem</span>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
<div id="cell-gap-control">
|
|
185
|
+
<div>
|
|
186
|
+
<label for="cell-row-gap-slider">Row gap:</label>
|
|
187
|
+
<input
|
|
188
|
+
type="range"
|
|
189
|
+
min="0"
|
|
190
|
+
max="5"
|
|
191
|
+
value="1.7"
|
|
192
|
+
step="0.1"
|
|
193
|
+
id="cell-row-gap-slider"
|
|
194
|
+
@input=${this.rowGapChanged}
|
|
195
|
+
/>
|
|
196
|
+
<span>${this.rowGap}rem</span>
|
|
197
|
+
</div>
|
|
198
|
+
<div>
|
|
199
|
+
<label for="cell-col-gap-slider">Col gap:</label>
|
|
200
|
+
<input
|
|
201
|
+
type="range"
|
|
202
|
+
min="0"
|
|
203
|
+
max="5"
|
|
204
|
+
value="1.7"
|
|
205
|
+
step="0.1"
|
|
206
|
+
id="cell-col-gap-slider"
|
|
207
|
+
@input=${this.colGapChanged}
|
|
208
|
+
/>
|
|
209
|
+
<span>${this.colGap}rem</span>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
<div id="checkbox-controls">
|
|
214
|
+
<div class="checkbox-control">
|
|
154
215
|
<input
|
|
155
|
-
type="
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
value="18"
|
|
159
|
-
step="0.1"
|
|
160
|
-
id="cell-width-slider"
|
|
161
|
-
@input=${this.widthChanged}
|
|
216
|
+
type="checkbox"
|
|
217
|
+
id="show-outline-check"
|
|
218
|
+
@click=${this.outlineChanged}
|
|
162
219
|
/>
|
|
163
|
-
<
|
|
220
|
+
<label for="show-outline-check">Show cell outlines</label>
|
|
164
221
|
</div>
|
|
165
|
-
<div>
|
|
166
|
-
<label for="cell-height-slider">Cell height:</label>
|
|
222
|
+
<div class="checkbox-control">
|
|
167
223
|
<input
|
|
168
|
-
type="
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
value="29"
|
|
172
|
-
step="0.1"
|
|
173
|
-
id="cell-height-slider"
|
|
174
|
-
@input=${this.heightChanged}
|
|
224
|
+
type="checkbox"
|
|
225
|
+
id="show-facet-group-outline-check"
|
|
226
|
+
@click=${this.toggleFacetGroupOutline}
|
|
175
227
|
/>
|
|
176
|
-
<
|
|
228
|
+
<label for="show-facet-group-outline-check">
|
|
229
|
+
Show facet group outlines
|
|
230
|
+
</label>
|
|
177
231
|
</div>
|
|
178
|
-
|
|
179
|
-
<div id="cell-gap-control">
|
|
180
|
-
<div>
|
|
181
|
-
<label for="cell-row-gap-slider">Row gap:</label>
|
|
232
|
+
<div class="checkbox-control">
|
|
182
233
|
<input
|
|
183
|
-
type="
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
value="1.7"
|
|
187
|
-
step="0.1"
|
|
188
|
-
id="cell-row-gap-slider"
|
|
189
|
-
@input=${this.rowGapChanged}
|
|
234
|
+
type="checkbox"
|
|
235
|
+
id="simulate-login"
|
|
236
|
+
@click=${this.loginChanged}
|
|
190
237
|
/>
|
|
191
|
-
<
|
|
238
|
+
<label for="simulate-login">Simulate login</label>
|
|
192
239
|
</div>
|
|
193
|
-
<div>
|
|
194
|
-
<label for="cell-col-gap-slider">Col gap:</label>
|
|
240
|
+
<div class="checkbox-control">
|
|
195
241
|
<input
|
|
196
|
-
type="
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
value="1.7"
|
|
200
|
-
step="0.1"
|
|
201
|
-
id="cell-col-gap-slider"
|
|
202
|
-
@input=${this.colGapChanged}
|
|
242
|
+
type="checkbox"
|
|
243
|
+
id="show-dummy-snippets"
|
|
244
|
+
@click=${this.snippetsChanged}
|
|
203
245
|
/>
|
|
204
|
-
<
|
|
246
|
+
<label for="show-dummy-snippets">Show dummy snippets</label>
|
|
247
|
+
</div>
|
|
248
|
+
<div class="checkbox-control">
|
|
249
|
+
<input
|
|
250
|
+
type="checkbox"
|
|
251
|
+
id="enable-date-picker"
|
|
252
|
+
checked
|
|
253
|
+
@click=${this.datePickerChanged}
|
|
254
|
+
/>
|
|
255
|
+
<label for="enable-date-picker">Enable date picker</label>
|
|
205
256
|
</div>
|
|
206
257
|
</div>
|
|
207
258
|
</div>
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
type="checkbox"
|
|
212
|
-
id="show-outline-check"
|
|
213
|
-
@click=${this.outlineChanged}
|
|
214
|
-
/>
|
|
215
|
-
<label for="show-outline-check">Show cell outlines</label>
|
|
216
|
-
</div>
|
|
217
|
-
<div class="checkbox-control">
|
|
218
|
-
<input
|
|
219
|
-
type="checkbox"
|
|
220
|
-
id="show-facet-group-outline-check"
|
|
221
|
-
@click=${this.toggleFacetGroupOutline}
|
|
222
|
-
/>
|
|
223
|
-
<label for="show-facet-group-outline-check">
|
|
224
|
-
Show facet group outlines
|
|
225
|
-
</label>
|
|
226
|
-
</div>
|
|
227
|
-
<div class="checkbox-control">
|
|
228
|
-
<input
|
|
229
|
-
type="checkbox"
|
|
230
|
-
id="simulate-login"
|
|
231
|
-
@click=${this.loginChanged}
|
|
232
|
-
/>
|
|
233
|
-
<label for="simulate-login">Simulate login</label>
|
|
234
|
-
</div>
|
|
235
|
-
<div class="checkbox-control">
|
|
236
|
-
<input
|
|
237
|
-
type="checkbox"
|
|
238
|
-
id="show-dummy-snippets"
|
|
239
|
-
@click=${this.snippetsChanged}
|
|
240
|
-
/>
|
|
241
|
-
<label for="show-dummy-snippets">Show dummy snippets</label>
|
|
242
|
-
</div>
|
|
243
|
-
<div class="checkbox-control">
|
|
244
|
-
<input
|
|
245
|
-
type="checkbox"
|
|
246
|
-
id="enable-date-picker"
|
|
247
|
-
checked
|
|
248
|
-
@click=${this.datePickerChanged}
|
|
249
|
-
/>
|
|
250
|
-
<label for="enable-date-picker">Enable date picker</label>
|
|
251
|
-
</div>
|
|
252
|
-
</div>
|
|
259
|
+
<button id="toggle-dev-tools-btn" @click=${this.toggleDevTools}>
|
|
260
|
+
Toggle Search Controls
|
|
261
|
+
</button>
|
|
253
262
|
</div>
|
|
254
|
-
|
|
255
263
|
<div id="collection-browser-container">
|
|
256
264
|
<collection-browser
|
|
257
265
|
.baseNavigationUrl=${'https://archive.org'}
|
|
@@ -271,135 +279,151 @@ let AppRoot = class AppRoot extends LitElement {
|
|
|
271
279
|
</collection-browser>
|
|
272
280
|
</div>
|
|
273
281
|
<modal-manager></modal-manager>
|
|
274
|
-
`;
|
|
275
|
-
}
|
|
276
|
-
baseQueryChanged(e) {
|
|
277
|
-
this.searchQuery = e.detail.baseQuery;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
//
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
this.
|
|
394
|
-
this.collectionBrowser.style.setProperty('--
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
282
|
+
`;
|
|
283
|
+
}
|
|
284
|
+
baseQueryChanged(e) {
|
|
285
|
+
this.searchQuery = e.detail.baseQuery;
|
|
286
|
+
}
|
|
287
|
+
/** Handler for search type changes coming from collection browser */
|
|
288
|
+
searchTypeChanged(e) {
|
|
289
|
+
this.searchType = e.detail;
|
|
290
|
+
}
|
|
291
|
+
/** Handler for user input selecting a search type */
|
|
292
|
+
searchTypeSelected(e) {
|
|
293
|
+
const target = e.target;
|
|
294
|
+
this.searchType =
|
|
295
|
+
target.value === 'fulltext' ? SearchType.FULLTEXT : SearchType.METADATA;
|
|
296
|
+
// Re-perform the current search with the new search target
|
|
297
|
+
this.reperformCurrentSearch();
|
|
298
|
+
}
|
|
299
|
+
loginChanged(e) {
|
|
300
|
+
const target = e.target;
|
|
301
|
+
if (target.checked) {
|
|
302
|
+
this.loggedIn = true;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
this.loggedIn = false;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
outlineChanged(e) {
|
|
309
|
+
const target = e.target;
|
|
310
|
+
if (target.checked) {
|
|
311
|
+
this.collectionBrowser.style.setProperty('--infiniteScrollerCellOutline', '1px solid #33D1FF');
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
this.collectionBrowser.style.removeProperty('--infiniteScrollerCellOutline');
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
toggleDevTools() {
|
|
318
|
+
var _a, _b;
|
|
319
|
+
const pageUrl = new URL(window.location.href);
|
|
320
|
+
const { searchParams } = pageUrl;
|
|
321
|
+
if (searchParams.get('hide-dev-tools')) {
|
|
322
|
+
searchParams.delete('hide-dev-tools');
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
searchParams.set('hide-dev-tools', 'true');
|
|
326
|
+
}
|
|
327
|
+
(_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dev-tools')) === null || _b === void 0 ? void 0 : _b.classList.toggle('hidden');
|
|
328
|
+
if (window.history.replaceState) {
|
|
329
|
+
window.history.replaceState({
|
|
330
|
+
path: pageUrl.toString(),
|
|
331
|
+
}, '', pageUrl.toString());
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
toggleFacetGroupOutline(e) {
|
|
335
|
+
const target = e.target;
|
|
336
|
+
if (target.checked) {
|
|
337
|
+
this.collectionBrowser.classList.add('showFacetGroupOutlines');
|
|
338
|
+
this.modalManager.classList.add('showFacetGroupOutlines');
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
this.collectionBrowser.classList.remove('showFacetGroupOutlines');
|
|
342
|
+
this.modalManager.classList.remove('showFacetGroupOutlines');
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
async snippetsChanged(e) {
|
|
346
|
+
const target = e.target;
|
|
347
|
+
if (target.checked) {
|
|
348
|
+
// Decorate the default search service with a wrapper that adds
|
|
349
|
+
// dummy snippets to any successful searches
|
|
350
|
+
this.searchService = {
|
|
351
|
+
async search(params, searchType) {
|
|
352
|
+
var _a;
|
|
353
|
+
const searchResponse = await SearchService.default.search(params, searchType);
|
|
354
|
+
(_a = searchResponse.success) === null || _a === void 0 ? void 0 : _a.response.results.forEach(result => {
|
|
355
|
+
Object.defineProperty(result, 'highlight', {
|
|
356
|
+
value: new StringField([
|
|
357
|
+
'this is a text {{{snippet}}} block with potentially',
|
|
358
|
+
'multiple {{{snippets}}} and such',
|
|
359
|
+
'but the {{{snippet}}} block may be quite long perhaps',
|
|
360
|
+
'depending on how many {{{snippet}}} matches there are',
|
|
361
|
+
'there may be multiple lines of {{{snippets}}} to show',
|
|
362
|
+
'but each {{{snippet}}} should be relatively short',
|
|
363
|
+
'and {{{snippets}}} are each a {{{snippet}}} of text',
|
|
364
|
+
'but every {{{snippet}}} might have multiple matches',
|
|
365
|
+
'the {{{snippets}}} should be separated and surrounded by ellipses',
|
|
366
|
+
]),
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
return searchResponse;
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
// Restore the default seach service
|
|
375
|
+
this.searchService = SearchService.default;
|
|
376
|
+
}
|
|
377
|
+
// Re-perform the current search to show/hide the snippets immediately
|
|
378
|
+
this.reperformCurrentSearch();
|
|
379
|
+
}
|
|
380
|
+
async reperformCurrentSearch() {
|
|
381
|
+
const oldQuery = this.searchQuery;
|
|
382
|
+
this.searchQuery = ''; // Should just reset to the placeholder
|
|
383
|
+
await this.updateComplete;
|
|
384
|
+
// For unclear reasons, Safari refuses to re-apply the old query until the next tick, hence:
|
|
385
|
+
await new Promise(res => {
|
|
386
|
+
setTimeout(res, 0);
|
|
387
|
+
});
|
|
388
|
+
this.searchQuery = oldQuery; // Re-apply the original query
|
|
389
|
+
}
|
|
390
|
+
datePickerChanged(e) {
|
|
391
|
+
const target = e.target;
|
|
392
|
+
this.collectionBrowser.showHistogramDatePicker = target.checked;
|
|
393
|
+
// When disabling the date picker from the demo app, also clear any existing date range params
|
|
394
|
+
if (!this.collectionBrowser.showHistogramDatePicker) {
|
|
395
|
+
this.collectionBrowser.minSelectedDate = undefined;
|
|
396
|
+
this.collectionBrowser.maxSelectedDate = undefined;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
rowGapChanged(e) {
|
|
400
|
+
const input = e.target;
|
|
401
|
+
this.rowGap = parseFloat(input.value);
|
|
402
|
+
this.collectionBrowser.style.setProperty('--collectionBrowserRowGap', `${input.value}rem`);
|
|
403
|
+
}
|
|
404
|
+
colGapChanged(e) {
|
|
405
|
+
const input = e.target;
|
|
406
|
+
this.colGap = parseFloat(input.value);
|
|
407
|
+
this.collectionBrowser.style.setProperty('--collectionBrowserColGap', `${input.value}rem`);
|
|
408
|
+
}
|
|
409
|
+
widthChanged(e) {
|
|
410
|
+
const input = e.target;
|
|
411
|
+
this.cellWidth = parseFloat(input.value);
|
|
412
|
+
this.collectionBrowser.style.setProperty('--collectionBrowserCellMinWidth', `${input.value}rem`);
|
|
413
|
+
}
|
|
414
|
+
heightChanged(e) {
|
|
415
|
+
const input = e.target;
|
|
416
|
+
this.cellHeight = parseFloat(input.value);
|
|
417
|
+
this.collectionBrowser.style.setProperty('--collectionBrowserCellMinHeight', `${input.value}rem`);
|
|
418
|
+
this.collectionBrowser.style.setProperty('--collectionBrowserCellMaxHeight', `${input.value}rem`);
|
|
419
|
+
}
|
|
420
|
+
visiblePageChanged(e) {
|
|
421
|
+
const { pageNumber } = e.detail;
|
|
422
|
+
if (pageNumber === this.currentPage)
|
|
423
|
+
return;
|
|
424
|
+
this.currentPage = pageNumber;
|
|
425
|
+
}
|
|
426
|
+
};
|
|
403
427
|
AppRoot.styles = css `
|
|
404
428
|
:host {
|
|
405
429
|
display: block;
|
|
@@ -434,10 +458,6 @@ AppRoot.styles = css `
|
|
|
434
458
|
font-size: 1.6rem;
|
|
435
459
|
}
|
|
436
460
|
|
|
437
|
-
collection-browser {
|
|
438
|
-
margin-top: 20rem;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
461
|
modal-manager.showFacetGroupOutlines,
|
|
442
462
|
collection-browser.showFacetGroupOutlines {
|
|
443
463
|
--facet-row-border-top: 1px solid red;
|
|
@@ -448,8 +468,11 @@ AppRoot.styles = css `
|
|
|
448
468
|
width: 300px;
|
|
449
469
|
}
|
|
450
470
|
|
|
471
|
+
.dev-tool-container {
|
|
472
|
+
position: relative;
|
|
473
|
+
}
|
|
451
474
|
#dev-tools {
|
|
452
|
-
position:
|
|
475
|
+
position: relative;
|
|
453
476
|
top: 0;
|
|
454
477
|
left: 0;
|
|
455
478
|
z-index: 1;
|
|
@@ -458,12 +481,27 @@ AppRoot.styles = css `
|
|
|
458
481
|
padding: 0.5rem 1rem;
|
|
459
482
|
border: 1px solid black;
|
|
460
483
|
font-size: 1.4rem;
|
|
484
|
+
width: 75%;
|
|
485
|
+
background: #ffffffb3;
|
|
461
486
|
}
|
|
462
487
|
|
|
463
488
|
#dev-tools > * {
|
|
464
489
|
display: flex;
|
|
465
490
|
}
|
|
466
491
|
|
|
492
|
+
#toggle-dev-tools-btn {
|
|
493
|
+
position: fixed;
|
|
494
|
+
left: 77.4%;
|
|
495
|
+
top: 0;
|
|
496
|
+
background: red;
|
|
497
|
+
padding: 5px;
|
|
498
|
+
color: white;
|
|
499
|
+
font-size: 1.4rem;
|
|
500
|
+
margin: 0;
|
|
501
|
+
z-index: 1;
|
|
502
|
+
cursor: pointer;
|
|
503
|
+
}
|
|
504
|
+
|
|
467
505
|
#search-and-page-inputs > form {
|
|
468
506
|
margin-right: 1rem;
|
|
469
507
|
}
|
|
@@ -508,8 +546,7 @@ AppRoot.styles = css `
|
|
|
508
546
|
}
|
|
509
547
|
|
|
510
548
|
.hidden {
|
|
511
|
-
|
|
512
|
-
display: none !important;
|
|
549
|
+
display: none;
|
|
513
550
|
}
|
|
514
551
|
|
|
515
552
|
#toggle-controls {
|
|
@@ -523,48 +560,48 @@ AppRoot.styles = css `
|
|
|
523
560
|
background-color: aliceblue;
|
|
524
561
|
font-size: 1.6rem;
|
|
525
562
|
}
|
|
526
|
-
`;
|
|
527
|
-
__decorate([
|
|
528
|
-
state()
|
|
529
|
-
], AppRoot.prototype, "currentPage", void 0);
|
|
530
|
-
__decorate([
|
|
531
|
-
state()
|
|
532
|
-
], AppRoot.prototype, "searchQuery", void 0);
|
|
533
|
-
__decorate([
|
|
534
|
-
state()
|
|
535
|
-
], AppRoot.prototype, "cellWidth", void 0);
|
|
536
|
-
__decorate([
|
|
537
|
-
state()
|
|
538
|
-
], AppRoot.prototype, "cellHeight", void 0);
|
|
539
|
-
__decorate([
|
|
540
|
-
state()
|
|
541
|
-
], AppRoot.prototype, "rowGap", void 0);
|
|
542
|
-
__decorate([
|
|
543
|
-
state()
|
|
544
|
-
], AppRoot.prototype, "colGap", void 0);
|
|
545
|
-
__decorate([
|
|
546
|
-
state()
|
|
547
|
-
], AppRoot.prototype, "loggedIn", void 0);
|
|
548
|
-
__decorate([
|
|
549
|
-
state()
|
|
550
|
-
], AppRoot.prototype, "searchType", void 0);
|
|
551
|
-
__decorate([
|
|
552
|
-
property({ type: Object, reflect: false })
|
|
553
|
-
], AppRoot.prototype, "latestAction", void 0);
|
|
554
|
-
__decorate([
|
|
555
|
-
query('#base-query-field')
|
|
556
|
-
], AppRoot.prototype, "baseQueryField", void 0);
|
|
557
|
-
__decorate([
|
|
558
|
-
query('#page-number-input')
|
|
559
|
-
], AppRoot.prototype, "pageNumberInput", void 0);
|
|
560
|
-
__decorate([
|
|
561
|
-
query('collection-browser')
|
|
562
|
-
], AppRoot.prototype, "collectionBrowser", void 0);
|
|
563
|
-
__decorate([
|
|
564
|
-
query('modal-manager')
|
|
565
|
-
], AppRoot.prototype, "modalManager", void 0);
|
|
566
|
-
AppRoot = __decorate([
|
|
567
|
-
customElement('app-root')
|
|
568
|
-
], AppRoot);
|
|
569
|
-
export { AppRoot };
|
|
563
|
+
`;
|
|
564
|
+
__decorate([
|
|
565
|
+
state()
|
|
566
|
+
], AppRoot.prototype, "currentPage", void 0);
|
|
567
|
+
__decorate([
|
|
568
|
+
state()
|
|
569
|
+
], AppRoot.prototype, "searchQuery", void 0);
|
|
570
|
+
__decorate([
|
|
571
|
+
state()
|
|
572
|
+
], AppRoot.prototype, "cellWidth", void 0);
|
|
573
|
+
__decorate([
|
|
574
|
+
state()
|
|
575
|
+
], AppRoot.prototype, "cellHeight", void 0);
|
|
576
|
+
__decorate([
|
|
577
|
+
state()
|
|
578
|
+
], AppRoot.prototype, "rowGap", void 0);
|
|
579
|
+
__decorate([
|
|
580
|
+
state()
|
|
581
|
+
], AppRoot.prototype, "colGap", void 0);
|
|
582
|
+
__decorate([
|
|
583
|
+
state()
|
|
584
|
+
], AppRoot.prototype, "loggedIn", void 0);
|
|
585
|
+
__decorate([
|
|
586
|
+
state()
|
|
587
|
+
], AppRoot.prototype, "searchType", void 0);
|
|
588
|
+
__decorate([
|
|
589
|
+
property({ type: Object, reflect: false })
|
|
590
|
+
], AppRoot.prototype, "latestAction", void 0);
|
|
591
|
+
__decorate([
|
|
592
|
+
query('#base-query-field')
|
|
593
|
+
], AppRoot.prototype, "baseQueryField", void 0);
|
|
594
|
+
__decorate([
|
|
595
|
+
query('#page-number-input')
|
|
596
|
+
], AppRoot.prototype, "pageNumberInput", void 0);
|
|
597
|
+
__decorate([
|
|
598
|
+
query('collection-browser')
|
|
599
|
+
], AppRoot.prototype, "collectionBrowser", void 0);
|
|
600
|
+
__decorate([
|
|
601
|
+
query('modal-manager')
|
|
602
|
+
], AppRoot.prototype, "modalManager", void 0);
|
|
603
|
+
AppRoot = __decorate([
|
|
604
|
+
customElement('app-root')
|
|
605
|
+
], AppRoot);
|
|
606
|
+
export { AppRoot };
|
|
570
607
|
//# sourceMappingURL=app-root.js.map
|