@internetarchive/collection-browser 4.3.1-alpha-webdev8165.0 → 4.3.1-alpha-webdev8257.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 (70) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/app-root.d.ts +8 -0
  4. package/dist/src/app-root.js +698 -672
  5. package/dist/src/app-root.js.map +1 -1
  6. package/dist/src/collection-browser.d.ts +8 -0
  7. package/dist/src/collection-browser.js +779 -762
  8. package/dist/src/collection-browser.js.map +1 -1
  9. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  10. package/dist/src/manage/manage-bar.js +77 -77
  11. package/dist/src/manage/manage-bar.js.map +1 -1
  12. package/dist/src/models.d.ts +6 -0
  13. package/dist/src/models.js +16 -7
  14. package/dist/src/models.js.map +1 -1
  15. package/dist/src/restoration-state-handler.js +3 -1
  16. package/dist/src/restoration-state-handler.js.map +1 -1
  17. package/dist/src/styles/tile-action-styles.d.ts +14 -0
  18. package/dist/src/styles/tile-action-styles.js +52 -0
  19. package/dist/src/styles/tile-action-styles.js.map +1 -0
  20. package/dist/src/tiles/base-tile-component.d.ts +17 -1
  21. package/dist/src/tiles/base-tile-component.js +48 -1
  22. package/dist/src/tiles/base-tile-component.js.map +1 -1
  23. package/dist/src/tiles/grid/item-tile.js +1 -0
  24. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  25. package/dist/src/tiles/list/tile-list-compact-header.js +66 -46
  26. package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
  27. package/dist/src/tiles/list/tile-list-compact.d.ts +1 -1
  28. package/dist/src/tiles/list/tile-list-compact.js +132 -100
  29. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  30. package/dist/src/tiles/list/tile-list.d.ts +1 -1
  31. package/dist/src/tiles/list/tile-list.js +316 -298
  32. package/dist/src/tiles/list/tile-list.js.map +1 -1
  33. package/dist/src/tiles/models.d.ts +14 -0
  34. package/dist/src/tiles/models.js.map +1 -1
  35. package/dist/src/tiles/tile-dispatcher.d.ts +14 -0
  36. package/dist/src/tiles/tile-dispatcher.js +107 -4
  37. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  38. package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
  39. package/dist/test/data-source/collection-browser-data-source.test.js +2 -2
  40. package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -1
  41. package/dist/test/manage/manage-bar.test.js +33 -33
  42. package/dist/test/manage/manage-bar.test.js.map +1 -1
  43. package/dist/test/restoration-state-handler.test.js +0 -70
  44. package/dist/test/restoration-state-handler.test.js.map +1 -1
  45. package/dist/test/tiles/list/tile-list-compact-header.test.js +12 -12
  46. package/dist/test/tiles/list/tile-list-compact-header.test.js.map +1 -1
  47. package/dist/test/tiles/list/tile-list.test.js +134 -134
  48. package/dist/test/tiles/list/tile-list.test.js.map +1 -1
  49. package/index.ts +1 -0
  50. package/package.json +1 -1
  51. package/src/app-root.ts +1281 -1251
  52. package/src/collection-browser.ts +3063 -3049
  53. package/src/data-source/collection-browser-data-source.ts +1465 -1465
  54. package/src/manage/manage-bar.ts +276 -276
  55. package/src/models.ts +895 -879
  56. package/src/restoration-state-handler.ts +550 -546
  57. package/src/styles/tile-action-styles.ts +52 -0
  58. package/src/tiles/base-tile-component.ts +57 -1
  59. package/src/tiles/grid/item-tile.ts +1 -0
  60. package/src/tiles/list/tile-list-compact-header.ts +106 -86
  61. package/src/tiles/list/tile-list-compact.ts +273 -239
  62. package/src/tiles/list/tile-list.ts +718 -700
  63. package/src/tiles/models.ts +16 -0
  64. package/src/tiles/tile-dispatcher.ts +114 -4
  65. package/src/tiles/tile-display-value-provider.ts +134 -134
  66. package/test/data-source/collection-browser-data-source.test.ts +193 -193
  67. package/test/manage/manage-bar.test.ts +347 -347
  68. package/test/restoration-state-handler.test.ts +480 -569
  69. package/test/tiles/list/tile-list-compact-header.test.ts +43 -43
  70. package/test/tiles/list/tile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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwLT,CAAC;IACJ,CAAC;CACF,CAAA;AAhpBC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACS;AAEnB;IAAhB,KAAK,EAAE;iDAAmE;AArBhE,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAmqBpB","sourcesContent":["import { css, html, nothing, PropertyValues, TemplateResult } from 'lit';\r\nimport { ifDefined } from 'lit/directives/if-defined.js';\r\nimport { join } from 'lit/directives/join.js';\r\nimport { map } from 'lit/directives/map.js';\r\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\r\nimport { customElement, property, state } from 'lit/decorators.js';\r\nimport { msg, str } from '@lit/localize';\r\nimport DOMPurify from 'dompurify';\r\n\r\nimport type { SortParam } from '@internetarchive/search-service';\r\nimport { suppressedCollections } from '../../models';\r\nimport type { CollectionTitles } from '../../data-source/models';\r\nimport { BaseTileComponent } from '../base-tile-component';\r\n\r\nimport { formatCount, NumberFormat } from '../../utils/format-count';\r\nimport type { DateFormat } from '../../utils/format-date';\r\nimport { isFirstMillisecondOfUTCYear } from '../../utils/local-date-from-utc';\r\n\r\nimport '../image-block';\r\nimport '../review-block';\r\nimport '../text-snippet-block';\r\nimport '../tile-mediatype-icon';\r\n\r\n@customElement('tile-list')\r\nexport class TileList 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 * - useLocalTime = false;\r\n */\r\n\r\n @property({ type: Object })\r\n collectionTitles?: CollectionTitles;\r\n\r\n @state() private collectionLinks: (TemplateResult | typeof nothing)[] = [];\r\n\r\n render() {\r\n return html`\r\n <div id=\"list-line\" class=\"${this.classSize}\">\r\n ${this.classSize === 'mobile'\r\n ? this.mobileTemplate\r\n : this.desktopTemplate}\r\n </div>\r\n `;\r\n }\r\n\r\n /**\r\n * Templates\r\n */\r\n private get mobileTemplate() {\r\n return html`\r\n <div id=\"list-line-top\">\r\n <div id=\"list-line-left\">${this.imageBlockTemplate}</div>\r\n <div id=\"list-line-right\">\r\n <div id=\"title-line\">\r\n <div id=\"title\">${this.titleTemplate}</div>\r\n ${this.iconRightTemplate}\r\n </div>\r\n </div>\r\n </div>\r\n <div id=\"list-line-bottom\">${this.detailsTemplate}</div>\r\n `;\r\n }\r\n\r\n private get desktopTemplate() {\r\n return html`\r\n <div id=\"list-line-left\">${this.imageBlockTemplate}</div>\r\n <div id=\"list-line-right\">\r\n <div id=\"title-line\">\r\n <div id=\"title\">${this.titleTemplate}</div>\r\n ${this.iconRightTemplate}\r\n </div>\r\n ${this.detailsTemplate}\r\n </div>\r\n `;\r\n }\r\n\r\n private get imageBlockTemplate() {\r\n if (!this.model) return nothing;\r\n\r\n const isCollection = this.model.mediatype === 'collection';\r\n const href = this.displayValueProvider.itemPageUrl(\r\n this.model.identifier,\r\n isCollection,\r\n );\r\n\r\n return html`<a\r\n id=\"image-link\"\r\n title=${msg(str`View ${this.model?.title}`)}\r\n href=${href}\r\n >\r\n <image-block\r\n .model=${this.model}\r\n .baseImageUrl=${this.baseImageUrl}\r\n .isCompactTile=${false}\r\n .isListTile=${true}\r\n .viewSize=${this.classSize}\r\n .loggedIn=${this.loggedIn}\r\n .suppressBlurring=${this.suppressBlurring}\r\n >\r\n </image-block>\r\n </a> `;\r\n }\r\n\r\n private get detailsTemplate() {\r\n return html`\r\n ${this.itemLineTemplate} ${this.creatorTemplate}\r\n <div id=\"dates-line\">\r\n ${this.datePublishedTemplate} ${this.dateSortByTemplate}\r\n ${this.webArchivesCaptureDatesTemplate}\r\n </div>\r\n <div id=\"views-line\">\r\n ${this.viewsTemplate} ${this.ratingTemplate} ${this.reviewsTemplate}\r\n </div>\r\n ${this.topicsTemplate} ${this.collectionsTemplate}\r\n ${this.descriptionTemplate} ${this.textSnippetsTemplate}\r\n ${this.reviewBlockTemplate}\r\n `;\r\n }\r\n\r\n // Data templates\r\n private get iconRightTemplate() {\r\n return html`\r\n <a\r\n id=\"icon-right\"\r\n href=${this.mediatypeURL}\r\n title=${msg(str`See more: ${this.model?.mediatype}`)}\r\n >\r\n <tile-mediatype-icon .model=${this.model}> </tile-mediatype-icon>\r\n </a>\r\n `;\r\n }\r\n\r\n private get titleTemplate() {\r\n if (!this.model?.title) {\r\n return nothing;\r\n }\r\n\r\n // If the model has a server-specified href, use it\r\n // Otherwise construct a details link using the identifier\r\n return this.model?.href\r\n ? html`<a href=\"${this.baseNavigationUrl}${this.model.href}\"\r\n >${this.model.title ?? this.model.identifier}</a\r\n >`\r\n : this.detailsLink(\r\n this.model.identifier,\r\n this.model.title,\r\n this.model.mediatype === 'collection',\r\n );\r\n }\r\n\r\n private get itemLineTemplate() {\r\n const source = this.sourceTemplate;\r\n const volume = this.volumeTemplate;\r\n const issue = this.issueTemplate;\r\n if (!source && !volume && !issue) {\r\n return nothing;\r\n }\r\n return html` <div id=\"item-line\">${source} ${volume} ${issue}</div> `;\r\n }\r\n\r\n private get sourceTemplate() {\r\n if (!this.model?.source) {\r\n return nothing;\r\n }\r\n return html`\r\n <div id=\"source\" class=\"metadata\">\r\n ${this.labelTemplate(msg('Source'))}\r\n ${this.searchLink('source', this.model.source)}\r\n </div>\r\n `;\r\n }\r\n\r\n private get volumeTemplate() {\r\n return this.metadataTemplate(this.model?.volume, msg('Volume'));\r\n }\r\n\r\n private get issueTemplate() {\r\n return this.metadataTemplate(this.model?.issue, msg('Issue'));\r\n }\r\n\r\n private get creatorTemplate() {\r\n // \"Archivist since\" if account\r\n if (this.model?.mediatype === 'account') {\r\n return html`\r\n <div id=\"creator\" class=\"metadata\">\r\n <span class=\"label\"\r\n >${this.displayValueProvider.accountLabel ?? nothing}</span\r\n >\r\n </div>\r\n `;\r\n }\r\n // \"Creator\" if not account tile\r\n if (!this.model?.creators || this.model.creators.length === 0) {\r\n return nothing;\r\n }\r\n return html`\r\n <div id=\"creator\" class=\"metadata\">\r\n ${this.labelTemplate(msg('By'))}\r\n ${join(\r\n map(this.model.creators, id => this.searchLink('creator', id)),\r\n ', ',\r\n )}\r\n </div>\r\n `;\r\n }\r\n\r\n private get datePublishedTemplate() {\r\n // If we're showing a date published of Jan 1 at midnight, only show the year.\r\n // This is because items with only a year for their publication date are normalized to\r\n // Jan 1 at midnight timestamps in the search engine documents.\r\n const date: Date | undefined = this.model?.datePublished;\r\n let format: DateFormat = 'long';\r\n if (isFirstMillisecondOfUTCYear(date)) {\r\n format = 'year-only';\r\n }\r\n\r\n return this.metadataTemplate(\r\n this.getFormattedDate(date, format),\r\n msg('Published'),\r\n );\r\n }\r\n\r\n // Show date label/value when sorted by date type\r\n // Except datePublished which is always shown\r\n private get dateSortByTemplate() {\r\n if (\r\n this.effectiveSort &&\r\n (this.effectiveSort.field === 'addeddate' ||\r\n this.effectiveSort.field === 'reviewdate' ||\r\n this.effectiveSort.field === 'publicdate')\r\n ) {\r\n return this.metadataTemplate(\r\n this.getFormattedDate(this.date, 'long'),\r\n this.displayValueProvider.dateLabel,\r\n );\r\n }\r\n return nothing;\r\n }\r\n\r\n private get viewsTemplate() {\r\n const isWeeklySort = this.effectiveSort?.field === 'week';\r\n const viewCount = isWeeklySort\r\n ? this.model?.weeklyViewCount // weekly views\r\n : this.model?.viewCount; // all-time views\r\n if (viewCount == null) return nothing;\r\n\r\n // when its a search-tile, we don't have any stats to show\r\n if (this.model?.mediatype === 'search') {\r\n return this.metadataTemplate('(Favorited search query)', '');\r\n }\r\n\r\n return this.metadataTemplate(\r\n `${formatCount(viewCount, this.formatSize)}`,\r\n this.displayValueProvider.viewsLabel,\r\n );\r\n }\r\n\r\n private get ratingTemplate() {\r\n return this.metadataTemplate(this.model?.averageRating, msg('Avg Rating'));\r\n }\r\n\r\n private get reviewsTemplate() {\r\n return this.metadataTemplate(this.model?.commentCount, msg('Reviews'));\r\n }\r\n\r\n private get topicsTemplate() {\r\n if (!this.model?.subjects || this.model.subjects.length === 0) {\r\n return nothing;\r\n }\r\n return html`\r\n <div id=\"topics\" class=\"metadata\">\r\n ${this.labelTemplate(msg('Topics'))}\r\n ${join(\r\n map(this.model.subjects, id => this.searchLink('subject', id)),\r\n ', ',\r\n )}\r\n </div>\r\n `;\r\n }\r\n\r\n private get collectionsTemplate() {\r\n if (!this.collectionLinks || this.collectionLinks.length === 0) {\r\n return nothing;\r\n }\r\n return html`\r\n <div id=\"collections\" class=\"metadata\">\r\n ${this.labelTemplate(msg('Collections'))}\r\n ${join(this.collectionLinks, ', ')}\r\n </div>\r\n `;\r\n }\r\n\r\n private get descriptionTemplate() {\r\n return this.metadataTemplate(\r\n // Sanitize away any HTML tags and convert line breaks to spaces.\r\n unsafeHTML(\r\n DOMPurify.sanitize(this.model?.description?.replace(/\\n/g, ' ') ?? ''),\r\n ),\r\n '',\r\n 'description',\r\n );\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=\"list\"\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) return nothing;\r\n\r\n return html`<text-snippet-block\r\n viewsize=\"list\"\r\n .snippets=${this.model?.snippets}\r\n ></text-snippet-block>`;\r\n }\r\n\r\n private get hasSnippets(): boolean {\r\n return !!this.model?.snippets?.length;\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 // Utility functions\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n private metadataTemplate(text: any, label = '', id?: string) {\r\n if (!text) return nothing;\r\n return html`\r\n <div id=${ifDefined(id)} class=\"metadata\">\r\n ${this.labelTemplate(label)} ${text}\r\n </div>\r\n `;\r\n }\r\n\r\n private labelTemplate(label: string) {\r\n return html` ${label\r\n ? html`<span class=\"label\">${label}: </span>`\r\n : nothing}`;\r\n }\r\n\r\n private searchLink(field: string, searchTerm: string) {\r\n if (!field || !searchTerm) {\r\n return nothing;\r\n }\r\n const query = encodeURIComponent(`${field}:\"${searchTerm}\"`);\r\n // No whitespace after closing tag\r\n // Note: single ' for href='' to wrap \" in query var gets changed back by yarn format\r\n return html`<a\r\n href=\"${this.baseNavigationUrl}/search?query=${query}\"\r\n rel=\"nofollow\"\r\n >\r\n ${DOMPurify.sanitize(searchTerm)}</a\r\n >`;\r\n }\r\n\r\n private detailsLink(\r\n identifier?: string,\r\n text?: string,\r\n isCollection = false,\r\n ): TemplateResult | typeof nothing {\r\n if (!identifier) return nothing;\r\n\r\n const linkText = text ?? identifier;\r\n const linkHref = this.displayValueProvider.itemPageUrl(\r\n identifier,\r\n isCollection,\r\n );\r\n\r\n return html`<a href=${linkHref}> ${DOMPurify.sanitize(linkText)} </a>`;\r\n }\r\n\r\n /** The URL of this item's mediatype collection, if defined. */\r\n private get mediatypeURL(): string | typeof nothing {\r\n // NB: baseNavigationUrl can be an empty string\r\n if (this.baseNavigationUrl === undefined || !this.model?.mediatype)\r\n return nothing;\r\n\r\n // Need special handling for certain mediatypes that don't have a top-level collection page\r\n switch (this.model.mediatype) {\r\n case 'collection':\r\n return `${this.baseNavigationUrl}/search?query=mediatype:collection&sort=-downloads`;\r\n case 'account':\r\n return nothing;\r\n default:\r\n return this.displayValueProvider.itemPageUrl(\r\n this.model.mediatype,\r\n true,\r\n );\r\n }\r\n }\r\n\r\n protected updated(changed: PropertyValues): void {\r\n if (changed.has('model') || changed.has('collectionTitles')) {\r\n this.buildCollectionLinks();\r\n }\r\n }\r\n\r\n private async buildCollectionLinks() {\r\n if (!this.model?.collections || this.model.collections.length === 0) {\r\n return;\r\n }\r\n\r\n // Note: quirk of Lit: need to replace collectionLinks array,\r\n // otherwise it will not re-render. Can't simply alter the array.\r\n this.collectionLinks = [];\r\n const newCollectionLinks: (TemplateResult | typeof nothing)[] = [];\r\n for (const collection of this.model.collections) {\r\n // Don't include favorites or collections that are meant to be suppressed\r\n if (\r\n !suppressedCollections[collection] &&\r\n !collection.startsWith('fav-')\r\n ) {\r\n newCollectionLinks.push(\r\n this.detailsLink(\r\n collection,\r\n this.collectionTitles?.get(collection) ?? collection,\r\n true,\r\n ),\r\n );\r\n }\r\n }\r\n this.collectionLinks = newCollectionLinks;\r\n }\r\n\r\n /*\r\n * TODO: fix field names to match model in src/collection-browser.ts\r\n * private get dateSortSelector()\r\n * @see src/models.ts\r\n */\r\n private get date(): Date | undefined {\r\n switch (this.effectiveSort?.field) {\r\n case 'date':\r\n return this.model?.datePublished;\r\n case 'reviewdate':\r\n return this.model?.dateReviewed;\r\n case 'addeddate':\r\n return this.model?.dateAdded;\r\n default:\r\n return this.model?.dateArchived; // publicdate\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 classSize(): string {\r\n if (\r\n this.mobileBreakpoint &&\r\n this.currentWidth &&\r\n this.currentWidth < this.mobileBreakpoint\r\n ) {\r\n return 'mobile';\r\n }\r\n return 'desktop';\r\n }\r\n\r\n private get formatSize(): NumberFormat {\r\n if (\r\n this.mobileBreakpoint &&\r\n this.currentWidth &&\r\n this.currentWidth < this.mobileBreakpoint\r\n ) {\r\n return 'short';\r\n }\r\n return 'long';\r\n }\r\n\r\n static get styles() {\r\n return css`\r\n html {\r\n font-size: unset;\r\n }\r\n\r\n div {\r\n font-size: 14px;\r\n }\r\n\r\n div a {\r\n text-decoration: none;\r\n }\r\n\r\n div a:link {\r\n color: var(--ia-theme-link-color, #4b64ff);\r\n }\r\n\r\n .label {\r\n font-weight: bold;\r\n }\r\n\r\n #list-line.mobile {\r\n --infiniteScrollerRowGap: 20px;\r\n --infiniteScrollerRowHeight: auto;\r\n }\r\n\r\n #list-line.desktop {\r\n --infiniteScrollerRowGap: 30px;\r\n --infiniteScrollerRowHeight: auto;\r\n }\r\n\r\n /* fields */\r\n #icon-right {\r\n width: 20px;\r\n padding-top: 5px;\r\n --iconHeight: 20px;\r\n --iconWidth: 20px;\r\n --iconTextAlign: right;\r\n margin-top: -8px;\r\n text-align: right;\r\n }\r\n\r\n #title {\r\n color: #4b64ff;\r\n text-decoration: none;\r\n font-size: 22px;\r\n font-weight: bold;\r\n /* align top of text with image */\r\n line-height: 25px;\r\n margin-top: -4px;\r\n padding-bottom: 2px;\r\n flex-grow: 1;\r\n\r\n display: -webkit-box;\r\n -webkit-box-orient: vertical;\r\n -webkit-line-clamp: 3;\r\n overflow: hidden;\r\n overflow-wrap: anywhere;\r\n }\r\n\r\n .metadata {\r\n line-height: 20px;\r\n }\r\n\r\n #description,\r\n #creator,\r\n #topics,\r\n #source {\r\n text-align: left;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n -webkit-box-orient: vertical;\r\n display: -webkit-box;\r\n word-break: break-word;\r\n -webkit-line-clamp: 3; /* number of lines to show */\r\n line-clamp: 3;\r\n\r\n /*\r\n * Safari doesn't always respect the line-clamping rules above,\r\n * so we add this to ensure these fields still get truncated\r\n */\r\n max-height: 60px;\r\n }\r\n\r\n #collections {\r\n display: -webkit-box;\r\n -webkit-box-orient: vertical;\r\n -webkit-line-clamp: 3;\r\n overflow: hidden;\r\n overflow-wrap: anywhere;\r\n }\r\n\r\n #collections > a {\r\n display: inline-block;\r\n }\r\n\r\n #icon {\r\n padding-top: 5px;\r\n }\r\n\r\n #description {\r\n padding-top: 10px;\r\n }\r\n\r\n /* Top level container */\r\n #list-line {\r\n display: flex;\r\n }\r\n\r\n #list-line.mobile {\r\n flex-direction: column;\r\n }\r\n\r\n #list-line.desktop {\r\n column-gap: 10px;\r\n }\r\n\r\n #list-line-top {\r\n display: flex;\r\n column-gap: 7px;\r\n }\r\n\r\n #list-line-bottom {\r\n padding-top: 4px;\r\n }\r\n\r\n #list-line-right,\r\n #list-line-top,\r\n #list-line-bottom {\r\n width: 100%;\r\n }\r\n\r\n /*\r\n * If the container becomes very tiny, don't let the thumbnail side take\r\n * up too much space. Shouldn't make a difference on ordinary viewport sizes.\r\n */\r\n #list-line-left {\r\n max-width: 25%;\r\n\r\n display: flex;\r\n flex-direction: column;\r\n row-gap: 5px;\r\n }\r\n\r\n div a:hover {\r\n text-decoration: underline;\r\n }\r\n\r\n /* Lines containing multiple div as row */\r\n #item-line,\r\n #dates-line,\r\n #views-line,\r\n #title-line {\r\n display: flex;\r\n flex-direction: row;\r\n column-gap: 10px;\r\n }\r\n\r\n /*\r\n * With the exception of the title line, allow these to wrap if\r\n * the space becomes too small to accommodate them together.\r\n *\r\n * The title line is excluded because it contains the mediatype icon\r\n * which we don't want to wrap.\r\n */\r\n #item-line,\r\n #dates-line,\r\n #views-line {\r\n flex-wrap: wrap;\r\n }\r\n\r\n .capture-dates {\r\n margin: 0;\r\n padding: 0;\r\n list-style-type: none;\r\n }\r\n\r\n .capture-dates a:link {\r\n text-decoration: none;\r\n color: var(--ia-theme-link-color, #4b64ff);\r\n }\r\n .capture-dates a:hover {\r\n text-decoration: underline;\r\n }\r\n `;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiMF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAhqBC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACS;AAEnB;IAAhB,KAAK,EAAE;iDAAmE;AAtBhE,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAorBpB","sourcesContent":["import { css, html, nothing, PropertyValues, TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { join } from 'lit/directives/join.js';\nimport { map } from 'lit/directives/map.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { msg, str } from '@lit/localize';\nimport DOMPurify from 'dompurify';\n\nimport type { SortParam } from '@internetarchive/search-service';\nimport { suppressedCollections } from '../../models';\nimport type { CollectionTitles } from '../../data-source/models';\nimport { BaseTileComponent } from '../base-tile-component';\n\nimport { formatCount, NumberFormat } from '../../utils/format-count';\nimport type { DateFormat } from '../../utils/format-date';\nimport { isFirstMillisecondOfUTCYear } from '../../utils/local-date-from-utc';\nimport { tileActionStyles } from '../../styles/tile-action-styles';\n\nimport '../image-block';\nimport '../review-block';\nimport '../text-snippet-block';\nimport '../tile-mediatype-icon';\n\n@customElement('tile-list')\nexport class TileList extends BaseTileComponent {\n /*\n * Reactive properties inherited from BaseTileComponent:\n * - model?: TileModel;\n * - tileActions: TileAction[] = [];\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 * - useLocalTime = false;\n */\n\n @property({ type: Object })\n collectionTitles?: CollectionTitles;\n\n @state() private collectionLinks: (TemplateResult | typeof nothing)[] = [];\n\n render() {\n return html`\n <div id=\"list-line\" class=\"${this.classSize}\">\n ${this.classSize === 'mobile'\n ? this.mobileTemplate\n : this.desktopTemplate}\n </div>\n `;\n }\n\n /**\n * Templates\n */\n private get mobileTemplate() {\n return html`\n <div id=\"list-line-top\">\n <div id=\"list-line-left\">\n ${this.imageBlockTemplate} ${this.renderTileActions('list-detail')}\n </div>\n <div id=\"list-line-right\">\n <div id=\"title-line\">\n <div id=\"title\">${this.titleTemplate}</div>\n ${this.iconRightTemplate}\n </div>\n </div>\n </div>\n <div id=\"list-line-bottom\">${this.detailsTemplate}</div>\n `;\n }\n\n private get desktopTemplate() {\n return html`\n <div id=\"list-line-left\">\n ${this.imageBlockTemplate} ${this.renderTileActions('list-detail')}\n </div>\n <div id=\"list-line-right\">\n <div id=\"title-line\">\n <div id=\"title\">${this.titleTemplate}</div>\n ${this.iconRightTemplate}\n </div>\n ${this.detailsTemplate}\n </div>\n `;\n }\n\n private get imageBlockTemplate() {\n if (!this.model) return nothing;\n\n const isCollection = this.model.mediatype === 'collection';\n const href = this.displayValueProvider.itemPageUrl(\n this.model.identifier,\n isCollection,\n );\n\n return html`<a\n id=\"image-link\"\n title=${msg(str`View ${this.model?.title}`)}\n href=${href}\n >\n <image-block\n .model=${this.model}\n .baseImageUrl=${this.baseImageUrl}\n .isCompactTile=${false}\n .isListTile=${true}\n .viewSize=${this.classSize}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n >\n </image-block>\n </a> `;\n }\n\n private get detailsTemplate() {\n return html`\n ${this.itemLineTemplate} ${this.creatorTemplate}\n <div id=\"dates-line\">\n ${this.datePublishedTemplate} ${this.dateSortByTemplate}\n ${this.webArchivesCaptureDatesTemplate}\n </div>\n <div id=\"views-line\">\n ${this.viewsTemplate} ${this.ratingTemplate} ${this.reviewsTemplate}\n </div>\n ${this.topicsTemplate} ${this.collectionsTemplate}\n ${this.descriptionTemplate} ${this.textSnippetsTemplate}\n ${this.reviewBlockTemplate}\n `;\n }\n\n // Data templates\n private get iconRightTemplate() {\n return html`\n <a\n id=\"icon-right\"\n href=${this.mediatypeURL}\n title=${msg(str`See more: ${this.model?.mediatype}`)}\n >\n <tile-mediatype-icon .model=${this.model}> </tile-mediatype-icon>\n </a>\n `;\n }\n\n private get titleTemplate() {\n if (!this.model?.title) {\n return nothing;\n }\n\n // If the model has a server-specified href, use it\n // Otherwise construct a details link using the identifier\n return this.model?.href\n ? html`<a href=\"${this.baseNavigationUrl}${this.model.href}\"\n >${this.model.title ?? this.model.identifier}</a\n >`\n : this.detailsLink(\n this.model.identifier,\n this.model.title,\n this.model.mediatype === 'collection',\n );\n }\n\n private get itemLineTemplate() {\n const source = this.sourceTemplate;\n const volume = this.volumeTemplate;\n const issue = this.issueTemplate;\n if (!source && !volume && !issue) {\n return nothing;\n }\n return html` <div id=\"item-line\">${source} ${volume} ${issue}</div> `;\n }\n\n private get sourceTemplate() {\n if (!this.model?.source) {\n return nothing;\n }\n return html`\n <div id=\"source\" class=\"metadata\">\n ${this.labelTemplate(msg('Source'))}\n ${this.searchLink('source', this.model.source)}\n </div>\n `;\n }\n\n private get volumeTemplate() {\n return this.metadataTemplate(this.model?.volume, msg('Volume'));\n }\n\n private get issueTemplate() {\n return this.metadataTemplate(this.model?.issue, msg('Issue'));\n }\n\n private get creatorTemplate() {\n // \"Archivist since\" if account\n if (this.model?.mediatype === 'account') {\n return html`\n <div id=\"creator\" class=\"metadata\">\n <span class=\"label\"\n >${this.displayValueProvider.accountLabel ?? nothing}</span\n >\n </div>\n `;\n }\n // \"Creator\" if not account tile\n if (!this.model?.creators || this.model.creators.length === 0) {\n return nothing;\n }\n return html`\n <div id=\"creator\" class=\"metadata\">\n ${this.labelTemplate(msg('By'))}\n ${join(\n map(this.model.creators, id => this.searchLink('creator', id)),\n ', ',\n )}\n </div>\n `;\n }\n\n private get datePublishedTemplate() {\n // If we're showing a date published of Jan 1 at midnight, only show the year.\n // This is because items with only a year for their publication date are normalized to\n // Jan 1 at midnight timestamps in the search engine documents.\n const date: Date | undefined = this.model?.datePublished;\n let format: DateFormat = 'long';\n if (isFirstMillisecondOfUTCYear(date)) {\n format = 'year-only';\n }\n\n return this.metadataTemplate(\n this.getFormattedDate(date, format),\n msg('Published'),\n );\n }\n\n // Show date label/value when sorted by date type\n // Except datePublished which is always shown\n private get dateSortByTemplate() {\n if (\n this.effectiveSort &&\n (this.effectiveSort.field === 'addeddate' ||\n this.effectiveSort.field === 'reviewdate' ||\n this.effectiveSort.field === 'publicdate')\n ) {\n return this.metadataTemplate(\n this.getFormattedDate(this.date, 'long'),\n this.displayValueProvider.dateLabel,\n );\n }\n return nothing;\n }\n\n private get viewsTemplate() {\n const isWeeklySort = this.effectiveSort?.field === 'week';\n const viewCount = isWeeklySort\n ? this.model?.weeklyViewCount // weekly views\n : this.model?.viewCount; // all-time views\n if (viewCount == null) return nothing;\n\n // when its a search-tile, we don't have any stats to show\n if (this.model?.mediatype === 'search') {\n return this.metadataTemplate('(Favorited search query)', '');\n }\n\n return this.metadataTemplate(\n `${formatCount(viewCount, this.formatSize)}`,\n this.displayValueProvider.viewsLabel,\n );\n }\n\n private get ratingTemplate() {\n return this.metadataTemplate(this.model?.averageRating, msg('Avg Rating'));\n }\n\n private get reviewsTemplate() {\n return this.metadataTemplate(this.model?.commentCount, msg('Reviews'));\n }\n\n private get topicsTemplate() {\n if (!this.model?.subjects || this.model.subjects.length === 0) {\n return nothing;\n }\n return html`\n <div id=\"topics\" class=\"metadata\">\n ${this.labelTemplate(msg('Topics'))}\n ${join(\n map(this.model.subjects, id => this.searchLink('subject', id)),\n ', ',\n )}\n </div>\n `;\n }\n\n private get collectionsTemplate() {\n if (!this.collectionLinks || this.collectionLinks.length === 0) {\n return nothing;\n }\n return html`\n <div id=\"collections\" class=\"metadata\">\n ${this.labelTemplate(msg('Collections'))}\n ${join(this.collectionLinks, ', ')}\n </div>\n `;\n }\n\n private get descriptionTemplate() {\n return this.metadataTemplate(\n // Sanitize away any HTML tags and convert line breaks to spaces.\n unsafeHTML(\n DOMPurify.sanitize(this.model?.description?.replace(/\\n/g, ' ') ?? ''),\n ),\n '',\n 'description',\n );\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=\"list\"\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) return nothing;\n\n return html`<text-snippet-block\n viewsize=\"list\"\n .snippets=${this.model?.snippets}\n ></text-snippet-block>`;\n }\n\n private get hasSnippets(): boolean {\n return !!this.model?.snippets?.length;\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 // Utility functions\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private metadataTemplate(text: any, label = '', id?: string) {\n if (!text) return nothing;\n return html`\n <div id=${ifDefined(id)} class=\"metadata\">\n ${this.labelTemplate(label)} ${text}\n </div>\n `;\n }\n\n private labelTemplate(label: string) {\n return html` ${label\n ? html`<span class=\"label\">${label}: </span>`\n : nothing}`;\n }\n\n private searchLink(field: string, searchTerm: string) {\n if (!field || !searchTerm) {\n return nothing;\n }\n const query = encodeURIComponent(`${field}:\"${searchTerm}\"`);\n // No whitespace after closing tag\n // Note: single ' for href='' to wrap \" in query var gets changed back by yarn format\n return html`<a\n href=\"${this.baseNavigationUrl}/search?query=${query}\"\n rel=\"nofollow\"\n >\n ${DOMPurify.sanitize(searchTerm)}</a\n >`;\n }\n\n private detailsLink(\n identifier?: string,\n text?: string,\n isCollection = false,\n ): TemplateResult | typeof nothing {\n if (!identifier) return nothing;\n\n const linkText = text ?? identifier;\n const linkHref = this.displayValueProvider.itemPageUrl(\n identifier,\n isCollection,\n );\n\n return html`<a href=${linkHref}> ${DOMPurify.sanitize(linkText)} </a>`;\n }\n\n /** The URL of this item's mediatype collection, if defined. */\n private get mediatypeURL(): string | typeof nothing {\n // NB: baseNavigationUrl can be an empty string\n if (this.baseNavigationUrl === undefined || !this.model?.mediatype)\n return nothing;\n\n // Need special handling for certain mediatypes that don't have a top-level collection page\n switch (this.model.mediatype) {\n case 'collection':\n return `${this.baseNavigationUrl}/search?query=mediatype:collection&sort=-downloads`;\n case 'account':\n return nothing;\n default:\n return this.displayValueProvider.itemPageUrl(\n this.model.mediatype,\n true,\n );\n }\n }\n\n protected updated(changed: PropertyValues): void {\n if (changed.has('model') || changed.has('collectionTitles')) {\n this.buildCollectionLinks();\n }\n }\n\n private async buildCollectionLinks() {\n if (!this.model?.collections || this.model.collections.length === 0) {\n return;\n }\n\n // Note: quirk of Lit: need to replace collectionLinks array,\n // otherwise it will not re-render. Can't simply alter the array.\n this.collectionLinks = [];\n const newCollectionLinks: (TemplateResult | typeof nothing)[] = [];\n for (const collection of this.model.collections) {\n // Don't include favorites or collections that are meant to be suppressed\n if (\n !suppressedCollections[collection] &&\n !collection.startsWith('fav-')\n ) {\n newCollectionLinks.push(\n this.detailsLink(\n collection,\n this.collectionTitles?.get(collection) ?? collection,\n true,\n ),\n );\n }\n }\n this.collectionLinks = newCollectionLinks;\n }\n\n /*\n * TODO: fix field names to match model in src/collection-browser.ts\n * private get dateSortSelector()\n * @see src/models.ts\n */\n private get date(): Date | undefined {\n switch (this.effectiveSort?.field) {\n case 'date':\n return this.model?.datePublished;\n case 'reviewdate':\n return this.model?.dateReviewed;\n case 'addeddate':\n return this.model?.dateAdded;\n default:\n return this.model?.dateArchived; // publicdate\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 classSize(): string {\n if (\n this.mobileBreakpoint &&\n this.currentWidth &&\n this.currentWidth < this.mobileBreakpoint\n ) {\n return 'mobile';\n }\n return 'desktop';\n }\n\n private get formatSize(): NumberFormat {\n if (\n this.mobileBreakpoint &&\n this.currentWidth &&\n this.currentWidth < this.mobileBreakpoint\n ) {\n return 'short';\n }\n return 'long';\n }\n\n static get styles() {\n return [\n tileActionStyles,\n css`\n html {\n font-size: unset;\n }\n\n div {\n font-size: 14px;\n }\n\n div a {\n text-decoration: none;\n }\n\n div a:link {\n color: var(--ia-theme-link-color, #4b64ff);\n }\n\n .label {\n font-weight: bold;\n }\n\n #list-line.mobile {\n --infiniteScrollerRowGap: 20px;\n --infiniteScrollerRowHeight: auto;\n }\n\n #list-line.desktop {\n --infiniteScrollerRowGap: 30px;\n --infiniteScrollerRowHeight: auto;\n }\n\n /* fields */\n #icon-right {\n width: 20px;\n padding-top: 5px;\n --iconHeight: 20px;\n --iconWidth: 20px;\n --iconTextAlign: right;\n margin-top: -8px;\n text-align: right;\n }\n\n #title {\n color: #4b64ff;\n text-decoration: none;\n font-size: 22px;\n font-weight: bold;\n /* align top of text with image */\n line-height: 25px;\n margin-top: -4px;\n padding-bottom: 2px;\n flex-grow: 1;\n\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 3;\n overflow: hidden;\n overflow-wrap: anywhere;\n }\n\n .metadata {\n line-height: 20px;\n }\n\n #description,\n #creator,\n #topics,\n #source {\n text-align: left;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-box-orient: vertical;\n display: -webkit-box;\n word-break: break-word;\n -webkit-line-clamp: 3; /* number of lines to show */\n line-clamp: 3;\n\n /*\n * Safari doesn't always respect the line-clamping rules above,\n * so we add this to ensure these fields still get truncated\n */\n max-height: 60px;\n }\n\n #collections {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 3;\n overflow: hidden;\n overflow-wrap: anywhere;\n }\n\n #collections > a {\n display: inline-block;\n }\n\n #icon {\n padding-top: 5px;\n }\n\n #description {\n padding-top: 10px;\n }\n\n /* Top level container */\n #list-line {\n display: flex;\n }\n\n #list-line.mobile {\n flex-direction: column;\n }\n\n #list-line.desktop {\n column-gap: 10px;\n }\n\n #list-line-top {\n display: flex;\n column-gap: 7px;\n }\n\n #list-line-bottom {\n padding-top: 4px;\n }\n\n #list-line-right,\n #list-line-top,\n #list-line-bottom {\n width: 100%;\n }\n\n /*\n * If the container becomes very tiny, don't let the thumbnail side take\n * up too much space. Shouldn't make a difference on ordinary viewport sizes.\n */\n #list-line-left {\n max-width: 25%;\n\n display: flex;\n flex-direction: column;\n row-gap: 5px;\n }\n\n div a:hover {\n text-decoration: underline;\n }\n\n /* Lines containing multiple div as row */\n #item-line,\n #dates-line,\n #views-line,\n #title-line {\n display: flex;\n flex-direction: row;\n column-gap: 10px;\n }\n\n /*\n * With the exception of the title line, allow these to wrap if\n * the space becomes too small to accommodate them together.\n *\n * The title line is excluded because it contains the mediatype icon\n * which we don't want to wrap.\n */\n #item-line,\n #dates-line,\n #views-line {\n flex-wrap: wrap;\n }\n\n .capture-dates {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n\n .capture-dates a:link {\n text-decoration: none;\n color: var(--ia-theme-link-color, #4b64ff);\n }\n .capture-dates a:hover {\n text-decoration: underline;\n }\n\n /*\n * Tile-list (extended) action row sits under the thumbnail in the left\n * column. The image-block above already has its own bottom padding via\n * the parent's row-gap, so we don't need extra spacing here.\n */\n .tile-actions.list-detail {\n width: 100%;\n }\n `,\n ];\n }\n}\n"]}
