@internetarchive/collection-browser 2.18.2-webdev-7743.1 → 2.18.3-alpha-webdev5427.0

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 (48) hide show
  1. package/.editorconfig +29 -29
  2. package/.github/workflows/ci.yml +27 -27
  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/.prettierignore +1 -1
  8. package/LICENSE +661 -661
  9. package/README.md +83 -83
  10. package/dist/src/collection-browser.js +682 -682
  11. package/dist/src/collection-browser.js.map +1 -1
  12. package/dist/src/collection-facets.js +291 -274
  13. package/dist/src/collection-facets.js.map +1 -1
  14. package/dist/src/expanded-date-picker.d.ts +6 -4
  15. package/dist/src/expanded-date-picker.js +64 -55
  16. package/dist/src/expanded-date-picker.js.map +1 -1
  17. package/dist/src/models.js.map +1 -1
  18. package/dist/src/sort-filter-bar/sort-filter-bar.js +382 -382
  19. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  20. package/dist/src/tiles/grid/item-tile.js +139 -139
  21. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  22. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +118 -118
  23. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
  24. package/dist/src/tiles/list/tile-list.js +289 -289
  25. package/dist/src/tiles/list/tile-list.js.map +1 -1
  26. package/dist/src/tiles/tile-dispatcher.js +200 -200
  27. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  28. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +37 -37
  29. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
  30. package/eslint.config.mjs +53 -53
  31. package/index.html +24 -24
  32. package/local.archive.org.cert +86 -86
  33. package/local.archive.org.key +27 -27
  34. package/package.json +117 -117
  35. package/renovate.json +6 -6
  36. package/src/collection-browser.ts +2712 -2712
  37. package/src/collection-facets.ts +990 -966
  38. package/src/expanded-date-picker.ts +191 -175
  39. package/src/models.ts +822 -822
  40. package/src/sort-filter-bar/sort-filter-bar.ts +1189 -1189
  41. package/src/tiles/grid/item-tile.ts +339 -339
  42. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +129 -129
  43. package/src/tiles/list/tile-list.ts +688 -688
  44. package/src/tiles/tile-dispatcher.ts +486 -486
  45. package/test/sort-filter-bar/sort-filter-bar.test.ts +692 -692
  46. package/tsconfig.json +20 -20
  47. package/web-dev-server.config.mjs +30 -30
  48. package/web-test-runner.config.mjs +41 -41
