@internetarchive/collection-browser 0.2.4-alpha.3 → 0.2.4-rc1

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 (38) hide show
  1. package/dist/src/tiles/grid/account-tile.d.ts +0 -1
  2. package/dist/src/tiles/grid/account-tile.js +68 -31
  3. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  4. package/dist/src/tiles/grid/icons/account.d.ts +1 -0
  5. package/dist/src/tiles/grid/icons/account.js +12 -0
  6. package/dist/src/tiles/grid/icons/account.js.map +1 -0
  7. package/dist/src/{assets/img → tiles/grid}/icons/favorite-filled.d.ts +0 -0
  8. package/dist/src/{assets/img → tiles/grid}/icons/favorite-filled.js +0 -0
  9. package/dist/src/{assets/img → tiles/grid}/icons/favorite-filled.js.map +1 -1
  10. package/dist/src/{assets/img → tiles/grid}/icons/reviews.d.ts +0 -0
  11. package/dist/src/{assets/img → tiles/grid}/icons/reviews.js +0 -0
  12. package/dist/src/{assets/img → tiles/grid}/icons/reviews.js.map +1 -1
  13. package/dist/src/{assets/img → tiles/grid}/icons/upload.d.ts +0 -0
  14. package/dist/src/{assets/img → tiles/grid}/icons/upload.js +0 -0
  15. package/dist/src/{assets/img → tiles/grid}/icons/upload.js.map +1 -1
  16. package/dist/src/tiles/grid/icons/views.d.ts +2 -0
  17. package/dist/src/{assets/img → tiles/grid}/icons/views.js +1 -1
  18. package/dist/src/tiles/grid/icons/views.js.map +1 -0
  19. package/dist/src/tiles/grid/item-tile.d.ts +0 -1
  20. package/dist/src/tiles/grid/item-tile.js +91 -43
  21. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  22. package/dist/src/tiles/mediatype-icon.js +0 -4
  23. package/dist/src/tiles/mediatype-icon.js.map +1 -1
  24. package/package.json +1 -1
  25. package/src/tiles/grid/account-tile.ts +67 -30
  26. package/src/tiles/grid/icons/account.ts +12 -0
  27. package/src/{assets/img → tiles/grid}/icons/favorite-filled.ts +0 -0
  28. package/src/{assets/img → tiles/grid}/icons/reviews.ts +0 -0
  29. package/src/{assets/img → tiles/grid}/icons/upload.ts +0 -0
  30. package/src/{assets/img → tiles/grid}/icons/views.ts +1 -1
  31. package/src/tiles/grid/item-tile.ts +94 -46
  32. package/src/tiles/mediatype-icon.ts +0 -4
  33. package/dist/src/assets/img/icons/views.d.ts +0 -1
  34. package/dist/src/assets/img/icons/views.js.map +0 -1
  35. package/dist/src/tiles/grid/tile-stats.d.ts +0 -10
  36. package/dist/src/tiles/grid/tile-stats.js +0 -106
  37. package/dist/src/tiles/grid/tile-stats.js.map +0 -1
  38. package/src/tiles/grid/tile-stats.ts +0 -104
@@ -1,6 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
2
  import { TileModel } from '../../models';
