@internetarchive/collection-browser 4.4.1 → 4.5.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/.editorconfig +29 -29
- package/.github/workflows/ci.yml +27 -27
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.husky/pre-commit +1 -1
- package/.prettierignore +1 -1
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/src/app-root.d.ts +8 -0
- package/dist/src/app-root.js +698 -672
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.d.ts +8 -0
- package/dist/src/collection-browser.js +782 -764
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.d.ts +6 -0
- package/dist/src/collection-facets/facet-row.js +158 -140
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +25 -23
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/styles/tile-action-styles.d.ts +14 -0
- package/dist/src/styles/tile-action-styles.js +59 -0
- package/dist/src/styles/tile-action-styles.js.map +1 -0
- package/dist/src/tiles/base-tile-component.d.ts +17 -1
- package/dist/src/tiles/base-tile-component.js +50 -1
- package/dist/src/tiles/base-tile-component.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +139 -138
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js +71 -46
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.d.ts +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +138 -100
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +1 -1
- package/dist/src/tiles/list/tile-list.js +316 -298
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/models.d.ts +11 -0
- package/dist/src/tiles/models.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +14 -0
- package/dist/src/tiles/tile-dispatcher.js +319 -216
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +55 -23
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +77 -77
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +134 -134
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +92 -92
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- package/index.ts +29 -28
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +120 -120
- package/renovate.json +6 -6
- package/src/app-root.ts +1284 -1254
- package/src/collection-browser.ts +3176 -3161
- package/src/collection-facets/facet-row.ts +309 -299
- package/src/collection-facets/facets-template.ts +85 -83
- package/src/styles/tile-action-styles.ts +59 -0
- package/src/tiles/base-tile-component.ts +124 -65
- package/src/tiles/grid/item-tile.ts +347 -346
- package/src/tiles/list/tile-list-compact-header.ts +112 -86
- package/src/tiles/list/tile-list-compact.ts +278 -239
- package/src/tiles/list/tile-list.ts +718 -700
- package/src/tiles/models.ts +21 -8
- package/src/tiles/tile-dispatcher.ts +637 -527
- package/src/tiles/tile-display-value-provider.ts +133 -133
- package/test/collection-facets/facet-row.test.ts +421 -375
- package/test/tiles/grid/item-tile.test.ts +520 -520
- package/test/tiles/list/tile-list.test.ts +576 -576
- package/test/tiles/tile-dispatcher.test.ts +320 -320
- package/tsconfig.json +25 -25
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +52 -52
|
@@ -1,86 +1,112 @@
|
|
|
1
|
-
import { css, html } from 'lit';
|
|
2
|
-
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
import { css, html, nothing } from 'lit';
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { msg } from '@lit/localize';
|
|
5
|
+
import { BaseTileComponent } from '../base-tile-component';
|
|
6
|
+
|
|
7
|
+
@customElement('tile-list-compact-header')
|
|
8
|
+
export class TileListCompactHeader extends BaseTileComponent {
|
|
9
|
+
/*
|
|
10
|
+
* Reactive properties inherited from BaseTileComponent:
|
|
11
|
+
* - model?: TileModel;
|
|
12
|
+
* - tileActions: TileAction[] = [];
|
|
13
|
+
* - currentWidth?: number;
|
|
14
|
+
* - currentHeight?: number;
|
|
15
|
+
* - baseNavigationUrl?: string;
|
|
16
|
+
* - baseImageUrl?: string;
|
|
17
|
+
* - collectionPagePath?: string;
|
|
18
|
+
* - sortParam: SortParam | null = null;
|
|
19
|
+
* - creatorFilter?: string;
|
|
20
|
+
* - mobileBreakpoint?: number;
|
|
21
|
+
* - loggedIn = false;
|
|
22
|
+
* - suppressBlurring = false;
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
render() {
|
|
26
|
+
const hasActions = this.tileActions.length > 0;
|
|
27
|
+
const headerClasses = classMap({
|
|
28
|
+
mobile: this.classSize === 'mobile',
|
|
29
|
+
desktop: this.classSize === 'desktop',
|
|
30
|
+
'has-actions': hasActions,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return html`
|
|
34
|
+
<div id="list-line-header" class=${headerClasses}>
|
|
35
|
+
<div id="thumb"></div>
|
|
36
|
+
${hasActions ? html`<div id="actions-header"></div>` : nothing}
|
|
37
|
+
<div id="title">${msg('Title')}</div>
|
|
38
|
+
<div id="creator">${msg('Creator')}</div>
|
|
39
|
+
<div id="date">
|
|
40
|
+
${this.displayValueProvider.dateLabel || msg('Published')}
|
|
41
|
+
</div>
|
|
42
|
+
<div id="icon">${msg('Type')}</div>
|
|
43
|
+
<div id="views">${this.displayValueProvider.viewsLabel}</div>
|
|
44
|
+
</div>
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private get classSize(): string {
|
|
49
|
+
if (
|
|
50
|
+
this.mobileBreakpoint &&
|
|
51
|
+
this.currentWidth &&
|
|
52
|
+
this.currentWidth < this.mobileBreakpoint
|
|
53
|
+
) {
|
|
54
|
+
return 'mobile';
|
|
55
|
+
}
|
|
56
|
+
return 'desktop';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static get styles() {
|
|
60
|
+
return css`
|
|
61
|
+
html {
|
|
62
|
+
font-size: unset;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
div {
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
line-height: 20px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.mobile #views {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
#views {
|
|
76
|
+
text-align: right;
|
|
77
|
+
padding-right: 8px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
#list-line-header {
|
|
81
|
+
display: grid;
|
|
82
|
+
column-gap: 10px;
|
|
83
|
+
align-items: flex-end;
|
|
84
|
+
padding-bottom: 2px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#list-line-header.mobile {
|
|
88
|
+
grid-template-columns: 36px 3fr 2fr 68px 35px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#list-line-header.desktop {
|
|
92
|
+
grid-template-columns: 51px 3fr 2fr 95px 30px 115px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/*
|
|
96
|
+
* When tile actions are present in the rows below, reserve a matching
|
|
97
|
+
* column here so the columns stay aligned with each row.
|
|
98
|
+
*/
|
|
99
|
+
#list-line-header.mobile.has-actions {
|
|
100
|
+
grid-template-columns:
|
|
101
|
+
36px var(--tileActionColumnWidth, 90px) 3fr 2fr
|
|
102
|
+
68px 35px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
#list-line-header.desktop.has-actions {
|
|
106
|
+
grid-template-columns:
|
|
107
|
+
51px var(--tileActionColumnWidth, 100px) 3fr 2fr
|
|
108
|
+
95px 30px 115px;
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
}
|