@internetarchive/collection-browser 0.4.3-alpha.9 → 0.4.4-alpha

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 (250) hide show
  1. package/.editorconfig +29 -29
  2. package/.github/workflows/ci.yml +26 -26
  3. package/.github/workflows/gh-pages-main.yml +39 -39
  4. package/.github/workflows/npm-publish.yml +39 -39
  5. package/.github/workflows/pr-preview.yml +38 -38
  6. package/.husky/pre-commit +4 -4
  7. package/LICENSE +661 -661
  8. package/README.md +83 -83
  9. package/dist/index.d.ts +9 -9
  10. package/dist/index.js +9 -9
  11. package/dist/src/app-root.d.ts +50 -48
  12. package/dist/src/app-root.js +449 -412
  13. package/dist/src/app-root.js.map +1 -1
  14. package/dist/src/assets/img/icons/arrow-left.d.ts +2 -2
  15. package/dist/src/assets/img/icons/arrow-left.js +2 -2
  16. package/dist/src/assets/img/icons/arrow-right.d.ts +2 -2
  17. package/dist/src/assets/img/icons/arrow-right.js +2 -2
  18. package/dist/src/assets/img/icons/chevron.d.ts +2 -2
  19. package/dist/src/assets/img/icons/chevron.js +2 -2
  20. package/dist/src/assets/img/icons/empty-query.d.ts +2 -2
  21. package/dist/src/assets/img/icons/empty-query.js +2 -2
  22. package/dist/src/assets/img/icons/eye-closed.d.ts +2 -2
  23. package/dist/src/assets/img/icons/eye-closed.js +2 -2
  24. package/dist/src/assets/img/icons/eye.d.ts +2 -2
  25. package/dist/src/assets/img/icons/eye.js +2 -2
  26. package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
  27. package/dist/src/assets/img/icons/favorite-filled.js +2 -2
  28. package/dist/src/assets/img/icons/login-required.d.ts +1 -1
  29. package/dist/src/assets/img/icons/login-required.js +2 -2
  30. package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
  31. package/dist/src/assets/img/icons/mediatype/account.js +2 -2
  32. package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
  33. package/dist/src/assets/img/icons/mediatype/audio.js +2 -2
  34. package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
  35. package/dist/src/assets/img/icons/mediatype/collection.js +2 -2
  36. package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
  37. package/dist/src/assets/img/icons/mediatype/data.js +2 -2
  38. package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
  39. package/dist/src/assets/img/icons/mediatype/etree.js +2 -2
  40. package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
  41. package/dist/src/assets/img/icons/mediatype/film.js +2 -2
  42. package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
  43. package/dist/src/assets/img/icons/mediatype/images.js +2 -2
  44. package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
  45. package/dist/src/assets/img/icons/mediatype/radio.js +2 -2
  46. package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
  47. package/dist/src/assets/img/icons/mediatype/software.js +2 -2
  48. package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
  49. package/dist/src/assets/img/icons/mediatype/texts.js +2 -2
  50. package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
  51. package/dist/src/assets/img/icons/mediatype/tv.js +2 -2
  52. package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
  53. package/dist/src/assets/img/icons/mediatype/video.js +2 -2
  54. package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
  55. package/dist/src/assets/img/icons/mediatype/web.js +2 -2
  56. package/dist/src/assets/img/icons/null-result.d.ts +2 -2
  57. package/dist/src/assets/img/icons/null-result.js +2 -2
  58. package/dist/src/assets/img/icons/restricted.d.ts +1 -1
  59. package/dist/src/assets/img/icons/restricted.js +2 -2
  60. package/dist/src/assets/img/icons/reviews.d.ts +1 -1
  61. package/dist/src/assets/img/icons/reviews.js +2 -2
  62. package/dist/src/assets/img/icons/upload.d.ts +1 -1
  63. package/dist/src/assets/img/icons/upload.js +2 -2
  64. package/dist/src/assets/img/icons/views.d.ts +1 -1
  65. package/dist/src/assets/img/icons/views.js +2 -2
  66. package/dist/src/circular-activity-indicator.d.ts +5 -5
  67. package/dist/src/circular-activity-indicator.js +17 -17
  68. package/dist/src/collection-browser.d.ts +315 -276
  69. package/dist/src/collection-browser.js +1276 -1179
  70. package/dist/src/collection-browser.js.map +1 -1
  71. package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -5
  72. package/dist/src/collection-facets/facet-tombstone-row.js +15 -15
  73. package/dist/src/collection-facets/facets-template.d.ts +16 -16
  74. package/dist/src/collection-facets/facets-template.js +125 -125
  75. package/dist/src/collection-facets/more-facets-content.d.ts +77 -77
  76. package/dist/src/collection-facets/more-facets-content.js +357 -357
  77. package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
  78. package/dist/src/collection-facets/more-facets-pagination.js +192 -192
  79. package/dist/src/collection-facets.d.ts +78 -78
  80. package/dist/src/collection-facets.js +391 -391
  81. package/dist/src/empty-placeholder.d.ts +11 -11
  82. package/dist/src/empty-placeholder.js +42 -42
  83. package/dist/src/language-code-handler/language-code-handler.d.ts +37 -37
  84. package/dist/src/language-code-handler/language-code-handler.js +26 -26
  85. package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -1
  86. package/dist/src/language-code-handler/language-code-mapping.js +562 -562
  87. package/dist/src/mediatype/mediatype-config.d.ts +3 -3
  88. package/dist/src/mediatype/mediatype-config.js +85 -85
  89. package/dist/src/models.d.ts +114 -112
  90. package/dist/src/models.js +125 -125
  91. package/dist/src/models.js.map +1 -1
  92. package/dist/src/restoration-state-handler.d.ts +45 -45
  93. package/dist/src/restoration-state-handler.js +230 -230
  94. package/dist/src/sort-filter-bar/alpha-bar.d.ts +12 -12
  95. package/dist/src/sort-filter-bar/alpha-bar.js +52 -52
  96. package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
  97. package/dist/src/sort-filter-bar/img/compact.js +2 -2
  98. package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
  99. package/dist/src/sort-filter-bar/img/list.js +2 -2
  100. package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
  101. package/dist/src/sort-filter-bar/img/sort-triangle.js +2 -2
  102. package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
  103. package/dist/src/sort-filter-bar/img/tile.js +2 -2
  104. package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +108 -108
  105. package/dist/src/sort-filter-bar/sort-filter-bar.js +428 -428
  106. package/dist/src/styles/item-image-styles.d.ts +8 -8
  107. package/dist/src/styles/item-image-styles.js +22 -12
  108. package/dist/src/styles/item-image-styles.js.map +1 -1
  109. package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -5
  110. package/dist/src/tiles/collection-browser-loading-tile.js +16 -16
  111. package/dist/src/tiles/collection-browser-loading-tile.js.map +1 -1
  112. package/dist/src/tiles/grid/account-tile.d.ts +17 -17
  113. package/dist/src/tiles/grid/account-tile.js +48 -47
  114. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  115. package/dist/src/tiles/grid/collection-tile.d.ts +14 -7
  116. package/dist/src/tiles/grid/collection-tile.js +112 -146
  117. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  118. package/dist/src/tiles/grid/item-tile.d.ts +29 -29
  119. package/dist/src/tiles/grid/item-tile.js +110 -105
  120. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  121. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -1
  122. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +12 -8
  123. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
  124. package/dist/src/tiles/grid/tile-stats.d.ts +10 -10
  125. package/dist/src/tiles/grid/tile-stats.js +41 -40
  126. package/dist/src/tiles/grid/tile-stats.js.map +1 -1
  127. package/dist/src/tiles/image-block.d.ts +17 -17
  128. package/dist/src/tiles/image-block.js +76 -72
  129. package/dist/src/tiles/image-block.js.map +1 -1
  130. package/dist/src/tiles/item-image.d.ts +35 -35
  131. package/dist/src/tiles/item-image.js +117 -116
  132. package/dist/src/tiles/item-image.js.map +1 -1
  133. package/dist/src/tiles/list/account-label.d.ts +1 -1
  134. package/dist/src/tiles/list/account-label.js +6 -6
  135. package/dist/src/tiles/list/date-label.d.ts +1 -1
  136. package/dist/src/tiles/list/date-label.js +12 -12
  137. package/dist/src/tiles/list/tile-list-compact-header.d.ts +12 -12
  138. package/dist/src/tiles/list/tile-list-compact-header.js +41 -41
  139. package/dist/src/tiles/list/tile-list-compact.d.ts +21 -21
  140. package/dist/src/tiles/list/tile-list-compact.js +93 -93
  141. package/dist/src/tiles/list/tile-list.d.ts +53 -53
  142. package/dist/src/tiles/list/tile-list.js +279 -279
  143. package/dist/src/tiles/mediatype-icon.d.ts +9 -9
  144. package/dist/src/tiles/mediatype-icon.js +47 -47
  145. package/dist/src/tiles/overlay/icon-overlay.d.ts +10 -10
  146. package/dist/src/tiles/overlay/icon-overlay.js +40 -40
  147. package/dist/src/tiles/overlay/icon-text-overlay.d.ts +9 -9
  148. package/dist/src/tiles/overlay/icon-text-overlay.js +38 -38
  149. package/dist/src/tiles/overlay/text-overlay.d.ts +10 -10
  150. package/dist/src/tiles/overlay/text-overlay.js +42 -42
  151. package/dist/src/tiles/text-snippet-block.d.ts +27 -27
  152. package/dist/src/tiles/text-snippet-block.js +73 -73
  153. package/dist/src/tiles/tile-dispatcher.d.ts +36 -36
  154. package/dist/src/tiles/tile-dispatcher.js +145 -128
  155. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  156. package/dist/src/utils/analytics-events.d.ts +22 -22
  157. package/dist/src/utils/analytics-events.js +24 -24
  158. package/dist/src/utils/format-count.d.ts +7 -7
  159. package/dist/src/utils/format-count.js +76 -76
  160. package/dist/src/utils/format-date.d.ts +2 -2
  161. package/dist/src/utils/format-date.js +23 -23
  162. package/dist/src/utils/format-unit-size.d.ts +2 -0
  163. package/dist/src/utils/format-unit-size.js +34 -0
  164. package/dist/src/utils/format-unit-size.js.map +1 -0
  165. package/dist/test/collection-browser.test.d.ts +1 -1
  166. package/dist/test/collection-browser.test.js +646 -646
  167. package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
  168. package/dist/test/collection-facets/facets-template.test.js +62 -62
  169. package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
  170. package/dist/test/collection-facets/more-facets-content.test.js +114 -114
  171. package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -1
  172. package/dist/test/collection-facets/more-facets-pagination.test.js +117 -117
  173. package/dist/test/collection-facets.test.d.ts +2 -2
  174. package/dist/test/collection-facets.test.js +544 -544
  175. package/dist/test/empty-placeholder.test.d.ts +1 -1
  176. package/dist/test/empty-placeholder.test.js +33 -33
  177. package/dist/test/icon-overlay.test.d.ts +1 -1
  178. package/dist/test/icon-overlay.test.js +24 -24
  179. package/dist/test/image-block.test.d.ts +1 -1
  180. package/dist/test/image-block.test.js +48 -48
  181. package/dist/test/item-image.test.d.ts +1 -1
  182. package/dist/test/item-image.test.js +84 -80
  183. package/dist/test/item-image.test.js.map +1 -1
  184. package/dist/test/mediatype-config.test.d.ts +1 -1
  185. package/dist/test/mediatype-config.test.js +16 -16
  186. package/dist/test/mocks/mock-analytics-handler.d.ts +10 -10
  187. package/dist/test/mocks/mock-analytics-handler.js +15 -15
  188. package/dist/test/mocks/mock-collection-name-cache.d.ts +7 -7
  189. package/dist/test/mocks/mock-collection-name-cache.js +13 -13
  190. package/dist/test/mocks/mock-search-responses.d.ts +12 -12
  191. package/dist/test/mocks/mock-search-responses.js +341 -341
  192. package/dist/test/mocks/mock-search-service.d.ts +13 -13
  193. package/dist/test/mocks/mock-search-service.js +40 -40
  194. package/dist/test/restoration-state-handler.test.d.ts +1 -1
  195. package/dist/test/restoration-state-handler.test.js +125 -125
  196. package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -1
  197. package/dist/test/sort-filter-bar/alpha-bar.test.js +43 -43
  198. package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -1
  199. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +141 -141
  200. package/dist/test/text-overlay.test.d.ts +1 -1
  201. package/dist/test/text-overlay.test.js +48 -48
  202. package/dist/test/text-snippet-block.test.d.ts +1 -1
  203. package/dist/test/text-snippet-block.test.js +57 -57
  204. package/dist/test/tile-stats.test.d.ts +1 -1
  205. package/dist/test/tile-stats.test.js +33 -33
  206. package/dist/test/tiles/grid/account-tile.test.d.ts +1 -1
  207. package/dist/test/tiles/grid/account-tile.test.js +60 -60
  208. package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -0
  209. package/dist/test/tiles/grid/collection-tile.test.js +73 -0
  210. package/dist/test/tiles/grid/collection-tile.test.js.map +1 -0
  211. package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
  212. package/dist/test/tiles/grid/item-tile.test.js +142 -129
  213. package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
  214. package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
  215. package/dist/test/tiles/list/tile-list-compact.test.js +92 -92
  216. package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
  217. package/dist/test/tiles/list/tile-list.test.js +123 -123
  218. package/dist/test/utils/format-count.test.d.ts +1 -1
  219. package/dist/test/utils/format-count.test.js +23 -23
  220. package/dist/test/utils/format-date.test.d.ts +1 -1
  221. package/dist/test/utils/format-date.test.js +17 -17
  222. package/dist/test/utils/format-unit-size.test.d.ts +1 -0
  223. package/dist/test/utils/format-unit-size.test.js +18 -0
  224. package/dist/test/utils/format-unit-size.test.js.map +1 -0
  225. package/index.html +24 -24
  226. package/local.archive.org.cert +86 -86
  227. package/local.archive.org.key +27 -27
  228. package/package.json +2 -2
  229. package/renovate.json +6 -6
  230. package/src/app-root.ts +214 -169
  231. package/src/collection-browser.ts +122 -3
  232. package/src/models.ts +2 -0
  233. package/src/styles/item-image-styles.ts +13 -3
  234. package/src/tiles/collection-browser-loading-tile.ts +1 -1
  235. package/src/tiles/grid/account-tile.ts +4 -2
  236. package/src/tiles/grid/collection-tile.ts +106 -136
  237. package/src/tiles/grid/item-tile.ts +8 -2
  238. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +6 -2
  239. package/src/tiles/grid/tile-stats.ts +1 -0
  240. package/src/tiles/image-block.ts +5 -2
  241. package/src/tiles/item-image.ts +4 -3
  242. package/src/tiles/tile-dispatcher.ts +17 -0
  243. package/src/utils/format-unit-size.ts +43 -0
  244. package/test/item-image.test.ts +4 -0
  245. package/test/tiles/grid/collection-tile.test.ts +85 -0
  246. package/test/tiles/grid/item-tile.test.ts +30 -4
  247. package/test/utils/format-unit-size.test.ts +21 -0
  248. package/tsconfig.json +21 -21
  249. package/web-dev-server.config.mjs +30 -30
  250. package/web-test-runner.config.mjs +41 -41
