@internetarchive/collection-browser 1.14.4 → 1.14.5-alpha2

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.
Files changed (277) hide show
  1. package/.editorconfig +29 -29
  2. package/.github/workflows/ci.yml +26 -26
  3. package/.github/workflows/gh-pages-main.yml +39 -39
  4. package/.github/workflows/npm-publish.yml +39 -39
  5. package/.github/workflows/pr-preview.yml +38 -38
  6. package/.husky/pre-commit +4 -4
  7. package/LICENSE +661 -661
  8. package/README.md +83 -83
  9. package/dist/index.d.ts +9 -9
  10. package/dist/index.js +9 -9
  11. package/dist/src/app-root.d.ts +64 -64
  12. package/dist/src/app-root.js +311 -311
  13. package/dist/src/assets/img/icons/arrow-left.d.ts +2 -2
  14. package/dist/src/assets/img/icons/arrow-left.js +2 -2
  15. package/dist/src/assets/img/icons/arrow-right.d.ts +2 -2
  16. package/dist/src/assets/img/icons/arrow-right.js +2 -2
  17. package/dist/src/assets/img/icons/chevron.d.ts +2 -2
  18. package/dist/src/assets/img/icons/chevron.js +2 -2
  19. package/dist/src/assets/img/icons/contract.d.ts +2 -2
  20. package/dist/src/assets/img/icons/contract.js +2 -2
  21. package/dist/src/assets/img/icons/empty-query.d.ts +2 -2
  22. package/dist/src/assets/img/icons/empty-query.js +2 -2
  23. package/dist/src/assets/img/icons/expand.d.ts +2 -2
  24. package/dist/src/assets/img/icons/expand.js +2 -2
  25. package/dist/src/assets/img/icons/eye-closed.d.ts +2 -2
  26. package/dist/src/assets/img/icons/eye-closed.js +2 -2
  27. package/dist/src/assets/img/icons/eye.d.ts +2 -2
  28. package/dist/src/assets/img/icons/eye.js +2 -2
  29. package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
  30. package/dist/src/assets/img/icons/favorite-filled.js +2 -2
  31. package/dist/src/assets/img/icons/login-required.d.ts +1 -1
  32. package/dist/src/assets/img/icons/login-required.js +2 -2
  33. package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
  34. package/dist/src/assets/img/icons/mediatype/account.js +2 -2
  35. package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
  36. package/dist/src/assets/img/icons/mediatype/audio.js +2 -2
  37. package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
  38. package/dist/src/assets/img/icons/mediatype/collection.js +2 -2
  39. package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
  40. package/dist/src/assets/img/icons/mediatype/data.js +2 -2
  41. package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
  42. package/dist/src/assets/img/icons/mediatype/etree.js +2 -2
  43. package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
  44. package/dist/src/assets/img/icons/mediatype/film.js +2 -2
  45. package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
  46. package/dist/src/assets/img/icons/mediatype/images.js +2 -2
  47. package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
  48. package/dist/src/assets/img/icons/mediatype/radio.js +2 -2
  49. package/dist/src/assets/img/icons/mediatype/search.d.ts +1 -1
  50. package/dist/src/assets/img/icons/mediatype/search.js +2 -2
  51. package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
  52. package/dist/src/assets/img/icons/mediatype/software.js +2 -2
  53. package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
  54. package/dist/src/assets/img/icons/mediatype/texts.js +2 -2
  55. package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
  56. package/dist/src/assets/img/icons/mediatype/tv.js +2 -2
  57. package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
  58. package/dist/src/assets/img/icons/mediatype/video.js +2 -2
  59. package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
  60. package/dist/src/assets/img/icons/mediatype/web.js +2 -2
  61. package/dist/src/assets/img/icons/null-result.d.ts +2 -2
  62. package/dist/src/assets/img/icons/null-result.js +2 -2
  63. package/dist/src/assets/img/icons/restricted.d.ts +1 -1
  64. package/dist/src/assets/img/icons/restricted.js +2 -2
  65. package/dist/src/assets/img/icons/reviews.d.ts +1 -1
  66. package/dist/src/assets/img/icons/reviews.js +2 -2
  67. package/dist/src/assets/img/icons/upload.d.ts +1 -1
  68. package/dist/src/assets/img/icons/upload.js +2 -2
  69. package/dist/src/assets/img/icons/views.d.ts +1 -1
  70. package/dist/src/assets/img/icons/views.js +2 -2
  71. package/dist/src/circular-activity-indicator.d.ts +5 -5
  72. package/dist/src/circular-activity-indicator.js +17 -17
  73. package/dist/src/collection-browser.d.ts +525 -524
  74. package/dist/src/collection-browser.js +1871 -1859
  75. package/dist/src/collection-browser.js.map +1 -1
  76. package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -5
  77. package/dist/src/collection-facets/facet-tombstone-row.js +15 -15
  78. package/dist/src/collection-facets/facets-template.d.ts +20 -20
  79. package/dist/src/collection-facets/facets-template.js +152 -152
  80. package/dist/src/collection-facets/more-facets-content.d.ts +77 -77
  81. package/dist/src/collection-facets/more-facets-content.js +359 -359
  82. package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
  83. package/dist/src/collection-facets/more-facets-pagination.js +196 -196
  84. package/dist/src/collection-facets/toggle-switch.d.ts +41 -41
  85. package/dist/src/collection-facets/toggle-switch.js +94 -94
  86. package/dist/src/collection-facets.d.ts +104 -104
  87. package/dist/src/collection-facets.js +507 -506
  88. package/dist/src/collection-facets.js.map +1 -1
  89. package/dist/src/empty-placeholder.d.ts +23 -23
  90. package/dist/src/empty-placeholder.js +74 -74
  91. package/dist/src/expanded-date-picker.d.ts +43 -43
  92. package/dist/src/expanded-date-picker.js +109 -109
  93. package/dist/src/language-code-handler/language-code-handler.d.ts +37 -37
  94. package/dist/src/language-code-handler/language-code-handler.js +26 -26
  95. package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -1
  96. package/dist/src/language-code-handler/language-code-mapping.js +562 -562
  97. package/dist/src/manage/manage-bar.d.ts +26 -26
  98. package/dist/src/manage/manage-bar.js +53 -53
  99. package/dist/src/mediatype/mediatype-config.d.ts +3 -3
  100. package/dist/src/mediatype/mediatype-config.js +91 -91
  101. package/dist/src/models.d.ts +164 -164
  102. package/dist/src/models.js +269 -269
  103. package/dist/src/restoration-state-handler.d.ts +70 -70
  104. package/dist/src/restoration-state-handler.js +355 -355
  105. package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +6 -6
  106. package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +24 -24
  107. package/dist/src/sort-filter-bar/alpha-bar.d.ts +21 -21
  108. package/dist/src/sort-filter-bar/alpha-bar.js +128 -128
  109. package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
  110. package/dist/src/sort-filter-bar/img/compact.js +2 -2
  111. package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
  112. package/dist/src/sort-filter-bar/img/list.js +2 -2
  113. package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -1
  114. package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +2 -2
  115. package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -1
  116. package/dist/src/sort-filter-bar/img/sort-toggle-down.js +2 -2
  117. package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -1
  118. package/dist/src/sort-filter-bar/img/sort-toggle-up.js +2 -2
  119. package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
  120. package/dist/src/sort-filter-bar/img/sort-triangle.js +2 -2
  121. package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
  122. package/dist/src/sort-filter-bar/img/tile.js +2 -2
  123. package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +208 -208
  124. package/dist/src/sort-filter-bar/sort-filter-bar.js +637 -637
  125. package/dist/src/styles/item-image-styles.d.ts +8 -8
  126. package/dist/src/styles/item-image-styles.js +9 -9
  127. package/dist/src/styles/sr-only.d.ts +1 -1
  128. package/dist/src/styles/sr-only.js +2 -2
  129. package/dist/src/tiles/base-tile-component.d.ts +19 -18
  130. package/dist/src/tiles/base-tile-component.js +63 -59
  131. package/dist/src/tiles/base-tile-component.js.map +1 -1
  132. package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -5
  133. package/dist/src/tiles/collection-browser-loading-tile.js +15 -15
  134. package/dist/src/tiles/grid/account-tile.d.ts +18 -18
  135. package/dist/src/tiles/grid/account-tile.js +72 -72
  136. package/dist/src/tiles/grid/collection-tile.d.ts +15 -15
  137. package/dist/src/tiles/grid/collection-tile.js +80 -80
  138. package/dist/src/tiles/grid/item-tile.d.ts +27 -27
  139. package/dist/src/tiles/grid/item-tile.js +134 -134
  140. package/dist/src/tiles/grid/search-tile.d.ts +10 -10
  141. package/dist/src/tiles/grid/search-tile.js +51 -51
  142. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -1
  143. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +8 -8
  144. package/dist/src/tiles/grid/tile-stats.d.ts +11 -11
  145. package/dist/src/tiles/grid/tile-stats.js +48 -48
  146. package/dist/src/tiles/hover/hover-pane-controller.d.ts +219 -219
  147. package/dist/src/tiles/hover/hover-pane-controller.js +352 -352
  148. package/dist/src/tiles/hover/tile-hover-pane.d.ts +15 -15
  149. package/dist/src/tiles/hover/tile-hover-pane.js +38 -38
  150. package/dist/src/tiles/image-block.d.ts +17 -17
  151. package/dist/src/tiles/image-block.js +73 -73
  152. package/dist/src/tiles/item-image.d.ts +36 -36
  153. package/dist/src/tiles/item-image.js +127 -127
  154. package/dist/src/tiles/list/tile-list-compact-header.d.ts +6 -6
  155. package/dist/src/tiles/list/tile-list-compact-header.js +38 -38
  156. package/dist/src/tiles/list/tile-list-compact.d.ts +15 -15
  157. package/dist/src/tiles/list/tile-list-compact.js +114 -114
  158. package/dist/src/tiles/list/tile-list.d.ts +46 -46
  159. package/dist/src/tiles/list/tile-list.js +302 -302
  160. package/dist/src/tiles/mediatype-icon.d.ts +9 -9
  161. package/dist/src/tiles/mediatype-icon.js +47 -47
  162. package/dist/src/tiles/overlay/icon-overlay.d.ts +10 -10
  163. package/dist/src/tiles/overlay/icon-overlay.js +40 -40
  164. package/dist/src/tiles/overlay/icon-text-overlay.d.ts +9 -9
  165. package/dist/src/tiles/overlay/icon-text-overlay.js +38 -38
  166. package/dist/src/tiles/overlay/text-overlay.d.ts +10 -10
  167. package/dist/src/tiles/overlay/text-overlay.js +42 -42
  168. package/dist/src/tiles/text-snippet-block.d.ts +27 -27
  169. package/dist/src/tiles/text-snippet-block.js +73 -73
  170. package/dist/src/tiles/tile-dispatcher.d.ts +64 -64
  171. package/dist/src/tiles/tile-dispatcher.js +235 -235
  172. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  173. package/dist/src/tiles/tile-display-value-provider.d.ts +43 -43
  174. package/dist/src/tiles/tile-display-value-provider.js +80 -80
  175. package/dist/src/utils/analytics-events.d.ts +25 -25
  176. package/dist/src/utils/analytics-events.js +27 -27
  177. package/dist/src/utils/array-equals.d.ts +4 -4
  178. package/dist/src/utils/array-equals.js +10 -10
  179. package/dist/src/utils/format-count.d.ts +7 -7
  180. package/dist/src/utils/format-count.js +76 -76
  181. package/dist/src/utils/format-date.d.ts +2 -2
  182. package/dist/src/utils/format-date.js +25 -25
  183. package/dist/src/utils/format-unit-size.d.ts +2 -2
  184. package/dist/src/utils/format-unit-size.js +33 -33
  185. package/dist/src/utils/local-date-from-utc.d.ts +9 -9
  186. package/dist/src/utils/local-date-from-utc.js +15 -15
  187. package/dist/src/utils/sha1.d.ts +2 -2
  188. package/dist/src/utils/sha1.js +8 -8
  189. package/dist/test/collection-browser.test.d.ts +1 -1
  190. package/dist/test/collection-browser.test.js +1098 -1098
  191. package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
  192. package/dist/test/collection-facets/facets-template.test.js +134 -134
  193. package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
  194. package/dist/test/collection-facets/more-facets-content.test.js +133 -133
  195. package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -1
  196. package/dist/test/collection-facets/more-facets-pagination.test.js +117 -117
  197. package/dist/test/collection-facets/toggle-switch.test.d.ts +1 -1
  198. package/dist/test/collection-facets/toggle-switch.test.js +73 -73
  199. package/dist/test/collection-facets.test.d.ts +2 -2
  200. package/dist/test/collection-facets.test.js +682 -682
  201. package/dist/test/empty-placeholder.test.d.ts +1 -1
  202. package/dist/test/empty-placeholder.test.js +63 -63
  203. package/dist/test/expanded-date-picker.test.d.ts +1 -1
  204. package/dist/test/expanded-date-picker.test.js +95 -95
  205. package/dist/test/icon-overlay.test.d.ts +1 -1
  206. package/dist/test/icon-overlay.test.js +24 -24
  207. package/dist/test/image-block.test.d.ts +1 -1
  208. package/dist/test/image-block.test.js +48 -48
  209. package/dist/test/item-image.test.d.ts +1 -1
  210. package/dist/test/item-image.test.js +86 -86
  211. package/dist/test/manage/manage-bar.test.d.ts +1 -1
  212. package/dist/test/manage/manage-bar.test.js +72 -72
  213. package/dist/test/mediatype-config.test.d.ts +1 -1
  214. package/dist/test/mediatype-config.test.js +16 -16
  215. package/dist/test/mocks/mock-analytics-handler.d.ts +10 -10
  216. package/dist/test/mocks/mock-analytics-handler.js +15 -15
  217. package/dist/test/mocks/mock-collection-name-cache.d.ts +9 -9
  218. package/dist/test/mocks/mock-collection-name-cache.js +17 -17
  219. package/dist/test/mocks/mock-search-responses.d.ts +21 -21
  220. package/dist/test/mocks/mock-search-responses.js +709 -709
  221. package/dist/test/mocks/mock-search-service.d.ts +15 -15
  222. package/dist/test/mocks/mock-search-service.js +50 -50
  223. package/dist/test/restoration-state-handler.test.d.ts +1 -1
  224. package/dist/test/restoration-state-handler.test.js +270 -270
  225. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +1 -1
  226. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +12 -12
  227. package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -1
  228. package/dist/test/sort-filter-bar/alpha-bar.test.js +73 -73
  229. package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -1
  230. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +378 -378
  231. package/dist/test/text-overlay.test.d.ts +1 -1
  232. package/dist/test/text-overlay.test.js +48 -48
  233. package/dist/test/text-snippet-block.test.d.ts +1 -1
  234. package/dist/test/text-snippet-block.test.js +57 -57
  235. package/dist/test/tile-stats.test.d.ts +1 -1
  236. package/dist/test/tile-stats.test.js +33 -33
  237. package/dist/test/tiles/grid/account-tile.test.d.ts +1 -1
  238. package/dist/test/tiles/grid/account-tile.test.js +76 -76
  239. package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -1
  240. package/dist/test/tiles/grid/collection-tile.test.js +73 -73
  241. package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
  242. package/dist/test/tiles/grid/item-tile.test.js +254 -254
  243. package/dist/test/tiles/grid/search-tile.test.d.ts +1 -1
  244. package/dist/test/tiles/grid/search-tile.test.js +51 -51
  245. package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -1
  246. package/dist/test/tiles/hover/hover-pane-controller.test.js +258 -258
  247. package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +1 -1
  248. package/dist/test/tiles/hover/tile-hover-pane.test.js +13 -13
  249. package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
  250. package/dist/test/tiles/list/tile-list-compact.test.js +143 -143
  251. package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
  252. package/dist/test/tiles/list/tile-list.test.js +242 -242
  253. package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -1
  254. package/dist/test/tiles/tile-dispatcher.test.js +94 -94
  255. package/dist/test/tiles/tile-display-value-provider.test.d.ts +1 -1
  256. package/dist/test/tiles/tile-display-value-provider.test.js +141 -141
  257. package/dist/test/utils/array-equals.test.d.ts +1 -1
  258. package/dist/test/utils/array-equals.test.js +26 -26
  259. package/dist/test/utils/format-count.test.d.ts +1 -1
  260. package/dist/test/utils/format-count.test.js +23 -23
  261. package/dist/test/utils/format-date.test.d.ts +1 -1
  262. package/dist/test/utils/format-date.test.js +17 -17
  263. package/dist/test/utils/format-unit-size.test.d.ts +1 -1
  264. package/dist/test/utils/format-unit-size.test.js +17 -17
  265. package/dist/test/utils/local-date-from-utc.test.d.ts +1 -1
  266. package/dist/test/utils/local-date-from-utc.test.js +26 -26
  267. package/local.archive.org.cert +86 -86
  268. package/local.archive.org.key +27 -27
  269. package/package.json +1 -1
  270. package/renovate.json +6 -6
  271. package/src/collection-browser.ts +11 -1
  272. package/src/collection-facets.ts +1 -0
  273. package/src/tiles/base-tile-component.ts +2 -0
  274. package/src/tiles/tile-dispatcher.ts +7 -5
  275. package/tsconfig.json +21 -21
  276. package/web-dev-server.config.mjs +30 -30
  277. package/web-test-runner.config.mjs +41 -41
