@internetarchive/collection-browser 4.7.0 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (453) hide show
  1. package/.husky/pre-commit +0 -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-facets/facet-row-template.d.ts +38 -0
  8. package/dist/src/collection-facets/facet-row-template.js +200 -0
  9. package/dist/src/collection-facets/facet-row-template.js.map +1 -0
  10. package/dist/src/collection-facets/facet-row.js +11 -186
  11. package/dist/src/collection-facets/facet-row.js.map +1 -1
  12. package/dist/src/collection-facets/models.d.ts +7 -2
  13. package/dist/src/collection-facets/models.js +7 -2
  14. package/dist/src/collection-facets/models.js.map +1 -1
  15. package/dist/src/collection-facets/more-facets-content.d.ts +87 -21
  16. package/dist/src/collection-facets/more-facets-content.js +477 -200
  17. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  18. package/dist/src/collection-facets/more-facets-scroller.d.ts +85 -0
  19. package/dist/src/collection-facets/more-facets-scroller.js +428 -0
  20. package/dist/src/collection-facets/more-facets-scroller.js.map +1 -0
  21. package/dist/src/collection-facets/page-window.d.ts +73 -0
  22. package/dist/src/collection-facets/page-window.js +202 -0
  23. package/dist/src/collection-facets/page-window.js.map +1 -0
  24. package/dist/src/collection-facets/toggle-switch.js +1 -0
  25. package/dist/src/collection-facets/toggle-switch.js.map +1 -1
  26. package/dist/src/models.d.ts +4 -0
  27. package/dist/src/models.js +16 -0
  28. package/dist/src/models.js.map +1 -1
  29. package/dist/src/utils/log.d.ts +1 -4
  30. package/dist/src/utils/normalize-filter-text.d.ts +28 -0
  31. package/dist/src/utils/normalize-filter-text.js +35 -0
  32. package/dist/src/utils/normalize-filter-text.js.map +1 -0
  33. package/dist/test/collection-facets/more-facets-content.test.js +367 -17
  34. package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
  35. package/dist/test/collection-facets/more-facets-scroller.test.d.ts +1 -0
  36. package/dist/test/collection-facets/more-facets-scroller.test.js +288 -0
  37. package/dist/test/collection-facets/more-facets-scroller.test.js.map +1 -0
  38. package/dist/test/collection-facets/page-window.test.d.ts +1 -0
  39. package/dist/test/collection-facets/page-window.test.js +175 -0
  40. package/dist/test/collection-facets/page-window.test.js.map +1 -0
  41. package/dist/test/mocks/mock-search-responses.d.ts +6 -0
  42. package/dist/test/mocks/mock-search-responses.js +52 -0
  43. package/dist/test/mocks/mock-search-responses.js.map +1 -1
  44. package/dist/test/mocks/mock-search-service.js +2 -1
  45. package/dist/test/mocks/mock-search-service.js.map +1 -1
  46. package/dist/test/utils/normalize-filter-text.test.d.ts +1 -0
  47. package/dist/test/utils/normalize-filter-text.test.js +69 -0
  48. package/dist/test/utils/normalize-filter-text.test.js.map +1 -0
  49. package/docs/design/column-virtualization.md +214 -0
  50. package/package.json +20 -16
  51. package/src/app-root.ts +0 -2
  52. package/src/assets/img/icons/check.ts +5 -0
  53. package/src/collection-facets/facet-row-template.ts +242 -0
  54. package/src/collection-facets/facet-row.ts +15 -202
  55. package/src/collection-facets/models.ts +8 -2
  56. package/src/collection-facets/more-facets-content.ts +528 -221
  57. package/src/collection-facets/more-facets-scroller.ts +485 -0
  58. package/src/collection-facets/page-window.ts +247 -0
  59. package/src/collection-facets/toggle-switch.ts +1 -0
  60. package/src/models.ts +17 -0
  61. package/src/utils/normalize-filter-text.ts +54 -0
  62. package/test/collection-facets/more-facets-content.test.ts +509 -24
  63. package/test/collection-facets/more-facets-scroller.test.ts +401 -0
  64. package/test/collection-facets/page-window.test.ts +208 -0
  65. package/test/mocks/mock-search-responses.ts +56 -0
  66. package/test/mocks/mock-search-service.ts +2 -0
  67. package/test/utils/normalize-filter-text.test.ts +87 -0
  68. package/web-test-runner.config.mjs +7 -2
  69. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.editorconfig +0 -29
  70. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.github/workflows/ci.yml +0 -27
  71. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.github/workflows/gh-pages-main.yml +0 -39
  72. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.github/workflows/npm-publish.yml +0 -39
  73. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.github/workflows/pr-preview.yml +0 -38
  74. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.husky/pre-commit +0 -1
  75. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/.prettierignore +0 -1
  76. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/LICENSE +0 -661
  77. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/README.md +0 -84
  78. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/eslint.config.mjs +0 -53
  79. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/index.html +0 -24
  80. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/index.ts +0 -29
  81. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/local.archive.org.cert +0 -86
  82. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/local.archive.org.key +0 -27
  83. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/package.json +0 -120
  84. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/renovate.json +0 -6
  85. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/app-root.ts +0 -1284
  86. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/arrow-left.ts +0 -10
  87. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/arrow-right.ts +0 -10
  88. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/chevron.ts +0 -4
  89. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/close-circle-dark.ts +0 -5
  90. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/contract.ts +0 -9
  91. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/empty-query.ts +0 -5
  92. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/expand.ts +0 -9
  93. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/eye-closed.ts +0 -5
  94. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/eye.ts +0 -5
  95. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/favorite-filled.ts +0 -10
  96. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/favorite-unfilled.ts +0 -9
  97. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/filter.ts +0 -10
  98. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/login-required.ts +0 -18
  99. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/account.ts +0 -14
  100. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/audio.ts +0 -14
  101. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/collection.ts +0 -12
  102. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/data.ts +0 -15
  103. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/etree.ts +0 -14
  104. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/film.ts +0 -14
  105. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/images.ts +0 -13
  106. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/radio.ts +0 -15
  107. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/search.ts +0 -14
  108. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/software.ts +0 -13
  109. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/texts.ts +0 -13
  110. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
  111. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
  112. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
  113. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/tv.ts +0 -14
  114. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/video.ts +0 -14
  115. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/mediatype/web.ts +0 -13
  116. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/null-result.ts +0 -5
  117. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/quote.ts +0 -7
  118. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/restricted.ts +0 -13
  119. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/reviews.ts +0 -11
  120. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/upload.ts +0 -12
  121. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/assets/img/icons/views.ts +0 -11
  122. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/circular-activity-indicator.ts +0 -64
  123. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-browser.ts +0 -3165
  124. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/facet-row.ts +0 -309
  125. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/facet-tombstone-row.ts +0 -40
  126. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/facets-template.ts +0 -85
  127. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/models.ts +0 -10
  128. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/more-facets-content.ts +0 -644
  129. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/more-facets-pagination.ts +0 -294
  130. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/dedupe.ts +0 -44
  131. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
  132. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
  133. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
  134. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
  135. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
  136. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
  137. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/models.ts +0 -36
  138. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
  139. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
  140. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
  141. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
  142. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
  143. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets/toggle-switch.ts +0 -174
  144. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/collection-facets.ts +0 -1013
  145. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/data-source/collection-browser-data-source-interface.ts +0 -351
  146. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/data-source/collection-browser-data-source.ts +0 -1474
  147. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/data-source/collection-browser-query-state.ts +0 -60
  148. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/data-source/models.ts +0 -56
  149. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/empty-placeholder.ts +0 -192
  150. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/expanded-date-picker.ts +0 -191
  151. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/language-code-handler/language-code-handler.ts +0 -64
  152. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/language-code-handler/language-code-mapping.ts +0 -564
  153. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/manage/manage-bar.ts +0 -276
  154. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/manage/remove-items-modal-content.ts +0 -102
  155. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/mediatype/mediatype-config.ts +0 -146
  156. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/models.ts +0 -895
  157. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/restoration-state-handler.ts +0 -550
  158. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
  159. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/alpha-bar.ts +0 -252
  160. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/compact.ts +0 -5
  161. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/list.ts +0 -5
  162. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
  163. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
  164. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
  165. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/sort-triangle.ts +0 -5
  166. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/img/tile.ts +0 -5
  167. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/sort-filter-bar/sort-filter-bar.ts +0 -733
  168. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/styles/ia-button.ts +0 -139
  169. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/styles/item-image-styles.ts +0 -124
  170. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/styles/sr-only.ts +0 -18
  171. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/styles/tile-action-styles.ts +0 -59
  172. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/base-tile-component.ts +0 -124
  173. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/collection-browser-loading-tile.ts +0 -26
  174. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/account-tile.ts +0 -113
  175. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/collection-tile.ts +0 -184
  176. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/item-tile.ts +0 -347
  177. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/search-tile.ts +0 -90
  178. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
  179. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/grid/tile-stats.ts +0 -211
  180. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/hover/hover-pane-controller.ts +0 -638
  181. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/hover/tile-hover-pane.ts +0 -184
  182. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/image-block.ts +0 -162
  183. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/item-image.ts +0 -214
  184. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/list/tile-list-compact-header.ts +0 -112
  185. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/list/tile-list-compact.ts +0 -278
  186. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/list/tile-list.ts +0 -718
  187. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/models.ts +0 -21
  188. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/overlay/icon-overlay.ts +0 -57
  189. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/overlay/text-overlay.ts +0 -79
  190. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/review-block.ts +0 -130
  191. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/text-snippet-block.ts +0 -132
  192. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/tile-dispatcher.ts +0 -637
  193. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/tile-display-value-provider.ts +0 -133
  194. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/tiles/tile-mediatype-icon.ts +0 -133
  195. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/analytics-events.ts +0 -29
  196. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/array-equals.ts +0 -8
  197. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/collapse-repeated-quotes.ts +0 -13
  198. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/date-filter-field.ts +0 -11
  199. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/facet-utils.ts +0 -183
  200. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/format-count.ts +0 -95
  201. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/format-date.ts +0 -62
  202. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/format-unit-size.ts +0 -43
  203. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/local-date-from-utc.ts +0 -15
  204. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/log.ts +0 -14
  205. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/resolve-mediatype.ts +0 -26
  206. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/src/utils/sha1.ts +0 -9
  207. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-browser.test.ts +0 -2639
  208. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/facet-row.test.ts +0 -421
  209. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/facets-template.test.ts +0 -139
  210. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/more-facets-content.test.ts +0 -231
  211. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/more-facets-pagination.test.ts +0 -201
  212. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets/toggle-switch.test.ts +0 -164
  213. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/collection-facets.test.ts +0 -928
  214. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/data-source/collection-browser-data-source.test.ts +0 -193
  215. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/empty-placeholder.test.ts +0 -88
  216. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/expanded-date-picker.test.ts +0 -201
  217. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/icon-overlay.test.ts +0 -38
  218. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/image-block.test.ts +0 -247
  219. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/item-image.test.ts +0 -220
  220. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/manage/manage-bar.test.ts +0 -347
  221. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/manage/remove-items-modal-content.test.ts +0 -81
  222. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/mediatype-config.test.ts +0 -11
  223. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/mocks/mock-analytics-handler.ts +0 -30
  224. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/mocks/mock-search-responses.ts +0 -1364
  225. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/mocks/mock-search-service.ts +0 -134
  226. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/restoration-state-handler.test.ts +0 -480
  227. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/review-block.test.ts +0 -62
  228. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
  229. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/sort-filter-bar/alpha-bar.test.ts +0 -101
  230. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/sort-filter-bar/sort-filter-bar.test.ts +0 -443
  231. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/text-overlay.test.ts +0 -55
  232. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/text-snippet-block.test.ts +0 -85
  233. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tile-stats.test.ts +0 -191
  234. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/grid/account-tile.test.ts +0 -121
  235. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/grid/collection-tile.test.ts +0 -114
  236. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/grid/item-tile.test.ts +0 -520
  237. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/grid/search-tile.test.ts +0 -75
  238. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/hover/hover-pane-controller.test.ts +0 -482
  239. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/hover/tile-hover-pane.test.ts +0 -80
  240. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/list/tile-list-compact-header.test.ts +0 -43
  241. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/list/tile-list-compact.test.ts +0 -282
  242. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/list/tile-list.test.ts +0 -576
  243. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/tile-dispatcher.test.ts +0 -320
  244. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/tile-display-value-provider.test.ts +0 -172
  245. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/tiles/tile-mediatype-icon.test.ts +0 -160
  246. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/array-equals.test.ts +0 -31
  247. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/format-count.test.ts +0 -32
  248. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/format-date.test.ts +0 -89
  249. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/format-unit-size.test.ts +0 -21
  250. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/test/utils/local-date-from-utc.test.ts +0 -37
  251. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/tsconfig.json +0 -25
  252. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/types/dompurify.d.ts +0 -1
  253. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/vite.config.ts +0 -29
  254. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/web-dev-server.config.mjs +0 -30
  255. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/web-test-runner.config.mjs +0 -52
  256. package/.claude/worktrees/WEBDEV-8677-bump-field-parsers/yarn.lock +0 -5965
  257. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.editorconfig +0 -29
  258. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.github/workflows/ci.yml +0 -29
  259. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.github/workflows/gh-pages-main.yml +0 -41
  260. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.github/workflows/npm-publish.yml +0 -49
  261. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.github/workflows/pr-preview.yml +0 -40
  262. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.husky/pre-commit +0 -1
  263. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/.prettierignore +0 -1
  264. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/LICENSE +0 -661
  265. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/README.md +0 -68
  266. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/eslint.config.mjs +0 -53
  267. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/index.html +0 -24
  268. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/index.ts +0 -29
  269. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/local.archive.org.cert +0 -86
  270. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/local.archive.org.key +0 -27
  271. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/package.json +0 -129
  272. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/pnpm-lock.yaml +0 -7366
  273. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/pnpm-workspace.yaml +0 -46
  274. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/renovate.json +0 -6
  275. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/app-root.ts +0 -1284
  276. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/arrow-left.ts +0 -10
  277. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/arrow-right.ts +0 -10
  278. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/chevron.ts +0 -4
  279. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/close-circle-dark.ts +0 -5
  280. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/contract.ts +0 -9
  281. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/empty-query.ts +0 -5
  282. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/expand.ts +0 -9
  283. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/eye-closed.ts +0 -5
  284. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/eye.ts +0 -5
  285. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/favorite-filled.ts +0 -10
  286. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/favorite-unfilled.ts +0 -9
  287. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/filter.ts +0 -10
  288. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/login-required.ts +0 -18
  289. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/account.ts +0 -14
  290. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/audio.ts +0 -14
  291. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/collection.ts +0 -12
  292. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/data.ts +0 -15
  293. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/etree.ts +0 -14
  294. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/film.ts +0 -14
  295. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/images.ts +0 -13
  296. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/radio.ts +0 -15
  297. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/search.ts +0 -14
  298. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/software.ts +0 -13
  299. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/texts.ts +0 -13
  300. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
  301. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
  302. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
  303. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/tv.ts +0 -14
  304. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/video.ts +0 -14
  305. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/mediatype/web.ts +0 -13
  306. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/null-result.ts +0 -5
  307. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/quote.ts +0 -7
  308. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/restricted.ts +0 -13
  309. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/reviews.ts +0 -11
  310. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/upload.ts +0 -12
  311. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/assets/img/icons/views.ts +0 -11
  312. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/circular-activity-indicator.ts +0 -64
  313. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-browser.ts +0 -3165
  314. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/facet-row.ts +0 -309
  315. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/facet-tombstone-row.ts +0 -40
  316. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/facets-template.ts +0 -85
  317. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/models.ts +0 -10
  318. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/more-facets-content.ts +0 -644
  319. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/more-facets-pagination.ts +0 -294
  320. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/dedupe.ts +0 -44
  321. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
  322. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
  323. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
  324. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
  325. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
  326. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
  327. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/models.ts +0 -36
  328. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
  329. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
  330. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
  331. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
  332. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
  333. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets/toggle-switch.ts +0 -174
  334. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/collection-facets.ts +0 -1013
  335. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/data-source/collection-browser-data-source-interface.ts +0 -351
  336. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/data-source/collection-browser-data-source.ts +0 -1474
  337. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/data-source/collection-browser-query-state.ts +0 -60
  338. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/data-source/models.ts +0 -56
  339. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/empty-placeholder.ts +0 -192
  340. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/expanded-date-picker.ts +0 -191
  341. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/language-code-handler/language-code-handler.ts +0 -64
  342. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/language-code-handler/language-code-mapping.ts +0 -564
  343. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/manage/manage-bar.ts +0 -276
  344. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/manage/remove-items-modal-content.ts +0 -102
  345. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/mediatype/mediatype-config.ts +0 -146
  346. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/models.ts +0 -895
  347. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/restoration-state-handler.ts +0 -550
  348. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
  349. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/alpha-bar.ts +0 -252
  350. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/compact.ts +0 -5
  351. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/list.ts +0 -5
  352. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
  353. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
  354. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
  355. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/sort-triangle.ts +0 -5
  356. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/img/tile.ts +0 -5
  357. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/sort-filter-bar/sort-filter-bar.ts +0 -733
  358. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/styles/ia-button.ts +0 -139
  359. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/styles/item-image-styles.ts +0 -124
  360. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/styles/sr-only.ts +0 -18
  361. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/styles/tile-action-styles.ts +0 -59
  362. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/base-tile-component.ts +0 -124
  363. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/collection-browser-loading-tile.ts +0 -26
  364. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/account-tile.ts +0 -113
  365. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/collection-tile.ts +0 -184
  366. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/item-tile.ts +0 -347
  367. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/search-tile.ts +0 -90
  368. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
  369. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/grid/tile-stats.ts +0 -211
  370. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/hover/hover-pane-controller.ts +0 -638
  371. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/hover/tile-hover-pane.ts +0 -184
  372. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/image-block.ts +0 -162
  373. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/item-image.ts +0 -214
  374. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/list/tile-list-compact-header.ts +0 -112
  375. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/list/tile-list-compact.ts +0 -278
  376. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/list/tile-list.ts +0 -718
  377. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/models.ts +0 -21
  378. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/overlay/icon-overlay.ts +0 -57
  379. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/overlay/text-overlay.ts +0 -79
  380. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/review-block.ts +0 -130
  381. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/text-snippet-block.ts +0 -132
  382. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/tile-dispatcher.ts +0 -637
  383. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/tile-display-value-provider.ts +0 -133
  384. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/tiles/tile-mediatype-icon.ts +0 -133
  385. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/analytics-events.ts +0 -29
  386. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/array-equals.ts +0 -8
  387. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/collapse-repeated-quotes.ts +0 -13
  388. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/date-filter-field.ts +0 -11
  389. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/facet-utils.ts +0 -183
  390. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/format-count.ts +0 -95
  391. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/format-date.ts +0 -62
  392. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/format-unit-size.ts +0 -43
  393. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/local-date-from-utc.ts +0 -15
  394. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/log.ts +0 -14
  395. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/resolve-mediatype.ts +0 -26
  396. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/src/utils/sha1.ts +0 -9
  397. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-browser.test.ts +0 -2639
  398. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/facet-row.test.ts +0 -421
  399. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/facets-template.test.ts +0 -139
  400. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/more-facets-content.test.ts +0 -231
  401. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/more-facets-pagination.test.ts +0 -201
  402. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets/toggle-switch.test.ts +0 -164
  403. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/collection-facets.test.ts +0 -928
  404. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/data-source/collection-browser-data-source.test.ts +0 -193
  405. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/empty-placeholder.test.ts +0 -88
  406. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/expanded-date-picker.test.ts +0 -201
  407. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/icon-overlay.test.ts +0 -38
  408. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/image-block.test.ts +0 -247
  409. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/item-image.test.ts +0 -220
  410. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/manage/manage-bar.test.ts +0 -347
  411. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/manage/remove-items-modal-content.test.ts +0 -81
  412. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/mediatype-config.test.ts +0 -11
  413. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/mocks/mock-analytics-handler.ts +0 -30
  414. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/mocks/mock-search-responses.ts +0 -1364
  415. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/mocks/mock-search-service.ts +0 -134
  416. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/restoration-state-handler.test.ts +0 -480
  417. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/review-block.test.ts +0 -62
  418. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
  419. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/sort-filter-bar/alpha-bar.test.ts +0 -101
  420. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/sort-filter-bar/sort-filter-bar.test.ts +0 -443
  421. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/text-overlay.test.ts +0 -55
  422. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/text-snippet-block.test.ts +0 -85
  423. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tile-stats.test.ts +0 -191
  424. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/grid/account-tile.test.ts +0 -121
  425. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/grid/collection-tile.test.ts +0 -114
  426. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/grid/item-tile.test.ts +0 -520
  427. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/grid/search-tile.test.ts +0 -75
  428. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/hover/hover-pane-controller.test.ts +0 -482
  429. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/hover/tile-hover-pane.test.ts +0 -80
  430. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/list/tile-list-compact-header.test.ts +0 -43
  431. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/list/tile-list-compact.test.ts +0 -282
  432. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/list/tile-list.test.ts +0 -576
  433. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/tile-dispatcher.test.ts +0 -320
  434. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/tile-display-value-provider.test.ts +0 -172
  435. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/tiles/tile-mediatype-icon.test.ts +0 -160
  436. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/array-equals.test.ts +0 -31
  437. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/format-count.test.ts +0 -32
  438. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/format-date.test.ts +0 -89
  439. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/format-unit-size.test.ts +0 -21
  440. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/test/utils/local-date-from-utc.test.ts +0 -37
  441. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/tsconfig.json +0 -25
  442. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/types/dompurify.d.ts +0 -1
  443. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/vite.config.ts +0 -29
  444. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/web-dev-server.config.mjs +0 -30
  445. package/.claude/worktrees/WEBDEV-9127-fix-publish-dist-tag/web-test-runner.config.mjs +0 -52
  446. package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -36
  447. package/dist/src/collection-facets/more-facets-pagination.js +0 -260
  448. package/dist/src/collection-facets/more-facets-pagination.js.map +0 -1
  449. package/dist/test/collection-facets/more-facets-pagination.test.d.ts +0 -1
  450. package/dist/test/collection-facets/more-facets-pagination.test.js +0 -126
  451. package/dist/test/collection-facets/more-facets-pagination.test.js.map +0 -1
  452. package/src/collection-facets/more-facets-pagination.ts +0 -294
  453. package/test/collection-facets/more-facets-pagination.test.ts +0 -201