@@ -6,3 +6,17 @@
6
6
  * - `minimal`: Show neither tile stats nor the text snippets.
7
7
  */
8
8
  export type LayoutType = 'default' | 'stats-only' | 'snippets-only' | 'minimal';
9
+ /**
10
+ * Describes an action button to render at the bottom of a tile.
11
+ * Styling is controlled via CSS custom properties on the host:
12
+ * - `--tileActionColor` (default: #333)
13
+ * - `--tileActionBg` (default: #fff)
14
+ * - `--tileActionHoverBg` (default: #f0f0f0)
15
+ * - `--tileActionSeparatorColor` (default: #ddd)
16
+ */
17
+ export interface TileAction {
18
+ /** Unique identifier for this action */
19
+ id: string;
20
+ /** Label text displayed on the button */
21
+ label: string;
22
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/tiles/models.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * What type of simplified tile layout to use.\n * - `default`: Do not apply any layout simplifications.\n * - `stats-only`: Only show the tile stats row, but not text snippets.\n * - `snippets-only`: Only show the text snippets row (if snippets exist), but not tile stats.\n * - `minimal`: Show neither tile stats nor the text snippets.\n */\nexport type LayoutType = 'default' | 'stats-only' | 'snippets-only' | 'minimal';\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/tiles/models.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * What type of simplified tile layout to use.\n * - `default`: Do not apply any layout simplifications.\n * - `stats-only`: Only show the tile stats row, but not text snippets.\n * - `snippets-only`: Only show the text snippets row (if snippets exist), but not tile stats.\n * - `minimal`: Show neither tile stats nor the text snippets.\n */\nexport type LayoutType = 'default' | 'stats-only' | 'snippets-only' | 'minimal';\n\n/**\n * Describes an action button to render at the bottom of a tile.\n * Styling is controlled via CSS custom properties on the host:\n * - `--tileActionColor` (default: #333)\n * - `--tileActionBg` (default: #fff)\n * - `--tileActionHoverBg` (default: #f0f0f0)\n * - `--tileActionSeparatorColor` (default: #ddd)\n */\nexport interface TileAction {\n /** Unique identifier for this action */\n id: string;\n\n /** Label text displayed on the button */\n label: string;\n}\n"]}
@@ -72,6 +72,20 @@ export declare class TileDispatcher extends BaseTileComponent implements SharedR
72
72
  */
73
73
  private handleLinkContextMenu;
74
74
  private tileInfoButtonPressed;
75
+ /** Whether tile action buttons should be rendered in grid mode */
76
+ private get showGridTileActions();
77
+ /**
78
+ * Template for the grid-mode action buttons. Rendered alongside the inner
79
+ * tile link inside the dispatcher's shadow root so the action buttons can
80
+ * suppress the hover pane on hover.
81
+ */
82
+ private get gridTileActionsTemplate();
83
+ /**
84
+ * When the mouse enters the grid-mode tile actions area, dispatch a
85
+ * synthetic mouseleave on the host to cancel the hover pane's show timer
86
+ * and hide any visible pane.
87
+ */
88
+ private handleGridActionsMouseEnter;
75
89
  private get tile();
76
90
  static get styles(): import("lit").CSSResult[];
77
91
  }