3
- import './tile-stats';
4
3
  export declare class AccountTile extends LitElement {
5
4
  model?: TileModel;
6
5
  render(): import("lit-html").TemplateResult<1>;
@@ -1,43 +1,52 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { css, html, LitElement } from 'lit';
3
3
  import { customElement, property } from 'lit/decorators.js';
4
- import './tile-stats';
4
+ import { accountIcon } from './icons/account';
5
+ import { favoriteFilledIcon } from './icons/favorite-filled';
6
+ import { reviewsIcon } from './icons/reviews';
7
+ import { uploadIcon } from './icons/upload';
5
8
  let AccountTile = class AccountTile extends LitElement {
6
9
  render() {
7
- var _a, _b, _c, _d, _e, _f, _g, _h;
10
+ var _a, _b, _c, _d, _e, _f, _g;
8
11
  return html `
9
12
  <div class="outer-holder">
10
- <div id="header-holder">
11
- <div id="title-holder">
12
- <h1 class="truncated">${(_a = this.model) === null || _a === void 0 ? void 0 : _a.identifier}</h1>
13
- </div>
14
- </div>
15
-
16
13
  <div class="inner-holder">
17
- <div id="avatar-holder">
18
- <img
19
- id="avatar"
20
- alt="patron-avatar"
21
- src="https://archive.org/services/img/${(_b = this.model) === null || _b === void 0 ? void 0 : _b.identifier}"
22
- />
14
+ <div id="header-holder">
15
+ <div id="title-holder">
16
+ <h1 class="truncated">${(_a = this.model) === null || _a === void 0 ? void 0 : _a.identifier}</h1>
17
+ </div>
18
+ <div id="avatar-holder">
19
+ <div
20
+ id="avatar"
21
+ style="background-image: url('https://archive.org/services/img/${(_b = this
22
+ .model) === null || _b === void 0 ? void 0 : _b.identifier}')"
23
+ ></div>
24
+ </div>
23
25
  </div>
24
-
25
26
  <div id="year-holder">
26
27
  <div id="archivist-since">
27
- <span>
28
- Archivist since ${(_d = (_c = this.model) === null || _c === void 0 ? void 0 : _c.dateAdded) === null || _d === void 0 ? void 0 : _d.getFullYear()}
29
- </span>
28
+ <h3>Archivist Since</h3>
29
+ </div>
30
+ <div id="year-holder">
31
+ <h3>${(_d = (_c = this.model) === null || _c === void 0 ? void 0 : _c.dateAdded) === null || _d === void 0 ? void 0 : _d.getFullYear()}</h3>
32
+ </div>
33
+ </div>
34
+ <div id="status-holder">
35
+ <div id="patron-icon">${accountIcon}</div>
36
+ <div class="stat-icon">
37
+ ${uploadIcon}
38
+ <h3>${(_e = this.model) === null || _e === void 0 ? void 0 : _e.itemCount}</h3>
39
+ </div>
40
+ <div class="stat-icon">
41
+ ${favoriteFilledIcon}
42
+ <h3>${(_f = this.model) === null || _f === void 0 ? void 0 : _f.favCount}</h3>
43
+ </div>
44
+ <div class="stat-icon">
45
+ ${reviewsIcon}
46
+ <h3>${(_g = this.model) === null || _g === void 0 ? void 0 : _g.commentCount}</h3>
30
47
  </div>
31
48
  </div>
32
49
  </div>
33
-
34
- <tile-stats
35
- .mediatype=${(_e = this.model) === null || _e === void 0 ? void 0 : _e.mediatype}
36
- .itemCount=${(_f = this.model) === null || _f === void 0 ? void 0 : _f.itemCount}
37
- .favCount=${(_g = this.model) === null || _g === void 0 ? void 0 : _g.favCount}
38
- .commentCount=${(_h = this.model) === null || _h === void 0 ? void 0 : _h.commentCount}
39
- >
40
- </tile-stats>
41
50
  </div>
42
51
  `;
43
52
  }
@@ -49,8 +58,9 @@ let AccountTile = class AccountTile extends LitElement {
49
58
  margin: 0;
50
59
  }
51
60
 
52
- span {
61
+ h3 {
53
62
  font-size: 14px;
63
+ font-weight: bold;
54
64
  color: #2c2c2c;
55
65
  margin: 0px;
56
66
  }
@@ -62,22 +72,27 @@ let AccountTile = class AccountTile extends LitElement {
62
72
  box-shadow: 1px 1px 2px 0px;
63
73
  height: 100%;
64
74
  display: flex;
65
- flex-direction: column;
66
75
  text-align: center;
67
76
  width: 100%;
68
77
  }
69
78
 
70
79
  .inner-holder {
71
- flex-grow: 1;
80
+ padding: 5px;
81
+ width: 100%;
82
+ display: flex;
83
+ flex-direction: column;
84
+ }
85
+
86
+ #header-holder {
87
+ flex: 1;
72
88
  }
73
89
 
74
90
  #title-holder {
75
- flex-shrink: 0;
76
91
  height: 40px;
92
+ margin-bottom: 5px;
77
93
  }
78
94
 
79
95
  #avatar-holder {
80
- margin-top: 5px;
81
96
  margin-bottom: 5px;
82
97
  display: flex;
83
98
  align-items: center;
@@ -97,6 +112,22 @@ let AccountTile = class AccountTile extends LitElement {
97
112
  height: 40px;
98
113
  }
99
114
 
115
+ #year-holder {
116
+ margin: 0px;
117
+ }
118
+
119
+ #status-holder {
120
+ height: 25px;
121
+ display: flex;
122
+ justify-content: space-evenly;
123
+ line-height: initial;
124
+ }
125
+
126
+ #patron-icon {
127
+ height: 25px;
128
+ width: 25px;
129
+ }
130
+
100
131
  .truncated {
101
132
  flex: 1;
102
133
  min-width: 0; /* Important for long words! */
@@ -106,9 +137,15 @@ let AccountTile = class AccountTile extends LitElement {
106
137
  display: -webkit-box;
107
138
  -webkit-box-orient: vertical;
108
139
  word-wrap: break-word;
140
+ word-break: break-all;
109
141
  line-height: 2rem;
110
142
  text-align: center;
111
143
  }
144
+
145
+ .stat-icon {
146
+ height: 10px;
147
+ width: 10px;
148
+ }
112
149
  `;
113
150
  }
114
151
  };
@@ -1 +1 @@
1
- {"version":3,"file":"account-tile.js","sourceRoot":"","sources":["../../../../src/tiles/grid/account-tile.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,cAAc,CAAC;AAGtB,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,UAAU;IAGzC,MAAM;;QACJ,OAAO,IAAI,CAAA;;;;oCAIqB,MAAA,IAAI,CAAC,KAAK,0CAAE,UAAU;;;;;;;;;sDASJ,MAAA,IAAI,CAAC,KAAK,0CAAE,UAAU;;;;;;;kCAO1C,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS,0CAAE,WAAW,EAAE;;;;;;;uBAO/C,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS;uBACrB,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS;sBACtB,MAAA,IAAI,CAAC,KAAK,0CAAE,QAAQ;0BAChB,MAAA,IAAI,CAAC,KAAK,0CAAE,YAAY;;;;KAI7C,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmET,CAAC;IACJ,CAAC;CACF,CAAA;AA9G6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAmB;AADnC,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA+GvB;SA/GY,WAAW","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TileModel } from '../../models';\n\nimport './tile-stats';\n\n@customElement('account-tile')\nexport class AccountTile extends LitElement {\n @property({ type: Object }) model?: TileModel;\n\n render() {\n return html`\n <div class=\"outer-holder\">\n <div id=\"header-holder\">\n <div id=\"title-holder\">\n <h1 class=\"truncated\">${this.model?.identifier}</h1>\n </div>\n </div>\n\n <div class=\"inner-holder\">\n <div id=\"avatar-holder\">\n <img\n id=\"avatar\"\n alt=\"patron-avatar\"\n src=\"https://archive.org/services/img/${this.model?.identifier}\"\n />\n </div>\n\n <div id=\"year-holder\">\n <div id=\"archivist-since\">\n <span>\n Archivist since ${this.model?.dateAdded?.getFullYear()}\n </span>\n </div>\n </div>\n </div>\n\n <tile-stats\n .mediatype=${this.model?.mediatype}\n .itemCount=${this.model?.itemCount}\n .favCount=${this.model?.favCount}\n .commentCount=${this.model?.commentCount}\n >\n </tile-stats>\n </div>\n `;\n }\n\n static get styles() {\n return css`\n h1 {\n color: black;\n font-size: 16px;\n margin: 0;\n }\n\n span {\n font-size: 14px;\n color: #2c2c2c;\n margin: 0px;\n }\n\n .outer-holder {\n background-color: #fcf5e6;\n border: 1px #2c2c2c;\n border-radius: 4px;\n box-shadow: 1px 1px 2px 0px;\n height: 100%;\n display: flex;\n flex-direction: column;\n text-align: center;\n width: 100%;\n }\n\n .inner-holder {\n flex-grow: 1;\n }\n\n #title-holder {\n flex-shrink: 0;\n height: 40px;\n }\n\n #avatar-holder {\n margin-top: 5px;\n margin-bottom: 5px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n #avatar {\n background-position: 50% 50%;\n border-radius: 50%;\n width: 160px;\n height: 160px;\n box-shadow: 1px 1px 2px #888888;\n }\n\n #year-holder {\n margin-bottom: 5px;\n height: 40px;\n }\n\n .truncated {\n flex: 1;\n min-width: 0; /* Important for long words! */\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n word-wrap: break-word;\n line-height: 2rem;\n text-align: center;\n }\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"account-tile.js","sourceRoot":"","sources":["../../../../src/tiles/grid/account-tile.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,UAAU;IAGzC,MAAM;;QACJ,OAAO,IAAI,CAAA;;;;;sCAKuB,MAAA,IAAI,CAAC,KAAK,0CAAE,UAAU;;;;;iFAKqB,MAAA,IAAI;aAClE,KAAK,0CAAE,UAAU;;;;;;;;;oBAShB,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS,0CAAE,WAAW,EAAE;;;;oCAIpB,WAAW;;gBAE/B,UAAU;oBACN,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS;;;gBAGzB,kBAAkB;oBACd,MAAA,IAAI,CAAC,KAAK,0CAAE,QAAQ;;;gBAGxB,WAAW;oBACP,MAAA,IAAI,CAAC,KAAK,0CAAE,YAAY;;;;;KAKvC,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+FT,CAAC;IACJ,CAAC;CACF,CAAA;AAhJ6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAmB;AADnC,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAiJvB;SAjJY,WAAW","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TileModel } from '../../models';\n\nimport { accountIcon } from './icons/account';\nimport { favoriteFilledIcon } from './icons/favorite-filled';\nimport { reviewsIcon } from './icons/reviews';\nimport { uploadIcon } from './icons/upload';\n\n@customElement('account-tile')\nexport class AccountTile extends LitElement {\n @property({ type: Object }) model?: TileModel;\n\n render() {\n return html`\n <div class=\"outer-holder\">\n <div class=\"inner-holder\">\n <div id=\"header-holder\">\n <div id=\"title-holder\">\n <h1 class=\"truncated\">${this.model?.identifier}</h1>\n </div>\n <div id=\"avatar-holder\">\n <div\n id=\"avatar\"\n style=\"background-image: url('https://archive.org/services/img/${this\n .model?.identifier}')\"\n ></div>\n </div>\n </div>\n <div id=\"year-holder\">\n <div id=\"archivist-since\">\n <h3>Archivist Since</h3>\n </div>\n <div id=\"year-holder\">\n <h3>${this.model?.dateAdded?.getFullYear()}</h3>\n </div>\n </div>\n <div id=\"status-holder\">\n <div id=\"patron-icon\">${accountIcon}</div>\n <div class=\"stat-icon\">\n ${uploadIcon}\n <h3>${this.model?.itemCount}</h3>\n </div>\n <div class=\"stat-icon\">\n ${favoriteFilledIcon}\n <h3>${this.model?.favCount}</h3>\n </div>\n <div class=\"stat-icon\">\n ${reviewsIcon}\n <h3>${this.model?.commentCount}</h3>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n static get styles() {\n return css`\n h1 {\n color: black;\n font-size: 16px;\n margin: 0;\n }\n\n h3 {\n font-size: 14px;\n font-weight: bold;\n color: #2c2c2c;\n margin: 0px;\n }\n\n .outer-holder {\n background-color: #fcf5e6;\n border: 1px #2c2c2c;\n border-radius: 4px;\n box-shadow: 1px 1px 2px 0px;\n height: 100%;\n display: flex;\n text-align: center;\n width: 100%;\n }\n\n .inner-holder {\n padding: 5px;\n width: 100%;\n display: flex;\n flex-direction: column;\n }\n\n #header-holder {\n flex: 1;\n }\n\n #title-holder {\n height: 40px;\n margin-bottom: 5px;\n }\n\n #avatar-holder {\n margin-bottom: 5px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n #avatar {\n background-position: 50% 50%;\n border-radius: 50%;\n width: 160px;\n height: 160px;\n box-shadow: 1px 1px 2px #888888;\n }\n\n #year-holder {\n margin-bottom: 5px;\n height: 40px;\n }\n\n #year-holder {\n margin: 0px;\n }\n\n #status-holder {\n height: 25px;\n display: flex;\n justify-content: space-evenly;\n line-height: initial;\n }\n\n #patron-icon {\n height: 25px;\n width: 25px;\n }\n\n .truncated {\n flex: 1;\n min-width: 0; /* Important for long words! */\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n word-wrap: break-word;\n word-break: break-all;\n line-height: 2rem;\n text-align: center;\n }\n\n .stat-icon {\n height: 10px;\n width: 10px;\n }\n `;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare const accountIcon: import("lit-html").TemplateResult<2>;
@@ -0,0 +1,12 @@
1
+ import { svg } from 'lit';
2
+ export const accountIcon = svg `
3
+ <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
4
+ <path
5
+ d="m89.6854559 79.6500588c1.7300364 6.4823648 2.180423 13.3122689 3.3145441 20.3499412h-86c.5683151-15.8558542 2.98334063-30.7849367 15.1676149-41.6581341 22.9948067-20.518674 59.250299-9.0032844 67.517841 21.3081929zm-40.0998307-79.6500588c10.872402.0493248 19.9700408 9.25722341 19.917959 20.1421788-.0829413 11.042868-8.9616237 19.8492523-20.0602807 19.8578212-11.1181198 0-19.9397193-8.7904706-19.9397193-19.8908727-.0327543-11.11998815 9.0125781-20.17487063 20.082041-20.1091273z"
6
+ fill="#333"
7
+ fill-rule="evenodd"
8
+ />
9
+ <title>Icon of a person</title>
10
+ </svg>
11
+ `;
12
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../../src/tiles/grid/icons/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;CAS7B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const accountIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m89.6854559 79.6500588c1.7300364 6.4823648 2.180423 13.3122689 3.3145441 20.3499412h-86c.5683151-15.8558542 2.98334063-30.7849367 15.1676149-41.6581341 22.9948067-20.518674 59.250299-9.0032844 67.517841 21.3081929zm-40.0998307-79.6500588c10.872402.0493248 19.9700408 9.25722341 19.917959 20.1421788-.0829413 11.042868-8.9616237 19.8492523-20.0602807 19.8578212-11.1181198 0-19.9397193-8.7904706-19.9397193-19.8908727-.0327543-11.11998815 9.0125781-20.17487063 20.082041-20.1091273z\"\n fill=\"#333\"\n fill-rule=\"evenodd\"\n />\n <title>Icon of a person</title>\n </svg>\n`;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"favorite-filled.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/favorite-filled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;;;;;;;;CAQpC,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const favoriteFilledIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m81.0388846 100-30.9636029-22.5595033-30.7410319 22.5595033 10.6670595-37.3922042-30.0013093-25.2155916h37.5556428l12.5196389-37.3922042 12.3690754 37.3922042h37.5556429l-29.7034563 25.2155916z\"\n fill=\"#333\"\n />\n <title>Icon of a star, filled in</title>\n </svg>\n`;\n"]}
1
+ {"version":3,"file":"favorite-filled.js","sourceRoot":"","sources":["../../../../../src/tiles/grid/icons/favorite-filled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;;;;;;;;CAQpC,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const favoriteFilledIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m81.0388846 100-30.9636029-22.5595033-30.7410319 22.5595033 10.6670595-37.3922042-30.0013093-25.2155916h37.5556428l12.5196389-37.3922042 12.3690754 37.3922042h37.5556429l-29.7034563 25.2155916z\"\n fill=\"#333\"\n />\n <title>Icon of a star, filled in</title>\n </svg>\n`;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reviews.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/reviews.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;CAQ7B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const reviewsIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m100 7.78013601c0-2.14552613-.7593357-3.978597-2.278007-5.4992126-1.5186713-1.52061561-3.3493984-2.28092341-5.4921813-2.28092341h-84.54977287c-2.08268321 0-3.88336049.7603078-5.40203183 2.28092341-1.51867133 1.5206156-2.278007 3.35368647-2.278007 5.4992126v51.49262709c0 2.0853495.75933567 3.8883321 2.278007 5.4089477 1.51867134 1.5206156 3.31934862 2.2809234 5.40203183 2.2809234h10.53361537l.3571304 33.0373658 32.4087237-33.0373658h41.2468361c2.1427829 0 3.97351-.7603078 5.4921813-2.2809234s2.278007-3.3235982 2.278007-5.4089477z\"\n fill=\"#333\"\n />\n <title>Icon of a speech bubble</title>\n </svg>\n`;\n"]}
1
+ {"version":3,"file":"reviews.js","sourceRoot":"","sources":["../../../../../src/tiles/grid/icons/reviews.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;CAQ7B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const reviewsIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m100 7.78013601c0-2.14552613-.7593357-3.978597-2.278007-5.4992126-1.5186713-1.52061561-3.3493984-2.28092341-5.4921813-2.28092341h-84.54977287c-2.08268321 0-3.88336049.7603078-5.40203183 2.28092341-1.51867133 1.5206156-2.278007 3.35368647-2.278007 5.4992126v51.49262709c0 2.0853495.75933567 3.8883321 2.278007 5.4089477 1.51867134 1.5206156 3.31934862 2.2809234 5.40203183 2.2809234h10.53361537l.3571304 33.0373658 32.4087237-33.0373658h41.2468361c2.1427829 0 3.97351-.7603078 5.4921813-2.2809234s2.278007-3.3235982 2.278007-5.4089477z\"\n fill=\"#333\"\n />\n <title>Icon of a speech bubble</title>\n </svg>\n`;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;CAS5B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const uploadIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m50 20 33.3333333 43.3333333h-20v36.6666667h-26.6666666v-36.6666667h-20zm50-20v13.3333333h-100v-13.3333333z\"\n fill=\"#333\"\n fill-rule=\"evenodd\"\n />\n <title>Icon of an arrow pointing upwards</title>\n </svg>\n`;\n"]}
1
+ {"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../../../src/tiles/grid/icons/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;CAS5B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const uploadIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m50 20 33.3333333 43.3333333h-20v36.6666667h-26.6666666v-36.6666667h-20zm50-20v13.3333333h-100v-13.3333333z\"\n fill=\"#333\"\n fill-rule=\"evenodd\"\n />\n <title>Icon of an arrow pointing upwards</title>\n </svg>\n`;\n"]}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("lit-html").TemplateResult<2>;
2
+ export default _default;
@@ -1,5 +1,5 @@
1
1
  import { svg } from 'lit';
