@internetarchive/collection-browser 3.0.1-webdev-7936.0 → 3.0.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.
- 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 +4 -4
- package/.prettierignore +1 -1
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/src/collection-browser.js +0 -1
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +1 -2
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/models.d.ts +9 -0
- package/dist/src/collection-facets/models.js +10 -0
- package/dist/src/collection-facets/models.js.map +1 -0
- package/dist/src/collection-facets/more-facets-content.js +121 -120
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets.js +0 -1
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +2 -3
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +2 -2
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/search-tile.js +2 -3
- package/dist/src/tiles/grid/search-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +1 -2
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +3 -13
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +0 -13
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +117 -117
- package/renovate.json +6 -6
- package/src/collection-browser.ts +0 -1
- package/src/collection-facets/facet-row.ts +1 -2
- package/src/collection-facets/models.ts +10 -0
- package/src/collection-facets/more-facets-content.ts +636 -632
- package/src/collection-facets.ts +0 -1
- package/src/sort-filter-bar/sort-filter-bar.ts +1 -1
- package/src/tiles/grid/collection-tile.ts +2 -3
- package/src/tiles/grid/item-tile.ts +2 -2
- package/src/tiles/grid/search-tile.ts +2 -3
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +1 -2
- package/src/tiles/list/tile-list.ts +3 -11
- package/test/tiles/list/tile-list.test.ts +0 -15
- package/tsconfig.json +20 -20
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
package/src/collection-facets.ts
CHANGED
|
@@ -1256,7 +1256,7 @@ export class SortFilterBar
|
|
|
1256
1256
|
--dropdownSelectedBgColor: rgba(255, 255, 255, 0.3);
|
|
1257
1257
|
--dropdownHoverBgColor: rgba(255, 255, 255, 0.3);
|
|
1258
1258
|
--caretHeight: 9px;
|
|
1259
|
-
--caretWidth:
|
|
1259
|
+
--caretWidth: 12px;
|
|
1260
1260
|
--caretPadding: 0 5px 0 0;
|
|
1261
1261
|
}
|
|
1262
1262
|
ia-dropdown.selected .dropdown-label {
|
|
@@ -55,7 +55,7 @@ export class CollectionTile extends BaseTileComponent {
|
|
|
55
55
|
|
|
56
56
|
private get getTitleTemplate() {
|
|
57
57
|
return html`<div id="title">
|
|
58
|
-
<
|
|
58
|
+
<h4 class="truncated">${this.model?.title}</h4>
|
|
59
59
|
</div>`;
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -123,8 +123,7 @@ export class CollectionTile extends BaseTileComponent {
|
|
|
123
123
|
flex-grow: initial;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
h4.truncated
|
|
127
|
-
h3.truncated {
|
|
126
|
+
h4.truncated {
|
|
128
127
|
color: ${whiteColor};
|
|
129
128
|
}
|
|
130
129
|
|
|
@@ -60,9 +60,9 @@ export class ItemTile extends BaseTileComponent {
|
|
|
60
60
|
${this.imageBlockTemplate}
|
|
61
61
|
|
|
62
62
|
<div id="title">
|
|
63
|
-
<
|
|
63
|
+
<h4 class="truncated" title=${ifDefined(itemTitle)}>
|
|
64
64
|
${itemTitle}
|
|
65
|
-
</
|
|
65
|
+
</h4>
|
|
66
66
|
</div>
|
|
67
67
|
|
|
68
68
|
${this.volumeIssueTemplate}
|
|
@@ -49,7 +49,7 @@ export class SearchTile extends BaseTileComponent {
|
|
|
49
49
|
|
|
50
50
|
private get getTitleTemplate() {
|
|
51
51
|
return html`<div id="title">
|
|
52
|
-
<
|
|
52
|
+
<h4 class="truncated">${this.model?.title}</h4>
|
|
53
53
|
</div>`;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -70,8 +70,7 @@ export class SearchTile extends BaseTileComponent {
|
|
|
70
70
|
flex-grow: initial;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
h4.truncated
|
|
74
|
-
h3.truncated {
|
|
73
|
+
h4.truncated {
|
|
75
74
|
color: ${whiteColor};
|
|
76
75
|
-webkit-line-clamp: 4;
|
|
77
76
|
}
|
|
@@ -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
|
|
7
|
+
import { msg } from '@lit/localize';
|
|
8
8
|
import DOMPurify from 'dompurify';
|
|
9
9
|
|
|
10
10
|
import type { SortParam } from '@internetarchive/search-service';
|
|
@@ -94,11 +94,7 @@ export class TileList extends BaseTileComponent {
|
|
|
94
94
|
isCollection,
|
|
95
95
|
);
|
|
96
96
|
|
|
97
|
-
return html`<a
|
|
98
|
-
id="image-link"
|
|
99
|
-
title=${msg(str`View ${this.model?.title}`)}
|
|
100
|
-
href=${href}
|
|
101
|
-
>
|
|
97
|
+
return html`<a href=${href}>
|
|
102
98
|
<image-block
|
|
103
99
|
.model=${this.model}
|
|
104
100
|
.baseImageUrl=${this.baseImageUrl}
|
|
@@ -131,11 +127,7 @@ export class TileList extends BaseTileComponent {
|
|
|
131
127
|
// Data templates
|
|
132
128
|
private get iconRightTemplate() {
|
|
133
129
|
return html`
|
|
134
|
-
<a
|
|
135
|
-
id="icon-right"
|
|
136
|
-
href=${this.mediatypeURL}
|
|
137
|
-
title=${msg(str`See more: ${this.model?.mediatype}`)}
|
|
138
|
-
>
|
|
130
|
+
<a id="icon-right" href=${this.mediatypeURL}>
|
|
139
131
|
<tile-mediatype-icon .model=${this.model}> </tile-mediatype-icon>
|
|
140
132
|
</a>
|
|
141
133
|
`;
|
|
@@ -49,20 +49,6 @@ 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
|
-
|
|
66
52
|
it('should render with creator element but not dates', async () => {
|
|
67
53
|
const el = await fixture<TileList>(html`
|
|
68
54
|
<tile-list .model=${{ creators: ['someone'] }}></tile-list>
|
|
@@ -338,7 +324,6 @@ describe('List Tile', () => {
|
|
|
338
324
|
expect(mediatypeLink?.getAttribute('href')).to.equal(
|
|
339
325
|
`https://archive.org/details/texts`,
|
|
340
326
|
);
|
|
341
|
-
expect(mediatypeLink?.getAttribute('title')).to.equal('See more: texts');
|
|
342
327
|
});
|
|
343
328
|
|
|
344
329
|
it('should render mediatype icon as link even with empty baseNavigationUrl', async () => {
|
package/tsconfig.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2018",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"noEmitOnError": true,
|
|
7
|
-
"lib": ["es2017", "dom", "dom.iterable"],
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": false,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"experimentalDecorators": true,
|
|
12
|
-
"importHelpers": true,
|
|
13
|
-
"outDir": "dist",
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"inlineSources": true,
|
|
16
|
-
"rootDir": "./",
|
|
17
|
-
"declaration": true,
|
|
18
|
-
},
|
|
19
|
-
"include": ["src", "test", "index.ts", "types"],
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2018",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"noEmitOnError": true,
|
|
7
|
+
"lib": ["es2017", "dom", "dom.iterable"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": false,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"inlineSources": true,
|
|
16
|
+
"rootDir": "./",
|
|
17
|
+
"declaration": true,
|
|
18
|
+
},
|
|
19
|
+
"include": ["src", "test", "index.ts", "types"],
|
|
20
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
-
|
|
3
|
-
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
-
const hmr = process.argv.includes('--hmr');
|
|
5
|
-
|
|
6
|
-
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
-
nodeResolve: true,
|
|
8
|
-
open: '/',
|
|
9
|
-
watch: !hmr,
|
|
10
|
-
|
|
11
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
12
|
-
// esbuildTarget: 'auto'
|
|
13
|
-
|
|
14
|
-
/** Set appIndex to enable SPA routing */
|
|
15
|
-
// appIndex: 'demo/index.html',
|
|
16
|
-
|
|
17
|
-
/** Confgure bare import resolve plugin */
|
|
18
|
-
// nodeResolve: {
|
|
19
|
-
// exportConditions: ['browser', 'development']
|
|
20
|
-
// },
|
|
21
|
-
|
|
22
|
-
plugins: [
|
|
23
|
-
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
24
|
-
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
25
|
-
],
|
|
26
|
-
|
|
27
|
-
http2: true,
|
|
28
|
-
sslCert: './local.archive.org.cert',
|
|
29
|
-
sslKey: './local.archive.org.key',
|
|
30
|
-
});
|
|
1
|
+
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
+
|
|
3
|
+
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
+
const hmr = process.argv.includes('--hmr');
|
|
5
|
+
|
|
6
|
+
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
+
nodeResolve: true,
|
|
8
|
+
open: '/',
|
|
9
|
+
watch: !hmr,
|
|
10
|
+
|
|
11
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
12
|
+
// esbuildTarget: 'auto'
|
|
13
|
+
|
|
14
|
+
/** Set appIndex to enable SPA routing */
|
|
15
|
+
// appIndex: 'demo/index.html',
|
|
16
|
+
|
|
17
|
+
/** Confgure bare import resolve plugin */
|
|
18
|
+
// nodeResolve: {
|
|
19
|
+
// exportConditions: ['browser', 'development']
|
|
20
|
+
// },
|
|
21
|
+
|
|
22
|
+
plugins: [
|
|
23
|
+
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
24
|
+
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
http2: true,
|
|
28
|
+
sslCert: './local.archive.org.cert',
|
|
29
|
+
sslKey: './local.archive.org.key',
|
|
30
|
+
});
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
|
-
|
|
3
|
-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
-
|
|
5
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
-
/** Test files to run */
|
|
7
|
-
files: 'dist/test/**/*.test.js',
|
|
8
|
-
|
|
9
|
-
/** Resolve bare module imports */
|
|
10
|
-
nodeResolve: {
|
|
11
|
-
exportConditions: ['browser', 'development'],
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
/** Filter out lit dev mode logs */
|
|
15
|
-
filterBrowserLogs(log) {
|
|
16
|
-
for (const arg of log.args) {
|
|
17
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
25
|
-
// esbuildTarget: 'auto',
|
|
26
|
-
|
|
27
|
-
/** Amount of browsers to run concurrently */
|
|
28
|
-
// concurrentBrowsers: 2,
|
|
29
|
-
|
|
30
|
-
/** Amount of test files per browser to test concurrently */
|
|
31
|
-
// concurrency: 1,
|
|
32
|
-
|
|
33
|
-
/** Browsers to run tests on */
|
|
34
|
-
// browsers: [
|
|
35
|
-
// playwrightLauncher({ product: 'chromium' }),
|
|
36
|
-
// playwrightLauncher({ product: 'firefox' }),
|
|
37
|
-
// playwrightLauncher({ product: 'webkit' }),
|
|
38
|
-
// ],
|
|
39
|
-
|
|
40
|
-
// See documentation for all available options
|
|
41
|
-
});
|
|
1
|
+
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
|
+
|
|
3
|
+
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
+
|
|
5
|
+
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
+
/** Test files to run */
|
|
7
|
+
files: 'dist/test/**/*.test.js',
|
|
8
|
+
|
|
9
|
+
/** Resolve bare module imports */
|
|
10
|
+
nodeResolve: {
|
|
11
|
+
exportConditions: ['browser', 'development'],
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
/** Filter out lit dev mode logs */
|
|
15
|
+
filterBrowserLogs(log) {
|
|
16
|
+
for (const arg of log.args) {
|
|
17
|
+
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
25
|
+
// esbuildTarget: 'auto',
|
|
26
|
+
|
|
27
|
+
/** Amount of browsers to run concurrently */
|
|
28
|
+
// concurrentBrowsers: 2,
|
|
29
|
+
|
|
30
|
+
/** Amount of test files per browser to test concurrently */
|
|
31
|
+
// concurrency: 1,
|
|
32
|
+
|
|
33
|
+
/** Browsers to run tests on */
|
|
34
|
+
// browsers: [
|
|
35
|
+
// playwrightLauncher({ product: 'chromium' }),
|
|
36
|
+
// playwrightLauncher({ product: 'firefox' }),
|
|
37
|
+
// playwrightLauncher({ product: 'webkit' }),
|
|
38
|
+
// ],
|
|
39
|
+
|
|
40
|
+
// See documentation for all available options
|
|
41
|
+
});
|