@internetarchive/collection-browser 3.3.2 → 3.3.4-alpha-webdev7761.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (543) hide show
  1. package/.editorconfig +29 -29
  2. package/.github/workflows/ci.yml +27 -27
  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/.prettierignore +1 -1
  8. package/LICENSE +661 -661
  9. package/README.md +83 -83
  10. package/dist/index.d.ts +16 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/src/app-root.d.ts +105 -0
  13. package/dist/src/app-root.js +1076 -0
  14. package/dist/src/app-root.js.map +1 -0
  15. package/dist/src/assets/img/icons/arrow-left.d.ts +2 -0
  16. package/dist/src/assets/img/icons/arrow-left.js +10 -0
  17. package/dist/src/assets/img/icons/arrow-left.js.map +1 -0
  18. package/dist/src/assets/img/icons/arrow-right.d.ts +2 -0
  19. package/dist/src/assets/img/icons/arrow-right.js +10 -0
  20. package/dist/src/assets/img/icons/arrow-right.js.map +1 -0
  21. package/dist/src/assets/img/icons/chevron.d.ts +2 -0
  22. package/dist/src/assets/img/icons/chevron.js +4 -0
  23. package/dist/src/assets/img/icons/chevron.js.map +1 -0
  24. package/dist/src/assets/img/icons/close-circle-dark.d.ts +2 -0
  25. package/dist/src/assets/img/icons/close-circle-dark.js +5 -0
  26. package/dist/src/assets/img/icons/close-circle-dark.js.map +1 -0
  27. package/dist/src/assets/img/icons/contract.d.ts +2 -0
  28. package/dist/src/assets/img/icons/contract.js +9 -0
  29. package/dist/src/assets/img/icons/contract.js.map +1 -0
  30. package/dist/src/assets/img/icons/empty-query.d.ts +2 -0
  31. package/dist/src/assets/img/icons/empty-query.js +5 -0
  32. package/dist/src/assets/img/icons/empty-query.js.map +1 -0
  33. package/dist/src/assets/img/icons/expand.d.ts +2 -0
  34. package/dist/src/assets/img/icons/expand.js +9 -0
  35. package/dist/src/assets/img/icons/expand.js.map +1 -0
  36. package/dist/src/assets/img/icons/eye-closed.d.ts +2 -0
  37. package/dist/src/assets/img/icons/eye-closed.js +5 -0
  38. package/dist/src/assets/img/icons/eye-closed.js.map +1 -0
  39. package/dist/src/assets/img/icons/eye.d.ts +2 -0
  40. package/dist/src/assets/img/icons/eye.js +5 -0
  41. package/dist/src/assets/img/icons/eye.js.map +1 -0
  42. package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -0
  43. package/dist/src/assets/img/icons/favorite-filled.js +10 -0
  44. package/dist/src/assets/img/icons/favorite-filled.js.map +1 -0
  45. package/dist/src/assets/img/icons/favorite-unfilled.d.ts +1 -0
  46. package/dist/src/assets/img/icons/favorite-unfilled.js +9 -0
  47. package/dist/src/assets/img/icons/favorite-unfilled.js.map +1 -0
  48. package/dist/src/assets/img/icons/filter.d.ts +2 -0
  49. package/dist/src/assets/img/icons/filter.js +10 -0
  50. package/dist/src/assets/img/icons/filter.js.map +1 -0
  51. package/dist/src/assets/img/icons/login-required.d.ts +1 -0
  52. package/dist/src/assets/img/icons/login-required.js +18 -0
  53. package/dist/src/assets/img/icons/login-required.js.map +1 -0
  54. package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -0
  55. package/dist/src/assets/img/icons/mediatype/account.js +14 -0
  56. package/dist/src/assets/img/icons/mediatype/account.js.map +1 -0
  57. package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -0
  58. package/dist/src/assets/img/icons/mediatype/audio.js +14 -0
  59. package/dist/src/assets/img/icons/mediatype/audio.js.map +1 -0
  60. package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -0
  61. package/dist/src/assets/img/icons/mediatype/collection.js +12 -0
  62. package/dist/src/assets/img/icons/mediatype/collection.js.map +1 -0
  63. package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -0
  64. package/dist/src/assets/img/icons/mediatype/data.js +15 -0
  65. package/dist/src/assets/img/icons/mediatype/data.js.map +1 -0
  66. package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -0
  67. package/dist/src/assets/img/icons/mediatype/etree.js +14 -0
  68. package/dist/src/assets/img/icons/mediatype/etree.js.map +1 -0
  69. package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -0
  70. package/dist/src/assets/img/icons/mediatype/film.js +14 -0
  71. package/dist/src/assets/img/icons/mediatype/film.js.map +1 -0
  72. package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -0
  73. package/dist/src/assets/img/icons/mediatype/images.js +13 -0
  74. package/dist/src/assets/img/icons/mediatype/images.js.map +1 -0
  75. package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -0
  76. package/dist/src/assets/img/icons/mediatype/radio.js +15 -0
  77. package/dist/src/assets/img/icons/mediatype/radio.js.map +1 -0
  78. package/dist/src/assets/img/icons/mediatype/search.d.ts +1 -0
  79. package/dist/src/assets/img/icons/mediatype/search.js +14 -0
  80. package/dist/src/assets/img/icons/mediatype/search.js.map +1 -0
  81. package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -0
  82. package/dist/src/assets/img/icons/mediatype/software.js +13 -0
  83. package/dist/src/assets/img/icons/mediatype/software.js.map +1 -0
  84. package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -0
  85. package/dist/src/assets/img/icons/mediatype/texts.js +13 -0
  86. package/dist/src/assets/img/icons/mediatype/texts.js.map +1 -0
  87. package/dist/src/assets/img/icons/mediatype/tv-commercial.d.ts +1 -0
  88. package/dist/src/assets/img/icons/mediatype/tv-commercial.js +12 -0
  89. package/dist/src/assets/img/icons/mediatype/tv-commercial.js.map +1 -0
  90. package/dist/src/assets/img/icons/mediatype/tv-fact-check.d.ts +1 -0
  91. package/dist/src/assets/img/icons/mediatype/tv-fact-check.js +12 -0
  92. package/dist/src/assets/img/icons/mediatype/tv-fact-check.js.map +1 -0
  93. package/dist/src/assets/img/icons/mediatype/tv-quote.d.ts +1 -0
  94. package/dist/src/assets/img/icons/mediatype/tv-quote.js +12 -0
  95. package/dist/src/assets/img/icons/mediatype/tv-quote.js.map +1 -0
  96. package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -0
  97. package/dist/src/assets/img/icons/mediatype/tv.js +14 -0
  98. package/dist/src/assets/img/icons/mediatype/tv.js.map +1 -0
  99. package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -0
  100. package/dist/src/assets/img/icons/mediatype/video.js +14 -0
  101. package/dist/src/assets/img/icons/mediatype/video.js.map +1 -0
  102. package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -0
  103. package/dist/src/assets/img/icons/mediatype/web.js +13 -0
  104. package/dist/src/assets/img/icons/mediatype/web.js.map +1 -0
  105. package/dist/src/assets/img/icons/null-result.d.ts +2 -0
  106. package/dist/src/assets/img/icons/null-result.js +5 -0
  107. package/dist/src/assets/img/icons/null-result.js.map +1 -0
  108. package/dist/src/assets/img/icons/quote.d.ts +1 -0
  109. package/dist/src/assets/img/icons/quote.js +7 -0
  110. package/dist/src/assets/img/icons/quote.js.map +1 -0
  111. package/dist/src/assets/img/icons/restricted.d.ts +1 -0
  112. package/dist/src/assets/img/icons/restricted.js +13 -0
  113. package/dist/src/assets/img/icons/restricted.js.map +1 -0
  114. package/dist/src/assets/img/icons/reviews.d.ts +1 -0
  115. package/dist/src/assets/img/icons/reviews.js +11 -0
  116. package/dist/src/assets/img/icons/reviews.js.map +1 -0
  117. package/dist/src/assets/img/icons/upload.d.ts +1 -0
  118. package/dist/src/assets/img/icons/upload.js +12 -0
  119. package/dist/src/assets/img/icons/upload.js.map +1 -0
  120. package/dist/src/assets/img/icons/views.d.ts +1 -0
  121. package/dist/src/assets/img/icons/views.js +11 -0
  122. package/dist/src/assets/img/icons/views.js.map +1 -0
  123. package/dist/src/circular-activity-indicator.d.ts +5 -0
  124. package/dist/src/circular-activity-indicator.js +66 -0
  125. package/dist/src/circular-activity-indicator.js.map +1 -0
  126. package/dist/src/collection-browser.d.ts +692 -0
  127. package/dist/src/collection-browser.js +2669 -0
  128. package/dist/src/collection-browser.js.map +1 -0
  129. package/dist/src/collection-facets/facet-row.d.ts +30 -0
  130. package/dist/src/collection-facets/facet-row.js +266 -0
  131. package/dist/src/collection-facets/facet-row.js.map +1 -0
  132. package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -0
  133. package/dist/src/collection-facets/facet-tombstone-row.js +43 -0
  134. package/dist/src/collection-facets/facet-tombstone-row.js.map +1 -0
  135. package/dist/src/collection-facets/facets-template.d.ts +13 -0
  136. package/dist/src/collection-facets/facets-template.js +68 -0
  137. package/dist/src/collection-facets/facets-template.js.map +1 -0
  138. package/dist/src/collection-facets/models.d.ts +9 -0
  139. package/dist/src/collection-facets/models.js +10 -0
  140. package/dist/src/collection-facets/models.js.map +1 -0
  141. package/dist/src/collection-facets/more-facets-content.d.ts +109 -0
  142. package/dist/src/collection-facets/more-facets-content.js +547 -0
  143. package/dist/src/collection-facets/more-facets-content.js.map +1 -0
  144. package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -0
  145. package/dist/src/collection-facets/more-facets-pagination.js +264 -0
  146. package/dist/src/collection-facets/more-facets-pagination.js.map +1 -0
  147. package/dist/src/collection-facets/smart-facets/dedupe.d.ts +10 -0
  148. package/dist/src/collection-facets/smart-facets/dedupe.js +35 -0
  149. package/dist/src/collection-facets/smart-facets/dedupe.js.map +1 -0
  150. package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.d.ts +5 -0
  151. package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js +24 -0
  152. package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js.map +1 -0
  153. package/dist/src/collection-facets/smart-facets/heuristics/index.d.ts +3 -0
  154. package/dist/src/collection-facets/smart-facets/heuristics/index.js +4 -0
  155. package/dist/src/collection-facets/smart-facets/heuristics/index.js.map +1 -0
  156. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.d.ts +4 -0
  157. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js +14 -0
  158. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js.map +1 -0
  159. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.d.ts +6 -0
  160. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js +68 -0
  161. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js.map +1 -0
  162. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.d.ts +9 -0
  163. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js +69 -0
  164. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js.map +1 -0
  165. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.d.ts +21 -0
  166. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +76 -0
  167. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +1 -0
  168. package/dist/src/collection-facets/smart-facets/models.d.ts +30 -0
  169. package/dist/src/collection-facets/smart-facets/models.js +2 -0
  170. package/dist/src/collection-facets/smart-facets/models.js.map +1 -0
  171. package/dist/src/collection-facets/smart-facets/smart-facet-bar.d.ts +54 -0
  172. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +383 -0
  173. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -0
  174. package/dist/src/collection-facets/smart-facets/smart-facet-button.d.ts +11 -0
  175. package/dist/src/collection-facets/smart-facets/smart-facet-button.js +133 -0
  176. package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +1 -0
  177. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.d.ts +28 -0
  178. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +172 -0
  179. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -0
  180. package/dist/src/collection-facets/smart-facets/smart-facet-equals.d.ts +2 -0
  181. package/dist/src/collection-facets/smart-facets/smart-facet-equals.js +13 -0
  182. package/dist/src/collection-facets/smart-facets/smart-facet-equals.js.map +1 -0
  183. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.d.ts +5 -0
  184. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js +18 -0
  185. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +1 -0
  186. package/dist/src/collection-facets/toggle-switch.d.ts +41 -0
  187. package/dist/src/collection-facets/toggle-switch.js +174 -0
  188. package/dist/src/collection-facets/toggle-switch.js.map +1 -0
  189. package/dist/src/collection-facets.d.ts +113 -0
  190. package/dist/src/collection-facets.js +884 -0
  191. package/dist/src/collection-facets.js.map +1 -0
  192. package/dist/src/data-source/collection-browser-data-source-interface.d.ts +270 -0
  193. package/dist/src/data-source/collection-browser-data-source-interface.js +2 -0
  194. package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -0
  195. package/dist/src/data-source/collection-browser-data-source.d.ts +418 -0
  196. package/dist/src/data-source/collection-browser-data-source.js +1121 -0
  197. package/dist/src/data-source/collection-browser-data-source.js.map +1 -0
  198. package/dist/src/data-source/collection-browser-query-state.d.ts +48 -0
  199. package/dist/src/data-source/collection-browser-query-state.js +2 -0
  200. package/dist/src/data-source/collection-browser-query-state.js.map +1 -0
  201. package/dist/src/data-source/models.d.ts +43 -0
  202. package/dist/src/data-source/models.js +9 -0
  203. package/dist/src/data-source/models.js.map +1 -0
  204. package/dist/src/empty-placeholder.d.ts +23 -0
  205. package/dist/src/empty-placeholder.js +165 -0
  206. package/dist/src/empty-placeholder.js.map +1 -0
  207. package/dist/src/expanded-date-picker.d.ts +50 -0
  208. package/dist/src/expanded-date-picker.js +182 -0
  209. package/dist/src/expanded-date-picker.js.map +1 -0
  210. package/dist/src/language-code-handler/language-code-handler.d.ts +37 -0
  211. package/dist/src/language-code-handler/language-code-handler.js +27 -0
  212. package/dist/src/language-code-handler/language-code-handler.js.map +1 -0
  213. package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -0
  214. package/dist/src/language-code-handler/language-code-mapping.js +563 -0
  215. package/dist/src/language-code-handler/language-code-mapping.js.map +1 -0
  216. package/dist/src/manage/manage-bar.d.ts +58 -0
  217. package/dist/src/manage/manage-bar.js +237 -0
  218. package/dist/src/manage/manage-bar.js.map +1 -0
  219. package/dist/src/manage/remove-items-modal-content.d.ts +9 -0
  220. package/dist/src/manage/remove-items-modal-content.js +104 -0
  221. package/dist/src/manage/remove-items-modal-content.js.map +1 -0
  222. package/dist/src/mediatype/mediatype-config.d.ts +11 -0
  223. package/dist/src/mediatype/mediatype-config.js +116 -0
  224. package/dist/src/mediatype/mediatype-config.js.map +1 -0
  225. package/dist/src/models.d.ts +298 -0
  226. package/dist/src/models.js +507 -0
  227. package/dist/src/models.js.map +1 -0
  228. package/dist/src/restoration-state-handler.d.ts +74 -0
  229. package/dist/src/restoration-state-handler.js +397 -0
  230. package/dist/src/restoration-state-handler.js.map +1 -0
  231. package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +6 -0
  232. package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +60 -0
  233. package/dist/src/sort-filter-bar/alpha-bar-tooltip.js.map +1 -0
  234. package/dist/src/sort-filter-bar/alpha-bar.d.ts +21 -0
  235. package/dist/src/sort-filter-bar/alpha-bar.js +241 -0
  236. package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -0
  237. package/dist/src/sort-filter-bar/img/compact.d.ts +1 -0
  238. package/dist/src/sort-filter-bar/img/compact.js +5 -0
  239. package/dist/src/sort-filter-bar/img/compact.js.map +1 -0
  240. package/dist/src/sort-filter-bar/img/list.d.ts +1 -0
  241. package/dist/src/sort-filter-bar/img/list.js +5 -0
  242. package/dist/src/sort-filter-bar/img/list.js.map +1 -0
  243. package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -0
  244. package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +15 -0
  245. package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js.map +1 -0
  246. package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -0
  247. package/dist/src/sort-filter-bar/img/sort-toggle-down.js +17 -0
  248. package/dist/src/sort-filter-bar/img/sort-toggle-down.js.map +1 -0
  249. package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -0
  250. package/dist/src/sort-filter-bar/img/sort-toggle-up.js +17 -0
  251. package/dist/src/sort-filter-bar/img/sort-toggle-up.js.map +1 -0
  252. package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -0
  253. package/dist/src/sort-filter-bar/img/sort-triangle.js +5 -0
  254. package/dist/src/sort-filter-bar/img/sort-triangle.js.map +1 -0
  255. package/dist/src/sort-filter-bar/img/tile.d.ts +1 -0
  256. package/dist/src/sort-filter-bar/img/tile.js +5 -0
  257. package/dist/src/sort-filter-bar/img/tile.js.map +1 -0
  258. package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +278 -0
  259. package/dist/src/sort-filter-bar/sort-filter-bar.js +1161 -0
  260. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -0
  261. package/dist/src/styles/ia-button.d.ts +2 -0
  262. package/dist/src/styles/ia-button.js +134 -0
  263. package/dist/src/styles/ia-button.js.map +1 -0
  264. package/dist/src/styles/item-image-styles.d.ts +8 -0
  265. package/dist/src/styles/item-image-styles.js +123 -0
  266. package/dist/src/styles/item-image-styles.js.map +1 -0
  267. package/dist/src/styles/sr-only.d.ts +1 -0
  268. package/dist/src/styles/sr-only.js +18 -0
  269. package/dist/src/styles/sr-only.js.map +1 -0
  270. package/dist/src/tiles/base-tile-component.d.ts +27 -0
  271. package/dist/src/tiles/base-tile-component.js +82 -0
  272. package/dist/src/tiles/base-tile-component.js.map +1 -0
  273. package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -0
  274. package/dist/src/tiles/collection-browser-loading-tile.js +29 -0
  275. package/dist/src/tiles/collection-browser-loading-tile.js.map +1 -0
  276. package/dist/src/tiles/grid/account-tile.d.ts +18 -0
  277. package/dist/src/tiles/grid/account-tile.js +111 -0
  278. package/dist/src/tiles/grid/account-tile.js.map +1 -0
  279. package/dist/src/tiles/grid/collection-tile.d.ts +15 -0
  280. package/dist/src/tiles/grid/collection-tile.js +160 -0
  281. package/dist/src/tiles/grid/collection-tile.js.map +1 -0
  282. package/dist/src/tiles/grid/item-tile.d.ts +41 -0
  283. package/dist/src/tiles/grid/item-tile.js +321 -0
  284. package/dist/src/tiles/grid/item-tile.js.map +1 -0
  285. package/dist/src/tiles/grid/search-tile.d.ts +10 -0
  286. package/dist/src/tiles/grid/search-tile.js +95 -0
  287. package/dist/src/tiles/grid/search-tile.js.map +1 -0
  288. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -0
  289. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +128 -0
  290. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -0
  291. package/dist/src/tiles/grid/tile-stats.d.ts +58 -0
  292. package/dist/src/tiles/grid/tile-stats.js +204 -0
  293. package/dist/src/tiles/grid/tile-stats.js.map +1 -0
  294. package/dist/src/tiles/hover/hover-pane-controller.d.ts +228 -0
  295. package/dist/src/tiles/hover/hover-pane-controller.js +446 -0
  296. package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -0
  297. package/dist/src/tiles/hover/tile-hover-pane.d.ts +20 -0
  298. package/dist/src/tiles/hover/tile-hover-pane.js +185 -0
  299. package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -0
  300. package/dist/src/tiles/image-block.d.ts +19 -0
  301. package/dist/src/tiles/image-block.js +175 -0
  302. package/dist/src/tiles/image-block.js.map +1 -0
  303. package/dist/src/tiles/item-image.d.ts +40 -0
  304. package/dist/src/tiles/item-image.js +191 -0
  305. package/dist/src/tiles/item-image.js.map +1 -0
  306. package/dist/src/tiles/list/tile-list-compact-header.d.ts +6 -0
  307. package/dist/src/tiles/list/tile-list-compact-header.js +85 -0
  308. package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -0
  309. package/dist/src/tiles/list/tile-list-compact.d.ts +19 -0
  310. package/dist/src/tiles/list/tile-list-compact.js +223 -0
  311. package/dist/src/tiles/list/tile-list-compact.js.map +1 -0
  312. package/dist/src/tiles/list/tile-list.d.ts +54 -0
  313. package/dist/src/tiles/list/tile-list.js +621 -0
  314. package/dist/src/tiles/list/tile-list.js.map +1 -0
  315. package/dist/src/tiles/models.d.ts +1 -0
  316. package/dist/src/tiles/models.js +2 -0
  317. package/dist/src/tiles/models.js.map +1 -0
  318. package/dist/src/tiles/overlay/icon-overlay.d.ts +8 -0
  319. package/dist/src/tiles/overlay/icon-overlay.js +55 -0
  320. package/dist/src/tiles/overlay/icon-overlay.js.map +1 -0
  321. package/dist/src/tiles/overlay/text-overlay.d.ts +9 -0
  322. package/dist/src/tiles/overlay/text-overlay.js +74 -0
  323. package/dist/src/tiles/overlay/text-overlay.js.map +1 -0
  324. package/dist/src/tiles/review-block.d.ts +12 -0
  325. package/dist/src/tiles/review-block.js +134 -0
  326. package/dist/src/tiles/review-block.js.map +1 -0
  327. package/dist/src/tiles/text-snippet-block.d.ts +27 -0
  328. package/dist/src/tiles/text-snippet-block.js +132 -0
  329. package/dist/src/tiles/text-snippet-block.js.map +1 -0
  330. package/dist/src/tiles/tile-dispatcher.d.ts +71 -0
  331. package/dist/src/tiles/tile-dispatcher.js +472 -0
  332. package/dist/src/tiles/tile-dispatcher.js.map +1 -0
  333. package/dist/src/tiles/tile-display-value-provider.d.ts +47 -0
  334. package/dist/src/tiles/tile-display-value-provider.js +95 -0
  335. package/dist/src/tiles/tile-display-value-provider.js.map +1 -0
  336. package/dist/src/tiles/tile-mediatype-icon.d.ts +27 -0
  337. package/dist/src/tiles/tile-mediatype-icon.js +130 -0
  338. package/dist/src/tiles/tile-mediatype-icon.js.map +1 -0
  339. package/dist/src/utils/analytics-events.d.ts +28 -0
  340. package/dist/src/utils/analytics-events.js +31 -0
  341. package/dist/src/utils/analytics-events.js.map +1 -0
  342. package/dist/src/utils/array-equals.d.ts +4 -0
  343. package/dist/src/utils/array-equals.js +11 -0
  344. package/dist/src/utils/array-equals.js.map +1 -0
  345. package/dist/src/utils/collapse-repeated-quotes.d.ts +11 -0
  346. package/dist/src/utils/collapse-repeated-quotes.js +14 -0
  347. package/dist/src/utils/collapse-repeated-quotes.js.map +1 -0
  348. package/dist/src/utils/facet-utils.d.ts +83 -0
  349. package/dist/src/utils/facet-utils.js +152 -0
  350. package/dist/src/utils/facet-utils.js.map +1 -0
  351. package/dist/src/utils/format-count.d.ts +7 -0
  352. package/dist/src/utils/format-count.js +76 -0
  353. package/dist/src/utils/format-count.js.map +1 -0
  354. package/dist/src/utils/format-date.d.ts +16 -0
  355. package/dist/src/utils/format-date.js +33 -0
  356. package/dist/src/utils/format-date.js.map +1 -0
  357. package/dist/src/utils/format-unit-size.d.ts +2 -0
  358. package/dist/src/utils/format-unit-size.js +34 -0
  359. package/dist/src/utils/format-unit-size.js.map +1 -0
  360. package/dist/src/utils/local-date-from-utc.d.ts +9 -0
  361. package/dist/src/utils/local-date-from-utc.js +16 -0
  362. package/dist/src/utils/local-date-from-utc.js.map +1 -0
  363. package/dist/src/utils/log.d.ts +7 -0
  364. package/dist/src/utils/log.js +14 -0
  365. package/dist/src/utils/log.js.map +1 -0
  366. package/dist/src/utils/resolve-mediatype.d.ts +8 -0
  367. package/dist/src/utils/resolve-mediatype.js +24 -0
  368. package/dist/src/utils/resolve-mediatype.js.map +1 -0
  369. package/dist/src/utils/sha1.d.ts +2 -0
  370. package/dist/src/utils/sha1.js +9 -0
  371. package/dist/src/utils/sha1.js.map +1 -0
  372. package/dist/test/collection-browser.test.d.ts +1 -0
  373. package/dist/test/collection-browser.test.js +1721 -0
  374. package/dist/test/collection-browser.test.js.map +1 -0
  375. package/dist/test/collection-facets/facet-row.test.d.ts +1 -0
  376. package/dist/test/collection-facets/facet-row.test.js +274 -0
  377. package/dist/test/collection-facets/facet-row.test.js.map +1 -0
  378. package/dist/test/collection-facets/facets-template.test.d.ts +1 -0
  379. package/dist/test/collection-facets/facets-template.test.js +101 -0
  380. package/dist/test/collection-facets/facets-template.test.js.map +1 -0
  381. package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -0
  382. package/dist/test/collection-facets/more-facets-content.test.js +169 -0
  383. package/dist/test/collection-facets/more-facets-content.test.js.map +1 -0
  384. package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -0
  385. package/dist/test/collection-facets/more-facets-pagination.test.js +132 -0
  386. package/dist/test/collection-facets/more-facets-pagination.test.js.map +1 -0
  387. package/dist/test/collection-facets/toggle-switch.test.d.ts +1 -0
  388. package/dist/test/collection-facets/toggle-switch.test.js +96 -0
  389. package/dist/test/collection-facets/toggle-switch.test.js.map +1 -0
  390. package/dist/test/collection-facets.test.d.ts +2 -0
  391. package/dist/test/collection-facets.test.js +745 -0
  392. package/dist/test/collection-facets.test.js.map +1 -0
  393. package/dist/test/data-source/collection-browser-data-source.test.d.ts +1 -0
  394. package/dist/test/data-source/collection-browser-data-source.test.js +102 -0
  395. package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -0
  396. package/dist/test/empty-placeholder.test.d.ts +1 -0
  397. package/dist/test/empty-placeholder.test.js +63 -0
  398. package/dist/test/empty-placeholder.test.js.map +1 -0
  399. package/dist/test/expanded-date-picker.test.d.ts +1 -0
  400. package/dist/test/expanded-date-picker.test.js +130 -0
  401. package/dist/test/expanded-date-picker.test.js.map +1 -0
  402. package/dist/test/icon-overlay.test.d.ts +1 -0
  403. package/dist/test/icon-overlay.test.js +30 -0
  404. package/dist/test/icon-overlay.test.js.map +1 -0
  405. package/dist/test/image-block.test.d.ts +1 -0
  406. package/dist/test/image-block.test.js +218 -0
  407. package/dist/test/image-block.test.js.map +1 -0
  408. package/dist/test/item-image.test.d.ts +1 -0
  409. package/dist/test/item-image.test.js +196 -0
  410. package/dist/test/item-image.test.js.map +1 -0
  411. package/dist/test/manage/manage-bar.test.d.ts +2 -0
  412. package/dist/test/manage/manage-bar.test.js +106 -0
  413. package/dist/test/manage/manage-bar.test.js.map +1 -0
  414. package/dist/test/manage/remove-items-modal-content.test.d.ts +1 -0
  415. package/dist/test/manage/remove-items-modal-content.test.js +65 -0
  416. package/dist/test/manage/remove-items-modal-content.test.js.map +1 -0
  417. package/dist/test/mediatype-config.test.d.ts +1 -0
  418. package/dist/test/mediatype-config.test.js +11 -0
  419. package/dist/test/mediatype-config.test.js.map +1 -0
  420. package/dist/test/mocks/mock-analytics-handler.d.ts +10 -0
  421. package/dist/test/mocks/mock-analytics-handler.js +16 -0
  422. package/dist/test/mocks/mock-analytics-handler.js.map +1 -0
  423. package/dist/test/mocks/mock-search-responses.d.ts +31 -0
  424. package/dist/test/mocks/mock-search-responses.js +1241 -0
  425. package/dist/test/mocks/mock-search-responses.js.map +1 -0
  426. package/dist/test/mocks/mock-search-service.d.ts +16 -0
  427. package/dist/test/mocks/mock-search-service.js +65 -0
  428. package/dist/test/mocks/mock-search-service.js.map +1 -0
  429. package/dist/test/restoration-state-handler.test.d.ts +1 -0
  430. package/dist/test/restoration-state-handler.test.js +343 -0
  431. package/dist/test/restoration-state-handler.test.js.map +1 -0
  432. package/dist/test/review-block.test.d.ts +1 -0
  433. package/dist/test/review-block.test.js +48 -0
  434. package/dist/test/review-block.test.js.map +1 -0
  435. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +1 -0
  436. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +13 -0
  437. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +1 -0
  438. package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -0
  439. package/dist/test/sort-filter-bar/alpha-bar.test.js +74 -0
  440. package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -0
  441. package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -0
  442. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +609 -0
  443. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -0
  444. package/dist/test/text-overlay.test.d.ts +1 -0
  445. package/dist/test/text-overlay.test.js +42 -0
  446. package/dist/test/text-overlay.test.js.map +1 -0
  447. package/dist/test/text-snippet-block.test.d.ts +1 -0
  448. package/dist/test/text-snippet-block.test.js +63 -0
  449. package/dist/test/text-snippet-block.test.js.map +1 -0
  450. package/dist/test/tile-stats.test.d.ts +1 -0
  451. package/dist/test/tile-stats.test.js +128 -0
  452. package/dist/test/tile-stats.test.js.map +1 -0
  453. package/dist/test/tiles/grid/account-tile.test.d.ts +1 -0
  454. package/dist/test/tiles/grid/account-tile.test.js +96 -0
  455. package/dist/test/tiles/grid/account-tile.test.js.map +1 -0
  456. package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -0
  457. package/dist/test/tiles/grid/collection-tile.test.js +96 -0
  458. package/dist/test/tiles/grid/collection-tile.test.js.map +1 -0
  459. package/dist/test/tiles/grid/item-tile.test.d.ts +1 -0
  460. package/dist/test/tiles/grid/item-tile.test.js +427 -0
  461. package/dist/test/tiles/grid/item-tile.test.js.map +1 -0
  462. package/dist/test/tiles/grid/search-tile.test.d.ts +1 -0
  463. package/dist/test/tiles/grid/search-tile.test.js +66 -0
  464. package/dist/test/tiles/grid/search-tile.test.js.map +1 -0
  465. package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -0
  466. package/dist/test/tiles/hover/hover-pane-controller.test.js +329 -0
  467. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -0
  468. package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +1 -0
  469. package/dist/test/tiles/hover/tile-hover-pane.test.js +57 -0
  470. package/dist/test/tiles/hover/tile-hover-pane.test.js.map +1 -0
  471. package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -0
  472. package/dist/test/tiles/list/tile-list-compact.test.js +251 -0
  473. package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -0
  474. package/dist/test/tiles/list/tile-list.test.d.ts +1 -0
  475. package/dist/test/tiles/list/tile-list.test.js +469 -0
  476. package/dist/test/tiles/list/tile-list.test.js.map +1 -0
  477. package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -0
  478. package/dist/test/tiles/tile-dispatcher.test.js +231 -0
  479. package/dist/test/tiles/tile-dispatcher.test.js.map +1 -0
  480. package/dist/test/tiles/tile-display-value-provider.test.d.ts +1 -0
  481. package/dist/test/tiles/tile-display-value-provider.test.js +142 -0
  482. package/dist/test/tiles/tile-display-value-provider.test.js.map +1 -0
  483. package/dist/test/tiles/tile-mediatype-icon.test.d.ts +1 -0
  484. package/dist/test/tiles/tile-mediatype-icon.test.js +145 -0
  485. package/dist/test/tiles/tile-mediatype-icon.test.js.map +1 -0
  486. package/dist/test/utils/array-equals.test.d.ts +1 -0
  487. package/dist/test/utils/array-equals.test.js +27 -0
  488. package/dist/test/utils/array-equals.test.js.map +1 -0
  489. package/dist/test/utils/format-count.test.d.ts +1 -0
  490. package/dist/test/utils/format-count.test.js +24 -0
  491. package/dist/test/utils/format-count.test.js.map +1 -0
  492. package/dist/test/utils/format-date.test.d.ts +1 -0
  493. package/dist/test/utils/format-date.test.js +61 -0
  494. package/dist/test/utils/format-date.test.js.map +1 -0
  495. package/dist/test/utils/format-unit-size.test.d.ts +1 -0
  496. package/dist/test/utils/format-unit-size.test.js +18 -0
  497. package/dist/test/utils/format-unit-size.test.js.map +1 -0
  498. package/dist/test/utils/local-date-from-utc.test.d.ts +1 -0
  499. package/dist/test/utils/local-date-from-utc.test.js +27 -0
  500. package/dist/test/utils/local-date-from-utc.test.js.map +1 -0
  501. package/eslint.config.mjs +53 -53
  502. package/index.html +24 -24
  503. package/local.archive.org.cert +86 -86
  504. package/local.archive.org.key +27 -27
  505. package/package.json +118 -117
  506. package/renovate.json +6 -6
  507. package/src/collection-browser.ts +2954 -2829
  508. package/src/collection-facets/facet-row.ts +299 -296
  509. package/src/collection-facets/models.ts +10 -10
  510. package/src/collection-facets/more-facets-content.ts +639 -639
  511. package/src/collection-facets.ts +1005 -995
  512. package/src/data-source/collection-browser-data-source-interface.ts +345 -333
  513. package/src/data-source/collection-browser-data-source.ts +1441 -1401
  514. package/src/data-source/collection-browser-query-state.ts +59 -65
  515. package/src/data-source/models.ts +56 -43
  516. package/src/manage/manage-bar.ts +247 -247
  517. package/src/models.ts +866 -870
  518. package/src/restoration-state-handler.ts +542 -544
  519. package/src/tiles/base-tile-component.ts +65 -65
  520. package/src/tiles/grid/account-tile.ts +113 -113
  521. package/src/tiles/grid/collection-tile.ts +163 -163
  522. package/src/tiles/grid/item-tile.ts +340 -340
  523. package/src/tiles/grid/search-tile.ts +90 -90
  524. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +130 -130
  525. package/src/tiles/hover/hover-pane-controller.ts +613 -517
  526. package/src/tiles/hover/tile-hover-pane.ts +184 -180
  527. package/src/tiles/list/tile-list-compact.ts +239 -239
  528. package/src/tiles/list/tile-list.ts +700 -700
  529. package/src/tiles/tile-dispatcher.ts +517 -490
  530. package/src/utils/format-date.ts +62 -62
  531. package/test/collection-browser.test.ts +2413 -2403
  532. package/test/collection-facets/facet-row.test.ts +375 -375
  533. package/test/collection-facets.test.ts +928 -928
  534. package/test/restoration-state-handler.test.ts +480 -510
  535. package/test/tiles/grid/item-tile.test.ts +520 -520
  536. package/test/tiles/hover/hover-pane-controller.test.ts +418 -353
  537. package/test/tiles/list/tile-list-compact.test.ts +282 -282
  538. package/test/tiles/list/tile-list.test.ts +552 -552
  539. package/test/tiles/tile-dispatcher.test.ts +283 -187
  540. package/test/utils/format-date.test.ts +89 -89
  541. package/tsconfig.json +20 -20
  542. package/web-dev-server.config.mjs +30 -30
  543. package/web-test-runner.config.mjs +41 -41
