@internetarchive/collection-browser 3.5.2-alpha-webdev8160.0 → 3.5.2-alpha-webdev8093.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 (58) hide show
  1. package/dist/src/app-root.js +606 -606
  2. package/dist/src/app-root.js.map +1 -1
  3. package/dist/src/collection-browser.js +764 -764
  4. package/dist/src/collection-browser.js.map +1 -1
  5. package/dist/src/collection-facets/facet-row.js +140 -140
  6. package/dist/src/collection-facets/facet-row.js.map +1 -1
  7. package/dist/src/collection-facets/facets-template.js +23 -23
  8. package/dist/src/collection-facets/facets-template.js.map +1 -1
  9. package/dist/src/collection-facets/more-facets-content.d.ts +1 -0
  10. package/dist/src/collection-facets/more-facets-content.js +126 -127
  11. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  12. package/dist/src/collection-facets.js +267 -267
  13. package/dist/src/collection-facets.js.map +1 -1
  14. package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
  15. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  16. package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
  17. package/dist/src/data-source/models.js.map +1 -1
  18. package/dist/src/models.d.ts +0 -4
  19. package/dist/src/models.js +0 -8
  20. package/dist/src/models.js.map +1 -1
  21. package/dist/src/restoration-state-handler.js.map +1 -1
  22. package/dist/src/tiles/grid/collection-tile.js +77 -77
  23. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  24. package/dist/src/tiles/grid/item-tile.js +137 -137
  25. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  26. package/dist/src/tiles/hover/hover-pane-controller.d.ts +8 -0
  27. package/dist/src/tiles/hover/hover-pane-controller.js +13 -1
  28. package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
  29. package/dist/src/tiles/models.js.map +1 -1
  30. package/dist/src/tiles/tile-dispatcher.js +215 -215
  31. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  32. package/dist/test/collection-browser.test.js +189 -189
  33. package/dist/test/collection-browser.test.js.map +1 -1
  34. package/dist/test/collection-facets/more-facets-content.test.js +28 -28
  35. package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
  36. package/dist/test/restoration-state-handler.test.js.map +1 -1
  37. package/package.json +1 -1
  38. package/src/app-root.ts +1140 -1140
  39. package/src/collection-browser.ts +3075 -3075
  40. package/src/collection-facets/facet-row.ts +299 -299
  41. package/src/collection-facets/facets-template.ts +83 -83
  42. package/src/collection-facets/more-facets-content.ts +642 -644
  43. package/src/collection-facets.ts +1010 -1010
  44. package/src/data-source/collection-browser-data-source-interface.ts +345 -345
  45. package/src/data-source/collection-browser-data-source.ts +1441 -1441
  46. package/src/data-source/collection-browser-query-state.ts +59 -59
  47. package/src/data-source/models.ts +56 -56
  48. package/src/models.ts +0 -9
  49. package/src/restoration-state-handler.ts +546 -546
  50. package/src/tiles/grid/collection-tile.ts +163 -163
  51. package/src/tiles/grid/item-tile.ts +340 -340
  52. package/src/tiles/hover/hover-pane-controller.ts +15 -1
  53. package/src/tiles/models.ts +1 -1
  54. package/src/tiles/tile-dispatcher.ts +517 -517
  55. package/test/collection-browser.test.ts +2413 -2413
  56. package/test/collection-facets/more-facets-content.test.ts +231 -231
  57. package/test/restoration-state-handler.test.ts +480 -480
  58. package/vite.config.ts +29 -29