2
- export const viewsIcon = svg `
2
+ export default svg `
3
3
  <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
4
4
  <path
5
5
  d="m98 50.5704143c-.2830293-.471515-.671154-1.1088947-1.1643742-1.9121392s-1.6003642-2.3617474-3.3214321-4.6755089c-1.7210678-2.3137614-3.522258-4.5325939-5.4035703-6.6564975-1.8813124-2.1239037-4.2828993-4.473133-7.2047606-7.0476881-2.9218612-2.5745551-5.8895067-4.7933876-8.9029363-6.6564976-3.0134295-1.86311-6.4628491-3.4330878-10.3482587-4.7099336-3.8854095-1.2768458-7.7822651-1.9142256-11.6905667-1.9121443-3.9083017.0020914-7.8051573.6154781-11.6905668 1.8401652-3.8854096 1.2246871-7.3702078 2.8301329-10.4543947 4.8163375-3.0841869 1.9862045-6.0278997 4.1695691-8.8311384 6.5500937s-5.2048256 4.7652219-7.2047605 7.1540919c-1.99993501 2.38887-3.75430043 4.5722346-5.26309632 6.5500938s-2.63883199 3.583305-3.39010829 4.8163374l-1.13003609 1.8401602c.2830293.4715149.67115403 1.1088946 1.16437421 1.9121391.49322017.8032445 1.5878776 2.3617475 3.28397229 4.6755089s3.47439274 4.521119 5.3348942 6.6220728c1.8605014 2.1009538 4.2506422 4.4387083 7.1704224 7.0132633 2.9197801 2.5745551 5.8874256 4.7819127 8.9029363 6.6220729 3.0155106 1.8401601 6.4774168 3.398663 10.3857184 4.6755088 3.9083017 1.2768458 7.8176438 1.9142256 11.7280266 1.9121443 3.9103827-.0020914 7.7957922-.6154781 11.6562286-1.8401652s7.3337886-2.818658 10.4200566-4.7819127 6.0299808-4.1351444 8.8311384-6.515669 5.2152311-4.7652219 7.2422203-7.1540919 3.8052873-4.5607597 5.3348942-6.515669c1.5296068-1.9549093 2.6721295-3.5488802 3.427568-4.7819127zm-24.5142913 0c0 6.467683-2.3079374 12.0152859-6.9238123 16.6428087s-10.1495139 6.9412843-16.600917 6.9412843c-6.4992683 0-12.0453939-2.3137615-16.6383767-6.9412843s-6.8894742-10.1751257-6.8894742-16.6428087 2.2964914-12.003811 6.8894742-16.608384 10.1391084-6.9068595 16.6383767-6.9068595c6.4534842 0 11.9871232 2.3022865 16.600917 6.9068595s6.9217312 10.140701 6.9238123 16.608384zm-23.5247293-10.552755c2.8261308 0 5.2870289 1.0619518 7.3826944 3.1858555 2.0956655 2.1239036 3.1434982 4.5795368 3.1434982 7.3668995 0 2.8332624-1.0478327 5.2888956-3.1434982 7.3668995-2.0956655 2.078004-4.5565636 3.1170059-7.3826944 3.1170059-2.873996 0-5.3348941-1.0264838-7.3826944-3.0794516-2.0478002-2.0529677-3.0717003-4.5200758-3.0717003-7.4013243 0-2.8332624 1.0239001-5.3003705 3.0717003-7.4013243 2.0478003-2.1009538 4.5086984-3.1514307 7.3826944-3.1514307z"
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.js","sourceRoot":"","sources":["../../../../../src/tiles/grid/icons/views.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,eAAe,GAAG,CAAA;;;;;;;;CAQjB,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport default svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m98 50.5704143c-.2830293-.471515-.671154-1.1088947-1.1643742-1.9121392s-1.6003642-2.3617474-3.3214321-4.6755089c-1.7210678-2.3137614-3.522258-4.5325939-5.4035703-6.6564975-1.8813124-2.1239037-4.2828993-4.473133-7.2047606-7.0476881-2.9218612-2.5745551-5.8895067-4.7933876-8.9029363-6.6564976-3.0134295-1.86311-6.4628491-3.4330878-10.3482587-4.7099336-3.8854095-1.2768458-7.7822651-1.9142256-11.6905667-1.9121443-3.9083017.0020914-7.8051573.6154781-11.6905668 1.8401652-3.8854096 1.2246871-7.3702078 2.8301329-10.4543947 4.8163375-3.0841869 1.9862045-6.0278997 4.1695691-8.8311384 6.5500937s-5.2048256 4.7652219-7.2047605 7.1540919c-1.99993501 2.38887-3.75430043 4.5722346-5.26309632 6.5500938s-2.63883199 3.583305-3.39010829 4.8163374l-1.13003609 1.8401602c.2830293.4715149.67115403 1.1088946 1.16437421 1.9121391.49322017.8032445 1.5878776 2.3617475 3.28397229 4.6755089s3.47439274 4.521119 5.3348942 6.6220728c1.8605014 2.1009538 4.2506422 4.4387083 7.1704224 7.0132633 2.9197801 2.5745551 5.8874256 4.7819127 8.9029363 6.6220729 3.0155106 1.8401601 6.4774168 3.398663 10.3857184 4.6755088 3.9083017 1.2768458 7.8176438 1.9142256 11.7280266 1.9121443 3.9103827-.0020914 7.7957922-.6154781 11.6562286-1.8401652s7.3337886-2.818658 10.4200566-4.7819127 6.0299808-4.1351444 8.8311384-6.515669 5.2152311-4.7652219 7.2422203-7.1540919 3.8052873-4.5607597 5.3348942-6.515669c1.5296068-1.9549093 2.6721295-3.5488802 3.427568-4.7819127zm-24.5142913 0c0 6.467683-2.3079374 12.0152859-6.9238123 16.6428087s-10.1495139 6.9412843-16.600917 6.9412843c-6.4992683 0-12.0453939-2.3137615-16.6383767-6.9412843s-6.8894742-10.1751257-6.8894742-16.6428087 2.2964914-12.003811 6.8894742-16.608384 10.1391084-6.9068595 16.6383767-6.9068595c6.4534842 0 11.9871232 2.3022865 16.600917 6.9068595s6.9217312 10.140701 6.9238123 16.608384zm-23.5247293-10.552755c2.8261308 0 5.2870289 1.0619518 7.3826944 3.1858555 2.0956655 2.1239036 3.1434982 4.5795368 3.1434982 7.3668995 0 2.8332624-1.0478327 5.2888956-3.1434982 7.3668995-2.0956655 2.078004-4.5565636 3.1170059-7.3826944 3.1170059-2.873996 0-5.3348941-1.0264838-7.3826944-3.0794516-2.0478002-2.0529677-3.0717003-4.5200758-3.0717003-7.4013243 0-2.8332624 1.0239001-5.3003705 3.0717003-7.4013243 2.0478003-2.1009538 4.5086984-3.1514307 7.3826944-3.1514307z\"\n fill=\"#333\"\n />\n <title>Eye icon</title>\n </svg>\n`;\n"]}
@@ -2,7 +2,6 @@ import { CSSResultGroup, LitElement } from 'lit';
2
2
  import { TileModel } from '../../models';
3
3
  import '../mediatype-icon';
4
4
  import '../item-image';