@@ -2,6 +2,7 @@ var TileDispatcher_1;
2
2
  import { __decorate } from "tslib";
3
3
  import { css, html, nothing } from 'lit';
4
4
  import { customElement, property, query } from 'lit/decorators.js';
5
+ import { classMap } from 'lit/directives/class-map.js';
5
6
  import { ifDefined } from 'lit/directives/if-defined.js';
6
7
  import { msg } from '@lit/localize';
7
8
  import './grid/collection-tile';
@@ -15,11 +16,13 @@ import './list/tile-list-compact-header';
15
16
  import { BaseTileComponent } from './base-tile-component';
16
17
  import { HoverPaneController, } from './hover/hover-pane-controller';
17
18
  import { srOnlyStyle } from '../styles/sr-only';
19
+ import { tileActionStyles } from '../styles/tile-action-styles';
18
20
  let TileDispatcher = class TileDispatcher extends BaseTileComponent {
19
21
  constructor() {
20
22
  /*
21
23
  * Reactive properties inherited from BaseTileComponent:
22
24
  * - model?: TileModel;
25
+ * - tileActions: TileAction[] = [];
23
26
  * - currentWidth?: number;
24
27
  * - currentHeight?: number;
25
28
  * - baseNavigationUrl?: string;
@@ -41,6 +44,14 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
41
44
  /** Whether this tile should include a hover pane at all (for applicable tile modes) */
42
45
  this.enableHoverPane = false;
43
46
  this.manageCheckTitle = msg('Remove this item from the list');
47
+ /**
48
+ * When the mouse enters the grid-mode tile actions area, dispatch a
49
+ * synthetic mouseleave on the host to cancel the hover pane's show timer
50
+ * and hide any visible pane.
51
+ */
52
+ this.handleGridActionsMouseEnter = () => {
53
+ this.dispatchEvent(new MouseEvent('mouseleave', { bubbles: false }));
54
+ };
44
55
  }
45
56
  static { TileDispatcher_1 = this; }
46
57
  acquireFocus() {
@@ -58,13 +69,19 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
58
69
  }; }
