@internetarchive/collection-browser 0.0.1-alpha.8 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/README.md +8 -11
  2. package/demo/app-root.ts +16 -92
  3. package/dist/demo/app-root.d.ts +3 -5
  4. package/dist/demo/app-root.js +13 -83
  5. package/dist/demo/app-root.js.map +1 -1
  6. package/dist/index.d.ts +6 -0
  7. package/dist/index.js +6 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/src/assets/img/icons/chevron.d.ts +2 -0
  10. package/dist/src/assets/img/icons/chevron.js +4 -0
  11. package/dist/src/assets/img/icons/chevron.js.map +1 -0
  12. package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -2
  13. package/dist/src/assets/img/icons/mediatype/account.js +6 -4
  14. package/dist/src/assets/img/icons/mediatype/account.js.map +1 -1
  15. package/dist/src/assets/img/icons/mediatype/audio.js +7 -4
  16. package/dist/src/assets/img/icons/mediatype/audio.js.map +1 -1
  17. package/dist/src/assets/img/icons/mediatype/collection.js +7 -4
  18. package/dist/src/assets/img/icons/mediatype/collection.js.map +1 -1
  19. package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -0
  20. package/dist/src/assets/img/icons/mediatype/data.js +15 -0
  21. package/dist/src/assets/img/icons/mediatype/data.js.map +1 -0
  22. package/dist/src/assets/img/icons/mediatype/etree.js +10 -5
  23. package/dist/src/assets/img/icons/mediatype/etree.js.map +1 -1
  24. package/dist/src/assets/img/icons/mediatype/film.js +2 -1
  25. package/dist/src/assets/img/icons/mediatype/film.js.map +1 -1
  26. package/dist/src/assets/img/icons/mediatype/images.js +9 -6
  27. package/dist/src/assets/img/icons/mediatype/images.js.map +1 -1
  28. package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -0
  29. package/dist/src/assets/img/icons/mediatype/radio.js +15 -0
  30. package/dist/src/assets/img/icons/mediatype/radio.js.map +1 -0
  31. package/dist/src/assets/img/icons/mediatype/software.js +9 -6
  32. package/dist/src/assets/img/icons/mediatype/software.js.map +1 -1
  33. package/dist/src/assets/img/icons/mediatype/texts.js +9 -6
  34. package/dist/src/assets/img/icons/mediatype/texts.js.map +1 -1
  35. package/dist/src/assets/img/icons/mediatype/tv.js +10 -5
  36. package/dist/src/assets/img/icons/mediatype/tv.js.map +1 -1
  37. package/dist/src/assets/img/icons/mediatype/video.js +10 -6
  38. package/dist/src/assets/img/icons/mediatype/video.js.map +1 -1
  39. package/dist/src/assets/img/icons/mediatype/web.js +9 -6
  40. package/dist/src/assets/img/icons/mediatype/web.js.map +1 -1
  41. package/dist/src/collection-browser.d.ts +53 -31
  42. package/dist/src/collection-browser.js +504 -166
  43. package/dist/src/collection-browser.js.map +1 -1
  44. package/dist/src/collection-facets.d.ts +28 -13
  45. package/dist/src/collection-facets.js +276 -160
  46. package/dist/src/collection-facets.js.map +1 -1
  47. package/dist/src/helpers.d.ts +1 -0
  48. package/dist/src/helpers.js +20 -0
  49. package/dist/src/helpers.js.map +1 -0
  50. package/dist/src/language-code-handler/language-code-handler.d.ts +37 -0
  51. package/dist/src/language-code-handler/language-code-handler.js +27 -0
  52. package/dist/src/language-code-handler/language-code-handler.js.map +1 -0
  53. package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -0
  54. package/dist/src/language-code-handler/language-code-mapping.js +563 -0
  55. package/dist/src/language-code-handler/language-code-mapping.js.map +1 -0
  56. package/dist/src/mediatype/mediatype-color.d.ts +3 -0
  57. package/dist/src/mediatype/mediatype-color.js +15 -0
  58. package/dist/src/mediatype/mediatype-color.js.map +1 -0
  59. package/dist/src/mediatype/mediatype-config.d.ts +3 -0
  60. package/dist/src/mediatype/mediatype-config.js +86 -0
  61. package/dist/src/mediatype/mediatype-config.js.map +1 -0
  62. package/dist/src/mediatype/mediatype-display.d.ts +3 -0
  63. package/dist/src/mediatype/mediatype-display.js +86 -0
  64. package/dist/src/mediatype/mediatype-display.js.map +1 -0
  65. package/dist/src/mediatype/mediatype-icon.d.ts +10 -0
  66. package/dist/src/mediatype/mediatype-icon.js +105 -0
  67. package/dist/src/mediatype/mediatype-icon.js.map +1 -0
  68. package/dist/src/mediatype/mediatype-text.d.ts +3 -0
  69. package/dist/src/mediatype/mediatype-text.js +17 -0
  70. package/dist/src/mediatype/mediatype-text.js.map +1 -0
  71. package/dist/src/mediatype/mediatypeConfig.d.ts +3 -0
  72. package/dist/src/mediatype/mediatypeConfig.js +86 -0
  73. package/dist/src/mediatype/mediatypeConfig.js.map +1 -0
  74. package/dist/src/mediatype-icon.d.ts +2 -2
  75. package/dist/src/mediatype-icon.js +35 -46
  76. package/dist/src/mediatype-icon.js.map +1 -1
  77. package/dist/src/models.d.ts +72 -13
  78. package/dist/src/models.js +57 -1
  79. package/dist/src/models.js.map +1 -1
  80. package/dist/src/restoration-state-handler.d.ts +38 -0
  81. package/dist/src/restoration-state-handler.js +204 -0
  82. package/dist/src/restoration-state-handler.js.map +1 -0
  83. package/dist/src/sort-filter-bar/alpha-bar.d.ts +1 -1
  84. package/dist/src/sort-filter-bar/alpha-bar.js +9 -2
  85. package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
  86. package/dist/src/sort-filter-bar/img/compact.d.ts +1 -0
  87. package/dist/src/sort-filter-bar/img/compact.js +5 -0
  88. package/dist/src/sort-filter-bar/img/compact.js.map +1 -0
  89. package/dist/src/sort-filter-bar/img/list.js +1 -1
  90. package/dist/src/sort-filter-bar/img/list.js.map +1 -1
  91. package/dist/src/sort-filter-bar/img/tile.d.ts +1 -0
  92. package/dist/src/sort-filter-bar/img/tile.js +5 -0
  93. package/dist/src/sort-filter-bar/img/tile.js.map +1 -0
  94. package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +71 -14
  95. package/dist/src/sort-filter-bar/sort-filter-bar.js +499 -216
  96. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  97. package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -0
  98. package/dist/src/tiles/collection-browser-loading-tile.js +32 -0
  99. package/dist/src/tiles/collection-browser-loading-tile.js.map +1 -0
  100. package/dist/src/tiles/grid/account-tile.d.ts +1 -1
  101. package/dist/src/tiles/grid/account-tile.js +5 -5
  102. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  103. package/dist/src/tiles/grid/collection-tile.js +1 -2
  104. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  105. package/dist/src/tiles/grid/icons/views.d.ts +1 -1
  106. package/dist/src/tiles/grid/icons/views.js +2 -2
  107. package/dist/src/tiles/grid/icons/views.js.map +1 -1
  108. package/dist/src/tiles/grid/item-tile.d.ts +2 -2
  109. package/dist/src/tiles/grid/item-tile.js +58 -150
  110. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  111. package/dist/src/tiles/item-image.d.ts +21 -0
  112. package/dist/src/tiles/item-image.js +215 -0
  113. package/dist/src/tiles/item-image.js.map +1 -0
  114. package/dist/src/tiles/list/account-label.d.ts +1 -0
  115. package/dist/src/tiles/list/account-label.js +7 -0
  116. package/dist/src/tiles/list/account-label.js.map +1 -0
  117. package/dist/src/tiles/list/date-label.d.ts +1 -0
  118. package/dist/src/tiles/list/date-label.js +13 -0
  119. package/dist/src/tiles/list/date-label.js.map +1 -0
  120. package/dist/src/tiles/list/tile-list-compact-header.d.ts +12 -0
  121. package/dist/src/tiles/list/tile-list-compact-header.js +84 -0
  122. package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -0
  123. package/dist/src/tiles/list/tile-list-compact.d.ts +12 -0
  124. package/dist/src/tiles/list/tile-list-compact.js +203 -6
  125. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  126. package/dist/src/tiles/list/tile-list.d.ts +35 -10
  127. package/dist/src/tiles/list/tile-list.js +368 -104
  128. package/dist/src/tiles/list/tile-list.js.map +1 -1
  129. package/dist/src/tiles/loading-tile.js +1 -42
  130. package/dist/src/tiles/loading-tile.js.map +1 -1
  131. package/dist/src/tiles/mediatype-icon.d.ts +9 -0
  132. package/dist/src/tiles/mediatype-icon.js +78 -0
  133. package/dist/src/tiles/mediatype-icon.js.map +1 -0
  134. package/dist/src/tiles/tile-dispatcher.d.ts +11 -4
  135. package/dist/src/tiles/tile-dispatcher.js +56 -19
  136. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  137. package/dist/src/utils/format-date.js +2 -2
  138. package/dist/src/utils/format-date.js.map +1 -1
  139. package/dist/src/waveform-thumbnail.d.ts +7 -0
  140. package/dist/src/waveform-thumbnail.js +106 -0
  141. package/dist/src/waveform-thumbnail.js.map +1 -0
  142. package/dist/{demo/icon-provider-icon.d.ts → src/waveform-view.d.ts} +0 -0
  143. package/dist/src/waveform-view.js +2 -0
  144. package/dist/src/waveform-view.js.map +1 -0
  145. package/dist/src/your-webcomponent.d.ts +8 -0
  146. package/dist/src/your-webcomponent.js +38 -0
  147. package/dist/src/your-webcomponent.js.map +1 -0
  148. package/dist/test/collection-browser.test.d.ts +1 -0
  149. package/dist/test/collection-browser.test.js +16 -2
  150. package/dist/test/collection-browser.test.js.map +1 -1
  151. package/dist/test/mediatype-config.test.d.ts +1 -0
  152. package/dist/test/mediatype-config.test.js +17 -0
  153. package/dist/test/mediatype-config.test.js.map +1 -0
  154. package/dist/{src/assets/img/icons/eye-hidden.d.ts → test/mediatype-icon.test.d.ts} +0 -0
  155. package/dist/test/mediatype-icon.test.js +3 -0
  156. package/dist/test/mediatype-icon.test.js.map +1 -0
  157. package/dist/test/mediatypeConfig.test.d.ts +1 -0
  158. package/dist/test/mediatypeConfig.test.js +17 -0
  159. package/dist/test/mediatypeConfig.test.js.map +1 -0
  160. package/dist/test/utils/format-date.test.js +1 -1
  161. package/dist/test/utils/format-date.test.js.map +1 -1
  162. package/dist/test/your-webcomponent.test.d.ts +1 -0
  163. package/dist/test/your-webcomponent.test.js +23 -0
  164. package/dist/test/your-webcomponent.test.js.map +1 -0
  165. package/index.ts +6 -0
  166. package/local.archive.org.cert +86 -0
  167. package/local.archive.org.key +27 -0
  168. package/package.json +9 -5
  169. package/src/assets/img/icons/chevron.ts +4 -0
  170. package/src/assets/img/icons/mediatype/account.ts +6 -4
  171. package/src/assets/img/icons/mediatype/audio.ts +7 -4
  172. package/src/assets/img/icons/mediatype/collection.ts +7 -4
  173. package/src/assets/img/icons/mediatype/data.ts +15 -0
  174. package/src/assets/img/icons/mediatype/etree.ts +10 -5
  175. package/src/assets/img/icons/mediatype/film.ts +2 -1
  176. package/src/assets/img/icons/mediatype/images.ts +9 -6
  177. package/src/assets/img/icons/mediatype/radio.ts +15 -0
  178. package/src/assets/img/icons/mediatype/software.ts +9 -6
  179. package/src/assets/img/icons/mediatype/texts.ts +9 -6
  180. package/src/assets/img/icons/mediatype/tv.ts +10 -5
  181. package/src/assets/img/icons/mediatype/video.ts +10 -6
  182. package/src/assets/img/icons/mediatype/web.ts +9 -6
  183. package/src/collection-browser.ts +529 -163
  184. package/src/collection-facets.ts +307 -205
  185. package/src/language-code-handler/language-code-handler.ts +64 -0
  186. package/src/language-code-handler/language-code-mapping.ts +564 -0
  187. package/src/mediatype/mediatype-config.ts +86 -0
  188. package/src/models.ts +141 -13
  189. package/src/restoration-state-handler.ts +266 -0
  190. package/src/sort-filter-bar/alpha-bar.ts +9 -3
  191. package/src/sort-filter-bar/img/compact.ts +5 -0
  192. package/src/sort-filter-bar/img/list.ts +1 -1
  193. package/src/sort-filter-bar/img/tile.ts +5 -0
  194. package/src/sort-filter-bar/sort-filter-bar.ts +557 -225
  195. package/src/tiles/collection-browser-loading-tile.ts +29 -0
  196. package/src/tiles/grid/account-tile.ts +1 -1
  197. package/src/tiles/grid/collection-tile.ts +1 -2
  198. package/src/tiles/grid/icons/views.ts +2 -2
  199. package/src/tiles/grid/item-tile.ts +57 -162
  200. package/src/tiles/item-image.ts +218 -0
  201. package/src/tiles/list/account-label.ts +6 -0
  202. package/src/tiles/list/date-label.ts +12 -0
  203. package/src/tiles/list/tile-list-compact-header.ts +77 -0
  204. package/src/tiles/list/tile-list-compact.ts +218 -0
  205. package/src/tiles/list/tile-list.ts +412 -107
  206. package/src/tiles/mediatype-icon.ts +75 -0
  207. package/src/tiles/tile-dispatcher.ts +66 -18
  208. package/src/utils/format-date.ts +2 -2
  209. package/test/collection-browser.test.ts +20 -1
  210. package/test/mediatype-config.test.ts +18 -0
  211. package/test/utils/format-date.test.ts +1 -1
  212. package/web-dev-server.config.mjs +3 -1
  213. package/dist/demo/icon-provider/icon-provider-icon.d.ts +0 -10
  214. package/dist/demo/icon-provider/icon-provider-icon.js +0 -32
  215. package/dist/demo/icon-provider/icon-provider-icon.js.map +0 -1
  216. package/dist/demo/icon-provider/icon-provider.d.ts +0 -10
  217. package/dist/demo/icon-provider/icon-provider.js +0 -9
  218. package/dist/demo/icon-provider/icon-provider.js.map +0 -1
  219. package/dist/demo/icon-provider-icon.js +0 -2
  220. package/dist/demo/icon-provider-icon.js.map +0 -1
  221. package/dist/demo/icon-provider.d.ts +0 -10
  222. package/dist/demo/icon-provider.js +0 -12
  223. package/dist/demo/icon-provider.js.map +0 -1
  224. package/dist/src/assets/img/icons/audio.d.ts +0 -1
  225. package/dist/src/assets/img/icons/audio.js +0 -9
  226. package/dist/src/assets/img/icons/audio.js.map +0 -1
  227. package/dist/src/assets/img/icons/collection.d.ts +0 -1
  228. package/dist/src/assets/img/icons/collection.js +0 -9
  229. package/dist/src/assets/img/icons/collection.js.map +0 -1
  230. package/dist/src/assets/img/icons/etree.d.ts +0 -1
  231. package/dist/src/assets/img/icons/etree.js +0 -9
  232. package/dist/src/assets/img/icons/etree.js.map +0 -1
  233. package/dist/src/assets/img/icons/eye-hidden.js +0 -2
  234. package/dist/src/assets/img/icons/eye-hidden.js.map +0 -1
  235. package/dist/src/assets/img/icons/images.d.ts +0 -1
  236. package/dist/src/assets/img/icons/images.js +0 -10
  237. package/dist/src/assets/img/icons/images.js.map +0 -1
  238. package/dist/src/assets/img/icons/mediatype/etree copy.d.ts +0 -1
  239. package/dist/src/assets/img/icons/mediatype/etree copy.js +0 -9
  240. package/dist/src/assets/img/icons/mediatype/etree copy.js.map +0 -1
  241. package/dist/src/assets/img/icons/software.d.ts +0 -1
  242. package/dist/src/assets/img/icons/software.js +0 -10
  243. package/dist/src/assets/img/icons/software.js.map +0 -1
  244. package/dist/src/assets/img/icons/texts.d.ts +0 -1
  245. package/dist/src/assets/img/icons/texts.js +0 -10
  246. package/dist/src/assets/img/icons/texts.js.map +0 -1
  247. package/dist/src/assets/img/icons/tv.d.ts +0 -1
  248. package/dist/src/assets/img/icons/tv.js +0 -9
  249. package/dist/src/assets/img/icons/tv.js.map +0 -1
  250. package/dist/src/assets/img/icons/video.d.ts +0 -1
  251. package/dist/src/assets/img/icons/video.js +0 -10
  252. package/dist/src/assets/img/icons/video.js.map +0 -1
  253. package/dist/src/assets/img/icons/web.d.ts +0 -1
  254. package/dist/src/assets/img/icons/web.js +0 -10
  255. package/dist/src/assets/img/icons/web.js.map +0 -1
  256. package/dist/src/search-handler.d.ts +0 -11
  257. package/dist/src/search-handler.js +0 -34
  258. package/dist/src/search-handler.js.map +0 -1
  259. package/src/mediatype-icon.ts +0 -83
  260. package/src/sort-filter-bar/img/grid.ts +0 -5
  261. package/src/tiles/loading-tile.ts +0 -70