5
- import './tile-stats';
6
5
  export declare class ItemTile extends LitElement {
7
6
  model?: TileModel;
8
7
  baseImageUrl?: string;
@@ -2,78 +2,91 @@ import { __decorate } from "tslib";
2
2
  /* eslint-disable import/no-duplicates */
3
3
  import { css, html, LitElement, nothing } from 'lit';
4
4
  import { customElement, property } from 'lit/decorators.js';
5
- import { ifDefined } from 'lit/directives/if-defined.js';
5
+ import { formatCount } from '../../utils/format-count';
6
+ import { favoriteFilledIcon } from './icons/favorite-filled';
7
+ import { reviewsIcon } from './icons/reviews';
8
+ import viewsIcon from './icons/views';
6
9
  import '../mediatype-icon';
7
10
  import '../item-image';
8
- import './tile-stats';
9
11
  let ItemTile = class ItemTile extends LitElement {
10
12
  render() {
11
- var _a, _b, _c, _d, _e, _f;
12
- const itemTitle = (_a = this.model) === null || _a === void 0 ? void 0 : _a.title;
13
+ var _a, _b, _c, _d, _e, _f, _g;
14
+ const itemTitle = ((_a = this.model) === null || _a === void 0 ? void 0 : _a.title) || nothing;
13
15
  const itemCreator = (_b = this.model) === null || _b === void 0 ? void 0 : _b.creator;
14
16
  return html `
15
17
  <div id="container">
16
- <div id="inner-wrapper">
17
- <div class="title-wrapper">
18
- <h1 id="item-title" title=${ifDefined(itemTitle)}>${itemTitle}</h1>
18
+ <div id="title-image-container">
19
+ <h1 id="item-title" title=${itemTitle}>${itemTitle}</h1>
20
+ <div id="item-image-container">
21
+ <item-image .model=${this.model} .baseImageUrl=${this.baseImageUrl}>
22
+ </item-image>
19
23
  </div>
20
-
21
- <div class="image-wrapper">
22
- <div id="item-image-container">
23
- <item-image
24
- .model=${this.model}
25
- .baseImageUrl=${this.baseImageUrl}>
26
- </item-image>
27
- </div>
28
- <div class="item-creator">
29
- <div class="truncated">
30
- ${itemCreator
24
+ <div class="item-creator">
25
+ <div class="truncated">
26
+ ${itemCreator
31
27
  ? html `<span>by&nbsp;${itemCreator}</span>`
32
28
  : nothing}
33
- </div>
34
29
  </div>
35
30
  </div>
36
31
  </div>
37
32
 
38
- <tile-stats
39
- .mediatype=${(_c = this.model) === null || _c === void 0 ? void 0 : _c.mediatype}
40
- .viewCount=${(_d = this.model) === null || _d === void 0 ? void 0 : _d.viewCount}
41
- .favCount=${(_e = this.model) === null || _e === void 0 ? void 0 : _e.favCount}
42
- .commentCount=${(_f = this.model) === null || _f === void 0 ? void 0 : _f.commentCount}>
43
- </tile-stats>
33
+ <div class="hr"></div>
34
+
35
+ <div id="item-stats-container">
36
+ <div id="stats-holder">
37
+ <div class="col">
38
+ <mediatype-icon
39
+ .mediatype=${(_c = this.model) === null || _c === void 0 ? void 0 : _c.mediatype}
40
+ .collection=${(_d = this.model) === null || _d === void 0 ? void 0 : _d.collections}
41
+ style="--iconHeight:25px; --iconWidth:25px;"
42
+ >
43
+ </mediatype-icon>
44
+ </div>
45
+ <div class="col">
46
+ ${viewsIcon}
47
+ <p class="status-text">
48
+ ${formatCount((_e = this.model) === null || _e === void 0 ? void 0 : _e.viewCount, 'short', 'short')}
49
+ </p>
50
+ </div>
51
+ <div class="col">
52
+ ${favoriteFilledIcon}
53
+ <p class="status-text">
54
+ ${formatCount((_f = this.model) === null || _f === void 0 ? void 0 : _f.itemCount, 'short', 'short')}
55
+ </p>
56
+ </div>
57
+ <div class="col">
58
+ ${reviewsIcon}
59
+ <p class="status-text">
60
+ ${formatCount((_g = this.model) === null || _g === void 0 ? void 0 : _g.favCount, 'short', 'short')}
61
+ </p>
62
+ </div>
63
+ </div>
44
64
  </div>
45
65
  </div>
46
66
  `;
47
67
  }
48
68
  static get styles() {
69
+ const cornerRadiusCss = css `var(--collectionTileCornerRadius, 4px)`;
49
70
  return css `
50
71
  #container {
51
72
  background-color: #ffffff;
52
- border-radius: var(--collectionTileCornerRadius, 4px);
73
+ border-radius: ${cornerRadiusCss};
53
74
  box-shadow: 1px 1px 2px 0px;
54
75
  display: flex;
55
76
  flex-direction: column;
56
77
  height: 100%;
78
+ position: relative;
57
79
  }
58
80
 
59
- #inner-wrapper {
60
- padding-top: 5px;
61
- padding-left: 5px;
62
- padding-right: 5px;
63
- }
64
-
65
- .title-wrapper {
66
- flex-shrink: 0;
67
- }
68
-
69
- .image-wrapper {
70
- flex-grow: 1;
81
+ #title-image-container {
82
+ display: flex;
83
+ flex: 1;
84
+ flex-direction: column;
85
+ padding: 0.5rem 0.5rem 0 0.5rem;
71
86
  }
72
87
 
73
88
  #item-title {
74
- flex: 1;
75
89
  color: #2c2c2c;
76
- min-width: 0; /* Important for long words! */
77
90
  font-size: 1.6rem;
78
91
  text-align: center;
79
92
  margin-top: 0rem;
@@ -81,7 +94,6 @@ let ItemTile = class ItemTile extends LitElement {
81
94
  overflow: hidden;
82
95
  text-overflow: ellipsis;
83
96
  display: -webkit-box;
84
- word-wrap: break-word;
85
97
  -webkit-line-clamp: 2;
86
98
  -webkit-box-orient: vertical;
87
99
  line-height: 2rem;
@@ -92,7 +104,6 @@ let ItemTile = class ItemTile extends LitElement {
92
104
  display: flex;
93
105
  justify-content: center;
94
106
  flex: 1;
95
- height: 16rem;
96
107
  }
97
108
 
98
109
  .hidden {
@@ -118,7 +129,6 @@ let ItemTile = class ItemTile extends LitElement {
118
129
  align-items: flex-end; /* Important to start text from bottom */
119
130
  height: 3rem;
120
131
  padding-top: 1rem;
121
- margin-top: 5px;
122
132
  }
123
133
 
124
134
  .truncated {
@@ -138,6 +148,44 @@ let ItemTile = class ItemTile extends LitElement {
138
148
  line-height: 2rem;
139
149
  text-align: center;
140
150
  }
151
+
152
+ .hr {
153
+ border: 0.5px solid #ccc;
154
+ }
155
+
156
+ #item-stats-container {
157
+ align-items: center;
158
+ display: flex;
159
+ height: 5.5rem;
160
+ padding-left: 1rem;
161
+ padding-right: 0.5rem;
162
+ }
163
+
164
+ #stats-holder {
165
+ align-items: center;
166
+ display: flex;
167
+ flex: 1;
168
+ justify-content: space-evenly;
169
+ text-align: center;
170
+ width: 100%;
171
+ }
172
+
173
+ svg {
174
+ height: 10px;
175
+ width: 10px;
176
+ }
177
+
178
+ .status-text {
179
+ font-size: 14px;
180
+ color: #2c2c2c;
181
+ margin: auto;
182
+ display: block;
183
+ text-align: center;
184
+ }
185
+
186
+ .col {
187
+ width: 25%;
188
+ }
141
189
  `;
142
190
  }
143
191
  };
@@ -1 +1 @@
1
- {"version":3,"file":"item-tile.js","sourceRoot":"","sources":["../../../../src/tiles/grid/item-tile.ts"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAIzD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AAGtB,IAAa,QAAQ,GAArB,MAAa,QAAS,SAAQ,UAAU;IAKtC,MAAM;;QACJ,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,KAAK,CAAC;QACpC,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,OAAO,CAAC;QACxC,OAAO,IAAI,CAAA;;;;wCAIyB,SAAS,CAAC,SAAS,CAAC,IAAI,SAAS;;;;;;yBAMhD,IAAI,CAAC,KAAK;gCACH,IAAI,CAAC,YAAY;;;;;kBAM/B,WAAW;YACT,CAAC,CAAC,IAAI,CAAA,iBAAiB,WAAW,SAAS;YAC3C,CAAC,CAAC,OACN;;;;;;;uBAOO,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS;uBACrB,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS;sBACtB,MAAA,IAAI,CAAC,KAAK,0CAAE,QAAQ;0BAChB,MAAA,IAAI,CAAC,KAAK,0CAAE,YAAY;;;;KAI7C,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4FT,CAAC;IACJ,CAAC;CACF,CAAA;AA3I6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAuB;AAHvC,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA4IpB;SA5IY,QAAQ","sourcesContent":["/* eslint-disable import/no-duplicates */\nimport { css, CSSResultGroup, html, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { TileModel } from '../../models';\n\nimport '../mediatype-icon';\nimport '../item-image';\nimport './tile-stats';\n\n@customElement('item-tile')\nexport class ItemTile extends LitElement {\n @property({ type: Object }) model?: TileModel;\n\n @property({ type: String }) baseImageUrl?: string;\n\n render() {\n const itemTitle = this.model?.title;\n const itemCreator = this.model?.creator;\n return html`\n <div id=\"container\">\n <div id=\"inner-wrapper\">\n <div class=\"title-wrapper\">\n <h1 id=\"item-title\" title=${ifDefined(itemTitle)}>${itemTitle}</h1>\n </div>\n\n <div class=\"image-wrapper\">\n <div id=\"item-image-container\">\n <item-image\n .model=${this.model}\n .baseImageUrl=${this.baseImageUrl}>\n </item-image>\n </div>\n <div class=\"item-creator\">\n <div class=\"truncated\">\n ${\n itemCreator\n ? html`<span>by&nbsp;${itemCreator}</span>`\n : nothing\n }\n </div>\n </div>\n </div>\n </div>\n\n <tile-stats \n .mediatype=${this.model?.mediatype}\n .viewCount=${this.model?.viewCount}\n .favCount=${this.model?.favCount}\n .commentCount=${this.model?.commentCount}>\n </tile-stats>\n </div>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n #container {\n background-color: #ffffff;\n border-radius: var(--collectionTileCornerRadius, 4px);\n box-shadow: 1px 1px 2px 0px;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n #inner-wrapper {\n padding-top: 5px;\n padding-left: 5px;\n padding-right: 5px;\n }\n\n .title-wrapper {\n flex-shrink: 0;\n }\n\n .image-wrapper {\n flex-grow: 1;\n }\n\n #item-title {\n flex: 1;\n color: #2c2c2c;\n min-width: 0; /* Important for long words! */\n font-size: 1.6rem;\n text-align: center;\n margin-top: 0rem;\n margin-bottom: 0.5rem;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n word-wrap: break-word;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n line-height: 2rem;\n height: 4rem;\n }\n\n #item-image-container {\n display: flex;\n justify-content: center;\n flex: 1;\n height: 16rem;\n }\n\n .hidden {\n display: none;\n }\n\n #container:hover > #title-image-container > .item-title {\n text-decoration: underline;\n }\n\n /** this is a workaround for Safari 15 where the hover effects are not working */\n #title-image-container:hover > #item-title {\n text-decoration: underline;\n }\n\n #container:hover > #item-title {\n background-color: #fcfcfc;\n }\n\n .item-creator {\n display: flex;\n justify-content: center;\n align-items: flex-end; /* Important to start text from bottom */\n height: 3rem;\n padding-top: 1rem;\n margin-top: 5px;\n }\n\n .truncated {\n flex: 1;\n min-width: 0; /* Important for long words! */\n }\n\n .truncated span {\n font-size: 1.4rem;\n color: #2c2c2c;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n word-wrap: break-word;\n line-height: 2rem;\n text-align: center;\n }\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"item-tile.js","sourceRoot":"","sources":["../../../../src/tiles/grid/item-tile.ts"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,SAAS,MAAM,eAAe,CAAC;AAEtC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AAGvB,IAAa,QAAQ,GAArB,MAAa,QAAS,SAAQ,UAAU;IAKtC,MAAM;;QACJ,MAAM,SAAS,GAAG,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,KAAK,KAAI,OAAO,CAAC;QAC/C,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,OAAO,CAAC;QACxC,OAAO,IAAI,CAAA;;;sCAGuB,SAAS,IAAI,SAAS;;iCAE3B,IAAI,CAAC,KAAK,kBAAkB,IAAI,CAAC,YAAY;;;;;gBAK9D,WAAW;YACX,CAAC,CAAC,IAAI,CAAA,iBAAiB,WAAW,SAAS;YAC3C,CAAC,CAAC,OAAO;;;;;;;;;;;6BAWI,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS;8BACpB,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW;;;;;;gBAMrC,SAAS;;kBAEP,WAAW,CAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC;;;;gBAItD,kBAAkB;;kBAEhB,WAAW,CAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC;;;;gBAItD,WAAW;;kBAET,WAAW,CAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;;;;;;KAMhE,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,MAAM,eAAe,GAAG,GAAG,CAAA,wCAAwC,CAAC;QAEpE,OAAO,GAAG,CAAA;;;yBAGW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoHnC,CAAC;IACJ,CAAC;CACF,CAAA;AAxL6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAuB;AAHvC,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAyLpB;SAzLY,QAAQ","sourcesContent":["/* eslint-disable import/no-duplicates */\nimport { css, CSSResultGroup, html, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { TileModel } from '../../models';\nimport { formatCount } from '../../utils/format-count';\n\nimport { favoriteFilledIcon } from './icons/favorite-filled';\nimport { reviewsIcon } from './icons/reviews';\nimport viewsIcon from './icons/views';\n\nimport '../mediatype-icon';\nimport '../item-image';\n\n@customElement('item-tile')\nexport class ItemTile extends LitElement {\n @property({ type: Object }) model?: TileModel;\n\n @property({ type: String }) baseImageUrl?: string;\n\n render() {\n const itemTitle = this.model?.title || nothing;\n const itemCreator = this.model?.creator;\n return html`\n <div id=\"container\">\n <div id=\"title-image-container\">\n <h1 id=\"item-title\" title=${itemTitle}>${itemTitle}</h1>\n <div id=\"item-image-container\">\n <item-image .model=${this.model} .baseImageUrl=${this.baseImageUrl}>\n </item-image>\n </div>\n <div class=\"item-creator\">\n <div class=\"truncated\">\n ${itemCreator\n ? html`<span>by&nbsp;${itemCreator}</span>`\n : nothing}\n </div>\n </div>\n </div>\n\n <div class=\"hr\"></div>\n\n <div id=\"item-stats-container\">\n <div id=\"stats-holder\">\n <div class=\"col\">\n <mediatype-icon\n .mediatype=${this.model?.mediatype}\n .collection=${this.model?.collections}\n style=\"--iconHeight:25px; --iconWidth:25px;\"\n >\n </mediatype-icon>\n </div>\n <div class=\"col\">\n ${viewsIcon}\n <p class=\"status-text\">\n ${formatCount(this.model?.viewCount, 'short', 'short')}\n </p>\n </div>\n <div class=\"col\">\n ${favoriteFilledIcon}\n <p class=\"status-text\">\n ${formatCount(this.model?.itemCount, 'short', 'short')}\n </p>\n </div>\n <div class=\"col\">\n ${reviewsIcon}\n <p class=\"status-text\">\n ${formatCount(this.model?.favCount, 'short', 'short')}\n </p>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n const cornerRadiusCss = css`var(--collectionTileCornerRadius, 4px)`;\n\n return css`\n #container {\n background-color: #ffffff;\n border-radius: ${cornerRadiusCss};\n box-shadow: 1px 1px 2px 0px;\n display: flex;\n flex-direction: column;\n height: 100%;\n position: relative;\n }\n\n #title-image-container {\n display: flex;\n flex: 1;\n flex-direction: column;\n padding: 0.5rem 0.5rem 0 0.5rem;\n }\n\n #item-title {\n color: #2c2c2c;\n font-size: 1.6rem;\n text-align: center;\n margin-top: 0rem;\n margin-bottom: 0.5rem;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n line-height: 2rem;\n height: 4rem;\n }\n\n #item-image-container {\n display: flex;\n justify-content: center;\n flex: 1;\n }\n\n .hidden {\n display: none;\n }\n\n #container:hover > #title-image-container > .item-title {\n text-decoration: underline;\n }\n\n /** this is a workaround for Safari 15 where the hover effects are not working */\n #title-image-container:hover > #item-title {\n text-decoration: underline;\n }\n\n #container:hover > #item-title {\n background-color: #fcfcfc;\n }\n\n .item-creator {\n display: flex;\n justify-content: center;\n align-items: flex-end; /* Important to start text from bottom */\n height: 3rem;\n padding-top: 1rem;\n }\n\n .truncated {\n flex: 1;\n min-width: 0; /* Important for long words! */\n }\n\n .truncated span {\n font-size: 1.4rem;\n color: #2c2c2c;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n word-wrap: break-word;\n line-height: 2rem;\n text-align: center;\n }\n\n .hr {\n border: 0.5px solid #ccc;\n }\n\n #item-stats-container {\n align-items: center;\n display: flex;\n height: 5.5rem;\n padding-left: 1rem;\n padding-right: 0.5rem;\n }\n\n #stats-holder {\n align-items: center;\n display: flex;\n flex: 1;\n justify-content: space-evenly;\n text-align: center;\n width: 100%;\n }\n\n svg {\n height: 10px;\n width: 10px;\n }\n\n .status-text {\n font-size: 14px;\n color: #2c2c2c;\n margin: auto;\n display: block;\n text-align: center;\n }\n\n .col {\n width: 25%;\n }\n `;\n }\n}\n"]}
@@ -39,10 +39,6 @@ let MediatypeIcon = class MediatypeIcon extends LitElement {
39
39
  }
40
40
  static get styles() {
41
41
  return css `
42
- #icon {
43
- height: var(--iconHeight, 25px);
44
- }
45
-
46
42
  .status-text {
47
43
  font-size: 14px;
48
44
  color: #2c2c2c;
@@ -1 +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;IAmEhD,CAAC;IAjEC,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;;;;;;;;;;;;;;;;;;;;;;;;;KAyBT,CAAC;IACJ,CAAC;CACF,CAAA;AAvE6B;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,CAwEzB;SAxEY,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 #icon {\n height: var(--iconHeight, 25px);\n }\n\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(--iconFillColor, '#000000');\n }\n `;\n }\n}\n"]}
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(--iconFillColor, '#000000');\n }\n `;\n }\n}\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "The Internet Archive Collection Browser.",
4
4
  "license": "AGPL-3.0-only",
5
5
  "author": "Internet Archive",
6
- "version": "0.2.4-alpha.3",
6
+ "version": "0.2.4-rc1",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
9
9
  "scripts": {
@@ -2,7 +2,10 @@ import { css, html, LitElement } from 'lit';
2
2
  import { customElement, property } from 'lit/decorators.js';
3
3
  import { TileModel } from '../../models';
4
4
 
5
- import './tile-stats';
5
+ import { accountIcon } from './icons/account';
6
+ import { favoriteFilledIcon } from './icons/favorite-filled';
7
+ import { reviewsIcon } from './icons/reviews';
8
+ import { uploadIcon } from './icons/upload';
6
9
 
7
10
  @customElement('account-tile')
8
11
  export class AccountTile extends LitElement {
@@ -11,37 +14,43 @@ export class AccountTile extends LitElement {
11
14
  render() {
12
15
  return html`
13
16
  <div class="outer-holder">
14
- <div id="header-holder">
15
- <div id="title-holder">
16
- <h1 class="truncated">${this.model?.identifier}</h1>
17
- </div>
18
- </div>
19
-
20
17
  <div class="inner-holder">
21
- <div id="avatar-holder">
22
- <img
23
- id="avatar"
24
- alt="patron-avatar"
25
- src="https://archive.org/services/img/${this.model?.identifier}"
26
- />
18
+ <div id="header-holder">
19
+ <div id="title-holder">
20
+ <h1 class="truncated">${this.model?.identifier}</h1>
21
+ </div>
22
+ <div id="avatar-holder">
23
+ <div
24
+ id="avatar"
25
+ style="background-image: url('https://archive.org/services/img/${this
26
+ .model?.identifier}')"
27
+ ></div>
28
+ </div>
27
29
  </div>
28
-
29
30
  <div id="year-holder">
30
31
  <div id="archivist-since">
31
- <span>
32
- Archivist since ${this.model?.dateAdded?.getFullYear()}
33
- </span>
32
+ <h3>Archivist Since</h3>
33
+ </div>
34
+ <div id="year-holder">
35
+ <h3>${this.model?.dateAdded?.getFullYear()}</h3>
36
+ </div>
37
+ </div>
38
+ <div id="status-holder">
39
+ <div id="patron-icon">${accountIcon}</div>
40
+ <div class="stat-icon">
41
+ ${uploadIcon}
42
+ <h3>${this.model?.itemCount}</h3>
43
+ </div>
44
+ <div class="stat-icon">
45
+ ${favoriteFilledIcon}
46
+ <h3>${this.model?.favCount}</h3>
47
+ </div>
48
+ <div class="stat-icon">
49
+ ${reviewsIcon}
50
+ <h3>${this.model?.commentCount}</h3>
34
51
  </div>
35
52
  </div>
36
53
  </div>
37
-
38
- <tile-stats
39
- .mediatype=${this.model?.mediatype}
40
- .itemCount=${this.model?.itemCount}
41
- .favCount=${this.model?.favCount}
42
- .commentCount=${this.model?.commentCount}
43
- >
44
- </tile-stats>
45
54
  </div>
46
55
  `;
47
56
  }
@@ -54,8 +63,9 @@ export class AccountTile extends LitElement {
54
63
  margin: 0;
55
64
  }
56
65
 
57
- span {
66
+ h3 {
58
67
  font-size: 14px;
68
+ font-weight: bold;
59
69
  color: #2c2c2c;
60
70
  margin: 0px;
61
71
  }
@@ -67,22 +77,27 @@ export class AccountTile extends LitElement {
67
77
  box-shadow: 1px 1px 2px 0px;
68
78
  height: 100%;
69
79
  display: flex;
70
- flex-direction: column;
71
80
  text-align: center;
72
81
  width: 100%;
73
82
  }
74
83
 
75
84
  .inner-holder {
76
- flex-grow: 1;
85
+ padding: 5px;
86
+ width: 100%;
87
+ display: flex;
88
+ flex-direction: column;
89
+ }
90
+
91
+ #header-holder {
92
+ flex: 1;
77
93
  }
78
94
 
79
95
  #title-holder {
80
- flex-shrink: 0;
81
96
  height: 40px;
97
+ margin-bottom: 5px;
82
98
  }
83
99
 
84
100
  #avatar-holder {
85
- margin-top: 5px;
86
101
  margin-bottom: 5px;
87
102
  display: flex;
88
103
  align-items: center;
@@ -102,6 +117,22 @@ export class AccountTile extends LitElement {
102
117
  height: 40px;
103
118
  }
104
119
 
120
+ #year-holder {
121
+ margin: 0px;
122
+ }
123
+
124
+ #status-holder {
125
+ height: 25px;
126
+ display: flex;
127
+ justify-content: space-evenly;
128
+ line-height: initial;
129
+ }
130
+
131
+ #patron-icon {
132
+ height: 25px;
133
+ width: 25px;
134
+ }
135
+
105
136
  .truncated {
106
137
  flex: 1;
107
138
  min-width: 0; /* Important for long words! */
@@ -111,9 +142,15 @@ export class AccountTile extends LitElement {
111
142
  display: -webkit-box;
112
143
  -webkit-box-orient: vertical;
113
144
  word-wrap: break-word;
145
+ word-break: break-all;
114
146
  line-height: 2rem;
115
147
  text-align: center;
116
148
  }
149
+
150
+ .stat-icon {
151
+ height: 10px;
152
+ width: 10px;
153
+ }
117
154
  `;
118
155
  }
