@internetarchive/collection-browser 4.8.0 → 4.8.1-alpha-webdev9189.1

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 (336) hide show
  1. package/dist/src/collection-browser.js +27 -2
  2. package/dist/src/collection-browser.js.map +1 -1
  3. package/dist/src/sort-filter-bar/sort-filter-bar.js +38 -20
  4. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  5. package/dist/src/utils/log.d.ts +4 -1
  6. package/package.json +5 -1
  7. package/.editorconfig +0 -29
  8. package/.github/workflows/ci.yml +0 -29
  9. package/.github/workflows/gh-pages-main.yml +0 -41
  10. package/.github/workflows/npm-publish.yml +0 -42
  11. package/.github/workflows/pr-preview.yml +0 -40
  12. package/.husky/pre-commit +0 -1
  13. package/.prettierignore +0 -1
  14. package/dist/test/collection-browser.test.d.ts +0 -1
  15. package/dist/test/collection-browser.test.js +0 -1815
  16. package/dist/test/collection-browser.test.js.map +0 -1
  17. package/dist/test/collection-facets/facet-row.test.d.ts +0 -1
  18. package/dist/test/collection-facets/facet-row.test.js +0 -291
  19. package/dist/test/collection-facets/facet-row.test.js.map +0 -1
  20. package/dist/test/collection-facets/facets-template.test.d.ts +0 -1
  21. package/dist/test/collection-facets/facets-template.test.js +0 -95
  22. package/dist/test/collection-facets/facets-template.test.js.map +0 -1
  23. package/dist/test/collection-facets/more-facets-content.test.d.ts +0 -1
  24. package/dist/test/collection-facets/more-facets-content.test.js +0 -509
  25. package/dist/test/collection-facets/more-facets-content.test.js.map +0 -1
  26. package/dist/test/collection-facets/more-facets-scroller.test.d.ts +0 -1
  27. package/dist/test/collection-facets/more-facets-scroller.test.js +0 -288
  28. package/dist/test/collection-facets/more-facets-scroller.test.js.map +0 -1
  29. package/dist/test/collection-facets/page-window.test.d.ts +0 -1
  30. package/dist/test/collection-facets/page-window.test.js +0 -175
  31. package/dist/test/collection-facets/page-window.test.js.map +0 -1
  32. package/dist/test/collection-facets/toggle-switch.test.d.ts +0 -1
  33. package/dist/test/collection-facets/toggle-switch.test.js +0 -99
  34. package/dist/test/collection-facets/toggle-switch.test.js.map +0 -1
  35. package/dist/test/collection-facets.test.d.ts +0 -2
  36. package/dist/test/collection-facets.test.js +0 -728
  37. package/dist/test/collection-facets.test.js.map +0 -1
  38. package/dist/test/data-source/collection-browser-data-source.test.d.ts +0 -1
  39. package/dist/test/data-source/collection-browser-data-source.test.js +0 -154
  40. package/dist/test/data-source/collection-browser-data-source.test.js.map +0 -1
  41. package/dist/test/empty-placeholder.test.d.ts +0 -1
  42. package/dist/test/empty-placeholder.test.js +0 -57
  43. package/dist/test/empty-placeholder.test.js.map +0 -1
  44. package/dist/test/expanded-date-picker.test.d.ts +0 -1
  45. package/dist/test/expanded-date-picker.test.js +0 -124
  46. package/dist/test/expanded-date-picker.test.js.map +0 -1
  47. package/dist/test/icon-overlay.test.d.ts +0 -1
  48. package/dist/test/icon-overlay.test.js +0 -31
  49. package/dist/test/icon-overlay.test.js.map +0 -1
  50. package/dist/test/image-block.test.d.ts +0 -1
  51. package/dist/test/image-block.test.js +0 -208
  52. package/dist/test/image-block.test.js.map +0 -1
  53. package/dist/test/item-image.test.d.ts +0 -1
  54. package/dist/test/item-image.test.js +0 -187
  55. package/dist/test/item-image.test.js.map +0 -1
  56. package/dist/test/manage/manage-bar.test.d.ts +0 -3
  57. package/dist/test/manage/manage-bar.test.js +0 -216
  58. package/dist/test/manage/manage-bar.test.js.map +0 -1
  59. package/dist/test/manage/remove-items-modal-content.test.d.ts +0 -1
  60. package/dist/test/manage/remove-items-modal-content.test.js +0 -60
  61. package/dist/test/manage/remove-items-modal-content.test.js.map +0 -1
  62. package/dist/test/mediatype-config.test.d.ts +0 -1
  63. package/dist/test/mediatype-config.test.js +0 -11
  64. package/dist/test/mediatype-config.test.js.map +0 -1
  65. package/dist/test/mocks/mock-analytics-handler.d.ts +0 -10
  66. package/dist/test/mocks/mock-analytics-handler.js +0 -16
  67. package/dist/test/mocks/mock-analytics-handler.js.map +0 -1
  68. package/dist/test/mocks/mock-search-responses.d.ts +0 -37
  69. package/dist/test/mocks/mock-search-responses.js +0 -1293
  70. package/dist/test/mocks/mock-search-responses.js.map +0 -1
  71. package/dist/test/mocks/mock-search-service.d.ts +0 -16
  72. package/dist/test/mocks/mock-search-service.js +0 -65
  73. package/dist/test/mocks/mock-search-service.js.map +0 -1
  74. package/dist/test/restoration-state-handler.test.d.ts +0 -1
  75. package/dist/test/restoration-state-handler.test.js +0 -335
  76. package/dist/test/restoration-state-handler.test.js.map +0 -1
  77. package/dist/test/review-block.test.d.ts +0 -1
  78. package/dist/test/review-block.test.js +0 -46
  79. package/dist/test/review-block.test.js.map +0 -1
  80. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +0 -1
  81. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +0 -12
  82. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +0 -1
  83. package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +0 -1
  84. package/dist/test/sort-filter-bar/alpha-bar.test.js +0 -68
  85. package/dist/test/sort-filter-bar/alpha-bar.test.js.map +0 -1
  86. package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +0 -1
  87. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -304
  88. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +0 -1
  89. package/dist/test/text-overlay.test.d.ts +0 -1
  90. package/dist/test/text-overlay.test.js +0 -43
  91. package/dist/test/text-overlay.test.js.map +0 -1
  92. package/dist/test/text-snippet-block.test.d.ts +0 -1
  93. package/dist/test/text-snippet-block.test.js +0 -58
  94. package/dist/test/text-snippet-block.test.js.map +0 -1
  95. package/dist/test/tile-stats.test.d.ts +0 -1
  96. package/dist/test/tile-stats.test.js +0 -167
  97. package/dist/test/tile-stats.test.js.map +0 -1
  98. package/dist/test/tiles/grid/account-tile.test.d.ts +0 -1
  99. package/dist/test/tiles/grid/account-tile.test.js +0 -96
  100. package/dist/test/tiles/grid/account-tile.test.js.map +0 -1
  101. package/dist/test/tiles/grid/collection-tile.test.d.ts +0 -1
  102. package/dist/test/tiles/grid/collection-tile.test.js +0 -90
  103. package/dist/test/tiles/grid/collection-tile.test.js.map +0 -1
  104. package/dist/test/tiles/grid/item-tile.test.d.ts +0 -1
  105. package/dist/test/tiles/grid/item-tile.test.js +0 -400
  106. package/dist/test/tiles/grid/item-tile.test.js.map +0 -1
  107. package/dist/test/tiles/grid/search-tile.test.d.ts +0 -1
  108. package/dist/test/tiles/grid/search-tile.test.js +0 -62
  109. package/dist/test/tiles/grid/search-tile.test.js.map +0 -1
  110. package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +0 -1
  111. package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -351
  112. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +0 -1
  113. package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +0 -1
  114. package/dist/test/tiles/hover/tile-hover-pane.test.js +0 -53
  115. package/dist/test/tiles/hover/tile-hover-pane.test.js.map +0 -1
  116. package/dist/test/tiles/list/tile-list-compact-header.test.d.ts +0 -1
  117. package/dist/test/tiles/list/tile-list-compact-header.test.js +0 -36
  118. package/dist/test/tiles/list/tile-list-compact-header.test.js.map +0 -1
  119. package/dist/test/tiles/list/tile-list-compact.test.d.ts +0 -1
  120. package/dist/test/tiles/list/tile-list-compact.test.js +0 -237
  121. package/dist/test/tiles/list/tile-list-compact.test.js.map +0 -1
  122. package/dist/test/tiles/list/tile-list.test.d.ts +0 -1
  123. package/dist/test/tiles/list/tile-list.test.js +0 -460
  124. package/dist/test/tiles/list/tile-list.test.js.map +0 -1
  125. package/dist/test/tiles/tile-dispatcher.test.d.ts +0 -1
  126. package/dist/test/tiles/tile-dispatcher.test.js +0 -246
  127. package/dist/test/tiles/tile-dispatcher.test.js.map +0 -1
  128. package/dist/test/tiles/tile-display-value-provider.test.d.ts +0 -1
  129. package/dist/test/tiles/tile-display-value-provider.test.js +0 -142
  130. package/dist/test/tiles/tile-display-value-provider.test.js.map +0 -1
  131. package/dist/test/tiles/tile-mediatype-icon.test.d.ts +0 -1
  132. package/dist/test/tiles/tile-mediatype-icon.test.js +0 -133
  133. package/dist/test/tiles/tile-mediatype-icon.test.js.map +0 -1
  134. package/dist/test/utils/array-equals.test.d.ts +0 -1
  135. package/dist/test/utils/array-equals.test.js +0 -27
  136. package/dist/test/utils/array-equals.test.js.map +0 -1
  137. package/dist/test/utils/format-count.test.d.ts +0 -1
  138. package/dist/test/utils/format-count.test.js +0 -24
  139. package/dist/test/utils/format-count.test.js.map +0 -1
  140. package/dist/test/utils/format-date.test.d.ts +0 -1
  141. package/dist/test/utils/format-date.test.js +0 -61
  142. package/dist/test/utils/format-date.test.js.map +0 -1
  143. package/dist/test/utils/format-unit-size.test.d.ts +0 -1
  144. package/dist/test/utils/format-unit-size.test.js +0 -18
  145. package/dist/test/utils/format-unit-size.test.js.map +0 -1
  146. package/dist/test/utils/local-date-from-utc.test.d.ts +0 -1
  147. package/dist/test/utils/local-date-from-utc.test.js +0 -27
  148. package/dist/test/utils/local-date-from-utc.test.js.map +0 -1
  149. package/dist/test/utils/normalize-filter-text.test.d.ts +0 -1
  150. package/dist/test/utils/normalize-filter-text.test.js +0 -69
  151. package/dist/test/utils/normalize-filter-text.test.js.map +0 -1
  152. package/docs/design/column-virtualization.md +0 -214
  153. package/eslint.config.mjs +0 -53
  154. package/index.html +0 -24
  155. package/index.ts +0 -29
  156. package/local.archive.org.cert +0 -86
  157. package/local.archive.org.key +0 -27
  158. package/pnpm-workspace.yaml +0 -30
  159. package/renovate.json +0 -6
  160. package/src/app-root.ts +0 -1282
  161. package/src/assets/img/icons/arrow-left.ts +0 -10
  162. package/src/assets/img/icons/arrow-right.ts +0 -10
  163. package/src/assets/img/icons/check.ts +0 -5
  164. package/src/assets/img/icons/chevron.ts +0 -4
  165. package/src/assets/img/icons/close-circle-dark.ts +0 -5
  166. package/src/assets/img/icons/contract.ts +0 -9
  167. package/src/assets/img/icons/empty-query.ts +0 -5
  168. package/src/assets/img/icons/expand.ts +0 -9
  169. package/src/assets/img/icons/eye-closed.ts +0 -5
  170. package/src/assets/img/icons/eye.ts +0 -5
  171. package/src/assets/img/icons/favorite-filled.ts +0 -10
  172. package/src/assets/img/icons/favorite-unfilled.ts +0 -9
  173. package/src/assets/img/icons/filter.ts +0 -10
  174. package/src/assets/img/icons/login-required.ts +0 -18
  175. package/src/assets/img/icons/mediatype/account.ts +0 -14
  176. package/src/assets/img/icons/mediatype/audio.ts +0 -14
  177. package/src/assets/img/icons/mediatype/collection.ts +0 -12
  178. package/src/assets/img/icons/mediatype/data.ts +0 -15
  179. package/src/assets/img/icons/mediatype/etree.ts +0 -14
  180. package/src/assets/img/icons/mediatype/film.ts +0 -14
  181. package/src/assets/img/icons/mediatype/images.ts +0 -13
  182. package/src/assets/img/icons/mediatype/radio.ts +0 -15
  183. package/src/assets/img/icons/mediatype/search.ts +0 -14
  184. package/src/assets/img/icons/mediatype/software.ts +0 -13
  185. package/src/assets/img/icons/mediatype/texts.ts +0 -13
  186. package/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
  187. package/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
  188. package/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
  189. package/src/assets/img/icons/mediatype/tv.ts +0 -14
  190. package/src/assets/img/icons/mediatype/video.ts +0 -14
  191. package/src/assets/img/icons/mediatype/web.ts +0 -13
  192. package/src/assets/img/icons/null-result.ts +0 -5
  193. package/src/assets/img/icons/quote.ts +0 -7
  194. package/src/assets/img/icons/restricted.ts +0 -13
  195. package/src/assets/img/icons/reviews.ts +0 -11
  196. package/src/assets/img/icons/upload.ts +0 -12
  197. package/src/assets/img/icons/views.ts +0 -11
  198. package/src/circular-activity-indicator.ts +0 -64
  199. package/src/collection-browser.ts +0 -3165
  200. package/src/collection-facets/facet-row-template.ts +0 -242
  201. package/src/collection-facets/facet-row.ts +0 -122
  202. package/src/collection-facets/facet-tombstone-row.ts +0 -40
  203. package/src/collection-facets/facets-template.ts +0 -85
  204. package/src/collection-facets/models.ts +0 -16
  205. package/src/collection-facets/more-facets-content.ts +0 -951
  206. package/src/collection-facets/more-facets-scroller.ts +0 -485
  207. package/src/collection-facets/page-window.ts +0 -247
  208. package/src/collection-facets/smart-facets/dedupe.ts +0 -44
  209. package/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
  210. package/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
  211. package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
  212. package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
  213. package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
  214. package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
  215. package/src/collection-facets/smart-facets/models.ts +0 -36
  216. package/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
  217. package/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
  218. package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
  219. package/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
  220. package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
  221. package/src/collection-facets/toggle-switch.ts +0 -175
  222. package/src/collection-facets.ts +0 -1013
  223. package/src/data-source/collection-browser-data-source-interface.ts +0 -351
  224. package/src/data-source/collection-browser-data-source.ts +0 -1474
  225. package/src/data-source/collection-browser-query-state.ts +0 -60
  226. package/src/data-source/models.ts +0 -56
  227. package/src/empty-placeholder.ts +0 -192
  228. package/src/expanded-date-picker.ts +0 -191
  229. package/src/language-code-handler/language-code-handler.ts +0 -64
  230. package/src/language-code-handler/language-code-mapping.ts +0 -564
  231. package/src/manage/manage-bar.ts +0 -276
  232. package/src/manage/remove-items-modal-content.ts +0 -102
  233. package/src/mediatype/mediatype-config.ts +0 -146
  234. package/src/models.ts +0 -912
  235. package/src/restoration-state-handler.ts +0 -550
  236. package/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
  237. package/src/sort-filter-bar/alpha-bar.ts +0 -252
  238. package/src/sort-filter-bar/img/compact.ts +0 -5
  239. package/src/sort-filter-bar/img/list.ts +0 -5
  240. package/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
  241. package/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
  242. package/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
  243. package/src/sort-filter-bar/img/sort-triangle.ts +0 -5
  244. package/src/sort-filter-bar/img/tile.ts +0 -5
  245. package/src/sort-filter-bar/sort-filter-bar.ts +0 -733
  246. package/src/styles/ia-button.ts +0 -139
  247. package/src/styles/item-image-styles.ts +0 -124
  248. package/src/styles/sr-only.ts +0 -18
  249. package/src/styles/tile-action-styles.ts +0 -59
  250. package/src/tiles/base-tile-component.ts +0 -124
  251. package/src/tiles/collection-browser-loading-tile.ts +0 -26
  252. package/src/tiles/grid/account-tile.ts +0 -113
  253. package/src/tiles/grid/collection-tile.ts +0 -184
  254. package/src/tiles/grid/item-tile.ts +0 -347
  255. package/src/tiles/grid/search-tile.ts +0 -90
  256. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
  257. package/src/tiles/grid/tile-stats.ts +0 -211
  258. package/src/tiles/hover/hover-pane-controller.ts +0 -638
  259. package/src/tiles/hover/tile-hover-pane.ts +0 -184
  260. package/src/tiles/image-block.ts +0 -162
  261. package/src/tiles/item-image.ts +0 -214
  262. package/src/tiles/list/tile-list-compact-header.ts +0 -112
  263. package/src/tiles/list/tile-list-compact.ts +0 -278
  264. package/src/tiles/list/tile-list.ts +0 -718
  265. package/src/tiles/models.ts +0 -21
  266. package/src/tiles/overlay/icon-overlay.ts +0 -57
  267. package/src/tiles/overlay/text-overlay.ts +0 -79
  268. package/src/tiles/review-block.ts +0 -130
  269. package/src/tiles/text-snippet-block.ts +0 -132
  270. package/src/tiles/tile-dispatcher.ts +0 -637
  271. package/src/tiles/tile-display-value-provider.ts +0 -133
  272. package/src/tiles/tile-mediatype-icon.ts +0 -133
  273. package/src/utils/analytics-events.ts +0 -29
  274. package/src/utils/array-equals.ts +0 -8
  275. package/src/utils/collapse-repeated-quotes.ts +0 -13
  276. package/src/utils/date-filter-field.ts +0 -11
  277. package/src/utils/facet-utils.ts +0 -183
  278. package/src/utils/format-count.ts +0 -95
  279. package/src/utils/format-date.ts +0 -62
  280. package/src/utils/format-unit-size.ts +0 -43
  281. package/src/utils/local-date-from-utc.ts +0 -15
  282. package/src/utils/log.ts +0 -14
  283. package/src/utils/normalize-filter-text.ts +0 -54
  284. package/src/utils/resolve-mediatype.ts +0 -26
  285. package/src/utils/sha1.ts +0 -9
  286. package/test/collection-browser.test.ts +0 -2639
  287. package/test/collection-facets/facet-row.test.ts +0 -421
  288. package/test/collection-facets/facets-template.test.ts +0 -139
  289. package/test/collection-facets/more-facets-content.test.ts +0 -716
  290. package/test/collection-facets/more-facets-scroller.test.ts +0 -401
  291. package/test/collection-facets/page-window.test.ts +0 -208
  292. package/test/collection-facets/toggle-switch.test.ts +0 -164
  293. package/test/collection-facets.test.ts +0 -928
  294. package/test/data-source/collection-browser-data-source.test.ts +0 -193
  295. package/test/empty-placeholder.test.ts +0 -88
  296. package/test/expanded-date-picker.test.ts +0 -201
  297. package/test/icon-overlay.test.ts +0 -38
  298. package/test/image-block.test.ts +0 -247
  299. package/test/item-image.test.ts +0 -220
  300. package/test/manage/manage-bar.test.ts +0 -347
  301. package/test/manage/remove-items-modal-content.test.ts +0 -81
  302. package/test/mediatype-config.test.ts +0 -11
  303. package/test/mocks/mock-analytics-handler.ts +0 -30
  304. package/test/mocks/mock-search-responses.ts +0 -1420
  305. package/test/mocks/mock-search-service.ts +0 -136
  306. package/test/restoration-state-handler.test.ts +0 -480
  307. package/test/review-block.test.ts +0 -62
  308. package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
  309. package/test/sort-filter-bar/alpha-bar.test.ts +0 -101
  310. package/test/sort-filter-bar/sort-filter-bar.test.ts +0 -443
  311. package/test/text-overlay.test.ts +0 -55
  312. package/test/text-snippet-block.test.ts +0 -85
  313. package/test/tile-stats.test.ts +0 -191
  314. package/test/tiles/grid/account-tile.test.ts +0 -121
  315. package/test/tiles/grid/collection-tile.test.ts +0 -114
  316. package/test/tiles/grid/item-tile.test.ts +0 -520
  317. package/test/tiles/grid/search-tile.test.ts +0 -75
  318. package/test/tiles/hover/hover-pane-controller.test.ts +0 -482
  319. package/test/tiles/hover/tile-hover-pane.test.ts +0 -80
  320. package/test/tiles/list/tile-list-compact-header.test.ts +0 -43
  321. package/test/tiles/list/tile-list-compact.test.ts +0 -282
  322. package/test/tiles/list/tile-list.test.ts +0 -576
  323. package/test/tiles/tile-dispatcher.test.ts +0 -320
  324. package/test/tiles/tile-display-value-provider.test.ts +0 -172
  325. package/test/tiles/tile-mediatype-icon.test.ts +0 -160
  326. package/test/utils/array-equals.test.ts +0 -31
  327. package/test/utils/format-count.test.ts +0 -32
  328. package/test/utils/format-date.test.ts +0 -89
  329. package/test/utils/format-unit-size.test.ts +0 -21
  330. package/test/utils/local-date-from-utc.test.ts +0 -37
  331. package/test/utils/normalize-filter-text.test.ts +0 -87
  332. package/tsconfig.json +0 -25
  333. package/types/dompurify.d.ts +0 -1
  334. package/vite.config.ts +0 -29
  335. package/web-dev-server.config.mjs +0 -30
  336. package/web-test-runner.config.mjs +0 -57