59
70
  render() {
60
71
  const isGridMode = this.tileDisplayMode === 'grid';
72
+ const hasTileActions = isGridMode && this.showGridTileActions;
61
73
  const hoverPaneTemplate = this.hoverPaneController?.getTemplate() ?? nothing;
74
+ const containerClasses = classMap({
75
+ hoverable: isGridMode,
76
+ 'has-tile-actions': hasTileActions,
77
+ });
62
78
  return html `
63
- <div id="container" class=${isGridMode ? 'hoverable' : ''}>
79
+ <div id="container" class=${containerClasses}>
64
80
  ${this.tileDisplayMode === 'list-header'
65
81
  ? this.headerTemplate
66
82
  : this.tileTemplate}
67
- ${this.manageCheckTemplate} ${hoverPaneTemplate}
83
+ ${this.gridTileActionsTemplate} ${this.manageCheckTemplate}
84
+ ${hoverPaneTemplate}
68
85
  </div>
69
86
  `;
70
87
  }
@@ -84,6 +101,7 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
84
101
  .currentWidth=${currentWidth}
85
102
  .sortParam=${sortParam ?? defaultSortParam}
86
103
  .mobileBreakpoint=${mobileBreakpoint}
104
+ .tileActions=${this.tileActions}
87
105
  >