@@ -0,0 +1,621 @@
1
+ import { __decorate } from "tslib";
2
+ import { css, html, nothing } from 'lit';
3
+ import { ifDefined } from 'lit/directives/if-defined.js';
4
+ import { join } from 'lit/directives/join.js';
5
+ import { map } from 'lit/directives/map.js';
6
+ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
7
+ import { customElement, property, state } from 'lit/decorators.js';
8
+ import { msg, str } from '@lit/localize';
9
+ import DOMPurify from 'dompurify';
10
+ import { suppressedCollections } from '../../models';
11
+ import { BaseTileComponent } from '../base-tile-component';
12
+ import { formatCount } from '../../utils/format-count';
13
+ import { isFirstMillisecondOfUTCYear } from '../../utils/local-date-from-utc';
14
+ import '../image-block';
15
+ import '../review-block';
16
+ import '../text-snippet-block';
17
+ import '../tile-mediatype-icon';
18
+ let TileList = class TileList extends BaseTileComponent {
19
+ constructor() {
20
+ /*
21
+ * Reactive properties inherited from BaseTileComponent:
22
+ * - model?: TileModel;
23
+ * - currentWidth?: number;
24
+ * - currentHeight?: number;
25
+ * - baseNavigationUrl?: string;
26
+ * - baseImageUrl?: string;
27
+ * - collectionPagePath?: string;
28
+ * - sortParam: SortParam | null = null;
29
+ * - defaultSortParam: SortParam | null = null;
30
+ * - creatorFilter?: string;
31
+ * - mobileBreakpoint?: number;
32
+ * - loggedIn = false;
33
+ * - suppressBlurring = false;
34
+ * - useLocalTime = false;
35
+ */
36
+ super(...arguments);
37
+ this.collectionLinks = [];
38
+ }
39
+ render() {
40
+ return html `
41
+ <div id="list-line" class="${this.classSize}">
42
+ ${this.classSize === 'mobile'
43
+ ? this.mobileTemplate
44
+ : this.desktopTemplate}
45
+ </div>
46
+ `;
47
+ }
48
+ /**
49
+ * Templates
50
+ */
51
+ get mobileTemplate() {
52
+ return html `
53
+ <div id="list-line-top">
54
+ <div id="list-line-left">${this.imageBlockTemplate}</div>
55
+ <div id="list-line-right">
56
+ <div id="title-line">
57
+ <div id="title">${this.titleTemplate}</div>
58
+ ${this.iconRightTemplate}
59
+ </div>
60
+ </div>
61
+ </div>
62
+ <div id="list-line-bottom">${this.detailsTemplate}</div>
63
+ `;
64
+ }
65
+ get desktopTemplate() {
66
+ return html `
67
+ <div id="list-line-left">${this.imageBlockTemplate}</div>
68
+ <div id="list-line-right">
69
+ <div id="title-line">
70
+ <div id="title">${this.titleTemplate}</div>
71
+ ${this.iconRightTemplate}
72
+ </div>
73
+ ${this.detailsTemplate}
74
+ </div>
75
+ `;
76
+ }
77
+ get imageBlockTemplate() {
78
+ var _a;
79
+ if (!this.model)
80
+ return nothing;
81
+ const isCollection = this.model.mediatype === 'collection';
82
+ const href = this.displayValueProvider.itemPageUrl(this.model.identifier, isCollection);
83
+ return html `<a
84
+ id="image-link"
85
+ title=${msg(str `View ${(_a = this.model) === null || _a === void 0 ? void 0 : _a.title}`)}
86
+ href=${href}
87
+ >
88
+ <image-block
89
+ .model=${this.model}
90
+ .baseImageUrl=${this.baseImageUrl}
91
+ .isCompactTile=${false}
92
+ .isListTile=${true}
93
+ .viewSize=${this.classSize}
94
+ .loggedIn=${this.loggedIn}
95
+ .suppressBlurring=${this.suppressBlurring}
96
+ >
97
+ </image-block>
98
+ </a> `;
99
+ }
100
+ get detailsTemplate() {
101
+ return html `
102
+ ${this.itemLineTemplate} ${this.creatorTemplate}
103
+ <div id="dates-line">
104
+ ${this.datePublishedTemplate} ${this.dateSortByTemplate}
105
+ ${this.webArchivesCaptureDatesTemplate}
106
+ </div>
107
+ <div id="views-line">
108
+ ${this.viewsTemplate} ${this.ratingTemplate} ${this.reviewsTemplate}
109
+ </div>
110
+ ${this.topicsTemplate} ${this.collectionsTemplate}
111
+ ${this.descriptionTemplate} ${this.textSnippetsTemplate}
112
+ ${this.reviewBlockTemplate}
113
+ `;
114
+ }
115
+ // Data templates
116
+ get iconRightTemplate() {
117
+ var _a;
118
+ return html `
119
+ <a
120
+ id="icon-right"
121
+ href=${this.mediatypeURL}
122
+ title=${msg(str `See more: ${(_a = this.model) === null || _a === void 0 ? void 0 : _a.mediatype}`)}
123
+ >
124
+ <tile-mediatype-icon .model=${this.model}> </tile-mediatype-icon>
125
+ </a>
126
+ `;
127
+ }
128
+ get titleTemplate() {
129
+ var _a, _b, _c;
130
+ if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.title)) {
131
+ return nothing;
132
+ }
133
+ // If the model has a server-specified href, use it
134
+ // Otherwise construct a details link using the identifier
135
+ return ((_b = this.model) === null || _b === void 0 ? void 0 : _b.href)
136
+ ? html `<a href="${this.baseNavigationUrl}${this.model.href}"
137
+ >${(_c = this.model.title) !== null && _c !== void 0 ? _c : this.model.identifier}</a
138
+ >`
139
+ : this.detailsLink(this.model.identifier, this.model.title, this.model.mediatype === 'collection');
140
+ }
141
+ get itemLineTemplate() {
142
+ const source = this.sourceTemplate;
143
+ const volume = this.volumeTemplate;
144
+ const issue = this.issueTemplate;
145
+ if (!source && !volume && !issue) {
146
+ return nothing;
147
+ }
148
+ return html ` <div id="item-line">${source} ${volume} ${issue}</div> `;
149
+ }
150
+ get sourceTemplate() {
151
+ var _a;
152
+ if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.source)) {
153
+ return nothing;
154
+ }
155
+ return html `
156
+ <div id="source" class="metadata">
157
+ ${this.labelTemplate(msg('Source'))}
158
+ ${this.searchLink('source', this.model.source)}
159
+ </div>
160
+ `;
161
+ }
162
+ get volumeTemplate() {
163
+ var _a;
164
+ return this.metadataTemplate((_a = this.model) === null || _a === void 0 ? void 0 : _a.volume, msg('Volume'));
165
+ }
166
+ get issueTemplate() {
167
+ var _a;
168
+ return this.metadataTemplate((_a = this.model) === null || _a === void 0 ? void 0 : _a.issue, msg('Issue'));
169
+ }
170
+ get creatorTemplate() {
171
+ var _a, _b, _c;
172
+ // "Archivist since" if account
173
+ if (((_a = this.model) === null || _a === void 0 ? void 0 : _a.mediatype) === 'account') {
174
+ return html `
175
+ <div id="creator" class="metadata">
176
+ <span class="label"
177
+ >${(_b = this.displayValueProvider.accountLabel) !== null && _b !== void 0 ? _b : nothing}</span
178
+ >
179
+ </div>
180
+ `;
181
+ }
182
+ // "Creator" if not account tile
183
+ if (!((_c = this.model) === null || _c === void 0 ? void 0 : _c.creators) || this.model.creators.length === 0) {
184
+ return nothing;
185
+ }
186
+ return html `
187
+ <div id="creator" class="metadata">
188
+ ${this.labelTemplate(msg('By'))}
189
+ ${join(map(this.model.creators, id => this.searchLink('creator', id)), ', ')}
190
+ </div>
191
+ `;
192
+ }
193
+ get datePublishedTemplate() {
194
+ var _a;
195
+ // If we're showing a date published of Jan 1 at midnight, only show the year.
196
+ // This is because items with only a year for their publication date are normalized to
197
+ // Jan 1 at midnight timestamps in the search engine documents.
198
+ const date = (_a = this.model) === null || _a === void 0 ? void 0 : _a.datePublished;
199
+ let format = 'long';
200
+ if (isFirstMillisecondOfUTCYear(date)) {
201
+ format = 'year-only';
202
+ }
203
+ return this.metadataTemplate(this.getFormattedDate(date, format), msg('Published'));
204
+ }
205
+ // Show date label/value when sorted by date type
206
+ // Except datePublished which is always shown
207
+ get dateSortByTemplate() {
208
+ if (this.effectiveSort &&
209
+ (this.effectiveSort.field === 'addeddate' ||
210
+ this.effectiveSort.field === 'reviewdate' ||
211
+ this.effectiveSort.field === 'publicdate')) {
212
+ return this.metadataTemplate(this.getFormattedDate(this.date, 'long'), this.displayValueProvider.dateLabel);
213
+ }
214
+ return nothing;
215
+ }
216
+ get viewsTemplate() {
217
+ var _a, _b, _c, _d;
218
+ const viewCount = ((_a = this.effectiveSort) === null || _a === void 0 ? void 0 : _a.field) === 'week'
219
+ ? (_b = this.model) === null || _b === void 0 ? void 0 : _b.weeklyViewCount // weekly views
220
+ : (_c = this.model) === null || _c === void 0 ? void 0 : _c.viewCount; // all-time views
221
+ if (viewCount == null)
222
+ return nothing;
223
+ // when its a search-tile, we don't have any stats to show
224
+ if (((_d = this.model) === null || _d === void 0 ? void 0 : _d.mediatype) === 'search') {
225
+ return this.metadataTemplate('(Favorited search query)', '');
226
+ }
227
+ return this.metadataTemplate(`${formatCount(viewCount, this.formatSize)}`, msg('Views'));
228
+ }
229
+ get ratingTemplate() {
230
+ var _a;
231
+ return this.metadataTemplate((_a = this.model) === null || _a === void 0 ? void 0 : _a.averageRating, msg('Avg Rating'));
232
+ }
233
+ get reviewsTemplate() {
234
+ var _a;
235
+ return this.metadataTemplate((_a = this.model) === null || _a === void 0 ? void 0 : _a.commentCount, msg('Reviews'));
236
+ }
237
+ get topicsTemplate() {
238
+ var _a;
239
+ if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.subjects) || this.model.subjects.length === 0) {
240
+ return nothing;
241
+ }
242
+ return html `
243
+ <div id="topics" class="metadata">
244
+ ${this.labelTemplate(msg('Topics'))}
245
+ ${join(map(this.model.subjects, id => this.searchLink('subject', id)), ', ')}
246
+ </div>
247
+ `;
248
+ }
249
+ get collectionsTemplate() {
250
+ if (!this.collectionLinks || this.collectionLinks.length === 0) {
251
+ return nothing;
252
+ }
253
+ return html `
254
+ <div id="collections" class="metadata">
255
+ ${this.labelTemplate(msg('Collections'))}
256
+ ${join(this.collectionLinks, ', ')}
257
+ </div>
258
+ `;
259
+ }
260
+ get descriptionTemplate() {
261
+ var _a, _b, _c;
262
+ return this.metadataTemplate(
263
+ // Sanitize away any HTML tags and convert line breaks to spaces.
264
+ unsafeHTML(DOMPurify.sanitize((_c = (_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.description) === null || _b === void 0 ? void 0 : _b.replace(/\n/g, ' ')) !== null && _c !== void 0 ? _c : '')), '', 'description');
265
+ }
266
+ get reviewBlockTemplate() {
267
+ var _a;
268
+ if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.review))
269
+ return nothing;
270
+ const { reviewtitle, reviewbody, stars } = this.model.review;
271
+ return html `
272
+ <review-block
273
+ viewsize="list"
274
+ title=${ifDefined(reviewtitle)}
275
+ body=${ifDefined(reviewbody)}
276
+ starRating=${ifDefined(stars)}
277
+ >
278
+ </review-block>
279
+ `;
280
+ }
281
+ get textSnippetsTemplate() {
282
+ var _a;
283
+ if (!this.hasSnippets)
284
+ return nothing;
285
+ return html `<text-snippet-block
286
+ viewsize="list"
287
+ .snippets=${(_a = this.model) === null || _a === void 0 ? void 0 : _a.snippets}
288
+ ></text-snippet-block>`;
289
+ }
290
+ get hasSnippets() {
291
+ var _a, _b;
292
+ return !!((_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.snippets) === null || _b === void 0 ? void 0 : _b.length);
293
+ }
294
+ get webArchivesCaptureDatesTemplate() {
295
+ var _a;
296
+ if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.captureDates) || !this.model.title)
297
+ return nothing;
298
+ return html `
299
+ <ul class="capture-dates">
300
+ ${map(this.model.captureDates, date => html `<li>
301
+ ${this.displayValueProvider.webArchivesCaptureLink(this.model.title, date)}
302
+ </li>`)}
303
+ </ul>
304
+ `;
305
+ }
306
+ // Utility functions
307
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
308
+ metadataTemplate(text, label = '', id) {
309
+ if (!text)
310
+ return nothing;
311
+ return html `
312
+ <div id=${ifDefined(id)} class="metadata">
313
+ ${this.labelTemplate(label)} ${text}
314
+ </div>
315
+ `;
316
+ }
317
+ labelTemplate(label) {
318
+ return html ` ${label
319
+ ? html `<span class="label">${label}: </span>`
320
+ : nothing}`;
321
+ }
322
+ searchLink(field, searchTerm) {
323
+ if (!field || !searchTerm) {
324
+ return nothing;
325
+ }
326
+ const query = encodeURIComponent(`${field}:"${searchTerm}"`);
327
+ // No whitespace after closing tag
328
+ // Note: single ' for href='' to wrap " in query var gets changed back by yarn format
329
+ return html `<a
330
+ href="${this.baseNavigationUrl}/search?query=${query}"
331
+ rel="nofollow"
332
+ >
333
+ ${DOMPurify.sanitize(searchTerm)}</a
334
+ >`;
335
+ }
336
+ detailsLink(identifier, text, isCollection = false) {
337
+ if (!identifier)
338
+ return nothing;
339
+ const linkText = text !== null && text !== void 0 ? text : identifier;
340
+ const linkHref = this.displayValueProvider.itemPageUrl(identifier, isCollection);
341
+ return html `<a href=${linkHref}> ${DOMPurify.sanitize(linkText)} </a>`;
342
+ }
343
+ /** The URL of this item's mediatype collection, if defined. */
344
+ get mediatypeURL() {
345
+ var _a;
346
+ // NB: baseNavigationUrl can be an empty string
347
+ if (this.baseNavigationUrl === undefined || !((_a = this.model) === null || _a === void 0 ? void 0 : _a.mediatype))
348
+ return nothing;
349
+ // Need special handling for certain mediatypes that don't have a top-level collection page
350
+ switch (this.model.mediatype) {
351
+ case 'collection':
352
+ return `${this.baseNavigationUrl}/search?query=mediatype:collection&sort=-downloads`;
353
+ case 'account':
354
+ return nothing;
355
+ default:
356
+ return this.displayValueProvider.itemPageUrl(this.model.mediatype, true);
357
+ }
358
+ }
359
+ updated(changed) {
360
+ if (changed.has('model') || changed.has('collectionTitles')) {
361
+ this.buildCollectionLinks();
362
+ }
363
+ }
364
+ async buildCollectionLinks() {
365
+ var _a, _b, _c;
366
+ if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.collections) || this.model.collections.length === 0) {
367
+ return;
368
+ }
369
+ // Note: quirk of Lit: need to replace collectionLinks array,
370
+ // otherwise it will not re-render. Can't simply alter the array.
371
+ this.collectionLinks = [];
372
+ const newCollectionLinks = [];
373
+ for (const collection of this.model.collections) {
374
+ // Don't include favorites or collections that are meant to be suppressed
375
+ if (!suppressedCollections[collection] &&
376
+ !collection.startsWith('fav-')) {
377
+ newCollectionLinks.push(this.detailsLink(collection, (_c = (_b = this.collectionTitles) === null || _b === void 0 ? void 0 : _b.get(collection)) !== null && _c !== void 0 ? _c : collection, true));
378
+ }
379
+ }
380
+ this.collectionLinks = newCollectionLinks;
381
+ }
382
+ /*
383
+ * TODO: fix field names to match model in src/collection-browser.ts
384
+ * private get dateSortSelector()
385
+ * @see src/models.ts
386
+ */
387
+ get date() {
388
+ var _a, _b, _c, _d, _e;
389
+ switch ((_a = this.effectiveSort) === null || _a === void 0 ? void 0 : _a.field) {
390
+ case 'date':
391
+ return (_b = this.model) === null || _b === void 0 ? void 0 : _b.datePublished;
392
+ case 'reviewdate':
393
+ return (_c = this.model) === null || _c === void 0 ? void 0 : _c.dateReviewed;
394
+ case 'addeddate':
395
+ return (_d = this.model) === null || _d === void 0 ? void 0 : _d.dateAdded;
396
+ default:
397
+ return (_e = this.model) === null || _e === void 0 ? void 0 : _e.dateArchived; // publicdate
398
+ }
399
+ }
400
+ /**
401
+ * Returns the active sort param if one is set, or the default sort param otherwise.
402
+ */
403
+ get effectiveSort() {
404
+ var _a;
405
+ return (_a = this.sortParam) !== null && _a !== void 0 ? _a : this.defaultSortParam;
406
+ }
407
+ get classSize() {
408
+ if (this.mobileBreakpoint &&
409
+ this.currentWidth &&
410
+ this.currentWidth < this.mobileBreakpoint) {
411
+ return 'mobile';
412
+ }
413
+ return 'desktop';
414
+ }
415
+ get formatSize() {
416
+ if (this.mobileBreakpoint &&
417
+ this.currentWidth &&
418
+ this.currentWidth < this.mobileBreakpoint) {
419
+ return 'short';
420
+ }
421
+ return 'long';
422
+ }
423
+ static get styles() {
424
+ return css `
425
+ html {
426
+ font-size: unset;
427
+ }
428
+
429
+ div {
430
+ font-size: 14px;
431
+ }
432
+
433
+ div a {
434
+ text-decoration: none;
435
+ }
436
+
437
+ div a:link {
438
+ color: var(--ia-theme-link-color, #4b64ff);
439
+ }
440
+
441
+ .label {
442
+ font-weight: bold;
443
+ }
444
+
445
+ #list-line.mobile {
446
+ --infiniteScrollerRowGap: 20px;
447
+ --infiniteScrollerRowHeight: auto;
448
+ }
449
+
450
+ #list-line.desktop {
451
+ --infiniteScrollerRowGap: 30px;
452
+ --infiniteScrollerRowHeight: auto;
453
+ }
454
+
455
+ /* fields */
456
+ #icon-right {
457
+ width: 20px;
458
+ padding-top: 5px;
459
+ --iconHeight: 20px;
460
+ --iconWidth: 20px;
461
+ --iconTextAlign: right;
462
+ margin-top: -8px;
463
+ text-align: right;
464
+ }
465
+
466
+ #title {
467
+ color: #4b64ff;
468
+ text-decoration: none;
469
+ font-size: 22px;
470
+ font-weight: bold;
471
+ /* align top of text with image */
472
+ line-height: 25px;
473
+ margin-top: -4px;
474
+ padding-bottom: 2px;
475
+ flex-grow: 1;
476
+
477
+ display: -webkit-box;
478
+ -webkit-box-orient: vertical;
479
+ -webkit-line-clamp: 3;
480
+ overflow: hidden;
481
+ overflow-wrap: anywhere;
482
+ }
483
+
484
+ .metadata {
485
+ line-height: 20px;
486
+ }
487
+
488
+ #description,
489
+ #creator,
490
+ #topics,
491
+ #source {
492
+ text-align: left;
493
+ overflow: hidden;
494
+ text-overflow: ellipsis;
495
+ -webkit-box-orient: vertical;
496
+ display: -webkit-box;
497
+ word-break: break-word;
498
+ -webkit-line-clamp: 3; /* number of lines to show */
499
+ line-clamp: 3;
500
+
501
+ /*
502
+ * Safari doesn't always respect the line-clamping rules above,
503
+ * so we add this to ensure these fields still get truncated
504
+ */
505
+ max-height: 60px;
506
+ }
507
+
508
+ #collections {
509
+ display: -webkit-box;
510
+ -webkit-box-orient: vertical;
511
+ -webkit-line-clamp: 3;
512
+ overflow: hidden;
513
+ overflow-wrap: anywhere;
514
+ }
515
+
516
+ #collections > a {
517
+ display: inline-block;
518
+ }
519
+
520
+ #icon {
521
+ padding-top: 5px;
522
+ }
523
+
524
+ #description {
525
+ padding-top: 10px;
526
+ }
527
+
528
+ /* Top level container */
529
+ #list-line {
530
+ display: flex;
531
+ }
532
+
533
+ #list-line.mobile {
534
+ flex-direction: column;
535
+ }
536
+
537
+ #list-line.desktop {
538
+ column-gap: 10px;
539
+ }
540
+
541
+ #list-line-top {
542
+ display: flex;
543
+ column-gap: 7px;
544
+ }
545
+
546
+ #list-line-bottom {
547
+ padding-top: 4px;
548
+ }
549
+
550
+ #list-line-right,
551
+ #list-line-top,
552
+ #list-line-bottom {
553
+ width: 100%;
554
+ }
555
+
556
+ /*
557
+ * If the container becomes very tiny, don't let the thumbnail side take
558
+ * up too much space. Shouldn't make a difference on ordinary viewport sizes.
559
+ */
560
+ #list-line-left {
561
+ max-width: 25%;
562
+
563
+ display: flex;
564
+ flex-direction: column;
565
+ row-gap: 5px;
566
+ }
567
+
568
+ div a:hover {
569
+ text-decoration: underline;
570
+ }
571
+
572
+ /* Lines containing multiple div as row */
573
+ #item-line,
574
+ #dates-line,
575
+ #views-line,
576
+ #title-line {
577
+ display: flex;
578
+ flex-direction: row;
579
+ column-gap: 10px;
580
+ }
581
+
582
+ /*
583
+ * With the exception of the title line, allow these to wrap if
584
+ * the space becomes too small to accommodate them together.
585
+ *
586
+ * The title line is excluded because it contains the mediatype icon
587
+ * which we don't want to wrap.
588
+ */
589
+ #item-line,
590
+ #dates-line,
591
+ #views-line {
592
+ flex-wrap: wrap;
593
+ }
594
+
595
+ .capture-dates {
596
+ margin: 0;
597
+ padding: 0;
598
+ list-style-type: none;
599
+ }
600
+
601
+ .capture-dates a:link {
602
+ text-decoration: none;
603
+ color: var(--ia-theme-link-color, #4b64ff);
604
+ }
605
+ .capture-dates a:hover {
606
+ text-decoration: underline;
607
+ }
608
+ `;
609
+ }
610
+ };
611
+ __decorate([
612
+ property({ type: Object })
613
+ ], TileList.prototype, "collectionTitles", void 0);
614
+ __decorate([
615
+ state()
616
+ ], TileList.prototype, "collectionLinks", void 0);
617
+ TileList = __decorate([
618
+ customElement('tile-list')
619
+ ], TileList);
620
+ export { TileList };
621
+ //# sourceMappingURL=tile-list.js.map