@internetarchive/collection-browser
Advanced tools
Comparing version 0.0.1-alpha.35 to 0.0.1-alpha.36
import { svg } from 'lit'; | ||
export const accountIcon = svg ` | ||
<svg viewBox="0 0 300 300" | ||
<svg viewBox="0 0 100 100" | ||
xmlns="http://www.w3.org/2000/svg"> | ||
@@ -8,2 +8,3 @@ <path | ||
fill="black" | ||
class="fill-color" | ||
fill-rule="evenodd" | ||
@@ -10,0 +11,0 @@ /> |
@@ -7,2 +7,3 @@ import { __decorate } from "tslib"; | ||
import { formatDate } from '../../utils/format-date'; | ||
import { accountLabel } from './account-label'; | ||
import '../../mediatype-icon'; | ||
@@ -15,3 +16,3 @@ let TileListCompact = class TileListCompact extends LitElement { | ||
render() { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
return html ` | ||
@@ -21,9 +22,13 @@ <div id="list-line" class="${this.classSize}"> | ||
<div id="title">${DOMPurify.sanitize((_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : '')}</div> | ||
<div id="creator">${DOMPurify.sanitize((_d = (_c = this.model) === null || _c === void 0 ? void 0 : _c.creator) !== null && _d !== void 0 ? _d : '')}</div> | ||
<div id="creator"> | ||
${((_c = this.model) === null || _c === void 0 ? void 0 : _c.mediatype) === 'account' | ||
? accountLabel((_d = this.model) === null || _d === void 0 ? void 0 : _d.dateAdded) | ||
: DOMPurify.sanitize((_f = (_e = this.model) === null || _e === void 0 ? void 0 : _e.creator) !== null && _f !== void 0 ? _f : '')} | ||
</div> | ||
<div id="date">${formatDate(this.date, this.formatSize)}</div> | ||
<div id="icon"> | ||
<mediatype-icon .mediatype=${(_e = this.model) === null || _e === void 0 ? void 0 : _e.mediatype}> </mediatype-icon> | ||
<mediatype-icon .mediatype=${(_g = this.model) === null || _g === void 0 ? void 0 : _g.mediatype}> </mediatype-icon> | ||
</div> | ||
<div id="views"> | ||
${formatCount((_g = (_f = this.model) === null || _f === void 0 ? void 0 : _f.viewCount) !== null && _g !== void 0 ? _g : 0, this.formatSize)} | ||
${formatCount((_j = (_h = this.model) === null || _h === void 0 ? void 0 : _h.viewCount) !== null && _j !== void 0 ? _j : 0, this.formatSize)} | ||
</div> | ||
@@ -30,0 +35,0 @@ </div> |
@@ -9,2 +9,3 @@ import { __decorate } from "tslib"; | ||
import { dateLabel } from './date-label'; | ||
import { accountLabel } from './account-label'; | ||
import { formatCount } from '../../utils/format-count'; | ||
@@ -107,4 +108,13 @@ import { formatDate } from '../../utils/format-date'; | ||
get creatorTemplate() { | ||
var _a; | ||
if (!((_a = this.model) === null || _a === void 0 ? void 0 : _a.creators) || this.model.creators.length === 0) { | ||
var _a, _b, _c; | ||
// "Achivist since" if account tile | ||
if (((_a = this.model) === null || _a === void 0 ? void 0 : _a.mediatype) === 'account') { | ||
return html ` | ||
<div id="creator"> | ||
<span class="label"> ${accountLabel((_b = this.model) === null || _b === void 0 ? void 0 : _b.dateAdded)} </span> | ||
</div> | ||
`; | ||
} | ||
// "Creator" if not account tile | ||
if (!((_c = this.model) === null || _c === void 0 ? void 0 : _c.creators) || this.model.creators.length === 0) { | ||
return nothing; | ||
@@ -111,0 +121,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"author": "Internet Archive", | ||
"version": "0.0.1-alpha.35", | ||
"version": "0.0.1-alpha.36", | ||
"main": "dist/index.js", | ||
@@ -9,0 +9,0 @@ "module": "dist/index.js", |
import { svg } from 'lit'; | ||
export const accountIcon = svg` | ||
<svg viewBox="0 0 300 300" | ||
<svg viewBox="0 0 100 100" | ||
xmlns="http://www.w3.org/2000/svg"> | ||
@@ -9,2 +9,3 @@ <path | ||
fill="black" | ||
class="fill-color" | ||
fill-rule="evenodd" | ||
@@ -11,0 +12,0 @@ /> |
@@ -8,2 +8,3 @@ import { css, html, LitElement, nothing } from 'lit'; | ||
import { formatDate, DateFormat } from '../../utils/format-date'; | ||
import { accountLabel } from './account-label'; | ||
import '../../mediatype-icon'; | ||
@@ -30,3 +31,7 @@ | ||
<div id="title">${DOMPurify.sanitize(this.model?.title ?? '')}</div> | ||
<div id="creator">${DOMPurify.sanitize(this.model?.creator ?? '')}</div> | ||
<div id="creator"> | ||
${this.model?.mediatype === 'account' | ||
? accountLabel(this.model?.dateAdded) | ||
: DOMPurify.sanitize(this.model?.creator ?? '')} | ||
</div> | ||
<div id="date">${formatDate(this.date, this.formatSize)}</div> | ||
@@ -33,0 +38,0 @@ <div id="icon"> |
@@ -10,2 +10,3 @@ import { css, html, LitElement, nothing } from 'lit'; | ||
import { dateLabel } from './date-label'; | ||
import { accountLabel } from './account-label'; | ||
import { TileModel } from '../../models'; | ||
@@ -124,2 +125,11 @@ import { formatCount, NumberFormat } from '../../utils/format-count'; | ||
private get creatorTemplate() { | ||
// "Achivist since" if account tile | ||
if (this.model?.mediatype === 'account') { | ||
return html` | ||
<div id="creator"> | ||
<span class="label"> ${accountLabel(this.model?.dateAdded)} </span> | ||
</div> | ||
`; | ||
} | ||
// "Creator" if not account tile | ||
if (!this.model?.creators || this.model.creators.length === 0) { | ||
@@ -126,0 +136,0 @@ return nothing; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
913697
244
12863