@@ -1,184 +0,0 @@
1
- import { css, CSSResultGroup, html, nothing, TemplateResult } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
- import { classMap } from 'lit/directives/class-map.js';
4
- import { msg } from '@lit/localize';
5
- import { collectionIcon } from '../../assets/img/icons/mediatype/collection';
6
- import { formatUnitSize } from '../../utils/format-unit-size';
7
- import { baseTileStyles } from './styles/tile-grid-shared-styles';
8
- import { BaseTileComponent } from '../base-tile-component';
9
- import { LayoutType } from '../models';
10
- import '../image-block';
11
-
12
- @customElement('collection-tile')
13
- export class CollectionTile extends BaseTileComponent {
14
- /*
15
- * Reactive properties inherited from BaseTileComponent:
16
- * - model?: TileModel;
17
- * - currentWidth?: number;
18
- * - currentHeight?: number;
19
- * - baseNavigationUrl?: string;
20
- * - baseImageUrl?: string;
21
- * - collectionPagePath?: string;
22
- * - sortParam: SortParam | null = null;
23
- * - creatorFilter?: string;
24
- * - mobileBreakpoint?: number;
25
- * - loggedIn = false;
26
- * - suppressBlurring = false;
27
- * - useLocalTime = false;
28
- */
29
-
30
- @property({ type: Boolean }) showInfoButton = false;
31
-
32
- @property({ type: String }) layoutType: LayoutType = 'default';
33
-
34
- render() {
35
- const containerClasses = classMap({
36
- container: true,
37
- minimal: this.layoutType === 'minimal',
38
- });
39
-
40
- return html`
41
- <div class=${containerClasses}>
42
- ${this.infoButtonTemplate}
43
- <div class="tile-details">
44
- <div class="item-info">
45
- ${this.getImageBlockTemplate} ${this.getTitleTemplate}
46
- </div>
47
- </div>
48
-
49
- ${this.getTileStatsTemplate}
50
- </div>
51
- `;
52
- }
53
-
54
- private get getImageBlockTemplate(): TemplateResult {
55
- return html`
56
- <image-block
57
- .model=${this.model}
58
- .baseImageUrl=${this.baseImageUrl}
59
- .viewSize=${'grid'}
60
- .suppressBlurring=${this.suppressBlurring}
61
- >
62
- </image-block>
63
- `;
64
- }
65
-
66
- private get getTitleTemplate() {
67
- return html`<div id="title">
68
- <h3 class="truncated">${this.model?.title}</h3>
69
- </div>`;
70
- }
71
-
72
- private get getTileStatsTemplate() {
73
- return html`
74
- <div id="item-stats">
75
- <div id="item-mediatype">${collectionIcon}</div>
76
-
77
- <div id="stats-row">
78
- ${this.getItemsTemplate} ${this.getSizeTemplate}
79
- </div>
80
- </div>
81
- `;
82
- }
83
-
84
- private get getItemsTemplate() {
85
- const collectionItems = this.model?.itemCount?.toLocaleString();
86
-
87
- return html`<span id="item-count"
88
- >${collectionItems} item${Number(collectionItems) !== 1 ? 's' : ''}</span
89
- >`;
90
- }
91
-
92
- private get getSizeTemplate() {
93
- const collectionSize = this.model?.collectionSize ?? 0;
94
-
95
- return collectionSize
96
- ? html`<span id="item-size">${formatUnitSize(collectionSize, 1)}</span>`
97
- : ``;
98
- }
99
-
100
- private get infoButtonTemplate(): TemplateResult | typeof nothing {
101
- // &#9432; is an information icon
102
- return this.showInfoButton
103
- ? html`<button class="info-button" @click=${this.infoButtonPressed}>
104
- &#9432;
105
- <span class="sr-only">${msg('More info')}</span>
106
- </button>`
107
- : nothing;
108
- }
109
-
110
- private infoButtonPressed(e: PointerEvent) {
111
- e.preventDefault();
112
- const event = new CustomEvent<{ x: number; y: number }>(
113
- 'infoButtonPressed',
114
- { detail: { x: e.clientX, y: e.clientY } },
115
- );
116
- this.dispatchEvent(event);
117
- }
118
-
119
- static get styles(): CSSResultGroup {
120
- const tileBorderColor = css`var(--tileBorderColor, #555555)`;
121
- const tileBackgroundColor = css`var(--tileBackgroundColor, #666666)`;
122
- const whiteColor = css`#fff`;
123
-
124
- return [
125
- baseTileStyles,
126
- css`
127
- .container {
128
- background-color: ${tileBackgroundColor};
129
- border: 1px solid ${tileBorderColor};
130
- }
131
-
132
- .item-info {
133
- flex-grow: initial;
134
- }
135
-
136
- h4.truncated,
137
- h3.truncated {
138
- color: ${whiteColor};
139
- }
140
-
141
- #item-mediatype svg {
142
- filter: invert(100%);
143
- height: 2.5rem;
144
- align-items: baseline;
145
- }
146
-
147
- .container:hover > #title {
148
- text-decoration: underline;
149
- }
150
-
151
- /* this is a workaround for Safari 15 where the hover effects are not working */
152
- image-block:hover > #title {
153
- text-decoration: underline;
154
- }
155
-
156
- #item-stats {
157
- display: flex;
158
- padding: 0 5px 5px;
159
- align-items: center;
160
- }
161
-
162
- #stats-row {
163
- display: flex;
164
- align-items: baseline;
165
- color: ${whiteColor};
166
- flex-direction: column;
167
- margin-left: 10px;
168
- }
169
-
170
- .minimal #item-stats {
171
- display: none;
172
- }
173
-
174
- .minimal .truncated {
175
- -webkit-line-clamp: initial;
176
- }
177
-
178
- .minimal .item-info {
179
- padding-bottom: 5px;
180
- }
181
- `,
182
- ];
183
- }
184
- }
@@ -1,347 +0,0 @@
1
- import { css, CSSResultGroup, html, nothing, TemplateResult } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
- import { ifDefined } from 'lit/directives/if-defined.js';
4
- import { map } from 'lit/directives/map.js';
5
- import { classMap } from 'lit/directives/class-map.js';
6
- import { msg } from '@lit/localize';
7
-
8
- import type { SortParam } from '@internetarchive/search-service';
9
- import type { DateFormat } from '../../utils/format-date';
10
- import { isFirstMillisecondOfUTCYear } from '../../utils/local-date-from-utc';
11
- import { BaseTileComponent } from '../base-tile-component';
12
- import { baseTileStyles } from './styles/tile-grid-shared-styles';
13
- import { LayoutType } from '../models';
14
-
15
- import '../image-block';
16
- import '../review-block';
17
- import '../text-snippet-block';
18
- import '../item-image';
19
- import '../tile-mediatype-icon';
20
- import './tile-stats';
21
-
22
- @customElement('item-tile')
23
- export class ItemTile extends BaseTileComponent {
24
- /*
25
- * Reactive properties inherited from BaseTileComponent:
26
- * - model?: TileModel;
27
- * - tileActions: TileAction[] = [];
28
- * - currentWidth?: number;
29
- * - currentHeight?: number;
30
- * - baseNavigationUrl?: string;
31
- * - baseImageUrl?: string;
32
- * - collectionPagePath?: string;
33
- * - sortParam: SortParam | null = null;
34
- * - defaultSortParam: SortParam | null = null;
35
- * - creatorFilter?: string;
36
- * - mobileBreakpoint?: number;
37
- * - loggedIn = false;
38
- * - suppressBlurring = false;
39
- * - useLocalTime = false;
40
- */
41
-
42
- @property({ type: Boolean }) showInfoButton = false;
43
-
44
- @property({ type: Boolean }) showTvClips = false;
45
-
46
- @property({ type: String }) layoutType: LayoutType = 'default';
47
-
48
- render() {
49
- const itemTitle = this.model?.title;
50
- const containerClasses = classMap({
51
- container: true,
52
- simple: this.layoutType !== 'default',
53
- 'stats-only': this.layoutType === 'stats-only',
54
- 'snippets-only': this.layoutType === 'snippets-only',
55
- minimal: this.layoutType === 'minimal',
56
- });
57
-
58
- return html`
59
- <div class=${containerClasses}>
60
- ${this.infoButtonTemplate}
61
- <div class="tile-details">
62
- <div class="item-info">
63
- ${this.imageBlockTemplate}
64
-
65
- <div id="title">
66
- <h3 class="truncated" title=${ifDefined(itemTitle)}>
67
- ${itemTitle}
68
- </h3>
69
- </div>
70
-
71
- ${this.volumeIssueTemplate}
72
- ${this.isSortedByDate
73
- ? this.sortedDateInfoTemplate
74
- : this.creatorTemplate}
75
- ${this.webArchivesCaptureDatesTemplate} ${this.textSnippetsTemplate}
76
- ${this.reviewBlockTemplate}
77
- </div>
78
-
79
- ${this.tileStatsTemplate}
80
- </div>
81
- </div>
82
- `;
83
- }
84
-
85
- /**
86
- * Templates
87
- */
88
- private get creatorTemplate(): TemplateResult | typeof nothing {
89
- const displayedCreator =
90
- this.displayValueProvider.firstCreatorMatchingFilter;
91
- if (!displayedCreator) return nothing;
92
-
93
- return html`
94
- <div class="created-by">
95
- <span class="truncated" title=${displayedCreator}>
96
- by&nbsp;${displayedCreator}
97
- </span>
98
- </div>
99
- `;
100
- }
101
-
102
- private get imageBlockTemplate(): TemplateResult {
103
- return html`
104
- <image-block
105
- .model=${this.model}
106
- .baseImageUrl=${this.baseImageUrl}
107
- .loggedIn=${this.loggedIn}
108
- .suppressBlurring=${this.suppressBlurring}
109
- .isCompactTile=${false}
110
- .isListTile=${false}
111
- .viewSize=${'grid'}
112
- >
113
- </image-block>
114
- `;
115
- }
116
-
117
- private get sortedDateInfoTemplate() {
118
- let sortedValue;
119
- let format: DateFormat = 'long';
120
- switch (this.effectiveSort?.field) {
121
- case 'date': {
122
- const datePublished = this.model?.datePublished;
123
- sortedValue = { field: 'published', value: datePublished };
124
- if (isFirstMillisecondOfUTCYear(datePublished)) {
125
- format = 'year-only';
126
- }
127
- break;
128
- }
129
- case 'reviewdate':
130
- sortedValue = { field: 'reviewed', value: this.model?.dateReviewed };
131
- break;
132
- case 'addeddate':
133
- sortedValue = { field: 'added', value: this.model?.dateAdded };
134
- break;
135
- case 'publicdate':
136
- sortedValue = { field: 'archived', value: this.model?.dateArchived };
137
- break;
138
- default:
139
- break;
140
- }
141
-
142
- if (!sortedValue?.value) {
143
- return nothing;
144
- }
145
-
146
- const formattedDate = this.getFormattedDate(sortedValue.value, format);
147
- return html`
148
- <div class="date-sorted-by truncated">
149
- <span>${sortedValue.field} ${formattedDate}</span>
150
- </div>
151
- `;
152
- }
153
-
154
- private get infoButtonTemplate(): TemplateResult | typeof nothing {
155
- // &#9432; is an information icon
156
- return this.showInfoButton
157
- ? html`<button class="info-button" @click=${this.infoButtonPressed}>
158
- &#9432;
159
- <span class="sr-only">${msg('More info')}</span>
160
- </button>`
161
- : nothing;
162
- }
163
-
164
- private get reviewBlockTemplate(): TemplateResult | typeof nothing {
165
- if (!this.model?.review) return nothing;
166
-
167
- const { reviewtitle, reviewbody, stars } = this.model.review;
168
- return html`
169
- <review-block
170
- viewsize="grid"
171
- title=${ifDefined(reviewtitle)}
172
- body=${ifDefined(reviewbody)}
173
- starRating=${ifDefined(stars)}
174
- >
175
- </review-block>
176
- `;
177
- }
178
-
179
- private get textSnippetsTemplate(): TemplateResult | typeof nothing {
180
- if (!this.hasSnippets) return nothing;
181
- if (['stats-only', 'minimal'].includes(this.layoutType)) {
182
- return nothing;
183
- }
184
-
185
- return html`
186
- <text-snippet-block viewsize="grid" .snippets=${this.model?.snippets}>
187
- </text-snippet-block>
188
- `;
189
- }
190
-
191
- private get volumeIssueTemplate(): TemplateResult | typeof nothing {
192
- if (!this.model?.volume || !this.model?.issue) return nothing;
193
-
194
- return html`
195
- <div class="volume-issue">
196
- <span class="truncated" title="volume|issue">
197
- Volume&nbsp;${this.model?.volume}, Issue&nbsp;${this.model?.issue}
198
- </span>
199
- </div>
200
- `;
201
- }
202
-
203
- private get webArchivesCaptureDatesTemplate():
204
- | TemplateResult
205
- | typeof nothing {
206
- if (!this.model?.captureDates || !this.model.title) return nothing;
207
-
208
- return html`
209
- <ul class="capture-dates">
210
- ${map(
211
- this.model.captureDates,
212
- date =>
213
- html`<li>
214
- ${this.displayValueProvider.webArchivesCaptureLink(
215
- this.model!.title,
216
- date,
217
- )}
218
- </li>`,
219
- )}
220
- </ul>
221
- `;
222
- }
223
-
224
- /**
225
- * Template for the stats row along the bottom of the tile.
226
- */
227
- private get tileStatsTemplate(): TemplateResult | typeof nothing {
228
- if (['snippets-only', 'minimal'].includes(this.layoutType)) {
229
- return nothing;
230
- }
231
-
232
- const effectiveSort = this.sortParam ?? this.defaultSortParam;
233
- const [viewCount, viewLabel] =
234
- effectiveSort?.field === 'week'
235
- ? [this.model?.weeklyViewCount, 'weekly views']
236
- : [this.model?.viewCount, 'all-time views'];
237
-
238
- return html`
239
- <tile-stats
240
- .model=${this.model}
241
- .mediatype=${this.model?.mediatype}
242
- .viewCount=${viewCount}
243
- .viewLabel=${viewLabel}
244
- .favCount=${this.model?.favCount}
245
- .commentCount=${this.model?.commentCount}
246
- .tvClipCount=${this.model?.tvClipCount}
247
- .showTvClips=${this.showTvClips}
248
- >
249
- </tile-stats>
250
- `;
251
- }
252
-
253
- private get isSortedByDate(): boolean {
254
- return ['date', 'reviewdate', 'addeddate', 'publicdate'].includes(
255
- this.effectiveSort?.field as string,
256
- );
257
- }
258
-
259
- /**
260
- * Returns the active sort param if one is set, or the default sort param otherwise.
261
- */
262
- private get effectiveSort(): SortParam | null {
263
- return this.sortParam ?? this.defaultSortParam;
264
- }
265
-
266
- private get hasSnippets(): boolean {
267
- return !!this.model?.snippets?.length;
268
- }
269
-
270
- private infoButtonPressed(e: PointerEvent): void {
271
- e.preventDefault();
272
- const event = new CustomEvent<{ x: number; y: number }>(
273
- 'infoButtonPressed',
274
- { detail: { x: e.clientX, y: e.clientY } },
275
- );
276
- this.dispatchEvent(event);
277
- }
278
-
279
- /**
280
- * CSS
281
- */
282
- static get styles(): CSSResultGroup {
283
- const tileBorderColor = css`var(--tileBorderColor, #dddddd)`;
284
-
285
- return [
286
- baseTileStyles,
287
- css`
288
- a:link {
289
- text-decoration: none;
290
- color: var(--ia-theme-link-color, #4b64ff);
291
- }
292
- a:hover {
293
- text-decoration: underline;
294
- }
295
-
296
- .container {
297
- border: 1px solid ${tileBorderColor};
298
- }
299
-
300
- .simple #title > .truncated {
301
- -webkit-line-clamp: 2;
302
- }
303
-
304
- .simple .created-by > .truncated,
305
- .simple .date-sorted-by > .truncated,
306
- .simple .volume-issue > .truncated {
307
- -webkit-line-clamp: 1;
308
- }
309
-
310
- .simple.snippets-only .item-info,
311
- .simple.minimal .item-info {
312
- padding-bottom: 5px;
313
- }
314
-
315
- .simple.snippets-only text-snippet-block {
316
- margin-top: auto; /* Force the snippets to the bottom of the tile */
317
- }
318
-
319
- .capture-dates {
320
- margin: 0;
321
- padding: 0 5px;
322
- list-style-type: none;
323
- }
324
-
325
- review-block,
326
- text-snippet-block {
327
- --containerLeftMargin: 5px;
328
- --containerTopMargin: 5px;
329
- }
330
-
331
- /**
332
- * iOS Safari long-press on tiles (to bring up hover pane)
333
- * gets messy without this
334
- */
335
- @media screen and (pointer: coarse) and (hover: none) {
336
- .container {
337
- -webkit-touch-callout: none;
338
- }
339
-
340
- .truncated {
341
- -webkit-touch-callout: default;
342
- }
343
- }
344
- `,
345
- ];
346
- }
347
- }
@@ -1,90 +0,0 @@
1
- import { css, CSSResultGroup, html, TemplateResult } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
- import { baseTileStyles } from './styles/tile-grid-shared-styles';
4
- import { BaseTileComponent } from '../base-tile-component';
5
- import '../image-block';
6
-
7
- @customElement('search-tile')
8
- export class SearchTile extends BaseTileComponent {
9
- /*
10
- * Reactive properties inherited from BaseTileComponent:
11
- * - model?: TileModel;
12
- * - currentWidth?: number;
13
- * - currentHeight?: number;
14
- * - baseNavigationUrl?: string;
15
- * - baseImageUrl?: string;
16
- * - collectionPagePath?: string;
17
- * - sortParam: SortParam | null = null;
18
- * - creatorFilter?: string;
19
- * - mobileBreakpoint?: number;
20
- * - loggedIn = false;
21
- * - suppressBlurring = false;
22
- */
23
-
24
- @property({ type: Boolean }) showInfoButton = false;
25
-
26
- render() {
27
- return html`
28
- <div class="container">
29
- <div class="tile-details">
30
- <div class="item-info">
31
- ${this.getImageBlockTemplate} ${this.getTitleTemplate}
32
- </div>
33
- </div>
34
- </div>
35
- `;
36
- }
37
-
38
- private get getImageBlockTemplate(): TemplateResult {
39
- return html`
40
- <image-block
41
- .model=${this.model}
42
- .baseImageUrl=${this.baseImageUrl}
43
- .viewSize=${'grid'}
44
- .suppressBlurring=${this.suppressBlurring}
45
- >
46
- </image-block>
47
- `;
48
- }
49
-
50
- private get getTitleTemplate() {
51
- return html`<div id="title">
52
- <h3 class="truncated">${this.model?.title}</h3>
53
- </div>`;
54
- }
55
-
56
- static get styles(): CSSResultGroup {
57
- const tileBorderColor = css`var(--tileBorderColor, #555555)`;
58
- const tileBackgroundColor = css`var(--tileBackgroundColor, #666666)`;
59
- const whiteColor = css`#fff`;
60
-
61
- return [
62
- baseTileStyles,
63
- css`
64
- .container {
65
- background-color: ${tileBackgroundColor};
66
- border: 1px solid ${tileBorderColor};
67
- }
68
-
69
- .item-info {
70
- flex-grow: initial;
71
- }
72
-
73
- h4.truncated,
74
- h3.truncated {
75
- color: ${whiteColor};
76
- -webkit-line-clamp: 4;
77
- }
78
-
79
- .container:hover > #title {
80
- text-decoration: underline;
81
- }
82
-
83
- /* this is a workaround for Safari 15 where the hover effects are not working */
84
- image-block:hover > #title {
85
- text-decoration: underline;
86
- }
87
- `,
88
- ];
89
- }
90
- }