119
156
  }
@@ -0,0 +1,12 @@
1
+ import { svg } from 'lit';
2
+
3
+ export const accountIcon = svg`
4
+ <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
5
+ <path
6
+ d="m89.6854559 79.6500588c1.7300364 6.4823648 2.180423 13.3122689 3.3145441 20.3499412h-86c.5683151-15.8558542 2.98334063-30.7849367 15.1676149-41.6581341 22.9948067-20.518674 59.250299-9.0032844 67.517841 21.3081929zm-40.0998307-79.6500588c10.872402.0493248 19.9700408 9.25722341 19.917959 20.1421788-.0829413 11.042868-8.9616237 19.8492523-20.0602807 19.8578212-11.1181198 0-19.9397193-8.7904706-19.9397193-19.8908727-.0327543-11.11998815 9.0125781-20.17487063 20.082041-20.1091273z"
7
+ fill="#333"
8
+ fill-rule="evenodd"
9
+ />
10
+ <title>Icon of a person</title>
11
+ </svg>
12
+ `;
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  import { svg } from 'lit';
2
2
 
3
- export const viewsIcon = svg`
3
+ export default svg`
4
4
  <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
5
5
  <path
6
6
  d="m98 50.5704143c-.2830293-.471515-.671154-1.1088947-1.1643742-1.9121392s-1.6003642-2.3617474-3.3214321-4.6755089c-1.7210678-2.3137614-3.522258-4.5325939-5.4035703-6.6564975-1.8813124-2.1239037-4.2828993-4.473133-7.2047606-7.0476881-2.9218612-2.5745551-5.8895067-4.7933876-8.9029363-6.6564976-3.0134295-1.86311-6.4628491-3.4330878-10.3482587-4.7099336-3.8854095-1.2768458-7.7822651-1.9142256-11.6905667-1.9121443-3.9083017.0020914-7.8051573.6154781-11.6905668 1.8401652-3.8854096 1.2246871-7.3702078 2.8301329-10.4543947 4.8163375-3.0841869 1.9862045-6.0278997 4.1695691-8.8311384 6.5500937s-5.2048256 4.7652219-7.2047605 7.1540919c-1.99993501 2.38887-3.75430043 4.5722346-5.26309632 6.5500938s-2.63883199 3.583305-3.39010829 4.8163374l-1.13003609 1.8401602c.2830293.4715149.67115403 1.1088946 1.16437421 1.9121391.49322017.8032445 1.5878776 2.3617475 3.28397229 4.6755089s3.47439274 4.521119 5.3348942 6.6220728c1.8605014 2.1009538 4.2506422 4.4387083 7.1704224 7.0132633 2.9197801 2.5745551 5.8874256 4.7819127 8.9029363 6.6220729 3.0155106 1.8401601 6.4774168 3.398663 10.3857184 4.6755088 3.9083017 1.2768458 7.8176438 1.9142256 11.7280266 1.9121443 3.9103827-.0020914 7.7957922-.6154781 11.6562286-1.8401652s7.3337886-2.818658 10.4200566-4.7819127 6.0299808-4.1351444 8.8311384-6.515669 5.2152311-4.7652219 7.2422203-7.1540919 3.8052873-4.5607597 5.3348942-6.515669c1.5296068-1.9549093 2.6721295-3.5488802 3.427568-4.7819127zm-24.5142913 0c0 6.467683-2.3079374 12.0152859-6.9238123 16.6428087s-10.1495139 6.9412843-16.600917 6.9412843c-6.4992683 0-12.0453939-2.3137615-16.6383767-6.9412843s-6.8894742-10.1751257-6.8894742-16.6428087 2.2964914-12.003811 6.8894742-16.608384 10.1391084-6.9068595 16.6383767-6.9068595c6.4534842 0 11.9871232 2.3022865 16.600917 6.9068595s6.9217312 10.140701 6.9238123 16.608384zm-23.5247293-10.552755c2.8261308 0 5.2870289 1.0619518 7.3826944 3.1858555 2.0956655 2.1239036 3.1434982 4.5795368 3.1434982 7.3668995 0 2.8332624-1.0478327 5.2888956-3.1434982 7.3668995-2.0956655 2.078004-4.5565636 3.1170059-7.3826944 3.1170059-2.873996 0-5.3348941-1.0264838-7.3826944-3.0794516-2.0478002-2.0529677-3.0717003-4.5200758-3.0717003-7.4013243 0-2.8332624 1.0239001-5.3003705 3.0717003-7.4013243 2.0478003-2.1009538 4.5086984-3.1514307 7.3826944-3.1514307z"