88
106
  </tile-list-compact-header>
89
107
  `;
@@ -226,6 +244,37 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
226
244
  enableTouchBackdrop: true,
227
245
  });
228
246
  }
247
+ /** Whether tile action buttons should be rendered in grid mode */
248
+ get showGridTileActions() {
249
+ return (this.tileActions.length > 0 &&
250
+ !this.isManageView &&
251
+ this.tileDisplayMode === 'grid');
252
+ }
253
+ /**
254
+ * Template for the grid-mode action buttons. Rendered alongside the inner
255
+ * tile link inside the dispatcher's shadow root so the action buttons can
256
+ * suppress the hover pane on hover.
257
+ */
258
+ get gridTileActionsTemplate() {
259
+ if (!this.showGridTileActions)
260
+ return nothing;
261
+ return html `
262
+ <div
263
+ class="tile-actions grid-tile-actions"
264
+ @mouseenter=${this.handleGridActionsMouseEnter}
265
+ @mousemove=${(e) => e.stopPropagation()}
266
+ >
267
+ ${this.tileActions.map(action => html `
268
+ <button
269
+ class="tile-action-btn"
270
+ @click=${(e) => this.handleTileActionClick(e, action)}
271
+ >
272
+ ${action.label}
273
+ </button>
274
+ `)}
275
+ </div>
276
+ `;
277
+ }
229
278
  get tile() {
230
279
  const { model, collectionPagePath, baseNavigationUrl, currentWidth, currentHeight, sortParam, creatorFilter, mobileBreakpoint, defaultSortParam, } = this;
231
280
  if (!model)
@@ -311,6 +360,7 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
311
360
  .baseImageUrl=${this.baseImageUrl}
312
361
  .loggedIn=${this.loggedIn}
313
362
  .suppressBlurring=${this.suppressBlurring}
363
+ .tileActions=${this.isManageView ? [] : this.tileActions}
314
364
  ?useLocalTime=${this.useLocalTime}
315
365
  >
316
366
  </tile-list-compact>`;
@@ -329,6 +379,7 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
329
379
  .baseImageUrl=${this.baseImageUrl}
330
380
  .loggedIn=${this.loggedIn}
331
381
  .suppressBlurring=${this.suppressBlurring}
382
+ .tileActions=${this.isManageView ? [] : this.tileActions}
332
383
  ?useLocalTime=${this.useLocalTime}
333
384
  >
334
385
  </tile-list>`;
@@ -339,6 +390,7 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
339
390
  static get styles() {
340
391
  return [
341
392
  srOnlyStyle,
393
+ tileActionStyles,
342
394
  css `
343
395
  :host {
344
396
  display: block;
@@ -374,8 +426,45 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
374
426
  border-radius: 4px;
375
427
  }
376
428
 
377
- #container.hoverable a:focus,
378
- #container.hoverable a:hover {
429
+ /*
430
+ * When tile actions are present, the container takes on the role of
431
+ * the tile's visual card so the tile content and action row appear
432
+ * as a single unified element. The inner tile's own shadow/radius
433
+ * are disabled via CSS variable overrides to avoid visual
434
+ * duplication, and the action row sits as a footer inside the same
435
+ * card.
436
+ */
437
+ #container.has-tile-actions {
438
+ display: flex;
439
+ flex-direction: column;
440
+ overflow: hidden;
441
+ box-shadow: var(--tileShadow, 1px 1px 2px 0);
442
+ --tileBoxShadow: none;
443
+ --tileCornerRadius: 0;
444
+ }
445
+
446
+ #container.has-tile-actions .tile-link {
447
+ flex: 1;
448
+ min-height: 0;
449
+ overflow: hidden;
450
+ border-radius: 0;
451
+ }
452
+
453
+ /* Normal hover shadow lives on the inner anchor for plain tiles */
454
+ #container.hoverable:not(.has-tile-actions) a:focus,
455
+ #container.hoverable:not(.has-tile-actions) a:hover {
456
+ box-shadow: var(
457
+ --tileHoverBoxShadow,
458
+ 0 0 6px 2px rgba(8, 8, 32, 0.8)
459
+ );
460
+ transition: box-shadow 0.1s ease;
461
+ }
462
+
463
+ /*
464
+ * When the container owns the card visuals, the hover shadow needs
465
+ * to move up to the container so it wraps the action row too.
466
+ */
467
+ #container.hoverable.has-tile-actions:hover {
379
468
  box-shadow: var(
380
469
  --tileHoverBoxShadow,
381
470
  0 0 6px 2px rgba(8, 8, 32, 0.8)
@@ -429,6 +518,20 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
429
518
  left: -9999px;
430
519
  z-index: 2;
431
520
  }
