@internetarchive/collection-browser 3.0.2-alpha1 → 3.0.2

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 (31) hide show
  1. package/dist/src/collection-browser.js +1 -0
  2. package/dist/src/collection-browser.js.map +1 -1
  3. package/dist/src/collection-facets/facet-row.js +2 -1
  4. package/dist/src/collection-facets/facet-row.js.map +1 -1
  5. package/dist/src/collection-facets.js +3 -1
  6. package/dist/src/collection-facets.js.map +1 -1
  7. package/dist/src/manage/manage-bar.js +1 -1
  8. package/dist/src/manage/manage-bar.js.map +1 -1
  9. package/dist/src/tiles/grid/collection-tile.js +3 -2
  10. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  11. package/dist/src/tiles/grid/item-tile.js +2 -2
  12. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  13. package/dist/src/tiles/grid/search-tile.js +3 -2
  14. package/dist/src/tiles/grid/search-tile.js.map +1 -1
  15. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +3 -2
  16. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
  17. package/dist/src/tiles/list/tile-list.js +13 -3
  18. package/dist/src/tiles/list/tile-list.js.map +1 -1
  19. package/dist/test/tiles/list/tile-list.test.js +13 -0
  20. package/dist/test/tiles/list/tile-list.test.js.map +1 -1
  21. package/package.json +2 -2
  22. package/src/collection-browser.ts +1 -0
  23. package/src/collection-facets/facet-row.ts +2 -1
  24. package/src/collection-facets.ts +3 -1
  25. package/src/manage/manage-bar.ts +1 -1
  26. package/src/tiles/grid/collection-tile.ts +3 -2
  27. package/src/tiles/grid/item-tile.ts +2 -2
  28. package/src/tiles/grid/search-tile.ts +3 -2
  29. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +3 -2
  30. package/src/tiles/list/tile-list.ts +11 -3
  31. package/test/tiles/list/tile-list.test.ts +15 -0
@@ -4,7 +4,7 @@ import { join } from 'lit/directives/join.js';
4
4
  import { map } from 'lit/directives/map.js';
5
5
  import { unsafeHTML } from 'lit/directives/unsafe-html.js';
6
6
  import { customElement, property, state } from 'lit/decorators.js';
7
- import { msg } from '@lit/localize';
7
+ import { msg, str } from '@lit/localize';
8
8
  import DOMPurify from 'dompurify';
9
9
 
10
10
  import type { SortParam } from '@internetarchive/search-service';
@@ -94,7 +94,11 @@ export class TileList extends BaseTileComponent {
94
94
  isCollection,
95
95
  );
96
96
 
97
- return html`<a href=${href}>
97
+ return html`<a
98
+ id="image-link"
99
+ title=${msg(str`View ${this.model?.title}`)}
100
+ href=${href}
101
+ >
98
102
  <image-block
99
103
  .model=${this.model}
100
104
  .baseImageUrl=${this.baseImageUrl}
@@ -127,7 +131,11 @@ export class TileList extends BaseTileComponent {
127
131
  // Data templates
128
132
  private get iconRightTemplate() {
129
133
  return html`
130
- <a id="icon-right" href=${this.mediatypeURL}>
134
+ <a
135
+ id="icon-right"
136
+ href=${this.mediatypeURL}
137
+ title=${msg(str`See more: ${this.model?.mediatype}`)}
138
+ >
131
139
  <tile-mediatype-icon .model=${this.model}> </tile-mediatype-icon>
132
140
  </a>
133
141
  `;
@@ -49,6 +49,20 @@ describe('List Tile', () => {
49
49
  expect(title?.getAttribute('href')).to.equal('/foo/bar');
50
50
  });
51
51
 
52
+ it('should add title to image link if provided', async () => {
53
+ const el = await fixture<TileList>(html`
54
+ <tile-list
55
+ .baseNavigationUrl=${''}
56
+ .model=${{ title: 'foo', href: '/foo/bar' }}
57
+ ></tile-list>
58
+ `);
59
+
60
+ const imageLink = el.shadowRoot?.querySelector('#image-link');
61
+
62
+ expect(imageLink).to.exist;
63
+ expect(imageLink?.getAttribute('title')).to.equal('View foo');
64
+ });
65
+
52
66
  it('should render with creator element but not dates', async () => {
53
67
  const el = await fixture<TileList>(html`
54
68
  <tile-list .model=${{ creators: ['someone'] }}></tile-list>
@@ -324,6 +338,7 @@ describe('List Tile', () => {
324
338
  expect(mediatypeLink?.getAttribute('href')).to.equal(
325
339
  `https://archive.org/details/texts`,
326
340
  );
341
+ expect(mediatypeLink?.getAttribute('title')).to.equal('See more: texts');
327
342
  });
328
343
 
329
344
  it('should render mediatype icon as link even with empty baseNavigationUrl', async () => {