@@ -1,895 +0,0 @@
1
- import type { TemplateResult } from 'lit';
2
- import { msg } from '@lit/localize';
3
- import type { MediaType } from '@internetarchive/field-parsers';
4
- import {
5
- AggregationSortType,
6
- HitType,
7
- SearchReview,
8
- SearchResult,
9
- SortDirection,
10
- } from '@internetarchive/search-service';
11
- import { collapseRepeatedQuotes } from './utils/collapse-repeated-quotes';
12
- import { resolveMediatype } from './utils/resolve-mediatype';
13
-
14
- import { loginRequiredIcon } from './assets/img/icons/login-required';
15
- import { restrictedIcon } from './assets/img/icons/restricted';
16
-
17
- /**
18
- * Flags that can affect the visibility of content on a tile
19
- */
20
- interface TileFlags {
21
- loginRequired: boolean;
22
- contentWarning: boolean;
23
- }
24
-
25
- /**
26
- * Different types of tile overlays, corresponding to the above flags.
27
- */
28
- export type TileOverlayType = 'login-required' | 'content-warning';
29
-
30
- export const TILE_OVERLAY_TEXT: Record<TileOverlayType, string> = {
31
- 'login-required': msg('Log in to view this item'),
32
- 'content-warning': msg('Content may be inappropriate'),
33
- };
34
-
35
- export const TILE_OVERLAY_ICONS: Record<TileOverlayType, TemplateResult> = {
36
- 'login-required': loginRequiredIcon,
37
- 'content-warning': restrictedIcon,
38
- };
39
-
40
- /**
41
- * What type of request produced a given set of hits:
42
- * - `search_query`: Hits produced by an explicit user query and/or applied filters on any page
43
- * - `collection_members`: Hits produced for a collection page without any query or filters
44
- * - `profile_tab`: Hits produced for a tab of the profile page without any query or filters
45
- * - `unknown`: Hits produced via any other means
46
- */
47
- export type HitRequestSource =
48
- | 'search_query'
49
- | 'collection_members'
50
- | 'profile_tab'
51
- | 'unknown';
52
-
53
- /**
54
- * Class for converting & storing raw search results in the correct format for UI tiles.
55
- */
56
- export class TileModel {
57
- /** For TV hits. List of identifiers for any commercials contained. */
58
- adIds?: string[];
59
-
60
- averageRating?: number;
61
-
62
- /** For Web Archive hits on profile pages. List of capture dates for the current URL. */
63
- captureDates?: Date[];
64
-
65
- /** Whether this tile is currently checked for item management functions */
66
- checked: boolean;
67
-
68
- collectionIdentifier?: string;
69
-
70
- collectionName?: string;
71
-
72
- collectionFilesCount: number;
73
-
74
- collections: string[];
75
-
76
- collectionSize: number;
77
-
78
- commentCount: number;
79
-
80
- creator?: string;
81
-
82
- creators: string[];
83
-
84
- /** A string representation of the publication date, used strictly for passing preformatted dates to the parent */
85
- dateStr?: string;
86
-
87
- /** Date added to public search (software-defined) [from MD field: addeddate] */
88
- dateAdded?: Date;
89
-
90
- /** Date archived (software-defined) item created on archive.org [from MD field: publicdate] */
91
- dateArchived?: Date;
92
-
93
- /** Date work published in the world (user-defined) [from MD field: date] */
94
- datePublished?: Date;
95
-
96
- /** Date reviewed (user-created) most recent review [from MD field: reviewdate] */
97
- dateReviewed?: Date;
98
-
99
- description?: string;
100
-
101
- /** For TV hits. List of URLs for any fact-checks of the contained clips. */
102
- factChecks?: string[];
103
-
104
- favCount: number;
105
-
106
- hitRequestSource: HitRequestSource;
107
-
108
- hitType?: HitType;
109
-
110
- href?: string;
111
-
112
- identifier?: string;
113
-
114
- /** Whether this model represents a TV clip */
115
- isClip?: boolean;
116
-
117
- issue?: string;
118
-
119
- itemCount: number;
120
-
121
- mediatype: MediaType;
122
-
123
- review?: SearchReview;
124
-
125
- source?: string;
126
-
127
- snippets?: string[];
128
-
129
- subjects: string[];
130
-
131
- thumbnailUrl?: string;
132
-
133
- title: string;
134
-
135
- tvClipCount?: number;
136
-
137
- viewCount?: number;
138
-
139
- volume?: string;
140
-
141
- weeklyViewCount?: number;
142
-
143
- loginRequired: boolean;
144
-
145
- contentWarning: boolean;
146
-
147
- constructor(
148
- result: SearchResult,
149
- hitRequestSource: HitRequestSource = 'unknown',
150
- ) {
151
- const flags = this.getFlags(result);
152
-
153
- this.adIds = result.ad_id?.values;
154
- this.averageRating = result.avg_rating?.value;
155
- this.captureDates = result.capture_dates?.values;
156
- this.checked = false;
157
- this.collections = result.collection?.values ?? [];
158
- this.collectionFilesCount = result.collection_files_count?.value ?? 0;
159
- this.collectionSize = result.collection_size?.value ?? 0;
160
- this.commentCount = result.num_reviews?.value ?? 0;
161
- this.creator = result.creator?.value;
162
- this.creators = result.creator?.values ?? [];
163
- this.dateAdded = result.addeddate?.value;
164
- this.dateArchived = result.publicdate?.value;
165
- this.datePublished = result.date?.value;
166
- this.dateReviewed = result.reviewdate?.value;
167
- this.description = result.description?.values.join('\n');
168
- this.factChecks = result.factcheck?.values;
169
- this.favCount = result.num_favorites?.value ?? 0;
170
- this.hitRequestSource = hitRequestSource;
171
- this.hitType = result.rawMetadata?.hit_type;
172
- this.href = collapseRepeatedQuotes(
173
- result.review?.__href__ ?? result.__href__?.value,
174
- );
175
- this.identifier = TileModel.cleanIdentifier(result.identifier);
176
- this.isClip = result.is_clip?.value;
177
- this.issue = result.issue?.value;
178
- this.itemCount = result.item_count?.value ?? 0;
179
- this.mediatype = resolveMediatype(result);
180
- this.review = result.review;
181
- this.snippets = result.highlight?.values ?? [];
182
- this.source = result.source?.value;
183
- this.subjects = result.subject?.values ?? [];
184
- this.thumbnailUrl = result.__img__?.value;
185
- this.title = result.title?.value ?? '';
186
- this.tvClipCount = result.num_clips?.value ?? 0;
187
- this.volume = result.volume?.value;
188
- this.viewCount = result.downloads?.value;
189
- this.weeklyViewCount = result.week?.value;
190
- this.loginRequired = flags.loginRequired;
191
- this.contentWarning = flags.contentWarning;
192
- }
193
-
194
- /**
195
- * Copies the contents of this TileModel onto a new instance
196
- */
197
- clone(): TileModel {
198
- const cloned = new TileModel({});
199
- cloned.adIds = this.adIds;
200
- cloned.averageRating = this.averageRating;
201
- cloned.captureDates = this.captureDates;
202
- cloned.checked = this.checked;
203
- cloned.collections = this.collections;
204
- cloned.collectionFilesCount = this.collectionFilesCount;
205
- cloned.collectionSize = this.collectionSize;
206
- cloned.commentCount = this.commentCount;
207
- cloned.creator = this.creator;
208
- cloned.creators = this.creators;
209
- cloned.dateStr = this.dateStr;
210
- cloned.dateAdded = this.dateAdded;
211
- cloned.dateArchived = this.dateArchived;
212
- cloned.datePublished = this.datePublished;
213
- cloned.dateReviewed = this.dateReviewed;
214
- cloned.description = this.description;
215
- cloned.factChecks = this.factChecks;
216
- cloned.favCount = this.favCount;
217
- cloned.hitRequestSource = this.hitRequestSource;
218
- cloned.hitType = this.hitType;
219
- cloned.href = this.href;
220
- cloned.identifier = this.identifier;
221
- cloned.isClip = this.isClip;
222
- cloned.issue = this.issue;
223
- cloned.itemCount = this.itemCount;
224
- cloned.mediatype = this.mediatype;
225
- cloned.snippets = this.snippets;
226
- cloned.source = this.source;
227
- cloned.subjects = this.subjects;
228
- cloned.thumbnailUrl = this.thumbnailUrl;
229
- cloned.title = this.title;
230
- cloned.tvClipCount = this.tvClipCount;
231
- cloned.volume = this.volume;
232
- cloned.viewCount = this.viewCount;
233
- cloned.weeklyViewCount = this.weeklyViewCount;
234
- cloned.loginRequired = this.loginRequired;
235
- cloned.contentWarning = this.contentWarning;
236
- return cloned;
237
- }
238
-
239
- /**
240
- * Whether this model represents the result of a TV search query.
241
- */
242
- get isTvSearchResult(): boolean {
243
- return (
244
- this.hitType === 'tv_clip' && this.hitRequestSource === 'search_query'
245
- );
246
- }
247
-
248
- /**
249
- * Determines the appropriate tile flags for the given search result
250
- * (login required and/or content warning)
251
- */
252
- private getFlags(result: SearchResult): TileFlags {
253
- const flags: TileFlags = {
254
- loginRequired: false,
255
- contentWarning: false,
256
- };
257
-
258
- // Check if item and item in "modifying" collection, setting above flags
259
- if (
260
- result.collection?.values.length &&
261
- result.mediatype?.value !== 'collection'
262
- ) {
263
- for (const collection of result.collection?.values ?? []) {
264
- if (collection === 'loggedin') {
265
- flags.loginRequired = true;
266
- if (flags.contentWarning) break;
267
- }
268
- if (collection === 'no-preview') {
269
- flags.contentWarning = true;
270
- if (flags.loginRequired) break;
271
- }
272
- }
273
- }
274
-
275
- return flags;
276
- }
277
-
278
- private static cleanIdentifier(
279
- identifier: string | undefined,
280
- ): string | undefined {
281
- // Some identifiers (e.g., from Whisper) represent documents rather than items, and
282
- // are suffixed with values that need to be stripped. Those values are separated
283
- // from the item identifier itself with '|'.
284
- const barIndex = identifier?.indexOf('|') ?? -1;
285
- const cleaned = barIndex > 0 ? identifier?.slice(0, barIndex) : identifier;
286
- return cleaned;
287
- }
288
- }
289
-
290
- export type RequestKind = 'full' | 'hits' | 'aggregations';
291
-
292
- export type CollectionDisplayMode = 'grid' | 'list-compact' | 'list-detail';
293
-
294
- export type TileDisplayMode =
295
- | 'grid'
296
- | 'list-compact'
297
- | 'list-detail'
298
- | 'list-header';
299
-
300
- /**
301
- * This is mainly used to set the cookies for the collection display mode.
302
- *
303
- * It allows the user to set different modes for different contexts (collection page, search page, profile page etc).
304
- */
305
- export type CollectionBrowserContext = 'collection' | 'search' | 'profile';
306
-
307
- /**
308
- * The sort fields shown in the sort filter bar
309
- */
310
- export enum SortField {
311
- 'default' = 'default',
312
- 'unrecognized' = 'unrecognized',
313
- 'relevance' = 'relevance',
314
- 'alltimeview' = 'alltimeview',
315
- 'weeklyview' = 'weeklyview',
316
- 'title' = 'title',
317
- 'date' = 'date',
318
- 'datearchived' = 'datearchived',
319
- 'datereviewed' = 'datereviewed',
320
- 'dateadded' = 'dateadded',
321
- 'datefavorited' = 'datefavorited',
322
- 'creator' = 'creator',
323
- }
324
-
325
- /**
326
- * Views-related sort fields
327
- */
328
- export const ALL_VIEWS_SORT_FIELDS = [
329
- SortField.weeklyview,
330
- SortField.alltimeview,
331
- ] as const;
332
- export type ViewsSortField = (typeof ALL_VIEWS_SORT_FIELDS)[number];
333
-
334
- /**
335
- * Date-related sort fields
336
- */
337
- export const ALL_DATE_SORT_FIELDS = [
338
- SortField.datefavorited,
339
- SortField.date,
340
- SortField.datearchived,
341
- SortField.datereviewed,
342
- SortField.dateadded,
343
- ] as const;
344
- export type DateSortField = (typeof ALL_DATE_SORT_FIELDS)[number];
345
-
346
- export interface SortOption {
347
- /**
348
- * The SortField enum member corresponding to this option.
349
- */
350
- field: SortField;
351
-
352
- /**
353
- * The default sort direction to apply when this sort option is first selected.
354
- */
355
- defaultSortDirection: SortDirection | null;
356
-
357
- /**
358
- * Whether this sort option allows its sort direction to be changed from the default.
359
- */
360
- canSetDirection: boolean;
361
-
362
- /**
363
- * Whether this sort option may appear in the sort bar.
364
- */
365
- shownInSortBar: boolean;
366
-
367
- /**
368
- * Whether this sort option should be saved to the URL.
369
- * If false, then no `sort` param will be added to the URL when this sort option
370
- * is selected.
371
- */
372
- shownInURL: boolean;
373
-
374
- /**
375
- * Whether this sort option is passed to the search service.
376
- * If false, then no sort param will be passed to the search service at all when
377
- * this sort option is selected.
378
- */
379
- handledBySearchService: boolean;
380
-
381
- /**
382
- * The string identifying this sort field to the search service & backend API.
383
- */
384
- searchServiceKey?: string;
385
-
386
- /**
387
- * The human-readable name to use for this option in the sort bar (if applicable).
388
- */
389
- displayName: string;
390
-
391
- /**
392
- * A list of URL param keys that should be mapped to this sort option.
393
- * E.g., both `title` and `titleSorter` in the URL map to the `SortField.title` option.
394
- */
395
- urlNames: (string | null | undefined)[];
396
- }
397
-
398
- export const SORT_OPTIONS: Record<SortField, SortOption> = {
399
- // Default sort is the case where the user has not specified a sort option via the sort bar or URL.
400
- // In these cases, we defer to whatever sort the backend chooses.
401
- // For the search page, the default is always relevance sort.
402
- // For collection pages _without a query_, the default is usually weekly views, but this can be
403
- // overridden by the collection's `sort-by` metadata entry. If a query _is_ specified, then the
404
- // default is again relevance sort.
405
- // For fav-* collections only, the default is instead sorting by date favorited.
406
- [SortField.default]: {
407
- field: SortField.default,
408
- defaultSortDirection: null,
409
- canSetDirection: false,
410
- shownInSortBar: false,
411
- shownInURL: false,
412
- handledBySearchService: false, // We rely on the PPS default sort handling in these cases
413
- displayName: '',
414
- urlNames: ['', null, undefined], // Empty or nullish sort params result in default sorting
415
- },
416
- // Unrecognized sort is the case where the user has specified a sort in the URL, but it is not
417
- // one of the options listed in this map. We still want these unrecognized sorts to be applied
418
- // when searching, but they are not displayed in the sort bar and we do not actively manage
419
- // their URL param beyond flipping the direction as needed.
420
- [SortField.unrecognized]: {
421
- field: SortField.unrecognized,
422
- defaultSortDirection: null,
423
- canSetDirection: true,
424
- shownInSortBar: false,
425
- shownInURL: false,
426
- handledBySearchService: true, // The unrecognized sort param is passed along as-is
427
- displayName: '',
428
- urlNames: [],
429
- },
430
- // Relevance sort is unique in that it does not produce a URL param when it is set.
431
- // It is only available when there is a user-specified query that relevancy can be scored against.
432
- // Therefore, it does not appear as a sort bar option when browsing a collection with no query set.
433
- [SortField.relevance]: {
434
- field: SortField.relevance,
435
- defaultSortDirection: null,
436
- canSetDirection: false,
437
- shownInSortBar: true,
438
- shownInURL: false,
439
- handledBySearchService: false,
440
- displayName: 'Relevance',
441
- urlNames: ['_score'],
442
- },
443
- [SortField.alltimeview]: {
444
- field: SortField.alltimeview,
445
- defaultSortDirection: 'desc',
446
- canSetDirection: true,
447
- shownInSortBar: true,
448
- shownInURL: true,
449
- handledBySearchService: true,
450
- searchServiceKey: 'downloads',
451
- displayName: 'All-time views',
452
- urlNames: ['downloads'],
453
- },
454
- [SortField.weeklyview]: {
455
- field: SortField.weeklyview,
456
- defaultSortDirection: 'desc',
457
- canSetDirection: true,
458
- shownInSortBar: true,
459
- shownInURL: true,
460
- handledBySearchService: true,
461
- searchServiceKey: 'week',
462
- displayName: 'Weekly views',
463
- urlNames: ['week'],
464
- },
465
- [SortField.title]: {
466
- field: SortField.title,
467
- defaultSortDirection: 'asc',
468
- canSetDirection: true,
469
- shownInSortBar: true,
470
- shownInURL: true,
471
- handledBySearchService: true,
472
- searchServiceKey: 'titleSorter',
473
- displayName: 'Title',
474
- urlNames: ['title', 'titleSorter'],
475
- },
476
- [SortField.date]: {
477
- field: SortField.date,
478
- defaultSortDirection: 'desc',
479
- canSetDirection: true,
480
- shownInSortBar: true,
481
- shownInURL: true,
482
- handledBySearchService: true,
483
- searchServiceKey: 'date',
484
- displayName: 'Date published',
485
- urlNames: ['date'],
486
- },
487
- [SortField.datearchived]: {
488
- field: SortField.datearchived,
489
- defaultSortDirection: 'desc',
490
- canSetDirection: true,
491
- shownInSortBar: true,
492
- shownInURL: true,
493
- handledBySearchService: true,
494
- searchServiceKey: 'publicdate',
495
- displayName: 'Date archived',
496
- urlNames: ['publicdate'],
497
- },
498
- [SortField.datereviewed]: {
499
- field: SortField.datereviewed,
500
- defaultSortDirection: 'desc',
501
- canSetDirection: true,
502
- shownInSortBar: true,
503
- shownInURL: true,
504
- handledBySearchService: true,
505
- searchServiceKey: 'reviewdate',
506
- displayName: 'Date reviewed',
507
- urlNames: ['reviewdate'],
508
- },
509
- [SortField.dateadded]: {
510
- field: SortField.dateadded,
511
- defaultSortDirection: 'desc',
512
- canSetDirection: true,
513
- shownInSortBar: true,
514
- shownInURL: true,
515
- handledBySearchService: true,
516
- searchServiceKey: 'addeddate',
517
- displayName: 'Date added',
518
- urlNames: ['addeddate'],
519
- },
520
- [SortField.datefavorited]: {
521
- field: SortField.datefavorited,
522
- defaultSortDirection: 'desc',
523
- canSetDirection: false,
524
- shownInSortBar: true, // But only when viewing fav-* collections
525
- shownInURL: false,
526
- handledBySearchService: false,
527
- searchServiceKey: 'favoritedate',
528
- displayName: 'Date favorited',
529
- urlNames: ['favoritedate'],
530
- },
531
- [SortField.creator]: {
532
- field: SortField.creator,
533
- defaultSortDirection: 'asc',
534
- canSetDirection: true,
535
- shownInSortBar: true,
536
- shownInURL: true,
537
- handledBySearchService: true,
538
- searchServiceKey: 'creatorSorter',
539
- displayName: 'Creator',
540
- urlNames: ['creator', 'creatorSorter'],
541
- },
542
- };
543
-
544
- /**
545
- * Returns the SortOption corresponding to the given API sort name, or
546
- * the "unrecognized" SortOption if none matches.
547
- */
548
- export function sortOptionFromAPIString(sortName?: string | null): SortOption {
549
- return (
550
- Object.values(SORT_OPTIONS).find(opt =>
551
- opt.urlNames.some(name => sortName === name),
552
- ) ?? SORT_OPTIONS[SortField.unrecognized]
553
- );
554
- }
555
-
556
- export const defaultSortAvailability: Record<SortField, boolean> = {
557
- [SortField.relevance]: true,
558
- [SortField.weeklyview]: true,
559
- [SortField.alltimeview]: true,
560
- [SortField.title]: true,
561
- [SortField.datefavorited]: false,
562
- [SortField.date]: true,
563
- [SortField.datearchived]: true,
564
- [SortField.datereviewed]: true,
565
- [SortField.dateadded]: true,
566
- [SortField.creator]: true,
567
- [SortField.default]: false,
568
- [SortField.unrecognized]: false,
569
- };
570
-
571
- export const favoritesSortAvailability: Record<SortField, boolean> = {
572
- ...defaultSortAvailability,
573
- [SortField.datefavorited]: true,
574
- };
575
-
576
- export const tvSortAvailability: Record<SortField, boolean> = {
577
- ...defaultSortAvailability,
578
- [SortField.date]: false,
579
- [SortField.datereviewed]: false,
580
- [SortField.dateadded]: false,
581
- };
582
-
583
- export const defaultProfileElementSorts: Record<
584
- string,
585
- Exclude<SortField, SortField.default>
586
- > = {
587
- uploads: SortField.datearchived,
588
- reviews: SortField.datereviewed,
589
- collections: SortField.datearchived,
590
- web_archives: SortField.datearchived,
591
- favorites: SortField.datefavorited,
592
- };
593
-
594
- /** A union of the fields that permit prefix filtering (e.g., alphabetical filtering) */
595
- export type PrefixFilterType = 'title' | 'creator';
596
-
597
- /** A map from prefixes (e.g., initial letters) to the number of items matching that prefix */
598
- export type PrefixFilterCounts = Record<string, number>;
599
-
600
- /**
601
- * A map from prefix filter types to the corresponding aggregation keys
602
- * that are needed to fetch the filter counts from the backend.
603
- */
604
- export const prefixFilterAggregationKeys: Record<PrefixFilterType, string> = {
605
- title: 'firstTitle',
606
- creator: 'firstCreator',
607
- };
608
-
609
- /**
610
- * Different facet loading strategies that can be used with collection browser.
611
- * - `eager`: Facet data is always loaded as soon as a search is performed
612
- * - `lazy-mobile`: In the desktop layout, functions exactly as `eager`.
613
- * In the mobile layout, facet data will only be loaded once the "Filters" accordion is opened.
614
- * - `opt-in-or-login`: Same as `opt-in` for guest users not logged into an account, but same as `eager` for
615
- * any logged in user.
616
- * - `opt-in`: In the desktop layout, facet data will only be loaded after the user presses a "Load Facets" button.
617
- * In the mobile layout, functions exactly as `lazy-mobile`.
618
- * - `off`: Facet data will never be loaded, and a message will be displayed in place of facets
619
- * indicating that they are unavailable.
620
- */
621
- export type FacetLoadStrategy =
622
- | 'eager'
623
- | 'lazy-mobile'
624
- | 'opt-in-or-login'
625
- | 'opt-in'
626
- | 'off';
627
-
628
- /**
629
- * Union of the facet types that are available in the sidebar.
630
- */
631
- export type FacetOption =
632
- | 'subject'
633
- | 'lending'
634
- | 'mediatype'
635
- | 'language'
636
- | 'creator'
637
- | 'collection'
638
- | 'year'
639
- // TV-specific facet options:
640
- | 'clip_type'
641
- | 'program'
642
- | 'person'
643
- | 'sponsor';
644
-
645
- export type SelectedFacetState = 'selected' | 'hidden';
646
-
647
- export type FacetState = SelectedFacetState | 'none';
648
-
649
- export interface FacetBucket {
650
- key: string;
651
- count: number;
652
- state: FacetState;
653
- // for some facets, we augment the key with a display value
654
- displayText?: string;
655
- // for TV channel facets, we add a parenthesized secondary name
656
- extraNote?: string;
657
- }
658
-
659
- export interface FacetGroup {
660
- title: string;
661
- key: FacetOption;
662
- buckets: FacetBucket[];
663
- }
664
-
665
- /**
666
- * Information about a user interaction event on a facet.
667
- */
668
- export type FacetEventDetails = {
669
- /**
670
- * The type of facet that was interacted with (e.g., 'mediatype', 'language', ...).
671
- */
672
- facetType: FacetOption;
673
- /**
674
- * The bucket corresponding to the facet that was interacted with, including the
675
- * updated state of the facet after the interaction.
676
- */
677
- bucket: FacetBucket;
678
- /**
679
- * Whether the interaction occurred on a negative facet.
680
- */
681
- negative: boolean;
682
- };
683
-
684
- export type FacetValue = string;
685
-
686
- export type SelectedFacets = Partial<
687
- Record<FacetOption, Record<FacetValue, FacetBucket>>
688
- >;
689
-
690
- export const getDefaultSelectedFacets = (): Required<SelectedFacets> => ({
691
- subject: {},
692
- lending: {},
693
- mediatype: {},
694
- language: {},
695
- creator: {},
696
- collection: {},
697
- year: {},
698
- clip_type: {},
699
- program: {},
700
- person: {},
701
- sponsor: {},
702
- });
703
-
704
- /**
705
- * For TV search results, what types of TV clips to restrict the results to.
706
- */
707
- export type TvClipFilterType = 'commercial' | 'fact check' | 'quote';
708
-
709
- /**
710
- * Map from allowed TV filtering parameters in the URL to their corresponding filter type
711
- */
712
- export const tvClipURLParamsToFilters: Record<string, TvClipFilterType> = {
713
- only_commercials: 'commercial',
714
- only_factchecks: 'fact check',
715
- only_quotes: 'quote',
716
- };
717
-
718
- /**
719
- * Facet display order when presenting results for all search types *except* TV (see below).
720
- */
721
- export const defaultFacetDisplayOrder: FacetOption[] = [
722
- 'mediatype',
723
- // 'lending', Commenting this out removes the lending facet from the sidebar for now
724
- 'year',
725
- 'subject',
726
- 'collection',
727
- 'creator',
728
- 'language',
729
- ];
730
-
731
- /**
732
- * Specialized facet ordering when displaying TV search results
733
- */
734
- export const tvFacetDisplayOrder: FacetOption[] = [
735
- 'program',
736
- 'creator',
737
- 'year',
738
- 'subject',
739
- // 'person', Omitting the Person facet group for now, though it may be re-added later with new semantics
740
- 'language',
741
- 'clip_type',
742
- ];
743
-
744
- /**
745
- * Human-readable titles for each facet group.
746
- */
747
- export const facetTitles: Record<FacetOption, string> = {
748
- subject: 'Subject',
749
- lending: 'Availability',
750
- mediatype: 'Media Type',
751
- language: 'Language',
752
- creator: 'Creator',
753
- collection: 'Collection',
754
- year: 'Year',
755
- clip_type: 'Clip Type',
756
- program: 'Program',
757
- person: 'Person',
758
- sponsor: 'Sponsor',
759
- };
760
-
761
- /**
762
- * The default sort type to use for each facet type
763
- */
764
- export const defaultFacetSort: Record<FacetOption, AggregationSortType> = {
765
- subject: AggregationSortType.COUNT,
766
- lending: AggregationSortType.COUNT,
767
- mediatype: AggregationSortType.COUNT,
768
- language: AggregationSortType.COUNT,
769
- creator: AggregationSortType.COUNT,
770
- collection: AggregationSortType.COUNT,
771
- year: AggregationSortType.NUMERIC, // Year facets are ordered by their numeric value by default
772
- clip_type: AggregationSortType.COUNT,
773
- program: AggregationSortType.COUNT,
774
- person: AggregationSortType.COUNT,
775
- sponsor: AggregationSortType.COUNT,
776
- };
777
-
778
- /**
779
- * The default sort type to use for each facet type in TV search More... dialogs only
780
- */
781
- export const tvMoreFacetSort: Record<FacetOption, AggregationSortType> = {
782
- ...defaultFacetSort,
783
- creator: AggregationSortType.ALPHABETICAL,
784
- program: AggregationSortType.ALPHABETICAL,
785
- };
786
-
787
- /**
788
- * The sort type corresponding to facet bucket values, for each facet type
789
- * (i.e., the opposite of "sort by count" for that type).
790
- */
791
- export const valueFacetSort: Record<FacetOption, AggregationSortType> = {
792
- subject: AggregationSortType.ALPHABETICAL,
793
- lending: AggregationSortType.ALPHABETICAL,
794
- mediatype: AggregationSortType.ALPHABETICAL,
795
- language: AggregationSortType.ALPHABETICAL,
796
- creator: AggregationSortType.ALPHABETICAL,
797
- collection: AggregationSortType.ALPHABETICAL,
798
- year: AggregationSortType.NUMERIC, // Year facets' values should be compared numerically, not lexicographically (year 2001 > year 3)
799
- clip_type: AggregationSortType.ALPHABETICAL,
800
- program: AggregationSortType.ALPHABETICAL,
801
- person: AggregationSortType.ALPHABETICAL,
802
- sponsor: AggregationSortType.ALPHABETICAL,
803
- };
804
-
805
- export type LendingFacetKey =
806
- | 'is_lendable'
807
- | 'is_borrowable'
808
- | 'available_to_borrow'
809
- | 'is_browsable'
810
- | 'available_to_browse'
811
- | 'is_readable'
812
- | 'available_to_waitlist';
813
-
814
- /**
815
- * Maps valid lending keys to whether they should be visible in the facet sidebar
816
- */
817
- export const lendingFacetKeysVisibility: Record<LendingFacetKey, boolean> = {
818
- is_lendable: true,
819
- is_borrowable: false,
820
- available_to_borrow: true,
821
- is_browsable: false,
822
- available_to_browse: false,
823
- is_readable: true,
824
- available_to_waitlist: false,
825
- };
826
-
827
- /**
828
- * Most facet options allow any string as keys, while some others can only take on a
829
- * limited set of strings. This type just defines those restrictions for the specific
830
- * facet types where they apply.
831
- */
832
- export type AllowedFacetKey<T extends FacetOption> = T extends 'lending'
833
- ? LendingFacetKey
834
- : T extends 'clip_type'
835
- ? TvClipFilterType
836
- : string;
837
-
838
- /**
839
- * A type mapping FacetOptions to objects that define custom display names for some
840
- * or all of their valid keys.
841
- */
842
- export type FacetDisplayNameMap = {
843
- [K in FacetOption]?: Partial<Record<AllowedFacetKey<K>, string>>;
844
- };
845
-
846
- export const customFacetDisplayNames: FacetDisplayNameMap = {
847
- lending: {
848
- is_lendable: 'Lending Library',
849
- available_to_borrow: 'Borrow 14 Days',
850
- is_readable: 'Always Available',
851
- },
852
- clip_type: {
853
- quote: 'Quote',
854
- commercial: 'Political Ad',
855
- 'fact check': 'Fact Check',
856
- },
857
- };
858
-
859
- /**
860
- * A record of which admin-only collections should be suppressed from being displayed
861
- * as facets or in an item's list of collections.
862
- */
863
- export const suppressedCollections: Record<string, boolean> = {
864
- deemphasize: true,
865
- community: true,
866
- stream_only: true,
867
- samples_only: true,
868
- test_collection: true,
869
- printdisabled: true,
870
- 'openlibrary-ol': true,
871
- nationalemergencylibrary: true,
872
- china: true,
873
- americana: true,
874
- toronto: true,
875
- };
876
-
877
- /**
878
- * A record of manageable item
879
- */
880
- export interface ManageableItem {
881
- identifier: string;
882
- title?: string;
883
- dateStr?: string;
884
- date?: string;
885
- }
886
-
887
- /**
888
- * Possible states for whether & how the user has overridden their user preference
889
- * for blurring behavior on tiles with sensitive content.
890
- * - `no-override`: The user has not overridden their user preference, so simply
891
- * respect the preference as given.
892
- * - `on`: The user has overridden their preference and wants tile blurring enabled.
893
- * - `off`: The user has overridden their preference and wants tile blurring disabled.
894
- */
895
- export type TileBlurOverrideState = 'no-override' | 'on' | 'off';