@@ -1,83 +1,83 @@
1
- import {
2
- css,
3
- html,
4
- LitElement,
5
- TemplateResult,
6
- CSSResultGroup,
7
- nothing,
8
- } from 'lit';
9
- import { customElement, property } from 'lit/decorators.js';
10
- import { repeat } from 'lit/directives/repeat.js';
11
- import type { FacetGroup, FacetBucket, FacetEventDetails } from '../models';
12
- import type { CollectionTitles } from '../data-source/models';
13
- import './facet-row';
14
-
15
- @customElement('facets-template')
16
- export class FacetsTemplate extends LitElement {
17
- @property({ type: Object }) facetGroup?: FacetGroup;
18
-
19
- @property({ type: Object })
20
- collectionTitles?: CollectionTitles;
21
-
22
- private facetClicked(e: CustomEvent<FacetEventDetails>) {
23
- this.dispatchFacetClickEvent(e.detail);
24
- }
25
-
26
- private dispatchFacetClickEvent(detail: FacetEventDetails) {
27
- const event = new CustomEvent<FacetEventDetails>('facetClick', {
28
- detail,
29
- composed: true,
30
- });
31
- this.dispatchEvent(event);
32
- }
33
-
34
- private get facetsTemplate(): TemplateResult | typeof nothing {
35
- const { facetGroup } = this;
36
- if (!facetGroup) return nothing;
37
-
38
- const facetBuckets = facetGroup.buckets as FacetBucket[];
39
-
40
- // Added data-testid for Playwright testing
41
- // Using className and aria-labels is not ideal for Playwright locator
42
- return html`
43
- <div class="facet-rows" data-testid="facets-on-${facetGroup.key}">
44
- ${repeat(
45
- facetBuckets,
46
- bucket => `${facetGroup.key}:${bucket.key}`,
47
- bucket =>
48
- html`<facet-row
49
- .facetType=${facetGroup.key}
50
- .bucket=${bucket}
51
- .collectionTitles=${this.collectionTitles}
52
- @facetClick=${this.facetClicked}
53
- ></facet-row>`,
54
- )}
55
- </div>
56
- `;
57
- }
58
-
59
- render() {
60
- return html`${this.facetsTemplate}`;
61
- }
62
-
63
- static get styles(): CSSResultGroup {
64
- const columnCount = css`var(--facetsColumnCount, 1)`;
65
- const columnGap = css`var(--facetsColumnGap, 15px)`;
66
-
67
- return css`
68
- .facet-rows {
69
- column-count: ${columnCount};
70
- column-gap: ${columnGap};
71
- }
72
-
73
- a:link,
74
- a:visited {
75
- text-decoration: none;
76
- color: var(--ia-theme-link-color, #4b64ff);
77
- }
78
- a:hover {
79
- text-decoration: underline;
80
- }
81
- `;
82
- }
83
- }
1
+ import {
2
+ css,
3
+ html,
4
+ LitElement,
5
+ TemplateResult,
6
+ CSSResultGroup,
7
+ nothing,
8
+ } from 'lit';
9
+ import { customElement, property } from 'lit/decorators.js';
10
+ import { repeat } from 'lit/directives/repeat.js';
11
+ import type { FacetGroup, FacetBucket, FacetEventDetails } from '../models';
12
+ import type { CollectionTitles } from '../data-source/models';
13
+ import './facet-row';
14
+
15
+ @customElement('facets-template')
16
+ export class FacetsTemplate extends LitElement {
17
+ @property({ type: Object }) facetGroup?: FacetGroup;
18
+
19
+ @property({ type: Object })
20
+ collectionTitles?: CollectionTitles;
21
+
22
+ private facetClicked(e: CustomEvent<FacetEventDetails>) {
23
+ this.dispatchFacetClickEvent(e.detail);
24
+ }
25
+
26
+ private dispatchFacetClickEvent(detail: FacetEventDetails) {
27
+ const event = new CustomEvent<FacetEventDetails>('facetClick', {
28
+ detail,
29
+ composed: true,
30
+ });
31
+ this.dispatchEvent(event);
32
+ }
33
+
34
+ private get facetsTemplate(): TemplateResult | typeof nothing {
35
+ const { facetGroup } = this;
36
+ if (!facetGroup) return nothing;
37
+
38
+ const facetBuckets = facetGroup.buckets as FacetBucket[];
39
+
40
+ // Added data-testid for Playwright testing
41
+ // Using className and aria-labels is not ideal for Playwright locator
42
+ return html`
43
+ <div class="facet-rows" data-testid="facets-on-${facetGroup.key}">
44
+ ${repeat(
45
+ facetBuckets,
46
+ bucket => `${facetGroup.key}:${bucket.key}`,
47
+ bucket =>
48
+ html`<facet-row
49
+ .facetType=${facetGroup.key}
50
+ .bucket=${bucket}
51
+ .collectionTitles=${this.collectionTitles}
52
+ @facetClick=${this.facetClicked}
53
+ ></facet-row>`,
54
+ )}
55
+ </div>
56
+ `;
57
+ }
58
+
59
+ render() {
60
+ return html`${this.facetsTemplate}`;
61
+ }
62
+
63
+ static get styles(): CSSResultGroup {
64
+ const columnCount = css`var(--facetsColumnCount, 1)`;
65
+ const columnGap = css`var(--facetsColumnGap, 15px)`;
66
+
67
+ return css`
68
+ .facet-rows {
69
+ column-count: ${columnCount};
70
+ column-gap: ${columnGap};
71
+ }
72
+
73
+ a:link,
74
+ a:visited {
75
+ text-decoration: none;
76
+ color: var(--ia-theme-link-color, #4b64ff);
77
+ }
78
+ a:hover {
79
+ text-decoration: underline;
80
+ }
81
+ `;
82
+ }
83
+ }