@internetarchive/collection-browser 3.3.1 → 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,220 +0,0 @@
1
- import type { SortParam } from '@internetarchive/search-service';
2
- import { HTMLTemplateResult, nothing, ReactiveController, ReactiveControllerHost } from 'lit';
3
- import type { TileModel } from '../../models';
4
- import type { CollectionTitles } from '../../data-source/models';
5
- export interface HoverPaneProperties {
6
- model?: TileModel;
7
- baseNavigationUrl?: string;
8
- baseImageUrl?: string;
9
- loggedIn: boolean;
10
- suppressBlurring: boolean;
11
- sortParam: SortParam | null;
12
- collectionTitles?: CollectionTitles;
13
- }
14
- export interface HoverPaneControllerOptions {
15
- offsetX?: number;
16
- offsetY?: number;
17
- enableLongPress?: boolean;
18
- showDelay?: number;
19
- hideDelay?: number;
20
- longPressDelay?: number;
21
- mobileBreakpoint?: number;
22
- }
23
- /** A common interface for providing a hover pane element. */
24
- export interface HoverPaneProviderInterface {
25
- /** Returns the provider's currently rendered hover pane element. */
26
- getHoverPane(): HTMLElement | undefined;
27
- /** Returns properties that should be passed to the hover pane. */
28
- getHoverPaneProps(): HoverPaneProperties;
29
- }
30
- export interface ToggleHoverPaneOptions {
31
- coords: {
32
- x: number;
33
- y: number;
34
- };
35
- enableTouchBackdrop?: boolean;
36
- }
37
- /**
38
- * An interface for interacting with hover pane controllers (e.g.,
39
- * to retrieve their current hover pane template).
40
- */
41
- export interface HoverPaneControllerInterface extends ReactiveController {
42
- /**
43
- * Returns the hover pane template to render based on this controller's
44
- * current state. The returned template may be `nothing` if the hover
45
- * pane should not currently be rendered.
46
- */
47
- getTemplate(): HTMLTemplateResult | typeof nothing;
48
- /**
49
- * Requests to manually toggle the state of the hover pane.
50
- * If the hover pane is already shown, it will begin fading out and then
51
- * subsequently be hidden and removed. If the hover pane is already fading
52
- * out or hidden, it will fade back in and be shown.
53
- */
54
- toggleHoverPane(options: ToggleHoverPaneOptions): void;
55
- }
56
- export declare class HoverPaneController implements HoverPaneControllerInterface {
57
- /** The host element to which this controller should attach listeners */
58
- private readonly host;
59
- /**
60
- * The hover pane element attached to this controller's host.
61
- */
62
- private hoverPane?;
63
- /**
64
- * The properties to be passed to the hover pane element
65
- */
66
- private hoverPaneProps?;
67
- /**
68
- * The breakpoint (in pixels) below which the mobile interface should be used.
69
- */
70
- private mobileBreakpoint?;
71
- /**
72
- * The number of horizontal pixels the hover pane should be offset from the
73
- * pointer position.
74
- */
75
- private offsetX;
76
- /**
77
- * The number of vertical pixels the hover pane should be offset from the
78
- * pointer position.
79
- */
80
- private offsetY;
81
- /**
82
- * The delay between the mouse idling within the host element and when the hover
83
- * pane should begin fading in (in milliseconds).
84
- */
85
- private showDelay;
86
- /**
87
- * The delay between when the mouse leaves the host element and when the hover
88
- * pane should begin fading out (in milliseconds).
89
- */
90
- private hideDelay;
91
- /**
92
- * The delay between when a touch event begins on the host element and when the
93
- * hover pane should begin fading in (in milliseconds).
94
- */
95
- private longPressDelay;
96
- /**
97
- * Whether long press interactions should cause the hover pane to appear (when
98
- * below the mobile breakpoint).
99
- */
100
- private enableLongPress;
101
- /**
102
- * Used to control the current state of this provider's hover pane.
103
- * - `'hidden'` => The hover pane is not present at all.
104
- * - `'shown'` => The hover pane is either fading in or fully visible.
105
- * - `'fading-out'` => The hover pane is fading out and about to be removed.
106
- */
107
- private hoverPaneState;
108
- /** The timer ID for showing the hover pane */
109
- private showTimer?;
110
- /** The timer ID for hiding the hover pane */
111
- private hideTimer?;
112
- /** The timer ID for recognizing a long press event */
113
- private longPressTimer?;
114
- /**
115
- * Whether the touch backdrop should currently be rendered irrespective of other touch
116
- * interactions being enabled.
117
- */
118
- private forceTouchBackdrop;
119
- /** A record of the last mouse position on the host element, for positioning the hover pane */
120
- private lastPointerClientPos;
121
- constructor(
122
- /** The host element to which this controller should attach listeners */
123
- host: ReactiveControllerHost & HoverPaneProviderInterface & HTMLElement,
124
- /** Options for adjusting the hover pane behavior (offsets, delays, etc.) */
125
- options?: HoverPaneControllerOptions);
126
- hostConnected(): void;
127
- hostDisconnected(): void;
128
- hostUpdated(): void;
129
- /** @inheritdoc */
130
- getTemplate(): HTMLTemplateResult | typeof nothing;
131
- /** @inheritdoc */
132
- toggleHoverPane(options: ToggleHoverPaneOptions): void;
133
- /**
134
- * Produces a template for the invisible touch capture backdrop that
135
- * is used to cancel the hover pane on touch devices. We want any
136
- * touch interaction on the backdrop to remove the hover pane, and
137
- * we don't want to bubble up mouse events that would otherwise
138
- * affect the state of the hover pane (e.g., fading it back in).
139
- */
140
- private get touchBackdropTemplate();
141
- private get showTouchBackdrop();
142
- /** Whether to use the mobile layout */
143
- private get isMobileView();
144
- private get isHoverEnabled();
145
- private get isTouchEnabled();
146
- /** Whether this controller should currently render its hover pane. */
147
- private get shouldRenderHoverPane();
148
- /**
149
- * Returns the desired top/left offsets (in pixels) for this tile's hover pane.
150
- * The desired offsets balance positioning the hover pane under the primary pointer
151
- * while preventing it from flowing outside the viewport. The returned offsets are
152
- * relative to the viewport, intended to position the pane as a popover element.
153
- *
154
- * These offsets are only valid if the hover pane is already rendered with its
155
- * correct width and height. If the hover pane is not present, the returned offsets
156
- * will simply represent the current pointer position.
157
- */
158
- private get hoverPaneDesiredOffsets();
159
- /**
160
- * Adds to the host element all the listeners necessary to make the
161
- * hover pane functional.
162
- */
163
- private attachListeners;
164
- /**
165
- * Removes all the hover pane listeners from the host element.
166
- */
167
- private detachListeners;
168
- /**
169
- * Handler for the mouseenter event on the host element.
170
- */
171
- private handleMouseEnter;
172
- /**
173
- * Handler for the mousemove event on the host element.
174
- * Aborts any pending hide/fade-out for the hover pane, and restarts the
175
- * timer to show it.
176
- */
177
- private handleMouseMove;
178
- /**
179
- * Handler for the mouseleave event on the host element.
180
- * Hides the hover pane if present, and aborts the timer for showing it.
181
- */
182
- private handleMouseLeave;
183
- /**
184
- * Handler for the touchstart event on the host element.
185
- * Begins the timer for recognizing a long press event.
186
- */
187
- private handleTouchStart;
188
- /**
189
- * Handler for events that should cancel a pending long press event
190
- * (touchmove, touchend, touchcancel). Aborts the timer for recognizing
191
- * a long press.
192
- */
193
- private handleLongPressCancel;
194
- /**
195
- * Handler for the contextmenu event, which should be suppressed during
196
- * mobile long-press events on the host element.
197
- */
198
- private handleContextMenu;
199
- /**
200
- * Immediately causes the hover pane to begin fading out, if it is present.
201
- */
202
- private handleBackdropInteraction;
203
- /**
204
- * Aborts and restarts the timer for showing the hover pane.
205
- */
206
- private restartShowHoverPaneTimer;
207
- /**
208
- * Causes this tile's hover pane to be rendered, positioned, and made visible.
209
- */
210
- private showHoverPane;
211
- /**
212
- * Causes this tile's hover pane to begin fading out and starts
213
- * the timer for it to be removed.
214
- */
215
- private fadeOutHoverPane;
216
- /**
217
- * Positions the hover pane with the correct offsets.
218
- */
219
- private repositionHoverPane;
220
- }
@@ -1,378 +0,0 @@
1
- import { html, nothing, } from 'lit';
2
- const clamp = (val, min = -Infinity, max = Infinity) => Math.max(min, Math.min(val, max));
3
- export class HoverPaneController {
4
- constructor(
5
- /** The host element to which this controller should attach listeners */
6
- host,
7
- /** Options for adjusting the hover pane behavior (offsets, delays, etc.) */
8
- options = {}) {
9
- var _a, _b, _c, _d, _e, _f, _g;
10
- this.host = host;
11
- /**
12
- * The breakpoint (in pixels) below which the mobile interface should be used.
13
- */
14
- this.mobileBreakpoint = 600;
15
- /**
16
- * The number of horizontal pixels the hover pane should be offset from the
17
- * pointer position.
18
- */
19
- this.offsetX = -10;
20
- /**
21
- * The number of vertical pixels the hover pane should be offset from the
22
- * pointer position.
23
- */
24
- this.offsetY = 15;
25
- /**
26
- * The delay between the mouse idling within the host element and when the hover
27
- * pane should begin fading in (in milliseconds).
28
- */
29
- this.showDelay = 300;
30
- /**
31
- * The delay between when the mouse leaves the host element and when the hover
32
- * pane should begin fading out (in milliseconds).
33
- */
34
- this.hideDelay = 100;
35
- /**
36
- * The delay between when a touch event begins on the host element and when the
37
- * hover pane should begin fading in (in milliseconds).
38
- */
39
- this.longPressDelay = 600;
40
- /**
41
- * Whether long press interactions should cause the hover pane to appear (when
42
- * below the mobile breakpoint).
43
- */
44
- this.enableLongPress = false;
45
- /**
46
- * Used to control the current state of this provider's hover pane.
47
- * - `'hidden'` => The hover pane is not present at all.
48
- * - `'shown'` => The hover pane is either fading in or fully visible.
49
- * - `'fading-out'` => The hover pane is fading out and about to be removed.
50
- */
51
- this.hoverPaneState = 'hidden';
52
- /**
53
- * Whether the touch backdrop should currently be rendered irrespective of other touch
54
- * interactions being enabled.
55
- */
56
- this.forceTouchBackdrop = false;
57
- /** A record of the last mouse position on the host element, for positioning the hover pane */
58
- this.lastPointerClientPos = { x: 0, y: 0 };
59
- /**
60
- * Handler for the mouseenter event on the host element.
61
- */
62
- // NB: Arrow function so 'this' remains bound to the controller
63
- this.handleMouseEnter = (e) => {
64
- // Delegate to the mousemove handler, as they are currently processed identically
65
- this.handleMouseMove(e);
66
- };
67
- /**
68
- * Handler for the mousemove event on the host element.
69
- * Aborts any pending hide/fade-out for the hover pane, and restarts the
70
- * timer to show it.
71
- */
72
- // NB: Arrow function so 'this' remains bound to the controller
73
- this.handleMouseMove = (e) => {
74
- var _a;
75
- // The mouse is within the tile, so abort any pending removal of the hover pane
76
- clearTimeout(this.hideTimer);
77
- // If the hover pane is currently fading out, just make it fade back in where it is
78
- if (this.hoverPaneState === 'fading-out') {
79
- this.hoverPaneState = 'shown';
80
- (_a = this.hoverPane) === null || _a === void 0 ? void 0 : _a.classList.add('fade-in');
81
- }
82
- // Restart the timer to show the hover pane anytime the mouse moves within the tile
83
- if (this.hoverPaneState === 'hidden') {
84
- this.restartShowHoverPaneTimer();
85
- this.lastPointerClientPos = { x: e.clientX, y: e.clientY };
86
- }
87
- };
88
- /**
89
- * Handler for the mouseleave event on the host element.
90
- * Hides the hover pane if present, and aborts the timer for showing it.
91
- */
92
- // NB: Arrow function so 'this' remains bound to the controller
93
- this.handleMouseLeave = () => {
94
- // Abort any timer to show the hover pane, as the mouse has left the tile
95
- clearTimeout(this.showTimer);
96
- // Hide the hover pane if it's already been shown
97
- clearTimeout(this.hideTimer);
98
- if (this.hoverPaneState !== 'hidden') {
99
- this.hideTimer = window.setTimeout(() => {
100
- this.fadeOutHoverPane();
101
- }, this.hideDelay);
102
- }
103
- };
104
- /**
105
- * Handler for the touchstart event on the host element.
106
- * Begins the timer for recognizing a long press event.
107
- */
108
- // NB: Arrow function so 'this' remains bound to the controller
109
- this.handleTouchStart = (e) => {
110
- clearTimeout(this.longPressTimer);
111
- if (e.touches.length === 1) {
112
- this.longPressTimer = window.setTimeout(() => {
113
- if (this.hoverPaneState === 'hidden') {
114
- this.showHoverPane();
115
- }
116
- }, this.longPressDelay);
117
- this.lastPointerClientPos = {
118
- x: e.touches[0].clientX,
119
- y: e.touches[0].clientY,
120
- };
121
- }
122
- };
123
- /**
124
- * Handler for events that should cancel a pending long press event
125
- * (touchmove, touchend, touchcancel). Aborts the timer for recognizing
126
- * a long press.
127
- */
128
- // NB: Arrow function so 'this' remains bound to the controller
129
- this.handleLongPressCancel = () => {
130
- clearTimeout(this.longPressTimer);
131
- };
132
- /**
133
- * Handler for the contextmenu event, which should be suppressed during
134
- * mobile long-press events on the host element.
135
- */
136
- // NB: Arrow function so 'this' remains bound to the controller
137
- this.handleContextMenu = (e) => {
138
- e.preventDefault();
139
- };
140
- /**
141
- * Immediately causes the hover pane to begin fading out, if it is present.
142
- */
143
- // NB: Arrow function so 'this' remains bound to the controller
144
- this.handleBackdropInteraction = (e) => {
145
- if (this.hoverPaneState !== 'hidden') {
146
- this.fadeOutHoverPane();
147
- }
148
- e.stopPropagation();
149
- };
150
- this.mobileBreakpoint = (_a = options.mobileBreakpoint) !== null && _a !== void 0 ? _a : this.mobileBreakpoint;
151
- this.offsetX = (_b = options.offsetX) !== null && _b !== void 0 ? _b : this.offsetX;
152
- this.offsetY = (_c = options.offsetY) !== null && _c !== void 0 ? _c : this.offsetY;
153
- this.showDelay = (_d = options.showDelay) !== null && _d !== void 0 ? _d : this.showDelay;
154
- this.hideDelay = (_e = options.hideDelay) !== null && _e !== void 0 ? _e : this.hideDelay;
155
- this.longPressDelay = (_f = options.longPressDelay) !== null && _f !== void 0 ? _f : this.longPressDelay;
156
- this.enableLongPress = (_g = options.enableLongPress) !== null && _g !== void 0 ? _g : this.enableLongPress;
157
- this.host.addController(this);
158
- }
159
- hostConnected() {
160
- this.attachListeners();
161
- }
162
- hostDisconnected() {
163
- this.detachListeners();
164
- }
165
- hostUpdated() {
166
- this.hoverPane = this.host.getHoverPane();
167
- this.hoverPaneProps = this.host.getHoverPaneProps();
168
- }
169
- /** @inheritdoc */
170
- getTemplate() {
171
- var _a, _b, _c, _d, _e, _f, _g;
172
- this.hoverPaneProps = this.host.getHoverPaneProps();
173
- return this.shouldRenderHoverPane
174
- ? html ` ${this.touchBackdropTemplate}
175
- <tile-hover-pane
176
- popover
177
- .model=${(_a = this.hoverPaneProps) === null || _a === void 0 ? void 0 : _a.model}
178
- .baseNavigationUrl=${(_b = this.hoverPaneProps) === null || _b === void 0 ? void 0 : _b.baseNavigationUrl}
179
- .baseImageUrl=${(_c = this.hoverPaneProps) === null || _c === void 0 ? void 0 : _c.baseImageUrl}
180
- .loggedIn=${(_d = this.hoverPaneProps) === null || _d === void 0 ? void 0 : _d.loggedIn}
181
- .suppressBlurring=${(_e = this.hoverPaneProps) === null || _e === void 0 ? void 0 : _e.suppressBlurring}
182
- .sortParam=${(_f = this.hoverPaneProps) === null || _f === void 0 ? void 0 : _f.sortParam}
183
- .collectionTitles=${(_g = this.hoverPaneProps) === null || _g === void 0 ? void 0 : _g.collectionTitles}
184
- .mobileBreakpoint=${this.mobileBreakpoint}
185
- .currentWidth=${window.innerWidth}
186
- ></tile-hover-pane>`
187
- : nothing;
188
- }
189
- /** @inheritdoc */
190
- toggleHoverPane(options) {
191
- var _a;
192
- if (this.hoverPaneState === 'shown') {
193
- this.fadeOutHoverPane();
194
- this.forceTouchBackdrop = false;
195
- }
196
- else {
197
- this.lastPointerClientPos = options.coords;
198
- this.forceTouchBackdrop = (_a = options.enableTouchBackdrop) !== null && _a !== void 0 ? _a : false;
199
- this.showHoverPane();
200
- }
201
- }
202
- /**
203
- * Produces a template for the invisible touch capture backdrop that
204
- * is used to cancel the hover pane on touch devices. We want any
205
- * touch interaction on the backdrop to remove the hover pane, and
206
- * we don't want to bubble up mouse events that would otherwise
207
- * affect the state of the hover pane (e.g., fading it back in).
208
- */
209
- get touchBackdropTemplate() {
210
- return this.showTouchBackdrop
211
- ? html `<div
212
- id="touch-backdrop"
213
- @touchstart=${this.handleBackdropInteraction}
214
- @touchmove=${this.handleBackdropInteraction}
215
- @touchend=${this.handleBackdropInteraction}
216
- @touchcancel=${this.handleBackdropInteraction}
217
- @mouseenter=${(e) => e.stopPropagation()}
218
- @mousemove=${(e) => e.stopPropagation()}
219
- @mouseleave=${(e) => e.stopPropagation()}
220
- ></div>`
221
- : nothing;
222
- }
223
- get showTouchBackdrop() {
224
- return ((this.isTouchEnabled && this.enableLongPress) || this.forceTouchBackdrop);
225
- }
226
- /** Whether to use the mobile layout */
227
- get isMobileView() {
228
- return !!this.mobileBreakpoint && window.innerWidth < this.mobileBreakpoint;
229
- }
230
- get isHoverEnabled() {
231
- return window.matchMedia('(hover: hover)').matches;
232
- }
233
- get isTouchEnabled() {
234
- return ('ontouchstart' in window &&
235
- window.matchMedia('(any-pointer: coarse)').matches);
236
- }
237
- /** Whether this controller should currently render its hover pane. */
238
- get shouldRenderHoverPane() {
239
- return this.hoverPaneState !== 'hidden';
240
- }
241
- /**
242
- * Returns the desired top/left offsets (in pixels) for this tile's hover pane.
243
- * The desired offsets balance positioning the hover pane under the primary pointer
244
- * while preventing it from flowing outside the viewport. The returned offsets are
245
- * relative to the viewport, intended to position the pane as a popover element.
246
- *
247
- * These offsets are only valid if the hover pane is already rendered with its
248
- * correct width and height. If the hover pane is not present, the returned offsets
249
- * will simply represent the current pointer position.
250
- */
251
- get hoverPaneDesiredOffsets() {
252
- // Try to find offsets for the hover pane that:
253
- // (a) cause it to lie entirely within the viewport, and
254
- // (b) to the extent possible, minimize the distance between the
255
- // nearest corner of the hover pane and the mouse position
256
- // (with some additional offsets applied after the fact).
257
- var _a;
258
- let [left, top] = [
259
- this.lastPointerClientPos.x,
260
- this.lastPointerClientPos.y,
261
- ];
262
- // Flip the hover pane according to which quadrant of the viewport the mouse is in.
263
- // (Similar to how Wikipedia's link hover panes work)
264
- const flipHorizontal = this.lastPointerClientPos.x > window.innerWidth / 2;
265
- const flipVertical = this.lastPointerClientPos.y > window.innerHeight / 2;
266
- const hoverPaneRect = (_a = this.hoverPane) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
267
- if (hoverPaneRect) {
268
- // If we need to flip the hover pane, do so by subtracting its width/height from left/top
269
- if (flipHorizontal) {
270
- left -= hoverPaneRect.width;
271
- }
272
- if (flipVertical) {
273
- top -= hoverPaneRect.height;
274
- }
275
- // Apply desired offsets from the mouse position
276
- left += (flipHorizontal ? -1 : 1) * this.offsetX;
277
- top += (flipVertical ? -1 : 1) * this.offsetY;
278
- // On mobile view, shunt the hover pane to avoid overflowing the viewport
279
- if (this.isMobileView) {
280
- left = clamp(left, 20, window.innerWidth - hoverPaneRect.width - 20);
281
- top = clamp(top, 20, window.innerHeight - hoverPaneRect.height - 20);
282
- }
283
- }
284
- left += window.scrollX;
285
- top += window.scrollY;
286
- return { left, top };
287
- }
288
- /**
289
- * Adds to the host element all the listeners necessary to make the
290
- * hover pane functional.
291
- */
292
- attachListeners() {
293
- if (this.isHoverEnabled) {
294
- this.host.addEventListener('mouseenter', this.handleMouseEnter);
295
- this.host.addEventListener('mousemove', this.handleMouseMove);
296
- this.host.addEventListener('mouseleave', this.handleMouseLeave);
297
- }
298
- if (this.isTouchEnabled && this.enableLongPress) {
299
- this.host.addEventListener('touchstart', this.handleTouchStart);
300
- this.host.addEventListener('touchmove', this.handleLongPressCancel);
301
- this.host.addEventListener('touchend', this.handleLongPressCancel);
302
- this.host.addEventListener('touchcancel', this.handleLongPressCancel);
303
- this.host.addEventListener('contextmenu', this.handleContextMenu);
304
- }
305
- }
306
- /**
307
- * Removes all the hover pane listeners from the host element.
308
- */
309
- detachListeners() {
310
- this.host.removeEventListener('mouseenter', this.handleMouseEnter);
311
- this.host.removeEventListener('mousemove', this.handleMouseMove);
312
- this.host.removeEventListener('mouseleave', this.handleMouseLeave);
313
- this.host.removeEventListener('touchstart', this.handleTouchStart);
314
- this.host.removeEventListener('touchmove', this.handleLongPressCancel);
315
- this.host.removeEventListener('touchend', this.handleLongPressCancel);
316
- this.host.removeEventListener('touchcancel', this.handleLongPressCancel);
317
- this.host.removeEventListener('contextmenu', this.handleContextMenu);
318
- }
319
- /**
320
- * Aborts and restarts the timer for showing the hover pane.
321
- */
322
- restartShowHoverPaneTimer() {
323
- clearTimeout(this.showTimer);
324
- this.showTimer = window.setTimeout(() => {
325
- this.showHoverPane();
326
- }, this.showDelay);
327
- }
328
- /**
329
- * Causes this tile's hover pane to be rendered, positioned, and made visible.
330
- */
331
- async showHoverPane() {
332
- var _a, _b, _c, _d;
333
- this.hoverPaneState = 'shown';
334
- this.host.requestUpdate();
335
- // Wait for the state update to render the hover pane
336
- await this.host.updateComplete;
337
- // Ensure the hover pane element is still in the document before showing,
338
- // as it might have been removed by the previous update.
339
- if (!((_a = this.hoverPane) === null || _a === void 0 ? void 0 : _a.isConnected))
340
- return;
341
- (_c = (_b = this.hoverPane) === null || _b === void 0 ? void 0 : _b.showPopover) === null || _c === void 0 ? void 0 : _c.call(_b);
342
- await new Promise(resolve => {
343
- // Pane sizes aren't accurate until next frame
344
- requestAnimationFrame(resolve);
345
- });
346
- // Apply the correct positioning to the hover pane
347
- this.repositionHoverPane();
348
- // The hover pane is initially not visible (to avoid it shifting around
349
- // while being positioned). Since it now has the correct positioning, we
350
- // can make it visible and begin its fade-in animation.
351
- (_d = this.hoverPane) === null || _d === void 0 ? void 0 : _d.classList.add('visible', 'fade-in');
352
- }
353
- /**
354
- * Causes this tile's hover pane to begin fading out and starts
355
- * the timer for it to be removed.
356
- */
357
- fadeOutHoverPane() {
358
- var _a;
359
- this.hoverPaneState = 'fading-out';
360
- (_a = this.hoverPane) === null || _a === void 0 ? void 0 : _a.classList.remove('fade-in');
361
- clearTimeout(this.hideTimer);
362
- this.hideTimer = window.setTimeout(() => {
363
- this.hoverPaneState = 'hidden';
364
- this.host.requestUpdate();
365
- }, 100);
366
- }
367
- /**
368
- * Positions the hover pane with the correct offsets.
369
- */
370
- repositionHoverPane() {
371
- if (!this.hoverPane)
372
- return;
373
- const { top, left } = this.hoverPaneDesiredOffsets;
374
- this.hoverPane.style.top = `${top}px`;
375
- this.hoverPane.style.left = `${left}px`;
376
- }
377
- }
378
- //# sourceMappingURL=hover-pane-controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hover-pane-controller.js","sourceRoot":"","sources":["../../../../src/tiles/hover/hover-pane-controller.ts"],"names":[],"mappings":"AACA,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,\n HTMLTemplateResult,\n nothing,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\nimport type { TileModel } from '../../models';\nimport type { CollectionTitles } from '../../data-source/models';\n\ntype HoverPaneState = 'hidden' | 'shown' | 'fading-out';\n\nexport interface HoverPaneProperties {\n model?: TileModel;\n baseNavigationUrl?: string;\n baseImageUrl?: string;\n loggedIn: boolean;\n suppressBlurring: boolean;\n sortParam: SortParam | null;\n collectionTitles?: CollectionTitles;\n}\n\nexport interface HoverPaneControllerOptions {\n offsetX?: number;\n offsetY?: number;\n enableLongPress?: boolean;\n showDelay?: number;\n hideDelay?: number;\n longPressDelay?: number;\n mobileBreakpoint?: number;\n}\n\n/** A common interface for providing a hover pane element. */\nexport interface HoverPaneProviderInterface {\n /** Returns the provider's currently rendered hover pane element. */\n getHoverPane(): HTMLElement | undefined;\n /** Returns properties that should be passed to the hover pane. */\n getHoverPaneProps(): HoverPaneProperties;\n}\n\nexport interface ToggleHoverPaneOptions {\n coords: { x: number; y: number };\n enableTouchBackdrop?: boolean;\n}\n\n/**\n * An interface for interacting with hover pane controllers (e.g.,\n * to retrieve their current hover pane template).\n */\nexport interface HoverPaneControllerInterface extends ReactiveController {\n /**\n * Returns the hover pane template to render based on this controller's\n * current state. The returned template may be `nothing` if the hover\n * pane should not currently be rendered.\n */\n getTemplate(): HTMLTemplateResult | typeof nothing;\n\n /**\n * Requests to manually toggle the state of the hover pane.\n * If the hover pane is already shown, it will begin fading out and then\n * subsequently be hidden and removed. If the hover pane is already fading\n * out or hidden, it will fade back in and be shown.\n */\n toggleHoverPane(options: ToggleHoverPaneOptions): void;\n}\n\nconst clamp = (val: number, min = -Infinity, max = Infinity) =>\n Math.max(min, Math.min(val, max));\n\nexport class HoverPaneController implements HoverPaneControllerInterface {\n /**\n * The hover pane element attached to this controller's host.\n */\n private hoverPane?: HTMLElement;\n\n /**\n * The properties to be passed to the hover pane element\n */\n private hoverPaneProps?: HoverPaneProperties;\n\n /**\n * The breakpoint (in pixels) below which the mobile interface should be used.\n */\n private mobileBreakpoint?: number = 600;\n\n /**\n * The number of horizontal pixels the hover pane should be offset from the\n * pointer position.\n */\n private offsetX: number = -10;\n\n /**\n * The number of vertical pixels the hover pane should be offset from the\n * pointer position.\n */\n private offsetY: number = 15;\n\n /**\n * The delay between the mouse idling within the host element and when the hover\n * pane should begin fading in (in milliseconds).\n */\n private showDelay: number = 300;\n\n /**\n * The delay between when the mouse leaves the host element and when the hover\n * pane should begin fading out (in milliseconds).\n */\n private hideDelay: number = 100;\n\n /**\n * The delay between when a touch event begins on the host element and when the\n * hover pane should begin fading in (in milliseconds).\n */\n private longPressDelay: number = 600;\n\n /**\n * Whether long press interactions should cause the hover pane to appear (when\n * below the mobile breakpoint).\n */\n private enableLongPress: boolean = false;\n\n /**\n * Used to control the current state of this provider's hover pane.\n * - `'hidden'` => The hover pane is not present at all.\n * - `'shown'` => The hover pane is either fading in or fully visible.\n * - `'fading-out'` => The hover pane is fading out and about to be removed.\n */\n private hoverPaneState: HoverPaneState = 'hidden';\n\n /** The timer ID for showing the hover pane */\n private showTimer?: number;\n\n /** The timer ID for hiding the hover pane */\n private hideTimer?: number;\n\n /** The timer ID for recognizing a long press event */\n private longPressTimer?: number;\n\n /**\n * Whether the touch backdrop should currently be rendered irrespective of other touch\n * interactions being enabled.\n */\n private forceTouchBackdrop: boolean = false;\n\n /** A record of the last mouse position on the host element, for positioning the hover pane */\n private lastPointerClientPos = { x: 0, y: 0 };\n\n constructor(\n /** The host element to which this controller should attach listeners */\n private readonly host: ReactiveControllerHost &\n HoverPaneProviderInterface &\n HTMLElement,\n /** Options for adjusting the hover pane behavior (offsets, delays, etc.) */\n options: HoverPaneControllerOptions = {},\n ) {\n this.mobileBreakpoint = options.mobileBreakpoint ?? this.mobileBreakpoint;\n this.offsetX = options.offsetX ?? this.offsetX;\n this.offsetY = options.offsetY ?? this.offsetY;\n this.showDelay = options.showDelay ?? this.showDelay;\n this.hideDelay = options.hideDelay ?? this.hideDelay;\n this.longPressDelay = options.longPressDelay ?? this.longPressDelay;\n this.enableLongPress = options.enableLongPress ?? this.enableLongPress;\n\n this.host.addController(this);\n }\n\n hostConnected(): void {\n this.attachListeners();\n }\n\n hostDisconnected(): void {\n this.detachListeners();\n }\n\n hostUpdated(): void {\n this.hoverPane = this.host.getHoverPane();\n this.hoverPaneProps = this.host.getHoverPaneProps();\n }\n\n /** @inheritdoc */\n getTemplate(): HTMLTemplateResult | typeof nothing {\n this.hoverPaneProps = this.host.getHoverPaneProps();\n\n return this.shouldRenderHoverPane\n ? html` ${this.touchBackdropTemplate}\n <tile-hover-pane\n popover\n .model=${this.hoverPaneProps?.model}\n .baseNavigationUrl=${this.hoverPaneProps?.baseNavigationUrl}\n .baseImageUrl=${this.hoverPaneProps?.baseImageUrl}\n .loggedIn=${this.hoverPaneProps?.loggedIn}\n .suppressBlurring=${this.hoverPaneProps?.suppressBlurring}\n .sortParam=${this.hoverPaneProps?.sortParam}\n .collectionTitles=${this.hoverPaneProps?.collectionTitles}\n .mobileBreakpoint=${this.mobileBreakpoint}\n .currentWidth=${window.innerWidth}\n ></tile-hover-pane>`\n : nothing;\n }\n\n /** @inheritdoc */\n toggleHoverPane(options: ToggleHoverPaneOptions): void {\n if (this.hoverPaneState === 'shown') {\n this.fadeOutHoverPane();\n this.forceTouchBackdrop = false;\n } else {\n this.lastPointerClientPos = options.coords;\n this.forceTouchBackdrop = options.enableTouchBackdrop ?? false;\n this.showHoverPane();\n }\n }\n\n /**\n * Produces a template for the invisible touch capture backdrop that\n * is used to cancel the hover pane on touch devices. We want any\n * touch interaction on the backdrop to remove the hover pane, and\n * we don't want to bubble up mouse events that would otherwise\n * affect the state of the hover pane (e.g., fading it back in).\n */\n private get touchBackdropTemplate(): HTMLTemplateResult | typeof nothing {\n return this.showTouchBackdrop\n ? html`<div\n id=\"touch-backdrop\"\n @touchstart=${this.handleBackdropInteraction}\n @touchmove=${this.handleBackdropInteraction}\n @touchend=${this.handleBackdropInteraction}\n @touchcancel=${this.handleBackdropInteraction}\n @mouseenter=${(e: MouseEvent) => e.stopPropagation()}\n @mousemove=${(e: MouseEvent) => e.stopPropagation()}\n @mouseleave=${(e: MouseEvent) => e.stopPropagation()}\n ></div>`\n : nothing;\n }\n\n private get showTouchBackdrop(): boolean {\n return (\n (this.isTouchEnabled && this.enableLongPress) || this.forceTouchBackdrop\n );\n }\n\n /** Whether to use the mobile layout */\n private get isMobileView(): boolean {\n return !!this.mobileBreakpoint && window.innerWidth < this.mobileBreakpoint;\n }\n\n private get isHoverEnabled(): boolean {\n return window.matchMedia('(hover: hover)').matches;\n }\n\n private get isTouchEnabled(): boolean {\n return (\n 'ontouchstart' in window &&\n window.matchMedia('(any-pointer: coarse)').matches\n );\n }\n\n /** Whether this controller should currently render its hover pane. */\n private get shouldRenderHoverPane(): boolean {\n return this.hoverPaneState !== 'hidden';\n }\n\n /**\n * Returns the desired top/left offsets (in pixels) for this tile's hover pane.\n * The desired offsets balance positioning the hover pane under the primary pointer\n * while preventing it from flowing outside the viewport. The returned offsets are\n * relative to the viewport, intended to position the pane as a popover element.\n *\n * These offsets are only valid if the hover pane is already rendered with its\n * correct width and height. If the hover pane is not present, the returned offsets\n * will simply represent the current pointer position.\n */\n private get hoverPaneDesiredOffsets(): { top: number; left: number } {\n // Try to find offsets for the hover pane that:\n // (a) cause it to lie entirely within the viewport, and\n // (b) to the extent possible, minimize the distance between the\n // nearest corner of the hover pane and the mouse position\n // (with some additional offsets applied after the fact).\n\n let [left, top] = [\n this.lastPointerClientPos.x,\n this.lastPointerClientPos.y,\n ];\n\n // Flip the hover pane according to which quadrant of the viewport the mouse is in.\n // (Similar to how Wikipedia's link hover panes work)\n const flipHorizontal = this.lastPointerClientPos.x > window.innerWidth / 2;\n const flipVertical = this.lastPointerClientPos.y > window.innerHeight / 2;\n\n const hoverPaneRect = this.hoverPane?.getBoundingClientRect();\n if (hoverPaneRect) {\n // If we need to flip the hover pane, do so by subtracting its width/height from left/top\n if (flipHorizontal) {\n left -= hoverPaneRect.width;\n }\n if (flipVertical) {\n top -= hoverPaneRect.height;\n }\n\n // Apply desired offsets from the mouse position\n left += (flipHorizontal ? -1 : 1) * this.offsetX;\n top += (flipVertical ? -1 : 1) * this.offsetY;\n\n // On mobile view, shunt the hover pane to avoid overflowing the viewport\n if (this.isMobileView) {\n left = clamp(left, 20, window.innerWidth - hoverPaneRect.width - 20);\n top = clamp(top, 20, window.innerHeight - hoverPaneRect.height - 20);\n }\n }\n\n left += window.scrollX;\n top += window.scrollY;\n\n return { left, top };\n }\n\n /**\n * Adds to the host element all the listeners necessary to make the\n * hover pane functional.\n */\n private attachListeners(): void {\n if (this.isHoverEnabled) {\n this.host.addEventListener('mouseenter', this.handleMouseEnter);\n this.host.addEventListener('mousemove', this.handleMouseMove);\n this.host.addEventListener('mouseleave', this.handleMouseLeave);\n }\n\n if (this.isTouchEnabled && this.enableLongPress) {\n this.host.addEventListener('touchstart', this.handleTouchStart);\n this.host.addEventListener('touchmove', this.handleLongPressCancel);\n this.host.addEventListener('touchend', this.handleLongPressCancel);\n this.host.addEventListener('touchcancel', this.handleLongPressCancel);\n this.host.addEventListener('contextmenu', this.handleContextMenu);\n }\n }\n\n /**\n * Removes all the hover pane listeners from the host element.\n */\n private detachListeners(): void {\n this.host.removeEventListener('mouseenter', this.handleMouseEnter);\n this.host.removeEventListener('mousemove', this.handleMouseMove);\n this.host.removeEventListener('mouseleave', this.handleMouseLeave);\n this.host.removeEventListener('touchstart', this.handleTouchStart);\n this.host.removeEventListener('touchmove', this.handleLongPressCancel);\n this.host.removeEventListener('touchend', this.handleLongPressCancel);\n this.host.removeEventListener('touchcancel', this.handleLongPressCancel);\n this.host.removeEventListener('contextmenu', this.handleContextMenu);\n }\n\n /**\n * Handler for the mouseenter event on the host element.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleMouseEnter = (e: MouseEvent): void => {\n // Delegate to the mousemove handler, as they are currently processed identically\n this.handleMouseMove(e);\n };\n\n /**\n * Handler for the mousemove event on the host element.\n * Aborts any pending hide/fade-out for the hover pane, and restarts the\n * timer to show it.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleMouseMove = (e: MouseEvent): void => {\n // The mouse is within the tile, so abort any pending removal of the hover pane\n clearTimeout(this.hideTimer);\n\n // If the hover pane is currently fading out, just make it fade back in where it is\n if (this.hoverPaneState === 'fading-out') {\n this.hoverPaneState = 'shown';\n this.hoverPane?.classList.add('fade-in');\n }\n\n // Restart the timer to show the hover pane anytime the mouse moves within the tile\n if (this.hoverPaneState === 'hidden') {\n this.restartShowHoverPaneTimer();\n this.lastPointerClientPos = { x: e.clientX, y: e.clientY };\n }\n };\n\n /**\n * Handler for the mouseleave event on the host element.\n * Hides the hover pane if present, and aborts the timer for showing it.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleMouseLeave = (): void => {\n // Abort any timer to show the hover pane, as the mouse has left the tile\n clearTimeout(this.showTimer);\n\n // Hide the hover pane if it's already been shown\n clearTimeout(this.hideTimer);\n if (this.hoverPaneState !== 'hidden') {\n this.hideTimer = window.setTimeout(() => {\n this.fadeOutHoverPane();\n }, this.hideDelay);\n }\n };\n\n /**\n * Handler for the touchstart event on the host element.\n * Begins the timer for recognizing a long press event.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleTouchStart = (e: TouchEvent): void => {\n clearTimeout(this.longPressTimer);\n\n if (e.touches.length === 1) {\n this.longPressTimer = window.setTimeout(() => {\n if (this.hoverPaneState === 'hidden') {\n this.showHoverPane();\n }\n }, this.longPressDelay);\n\n this.lastPointerClientPos = {\n x: e.touches[0].clientX,\n y: e.touches[0].clientY,\n };\n }\n };\n\n /**\n * Handler for events that should cancel a pending long press event\n * (touchmove, touchend, touchcancel). Aborts the timer for recognizing\n * a long press.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleLongPressCancel = (): void => {\n clearTimeout(this.longPressTimer);\n };\n\n /**\n * Handler for the contextmenu event, which should be suppressed during\n * mobile long-press events on the host element.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleContextMenu = (e: Event): void => {\n e.preventDefault();\n };\n\n /**\n * Immediately causes the hover pane to begin fading out, if it is present.\n */\n // NB: Arrow function so 'this' remains bound to the controller\n private handleBackdropInteraction = (e: Event): void => {\n if (this.hoverPaneState !== 'hidden') {\n this.fadeOutHoverPane();\n }\n e.stopPropagation();\n };\n\n /**\n * Aborts and restarts the timer for showing the hover pane.\n */\n private restartShowHoverPaneTimer(): void {\n clearTimeout(this.showTimer);\n this.showTimer = window.setTimeout(() => {\n this.showHoverPane();\n }, this.showDelay);\n }\n\n /**\n * Causes this tile's hover pane to be rendered, positioned, and made visible.\n */\n private async showHoverPane(): Promise<void> {\n this.hoverPaneState = 'shown';\n this.host.requestUpdate();\n\n // Wait for the state update to render the hover pane\n await this.host.updateComplete;\n\n // Ensure the hover pane element is still in the document before showing,\n // as it might have been removed by the previous update.\n if (!this.hoverPane?.isConnected) return;\n\n this.hoverPane?.showPopover?.();\n await new Promise(resolve => {\n // Pane sizes aren't accurate until next frame\n requestAnimationFrame(resolve);\n });\n\n // Apply the correct positioning to the hover pane\n this.repositionHoverPane();\n\n // The hover pane is initially not visible (to avoid it shifting around\n // while being positioned). Since it now has the correct positioning, we\n // can make it visible and begin its fade-in animation.\n this.hoverPane?.classList.add('visible', 'fade-in');\n }\n\n /**\n * Causes this tile's hover pane to begin fading out and starts\n * the timer for it to be removed.\n */\n private fadeOutHoverPane(): void {\n this.hoverPaneState = 'fading-out';\n this.hoverPane?.classList.remove('fade-in');\n\n clearTimeout(this.hideTimer);\n this.hideTimer = window.setTimeout(() => {\n this.hoverPaneState = 'hidden';\n this.host.requestUpdate();\n }, 100);\n }\n\n /**\n * Positions the hover pane with the correct offsets.\n */\n private repositionHoverPane(): void {\n if (!this.hoverPane) return;\n\n const { top, left } = this.hoverPaneDesiredOffsets;\n this.hoverPane.style.top = `${top}px`;\n this.hoverPane.style.left = `${left}px`;\n }\n}\n"]}