@@ -1,13 +1,16 @@
1
1
  /* eslint-disable import/no-duplicates */
2
2
  import { css, CSSResultGroup, html, LitElement, nothing } from 'lit';
3
3
  import { customElement, property } from 'lit/decorators.js';
4
- import { ifDefined } from 'lit/directives/if-defined.js';
5
4
 
6
5
  import { TileModel } from '../../models';
6
+ import { formatCount } from '../../utils/format-count';
7
+
8
+ import { favoriteFilledIcon } from './icons/favorite-filled';
9
+ import { reviewsIcon } from './icons/reviews';
10
+ import viewsIcon from './icons/views';
7
11
 
8
12
  import '../mediatype-icon';
9
13
  import '../item-image';
10
- import './tile-stats';
11
14
 
12
15
  @customElement('item-tile')
13
16
  export class ItemTile extends LitElement {
@@ -16,74 +19,84 @@ export class ItemTile extends LitElement {
16
19
  @property({ type: String }) baseImageUrl?: string;
17
20
 
18
21
  render() {
19
- const itemTitle = this.model?.title;
22
+ const itemTitle = this.model?.title || nothing;
20
23
  const itemCreator = this.model?.creator;
21
24
  return html`
22
25
  <div id="container">
23
- <div id="inner-wrapper">
24
- <div class="title-wrapper">
25
- <h1 id="item-title" title=${ifDefined(itemTitle)}>${itemTitle}</h1>
26
+ <div id="title-image-container">
27
+ <h1 id="item-title" title=${itemTitle}>${itemTitle}</h1>
28
+ <div id="item-image-container">
29
+ <item-image .model=${this.model} .baseImageUrl=${this.baseImageUrl}>
30
+ </item-image>
26
31
  </div>
27
-
28
- <div class="image-wrapper">
29
- <div id="item-image-container">
30
- <item-image
31
- .model=${this.model}
32
- .baseImageUrl=${this.baseImageUrl}>
33
- </item-image>
34
- </div>
35
- <div class="item-creator">
36
- <div class="truncated">
37
- ${
38
- itemCreator
39
- ? html`<span>by&nbsp;${itemCreator}</span>`
40
- : nothing
41
- }
42
- </div>
32
+ <div class="item-creator">
33
+ <div class="truncated">
34
+ ${itemCreator
35
+ ? html`<span>by&nbsp;${itemCreator}</span>`
36
+ : nothing}
43
37
  </div>
44
38
  </div>
45
39
  </div>
46
40
 
47
- <tile-stats
48
- .mediatype=${this.model?.mediatype}
49
- .viewCount=${this.model?.viewCount}
50
- .favCount=${this.model?.favCount}
51
- .commentCount=${this.model?.commentCount}>
52
- </tile-stats>
41
+ <div class="hr"></div>
42
+
43
+ <div id="item-stats-container">
44
+ <div id="stats-holder">
45
+ <div class="col">
46
+ <mediatype-icon
47
+ .mediatype=${this.model?.mediatype}
48
+ .collection=${this.model?.collections}
49
+ style="--iconHeight:25px; --iconWidth:25px;"
50
+ >
51
+ </mediatype-icon>
52
+ </div>
53
+ <div class="col">
54
+ ${viewsIcon}
55
+ <p class="status-text">
56
+ ${formatCount(this.model?.viewCount, 'short', 'short')}
57
+ </p>
58
+ </div>
59
+ <div class="col">
60
+ ${favoriteFilledIcon}
61
+ <p class="status-text">
62
+ ${formatCount(this.model?.itemCount, 'short', 'short')}
63
+ </p>
64
+ </div>
65
+ <div class="col">
66
+ ${reviewsIcon}
67
+ <p class="status-text">
68
+ ${formatCount(this.model?.favCount, 'short', 'short')}
69
+ </p>
70
+ </div>
71
+ </div>
53
72
  </div>
54
73
  </div>
55
74
  `;
56
75
  }
57
76
 
58
77
  static get styles(): CSSResultGroup {
78
+ const cornerRadiusCss = css`var(--collectionTileCornerRadius, 4px)`;
79
+
59
80
  return css`
60
81
  #container {
61
82
  background-color: #ffffff;
62
- border-radius: var(--collectionTileCornerRadius, 4px);
83
+ border-radius: ${cornerRadiusCss};
63
84
  box-shadow: 1px 1px 2px 0px;
64
85
  display: flex;
65
86
  flex-direction: column;
66
87
  height: 100%;
88
+ position: relative;
67
89
  }
68
90
 
69
- #inner-wrapper {
70
- padding-top: 5px;
71
- padding-left: 5px;
72
- padding-right: 5px;
73
- }
74
-
75
- .title-wrapper {
76
- flex-shrink: 0;
77
- }
78
-
79
- .image-wrapper {
80
- flex-grow: 1;
91
+ #title-image-container {
92
+ display: flex;
93
+ flex: 1;
94
+ flex-direction: column;
95
+ padding: 0.5rem 0.5rem 0 0.5rem;
81
96
  }
82
97
 
83
98
  #item-title {
84
- flex: 1;
85
99
  color: #2c2c2c;
86
- min-width: 0; /* Important for long words! */
87
100
  font-size: 1.6rem;
88
101
  text-align: center;
89
102
  margin-top: 0rem;
@@ -91,7 +104,6 @@ export class ItemTile extends LitElement {
91
104
  overflow: hidden;
92
105
  text-overflow: ellipsis;
93
106
  display: -webkit-box;
94
- word-wrap: break-word;
95
107
  -webkit-line-clamp: 2;
96
108
  -webkit-box-orient: vertical;
97
109
  line-height: 2rem;
@@ -102,7 +114,6 @@ export class ItemTile extends LitElement {
102
114
  display: flex;
103
115
  justify-content: center;
104
116
  flex: 1;
105
- height: 16rem;
106
117
  }
107
118
 
108
119
  .hidden {
@@ -128,7 +139,6 @@ export class ItemTile extends LitElement {
128
139
  align-items: flex-end; /* Important to start text from bottom */
129
140
  height: 3rem;
130
141
  padding-top: 1rem;
131
- margin-top: 5px;
132
142
  }
133
143
 
134
144
  .truncated {
@@ -148,6 +158,44 @@ export class ItemTile extends LitElement {
148
158
  line-height: 2rem;
149
159
  text-align: center;
150
160
  }
161
+
162
+ .hr {
163
+ border: 0.5px solid #ccc;
164
+ }
165
+
166
+ #item-stats-container {
167
+ align-items: center;
168
+ display: flex;
169
+ height: 5.5rem;
170
+ padding-left: 1rem;
171
+ padding-right: 0.5rem;
172
+ }
173
+
174
+ #stats-holder {
175
+ align-items: center;
176
+ display: flex;
177
+ flex: 1;
178
+ justify-content: space-evenly;
179
+ text-align: center;
180
+ width: 100%;
181
+ }
182
+
183
+ svg {
184
+ height: 10px;
185
+ width: 10px;
186
+ }
187
+
188
+ .status-text {
189
+ font-size: 14px;
190
+ color: #2c2c2c;
191
+ margin: auto;
192
+ display: block;
193
+ text-align: center;
194
+ }
195
+
196
+ .col {
197
+ width: 25%;
198
+ }
151
199
  `;
152
200
  }
153
201
  }
@@ -50,10 +50,6 @@ export class MediatypeIcon extends LitElement {
50
50
 
51
51
  static get styles(): CSSResultGroup {
52
52
  return css`
53
- #icon {
54
- height: var(--iconHeight, 25px);
55
- }
56
-
57
53
  .status-text {
58
54
  font-size: 14px;
59
55
  color: #2c2c2c;
@@ -1 +0,0 @@
1
- export declare const viewsIcon: import("lit-html").TemplateResult<2>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"views.js","sourceRoot":"","sources":["../../../../../src/assets/img/icons/views.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;;;CAQ3B,CAAC","sourcesContent":["import { svg } from 'lit';\n\nexport const viewsIcon = svg`\n <svg viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"m98 50.5704143c-.2830293-.471515-.671154-1.1088947-1.1643742-1.9121392s-1.6003642-2.3617474-3.3214321-4.6755089c-1.7210678-2.3137614-3.522258-4.5325939-5.4035703-6.6564975-1.8813124-2.1239037-4.2828993-4.473133-7.2047606-7.0476881-2.9218612-2.5745551-5.8895067-4.7933876-8.9029363-6.6564976-3.0134295-1.86311-6.4628491-3.4330878-10.3482587-4.7099336-3.8854095-1.2768458-7.7822651-1.9142256-11.6905667-1.9121443-3.9083017.0020914-7.8051573.6154781-11.6905668 1.8401652-3.8854096 1.2246871-7.3702078 2.8301329-10.4543947 4.8163375-3.0841869 1.9862045-6.0278997 4.1695691-8.8311384 6.5500937s-5.2048256 4.7652219-7.2047605 7.1540919c-1.99993501 2.38887-3.75430043 4.5722346-5.26309632 6.5500938s-2.63883199 3.583305-3.39010829 4.8163374l-1.13003609 1.8401602c.2830293.4715149.67115403 1.1088946 1.16437421 1.9121391.49322017.8032445 1.5878776 2.3617475 3.28397229 4.6755089s3.47439274 4.521119 5.3348942 6.6220728c1.8605014 2.1009538 4.2506422 4.4387083 7.1704224 7.0132633 2.9197801 2.5745551 5.8874256 4.7819127 8.9029363 6.6220729 3.0155106 1.8401601 6.4774168 3.398663 10.3857184 4.6755088 3.9083017 1.2768458 7.8176438 1.9142256 11.7280266 1.9121443 3.9103827-.0020914 7.7957922-.6154781 11.6562286-1.8401652s7.3337886-2.818658 10.4200566-4.7819127 6.0299808-4.1351444 8.8311384-6.515669 5.2152311-4.7652219 7.2422203-7.1540919 3.8052873-4.5607597 5.3348942-6.515669c1.5296068-1.9549093 2.6721295-3.5488802 3.427568-4.7819127zm-24.5142913 0c0 6.467683-2.3079374 12.0152859-6.9238123 16.6428087s-10.1495139 6.9412843-16.600917 6.9412843c-6.4992683 0-12.0453939-2.3137615-16.6383767-6.9412843s-6.8894742-10.1751257-6.8894742-16.6428087 2.2964914-12.003811 6.8894742-16.608384 10.1391084-6.9068595 16.6383767-6.9068595c6.4534842 0 11.9871232 2.3022865 16.600917 6.9068595s6.9217312 10.140701 6.9238123 16.608384zm-23.5247293-10.552755c2.8261308 0 5.2870289 1.0619518 7.3826944 3.1858555 2.0956655 2.1239036 3.1434982 4.5795368 3.1434982 7.3668995 0 2.8332624-1.0478327 5.2888956-3.1434982 7.3668995-2.0956655 2.078004-4.5565636 3.1170059-7.3826944 3.1170059-2.873996 0-5.3348941-1.0264838-7.3826944-3.0794516-2.0478002-2.0529677-3.0717003-4.5200758-3.0717003-7.4013243 0-2.8332624 1.0239001-5.3003705 3.0717003-7.4013243 2.0478003-2.1009538 4.5086984-3.1514307 7.3826944-3.1514307z\"\n fill=\"#333\"\n />\n <title>Eye icon</title>\n </svg>\n`;\n"]}
@@ -1,10 +0,0 @@
1
- import { CSSResultGroup, LitElement } from 'lit';
2
- export declare class TileStats extends LitElement {
3
- mediatype?: string;
4
- itemCount?: number;
5
- viewCount?: number;
6
- favCount?: number;
7
- commentCount?: number;
8
- render(): import("lit-html").TemplateResult<1>;
9
- static get styles(): CSSResultGroup;
10
- }
@@ -1,106 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { css, html, LitElement } from 'lit';
3
- import { customElement, property } from 'lit/decorators.js';
4
- import { favoriteFilledIcon } from '../../assets/img/icons/favorite-filled';
5
- import { reviewsIcon } from '../../assets/img/icons/reviews';
6
- import { uploadIcon } from '../../assets/img/icons/upload';
7
- import { viewsIcon } from '../../assets/img/icons/views';
8
- import { formatCount } from '../../utils/format-count';
9
- let TileStats = class TileStats extends LitElement {
10
- render() {
11
- console.log('tile-stats here');
12
- return html `
13
- <div class="stats-wrapper">
14
- <div id="stats-holder">
15
- <div class="col">
16
- <mediatype-icon
17
- .mediatype=${this.mediatype}
18
- style="--iconHeight:25px; --iconWidth:25px;"
19
- >
20
- </mediatype-icon>
21
- </div>
22
- <div class="col">
23
- ${this.mediatype === 'account' ? uploadIcon : viewsIcon}
24
- <p class="status-text">
25
- ${formatCount(this.mediatype === 'account' ? this.itemCount : this.viewCount, 'short', 'short')}
26
- </p>
27
- </div>
28
- <div class="col">
29
- ${favoriteFilledIcon}
30
- <p class="status-text">
31
- ${formatCount(this.favCount, 'short', 'short')}
32
- </p>
33
- </div>
34
- <div class="col">
35
- ${reviewsIcon}
36
- <p class="status-text">
37
- ${formatCount(this.commentCount, 'short', 'short')}
38
- </p>
39
- </div>
40
- </div>
41
- </div>
42
- `;
43
- }
44
- static get styles() {
45
- return css `
46
- .stats-wrapper {
47
- height: 35px;
48
- flex-shrink: 0;
49
- }
50
-
51
- #stats-holder {
52
- border-top: 1px solid #bbb;
53
- align-items: center;
54
- display: flex;
55
- flex: 1;
56
- justify-content: space-evenly;
57
- text-align: center;
58
- width: 100%;
59
- padding-top: 5px;
60
- padding-bottom: 5px;
61
- }
62
-
63
- .col {
64
- width: 25%;
65
- height: 25px;
66
- }
67
-
68
- svg {
69
- height: 10px;
70
- width: 10px;
71
- display: block;
72
- margin: auto;
73
- }
74
-
75
- .status-text {
76
- font-size: 14px;
77
- height: 15px;
78
- color: #2c2c2c;
79
- line-height: 20px;
80
- margin: auto;
81
- display: block;
82
- text-align: center;
83
- }
84
- `;
85
- }
86
- };
87
- __decorate([
88
- property({ type: String })
89
- ], TileStats.prototype, "mediatype", void 0);
90
- __decorate([
91
- property({ type: Number })
92
- ], TileStats.prototype, "itemCount", void 0);
93
- __decorate([
94
- property({ type: Number })
95
- ], TileStats.prototype, "viewCount", void 0);
96
- __decorate([
97
- property({ type: Number })
98
- ], TileStats.prototype, "favCount", void 0);
99
- __decorate([
100
- property({ type: Number })
101
- ], TileStats.prototype, "commentCount", void 0);
102
- TileStats = __decorate([
103
- customElement('tile-stats')
104
- ], TileStats);
105
- export { TileStats };
106
- //# sourceMappingURL=tile-stats.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tile-stats.js","sourceRoot":"","sources":["../../../../src/tiles/grid/tile-stats.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,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,UAAU;IAWvC,MAAM;QACJ,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;QAC9B,OAAO,IAAI,CAAA;;;;;2BAKY,IAAI,CAAC,SAAS;;;;;;cAM3B,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;;gBAEnD,WAAW,CACX,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAC9D,OAAO,EACP,OAAO,CACR;;;;cAID,kBAAkB;;gBAEhB,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;;;;cAI9C,WAAW;;gBAET,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC;;;;;KAK3D,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCT,CAAC;IACJ,CAAC;CACF,CAAA;AA3F6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAoB;AAEnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAoB;AAEnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAoB;AAEnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAuB;AATvC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA4FrB;SA5FY,SAAS","sourcesContent":["import { css, CSSResultGroup, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { favoriteFilledIcon } from '../../assets/img/icons/favorite-filled';\nimport { reviewsIcon } from '../../assets/img/icons/reviews';\nimport { uploadIcon } from '../../assets/img/icons/upload';\nimport { viewsIcon } from '../../assets/img/icons/views';\n\nimport { formatCount } from '../../utils/format-count';\n\n@customElement('tile-stats')\nexport class TileStats extends LitElement {\n @property({ type: String }) mediatype?: string;\n\n @property({ type: Number }) itemCount?: number;\n\n @property({ type: Number }) viewCount?: number;\n\n @property({ type: Number }) favCount?: number;\n\n @property({ type: Number }) commentCount?: number;\n\n render() {\n console.log('tile-stats here')\n return html`\n <div class=\"stats-wrapper\">\n <div id=\"stats-holder\">\n <div class=\"col\">\n <mediatype-icon\n .mediatype=${this.mediatype}\n style=\"--iconHeight:25px; --iconWidth:25px;\"\n >\n </mediatype-icon>\n </div>\n <div class=\"col\">\n ${this.mediatype === 'account' ? uploadIcon : viewsIcon}\n <p class=\"status-text\">\n ${formatCount(\n this.mediatype === 'account' ? this.itemCount : this.viewCount,\n 'short',\n 'short'\n )}\n </p>\n </div>\n <div class=\"col\">\n ${favoriteFilledIcon}\n <p class=\"status-text\">\n ${formatCount(this.favCount, 'short', 'short')}\n </p>\n </div>\n <div class=\"col\">\n ${reviewsIcon}\n <p class=\"status-text\">\n ${formatCount(this.commentCount, 'short', 'short')}\n </p>\n </div>\n </div>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n .stats-wrapper {\n height: 35px;\n flex-shrink: 0;\n }\n\n #stats-holder {\n border-top: 1px solid #bbb;\n align-items: center;\n display: flex;\n flex: 1;\n justify-content: space-evenly;\n text-align: center;\n width: 100%;\n padding-top: 5px;\n padding-bottom: 5px;\n }\n\n .col {\n width: 25%;\n height: 25px;\n }\n\n svg {\n height: 10px;\n width: 10px;\n display: block;\n margin: auto;\n }\n\n .status-text {\n font-size: 14px;\n height: 15px;\n color: #2c2c2c;\n line-height: 20px;\n margin: auto;\n display: block;\n text-align: center;\n }\n `;\n }\n}\n"]}
@@ -1,104 +0,0 @@
1
- import { css, CSSResultGroup, html, LitElement } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
-
4
- import { favoriteFilledIcon } from '../../assets/img/icons/favorite-filled';
5
- import { reviewsIcon } from '../../assets/img/icons/reviews';
6
- import { uploadIcon } from '../../assets/img/icons/upload';
7
- import { viewsIcon } from '../../assets/img/icons/views';
8
-
9
- import { formatCount } from '../../utils/format-count';
10
-
11
- @customElement('tile-stats')
12
- export class TileStats extends LitElement {
13
- @property({ type: String }) mediatype?: string;
14
-
15
- @property({ type: Number }) itemCount?: number;
16
-
17
- @property({ type: Number }) viewCount?: number;
18
-
19
- @property({ type: Number }) favCount?: number;
20
-
21
- @property({ type: Number }) commentCount?: number;
22
-
23
- render() {
24
- console.log('tile-stats here')
25
- return html`
26
- <div class="stats-wrapper">
27
- <div id="stats-holder">
28
- <div class="col">
29
- <mediatype-icon
30
- .mediatype=${this.mediatype}
31
- style="--iconHeight:25px; --iconWidth:25px;"
32
- >
33
- </mediatype-icon>
34
- </div>
35
- <div class="col">
36
- ${this.mediatype === 'account' ? uploadIcon : viewsIcon}
37
- <p class="status-text">
38
- ${formatCount(
39
- this.mediatype === 'account' ? this.itemCount : this.viewCount,
40
- 'short',
41
- 'short'
42
- )}
43
- </p>
44
- </div>
45
- <div class="col">
46
- ${favoriteFilledIcon}
47
- <p class="status-text">
48
- ${formatCount(this.favCount, 'short', 'short')}
49
- </p>
50
- </div>
51
- <div class="col">
52
- ${reviewsIcon}
53
- <p class="status-text">
54
- ${formatCount(this.commentCount, 'short', 'short')}
55
- </p>
56
- </div>
57
- </div>
58
- </div>
59
- `;
60
- }
61
-
62
- static get styles(): CSSResultGroup {
63
- return css`
64
- .stats-wrapper {
65
- height: 35px;
66
- flex-shrink: 0;
67
- }
68
-
69
- #stats-holder {
70
- border-top: 1px solid #bbb;
71
- align-items: center;
72
- display: flex;
73
- flex: 1;
74
- justify-content: space-evenly;
75
- text-align: center;
76
- width: 100%;
77
- padding-top: 5px;
78
- padding-bottom: 5px;
79
- }
80
-
81
- .col {
82
- width: 25%;
83
- height: 25px;
84
- }
85
-
86
- svg {
87
- height: 10px;
88
- width: 10px;
89
- display: block;
90
- margin: auto;
91
- }
92
-
93
- .status-text {
94
- font-size: 14px;
95
- height: 15px;
96
- color: #2c2c2c;
97
- line-height: 20px;
98
- margin: auto;
99
- display: block;
100
- text-align: center;
101
- }
102
- `;
103
- }
104
- }