@@ -18,51 +18,10 @@ let LoadingTile = class LoadingTile extends LitElement {
18
18
  rgba(25, 69, 154, 0.1),
19
19
  rgb(105, 161, 234, 0.2)
20
20
  );
21
- background-size: 400% 400%;
22
-
23
- -webkit-animation: AnimationName 4s ease infinite;
24
- -moz-animation: AnimationName 4s ease infinite;
25
- animation: AnimationName 4s ease infinite;
26
-
21
+ background-size: 100% 100%;
27
22
  display: block;
28
23
  height: 100%;
29
24
  }
30
-
31
- @-webkit-keyframes AnimationName {
32
- 0% {
33
- background-position: 0% 50%;
34
- }
35
- 50% {
36
- background-position: 100% 50%;
37
- }
38
- 100% {
39
- background-position: 0% 50%;
40
- }
41
- }
42
-
43
- @-moz-keyframes AnimationName {
44
- 0% {
45
- background-position: 0% 50%;
46
- }
47
- 50% {
48
- background-position: 100% 50%;
49
- }
50
- 100% {
51
- background-position: 0% 50%;
52
- }
53
- }
54
-
55
- @keyframes AnimationName {
56
- 0% {
57
- background-position: 0% 50%;
58
- }
59
- 50% {
60
- background-position: 100% 50%;
61
- }
62
- 100% {
63
- background-position: 0% 50%;
64
- }
65
- }
66
25
  `;
67
26
  }
68
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"loading-tile.js","sourceRoot":"","sources":["../../../src/tiles/loading-tile.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,UAAU;IACzC,MAAM;QACJ,OAAO,IAAI,CAAA,8BAA8B,CAAC;IAC5C,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyDT,CAAC;IACJ,CAAC;CACF,CAAA;AAjEY,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAiEvB;SAjEY,WAAW","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('loading-tile')\nexport class LoadingTile extends LitElement {\n render() {\n return html` <div id=\"container\"></div> `;\n }\n\n static get styles() {\n return css`\n :host {\n display: block;\n height: 100%;\n }\n\n #container {\n background: linear-gradient(\n to right,\n rgba(25, 69, 154, 0.1),\n rgb(105, 161, 234, 0.2)\n );\n background-size: 400% 400%;\n\n -webkit-animation: AnimationName 4s ease infinite;\n -moz-animation: AnimationName 4s ease infinite;\n animation: AnimationName 4s ease infinite;\n\n display: block;\n height: 100%;\n }\n\n @-webkit-keyframes AnimationName {\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n }\n\n @-moz-keyframes AnimationName {\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n }\n\n @keyframes AnimationName {\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n }\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"loading-tile.js","sourceRoot":"","sources":["../../../src/tiles/loading-tile.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,UAAU;IACzC,MAAM;QACJ,OAAO,IAAI,CAAA,8BAA8B,CAAC;IAC5C,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;KAgBT,CAAC;IACJ,CAAC;CACF,CAAA;AAxBY,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAwBvB;SAxBY,WAAW","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('loading-tile')\nexport class LoadingTile extends LitElement {\n render() {\n return html` <div id=\"container\"></div> `;\n }\n\n static get styles() {\n return css`\n :host {\n display: block;\n height: 100%;\n }\n\n #container {\n background: linear-gradient(\n to right,\n rgba(25, 69, 154, 0.1),\n rgb(105, 161, 234, 0.2)\n );\n background-size: 100% 100%;\n display: block;\n height: 100%;\n }\n `;\n }\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { CSSResultGroup, LitElement } from 'lit';
2
+ export declare class MediatypeIcon extends LitElement {
3
+ mediatype: string | undefined;
4
+ collections: string[] | undefined;
5
+ showText: boolean;
6
+ private get displayMediatype();
7
+ render(): import("lit-html").TemplateResult<1>;
8
+ static get styles(): CSSResultGroup;
9
+ }
@@ -0,0 +1,78 @@
1
+ import { __decorate } from "tslib";
2
+ import { css, html, LitElement } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import { mediatypeConfig } from '../mediatype/mediatype-config';
5
+ let MediatypeIcon = class MediatypeIcon extends LitElement {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.showText = false;
9
+ }
10
+ get displayMediatype() {
11
+ var _a, _b;
12
+ const tvIdentifier = ['tvnews', 'tvarchive', 'television'];
13
+ const radioIdentifier = ['radio', 'radioprogram'];
14
+ if (this.mediatype === 'movies' &&
15
+ ((_a = this.collections) === null || _a === void 0 ? void 0 : _a.some(id => tvIdentifier.indexOf(id) >= 0))) {
16
+ return 'tv';
17
+ }
18
+ if (this.mediatype === 'audio' &&
19
+ ((_b = this.collections) === null || _b === void 0 ? void 0 : _b.some(id => radioIdentifier.indexOf(id) >= 0))) {
20
+ return 'radio';
21
+ }
22
+ return this.mediatype || '';
23
+ }
24
+ render() {
25
+ const config = mediatypeConfig[this.displayMediatype];
26
+ if (!config) {
27
+ return html ``;
28
+ }
29
+ return html `
30
+ <div
31
+ id="icon"
32
+ class="${this.showText ? 'show-text' : 'hide-text'}"
33
+ style="--iconFillColor: ${config.color}"
34
+ >
35
+ ${config.icon}
36
+ <p class="status-text">${config.text}</p>
37
+ </div>
38
+ `;
39
+ }
40
+ static get styles() {
41
+ return css `
42
+ .status-text {
43
+ font-size: 14px;
44
+ color: #2c2c2c;
45
+ margin: auto;
46
+ display: block;
47
+ text-align: var(--iconTextAlign, center);
48
+ }
49
+
50
+ #icon.hide-text p {
51
+ display: none;
52
+ }
53
+
54
+ svg {
55
+ height: var(--iconHeight, 10px);
56
+ width: var(--iconWidth, 10px);
57
+ }
58
+
59
+ .fill-color {
60
+ fill: var(--iconCustomFillColor, var(--iconFillColor, '#000000'));
61
+ }
62
+ `;
63
+ }
64
+ };
65
+ __decorate([
66
+ property({ type: String })
67
+ ], MediatypeIcon.prototype, "mediatype", void 0);
68
+ __decorate([
69
+ property({ type: Array })
70
+ ], MediatypeIcon.prototype, "collections", void 0);
71
+ __decorate([
72
+ property({ type: Boolean })
73
+ ], MediatypeIcon.prototype, "showText", void 0);
74
+ MediatypeIcon = __decorate([
75
+ customElement('mediatype-icon')
76
+ ], MediatypeIcon);
77
+ export { MediatypeIcon };
78
+ //# sourceMappingURL=mediatype-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mediatype-icon.js","sourceRoot":"","sources":["../../../src/tiles/mediatype-icon.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,IAAa,aAAa,GAA1B,MAAa,aAAc,SAAQ,UAAU;IAA7C;;QAK+B,aAAQ,GAAG,KAAK,CAAC;IA+DhD,CAAC;IA7DC,IAAY,gBAAgB;;QAC1B,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QAC3D,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAElD,IACE,IAAI,CAAC,SAAS,KAAK,QAAQ;aAC3B,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA,EAC3D;YACA,OAAO,IAAI,CAAC;SACb;QACD,IACE,IAAI,CAAC,SAAS,KAAK,OAAO;aAC1B,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA,EAC9D;YACA,OAAO,OAAO,CAAC;SAChB;QACD,OAAO,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,IAAI,CAAA,EAAE,CAAC;SACf;QAED,OAAO,IAAI,CAAA;;;iBAGE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW;kCACxB,MAAM,CAAC,KAAK;;UAEpC,MAAM,CAAC,IAAI;iCACY,MAAM,CAAC,IAAI;;KAEvC,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBT,CAAC;IACJ,CAAC;CACF,CAAA;AAnE6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAA+B;AAE/B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAmC;AAEhC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAkB;AALnC,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAoEzB;SApEY,aAAa","sourcesContent":["import { css, CSSResultGroup, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { mediatypeConfig } from '../mediatype/mediatype-config';\n\n@customElement('mediatype-icon')\nexport class MediatypeIcon extends LitElement {\n @property({ type: String }) mediatype: string | undefined;\n\n @property({ type: Array }) collections: string[] | undefined;\n\n @property({ type: Boolean }) showText = false;\n\n private get displayMediatype(): string {\n const tvIdentifier = ['tvnews', 'tvarchive', 'television'];\n const radioIdentifier = ['radio', 'radioprogram'];\n\n if (\n this.mediatype === 'movies' &&\n this.collections?.some(id => tvIdentifier.indexOf(id) >= 0)\n ) {\n return 'tv';\n }\n if (\n this.mediatype === 'audio' &&\n this.collections?.some(id => radioIdentifier.indexOf(id) >= 0)\n ) {\n return 'radio';\n }\n return this.mediatype || '';\n }\n\n render() {\n const config = mediatypeConfig[this.displayMediatype];\n if (!config) {\n return html``;\n }\n\n return html`\n <div\n id=\"icon\"\n class=\"${this.showText ? 'show-text' : 'hide-text'}\"\n style=\"--iconFillColor: ${config.color}\"\n >\n ${config.icon}\n <p class=\"status-text\">${config.text}</p>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n .status-text {\n font-size: 14px;\n color: #2c2c2c;\n margin: auto;\n display: block;\n text-align: var(--iconTextAlign, center);\n }\n\n #icon.hide-text p {\n display: none;\n }\n\n svg {\n height: var(--iconHeight, 10px);\n width: var(--iconWidth, 10px);\n }\n\n .fill-color {\n fill: var(--iconCustomFillColor, var(--iconFillColor, '#000000'));\n }\n `;\n }\n}\n"]}
@@ -1,22 +1,29 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import { SharedResizeObserverInterface, SharedResizeObserverResizeHandlerInterface } from '@internetarchive/shared-resize-observer';
3
+ import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
3
4
  import { SortParam } from '@internetarchive/search-service';