521
+
522
+ /*
523
+ * Grid-mode action row sits flush against the bottom of the card —
524
+ * the buttons' own borders form the visible bottom edge. The outer
525
+ * buttons get rounded bottom corners to match the container so the
526
+ * red border traces cleanly around the card's bottom corners.
527
+ */
528
+ .grid-tile-actions .tile-action-btn:first-child {
529
+ border-bottom-left-radius: 4px;
530
+ }
531
+
532
+ .grid-tile-actions .tile-action-btn:last-child {
533
+ border-bottom-right-radius: 4px;
534
+ }
432
535
  `,
433
536
  ];
434
537
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tile-dispatcher.js","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,MAAM,EAAE,CAAC;kDAAoC;AAGlC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uDAAyB;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAEzB;AAKM;IADP,KAAK,CAAC,YAAY,CAAC;iDACe;AAG3B;IADP,KAAK,CAAC,iBAAiB,CAAC;iDACS;AAG1B;IADP,KAAK,CAAC,YAAY,CAAC;uDACwB;AArDjC,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAgf1B","sourcesContent":["import { css, html, nothing, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { msg } from '@lit/localize';\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { TileDisplayMode } from '../models';\nimport type { CollectionTitles } from '../data-source/models';\nimport './grid/collection-tile';\nimport './grid/item-tile';\nimport './grid/account-tile';\nimport './grid/search-tile';\nimport './hover/tile-hover-pane';\nimport './list/tile-list';\nimport './list/tile-list-compact';\nimport './list/tile-list-compact-header';\nimport type { TileHoverPane } from './hover/tile-hover-pane';\nimport { BaseTileComponent } from './base-tile-component';\nimport { LayoutType } from './models';\nimport {\n HoverPaneController,\n HoverPaneControllerInterface,\n HoverPaneProperties,\n HoverPaneProviderInterface,\n} from './hover/hover-pane-controller';\nimport { srOnlyStyle } from '../styles/sr-only';\n\n@customElement('tile-dispatcher')\nexport class TileDispatcher\n extends BaseTileComponent\n implements\n SharedResizeObserverResizeHandlerInterface,\n HoverPaneProviderInterface\n{\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 * - suppressTileBlurring = false;\n * - useLocalTime = false;\n */\n\n @property({ type: String }) tileDisplayMode?: TileDisplayMode;\n\n @property({ type: Boolean }) isManageView = false;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object })\n collectionTitles?: CollectionTitles;\n\n @property({ type: Boolean }) showTvClips = false;\n\n /** What type of simplified layout to use in grid mode, if any */\n @property({ type: String }) layoutType: LayoutType = 'default';\n\n /** Whether this tile should include a hover pane at all (for applicable tile modes) */\n @property({ type: Boolean }) enableHoverPane = false;\n\n @property({ type: String }) manageCheckTitle = msg(\n 'Remove this item from the list',\n );\n\n private hoverPaneController?: HoverPaneControllerInterface;\n\n @query('#container')\n private container!: HTMLDivElement;\n\n @query('tile-hover-pane')\n private hoverPane?: TileHoverPane;\n\n @query('.tile-link')\n private tileLinkElement?: HTMLAnchorElement;\n\n acquireFocus(): void {\n this.tileLinkElement?.focus();\n }\n\n releaseFocus(): void {\n this.tileLinkElement?.blur();\n }\n\n /** Maps each display mode to whether hover panes should appear in that mode */\n private static readonly HOVER_PANE_DISPLAY_MODES: Record<\n TileDisplayMode,\n boolean\n > = {\n grid: true,\n 'list-compact': true,\n 'list-detail': false,\n 'list-header': false,\n };\n\n render() {\n const isGridMode = this.tileDisplayMode === 'grid';\n const hoverPaneTemplate =\n this.hoverPaneController?.getTemplate() ?? nothing;\n return html`\n <div id=\"container\" class=${isGridMode ? 'hoverable' : ''}>\n ${this.tileDisplayMode === 'list-header'\n ? this.headerTemplate\n : this.tileTemplate}\n ${this.manageCheckTemplate} ${hoverPaneTemplate}\n </div>\n `;\n }\n\n protected firstUpdated(): void {\n if (this.shouldPrepareHoverPane) {\n this.hoverPaneController = new HoverPaneController(this, {\n mobileBreakpoint: this.mobileBreakpoint,\n enableLongPress: false,\n });\n }\n }\n\n private get headerTemplate() {\n const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } =\n this;\n return html`\n <tile-list-compact-header\n class=\"header\"\n .currentWidth=${currentWidth}\n .sortParam=${sortParam ?? defaultSortParam}\n .mobileBreakpoint=${mobileBreakpoint}\n >\n </tile-list-compact-header>\n `;\n }\n\n private get tileTemplate() {\n return html`\n ${this.tileDisplayMode === 'list-detail'\n ? this.tile\n : this.linkTileTemplate}\n `;\n }\n\n private get linkTileTemplate() {\n return html`\n <a\n href=${this.linkTileHref}\n aria-label=${this.model?.title ?? 'Untitled item'}\n aria-describedby=\"link-aria-description\"\n aria-haspopup=${this.shouldPrepareHoverPane ? 'dialog' : 'false'}\n title=${this.shouldPrepareHoverPane\n ? nothing // Don't show title tooltips when we have the tile info popups\n : ifDefined(this.model?.title)}\n @click=${this.handleLinkClicked}\n @contextmenu=${this.handleLinkContextMenu}\n class=\"tile-link\"\n >\n ${this.tile}\n </a>\n <div id=\"link-aria-description\" class=\"sr-only\">\n ${msg('Press Down Arrow to preview item details')}\n </div>\n `;\n }\n\n private get linkTileHref(): string | typeof nothing {\n if (!this.model?.identifier || this.baseNavigationUrl == null)\n return nothing;\n\n // Use the server-specified href if available.\n // Otherwise, construct a details page URL from the item identifier.\n if (this.model.href) {\n return `${this.baseNavigationUrl}${this.model.href}`;\n }\n\n return this.displayValueProvider.itemPageUrl(\n this.model.identifier,\n this.model.mediatype === 'collection',\n );\n }\n\n private get manageCheckTemplate() {\n if (!this.isManageView || this.tileDisplayMode !== 'grid') return nothing;\n\n return html`\n <div class=\"manage-check\">\n <input\n type=\"checkbox\"\n title=${this.manageCheckTitle}\n ?checked=${this.model?.checked}\n @change=${this.handleLinkClicked}\n />\n </div>\n `;\n }\n\n /**\n * Whether hover pane behavior should be prepared for this tile\n * (e.g., whether mouse listeners should be attached, etc.)\n */\n private get shouldPrepareHoverPane(): boolean {\n return (\n this.enableHoverPane &&\n !!this.tileDisplayMode &&\n TileDispatcher.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode] &&\n this.model?.mediatype !== 'search' && // don't show hover panes on search tiles\n !this.model?.captureDates // don't show hover panes on web archive tiles\n );\n }\n\n private get isHoverEnabled(): boolean {\n return window.matchMedia('(hover: hover)').matches;\n }\n\n /**\n * Whether the info button should be shown on this tile.\n * Only shown on touch/non-hover devices where a hover pane is available,\n * so the button always has something to toggle.\n */\n private get shouldShowInfoButton(): boolean {\n return !this.isHoverEnabled && this.shouldPrepareHoverPane;\n }\n\n /** @inheritdoc */\n getHoverPane(): TileHoverPane | undefined {\n return this.hoverPane;\n }\n\n /** @inheritdoc */\n getHoverPaneProps(): HoverPaneProperties {\n return this;\n }\n\n handleResize(entry: ResizeObserverEntry): void {\n this.currentWidth = entry.contentRect.width;\n this.currentHeight = entry.contentRect.height;\n }\n\n disconnectedCallback(): void {\n this.stopResizeObservation(this.resizeObserver);\n }\n\n private stopResizeObservation(observer?: SharedResizeObserverInterface) {\n observer?.removeObserver({\n handler: this,\n target: this.container,\n });\n }\n\n private startResizeObservation() {\n this.stopResizeObservation(this.resizeObserver);\n this.resizeObserver?.addObserver({\n handler: this,\n target: this.container,\n });\n }\n\n updated(props: PropertyValues) {\n if (props.has('resizeObserver')) {\n const previousObserver = props.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.stopResizeObservation(previousObserver);\n this.startResizeObservation();\n }\n }\n\n /**\n * Handler for when the tile link is left-clicked. Emits the `resultSelected` event.\n * In manage view, it also checks/unchecks the tile.\n */\n private handleLinkClicked(e: Event): void {\n if (this.isManageView) {\n e.preventDefault();\n if (this.model) this.model.checked = !this.model.checked;\n }\n\n this.dispatchEvent(\n new CustomEvent('resultSelected', { detail: this.model }),\n );\n }\n\n /**\n * Handler for when the tile link is right-clicked.\n * In manage view, it opens the item in a new tab. Otherwise, does nothing.\n */\n private handleLinkContextMenu(e: Event): void {\n if (this.isManageView && this.linkTileHref !== nothing) {\n e.preventDefault();\n window.open(this.linkTileHref, '_blank');\n }\n }\n\n private tileInfoButtonPressed(\n e: CustomEvent<{ x: number; y: number }>,\n ): void {\n this.hoverPaneController?.toggleHoverPane({\n coords: e.detail,\n enableTouchBackdrop: true,\n });\n }\n\n private get tile() {\n const {\n model,\n collectionPagePath,\n baseNavigationUrl,\n currentWidth,\n currentHeight,\n sortParam,\n creatorFilter,\n mobileBreakpoint,\n defaultSortParam,\n } = this;\n\n if (!model) return nothing;\n\n switch (this.tileDisplayMode) {\n case 'grid':\n switch (model.mediatype) {\n case 'collection':\n return html`<collection-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .layoutType=${this.layoutType}\n ?showInfoButton=${this.shouldShowInfoButton}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </collection-tile>`;\n case 'account':\n return html`<account-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${this.shouldShowInfoButton}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </account-tile>`;\n case 'search':\n return html`<search-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${false}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </search-tile>`;\n default:\n return html`<item-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${this.currentWidth}\n .currentHeight=${this.currentHeight}\n .baseImageUrl=${this.baseImageUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .layoutType=${this.layoutType}\n ?showTvClips=${this.showTvClips}\n ?showInfoButton=${this.shouldShowInfoButton}\n ?useLocalTime=${this.useLocalTime}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </item-tile>`;\n }\n case 'list-compact':\n return html`<tile-list-compact\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list-compact>`;\n case 'list-detail':\n return html`<tile-list\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .collectionTitles=${this.collectionTitles}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list>`;\n default:\n return nothing;\n }\n }\n\n static get styles() {\n return [\n srOnlyStyle,\n css`\n :host {\n display: block;\n height: 100%;\n }\n\n collection-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n }\n\n account-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #fcf5e6;\n }\n\n item-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #f1f1f4;\n }\n\n search-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n --iconFillColor: #2c2c2c;\n }\n\n #container {\n position: relative;\n height: 100%;\n border-radius: 4px;\n }\n\n #container.hoverable a:focus,\n #container.hoverable a:hover {\n box-shadow: var(\n --tileHoverBoxShadow,\n 0 0 6px 2px rgba(8, 8, 32, 0.8)\n );\n transition: box-shadow 0.1s ease;\n }\n\n a {\n display: block;\n height: 100%;\n color: unset;\n text-decoration: none;\n transition: transform 0.05s ease;\n border-radius: 4px;\n outline: none;\n }\n\n a :first-child {\n display: block;\n height: 100%;\n }\n\n .manage-check {\n position: absolute;\n right: 0;\n top: 0;\n border: 5px solid #2c2c2c;\n border-radius: 3px;\n background-color: #2c2c2c;\n z-index: 1;\n }\n\n .manage-check > input[type='checkbox'] {\n display: block;\n margin: 0;\n }\n\n #touch-backdrop {\n position: fixed;\n width: 100vw;\n height: 100vh;\n top: 0;\n left: 0;\n z-index: 2;\n background: transparent;\n }\n\n tile-hover-pane {\n position: absolute;\n top: 0;\n left: -9999px;\n z-index: 2;\n }\n `,\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"tile-dispatcher.js","sourceRoot":"","sources":["../../../src/tiles/tile-dispatcher.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAOpC,OAAO,wBAAwB,CAAC;AAChC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,yBAAyB,CAAC;AACjC,OAAO,kBAAkB,CAA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Values } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { msg } from '@lit/localize';\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { TileDisplayMode } from '../models';\nimport type { CollectionTitles } from '../data-source/models';\nimport './grid/collection-tile';\nimport './grid/item-tile';\nimport './grid/account-tile';\nimport './grid/search-tile';\nimport './hover/tile-hover-pane';\nimport './list/tile-list';\nimport './list/tile-list-compact';\nimport './list/tile-list-compact-header';\nimport type { TileHoverPane } from './hover/tile-hover-pane';\nimport { BaseTileComponent } from './base-tile-component';\nimport { LayoutType } from './models';\nimport {\n HoverPaneController,\n HoverPaneControllerInterface,\n HoverPaneProperties,\n HoverPaneProviderInterface,\n} from './hover/hover-pane-controller';\nimport { srOnlyStyle } from '../styles/sr-only';\nimport { tileActionStyles } from '../styles/tile-action-styles';\n\n@customElement('tile-dispatcher')\nexport class TileDispatcher\n extends BaseTileComponent\n implements\n SharedResizeObserverResizeHandlerInterface,\n HoverPaneProviderInterface\n{\n /*\n * Reactive properties inherited from BaseTileComponent:\n * - model?: TileModel;\n * - tileActions: TileAction[] = [];\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 * - suppressTileBlurring = false;\n * - useLocalTime = false;\n */\n\n @property({ type: String }) tileDisplayMode?: TileDisplayMode;\n\n @property({ type: Boolean }) isManageView = false;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object })\n collectionTitles?: CollectionTitles;\n\n @property({ type: Boolean }) showTvClips = false;\n\n /** What type of simplified layout to use in grid mode, if any */\n @property({ type: String }) layoutType: LayoutType = 'default';\n\n /** Whether this tile should include a hover pane at all (for applicable tile modes) */\n @property({ type: Boolean }) enableHoverPane = false;\n\n @property({ type: String }) manageCheckTitle = msg(\n 'Remove this item from the list',\n );\n\n private hoverPaneController?: HoverPaneControllerInterface;\n\n @query('#container')\n private container!: HTMLDivElement;\n\n @query('tile-hover-pane')\n private hoverPane?: TileHoverPane;\n\n @query('.tile-link')\n private tileLinkElement?: HTMLAnchorElement;\n\n acquireFocus(): void {\n this.tileLinkElement?.focus();\n }\n\n releaseFocus(): void {\n this.tileLinkElement?.blur();\n }\n\n /** Maps each display mode to whether hover panes should appear in that mode */\n private static readonly HOVER_PANE_DISPLAY_MODES: Record<\n TileDisplayMode,\n boolean\n > = {\n grid: true,\n 'list-compact': true,\n 'list-detail': false,\n 'list-header': false,\n };\n\n render() {\n const isGridMode = this.tileDisplayMode === 'grid';\n const hasTileActions = isGridMode && this.showGridTileActions;\n const hoverPaneTemplate =\n this.hoverPaneController?.getTemplate() ?? nothing;\n const containerClasses = classMap({\n hoverable: isGridMode,\n 'has-tile-actions': hasTileActions,\n });\n return html`\n <div id=\"container\" class=${containerClasses}>\n ${this.tileDisplayMode === 'list-header'\n ? this.headerTemplate\n : this.tileTemplate}\n ${this.gridTileActionsTemplate} ${this.manageCheckTemplate}\n ${hoverPaneTemplate}\n </div>\n `;\n }\n\n protected firstUpdated(): void {\n if (this.shouldPrepareHoverPane) {\n this.hoverPaneController = new HoverPaneController(this, {\n mobileBreakpoint: this.mobileBreakpoint,\n enableLongPress: false,\n });\n }\n }\n\n private get headerTemplate() {\n const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } =\n this;\n return html`\n <tile-list-compact-header\n class=\"header\"\n .currentWidth=${currentWidth}\n .sortParam=${sortParam ?? defaultSortParam}\n .mobileBreakpoint=${mobileBreakpoint}\n .tileActions=${this.tileActions}\n >\n </tile-list-compact-header>\n `;\n }\n\n private get tileTemplate() {\n return html`\n ${this.tileDisplayMode === 'list-detail'\n ? this.tile\n : this.linkTileTemplate}\n `;\n }\n\n private get linkTileTemplate() {\n return html`\n <a\n href=${this.linkTileHref}\n aria-label=${this.model?.title ?? 'Untitled item'}\n aria-describedby=\"link-aria-description\"\n aria-haspopup=${this.shouldPrepareHoverPane ? 'dialog' : 'false'}\n title=${this.shouldPrepareHoverPane\n ? nothing // Don't show title tooltips when we have the tile info popups\n : ifDefined(this.model?.title)}\n @click=${this.handleLinkClicked}\n @contextmenu=${this.handleLinkContextMenu}\n class=\"tile-link\"\n >\n ${this.tile}\n </a>\n <div id=\"link-aria-description\" class=\"sr-only\">\n ${msg('Press Down Arrow to preview item details')}\n </div>\n `;\n }\n\n private get linkTileHref(): string | typeof nothing {\n if (!this.model?.identifier || this.baseNavigationUrl == null)\n return nothing;\n\n // Use the server-specified href if available.\n // Otherwise, construct a details page URL from the item identifier.\n if (this.model.href) {\n return `${this.baseNavigationUrl}${this.model.href}`;\n }\n\n return this.displayValueProvider.itemPageUrl(\n this.model.identifier,\n this.model.mediatype === 'collection',\n );\n }\n\n private get manageCheckTemplate() {\n if (!this.isManageView || this.tileDisplayMode !== 'grid') return nothing;\n\n return html`\n <div class=\"manage-check\">\n <input\n type=\"checkbox\"\n title=${this.manageCheckTitle}\n ?checked=${this.model?.checked}\n @change=${this.handleLinkClicked}\n />\n </div>\n `;\n }\n\n /**\n * Whether hover pane behavior should be prepared for this tile\n * (e.g., whether mouse listeners should be attached, etc.)\n */\n private get shouldPrepareHoverPane(): boolean {\n return (\n this.enableHoverPane &&\n !!this.tileDisplayMode &&\n TileDispatcher.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode] &&\n this.model?.mediatype !== 'search' && // don't show hover panes on search tiles\n !this.model?.captureDates // don't show hover panes on web archive tiles\n );\n }\n\n private get isHoverEnabled(): boolean {\n return window.matchMedia('(hover: hover)').matches;\n }\n\n /**\n * Whether the info button should be shown on this tile.\n * Only shown on touch/non-hover devices where a hover pane is available,\n * so the button always has something to toggle.\n */\n private get shouldShowInfoButton(): boolean {\n return !this.isHoverEnabled && this.shouldPrepareHoverPane;\n }\n\n /** @inheritdoc */\n getHoverPane(): TileHoverPane | undefined {\n return this.hoverPane;\n }\n\n /** @inheritdoc */\n getHoverPaneProps(): HoverPaneProperties {\n return this;\n }\n\n handleResize(entry: ResizeObserverEntry): void {\n this.currentWidth = entry.contentRect.width;\n this.currentHeight = entry.contentRect.height;\n }\n\n disconnectedCallback(): void {\n this.stopResizeObservation(this.resizeObserver);\n }\n\n private stopResizeObservation(observer?: SharedResizeObserverInterface) {\n observer?.removeObserver({\n handler: this,\n target: this.container,\n });\n }\n\n private startResizeObservation() {\n this.stopResizeObservation(this.resizeObserver);\n this.resizeObserver?.addObserver({\n handler: this,\n target: this.container,\n });\n }\n\n updated(props: PropertyValues) {\n if (props.has('resizeObserver')) {\n const previousObserver = props.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.stopResizeObservation(previousObserver);\n this.startResizeObservation();\n }\n }\n\n /**\n * Handler for when the tile link is left-clicked. Emits the `resultSelected` event.\n * In manage view, it also checks/unchecks the tile.\n */\n private handleLinkClicked(e: Event): void {\n if (this.isManageView) {\n e.preventDefault();\n if (this.model) this.model.checked = !this.model.checked;\n }\n\n this.dispatchEvent(\n new CustomEvent('resultSelected', { detail: this.model }),\n );\n }\n\n /**\n * Handler for when the tile link is right-clicked.\n * In manage view, it opens the item in a new tab. Otherwise, does nothing.\n */\n private handleLinkContextMenu(e: Event): void {\n if (this.isManageView && this.linkTileHref !== nothing) {\n e.preventDefault();\n window.open(this.linkTileHref, '_blank');\n }\n }\n\n private tileInfoButtonPressed(\n e: CustomEvent<{ x: number; y: number }>,\n ): void {\n this.hoverPaneController?.toggleHoverPane({\n coords: e.detail,\n enableTouchBackdrop: true,\n });\n }\n\n /** Whether tile action buttons should be rendered in grid mode */\n private get showGridTileActions(): boolean {\n return (\n this.tileActions.length > 0 &&\n !this.isManageView &&\n this.tileDisplayMode === 'grid'\n );\n }\n\n /**\n * Template for the grid-mode action buttons. Rendered alongside the inner\n * tile link inside the dispatcher's shadow root so the action buttons can\n * suppress the hover pane on hover.\n */\n private get gridTileActionsTemplate() {\n if (!this.showGridTileActions) return nothing;\n\n return html`\n <div\n class=\"tile-actions grid-tile-actions\"\n @mouseenter=${this.handleGridActionsMouseEnter}\n @mousemove=${(e: Event) => e.stopPropagation()}\n >\n ${this.tileActions.map(\n action => html`\n <button\n class=\"tile-action-btn\"\n @click=${(e: Event) => this.handleTileActionClick(e, action)}\n >\n ${action.label}\n </button>\n `,\n )}\n </div>\n `;\n }\n\n /**\n * When the mouse enters the grid-mode tile actions area, dispatch a\n * synthetic mouseleave on the host to cancel the hover pane's show timer\n * and hide any visible pane.\n */\n private handleGridActionsMouseEnter = (): void => {\n this.dispatchEvent(new MouseEvent('mouseleave', { bubbles: false }));\n };\n\n private get tile() {\n const {\n model,\n collectionPagePath,\n baseNavigationUrl,\n currentWidth,\n currentHeight,\n sortParam,\n creatorFilter,\n mobileBreakpoint,\n defaultSortParam,\n } = this;\n\n if (!model) return nothing;\n\n switch (this.tileDisplayMode) {\n case 'grid':\n switch (model.mediatype) {\n case 'collection':\n return html`<collection-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .layoutType=${this.layoutType}\n ?showInfoButton=${this.shouldShowInfoButton}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </collection-tile>`;\n case 'account':\n return html`<account-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${this.shouldShowInfoButton}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </account-tile>`;\n case 'search':\n return html`<search-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${false}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </search-tile>`;\n default:\n return html`<item-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${this.currentWidth}\n .currentHeight=${this.currentHeight}\n .baseImageUrl=${this.baseImageUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .layoutType=${this.layoutType}\n ?showTvClips=${this.showTvClips}\n ?showInfoButton=${this.shouldShowInfoButton}\n ?useLocalTime=${this.useLocalTime}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </item-tile>`;\n }\n case 'list-compact':\n return html`<tile-list-compact\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n .tileActions=${this.isManageView ? [] : this.tileActions}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list-compact>`;\n case 'list-detail':\n return html`<tile-list\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .collectionTitles=${this.collectionTitles}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n .tileActions=${this.isManageView ? [] : this.tileActions}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list>`;\n default:\n return nothing;\n }\n }\n\n static get styles() {\n return [\n srOnlyStyle,\n tileActionStyles,\n css`\n :host {\n display: block;\n height: 100%;\n }\n\n collection-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n }\n\n account-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #fcf5e6;\n }\n\n item-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #f1f1f4;\n }\n\n search-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n --iconFillColor: #2c2c2c;\n }\n\n #container {\n position: relative;\n height: 100%;\n border-radius: 4px;\n }\n\n /*\n * When tile actions are present, the container takes on the role of\n * the tile's visual card so the tile content and action row appear\n * as a single unified element. The inner tile's own shadow/radius\n * are disabled via CSS variable overrides to avoid visual\n * duplication, and the action row sits as a footer inside the same\n * card.\n */\n #container.has-tile-actions {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n box-shadow: var(--tileShadow, 1px 1px 2px 0);\n --tileBoxShadow: none;\n --tileCornerRadius: 0;\n }\n\n #container.has-tile-actions .tile-link {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n border-radius: 0;\n }\n\n /* Normal hover shadow lives on the inner anchor for plain tiles */\n #container.hoverable:not(.has-tile-actions) a:focus,\n #container.hoverable:not(.has-tile-actions) a:hover {\n box-shadow: var(\n --tileHoverBoxShadow,\n 0 0 6px 2px rgba(8, 8, 32, 0.8)\n );\n transition: box-shadow 0.1s ease;\n }\n\n /*\n * When the container owns the card visuals, the hover shadow needs\n * to move up to the container so it wraps the action row too.\n */\n #container.hoverable.has-tile-actions:hover {\n box-shadow: var(\n --tileHoverBoxShadow,\n 0 0 6px 2px rgba(8, 8, 32, 0.8)\n );\n transition: box-shadow 0.1s ease;\n }\n\n a {\n display: block;\n height: 100%;\n color: unset;\n text-decoration: none;\n transition: transform 0.05s ease;\n border-radius: 4px;\n outline: none;\n }\n\n a :first-child {\n display: block;\n height: 100%;\n }\n\n .manage-check {\n position: absolute;\n right: 0;\n top: 0;\n border: 5px solid #2c2c2c;\n border-radius: 3px;\n background-color: #2c2c2c;\n z-index: 1;\n }\n\n .manage-check > input[type='checkbox'] {\n display: block;\n margin: 0;\n }\n\n #touch-backdrop {\n position: fixed;\n width: 100vw;\n height: 100vh;\n top: 0;\n left: 0;\n z-index: 2;\n background: transparent;\n }\n\n tile-hover-pane {\n position: absolute;\n top: 0;\n left: -9999px;\n z-index: 2;\n }\n\n /*\n * Grid-mode action row sits flush against the bottom of the card —\n * the buttons' own borders form the visible bottom edge. The outer\n * buttons get rounded bottom corners to match the container so the\n * red border traces cleanly around the card's bottom corners.\n */\n .grid-tile-actions .tile-action-btn:first-child {\n border-bottom-left-radius: 4px;\n }\n\n .grid-tile-actions .tile-action-btn:last-child {\n border-bottom-right-radius: 4px;\n }\n `,\n ];\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tile-display-value-provider.js","sourceRoot":"","sources":["../../../src/tiles/tile-display-value-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IAWnC,YACE,UAMI,EAAE;QAEN,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB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C;YACzB,KAAK,WAAW;gBACd,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;YACtB,KAAK,MAAM;gBACT,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC;YAC1B;gBACE,OAAO,EAAE,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,SAAS,EAAE,KAAK,KAAK,MAAM;YACrC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC;YACrB,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,WAAW,CACT,UAAmB,EACnB,YAAY,GAAG,KAAK;QAEpB,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI;YAAE,OAAO,OAAO,CAAC;QAClE,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC;QACtE,OAAO,GAAG,IAAI,CAAC,iBAAiB,GAAG,QAAQ,GAAG,UAAU,EAAE,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,GAAW,EAAE,IAAU;QAC5C,8FAA8F;QAC9F,MAAM,cAAc,GAAG,IAAI;aACxB,WAAW,EAAE;aACb,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;aACtB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACvB,MAAM,WAAW,GAAG,+BAA+B,cAAc,IAAI,kBAAkB,CACrF,GAAG,CACJ,EAAE,CAAC;QACJ,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAA,YAAY,WAAW,KAAK,WAAW,QAAQ,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import { TemplateResult, html, nothing } from 'lit';\r\nimport { msg, str } from '@lit/localize';\r\nimport type { SortParam } from '@internetarchive/search-service';\r\nimport type { TileModel } from '../models';\r\nimport { formatDate } from '../utils/format-date';\r\n\r\n/**\r\n * A class encapsulating shared logic for converting model values into display values\r\n * across different types of tiles.\r\n */\r\nexport class TileDisplayValueProvider {\r\n private model?: TileModel;\r\n\r\n private baseNavigationUrl?: string;\r\n\r\n private collectionPagePath?: string;\r\n\r\n private sortParam?: SortParam;\r\n\r\n private creatorFilter?: string;\r\n\r\n constructor(\r\n options: {\r\n model?: TileModel;\r\n baseNavigationUrl?: string;\r\n collectionPagePath?: string;\r\n sortParam?: SortParam;\r\n creatorFilter?: string;\r\n } = {},\r\n ) {\r\n this.model = options.model;\r\n this.baseNavigationUrl = options.baseNavigationUrl;\r\n this.collectionPagePath = options.collectionPagePath ?? '/details/';\r\n this.sortParam = options.sortParam;\r\n this.creatorFilter = options.creatorFilter;\r\n }\r\n\r\n /**\r\n * Examines the creator(s) for the given tile model, returning\r\n * the first creator whose name matches the provided filter\r\n * (or simply the first creator overall if no filter is provided).\r\n */\r\n get firstCreatorMatchingFilter(): string | undefined {\r\n let matchingCreator;\r\n\r\n // If we're filtering by creator initial and have multiple creators, we want\r\n // to surface the first creator who matches the filter.\r\n if (this.creatorFilter && this.model?.creators.length) {\r\n const firstLetter = this.creatorFilter; // This is just to satisfy tsc\r\n matchingCreator = this.model.creators.find(creator =>\r\n // Decompose combining characters first, so that e.g., filtering on E matches É too.\r\n // Then remove anything that isn't strictly alphabetic, since our filters currently\r\n // only handle A-Z. The first such letter (if one exists) is what needs to match.\r\n creator\r\n .normalize('NFD')\r\n .replace(/[^A-Z]+/gi, '')\r\n .toUpperCase()\r\n .startsWith(firstLetter),\r\n );\r\n }\r\n\r\n return matchingCreator ?? this.model?.creator;\r\n }\r\n\r\n /**\r\n * The label indicating what year an account item was created.\r\n * E.g., \"Archivist since 2015\"\r\n */\r\n get accountLabel(): string {\r\n return this.model?.dateAdded\r\n ? msg(str`Archivist since ${this.model.dateAdded.getFullYear()}`)\r\n : '';\r\n }\r\n\r\n /**\r\n * The readable label for the current sort if it is a type of date sort,\r\n * or the empty string otherwise.\r\n */\r\n get dateLabel(): string {\r\n switch (this.sortParam?.field) {\r\n case 'publicdate':\r\n return msg('Archived');\r\n case 'reviewdate':\r\n return msg('Reviewed');\r\n case 'addeddate':\r\n return msg('Added');\r\n case 'date':\r\n return msg('Published');\r\n default:\r\n return '';\r\n }\r\n }\r\n\r\n /**\r\n * The readable label for the current views column, based on whether\r\n * weekly or all-time views are being shown.\r\n */\r\n get viewsLabel(): string {\r\n return this.sortParam?.field === 'week'\r\n ? msg('Weekly views')\r\n : msg('All-time views');\r\n }\r\n\r\n /**\r\n * Produces a URL pointing at the item page for the given identifier,\r\n * using the current base URL and the correct path based on whether the\r\n * item is specified to be a collection (default false).\r\n */\r\n itemPageUrl(\r\n identifier?: string,\r\n isCollection = false,\r\n ): string | typeof nothing {\r\n if (!identifier || this.baseNavigationUrl == null) return nothing;\r\n const basePath = isCollection ? this.collectionPagePath : '/details/';\r\n return `${this.baseNavigationUrl}${basePath}${identifier}`;\r\n }\r\n\r\n /**\r\n * Produces a template for a link to a single web capture of the given URL and date\r\n */\r\n webArchivesCaptureLink(url: string, date: Date): TemplateResult {\r\n // Convert the date into the format used to identify wayback captures (e.g., '20150102124550')\r\n const captureDateStr = date\r\n .toISOString()\r\n .replace(/[TZ:-]/g, '')\r\n .replace(/\\..*/, '');\r\n const captureHref = `https://web.archive.org/web/${captureDateStr}/${encodeURIComponent(\r\n url,\r\n )}`;\r\n const captureText = formatDate(date, 'long');\r\n\r\n return html` <a href=${captureHref}> ${captureText} </a> `;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"tile-display-value-provider.js","sourceRoot":"","sources":["../../../src/tiles/tile-display-value-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE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AAM,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAA,YAAY,WAAW,KAAK,WAAW,QAAQ,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import { TemplateResult, html, nothing } from 'lit';\nimport { msg, str } from '@lit/localize';\nimport type { SortParam } from '@internetarchive/search-service';\nimport type { TileModel } from '../models';\nimport { formatDate } from '../utils/format-date';\n\n/**\n * A class encapsulating shared logic for converting model values into display values\n * across different types of tiles.\n */\nexport class TileDisplayValueProvider {\n private model?: TileModel;\n\n private baseNavigationUrl?: string;\n\n private collectionPagePath?: string;\n\n private sortParam?: SortParam;\n\n private creatorFilter?: string;\n\n constructor(\n options: {\n model?: TileModel;\n baseNavigationUrl?: string;\n collectionPagePath?: string;\n sortParam?: SortParam;\n creatorFilter?: string;\n } = {},\n ) {\n this.model = options.model;\n this.baseNavigationUrl = options.baseNavigationUrl;\n this.collectionPagePath = options.collectionPagePath ?? '/details/';\n this.sortParam = options.sortParam;\n this.creatorFilter = options.creatorFilter;\n }\n\n /**\n * Examines the creator(s) for the given tile model, returning\n * the first creator whose name matches the provided filter\n * (or simply the first creator overall if no filter is provided).\n */\n get firstCreatorMatchingFilter(): string | undefined {\n let matchingCreator;\n\n // If we're filtering by creator initial and have multiple creators, we want\n // to surface the first creator who matches the filter.\n if (this.creatorFilter && this.model?.creators.length) {\n const firstLetter = this.creatorFilter; // This is just to satisfy tsc\n matchingCreator = this.model.creators.find(creator =>\n // Decompose combining characters first, so that e.g., filtering on E matches É too.\n // Then remove anything that isn't strictly alphabetic, since our filters currently\n // only handle A-Z. The first such letter (if one exists) is what needs to match.\n creator\n .normalize('NFD')\n .replace(/[^A-Z]+/gi, '')\n .toUpperCase()\n .startsWith(firstLetter),\n );\n }\n\n return matchingCreator ?? this.model?.creator;\n }\n\n /**\n * The label indicating what year an account item was created.\n * E.g., \"Archivist since 2015\"\n */\n get accountLabel(): string {\n return this.model?.dateAdded\n ? msg(str`Archivist since ${this.model.dateAdded.getFullYear()}`)\n : '';\n }\n\n /**\n * The readable label for the current sort if it is a type of date sort,\n * or the empty string otherwise.\n */\n get dateLabel(): string {\n switch (this.sortParam?.field) {\n case 'publicdate':\n return msg('Archived');\n case 'reviewdate':\n return msg('Reviewed');\n case 'addeddate':\n return msg('Added');\n case 'date':\n return msg('Published');\n default:\n return '';\n }\n }\n\n /**\n * The readable label for the current views column, based on whether\n * weekly or all-time views are being shown.\n */\n get viewsLabel(): string {\n return this.sortParam?.field === 'week'\n ? msg('Weekly views')\n : msg('All-time views');\n }\n\n /**\n * Produces a URL pointing at the item page for the given identifier,\n * using the current base URL and the correct path based on whether the\n * item is specified to be a collection (default false).\n */\n itemPageUrl(\n identifier?: string,\n isCollection = false,\n ): string | typeof nothing {\n if (!identifier || this.baseNavigationUrl == null) return nothing;\n const basePath = isCollection ? this.collectionPagePath : '/details/';\n return `${this.baseNavigationUrl}${basePath}${identifier}`;\n }\n\n /**\n * Produces a template for a link to a single web capture of the given URL and date\n */\n webArchivesCaptureLink(url: string, date: Date): TemplateResult {\n // Convert the date into the format used to identify wayback captures (e.g., '20150102124550')\n const captureDateStr = date\n .toISOString()\n .replace(/[TZ:-]/g, '')\n .replace(/\\..*/, '');\n const captureHref = `https://web.archive.org/web/${captureDateStr}/${encodeURIComponent(\n url,\n )}`;\n const captureText = formatDate(date, 'long');\n\n return html` <a href=${captureHref}> ${captureText} </a> `;\n }\n}\n"]}
@@ -21,8 +21,8 @@ const dataPage = [
21
21
  describe('Collection Browser Data Source', () => {
22
22
  let host;
23
23
  beforeEach(async () => {
24
- host = await fixture(html `
25
- <collection-browser></collection-browser>
24
+ host = await fixture(html `
25
+ <collection-browser></collection-browser>
26
26
  `);
27
27
  });
28
28
  it('can add and retrieve data pages', () => {