@internetarchive/collection-browser 3.3.1-alpha3 → 3.3.2

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 (492) hide show
  1. package/package.json +1 -1
  2. package/dist/index.d.ts +0 -16
  3. package/dist/index.js.map +0 -1
  4. package/dist/src/app-root.d.ts +0 -105
  5. package/dist/src/app-root.js +0 -1076
  6. package/dist/src/app-root.js.map +0 -1
  7. package/dist/src/assets/img/icons/arrow-left.d.ts +0 -2
  8. package/dist/src/assets/img/icons/arrow-left.js +0 -10
  9. package/dist/src/assets/img/icons/arrow-left.js.map +0 -1
  10. package/dist/src/assets/img/icons/arrow-right.d.ts +0 -2
  11. package/dist/src/assets/img/icons/arrow-right.js +0 -10
  12. package/dist/src/assets/img/icons/arrow-right.js.map +0 -1
  13. package/dist/src/assets/img/icons/chevron.d.ts +0 -2
  14. package/dist/src/assets/img/icons/chevron.js +0 -4
  15. package/dist/src/assets/img/icons/chevron.js.map +0 -1
  16. package/dist/src/assets/img/icons/close-circle-dark.d.ts +0 -2
  17. package/dist/src/assets/img/icons/close-circle-dark.js +0 -5
  18. package/dist/src/assets/img/icons/close-circle-dark.js.map +0 -1
  19. package/dist/src/assets/img/icons/contract.d.ts +0 -2
  20. package/dist/src/assets/img/icons/contract.js +0 -9
  21. package/dist/src/assets/img/icons/contract.js.map +0 -1
  22. package/dist/src/assets/img/icons/empty-query.d.ts +0 -2
  23. package/dist/src/assets/img/icons/empty-query.js +0 -5
  24. package/dist/src/assets/img/icons/empty-query.js.map +0 -1
  25. package/dist/src/assets/img/icons/expand.d.ts +0 -2
  26. package/dist/src/assets/img/icons/expand.js +0 -9
  27. package/dist/src/assets/img/icons/expand.js.map +0 -1
  28. package/dist/src/assets/img/icons/eye-closed.d.ts +0 -2
  29. package/dist/src/assets/img/icons/eye-closed.js +0 -5
  30. package/dist/src/assets/img/icons/eye-closed.js.map +0 -1
  31. package/dist/src/assets/img/icons/eye.d.ts +0 -2
  32. package/dist/src/assets/img/icons/eye.js +0 -5
  33. package/dist/src/assets/img/icons/eye.js.map +0 -1
  34. package/dist/src/assets/img/icons/favorite-filled.d.ts +0 -1
  35. package/dist/src/assets/img/icons/favorite-filled.js +0 -10
  36. package/dist/src/assets/img/icons/favorite-filled.js.map +0 -1
  37. package/dist/src/assets/img/icons/favorite-unfilled.d.ts +0 -1
  38. package/dist/src/assets/img/icons/favorite-unfilled.js +0 -9
  39. package/dist/src/assets/img/icons/favorite-unfilled.js.map +0 -1
  40. package/dist/src/assets/img/icons/filter.d.ts +0 -2
  41. package/dist/src/assets/img/icons/filter.js +0 -10
  42. package/dist/src/assets/img/icons/filter.js.map +0 -1
  43. package/dist/src/assets/img/icons/login-required.d.ts +0 -1
  44. package/dist/src/assets/img/icons/login-required.js +0 -18
  45. package/dist/src/assets/img/icons/login-required.js.map +0 -1
  46. package/dist/src/assets/img/icons/mediatype/account.d.ts +0 -1
  47. package/dist/src/assets/img/icons/mediatype/account.js +0 -14
  48. package/dist/src/assets/img/icons/mediatype/account.js.map +0 -1
  49. package/dist/src/assets/img/icons/mediatype/audio.d.ts +0 -1
  50. package/dist/src/assets/img/icons/mediatype/audio.js +0 -14
  51. package/dist/src/assets/img/icons/mediatype/audio.js.map +0 -1
  52. package/dist/src/assets/img/icons/mediatype/collection.d.ts +0 -1
  53. package/dist/src/assets/img/icons/mediatype/collection.js +0 -12
  54. package/dist/src/assets/img/icons/mediatype/collection.js.map +0 -1
  55. package/dist/src/assets/img/icons/mediatype/data.d.ts +0 -1
  56. package/dist/src/assets/img/icons/mediatype/data.js +0 -15
  57. package/dist/src/assets/img/icons/mediatype/data.js.map +0 -1
  58. package/dist/src/assets/img/icons/mediatype/etree.d.ts +0 -1
  59. package/dist/src/assets/img/icons/mediatype/etree.js +0 -14
  60. package/dist/src/assets/img/icons/mediatype/etree.js.map +0 -1
  61. package/dist/src/assets/img/icons/mediatype/film.d.ts +0 -1
  62. package/dist/src/assets/img/icons/mediatype/film.js +0 -14
  63. package/dist/src/assets/img/icons/mediatype/film.js.map +0 -1
  64. package/dist/src/assets/img/icons/mediatype/images.d.ts +0 -1
  65. package/dist/src/assets/img/icons/mediatype/images.js +0 -13
  66. package/dist/src/assets/img/icons/mediatype/images.js.map +0 -1
  67. package/dist/src/assets/img/icons/mediatype/radio.d.ts +0 -1
  68. package/dist/src/assets/img/icons/mediatype/radio.js +0 -15
  69. package/dist/src/assets/img/icons/mediatype/radio.js.map +0 -1
  70. package/dist/src/assets/img/icons/mediatype/search.d.ts +0 -1
  71. package/dist/src/assets/img/icons/mediatype/search.js +0 -14
  72. package/dist/src/assets/img/icons/mediatype/search.js.map +0 -1
  73. package/dist/src/assets/img/icons/mediatype/software.d.ts +0 -1
  74. package/dist/src/assets/img/icons/mediatype/software.js +0 -13
  75. package/dist/src/assets/img/icons/mediatype/software.js.map +0 -1
  76. package/dist/src/assets/img/icons/mediatype/texts.d.ts +0 -1
  77. package/dist/src/assets/img/icons/mediatype/texts.js +0 -13
  78. package/dist/src/assets/img/icons/mediatype/texts.js.map +0 -1
  79. package/dist/src/assets/img/icons/mediatype/tv-commercial.d.ts +0 -1
  80. package/dist/src/assets/img/icons/mediatype/tv-commercial.js +0 -12
  81. package/dist/src/assets/img/icons/mediatype/tv-commercial.js.map +0 -1
  82. package/dist/src/assets/img/icons/mediatype/tv-fact-check.d.ts +0 -1
  83. package/dist/src/assets/img/icons/mediatype/tv-fact-check.js +0 -12
  84. package/dist/src/assets/img/icons/mediatype/tv-fact-check.js.map +0 -1
  85. package/dist/src/assets/img/icons/mediatype/tv-quote.d.ts +0 -1
  86. package/dist/src/assets/img/icons/mediatype/tv-quote.js +0 -12
  87. package/dist/src/assets/img/icons/mediatype/tv-quote.js.map +0 -1
  88. package/dist/src/assets/img/icons/mediatype/tv.d.ts +0 -1
  89. package/dist/src/assets/img/icons/mediatype/tv.js +0 -14
  90. package/dist/src/assets/img/icons/mediatype/tv.js.map +0 -1
  91. package/dist/src/assets/img/icons/mediatype/video.d.ts +0 -1
  92. package/dist/src/assets/img/icons/mediatype/video.js +0 -14
  93. package/dist/src/assets/img/icons/mediatype/video.js.map +0 -1
  94. package/dist/src/assets/img/icons/mediatype/web.d.ts +0 -1
  95. package/dist/src/assets/img/icons/mediatype/web.js +0 -13
  96. package/dist/src/assets/img/icons/mediatype/web.js.map +0 -1
  97. package/dist/src/assets/img/icons/null-result.d.ts +0 -2
  98. package/dist/src/assets/img/icons/null-result.js +0 -5
  99. package/dist/src/assets/img/icons/null-result.js.map +0 -1
  100. package/dist/src/assets/img/icons/quote.d.ts +0 -1
  101. package/dist/src/assets/img/icons/quote.js +0 -7
  102. package/dist/src/assets/img/icons/quote.js.map +0 -1
  103. package/dist/src/assets/img/icons/restricted.d.ts +0 -1
  104. package/dist/src/assets/img/icons/restricted.js +0 -13
  105. package/dist/src/assets/img/icons/restricted.js.map +0 -1
  106. package/dist/src/assets/img/icons/reviews.d.ts +0 -1
  107. package/dist/src/assets/img/icons/reviews.js +0 -11
  108. package/dist/src/assets/img/icons/reviews.js.map +0 -1
  109. package/dist/src/assets/img/icons/upload.d.ts +0 -1
  110. package/dist/src/assets/img/icons/upload.js +0 -12
  111. package/dist/src/assets/img/icons/upload.js.map +0 -1
  112. package/dist/src/assets/img/icons/views.d.ts +0 -1
  113. package/dist/src/assets/img/icons/views.js +0 -11
  114. package/dist/src/assets/img/icons/views.js.map +0 -1
  115. package/dist/src/circular-activity-indicator.d.ts +0 -5
  116. package/dist/src/circular-activity-indicator.js +0 -66
  117. package/dist/src/circular-activity-indicator.js.map +0 -1
  118. package/dist/src/collection-browser.d.ts +0 -684
  119. package/dist/src/collection-browser.js +0 -2567
  120. package/dist/src/collection-browser.js.map +0 -1
  121. package/dist/src/collection-facets/facet-row.d.ts +0 -30
  122. package/dist/src/collection-facets/facet-row.js +0 -265
  123. package/dist/src/collection-facets/facet-row.js.map +0 -1
  124. package/dist/src/collection-facets/facet-tombstone-row.d.ts +0 -5
  125. package/dist/src/collection-facets/facet-tombstone-row.js +0 -43
  126. package/dist/src/collection-facets/facet-tombstone-row.js.map +0 -1
  127. package/dist/src/collection-facets/facets-template.d.ts +0 -13
  128. package/dist/src/collection-facets/facets-template.js +0 -68
  129. package/dist/src/collection-facets/facets-template.js.map +0 -1
  130. package/dist/src/collection-facets/models.d.ts +0 -9
  131. package/dist/src/collection-facets/models.js +0 -10
  132. package/dist/src/collection-facets/models.js.map +0 -1
  133. package/dist/src/collection-facets/more-facets-content.d.ts +0 -109
  134. package/dist/src/collection-facets/more-facets-content.js +0 -547
  135. package/dist/src/collection-facets/more-facets-content.js.map +0 -1
  136. package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -36
  137. package/dist/src/collection-facets/more-facets-pagination.js +0 -264
  138. package/dist/src/collection-facets/more-facets-pagination.js.map +0 -1
  139. package/dist/src/collection-facets/smart-facets/dedupe.d.ts +0 -10
  140. package/dist/src/collection-facets/smart-facets/dedupe.js +0 -35
  141. package/dist/src/collection-facets/smart-facets/dedupe.js.map +0 -1
  142. package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.d.ts +0 -5
  143. package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js +0 -24
  144. package/dist/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.js.map +0 -1
  145. package/dist/src/collection-facets/smart-facets/heuristics/index.d.ts +0 -3
  146. package/dist/src/collection-facets/smart-facets/heuristics/index.js +0 -4
  147. package/dist/src/collection-facets/smart-facets/heuristics/index.js.map +0 -1
  148. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.d.ts +0 -4
  149. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js +0 -14
  150. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.js.map +0 -1
  151. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.d.ts +0 -6
  152. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js +0 -68
  153. package/dist/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.js.map +0 -1
  154. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.d.ts +0 -9
  155. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js +0 -69
  156. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.js.map +0 -1
  157. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.d.ts +0 -21
  158. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +0 -76
  159. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +0 -1
  160. package/dist/src/collection-facets/smart-facets/models.d.ts +0 -30
  161. package/dist/src/collection-facets/smart-facets/models.js +0 -2
  162. package/dist/src/collection-facets/smart-facets/models.js.map +0 -1
  163. package/dist/src/collection-facets/smart-facets/smart-facet-bar.d.ts +0 -54
  164. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +0 -383
  165. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +0 -1
  166. package/dist/src/collection-facets/smart-facets/smart-facet-button.d.ts +0 -11
  167. package/dist/src/collection-facets/smart-facets/smart-facet-button.js +0 -133
  168. package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +0 -1
  169. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.d.ts +0 -28
  170. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +0 -172
  171. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +0 -1
  172. package/dist/src/collection-facets/smart-facets/smart-facet-equals.d.ts +0 -2
  173. package/dist/src/collection-facets/smart-facets/smart-facet-equals.js +0 -13
  174. package/dist/src/collection-facets/smart-facets/smart-facet-equals.js.map +0 -1
  175. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.d.ts +0 -5
  176. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js +0 -18
  177. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +0 -1
  178. package/dist/src/collection-facets/toggle-switch.d.ts +0 -41
  179. package/dist/src/collection-facets/toggle-switch.js +0 -174
  180. package/dist/src/collection-facets/toggle-switch.js.map +0 -1
  181. package/dist/src/collection-facets.d.ts +0 -113
  182. package/dist/src/collection-facets.js +0 -873
  183. package/dist/src/collection-facets.js.map +0 -1
  184. package/dist/src/data-source/collection-browser-data-source-interface.d.ts +0 -261
  185. package/dist/src/data-source/collection-browser-data-source-interface.js +0 -2
  186. package/dist/src/data-source/collection-browser-data-source-interface.js.map +0 -1
  187. package/dist/src/data-source/collection-browser-data-source.d.ts +0 -400
  188. package/dist/src/data-source/collection-browser-data-source.js +0 -1103
  189. package/dist/src/data-source/collection-browser-data-source.js.map +0 -1
  190. package/dist/src/data-source/collection-browser-query-state.d.ts +0 -49
  191. package/dist/src/data-source/collection-browser-query-state.js +0 -2
  192. package/dist/src/data-source/collection-browser-query-state.js.map +0 -1
  193. package/dist/src/data-source/models.d.ts +0 -32
  194. package/dist/src/data-source/models.js +0 -9
  195. package/dist/src/data-source/models.js.map +0 -1
  196. package/dist/src/empty-placeholder.d.ts +0 -23
  197. package/dist/src/empty-placeholder.js +0 -165
  198. package/dist/src/empty-placeholder.js.map +0 -1
  199. package/dist/src/expanded-date-picker.d.ts +0 -50
  200. package/dist/src/expanded-date-picker.js +0 -182
  201. package/dist/src/expanded-date-picker.js.map +0 -1
  202. package/dist/src/language-code-handler/language-code-handler.d.ts +0 -37
  203. package/dist/src/language-code-handler/language-code-handler.js +0 -27
  204. package/dist/src/language-code-handler/language-code-handler.js.map +0 -1
  205. package/dist/src/language-code-handler/language-code-mapping.d.ts +0 -1
  206. package/dist/src/language-code-handler/language-code-mapping.js +0 -563
  207. package/dist/src/language-code-handler/language-code-mapping.js.map +0 -1
  208. package/dist/src/manage/manage-bar.d.ts +0 -58
  209. package/dist/src/manage/manage-bar.js +0 -237
  210. package/dist/src/manage/manage-bar.js.map +0 -1
  211. package/dist/src/manage/remove-items-modal-content.d.ts +0 -9
  212. package/dist/src/manage/remove-items-modal-content.js +0 -104
  213. package/dist/src/manage/remove-items-modal-content.js.map +0 -1
  214. package/dist/src/mediatype/mediatype-config.d.ts +0 -11
  215. package/dist/src/mediatype/mediatype-config.js +0 -116
  216. package/dist/src/mediatype/mediatype-config.js.map +0 -1
  217. package/dist/src/models.d.ts +0 -302
  218. package/dist/src/models.js +0 -511
  219. package/dist/src/models.js.map +0 -1
  220. package/dist/src/restoration-state-handler.d.ts +0 -75
  221. package/dist/src/restoration-state-handler.js +0 -403
  222. package/dist/src/restoration-state-handler.js.map +0 -1
  223. package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +0 -6
  224. package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +0 -60
  225. package/dist/src/sort-filter-bar/alpha-bar-tooltip.js.map +0 -1
  226. package/dist/src/sort-filter-bar/alpha-bar.d.ts +0 -21
  227. package/dist/src/sort-filter-bar/alpha-bar.js +0 -241
  228. package/dist/src/sort-filter-bar/alpha-bar.js.map +0 -1
  229. package/dist/src/sort-filter-bar/img/compact.d.ts +0 -1
  230. package/dist/src/sort-filter-bar/img/compact.js +0 -5
  231. package/dist/src/sort-filter-bar/img/compact.js.map +0 -1
  232. package/dist/src/sort-filter-bar/img/list.d.ts +0 -1
  233. package/dist/src/sort-filter-bar/img/list.js +0 -5
  234. package/dist/src/sort-filter-bar/img/list.js.map +0 -1
  235. package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +0 -1
  236. package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +0 -15
  237. package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js.map +0 -1
  238. package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +0 -1
  239. package/dist/src/sort-filter-bar/img/sort-toggle-down.js +0 -17
  240. package/dist/src/sort-filter-bar/img/sort-toggle-down.js.map +0 -1
  241. package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +0 -1
  242. package/dist/src/sort-filter-bar/img/sort-toggle-up.js +0 -17
  243. package/dist/src/sort-filter-bar/img/sort-toggle-up.js.map +0 -1
  244. package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +0 -1
  245. package/dist/src/sort-filter-bar/img/sort-triangle.js +0 -5
  246. package/dist/src/sort-filter-bar/img/sort-triangle.js.map +0 -1
  247. package/dist/src/sort-filter-bar/img/tile.d.ts +0 -1
  248. package/dist/src/sort-filter-bar/img/tile.js +0 -5
  249. package/dist/src/sort-filter-bar/img/tile.js.map +0 -1
  250. package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +0 -278
  251. package/dist/src/sort-filter-bar/sort-filter-bar.js +0 -1161
  252. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +0 -1
  253. package/dist/src/styles/ia-button.d.ts +0 -2
  254. package/dist/src/styles/ia-button.js +0 -134
  255. package/dist/src/styles/ia-button.js.map +0 -1
  256. package/dist/src/styles/item-image-styles.d.ts +0 -8
  257. package/dist/src/styles/item-image-styles.js +0 -123
  258. package/dist/src/styles/item-image-styles.js.map +0 -1
  259. package/dist/src/styles/sr-only.d.ts +0 -1
  260. package/dist/src/styles/sr-only.js +0 -18
  261. package/dist/src/styles/sr-only.js.map +0 -1
  262. package/dist/src/tiles/base-tile-component.d.ts +0 -27
  263. package/dist/src/tiles/base-tile-component.js +0 -82
  264. package/dist/src/tiles/base-tile-component.js.map +0 -1
  265. package/dist/src/tiles/collection-browser-loading-tile.d.ts +0 -5
  266. package/dist/src/tiles/collection-browser-loading-tile.js +0 -29
  267. package/dist/src/tiles/collection-browser-loading-tile.js.map +0 -1
  268. package/dist/src/tiles/grid/account-tile.d.ts +0 -18
  269. package/dist/src/tiles/grid/account-tile.js +0 -111
  270. package/dist/src/tiles/grid/account-tile.js.map +0 -1
  271. package/dist/src/tiles/grid/collection-tile.d.ts +0 -15
  272. package/dist/src/tiles/grid/collection-tile.js +0 -160
  273. package/dist/src/tiles/grid/collection-tile.js.map +0 -1
  274. package/dist/src/tiles/grid/item-tile.d.ts +0 -41
  275. package/dist/src/tiles/grid/item-tile.js +0 -321
  276. package/dist/src/tiles/grid/item-tile.js.map +0 -1
  277. package/dist/src/tiles/grid/search-tile.d.ts +0 -10
  278. package/dist/src/tiles/grid/search-tile.js +0 -95
  279. package/dist/src/tiles/grid/search-tile.js.map +0 -1
  280. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +0 -1
  281. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +0 -128
  282. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +0 -1
  283. package/dist/src/tiles/grid/tile-stats.d.ts +0 -58
  284. package/dist/src/tiles/grid/tile-stats.js +0 -204
  285. package/dist/src/tiles/grid/tile-stats.js.map +0 -1
  286. package/dist/src/tiles/hover/hover-pane-controller.d.ts +0 -220
  287. package/dist/src/tiles/hover/hover-pane-controller.js +0 -378
  288. package/dist/src/tiles/hover/hover-pane-controller.js.map +0 -1
  289. package/dist/src/tiles/hover/tile-hover-pane.d.ts +0 -19
  290. package/dist/src/tiles/hover/tile-hover-pane.js +0 -182
  291. package/dist/src/tiles/hover/tile-hover-pane.js.map +0 -1
  292. package/dist/src/tiles/image-block.d.ts +0 -19
  293. package/dist/src/tiles/image-block.js +0 -175
  294. package/dist/src/tiles/image-block.js.map +0 -1
  295. package/dist/src/tiles/item-image.d.ts +0 -40
  296. package/dist/src/tiles/item-image.js +0 -191
  297. package/dist/src/tiles/item-image.js.map +0 -1
  298. package/dist/src/tiles/list/tile-list-compact-header.d.ts +0 -6
  299. package/dist/src/tiles/list/tile-list-compact-header.js +0 -85
  300. package/dist/src/tiles/list/tile-list-compact-header.js.map +0 -1
  301. package/dist/src/tiles/list/tile-list-compact.d.ts +0 -19
  302. package/dist/src/tiles/list/tile-list-compact.js +0 -223
  303. package/dist/src/tiles/list/tile-list-compact.js.map +0 -1
  304. package/dist/src/tiles/list/tile-list.d.ts +0 -54
  305. package/dist/src/tiles/list/tile-list.js +0 -621
  306. package/dist/src/tiles/list/tile-list.js.map +0 -1
  307. package/dist/src/tiles/models.d.ts +0 -1
  308. package/dist/src/tiles/models.js +0 -2
  309. package/dist/src/tiles/models.js.map +0 -1
  310. package/dist/src/tiles/overlay/icon-overlay.d.ts +0 -8
  311. package/dist/src/tiles/overlay/icon-overlay.js +0 -55
  312. package/dist/src/tiles/overlay/icon-overlay.js.map +0 -1
  313. package/dist/src/tiles/overlay/text-overlay.d.ts +0 -9
  314. package/dist/src/tiles/overlay/text-overlay.js +0 -74
  315. package/dist/src/tiles/overlay/text-overlay.js.map +0 -1
  316. package/dist/src/tiles/review-block.d.ts +0 -12
  317. package/dist/src/tiles/review-block.js +0 -134
  318. package/dist/src/tiles/review-block.js.map +0 -1
  319. package/dist/src/tiles/text-snippet-block.d.ts +0 -27
  320. package/dist/src/tiles/text-snippet-block.js +0 -132
  321. package/dist/src/tiles/text-snippet-block.js.map +0 -1
  322. package/dist/src/tiles/tile-dispatcher.d.ts +0 -68
  323. package/dist/src/tiles/tile-dispatcher.js +0 -445
  324. package/dist/src/tiles/tile-dispatcher.js.map +0 -1
  325. package/dist/src/tiles/tile-display-value-provider.d.ts +0 -47
  326. package/dist/src/tiles/tile-display-value-provider.js +0 -95
  327. package/dist/src/tiles/tile-display-value-provider.js.map +0 -1
  328. package/dist/src/tiles/tile-mediatype-icon.d.ts +0 -27
  329. package/dist/src/tiles/tile-mediatype-icon.js +0 -130
  330. package/dist/src/tiles/tile-mediatype-icon.js.map +0 -1
  331. package/dist/src/utils/analytics-events.d.ts +0 -28
  332. package/dist/src/utils/analytics-events.js +0 -31
  333. package/dist/src/utils/analytics-events.js.map +0 -1
  334. package/dist/src/utils/array-equals.d.ts +0 -4
  335. package/dist/src/utils/array-equals.js +0 -11
  336. package/dist/src/utils/array-equals.js.map +0 -1
  337. package/dist/src/utils/collapse-repeated-quotes.d.ts +0 -11
  338. package/dist/src/utils/collapse-repeated-quotes.js +0 -14
  339. package/dist/src/utils/collapse-repeated-quotes.js.map +0 -1
  340. package/dist/src/utils/facet-utils.d.ts +0 -83
  341. package/dist/src/utils/facet-utils.js +0 -152
  342. package/dist/src/utils/facet-utils.js.map +0 -1
  343. package/dist/src/utils/format-count.d.ts +0 -7
  344. package/dist/src/utils/format-count.js +0 -76
  345. package/dist/src/utils/format-count.js.map +0 -1
  346. package/dist/src/utils/format-date.d.ts +0 -16
  347. package/dist/src/utils/format-date.js +0 -33
  348. package/dist/src/utils/format-date.js.map +0 -1
  349. package/dist/src/utils/format-unit-size.d.ts +0 -2
  350. package/dist/src/utils/format-unit-size.js +0 -34
  351. package/dist/src/utils/format-unit-size.js.map +0 -1
  352. package/dist/src/utils/local-date-from-utc.d.ts +0 -9
  353. package/dist/src/utils/local-date-from-utc.js +0 -16
  354. package/dist/src/utils/local-date-from-utc.js.map +0 -1
  355. package/dist/src/utils/log.d.ts +0 -7
  356. package/dist/src/utils/log.js +0 -14
  357. package/dist/src/utils/log.js.map +0 -1
  358. package/dist/src/utils/resolve-mediatype.d.ts +0 -8
  359. package/dist/src/utils/resolve-mediatype.js +0 -24
  360. package/dist/src/utils/resolve-mediatype.js.map +0 -1
  361. package/dist/src/utils/sha1.d.ts +0 -2
  362. package/dist/src/utils/sha1.js +0 -9
  363. package/dist/src/utils/sha1.js.map +0 -1
  364. package/dist/test/collection-browser.test.d.ts +0 -1
  365. package/dist/test/collection-browser.test.js +0 -1711
  366. package/dist/test/collection-browser.test.js.map +0 -1
  367. package/dist/test/collection-facets/facet-row.test.d.ts +0 -1
  368. package/dist/test/collection-facets/facet-row.test.js +0 -274
  369. package/dist/test/collection-facets/facet-row.test.js.map +0 -1
  370. package/dist/test/collection-facets/facets-template.test.d.ts +0 -1
  371. package/dist/test/collection-facets/facets-template.test.js +0 -101
  372. package/dist/test/collection-facets/facets-template.test.js.map +0 -1
  373. package/dist/test/collection-facets/more-facets-content.test.d.ts +0 -1
  374. package/dist/test/collection-facets/more-facets-content.test.js +0 -169
  375. package/dist/test/collection-facets/more-facets-content.test.js.map +0 -1
  376. package/dist/test/collection-facets/more-facets-pagination.test.d.ts +0 -1
  377. package/dist/test/collection-facets/more-facets-pagination.test.js +0 -132
  378. package/dist/test/collection-facets/more-facets-pagination.test.js.map +0 -1
  379. package/dist/test/collection-facets/toggle-switch.test.d.ts +0 -1
  380. package/dist/test/collection-facets/toggle-switch.test.js +0 -96
  381. package/dist/test/collection-facets/toggle-switch.test.js.map +0 -1
  382. package/dist/test/collection-facets.test.d.ts +0 -2
  383. package/dist/test/collection-facets.test.js +0 -745
  384. package/dist/test/collection-facets.test.js.map +0 -1
  385. package/dist/test/data-source/collection-browser-data-source.test.d.ts +0 -1
  386. package/dist/test/data-source/collection-browser-data-source.test.js +0 -102
  387. package/dist/test/data-source/collection-browser-data-source.test.js.map +0 -1
  388. package/dist/test/empty-placeholder.test.d.ts +0 -1
  389. package/dist/test/empty-placeholder.test.js +0 -63
  390. package/dist/test/empty-placeholder.test.js.map +0 -1
  391. package/dist/test/expanded-date-picker.test.d.ts +0 -1
  392. package/dist/test/expanded-date-picker.test.js +0 -130
  393. package/dist/test/expanded-date-picker.test.js.map +0 -1
  394. package/dist/test/icon-overlay.test.d.ts +0 -1
  395. package/dist/test/icon-overlay.test.js +0 -30
  396. package/dist/test/icon-overlay.test.js.map +0 -1
  397. package/dist/test/image-block.test.d.ts +0 -1
  398. package/dist/test/image-block.test.js +0 -218
  399. package/dist/test/image-block.test.js.map +0 -1
  400. package/dist/test/item-image.test.d.ts +0 -1
  401. package/dist/test/item-image.test.js +0 -196
  402. package/dist/test/item-image.test.js.map +0 -1
  403. package/dist/test/manage/manage-bar.test.d.ts +0 -2
  404. package/dist/test/manage/manage-bar.test.js +0 -106
  405. package/dist/test/manage/manage-bar.test.js.map +0 -1
  406. package/dist/test/manage/remove-items-modal-content.test.d.ts +0 -1
  407. package/dist/test/manage/remove-items-modal-content.test.js +0 -65
  408. package/dist/test/manage/remove-items-modal-content.test.js.map +0 -1
  409. package/dist/test/mediatype-config.test.d.ts +0 -1
  410. package/dist/test/mediatype-config.test.js +0 -11
  411. package/dist/test/mediatype-config.test.js.map +0 -1
  412. package/dist/test/mocks/mock-analytics-handler.d.ts +0 -10
  413. package/dist/test/mocks/mock-analytics-handler.js +0 -16
  414. package/dist/test/mocks/mock-analytics-handler.js.map +0 -1
  415. package/dist/test/mocks/mock-search-responses.d.ts +0 -31
  416. package/dist/test/mocks/mock-search-responses.js +0 -1241
  417. package/dist/test/mocks/mock-search-responses.js.map +0 -1
  418. package/dist/test/mocks/mock-search-service.d.ts +0 -16
  419. package/dist/test/mocks/mock-search-service.js +0 -65
  420. package/dist/test/mocks/mock-search-service.js.map +0 -1
  421. package/dist/test/restoration-state-handler.test.d.ts +0 -1
  422. package/dist/test/restoration-state-handler.test.js +0 -375
  423. package/dist/test/restoration-state-handler.test.js.map +0 -1
  424. package/dist/test/review-block.test.d.ts +0 -1
  425. package/dist/test/review-block.test.js +0 -48
  426. package/dist/test/review-block.test.js.map +0 -1
  427. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +0 -1
  428. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +0 -13
  429. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +0 -1
  430. package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +0 -1
  431. package/dist/test/sort-filter-bar/alpha-bar.test.js +0 -74
  432. package/dist/test/sort-filter-bar/alpha-bar.test.js.map +0 -1
  433. package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +0 -1
  434. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -609
  435. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +0 -1
  436. package/dist/test/text-overlay.test.d.ts +0 -1
  437. package/dist/test/text-overlay.test.js +0 -42
  438. package/dist/test/text-overlay.test.js.map +0 -1
  439. package/dist/test/text-snippet-block.test.d.ts +0 -1
  440. package/dist/test/text-snippet-block.test.js +0 -63
  441. package/dist/test/text-snippet-block.test.js.map +0 -1
  442. package/dist/test/tile-stats.test.d.ts +0 -1
  443. package/dist/test/tile-stats.test.js +0 -128
  444. package/dist/test/tile-stats.test.js.map +0 -1
  445. package/dist/test/tiles/grid/account-tile.test.d.ts +0 -1
  446. package/dist/test/tiles/grid/account-tile.test.js +0 -96
  447. package/dist/test/tiles/grid/account-tile.test.js.map +0 -1
  448. package/dist/test/tiles/grid/collection-tile.test.d.ts +0 -1
  449. package/dist/test/tiles/grid/collection-tile.test.js +0 -96
  450. package/dist/test/tiles/grid/collection-tile.test.js.map +0 -1
  451. package/dist/test/tiles/grid/item-tile.test.d.ts +0 -1
  452. package/dist/test/tiles/grid/item-tile.test.js +0 -427
  453. package/dist/test/tiles/grid/item-tile.test.js.map +0 -1
  454. package/dist/test/tiles/grid/search-tile.test.d.ts +0 -1
  455. package/dist/test/tiles/grid/search-tile.test.js +0 -66
  456. package/dist/test/tiles/grid/search-tile.test.js.map +0 -1
  457. package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +0 -1
  458. package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -282
  459. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +0 -1
  460. package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +0 -1
  461. package/dist/test/tiles/hover/tile-hover-pane.test.js +0 -57
  462. package/dist/test/tiles/hover/tile-hover-pane.test.js.map +0 -1
  463. package/dist/test/tiles/list/tile-list-compact.test.d.ts +0 -1
  464. package/dist/test/tiles/list/tile-list-compact.test.js +0 -251
  465. package/dist/test/tiles/list/tile-list-compact.test.js.map +0 -1
  466. package/dist/test/tiles/list/tile-list.test.d.ts +0 -1
  467. package/dist/test/tiles/list/tile-list.test.js +0 -469
  468. package/dist/test/tiles/list/tile-list.test.js.map +0 -1
  469. package/dist/test/tiles/tile-dispatcher.test.d.ts +0 -1
  470. package/dist/test/tiles/tile-dispatcher.test.js +0 -153
  471. package/dist/test/tiles/tile-dispatcher.test.js.map +0 -1
  472. package/dist/test/tiles/tile-display-value-provider.test.d.ts +0 -1
  473. package/dist/test/tiles/tile-display-value-provider.test.js +0 -142
  474. package/dist/test/tiles/tile-display-value-provider.test.js.map +0 -1
  475. package/dist/test/tiles/tile-mediatype-icon.test.d.ts +0 -1
  476. package/dist/test/tiles/tile-mediatype-icon.test.js +0 -145
  477. package/dist/test/tiles/tile-mediatype-icon.test.js.map +0 -1
  478. package/dist/test/utils/array-equals.test.d.ts +0 -1
  479. package/dist/test/utils/array-equals.test.js +0 -27
  480. package/dist/test/utils/array-equals.test.js.map +0 -1
  481. package/dist/test/utils/format-count.test.d.ts +0 -1
  482. package/dist/test/utils/format-count.test.js +0 -24
  483. package/dist/test/utils/format-count.test.js.map +0 -1
  484. package/dist/test/utils/format-date.test.d.ts +0 -1
  485. package/dist/test/utils/format-date.test.js +0 -61
  486. package/dist/test/utils/format-date.test.js.map +0 -1
  487. package/dist/test/utils/format-unit-size.test.d.ts +0 -1
  488. package/dist/test/utils/format-unit-size.test.js +0 -18
  489. package/dist/test/utils/format-unit-size.test.js.map +0 -1
  490. package/dist/test/utils/local-date-from-utc.test.d.ts +0 -1
  491. package/dist/test/utils/local-date-from-utc.test.js +0 -27
  492. package/dist/test/utils/local-date-from-utc.test.js.map +0 -1
