@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.
- package/dist/src/app-root.js +606 -606
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.js +764 -764
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +140 -140
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +23 -23
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +1 -0
- package/dist/src/collection-facets/more-facets-content.js +126 -127
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets.js +267 -267
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/models.d.ts +0 -4
- package/dist/src/models.js +0 -8
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +77 -77
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +137 -137
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +8 -0
- package/dist/src/tiles/hover/hover-pane-controller.js +13 -1
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/models.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +215 -215
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/collection-browser.test.js +189 -189
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +28 -28
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +1 -1
- package/src/app-root.ts +1140 -1140
- package/src/collection-browser.ts +3075 -3075
- package/src/collection-facets/facet-row.ts +299 -299
- package/src/collection-facets/facets-template.ts +83 -83
- package/src/collection-facets/more-facets-content.ts +642 -644
- package/src/collection-facets.ts +1010 -1010
- package/src/data-source/collection-browser-data-source-interface.ts +345 -345
- package/src/data-source/collection-browser-data-source.ts +1441 -1441
- package/src/data-source/collection-browser-query-state.ts +59 -59
- package/src/data-source/models.ts +56 -56
- package/src/models.ts +0 -9
- package/src/restoration-state-handler.ts +546 -546
- package/src/tiles/grid/collection-tile.ts +163 -163
- package/src/tiles/grid/item-tile.ts +340 -340
- package/src/tiles/hover/hover-pane-controller.ts +15 -1
- package/src/tiles/models.ts +1 -1
- package/src/tiles/tile-dispatcher.ts +517 -517
- package/test/collection-browser.test.ts +2413 -2413
- package/test/collection-facets/more-facets-content.test.ts +231 -231
- package/test/restoration-state-handler.test.ts +480 -480
- 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
|
+
}
|