@@ -1,7 +1,7 @@
1
- export function accountLabel(date) {
2
- if (!date) {
3
- return '';
4
- }
5
- return `Archivist since ${date.getFullYear()}`;
6
- }
1
+ export function accountLabel(date) {
2
+ if (!date) {
3
+ return '';
4
+ }
5
+ return `Archivist since ${date.getFullYear()}`;
6
+ }
7
7
  //# sourceMappingURL=account-label.js.map
@@ -1 +1 @@
1
- export declare function dateLabel(sortField: string | undefined): string;
1
+ export declare function dateLabel(sortField: string | undefined): string;
@@ -1,13 +1,13 @@
1
- export function dateLabel(sortField) {
2
- switch (sortField) {
3
- case 'date':
4
- return 'Published';
5
- case 'reviewdate':
6
- return 'Reviewed';
7
- case 'addeddate':
8
- return 'Added';
9
- default:
10
- return 'Archived';
11
- }
12
- }
1
+ export function dateLabel(sortField) {
2
+ switch (sortField) {
3
+ case 'date':
4
+ return 'Published';
5
+ case 'reviewdate':
6
+ return 'Reviewed';
7
+ case 'addeddate':
8
+ return 'Added';
9
+ default:
10
+ return 'Archived';
11
+ }
12
+ }
13
13
  //# sourceMappingURL=date-label.js.map
