@internetarchive/collection-browser 4.7.1-alpha-webdev9189.0 → 4.8.1-webdev-9227.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 (396) hide show
  1. package/README.md +33 -0
  2. package/dist/src/app-root.js +0 -2
  3. package/dist/src/app-root.js.map +1 -1
  4. package/dist/src/assets/img/icons/check.d.ts +2 -0
  5. package/dist/src/assets/img/icons/check.js +5 -0
  6. package/dist/src/assets/img/icons/check.js.map +1 -0
  7. package/dist/src/collection-browser.d.ts +2 -1
  8. package/dist/src/collection-browser.js +5 -27
  9. package/dist/src/collection-browser.js.map +1 -1
  10. package/dist/src/collection-facets/facet-row-template.d.ts +38 -0
  11. package/dist/src/collection-facets/facet-row-template.js +200 -0
  12. package/dist/src/collection-facets/facet-row-template.js.map +1 -0
  13. package/dist/src/collection-facets/facet-row.js +11 -186
  14. package/dist/src/collection-facets/facet-row.js.map +1 -1
  15. package/dist/src/collection-facets/models.d.ts +7 -2
  16. package/dist/src/collection-facets/models.js +7 -2
  17. package/dist/src/collection-facets/models.js.map +1 -1
  18. package/dist/src/collection-facets/more-facets-content.d.ts +87 -21
  19. package/dist/src/collection-facets/more-facets-content.js +479 -201
  20. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  21. package/dist/src/collection-facets/more-facets-scroller.d.ts +85 -0
  22. package/dist/src/collection-facets/more-facets-scroller.js +429 -0
  23. package/dist/src/collection-facets/more-facets-scroller.js.map +1 -0
  24. package/dist/src/collection-facets/page-window.d.ts +73 -0
  25. package/dist/src/collection-facets/page-window.js +202 -0
  26. package/dist/src/collection-facets/page-window.js.map +1 -0
  27. package/dist/src/collection-facets/toggle-switch.js +1 -0
  28. package/dist/src/collection-facets/toggle-switch.js.map +1 -1
  29. package/dist/src/collection-facets.js +3 -2
  30. package/dist/src/collection-facets.js.map +1 -1
  31. package/dist/src/empty-placeholder.d.ts +7 -7
  32. package/dist/src/empty-placeholder.js +29 -15
  33. package/dist/src/empty-placeholder.js.map +1 -1
  34. package/dist/src/expanded-date-picker.js +3 -2
  35. package/dist/src/expanded-date-picker.js.map +1 -1
  36. package/dist/src/locales/es.d.ts +94 -0
  37. package/dist/src/locales/es.js +109 -0
  38. package/dist/src/locales/es.js.map +1 -0
  39. package/dist/src/manage/manage-bar.d.ts +3 -2
  40. package/dist/src/manage/manage-bar.js +6 -7
  41. package/dist/src/manage/manage-bar.js.map +1 -1
  42. package/dist/src/manage/remove-items-modal-content.js +3 -2
  43. package/dist/src/manage/remove-items-modal-content.js.map +1 -1
  44. package/dist/src/models.d.ts +4 -0
  45. package/dist/src/models.js +22 -2
  46. package/dist/src/models.js.map +1 -1
  47. package/dist/src/sort-filter-bar/sort-filter-bar.js +3 -3
  48. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  49. package/dist/src/tiles/grid/account-tile.js +3 -2
  50. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  51. package/dist/src/tiles/grid/collection-tile.js +3 -2
  52. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  53. package/dist/src/tiles/grid/item-tile.js +3 -2
  54. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  55. package/dist/src/tiles/grid/tile-stats.js +3 -2
  56. package/dist/src/tiles/grid/tile-stats.js.map +1 -1
  57. package/dist/src/tiles/list/tile-list-compact-header.js +3 -2
  58. package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
  59. package/dist/src/tiles/list/tile-list-compact.js +3 -1
  60. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  61. package/dist/src/tiles/list/tile-list.js +3 -2
  62. package/dist/src/tiles/list/tile-list.js.map +1 -1
  63. package/dist/src/tiles/overlay/text-overlay.js +3 -1
  64. package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
  65. package/dist/src/tiles/review-block.js +3 -2
  66. package/dist/src/tiles/review-block.js.map +1 -1
  67. package/dist/src/tiles/tile-dispatcher.d.ts +2 -1
  68. package/dist/src/tiles/tile-dispatcher.js +5 -4
  69. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  70. package/dist/src/utils/log.d.ts +1 -4
  71. package/dist/src/utils/normalize-filter-text.d.ts +28 -0
  72. package/dist/src/utils/normalize-filter-text.js +35 -0
  73. package/dist/src/utils/normalize-filter-text.js.map +1 -0
  74. package/locales/es.d.ts +1 -0
  75. package/locales/es.js +1 -0
  76. package/package.json +15 -1
  77. package/.editorconfig +0 -29
  78. package/.github/workflows/ci.yml +0 -29
  79. package/.github/workflows/gh-pages-main.yml +0 -41
  80. package/.github/workflows/npm-publish.yml +0 -42
  81. package/.github/workflows/pr-preview.yml +0 -40
  82. package/.husky/pre-commit +0 -1
  83. package/.prettierignore +0 -1
  84. package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -36
  85. package/dist/src/collection-facets/more-facets-pagination.js +0 -260
  86. package/dist/src/collection-facets/more-facets-pagination.js.map +0 -1
  87. package/dist/test/collection-browser.test.d.ts +0 -1
  88. package/dist/test/collection-browser.test.js +0 -1849
  89. package/dist/test/collection-browser.test.js.map +0 -1
  90. package/dist/test/collection-facets/facet-row.test.d.ts +0 -1
  91. package/dist/test/collection-facets/facet-row.test.js +0 -291
  92. package/dist/test/collection-facets/facet-row.test.js.map +0 -1
  93. package/dist/test/collection-facets/facets-template.test.d.ts +0 -1
  94. package/dist/test/collection-facets/facets-template.test.js +0 -95
  95. package/dist/test/collection-facets/facets-template.test.js.map +0 -1
  96. package/dist/test/collection-facets/more-facets-content.test.d.ts +0 -1
  97. package/dist/test/collection-facets/more-facets-content.test.js +0 -159
  98. package/dist/test/collection-facets/more-facets-content.test.js.map +0 -1
  99. package/dist/test/collection-facets/more-facets-pagination.test.d.ts +0 -1
  100. package/dist/test/collection-facets/more-facets-pagination.test.js +0 -126
  101. package/dist/test/collection-facets/more-facets-pagination.test.js.map +0 -1
  102. package/dist/test/collection-facets/toggle-switch.test.d.ts +0 -1
  103. package/dist/test/collection-facets/toggle-switch.test.js +0 -99
  104. package/dist/test/collection-facets/toggle-switch.test.js.map +0 -1
  105. package/dist/test/collection-facets.test.d.ts +0 -2
  106. package/dist/test/collection-facets.test.js +0 -728
  107. package/dist/test/collection-facets.test.js.map +0 -1
  108. package/dist/test/data-source/collection-browser-data-source.test.d.ts +0 -1
  109. package/dist/test/data-source/collection-browser-data-source.test.js +0 -154
  110. package/dist/test/data-source/collection-browser-data-source.test.js.map +0 -1
  111. package/dist/test/empty-placeholder.test.d.ts +0 -1
  112. package/dist/test/empty-placeholder.test.js +0 -57
  113. package/dist/test/empty-placeholder.test.js.map +0 -1
  114. package/dist/test/expanded-date-picker.test.d.ts +0 -1
  115. package/dist/test/expanded-date-picker.test.js +0 -124
  116. package/dist/test/expanded-date-picker.test.js.map +0 -1
  117. package/dist/test/icon-overlay.test.d.ts +0 -1
  118. package/dist/test/icon-overlay.test.js +0 -31
  119. package/dist/test/icon-overlay.test.js.map +0 -1
  120. package/dist/test/image-block.test.d.ts +0 -1
  121. package/dist/test/image-block.test.js +0 -208
  122. package/dist/test/image-block.test.js.map +0 -1
  123. package/dist/test/item-image.test.d.ts +0 -1
  124. package/dist/test/item-image.test.js +0 -187
  125. package/dist/test/item-image.test.js.map +0 -1
  126. package/dist/test/manage/manage-bar.test.d.ts +0 -3
  127. package/dist/test/manage/manage-bar.test.js +0 -216
  128. package/dist/test/manage/manage-bar.test.js.map +0 -1
  129. package/dist/test/manage/remove-items-modal-content.test.d.ts +0 -1
  130. package/dist/test/manage/remove-items-modal-content.test.js +0 -60
  131. package/dist/test/manage/remove-items-modal-content.test.js.map +0 -1
  132. package/dist/test/mediatype-config.test.d.ts +0 -1
  133. package/dist/test/mediatype-config.test.js +0 -11
  134. package/dist/test/mediatype-config.test.js.map +0 -1
  135. package/dist/test/mocks/mock-analytics-handler.d.ts +0 -10
  136. package/dist/test/mocks/mock-analytics-handler.js +0 -16
  137. package/dist/test/mocks/mock-analytics-handler.js.map +0 -1
  138. package/dist/test/mocks/mock-search-responses.d.ts +0 -31
  139. package/dist/test/mocks/mock-search-responses.js +0 -1241
  140. package/dist/test/mocks/mock-search-responses.js.map +0 -1
  141. package/dist/test/mocks/mock-search-service.d.ts +0 -16
  142. package/dist/test/mocks/mock-search-service.js +0 -64
  143. package/dist/test/mocks/mock-search-service.js.map +0 -1
  144. package/dist/test/restoration-state-handler.test.d.ts +0 -1
  145. package/dist/test/restoration-state-handler.test.js +0 -335
  146. package/dist/test/restoration-state-handler.test.js.map +0 -1
  147. package/dist/test/review-block.test.d.ts +0 -1
  148. package/dist/test/review-block.test.js +0 -46
  149. package/dist/test/review-block.test.js.map +0 -1
  150. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +0 -1
  151. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +0 -12
  152. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +0 -1
  153. package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +0 -1
  154. package/dist/test/sort-filter-bar/alpha-bar.test.js +0 -68
  155. package/dist/test/sort-filter-bar/alpha-bar.test.js.map +0 -1
  156. package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +0 -1
  157. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -326
  158. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +0 -1
  159. package/dist/test/text-overlay.test.d.ts +0 -1
  160. package/dist/test/text-overlay.test.js +0 -43
  161. package/dist/test/text-overlay.test.js.map +0 -1
  162. package/dist/test/text-snippet-block.test.d.ts +0 -1
  163. package/dist/test/text-snippet-block.test.js +0 -58
  164. package/dist/test/text-snippet-block.test.js.map +0 -1
  165. package/dist/test/tile-stats.test.d.ts +0 -1
  166. package/dist/test/tile-stats.test.js +0 -167
  167. package/dist/test/tile-stats.test.js.map +0 -1
  168. package/dist/test/tiles/grid/account-tile.test.d.ts +0 -1
  169. package/dist/test/tiles/grid/account-tile.test.js +0 -96
  170. package/dist/test/tiles/grid/account-tile.test.js.map +0 -1
  171. package/dist/test/tiles/grid/collection-tile.test.d.ts +0 -1
  172. package/dist/test/tiles/grid/collection-tile.test.js +0 -90
  173. package/dist/test/tiles/grid/collection-tile.test.js.map +0 -1
  174. package/dist/test/tiles/grid/item-tile.test.d.ts +0 -1
  175. package/dist/test/tiles/grid/item-tile.test.js +0 -400
  176. package/dist/test/tiles/grid/item-tile.test.js.map +0 -1
  177. package/dist/test/tiles/grid/search-tile.test.d.ts +0 -1
  178. package/dist/test/tiles/grid/search-tile.test.js +0 -62
  179. package/dist/test/tiles/grid/search-tile.test.js.map +0 -1
  180. package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +0 -1
  181. package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -351
  182. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +0 -1
  183. package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +0 -1
  184. package/dist/test/tiles/hover/tile-hover-pane.test.js +0 -53
  185. package/dist/test/tiles/hover/tile-hover-pane.test.js.map +0 -1
  186. package/dist/test/tiles/list/tile-list-compact-header.test.d.ts +0 -1
  187. package/dist/test/tiles/list/tile-list-compact-header.test.js +0 -36
  188. package/dist/test/tiles/list/tile-list-compact-header.test.js.map +0 -1
  189. package/dist/test/tiles/list/tile-list-compact.test.d.ts +0 -1
  190. package/dist/test/tiles/list/tile-list-compact.test.js +0 -237
  191. package/dist/test/tiles/list/tile-list-compact.test.js.map +0 -1
  192. package/dist/test/tiles/list/tile-list.test.d.ts +0 -1
  193. package/dist/test/tiles/list/tile-list.test.js +0 -460
  194. package/dist/test/tiles/list/tile-list.test.js.map +0 -1
  195. package/dist/test/tiles/tile-dispatcher.test.d.ts +0 -1
  196. package/dist/test/tiles/tile-dispatcher.test.js +0 -246
  197. package/dist/test/tiles/tile-dispatcher.test.js.map +0 -1
  198. package/dist/test/tiles/tile-display-value-provider.test.d.ts +0 -1
  199. package/dist/test/tiles/tile-display-value-provider.test.js +0 -142
  200. package/dist/test/tiles/tile-display-value-provider.test.js.map +0 -1
  201. package/dist/test/tiles/tile-mediatype-icon.test.d.ts +0 -1
  202. package/dist/test/tiles/tile-mediatype-icon.test.js +0 -133
  203. package/dist/test/tiles/tile-mediatype-icon.test.js.map +0 -1
  204. package/dist/test/utils/array-equals.test.d.ts +0 -1
  205. package/dist/test/utils/array-equals.test.js +0 -27
  206. package/dist/test/utils/array-equals.test.js.map +0 -1
  207. package/dist/test/utils/format-count.test.d.ts +0 -1
  208. package/dist/test/utils/format-count.test.js +0 -24
  209. package/dist/test/utils/format-count.test.js.map +0 -1
  210. package/dist/test/utils/format-date.test.d.ts +0 -1
  211. package/dist/test/utils/format-date.test.js +0 -61
  212. package/dist/test/utils/format-date.test.js.map +0 -1
  213. package/dist/test/utils/format-unit-size.test.d.ts +0 -1
  214. package/dist/test/utils/format-unit-size.test.js +0 -18
  215. package/dist/test/utils/format-unit-size.test.js.map +0 -1
  216. package/dist/test/utils/local-date-from-utc.test.d.ts +0 -1
  217. package/dist/test/utils/local-date-from-utc.test.js +0 -27
  218. package/dist/test/utils/local-date-from-utc.test.js.map +0 -1
  219. package/eslint.config.mjs +0 -53
  220. package/index.html +0 -24
  221. package/index.ts +0 -29
  222. package/local.archive.org.cert +0 -86
  223. package/local.archive.org.key +0 -27
  224. package/pnpm-workspace.yaml +0 -30
  225. package/renovate.json +0 -6
  226. package/src/app-root.ts +0 -1284
  227. package/src/assets/img/icons/arrow-left.ts +0 -10
  228. package/src/assets/img/icons/arrow-right.ts +0 -10
  229. package/src/assets/img/icons/chevron.ts +0 -4
  230. package/src/assets/img/icons/close-circle-dark.ts +0 -5
  231. package/src/assets/img/icons/contract.ts +0 -9
  232. package/src/assets/img/icons/empty-query.ts +0 -5
  233. package/src/assets/img/icons/expand.ts +0 -9
  234. package/src/assets/img/icons/eye-closed.ts +0 -5
  235. package/src/assets/img/icons/eye.ts +0 -5
  236. package/src/assets/img/icons/favorite-filled.ts +0 -10
  237. package/src/assets/img/icons/favorite-unfilled.ts +0 -9
  238. package/src/assets/img/icons/filter.ts +0 -10
  239. package/src/assets/img/icons/login-required.ts +0 -18
  240. package/src/assets/img/icons/mediatype/account.ts +0 -14
  241. package/src/assets/img/icons/mediatype/audio.ts +0 -14
  242. package/src/assets/img/icons/mediatype/collection.ts +0 -12
  243. package/src/assets/img/icons/mediatype/data.ts +0 -15
  244. package/src/assets/img/icons/mediatype/etree.ts +0 -14
  245. package/src/assets/img/icons/mediatype/film.ts +0 -14
  246. package/src/assets/img/icons/mediatype/images.ts +0 -13
  247. package/src/assets/img/icons/mediatype/radio.ts +0 -15
  248. package/src/assets/img/icons/mediatype/search.ts +0 -14
  249. package/src/assets/img/icons/mediatype/software.ts +0 -13
  250. package/src/assets/img/icons/mediatype/texts.ts +0 -13
  251. package/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
  252. package/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
  253. package/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
  254. package/src/assets/img/icons/mediatype/tv.ts +0 -14
  255. package/src/assets/img/icons/mediatype/video.ts +0 -14
  256. package/src/assets/img/icons/mediatype/web.ts +0 -13
  257. package/src/assets/img/icons/null-result.ts +0 -5
  258. package/src/assets/img/icons/quote.ts +0 -7
  259. package/src/assets/img/icons/restricted.ts +0 -13
  260. package/src/assets/img/icons/reviews.ts +0 -11
  261. package/src/assets/img/icons/upload.ts +0 -12
  262. package/src/assets/img/icons/views.ts +0 -11
  263. package/src/circular-activity-indicator.ts +0 -64
  264. package/src/collection-browser.ts +0 -3187
  265. package/src/collection-facets/facet-row.ts +0 -309
  266. package/src/collection-facets/facet-tombstone-row.ts +0 -40
  267. package/src/collection-facets/facets-template.ts +0 -85
  268. package/src/collection-facets/models.ts +0 -10
  269. package/src/collection-facets/more-facets-content.ts +0 -644
  270. package/src/collection-facets/more-facets-pagination.ts +0 -294
  271. package/src/collection-facets/smart-facets/dedupe.ts +0 -44
  272. package/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
  273. package/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
  274. package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
  275. package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
  276. package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
  277. package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
  278. package/src/collection-facets/smart-facets/models.ts +0 -36
  279. package/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
  280. package/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
  281. package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
  282. package/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
  283. package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
  284. package/src/collection-facets/toggle-switch.ts +0 -174
  285. package/src/collection-facets.ts +0 -1013
  286. package/src/data-source/collection-browser-data-source-interface.ts +0 -351
  287. package/src/data-source/collection-browser-data-source.ts +0 -1474
  288. package/src/data-source/collection-browser-query-state.ts +0 -60
  289. package/src/data-source/models.ts +0 -56
  290. package/src/empty-placeholder.ts +0 -192
  291. package/src/expanded-date-picker.ts +0 -191
  292. package/src/language-code-handler/language-code-handler.ts +0 -64
  293. package/src/language-code-handler/language-code-mapping.ts +0 -564
  294. package/src/manage/manage-bar.ts +0 -276
  295. package/src/manage/remove-items-modal-content.ts +0 -102
  296. package/src/mediatype/mediatype-config.ts +0 -146
  297. package/src/models.ts +0 -895
  298. package/src/restoration-state-handler.ts +0 -550
  299. package/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
  300. package/src/sort-filter-bar/alpha-bar.ts +0 -252
  301. package/src/sort-filter-bar/img/compact.ts +0 -5
  302. package/src/sort-filter-bar/img/list.ts +0 -5
  303. package/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
  304. package/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
  305. package/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
  306. package/src/sort-filter-bar/img/sort-triangle.ts +0 -5
  307. package/src/sort-filter-bar/img/tile.ts +0 -5
  308. package/src/sort-filter-bar/sort-filter-bar.ts +0 -734
  309. package/src/styles/ia-button.ts +0 -139
  310. package/src/styles/item-image-styles.ts +0 -124
  311. package/src/styles/sr-only.ts +0 -18
  312. package/src/styles/tile-action-styles.ts +0 -59
  313. package/src/tiles/base-tile-component.ts +0 -124
  314. package/src/tiles/collection-browser-loading-tile.ts +0 -26
  315. package/src/tiles/grid/account-tile.ts +0 -113
  316. package/src/tiles/grid/collection-tile.ts +0 -184
  317. package/src/tiles/grid/item-tile.ts +0 -347
  318. package/src/tiles/grid/search-tile.ts +0 -90
  319. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
  320. package/src/tiles/grid/tile-stats.ts +0 -211
  321. package/src/tiles/hover/hover-pane-controller.ts +0 -638
  322. package/src/tiles/hover/tile-hover-pane.ts +0 -184
  323. package/src/tiles/image-block.ts +0 -162
  324. package/src/tiles/item-image.ts +0 -214
  325. package/src/tiles/list/tile-list-compact-header.ts +0 -112
  326. package/src/tiles/list/tile-list-compact.ts +0 -278
  327. package/src/tiles/list/tile-list.ts +0 -718
  328. package/src/tiles/models.ts +0 -21
  329. package/src/tiles/overlay/icon-overlay.ts +0 -57
  330. package/src/tiles/overlay/text-overlay.ts +0 -79
  331. package/src/tiles/review-block.ts +0 -130
  332. package/src/tiles/text-snippet-block.ts +0 -132
  333. package/src/tiles/tile-dispatcher.ts +0 -637
  334. package/src/tiles/tile-display-value-provider.ts +0 -133
  335. package/src/tiles/tile-mediatype-icon.ts +0 -133
  336. package/src/utils/analytics-events.ts +0 -29
  337. package/src/utils/array-equals.ts +0 -8
  338. package/src/utils/collapse-repeated-quotes.ts +0 -13
  339. package/src/utils/date-filter-field.ts +0 -11
  340. package/src/utils/facet-utils.ts +0 -183
  341. package/src/utils/format-count.ts +0 -95
  342. package/src/utils/format-date.ts +0 -62
  343. package/src/utils/format-unit-size.ts +0 -43
  344. package/src/utils/local-date-from-utc.ts +0 -15
  345. package/src/utils/log.ts +0 -14
  346. package/src/utils/resolve-mediatype.ts +0 -26
  347. package/src/utils/sha1.ts +0 -9
  348. package/test/collection-browser.test.ts +0 -2694
  349. package/test/collection-facets/facet-row.test.ts +0 -421
  350. package/test/collection-facets/facets-template.test.ts +0 -139
  351. package/test/collection-facets/more-facets-content.test.ts +0 -231
  352. package/test/collection-facets/more-facets-pagination.test.ts +0 -201
  353. package/test/collection-facets/toggle-switch.test.ts +0 -164
  354. package/test/collection-facets.test.ts +0 -928
  355. package/test/data-source/collection-browser-data-source.test.ts +0 -193
  356. package/test/empty-placeholder.test.ts +0 -88
  357. package/test/expanded-date-picker.test.ts +0 -201
  358. package/test/icon-overlay.test.ts +0 -38
  359. package/test/image-block.test.ts +0 -247
  360. package/test/item-image.test.ts +0 -220
  361. package/test/manage/manage-bar.test.ts +0 -347
  362. package/test/manage/remove-items-modal-content.test.ts +0 -81
  363. package/test/mediatype-config.test.ts +0 -11
  364. package/test/mocks/mock-analytics-handler.ts +0 -30
  365. package/test/mocks/mock-search-responses.ts +0 -1364
  366. package/test/mocks/mock-search-service.ts +0 -134
  367. package/test/restoration-state-handler.test.ts +0 -480
  368. package/test/review-block.test.ts +0 -62
  369. package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
  370. package/test/sort-filter-bar/alpha-bar.test.ts +0 -101
  371. package/test/sort-filter-bar/sort-filter-bar.test.ts +0 -472
  372. package/test/text-overlay.test.ts +0 -55
  373. package/test/text-snippet-block.test.ts +0 -85
  374. package/test/tile-stats.test.ts +0 -191
  375. package/test/tiles/grid/account-tile.test.ts +0 -121
  376. package/test/tiles/grid/collection-tile.test.ts +0 -114
  377. package/test/tiles/grid/item-tile.test.ts +0 -520
  378. package/test/tiles/grid/search-tile.test.ts +0 -75
  379. package/test/tiles/hover/hover-pane-controller.test.ts +0 -482
  380. package/test/tiles/hover/tile-hover-pane.test.ts +0 -80
  381. package/test/tiles/list/tile-list-compact-header.test.ts +0 -43
  382. package/test/tiles/list/tile-list-compact.test.ts +0 -282
  383. package/test/tiles/list/tile-list.test.ts +0 -576
  384. package/test/tiles/tile-dispatcher.test.ts +0 -320
  385. package/test/tiles/tile-display-value-provider.test.ts +0 -172
  386. package/test/tiles/tile-mediatype-icon.test.ts +0 -160
  387. package/test/utils/array-equals.test.ts +0 -31
  388. package/test/utils/format-count.test.ts +0 -32
  389. package/test/utils/format-date.test.ts +0 -89
  390. package/test/utils/format-unit-size.test.ts +0 -21
  391. package/test/utils/local-date-from-utc.test.ts +0 -37
  392. package/tsconfig.json +0 -25
  393. package/types/dompurify.d.ts +0 -1
  394. package/vite.config.ts +0 -29
  395. package/web-dev-server.config.mjs +0 -30
  396. package/web-test-runner.config.mjs +0 -52
