@internetarchive/collection-browser 3.0.5 → 3.0.7-alpha-webdev7989.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 +4 -4
- package/.prettierignore +1 -1
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/src/collection-browser.d.ts +5 -0
- package/dist/src/collection-browser.js +9 -0
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +144 -132
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js +1 -0
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +1 -0
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +47 -24
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/collection-facets.test.js +21 -22
- package/dist/test/collection-facets.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 +12 -0
- package/src/collection-facets/facet-row.ts +296 -283
- package/src/data-source/collection-browser-data-source.ts +1 -0
- package/src/data-source/collection-browser-query-state.ts +1 -0
- package/test/collection-facets/facet-row.test.ts +375 -342
- package/test/collection-facets.test.ts +928 -932
- package/tsconfig.json +20 -20
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
package/README.md
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
 [](https://codecov.io/gh/internetarchive/iaux-collection-browser)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# Internet Archive Collection Browser
|
|
5
|
-
|
|
6
|
-
This is the main collection browser for the Internet Archive website.
|
|
7
|
-
|
|
8
|
-
[Review app URL](https://internetarchive.github.io/iaux-collection-browser/main)
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
```ts
|
|
12
|
-
import '@internetarchive/collection-browser';
|
|
13
|
-
|
|
14
|
-
<collection-browser>
|
|
15
|
-
</collection-browser>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Local Demo with `web-dev-server`
|
|
19
|
-
```bash
|
|
20
|
-
yarn install
|
|
21
|
-
yarn start
|
|
22
|
-
```
|
|
23
|
-
To run a local development server that serves the basic demo located in `index.html`
|
|
24
|
-
|
|
25
|
-
## Testing with Web Test Runner
|
|
26
|
-
To run the suite of Web Test Runner tests, run
|
|
27
|
-
```bash
|
|
28
|
-
yarn run test
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
To run the tests in watch mode (for <abbr title="test driven development">TDD</abbr>, for example), run
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
yarn run test:watch
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Linting with ESLint, Prettier, and Types
|
|
38
|
-
To scan the project for linting errors, run
|
|
39
|
-
```bash
|
|
40
|
-
yarn run lint
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
You can lint with ESLint and Prettier individually as well
|
|
44
|
-
```bash
|
|
45
|
-
yarn run lint:eslint
|
|
46
|
-
```
|
|
47
|
-
```bash
|
|
48
|
-
yarn run lint:prettier
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
To automatically fix many linting errors, run
|
|
52
|
-
```bash
|
|
53
|
-
yarn run format
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
You can format using ESLint and Prettier individually as well
|
|
57
|
-
```bash
|
|
58
|
-
yarn run format:eslint
|
|
59
|
-
```
|
|
60
|
-
```bash
|
|
61
|
-
yarn run format:prettier
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Tooling configs
|
|
65
|
-
|
|
66
|
-
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
67
|
-
|
|
68
|
-
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
69
|
-
|
|
70
|
-
## Manual Deploy using `gh-pages`
|
|
71
|
-
|
|
72
|
-
Live demo app from current main branch: [https://internetarchive.github.io/iaux-collection-browser](https://internetarchive.github.io/iaux-collection-browser)
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
yarn run deploy
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Automatic Deploy of Demo App
|
|
79
|
-
|
|
80
|
-
When you create a Pull Request, if your code passes codecov unit tests, it will be always served live at base url / pull request number. For this demo app, you must create a Pull Request, nothing will be created from a simple branch.
|
|
81
|
-
|
|
82
|
-
This URL will be removed when the Pull Request is merged/closed.
|
|
83
|
-
|
|
1
|
+
 [](https://codecov.io/gh/internetarchive/iaux-collection-browser)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# Internet Archive Collection Browser
|
|
5
|
+
|
|
6
|
+
This is the main collection browser for the Internet Archive website.
|
|
7
|
+
|
|
8
|
+
[Review app URL](https://internetarchive.github.io/iaux-collection-browser/main)
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import '@internetarchive/collection-browser';
|
|
13
|
+
|
|
14
|
+
<collection-browser>
|
|
15
|
+
</collection-browser>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Local Demo with `web-dev-server`
|
|
19
|
+
```bash
|
|
20
|
+
yarn install
|
|
21
|
+
yarn start
|
|
22
|
+
```
|
|
23
|
+
To run a local development server that serves the basic demo located in `index.html`
|
|
24
|
+
|
|
25
|
+
## Testing with Web Test Runner
|
|
26
|
+
To run the suite of Web Test Runner tests, run
|
|
27
|
+
```bash
|
|
28
|
+
yarn run test
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
To run the tests in watch mode (for <abbr title="test driven development">TDD</abbr>, for example), run
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn run test:watch
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Linting with ESLint, Prettier, and Types
|
|
38
|
+
To scan the project for linting errors, run
|
|
39
|
+
```bash
|
|
40
|
+
yarn run lint
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
You can lint with ESLint and Prettier individually as well
|
|
44
|
+
```bash
|
|
45
|
+
yarn run lint:eslint
|
|
46
|
+
```
|
|
47
|
+
```bash
|
|
48
|
+
yarn run lint:prettier
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
To automatically fix many linting errors, run
|
|
52
|
+
```bash
|
|
53
|
+
yarn run format
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
You can format using ESLint and Prettier individually as well
|
|
57
|
+
```bash
|
|
58
|
+
yarn run format:eslint
|
|
59
|
+
```
|
|
60
|
+
```bash
|
|
61
|
+
yarn run format:prettier
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Tooling configs
|
|
65
|
+
|
|
66
|
+
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
67
|
+
|
|
68
|
+
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
69
|
+
|
|
70
|
+
## Manual Deploy using `gh-pages`
|
|
71
|
+
|
|
72
|
+
Live demo app from current main branch: [https://internetarchive.github.io/iaux-collection-browser](https://internetarchive.github.io/iaux-collection-browser)
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
yarn run deploy
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Automatic Deploy of Demo App
|
|
79
|
+
|
|
80
|
+
When you create a Pull Request, if your code passes codecov unit tests, it will be always served live at base url / pull request number. For this demo app, you must create a Pull Request, nothing will be created from a simple branch.
|
|
81
|
+
|
|
82
|
+
This URL will be removed when the Pull Request is merged/closed.
|
|
83
|
+
|
|
84
84
|
Example: `https://internetarchive.github.io/iaux-collection-browser/pr/<pr-number>`
|
|
@@ -554,6 +554,11 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
554
554
|
* been toggled open or closed.
|
|
555
555
|
*/
|
|
556
556
|
private emitFacetPaneVisibilityChanged;
|
|
557
|
+
/**
|
|
558
|
+
* Emits a `searchError` event indicating that the most recent search has encountered
|
|
559
|
+
* an error from the backend.
|
|
560
|
+
*/
|
|
561
|
+
emitSearchError(): void;
|
|
557
562
|
/**
|
|
558
563
|
* Emits a `queryStateChanged` event indicating that one or more of this component's
|
|
559
564
|
* properties have changed in a way that could affect the set of search results.
|
|
@@ -1453,6 +1453,15 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1453
1453
|
detail: this.facetPaneVisible,
|
|
1454
1454
|
}));
|
|
1455
1455
|
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Emits a `searchError` event indicating that the most recent search has encountered
|
|
1458
|
+
* an error from the backend.
|
|
1459
|
+
*/
|
|
1460
|
+
emitSearchError() {
|
|
1461
|
+
this.dispatchEvent(new CustomEvent('searchError', {
|
|
1462
|
+
detail: this.dataSource.queryErrorMessage
|
|
1463
|
+
}));
|
|
1464
|
+
}
|
|
1456
1465
|
/**
|
|
1457
1466
|
* Emits a `queryStateChanged` event indicating that one or more of this component's
|
|
1458
1467
|
* properties have changed in a way that could affect the set of search results.
|