@@ -1,12 +1,12 @@
1
- import { LitElement } from 'lit';
2
- import type { SortParam } from '@internetarchive/search-service';
3
- import type { TileModel } from '../../models';
4
- export declare class TileListCompactHeader extends LitElement {
5
- model?: TileModel;
6
- currentWidth?: number;
7
- sortParam: SortParam | null;
8
- mobileBreakpoint?: number;
9
- render(): import("lit-html").TemplateResult<1>;
10
- private get classSize();
11
- static get styles(): import("lit").CSSResult;
12
- }
1
+ import { LitElement } from 'lit';
2
+ import type { SortParam } from '@internetarchive/search-service';
3
+ import type { TileModel } from '../../models';
4
+ export declare class TileListCompactHeader extends LitElement {
5
+ model?: TileModel;
6
+ currentWidth?: number;
7
+ sortParam: SortParam | null;
8
+ mobileBreakpoint?: number;
9
+ render(): import("lit-html").TemplateResult<1>;
10
+ private get classSize();
11
+ static get styles(): import("lit").CSSResult;
12
+ }
@@ -1,14 +1,14 @@
1
- import { __decorate } from "tslib";
2
- import { css, html, LitElement } from 'lit';
3
- import { customElement, property } from 'lit/decorators.js';
4
- import { dateLabel } from './date-label';
5
- let TileListCompactHeader = class TileListCompactHeader extends LitElement {
6
- constructor() {
7
- super(...arguments);
8
- this.sortParam = null;
9
- }
10
- render() {
11
- var _a;
1
+ import { __decorate } from "tslib";
2
+ import { css, html, LitElement } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import { dateLabel } from './date-label';
5
+ let TileListCompactHeader = class TileListCompactHeader extends LitElement {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.sortParam = null;
9
+ }
10
+ render() {
11
+ var _a;
12
12
  return html `
13
13
  <div id="list-line-header" class="${this.classSize}">
14
14
  <div id="thumb"></div>
@@ -18,17 +18,17 @@ let TileListCompactHeader = class TileListCompactHeader extends LitElement {
18
18
  <div id="icon"></div>
19
19
  <div id="views">Views</div>
20
20
  </div>
21
- `;
22
- }
23
- get classSize() {
24
- if (this.mobileBreakpoint &&
25
- this.currentWidth &&
26
- this.currentWidth < this.mobileBreakpoint) {
27
- return 'mobile';
28
- }
29
- return 'desktop';
30
- }
31
- static get styles() {
21
+ `;
22
+ }
23
+ get classSize() {
24
+ if (this.mobileBreakpoint &&
25
+ this.currentWidth &&
26
+ this.currentWidth < this.mobileBreakpoint) {
27
+ return 'mobile';
28
+ }
29
+ return 'desktop';
30
+ }
31
+ static get styles() {
32
32
  return css `
33
33
  html {
34
34
  font-size: unset;
@@ -62,23 +62,23 @@ let TileListCompactHeader = class TileListCompactHeader extends LitElement {
62
62
  #list-line-header.desktop {
63
63
  grid-template-columns: 51px 3fr 2fr 100px 20px 60px;
64
64
  }
65
- `;
66
- }
67
- };
68
- __decorate([
69
- property({ type: Object })
70
- ], TileListCompactHeader.prototype, "model", void 0);
71
- __decorate([
72
- property({ type: Number })
73
- ], TileListCompactHeader.prototype, "currentWidth", void 0);
74
- __decorate([
75
- property({ type: Object })
76
- ], TileListCompactHeader.prototype, "sortParam", void 0);
77
- __decorate([
78
- property({ type: Number })
79
- ], TileListCompactHeader.prototype, "mobileBreakpoint", void 0);
80
- TileListCompactHeader = __decorate([
81
- customElement('tile-list-compact-header')
82
- ], TileListCompactHeader);
83
- export { TileListCompactHeader };
65
+ `;
66
+ }
67
+ };
68
+ __decorate([
69
+ property({ type: Object })
70
+ ], TileListCompactHeader.prototype, "model", void 0);
71
+ __decorate([
72
+ property({ type: Number })
73
+ ], TileListCompactHeader.prototype, "currentWidth", void 0);
74
+ __decorate([
75
+ property({ type: Object })
76
+ ], TileListCompactHeader.prototype, "sortParam", void 0);
77
+ __decorate([
78
+ property({ type: Number })
79
+ ], TileListCompactHeader.prototype, "mobileBreakpoint", void 0);
80
+ TileListCompactHeader = __decorate([
81
+ customElement('tile-list-compact-header')
82
+ ], TileListCompactHeader);
83
+ export { TileListCompactHeader };
84
84
  //# sourceMappingURL=tile-list-compact-header.js.map
@@ -1,21 +1,21 @@
1
- import { LitElement } from 'lit';
2
- import type { SortParam } from '@internetarchive/search-service';
3
- import type { TileModel } from '../../models';
4
- import '../image-block';
5
- import '../mediatype-icon';
6
- export declare class TileListCompact extends LitElement {
7
- model?: TileModel;
8
- baseNavigationUrl?: string;
9
- currentWidth?: number;
10
- currentHeight?: number;
11
- sortParam: SortParam | null;
12
- mobileBreakpoint?: number;
13
- baseImageUrl?: string;
14
- loggedIn: boolean;
15
- render(): import("lit-html").TemplateResult<1>;
16
- private get date();
17
- private get views();
18
- private get classSize();
19
- private get formatSize();
20
- static get styles(): import("lit").CSSResult;
21
- }
1
+ import { LitElement } from 'lit';
2
+ import type { SortParam } from '@internetarchive/search-service';
3
+ import type { TileModel } from '../../models';
4
+ import '../image-block';
5
+ import '../mediatype-icon';
6
+ export declare class TileListCompact extends LitElement {
7
+ model?: TileModel;
8
+ baseNavigationUrl?: string;
9
+ currentWidth?: number;
10
+ currentHeight?: number;
11
+ sortParam: SortParam | null;
12
+ mobileBreakpoint?: number;
13
+ baseImageUrl?: string;
14
+ loggedIn: boolean;
15
+ render(): import("lit-html").TemplateResult<1>;
16
+ private get date();
17
+ private get views();
18
+ private get classSize();
19
+ private get formatSize();
20
+ static get styles(): import("lit").CSSResult;
21
+ }
@@ -1,20 +1,20 @@
1
- import { __decorate } from "tslib";
2
- import { css, html, LitElement } from 'lit';
3
- import { customElement, property } from 'lit/decorators.js';
4
- import DOMPurify from 'dompurify';
5
- import { formatCount } from '../../utils/format-count';
6
- import { formatDate } from '../../utils/format-date';
7
- import { accountLabel } from './account-label';
8
- import '../image-block';
9
- import '../mediatype-icon';
10
- let TileListCompact = class TileListCompact extends LitElement {
11
- constructor() {
12
- super(...arguments);
13
- this.sortParam = null;
14
- this.loggedIn = false;
15
- }
16
- render() {
17
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1
+ import { __decorate } from "tslib";
2
+ import { css, html, LitElement } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import DOMPurify from 'dompurify';
5
+ import { formatCount } from '../../utils/format-count';
6
+ import { formatDate } from '../../utils/format-date';
7
+ import { accountLabel } from './account-label';
8
+ import '../image-block';
9
+ import '../mediatype-icon';
10
+ let TileListCompact = class TileListCompact extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.sortParam = null;
14
+ this.loggedIn = false;
15
+ }
16
+ render() {
17
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
18
18
  return html `
19
19
  <div id="list-line" class="${this.classSize}">
20
20
  <image-block
@@ -28,8 +28,8 @@ let TileListCompact = class TileListCompact extends LitElement {
28
28
  </image-block>
29
29
  <div id="title">${DOMPurify.sanitize((_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : '')}</div>
30
30
  <div id="creator">
31
- ${((_c = this.model) === null || _c === void 0 ? void 0 : _c.mediatype) === 'account'
32
- ? accountLabel((_d = this.model) === null || _d === void 0 ? void 0 : _d.dateAdded)
31
+ ${((_c = this.model) === null || _c === void 0 ? void 0 : _c.mediatype) === 'account'
32
+ ? accountLabel((_d = this.model) === null || _d === void 0 ? void 0 : _d.dateAdded)
33
33
  : DOMPurify.sanitize((_f = (_e = this.model) === null || _e === void 0 ? void 0 : _e.creator) !== null && _f !== void 0 ? _f : '')}
34
34
  </div>
35
35
  <div id="date">${formatDate(this.date, this.formatSize)}</div>
@@ -42,49 +42,49 @@ let TileListCompact = class TileListCompact extends LitElement {
42
42
  </div>
43
43
  <div id="views">${formatCount((_j = this.views) !== null && _j !== void 0 ? _j : 0, this.formatSize)}</div>
44
44
  </div>
45
- `;
46
- }
47
- /*
48
- * TODO: fix field names to match model in src/collection-browser.ts
49
- * private get dateSortSelector()
50
- * @see src/models.ts
51
- */
52
- get date() {
53
- var _a, _b, _c, _d, _e;
54
- switch ((_a = this.sortParam) === null || _a === void 0 ? void 0 : _a.field) {
55
- case 'date':
56
- return (_b = this.model) === null || _b === void 0 ? void 0 : _b.datePublished;
57
- case 'reviewdate':
58
- return (_c = this.model) === null || _c === void 0 ? void 0 : _c.dateReviewed;
59
- case 'addeddate':
60
- return (_d = this.model) === null || _d === void 0 ? void 0 : _d.dateAdded;
61
- default:
62
- return (_e = this.model) === null || _e === void 0 ? void 0 : _e.dateArchived; // publicdate
63
- }
64
- }
65
- get views() {
66
- var _a, _b, _c;
67
- return ((_a = this.sortParam) === null || _a === void 0 ? void 0 : _a.field) === 'week'
68
- ? (_b = this.model) === null || _b === void 0 ? void 0 : _b.weeklyViewCount // weekly views
69
- : (_c = this.model) === null || _c === void 0 ? void 0 : _c.viewCount; // all-time views
70
- }
71
- get classSize() {
72
- if (this.mobileBreakpoint &&
73
- this.currentWidth &&
74
- this.currentWidth < this.mobileBreakpoint) {
75
- return 'mobile';
76
- }
77
- return 'desktop';
78
- }
79
- get formatSize() {
80
- if (this.mobileBreakpoint &&
81
- this.currentWidth &&
82
- this.currentWidth < this.mobileBreakpoint) {
83
- return 'short';
84
- }
85
- return 'long';
86
- }
87
- static get styles() {
45
+ `;
46
+ }
47
+ /*
48
+ * TODO: fix field names to match model in src/collection-browser.ts
49
+ * private get dateSortSelector()
50
+ * @see src/models.ts
51
+ */
52
+ get date() {
53
+ var _a, _b, _c, _d, _e;
54
+ switch ((_a = this.sortParam) === null || _a === void 0 ? void 0 : _a.field) {
55
+ case 'date':
56
+ return (_b = this.model) === null || _b === void 0 ? void 0 : _b.datePublished;
57
+ case 'reviewdate':
58
+ return (_c = this.model) === null || _c === void 0 ? void 0 : _c.dateReviewed;
59
+ case 'addeddate':
60
+ return (_d = this.model) === null || _d === void 0 ? void 0 : _d.dateAdded;
61
+ default:
62
+ return (_e = this.model) === null || _e === void 0 ? void 0 : _e.dateArchived; // publicdate
63
+ }
64
+ }
65
+ get views() {
66
+ var _a, _b, _c;
67
+ return ((_a = this.sortParam) === null || _a === void 0 ? void 0 : _a.field) === 'week'
68
+ ? (_b = this.model) === null || _b === void 0 ? void 0 : _b.weeklyViewCount // weekly views
69
+ : (_c = this.model) === null || _c === void 0 ? void 0 : _c.viewCount; // all-time views
70
+ }
71
+ get classSize() {
72
+ if (this.mobileBreakpoint &&
73
+ this.currentWidth &&
74
+ this.currentWidth < this.mobileBreakpoint) {
75
+ return 'mobile';
76
+ }
77
+ return 'desktop';
78
+ }
79
+ get formatSize() {
80
+ if (this.mobileBreakpoint &&
81
+ this.currentWidth &&
82
+ this.currentWidth < this.mobileBreakpoint) {
83
+ return 'short';
84
+ }
85
+ return 'long';
86
+ }
87
+ static get styles() {
88
88
  return css `
89
89
  html {
90
90
  font-size: unset;
@@ -151,35 +151,35 @@ let TileListCompact = class TileListCompact extends LitElement {
151
151
  --imgHeight: 100%;
152
152
  --imgWidth: 100%;
153
153
  }
154
- `;
155
- }
156
- };
157
- __decorate([
158
- property({ type: Object })
159
- ], TileListCompact.prototype, "model", void 0);
160
- __decorate([
161
- property({ type: String })
162
- ], TileListCompact.prototype, "baseNavigationUrl", void 0);
163
- __decorate([
164
- property({ type: Number })
165
- ], TileListCompact.prototype, "currentWidth", void 0);
166
- __decorate([
167
- property({ type: Number })
168
- ], TileListCompact.prototype, "currentHeight", void 0);
169
- __decorate([
170
- property({ type: Object })
171
- ], TileListCompact.prototype, "sortParam", void 0);
172
- __decorate([
173
- property({ type: Number })
174
- ], TileListCompact.prototype, "mobileBreakpoint", void 0);
175
- __decorate([
176
- property({ type: String })
177
- ], TileListCompact.prototype, "baseImageUrl", void 0);
178
- __decorate([
179
- property({ type: Boolean })
180
- ], TileListCompact.prototype, "loggedIn", void 0);
181
- TileListCompact = __decorate([
182
- customElement('tile-list-compact')
183
- ], TileListCompact);
184
- export { TileListCompact };
154
+ `;
155
+ }
156
+ };
157
+ __decorate([
158
+ property({ type: Object })
159
+ ], TileListCompact.prototype, "model", void 0);
160
+ __decorate([
161
+ property({ type: String })
162
+ ], TileListCompact.prototype, "baseNavigationUrl", void 0);
163
+ __decorate([
164
+ property({ type: Number })
165
+ ], TileListCompact.prototype, "currentWidth", void 0);
166
+ __decorate([
167
+ property({ type: Number })
168
+ ], TileListCompact.prototype, "currentHeight", void 0);
169
+ __decorate([
170
+ property({ type: Object })
171
+ ], TileListCompact.prototype, "sortParam", void 0);
172
+ __decorate([
173
+ property({ type: Number })
174
+ ], TileListCompact.prototype, "mobileBreakpoint", void 0);
175
+ __decorate([
176
+ property({ type: String })
177
+ ], TileListCompact.prototype, "baseImageUrl", void 0);
178
+ __decorate([
179
+ property({ type: Boolean })
180
+ ], TileListCompact.prototype, "loggedIn", void 0);
181
+ TileListCompact = __decorate([
182
+ customElement('tile-list-compact')
183
+ ], TileListCompact);
184
+ export { TileListCompact };
185
185
  //# sourceMappingURL=tile-list-compact.js.map
@@ -1,53 +1,53 @@
1
- import { LitElement, PropertyValues, TemplateResult } from 'lit';
2
- import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
3
- import type { SortParam } from '@internetarchive/search-service';
4
- import { TileModel } from '../../models';
5
- import '../image-block';
6
- import '../mediatype-icon';
7
- export declare class TileList extends LitElement {
8
- model?: TileModel;
9
- baseNavigationUrl?: string;
10
- collectionNameCache?: CollectionNameCacheInterface;
11
- currentWidth?: number;
12
- currentHeight?: number;
13
- sortParam: SortParam | null;
14
- mobileBreakpoint?: number;
15
- private collectionLinks;
16
- baseImageUrl?: string;
17
- loggedIn: boolean;
18
- render(): TemplateResult<1>;
19
- /**
20
- * Templates
21
- */
22
- private get mobileTemplate();
23
- private get desktopTemplate();
24
- private get imageBlockTemplate();
25
- private get detailsTemplate();
26
- private get iconRightTemplate();
27
- private get titleTemplate();
28
- private get itemLineTemplate();
29
- private get sourceTemplate();
30
- private get volumeTemplate();
31
- private get issueTemplate();
32
- private get creatorTemplate();
33
- private get datePublishedTemplate();
34
- private get dateSortByTemplate();
35
- private get viewsTemplate();
36
- private get ratingTemplate();
37
- private get reviewsTemplate();
38
- private get topicsTemplate();
39
- private get collectionsTemplate();
40
- private get descriptionTemplate();
41
- private get textSnippetsTemplate();
42
- private get hasSnippets();
43
- private metadataTemplate;
44
- private labelTemplate;
45
- private searchLink;
46
- private detailsLink;
47
- protected updated(changed: PropertyValues): void;
48
- private fetchCollectionNames;
49
- private get date();
50
- private get classSize();
51
- private get formatSize();
52
- static get styles(): import("lit").CSSResult;
53
- }
1
+ import { LitElement, PropertyValues, TemplateResult } from 'lit';
2
+ import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
3
+ import type { SortParam } from '@internetarchive/search-service';
4
+ import { TileModel } from '../../models';
5
+ import '../image-block';
6
+ import '../mediatype-icon';
7
+ export declare class TileList extends LitElement {
8
+ model?: TileModel;
9
+ baseNavigationUrl?: string;
10
+ collectionNameCache?: CollectionNameCacheInterface;
11
+ currentWidth?: number;
12
+ currentHeight?: number;
13
+ sortParam: SortParam | null;
14
+ mobileBreakpoint?: number;
15
+ private collectionLinks;
16
+ baseImageUrl?: string;
17
+ loggedIn: boolean;
18
+ render(): TemplateResult<1>;
19
+ /**
20
+ * Templates
21
+ */
22
+ private get mobileTemplate();
23
+ private get desktopTemplate();
24
+ private get imageBlockTemplate();
25
+ private get detailsTemplate();
26
+ private get iconRightTemplate();
27
+ private get titleTemplate();
28
+ private get itemLineTemplate();
29
+ private get sourceTemplate();
30
+ private get volumeTemplate();
31
+ private get issueTemplate();
32
+ private get creatorTemplate();
33
+ private get datePublishedTemplate();
34
+ private get dateSortByTemplate();
35
+ private get viewsTemplate();
36
+ private get ratingTemplate();
37
+ private get reviewsTemplate();
38
+ private get topicsTemplate();
39
+ private get collectionsTemplate();
40
+ private get descriptionTemplate();
41
+ private get textSnippetsTemplate();
42
+ private get hasSnippets();
43
+ private metadataTemplate;
44
+ private labelTemplate;
45
+ private searchLink;
46
+ private detailsLink;
47
+ protected updated(changed: PropertyValues): void;
48
+ private fetchCollectionNames;
49
+ private get date();
50
+ private get classSize();
51
+ private get formatSize();
52
+ static get styles(): import("lit").CSSResult;
53
+ }