@@ -1,524 +1,525 @@
1
- import { LitElement, PropertyValues, TemplateResult } from 'lit';
2
- import type { InfiniteScrollerCellProviderInterface } from '@internetarchive/infinite-scroller';
3
- import { CollectionExtraInfo, SearchServiceInterface, SearchType, SortDirection, SortParam } from '@internetarchive/search-service';
4
- import type { SharedResizeObserverInterface, SharedResizeObserverResizeHandlerInterface } from '@internetarchive/shared-resize-observer';
5
- import '@internetarchive/infinite-scroller';
6
- import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
7
- import type { ModalManagerInterface } from '@internetarchive/modal-manager';
8
- import type { FeatureFeedbackServiceInterface } from '@internetarchive/feature-feedback';
9
- import type { RecaptchaManagerInterface } from '@internetarchive/recaptcha-manager';
10
- import './tiles/tile-dispatcher';
11
- import './tiles/collection-browser-loading-tile';
12
- import './sort-filter-bar/sort-filter-bar';
13
- import './manage/manage-bar';
14
- import './collection-facets';
15
- import './circular-activity-indicator';
16
- import { SelectedFacets, SortField, CollectionBrowserContext, TileModel, CollectionDisplayMode, FacetEventDetails } from './models';
17
- import { RestorationStateHandlerInterface } from './restoration-state-handler';
18
- import './empty-placeholder';
19
- export declare class CollectionBrowser extends LitElement implements InfiniteScrollerCellProviderInterface, SharedResizeObserverResizeHandlerInterface {
20
- baseNavigationUrl?: string;
21
- baseImageUrl: string;
22
- searchService?: SearchServiceInterface;
23
- searchType: SearchType;
24
- withinCollection?: string;
25
- baseQuery?: string;
26
- displayMode?: CollectionDisplayMode;
27
- sortParam: SortParam | null;
28
- selectedSort: SortField;
29
- selectedTitleFilter: string | null;
30
- selectedCreatorFilter: string | null;
31
- sortDirection: SortDirection | null;
32
- pageSize: number;
33
- resizeObserver?: SharedResizeObserverInterface;
34
- currentPage?: number;
35
- minSelectedDate?: string;
36
- maxSelectedDate?: string;
37
- selectedFacets?: SelectedFacets;
38
- showHistogramDatePicker: boolean;
39
- collectionPagePath: string;
40
- collectionInfo?: CollectionExtraInfo;
41
- parentCollections: string[];
42
- /** describes where this component is being used */
43
- searchContext: string;
44
- collectionNameCache?: CollectionNameCacheInterface;
45
- pageContext: CollectionBrowserContext;
46
- restorationStateHandler: RestorationStateHandlerInterface;
47
- mobileBreakpoint: number;
48
- loggedIn: boolean;
49
- modalManager?: ModalManagerInterface;
50
- featureFeedbackService?: FeatureFeedbackServiceInterface;
51
- recaptchaManager?: RecaptchaManagerInterface;
52
- /**
53
- * If item management UI active
54
- */
55
- isManageView: boolean;
56
- /**
57
- * The page that the consumer wants to load.
58
- */
59
- private initialPageNumber;
60
- /**
61
- * This the the number of pages that we want to show.
62
- *
63
- * The data isn't necessarily loaded for all of the pages, but this lets us
64
- * know how many cells we should render.
65
- */
66
- private pagesToRender;
67
- /**
68
- * Whether the initial page fetch for a new query is currently in progress.
69
- */
70
- private searchResultsLoading;
71
- private facetsLoading;
72
- private fullYearAggregationLoading;
73
- private aggregations?;
74
- private fullYearsHistogramAggregation;
75
- private totalResults?;
76
- private queryErrorMessage?;
77
- private mobileView;
78
- private mobileFacetsVisible;
79
- private contentWidth?;
80
- private defaultSortField;
81
- private defaultSortDirection;
82
- private placeholderType;
83
- private prefixFilterCountMap;
84
- private contentContainer;
85
- private leftColumn?;
86
- private collectionFacets?;
87
- private analyticsHandler?;
88
- /**
89
- * When we're animated scrolling to the page, we don't want to fetch
90
- * all of the pages as it scrolls so this lets us know if we're scrolling
91
- */
92
- private isScrollingToCell;
93
- /**
94
- * When we've reached the end of the data, stop trying to fetch more
95
- */
96
- private endOfDataReached;
97
- /**
98
- * When page width resizes from desktop to mobile, set true to
99
- * disable expand/collapse transition when loading.
100
- */
101
- private isResizeToMobile;
102
- private leftColIntersectionObserver?;
103
- private facetsIntersectionObserver?;
104
- private placeholderCellTemplate;
105
- private tileModelAtCellIndex;
106
- private get sortFilterQueries();
107
- private get estimatedTileCount();
108
- /**
109
- * The results per page so we can paginate.
110
- *
111
- * This allows us to start in the middle of the search results and
112
- * fetch data before or after the current page. If we don't have a key
113
- * for the previous/next page, we'll fetch the next/previous page to populate it
114
- */
115
- private dataSource;
116
- /**
117
- * How many tiles to offset the data source by, to account for any removed tiles.
118
- */
119
- private tileModelOffset;
120
- private infiniteScroller;
121
- private sessionIdGenPromise?;
122
- /**
123
- * Returns a promise resolving to a unique string that persists for the current browser session.
124
- * Used in generating unique IDs for search requests, so that multiple requests coming from the
125
- * same browser session can be identified.
126
- */
127
- private getSessionId;
128
- /**
129
- * Go to the given page of results
130
- *
131
- * @param pageNumber
132
- */
133
- goToPage(pageNumber: number): Promise<void>;
134
- /**
135
- * Clears all selected/negated facets, date ranges, and letter filters.
136
- *
137
- * By default, the current sort field/direction are not cleared,
138
- * but this can be overridden by setting the `sort` option to `true`.
139
- *
140
- * Similarly, it is possible to finely control what is cleared by
141
- * setting any of the `facets`, `dateRange`, or `letterFilters` flags
142
- * in the options object.
143
- */
144
- clearFilters({ facets, dateRange, letterFilters, sort, }?: {
145
- facets?: boolean | undefined;
146
- dateRange?: boolean | undefined;
147
- letterFilters?: boolean | undefined;
148
- sort?: boolean | undefined;
149
- }): void;
150
- /**
151
- * Returns true if the current value of `this.selectedFacets` contains
152
- * any facet buckets than have been selected or negated, or false otherwise.
153
- */
154
- private get hasCheckedFacets();
155
- /**
156
- * Returns true if there are any currently selected/negated facet buckets,
157
- * any selected date range, or any selected letter filters. False otherwise.
158
- *
159
- * Ignores sorting options.
160
- */
161
- private get hasActiveFilters();
162
- render(): TemplateResult<1>;
163
- private setPlaceholderType;
164
- private get emptyPlaceholderTemplate();
165
- /**
166
- * Top-level template for rendering the left (facets) and right (results) columns.
167
- */
168
- private get collectionBrowserTemplate();
169
- /**
170
- * Template for either the mobile or desktop version of the left column, depending
171
- * on current component state.
172
- */
173
- private get leftColumnTemplate();
174
- /**
175
- * Template for the mobile version of the "left column" (which in this case, appears
176
- * *above* the search results rather than beside them), for rendering the
177
- * accordion-style facets.
178
- */
179
- private get mobileLeftColumnTemplate();
180
- /**
181
- * Template for the desktop version of the left column, displaying the facets sidebar.
182
- */
183
- private get desktopLeftColumnTemplate();
184
- /**
185
- * Template for the "X Results" count at the top of the search results.
186
- * Changes to the "Searching..." label if the search results are still loading.
187
- */
188
- private get resultsCountTemplate();
189
- /**
190
- * Template for the right column of the collection browser, where the result
191
- * tiles and sort/filter bar are shown.
192
- */
193
- private get rightColumnTemplate();
194
- private get infiniteScrollerTemplate();
195
- private get infiniteScrollerClasses();
196
- private get sortFilterBarTemplate();
197
- private get manageBarTemplate();
198
- /**
199
- * Handler for when the user requests to remove all checked items via the manage bar.
200
- * Emits an `itemRemovalRequested` event with all checked tile models.
201
- */
202
- private handleRemoveItems;
203
- /**
204
- * Removes all tile models that are currently checked & adjusts the paging
205
- * of the data source to account for any new gaps in the data.
206
- */
207
- removeCheckedTiles(): void;
208
- /**
209
- * Checks every tile's management checkbox
210
- */
211
- checkAllTiles(): void;
212
- /**
213
- * Unchecks every tile's management checkbox
214
- */
215
- uncheckAllTiles(): void;
216
- /**
217
- * Applies the given map function to all of the tile models in every page of the data
218
- * source. This method updates the data source object in immutable fashion.
219
- *
220
- * @param mapFn A callback function to apply on each tile model, as with Array.map
221
- */
222
- private mapDataSource;
223
- /**
224
- * An array of all the tile models whose management checkboxes are checked
225
- */
226
- get checkedTileModels(): TileModel[];
227
- /**
228
- * An array of all the tile models whose management checkboxes are unchecked
229
- */
230
- get uncheckedTileModels(): TileModel[];
231
- /**
232
- * Returns a flattened, filtered array of all the tile models in the data source
233
- * for which the given predicate returns a truthy value.
234
- *
235
- * @param predicate A callback function to apply on each tile model, as with Array.filter
236
- * @returns A filtered array of tile models satisfying the predicate
237
- */
238
- private getFilteredTileModels;
239
- private userChangedSort;
240
- private sendSortByAnalytics;
241
- private selectedSortChanged;
242
- private displayModeChanged;
243
- /**
244
- * Returns a query clause identifying the currently selected title filter,
245
- * e.g., `firstTitle:X`.
246
- */
247
- private get titleQuery();
248
- /**
249
- * Returns a query clause identifying the currently selected creator filter,
250
- * e.g., `firstCreator:X`.
251
- */
252
- private get creatorQuery();
253
- /**
254
- * Send Analytics when sorting by title's first letter
255
- * labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
256
- */
257
- private sendFilterByTitleAnalytics;
258
- /**
259
- * Send Analytics when filtering by creator's first letter
260
- * labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
261
- */
262
- private sendFilterByCreatorAnalytics;
263
- /**
264
- * Handler for changes to which letter is selected in the title alphabet bar.
265
- */
266
- private titleLetterSelected;
267
- /**
268
- * Handler for changes to which letter is selected in the creator alphabet bar.
269
- */
270
- private creatorLetterSelected;
271
- /**
272
- * The full template for how the facets should be structured in mobile view,
273
- * including the collapsible container (with header) and the facets themselves.
274
- */
275
- private get mobileFacetsTemplate();
276
- /**
277
- * The template for the facets component alone, without any surrounding wrappers.
278
- */
279
- private get facetsTemplate();
280
- /**
281
- * The HTML template for the "Clear all filters" button, or `nothing` if no
282
- * filters are currently active.
283
- *
284
- * @param mobile Whether to style/shorten the button for mobile view
285
- */
286
- private clearFiltersBtnTemplate;
287
- private get loadingTemplate();
288
- private get listHeaderTemplate();
289
- private histogramDateRangeUpdated;
290
- private get dateRangeQueryClause();
291
- /**
292
- * Emits an event indicating a change in whether the manage mode is shown.
293
- */
294
- private emitManageModeChangedEvent;
295
- firstUpdated(): void;
296
- updated(changed: PropertyValues): void;
297
- disconnectedCallback(): void;
298
- handleResize(entry: ResizeObserverEntry): void;
299
- /**
300
- * Sets up listeners for events that may require updating the left column height.
301
- */
302
- private setupLeftColumnScrollListeners;
303
- /**
304
- * Sets up listeners to control whether the facet sidebar shows its bottom fade-out.
305
- * Note this uses a separate IntersectionObserver from the left column, because we
306
- * don't need granular intersection thresholds for this.
307
- */
308
- private setupFacetsScrollListeners;
309
- /**
310
- * Updates the height of the left column according to its position on the page.
311
- * Arrow function ensures proper `this` binding.
312
- */
313
- private updateLeftColumnHeight;
314
- /**
315
- * Toggles whether the fade-out is visible at the bottom of the facets.
316
- * It should only be visible if the facets are not scrolled to the bottom.
317
- * Arrow function ensures proper `this` binding.
318
- */
319
- private updateFacetFadeOut;
320
- private emitBaseQueryChanged;
321
- private emitSearchTypeChanged;
322
- private emitEmptyResults;
323
- private disconnectResizeObserver;
324
- private setupResizeObserver;
325
- /**
326
- * When the visible cells change from the infinite scroller, we want to emit
327
- * which page is currently visible so the consumer can update its UI or the URL
328
- *
329
- * @param e
330
- * @returns
331
- */
332
- private visibleCellsChanged;
333
- private initialQueryChangeHappened;
334
- private historyPopOccurred;
335
- private previousQueryKey?;
336
- /**
337
- * Internal property to store the `resolve` function for the most recent
338
- * `initialSearchComplete` promise, allowing us to resolve it at the appropriate time.
339
- */
340
- private _initialSearchCompleteResolver;
341
- /**
342
- * Internal property to store the private value backing the `initialSearchComplete` getter.
343
- */
344
- private _initialSearchCompletePromise;
345
- /**
346
- * A Promise which, after each query change, resolves once the fetches for the initial
347
- * search have completed. Waits for *both* the hits and aggregations fetches to finish.
348
- *
349
- * Ensure you await this component's `updateComplete` promise before awaiting this
350
- * one, to ensure you do not await an obsolete promise from the previous update.
351
- */
352
- get initialSearchComplete(): Promise<boolean>;
353
- private handleQueryChange;
354
- private setupStateRestorationObserver;
355
- private boundNavigationHandler?;
356
- private historyNavigationHandler;
357
- private restoreState;
358
- private persistState;
359
- private doInitialPageFetch;
360
- private emitSearchResultsLoadingChanged;
361
- /**
362
- * Produces a compact unique ID for a search request that can help with debugging
363
- * on the backend by making related requests easier to trace through different services.
364
- * (e.g., tying the hits/aggregations requests for the same page back to a single hash).
365
- *
366
- * @param params The search service parameters for the request
367
- * @param kind The kind of request (hits-only, aggregations-only, or both)
368
- * @returns A Promise resolving to the uid to apply to the request
369
- */
370
- private requestUID;
371
- /**
372
- * Constructs a search service FilterMap object from the combination of
373
- * all the currently-applied filters. This includes any facets, letter
374
- * filters, and date range.
375
- */
376
- private get filterMap();
377
- /** The full query, including year facets and date range clauses */
378
- private get fullQuery();
379
- /**
380
- * Generates a query string for the given facets
381
- *
382
- * Example: `mediatype:("collection" OR "audio" OR -"etree") AND year:("2000" OR "2001")`
383
- */
384
- private get facetQuery();
385
- /**
386
- * Builds an OR-joined facet clause for the given facet name and values.
387
- *
388
- * E.g., for name `subject` and values
389
- * `{ foo: { state: 'selected' }, bar: { state: 'hidden' } }`
390
- * this will produce the clause
391
- * `subject:("foo" OR -"bar")`.
392
- *
393
- * @param facetName The facet type (e.g., 'collection')
394
- * @param facetValues The facet buckets, mapped by their keys
395
- */
396
- private buildFacetClause;
397
- /**
398
- * Handles some special pre-request normalization steps for certain facet types
399
- * that require them.
400
- *
401
- * @param facetName The name of the facet type (e.g., 'language')
402
- * @param facetValues An array of values for that facet type
403
- */
404
- private prepareFacetForFetch;
405
- /**
406
- * Takes an array of facet clauses, and combines them into a
407
- * full AND-joined facet query string. Empty clauses are ignored.
408
- */
409
- private joinFacetClauses;
410
- facetsChanged(e: CustomEvent<SelectedFacets>): void;
411
- facetClickHandler({ detail: { key, state: facetState, negative }, }: CustomEvent<FacetEventDetails>): void;
412
- private fetchFacets;
413
- private scrollToPage;
414
- /**
415
- * Whether sorting by relevance makes sense for the current state.
416
- * Currently equivalent to having a non-empty query.
417
- */
418
- private get isRelevanceSortAvailable();
419
- /**
420
- * Whether a search may be performed in the current state of the component.
421
- * This is only true if the search service is defined, and either
422
- * (a) a non-empty query is set, or
423
- * (b) we are on a collection page in metadata search mode.
424
- */
425
- private get canPerformSearch();
426
- /**
427
- * Additional params to pass to the search service if targeting a collection page,
428
- * or null otherwise.
429
- */
430
- private get collectionParams();
431
- /**
432
- * The query key is a string that uniquely identifies the current search.
433
- * It consists of:
434
- * - The current base query
435
- * - The current collection
436
- * - The current search type
437
- * - Any currently-applied facets
438
- * - Any currently-applied date range
439
- * - Any currently-applied prefix filters
440
- * - The current sort options
441
- *
442
- * This lets us keep track of queries so we don't persist data that's
443
- * no longer relevant.
444
- */
445
- private get pageFetchQueryKey();
446
- /**
447
- * Similar to `pageFetchQueryKey` above, but excludes sort fields since they
448
- * are not relevant in determining aggregation queries.
449
- */
450
- private get facetFetchQueryKey();
451
- private pageFetchesInProgress;
452
- /**
453
- * Fetches one or more pages of results and updates the data source.
454
- *
455
- * @param pageNumber The page number to fetch
456
- * @param numInitialPages If this is an initial page fetch (`pageNumber = 1`),
457
- * specifies how many pages to batch together in one request. Ignored
458
- * if `pageNumber != 1`, defaulting to a single page.
459
- */
460
- fetchPage(pageNumber: number, numInitialPages?: number): Promise<void>;
461
- private preloadCollectionNames;
462
- /**
463
- * Applies any default sort option for the current collection, by checking
464
- * for one in the collection's metadata. If none is found, defaults to sorting
465
- * descending by:
466
- * - Date Favorited for fav-* collections
467
- * - Weekly views for all other collections
468
- */
469
- private applyDefaultCollectionSort;
470
- /**
471
- * This is useful for determining whether we need to reload the scroller.
472
- *
473
- * When the fetch completes, we need to reload the scroller if the cells for that
474
- * page are visible, but if the page is not currenlty visible, we don't need to reload
475
- */
476
- private get currentVisiblePageNumbers();
477
- /**
478
- * Update the datasource from the fetch response
479
- *
480
- * @param pageNumber
481
- * @param results
482
- */
483
- private updateDataSource;
484
- private getMediatype;
485
- /**
486
- * Returns the input string, but removing one set of quotes from all instances of
487
- * ""clauses wrapped in two sets of quotes"". This assumes the quotes are already
488
- * URL-encoded.
489
- *
490
- * This should be a temporary measure to address the fact that the __href__ field
491
- * sometimes acquires extra quotation marks during query rewriting. Once there is a
492
- * full Lucene parser in place that handles quoted queries correctly, this can likely
493
- * be removed.
494
- */
495
- private collapseRepeatedQuotes;
496
- /** Fetches the aggregation buckets for the given prefix filter type. */
497
- private fetchPrefixFilterBuckets;
498
- /** Fetches and caches the prefix filter counts for the given filter type. */
499
- private updatePrefixFilterCounts;
500
- /**
501
- * Fetches and caches the prefix filter counts for the current sort type,
502
- * provided it is one that permits prefix filtering. (If not, this does nothing).
503
- */
504
- private updatePrefixFiltersForCurrentSort;
505
- /**
506
- * Clears the cached letter counts for both title and creator, and
507
- * fetches a new set of counts for whichever of them is the currently
508
- * selected sort option (which may be neither).
509
- *
510
- * Call this whenever the counts are invalidated (e.g., by a query change).
511
- */
512
- private refreshLetterCounts;
513
- /**
514
- * Callback when a result is selected
515
- */
516
- resultSelected(event: CustomEvent<TileModel>): void;
517
- cellForIndex(index: number): TemplateResult | undefined;
518
- /**
519
- * When the user scrolls near to the bottom of the page, fetch the next page
520
- * increase the number of pages to render and start fetching data for the new page
521
- */
522
- private scrollThresholdReached;
523
- static get styles(): import("lit").CSSResult[];
524
- }
1
+ import { LitElement, PropertyValues, TemplateResult } from 'lit';
2
+ import type { InfiniteScrollerCellProviderInterface } from '@internetarchive/infinite-scroller';
3
+ import { CollectionExtraInfo, SearchServiceInterface, SearchType, SortDirection, SortParam } from '@internetarchive/search-service';
4
+ import type { SharedResizeObserverInterface, SharedResizeObserverResizeHandlerInterface } from '@internetarchive/shared-resize-observer';
5
+ import '@internetarchive/infinite-scroller';
6
+ import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
7
+ import type { ModalManagerInterface } from '@internetarchive/modal-manager';
8
+ import type { FeatureFeedbackServiceInterface } from '@internetarchive/feature-feedback';
9
+ import type { RecaptchaManagerInterface } from '@internetarchive/recaptcha-manager';
10
+ import './tiles/tile-dispatcher';
11
+ import './tiles/collection-browser-loading-tile';
12
+ import './sort-filter-bar/sort-filter-bar';
13
+ import './manage/manage-bar';
14
+ import './collection-facets';
15
+ import './circular-activity-indicator';
16
+ import { SelectedFacets, SortField, CollectionBrowserContext, TileModel, CollectionDisplayMode, FacetEventDetails } from './models';
17
+ import { RestorationStateHandlerInterface } from './restoration-state-handler';
18
+ import './empty-placeholder';
19
+ export declare class CollectionBrowser extends LitElement implements InfiniteScrollerCellProviderInterface, SharedResizeObserverResizeHandlerInterface {
20
+ baseNavigationUrl?: string;
21
+ baseImageUrl: string;
22
+ searchService?: SearchServiceInterface;
23
+ searchType: SearchType;
24
+ withinCollection?: string;
25
+ baseQuery?: string;
26
+ displayMode?: CollectionDisplayMode;
27
+ sortParam: SortParam | null;
28
+ defaultSortParam: SortParam | null;
29
+ selectedSort: SortField;
30
+ selectedTitleFilter: string | null;
31
+ selectedCreatorFilter: string | null;
32
+ sortDirection: SortDirection | null;
33
+ pageSize: number;
34
+ resizeObserver?: SharedResizeObserverInterface;
35
+ currentPage?: number;
36
+ minSelectedDate?: string;
37
+ maxSelectedDate?: string;
38
+ selectedFacets?: SelectedFacets;
39
+ showHistogramDatePicker: boolean;
40
+ collectionPagePath: string;
41
+ collectionInfo?: CollectionExtraInfo;
42
+ parentCollections: string[];
43
+ /** describes where this component is being used */
44
+ searchContext: string;
45
+ collectionNameCache?: CollectionNameCacheInterface;
46
+ pageContext: CollectionBrowserContext;
47
+ restorationStateHandler: RestorationStateHandlerInterface;
48
+ mobileBreakpoint: number;
49
+ loggedIn: boolean;
50
+ modalManager?: ModalManagerInterface;
51
+ featureFeedbackService?: FeatureFeedbackServiceInterface;
52
+ recaptchaManager?: RecaptchaManagerInterface;
53
+ /**
54
+ * If item management UI active
55
+ */
56
+ isManageView: boolean;
57
+ /**
58
+ * The page that the consumer wants to load.
59
+ */
60
+ private initialPageNumber;
61
+ /**
62
+ * This the the number of pages that we want to show.
63
+ *
64
+ * The data isn't necessarily loaded for all of the pages, but this lets us
65
+ * know how many cells we should render.
66
+ */
67
+ private pagesToRender;
68
+ /**
69
+ * Whether the initial page fetch for a new query is currently in progress.
70
+ */
71
+ private searchResultsLoading;
72
+ private facetsLoading;
73
+ private fullYearAggregationLoading;
74
+ private aggregations?;
75
+ private fullYearsHistogramAggregation;
76
+ private totalResults?;
77
+ private queryErrorMessage?;
78
+ private mobileView;
79
+ private mobileFacetsVisible;
80
+ private contentWidth?;
81
+ private defaultSortField;
82
+ private defaultSortDirection;
83
+ private placeholderType;
84
+ private prefixFilterCountMap;
85
+ private contentContainer;
86
+ private leftColumn?;
87
+ private collectionFacets?;
88
+ private analyticsHandler?;
89
+ /**
90
+ * When we're animated scrolling to the page, we don't want to fetch
91
+ * all of the pages as it scrolls so this lets us know if we're scrolling
92
+ */
93
+ private isScrollingToCell;
94
+ /**
95
+ * When we've reached the end of the data, stop trying to fetch more
96
+ */
97
+ private endOfDataReached;
98
+ /**
99
+ * When page width resizes from desktop to mobile, set true to
100
+ * disable expand/collapse transition when loading.
101
+ */
102
+ private isResizeToMobile;
103
+ private leftColIntersectionObserver?;
104
+ private facetsIntersectionObserver?;
105
+ private placeholderCellTemplate;
106
+ private tileModelAtCellIndex;
107
+ private get sortFilterQueries();
108
+ private get estimatedTileCount();
109
+ /**
110
+ * The results per page so we can paginate.
111
+ *
112
+ * This allows us to start in the middle of the search results and
113
+ * fetch data before or after the current page. If we don't have a key
114
+ * for the previous/next page, we'll fetch the next/previous page to populate it
115
+ */
116
+ private dataSource;
117
+ /**
118
+ * How many tiles to offset the data source by, to account for any removed tiles.
119
+ */
120
+ private tileModelOffset;
121
+ private infiniteScroller;
122
+ private sessionIdGenPromise?;
123
+ /**
124
+ * Returns a promise resolving to a unique string that persists for the current browser session.
125
+ * Used in generating unique IDs for search requests, so that multiple requests coming from the
126
+ * same browser session can be identified.
127
+ */
128
+ private getSessionId;
129
+ /**
130
+ * Go to the given page of results
131
+ *
132
+ * @param pageNumber
133
+ */
134
+ goToPage(pageNumber: number): Promise<void>;
135
+ /**
136
+ * Clears all selected/negated facets, date ranges, and letter filters.
137
+ *
138
+ * By default, the current sort field/direction are not cleared,
139
+ * but this can be overridden by setting the `sort` option to `true`.
140
+ *
141
+ * Similarly, it is possible to finely control what is cleared by
142
+ * setting any of the `facets`, `dateRange`, or `letterFilters` flags
143
+ * in the options object.
144
+ */
145
+ clearFilters({ facets, dateRange, letterFilters, sort, }?: {
146
+ facets?: boolean | undefined;
147
+ dateRange?: boolean | undefined;
148
+ letterFilters?: boolean | undefined;
149
+ sort?: boolean | undefined;
150
+ }): void;
151
+ /**
152
+ * Returns true if the current value of `this.selectedFacets` contains
153
+ * any facet buckets than have been selected or negated, or false otherwise.
154
+ */
155
+ private get hasCheckedFacets();
156
+ /**
157
+ * Returns true if there are any currently selected/negated facet buckets,
158
+ * any selected date range, or any selected letter filters. False otherwise.
159
+ *
160
+ * Ignores sorting options.
161
+ */
162
+ private get hasActiveFilters();
163
+ render(): TemplateResult<1>;
164
+ private setPlaceholderType;
165
+ private get emptyPlaceholderTemplate();
166
+ /**
167
+ * Top-level template for rendering the left (facets) and right (results) columns.
168
+ */
169
+ private get collectionBrowserTemplate();
170
+ /**
171
+ * Template for either the mobile or desktop version of the left column, depending
172
+ * on current component state.
173
+ */
174
+ private get leftColumnTemplate();
175
+ /**
176
+ * Template for the mobile version of the "left column" (which in this case, appears
177
+ * *above* the search results rather than beside them), for rendering the
178
+ * accordion-style facets.
179
+ */
180
+ private get mobileLeftColumnTemplate();
181
+ /**
182
+ * Template for the desktop version of the left column, displaying the facets sidebar.
183
+ */
184
+ private get desktopLeftColumnTemplate();
185
+ /**
186
+ * Template for the "X Results" count at the top of the search results.
187
+ * Changes to the "Searching..." label if the search results are still loading.
188
+ */
189
+ private get resultsCountTemplate();
190
+ /**
191
+ * Template for the right column of the collection browser, where the result
192
+ * tiles and sort/filter bar are shown.
193
+ */
194
+ private get rightColumnTemplate();
195
+ private get infiniteScrollerTemplate();
196
+ private get infiniteScrollerClasses();
197
+ private get sortFilterBarTemplate();
198
+ private get manageBarTemplate();
199
+ /**
200
+ * Handler for when the user requests to remove all checked items via the manage bar.
201
+ * Emits an `itemRemovalRequested` event with all checked tile models.
202
+ */
203
+ private handleRemoveItems;
204
+ /**
205
+ * Removes all tile models that are currently checked & adjusts the paging
206
+ * of the data source to account for any new gaps in the data.
207
+ */
208
+ removeCheckedTiles(): void;
209
+ /**
210
+ * Checks every tile's management checkbox
211
+ */
212
+ checkAllTiles(): void;
213
+ /**
214
+ * Unchecks every tile's management checkbox
215
+ */
216
+ uncheckAllTiles(): void;
217
+ /**
218
+ * Applies the given map function to all of the tile models in every page of the data
219
+ * source. This method updates the data source object in immutable fashion.
220
+ *
221
+ * @param mapFn A callback function to apply on each tile model, as with Array.map
222
+ */
223
+ private mapDataSource;
224
+ /**
225
+ * An array of all the tile models whose management checkboxes are checked
226
+ */
227
+ get checkedTileModels(): TileModel[];
228
+ /**
229
+ * An array of all the tile models whose management checkboxes are unchecked
230
+ */
231
+ get uncheckedTileModels(): TileModel[];
232
+ /**
233
+ * Returns a flattened, filtered array of all the tile models in the data source
234
+ * for which the given predicate returns a truthy value.
235
+ *
236
+ * @param predicate A callback function to apply on each tile model, as with Array.filter
237
+ * @returns A filtered array of tile models satisfying the predicate
238
+ */
239
+ private getFilteredTileModels;
240
+ private userChangedSort;
241
+ private sendSortByAnalytics;
242
+ private selectedSortChanged;
243
+ private displayModeChanged;
244
+ /**
245
+ * Returns a query clause identifying the currently selected title filter,
246
+ * e.g., `firstTitle:X`.
247
+ */
248
+ private get titleQuery();
249
+ /**
250
+ * Returns a query clause identifying the currently selected creator filter,
251
+ * e.g., `firstCreator:X`.
252
+ */
253
+ private get creatorQuery();
254
+ /**
255
+ * Send Analytics when sorting by title's first letter
256
+ * labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
257
+ */
258
+ private sendFilterByTitleAnalytics;
259
+ /**
260
+ * Send Analytics when filtering by creator's first letter
261
+ * labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
262
+ */
263
+ private sendFilterByCreatorAnalytics;
264
+ /**
265
+ * Handler for changes to which letter is selected in the title alphabet bar.
266
+ */
267
+ private titleLetterSelected;
268
+ /**
269
+ * Handler for changes to which letter is selected in the creator alphabet bar.
270
+ */
271
+ private creatorLetterSelected;
272
+ /**
273
+ * The full template for how the facets should be structured in mobile view,
274
+ * including the collapsible container (with header) and the facets themselves.
275
+ */
276
+ private get mobileFacetsTemplate();
277
+ /**
278
+ * The template for the facets component alone, without any surrounding wrappers.
279
+ */
280
+ private get facetsTemplate();
281
+ /**
282
+ * The HTML template for the "Clear all filters" button, or `nothing` if no
283
+ * filters are currently active.
284
+ *
285
+ * @param mobile Whether to style/shorten the button for mobile view
286
+ */
287
+ private clearFiltersBtnTemplate;
288
+ private get loadingTemplate();
289
+ private get listHeaderTemplate();
290
+ private histogramDateRangeUpdated;
291
+ private get dateRangeQueryClause();
292
+ /**
293
+ * Emits an event indicating a change in whether the manage mode is shown.
294
+ */
295
+ private emitManageModeChangedEvent;
296
+ firstUpdated(): void;
297
+ updated(changed: PropertyValues): void;
298
+ disconnectedCallback(): void;
299
+ handleResize(entry: ResizeObserverEntry): void;
300
+ /**
301
+ * Sets up listeners for events that may require updating the left column height.
302
+ */
303
+ private setupLeftColumnScrollListeners;
304
+ /**
305
+ * Sets up listeners to control whether the facet sidebar shows its bottom fade-out.
306
+ * Note this uses a separate IntersectionObserver from the left column, because we
307
+ * don't need granular intersection thresholds for this.
308
+ */
309
+ private setupFacetsScrollListeners;
310
+ /**
311
+ * Updates the height of the left column according to its position on the page.
312
+ * Arrow function ensures proper `this` binding.
313
+ */
314
+ private updateLeftColumnHeight;
315
+ /**
316
+ * Toggles whether the fade-out is visible at the bottom of the facets.
317
+ * It should only be visible if the facets are not scrolled to the bottom.
318
+ * Arrow function ensures proper `this` binding.
319
+ */
320
+ private updateFacetFadeOut;
321
+ private emitBaseQueryChanged;
322
+ private emitSearchTypeChanged;
323
+ private emitEmptyResults;
324
+ private disconnectResizeObserver;
325
+ private setupResizeObserver;
326
+ /**
327
+ * When the visible cells change from the infinite scroller, we want to emit
328
+ * which page is currently visible so the consumer can update its UI or the URL
329
+ *
330
+ * @param e
331
+ * @returns
332
+ */
333
+ private visibleCellsChanged;
334
+ private initialQueryChangeHappened;
335
+ private historyPopOccurred;
336
+ private previousQueryKey?;
337
+ /**
338
+ * Internal property to store the `resolve` function for the most recent
339
+ * `initialSearchComplete` promise, allowing us to resolve it at the appropriate time.
340
+ */
341
+ private _initialSearchCompleteResolver;
342
+ /**
343
+ * Internal property to store the private value backing the `initialSearchComplete` getter.
344
+ */
345
+ private _initialSearchCompletePromise;
346
+ /**
347
+ * A Promise which, after each query change, resolves once the fetches for the initial
348
+ * search have completed. Waits for *both* the hits and aggregations fetches to finish.
349
+ *
350
+ * Ensure you await this component's `updateComplete` promise before awaiting this
351
+ * one, to ensure you do not await an obsolete promise from the previous update.
352
+ */
353
+ get initialSearchComplete(): Promise<boolean>;
354
+ private handleQueryChange;
355
+ private setupStateRestorationObserver;
356
+ private boundNavigationHandler?;
357
+ private historyNavigationHandler;
358
+ private restoreState;
359
+ private persistState;
360
+ private doInitialPageFetch;
361
+ private emitSearchResultsLoadingChanged;
362
+ /**
363
+ * Produces a compact unique ID for a search request that can help with debugging
364
+ * on the backend by making related requests easier to trace through different services.
365
+ * (e.g., tying the hits/aggregations requests for the same page back to a single hash).
366
+ *
367
+ * @param params The search service parameters for the request
368
+ * @param kind The kind of request (hits-only, aggregations-only, or both)
369
+ * @returns A Promise resolving to the uid to apply to the request
370
+ */
371
+ private requestUID;
372
+ /**
373
+ * Constructs a search service FilterMap object from the combination of
374
+ * all the currently-applied filters. This includes any facets, letter
375
+ * filters, and date range.
376
+ */
377
+ private get filterMap();
378
+ /** The full query, including year facets and date range clauses */
379
+ private get fullQuery();
380
+ /**
381
+ * Generates a query string for the given facets
382
+ *
383
+ * Example: `mediatype:("collection" OR "audio" OR -"etree") AND year:("2000" OR "2001")`
384
+ */
385
+ private get facetQuery();
386
+ /**
387
+ * Builds an OR-joined facet clause for the given facet name and values.
388
+ *
389
+ * E.g., for name `subject` and values
390
+ * `{ foo: { state: 'selected' }, bar: { state: 'hidden' } }`
391
+ * this will produce the clause
392
+ * `subject:("foo" OR -"bar")`.
393
+ *
394
+ * @param facetName The facet type (e.g., 'collection')
395
+ * @param facetValues The facet buckets, mapped by their keys
396
+ */
397
+ private buildFacetClause;
398
+ /**
399
+ * Handles some special pre-request normalization steps for certain facet types
400
+ * that require them.
401
+ *
402
+ * @param facetName The name of the facet type (e.g., 'language')
403
+ * @param facetValues An array of values for that facet type
404
+ */
405
+ private prepareFacetForFetch;
406
+ /**
407
+ * Takes an array of facet clauses, and combines them into a
408
+ * full AND-joined facet query string. Empty clauses are ignored.
409
+ */
410
+ private joinFacetClauses;
411
+ facetsChanged(e: CustomEvent<SelectedFacets>): void;
412
+ facetClickHandler({ detail: { key, state: facetState, negative }, }: CustomEvent<FacetEventDetails>): void;
413
+ private fetchFacets;
414
+ private scrollToPage;
415
+ /**
416
+ * Whether sorting by relevance makes sense for the current state.
417
+ * Currently equivalent to having a non-empty query.
418
+ */
419
+ private get isRelevanceSortAvailable();
420
+ /**
421
+ * Whether a search may be performed in the current state of the component.
422
+ * This is only true if the search service is defined, and either
423
+ * (a) a non-empty query is set, or
424
+ * (b) we are on a collection page in metadata search mode.
425
+ */
426
+ private get canPerformSearch();
427
+ /**
428
+ * Additional params to pass to the search service if targeting a collection page,
429
+ * or null otherwise.
430
+ */
431
+ private get collectionParams();
432
+ /**
433
+ * The query key is a string that uniquely identifies the current search.
434
+ * It consists of:
435
+ * - The current base query
436
+ * - The current collection
437
+ * - The current search type
438
+ * - Any currently-applied facets
439
+ * - Any currently-applied date range
440
+ * - Any currently-applied prefix filters
441
+ * - The current sort options
442
+ *
443
+ * This lets us keep track of queries so we don't persist data that's
444
+ * no longer relevant.
445
+ */
446
+ private get pageFetchQueryKey();
447
+ /**
448
+ * Similar to `pageFetchQueryKey` above, but excludes sort fields since they
449
+ * are not relevant in determining aggregation queries.
450
+ */
451
+ private get facetFetchQueryKey();
452
+ private pageFetchesInProgress;
453
+ /**
454
+ * Fetches one or more pages of results and updates the data source.
455
+ *
456
+ * @param pageNumber The page number to fetch
457
+ * @param numInitialPages If this is an initial page fetch (`pageNumber = 1`),
458
+ * specifies how many pages to batch together in one request. Ignored
459
+ * if `pageNumber != 1`, defaulting to a single page.
460
+ */
461
+ fetchPage(pageNumber: number, numInitialPages?: number): Promise<void>;
462
+ private preloadCollectionNames;
463
+ /**
464
+ * Applies any default sort option for the current collection, by checking
465
+ * for one in the collection's metadata. If none is found, defaults to sorting
466
+ * descending by:
467
+ * - Date Favorited for fav-* collections
468
+ * - Weekly views for all other collections
469
+ */
470
+ private applyDefaultCollectionSort;
471
+ /**
472
+ * This is useful for determining whether we need to reload the scroller.
473
+ *
474
+ * When the fetch completes, we need to reload the scroller if the cells for that
475
+ * page are visible, but if the page is not currenlty visible, we don't need to reload
476
+ */
477
+ private get currentVisiblePageNumbers();
478
+ /**
479
+ * Update the datasource from the fetch response
480
+ *
481
+ * @param pageNumber
482
+ * @param results
483
+ */
484
+ private updateDataSource;
485
+ private getMediatype;
486
+ /**
487
+ * Returns the input string, but removing one set of quotes from all instances of
488
+ * ""clauses wrapped in two sets of quotes"". This assumes the quotes are already
489
+ * URL-encoded.
490
+ *
491
+ * This should be a temporary measure to address the fact that the __href__ field
492
+ * sometimes acquires extra quotation marks during query rewriting. Once there is a
493
+ * full Lucene parser in place that handles quoted queries correctly, this can likely
494
+ * be removed.
495
+ */
496
+ private collapseRepeatedQuotes;
497
+ /** Fetches the aggregation buckets for the given prefix filter type. */
498
+ private fetchPrefixFilterBuckets;
499
+ /** Fetches and caches the prefix filter counts for the given filter type. */
500
+ private updatePrefixFilterCounts;
501
+ /**
502
+ * Fetches and caches the prefix filter counts for the current sort type,
503
+ * provided it is one that permits prefix filtering. (If not, this does nothing).
504
+ */
505
+ private updatePrefixFiltersForCurrentSort;
506
+ /**
507
+ * Clears the cached letter counts for both title and creator, and
508
+ * fetches a new set of counts for whichever of them is the currently
509
+ * selected sort option (which may be neither).
510
+ *
511
+ * Call this whenever the counts are invalidated (e.g., by a query change).
512
+ */
513
+ private refreshLetterCounts;
514
+ /**
515
+ * Callback when a result is selected
516
+ */
517
+ resultSelected(event: CustomEvent<TileModel>): void;
518
+ cellForIndex(index: number): TemplateResult | undefined;
519
+ /**
520
+ * When the user scrolls near to the bottom of the page, fetch the next page
521
+ * increase the number of pages to render and start fetching data for the new page
522
+ */
523
+ private scrollThresholdReached;
524
+ static get styles(): import("lit").CSSResult[];
525
+ }