@@ -1,445 +0,0 @@
1
- var TileDispatcher_1;
2
- import { __decorate } from "tslib";
3
- import { css, html, nothing } from 'lit';
4
- import { customElement, property, query } from 'lit/decorators.js';
5
- import { ifDefined } from 'lit/directives/if-defined.js';
6
- import { msg } from '@lit/localize';
7
- import './grid/collection-tile';
8
- import './grid/item-tile';
9
- import './grid/account-tile';
10
- import './grid/search-tile';
11
- import './hover/tile-hover-pane';
12
- import './list/tile-list';
13
- import './list/tile-list-compact';
14
- import './list/tile-list-compact-header';
15
- import { BaseTileComponent } from './base-tile-component';
16
- import { HoverPaneController, } from './hover/hover-pane-controller';
17
- let TileDispatcher = TileDispatcher_1 = class TileDispatcher extends BaseTileComponent {
18
- constructor() {
19
- /*
20
- * Reactive properties inherited from BaseTileComponent:
21
- * - model?: TileModel;
22
- * - currentWidth?: number;
23
- * - currentHeight?: number;
24
- * - baseNavigationUrl?: string;
25
- * - baseImageUrl?: string;
26
- * - collectionPagePath?: string;
27
- * - sortParam: SortParam | null = null;
28
- * - defaultSortParam: SortParam | null = null;
29
- * - creatorFilter?: string;
30
- * - mobileBreakpoint?: number;
31
- * - loggedIn = false;
32
- * - suppressTileBlurring = false;
33
- * - useLocalTime = false;
34
- */
35
- super(...arguments);
36
- this.isManageView = false;
37
- this.showTvClips = false;
38
- /** What type of simple layout to use in grid mode, if any */
39
- this.simpleLayoutType = 'none';
40
- /** Whether this tile should include a hover pane at all (for applicable tile modes) */
41
- this.enableHoverPane = false;
42
- this.manageCheckTitle = msg('Remove this item from the list');
43
- }
44
- render() {
45
- var _a, _b;
46
- const isGridMode = this.tileDisplayMode === 'grid';
47
- const hoverPaneTemplate = (_b = (_a = this.hoverPaneController) === null || _a === void 0 ? void 0 : _a.getTemplate()) !== null && _b !== void 0 ? _b : nothing;
48
- return html `
49
- <div id="container" class=${isGridMode ? 'hoverable' : nothing}>
50
- ${this.tileDisplayMode === 'list-header'
51
- ? this.headerTemplate
52
- : this.tileTemplate}
53
- ${this.manageCheckTemplate} ${hoverPaneTemplate}
54
- </div>
55
- `;
56
- }
57
- firstUpdated() {
58
- if (this.shouldPrepareHoverPane) {
59
- this.hoverPaneController = new HoverPaneController(this, {
60
- mobileBreakpoint: this.mobileBreakpoint,
61
- enableLongPress: false,
62
- });
63
- }
64
- }
65
- get headerTemplate() {
66
- const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } = this;
67
- return html `
68
- <tile-list-compact-header
69
- class="header"
70
- .currentWidth=${currentWidth}
71
- .sortParam=${sortParam !== null && sortParam !== void 0 ? sortParam : defaultSortParam}
72
- .mobileBreakpoint=${mobileBreakpoint}
73
- >
74
- </tile-list-compact-header>
75
- `;
76
- }
77
- get tileTemplate() {
78
- return html `
79
- ${this.tileDisplayMode === 'list-detail'
80
- ? this.tile
81
- : this.linkTileTemplate}
82
- `;
83
- }
84
- get linkTileTemplate() {
85
- var _a, _b, _c;
86
- return html `
87
- <a
88
- href=${this.linkTileHref}
89
- aria-label=${(_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : 'Untitled item'}
90
- title=${this.shouldPrepareHoverPane
91
- ? nothing // Don't show title tooltips when we have the tile info popups
92
- : ifDefined((_c = this.model) === null || _c === void 0 ? void 0 : _c.title)}
93
- @click=${this.handleLinkClicked}
94
- @contextmenu=${this.handleLinkContextMenu}
95
- >
96
- ${this.tile}
97
- </a>
98
- `;
99
- }
100
- get linkTileHref() {
101
- var _a;
102
- if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.identifier) || this.baseNavigationUrl == null)
103
- return nothing;
104
- // Use the server-specified href if available.
105
- // Otherwise, construct a details page URL from the item identifier.
106
- if (this.model.href) {
107
- return `${this.baseNavigationUrl}${this.model.href}`;
108
- }
109
- return this.displayValueProvider.itemPageUrl(this.model.identifier, this.model.mediatype === 'collection');
110
- }
111
- get manageCheckTemplate() {
112
- var _a;
113
- if (!this.isManageView || this.tileDisplayMode !== 'grid')
114
- return nothing;
115
- return html `
116
- <div class="manage-check">
117
- <input
118
- type="checkbox"
119
- title=${this.manageCheckTitle}
120
- .checked=${(_a = this.model) === null || _a === void 0 ? void 0 : _a.checked}
121
- @change=${this.handleLinkClicked}
122
- />
123
- </div>
124
- `;
125
- }
126
- /**
127
- * Whether hover pane behavior should be prepared for this tile
128
- * (e.g., whether mouse listeners should be attached, etc.)
129
- */
130
- get shouldPrepareHoverPane() {
131
- var _a, _b;
132
- return (this.enableHoverPane &&
133
- !!this.tileDisplayMode &&
134
- TileDispatcher_1.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode] &&
135
- ((_a = this.model) === null || _a === void 0 ? void 0 : _a.mediatype) !== 'search' && // don't show hover panes on search tiles
136
- !((_b = this.model) === null || _b === void 0 ? void 0 : _b.captureDates) // don't show hover panes on web archive tiles
137
- );
138
- }
139
- get isHoverEnabled() {
140
- return window.matchMedia('(hover: hover)').matches;
141
- }
142
- /** @inheritdoc */
143
- getHoverPane() {
144
- return this.hoverPane;
145
- }
146
- /** @inheritdoc */
147
- getHoverPaneProps() {
148
- return this;
149
- }
150
- handleResize(entry) {
151
- this.currentWidth = entry.contentRect.width;
152
- this.currentHeight = entry.contentRect.height;
153
- }
154
- disconnectedCallback() {
155
- this.stopResizeObservation(this.resizeObserver);
156
- }
157
- stopResizeObservation(observer) {
158
- observer === null || observer === void 0 ? void 0 : observer.removeObserver({
159
- handler: this,
160
- target: this.container,
161
- });
162
- }
163
- startResizeObservation() {
164
- var _a;
165
- this.stopResizeObservation(this.resizeObserver);
166
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.addObserver({
167
- handler: this,
168
- target: this.container,
169
- });
170
- }
171
- updated(props) {
172
- if (props.has('resizeObserver')) {
173
- const previousObserver = props.get('resizeObserver');
174
- this.stopResizeObservation(previousObserver);
175
- this.startResizeObservation();
176
- }
177
- }
178
- /**
179
- * Handler for when the tile link is left-clicked. Emits the `resultSelected` event.
180
- * In manage view, it also checks/unchecks the tile.
181
- */
182
- handleLinkClicked(e) {
183
- if (this.isManageView) {
184
- e.preventDefault();
185
- if (this.model)
186
- this.model.checked = !this.model.checked;
187
- }
188
- this.dispatchEvent(new CustomEvent('resultSelected', { detail: this.model }));
189
- }
190
- /**
191
- * Handler for when the tile link is right-clicked.
192
- * In manage view, it opens the item in a new tab. Otherwise, does nothing.
193
- */
194
- handleLinkContextMenu(e) {
195
- if (this.isManageView && this.linkTileHref !== nothing) {
196
- e.preventDefault();
197
- window.open(this.linkTileHref, '_blank');
198
- }
199
- }
200
- tileInfoButtonPressed(e) {
201
- var _a;
202
- (_a = this.hoverPaneController) === null || _a === void 0 ? void 0 : _a.toggleHoverPane({
203
- coords: e.detail,
204
- enableTouchBackdrop: true,
205
- });
206
- }
207
- get tile() {
208
- const { model, collectionPagePath, baseNavigationUrl, currentWidth, currentHeight, sortParam, creatorFilter, mobileBreakpoint, defaultSortParam, } = this;
209
- if (!model)
210
- return nothing;
211
- switch (this.tileDisplayMode) {
212
- case 'grid':
213
- switch (model.mediatype) {
214
- case 'collection':
215
- return html `<collection-tile
216
- .model=${model}
217
- .collectionPagePath=${collectionPagePath}
218
- .baseImageUrl=${this.baseImageUrl}
219
- .currentWidth=${currentWidth}
220
- .currentHeight=${currentHeight}
221
- .creatorFilter=${creatorFilter}
222
- .suppressBlurring=${this.suppressBlurring}
223
- .isManageView=${this.isManageView}
224
- ?showInfoButton=${!this.isHoverEnabled}
225
- @infoButtonPressed=${this.tileInfoButtonPressed}
226
- >
227
- </collection-tile>`;
228
- case 'account':
229
- return html `<account-tile
230
- .model=${model}
231
- .collectionPagePath=${collectionPagePath}
232
- .baseImageUrl=${this.baseImageUrl}
233
- .currentWidth=${currentWidth}
234
- .currentHeight=${currentHeight}
235
- .creatorFilter=${creatorFilter}
236
- .suppressBlurring=${this.suppressBlurring}
237
- .isManageView=${this.isManageView}
238
- ?showInfoButton=${!this.isHoverEnabled}
239
- @infoButtonPressed=${this.tileInfoButtonPressed}
240
- >
241
- </account-tile>`;
242
- case 'search':
243
- return html `<search-tile
244
- .model=${model}
245
- .collectionPagePath=${collectionPagePath}
246
- .baseImageUrl=${this.baseImageUrl}
247
- .currentWidth=${currentWidth}
248
- .currentHeight=${currentHeight}
249
- .creatorFilter=${creatorFilter}
250
- .suppressBlurring=${this.suppressBlurring}
251
- .isManageView=${this.isManageView}
252
- ?showInfoButton=${false}
253
- @infoButtonPressed=${this.tileInfoButtonPressed}
254
- >
255
- </search-tile>`;
256
- default:
257
- return html `<item-tile
258
- .model=${model}
259
- .collectionPagePath=${collectionPagePath}
260
- .currentWidth=${this.currentWidth}
261
- .currentHeight=${this.currentHeight}
262
- .baseImageUrl=${this.baseImageUrl}
263
- .sortParam=${sortParam}
264
- .defaultSortParam=${defaultSortParam}
265
- .creatorFilter=${creatorFilter}
266
- .loggedIn=${this.loggedIn}
267
- .suppressBlurring=${this.suppressBlurring}
268
- .isManageView=${this.isManageView}
269
- .simpleLayoutType=${this.simpleLayoutType}
270
- ?showTvClips=${this.showTvClips}
271
- ?showInfoButton=${!this.isHoverEnabled}
272
- ?useLocalTime=${this.useLocalTime}
273
- @infoButtonPressed=${this.tileInfoButtonPressed}
274
- >
275
- </item-tile>`;
276
- }
277
- case 'list-compact':
278
- return html `<tile-list-compact
279
- .model=${model}
280
- .collectionPagePath=${collectionPagePath}
281
- .currentWidth=${currentWidth}
282
- .currentHeight=${currentHeight}
283
- .baseNavigationUrl=${baseNavigationUrl}
284
- .sortParam=${sortParam}
285
- .defaultSortParam=${defaultSortParam}
286
- .creatorFilter=${creatorFilter}
287
- .mobileBreakpoint=${mobileBreakpoint}
288
- .baseImageUrl=${this.baseImageUrl}
289
- .loggedIn=${this.loggedIn}
290
- .suppressBlurring=${this.suppressBlurring}
291
- ?useLocalTime=${this.useLocalTime}
292
- >
293
- </tile-list-compact>`;
294
- case 'list-detail':
295
- return html `<tile-list
296
- .model=${model}
297
- .collectionPagePath=${collectionPagePath}
298
- .collectionTitles=${this.collectionTitles}
299
- .currentWidth=${currentWidth}
300
- .currentHeight=${currentHeight}
301
- .baseNavigationUrl=${baseNavigationUrl}
302
- .sortParam=${sortParam}
303
- .defaultSortParam=${defaultSortParam}
304
- .creatorFilter=${creatorFilter}
305
- .mobileBreakpoint=${mobileBreakpoint}
306
- .baseImageUrl=${this.baseImageUrl}
307
- .loggedIn=${this.loggedIn}
308
- .suppressBlurring=${this.suppressBlurring}
309
- ?useLocalTime=${this.useLocalTime}
310
- >
311
- </tile-list>`;
312
- default:
313
- return nothing;
314
- }
315
- }
316
- static get styles() {
317
- return css `
318
- :host {
319
- display: block;
320
- height: 100%;
321
- }
322
-
323
- collection-tile {
324
- --tileBorderColor: #555555;
325
- --tileBackgroundColor: #666666;
326
- --imageBlockBackgroundColor: #666666;
327
- }
328
-
329
- account-tile {
330
- --tileBorderColor: #dddddd;
331
- --imageBlockBackgroundColor: #fcf5e6;
332
- }
333
-
334
- item-tile {
335
- --tileBorderColor: #dddddd;
336
- --imageBlockBackgroundColor: #f1f1f4;
337
- }
338
-
339
- search-tile {
340
- --tileBorderColor: #555555;
341
- --tileBackgroundColor: #666666;
342
- --imageBlockBackgroundColor: #666666;
343
- --iconFillColor: #2c2c2c;
344
- }
345
-
346
- #container {
347
- position: relative;
348
- height: 100%;
349
- border-radius: 4px;
350
- }
351
-
352
- #container.hoverable:hover {
353
- box-shadow: var(--tileHoverBoxShadow, 0 0 6px 2px rgba(8, 8, 32, 0.8));
354
- transition: box-shadow 0.1s ease;
355
- }
356
-
357
- a {
358
- display: block;
359
- height: 100%;
360
- color: unset;
361
- text-decoration: none;
362
- transition: transform 0.05s ease;
363
- }
364
-
365
- a :first-child {
366
- display: block;
367
- height: 100%;
368
- }
369
-
370
- .manage-check {
371
- position: absolute;
372
- right: 0;
373
- top: 0;
374
- border: 5px solid #2c2c2c;
375
- border-radius: 3px;
376
- background-color: #2c2c2c;
377
- z-index: 1;
378
- }
379
-
380
- .manage-check > input[type='checkbox'] {
381
- display: block;
382
- margin: 0;
383
- }
384
-
385
- #touch-backdrop {
386
- position: fixed;
387
- width: 100vw;
388
- height: 100vh;
389
- top: 0;
390
- left: 0;
391
- z-index: 2;
392
- background: transparent;
393
- }
394
-
395
- tile-hover-pane {
396
- position: absolute;
397
- top: 0;
398
- left: -9999px;
399
- z-index: 2;
400
- }
401
- `;
402
- }
403
- };
404
- /** Maps each display mode to whether hover panes should appear in that mode */
405
- TileDispatcher.HOVER_PANE_DISPLAY_MODES = {
406
- grid: true,
407
- 'list-compact': true,
408
- 'list-detail': false,
409
- 'list-header': false,
410
- };
411
- __decorate([
412
- property({ type: String })
413
- ], TileDispatcher.prototype, "tileDisplayMode", void 0);
414
- __decorate([
415
- property({ type: Boolean })
416
- ], TileDispatcher.prototype, "isManageView", void 0);
417
- __decorate([
418
- property({ type: Object })
419
- ], TileDispatcher.prototype, "resizeObserver", void 0);
420
- __decorate([
421
- property({ type: Object })
422
- ], TileDispatcher.prototype, "collectionTitles", void 0);
423
- __decorate([
424
- property({ type: Boolean })
425
- ], TileDispatcher.prototype, "showTvClips", void 0);
426
- __decorate([
427
- property({ type: String })
428
- ], TileDispatcher.prototype, "simpleLayoutType", void 0);
429
- __decorate([
430
- property({ type: Boolean })
431
- ], TileDispatcher.prototype, "enableHoverPane", void 0);
432
- __decorate([
433
- property({ type: String })
434
- ], TileDispatcher.prototype, "manageCheckTitle", void 0);
435
- __decorate([
436
- query('#container')
437
- ], TileDispatcher.prototype, "container", void 0);
438
- __decorate([
439
- query('tile-hover-pane')
440
- ], TileDispatcher.prototype, "hoverPane", void 0);
441
- TileDispatcher = TileDispatcher_1 = __decorate([
442
- customElement('tile-dispatcher')
443
- ], TileDispatcher);
444
- export { TileDispatcher };
445
- //# sourceMappingURL=tile-dispatcher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tile-dispatcher.js","sourceRoot":"","sources":["../../../src/tiles/tile-dispatcher.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAOpC,OAAO,wBAAwB,CAAC;AAChC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,yBAAyB,CAAC;AACjC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAC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AM,EAAE,CAAC;uDAAmC;AAEjC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAAsB;AAEtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAgD;AAG3E;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDACS;AAEP;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAAqB;AAGrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAA6C;AAG3C;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uDAAyB;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAEzB;AAKM;IADP,KAAK,CAAC,YAAY,CAAC;iDACe;AAG3B;IADP,KAAK,CAAC,iBAAiB,CAAC;iDACS;AAlDvB,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CA4c1B","sourcesContent":["import { css, html, nothing, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { msg } from '@lit/localize';\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { TileDisplayMode } from '../models';\nimport type { CollectionTitles } from '../data-source/models';\nimport './grid/collection-tile';\nimport './grid/item-tile';\nimport './grid/account-tile';\nimport './grid/search-tile';\nimport './hover/tile-hover-pane';\nimport './list/tile-list';\nimport './list/tile-list-compact';\nimport './list/tile-list-compact-header';\nimport type { TileHoverPane } from './hover/tile-hover-pane';\nimport { BaseTileComponent } from './base-tile-component';\nimport { SimpleLayoutType } from './models';\nimport {\n HoverPaneController,\n HoverPaneControllerInterface,\n HoverPaneProperties,\n HoverPaneProviderInterface,\n} from './hover/hover-pane-controller';\n\n@customElement('tile-dispatcher')\nexport class TileDispatcher\n extends BaseTileComponent\n implements\n SharedResizeObserverResizeHandlerInterface,\n HoverPaneProviderInterface\n{\n /*\n * Reactive properties inherited from BaseTileComponent:\n * - model?: TileModel;\n * - currentWidth?: number;\n * - currentHeight?: number;\n * - baseNavigationUrl?: string;\n * - baseImageUrl?: string;\n * - collectionPagePath?: string;\n * - sortParam: SortParam | null = null;\n * - defaultSortParam: SortParam | null = null;\n * - creatorFilter?: string;\n * - mobileBreakpoint?: number;\n * - loggedIn = false;\n * - suppressTileBlurring = false;\n * - useLocalTime = false;\n */\n\n @property({ type: String }) tileDisplayMode?: TileDisplayMode;\n\n @property({ type: Boolean }) isManageView = false;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object })\n collectionTitles?: CollectionTitles;\n\n @property({ type: Boolean }) showTvClips = false;\n\n /** What type of simple layout to use in grid mode, if any */\n @property({ type: String }) simpleLayoutType: SimpleLayoutType = 'none';\n\n /** Whether this tile should include a hover pane at all (for applicable tile modes) */\n @property({ type: Boolean }) enableHoverPane = false;\n\n @property({ type: String }) manageCheckTitle = msg(\n 'Remove this item from the list',\n );\n\n private hoverPaneController?: HoverPaneControllerInterface;\n\n @query('#container')\n private container!: HTMLDivElement;\n\n @query('tile-hover-pane')\n private hoverPane?: TileHoverPane;\n\n /** Maps each display mode to whether hover panes should appear in that mode */\n private static readonly HOVER_PANE_DISPLAY_MODES: Record<\n TileDisplayMode,\n boolean\n > = {\n grid: true,\n 'list-compact': true,\n 'list-detail': false,\n 'list-header': false,\n };\n\n render() {\n const isGridMode = this.tileDisplayMode === 'grid';\n const hoverPaneTemplate =\n this.hoverPaneController?.getTemplate() ?? nothing;\n return html`\n <div id=\"container\" class=${isGridMode ? 'hoverable' : nothing}>\n ${this.tileDisplayMode === 'list-header'\n ? this.headerTemplate\n : this.tileTemplate}\n ${this.manageCheckTemplate} ${hoverPaneTemplate}\n </div>\n `;\n }\n\n protected firstUpdated(): void {\n if (this.shouldPrepareHoverPane) {\n this.hoverPaneController = new HoverPaneController(this, {\n mobileBreakpoint: this.mobileBreakpoint,\n enableLongPress: false,\n });\n }\n }\n\n private get headerTemplate() {\n const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } =\n this;\n return html`\n <tile-list-compact-header\n class=\"header\"\n .currentWidth=${currentWidth}\n .sortParam=${sortParam ?? defaultSortParam}\n .mobileBreakpoint=${mobileBreakpoint}\n >\n </tile-list-compact-header>\n `;\n }\n\n private get tileTemplate() {\n return html`\n ${this.tileDisplayMode === 'list-detail'\n ? this.tile\n : this.linkTileTemplate}\n `;\n }\n\n private get linkTileTemplate() {\n return html`\n <a\n href=${this.linkTileHref}\n aria-label=${this.model?.title ?? 'Untitled item'}\n title=${this.shouldPrepareHoverPane\n ? nothing // Don't show title tooltips when we have the tile info popups\n : ifDefined(this.model?.title)}\n @click=${this.handleLinkClicked}\n @contextmenu=${this.handleLinkContextMenu}\n >\n ${this.tile}\n </a>\n `;\n }\n\n private get linkTileHref(): string | typeof nothing {\n if (!this.model?.identifier || this.baseNavigationUrl == null)\n return nothing;\n\n // Use the server-specified href if available.\n // Otherwise, construct a details page URL from the item identifier.\n if (this.model.href) {\n return `${this.baseNavigationUrl}${this.model.href}`;\n }\n\n return this.displayValueProvider.itemPageUrl(\n this.model.identifier,\n this.model.mediatype === 'collection',\n );\n }\n\n private get manageCheckTemplate() {\n if (!this.isManageView || this.tileDisplayMode !== 'grid') return nothing;\n\n return html`\n <div class=\"manage-check\">\n <input\n type=\"checkbox\"\n title=${this.manageCheckTitle}\n .checked=${this.model?.checked}\n @change=${this.handleLinkClicked}\n />\n </div>\n `;\n }\n\n /**\n * Whether hover pane behavior should be prepared for this tile\n * (e.g., whether mouse listeners should be attached, etc.)\n */\n private get shouldPrepareHoverPane(): boolean {\n return (\n this.enableHoverPane &&\n !!this.tileDisplayMode &&\n TileDispatcher.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode] &&\n this.model?.mediatype !== 'search' && // don't show hover panes on search tiles\n !this.model?.captureDates // don't show hover panes on web archive tiles\n );\n }\n\n private get isHoverEnabled(): boolean {\n return window.matchMedia('(hover: hover)').matches;\n }\n\n /** @inheritdoc */\n getHoverPane(): TileHoverPane | undefined {\n return this.hoverPane;\n }\n\n /** @inheritdoc */\n getHoverPaneProps(): HoverPaneProperties {\n return this;\n }\n\n handleResize(entry: ResizeObserverEntry): void {\n this.currentWidth = entry.contentRect.width;\n this.currentHeight = entry.contentRect.height;\n }\n\n disconnectedCallback(): void {\n this.stopResizeObservation(this.resizeObserver);\n }\n\n private stopResizeObservation(observer?: SharedResizeObserverInterface) {\n observer?.removeObserver({\n handler: this,\n target: this.container,\n });\n }\n\n private startResizeObservation() {\n this.stopResizeObservation(this.resizeObserver);\n this.resizeObserver?.addObserver({\n handler: this,\n target: this.container,\n });\n }\n\n updated(props: PropertyValues) {\n if (props.has('resizeObserver')) {\n const previousObserver = props.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.stopResizeObservation(previousObserver);\n this.startResizeObservation();\n }\n }\n\n /**\n * Handler for when the tile link is left-clicked. Emits the `resultSelected` event.\n * In manage view, it also checks/unchecks the tile.\n */\n private handleLinkClicked(e: Event): void {\n if (this.isManageView) {\n e.preventDefault();\n if (this.model) this.model.checked = !this.model.checked;\n }\n\n this.dispatchEvent(\n new CustomEvent('resultSelected', { detail: this.model }),\n );\n }\n\n /**\n * Handler for when the tile link is right-clicked.\n * In manage view, it opens the item in a new tab. Otherwise, does nothing.\n */\n private handleLinkContextMenu(e: Event): void {\n if (this.isManageView && this.linkTileHref !== nothing) {\n e.preventDefault();\n window.open(this.linkTileHref, '_blank');\n }\n }\n\n private tileInfoButtonPressed(\n e: CustomEvent<{ x: number; y: number }>,\n ): void {\n this.hoverPaneController?.toggleHoverPane({\n coords: e.detail,\n enableTouchBackdrop: true,\n });\n }\n\n private get tile() {\n const {\n model,\n collectionPagePath,\n baseNavigationUrl,\n currentWidth,\n currentHeight,\n sortParam,\n creatorFilter,\n mobileBreakpoint,\n defaultSortParam,\n } = this;\n\n if (!model) return nothing;\n\n switch (this.tileDisplayMode) {\n case 'grid':\n switch (model.mediatype) {\n case 'collection':\n return html`<collection-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${!this.isHoverEnabled}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </collection-tile>`;\n case 'account':\n return html`<account-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${!this.isHoverEnabled}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </account-tile>`;\n case 'search':\n return html`<search-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${false}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </search-tile>`;\n default:\n return html`<item-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${this.currentWidth}\n .currentHeight=${this.currentHeight}\n .baseImageUrl=${this.baseImageUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .simpleLayoutType=${this.simpleLayoutType}\n ?showTvClips=${this.showTvClips}\n ?showInfoButton=${!this.isHoverEnabled}\n ?useLocalTime=${this.useLocalTime}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </item-tile>`;\n }\n case 'list-compact':\n return html`<tile-list-compact\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list-compact>`;\n case 'list-detail':\n return html`<tile-list\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .collectionTitles=${this.collectionTitles}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list>`;\n default:\n return nothing;\n }\n }\n\n static get styles() {\n return css`\n :host {\n display: block;\n height: 100%;\n }\n\n collection-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n }\n\n account-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #fcf5e6;\n }\n\n item-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #f1f1f4;\n }\n\n search-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n --iconFillColor: #2c2c2c;\n }\n\n #container {\n position: relative;\n height: 100%;\n border-radius: 4px;\n }\n\n #container.hoverable:hover {\n box-shadow: var(--tileHoverBoxShadow, 0 0 6px 2px rgba(8, 8, 32, 0.8));\n transition: box-shadow 0.1s ease;\n }\n\n a {\n display: block;\n height: 100%;\n color: unset;\n text-decoration: none;\n transition: transform 0.05s ease;\n }\n\n a :first-child {\n display: block;\n height: 100%;\n }\n\n .manage-check {\n position: absolute;\n right: 0;\n top: 0;\n border: 5px solid #2c2c2c;\n border-radius: 3px;\n background-color: #2c2c2c;\n z-index: 1;\n }\n\n .manage-check > input[type='checkbox'] {\n display: block;\n margin: 0;\n }\n\n #touch-backdrop {\n position: fixed;\n width: 100vw;\n height: 100vh;\n top: 0;\n left: 0;\n z-index: 2;\n background: transparent;\n }\n\n tile-hover-pane {\n position: absolute;\n top: 0;\n left: -9999px;\n z-index: 2;\n }\n `;\n }\n}\n"]}
@@ -1,47 +0,0 @@
1
- import { TemplateResult, nothing } from 'lit';
2
- import type { SortParam } from '@internetarchive/search-service';
3
- import type { TileModel } from '../models';
4
- /**
5
- * A class encapsulating shared logic for converting model values into display values
6
- * across different types of tiles.
7
- */
8
- export declare class TileDisplayValueProvider {
9
- private model?;
10
- private baseNavigationUrl?;
11
- private collectionPagePath?;
12
- private sortParam?;
13
- private creatorFilter?;
14
- constructor(options?: {
15
- model?: TileModel;
16
- baseNavigationUrl?: string;
17
- collectionPagePath?: string;
18
- sortParam?: SortParam;
19
- creatorFilter?: string;
20
- });
21
- /**
22
- * Examines the creator(s) for the given tile model, returning
23
- * the first creator whose name matches the provided filter
24
- * (or simply the first creator overall if no filter is provided).
25
- */
26
- get firstCreatorMatchingFilter(): string | undefined;
27
- /**
28
- * The label indicating what year an account item was created.
29
- * E.g., "Archivist since 2015"
30
- */
31
- get accountLabel(): string;
32
- /**
33
- * The readable label for the current sort if it is a type of date sort,
34
- * or the empty string otherwise.
35
- */
36
- get dateLabel(): string;
37
- /**
38
- * Produces a URL pointing at the item page for the given identifier,
39
- * using the current base URL and the correct path based on whether the
40
- * item is specified to be a collection (default false).
41
- */
42
- itemPageUrl(identifier?: string, isCollection?: boolean): string | typeof nothing;
43
- /**
44
- * Produces a template for a link to a single web capture of the given URL and date
45
- */
46
- webArchivesCaptureLink(url: string, date: Date): TemplateResult;
47
- }
@@ -1,95 +0,0 @@
1
- import { html, nothing } from 'lit';
2
- import { msg, str } from '@lit/localize';
3
- import { formatDate } from '../utils/format-date';
4
- /**
5
- * A class encapsulating shared logic for converting model values into display values
6
- * across different types of tiles.
7
- */
8
- export class TileDisplayValueProvider {
9
- constructor(options = {}) {
10
- var _a;
11
- this.model = options.model;
12
- this.baseNavigationUrl = options.baseNavigationUrl;
13
- this.collectionPagePath = (_a = options.collectionPagePath) !== null && _a !== void 0 ? _a : '/details/';
14
- this.sortParam = options.sortParam;
15
- this.creatorFilter = options.creatorFilter;
16
- }
17
- /**
18
- * Examines the creator(s) for the given tile model, returning
19
- * the first creator whose name matches the provided filter
20
- * (or simply the first creator overall if no filter is provided).
21
- */
22
- get firstCreatorMatchingFilter() {
23
- var _a, _b;
24
- let matchingCreator;
25
- // If we're filtering by creator initial and have multiple creators, we want
26
- // to surface the first creator who matches the filter.
27
- if (this.creatorFilter && ((_a = this.model) === null || _a === void 0 ? void 0 : _a.creators.length)) {
28
- const firstLetter = this.creatorFilter; // This is just to satisfy tsc
29
- matchingCreator = this.model.creators.find(creator =>
30
- // Decompose combining characters first, so that e.g., filtering on E matches É too.
31
- // Then remove anything that isn't strictly alphabetic, since our filters currently
32
- // only handle A-Z. The first such letter (if one exists) is what needs to match.
33
- creator
34
- .normalize('NFD')
35
- .replace(/[^A-Z]+/gi, '')
36
- .toUpperCase()
37
- .startsWith(firstLetter));
38
- }
39
- return matchingCreator !== null && matchingCreator !== void 0 ? matchingCreator : (_b = this.model) === null || _b === void 0 ? void 0 : _b.creator;
40
- }
41
- /**
42
- * The label indicating what year an account item was created.
43
- * E.g., "Archivist since 2015"
44
- */
45
- get accountLabel() {
46
- var _a;
47
- return ((_a = this.model) === null || _a === void 0 ? void 0 : _a.dateAdded)
48
- ? msg(str `Archivist since ${this.model.dateAdded.getFullYear()}`)
49
- : '';
50
- }
51
- /**
52
- * The readable label for the current sort if it is a type of date sort,
53
- * or the empty string otherwise.
54
- */
55
- get dateLabel() {
56
- var _a;
57
- switch ((_a = this.sortParam) === null || _a === void 0 ? void 0 : _a.field) {
58
- case 'publicdate':
59
- return msg('Archived');
60
- case 'reviewdate':
61
- return msg('Reviewed');
62
- case 'addeddate':
63
- return msg('Added');
64
- case 'date':
65
- return msg('Published');
66
- default:
67
- return '';
68
- }
69
- }
70
- /**
71
- * Produces a URL pointing at the item page for the given identifier,
72
- * using the current base URL and the correct path based on whether the
73
- * item is specified to be a collection (default false).
74
- */
75
- itemPageUrl(identifier, isCollection = false) {
76
- if (!identifier || this.baseNavigationUrl == null)
77
- return nothing;
78
- const basePath = isCollection ? this.collectionPagePath : '/details/';
79
- return `${this.baseNavigationUrl}${basePath}${identifier}`;
80
- }
81
- /**
82
- * Produces a template for a link to a single web capture of the given URL and date
83
- */
84
- webArchivesCaptureLink(url, date) {
85
- // Convert the date into the format used to identify wayback captures (e.g., '20150102124550')
86
- const captureDateStr = date
87
- .toISOString()
88
- .replace(/[TZ:-]/g, '')
89
- .replace(/\..*/, '');
90
- const captureHref = `https://web.archive.org/web/${captureDateStr}/${encodeURIComponent(url)}`;
91
- const captureText = formatDate(date, 'long');
92
- return html ` <a href=${captureHref}> ${captureText} </a> `;
93
- }
94
- }
95
- //# sourceMappingURL=tile-display-value-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tile-display-value-provider.js","sourceRoot":"","sources":["../../../src/tiles/tile-display-value-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IAWnC,YACE,UAMI,EA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SAAS;;QACX,QAAQ,MAAA,IAAI,CAAC,SAAS,0CAAE,KAAK,EAAE,CAAC;YAC9B,KAAK,YAAY;gBACf,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC;YACzB,KAAK,YAAY;gBACf,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC;YACzB,KAAK,WAAW;gBACd,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;YACtB,KAAK,MAAM;gBACT,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC;YAC1B;gBACE,OAAO,EAAE,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,WAAW,CACT,UAAmB,EACnB,YAAY,GAAG,KAAK;QAEpB,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI;YAAE,OAAO,OAAO,CAAC;QAClE,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC;QACtE,OAAO,GAAG,IAAI,CAAC,iBAAiB,GAAG,QAAQ,GAAG,UAAU,EAAE,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,GAAW,EAAE,IAAU;QAC5C,8FAA8F;QAC9F,MAAM,cAAc,GAAG,IAAI;aACxB,WAAW,EAAE;aACb,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;aACtB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACvB,MAAM,WAAW,GAAG,+BAA+B,cAAc,IAAI,kBAAkB,CACrF,GAAG,CACJ,EAAE,CAAC;QACJ,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAA,YAAY,WAAW,KAAK,WAAW,QAAQ,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import { TemplateResult, html, nothing } from 'lit';\nimport { msg, str } from '@lit/localize';\nimport type { SortParam } from '@internetarchive/search-service';\nimport type { TileModel } from '../models';\nimport { formatDate } from '../utils/format-date';\n\n/**\n * A class encapsulating shared logic for converting model values into display values\n * across different types of tiles.\n */\nexport class TileDisplayValueProvider {\n private model?: TileModel;\n\n private baseNavigationUrl?: string;\n\n private collectionPagePath?: string;\n\n private sortParam?: SortParam;\n\n private creatorFilter?: string;\n\n constructor(\n options: {\n model?: TileModel;\n baseNavigationUrl?: string;\n collectionPagePath?: string;\n sortParam?: SortParam;\n creatorFilter?: string;\n } = {},\n ) {\n this.model = options.model;\n this.baseNavigationUrl = options.baseNavigationUrl;\n this.collectionPagePath = options.collectionPagePath ?? '/details/';\n this.sortParam = options.sortParam;\n this.creatorFilter = options.creatorFilter;\n }\n\n /**\n * Examines the creator(s) for the given tile model, returning\n * the first creator whose name matches the provided filter\n * (or simply the first creator overall if no filter is provided).\n */\n get firstCreatorMatchingFilter(): string | undefined {\n let matchingCreator;\n\n // If we're filtering by creator initial and have multiple creators, we want\n // to surface the first creator who matches the filter.\n if (this.creatorFilter && this.model?.creators.length) {\n const firstLetter = this.creatorFilter; // This is just to satisfy tsc\n matchingCreator = this.model.creators.find(creator =>\n // Decompose combining characters first, so that e.g., filtering on E matches É too.\n // Then remove anything that isn't strictly alphabetic, since our filters currently\n // only handle A-Z. The first such letter (if one exists) is what needs to match.\n creator\n .normalize('NFD')\n .replace(/[^A-Z]+/gi, '')\n .toUpperCase()\n .startsWith(firstLetter),\n );\n }\n\n return matchingCreator ?? this.model?.creator;\n }\n\n /**\n * The label indicating what year an account item was created.\n * E.g., \"Archivist since 2015\"\n */\n get accountLabel(): string {\n return this.model?.dateAdded\n ? msg(str`Archivist since ${this.model.dateAdded.getFullYear()}`)\n : '';\n }\n\n /**\n * The readable label for the current sort if it is a type of date sort,\n * or the empty string otherwise.\n */\n get dateLabel(): string {\n switch (this.sortParam?.field) {\n case 'publicdate':\n return msg('Archived');\n case 'reviewdate':\n return msg('Reviewed');\n case 'addeddate':\n return msg('Added');\n case 'date':\n return msg('Published');\n default:\n return '';\n }\n }\n\n /**\n * Produces a URL pointing at the item page for the given identifier,\n * using the current base URL and the correct path based on whether the\n * item is specified to be a collection (default false).\n */\n itemPageUrl(\n identifier?: string,\n isCollection = false,\n ): string | typeof nothing {\n if (!identifier || this.baseNavigationUrl == null) return nothing;\n const basePath = isCollection ? this.collectionPagePath : '/details/';\n return `${this.baseNavigationUrl}${basePath}${identifier}`;\n }\n\n /**\n * Produces a template for a link to a single web capture of the given URL and date\n */\n webArchivesCaptureLink(url: string, date: Date): TemplateResult {\n // Convert the date into the format used to identify wayback captures (e.g., '20150102124550')\n const captureDateStr = date\n .toISOString()\n .replace(/[TZ:-]/g, '')\n .replace(/\\..*/, '');\n const captureHref = `https://web.archive.org/web/${captureDateStr}/${encodeURIComponent(\n url,\n )}`;\n const captureText = formatDate(date, 'long');\n\n return html` <a href=${captureHref}> ${captureText} </a> `;\n }\n}\n"]}