@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,1364 +0,0 @@
1
- // eslint-disable @typescript-eslint/no-unsafe-function-type
2
- import type { Result } from '@internetarchive/result-type';
3
- import {
4
- Aggregation,
5
- ItemHit,
6
- SearchResponse,
7
- SearchServiceError,
8
- TextHit,
9
- } from '@internetarchive/search-service';
10
- import { TvClipHit } from '@internetarchive/search-service/dist/src/models/hit-types/tv-clip-hit';
11
- import { WebArchiveHit } from '@internetarchive/search-service/dist/src/models/hit-types/web-archive-hit';
12
- import { SearchServiceErrorType } from '@internetarchive/search-service/dist/src/search-service-error';
13
-
14
- export const getMockSuccessSingleResult: () => Result<
15
- SearchResponse,
16
- SearchServiceError
17
- > = () => ({
18
- success: {
19
- request: {
20
- kind: 'hits',
21
- clientParameters: {
22
- user_query: 'collection:foo',
23
- sort: [],
24
- },
25
- backendRequests: {
26
- primary: {
27
- kind: 'hits',
28
- finalized_parameters: {
29
- user_query: 'collection:foo',
30
- sort: [],
31
- },
32
- },
33
- },
34
- },
35
- rawResponse: {},
36
- sessionContext: {},
37
- response: {
38
- totalResults: 1,
39
- returnedCount: 1,
40
- results: [
41
- new ItemHit({
42
- fields: {
43
- identifier: 'foo',
44
- collection: ['foo', 'bar'],
45
- },
46
- }),
47
- ],
48
- },
49
- responseHeader: {
50
- succeeded: true,
51
- query_time: 0,
52
- },
53
- },
54
- });
55
-
56
- export const getMockSuccessManyFields: () => Result<
57
- SearchResponse,
58
- SearchServiceError
59
- > = () => ({
60
- success: {
61
- request: {
62
- kind: 'hits',
63
- clientParameters: {
64
- user_query: 'many-fields',
65
- sort: [],
66
- },
67
- backendRequests: {
68
- primary: {
69
- kind: 'hits',
70
- finalized_parameters: {
71
- user_query: 'many-fields',
72
- sort: [],
73
- },
74
- },
75
- },
76
- },
77
- rawResponse: {},
78
- sessionContext: {},
79
- response: {
80
- totalResults: 1,
81
- returnedCount: 1,
82
- results: [
83
- new ItemHit({
84
- fields: {
85
- identifier: 'foo',
86
- avg_rating: 3.5,
87
- collection: ['foo', 'bar', 'no-preview', 'loggedin'],
88
- collection_files_count: 123,
89
- collection_size: 234,
90
- creator: ['baz', 'boop'],
91
- date: '2010-01-03T01:23:45Z',
92
- addeddate: '2010-01-01T01:23:45Z',
93
- publicdate: '2010-01-02T01:23:45Z',
94
- reviewdate: '2010-01-04T01:23:45Z',
95
- description: 'foo bar baz',
96
- downloads: 246,
97
- issue: 1,
98
- item_count: 20,
99
- mediatype: 'texts',
100
- num_favorites: 12,
101
- num_reviews: 23,
102
- num_clips: 34,
103
- source: 'foo bar',
104
- subject: ['baz', 'quux'],
105
- title: 'Foo Bar',
106
- volume: 2,
107
- week: 50,
108
- __href__: 'https://archive.org/details/foo',
109
- __img__: '//services/img/foo',
110
- },
111
- }),
112
- ],
113
- },
114
- responseHeader: {
115
- succeeded: true,
116
- query_time: 0,
117
- },
118
- },
119
- });
120
-
121
- export const getMockSuccessTvFields: () => Result<
122
- SearchResponse,
123
- SearchServiceError
124
- > = () => ({
125
- success: {
126
- request: {
127
- kind: 'hits',
128
- clientParameters: {
129
- user_query: 'tv-fields',
130
- sort: [],
131
- },
132
- backendRequests: {
133
- primary: {
134
- kind: 'hits',
135
- finalized_parameters: {
136
- user_query: 'tv-fields',
137
- sort: [],
138
- },
139
- },
140
- },
141
- },
142
- rawResponse: {},
143
- sessionContext: {},
144
- response: {
145
- totalResults: 1,
146
- returnedCount: 1,
147
- results: [
148
- new TvClipHit({
149
- fields: {
150
- identifier: 'foo',
151
- ad_id: ['foo-ad'],
152
- clip: true,
153
- collection: ['foo', 'bar', 'tvnews'],
154
- creator: ['baz', 'boop'],
155
- date: '2010-01-03T01:23:45Z',
156
- addeddate: '2010-01-01T01:23:45Z',
157
- publicdate: '2010-01-02T01:23:45Z',
158
- reviewdate: '2010-01-04T01:23:45Z',
159
- description: 'foo bar baz',
160
- downloads: 246,
161
- factcheck: ['https://foo.bar'],
162
- files_count: 75,
163
- indexflag: ['index', 'nonoindex'],
164
- item_size: 123456,
165
- language: 'eng',
166
- mediatype: 'movies',
167
- num_favorites: 12,
168
- nclips: 34,
169
- source: 'foo bar',
170
- start: '1234',
171
- subject: ['baz', 'quux'],
172
- title: 'Foo Bar',
173
- week: 50,
174
- year: 2010,
175
- __href__: 'https://archive.org/details/foo',
176
- __img__: '//services/img/foo',
177
- },
178
- }),
179
- ],
180
- },
181
- responseHeader: {
182
- succeeded: true,
183
- query_time: 0,
184
- },
185
- },
186
- });
187
-
188
- export const getMockSuccessWithYearHistogramAggs: () => Result<
189
- SearchResponse,
190
- SearchServiceError
191
- > = () => ({
192
- success: {
193
- request: {
194
- kind: 'hits',
195
- clientParameters: {
196
- user_query: 'years',
197
- sort: [],
198
- },
199
- backendRequests: {
200
- primary: {
201
- kind: 'hits',
202
- finalized_parameters: {
203
- user_query: 'years',
204
- sort: [],
205
- },
206
- },
207
- },
208
- },
209
- rawResponse: {},
210
- sessionContext: {},
211
- response: {
212
- totalResults: 1,
213
- returnedCount: 1,
214
- aggregations: {
215
- subject: new Aggregation({
216
- buckets: [
217
- {
218
- key: 'foo',
219
- doc_count: 3,
220
- },
221
- ],
222
- }),
223
- year_histogram: new Aggregation({
224
- buckets: [1, 2, 3, 3, 2, 1],
225
- first_bucket_key: 1950,
226
- last_bucket_key: 2000,
227
- interval: 10,
228
- number_buckets: 6,
229
- }),
230
- },
231
- results: [],
232
- },
233
- responseHeader: {
234
- succeeded: true,
235
- query_time: 0,
236
- },
237
- },
238
- });
239
-
240
- export const getMockSuccessWithDateHistogramAggs: () => Result<
241
- SearchResponse,
242
- SearchServiceError
243
- > = () => ({
244
- success: {
245
- request: {
246
- kind: 'hits',
247
- clientParameters: {
248
- user_query: 'months',
249
- sort: [],
250
- },
251
- backendRequests: {
252
- primary: {
253
- kind: 'hits',
254
- finalized_parameters: {
255
- user_query: 'months',
256
- sort: [],
257
- },
258
- },
259
- },
260
- },
261
- rawResponse: {},
262
- sessionContext: {},
263
- response: {
264
- totalResults: 1,
265
- returnedCount: 1,
266
- aggregations: {
267
- subject: new Aggregation({
268
- buckets: [
269
- {
270
- key: 'foo',
271
- doc_count: 3,
272
- },
273
- ],
274
- }),
275
- date_histogram: new Aggregation({
276
- buckets: [1, 2, 3, 3, 2, 1],
277
- first_bucket_year: 2000,
278
- first_bucket_month: 1,
279
- last_bucket_year: 2002,
280
- last_bucket_month: 7,
281
- interval_in_months: 6,
282
- number_buckets: 6,
283
- }),
284
- },
285
- results: [],
286
- },
287
- responseHeader: {
288
- succeeded: true,
289
- query_time: 0,
290
- },
291
- },
292
- });
293
-
294
- export const getMockSuccessArchiveOrgUserResult: () => Result<
295
- SearchResponse,
296
- SearchServiceError
297
- > = () => ({
298
- success: {
299
- request: {
300
- kind: 'hits',
301
- clientParameters: {
302
- user_query: 'archive-org-user-loggedin',
303
- sort: [],
304
- },
305
- backendRequests: {
306
- primary: {
307
- kind: 'hits',
308
- finalized_parameters: {
309
- user_query: 'archive-org-user-loggedin',
310
- sort: [],
311
- },
312
- },
313
- },
314
- },
315
- rawResponse: {},
316
- sessionContext: {
317
- is_archive_user: true,
318
- pps_relevant_user_preferences: {
319
- display__blur_moderated_content: 'on',
320
- },
321
- },
322
- response: {
323
- totalResults: 2,
324
- returnedCount: 2,
325
- results: [
326
- new ItemHit({
327
- fields: {
328
- identifier: 'foo',
329
- collection: ['foo', 'loggedin', 'bar'],
330
- __href__: '/foo',
331
- },
332
- }),
333
- new ItemHit({
334
- fields: {
335
- identifier: 'bar',
336
- collection: ['baz', 'boop'],
337
- __href__: '/bar',
338
- },
339
- }),
340
- ],
341
- },
342
- responseHeader: {
343
- succeeded: true,
344
- query_time: 0,
345
- },
346
- },
347
- });
348
-
349
- export const getMockSuccessArchiveOrgUserNoBlurResult: () => Result<
350
- SearchResponse,
351
- SearchServiceError
352
- > = () => ({
353
- success: {
354
- request: {
355
- kind: 'hits',
356
- clientParameters: {
357
- user_query: 'archive-org-user-loggedin-noblur',
358
- sort: [],
359
- },
360
- backendRequests: {
361
- primary: {
362
- kind: 'hits',
363
- finalized_parameters: {
364
- user_query: 'archive-org-user-loggedin-noblur',
365
- sort: [],
366
- },
367
- },
368
- },
369
- },
370
- rawResponse: {},
371
- sessionContext: {
372
- is_archive_user: true,
373
- pps_relevant_user_preferences: {
374
- display__blur_moderated_content: 'off',
375
- },
376
- },
377
- response: {
378
- totalResults: 1,
379
- returnedCount: 1,
380
- results: [
381
- new ItemHit({
382
- fields: {
383
- identifier: 'foo',
384
- collection: ['loggedin'],
385
- title: 'foo',
386
- mediatype: 'texts',
387
- },
388
- }),
389
- ],
390
- },
391
- responseHeader: {
392
- succeeded: true,
393
- query_time: 0,
394
- },
395
- },
396
- });
397
-
398
- export const getMockSuccessLoggedInResult: () => Result<
399
- SearchResponse,
400
- SearchServiceError
401
- > = () => ({
402
- success: {
403
- request: {
404
- kind: 'hits',
405
- clientParameters: {
406
- user_query: 'loggedin',
407
- sort: [],
408
- },
409
- backendRequests: {
410
- primary: {
411
- kind: 'hits',
412
- finalized_parameters: {
413
- user_query: 'loggedin',
414
- sort: [],
415
- },
416
- },
417
- },
418
- },
419
- rawResponse: {},
420
- sessionContext: {},
421
- response: {
422
- totalResults: 1,
423
- returnedCount: 1,
424
- results: [
425
- new ItemHit({
426
- fields: {
427
- identifier: 'foo',
428
- collection: ['foo', 'loggedin', 'bar'],
429
- title: 'foo',
430
- mediatype: 'data',
431
- },
432
- }),
433
- ],
434
- },
435
- responseHeader: {
436
- succeeded: true,
437
- query_time: 0,
438
- },
439
- },
440
- });
441
-
442
- export const getMockSuccessNoPreviewResult: () => Result<
443
- SearchResponse,
444
- SearchServiceError
445
- > = () => ({
446
- success: {
447
- request: {
448
- kind: 'hits',
449
- clientParameters: {
450
- user_query: 'no-preview',
451
- sort: [],
452
- },
453
- backendRequests: {
454
- primary: {
455
- kind: 'hits',
456
- finalized_parameters: {
457
- user_query: 'no-preview',
458
- sort: [],
459
- },
460
- },
461
- },
462
- },
463
- rawResponse: {},
464
- sessionContext: {},
465
- response: {
466
- totalResults: 1,
467
- returnedCount: 1,
468
- results: [
469
- new ItemHit({
470
- fields: {
471
- identifier: 'foo',
472
- collection: ['foo', 'no-preview', 'bar'],
473
- },
474
- }),
475
- ],
476
- },
477
- responseHeader: {
478
- succeeded: true,
479
- query_time: 0,
480
- },
481
- },
482
- });
483
-
484
- export const getMockSuccessLoggedInAndNoPreviewResult: () => Result<
485
- SearchResponse,
486
- SearchServiceError
487
- > = () => ({
488
- success: {
489
- request: {
490
- kind: 'hits',
491
- clientParameters: {
492
- user_query: 'loggedin-no-preview',
493
- sort: [],
494
- },
495
- backendRequests: {
496
- primary: {
497
- kind: 'hits',
498
- finalized_parameters: {
499
- user_query: 'loggedin-no-preview',
500
- sort: [],
501
- },
502
- },
503
- },
504
- },
505
- rawResponse: {},
506
- sessionContext: {},
507
- response: {
508
- totalResults: 1,
509
- returnedCount: 1,
510
- results: [
511
- new ItemHit({
512
- fields: {
513
- identifier: 'foo',
514
- collection: ['foo', 'loggedin', 'no-preview', 'bar'],
515
- },
516
- }),
517
- ],
518
- },
519
- responseHeader: {
520
- succeeded: true,
521
- query_time: 0,
522
- },
523
- },
524
- });
525
-
526
- export const getMockSuccessFirstTitleResult: () => Result<
527
- SearchResponse,
528
- SearchServiceError
529
- > = () => ({
530
- success: {
531
- request: {
532
- kind: 'hits',
533
- clientParameters: {
534
- user_query: 'first-title',
535
- sort: ['title', 'asc'],
536
- },
537
- backendRequests: {
538
- primary: {
539
- kind: 'hits',
540
- finalized_parameters: {
541
- user_query: 'first-title',
542
- sort: ['title', 'asc'],
543
- },
544
- },
545
- },
546
- },
547
- rawResponse: {},
548
- sessionContext: {},
549
- response: {
550
- totalResults: 1,
551
- returnedCount: 1,
552
- aggregations: {
553
- firstTitle: new Aggregation({
554
- buckets: [{ key: 'X', doc_count: 1 }],
555
- }),
556
- },
557
- results: [
558
- new ItemHit({
559
- fields: {
560
- identifier: 'foo',
561
- },
562
- }),
563
- ],
564
- },
565
- responseHeader: {
566
- succeeded: true,
567
- query_time: 0,
568
- },
569
- },
570
- });
571
-
572
- export const getMockSuccessFirstCreatorResult: () => Result<
573
- SearchResponse,
574
- SearchServiceError
575
- > = () => ({
576
- success: {
577
- request: {
578
- kind: 'hits',
579
- clientParameters: {
580
- user_query: 'first-creator',
581
- sort: ['creator', 'asc'],
582
- },
583
- backendRequests: {
584
- primary: {
585
- kind: 'hits',
586
- finalized_parameters: {
587
- user_query: 'first-creator',
588
- sort: ['creator', 'asc'],
589
- },
590
- },
591
- },
592
- },
593
- rawResponse: {},
594
- sessionContext: {},
595
- response: {
596
- totalResults: 1,
597
- returnedCount: 1,
598
- aggregations: {
599
- firstCreator: new Aggregation({
600
- buckets: [{ key: 'X', doc_count: 1 }],
601
- }),
602
- },
603
- results: [
604
- new ItemHit({
605
- fields: {
606
- identifier: 'foo',
607
- },
608
- }),
609
- ],
610
- },
611
- responseHeader: {
612
- succeeded: true,
613
- query_time: 0,
614
- },
615
- },
616
- });
617
-
618
- export const getMockSuccessWithCollectionTitles: () => Result<
619
- SearchResponse,
620
- SearchServiceError
621
- > = () => ({
622
- success: {
623
- request: {
624
- kind: 'hits',
625
- clientParameters: {
626
- user_query: 'collection:foo',
627
- sort: [],
628
- },
629
- backendRequests: {
630
- primary: {
631
- kind: 'hits',
632
- finalized_parameters: {
633
- user_query: 'collection:foo',
634
- sort: [],
635
- },
636
- },
637
- },
638
- },
639
- rawResponse: {},
640
- sessionContext: {},
641
- response: {
642
- totalResults: 2,
643
- returnedCount: 2,
644
- results: [
645
- new ItemHit({
646
- fields: {
647
- identifier: 'foo',
648
- collection: ['foo', 'bar'],
649
- },
650
- }),
651
- new ItemHit({
652
- fields: {
653
- identifier: 'bar',
654
- collection: ['baz', 'boop'],
655
- },
656
- }),
657
- ],
658
- collectionTitles: {
659
- foo: 'Foo Collection',
660
- bar: 'Bar Collection',
661
- baz: 'Baz Collection',
662
- boop: 'Boop Collection',
663
- },
664
- },
665
- responseHeader: {
666
- succeeded: true,
667
- query_time: 0,
668
- },
669
- },
670
- });
671
-
672
- export const getMockSuccessWithChannelAliases: () => Result<
673
- SearchResponse,
674
- SearchServiceError
675
- > = () => ({
676
- success: {
677
- request: {
678
- kind: 'hits',
679
- clientParameters: {
680
- user_query: 'collection:foo',
681
- sort: [],
682
- },
683
- backendRequests: {
684
- primary: {
685
- kind: 'hits',
686
- finalized_parameters: {
687
- user_query: 'collection:foo',
688
- sort: [],
689
- },
690
- },
691
- },
692
- },
693
- rawResponse: {},
694
- sessionContext: {},
695
- response: {
696
- totalResults: 1,
697
- returnedCount: 1,
698
- results: [
699
- new TvClipHit({
700
- fields: {
701
- identifier: 'foo',
702
- creator: ['foo', 'bar'],
703
- },
704
- }),
705
- ],
706
- tvChannelAliases: {
707
- foo: 'Foo Network',
708
- bar: 'Bar Network',
709
- },
710
- },
711
- responseHeader: {
712
- succeeded: true,
713
- query_time: 0,
714
- },
715
- },
716
- });
717
-
718
- export const getMockSuccessWithCollectionAggregations: () => Result<
719
- SearchResponse,
720
- SearchServiceError
721
- > = () => ({
722
- success: {
723
- request: {
724
- kind: 'hits',
725
- clientParameters: {
726
- user_query: 'collection:foo',
727
- sort: [],
728
- },
729
- backendRequests: {
730
- primary: {
731
- kind: 'hits',
732
- finalized_parameters: {
733
- user_query: 'collection:foo',
734
- sort: [],
735
- },
736
- },
737
- },
738
- },
739
- rawResponse: {},
740
- sessionContext: {},
741
- response: {
742
- totalResults: 0,
743
- returnedCount: 0,
744
- results: [],
745
- aggregations: {
746
- collection: new Aggregation({
747
- buckets: [
748
- {
749
- key: 'foo',
750
- doc_count: 10,
751
- },
752
- {
753
- key: 'bar',
754
- doc_count: 10,
755
- },
756
- ],
757
- }),
758
- },
759
- collectionTitles: {
760
- foo: 'Foo',
761
- bar: 'Bar',
762
- },
763
- },
764
- responseHeader: {
765
- succeeded: true,
766
- query_time: 0,
767
- },
768
- },
769
- });
770
-
771
- export const getMockSuccessSingleResultWithSort: (
772
- resultsSpy: Function,
773
- ) => Result<SearchResponse, SearchServiceError> = (resultsSpy: Function) => ({
774
- success: {
775
- request: {
776
- kind: 'hits',
777
- clientParameters: {
778
- user_query: 'with-sort',
779
- sort: ['foo:asc'],
780
- },
781
- backendRequests: {
782
- primary: {
783
- kind: 'hits',
784
- finalized_parameters: {
785
- user_query: 'with-sort',
786
- sort: ['foo:asc'],
787
- },
788
- },
789
- },
790
- },
791
- rawResponse: {},
792
- sessionContext: {},
793
- response: {
794
- totalResults: 1,
795
- returnedCount: 1,
796
- get results() {
797
- resultsSpy();
798
- return [
799
- new ItemHit({
800
- fields: {
801
- identifier: 'foo',
802
- collection: ['foo', 'bar'],
803
- },
804
- }),
805
- ];
806
- },
807
- },
808
- responseHeader: {
809
- succeeded: true,
810
- query_time: 0,
811
- },
812
- },
813
- });
814
-
815
- export const getMockSuccessMultipleResults: () => Result<
816
- SearchResponse,
817
- SearchServiceError
818
- > = () => ({
819
- success: {
820
- request: {
821
- kind: 'hits',
822
- clientParameters: {
823
- user_query: 'collection:foo',
824
- sort: [],
825
- },
826
- backendRequests: {
827
- primary: {
828
- kind: 'hits',
829
- finalized_parameters: {
830
- user_query: 'collection:foo',
831
- sort: [],
832
- },
833
- },
834
- },
835
- },
836
- rawResponse: {},
837
- sessionContext: {},
838
- response: {
839
- totalResults: 2,
840
- returnedCount: 2,
841
- results: [
842
- new ItemHit({
843
- fields: {
844
- identifier: 'foo',
845
- collection: ['foo', 'bar'],
846
- __href__: '/foo',
847
- },
848
- }),
849
- new ItemHit({
850
- fields: {
851
- identifier: 'bar',
852
- collection: ['baz', 'boop'],
853
- __href__: '/bar',
854
- },
855
- }),
856
- ],
857
- },
858
- responseHeader: {
859
- succeeded: true,
860
- query_time: 0,
861
- },
862
- },
863
- });
864
-
865
- export const getMockSuccessNoResults: () => Result<
866
- SearchResponse,
867
- SearchServiceError
868
- > = () => ({
869
- success: {
870
- request: {
871
- kind: 'hits',
872
- clientParameters: {
873
- user_query: 'no-results',
874
- sort: [],
875
- },
876
- backendRequests: {
877
- primary: {
878
- kind: 'hits',
879
- finalized_parameters: {
880
- user_query: 'no-results',
881
- sort: [],
882
- },
883
- },
884
- },
885
- },
886
- rawResponse: {},
887
- sessionContext: {},
888
- response: {
889
- totalResults: 0,
890
- returnedCount: 0,
891
- results: [],
892
- },
893
- responseHeader: {
894
- succeeded: true,
895
- query_time: 0,
896
- },
897
- },
898
- });
899
-
900
- export const getMockSuccessMultiLineDescription: () => Result<
901
- SearchResponse,
902
- SearchServiceError
903
- > = () => ({
904
- success: {
905
- request: {
906
- kind: 'hits',
907
- clientParameters: {
908
- user_query: 'multi-line-description',
909
- sort: [],
910
- },
911
- backendRequests: {
912
- primary: {
913
- kind: 'hits',
914
- finalized_parameters: {
915
- user_query: 'multi-line-description',
916
- sort: [],
917
- },
918
- },
919
- },
920
- },
921
- rawResponse: {},
922
- sessionContext: {},
923
- response: {
924
- totalResults: 1,
925
- returnedCount: 1,
926
- results: [
927
- new ItemHit({
928
- fields: {
929
- identifier: 'foo',
930
- collection: ['foo', 'bar'],
931
- description: ['line1', 'line2'],
932
- },
933
- }),
934
- ],
935
- },
936
- responseHeader: {
937
- succeeded: true,
938
- query_time: 0,
939
- },
940
- },
941
- });
942
-
943
- export const getMockSuccessExtraQuotedHref: () => Result<
944
- SearchResponse,
945
- SearchServiceError
946
- > = () => ({
947
- success: {
948
- request: {
949
- kind: 'hits',
950
- clientParameters: {
951
- user_query: 'extra-quoted-href',
952
- sort: [],
953
- },
954
- backendRequests: {
955
- primary: {
956
- kind: 'hits',
957
- finalized_parameters: {
958
- user_query: 'extra-quoted-href',
959
- sort: [],
960
- },
961
- },
962
- },
963
- },
964
- rawResponse: {},
965
- sessionContext: {},
966
- response: {
967
- totalResults: 1,
968
- returnedCount: 1,
969
- results: [
970
- new TextHit({
971
- fields: {
972
- identifier: 'foo',
973
- title: 'Foo',
974
- __href__: '/details/foo?q=%22%22quoted+query%22%22',
975
- },
976
- }),
977
- ],
978
- },
979
- responseHeader: {
980
- succeeded: true,
981
- query_time: 0,
982
- },
983
- },
984
- });
985
-
986
- export const getMockSuccessWithDefaultSort: () => Result<
987
- SearchResponse,
988
- SearchServiceError
989
- > = () => ({
990
- success: {
991
- request: {
992
- kind: 'hits',
993
- clientParameters: {
994
- user_query: 'default-sort',
995
- sort: [],
996
- },
997
- backendRequests: {
998
- primary: {
999
- kind: 'hits',
1000
- finalized_parameters: {
1001
- user_query: 'default-sort',
1002
- sort: ['titleSorter', 'identifier'],
1003
- },
1004
- },
1005
- },
1006
- },
1007
- rawResponse: {},
1008
- sessionContext: {},
1009
- response: {
1010
- totalResults: 1,
1011
- returnedCount: 1,
1012
- results: [
1013
- new ItemHit({
1014
- fields: {
1015
- identifier: 'foo',
1016
- title: 'Foo',
1017
- },
1018
- }),
1019
- ],
1020
- collectionExtraInfo: {
1021
- public_metadata: {
1022
- 'sort-by': 'titleSorter',
1023
- },
1024
- },
1025
- },
1026
- responseHeader: {
1027
- succeeded: true,
1028
- query_time: 0,
1029
- },
1030
- },
1031
- });
1032
-
1033
- export const getMockSuccessWithConciseDefaultSort: () => Result<
1034
- SearchResponse,
1035
- SearchServiceError
1036
- > = () => ({
1037
- success: {
1038
- request: {
1039
- kind: 'hits',
1040
- clientParameters: {
1041
- user_query: 'default-sort-concise',
1042
- sort: [],
1043
- },
1044
- backendRequests: {
1045
- primary: {
1046
- kind: 'hits',
1047
- finalized_parameters: {
1048
- user_query: 'default-sort-concise',
1049
- sort: ['addeddate:desc', 'identifier'],
1050
- },
1051
- },
1052
- },
1053
- },
1054
- rawResponse: {},
1055
- sessionContext: {},
1056
- response: {
1057
- totalResults: 1,
1058
- returnedCount: 1,
1059
- results: [
1060
- new ItemHit({
1061
- fields: {
1062
- identifier: 'foo',
1063
- title: 'Foo',
1064
- },
1065
- }),
1066
- ],
1067
- collectionExtraInfo: {
1068
- public_metadata: {
1069
- 'sort-by': '-addeddate',
1070
- },
1071
- },
1072
- },
1073
- responseHeader: {
1074
- succeeded: true,
1075
- query_time: 0,
1076
- },
1077
- },
1078
- });
1079
-
1080
- export const getMockSuccessWithDefaultFavSort: () => Result<
1081
- SearchResponse,
1082
- SearchServiceError
1083
- > = () => ({
1084
- success: {
1085
- request: {
1086
- kind: 'hits',
1087
- clientParameters: {
1088
- user_query: 'fav-sort',
1089
- sort: [],
1090
- },
1091
- backendRequests: {
1092
- primary: {
1093
- kind: 'hits',
1094
- finalized_parameters: {
1095
- user_query: 'fav-sort',
1096
- sort: [],
1097
- },
1098
- },
1099
- },
1100
- },
1101
- rawResponse: {},
1102
- sessionContext: {},
1103
- response: {
1104
- totalResults: 1,
1105
- returnedCount: 1,
1106
- results: [
1107
- new ItemHit({
1108
- fields: {
1109
- identifier: 'foo',
1110
- title: 'Foo',
1111
- },
1112
- }),
1113
- ],
1114
- collectionExtraInfo: {
1115
- public_metadata: {
1116
- identifier: 'fav-foo',
1117
- },
1118
- },
1119
- },
1120
- responseHeader: {
1121
- succeeded: true,
1122
- query_time: 0,
1123
- },
1124
- },
1125
- });
1126
-
1127
- export const getMockSuccessWithParentCollections: () => Result<
1128
- SearchResponse,
1129
- SearchServiceError
1130
- > = () => ({
1131
- success: {
1132
- request: {
1133
- kind: 'hits',
1134
- clientParameters: {
1135
- user_query: 'parent-collections',
1136
- sort: [],
1137
- },
1138
- backendRequests: {
1139
- primary: {
1140
- kind: 'hits',
1141
- finalized_parameters: {
1142
- user_query: 'parent-collections',
1143
- sort: [],
1144
- },
1145
- },
1146
- },
1147
- },
1148
- rawResponse: {},
1149
- sessionContext: {},
1150
- response: {
1151
- totalResults: 1,
1152
- returnedCount: 1,
1153
- results: [
1154
- new ItemHit({
1155
- fields: {
1156
- identifier: 'foo',
1157
- title: 'Foo',
1158
- },
1159
- }),
1160
- ],
1161
- collectionExtraInfo: {
1162
- public_metadata: {
1163
- collection: ['foo', 'bar'],
1164
- },
1165
- },
1166
- },
1167
- responseHeader: {
1168
- succeeded: true,
1169
- query_time: 0,
1170
- },
1171
- },
1172
- });
1173
-
1174
- export const getMockSuccessForTvCollection: () => Result<
1175
- SearchResponse,
1176
- SearchServiceError
1177
- > = () => ({
1178
- success: {
1179
- request: {
1180
- kind: 'hits',
1181
- clientParameters: {
1182
- user_query: 'tv-collection',
1183
- sort: [],
1184
- },
1185
- backendRequests: {
1186
- primary: {
1187
- kind: 'hits',
1188
- finalized_parameters: {
1189
- user_query: 'tv-collection',
1190
- sort: [],
1191
- },
1192
- },
1193
- },
1194
- },
1195
- rawResponse: {},
1196
- sessionContext: {},
1197
- response: {
1198
- totalResults: 1,
1199
- returnedCount: 1,
1200
- results: [
1201
- new ItemHit({
1202
- fields: {
1203
- identifier: 'foo',
1204
- title: 'Foo',
1205
- },
1206
- }),
1207
- ],
1208
- collectionExtraInfo: {
1209
- public_metadata: {
1210
- identifier: 'TV-FOO',
1211
- collection: ['tvarchive'],
1212
- },
1213
- },
1214
- },
1215
- responseHeader: {
1216
- succeeded: true,
1217
- query_time: 0,
1218
- },
1219
- },
1220
- });
1221
-
1222
- export const getMockSuccessWithWebArchiveHits: () => Result<
1223
- SearchResponse,
1224
- SearchServiceError
1225
- > = () => ({
1226
- success: {
1227
- request: {
1228
- kind: 'hits',
1229
- clientParameters: {
1230
- user_query: 'web-archive',
1231
- sort: [],
1232
- },
1233
- backendRequests: {
1234
- primary: {
1235
- kind: 'hits',
1236
- finalized_parameters: {
1237
- user_query: 'web-archive',
1238
- sort: [],
1239
- },
1240
- },
1241
- },
1242
- },
1243
- rawResponse: {},
1244
- sessionContext: {},
1245
- response: {
1246
- totalResults: 1,
1247
- returnedCount: 1,
1248
- results: [
1249
- new WebArchiveHit({
1250
- fields: {
1251
- url: 'https://example.com',
1252
- capture_dates: ['2010-01-02T03:04:05Z'],
1253
- __href__:
1254
- 'https://web.archive.org/web/20100102030405/https%3A%2F%2Fexample.com',
1255
- },
1256
- }),
1257
- ],
1258
- },
1259
- responseHeader: {
1260
- succeeded: true,
1261
- query_time: 0,
1262
- },
1263
- },
1264
- });
1265
-
1266
- export const getMockSuccessWithManyAggregations: () => Result<
1267
- SearchResponse,
1268
- SearchServiceError
1269
- > = () => ({
1270
- success: {
1271
- request: {
1272
- kind: 'aggregations',
1273
- clientParameters: {
1274
- user_query: 'more-facets',
1275
- sort: [],
1276
- },
1277
- backendRequests: {
1278
- primary: {
1279
- kind: 'aggregations',
1280
- finalized_parameters: {
1281
- user_query: 'more-facets',
1282
- sort: [],
1283
- },
1284
- },
1285
- },
1286
- },
1287
- rawResponse: {},
1288
- sessionContext: {},
1289
- response: {
1290
- totalResults: 0,
1291
- returnedCount: 0,
1292
- results: [],
1293
- aggregations: {
1294
- year: new Aggregation({
1295
- buckets: [
1296
- { key: '1980', doc_count: 5 },
1297
- { key: '1981', doc_count: 6 },
1298
- { key: '1982', doc_count: 7 },
1299
- { key: '1983', doc_count: 8 },
1300
- { key: '1984', doc_count: 5 },
1301
- { key: '1985', doc_count: 6 },
1302
- { key: '1986', doc_count: 7 },
1303
- { key: '1987', doc_count: 8 },
1304
- { key: '1988', doc_count: 5 },
1305
- { key: '1989', doc_count: 6 },
1306
- { key: '1990', doc_count: 7 },
1307
- { key: '1991', doc_count: 8 },
1308
- { key: '1992', doc_count: 5 },
1309
- { key: '1993', doc_count: 6 },
1310
- { key: '1994', doc_count: 7 },
1311
- { key: '1995', doc_count: 8 },
1312
- { key: '1996', doc_count: 5 },
1313
- { key: '1997', doc_count: 6 },
1314
- { key: '1998', doc_count: 7 },
1315
- { key: '1999', doc_count: 8 },
1316
- { key: '2000', doc_count: 5 },
1317
- { key: '2001', doc_count: 6 },
1318
- { key: '2002', doc_count: 7 },
1319
- { key: '2003', doc_count: 8 },
1320
- { key: '2004', doc_count: 5 },
1321
- { key: '2005', doc_count: 6 },
1322
- { key: '2006', doc_count: 7 },
1323
- { key: '2007', doc_count: 8 },
1324
- { key: '2008', doc_count: 5 },
1325
- { key: '2009', doc_count: 6 },
1326
- { key: '2010', doc_count: 7 },
1327
- { key: '2011', doc_count: 8 },
1328
- { key: '2012', doc_count: 5 },
1329
- { key: '2013', doc_count: 6 },
1330
- { key: '2014', doc_count: 7 },
1331
- { key: '2015', doc_count: 8 },
1332
- { key: '2016', doc_count: 5 },
1333
- { key: '2017', doc_count: 6 },
1334
- { key: '2018', doc_count: 7 },
1335
- { key: '2019', doc_count: 8 },
1336
- { key: '2020', doc_count: 5 },
1337
- { key: '2021', doc_count: 6 },
1338
- { key: '2022', doc_count: 7 },
1339
- { key: '2023', doc_count: 8 },
1340
- { key: '2024', doc_count: 5 },
1341
- ],
1342
- }),
1343
- },
1344
- },
1345
- responseHeader: {
1346
- succeeded: true,
1347
- query_time: 0,
1348
- },
1349
- },
1350
- });
1351
-
1352
- export const getMockErrorResult: () => Result<
1353
- SearchResponse,
1354
- SearchServiceError
1355
- > = () => ({
1356
- error: new SearchServiceError(SearchServiceErrorType.networkError, 'foo', {
1357
- message: 'bar',
1358
- }),
1359
- });
1360
-
1361
- export const getMockMalformedResult: () => Result<
1362
- SearchResponse,
1363
- SearchServiceError
1364
- > = () => ({});