@@ -1,60 +0,0 @@
1
- import type {
2
- CollectionExtraInfo,
3
- PageElementName,
4
- SearchServiceInterface,
5
- SearchType,
6
- SortDirection,
7
- SortParam,
8
- } from '@internetarchive/search-service';
9
- import type { FacetLoadStrategy, SelectedFacets, SortField } from '../models';
10
- import type { CollectionBrowserDataSourceInterface } from './collection-browser-data-source-interface';
11
-
12
- /**
13
- * Properties of collection browser that affect the overall search query
14
- */
15
- export interface CollectionBrowserQueryState {
16
- baseQuery?: string;
17
- identifiers?: string[];
18
- withinCollection?: string;
19
- withinProfile?: string;
20
- profileElement?: PageElementName;
21
- searchType: SearchType;
22
- selectedFacets?: SelectedFacets;
23
- internalFilters?: SelectedFacets;
24
- minSelectedDate?: string;
25
- maxSelectedDate?: string;
26
- selectedTitleFilter: string | null;
27
- selectedCreatorFilter: string | null;
28
- selectedSort?: SortField;
29
- sortDirection: SortDirection | null;
30
- }
31
-
32
- /**
33
- * Interface representing search-related state and operations required by the
34
- * data source on its host component.
35
- */
36
- export interface CollectionBrowserSearchInterface
37
- extends CollectionBrowserQueryState {
38
- searchService?: SearchServiceInterface;
39
- isTVCollection: boolean;
40
- readonly sortParam: SortParam | null;
41
- readonly defaultSortField: SortField | null;
42
- readonly defaultSortDirection: SortDirection | null;
43
- readonly facetLoadStrategy: FacetLoadStrategy;
44
- readonly initialPageNumber: number;
45
- readonly maxPagesToManage: number;
46
- readonly currentVisiblePageNumbers: number[];
47
- readonly clearResultsOnEmptyQuery?: boolean;
48
- readonly dataSource?: CollectionBrowserDataSourceInterface;
49
-
50
- getSessionId(): Promise<string>;
51
- setSearchResultsLoading(loading: boolean): void;
52
- setFacetsLoading(loading: boolean): void;
53
- setTotalResultCount(count: number): void;
54
- setTileCount(count: number): void;
55
- applyDefaultCollectionSort(collectionInfo?: CollectionExtraInfo): void;
56
- emitEmptyResults(): void;
57
- emitSearchError(): void;
58
- emitQueryStateChanged(): void;
59
- refreshVisibleResults(): void;
60
- }
@@ -1,56 +0,0 @@
1
- import type {
2
- PageElementName,
3
- PageType,
4
- } from '@internetarchive/search-service';
5
-
6
- /**
7
- * A Map from collection identifiers to their corresponding collection titles.
8
- */
9
- export type CollectionTitles = Map<string, string>;
10
-
11
- /**
12
- * A Map from channel names to their corresponding, more human-readable network name.
13
- */
14
- export type TVChannelAliases = Map<string, string>;
15
-
16
- /**
17
- * A Map from program (show) names to a mapping of all the channels that run them.
18
- */
19
- export type TVProgramChannels = Map<string, Record<string, number>>;
20
-
21
- /**
22
- * Object storing the different TV channel mappings used by the data source.
23
- */
24
- export type TVChannelMaps = {
25
- channelToNetwork?: TVChannelAliases;
26
- programToChannels?: TVProgramChannels;
27
- };
28
-
29
- /**
30
- * The subset of search service params that uniquely specify the type of results
31
- * that are sought by an instance of collection browser.
32
- */
33
- export type PageSpecifierParams = {
34
- /**
35
- * What high-level type of page is being fetched for (search results, collection, or profile)
36
- */
37
- pageType: PageType;
38
- /**
39
- * The target identifier for collection or profile pages (e.g., "prelinger", "@brewster", ...)
40
- */
41
- pageTarget?: string;
42
- /**
43
- * Which specific elements of a profile page to fetch. Corresponds to individual tab data
44
- * (e.g., "uploads", "reviews", ...)
45
- */
46
- pageElements?: PageElementName[];
47
- };
48
-
49
- /**
50
- * List of profile page elements that do not currently allow faceting
51
- */
52
- export const FACETLESS_PAGE_ELEMENTS: PageElementName[] = [
53
- 'forum_posts',
54
- 'lending',
55
- 'web_archives',
56
- ];
@@ -1,192 +0,0 @@
1
- import {
2
- css,
3
- html,
4
- LitElement,
5
- CSSResultGroup,
6
- nothing,
7
- TemplateResult,
8
- } from 'lit';
9
- import { customElement, property } from 'lit/decorators.js';
10
- import { choose } from 'lit/directives/choose.js';
11
- import { msg } from '@lit/localize';
12
-
13
- import emptyQueryIcon from './assets/img/icons/empty-query';
14
- import nullResultIcon from './assets/img/icons/null-result';
15
-
16
- export type PlaceholderType =
17
- | 'empty-query'
18
- | 'empty-collection'
19
- | 'no-results'
20
- | 'query-error'
21
- | 'collection-error'
22
- | null;
23
- @customElement('empty-placeholder')
24
- export class EmptyPlaceholder extends LitElement {
25
- private static readonly MESSAGE_EMPTY_QUERY = msg(
26
- 'To begin searching, enter a search term in the box above and hit "Go".',
27
- );
28
-
29
- private static readonly MESSAGE_NO_SEARCH_RESULTS = msg(
30
- 'Your search did not match any items in the Archive. ' +
31
- 'Try different keywords or a more general search.',
32
- );
33
-
34
- private static readonly MESSAGE_NO_COLLECTION_RESULTS = msg(
35
- 'Your search did not match any items in this collection. ' +
36
- 'Try different keywords or a more general search.',
37
- );
38
-
39
- private static readonly MESSAGE_NO_VIEWABLE_MEMBERS = msg(
40
- 'This collection contains no viewable items.',
41
- );
42
-
43
- private static readonly MESSAGE_QUERY_ERROR = msg(
44
- html`The search engine encountered an error, which might be related to your
45
- search query.
46
- <a
47
- href="https://help.archive.org/help/search-building-powerful-complex-queries/"
48
- >
49
- Tips for constructing search queries.
50
- </a> `,
51
- );
52
-
53
- private static readonly MESSAGE_COLLECTION_ERROR = msg(
54
- html`The search engine encountered an error while loading this collection.
55
- If the problem persists, please let us know at
56
- <a href="mailto:info@archive.org">info@archive.org</a>.`,
57
- );
58
-
59
- private static readonly QUERY_ERROR_DETAILS_MESSAGE = msg('Error details:');
60
-
61
- @property({ type: String }) placeholderType: PlaceholderType = null;
62
-
63
- @property({ type: Boolean }) isMobileView?: false;
64
-
65
- @property({ type: Boolean }) isCollection?: false;
66
-
67
- @property({ type: String }) detailMessage?: string = '';
68
-
69
- render() {
70
- return this.placeholderType ? html`${this.placeholderTemplate}` : nothing;
71
- }
72
-
73
- private get placeholderTemplate(): TemplateResult {
74
- return html`
75
- <div
76
- class="placeholder ${this.placeholderType} ${this.isMobileView
77
- ? 'mobile'
78
- : 'desktop'}"
79
- >
80
- ${choose(this.placeholderType, [
81
- ['empty-query', () => this.emptyQueryTemplate],
82
- ['empty-collection', () => this.emptyCollectionTemplate],
83
- ['no-results', () => this.noResultsTemplate],
84
- ['query-error', () => this.queryErrorTemplate],
85
- ['collection-error', () => this.collectionErrorTemplate],
86
- ])}
87
- </div>
88
- `;
89
- }
90
-
91
- private get emptyQueryTemplate(): TemplateResult {
92
- // Added data-testid for Playwright testing
93
- return html`
94
- <h2 class="title" data-testid="empty-query-text-msg">
95
- ${EmptyPlaceholder.MESSAGE_EMPTY_QUERY}
96
- </h2>
97
- <div>${emptyQueryIcon}</div>
98
- `;
99
- }
100
-
101
- private get emptyCollectionTemplate(): TemplateResult {
102
- // Added data-testid for Playwright testing
103
- return html`
104
- <h2 class="title" data-testid="empty-collection-text-msg">
105
- ${EmptyPlaceholder.MESSAGE_NO_VIEWABLE_MEMBERS}
106
- </h2>
107
- <div>${nullResultIcon}</div>
108
- `;
109
- }
110
-
111
- private get noResultsTemplate(): TemplateResult {
112
- // Added data-testid for Playwright testing
113
- return html`
114
- <h2 class="title" data-testid="empty-results-text-msg">
115
- ${this.isCollection
116
- ? EmptyPlaceholder.MESSAGE_NO_COLLECTION_RESULTS
117
- : EmptyPlaceholder.MESSAGE_NO_SEARCH_RESULTS}
118
- </h2>
119
- <div>${nullResultIcon}</div>
120
- `;
121
- }
122
-
123
- private get queryErrorTemplate(): TemplateResult {
124
- // Added data-testid for Playwright testing
125
- return html`
126
- <h2 class="title" data-testid="error-query-text-msg">
127
- ${EmptyPlaceholder.MESSAGE_QUERY_ERROR}
128
- </h2>
129
- <div>${nullResultIcon}</div>
130
- <p class="error-details">
131
- ${EmptyPlaceholder.QUERY_ERROR_DETAILS_MESSAGE} ${this.detailMessage}
132
- </p>
133
- `;
134
- }
135
-
136
- private get collectionErrorTemplate(): TemplateResult {
137
- // Added data-testid for Playwright testing
138
- return html`
139
- <h2 class="title" data-testid="error-collection-text-msg">
140
- ${EmptyPlaceholder.MESSAGE_COLLECTION_ERROR}
141
- </h2>
142
- <div>${nullResultIcon}</div>
143
- <p class="error-details">
144
- ${EmptyPlaceholder.QUERY_ERROR_DETAILS_MESSAGE} ${this.detailMessage}
145
- </p>
146
- `;
147
- }
148
-
149
- static get styles(): CSSResultGroup {
150
- return css`
151
- :host {
152
- text-align: center;
153
- width: 100%;
154
- }
155
-
156
- a {
157
- text-decoration: none;
158
- }
159
- a:link {
160
- color: var(--ia-theme-link-color, #4b64ff);
161
- }
162
- a:hover {
163
- text-decoration: underline;
164
- }
165
-
166
- .placeholder {
167
- display: block;
168
- }
169
-
170
- .desktop svg {
171
- max-height: 40rem;
172
- }
173
- .desktop .title,
174
- .desktop .error-details {
175
- margin: 4rem 0;
176
- }
177
-
178
- .mobile svg {
179
- max-height: 20rem;
180
- }
181
- .mobile .title,
182
- .mobile .error-details {
183
- margin: 2rem 0.5;
184
- }
185
-
186
- .error-details {
187
- font-size: 1.2rem;
188
- word-break: break-word;
189
- }
190
- `;
191
- }
192
- }
@@ -1,191 +0,0 @@
1
- import {
2
- css,
3
- html,
4
- LitElement,
5
- CSSResultGroup,
6
- TemplateResult,
7
- nothing,
8
- } from 'lit';
9
- import { customElement, property } from 'lit/decorators.js';
10
- import { ifDefined } from 'lit/directives/if-defined.js';
11
- import { msg } from '@lit/localize';
12
- import type { ModalManagerInterface } from '@internetarchive/modal-manager';
13
- import type { AnalyticsManagerInterface } from '@internetarchive/analytics-manager';
14
- import {
15
- BarScalingOption,
16
- BinSnappingInterval,
17
- } from '@internetarchive/elements/ia-histogram-date-range/models';
18
- import {
19
- analyticsActions,
20
- analyticsCategories,
21
- } from './utils/analytics-events';
22
-
23
- import '@internetarchive/elements/ia-histogram-date-range/ia-histogram-date-range';
24
-
25
- @customElement('expanded-date-picker')
26
- export class ExpandedDatePicker extends LitElement {
27
- @property({ type: String }) minDate?: string;
28
-
29
- @property({ type: String }) maxDate?: string;
30
-
31
- @property({ type: String }) minSelectedDate?: string;
32
-
33
- @property({ type: String }) maxSelectedDate?: string;
34
-
35
- @property({ type: Array }) buckets?: number[];
36
-
37
- @property({ type: String }) customDateFormat?: string;
38
-
39
- @property({ type: String }) customTooltipDateFormat?: string;
40
-
41
- @property({ type: String }) customTooltipLabel?: string;
42
-
43
- @property({ type: String }) binSnapping: BinSnappingInterval = 'none';
44
-
45
- @property({ type: String }) barScaling: BarScalingOption = 'logarithmic';
46
-
47
- @property({ type: Object, attribute: false })
48
- modalManager?: ModalManagerInterface;
49
-
50
- @property({ type: Object, attribute: false })
51
- analyticsHandler?: AnalyticsManagerInterface;
52
-
53
- render(): TemplateResult {
54
- return html`
55
- <div id="container">
56
- <ia-histogram-date-range
57
- id="date-picker"
58
- .minDate=${this.minDate}
59
- .maxDate=${this.maxDate}
60
- .minSelectedDate=${this.minSelectedDate ?? this.minDate}
61
- .maxSelectedDate=${this.maxSelectedDate ?? this.maxDate}
62
- dateFormat=${ifDefined(this.customDateFormat)}
63
- tooltipDateFormat=${ifDefined(this.customTooltipDateFormat)}
64
- tooltipLabel=${ifDefined(this.customTooltipLabel)}
65
- .binSnapping=${this.binSnapping}
66
- .barScaling=${this.barScaling ?? nothing}
67
- .updateDelay=${0}
68
- updateWhileFocused
69
- missingDataMessage="..."
70
- .width=${560}
71
- .height=${120}
72
- .bins=${this.buckets}
73
- @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
74
- >
75
- <button
76
- id="apply-btn"
77
- slot="inputs-right-side"
78
- @click=${this.applyBtnClicked}
79
- >
80
- ${msg('Apply date range')}
81
- </button>
82
- </ia-histogram-date-range>
83
- </div>
84
- `;
85
- }
86
-
87
- connectedCallback(): void {
88
- super.connectedCallback?.();
89
- this.setupEscapeListener();
90
- }
91
-
92
- disconnectedCallback(): void {
93
- super.disconnectedCallback?.();
94
- this.removeEscapeListener();
95
- }
96
-
97
- /**
98
- * Add an event listener to close the date picker modal when the Esc key is pressed
99
- */
100
- private setupEscapeListener() {
101
- document.addEventListener('keydown', this.boundEscapeListener);
102
- }
103
-
104
- /**
105
- * Remove the Esc key listener that was previously added
106
- */
107
- private removeEscapeListener() {
108
- document.removeEventListener('keydown', this.boundEscapeListener);
109
- }
110
-
111
- /**
112
- * Closes the modal dialog if the given event is pressing the Esc key.
113
- * Arrow function to ensure `this` remains bound to the current component.
114
- */
115
- private boundEscapeListener = (e: KeyboardEvent) => {
116
- if (e.key === 'Escape') {
117
- this.closeModal();
118
- }
119
- };
120
-
121
- /**
122
- * When the histogram is updated, keep track of the newly selected date range.
123
- * We don't commit to the new range until the apply button is clicked.
124
- */
125
- private histogramDateRangeUpdated(
126
- e: CustomEvent<{
127
- minDate: string;
128
- maxDate: string;
129
- }>,
130
- ): void {
131
- this.minSelectedDate = e.detail.minDate;
132
- this.maxSelectedDate = e.detail.maxDate;
133
- }
134
-
135
- /**
136
- * When the Apply button is clicked, emit the current date range and close the modal.
137
- */
138
- private applyBtnClicked(): void {
139
- const event = new CustomEvent('histogramDateRangeApplied', {
140
- detail: {
141
- minDate: this.minSelectedDate,
142
- maxDate: this.maxSelectedDate,
143
- },
144
- });
145
- this.dispatchEvent(event);
146
- this.closeModal();
147
-
148
- this.analyticsHandler?.sendEvent({
149
- category: analyticsCategories.default,
150
- action: analyticsActions.histogramChangedFromModal,
151
- label: window.location.href,
152
- });
153
- }
154
-
155
- /**
156
- * Closes the modal associated with this component (if it exists) and dispatches a
157
- * modalClosed event.
158
- */
159
- private closeModal(): void {
160
- if (this.modalManager) {
161
- this.modalManager.closeModal();
162
- this.dispatchEvent(new CustomEvent('modalClosed'));
163
- }
164
- }
165
-
166
- static get styles(): CSSResultGroup {
167
- return css`
168
- #container {
169
- display: flex;
170
- justify-content: center;
171
- padding: 40px 10px 10px;
172
- overflow: hidden;
173
- }
174
-
175
- #date-picker {
176
- --histogramDateRangeInputWidth: 50px;
177
- --histogramDateRangeInputRowMargin: 5px 0 0 0;
178
- }
179
-
180
- #apply-btn {
181
- margin: 0 0 0 5px;
182
- padding: 8px 10px;
183
- border: 0;
184
- border-radius: 4px;
185
- background: var(--primaryButtonBGColor, #194880);
186
- color: white;
187
- cursor: pointer;
188
- }
189
- `;
190
- }
191
- }
@@ -1,64 +0,0 @@
1
- import { codeToLanguageMap } from './language-code-mapping';
2
-
3
- // To serialize the list of potential language codes, we store
4
- // the string in the format `en-us|en|en-gb` with `|` being the separator.
5
- // This allows us to generate a query of `language:(en-us OR en OR en-gb)`
6
- // when we deserialize the string.
7
- export interface LanguageCodeHandlerInterface {
8
- /**
9
- * This takes a list of codes in the format `en-us|en|en-gb` and
10
- * returns the first language code in the list.
11
- *
12
- * The codes in the string should always represent the same language name.
13
- * eg `en-us`, `en-gb`, and `en` should always be "English"
14
- *
15
- * @param languageCodes
16
- */
17
- getLanguageNameFromCodeString(languageCodes: string): string;
18
-
19
- /**
20
- * This creates a serialized string of language codes for the given language.
21
- *
22
- * eg. `English` becomes `en-us|en|en-gb|.....`
23
- *
24
- * @param languageName
25
- */
26
- getCodeStringFromLanguageName(languageName: string): string;
27
-
28
- /**
29
- * Get an array of langauge codes from a serialized string.
30
- *
31
- * eg. `en-us|en|en-gb` becomes `['en-us', 'en', 'en-gb']`
32
- *
33
- * @param languageCodes
34
- */
35
- getCodeArrayFromCodeString(languageCodes: string): string[];
36
- }
37
-
38
- export class LanguageCodeHandler implements LanguageCodeHandlerInterface {
39
- private delimeter = '|';
40
-
41
- /** @inheritdoc */
42
- getLanguageNameFromCodeString(languageCodes: string): string {
43
- const split = this.getCodeArrayFromCodeString(languageCodes);
44
- if (split.length === 0) return '';
45
- const languageCode = split[0];
46
- const languageName = codeToLanguageMap[languageCode];
47
- return languageName ?? languageCodes;
48
- }
49
-
50
- /** @inheritdoc */
51
- getCodeStringFromLanguageName(languageName: string): string {
52
- const languageCodes = Object.keys(codeToLanguageMap).filter(
53
- code => codeToLanguageMap[code] === languageName,
54
- );
55
- const stringifiedCodes = languageCodes?.join(this.delimeter);
56
- return stringifiedCodes;
57
- }
58
-
59
- /** @inheritdoc */
60
- getCodeArrayFromCodeString(languageCodes: string): string[] {
61
- const split = languageCodes.split(this.delimeter);
62
- return split;
63
- }
64
- }