@internetarchive/collection-browser 3.5.2-alpha-webdev8164.0 → 3.5.2-webdev-8162.1

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 (45) hide show
  1. package/.editorconfig +29 -29
  2. package/.github/workflows/ci.yml +27 -27
  3. package/.github/workflows/gh-pages-main.yml +39 -39
  4. package/.github/workflows/npm-publish.yml +39 -39
  5. package/.github/workflows/pr-preview.yml +38 -38
  6. package/.prettierignore +1 -1
  7. package/LICENSE +661 -661
  8. package/README.md +83 -83
  9. package/dist/src/app-root.js +606 -606
  10. package/dist/src/app-root.js.map +1 -1
  11. package/dist/src/collection-facets/facets-template.js +23 -28
  12. package/dist/src/collection-facets/facets-template.js.map +1 -1
  13. package/dist/src/collection-facets/more-facets-content.d.ts +8 -34
  14. package/dist/src/collection-facets/more-facets-content.js +159 -358
  15. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  16. package/dist/src/tiles/grid/collection-tile.js +77 -77
  17. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  18. package/dist/src/tiles/grid/item-tile.js +137 -137
  19. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  20. package/dist/src/tiles/models.js.map +1 -1
  21. package/dist/src/tiles/tile-dispatcher.js +215 -215
  22. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  23. package/dist/test/collection-browser.test.js +1 -1
  24. package/dist/test/collection-browser.test.js.map +1 -1
  25. package/dist/test/collection-facets/more-facets-content.test.js +31 -137
  26. package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
  27. package/eslint.config.mjs +53 -53
  28. package/index.html +24 -24
  29. package/local.archive.org.cert +86 -86
  30. package/local.archive.org.key +27 -27
  31. package/package.json +121 -119
  32. package/renovate.json +6 -6
  33. package/src/app-root.ts +1140 -1140
  34. package/src/collection-facets/facets-template.ts +83 -88
  35. package/src/collection-facets/more-facets-content.ts +642 -856
  36. package/src/tiles/grid/collection-tile.ts +163 -163
  37. package/src/tiles/grid/item-tile.ts +340 -340
  38. package/src/tiles/models.ts +1 -1
  39. package/src/tiles/tile-dispatcher.ts +517 -517
  40. package/test/collection-browser.test.ts +1 -1
  41. package/test/collection-facets/more-facets-content.test.ts +231 -378
  42. package/tsconfig.json +25 -25
  43. package/web-dev-server.config.mjs +30 -30
  44. package/web-test-runner.config.mjs +52 -41
  45. package/.husky/pre-commit +0 -4
@@ -1,88 +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
- const columnWidth = css`var(--facetsColumnWidth, auto)`;
67
- const maxHeight = css`var(--facetsMaxHeight, none)`;
68
-
69
- return css`
70
- .facet-rows {
71
- column-count: ${columnCount};
72
- column-gap: ${columnGap};
73
- column-width: ${columnWidth};
74
- max-height: ${maxHeight};
75
- column-fill: auto;
76
- }
77
-
78
- a:link,
79
- a:visited {
80
- text-decoration: none;
81
- color: var(--ia-theme-link-color, #4b64ff);
82
- }
83
- a:hover {
84
- text-decoration: underline;
85
- }
86
- `;
87
- }
88
- }
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
+ }