4
- import type { CollectionDisplayMode, TileModel } from '../models';
5
+ import type { TileDisplayMode, TileModel } from '../models';
5
6
  import './grid/collection-tile';
6
7
  import './grid/item-tile';
7
8
  import './grid/account-tile';
8
9
  import './list/tile-list';
10
+ import './list/tile-list-compact';
11
+ import './list/tile-list-compact-header';
9
12
  export declare class TileDispatcher extends LitElement implements SharedResizeObserverResizeHandlerInterface {
10
- displayMode: CollectionDisplayMode;
13
+ tileDisplayMode?: TileDisplayMode;
11
14
  model?: TileModel;
12
15
  baseNavigationUrl?: string;
13
- showDeleteButton: boolean;
14
16
  currentWidth?: number;
15
17
  currentHeight?: number;
16
18
  resizeObserver?: SharedResizeObserverInterface;
17
- sortParam?: SortParam;
19
+ collectionNameCache?: CollectionNameCacheInterface;
20
+ sortParam: SortParam | null;
18
21
  private container;
22
+ mobileBreakpoint?: number;
19
23
  render(): import("lit-html").TemplateResult<1>;
24
+ private get headerTemplate();
25
+ private get tileTemplate();
26
+ private get linkTileTemplate();
20
27
  handleResize(entry: ResizeObserverEntry): void;
21
28
  disconnectedCallback(): void;
22
29
  private stopResizeObservation;
@@ -6,28 +6,52 @@ import './grid/collection-tile';
6
6
  import './grid/item-tile';
7
7
  import './grid/account-tile';
8
8
  import './list/tile-list';
9
+ import './list/tile-list-compact';
10
+ import './list/tile-list-compact-header';
9
11
  let TileDispatcher = class TileDispatcher extends LitElement {
10
12
  constructor() {
11
13
  super(...arguments);
12
- this.displayMode = 'grid';
13
- this.showDeleteButton = false;
14
+ this.sortParam = null;
14
15
  }
15
16
  render() {
16
- var _a, _b;
17
17
  return html `
18
18
  <div id="container">
19
- ${this.showDeleteButton
20
- ? html `<button id="delete-button">X</button>`
21
- : nothing}
22
- <a
23
- href="${this.baseNavigationUrl}/details/${(_a = this.model) === null || _a === void 0 ? void 0 : _a.identifier}"
24
- title=${ifDefined((_b = this.model) === null || _b === void 0 ? void 0 : _b.title)}
25
- >
26
- ${this.tile}
27
- </a>
19
+ ${this.tileDisplayMode === 'list-header'
20
+ ? this.headerTemplate
21
+ : this.tileTemplate}
28
22
  </div>
29
23
  `;
30
24
  }
25
+ get headerTemplate() {
26
+ const { currentWidth, sortParam, mobileBreakpoint } = this;
27
+ return html `
28
+ <tile-list-compact-header
29
+ class="header"
30
+ .currentWidth=${currentWidth}
31
+ .sortParam=${sortParam}
32
+ .mobileBreakpoint=${mobileBreakpoint}
33
+ >
34
+ </tile-list-compact-header>
35
+ `;
36
+ }
37
+ get tileTemplate() {
38
+ return html `
39
+ ${this.tileDisplayMode === 'list-detail'
40
+ ? this.tile
41
+ : this.linkTileTemplate}
42
+ `;
43
+ }
44
+ get linkTileTemplate() {
45
+ var _a, _b;
46
+ return html `
47
+ <a
48
+ href="${this.baseNavigationUrl}/details/${(_a = this.model) === null || _a === void 0 ? void 0 : _a.identifier}"
49
+ title=${ifDefined((_b = this.model) === null || _b === void 0 ? void 0 : _b.title)}
50
+ >
51
+ ${this.tile}
52
+ </a>
53
+ `;
54
+ }
31
55
  handleResize(entry) {
32
56
  this.currentWidth = entry.contentRect.width;
33
57
  this.currentHeight = entry.contentRect.height;
@@ -57,10 +81,10 @@ let TileDispatcher = class TileDispatcher extends LitElement {
57
81
  }
58
82
  }
59
83
  get tile() {
60
- const { model, baseNavigationUrl, currentWidth, currentHeight, sortParam } = this;
84
+ const { model, baseNavigationUrl, currentWidth, currentHeight, sortParam, mobileBreakpoint, } = this;
61
85
  if (!model)
62
86
  return nothing;
63
- switch (this.displayMode) {
87
+ switch (this.tileDisplayMode) {
64
88
  case 'grid':
65
89
  switch (model.mediatype) {
66
90
  case 'collection':
@@ -82,17 +106,27 @@ let TileDispatcher = class TileDispatcher extends LitElement {
82
106
  .baseNavigationUrl=${this.baseNavigationUrl}
83
107
  .currentWidth=${this.currentWidth}
84
108
  .currentHeight=${this.currentHeight}
109
+ .collectionNameCache=${this.collectionNameCache}
85
110
  ></item-tile>`;
86
111
  }
87
112
  case 'list-compact':
113
+ return html `<tile-list-compact
114
+ .model=${model}
115
+ .currentWidth=${currentWidth}
116
+ .currentHeight=${currentHeight}
117
+ .baseNavigationUrl=${baseNavigationUrl}
118
+ .sortParam=${sortParam}
119
+ .mobileBreakpoint=${mobileBreakpoint}
120
+ ></tile-list-compact>`;
88
121
  case 'list-detail':
89
122
  return html `<tile-list
90
123
  .model=${model}
124
+ .collectionNameCache=${this.collectionNameCache}
91
125
  .currentWidth=${currentWidth}
92
126
  .currentHeight=${currentHeight}
93
127
  .baseNavigationUrl=${baseNavigationUrl}
94
128
  .sortParam=${sortParam}
95
- .displayMode=${this.displayMode}
129
+ .mobileBreakpoint=${mobileBreakpoint}
96
130
  ></tile-list>`;
97
131
  default:
98
132
  return nothing;
@@ -129,16 +163,13 @@ let TileDispatcher = class TileDispatcher extends LitElement {
129
163
  };
130
164
  __decorate([
131
165
  property({ type: String })
132
- ], TileDispatcher.prototype, "displayMode", void 0);
166
+ ], TileDispatcher.prototype, "tileDisplayMode", void 0);
133
167
  __decorate([
134
168
  property({ type: Object })
135
169
  ], TileDispatcher.prototype, "model", void 0);
136
170
  __decorate([
137
171
  property({ type: String })
138
172
  ], TileDispatcher.prototype, "baseNavigationUrl", void 0);
139
- __decorate([
140
- property({ type: Boolean })
141
- ], TileDispatcher.prototype, "showDeleteButton", void 0);
142
173
  __decorate([
143
174
  property({ type: Number })
144
175
  ], TileDispatcher.prototype, "currentWidth", void 0);
@@ -148,12 +179,18 @@ __decorate([
148
179
  __decorate([
149
180
  property({ type: Object })
150
181
  ], TileDispatcher.prototype, "resizeObserver", void 0);
182
+ __decorate([
183
+ property({ type: Object })
184
+ ], TileDispatcher.prototype, "collectionNameCache", void 0);
151
185
  __decorate([
152
186
  property({ type: Object })
153
187
  ], TileDispatcher.prototype, "sortParam", void 0);
154
188
  __decorate([
155
189
  query('#container')
156
190
  ], TileDispatcher.prototype, "container", void 0);
191
+ __decorate([
192
+ property({ type: Number })
193
+ ], TileDispatcher.prototype, "mobileBreakpoint", void 0);
157
194
  TileDispatcher = __decorate([
158
195
  customElement('tile-dispatcher')
159
196
  ], TileDispatcher);
@@ -1 +1 @@
1
- {"version":3,"file":"tile-dispatcher.js","sourceRoot":"","sources":["../../../src/tiles/tile-dispatcher.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAOzD,OAAO,wBAAwB,CAAC;AAChC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAG1B,IAAa,cAAc,GAA3B,MAAa,cACX,SAAQ,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B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDAA0B;AAE1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAuB;AAEtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAwB;AAEvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAgD;AAE/C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAuB;AAE7B;IAApB,KAAK,CAAC,YAAY,CAAC;iDAAoC;AApB7C,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAiJ1B;SAjJY,cAAc","sourcesContent":["import { css, html, LitElement, nothing, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport { SortParam } from '@internetarchive/search-service';\nimport type { CollectionDisplayMode, TileModel } from '../models';\nimport './grid/collection-tile';\nimport './grid/item-tile';\nimport './grid/account-tile';\nimport './list/tile-list';\n\n@customElement('tile-dispatcher')\nexport class TileDispatcher\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n @property({ type: String }) displayMode: CollectionDisplayMode = 'grid';\n\n @property({ type: Object }) model?: TileModel;\n\n @property({ type: String }) baseNavigationUrl?: string;\n\n @property({ type: Boolean }) showDeleteButton = false;\n\n @property({ type: Number }) currentWidth?: number;\n\n @property({ type: Number }) currentHeight?: number;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object }) sortParam?: SortParam;\n\n @query('#container') private container!: HTMLDivElement;\n\n render() {\n return html`\n <div id=\"container\">\n ${this.showDeleteButton\n ? html`<button id=\"delete-button\">X</button>`\n : nothing}\n <a\n href=\"${this.baseNavigationUrl}/details/${this.model?.identifier}\"\n title=${ifDefined(this.model?.title)}\n >\n ${this.tile}\n </a>\n </div>\n `;\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 private get tile() {\n const { model, baseNavigationUrl, currentWidth, currentHeight, sortParam } =\n this;\n\n if (!model) return nothing;\n\n switch (this.displayMode) {\n case 'grid':\n switch (model.mediatype) {\n case 'collection':\n return html`<collection-tile\n .model=${model}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n >\n </collection-tile>`;\n case 'account':\n return html`<account-tile\n .model=${model}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n ></account-tile>`;\n default:\n return html`<item-tile\n .model=${model}\n .baseNavigationUrl=${this.baseNavigationUrl}\n .currentWidth=${this.currentWidth}\n .currentHeight=${this.currentHeight}\n ></item-tile>`;\n }\n case 'list-compact':\n case 'list-detail':\n return html`<tile-list\n .model=${model}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .displayMode=${this.displayMode}\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 #container {\n height: 100%;\n }\n\n #delete-button {\n float: right;\n }\n\n a {\n display: block;\n height: 100%;\n color: unset;\n text-decoration: none;\n }\n\n a :first-child {\n display: block;\n height: 100%;\n }\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"tile-dispatcher.js","sourceRoot":"","sources":["../../../src/tiles/tile-dispatcher.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAQzD,OAAO,wBAAwB,CAAC;AAChC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AAGzC,IAAa,cAAc,GAA3B,MAAa,cACX,SAAQ,UAAU;IADpB;;QAmB8B,cAAS,GAAqB,IAAI,CAAC;IA2KjE,CAAC;IArKC,MAAM;QACJ,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,eAAe,KAAK,aAAa;YACtC,CAAC,CAAC,IAAI,CAAC,cAAc;YACrB,CAAC,CAAC,IAAI,CAAC,YAAY;;KAExB,CAAC;IACJ,CAAC;IAED,IAAY,cAAc;QACxB,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;QAC3D,OAAO,IAAI,CAAA;;;wBAGS,YAAY;qBACf,SAAS;4BACF,gBAAgB;;;KAGvC,CAAC;IACJ,CAAC;IAED,IAAY,YAAY;QACtB,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,eAAe,KAAK,aAAa;YACtC,CAAC,CAAC,IAAI,CAAC,IAAI;YACX,CAAC,CAAC,IAAI,CAAC,gBAAgB;KAC1B,CAAC;IACJ,CAAC;IAED,IAAY,gBAAgB;;QAC1B,OAAO,IAAI,CAAA;;gBAEC,IAAI,CA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AAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAwB;AAEvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAgD;AAG3E;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DACwB;AAEvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAoC;AAE1C;IAApB,KAAK,CAAC,YAAY,CAAC;iDAAoC;AAE5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAA2B;AAvB3C,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CA8L1B;SA9LY,cAAc","sourcesContent":["import { css, html, LitElement, nothing, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';\nimport { SortParam } from '@internetarchive/search-service';\nimport type { TileDisplayMode, TileModel } from '../models';\nimport './grid/collection-tile';\nimport './grid/item-tile';\nimport './grid/account-tile';\nimport './list/tile-list';\nimport './list/tile-list-compact';\nimport './list/tile-list-compact-header';\n\n@customElement('tile-dispatcher')\nexport class TileDispatcher\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n @property({ type: String }) tileDisplayMode?: TileDisplayMode;\n\n @property({ type: Object }) model?: TileModel;\n\n @property({ type: String }) baseNavigationUrl?: string;\n\n @property({ type: Number }) currentWidth?: number;\n\n @property({ type: Number }) currentHeight?: number;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object })\n collectionNameCache?: CollectionNameCacheInterface;\n\n @property({ type: Object }) sortParam: SortParam | null = null;\n\n @query('#container') private container!: HTMLDivElement;\n\n @property({ type: Number }) mobileBreakpoint?: number;\n\n render() {\n return html`\n <div id=\"container\">\n ${this.tileDisplayMode === 'list-header'\n ? this.headerTemplate\n : this.tileTemplate}\n </div>\n `;\n }\n\n private get headerTemplate() {\n const { currentWidth, sortParam, mobileBreakpoint } = this;\n return html`\n <tile-list-compact-header\n class=\"header\"\n .currentWidth=${currentWidth}\n .sortParam=${sortParam}\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.baseNavigationUrl}/details/${this.model?.identifier}\"\n title=${ifDefined(this.model?.title)}\n >\n ${this.tile}\n </a>\n `;\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 private get tile() {\n const {\n model,\n baseNavigationUrl,\n currentWidth,\n currentHeight,\n sortParam,\n mobileBreakpoint,\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 .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n >\n </collection-tile>`;\n case 'account':\n return html`<account-tile\n .model=${model}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n ></account-tile>`;\n default:\n return html`<item-tile\n .model=${model}\n .baseNavigationUrl=${this.baseNavigationUrl}\n .currentWidth=${this.currentWidth}\n .currentHeight=${this.currentHeight}\n .collectionNameCache=${this.collectionNameCache}\n ></item-tile>`;\n }\n case 'list-compact':\n return html`<tile-list-compact\n .model=${model}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .mobileBreakpoint=${mobileBreakpoint}\n ></tile-list-compact>`;\n case 'list-detail':\n return html`<tile-list\n .model=${model}\n .collectionNameCache=${this.collectionNameCache}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .mobileBreakpoint=${mobileBreakpoint}\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 #container {\n height: 100%;\n }\n\n #delete-button {\n float: right;\n }\n\n a {\n display: block;\n height: 100%;\n color: unset;\n text-decoration: none;\n }\n\n a :first-child {\n display: block;\n height: 100%;\n }\n `;\n }\n}\n"]}
@@ -7,8 +7,8 @@ export function formatDate(date, format = 'short', locale = 'en-US') {
7
7
  };
8
8
  switch (format) {
9
9
  case 'short':
10
- options.month = '2-digit';
11
- options.year = '2-digit';
10
+ options.month = 'short';
11
+ options.year = 'numeric';
12
12
  break;
13
13
  case 'long':
14
14
  options.year = 'numeric';
@@ -1 +1 @@
1
- {"version":3,"file":"format-date.js","sourceRoot":"","sources":["../../../src/utils/format-date.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,UAAU,CACxB,IAAsB,EACtB,SAAqB,OAAO,EAC5B,SAAiB,OAAO;IAExB,4BAA4B;IAC5B,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,MAAM,OAAO,GAA+B;QAC1C,QAAQ,EAAE,KAAK,EAAE,4BAA4B;KAC9C,CAAC;IACF,QAAQ,MAAM,EAAE;QACd,KAAK,OAAO;YACV,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC;YAC1B,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;YACzB,MAAM;QACR,KAAK,MAAM;YACT,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;YACzB,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC;YACxB,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC;YACxB,MAAM;QACR;YACE,MAAM;KACT;IAED,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/*\n * Display date\n * Override browser timezone to always display same date as in data\n */\nexport type DateFormat =\n | 'short' // 12/20\n | 'long'; // Dec 20, 2020\n\nexport function formatDate(\n date: Date | undefined,\n format: DateFormat = 'short',\n locale: string = 'en-US'\n): string {\n // Return blank if undefined\n if (!date) return '';\n\n const options: Intl.DateTimeFormatOptions = {\n timeZone: 'UTC', // Override browser timezone\n };\n switch (format) {\n case 'short':\n options.month = '2-digit';\n options.year = '2-digit';\n break;\n case 'long':\n options.year = 'numeric';\n options.month = 'short';\n options.day = '2-digit';\n break;\n default:\n break;\n }\n\n const dateFormatter = new Intl.DateTimeFormat(locale, options);\n return dateFormatter.format(date);\n}\n"]}
1
+ {"version":3,"file":"format-date.js","sourceRoot":"","sources":["../../../src/utils/format-date.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,UAAU,CACxB,IAAsB,EACtB,SAAqB,OAAO,EAC5B,SAAiB,OAAO;IAExB,4BAA4B;IAC5B,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,MAAM,OAAO,GAA+B;QAC1C,QAAQ,EAAE,KAAK,EAAE,4BAA4B;KAC9C,CAAC;IACF,QAAQ,MAAM,EAAE;QACd,KAAK,OAAO;YACV,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC;YACxB,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;YACzB,MAAM;QACR,KAAK,MAAM;YACT,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;YACzB,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC;YACxB,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC;YACxB,MAAM;QACR;YACE,MAAM;KACT;IAED,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/*\n * Display date\n * Override browser timezone to always display same date as in data\n */\nexport type DateFormat =\n | 'short' // 12/20\n | 'long'; // Dec 20, 2020\n\nexport function formatDate(\n date: Date | undefined,\n format: DateFormat = 'short',\n locale: string = 'en-US'\n): string {\n // Return blank if undefined\n if (!date) return '';\n\n const options: Intl.DateTimeFormatOptions = {\n timeZone: 'UTC', // Override browser timezone\n };\n switch (format) {\n case 'short':\n options.month = 'short';\n options.year = 'numeric';\n break;\n case 'long':\n options.year = 'numeric';\n options.month = 'short';\n options.day = '2-digit';\n break;\n default:\n break;\n }\n\n const dateFormatter = new Intl.DateTimeFormat(locale, options);\n return dateFormatter.format(date);\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { CSSResultGroup, LitElement } from 'lit';
2
+ export declare class WaveformThumbnail extends LitElement {
3
+ baseNavigationUrl?: string;
4
+ identifier?: string;
5
+ render(): import("lit-html").TemplateResult<1>;
6
+ static get styles(): CSSResultGroup;
7
+ }
@@ -0,0 +1,106 @@
1
+ import { __decorate } from "tslib";
2
+ import { css, html, LitElement } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ let WaveformThumbnail = class WaveformThumbnail extends LitElement {
5
+ render() {
6
+ const imgSrcUrl = `${this.baseNavigationUrl}/services/img/${this.identifier}`;
7
+ const randomGradient = `grad${Math.floor(Math.random() * (6 - 1) + 1)}`;
8
+ return html `
9
+ <div class="box" id=${randomGradient}>
10
+ <div
11
+ class="item-image"
12
+ style="background-image:url(${imgSrcUrl})"
13
+ ></div>
14
+ </div>
15
+ `;
16
+ }
17
+ static get styles() {
18
+ return css `
19
+ .box {
20
+ width: 16rem;
21
+ height: 16rem;
22
+ overflow: hidden;
23
+ position: relative;
24
+ box-shadow: 1px 1px 2px 0px;
25
+ display: flex;
26
+ }
27
+
28
+ .item-image {
29
+ width: 16rem;
30
+ height: 16rem;
31
+ object-fit: cover;
32
+ background-repeat: no-repeat;
33
+ background-position: center center;
34
+ position: relative;
35
+ -webkit-appearance: none;
36
+ overflow: visible;
37
+ mix-blend-mode: screen;
38
+ }
39
+
40
+ #grad1 {
41
+ background: linear-gradient(
42
+ hsl(300, 80%, 55%),
43
+ hsl(330, 80%, 33%) 35%,
44
+ hsl(330, 80%, 22%) 70%,
45
+ hsl(0, 0%, 0%)
46
+ );
47
+ }
48
+
49
+ #grad2 {
50
+ background: linear-gradient(
51
+ hsl(200, 80%, 55%),
52
+ hsl(230, 80%, 33%) 35%,
53
+ hsl(230, 80%, 22%) 70%,
54
+ hsl(0, 0%, 0%)
55
+ );
56
+ }
57
+
58
+ #grad3 {
59
+ background: linear-gradient(
60
+ hsl(160, 80%, 55%),
61
+ hsl(190, 80%, 33%) 35%,
62
+ hsl(190, 80%, 22%) 70%,
63
+ hsl(0, 0%, 0%)
64
+ );
65
+ }
66
+
67
+ #grad4 {
68
+ background: linear-gradient(
69
+ hsl(250, 80%, 55%),
70
+ hsl(280, 80%, 33%) 35%,
71
+ hsl(280, 80%, 22%) 70%,
72
+ hsl(0, 0%, 0%)
73
+ );
74
+ }
75
+
76
+ #grad5 {
77
+ background: linear-gradient(
78
+ hsl(280, 80%, 55%),
79
+ hsl(310, 80%, 33%) 35%,
80
+ hsl(310, 80%, 22%) 70%,
81
+ hsl(0, 0%, 0%)
82
+ );
83
+ }
84
+
85
+ #grad6 {
86
+ background: linear-gradient(
87
+ hsl(340, 80%, 55%),
88
+ hsl(0, 80%, 33%) 35%,
89
+ hsl(0, 80%, 22%) 70%,
90
+ hsl(0, 0%, 0%)
91
+ );
92
+ }
93
+ `;
94
+ }
95
+ };
96
+ __decorate([
97
+ property({ type: String })
98
+ ], WaveformThumbnail.prototype, "baseNavigationUrl", void 0);
99
+ __decorate([
100
+ property({ type: String })
101
+ ], WaveformThumbnail.prototype, "identifier", void 0);
102
+ WaveformThumbnail = __decorate([
103
+ customElement('waveform-thumbnail')
104
+ ], WaveformThumbnail);
105
+ export { WaveformThumbnail };
106
+ //# sourceMappingURL=waveform-thumbnail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waveform-thumbnail.js","sourceRoot":"","sources":["../../src/waveform-thumbnail.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG5D,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,UAAU;IAK/C,MAAM;QACJ,MAAM,SAAS,GAAG,GAAG,IAAI,CAAC,iBAAiB,iBAAiB,IAAI,CAAC,UAAU,EAAE,CAAC;QAC9E,MAAM,cAAc,GAAG,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAExE,OAAO,IAAI,CAAA;4BACa,cAAc;;;wCAGF,SAAS;;;KAG5C,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2ET,CAAC;IACJ,CAAC;CACF,CAAA;AAhG6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAA4B;AAE3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAqB;AAHrC,iBAAiB;IAD7B,aAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CAiG7B;SAjGY,iBAAiB","sourcesContent":["import { css, CSSResultGroup, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n@customElement('waveform-thumbnail')\nexport class WaveformThumbnail extends LitElement {\n @property({ type: String }) baseNavigationUrl?: string;\n\n @property({ type: String }) identifier?: string;\n\n render() {\n const imgSrcUrl = `${this.baseNavigationUrl}/services/img/${this.identifier}`;\n const randomGradient = `grad${Math.floor(Math.random() * (6 - 1) + 1)}`;\n\n return html`\n <div class=\"box\" id=${randomGradient}>\n <div\n class=\"item-image\"\n style=\"background-image:url(${imgSrcUrl})\"\n ></div>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n .box {\n width: 16rem;\n height: 16rem;\n overflow: hidden;\n position: relative;\n box-shadow: 1px 1px 2px 0px;\n display: flex;\n }\n\n .item-image {\n width: 16rem;\n height: 16rem;\n object-fit: cover;\n background-repeat: no-repeat;\n background-position: center center;\n position: relative;\n -webkit-appearance: none;\n overflow: visible;\n mix-blend-mode: screen;\n }\n\n #grad1 {\n background: linear-gradient(\n hsl(300, 80%, 55%),\n hsl(330, 80%, 33%) 35%,\n hsl(330, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad2 {\n background: linear-gradient(\n hsl(200, 80%, 55%),\n hsl(230, 80%, 33%) 35%,\n hsl(230, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad3 {\n background: linear-gradient(\n hsl(160, 80%, 55%),\n hsl(190, 80%, 33%) 35%,\n hsl(190, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad4 {\n background: linear-gradient(\n hsl(250, 80%, 55%),\n hsl(280, 80%, 33%) 35%,\n hsl(280, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad5 {\n background: linear-gradient(\n hsl(280, 80%, 55%),\n hsl(310, 80%, 33%) 35%,\n hsl(310, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n\n #grad6 {\n background: linear-gradient(\n hsl(340, 80%, 55%),\n hsl(0, 80%, 33%) 35%,\n hsl(0, 80%, 22%) 70%,\n hsl(0, 0%, 0%)\n );\n }\n `;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=waveform-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waveform-view.js","sourceRoot":"","sources":["../../src/waveform-view.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class YourWebComponent extends LitElement {
3
+ title: string;
4
+ counter: number;
5
+ private increment;
6
+ render(): import("lit-html").TemplateResult<1>;
7
+ static styles: import("lit").CSSResult;
8
+ }
@@ -0,0 +1,38 @@
1
+ import { __decorate } from "tslib";
2
+ import { html, css, LitElement } from 'lit';
3
+ import { property, customElement } from 'lit/decorators.js';
4
+ let YourWebComponent = class YourWebComponent extends LitElement {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.title = 'Hey there';
8
+ this.counter = 5;
9
+ }
10
+ increment() {
11
+ this.counter += 1;
12
+ }
13
+ render() {
14
+ return html `
15
+ <h2>${this.title}, Number: ${this.counter}!</h2>
16
+ <button @click=${this.increment}>increment</button>
17
+ <slot name="my-slot"> </slot>
18
+ `;
19
+ }
20
+ };
21
+ YourWebComponent.styles = css `
22
+ :host {
23
+ display: block;
24
+ padding: 25px;
25
+ color: var(--your-webcomponent-text-color, #000);
26
+ }
27
+ `;
28
+ __decorate([
29
+ property({ type: String })
30
+ ], YourWebComponent.prototype, "title", void 0);
31
+ __decorate([
32
+ property({ type: Number })
33
+ ], YourWebComponent.prototype, "counter", void 0);
34
+ YourWebComponent = __decorate([
35
+ customElement('your-webcomponent')
36
+ ], YourWebComponent);
37
+ export { YourWebComponent };
38
+ //# sourceMappingURL=your-webcomponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"your-webcomponent.js","sourceRoot":"","sources":["../../src/your-webcomponent.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG5D,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,UAAU;IAAhD;;QAC8B,UAAK,GAAG,WAAW,CAAC;QAEpB,YAAO,GAAG,CAAC,CAAC;IAqB1C,CAAC;IAnBS,SAAS;QACf,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;YACH,IAAI,CAAC,KAAK,aAAa,IAAI,CAAC,OAAO;uBACxB,IAAI,CAAC,SAAS;;KAEhC,CAAC;IACJ,CAAC;CASF,CAAA;AAPQ,uBAAM,GAAG,GAAG,CAAA;;;;;;GAMlB,CAAC;AAtB0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAqB;AAEpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAa;AAH7B,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAwB5B;SAxBY,gBAAgB","sourcesContent":["import { html, css, LitElement } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\n\n@customElement('your-webcomponent')\nexport class YourWebComponent extends LitElement {\n @property({ type: String }) title = 'Hey there';\n\n @property({ type: Number }) counter = 5;\n\n private increment() {\n this.counter += 1;\n }\n\n render() {\n return html`\n <h2>${this.title}, Number: ${this.counter}!</h2>\n <button @click=${this.increment}>increment</button>\n <slot name=\"my-slot\"> </slot>\n `;\n }\n\n static styles = css`\n :host {\n display: block;\n padding: 25px;\n color: var(--your-webcomponent-text-color, #000);\n }\n `;\n}\n"]}
@@ -0,0 +1 @@
1
+ import '../src/collection-browser';
@@ -1,3 +1,17 @@
1
- "use strict";
2
- describe('YourWebComponent', () => { });
1
+ /* eslint-disable import/no-duplicates */
2
+ import { expect, fixture } from '@open-wc/testing';
3
+ import { html } from 'lit';
4
+ import '../src/collection-browser';
5
+ describe('Collection Browser', () => {
6
+ it('should render with a sort bar, facets, and infinite scroller', async () => {
7
+ var _a, _b, _c;
8
+ const el = await fixture(html `<collection-browser></collection-browser>`);
9
+ const facets = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('collection-facets');
10
+ const sortBar = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('sort-filter-bar');
11
+ const infiniteScroller = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('infinite-scroller');
12
+ expect(facets).to.exist;
13
+ expect(sortBar).to.exist;
14
+ expect(infiniteScroller).to.exist;
15
+ });
16
+ });
3
17
  //# sourceMappingURL=collection-browser.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collection-browser.test.js","sourceRoot":"","sources":["../../test/collection-browser.test.ts"],"names":[],"mappings":";AAAA,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC","sourcesContent":["describe('YourWebComponent', () => {});\n"]}
1
+ {"version":3,"file":"collection-browser.test.js","sourceRoot":"","sources":["../../test/collection-browser.test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAE3B,OAAO,2BAA2B,CAAC;AAEnC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;;QAC5E,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA,2CAA2C,CAChD,CAAC;QAEF,MAAM,MAAM,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;QACjE,MAAM,OAAO,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;QAChE,MAAM,gBAAgB,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;QAC3E,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QACxB,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QACzB,MAAM,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable import/no-duplicates */\nimport { expect, fixture } from '@open-wc/testing';\nimport { html } from 'lit';\nimport { CollectionBrowser } from '../src/collection-browser';\nimport '../src/collection-browser';\n\ndescribe('Collection Browser', () => {\n it('should render with a sort bar, facets, and infinite scroller', async () => {\n const el = await fixture<CollectionBrowser>(\n html`<collection-browser></collection-browser>`\n );\n\n const facets = el.shadowRoot?.querySelector('collection-facets');\n const sortBar = el.shadowRoot?.querySelector('sort-filter-bar');\n const infiniteScroller = el.shadowRoot?.querySelector('infinite-scroller');\n expect(facets).to.exist;\n expect(sortBar).to.exist;\n expect(infiniteScroller).to.exist;\n });\n});\n"]}
@@ -0,0 +1 @@
1
+ export {};