@@ -1 +1 @@
1
- {"version":3,"file":"item-tile.js","sourceRoot":"","sources":["../../../../src/tiles/grid/item-tile.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAAc,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,eAAe,CAAC;AACvB,OAAO,wBAAwB,CAAC;AAChC,OAAO,cAAc,CAAC;AAIf,IAAM,QAAQ,GAA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AA,IAAI,CAAC,aAAa,0CAAE,KAAe,CACpC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,IAAY,aAAa;;QACvB,OAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,gBAAgB,CAAC;IACjD,CAAC;IAED,IAAY,WAAW;;QACrB,OAAO,CAAC,CAAC,CAAA,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,QAAQ,0CAAE,MAAM,CAAA,CAAC;IACxC,CAAC;IAEO,iBAAiB,CAAC,CAAe;QACvC,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,MAAM,KAAK,GAAG,IAAI,WAAW,CAC3B,mBAAmB,EACnB,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAC3C,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,MAAM,KAAK,MAAM;QACf,MAAM,eAAe,GAAG,GAAG,CAAA,iCAAiC,CAAC;QAE7D,OAAO;YACL,cAAc;YACd,GAAG,CAAA;;;;;;;;;;8BAUqB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CtC;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA3S8B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDAAwB;AAEvB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAqB;AAErB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA6C;AArB7D,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA4TpB","sourcesContent":["import { css, CSSResultGroup, html, nothing, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { map } from 'lit/directives/map.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { msg } from '@lit/localize';\n\nimport type { SortParam } from '@internetarchive/search-service';\nimport { DateFormat, formatDate } from '../../utils/format-date';\nimport { isFirstMillisecondOfUTCYear } from '../../utils/local-date-from-utc';\nimport { BaseTileComponent } from '../base-tile-component';\nimport { baseTileStyles } from './styles/tile-grid-shared-styles';\n\nimport '../image-block';\nimport '../review-block';\nimport '../text-snippet-block';\nimport '../item-image';\nimport '../tile-mediatype-icon';\nimport './tile-stats';\nimport { SimpleLayoutType } from '../models';\n\n@customElement('item-tile')\nexport class ItemTile extends BaseTileComponent {\n /*\n * Reactive properties inherited from BaseTileComponent:\n * - model?: TileModel;\n * - currentWidth?: number;\n * - currentHeight?: number;\n * - baseNavigationUrl?: string;\n * - baseImageUrl?: string;\n * - collectionPagePath?: string;\n * - sortParam: SortParam | null = null;\n * - defaultSortParam: SortParam | null = null;\n * - creatorFilter?: string;\n * - mobileBreakpoint?: number;\n * - loggedIn = false;\n * - suppressBlurring = false;\n */\n\n @property({ type: Boolean }) showInfoButton = false;\n\n @property({ type: Boolean }) showTvClips = false;\n\n @property({ type: String }) simpleLayoutType: SimpleLayoutType = 'none';\n\n render() {\n const itemTitle = this.model?.title;\n const containerClasses = classMap({\n container: true,\n simple: this.simpleLayoutType !== 'none',\n 'stats-only': this.simpleLayoutType === 'stats-only',\n 'snippets-only': this.simpleLayoutType === 'snippets-only',\n });\n\n return html`\n <div class=${containerClasses}>\n ${this.infoButtonTemplate}\n <div class=\"tile-details\">\n <div class=\"item-info\">\n ${this.imageBlockTemplate}\n\n <div id=\"title\">\n <h4 class=\"truncated\" title=${ifDefined(itemTitle)}>\n ${itemTitle}\n </h4>\n </div>\n\n ${this.volumeIssueTemplate}\n ${this.isSortedByDate\n ? this.sortedDateInfoTemplate\n : this.creatorTemplate}\n ${this.webArchivesCaptureDatesTemplate} ${this.textSnippetsTemplate}\n ${this.reviewBlockTemplate}\n </div>\n\n ${this.tileStatsTemplate}\n </div>\n </div>\n `;\n }\n\n /**\n * Templates\n */\n private get creatorTemplate(): TemplateResult | typeof nothing {\n const displayedCreator =\n this.displayValueProvider.firstCreatorMatchingFilter;\n if (!displayedCreator) return nothing;\n\n return html`\n <div class=\"created-by\">\n <span class=\"truncated\" title=${displayedCreator}>\n by&nbsp;${displayedCreator}\n </span>\n </div>\n `;\n }\n\n private get imageBlockTemplate(): TemplateResult {\n return html`\n <image-block\n .model=${this.model}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n .isCompactTile=${false}\n .isListTile=${false}\n .viewSize=${'grid'}\n >\n </image-block>\n `;\n }\n\n private get sortedDateInfoTemplate() {\n let sortedValue;\n let format: DateFormat = 'long';\n switch (this.effectiveSort?.field) {\n case 'date': {\n const datePublished = this.model?.datePublished;\n sortedValue = { field: 'published', value: datePublished };\n if (isFirstMillisecondOfUTCYear(datePublished)) {\n format = 'year-only';\n }\n break;\n }\n case 'reviewdate':\n sortedValue = { field: 'reviewed', value: this.model?.dateReviewed };\n break;\n case 'addeddate':\n sortedValue = { field: 'added', value: this.model?.dateAdded };\n break;\n case 'publicdate':\n sortedValue = { field: 'archived', value: this.model?.dateArchived };\n break;\n default:\n break;\n }\n\n if (!sortedValue?.value) {\n return nothing;\n }\n return html`\n <div class=\"date-sorted-by truncated\">\n <span>\n ${sortedValue?.field} ${formatDate(sortedValue?.value, format)}\n </span>\n </div>\n `;\n }\n\n private get infoButtonTemplate(): TemplateResult | typeof nothing {\n // &#9432; is an information icon\n return this.showInfoButton\n ? html`<button class=\"info-button\" @click=${this.infoButtonPressed}>\n &#9432;\n <span class=\"sr-only\">${msg('More info')}</span>\n </button>`\n : nothing;\n }\n\n private get reviewBlockTemplate(): TemplateResult | typeof nothing {\n if (!this.model?.review) return nothing;\n\n const { reviewtitle, reviewbody, stars } = this.model.review;\n return html`\n <review-block\n viewsize=\"grid\"\n title=${ifDefined(reviewtitle)}\n body=${ifDefined(reviewbody)}\n starRating=${ifDefined(stars)}\n >\n </review-block>\n `;\n }\n\n private get textSnippetsTemplate(): TemplateResult | typeof nothing {\n if (!this.hasSnippets || this.simpleLayoutType === 'stats-only')\n return nothing;\n\n return html`\n <text-snippet-block viewsize=\"grid\" .snippets=${this.model?.snippets}>\n </text-snippet-block>\n `;\n }\n\n private get volumeIssueTemplate(): TemplateResult | typeof nothing {\n if (!this.model?.volume || !this.model?.issue) return nothing;\n\n return html`\n <div class=\"volume-issue\">\n <span class=\"truncated\" title=\"volume|issue\">\n Volume&nbsp;${this.model?.volume}, Issue&nbsp;${this.model?.issue}\n </span>\n </div>\n `;\n }\n\n private get webArchivesCaptureDatesTemplate():\n | TemplateResult\n | typeof nothing {\n if (!this.model?.captureDates || !this.model.title) return nothing;\n\n return html`\n <ul class=\"capture-dates\">\n ${map(\n this.model.captureDates,\n date =>\n html`<li>\n ${this.displayValueProvider.webArchivesCaptureLink(\n this.model!.title,\n date,\n )}\n </li>`,\n )}\n </ul>\n `;\n }\n\n /**\n * Template for the stats row along the bottom of the tile.\n */\n private get tileStatsTemplate(): TemplateResult | typeof nothing {\n if (this.simpleLayoutType === 'snippets-only') return nothing;\n\n const effectiveSort = this.sortParam ?? this.defaultSortParam;\n const [viewCount, viewLabel] =\n effectiveSort?.field === 'week'\n ? [this.model?.weeklyViewCount, 'weekly views']\n : [this.model?.viewCount, 'all-time views'];\n\n return html`\n <tile-stats\n .model=${this.model}\n .mediatype=${this.model?.mediatype}\n .viewCount=${viewCount}\n .viewLabel=${viewLabel}\n .favCount=${this.model?.favCount}\n .commentCount=${this.model?.commentCount}\n .tvClipCount=${this.model?.tvClipCount}\n .showTvClips=${this.showTvClips}\n >\n </tile-stats>\n `;\n }\n\n private get isSortedByDate(): boolean {\n return ['date', 'reviewdate', 'addeddate', 'publicdate'].includes(\n this.effectiveSort?.field as string,\n );\n }\n\n /**\n * Returns the active sort param if one is set, or the default sort param otherwise.\n */\n private get effectiveSort(): SortParam | null {\n return this.sortParam ?? this.defaultSortParam;\n }\n\n private get hasSnippets(): boolean {\n return !!this.model?.snippets?.length;\n }\n\n private infoButtonPressed(e: PointerEvent): void {\n e.preventDefault();\n const event = new CustomEvent<{ x: number; y: number }>(\n 'infoButtonPressed',\n { detail: { x: e.clientX, y: e.clientY } },\n );\n this.dispatchEvent(event);\n }\n\n /**\n * CSS\n */\n static get styles(): CSSResultGroup {\n const tileBorderColor = css`var(--tileBorderColor, #dddddd)`;\n\n return [\n baseTileStyles,\n css`\n a:link {\n text-decoration: none;\n color: var(--ia-theme-link-color, #4b64ff);\n }\n a:hover {\n text-decoration: underline;\n }\n\n .container {\n border: 1px solid ${tileBorderColor};\n }\n\n .simple #title > .truncated {\n -webkit-line-clamp: 2;\n }\n\n .simple .created-by > .truncated,\n .simple .date-sorted-by > .truncated,\n .simple .volume-issue > .truncated {\n -webkit-line-clamp: 1;\n }\n\n .simple.snippets-only .item-info {\n padding-bottom: 5px;\n }\n\n .simple.snippets-only text-snippet-block {\n margin-top: auto; /* Force the snippets to the bottom of the tile */\n }\n\n .capture-dates {\n margin: 0;\n padding: 0 5px;\n list-style-type: none;\n }\n\n review-block,\n text-snippet-block {\n --containerLeftMargin: 5px;\n --containerTopMargin: 5px;\n }\n\n /**\n * iOS Safari long-press on tiles (to bring up hover pane)\n * gets messy without this\n */\n @media screen and (pointer: coarse) and (hover: none) {\n .container {\n -webkit-touch-callout: none;\n }\n\n .truncated {\n -webkit-touch-callout: default;\n }\n }\n `,\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"item-tile.js","sourceRoot":"","sources":["../../../../src/tiles/grid/item-tile.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;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O;YACL,cAAc;YACd,GAAG,CAAA;;;;;;;;;;8BAUqB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CtC;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA3S8B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDAAwB;AAEvB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAqB;AAErB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA6C;AArB7D,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA4TpB","sourcesContent":["import { css, CSSResultGroup, html, nothing, TemplateResult } from 'lit';\r\nimport { customElement, property } from 'lit/decorators.js';\r\nimport { ifDefined } from 'lit/directives/if-defined.js';\r\nimport { map } from 'lit/directives/map.js';\r\nimport { classMap } from 'lit/directives/class-map.js';\r\nimport { msg } from '@lit/localize';\r\n\r\nimport type { SortParam } from '@internetarchive/search-service';\r\nimport { DateFormat, formatDate } from '../../utils/format-date';\r\nimport { isFirstMillisecondOfUTCYear } from '../../utils/local-date-from-utc';\r\nimport { BaseTileComponent } from '../base-tile-component';\r\nimport { baseTileStyles } from './styles/tile-grid-shared-styles';\r\n\r\nimport '../image-block';\r\nimport '../review-block';\r\nimport '../text-snippet-block';\r\nimport '../item-image';\r\nimport '../tile-mediatype-icon';\r\nimport './tile-stats';\r\nimport { SimpleLayoutType } from '../models';\r\n\r\n@customElement('item-tile')\r\nexport class ItemTile extends BaseTileComponent {\r\n /*\r\n * Reactive properties inherited from BaseTileComponent:\r\n * - model?: TileModel;\r\n * - currentWidth?: number;\r\n * - currentHeight?: number;\r\n * - baseNavigationUrl?: string;\r\n * - baseImageUrl?: string;\r\n * - collectionPagePath?: string;\r\n * - sortParam: SortParam | null = null;\r\n * - defaultSortParam: SortParam | null = null;\r\n * - creatorFilter?: string;\r\n * - mobileBreakpoint?: number;\r\n * - loggedIn = false;\r\n * - suppressBlurring = false;\r\n */\r\n\r\n @property({ type: Boolean }) showInfoButton = false;\r\n\r\n @property({ type: Boolean }) showTvClips = false;\r\n\r\n @property({ type: String }) simpleLayoutType: SimpleLayoutType = 'none';\r\n\r\n render() {\r\n const itemTitle = this.model?.title;\r\n const containerClasses = classMap({\r\n container: true,\r\n simple: this.simpleLayoutType !== 'none',\r\n 'stats-only': this.simpleLayoutType === 'stats-only',\r\n 'snippets-only': this.simpleLayoutType === 'snippets-only',\r\n });\r\n\r\n return html`\r\n <div class=${containerClasses}>\r\n ${this.infoButtonTemplate}\r\n <div class=\"tile-details\">\r\n <div class=\"item-info\">\r\n ${this.imageBlockTemplate}\r\n\r\n <div id=\"title\">\r\n <h4 class=\"truncated\" title=${ifDefined(itemTitle)}>\r\n ${itemTitle}\r\n </h4>\r\n </div>\r\n\r\n ${this.volumeIssueTemplate}\r\n ${this.isSortedByDate\r\n ? this.sortedDateInfoTemplate\r\n : this.creatorTemplate}\r\n ${this.webArchivesCaptureDatesTemplate} ${this.textSnippetsTemplate}\r\n ${this.reviewBlockTemplate}\r\n </div>\r\n\r\n ${this.tileStatsTemplate}\r\n </div>\r\n </div>\r\n `;\r\n }\r\n\r\n /**\r\n * Templates\r\n */\r\n private get creatorTemplate(): TemplateResult | typeof nothing {\r\n const displayedCreator =\r\n this.displayValueProvider.firstCreatorMatchingFilter;\r\n if (!displayedCreator) return nothing;\r\n\r\n return html`\r\n <div class=\"created-by\">\r\n <span class=\"truncated\" title=${displayedCreator}>\r\n by&nbsp;${displayedCreator}\r\n </span>\r\n </div>\r\n `;\r\n }\r\n\r\n private get imageBlockTemplate(): TemplateResult {\r\n return html`\r\n <image-block\r\n .model=${this.model}\r\n .baseImageUrl=${this.baseImageUrl}\r\n .loggedIn=${this.loggedIn}\r\n .suppressBlurring=${this.suppressBlurring}\r\n .isCompactTile=${false}\r\n .isListTile=${false}\r\n .viewSize=${'grid'}\r\n >\r\n </image-block>\r\n `;\r\n }\r\n\r\n private get sortedDateInfoTemplate() {\r\n let sortedValue;\r\n let format: DateFormat = 'long';\r\n switch (this.effectiveSort?.field) {\r\n case 'date': {\r\n const datePublished = this.model?.datePublished;\r\n sortedValue = { field: 'published', value: datePublished };\r\n if (isFirstMillisecondOfUTCYear(datePublished)) {\r\n format = 'year-only';\r\n }\r\n break;\r\n }\r\n case 'reviewdate':\r\n sortedValue = { field: 'reviewed', value: this.model?.dateReviewed };\r\n break;\r\n case 'addeddate':\r\n sortedValue = { field: 'added', value: this.model?.dateAdded };\r\n break;\r\n case 'publicdate':\r\n sortedValue = { field: 'archived', value: this.model?.dateArchived };\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n if (!sortedValue?.value) {\r\n return nothing;\r\n }\r\n return html`\r\n <div class=\"date-sorted-by truncated\">\r\n <span>\r\n ${sortedValue?.field} ${formatDate(sortedValue?.value, format)}\r\n </span>\r\n </div>\r\n `;\r\n }\r\n\r\n private get infoButtonTemplate(): TemplateResult | typeof nothing {\r\n // &#9432; is an information icon\r\n return this.showInfoButton\r\n ? html`<button class=\"info-button\" @click=${this.infoButtonPressed}>\r\n &#9432;\r\n <span class=\"sr-only\">${msg('More info')}</span>\r\n </button>`\r\n : nothing;\r\n }\r\n\r\n private get reviewBlockTemplate(): TemplateResult | typeof nothing {\r\n if (!this.model?.review) return nothing;\r\n\r\n const { reviewtitle, reviewbody, stars } = this.model.review;\r\n return html`\r\n <review-block\r\n viewsize=\"grid\"\r\n title=${ifDefined(reviewtitle)}\r\n body=${ifDefined(reviewbody)}\r\n starRating=${ifDefined(stars)}\r\n >\r\n </review-block>\r\n `;\r\n }\r\n\r\n private get textSnippetsTemplate(): TemplateResult | typeof nothing {\r\n if (!this.hasSnippets || this.simpleLayoutType === 'stats-only')\r\n return nothing;\r\n\r\n return html`\r\n <text-snippet-block viewsize=\"grid\" .snippets=${this.model?.snippets}>\r\n </text-snippet-block>\r\n `;\r\n }\r\n\r\n private get volumeIssueTemplate(): TemplateResult | typeof nothing {\r\n if (!this.model?.volume || !this.model?.issue) return nothing;\r\n\r\n return html`\r\n <div class=\"volume-issue\">\r\n <span class=\"truncated\" title=\"volume|issue\">\r\n Volume&nbsp;${this.model?.volume}, Issue&nbsp;${this.model?.issue}\r\n </span>\r\n </div>\r\n `;\r\n }\r\n\r\n private get webArchivesCaptureDatesTemplate():\r\n | TemplateResult\r\n | typeof nothing {\r\n if (!this.model?.captureDates || !this.model.title) return nothing;\r\n\r\n return html`\r\n <ul class=\"capture-dates\">\r\n ${map(\r\n this.model.captureDates,\r\n date =>\r\n html`<li>\r\n ${this.displayValueProvider.webArchivesCaptureLink(\r\n this.model!.title,\r\n date,\r\n )}\r\n </li>`,\r\n )}\r\n </ul>\r\n `;\r\n }\r\n\r\n /**\r\n * Template for the stats row along the bottom of the tile.\r\n */\r\n private get tileStatsTemplate(): TemplateResult | typeof nothing {\r\n if (this.simpleLayoutType === 'snippets-only') return nothing;\r\n\r\n const effectiveSort = this.sortParam ?? this.defaultSortParam;\r\n const [viewCount, viewLabel] =\r\n effectiveSort?.field === 'week'\r\n ? [this.model?.weeklyViewCount, 'weekly views']\r\n : [this.model?.viewCount, 'all-time views'];\r\n\r\n return html`\r\n <tile-stats\r\n .model=${this.model}\r\n .mediatype=${this.model?.mediatype}\r\n .viewCount=${viewCount}\r\n .viewLabel=${viewLabel}\r\n .favCount=${this.model?.favCount}\r\n .commentCount=${this.model?.commentCount}\r\n .tvClipCount=${this.model?.tvClipCount}\r\n .showTvClips=${this.showTvClips}\r\n >\r\n </tile-stats>\r\n `;\r\n }\r\n\r\n private get isSortedByDate(): boolean {\r\n return ['date', 'reviewdate', 'addeddate', 'publicdate'].includes(\r\n this.effectiveSort?.field as string,\r\n );\r\n }\r\n\r\n /**\r\n * Returns the active sort param if one is set, or the default sort param otherwise.\r\n */\r\n private get effectiveSort(): SortParam | null {\r\n return this.sortParam ?? this.defaultSortParam;\r\n }\r\n\r\n private get hasSnippets(): boolean {\r\n return !!this.model?.snippets?.length;\r\n }\r\n\r\n private infoButtonPressed(e: PointerEvent): void {\r\n e.preventDefault();\r\n const event = new CustomEvent<{ x: number; y: number }>(\r\n 'infoButtonPressed',\r\n { detail: { x: e.clientX, y: e.clientY } },\r\n );\r\n this.dispatchEvent(event);\r\n }\r\n\r\n /**\r\n * CSS\r\n */\r\n static get styles(): CSSResultGroup {\r\n const tileBorderColor = css`var(--tileBorderColor, #dddddd)`;\r\n\r\n return [\r\n baseTileStyles,\r\n css`\r\n a:link {\r\n text-decoration: none;\r\n color: var(--ia-theme-link-color, #4b64ff);\r\n }\r\n a:hover {\r\n text-decoration: underline;\r\n }\r\n\r\n .container {\r\n border: 1px solid ${tileBorderColor};\r\n }\r\n\r\n .simple #title > .truncated {\r\n -webkit-line-clamp: 2;\r\n }\r\n\r\n .simple .created-by > .truncated,\r\n .simple .date-sorted-by > .truncated,\r\n .simple .volume-issue > .truncated {\r\n -webkit-line-clamp: 1;\r\n }\r\n\r\n .simple.snippets-only .item-info {\r\n padding-bottom: 5px;\r\n }\r\n\r\n .simple.snippets-only text-snippet-block {\r\n margin-top: auto; /* Force the snippets to the bottom of the tile */\r\n }\r\n\r\n .capture-dates {\r\n margin: 0;\r\n padding: 0 5px;\r\n list-style-type: none;\r\n }\r\n\r\n review-block,\r\n text-snippet-block {\r\n --containerLeftMargin: 5px;\r\n --containerTopMargin: 5px;\r\n }\r\n\r\n /**\r\n * iOS Safari long-press on tiles (to bring up hover pane)\r\n * gets messy without this\r\n */\r\n @media screen and (pointer: coarse) and (hover: none) {\r\n .container {\r\n -webkit-touch-callout: none;\r\n }\r\n\r\n .truncated {\r\n -webkit-touch-callout: default;\r\n }\r\n }\r\n `,\r\n ];\r\n }\r\n}\r\n"]}
@@ -5,123 +5,123 @@ import { srOnlyStyle } from '../../../styles/sr-only';
5
5
  */
6
6
  const tileBackgroundColor = css `var(--tileBackgroundColor, #ffffff)`;
7
7
  const tileCornerRadius = css `var(--tileCornerRadius, 4px)`;
8
- export const baseTileStyles = css `
9
- /* Include .sr-only styles for all tiles */
10
- ${srOnlyStyle}
11
-
12
- .container {
13
- background-color: ${tileBackgroundColor};
14
- border: 1px #2c2c2c;
15
- border-radius: ${tileCornerRadius};
16
- box-shadow: 1px 1px 2px 0;
17
- box-sizing: border-box;
18
- height: 100%;
19
- display: flex;
20
- flex-direction: column;
21
- width: 100%;
22
- }
23
-
24
- image-block {
25
- display: block;
26
- position: relative;
27
- text-align: center;
28
- }
29
-
30
- .tile-details {
31
- display: flex;
32
- flex-direction: column;
33
- height: 100%;
34
- row-gap: 10px;
35
- font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
36
- }
37
-
38
- .item-info {
39
- display: flex;
40
- flex-direction: column;
41
- row-gap: 5px;
42
- flex-grow: 1;
43
- }
44
-
45
- #title {
46
- padding: 0 5px;
47
- }
48
-
49
- .created-by,
50
- .date-sorted-by,
51
- .volume-issue,
52
- .archivist-since {
53
- display: flex;
54
- justify-content: left;
55
- align-items: flex-start;
56
- padding: 0 5px;
57
- }
58
-
59
- .truncated {
60
- flex: 1;
61
- color: #2c2c2c;
62
- min-width: 0; /* Important for long words! */
63
- text-align: left;
64
- line-height: 15px;
65
- text-overflow: ellipsis;
66
- overflow: hidden;
67
- word-wrap: break-word;
68
- -webkit-line-clamp: 3;
69
- -webkit-box-orient: vertical;
70
- }
71
-
72
- h4.truncated {
73
- display: -webkit-box;
74
- margin: 0px;
75
- line-height: 15px;
76
- font-size: 14px;
77
- font-weight: 500;
78
- padding-bottom: 1px;
79
- }
80
-
81
- span {
82
- display: -webkit-box;
83
- font-size: 1.4rem;
84
- line-height: 15px;
85
- overflow: hidden;
86
- word-wrap: break-word;
87
- -webkit-line-clamp: 1;
88
- -webkit-box-orient: vertical;
89
- padding-bottom: 1px;
90
- }
91
-
92
- .container:hover > .tile-details > .item-info > #title > .truncated {
93
- text-decoration: underline;
94
- }
95
-
96
- /** this is a workaround for Safari 15 where the hover effects are not working */
97
- #title:hover > .truncated {
98
- text-decoration: underline;
99
- }
100
-
101
- .info-button {
102
- position: absolute;
103
- right: 10px;
104
- top: 10px;
105
- margin: 0;
106
- padding: 0;
107
- border: none;
108
- border-radius: 50%;
109
- display: flex;
110
- justify-content: center;
111
- align-items: center;
112
- background: rgba(220, 220, 220, 0.5);
113
- color: white;
114
- font-size: 2rem;
115
- font-weight: bold;
116
- line-height: 1;
117
- text-shadow: black 1px 1px 3px;
118
- overflow: visible;
119
- aspect-ratio: 1 / 1;
120
- z-index: 1;
121
- }
122
-
123
- .hidden {
124
- display: none;
125
- }
8
+ export const baseTileStyles = css `
9
+ /* Include .sr-only styles for all tiles */
10
+ ${srOnlyStyle}
11
+
12
+ .container {
13
+ background-color: ${tileBackgroundColor};
14
+ border: 1px #2c2c2c;
15
+ border-radius: ${tileCornerRadius};
16
+ box-shadow: 1px 1px 2px 0;
17
+ box-sizing: border-box;
18
+ height: 100%;
19
+ display: flex;
20
+ flex-direction: column;
21
+ width: 100%;
22
+ }
23
+
24
+ image-block {
25
+ display: block;
26
+ position: relative;
27
+ text-align: center;
28
+ }
29
+
30
+ .tile-details {
31
+ display: flex;
32
+ flex-direction: column;
33
+ height: 100%;
34
+ row-gap: 10px;
35
+ font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
36
+ }
37
+
38
+ .item-info {
39
+ display: flex;
40
+ flex-direction: column;
41
+ row-gap: 5px;
42
+ flex-grow: 1;
43
+ }
44
+
45
+ #title {
46
+ padding: 0 5px;
47
+ }
48
+
49
+ .created-by,
50
+ .date-sorted-by,
51
+ .volume-issue,
52
+ .archivist-since {
53
+ display: flex;
54
+ justify-content: left;
55
+ align-items: flex-start;
56
+ padding: 0 5px;
57
+ }
58
+
59
+ .truncated {
60
+ flex: 1;
61
+ color: #2c2c2c;
62
+ min-width: 0; /* Important for long words! */
63
+ text-align: left;
64
+ line-height: 15px;
65
+ text-overflow: ellipsis;
66
+ overflow: hidden;
67
+ word-wrap: break-word;
68
+ -webkit-line-clamp: 3;
69
+ -webkit-box-orient: vertical;
70
+ }
71
+
72
+ h4.truncated {
73
+ display: -webkit-box;
74
+ margin: 0px;
75
+ line-height: 15px;
76
+ font-size: 14px;
77
+ font-weight: 500;
78
+ padding-bottom: 1px;
79
+ }
80
+
81
+ span {
82
+ display: -webkit-box;
83
+ font-size: 1.4rem;
84
+ line-height: 15px;
85
+ overflow: hidden;
86
+ word-wrap: break-word;
87
+ -webkit-line-clamp: 1;
88
+ -webkit-box-orient: vertical;
89
+ padding-bottom: 1px;
90
+ }
91
+
92
+ .container:hover > .tile-details > .item-info > #title > .truncated {
93
+ text-decoration: underline;
94
+ }
95
+
96
+ /** this is a workaround for Safari 15 where the hover effects are not working */
97
+ #title:hover > .truncated {
98
+ text-decoration: underline;
99
+ }
100
+
101
+ .info-button {
102
+ position: absolute;
103
+ right: 10px;
104
+ top: 10px;
105
+ margin: 0;
106
+ padding: 0;
107
+ border: none;
108
+ border-radius: 50%;
109
+ display: flex;
110
+ justify-content: center;
111
+ align-items: center;
112
+ background: rgba(220, 220, 220, 0.5);
113
+ color: white;
114
+ font-size: 2rem;
115
+ font-weight: bold;
116
+ line-height: 1;
117
+ text-shadow: black 1px 1px 3px;
118
+ overflow: visible;
119
+ aspect-ratio: 1 / 1;
120
+ z-index: 1;
121
+ }
122
+
123
+ .hidden {
124
+ display: none;
125
+ }
126
126
  `;
127
127
  //# sourceMappingURL=tile-grid-shared-styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tile-grid-shared-styles.js","sourceRoot":"","sources":["../../../../../src/tiles/grid/styles/tile-grid-shared-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;GAEG;AAEH,MAAM,mBAAmB,GAAG,GAAG,CAAA,qCAAqC,CAAC;AACrE,MAAM,gBAAgB,GAAG,GAAG,CAAA,8BAA8B,CAAC;AAE3D,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;IAE7B,WAAW;;;wBAGS,mBAAmB;;qBAEtB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GpC,CAAC","sourcesContent":["import { css } from 'lit';\nimport { srOnlyStyle } from '../../../styles/sr-only';\n\n/**\n * Base tile styles\n */\n\nconst tileBackgroundColor = css`var(--tileBackgroundColor, #ffffff)`;\nconst tileCornerRadius = css`var(--tileCornerRadius, 4px)`;\n\nexport const baseTileStyles = css`\n /* Include .sr-only styles for all tiles */\n ${srOnlyStyle}\n\n .container {\n background-color: ${tileBackgroundColor};\n border: 1px #2c2c2c;\n border-radius: ${tileCornerRadius};\n box-shadow: 1px 1px 2px 0;\n box-sizing: border-box;\n height: 100%;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n image-block {\n display: block;\n position: relative;\n text-align: center;\n }\n\n .tile-details {\n display: flex;\n flex-direction: column;\n height: 100%;\n row-gap: 10px;\n font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;\n }\n\n .item-info {\n display: flex;\n flex-direction: column;\n row-gap: 5px;\n flex-grow: 1;\n }\n\n #title {\n padding: 0 5px;\n }\n\n .created-by,\n .date-sorted-by,\n .volume-issue,\n .archivist-since {\n display: flex;\n justify-content: left;\n align-items: flex-start;\n padding: 0 5px;\n }\n\n .truncated {\n flex: 1;\n color: #2c2c2c;\n min-width: 0; /* Important for long words! */\n text-align: left;\n line-height: 15px;\n text-overflow: ellipsis;\n overflow: hidden;\n word-wrap: break-word;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n }\n\n h4.truncated {\n display: -webkit-box;\n margin: 0px;\n line-height: 15px;\n font-size: 14px;\n font-weight: 500;\n padding-bottom: 1px;\n }\n\n span {\n display: -webkit-box;\n font-size: 1.4rem;\n line-height: 15px;\n overflow: hidden;\n word-wrap: break-word;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n padding-bottom: 1px;\n }\n\n .container:hover > .tile-details > .item-info > #title > .truncated {\n text-decoration: underline;\n }\n\n /** this is a workaround for Safari 15 where the hover effects are not working */\n #title:hover > .truncated {\n text-decoration: underline;\n }\n\n .info-button {\n position: absolute;\n right: 10px;\n top: 10px;\n margin: 0;\n padding: 0;\n border: none;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: rgba(220, 220, 220, 0.5);\n color: white;\n font-size: 2rem;\n font-weight: bold;\n line-height: 1;\n text-shadow: black 1px 1px 3px;\n overflow: visible;\n aspect-ratio: 1 / 1;\n z-index: 1;\n }\n\n .hidden {\n display: none;\n }\n`;\n"]}
1
+ {"version":3,"file":"tile-grid-shared-styles.js","sourceRoot":"","sources":["../../../../../src/tiles/grid/styles/tile-grid-shared-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;GAEG;AAEH,MAAM,mBAAmB,GAAG,GAAG,CAAA,qCAAqC,CAAC;AACrE,MAAM,gBAAgB,GAAG,GAAG,CAAA,8BAA8B,CAAC;AAE3D,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;IAE7B,WAAW;;;wBAGS,mBAAmB;;qBAEtB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GpC,CAAC","sourcesContent":["import { css } from 'lit';\r\nimport { srOnlyStyle } from '../../../styles/sr-only';\r\n\r\n/**\r\n * Base tile styles\r\n */\r\n\r\nconst tileBackgroundColor = css`var(--tileBackgroundColor, #ffffff)`;\r\nconst tileCornerRadius = css`var(--tileCornerRadius, 4px)`;\r\n\r\nexport const baseTileStyles = css`\r\n /* Include .sr-only styles for all tiles */\r\n ${srOnlyStyle}\r\n\r\n .container {\r\n background-color: ${tileBackgroundColor};\r\n border: 1px #2c2c2c;\r\n border-radius: ${tileCornerRadius};\r\n box-shadow: 1px 1px 2px 0;\r\n box-sizing: border-box;\r\n height: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n width: 100%;\r\n }\r\n\r\n image-block {\r\n display: block;\r\n position: relative;\r\n text-align: center;\r\n }\r\n\r\n .tile-details {\r\n display: flex;\r\n flex-direction: column;\r\n height: 100%;\r\n row-gap: 10px;\r\n font-family: 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;\r\n }\r\n\r\n .item-info {\r\n display: flex;\r\n flex-direction: column;\r\n row-gap: 5px;\r\n flex-grow: 1;\r\n }\r\n\r\n #title {\r\n padding: 0 5px;\r\n }\r\n\r\n .created-by,\r\n .date-sorted-by,\r\n .volume-issue,\r\n .archivist-since {\r\n display: flex;\r\n justify-content: left;\r\n align-items: flex-start;\r\n padding: 0 5px;\r\n }\r\n\r\n .truncated {\r\n flex: 1;\r\n color: #2c2c2c;\r\n min-width: 0; /* Important for long words! */\r\n text-align: left;\r\n line-height: 15px;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n word-wrap: break-word;\r\n -webkit-line-clamp: 3;\r\n -webkit-box-orient: vertical;\r\n }\r\n\r\n h4.truncated {\r\n display: -webkit-box;\r\n margin: 0px;\r\n line-height: 15px;\r\n font-size: 14px;\r\n font-weight: 500;\r\n padding-bottom: 1px;\r\n }\r\n\r\n span {\r\n display: -webkit-box;\r\n font-size: 1.4rem;\r\n line-height: 15px;\r\n overflow: hidden;\r\n word-wrap: break-word;\r\n -webkit-line-clamp: 1;\r\n -webkit-box-orient: vertical;\r\n padding-bottom: 1px;\r\n }\r\n\r\n .container:hover > .tile-details > .item-info > #title > .truncated {\r\n text-decoration: underline;\r\n }\r\n\r\n /** this is a workaround for Safari 15 where the hover effects are not working */\r\n #title:hover > .truncated {\r\n text-decoration: underline;\r\n }\r\n\r\n .info-button {\r\n position: absolute;\r\n right: 10px;\r\n top: 10px;\r\n margin: 0;\r\n padding: 0;\r\n border: none;\r\n border-radius: 50%;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n background: rgba(220, 220, 220, 0.5);\r\n color: white;\r\n font-size: 2rem;\r\n font-weight: bold;\r\n line-height: 1;\r\n text-shadow: black 1px 1px 3px;\r\n overflow: visible;\r\n aspect-ratio: 1 / 1;\r\n z-index: 1;\r\n }\r\n\r\n .hidden {\r\n display: none;\r\n }\r\n`;\r\n"]}